diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-01-10 16:57:47 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-01-10 16:57:47 -0500 |
commit | 893ed79637dec5369e21e092e7e0136f9bd3440f (patch) | |
tree | 5c32df0d25d6643899591301dd65048bd20d42ee /common | |
parent | 2da26d95e630b59acc9af54fcf7a96e1be900500 (diff) | |
download | pentadactyl-893ed79637dec5369e21e092e7e0136f9bd3440f.tar.gz |
Fix deleting files after viewing them from source links in :list*.
Diffstat (limited to 'common')
-rw-r--r-- | common/Makefile | 4 | ||||
-rwxr-xr-x | common/bootstrap.js | 16 | ||||
-rw-r--r-- | common/content/buffer.js | 63 | ||||
-rw-r--r-- | common/content/statusline.js | 2 | ||||
-rw-r--r-- | common/modules/base.jsm | 80 | ||||
-rw-r--r-- | common/modules/bookmarkcache.jsm | 4 | ||||
-rw-r--r-- | common/modules/completion.jsm | 4 | ||||
-rw-r--r-- | common/modules/config.jsm | 4 | ||||
-rw-r--r-- | common/modules/finder.jsm | 4 | ||||
-rw-r--r-- | common/modules/highlight.jsm | 4 | ||||
-rw-r--r-- | common/modules/io.jsm | 4 | ||||
-rw-r--r-- | common/modules/javascript.jsm | 4 | ||||
-rw-r--r-- | common/modules/overlay.jsm | 4 | ||||
-rw-r--r-- | common/modules/prefs.jsm | 4 | ||||
-rw-r--r-- | common/modules/sanitizer.jsm | 4 | ||||
-rw-r--r-- | common/modules/services.jsm | 4 | ||||
-rw-r--r-- | common/modules/storage.jsm | 4 | ||||
-rw-r--r-- | common/modules/styles.jsm | 4 | ||||
-rw-r--r-- | common/modules/template.jsm | 4 | ||||
-rw-r--r-- | common/modules/util.jsm | 4 | ||||
-rw-r--r-- | common/process_manifest.awk | 11 |
21 files changed, 98 insertions, 138 deletions
diff --git a/common/Makefile b/common/Makefile index 47789fda..51ff6197 100644 --- a/common/Makefile +++ b/common/Makefile @@ -8,7 +8,7 @@ GOOGLE_PROJ = dactyl GOOGLE = https://$(GOOGLE_PROJ).googlecode.com/files VERSION ?= $(shell sed -n 's/.*em:version\(>\|="\)\(.*\)["<].*/\2/p' $(TOP)/install.rdf | sed 1q) UUID := $(shell sed -n 's/.*em:id\(>\|="\)\(.*\)["<].*/\2/p' $(TOP)/install.rdf | sed 1q) -MANGLE := $(shell date | md5sum - | awk '{ print $$1 }') +MANGLE := $(shell date '+%s' | awk '{ printf "%x", $$1 }') LOCALEDIR = locale DOC_FILES = $(wildcard $(LOCALEDIR)/*/*.xml) @@ -163,7 +163,7 @@ $(XPI): $(CHROME) @echo "Building XPI..." mkdir -p $(XPI_PATH) - $(AWK) -v 'name=$(NAME)' -v 'chrome=$(MANGLE)' \ + $(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \ -f $(BASE)/process_manifest.awk \ $(TOP)/chrome.manifest >$(XPI_PATH)/chrome.manifest diff --git a/common/bootstrap.js b/common/bootstrap.js index bee3e51c..9ce8dec5 100755 --- a/common/bootstrap.js +++ b/common/bootstrap.js @@ -47,7 +47,6 @@ let basePath = null; let components = {}; let getURI = null; storage.set("dactyl.bootstrap", this); -var JSMLoader = storage.get("dactyl.JSMLoader", { get load() Cu.import }); function startup(data, reason) { dump("dactyl: bootstrap: startup " + reasonToString(reason) + "\n"); @@ -62,7 +61,7 @@ function startup(data, reason) { AddonManager.getAddonByID(addon.id, function (a) { addon = a; }); // Temporary hack. - if (basePath.isDirectory() && JSMLoader.bump == null) + if (basePath.isDirectory() && false && JSMLoader.bump == null) JSMLoader.bump = 1; if (basePath.isDirectory()) @@ -147,17 +146,26 @@ function init() { break; case "resource": + let str = "dactyl-"; + if (fields[1].indexOf(str) == 0) + var prefix = fields[1].substr(str.length); + resourceProto.setSubstitution(fields[1], getURI(fields[2])); } } - JSMLoader.load("resource://dactyl/base.jsm", global); + if (typeof JSMLoader === "undefined") + Cu.import("resource://dactyl/bootstrap.jsm", global); + else { + Cu.import("resource://dactyl/bootstrap.jsm", {}).JSMLoader = JSMLoader; + JSMLoader.load("resource://dactyl/bootstrap.jsm", global); + } for each (let component in components) component.register(); Services.obs.notifyObservers(null, "dactyl-rehash", null); - JSMLoader.load("resource://dactyl/base.jsm", global); + JSMLoader.load("resource://dactyl/bootstrap.jsm", global); require(global, "services"); diff --git a/common/content/buffer.js b/common/content/buffer.js index 8da18e26..97017ff0 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -345,7 +345,7 @@ var Buffer = Module("buffer", { * buffer. Only returns style sheets for the 'screen' media type. */ get alternateStyleSheets() { - let stylesheets = window.getAllStyleSheets(buffer.focusedFrame); + let stylesheets = window.getAllStyleSheets(this.focusedFrame); return stylesheets.filter( function (stylesheet) /^(screen|all|)$/i.test(stylesheet.media.mediaText) && !/^\s*$/.test(stylesheet.title) @@ -362,9 +362,9 @@ var Buffer = Module("buffer", { * @property {number} True when the buffer is fully loaded. */ get loaded() Math.min.apply(null, - buffer.allFrames() - .map(function (frame) ["loading", "interactive", "complete"] - .indexOf(frame.document.readyState))), + this.allFrames() + .map(function (frame) ["loading", "interactive", "complete"] + .indexOf(frame.document.readyState))), /** * @property {Object} The local state store for the currently selected @@ -425,7 +425,7 @@ var Buffer = Module("buffer", { * @property {number} The buffer's horizontal scroll percentile. */ get scrollXPercent() { - let elem = buffer.findScrollable(0, true); + let elem = this.findScrollable(0, true); if (elem.scrollWidth - elem.clientWidth === 0) return 0; return elem.scrollLeft * 100 / (elem.scrollWidth - elem.clientWidth); @@ -435,7 +435,7 @@ var Buffer = Module("buffer", { * @property {number} The buffer's vertical scroll percentile. */ get scrollYPercent() { - let elem = buffer.findScrollable(0, false); + let elem = this.findScrollable(0, false); if (elem.scrollHeight - elem.clientHeight === 0) return 0; return elem.scrollTop * 100 / (elem.scrollHeight - elem.clientHeight); @@ -491,7 +491,7 @@ var Buffer = Module("buffer", { * @returns {string} */ getCurrentWord: function (win) { - win = win || buffer.focusedFrame || content; + win = win || this.focusedFrame || content; let selection = win.getSelection(); if (selection.rangeCount == 0) return ""; @@ -545,7 +545,7 @@ var Buffer = Module("buffer", { if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); - buffer.lastInputField = elem; + this.lastInputField = elem; } else { if (isinstance(elem, [HTMLInputElement, XULTextBoxElement])) @@ -635,11 +635,11 @@ var Buffer = Module("buffer", { } } - for (let frame in values(buffer.allFrames(null, true))) + for (let frame in values(this.allFrames(null, true))) for (let elem in followFrame(frame)) if (count-- === 0) { if (follow) - buffer.followLink(elem, dactyl.CURRENT_TAB); + this.followLink(elem, dactyl.CURRENT_TAB); return elem; } @@ -660,7 +660,7 @@ var Buffer = Module("buffer", { let { left: offsetX, top: offsetY } = elem.getBoundingClientRect(); if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) - return buffer.focusElement(elem); + return this.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); @@ -690,7 +690,7 @@ var Buffer = Module("buffer", { dactyl.log("Invalid where argument for followLink()", 0); } - buffer.focusElement(elem); + this.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); @@ -758,7 +758,7 @@ var Buffer = Module("buffer", { _scrollByScrollSize: function _scrollByScrollSize(count, direction) { if (count > 0) options["scroll"] = count; - buffer.scrollByScrollSize(direction); + this.scrollByScrollSize(direction); }, /** @@ -774,7 +774,7 @@ var Buffer = Module("buffer", { count = count || 1; if (options["scroll"] > 0) - this.scrollLines(options["scroll"] * direction); + this.scrollVertical("lines", options["scroll"] * direction); else this.scrollVertical("pages", direction / 2); }, @@ -790,14 +790,14 @@ var Buffer = Module("buffer", { } try { - var elem = buffer.focusedFrame.document.activeElement; + var elem = this.focusedFrame.document.activeElement; if (elem == elem.ownerDocument.body) elem = null; } catch (e) {} try { - var sel = buffer.focusedFrame.getSelection(); + var sel = this.focusedFrame.getSelection(); } catch (e) {} if (!elem && sel && sel.rangeCount) @@ -806,11 +806,11 @@ var Buffer = Module("buffer", { elem = find(elem); if (!(elem instanceof Element)) { - let doc = buffer.findScrollableWindow().document; + let doc = this.findScrollableWindow().document; elem = find(doc.body || doc.getElementsByTagName("body")[0] || doc.documentElement); } - let doc = buffer.focusedFrame.document; + let doc = this.focusedFrame.document; return elem || doc.body || doc.documentElement; }, @@ -846,7 +846,7 @@ var Buffer = Module("buffer", { if (!(content.document instanceof HTMLDocument)) return; - let frames = buffer.allFrames(); + let frames = this.allFrames(); if (frames.length == 0) // currently top is always included return; @@ -858,7 +858,7 @@ var Buffer = Module("buffer", { rect.width && rect.height); // find the currently focused frame index - let current = Math.max(0, frames.indexOf(buffer.focusedFrame)); + let current = Math.max(0, frames.indexOf(this.focusedFrame)); // calculate the next frame to focus let next = current + count; @@ -921,7 +921,7 @@ var Buffer = Module("buffer", { let option = sections || options["pageinfo"]; let list = template.map(option, function (option) { - let opt = buffer.pageInfo[option]; + let opt = this.pageInfo[option]; return opt ? template.table(opt[1], opt[0](true)) : undefined; }, <br/>); dactyl.echo(list, commandline.FORCE_MULTILINE); @@ -945,7 +945,7 @@ var Buffer = Module("buffer", { // copied (and tuned somewhat) from browser.jar -> nsContextMenu.js let win = document.commandDispatcher.focusedWindow; if (win == window) - win = buffer.focusedFrame; + win = this.focusedFrame; let charset = win ? "charset=" + win.document.characterSet : null; @@ -964,7 +964,7 @@ var Buffer = Module("buffer", { * @param {boolean} useExternalEditor View the source in the external editor. */ viewSource: function (url, useExternalEditor) { - let doc = buffer.focusedFrame.document; + let doc = this.focusedFrame.document; if (isArray(url)) { if (options.get("editor").has("line")) @@ -1006,9 +1006,9 @@ var Buffer = Module("buffer", { XPCOM([Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference]), { init: function (doc, callback) { this.callback = callable(callback) ? callback : - function (file) { + function (file, temp) { editor.editFileExternally({ file: file.path, line: callback }, - function () { file.remove(false); }); + function () { temp && file.remove(false); }); return true; }; @@ -1019,12 +1019,12 @@ var Buffer = Module("buffer", { let encoder = services.HtmlEncoder(); encoder.init(doc, "text/unicode", encoder.OutputRaw|encoder.OutputPreformatted); temp.write(encoder.encodeToString(), ">"); - return this.callback(temp); + return this.callback(temp, true); }, this, true); let file = util.getFile(uri); if (file) - this.callback(file); + this.callback(file, false); else { this.file = io.createTempFile(); var persist = services.Persist(); @@ -1038,7 +1038,7 @@ var Buffer = Module("buffer", { onStateChange: function (progress, request, flag, status) { if ((flag & Ci.nsIWebProgressListener.STATE_STOP) && status == 0) { try { - var ok = this.callback(this.file); + var ok = this.callback(this.file, true); } finally { if (ok !== true) @@ -1056,7 +1056,7 @@ var Buffer = Module("buffer", { * @param {boolean} fullZoom Whether to use full zoom or text zoom. */ zoomIn: function (steps, fullZoom) { - buffer.bumpZoomLevel(steps, fullZoom); + this.bumpZoomLevel(steps, fullZoom); }, /** @@ -1066,7 +1066,7 @@ var Buffer = Module("buffer", { * @param {boolean} fullZoom Whether to use full zoom or text zoom. */ zoomOut: function (steps, fullZoom) { - buffer.bumpZoomLevel(-steps, fullZoom); + this.bumpZoomLevel(-steps, fullZoom); }, setZoom: function setZoom(value, fullZoom) { @@ -1099,11 +1099,12 @@ var Buffer = Module("buffer", { if (i == cur && fullZoom == ZoomManager.useFullZoom) dactyl.beep(); - buffer.setZoom(Math.round(values[i] * 100), fullZoom); + this.setZoom(Math.round(values[i] * 100), fullZoom); } }, { ZOOM_MIN: Class.memoize(function () prefs.get("zoom.minPercent")), ZOOM_MAX: Class.memoize(function () prefs.get("zoom.maxPercent")), + setZoom: deprecated("Please use buffer.setZoom instead", function setZoom() buffer.setZoom.apply(buffer, arguments)), bumpZoomLevel: deprecated("Please use buffer.bumpZoomLevel instead", function bumpZoomLevel() buffer.bumpZoomLevel.apply(buffer, arguments)), diff --git a/common/content/statusline.js b/common/content/statusline.js index 2bc9660b..888336a7 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -230,7 +230,7 @@ var StatusLine = Module("statusline", { if (progress <= 0) progressStr = "[ Loading... ]"; else if (progress < 1) { - progress = Math.floor(progress * 20); + progress = Math.round(progress * 20); progressStr = "[" + "===================> " .substr(20 - progress, 20) diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 3e21d753..c30c734a 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -1,76 +1,14 @@ -// Copyright (c) 2009-2010 by Kris Maglione <maglione.k@gmail.com> +// Copyright (c) 2009-2011 by 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"; -if (!JSMLoader || JSMLoader.bump != 1) - var JSMLoader = { - bump: 1, - builtin: Components.utils.Sandbox(this), - canonical: {}, - factories: [], - globals: {}, - io: Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService), - manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar), - stale: {}, - getTarget: function getTarget(url) { - let chan = this.io.newChannel(url, null, null); - chan.cancel(Components.results.NS_BINDING_ABORTED); - return chan.name; - }, - load: function load(url, target) { - let stale = this.stale[url]; - if (stale) { - delete this.stale[url]; - - let global = this.globals[url]; - for each (let prop in Object.getOwnPropertyNames(global)) - try { - if (!(prop in this.builtin) && - [this, set].indexOf(Object.getOwnPropertyDescriptor(global, prop).value) < 0 && - !global.__lookupGetter__(prop)) - global[prop] = undefined; - } - catch (e) { - dump("Deleting property " + prop + " on " + url + ":\n " + e + "\n"); - Components.utils.reportError(e); - } - - if (stale === this.getTarget(url)) - Components.classes["@mozilla.org/moz/jssubscript-loader;1"] - .getService(Components.interfaces.mozIJSSubScriptLoader) - .loadSubScript(url, global); - } - - let global = Components.utils.import(url, target); - return this.globals[url] = global; - }, - cleanup: function unregister() { - for each (let factory in this.factories.splice(0)) - this.manager.unregisterFactory(factory.classID, factory); - }, - purge: function purge() { - for (let [url, global] in Iterator(this.globals)) - this.stale[url] = this.getTarget(url); - }, - registerFactory: function registerFactory(factory) { - this.manager.registerFactory(factory.classID, - String(factory.classID), - factory.contractID, - factory); - this.factories.push(factory); - } - }; - var Cc = Components.classes; var Ci = Components.interfaces; var Cr = Components.results; var Cu = Components.utils; -Cc["@mozilla.org/fuel/application;1"].getService(Ci.fuelIApplication) - .storage.set("dactyl.JSMLoader", JSMLoader); - Cu.import("resource://gre/modules/XPCOMUtils.jsm"); try { var ctypes; @@ -161,8 +99,10 @@ if (!Object.keys) let use = {}; let loaded = {}; let currentModule; -function defineModule(name, params) { - let module = Cu.getGlobalForObject ? Cu.getGlobalForObject(params) : params.__parent__; +let global = this; +function defineModule(name, params, module) { + if (!module) + module = Cu.getGlobalForObject ? Cu.getGlobalForObject(params) : params.__parent__; module.NAME = name; module.EXPORTED_SYMBOLS = params.exports || []; @@ -230,7 +170,7 @@ function endModule() { function require(obj, name, from) { try { defineModule.loadLog.push((from || "require") + ": loading " + name + " into " + obj.NAME); - JSMLoader.load("resource://dactyl/" + name + ".jsm", obj); + JSMLoader.load(name + ".jsm", obj); } catch (e) { defineModule.dump("loading " + String.quote("resource://dactyl/" + name + ".jsm") + "\n"); @@ -252,7 +192,7 @@ defineModule("base", { "require", "set", "update", "values", "withCallerGlobal" ], use: ["config", "services", "util"] -}); +}, this); function Runnable(self, func, args) { return { @@ -329,12 +269,14 @@ function deprecated(reason, fn) { function deprecatedMethod() { let frame = Components.stack.caller; - let obj = this.className || this.constructor.className; + let obj = this.className ? this.className + "#" : + this.constructor.className ? this.constructor.className + "#" : + ""; let filename = frame.filename.replace(/.* -> /, ""); if (!set.add(deprecatedMethod.seen, filename)) util.dactyl(fn).echoerr( util.urlPath(filename || "unknown") + ":" + frame.lineNumber + ": " + - (obj ? obj + "." : "") + (fn.name || name) + " is deprecated: " + reason); + obj + (fn.name || name) + " is deprecated: " + reason); return func.apply(this, arguments); } deprecatedMethod.seen = { diff --git a/common/modules/bookmarkcache.jsm b/common/modules/bookmarkcache.jsm index 3e1273d6..ebea960b 100644 --- a/common/modules/bookmarkcache.jsm +++ b/common/modules/bookmarkcache.jsm @@ -4,11 +4,11 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("bookmarkcache", { exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"], require: ["services", "storage", "util"] -}); +}, this); var Bookmark = Struct("url", "title", "icon", "post", "keyword", "tags", "charset", "id"); var Keyword = Struct("keyword", "title", "icon", "url"); diff --git a/common/modules/completion.jsm b/common/modules/completion.jsm index aa32821f..fd8e9307 100644 --- a/common/modules/completion.jsm +++ b/common/modules/completion.jsm @@ -8,11 +8,11 @@ try { -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("completion", { exports: ["CompletionContext", "Completion", "completion"], use: ["config", "template", "util"] -}); +}, this); /** * Creates a new completion context. diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 580e5ad8..309e7bea 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -8,12 +8,12 @@ try { -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("config", { exports: ["ConfigBase", "Config", "config"], require: ["highlight", "services", "storage", "util", "template"], use: ["io"] -}); +}, this); var ConfigBase = Class("ConfigBase", { /** diff --git a/common/modules/finder.jsm b/common/modules/finder.jsm index 0bfaf54e..94d607d0 100644 --- a/common/modules/finder.jsm +++ b/common/modules/finder.jsm @@ -4,11 +4,11 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("finder", { exports: ["RangeFind", "RangeFinder", "rangefinder"], use: ["prefs", "services", "util"] -}); +}, this); /** @instance rangefinder */ var RangeFinder = Module("rangefinder", { diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index 67545814..00ee36cc 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -4,12 +4,12 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("highlight", { exports: ["Highlight", "Highlights", "highlight"], require: ["services", "styles", "util"], use: ["template"] -}); +}, this); var Highlight = Struct("class", "selector", "sites", "defaultExtends", "defaultValue", diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 5ced4058..4651eca1 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -9,12 +9,12 @@ try { -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("io", { exports: ["IO", "io"], require: ["services"], use: ["config", "storage", "styles", "template", "util"] -}); +}, this); // TODO: why are we passing around strings rather than file objects? /** diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index 2dd6c8cf..eaeb1402 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -6,11 +6,11 @@ try { -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("javascript", { exports: ["JavaScript", "javascript"], use: ["services", "template", "util"], -}); +}, this); // TODO: Clean this up. diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm index 07937f4c..d6691927 100644 --- a/common/modules/overlay.jsm +++ b/common/modules/overlay.jsm @@ -4,11 +4,11 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("overlay", { exports: ["ModuleBase"], require: ["config", "sanitizer", "services", "util"] -}); +}, this); /** * @class ModuleBase diff --git a/common/modules/prefs.jsm b/common/modules/prefs.jsm index 4ade793c..4e2039c3 100644 --- a/common/modules/prefs.jsm +++ b/common/modules/prefs.jsm @@ -6,12 +6,12 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("prefs", { exports: ["Prefs", "localPrefs", "prefs"], require: ["services", "util"], use: ["config", "template"] -}); +}, this); var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), { SAVED: "extensions.dactyl.saved.", diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index 08d5fa27..aa4dad1e 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -14,11 +14,11 @@ try { -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("sanitizer", { exports: ["Range", "Sanitizer", "sanitizer"], require: ["prefs", "services", "storage", "template", "util"] -}); +}, this); let tmp = {}; services.subscriptLoader.loadSubScript("chrome://browser/content/sanitize.js", tmp); diff --git a/common/modules/services.jsm b/common/modules/services.jsm index 8cd60af9..42544295 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -7,11 +7,11 @@ try { var global = this; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("services", { exports: ["AddonManager", "services"], use: ["util"] -}); +}, this); /** * A lazily-instantiated XPCOM class and service cache. diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 18a701bb..da2e97a6 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -5,11 +5,11 @@ "use strict"; var myObject = Object; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("storage", { exports: ["File", "storage"], require: ["services", "util"] -}); +}, this); var win32 = /^win(32|nt)$/i.test(services.runtime.OS); diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index 3321dbc2..ecc5b29c 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -4,12 +4,12 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("styles", { exports: ["Style", "Styles", "styles"], require: ["services", "util"], use: ["template"] -}); +}, this); function cssUri(css) "chrome-data:text/css," + encodeURI(css); var namespace = "@namespace html " + XHTML.uri.quote() + ";\n" + diff --git a/common/modules/template.jsm b/common/modules/template.jsm index c13158e3..33a90486 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -4,12 +4,12 @@ // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("template", { exports: ["Template", "template"], require: ["util"], use: ["services"] -}); +}, this); default xml namespace = XHTML; diff --git a/common/modules/util.jsm b/common/modules/util.jsm index a3fa9d73..bb1d357f 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -8,12 +8,12 @@ try { -Components.utils.import("resource://dactyl/base.jsm"); +Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("util", { exports: ["FailedAssertion", "Math", "NS", "Point", "Util", "XBL", "XHTML", "XUL", "util"], require: ["services"], use: ["config", "highlight", "storage", "template"] -}); +}, this); var XBL = Namespace("xbl", "http://www.mozilla.org/xbl"); var XHTML = Namespace("html", "http://www.w3.org/1999/xhtml"); diff --git a/common/process_manifest.awk b/common/process_manifest.awk index 5a9c6eaa..c47772f0 100644 --- a/common/process_manifest.awk +++ b/common/process_manifest.awk @@ -1,4 +1,8 @@ -BEGIN { if (!chrome) chrome = "chrome" } +BEGIN { + chrome = "chrome" + if (suffix) + chrome = suffix +} { content = $1 ~ /^(content|skin|locale|resource)$/ } content && $NF ~ /^[a-z]/ { $NF = "/" name "/" $NF } content { @@ -11,5 +15,10 @@ content { { sub("^\\.\\./common/", "", $NF) print + if (content && suffix && $1 == "resource") { + $2 = $2 "-" suffix + print + } } +# vim:se sts=4 sw=4 et ft=awk: |