pjs/calendar/install.js

54 строки
1.7 KiB
JavaScript
Исходник Обычный вид История

2003-01-14 00:53:58 +03:00
initInstall("Mozilla Calendar", "Mozilla/Calendar", "0.8");
2001-12-20 23:13:53 +03:00
calendarDir = getFolder("Chrome","calendar");
setPackageFolder(calendarDir);
addDirectory( "resources" );
2001-12-20 23:13:53 +03:00
addDirectory("", "components", getFolder( "Components" ), "" );
2003-01-14 00:53:58 +03:00
addDirectory( "", "", "icons", getFolder( "Chrome", "icons" ), "", true );
2002-03-05 17:03:26 +03:00
var err = getLastError();
2001-12-20 23:13:53 +03:00
if ( err == SUCCESS ) {
2002-03-05 17:03:26 +03:00
var calendarContent = getFolder(calendarDir, "content");
var calendarSkin = getFolder(calendarDir, "skin");
var calendarLocale = getFolder(calendarDir, "locale");
2001-12-20 23:13:53 +03:00
2002-03-05 17:03:26 +03:00
var returnval = registerChrome(CONTENT | DELAYED_CHROME, calendarContent );
var returnval = registerChrome(SKIN | DELAYED_CHROME, calendarSkin, "modern/");
2002-04-05 18:27:07 +04:00
var returnval = registerChrome(SKIN | DELAYED_CHROME, calendarSkin, "classic/");
2002-03-05 17:03:26 +03:00
var returnval = registerChrome(LOCALE | DELAYED_CHROME, calendarLocale, "en-US/");
err = performInstall();
2001-12-20 23:13:53 +03:00
if ( err == SUCCESS ) {
alert("The Mozilla Calendar has been succesfully installed. \n"
2001-12-20 23:13:53 +03:00
+"Please restart your browser to continue.");
}
2002-03-05 17:03:26 +03:00
else if( err == "999" )
{
alert("The Mozilla Calendar has been installed. \n Please restart your browser to continue.");
2002-03-05 17:03:26 +03:00
}
else {
2001-12-20 23:13:53 +03:00
alert("performInstall() failed. \n"
+"_____________________________\nError code:" + err);
cancelInstall(err);
}
2001-12-20 23:13:53 +03:00
}
else {
alert("Failed to create directory. \n"
2001-12-20 23:13:53 +03:00
+"You probably don't have appropriate permissions \n"
+"(write access to mozilla/chrome directory). \n"
+"If you installed Mozilla as root then you need to install calendar as root as well.\n"
+"Or, you can change ownership of your Mozilla directory to yourself and install calendar."
2001-12-20 23:13:53 +03:00
+"_____________________________\nError code:" + err);
cancelInstall(err);
}