diff --git a/common/components/protocols.js b/common/components/protocols.js index 590dcf93..a4488fab 100644 --- a/common/components/protocols.js +++ b/common/components/protocols.js @@ -26,6 +26,8 @@ const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].getService(Ci.nsIPr function dataURL(type, data) "data:" + (type || "application/xml;encoding=UTF-8") + "," + escape(data); function makeChannel(url, orig) { + if (url == null) + return fakeChannel(); if (typeof url == "function") url = dataURL.apply(null, url()); let uri = ioService.newURI(url, null, null); @@ -83,12 +85,15 @@ ChromeData.prototype = { }; function Dactyl() { + const self = this; this.wrappedJSObject = this; this.HELP_TAGS = {}; this.FILE_MAP = {}; this.OVERLAY_MAP = {}; this.addonID = this.name + "@dactyl.googlecode.com"; + + this.pages = {}; } Dactyl.prototype = { contractID: "@mozilla.org/network/protocol;1?name=dactyl", @@ -106,9 +111,12 @@ Dactyl.prototype = { }, appName: prefs.getComplexValue("appName", Ci.nsISupportsString).data, - name: prefs.getComplexValue("name", Ci.nsISupportsString).data, - idName: prefs.getComplexValue("idName", Ci.nsISupportsString).data, + fileExt: prefs.getComplexValue("fileExt", Ci.nsISupportsString).data, host: prefs.getComplexValue("host", Ci.nsISupportsString).data, + hostbin: prefs.getComplexValue("hostbin", Ci.nsISupportsString).data, + idName: prefs.getComplexValue("idName", Ci.nsISupportsString).data, + name: prefs.getComplexValue("name", Ci.nsISupportsString).data, + get version() prefs.getComplexValue("version", Ci.nsISupportsString).data, init: function (obj) { for each (let prop in ["HELP_TAGS", "FILE_MAP", "OVERLAY_MAP"]) { @@ -135,16 +143,17 @@ Dactyl.prototype = { newChannel: function (uri) { try { - if (!("all" in this.FILE_MAP)) + if (uri.host != "content" && !("all" in this.FILE_MAP)) return redirect(uri.spec, uri, 1); + let path = decodeURIComponent(uri.path.replace(/^\/|#.*/g, "")); switch(uri.host) { + case "content": + return makeChannel(this.pages[path], uri); case "help": - let url = this.FILE_MAP[decodeURIComponent(uri.path.replace(/^\/|#.*/g, ""))]; - return makeChannel(url, uri); + return makeChannel(this.FILE_MAP[path], uri); case "help-overlay": - url = this.OVERLAY_MAP[decodeURIComponent(uri.path.replace(/^\/|#.*/g, ""))]; - return makeChannel(url, uri); + return makeChannel(this.OVERLAY_MAP[path], uri); case "help-tag": let tag = decodeURIComponent(uri.path.substr(1)); if (tag in this.FILE_MAP) diff --git a/common/content/about.xul b/common/content/about.xul index 6952e33b..00c0aba9 100644 --- a/common/content/about.xul +++ b/common/content/about.xul @@ -15,7 +15,7 @@
-version @VERSION@
+version &dactyl.version;
by Kris Maglione, Doug Kearns, et al.
&dactyl.appName; is open source and freely distributable
diff --git a/common/content/base.dtd b/common/content/base.dtd
new file mode 100644
index 00000000..cd548f6a
--- /dev/null
+++ b/common/content/base.dtd
@@ -0,0 +1,18 @@
+
+
+%dactylBranding;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/common/content/dactyl-overlay.js b/common/content/dactyl-overlay.js
index 76724ff1..f7e2d3fc 100644
--- a/common/content/dactyl-overlay.js
+++ b/common/content/dactyl-overlay.js
@@ -39,6 +39,9 @@
let prefix = [BASE];
+ modules.load("services");
+ prefix.unshift("chrome://" + modules.services.get("dactyl:").name + "/content/");
+
["base",
"modules",
"storage",
@@ -63,13 +66,11 @@
"marks",
"modes",
"options",
- "services",
"statusline",
"styles",
"template"
].forEach(modules.load);
- prefix.unshift("chrome://" + modules.services.get("dactyl:").name + "/content/");
modules.Config.prototype.scripts.forEach(modules.load);
})();
diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index 99725d18..df41e43a 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -1929,6 +1929,7 @@ const Dactyl = Module("dactyl", {
AddonManager.getAddonByID(services.get("dactyl:").addonID, function (addon) {
// @DATE@ token replaced by the Makefile
// TODO: Find it automatically
+ options.setPref("extensions.dactyl.version", addon.version);
dactyl.version = addon.version + " (created: @DATE@)";
});
diff --git a/melodactyl/chrome.manifest b/melodactyl/chrome.manifest
index b39e9180..7978f433 100644
--- a/melodactyl/chrome.manifest
+++ b/melodactyl/chrome.manifest
@@ -9,7 +9,6 @@ resource dactyl ../common/modules/
skin dactyl classic/1.0 ../common/skin/
override chrome://dactyl/content/dactyl.dtd chrome://melodactyl/content/dactyl.dtd
-override chrome://dactyl/content/config.js chrome://melodactyl/content/config.js
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://melodactyl/content/melodactyl.xul
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://dactyl/content/dactyl.xul
diff --git a/melodactyl/content/dactyl.dtd b/melodactyl/content/dactyl.dtd
index 92ffdc1f..23ba95cb 100644
--- a/melodactyl/content/dactyl.dtd
+++ b/melodactyl/content/dactyl.dtd
@@ -1,23 +1,15 @@
-
-%dactylBranding;
-
+
-
-
-
-
-
+
+%dactylBase;
-
-
-
diff --git a/melodactyl/defaults/preferences/dactyl.js b/melodactyl/defaults/preferences/dactyl.js
index 30601bfa..077178a9 100644
--- a/melodactyl/defaults/preferences/dactyl.js
+++ b/melodactyl/defaults/preferences/dactyl.js
@@ -1,4 +1,6 @@
pref("extensions.dactyl.name", "melodactyl");
pref("extensions.dactyl.appName", "Melodactyl");
pref("extensions.dactyl.idName", "MELODACTYL");
+pref("extensions.dactyl.fileExt", "melo");
pref("extensions.dactyl.host", "Songbird");
+pref("extensions.dactyl.hostbin", "songbird");
diff --git a/melodactyl/locale/en-US/dactyl.dtd b/melodactyl/locale/en-US/dactyl.dtd
deleted file mode 100644
index d2bc54b8..00000000
--- a/melodactyl/locale/en-US/dactyl.dtd
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/pentadactyl/chrome.manifest b/pentadactyl/chrome.manifest
index 9b2b3e0a..5b2b12e9 100644
--- a/pentadactyl/chrome.manifest
+++ b/pentadactyl/chrome.manifest
@@ -9,7 +9,6 @@ resource dactyl ../common/modules/
skin dactyl classic/1.0 ../common/skin/
override chrome://dactyl/content/dactyl.dtd chrome://pentadactyl/content/dactyl.dtd
-override chrome://dactyl/content/config.js chrome://pentadactyl/content/config.js
overlay chrome://browser/content/browser.xul chrome://dactyl/content/dactyl.xul
overlay chrome://browser/content/browser.xul chrome://pentadactyl/content/pentadactyl.xul
diff --git a/pentadactyl/content/dactyl.dtd b/pentadactyl/content/dactyl.dtd
index a2ade11c..7ca672b2 100644
--- a/pentadactyl/content/dactyl.dtd
+++ b/pentadactyl/content/dactyl.dtd
@@ -1,24 +1,15 @@
-
-%dactylBranding;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+%dactylBase;
diff --git a/pentadactyl/defaults/preferences/dactyl.js b/pentadactyl/defaults/preferences/dactyl.js
index b2d69713..c029b1df 100644
--- a/pentadactyl/defaults/preferences/dactyl.js
+++ b/pentadactyl/defaults/preferences/dactyl.js
@@ -1,4 +1,6 @@
pref("extensions.dactyl.name", "pentadactyl");
pref("extensions.dactyl.appName", "Pentadactyl");
pref("extensions.dactyl.idName", "PENTADACTYL");
+pref("extensions.dactyl.fileExt", "penta");
pref("extensions.dactyl.host", "Firefox");
+pref("extensions.dactyl.hostbin", "firefox");
diff --git a/pentadactyl/locale/en-US/dactyl.dtd b/pentadactyl/locale/en-US/dactyl.dtd
deleted file mode 100644
index 882fd77f..00000000
--- a/pentadactyl/locale/en-US/dactyl.dtd
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/pentadactyl/locale/en-US/intro.xml b/pentadactyl/locale/en-US/intro.xml
index 3f07536f..313d890b 100644
--- a/pentadactyl/locale/en-US/intro.xml
+++ b/pentadactyl/locale/en-US/intro.xml
@@ -168,13 +168,13 @@
Please send comments, questions, or patches to the - mailing list, + mailing list, where we will do our best to answer any inquiries. You can also check the wiki or FAQ. Issue reports can be entered in the - issue tracker. + issue tracker.
diff --git a/teledactyl/chrome.manifest b/teledactyl/chrome.manifest index 7842173f..137637f3 100644 --- a/teledactyl/chrome.manifest +++ b/teledactyl/chrome.manifest @@ -8,7 +8,6 @@ resource dactyl ../common/modules/ skin dactyl classic/1.0 ../common/skin/ override chrome://dactyl/content/dactyl.dtd chrome://teledactyl/content/dactyl.dtd -override chrome://dactyl/content/config.js chrome://teledactyl/content/config.js overlay chrome://messenger/content/messenger.xul chrome://dactyl/content/dactyl.xul overlay chrome://messenger/content/messenger.xul chrome://teledactyl/content/teledactyl.xul diff --git a/teledactyl/content/compose/dactyl.dtd b/teledactyl/content/compose/dactyl.dtd index 67f3d328..9fa9cf75 100644 --- a/teledactyl/content/compose/dactyl.dtd +++ b/teledactyl/content/compose/dactyl.dtd @@ -6,3 +6,4 @@ + diff --git a/teledactyl/content/dactyl.dtd b/teledactyl/content/dactyl.dtd index 8dd53616..0fc1a9e2 100644 --- a/teledactyl/content/dactyl.dtd +++ b/teledactyl/content/dactyl.dtd @@ -1,19 +1,15 @@ - -%dactylBranding; - - - - - - - - - - + + + + + + + +%dactylBase; diff --git a/teledactyl/defaults/preferences/dactyl.js b/teledactyl/defaults/preferences/dactyl.js index c54e4888..bf789242 100644 --- a/teledactyl/defaults/preferences/dactyl.js +++ b/teledactyl/defaults/preferences/dactyl.js @@ -1,4 +1,6 @@ pref("extensions.dactyl.name", "teledactyl"); pref("extensions.dactyl.appName", "Teledactyl"); pref("extensions.dactyl.idName", "TELEDACTYL"); +pref("extensions.dactyl.fileExt", "tele"); pref("extensions.dactyl.host", "Thunderbird"); +pref("extensions.dactyl.hostbin", "thunderbird"); diff --git a/teledactyl/locale/en-US/intro.xml b/teledactyl/locale/en-US/intro.xml index bcf44ca9..a4321271 100644 --- a/teledactyl/locale/en-US/intro.xml +++ b/teledactyl/locale/en-US/intro.xml @@ -165,13 +165,13 @@ orPlease send comments, questions, or patches to the - mailing list, + mailing list, where we will do our best to answer any questions. You can also check the wiki for FAQ. Issue reports can be entered in the - issue tracker. +