home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 December
/
PCWorld_2006-12_cd.bin
/
komunikace
/
netscape
/
nsb-install-8-1-2.exe
/
chrome
/
help.jar
/
content
/
help
/
contextHelp.js
< prev
next >
Wrap
Text File
|
2006-01-06
|
1KB
|
48 lines
const MOZILLA_CONTENT_PACK = "chrome://help/locale/firebirdhelp.rdf";
var helpFileURI = MOZILLA_CONTENT_PACK;
function openHelp(topic, contentPack)
{
helpFileURI = contentPack || helpFileURI;
var topWindow = locateHelpWindow(helpFileURI);
if ( topWindow ) {
topWindow.focus();
topWindow.displayTopic(topic);
} else {
const params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"]
.createInstance(Components.interfaces.nsIDialogParamBlock);
params.SetNumberStrings(2);
params.SetString(0, helpFileURI);
params.SetString(1, topic);
const ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
ww.openWindow(null, "chrome://help/content/help.xul", "_blank", "chrome,all,alwaysRaised,dialog=no", params);
}
}
function setHelpFileURI(rdfURI)
{
helpFileURI = rdfURI;
}
function locateHelpWindow(contentPack) {
const windowManagerInterface = Components
.classes['@mozilla.org/appshell/window-mediator;1'].getService()
.QueryInterface(Components.interfaces.nsIWindowMediator);
const iterator = windowManagerInterface.getEnumerator("mozilla:help");
var topWindow = null;
var aWindow;
while (iterator.hasMoreElements()) {
aWindow = iterator.getNext();
if (aWindow.getHelpFileURI() == contentPack) {
topWindow = aWindow;
}
}
return topWindow;
}