whatnowmax / notes_xml_translate

// ==UserScript==
// @name notes_xml_translate
// @description translate notes to xml
// @version 1.0
// @author whatnowmax
// @license MIT
// @match https://crm.stagrp.com/index.php?action=DetailView&module=Cases&record=*
// @match https://crm.stagrp.com/index.php?module=Cases*

// @run-at document-end
// @grant none
// ==/UserScript==

        replaceCaseUpdateFirst("caseUpdate");


function replaceCaseUpdateFirst(_field) {
    var _caseUPs = document.getElementsByClassName(_field);
    console.log("replacing URI syntax(?) with xml " + _caseUPs.id);

    //for each case update
    for (var i = 0; i < _caseUPs.length; i++){
        var _LT = '%26lt;';
        var _GT = '%26gt;';

        _caseUPs[i].innerText = _caseUPs[i].innerText.replaceAll(_LT,"<");
        _caseUPs[i].innerText = _caseUPs[i].innerText.replaceAll(_GT,">");
    }
}