mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 07:48:00 +01:00
Don't Be Evil.
--HG-- rename : pentadactyl/skin/icon.png => pentadactyl/icon16.png
This commit is contained in:
@@ -270,9 +270,10 @@ var Buffer = Module("buffer", {
|
||||
*/
|
||||
get localStore() {
|
||||
let doc = content.document;
|
||||
if (!doc.dactylStore || !buffer.localStorePrototype.isPrototypeOf(doc.dactylStore))
|
||||
doc.dactylStore = Object.create(buffer.localStorePrototype);
|
||||
return doc.dactylStore.instance = doc.dactylStore;
|
||||
let store = overlay.getData(doc, "buffer");
|
||||
if (!store || !buffer.localStorePrototype.isPrototypeOf(store))
|
||||
store = overlay.setData(doc, "buffer", Object.create(buffer.localStorePrototype));
|
||||
return store.instance = store;
|
||||
},
|
||||
|
||||
localStorePrototype: memoize({
|
||||
@@ -463,7 +464,8 @@ var Buffer = Module("buffer", {
|
||||
else
|
||||
flags = services.focus.FLAG_SHOWRING;
|
||||
|
||||
if (!elem.dactylHadFocus && elem.value &&
|
||||
if (!overlay.getData(elem, "had-focus", false) &&
|
||||
elem.value &&
|
||||
elem instanceof HTMLInputElement &&
|
||||
Editor.getEditor(elem) &&
|
||||
elem.selectionStart != null &&
|
||||
|
||||
@@ -163,10 +163,10 @@ var Events = Module("events", {
|
||||
if (modes.main != modes.AUTOCOMPLETE)
|
||||
modes.push(modes.AUTOCOMPLETE);
|
||||
}
|
||||
else if (elem.localName !== "tooltip") {
|
||||
if (Events.isHidden(elem))
|
||||
if (elem.hidePopup && Events.isHidden(elem.parentNode))
|
||||
elem.hidePopup();
|
||||
else if (elem.hidePopup && elem.localName !== "tooltip"
|
||||
&& Events.isHidden(elem)
|
||||
&& Events.isHidden(elem.parentNode)) {
|
||||
elem.hidePopup();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -420,6 +420,7 @@ var Events = Module("events", {
|
||||
toString: function toString() {
|
||||
if (!arguments.length)
|
||||
return toString.supercall(this);
|
||||
|
||||
deprecated.warn(toString, "toString", "DOM.Event.stringify");
|
||||
return DOM.Event.stringify.apply(DOM.Event, arguments);
|
||||
},
|
||||
@@ -584,7 +585,7 @@ var Events = Module("events", {
|
||||
if (elem == window)
|
||||
overlay.activeWindow = window;
|
||||
|
||||
elem.dactylHadFocus = true;
|
||||
overlay.setData(elem, "had-focus", true);
|
||||
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
|
||||
if (Events.isHidden(elem, true))
|
||||
elem.blur();
|
||||
|
||||
@@ -117,8 +117,8 @@ var actions = {
|
||||
});
|
||||
},
|
||||
get filter() {
|
||||
let ids = XPIProvider.bootstrappedAddons;
|
||||
return function ({ item }) !item.userDisabled && Set.has(ids, item.id);
|
||||
return function ({ item }) !item.userDisabled &&
|
||||
!(item.operationsRequiringRestart & (AddonManager.OP_NEEDS_RESTART_ENABLE | AddonManager.OP_NEEDS_RESTART_DISABLE))
|
||||
},
|
||||
perm: "disable"
|
||||
},
|
||||
@@ -492,10 +492,8 @@ var Addons = Module("addons", {
|
||||
}
|
||||
});
|
||||
|
||||
if (!services.has("extensionManager")) {
|
||||
if (!services.has("extensionManager"))
|
||||
Components.utils.import("resource://gre/modules/AddonManager.jsm");
|
||||
var { XPIProvider } = Components.utils.import("resource://gre/modules/XPIProvider.jsm", {});
|
||||
}
|
||||
else
|
||||
var AddonManager = {
|
||||
PERM_CAN_UNINSTALL: 1,
|
||||
|
||||
@@ -993,6 +993,12 @@ Class.prototype = {
|
||||
localizedProperties: {},
|
||||
magicalProperties: {}
|
||||
};
|
||||
for (let name in properties(Class.prototype)) {
|
||||
let desc = Object.getOwnPropertyDescriptor(Class.prototype, name);
|
||||
desc.enumerable = false;
|
||||
Object.defineProperty(Class.prototype, name, desc);
|
||||
}
|
||||
|
||||
Class.makeClosure = function makeClosure() {
|
||||
const self = this;
|
||||
function closure(fn) {
|
||||
@@ -1059,7 +1065,12 @@ function XPCOMShim(interfaces) {
|
||||
return (interfaces || []).reduce(function (shim, iface) shim.QueryInterface(Ci[iface]),
|
||||
ip.data)
|
||||
};
|
||||
function stub() null;
|
||||
let stub = Class.Property({
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: function stub() null,
|
||||
writable: true
|
||||
});
|
||||
|
||||
/**
|
||||
* An abstract base class for classes that wish to inherit from Error.
|
||||
|
||||
@@ -77,14 +77,15 @@ var DOM = Class("DOM", {
|
||||
yield this.eq(i);
|
||||
},
|
||||
|
||||
get document() this._document || this[0].ownerDocument || this[0].document || this[0],
|
||||
get document() this._document || this[0] && (this[0].ownerDocument || this[0].document || this[0]),
|
||||
set document(val) this._document = val,
|
||||
|
||||
attrHooks: array.toObject([
|
||||
["", {
|
||||
href: { get: function (elem) elem.href || elem.getAttribute("href") },
|
||||
src: { get: function (elem) elem.src || elem.getAttribute("src") },
|
||||
checked: { get: function (elem) elem.checked, set: function (elem, val) elem.checked = val },
|
||||
checked: { get: function (elem) elem.hasAttribute("checked") ? elem.getAttribute("checked") == "true" : elem.checked,
|
||||
set: function (elem, val) { elem.setAttribute("checked", !!val); elem.checked = val } },
|
||||
collapsed: BooleanAttribute("collapsed"),
|
||||
disabled: BooleanAttribute("disabled"),
|
||||
hidden: BooleanAttribute("hidden"),
|
||||
|
||||
@@ -150,11 +150,14 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
|
||||
getData: function getData(obj, key, constructor) {
|
||||
let { id } = this;
|
||||
|
||||
if (!(id in obj))
|
||||
if (!(id in obj && obj[id]))
|
||||
obj[id] = {};
|
||||
|
||||
if (obj[id][key] === undefined)
|
||||
obj[id][key] = (constructor || Array)();
|
||||
if (constructor === undefined || callable(constructor))
|
||||
obj[id][key] = (constructor || Array)();
|
||||
else
|
||||
obj[id][key] = constructor;
|
||||
|
||||
return obj[id][key];
|
||||
},
|
||||
|
||||
@@ -164,10 +164,6 @@ var Storage = Module("Storage", {
|
||||
this[key].timer.flush();
|
||||
delete this[key];
|
||||
}
|
||||
for (let ary in values(this.observers))
|
||||
for (let obj in values(ary))
|
||||
if (obj.ref && obj.ref.get())
|
||||
delete obj.ref.get().dactylStorageRefs;
|
||||
|
||||
this.keys = {};
|
||||
this.observers = {};
|
||||
@@ -201,9 +197,8 @@ var Storage = Module("Storage", {
|
||||
|
||||
addObserver: function addObserver(key, callback, ref) {
|
||||
if (ref) {
|
||||
if (!ref.dactylStorageRefs)
|
||||
ref.dactylStorageRefs = [];
|
||||
ref.dactylStorageRefs.push(callback);
|
||||
let refs = overlay.getData(ref, "storage-refs");
|
||||
refs.push(callback);
|
||||
var callbackRef = Cu.getWeakReference(callback);
|
||||
}
|
||||
else {
|
||||
@@ -227,7 +222,9 @@ var Storage = Module("Storage", {
|
||||
|
||||
removeDeadObservers: function () {
|
||||
for (let [key, ary] in Iterator(this.observers)) {
|
||||
this.observers[key] = ary = ary.filter(function (o) o.callback.get() && (!o.ref || o.ref.get() && o.ref.get().dactylStorageRefs));
|
||||
this.observers[key] = ary = ary.filter(function (o) o.callback.get()
|
||||
&& (!o.ref || o.ref.get()
|
||||
&& overlay.getData(o.ref.get(), "storage-refs", null)));
|
||||
if (!ary.length)
|
||||
delete this.observers[key];
|
||||
}
|
||||
@@ -280,7 +277,7 @@ var Storage = Module("Storage", {
|
||||
},
|
||||
|
||||
cleanup: function (dactyl, modules, window) {
|
||||
delete window.dactylStorageRefs;
|
||||
overlay.setData(window, "storage-refs", null);
|
||||
this.removeDeadObservers();
|
||||
}
|
||||
});
|
||||
|
||||
BIN
pentadactyl/icon16.png
Normal file
BIN
pentadactyl/icon16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 464 B |
Reference in New Issue
Block a user