// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
+// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-/* use strict */
+"use strict";
let global = this;
-Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("config", {
exports: ["ConfigBase", "Config", "config"],
require: ["dom", "io", "protocol", "services", "util", "template"]
-}, this);
+});
-this.lazyRequire("addons", ["AddonManager"]);
-this.lazyRequire("cache", ["cache"]);
-this.lazyRequire("highlight", ["highlight"]);
-this.lazyRequire("messages", ["_"]);
-this.lazyRequire("prefs", ["localPrefs", "prefs"]);
-this.lazyRequire("storage", ["storage", "File"]);
-this.lazyRequire("styles", ["Styles"]);
+lazyRequire("addons", ["AddonManager"]);
+lazyRequire("cache", ["cache"]);
+lazyRequire("highlight", ["highlight"]);
+lazyRequire("messages", ["_"]);
+lazyRequire("prefs", ["localPrefs", "prefs"]);
+lazyRequire("storage", ["storage", "File"]);
+lazyRequire("styles", ["Styles"]);
function AboutHandler() {}
AboutHandler.prototype = {
global: ["addons",
"base",
"io",
+ ["bookmarkcache", "bookmarkcache"],
"buffer",
"cache",
"commands",
highlight.loadCSS(this.helpCSS.replace(/__MSG_(.*?)__/g, function (m0, m1) _(m1)));
if (!this.haveGecko("2b"))
- highlight.loadCSS(<![CDATA[
+ highlight.loadCSS(literal(/*
!TabNumber font-weight: bold; margin: 0px; padding-right: .8ex;
!TabIconNumber {
font-weight: bold;
text-align: center;
text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px;
}
- ]]>);
+ */));
let hl = highlight.set("Find", "");
hl.onChange = function () {
}
}
function processJar(file) {
- let jar = services.ZipReader(file);
+ let jar = services.ZipReader(file.file);
if (jar)
try {
if (jar.hasEntry("chrome.manifest"))
"xmlns.html": "http://www.w3.org/1999/xhtml",
"xmlns.xul": "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "tag.command-line": <link topic="command-line">command line</link>,
- "tag.status-line": <link topic="status-line">status line</link>,
- "mode.command-line": <link topic="command-line-mode">Command Line</link>,
+ "tag.command-line": ["link", { xmlns: "dactyl", topic: "command-line" }, "command line"],
+ "tag.status-line": ["link", { xmlns: "dactyl", topic: "status-line" }, "status line"],
+ "mode.command-line": ["link", { xmlns: "dactyl", topic: "command-line-mode" }, "Command Line"]
},
dtdStrings: [
init: function init() {
this.loadConfig(document.documentURI);
- let append = <e4x xmlns={XUL} xmlns:dactyl={NS}>
- <menupopup id="viewSidebarMenu"/>
- <broadcasterset id="mainBroadcasterSet"/>
- </e4x>;
+ let append = [
+ ["menupopup", { id: "viewSidebarMenu", xmlns: "xul" }],
+ ["broadcasterset", { id: "mainBroadcasterSet", xmlns: "xul" }]];
+
for each (let [id, [name, key, uri]] in Iterator(this.sidebars)) {
- append.XUL::menupopup[0].* +=
- <menuitem observes={"pentadactyl-" + id + "Sidebar"} label={name} accesskey={key} xmlns={XUL}/>;
- append.XUL::broadcasterset[0].* +=
- <broadcaster id={"pentadactyl-" + id + "Sidebar"}
- autoCheck="false" type="checkbox" group="sidebar"
- sidebartitle={name} sidebarurl={uri}
- oncommand="toggleSidebar(this.id || this.observes);" xmlns={XUL}/>;
+ append[0].push(
+ ["menuitem", { observes: "pentadactyl-" + id + "Sidebar", label: name,
+ accesskey: key }]);
+ append[1].push(
+ ["broadcaster", { id: "pentadactyl-" + id + "Sidebar", autoCheck: "false",
+ type: "checkbox", group: "sidebar", sidebartitle: name,
+ sidebarurl: uri,
+ oncommand: "toggleSidebar(this.id || this.observes);" }]);
}
- util.overlayWindow(window, { append: append.elements() });
+ util.overlayWindow(window, { append: append });
},
get window() window,
let img = window.Image();
img.src = this.logo || "resource://dactyl-local-content/logo.png";
img.onload = util.wrapCallback(function () {
- highlight.loadCSS(<>{"!Logo {"}
+ highlight.loadCSS(literal(/*
+ !Logo {
display: inline-block;
- background: url({img.src});
- width: {img.width}px;
- height: {img.height}px;
- {"}"}</>);
+ background: url({src});
+ width: {width}px;
+ height: {height}px;
+ }
+ */).replace(/\{(.*?)\}/g, function (m, m1) img[m1]));
img = null;
});
},