mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-14 04:45:48 +01:00
Don't Be Evil.
--HG-- rename : pentadactyl/skin/icon.png => pentadactyl/icon16.png
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user