1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00
dolibarr_ynh/sources/dolibarr/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js
Laurent Peuch e6008fc691 init
2015-09-28 22:09:38 +02:00

64 lines
1.2 KiB
JavaScript

function last(href)
{
var ret = href.split("/");
return ret[ret.length-1];
}
function StopProcess()
{
LeftFrame = parent.TOC.document.location.href;
LeftFrame = last(LeftFrame);
if (LeftFrame == "dhtml_search.htm") return 1
else return 0;
}
function highlightTOC(str) {
if (StopProcess()) return;
try {
str = str || parent.BODY.document.location.href;
uri = last(str);
list = parent.TOC.document.getElementsByTagName("a");
for(i=0; i<list.length; i++)
{
if (last(list[i].href) == uri)
{
list[i].style.backgroundColor = "#6697cc";
list[i].style.padding = "2px";
list[i].style.color = "#ffffff";
} else {
list[i].style.backgroundColor = "#ffffff";
list[i].style.color = "#003380";
}
}
} catch (e) {}
}
function FindCorrectTOCPage()
{
if (StopProcess()) return;
//Updated on 30.04.2008
list = parent.BODY.document.getElementsByTagName("a") || document.getElementsByTagName("a");
for(i=0; i<list.length; i++)
{
if (list[i].target == "TOC")
{
if (last(list[i].href) != last(parent.TOC.document.location.href))
{
parent.TOC.document.location.href = list[i].href;
return;
}
}
}
}