summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-10-02 18:08:41 -0400
committerKris Maglione <maglione.k@gmail.com>2010-10-02 18:08:41 -0400
commit8ab81562bafef4db599fe03a87888c7e496ce226 (patch)
tree72f71e2dc6ec560885b21a6aa640b993f6a60ef8
parentbc97c417d6bede7d665d9808eb34624037931708 (diff)
downloadpentadactyl-8ab81562bafef4db599fe03a87888c7e496ce226.tar.gz
Remove some duplication in the DTDs. Link to the mailing list web page rather than address.
-rw-r--r--common/components/protocols.js23
-rw-r--r--common/content/about.xul2
-rw-r--r--common/content/base.dtd18
-rw-r--r--common/content/dactyl-overlay.js5
-rw-r--r--common/content/dactyl.js1
-rw-r--r--melodactyl/chrome.manifest1
-rw-r--r--melodactyl/content/dactyl.dtd14
-rw-r--r--melodactyl/defaults/preferences/dactyl.js2
-rw-r--r--melodactyl/locale/en-US/dactyl.dtd4
-rw-r--r--pentadactyl/chrome.manifest1
-rw-r--r--pentadactyl/content/dactyl.dtd25
-rw-r--r--pentadactyl/defaults/preferences/dactyl.js2
-rw-r--r--pentadactyl/locale/en-US/dactyl.dtd4
-rw-r--r--pentadactyl/locale/en-US/intro.xml4
-rw-r--r--teledactyl/chrome.manifest1
-rw-r--r--teledactyl/content/compose/dactyl.dtd1
-rw-r--r--teledactyl/content/dactyl.dtd14
-rw-r--r--teledactyl/defaults/preferences/dactyl.js2
-rw-r--r--teledactyl/locale/en-US/intro.xml4
19 files changed, 66 insertions, 62 deletions
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 @@
<div xmlns="&xmlns.html;" style="text-align: center" id="text-container">
<img src="chrome://&dactyl.name;/content/logo.png" alt="&dactyl.appName;" />
-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 @@
+
+<!ENTITY % dactylBranding SYSTEM "chrome://branding/locale/brand.dtd">
+%dactylBranding;
+
+<!ENTITY dactyl.version "@VERSION@">
+<!ENTITY dactyl.host "&brandShortName;">
+<!ENTITY dactyl.home "http://dactyl.sourceforge.net/">
+<!ENTITY dactyl.apphome "&dactyl.home;&dactyl.name;">
+<!ENTITY dactyl.code "http://code.google.com/p/dactyl/">
+<!ENTITY dactyl.issues "&dactyl.home;bug/&dactyl.name;">
+<!ENTITY dactyl.plugins "http://dactyl.sf.net/&dactyl.name;/plugins">
+<!ENTITY dactyl.list.mailto "&dactyl.name;@googlegroups.com">
+<!ENTITY dactyl.list.href "http://groups.google.com/group/&dactyl.name;">
+
+<!ENTITY xmlns.dactyl "http://vimperator.org/namespaces/liberator">
+<!ENTITY xmlns.html "http://www.w3.org/1999/xhtml">
+<!ENTITY xmlns.xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
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 @@
-<!ENTITY % dactylBranding SYSTEM "chrome://branding/locale/brand.dtd">
-%dactylBranding;
-
<!ENTITY dactyl.mainWindow "mainplayer">
<!ENTITY dactyl.commandContainer "&dactyl.mainWindow;">
<!ENTITY dactyl.statusBefore "statusbar-display">
<!ENTITY dactyl.statusAfter "">
+
<!ENTITY dactyl.name "melodactyl">
<!ENTITY dactyl.appName "Melodactyl">
<!ENTITY dactyl.idName "MELODACTYL">
<!ENTITY dactyl.fileExt "melo">
-<!ENTITY dactyl.host "&brandShortName;">
<!ENTITY dactyl.hostbin "songbird">
-<!ENTITY dactyl.code "http://code.google.com/p/dactyl/">
-<!ENTITY dactyl.maillist "pentadactyl@googlegroups.com">
-<!ENTITY dactyl.plugins "http://dactyl.sf.net/&dactyl.name;/plugins">
-<!ENTITY dactyl.version "1.0">
+<!ENTITY % dactylBase SYSTEM "chrome://dactyl/content/base.dtd">
+%dactylBase;
-<!ENTITY xmlns.dactyl "http://vimperator.org/namespaces/liberator">
-<!ENTITY xmlns.html "http://www.w3.org/1999/xhtml">
-<!ENTITY xmlns.xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
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 @@
-
-<!ENTITY appName "Xulmus">
-<!ENTITY hostapp "Songbird">
-
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 @@
-<!ENTITY % dactylBranding SYSTEM "chrome://branding/locale/brand.dtd">
-%dactylBranding;
-
<!ENTITY dactyl.mainWindow "main-window">
<!ENTITY dactyl.commandContainer "browser-bottombox">
-<!ENTITY dactyl.name "pentadactyl">
-<!ENTITY dactyl.version "1.0">
-<!ENTITY dactyl.idName "PENTADACTYL">
-<!ENTITY dactyl.appName "Pentadactyl">
-<!ENTITY dactyl.apphome "http://dactyl.sf.net/">
-<!ENTITY dactyl.code "http://code.google.com/p/dactyl/">
-<!ENTITY dactyl.plugins "http://dactyl.sf.net/&dactyl.name;/plugins">
-<!ENTITY dactyl.maillist "pentadactyl@googlegroups.com">
-<!ENTITY dactyl.host "&brandShortName;">
-<!ENTITY dactyl.hostbin "firefox">
-<!ENTITY dactyl.fileExt "penta">
<!ENTITY dactyl.statusBefore "statusbar-display">
<!ENTITY dactyl.statusAfter "">
-<!ENTITY xmlns.dactyl "http://vimperator.org/namespaces/liberator">
-<!ENTITY xmlns.html "http://www.w3.org/1999/xhtml">
-<!ENTITY xmlns.xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<!ENTITY dactyl.appName "Pentadactyl">
+<!ENTITY dactyl.idName "PENTADACTYL">
+<!ENTITY dactyl.name "pentadactyl">
+<!ENTITY dactyl.fileExt "penta">
+<!ENTITY dactyl.hostbin "firefox">
+
+<!ENTITY % dactylBase SYSTEM "chrome://dactyl/content/base.dtd">
+%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 @@
-
-<!ENTITY appName "Pentadactyl">
-<!ENTITY hostapp "Firefox">
-
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 @@
<p>
Please send comments, questions, or patches to the
- <link topic="mailto:&dactyl.maillist;">mailing list</link>,
+ <link topic="&dactyl.list.href;">mailing list</link>,
where we will do our best to answer any inquiries. You can also
check the
<link topic="http://code.google.com/p/dactyl/wiki">wiki</link> or
<link topic="http://dactyl.sourceforge.net/pentadactyl/faq">FAQ</link>.
Issue reports can be entered in the
- <link topic="http://code.google.com/p/dactyl/issues/list">issue tracker</link>.
+ <link topic="&dactyl.issues;">issue tracker</link>.
</p>
</document>
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 @@
<!ENTITY xmlns.dactyl "http://vimperator.org/namespaces/liberator">
<!ENTITY xmlns.html "http://www.w3.org/1999/xhtml">
<!ENTITY xmlns.xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
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 @@
-<!ENTITY % dactylBranding SYSTEM "chrome://branding/locale/brand.dtd">
-%dactylBranding;
-
<!ENTITY dactyl.mainWindow "messengerWindow">
<!ENTITY dactyl.commandContainer "&dactyl.mainWindow;">
+<!ENTITY dactyl.statusBefore "">
+<!ENTITY dactyl.statusAfter "statusTextBox">
+
<!ENTITY dactyl.name "teledactyl">
<!ENTITY dactyl.idName "TELEDACTYL">
<!ENTITY dactyl.appName "Teledactyl">
-<!ENTITY dactyl.host "&brandShortName;">
<!ENTITY dactyl.hostbin "thunderbird">
<!ENTITY dactyl.fileExt "tele">
-<!ENTITY dactyl.statusBefore "">
-<!ENTITY dactyl.statusAfter "statusTextBox">
-<!ENTITY xmlns.dactyl "http://vimperator.org/namespaces/liberator">
-<!ENTITY xmlns.html "http://www.w3.org/1999/xhtml">
-<!ENTITY xmlns.xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<!ENTITY % dactylBase SYSTEM "chrome://dactyl/content/base.dtd">
+%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 @@ or <ex>:help :set</ex>.
<p>
Please send comments, questions, or patches to the
- <link topic="mailto:&dactyl.maillist;">mailing list</link>,
+ <link topic="&dactyl.list.href;">mailing list</link>,
where we will do our best to answer any questions. You can also
check the
<link topic="http://code.google.com/p/dactyl/wiki">wiki</link> for
<link topic="http://code.google.com/p/dactyl/wiki/FAQ">FAQ</link>.
Issue reports can be entered in the
- <link topic="http://code.google.com/p/dactyl/issues/list">issue tracker</link>.
+ <link topic="&dactyl.issues;>issue tracker</link>.
</p>
</document>