X-Git-Url: https://git.donarmstrong.com/?p=dactyl.git;a=blobdiff_plain;f=common%2Fmodules%2Fconfig.jsm;h=305880d3cbd5bdae938f6ad985ca10696892f56a;hp=f92ea2258989cf5c8b8518303ce7b96aaf257ec4;hb=8b6fcae7eaa413bc62d645d2d0c99835c47265e6;hpb=5ebd29f56d17f62011cdd596b1d351947ee534ff diff --git a/common/modules/config.jsm b/common/modules/config.jsm index f92ea22..305880d 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -1,25 +1,24 @@ // Copyright (c) 2006-2008 by Martin Stubenschrott // Copyright (c) 2007-2011 by Doug Kearns -// Copyright (c) 2008-2011 by Kris Maglione +// Copyright (c) 2008-2012 Kris Maglione // // 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 = { @@ -109,6 +108,7 @@ var ConfigBase = Class("ConfigBase", { global: ["addons", "base", "io", + ["bookmarkcache", "bookmarkcache"], "buffer", "cache", "commands", @@ -156,7 +156,7 @@ var ConfigBase = Class("ConfigBase", { highlight.loadCSS(this.helpCSS.replace(/__MSG_(.*?)__/g, function (m0, m1) _(m1))); if (!this.haveGecko("2b")) - highlight.loadCSS(); + */)); let hl = highlight.set("Find", ""); hl.onChange = function () { @@ -261,7 +261,7 @@ var ConfigBase = Class("ConfigBase", { } } function processJar(file) { - let jar = services.ZipReader(file); + let jar = services.ZipReader(file.file); if (jar) try { if (jar.hasEntry("chrome.manifest")) @@ -423,9 +423,9 @@ var ConfigBase = Class("ConfigBase", { "xmlns.html": "http://www.w3.org/1999/xhtml", "xmlns.xul": "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", - "tag.command-line": command line, - "tag.status-line": status line, - "mode.command-line": Command Line, + "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: [ @@ -452,21 +452,22 @@ var ConfigBase = Class("ConfigBase", { init: function init() { this.loadConfig(document.documentURI); - let append = - - - ; + 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].* += - ; - append.XUL::broadcasterset[0].* += - ; + 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, @@ -592,12 +593,14 @@ config.INIT = update(Object.create(config.INIT), config.INIT, { 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; }); },