diff -Naur chatzilla-239243fd40b4/jar.mn chatzilla/jar.mn --- chatzilla-239243fd40b4/jar.mn 2010-06-23 15:57:41.000000000 +0100 +++ chatzilla/jar.mn 2010-06-26 15:29:09.000000000 +0100 @@ -13,6 +13,7 @@ % style chrome://global/content/customizeToolbar.xul chrome://chatzilla/skin/browserOverlay.css * content/chatzilla/contents.rdf (xul/content/contents.rdf) skin/modern/chatzilla/contents.rdf (xul/skin/contents.rdf) + content/chatzilla/xr/overlay.xul (xul/content/xr/overlay.xul) content/chatzilla/lib/js/utils.js (js/lib/utils.js) content/chatzilla/lib/js/events.js (js/lib/events.js) content/chatzilla/lib/js/connection-xpcom.js (js/lib/connection-xpcom.js) diff -Naur chatzilla-239243fd40b4/locales/en-US/chrome/chatzilla.properties chatzilla/locales/en-US/chrome/chatzilla.properties --- chatzilla-239243fd40b4/locales/en-US/chrome/chatzilla.properties 2010-06-23 15:57:41.000000000 +0100 +++ chatzilla/locales/en-US/chrome/chatzilla.properties 2010-06-26 15:30:48.000000000 +0100 @@ -115,6 +115,20 @@ # ### End of notes ### +cmd.extension-manager.label = Extensions +cmd.extension-manager.help = +cmd.theme-manager.label = Themes +cmd.theme-manager.help = +cmd.add-ons.params = [<type>] +cmd.add-ons.label = Add-ons +cmd.add-ons.help = +cmd.jsconsole.label = JavaScript Console +cmd.jsconsole.help = +cmd.about-config.label = Advanced Configuration +cmd.about-config.help = +cmd.update.label = Update... +cmd.update.help = + cmd.about.label = About ChatZilla cmd.about.help = Display information about this version of ChatZilla. @@ -943,7 +957,7 @@ msg.default.alias.help = This command is an alias for |%1$S|. msg.extra.params = Extra parameters ``%1$S'' ignored. msg.version.reply = ChatZilla %S [%S] -msg.source.reply = http://chatzilla.hacksrus.com/ +msg.source.reply = http://chatzilla.rdmsoft.com/xulrunner/ msg.nothing.to.cancel = No connection or /list in progress, nothing to cancel. msg.cancelling = Cancelling connection to ``%S''… msg.cancelling.list = Cancelling /list request… diff -Naur chatzilla-239243fd40b4/xpi/resources/application.ini chatzilla/xpi/resources/application.ini --- chatzilla-239243fd40b4/xpi/resources/application.ini 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/application.ini 2010-06-26 15:31:41.000000000 +0100 @@ -0,0 +1,12 @@ +[App] +Name=ChatZilla +Version=@REVISION@ +BuildID=@BUILDID@ +ID={59c81df5-4b7a-477b-912d-4e0fdf64e5f2} + +[Gecko] +MinVersion=1.8 +MaxVersion=1.9.* + +[XRE] +EnableExtensionManager=Try it, see if I care. diff -Naur chatzilla-239243fd40b4/xpi/resources/brand.dtd chatzilla/xpi/resources/brand.dtd --- chatzilla-239243fd40b4/xpi/resources/brand.dtd 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/brand.dtd 2010-06-26 15:32:07.000000000 +0100 @@ -0,0 +1,4 @@ +<!ENTITY brandShortName "ChatZilla"> +<!ENTITY brandFullName "ChatZilla @REVISION@"> +<!ENTITY vendorShortName ""> +<!ENTITY releaseURL "http://www.hacksrus.com/~ginda/chatzilla/"> diff -Naur chatzilla-239243fd40b4/xpi/resources/brand.properties chatzilla/xpi/resources/brand.properties --- chatzilla-239243fd40b4/xpi/resources/brand.properties 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/brand.properties 2010-06-26 15:32:34.000000000 +0100 @@ -0,0 +1,3 @@ +brandShortName=ChatZilla +brandFullName=ChatZilla @REVISION@ +vendorShortName= diff -Naur chatzilla-239243fd40b4/xpi/resources/chatzilla-prefs.xr.js chatzilla/xpi/resources/chatzilla-prefs.xr.js --- chatzilla-239243fd40b4/xpi/resources/chatzilla-prefs.xr.js 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/chatzilla-prefs.xr.js 2010-06-26 15:33:29.000000000 +0100 @@ -0,0 +1,34 @@ +// ChatZilla for XULRunner +// Default Prefs + +// This is needed to start ChatZilla. +pref("toolkit.defaultChromeURI", "chrome://chatzilla/content/chatzilla.xul"); + +// Enable the extension manager... +pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul"); +pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes"); +pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions"); +pref("xpinstall.dialog.progress.type.skin", "Extension:Manager-themes"); +pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager-extensions"); +pref("extensions.update.enabled", true); +pref("extensions.update.interval", 86400); +pref("extensions.dss.enabled", false); +pref("extensions.dss.switchPending", false); +pref("extensions.ignoreMTimeChanges", false); +pref("extensions.logging.enabled", false); +pref("general.skins.selectedSkin", "classic/1.0"); +pref("extensions.checkUpdateSecurity", false); + +// This means nothing because a.m.o doesn't host ChatZilla extensions, +// but I have to put something or the extension manager pukes. +pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties"); +pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties"); +pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties"); + +// make the external protocol service happy +pref("network.protocol-handler.expose-all", false); +pref("network.protocol-handler.expose.irc", true); +pref("network.protocol-handler.expose.ircs", true); +pref("security.dialog_enable_delay", 0); + +pref("general.useragent.extra.chatzilla", "ChatZilla/@REVISION@"); diff -Naur chatzilla-239243fd40b4/xpi/resources/chrome.xr.manifest chatzilla/xpi/resources/chrome.xr.manifest --- chatzilla-239243fd40b4/xpi/resources/chrome.xr.manifest 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/chrome.xr.manifest 2010-06-26 15:34:00.000000000 +0100 @@ -0,0 +1,5 @@ +content chatzilla jar:chatzilla.jar!/content/chatzilla/ xpcnativewrappers=yes +overlay chrome://chatzilla/content/chatzilla.xul chrome://chatzilla/content/xr/overlay.xul +skin chatzilla classic/1.0 jar:chatzilla.jar!/skin/modern/chatzilla/ +locale chatzilla en-US jar:chatzilla.jar!/locale/en-US/chatzilla/ +locale branding en-US branding/ diff -Naur chatzilla-239243fd40b4/xpi/resources/themeinstall.rdf chatzilla/xpi/resources/themeinstall.rdf --- chatzilla-239243fd40b4/xpi/resources/themeinstall.rdf 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/themeinstall.rdf 2010-06-26 15:34:40.000000000 +0100 @@ -0,0 +1,21 @@ +<r:RDF xmlns="http://www.mozilla.org/2004/em-rdf#" xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> +<r:Description r:about="urn:mozilla:install-manifest"> + + <id>{972ce4c6-7e08-4474-a285-3208198ce6fd}</id> + <version>1</version> + <name>ChatZilla</name> + + <targetApplication><r:Description> + <id>{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}</id> + <minVersion>0</minVersion> + <maxVersion>*</maxVersion> + </r:Description></targetApplication> + + <description>The Default Theme</description> + <creator>ChatZilla Contributors</creator> + <internalName>classic/1.0</internalName> + <appManaged>true</appManaged> + <locked>true</locked> + +</r:Description> +</r:RDF> diff -Naur chatzilla-239243fd40b4/xpi/resources/update-prefs.xr.js chatzilla/xpi/resources/update-prefs.xr.js --- chatzilla-239243fd40b4/xpi/resources/update-prefs.xr.js 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xpi/resources/update-prefs.xr.js 2010-06-26 15:35:11.000000000 +0100 @@ -0,0 +1,19 @@ +// Always prompt by default. +pref("app.update.enabled", true); +pref("app.update.auto", false); +pref("app.update.silent", false); +pref("app.update.mode", 0); +pref("app.update.incompatible.mode", 0); + +pref("app.update.url", "http://chatzilla.rdmsoft.com/xulrunner/update/1/%CHANNEL%?v=%VERSION%&b=%BUILD_ID%&o=%BUILD_TARGET%&"); +pref("app.update.url.manual", "http://chatzilla.rdmsoft.com/xulrunner/"); +pref("app.update.url.details", "http://chatzilla.rdmsoft.com/xulrunner/"); + +// Check every day, if download or install is deferred ask again each day. +pref("app.update.interval", 86400); +pref("app.update.nagTimer.download", 86400); +pref("app.update.nagTimer.restart", 86400); +pref("app.update.timer", 600000); + +// Seems to be broken, and nothing else uses it. +pref("app.update.showInstalledUI", false); diff -Naur chatzilla-239243fd40b4/xul/content/commands.js chatzilla/xul/content/commands.js --- chatzilla-239243fd40b4/xul/content/commands.js 2010-06-23 15:57:41.000000000 +0100 +++ chatzilla/xul/content/commands.js 2010-06-26 15:37:16.000000000 +0100 @@ -256,6 +256,13 @@ ["statusbar", "toggle-ui status", CMD_CONSOLE], ["header", "toggle-ui header", CMD_CONSOLE], + ["extension-manager", "add-ons extensions", 0], + ["theme-manager", "add-ons themes", 0], + ["add-ons", cmdAddons, 0], + ["jsconsole", cmdJSConsole, 0], + ["about-config", cmdAboutConfig, 0], + ["update", cmdUpdate, 0], + // text-direction aliases ["rtl", "text-direction rtl", CMD_CONSOLE], ["ltr", "text-direction ltr", CMD_CONSOLE], @@ -4646,3 +4653,59 @@ client.urlLogger = logger; } } + +function cmdAddons(e) +{ + var winType = "Extension:Manager"; + var url = "chrome://mozapps/content/extensions/extensions.xul" + + if(!e.type && !client.hostCompat.addonManager) + e.type = "extensions"; + + if (e.type) + { + winType += "-" + e.type; + url += "?type=" + e.type; + } + + toOpenWindowByType(winType, url); +} + +function toOpenWindowByType(inType, url, features) +{ + var wm = getService("@mozilla.org/appshell/window-mediator;1", + "nsIWindowMediator"); + var topWindow = wm.getMostRecentWindow(inType); + + if(typeof features == "undefined") + features = "chrome,extrachrome,menubar,resizable," + + "scrollbars,status,toolbar"; + + if (topWindow) + topWindow.focus(); + else + window.open(url, "_blank", features); +} + +function cmdJSConsole(e) +{ + toOpenWindowByType("global:console", "chrome://global/content/console.xul"); +} + +function cmdAboutConfig(e) +{ + openDialog("chrome://global/content/config.xul"); +} + +function cmdUpdate(e) +{ + var um = getService("@mozilla.org/updates/update-manager;1", + "nsIUpdateManager"); + var prompter = newObject("@mozilla.org/updates/update-prompt;1", + "nsIUpdatePrompt"); + + if (um.activeUpdate && um.activeUpdate.state == "pending") + prompter.showUpdateDownloaded(um.activeUpdate); + else + prompter.checkForUpdates(); +} diff -Naur chatzilla-239243fd40b4/xul/content/menus.js chatzilla/xul/content/menus.js --- chatzilla-239243fd40b4/xul/content/menus.js 2010-06-23 15:57:41.000000000 +0100 +++ chatzilla/xul/content/menus.js 2010-06-26 15:38:10.000000000 +0100 @@ -135,6 +135,8 @@ var NetConnected = "(cx.network and cx.network.isConnected())"; var NetDisconnected = "(cx.network and !cx.network.isConnected())"; + var addons = "client.hostCompat.addonManager"; + client.menuSpecs["mainmenu:chatzilla"] = { label: MSG_MNU_CHATZILLA, accesskey: getAccessKeyForMenu('MSG_MNU_CHATZILLA'), @@ -146,6 +148,12 @@ ["-"], ["print"], ["save"], + ["-", {visibleif: XULRunner}], + ["extension-manager", {visibleif: XULRunner + " && !" + addons}], + ["theme-manager", {visibleif: XULRunner + " && !" + addons}], + ["add-ons", {visibleif: XULRunner + " && " + addons}], + ["jsconsole", {visibleif: XULRunner}], + ["about-config", {visibleif: XULRunner}], ["-", {visibleif: NotMac}], ["exit", {visibleif: Win}], ["quit", {visibleif: NotMac + " and " + NotWin}] diff -Naur chatzilla-239243fd40b4/xul/content/static.js chatzilla/xul/content/static.js --- chatzilla-239243fd40b4/xul/content/static.js 2010-06-23 15:57:41.000000000 +0100 +++ chatzilla/xul/content/static.js 2010-06-26 15:40:29.000000000 +0100 @@ -43,7 +43,7 @@ const __cz_version = "0.9.86"; const __cz_condition = "green"; -const __cz_suffix = ""; +const __cz_suffix = "rdmsoft"; const __cz_guid = "59c81df5-4b7a-477b-912d-4e0fdf64e5f2"; const __cz_locale = "0.9.86"; @@ -528,6 +528,8 @@ case "{" + __cz_guid + "}": // We ARE the app, in other words, we're running in XULRunner. client.host = "XULRunner"; + client.hostCompat.addonManager = + (compareVersions(app.platformVersion, "1.8.1") <= 0); break; case "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}": // SeaMonkey client.host = "Mozilla"; @@ -590,6 +592,31 @@ function initIcons() { + // This is a hack to make the theme manager work. + // XULRunner 1.8 doesn't read extensions from the app directory, + // so copy the default theme install.rdf to the profile. + if (client.host == "XULRunner") + { + try + { + const defaultThemeId = "{972ce4c6-7e08-4474-a285-3208198ce6fd}"; + var themeSrc = getSpecialDirectory("resource:app"); + var themeDest = getSpecialDirectory("ProfD"); + themeSrc.append("extensions"); themeDest.append("extensions"); + themeSrc.append(defaultThemeId); themeDest.append(defaultThemeId); + if (!themeDest.exists()) + mkdir(themeDest); + + themeSrc.append("install.rdf"); themeDest.append("install.rdf"); + if (!themeDest.exists()) + themeSrc.copyTo(themeDest.parent, "install.rdf") + } + catch(ex) + { + dd("failed to copy default theme"); + } + } + // Make sure we got the ChatZilla icon(s) in place first. const iconName = "chatzilla-window"; const suffixes = [".ico", ".xpm", "16.xpm"]; diff -Naur chatzilla-239243fd40b4/xul/content/xr/overlay.xul chatzilla/xul/content/xr/overlay.xul --- chatzilla-239243fd40b4/xul/content/xr/overlay.xul 1970-01-01 00:00:00.000000000 +0000 +++ chatzilla/xul/content/xr/overlay.xul 2010-06-26 15:41:19.000000000 +0100 @@ -0,0 +1,8 @@ +<?xml version="1.0"?> + +<overlay id="ChatzillaXROverlay" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + +<script type="application/x-javascript" src="chrome://global/content/findUtils.js"/> + +</overlay>