PortaleOrdiniGruppo/PostIn/postin_help.js
2025-03-24 15:28:26 +01:00

67 lines
1.9 KiB
JavaScript

var m_cHelpUrl=null;
(function() {
function LoadHelp() {
var jsToLoad = "help/postin/postin_dictionary.js";
var urlToFind = "help/postin/images/spr_urg/spr_fronte.jpg";
var urls = ['https://www.zucchettitools.com/build61.7/','https://www.zucchettitools.com/build61/', '../'];
var i = 0;
var img = document.createElement('img');
img.style.visibility='hidden';
img.style.top='0px';
img.style.left='0px';
img.style.width='1px';
img.style.height='1px';
document.body.appendChild(img);
img.onload = function() {
//file trovato, ricerca conclusa
m_cHelpUrl = urls[i];
document.body.removeChild(img);
EndWhile();
};
img.onerror = function() {
//file non trovato, continuo la ricerca
i++;
WhileBody();
};
function WhileBody() {
if (urls[i]) {
img.src = urls[i] + urlToFind;
} else {
m_cHelpUrl = '../';
document.body.removeChild(img);
EndWhile();
}
}
WhileBody();
function EndWhile() {
if (m_cHelpUrl!=null) {
var fileref=document.createElement('script');
fileref.setAttribute("src",m_cHelpUrl+jsToLoad);
document.getElementsByTagName("head")[0].appendChild(fileref);
}
}
}
if (document.readyState=='complete') {
LoadHelp();
} else {
LibJavascript.Events.addEvent(document,'readystatechange',function(){
if (document.readyState=='complete') {
LoadHelp();
}
});
}
})();
function Help(ctrlname) {
var anchor="";
if(typeof(anchorToFeature)!='undefined'){
if(typeof(ctrlname)!='undefined'){
anchor=anchorToFeature[ctrlname];
}
else if(typeof(m_cProgName)!='undefined'){
anchor=anchorToFeature[m_cProgName]||anchorToFeature[m_cProgName.replace(/_/g, "")];
}
}
window.open((m_cHelpUrl||'../')+'help/postin/postin_navigator.htm?'+anchor,'','toolbar=0,menubar=0,directories=0,width=800,height=600,resizable=1');
}