NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name BlueCat Address Manager Restore Button // @description Additional Restore Button in Transaction Details in BlueCat Address Manager // @namespace * // @include */app*page=UndeleteListPage* // @version 7 // @grant none // @author Marius Galm // @copyright 2018, Marius Galm // @license MIT // @icon https://www.bluecatnetworks.com/wp-content/uploads/2018/03/cropped-bluecat-favicon-32x32.png // ==/UserScript== if (document.readyState === "interactive" ) { var page = document.childNodes[2].nodeValue; switch(page) { case " Page: HistoryDetails ": addButton(); break; default: // nothing for now } } function addButton() { var pane = document.getElementsByClassName("detailsPane"); if ((pane !== undefined)||(pane != null)) { var tds = pane[0].getElementsByClassName("detailsPane-fieldName"); if ((tds !== undefined)||(tds != null)) { var tdList = Array.prototype.slice.call(tds); tdList.forEach(function(element) { if (element.innerText.trim() == "Transaction Number:") { var num = parseInt(element.id.split("_")[1])+1; var idVar = document.getElementById("Any_"+num).innerHTML.trim(); document.getElementById("Any_"+num).innerHTML = idVar+'<p><a id="undeleteLink" name="undelete_hist_History:'+idVar+':0" href="/app?component=undeleteLink&page=UndeleteListPage&service=direct&session=T&sp=SformMode%3Dedit&sp=StableClass%3Dcom.bluecatnetworks.proteus.data.History&sp=StablePageName%3DUndeleteListPage&sp=StableId%3DuserUndeleteList&sp=Spage%3DUndeleteListPage&sp=SextraOptionalValue%3DundeleteType%7Cnull%3BpageBeforeList%7Cnull&sp=Suserspecific%3Dtrue&sp=ShistoryId%3DHistory%3A'+idVar+'%3A0"><img src="/images/icons/small/undelete.gif" border="0"></a></p>'; } }); } } }