mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-05 15:04:11 +01:00
Support Firefox 45 (without e10s).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// Copyright (c) 2010 by anekos <anekos@snca.net>
|
||||
// Copyright (c) 2010-2014 Kris Maglione <maglione.k at Gmail>
|
||||
// Copyright (c) 2010-2015 Kris Maglione <maglione.k at Gmail>
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -142,8 +142,8 @@ var AbbrevHive = Class("AbbrevHive", Contexts.Hive, {
|
||||
*/
|
||||
get: function (mode, lhs) {
|
||||
let abbrevs = this._store[mode];
|
||||
return abbrevs && hasOwnProperty(abbrevs, lhs) ? abbrevs[lhs]
|
||||
: null;
|
||||
return abbrevs && hasOwnProp(abbrevs, lhs) ? abbrevs[lhs]
|
||||
: null;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -225,28 +225,29 @@ var Abbreviations = Module("abbreviations", {
|
||||
nonkeyword: /[ "']/
|
||||
};
|
||||
|
||||
this._match = util.regexp(literal(function () /*
|
||||
this._match = util.regexp(String.raw`
|
||||
(^ | \s | <nonkeyword>) (<keyword>+ )$ | // full-id
|
||||
(^ | \s | <keyword> ) (<nonkeyword>+ <keyword>)$ | // end-id
|
||||
(^ | \s ) (\S* <nonkeyword> )$ // non-id
|
||||
*/$), "x", params);
|
||||
this._check = util.regexp(literal(function () /*
|
||||
`, "x", params);
|
||||
|
||||
this._check = util.regexp(String.raw`
|
||||
^ (?:
|
||||
<keyword>+ | // full-id
|
||||
<nonkeyword>+ <keyword> | // end-id
|
||||
\S* <nonkeyword> // non-id
|
||||
) $
|
||||
*/$), "x", params);
|
||||
`, "x", params);
|
||||
},
|
||||
|
||||
get allHives() { return contexts.allGroups.abbrevs; },
|
||||
|
||||
get userHives() { return this.allHives.filter(h => h !== this.builtin); },
|
||||
|
||||
get: deprecated("group.abbrevs.get", { get: function get() this.user.bound.get }),
|
||||
set: deprecated("group.abbrevs.set", { get: function set() this.user.bound.set }),
|
||||
remove: deprecated("group.abbrevs.remove", { get: function remove() this.user.bound.remove }),
|
||||
removeAll: deprecated("group.abbrevs.clear", { get: function removeAll() this.user.bound.clear }),
|
||||
get: deprecated("group.abbrevs.get", { get: function get() { return this.user.bound.get; } }),
|
||||
set: deprecated("group.abbrevs.set", { get: function set() { return this.user.bound.set; } }),
|
||||
remove: deprecated("group.abbrevs.remove", { get: function remove() { return this.user.bound.remove; } }),
|
||||
removeAll: deprecated("group.abbrevs.clear", { get: function removeAll() { return this.user.bound.clear; } }),
|
||||
|
||||
/**
|
||||
* Returns the abbreviation for the given *mode* if *text* matches the
|
||||
|
||||
@@ -79,9 +79,9 @@ var AutoCommands = Module("autocommands", {
|
||||
return contexts.allGroups.autocmd.filter(h => h._store.length);
|
||||
},
|
||||
|
||||
add: deprecated("group.autocmd.add", { get: function add() autocommands.user.bound.add }),
|
||||
get: deprecated("group.autocmd.get", { get: function get() autocommands.user.bound.get }),
|
||||
remove: deprecated("group.autocmd.remove", { get: function remove() autocommands.user.bound.remove }),
|
||||
add: deprecated("group.autocmd.add", { get: function add() { return autocommands.user.bound.add; } }),
|
||||
get: deprecated("group.autocmd.get", { get: function get() { return autocommands.user.bound.get; } }),
|
||||
remove: deprecated("group.autocmd.remove", { get: function remove() { return autocommands.user.bound.remove; } }),
|
||||
|
||||
/**
|
||||
* Lists all autocommands with a matching *event*, *regexp* and optionally
|
||||
|
||||
@@ -77,7 +77,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
if (id != null)
|
||||
var bmark = bookmarkcache.bookmarks[id];
|
||||
else if (!force) {
|
||||
if (keyword && hasOwnProperty(bookmarkcache.keywords, keyword))
|
||||
if (keyword && hasOwnProp(bookmarkcache.keywords, keyword))
|
||||
bmark = bookmarkcache.keywords[keyword];
|
||||
else if (bookmarkcache.isBookmarked(uri))
|
||||
for (bmark of bookmarkcache)
|
||||
@@ -178,7 +178,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
}
|
||||
},
|
||||
|
||||
isBookmarked: deprecated("bookmarkcache.isBookmarked", { get: function isBookmarked() bookmarkcache.bound.isBookmarked }),
|
||||
isBookmarked: deprecated("bookmarkcache.isBookmarked", { get: function isBookmarked() { return bookmarkcache.bound.isBookmarked; } }),
|
||||
|
||||
/**
|
||||
* Remove a bookmark or bookmarks. If *ids* is an array, removes the
|
||||
@@ -213,7 +213,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
}
|
||||
},
|
||||
|
||||
getSearchEngines: deprecated("bookmarks.searchEngines", function getSearchEngines() this.searchEngines),
|
||||
getSearchEngines: deprecated("bookmarks.searchEngines", function getSearchEngines() { return this.searchEngines; }),
|
||||
/**
|
||||
* Returns a list of all visible search engines in the search
|
||||
* services, augmented with keyword, title, and icon properties for
|
||||
@@ -228,7 +228,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
if (!alias)
|
||||
alias = "search"; // for search engines which we can't find a suitable alias
|
||||
|
||||
if (hasOwnProperty(aliases, alias))
|
||||
if (hasOwnProp(aliases, alias))
|
||||
alias += ++aliases[alias];
|
||||
else
|
||||
aliases[alias] = 0;
|
||||
@@ -252,10 +252,10 @@ var Bookmarks = Module("bookmarks", {
|
||||
hasSuggestions: function hasSuggestions(engineName, query, callback) {
|
||||
const responseType = "application/x-suggestions+json";
|
||||
|
||||
if (hasOwnProperty(this.suggestionProviders, engineName))
|
||||
if (hasOwnProp(this.suggestionProviders, engineName))
|
||||
return true;
|
||||
|
||||
let engine = hasOwnProperty(this.searchEngines, engineName) && this.searchEngines[engineName];
|
||||
let engine = hasOwnProp(this.searchEngines, engineName) && this.searchEngines[engineName];
|
||||
if (engine && engine.supportsResponseType(responseType))
|
||||
return true;
|
||||
|
||||
@@ -281,10 +281,10 @@ var Bookmarks = Module("bookmarks", {
|
||||
getSuggestions: function getSuggestions(engineName, query, callback) {
|
||||
const responseType = "application/x-suggestions+json";
|
||||
|
||||
if (hasOwnProperty(this.suggestionProviders, engineName))
|
||||
if (hasOwnProp(this.suggestionProviders, engineName))
|
||||
return this.suggestionProviders[engineName](query, callback);
|
||||
|
||||
let engine = hasOwnProperty(this.searchEngines, engineName) && this.searchEngines[engineName];
|
||||
let engine = hasOwnProp(this.searchEngines, engineName) && this.searchEngines[engineName];
|
||||
if (engine && engine.supportsResponseType(responseType))
|
||||
var queryURI = engine.getSubmission(query, responseType).uri.spec;
|
||||
|
||||
@@ -347,7 +347,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
let [keyword, param] = util.split(query, " ", 2);
|
||||
param = param || "";
|
||||
|
||||
var engine = hasOwnProperty(bookmarks.searchEngines, keyword) && bookmarks.searchEngines[keyword];
|
||||
var engine = hasOwnProp(bookmarks.searchEngines, keyword) && bookmarks.searchEngines[keyword];
|
||||
if (engine) {
|
||||
if (engine.searchForm && !param)
|
||||
return engine.searchForm;
|
||||
|
||||
@@ -975,7 +975,7 @@ var CommandLine = Module("commandline", {
|
||||
}
|
||||
},
|
||||
|
||||
updateOutputHeight: deprecated("mow.resize", function updateOutputHeight(open, extra) mow.resize(open, extra)),
|
||||
updateOutputHeight: deprecated("mow.resize", function updateOutputHeight(open, extra) { return mow.resize(open, extra); }),
|
||||
|
||||
withOutputToString: function withOutputToString(fn, self, ...args) {
|
||||
dactyl.registerObserver("echoLine", observe, true);
|
||||
|
||||
@@ -54,9 +54,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
delete window.liberator;
|
||||
|
||||
// Prevents box ordering bugs after our stylesheet is removed.
|
||||
styles.system.add("cleanup-sheet", config.styleableChrome, literal(function () /*
|
||||
styles.system.add("cleanup-sheet", config.styleableChrome, String.raw`
|
||||
#TabsToolbar tab { display: none; }
|
||||
*/$));
|
||||
`);
|
||||
styles.unregisterSheet("resource://dactyl-skin/dactyl.css");
|
||||
DOM('#TabsToolbar tab', document).style.display;
|
||||
},
|
||||
@@ -113,15 +113,15 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
}
|
||||
},
|
||||
|
||||
profileName: deprecated("config.profileName", { get: function profileName() config.profileName }),
|
||||
profileName: deprecated("config.profileName", { get: function profileName() { return config.profileName; } }),
|
||||
|
||||
/**
|
||||
* @property {Modes.Mode} The current main mode.
|
||||
* @see modes#mainModes
|
||||
*/
|
||||
mode: deprecated("modes.main", {
|
||||
get: function mode() modes.main,
|
||||
set: function mode(val) modes.main = val
|
||||
get: function mode() { return modes.main; },
|
||||
set: function mode(val) { modes.main = val; },
|
||||
}),
|
||||
|
||||
getMenuItems: function getMenuItems(targetPath) {
|
||||
@@ -176,7 +176,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
this[v] = val[k];
|
||||
},
|
||||
|
||||
version: deprecated("config.version", { get: function version() config.version }),
|
||||
version: deprecated("config.version", { get: function version() { return config.version; } }),
|
||||
|
||||
/**
|
||||
* @property {Object} The map of command-line options. These are
|
||||
@@ -280,7 +280,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
|
||||
for (let obj of results) {
|
||||
let res = dactyl.generateHelp(obj, null, null, true);
|
||||
if (!hasOwnProperty(help.tags, obj.helpTag))
|
||||
if (!hasOwnProp(help.tags, obj.helpTag))
|
||||
res[0][1].tag = obj.helpTag;
|
||||
|
||||
yield res;
|
||||
@@ -386,9 +386,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
},
|
||||
|
||||
dump: deprecated("util.dump",
|
||||
{ get: function dump() util.bound.dump }),
|
||||
{ get: function dump() { return util.bound.dump; } }),
|
||||
dumpStack: deprecated("util.dumpStack",
|
||||
{ get: function dumpStack() util.bound.dumpStack }),
|
||||
{ get: function dumpStack() { return util.bound.dumpStack; } }),
|
||||
|
||||
/**
|
||||
* Outputs a plain message to the command line.
|
||||
@@ -638,8 +638,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
}
|
||||
},
|
||||
|
||||
help: deprecated("help.help", { get: function help() modules.help.bound.help }),
|
||||
findHelp: deprecated("help.findHelp", { get: function findHelp() help.bound.findHelp }),
|
||||
help: deprecated("help.help", { get: function help() { return modules.help.bound.help; } }),
|
||||
findHelp: deprecated("help.findHelp", { get: function findHelp() { return help.bound.findHelp; } }),
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -762,7 +762,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
*/
|
||||
_globalVariables: {},
|
||||
globalVariables: deprecated(_("deprecated.for.theOptionsSystem"), {
|
||||
get: function globalVariables() this._globalVariables
|
||||
get: function globalVariables() { return this._globalVariables },
|
||||
}),
|
||||
|
||||
loadPlugins: function loadPlugins(args, force) {
|
||||
@@ -1053,15 +1053,15 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
}, this);
|
||||
},
|
||||
stringToURLArray: deprecated("dactyl.parseURLs", "parseURLs"),
|
||||
urlish: Class.Memoize(() => util.regexp(literal(function () /*
|
||||
urlish: Class.Memoize(() => util.regexp(String.raw`
|
||||
^ (
|
||||
<domain>+ (:\d+)? (/ .*) |
|
||||
<domain>+ (:\d+) |
|
||||
<domain>+ \. [a-z0-9]+ |
|
||||
localhost
|
||||
) $
|
||||
*/$), "ix", {
|
||||
domain: util.regexp(String.replace(literal(function () /*
|
||||
`, "ix", {
|
||||
domain: util.regexp(String.raw`
|
||||
[^
|
||||
U0000-U002c // U002d-U002e --.
|
||||
U002f // /
|
||||
@@ -1070,7 +1070,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
U005b-U0060 // U0061-U007a A-Z
|
||||
U007b-U007f
|
||||
]
|
||||
*/$), /U/g, "\\u"), "x")
|
||||
`.replace(/U/g, "\\u"), "x")
|
||||
})),
|
||||
|
||||
pluginFiles: {},
|
||||
@@ -1878,8 +1878,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
context.anchored = false;
|
||||
context.keys = {
|
||||
text: "dactylPath",
|
||||
description: function (item) item.getAttribute("label"),
|
||||
highlight: function (item) item.disabled ? "Disabled" : ""
|
||||
description: item => item.getAttribute("label"),
|
||||
highlight: item => item.disabled ? "Disabled" : "",
|
||||
};
|
||||
context.generate = () => dactyl.menuItems;
|
||||
};
|
||||
@@ -1888,7 +1888,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
context.title = ["Toolbar"];
|
||||
context.keys = {
|
||||
text: Dactyl.getToolbarName,
|
||||
description: function () ""
|
||||
description: () => "",
|
||||
};
|
||||
context.completions = config.toolbars;
|
||||
};
|
||||
@@ -1905,7 +1905,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
|
||||
dactyl.log(_("dactyl.modulesLoaded"), 3);
|
||||
|
||||
userContext.DOM = Class("DOM", DOM, { init: function DOM_(sel, ctxt) DOM(sel, ctxt || buffer.focusedFrame.document) });
|
||||
userContext.DOM = Class("DOM", DOM, {
|
||||
init(sel, ctxt) {
|
||||
return DOM(sel, ctxt || buffer.focusedFrame.document);
|
||||
}
|
||||
});
|
||||
|
||||
userContext.$ = modules.userContext.DOM;
|
||||
|
||||
// Hack: disable disabling of Personas in private windows.
|
||||
@@ -2038,6 +2043,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
statusline.update();
|
||||
dactyl.log(_("dactyl.initialized", config.appName), 0);
|
||||
dactyl.initialized = true;
|
||||
|
||||
util.delay(() => {
|
||||
if (services.focus.activeWindow === window)
|
||||
overlay.activeWindow = window;
|
||||
|
||||
util.flushLateMethods(dactyl);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
name = 0;
|
||||
if (name == "_")
|
||||
var res = null;
|
||||
else if (hasOwnProperty(this.selectionRegisters, name))
|
||||
else if (hasOwnProp(this.selectionRegisters, name))
|
||||
res = { text: dactyl.clipboardRead(this.selectionRegisters[name]) || "" };
|
||||
else if (!/^[0-9]$/.test(name))
|
||||
res = this.registers.get(name);
|
||||
@@ -113,7 +113,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
n = 0;
|
||||
if (n == "_")
|
||||
;
|
||||
else if (hasOwnProperty(this.selectionRegisters, n))
|
||||
else if (hasOwnProp(this.selectionRegisters, n))
|
||||
dactyl.clipboardWrite(value.text, verbose, this.selectionRegisters[n]);
|
||||
else if (!/^[0-9]$/.test(n))
|
||||
this.registers.set(n, value);
|
||||
|
||||
@@ -28,7 +28,7 @@ var EventHive = Class("EventHive", Contexts.Hive, {
|
||||
else
|
||||
[self, events] = [event, event[callback || "events"]];
|
||||
|
||||
if (hasOwnProperty(events, "input") && !hasOwnProperty(events, "dactyl-input"))
|
||||
if (hasOwnProp(events, "input") && !hasOwnProp(events, "dactyl-input"))
|
||||
events["dactyl-input"] = events.input;
|
||||
|
||||
return [self, events];
|
||||
@@ -79,7 +79,7 @@ var EventHive = Class("EventHive", Contexts.Hive, {
|
||||
let elem = args[0].get();
|
||||
if (target == null || elem == target
|
||||
&& self == args[1].get()
|
||||
&& hasOwnProperty(events, args[2])
|
||||
&& hasOwnProp(events, args[2])
|
||||
&& args[3].wrapped == events[args[2]]
|
||||
&& args[4] == capture) {
|
||||
|
||||
@@ -212,7 +212,7 @@ var Events = Module("events", {
|
||||
},
|
||||
|
||||
get listen() { return this.builtin.bound.listen; },
|
||||
addSessionListener: deprecated("events.listen", { get: function addSessionListener() this.listen }),
|
||||
addSessionListener: deprecated("events.listen", { get: function addSessionListener() { return this.listen; } }),
|
||||
|
||||
/**
|
||||
* Wraps an event listener to ensure that errors are reported.
|
||||
@@ -423,11 +423,11 @@ var Events = Module("events", {
|
||||
return true;
|
||||
},
|
||||
|
||||
canonicalKeys: deprecated("DOM.Event.canonicalKeys", { get: function canonicalKeys() DOM.Event.bound.canonicalKeys }),
|
||||
create: deprecated("DOM.Event", function create() DOM.Event.apply(null, arguments)),
|
||||
dispatch: deprecated("DOM.Event.dispatch", function dispatch() apply(DOM.Event, "dispatch", arguments)),
|
||||
fromString: deprecated("DOM.Event.parse", { get: function fromString() DOM.Event.bound.parse }),
|
||||
iterKeys: deprecated("DOM.Event.iterKeys", { get: function iterKeys() DOM.Event.bound.iterKeys }),
|
||||
canonicalKeys: deprecated("DOM.Event.canonicalKeys", { get: function canonicalKeys() { return DOM.Event.bound.canonicalKeys; } }),
|
||||
create: deprecated("DOM.Event", function create() { return DOM.Event.apply(null, arguments); }),
|
||||
dispatch: deprecated("DOM.Event.dispatch", function dispatch() { return apply(DOM.Event, "dispatch", arguments); }),
|
||||
fromString: deprecated("DOM.Event.parse", { get: function fromString() { return DOM.Event.bound.parse; } }),
|
||||
iterKeys: deprecated("DOM.Event.iterKeys", { get: function iterKeys() { return DOM.Event.bound.iterKeys; } }),
|
||||
|
||||
toString: function toString() {
|
||||
if (!arguments.length)
|
||||
@@ -1152,7 +1152,7 @@ var Events = Module("events", {
|
||||
|
||||
has: function (key) {
|
||||
return this.pass.has(key) ||
|
||||
hasOwnProperty(this.commandHive.stack.mappings, key);
|
||||
hasOwnProp(this.commandHive.stack.mappings, key);
|
||||
},
|
||||
|
||||
get pass() { this.flush(); return this.pass; },
|
||||
|
||||
@@ -39,7 +39,7 @@ var Map = Class("Map", {
|
||||
Object.freeze(this.modes);
|
||||
|
||||
if (info) {
|
||||
if (hasOwnProperty(Map.types, info.type))
|
||||
if (hasOwnProp(Map.types, info.type))
|
||||
this.update(Map.types[info.type]);
|
||||
this.update(info);
|
||||
}
|
||||
@@ -370,7 +370,7 @@ var Mappings = Module("mappings", {
|
||||
|
||||
get userHives() { return this.allHives.filter(h => h !== this.builtin); },
|
||||
|
||||
expandLeader: deprecated("your brain", function expandLeader(keyString) keyString),
|
||||
expandLeader: deprecated("your brain", function expandLeader(keyString) { return keyString; }),
|
||||
|
||||
prefixes: Class.Memoize(function () {
|
||||
let list = Array.map("CASM", s => s + "-");
|
||||
@@ -415,11 +415,11 @@ var Mappings = Module("mappings", {
|
||||
return this.iterate(modes.NORMAL);
|
||||
},
|
||||
|
||||
getDefault: deprecated("mappings.builtin.get", function getDefault(mode, cmd) this.builtin.get(mode, cmd)),
|
||||
getUserIterator: deprecated("mappings.user.iterator", function getUserIterator(modes) this.user.iterator(modes)),
|
||||
hasMap: deprecated("group.mappings.has", function hasMap(mode, cmd) this.user.has(mode, cmd)),
|
||||
remove: deprecated("group.mappings.remove", function remove(mode, cmd) this.user.remove(mode, cmd)),
|
||||
removeAll: deprecated("group.mappings.clear", function removeAll(mode) this.user.clear(mode)),
|
||||
getDefault: deprecated("mappings.builtin.get", function getDefault(mode, cmd) { return this.builtin.get(mode, cmd); }),
|
||||
getUserIterator: deprecated("mappings.user.iterator", function getUserIterator(modes) { return this.user.iterator(modes); }),
|
||||
hasMap: deprecated("group.mappings.has", function hasMap(mode, cmd) { return this.user.has(mode, cmd); }),
|
||||
remove: deprecated("group.mappings.remove", function remove(mode, cmd) { return this.user.remove(mode, cmd); }),
|
||||
removeAll: deprecated("group.mappings.clear", function removeAll(mode) { return this.user.clear(mode); }),
|
||||
|
||||
/**
|
||||
* Adds a new default key mapping.
|
||||
@@ -839,7 +839,7 @@ var Mappings = Module("mappings", {
|
||||
iterateIndex: function (args) {
|
||||
let self = this;
|
||||
let prefix = /^[bCmn]$/.test(mode.char) ? "" : mode.char + "_";
|
||||
let haveTag = k => hasOwnProperty(help.tags, k);
|
||||
let haveTag = k => hasOwnProp(help.tags, k);
|
||||
|
||||
return ({ helpTag: prefix + map.name, __proto__: map }
|
||||
for (map of self.iterate(args, true))
|
||||
|
||||
@@ -659,7 +659,7 @@ var Modes = Module("modes", {
|
||||
return (this.value.find(v => val.some(m => m.name === v.mode))
|
||||
|| { result: default_ }).result;
|
||||
|
||||
return hasOwnProperty(this.valueMap, val) ? this.valueMap[val] : default_;
|
||||
return hasOwnProp(this.valueMap, val) ? this.valueMap[val] : default_;
|
||||
},
|
||||
|
||||
setter: function (vals) {
|
||||
@@ -678,7 +678,7 @@ var Modes = Module("modes", {
|
||||
|
||||
validator: function validator(vals) {
|
||||
return vals.map(v => v.replace(/^!/, ""))
|
||||
.every(k => hasOwnProperty(this.values, k));
|
||||
.every(k => hasOwnProp(this.values, k));
|
||||
},
|
||||
|
||||
get values() {
|
||||
|
||||
@@ -7,8 +7,22 @@
|
||||
"use strict";
|
||||
|
||||
var MOW = Module("mow", {
|
||||
init: function init() {
|
||||
init() {
|
||||
let proxy = new Proxy(this, {
|
||||
get(target, prop, receiver) {
|
||||
if (prop in target)
|
||||
return target[prop];
|
||||
|
||||
if (prop in Buffer)
|
||||
return Buffer[prop].bind(Buffer, receiver.body);
|
||||
},
|
||||
});
|
||||
|
||||
proxy._init();
|
||||
return proxy;
|
||||
},
|
||||
|
||||
_init() {
|
||||
this._resize = Timer(20, 400, function _resize() {
|
||||
if (this.visible)
|
||||
this.resize(false);
|
||||
@@ -66,10 +80,6 @@ var MOW = Module("mow", {
|
||||
});
|
||||
},
|
||||
|
||||
__noSuchMethod__: function (meth, args) {
|
||||
return apply(Buffer, meth, [this.body].concat(args));
|
||||
},
|
||||
|
||||
get widget() { return this.widgets.multilineOutput; },
|
||||
|
||||
widgets: Class.Memoize(function widgets() {
|
||||
|
||||
@@ -37,27 +37,31 @@ var StatusLine = Module("statusline", {
|
||||
config.tabbrowser.getStatusPanel().hidden = true;
|
||||
|
||||
if (this.statusBar.localName == "toolbar") {
|
||||
styles.system.add("addon-bar", config.styleableChrome, literal(function () /*
|
||||
styles.system.add("addon-bar", config.styleableChrome, String.raw`
|
||||
#status-bar, #dactyl-status-bar { margin-top: 0 !important; }
|
||||
#dactyl-status-bar { min-height: 0 !important; }
|
||||
:-moz-any(#addon-bar, #dactyl-addon-bar) > statusbar { -moz-box-flex: 1 }
|
||||
:-moz-any(#addon-bar, #dactyl-addon-bar) > xul|toolbarspring { visibility: collapse; }
|
||||
#browser-bottombox>#addon-bar > #addonbar-closebutton { visibility: collapse; }
|
||||
*/$));
|
||||
`);
|
||||
|
||||
overlay.overlayWindow(window, {
|
||||
append: [
|
||||
["statusbar", { id: this._statusLine.id, ordinal: "0" }]]
|
||||
});
|
||||
|
||||
highlight.loadCSS(util.compileMacro(literal(function () /*
|
||||
let padding = "";
|
||||
if (config.OS.isMacOSX)
|
||||
padding = "padding-right: 10px !important;";
|
||||
|
||||
highlight.loadCSS(String.raw`
|
||||
!AddonBar;#browser-bottombox>#addon-bar,#dactyl-addon-bar {
|
||||
padding-left: 0 !important;
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
min-height: 18px !important;
|
||||
-moz-appearance: none !important;
|
||||
<padding>
|
||||
${padding}
|
||||
}
|
||||
!AddonButton;#browser-bottombox>#addon-bar xul|toolbarbutton, #dactyl-addon-bar xul|toolbarbutton {
|
||||
-moz-appearance: none !important;
|
||||
@@ -67,12 +71,12 @@ var StatusLine = Module("statusline", {
|
||||
color: inherit !important;
|
||||
}
|
||||
AddonButton:not(:hover) background: transparent;
|
||||
*/$))({ padding: config.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
|
||||
`);
|
||||
|
||||
if (document.getElementById("appmenu-button"))
|
||||
highlight.loadCSS(literal(function () /*
|
||||
highlight.loadCSS(String.raw`
|
||||
AppmenuButton min-width: 0 !important; padding: 0 .5em !important;
|
||||
*/$));
|
||||
`);
|
||||
}
|
||||
|
||||
let prepend = [
|
||||
@@ -239,8 +243,8 @@ var StatusLine = Module("statusline", {
|
||||
this.updateZoomLevel();
|
||||
},
|
||||
|
||||
unsafeURI: deprecated("util.unsafeURI", { get: function unsafeURI() util.unsafeURI }),
|
||||
losslessDecodeURI: deprecated("util.losslessDecodeURI", function losslessDecodeURI() apply(util, "losslessDecodeURI", arguments)),
|
||||
unsafeURI: deprecated("util.unsafeURI", { get: function unsafeURI() { return util.unsafeURI; } }),
|
||||
losslessDecodeURI: deprecated("util.losslessDecodeURI", function losslessDecodeURI() { return apply(util, "losslessDecodeURI", arguments); }),
|
||||
|
||||
/**
|
||||
* Update the URL displayed in the status line. Also displays status
|
||||
|
||||
@@ -36,9 +36,11 @@ var Tabs = Module("tabs", {
|
||||
tabs.switchTo(event.originalTarget.getAttribute("identifier"));
|
||||
};
|
||||
|
||||
this.tabBinding = styles.system.add("tab-binding", "chrome://browser/content/browser.xul", literal(function () /*
|
||||
this.tabBinding = styles.system.add(
|
||||
"tab-binding", "chrome://browser/content/browser.xul",
|
||||
String.raw`
|
||||
xul|tab { -moz-binding: url(chrome://dactyl/content/bindings.xml#tab) !important; }
|
||||
*/$).replace(/tab-./g, m => config.OS.isMacOSX ? "tab-mac" : m),
|
||||
`,
|
||||
false, true);
|
||||
|
||||
this.timeout(function () {
|
||||
@@ -133,10 +135,11 @@ var Tabs = Module("tabs", {
|
||||
* in the current window.
|
||||
*/
|
||||
get browsers() {
|
||||
let browsers = config.tabbrowser.browsers;
|
||||
for (let i = 0; i < browsers.length; i++)
|
||||
if (browsers[i] !== undefined) // Bug in Google's Page Speed add-on.
|
||||
yield [i, browsers[i]];
|
||||
return function* () {
|
||||
for (let [i, browser] of config.tabbrowser.browsers.entries())
|
||||
if (browser !== undefined) // Bug in Google's Page Speed add-on.
|
||||
yield [i, browser];
|
||||
}();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1064,7 +1067,7 @@ var Tabs = Module("tabs", {
|
||||
tabs.getGroups();
|
||||
tabs[visible ? "visibleTabs" : "allTabs"].forEach(function (tab, i) {
|
||||
let group = (tab.tabItem || tab._tabViewTabItem || defItem).parent || defItem.parent;
|
||||
if (!hasOwnProperty(tabGroups, group.id))
|
||||
if (!hasOwnProp(tabGroups, group.id))
|
||||
tabGroups[group.id] = [group.getTitle(), []];
|
||||
|
||||
group = tabGroups[group.id];
|
||||
|
||||
Reference in New Issue
Block a user