Index: extensions/irc/jar.mn =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/jar.mn,v retrieving revision 1.40 diff -p -u -6 -r1.40 jar.mn --- extensions/irc/jar.mn 4 May 2008 20:30:22 -0000 1.40 +++ extensions/irc/jar.mn 24 Jun 2008 11:41:41 -0000 @@ -8,12 +8,13 @@ chatzilla.jar: % overlay chrome://communicator/content/pref/pref-appearance.xul chrome://chatzilla/content/prefsOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} % style chrome://browser/content/browser.xul chrome://chatzilla/skin/browserOverlay.css % style chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://chatzilla/skin/browserOverlay.css % 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) content/chatzilla/lib/js/command-manager.js (js/lib/command-manager.js) content/chatzilla/lib/js/pref-manager.js (js/lib/pref-manager.js) content/chatzilla/lib/js/message-manager.js (js/lib/message-manager.js) Index: extensions/irc/locales/en-US/chrome/chatzilla.properties =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties,v retrieving revision 1.163 diff -p -u -6 -r1.163 chatzilla.properties --- extensions/irc/locales/en-US/chrome/chatzilla.properties 22 Jun 2008 14:42:05 -0000 1.163 +++ extensions/irc/locales/en-US/chrome/chatzilla.properties 24 Jun 2008 11:41:43 -0000 @@ -99,12 +99,26 @@ msg.confirm = Confirm # The three standard brand entities (brandShortName, brandFullName, vendorName) # can all be used like this: # foo.bar = Some text used in &brandFullName;! # ### 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 = [] +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. cmd.alias.params = [ ] cmd.alias.help = Defines as an alias for the semicolon (';') delimited list of commands specified by . If is a minus ('-') character, the alias will be removed. If is not provided, all aliases will be listed. @@ -898,13 +912,13 @@ msg.no.help = Help not availab msg.no.cmdmatch = No commands match ``%1$S''. msg.no.plugins = There are no plugins loaded. msg.cmdmatch = Commands matching ``%1$S'' are [%2$S]. 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… msg.current.charset = Using ``%S'' as default character encoding. msg.current.charset.view = Using ``%S'' as character encoding for this view. msg.current.css = Using <%S> as default motif. Index: extensions/irc/xpi/.cvsignore =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/xpi/.cvsignore,v retrieving revision 1.2 diff -p -u -6 -r1.2 .cvsignore --- extensions/irc/xpi/.cvsignore 31 Jan 2006 17:41:50 -0000 1.2 +++ extensions/irc/xpi/.cvsignore 24 Jun 2008 11:41:43 -0000 @@ -1,4 +1,5 @@ jar-tree xpi-tree +xr-tree xpi-tree-* -chatzilla-*.xpi +chatzilla-* Index: extensions/irc/xpi/makexpi.sh =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/xpi/makexpi.sh,v retrieving revision 1.16 diff -p -u -6 -r1.16 makexpi.sh --- extensions/irc/xpi/makexpi.sh 17 Jun 2008 22:22:31 -0000 1.16 +++ extensions/irc/xpi/makexpi.sh 24 Jun 2008 11:41:43 -0000 @@ -5,12 +5,13 @@ if [ -z "$DEBUG" ]; then DEBUG=0; fi if [ -z "$PERL" ]; then PERL=perl; fi if [ -z "$FEDIR" ]; then FEDIR=$PWD/..; fi if [ -z "$CONFIGDIR" ]; then CONFIGDIR=$FEDIR/../../config; fi if [ -z "$XPIFILES" ]; then XPIFILES=$PWD/resources; fi if [ -z "$XPIROOT" ]; then XPIROOT=$PWD/xpi-tree; fi if [ -z "$JARROOT" ]; then JARROOT=$PWD/jar-tree; fi +if [ -z "$XRROOT" ]; then XRROOT=$PWD/xr-tree; fi if [ -z "$LOCALEDIR" ]; then LOCALEDIR=$FEDIR/locales; fi # Display all the settings and paths if we're in debug mode. if [ $DEBUG -ge 1 ]; then echo "\$DEBUG = $DEBUG" echo "\$PERL = $PERL" @@ -98,22 +99,38 @@ function safeCommand() exit 1 fi rm -f log.stdout log.stderr return $EC } +function doZip() +{ + OLDPWD=`pwd` + cd "$2" + if [ -x "$SEVENZIP" ]; then + # Windows/Cygwin specific: use 7-zip if available for better compression + # If you use this, watch out for Linux issues (bug 399191) + ZIPTARGET=`cygpath -w "$OLDPWD/$1"` + safeCommand "$SEVENZIP" a -tzip -mx=9 "$ZIPTARGET" . -x!log* + else + safeCommand zip -9vr "$OLDPWD/$1" . -i "*" -x "log*" + fi + cd "$OLDPWD" +} ## Begin real program ## # Clean up XPI and JAR build directories. if [ "$1" = "clean" ]; then echo -n "Cleaning up files" echo -n . rm -rf "$XPIROOT" echo -n . + rm -rf "$XRROOT" + echo -n . rm -rf "$JARROOT" echo ". done." exit fi @@ -128,30 +145,45 @@ if ! [ -d "$CONFIGDIR" ]; then exit 1 fi # Extract version number. VERSION=`grep "const __cz_version" "$FEDIR/xul/content/static.js" | sed "s|.*\"\([^\"]\{1,\}\)\".*|\1|"` +BUILDID=`date +%Y%m%d%H` + if [ -z "$VERSION" ]; then echo "ERROR: Unable to get version number." exit 1 fi echo Beginning build of ChatZilla $VERSION... -# Set up XPI name. -XPINAME="chatzilla-$VERSION.xpi" +# Set up base output file name. +BASENAME="chatzilla-$VERSION-$BUILDID" # Check for an existing XPI file and print a warning. -if [ -r "$XPINAME" ]; then +if [ -r "$BASENAME.xpi" ]; then echo " WARNING: output XPI will be overwritten." fi # Check for required directory layouts. +echo -n " Creating XULRunner structure" +echo -n . +mkdir -p $XRROOT/chrome/branding +echo -n . +mkdir -p $XRROOT/chrome/icons/default +echo -n . +mkdir -p $XRROOT/components +echo -n . +mkdir -p $XRROOT/defaults/preferences +echo -n . +mkdir -p $XRROOT/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} +echo ". done" + echo -n " Checking XPI structure" echo -n . if ! [ -d "$XPIROOT" ]; then mkdir -p "$XPIROOT"; fi echo -n . if ! [ -d "$XPIROOT/chrome" ]; then mkdir "$XPIROOT/chrome"; fi echo -n . @@ -209,12 +241,83 @@ safeCommand $PERL preprocessor.pl -DAB_C safeCommand $PERL make-jars.pl -e -v -z zip -p preprocessor.pl -s "$LOCALEDIR" -d "$JARROOT" -c "$LOCALEDIR/en-US" -- "-DAB_CD=\"en-US\" -DMOZILLA_LOCALE_VERSION=\"\"" '<' "$LOCALEDIR/jar.mn.pp" safeCommand rm "$LOCALEDIR/jar.mn.pp" echo -n . cd "$OLDPWD" echo ". done" +# Make XULRunner package +echo -n " Constructing XULRunner app" +echo -n . +safeCommand cp -v "$JARROOT/chatzilla.jar" "$XRROOT/chrome/" +safeCommand chmod 664 "$XRROOT/chrome/chatzilla.jar" +echo -n . +safeCommand cp -v "$FEDIR/js/lib/chatzilla-service.js" "$XRROOT/components/" +safeCommand chmod 664 "$XRROOT/components/chatzilla-service.js" +echo -n . +safeCommand sed "s|@REVISION@|$VERSION|g" '<' "$XPIFILES/chatzilla-prefs.xr.js" '>' "$XRROOT/defaults/preferences/chatzilla-prefs.xr.js" +if [ $UPDATE_CHANNEL ]; then + safeCommand cp "$XPIFILES/update-prefs.xr.js" "$XRROOT/defaults/preferences/" + safeCommand echo "pref(\"app.update.channel\", \"$UPDATE_CHANNEL\");" '>' "$XRROOT/defaults/preferences/channel-prefs.js" +fi +safeCommand sed "s|@REVISION@|$VERSION|g" '<' "$XPIFILES/themeinstall.rdf" '>' "$XRROOT/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf" +echo -n . +safeCommand sed "s|@REVISION@|$VERSION|g" '<' "$XPIFILES/brand.dtd" '>' "$XRROOT/chrome/branding/brand.dtd" +safeCommand sed "s|@REVISION@|$VERSION|g" '<' "$XPIFILES/brand.properties" '>' "$XRROOT/chrome/branding/brand.properties" +echo -n . +safeCommand sed "s|@REVISION@|$VERSION|g" '<' "$XPIFILES/application.ini" '>' "$XRROOT/application.ini.tmp" +safeCommand sed "s|@BUILDID@|$BUILDID|g" '<' "$XRROOT/application.ini.tmp" '>' "$XRROOT/application.ini" +safeCommand rm "$XRROOT/application.ini.tmp" +echo -n . +safeCommand cp "$XPIFILES/chatzilla-window.ico" "$XRROOT/chrome/icons/default/chatzilla-window.ico" +safeCommand cp "$XPIFILES/chatzilla-window.xpm" "$XRROOT/chrome/icons/default/chatzilla-window.xpm" +safeCommand cp "$XPIFILES/chatzilla-window16.xpm" "$XRROOT/chrome/icons/default/chatzilla-window16.xpm" +echo -n . +safeCommand cp "$XPIFILES/chrome.xr.manifest" "$XRROOT/chrome/chrome.manifest" +echo ". done" + +echo -n " Packaging XULRunner app" +echo -n . +doZip $BASENAME-xr.zip "$XRROOT" +echo -n . +# most of this stuff is specific to chatzilla.rdmsoft.com +if [ $UPDATE_CHANNEL ]; then + UPSCRIPTS=$PWD/../../../tools/update-packaging + safeCommand $UPSCRIPTS/make_full_update.sh $BASENAME.mar xr-tree + echo -n ... + if [ $FROM ]; then + mkdir xr-tree-old + cd xr-tree-old + safeCommand $PERL $UPSCRIPTS/unwrap_full_update.pl ../$FROM + echo -n .. + FROM_ID=`grep BuildID application.ini | sed s/[^0-9]//g` + cd .. + safeCommand $UPSCRIPTS/make_incremental_update.sh partial/$BASENAME.mar xr-tree-old xr-tree + echo -n . + rm -rf xr-tree-old + fi + UPDATA="$BASENAME.txt" + echo "version : $VERSION" > $UPDATA + echo "buildid : $BUILDID" >> $UPDATA + echo "zip-url : download/$BASENAME-xr.zip" >> $UPDATA + echo "zip-size : "`stat --printf=%s $BASENAME-xr.zip` >> $UPDATA + echo "mar-url : update/$BASENAME.mar" >> $UPDATA + echo "mar-size : "`stat --printf=%s $BASENAME.mar` >> $UPDATA + echo "mar-sha1 : "`sha1sum $BASENAME.mar | head -c 40` >> $UPDATA + if [ $FROM ]; then + echo "partial-from : $FROM_ID" >> $UPDATA + echo "partial-url : update/partial/$BASENAME.mar" >> $UPDATA + echo "partial-size : "`stat --printf=%s partial/$BASENAME.mar` >> $UPDATA + echo "partial-sha1 : "`sha1sum partial/$BASENAME.mar | head -c 40` >> $UPDATA + fi + echo "channels : " >> $UPDATA + echo -n . + if [ -z $FROM ]; then echo -n " "; fi +else + echo -n " " +fi +echo " done" # Make XPI. echo -n " Constructing XPI package" echo -n . safeCommand cp -v "$JARROOT/chatzilla.jar" "$XPIROOT/chrome/" echo -n . @@ -223,14 +326,11 @@ echo -n . safeCommand mv "$JARROOT/../chrome.manifest" "$XPIROOT/chrome.manifest" echo -n . safeCommand chmod 664 "$XPIROOT/chrome/chatzilla.jar" echo -n . safeCommand chmod 664 "$XPIROOT/components/chatzilla-service.js" echo -n . -OLDPWD=`pwd` -cd "$XPIROOT" -safeCommand zip -vr ../$XPINAME . -i "*" -x "log*" -cd "$OLDPWD" +doZip $BASENAME.xpi "$XPIROOT" echo ". done" echo "Build of ChatZilla $VERSION... ALL DONE" Index: extensions/irc/xpi/resources/application.ini =================================================================== RCS file: extensions/irc/xpi/resources/application.ini diff -N extensions/irc/xpi/resources/application.ini --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/application.ini 24 Jun 2008 11:41:43 -0000 @@ -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. Index: extensions/irc/xpi/resources/brand.dtd =================================================================== RCS file: extensions/irc/xpi/resources/brand.dtd diff -N extensions/irc/xpi/resources/brand.dtd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/brand.dtd 24 Jun 2008 11:41:43 -0000 @@ -0,0 +1,4 @@ + + + + Index: extensions/irc/xpi/resources/brand.properties =================================================================== RCS file: extensions/irc/xpi/resources/brand.properties diff -N extensions/irc/xpi/resources/brand.properties --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/brand.properties 24 Jun 2008 11:41:43 -0000 @@ -0,0 +1,3 @@ +brandShortName=ChatZilla +brandFullName=ChatZilla @REVISION@ +vendorShortName= Index: extensions/irc/xpi/resources/chatzilla-prefs.xr.js =================================================================== RCS file: extensions/irc/xpi/resources/chatzilla-prefs.xr.js diff -N extensions/irc/xpi/resources/chatzilla-prefs.xr.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/chatzilla-prefs.xr.js 24 Jun 2008 11:41:43 -0000 @@ -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@"); Index: extensions/irc/xpi/resources/chrome.xr.manifest =================================================================== RCS file: extensions/irc/xpi/resources/chrome.xr.manifest diff -N extensions/irc/xpi/resources/chrome.xr.manifest --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/chrome.xr.manifest 24 Jun 2008 11:41:43 -0000 @@ -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/ Index: extensions/irc/xpi/resources/themeinstall.rdf =================================================================== RCS file: extensions/irc/xpi/resources/themeinstall.rdf diff -N extensions/irc/xpi/resources/themeinstall.rdf --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/themeinstall.rdf 24 Jun 2008 11:41:43 -0000 @@ -0,0 +1,22 @@ + + + + {972ce4c6-7e08-4474-a285-3208198ce6fd} + 1 + ChatZilla + + + {59c81df5-4b7a-477b-912d-4e0fdf64e5f2} + 0 + * + + + The Default Theme + ChatZilla Contributors + classic/1.0 + true + true + + + + Index: extensions/irc/xpi/resources/update-prefs.xr.js =================================================================== RCS file: extensions/irc/xpi/resources/update-prefs.xr.js diff -N extensions/irc/xpi/resources/update-prefs.xr.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xpi/resources/update-prefs.xr.js 24 Jun 2008 11:41:43 -0000 @@ -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); Index: extensions/irc/xul/content/commands.js =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/xul/content/commands.js,v retrieving revision 1.159 diff -p -u -6 -r1.159 commands.js --- extensions/irc/xul/content/commands.js 20 Jun 2008 15:09:55 -0000 1.159 +++ extensions/irc/xul/content/commands.js 24 Jun 2008 11:41:45 -0000 @@ -247,12 +247,19 @@ function initCommands() ["sync-output", "eval syncOutputFrame(this)", 0], ["userlist", "toggle-ui userlist", CMD_CONSOLE], ["tabstrip", "toggle-ui tabstrip", CMD_CONSOLE], ["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], ["toggle-text-dir", "text-direction toggle", 0], ["irtl", "input-text-direction rtl", CMD_CONSOLE], ["iltr", "input-text-direction ltr", CMD_CONSOLE], @@ -4585,6 +4592,62 @@ function cmdURLs(e) display(getMsg(MSG_URLS_ITEM, [i + 1, oldList[i]])); // Restore old URL list so displaying it has no effect. client.prefs["urls.list"] = oldList; } } + +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(); +} Index: extensions/irc/xul/content/menus.js =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/xul/content/menus.js,v retrieving revision 1.30 diff -p -u -6 -r1.30 menus.js --- extensions/irc/xul/content/menus.js 4 May 2008 20:30:24 -0000 1.30 +++ extensions/irc/xul/content/menus.js 24 Jun 2008 11:41:45 -0000 @@ -130,20 +130,28 @@ function initMenus() // IRC specific combinations var ChannelActive = "(" + ViewChannel + " and cx.channel.active)"; var ChannelInactive = "(" + ViewChannel + " and !cx.channel.active)"; 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, getContext: getDefaultContext, items: [ ["cmd-prefs", {id: "menu_preferences"}], ["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}] ] }; Index: extensions/irc/xul/content/static.js =================================================================== RCS file: /cvsroot/mozilla/extensions/irc/xul/content/static.js,v retrieving revision 1.281 diff -p -u -6 -r1.281 static.js --- extensions/irc/xul/content/static.js 22 Jun 2008 14:42:05 -0000 1.281 +++ extensions/irc/xul/content/static.js 24 Jun 2008 11:41:49 -0000 @@ -39,13 +39,13 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ const __cz_version = "0.9.83"; const __cz_condition = "green"; -const __cz_suffix = ""; +const __cz_suffix = "rdmsoft"; const __cz_guid = "59c81df5-4b7a-477b-912d-4e0fdf64e5f2"; const __cz_locale = "0.9.83"; var warn; var ASSERT; var TEST; @@ -446,12 +446,14 @@ function initApplicationCompatibility() case "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": client.host = "Firefox"; break; 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"; break; case "{a463f10c-3994-11da-9945-000d60ca027b}": // Flock client.host = "Flock"; @@ -508,12 +510,37 @@ function initApplicationCompatibility() else client.lineEnd = "\n"; } 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"]; /* when installing on Mozilla, the XPI has the power to put the icons where * they are needed - in older versions of Firefox, it doesn't. Index: extensions/irc/xul/content/xr/overlay.xul =================================================================== RCS file: extensions/irc/xul/content/xr/overlay.xul diff -N extensions/irc/xul/content/xr/overlay.xul --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extensions/irc/xul/content/xr/overlay.xul 24 Jun 2008 11:41:49 -0000 @@ -0,0 +1,8 @@ + + + + +