-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBlueCat Address Manager Restore Button.user.js
40 lines (38 loc) · 1.96 KB
/
BlueCat Address Manager Restore Button.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ==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>';
}
});
}
}
}