diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index cde225c1..f3d69823 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -32,10 +32,8 @@ var Abbreviation = Class("Abbreviation", { get modeChar() Abbreviation.modeChar(this.modes) }, { modeChar: function (_modes) { - let result = ""; - for (let [, mode] in Iterator(_modes)) - result += modes.getMode(mode).char; - if (/^(ic|ci)$/(result)) + let result = array.uniq(_modes.map(function (m) m.char)).join(""); + if (result == "ci") result = "!"; return result; } diff --git a/common/content/mappings.js b/common/content/mappings.js index ada6e35d..4cd189d3 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -527,7 +527,6 @@ var Mappings = Module("mappings", { return null; } function uniqueModes(modes) { - modes = modes.map(modules.modes.closure.getMode); let chars = [k for ([k, v] in Iterator(modules.modes.modeChars)) if (v.every(function (mode) modes.indexOf(mode) >= 0))]; return array.uniq(modes.filter(function (m) chars.indexOf(m.char) < 0).concat(chars)); diff --git a/common/content/modes.js b/common/content/modes.js index 1f1b2638..66b55c86 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -228,10 +228,11 @@ var Modes = Module("modes", { getStack: function (idx) this._modeStack[this._modeStack.length - idx - 1] || this._modeStack[0], - getCharModes: function (chr) [m for (m in values(this._modeMap)) if (m.char == chr)], + getCharModes: function (chr) (this.modeChars[chr] || []).slice(), matchModes: function (obj) - [m for (m in values(this._modeMap)) if (Object.keys(obj).every(function (k) obj[k] == (m[k] || false)))], + this._modes.filter(function (mode) Object.keys(obj) + .every(function (k) obj[k] == (mode[k] || false))), // show the current mode string in the command line show: function show() { diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 8cd98383..e239825e 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -159,7 +159,11 @@ function defineModule(name, params) { defineModule.loadLog = []; Object.defineProperty(defineModule.loadLog, "push", { - value: function (val) { defineModule.dump(val + "\n"); this[this.length] = val; } + value: function (val) { + if (false) + defineModule.dump(val + "\n"); + this[this.length] = Date.now() + " " + val; + } }); defineModule.dump = function dump_() { let msg = Array.map(arguments, function (msg) { diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm index ecf63ec5..837ddf2e 100644 --- a/common/modules/overlay.jsm +++ b/common/modules/overlay.jsm @@ -250,7 +250,7 @@ var Overlay = Module("Overlay", { deferredInit["load"].forEach(call); modules.times = update({}, defineModule.times); - util.dump("Loaded in " + (Date.now() - start) + "ms"); + defineModule.loadLog.push("Loaded in " + (Date.now() - start) + "ms"); modules.events.addSessionListener(window, "unload", function onUnload() { window.removeEventListener("unload", onUnload.wrapped, false); diff --git a/common/modules/util.jsm b/common/modules/util.jsm index ce70bbd2..6457c14a 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -932,7 +932,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), observe: { "dactyl-cleanup-modules": function () { - util.dump("dactyl: util: observe: dactyl-cleanup-modules"); + defineModule.loadLog.push("dactyl: util: observe: dactyl-cleanup-modules"); for (let module in values(defineModule.modules)) if (module.cleanup) { @@ -945,12 +945,12 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), "dactyl-rehash": function () { services.observer.removeObserver(this, "dactyl-rehash"); - util.dump("dactyl: util: observe: dactyl-rehash"); + defineModule.loadLog.push("dactyl: util: observe: dactyl-rehash"); if (this.rehashing) JSMLoader.purge(); else for (let module in values(defineModule.modules)) { - util.dump("dactyl: util: init(" + module + ")"); + defineModule.loadLog.push("dactyl: util: init(" + module + ")"); if (module.reinit) module.reinit(); else @@ -974,7 +974,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), if (!window.dactylOverlays) window.dactylOverlays = []; - util.dump("load overlays", window.document.documentURI); + defineModule.loadLog.push("load overlays " + window.document.documentURI); for each (let obj in util.overlays[window.document.documentURI] || []) { if (window.dactylOverlays.indexOf(obj) >= 0) @@ -988,7 +988,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), if (!doc.dactylOverlayElements) doc.dactylOverlayElements = []; - util.dump("load overlay", doc.documentURI, String(obj).substr(0, 60)); + defineModule.loadLog.push("load overlays " + doc.documentURI + " " + String(obj).substr(0, 60)); function overlay(key, fn) { if (obj[key]) { diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index f1da3abf..5daa50ef 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -1,4 +1,4 @@ -1.0b4pre: +1.0b4: * Extensive Firefox 4 support, including: - Fully restartless. Can now be installed, uninstalled, enabled, disabled, and upgraded without restarting Firefox. diff --git a/pentadactyl/install.rdf b/pentadactyl/install.rdf index 7e7429b7..b5f1899d 100644 --- a/pentadactyl/install.rdf +++ b/pentadactyl/install.rdf @@ -4,7 +4,7 @@