mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 11:47:59 +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() {
|
get localStore() {
|
||||||
let doc = content.document;
|
let doc = content.document;
|
||||||
if (!doc.dactylStore || !buffer.localStorePrototype.isPrototypeOf(doc.dactylStore))
|
let store = overlay.getData(doc, "buffer");
|
||||||
doc.dactylStore = Object.create(buffer.localStorePrototype);
|
if (!store || !buffer.localStorePrototype.isPrototypeOf(store))
|
||||||
return doc.dactylStore.instance = doc.dactylStore;
|
store = overlay.setData(doc, "buffer", Object.create(buffer.localStorePrototype));
|
||||||
|
return store.instance = store;
|
||||||
},
|
},
|
||||||
|
|
||||||
localStorePrototype: memoize({
|
localStorePrototype: memoize({
|
||||||
@@ -463,7 +464,8 @@ var Buffer = Module("buffer", {
|
|||||||
else
|
else
|
||||||
flags = services.focus.FLAG_SHOWRING;
|
flags = services.focus.FLAG_SHOWRING;
|
||||||
|
|
||||||
if (!elem.dactylHadFocus && elem.value &&
|
if (!overlay.getData(elem, "had-focus", false) &&
|
||||||
|
elem.value &&
|
||||||
elem instanceof HTMLInputElement &&
|
elem instanceof HTMLInputElement &&
|
||||||
Editor.getEditor(elem) &&
|
Editor.getEditor(elem) &&
|
||||||
elem.selectionStart != null &&
|
elem.selectionStart != null &&
|
||||||
|
|||||||
@@ -163,10 +163,10 @@ var Events = Module("events", {
|
|||||||
if (modes.main != modes.AUTOCOMPLETE)
|
if (modes.main != modes.AUTOCOMPLETE)
|
||||||
modes.push(modes.AUTOCOMPLETE);
|
modes.push(modes.AUTOCOMPLETE);
|
||||||
}
|
}
|
||||||
else if (elem.localName !== "tooltip") {
|
else if (elem.hidePopup && elem.localName !== "tooltip"
|
||||||
if (Events.isHidden(elem))
|
&& Events.isHidden(elem)
|
||||||
if (elem.hidePopup && Events.isHidden(elem.parentNode))
|
&& Events.isHidden(elem.parentNode)) {
|
||||||
elem.hidePopup();
|
elem.hidePopup();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -420,6 +420,7 @@ var Events = Module("events", {
|
|||||||
toString: function toString() {
|
toString: function toString() {
|
||||||
if (!arguments.length)
|
if (!arguments.length)
|
||||||
return toString.supercall(this);
|
return toString.supercall(this);
|
||||||
|
|
||||||
deprecated.warn(toString, "toString", "DOM.Event.stringify");
|
deprecated.warn(toString, "toString", "DOM.Event.stringify");
|
||||||
return DOM.Event.stringify.apply(DOM.Event, arguments);
|
return DOM.Event.stringify.apply(DOM.Event, arguments);
|
||||||
},
|
},
|
||||||
@@ -584,7 +585,7 @@ var Events = Module("events", {
|
|||||||
if (elem == window)
|
if (elem == window)
|
||||||
overlay.activeWindow = window;
|
overlay.activeWindow = window;
|
||||||
|
|
||||||
elem.dactylHadFocus = true;
|
overlay.setData(elem, "had-focus", true);
|
||||||
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
|
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
|
||||||
if (Events.isHidden(elem, true))
|
if (Events.isHidden(elem, true))
|
||||||
elem.blur();
|
elem.blur();
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ var actions = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
get filter() {
|
get filter() {
|
||||||
let ids = XPIProvider.bootstrappedAddons;
|
return function ({ item }) !item.userDisabled &&
|
||||||
return function ({ item }) !item.userDisabled && Set.has(ids, item.id);
|
!(item.operationsRequiringRestart & (AddonManager.OP_NEEDS_RESTART_ENABLE | AddonManager.OP_NEEDS_RESTART_DISABLE))
|
||||||
},
|
},
|
||||||
perm: "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");
|
Components.utils.import("resource://gre/modules/AddonManager.jsm");
|
||||||
var { XPIProvider } = Components.utils.import("resource://gre/modules/XPIProvider.jsm", {});
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
var AddonManager = {
|
var AddonManager = {
|
||||||
PERM_CAN_UNINSTALL: 1,
|
PERM_CAN_UNINSTALL: 1,
|
||||||
|
|||||||
@@ -993,6 +993,12 @@ Class.prototype = {
|
|||||||
localizedProperties: {},
|
localizedProperties: {},
|
||||||
magicalProperties: {}
|
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() {
|
Class.makeClosure = function makeClosure() {
|
||||||
const self = this;
|
const self = this;
|
||||||
function closure(fn) {
|
function closure(fn) {
|
||||||
@@ -1059,7 +1065,12 @@ function XPCOMShim(interfaces) {
|
|||||||
return (interfaces || []).reduce(function (shim, iface) shim.QueryInterface(Ci[iface]),
|
return (interfaces || []).reduce(function (shim, iface) shim.QueryInterface(Ci[iface]),
|
||||||
ip.data)
|
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.
|
* An abstract base class for classes that wish to inherit from Error.
|
||||||
|
|||||||
@@ -77,14 +77,15 @@ var DOM = Class("DOM", {
|
|||||||
yield this.eq(i);
|
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,
|
set document(val) this._document = val,
|
||||||
|
|
||||||
attrHooks: array.toObject([
|
attrHooks: array.toObject([
|
||||||
["", {
|
["", {
|
||||||
href: { get: function (elem) elem.href || elem.getAttribute("href") },
|
href: { get: function (elem) elem.href || elem.getAttribute("href") },
|
||||||
src: { get: function (elem) elem.src || elem.getAttribute("src") },
|
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"),
|
collapsed: BooleanAttribute("collapsed"),
|
||||||
disabled: BooleanAttribute("disabled"),
|
disabled: BooleanAttribute("disabled"),
|
||||||
hidden: BooleanAttribute("hidden"),
|
hidden: BooleanAttribute("hidden"),
|
||||||
|
|||||||
@@ -150,11 +150,14 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
|
|||||||
getData: function getData(obj, key, constructor) {
|
getData: function getData(obj, key, constructor) {
|
||||||
let { id } = this;
|
let { id } = this;
|
||||||
|
|
||||||
if (!(id in obj))
|
if (!(id in obj && obj[id]))
|
||||||
obj[id] = {};
|
obj[id] = {};
|
||||||
|
|
||||||
if (obj[id][key] === undefined)
|
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];
|
return obj[id][key];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -164,10 +164,6 @@ var Storage = Module("Storage", {
|
|||||||
this[key].timer.flush();
|
this[key].timer.flush();
|
||||||
delete this[key];
|
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.keys = {};
|
||||||
this.observers = {};
|
this.observers = {};
|
||||||
@@ -201,9 +197,8 @@ var Storage = Module("Storage", {
|
|||||||
|
|
||||||
addObserver: function addObserver(key, callback, ref) {
|
addObserver: function addObserver(key, callback, ref) {
|
||||||
if (ref) {
|
if (ref) {
|
||||||
if (!ref.dactylStorageRefs)
|
let refs = overlay.getData(ref, "storage-refs");
|
||||||
ref.dactylStorageRefs = [];
|
refs.push(callback);
|
||||||
ref.dactylStorageRefs.push(callback);
|
|
||||||
var callbackRef = Cu.getWeakReference(callback);
|
var callbackRef = Cu.getWeakReference(callback);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -227,7 +222,9 @@ var Storage = Module("Storage", {
|
|||||||
|
|
||||||
removeDeadObservers: function () {
|
removeDeadObservers: function () {
|
||||||
for (let [key, ary] in Iterator(this.observers)) {
|
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)
|
if (!ary.length)
|
||||||
delete this.observers[key];
|
delete this.observers[key];
|
||||||
}
|
}
|
||||||
@@ -280,7 +277,7 @@ var Storage = Module("Storage", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
cleanup: function (dactyl, modules, window) {
|
cleanup: function (dactyl, modules, window) {
|
||||||
delete window.dactylStorageRefs;
|
overlay.setData(window, "storage-refs", null);
|
||||||
this.removeDeadObservers();
|
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