diff -r fb04f1cb7849 .hgignore
--- a/.hgignore Tue Jul 09 20:40:22 2013 +0100
+++ b/.hgignore Thu Jul 18 22:40:03 2013 +0100
@@ -1,8 +1,8 @@
(^|/)Makefile$
-^xpi/chatzilla-.*\.xpi$
+^xpi/chatzilla-.*(\.xpi|\.mar|\.zip|\.xulapp|\.tar\.bz2|\.dmg|\.txt|\.msi)$
+^xpi/runtimes$
^xpi/jar-tree$
-^xpi/xpi-tree$
-^xpi/xpi-tree-.*
+^xpi/(xpi|xr)-tree(-.*)?$
-.*\.pyc
\ No newline at end of file
+.*\.pyc
diff -r fb04f1cb7849 jar.mn
--- a/jar.mn Tue Jul 09 20:40:22 2013 +0100
+++ b/jar.mn Thu Jul 18 22:40:03 2013 +0100
@@ -23,6 +23,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 -r fb04f1cb7849 locales/en-US/chrome/chatzilla.properties
--- a/locales/en-US/chrome/chatzilla.properties Tue Jul 09 20:40:22 2013 +0100
+++ b/locales/en-US/chrome/chatzilla.properties Thu Jul 18 22:40:03 2013 +0100
@@ -80,6 +80,15 @@
#
### End of notes ###
+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.
@@ -921,7 +930,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 -r fb04f1cb7849 xpi/makexpi.py
--- a/xpi/makexpi.py Tue Jul 09 20:40:22 2013 +0100
+++ b/xpi/makexpi.py Thu Jul 18 22:40:03 2013 +0100
@@ -14,10 +14,12 @@
import os
import os.path
import sys
+import time
import shutil
import re
import zipfile
from os.path import join as joinpath
+from subprocess import call, PIPE
# Set up settings and paths for finding files.
pwd = os.path.dirname(__file__)
@@ -85,6 +87,7 @@
except WindowsError, ex:
if ex.errno != 2:
raise
+
def mkdir(dir):
"""
acts like mkdir -p
@@ -100,6 +103,13 @@
"""
shutil.copy(src, dst)
+def copytree(src, dst):
+ """
+ copy directory
+ """
+ shutil.rmtree(dst)
+ shutil.copytree(src, dst)
+
def move(src, dst):
"""
move file
@@ -174,6 +184,7 @@
fedir = getenv('FEDIR', joinpath(pwd, '..'), dir=True, check=True)
xpifiles = getenv('XPIFILES', joinpath(pwd, 'resources'), dir=True, check=True)
xpiroot = getenv('XPIROOT', joinpath(pwd, 'xpi-tree'), dir=True)
+xrroot = getenv('XRROOT', joinpath(pwd, 'xr-tree'), dir=True)
jarroot = getenv('JARROOT', joinpath(pwd, 'jar-tree'), dir=True)
localedir = getenv('LOCALEDIR', joinpath(fedir, 'locales'), dir=True, check=True)
locale = locale()
@@ -185,11 +196,14 @@
version = version(fedir)
xpiname = None
+buildid = time.strftime("%Y%m%d%H%M%S")
+theme_guid = '{972ce4c6-7e08-4474-a285-3208198ce6fd}'
if debug > 0:
print 'FEDIR = %s' % fedir
print 'XPIFILES = %s' % xpifiles
print 'XPIROOT = %s' % xpiroot
+ print 'XRROOT = %s' % xrroot
print 'JARROOT = %s' % jarroot
print 'LOCALEDIR = %s' % localedir
print 'LOCALE = %s' % locale
@@ -298,6 +312,15 @@
sed_infile.close()
sed_outfile.close()
+def sed_version_buildid(inpath, outpath):
+ echo('.')
+ infile = joinpath(*inpath)
+ tempfile = joinpath(*outpath) + ".tmp"
+ outfile = joinpath(*outpath)
+ sed(("@REVISION@", version), open(infile), open(tempfile, "w"))
+ sed(("@BUILDID@", buildid), open(tempfile), open(outfile, "w"))
+ rm(tempfile)
+
def progress_zip(indir, outfile):
if debug > 1:
print ' zip %s %s' % (indir, outfile)
@@ -317,11 +340,16 @@
rm(xpiroot)
echo('.')
rm(jarroot)
+ echo('.')
+ rm(xrroot)
print('. done.')
def do_build_base():
print 'Beginning build of ChatZilla %s...' % version
- xpiname = check_xpiname('chatzilla-%s.xpi' % version)
+ basename = 'chatzilla-%s' % version
+ if "dev" in sys.argv:
+ basename += "-%s" % buildid
+ xpiname = check_xpiname('%s.xpi' % basename)
progress_echo(' Checking XPI structure')
progress_mkdir(xpiroot)
@@ -331,6 +359,16 @@
progress_mkdir(joinpath(xpiroot, 'components'))
print ' done'
+ progress_echo(' Checking XULRunner structure')
+ progress_mkdir(xrroot)
+ progress_mkdir(joinpath(xrroot, 'chrome', 'branding'))
+ progress_mkdir(joinpath(xrroot, 'chrome', 'icons', 'default'))
+ progress_mkdir(joinpath(xrroot, 'components'))
+ progress_mkdir(joinpath(xrroot, 'defaults', 'preferences'))
+ progress_mkdir(joinpath(xrroot, 'extensions', theme_guid))
+ progress_mkdir(joinpath(xrroot, 'icons'))
+ print ' done'
+
progress_echo(' Checking JAR structure')
progress_mkdir(jarroot)
print ' done'
@@ -354,12 +392,13 @@
progress_jarmaker_make(jm, joinpath(fedir, 'jar.mn'), fedir)
progress_jarmaker_make(jm, joinpath(fedir, 'sm', 'jar.mn'), joinpath(fedir, 'sm'))
progress_jarmaker_make(jm, joinpath(fedir, 'ff', 'jar.mn'), joinpath(fedir, 'ff'))
+ progress_jarmaker_make(jm, joinpath(fedir, 'xr', 'jar.mn'), joinpath(fedir, 'xr'))
progress_preprocess(joinpath(localedir, 'jar.mn'), joinpath(localedir, 'jar.mn.pp'), {'AB_CD': 'en-US'})
# Define a preprocessor var for the next call to makeJar
jm.pp.context['AB_CD'] = 'en-US'
progress_jarmaker_make(jm, joinpath(localedir, 'jar.mn.pp'), localedir, [joinpath(localedir, 'en-US')])
progress_rm(joinpath(localedir, 'jar.mn.pp'))
- print ' done'
+ print ' done'
progress_echo(' Constructing XPI package')
progress_copy(joinpath(jarroot, 'chatzilla.jar'), joinpath(xpiroot, 'chrome'))
@@ -369,7 +408,36 @@
progress_chmod(joinpath(xpiroot, 'components', 'chatzilla-service.js'), 0664)
progress_zip(xpiroot, joinpath(pwd, xpiname))
print ' done'
-
+
+ progress_echo(' Packaging XULRunner app')
+ progress_copy(joinpath(jarroot, 'chatzilla.jar'), joinpath(xrroot, 'chrome'))
+ progress_copy(joinpath(fedir, 'js', 'lib', 'chatzilla-service.js'), joinpath(xrroot, 'components'))
+ progress_copy(joinpath(xpiroot, 'chrome.manifest'), joinpath(xrroot, 'chrome.manifest'))
+ progress_chmod(joinpath(xrroot, 'chrome', 'chatzilla.jar'), 0664)
+ progress_chmod(joinpath(xrroot, 'components', 'chatzilla-service.js'), 0664)
+
+ if "updates" in sys.argv:
+ sed_version_buildid((xpifiles, "update-prefs.xr.js"), (xrroot, "defaults", "preferences", "update-prefs.xr.js"))
+ channel = "dev" if "dev" in sys.argv else "release"
+ open(joinpath(xrroot, "defaults", "preferences", "channel-prefs.js"), "w").write("pref(\"app.update.channel\", \"%s\");" % channel)
+ else:
+ echo('.')
+
+ sed_version_buildid((xpifiles, "chatzilla-prefs.xr.js"), (xrroot, "defaults", "preferences", "chatzilla-prefs.xr.js"))
+ sed_version_buildid((xpifiles, "themeinstall.rdf"), (xrroot, "extensions", theme_guid, "install.rdf"))
+ sed_version_buildid((xpifiles, "brand.dtd"), (xrroot, "chrome", "branding", "brand.dtd"))
+ sed_version_buildid((xpifiles, "brand.properties"), (xrroot, "chrome", "branding", "brand.properties"))
+ sed_version_buildid((xpifiles, "application.ini"), (xrroot, "application.ini"))
+
+ progress_copy(joinpath(xpifiles, "chatzilla-window.ico"), joinpath(xrroot, "chrome", "icons", "default", "chatzilla-window.ico"))
+ progress_copy(joinpath(xpifiles, "chatzilla-window.xpm"), joinpath(xrroot, "chrome", "icons", "default", "chatzilla-window.xpm"))
+ progress_copy(joinpath(xpifiles, "chatzilla-window16.xpm"), joinpath(xrroot, "chrome", "icons", "default", "chatzilla-window16.xpm"))
+ open(joinpath(xrroot, "icons", "updater.png"), "w").close()
+
+ xrname = '%s.en-US.xulapp' % basename
+ progress_zip(xrroot, joinpath(pwd, xrname))
+
+ print ' done'
print 'Build of ChatZilla %s... ALL DONE' % version
diff -r fb04f1cb7849 xpi/resources/Info.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/Info.plist Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,24 @@
+
+
+
+
+CFBundleInfoDictionaryVersion6.0
+ CFBundleIdentifiercom.rdmsoft.chatzilla
+ CFBundlePackageTypeAPPL
+ CFBundleExecutablexulrunner
+ NSAppleScriptEnabled
+ CFBundleNameChatZilla
+ CFBundleDisplayNameChatZilla
+ CFBundleGetInfoStringChatZilla @REVISION@
+ CFBundleShortVersionString@REVISION@
+ CFBundleVersion@REVISION@.@BUILDID@
+
+
+
+
\ No newline at end of file
diff -r fb04f1cb7849 xpi/resources/application.ini
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/application.ini Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,12 @@
+[App]
+Name=ChatZilla
+Version=@REVISION@
+BuildID=@BUILDID@
+ID={59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
+
+[Gecko]
+MinVersion=17.0
+MaxVersion=25.*
+
+[XRE]
+EnableExtensionManager=Truly, yes.
diff -r fb04f1cb7849 xpi/resources/brand.dtd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/brand.dtd Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,5 @@
+
+
+
+
+
diff -r fb04f1cb7849 xpi/resources/brand.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/brand.properties Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,3 @@
+brandShortName=ChatZilla
+brandFullName=ChatZilla @REVISION@
+vendorShortName=
diff -r fb04f1cb7849 xpi/resources/chatzilla-prefs.xr.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/chatzilla-prefs.xr.js Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,37 @@
+// 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);
+pref("extensions.getAddons.cache.enabled", true);
+
+// This means nothing because AMO 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");
+
+pref("extensions.getAddons.showPane", false);
+
+// 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 -r fb04f1cb7849 xpi/resources/chrome.xr.manifest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/chrome.xr.manifest Thu Jul 18 22:40:03 2013 +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 -r fb04f1cb7849 xpi/resources/themeinstall.rdf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/themeinstall.rdf Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,22 @@
+
+
+
+ {972ce4c6-7e08-4474-a285-3208198ce6fd}
+ 1
+ ChatZilla
+
+
+ {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
+ 0
+ *
+
+
+ The Default Theme
+ ChatZilla Contributors
+ modern/1.0
+ true
+ true
+
+
+
+
diff -r fb04f1cb7849 xpi/resources/update-prefs.xr.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xpi/resources/update-prefs.xr.js Thu Jul 18 22:40:03 2013 +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/2/%CHANNEL%?v=%VERSION%&b=%BUILD_ID%&o=%BUILD_TARGET%&ov=%OS_VERSION%&pv=%PLATFORM_VERSION%&");
+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 -r fb04f1cb7849 xr/Makefile.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xr/Makefile.in Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,20 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DEPTH = ../../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+CHATZILLA_VERSION=$(shell grep "const __cz_version" "$(srcdir)/../xul/content/static.js" | sed "s|.*\"\([^\"]\{1,\}\)\".*|\1|")
+
+XPI_NAME = chatzilla
+USE_EXTENSION_MANIFEST = 1
+NO_JAR_AUTO_REG = 1
+INSTALL_EXTENSION_ID = {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
+XPI_PKGNAME = chatzilla-$(CHATZILLA_VERSION)
+
+include $(topsrcdir)/config/rules.mk
diff -r fb04f1cb7849 xr/jar.mn
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xr/jar.mn Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# The registration of the overlays specific to Firefox below should match
+# the ../xul/content/ff/contents.rdf file.
+chatzilla.jar:
+% content chatzilla-xr %content/chatzilla/xr/
+% overlay chrome://chatzilla/content/chatzilla.xul chrome://chatzilla/content/xr/overlay.xul application={59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
+% locale branding en-US chrome/branding/ application={59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
+ content/chatzilla/xr/overlay.xul (../xul/content/xr/overlay.xul)
diff -r fb04f1cb7849 xul/content/commands.js
--- a/xul/content/commands.js Tue Jul 09 20:40:22 2013 +0100
+++ b/xul/content/commands.js Thu Jul 18 22:40:03 2013 +0100
@@ -223,6 +223,11 @@
["statusbar", "toggle-ui status", CMD_CONSOLE],
["header", "toggle-ui header", CMD_CONSOLE],
+ ["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],
@@ -4648,3 +4653,49 @@
}
dispatch(client.prefs["messages.click"], {url: searchURL});
}
+
+function cmdAddons(e)
+{
+ var winType = "Extension:Manager";
+ var url = "chrome://mozapps/content/extensions/extensions.xul"
+ 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 -r fb04f1cb7849 xul/content/menus.js
--- a/xul/content/menus.js Tue Jul 09 20:40:22 2013 +0100
+++ b/xul/content/menus.js Thu Jul 18 22:40:03 2013 +0100
@@ -114,6 +114,10 @@
["-"],
["print"],
["save"],
+ ["-", {visibleif: XULRunner}],
+ ["add-ons", {visibleif: XULRunner}],
+ ["jsconsole", {visibleif: XULRunner}],
+ ["about-config", {visibleif: XULRunner}],
["-", {visibleif: NotMac}],
["exit", {visibleif: Win}],
["quit", {visibleif: NotMac + " and " + NotWin}]
diff -r fb04f1cb7849 xul/content/static.js
--- a/xul/content/static.js Tue Jul 09 20:40:22 2013 +0100
+++ b/xul/content/static.js Thu Jul 18 22:40:03 2013 +0100
@@ -6,7 +6,7 @@
const __cz_version = "0.9.90.1";
const __cz_condition = "green";
-const __cz_suffix = "";
+const __cz_suffix = "rdmsoft";
const __cz_guid = "59c81df5-4b7a-477b-912d-4e0fdf64e5f2";
const __cz_locale = "0.9.90.1";
diff -r fb04f1cb7849 xul/content/xr/overlay.xul
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xul/content/xr/overlay.xul Thu Jul 18 22:40:03 2013 +0100
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+