Home Analyst Portal

Name change from "Save" button

Nico_RedepenningNico_Redepenning Customer IT Monkey ✭
Hi. How can i change the name of the Button "Save" permanently in CSS or .js.
When i change it in the Localizations, the rename is gone after an update. Thanks. :-)

Best Answers

Answers

  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭
    edited June 2019
    Hi @Nico_Redepenning

    Try this Javascript out and let me know if this is what you are after!

    $(document).ready(function () {
    var mainPageNode = document.getElementById('main_wrapper');
    var observer = new MutationObserver(function(mutations) {
    var saveElement = document.getElementsByClassName('btn btn-link btn-lg')[0].getElementsByTagName('div')[0]

    if (saveElement.innerHTML == "Save") { //Check Save box exists
    saveElement.innerHTML = 'New Text'
    observer.disconnect();
    }
    });

    // configure the observer and start the instance.
    var observerConfig = {attributes: true, childList: true, subtree: true, characterData: true };
    observer.observe(mainPageNode, observerConfig);
    });

    Also, if you wanted to change the color of the tick box you could add this to your .css file:

    .fa-check:before {
    color: lawngreen;
    }

    Thanks,
    Shane.
  • Nico_RedepenningNico_Redepenning Customer IT Monkey ✭
    Hi @Shane_White
    i put it in the custom.js but the name is the same. 
  • Nico_RedepenningNico_Redepenning Customer IT Monkey ✭
    Sorry but i forget to press Ctrl+F5. I only press F5. Now it works. Thanks.
  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭
    @Nico_Redepenning

    Made a quick edit to the above code as I only put 1 = instead of 2!

    This means it shouldn't just randomly change things :smile:

    Thanks,
    Shane.
  • Nico_RedepenningNico_Redepenning Customer IT Monkey ✭
    @Shane_White
    Can this also be used for Service Request? 
  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭
    @Nico_Redepenning

    Yes this is for all workitems!

    Thanks,
    Shane.
  • Nico_RedepenningNico_Redepenning Customer IT Monkey ✭

    I mean when i open a Service Request. View Screenshot.


  • Gerhard_GoossensGerhard_Goossens Customer Advanced IT Monkey ✭✭✭
    edited July 2019


  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭

    Hi @Nico_Redepenning

    I just made an improvement to this customisation if you would like to try it out, less code and more efficient!

    $(document).on('ajaxStop', function () {

    var buttons = $('.btn.btn-link.btn-lg')

    var buttonDivs = buttons.find("div")

    buttonDivs.each(changeName);


    function changeName() {

    if (this.innerHTML == "Save") { //Check Save box exists

    this.innerHTML = 'Save Ticket'

    }

    if (this.innerHTML == "Apply") {


    this.innerHTML = "Apply Changes"

    }

    };

    });

    Let me know what you think!

    Thanks,

    Shane

Sign In or Register to comment.