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
/
browser.jar
/
content
/
browser
/
askUserAboutJar.js
< prev
next >
Wrap
Text File
|
2006-01-06
|
1KB
|
53 lines
var dialog;
function onLoad()
{
dialog = new Object;
dialog.whatToDo = document.getElementById("jar_whatToDo");
dialog.jarOpenTheme = document.getElementById("jar_openTheme");
dialog.jarDownload = document.getElementById("jar_download");
dialog.jarTrident = document.getElementById("jar_trident");
}
function getTopWin()
{
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
if (topWindowOfType) {
return topWindowOfType;
}
return null;
}
function onAccept()
{
var args = window.arguments[0];
// Check which option they selected.
switch (dialog.whatToDo.selectedItem)
{
case dialog.jarOpenTheme:
// Install the theme using the InstallTriger (from extensions.js)
InstallTrigger.installChrome(InstallTrigger.SKIN, args.jarUrl, args.jarUrl);
args.handled = 0;
break;
case dialog.jarDownload:
// download the file
args.handled = 1;
break;
case dialog.jarTrident:
// pass back to trident
args.handled = 2;
break;
}
}
function onCancel()
{
// Canceled so pretend we have handled it
var args = window.arguments[0];
args.handled = 0;
}