mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 00:32:27 +01:00
Fix some minor bugs.
--HG-- branch : groups
This commit is contained in:
@@ -17,6 +17,10 @@ var Group = Class("Group", {
|
|||||||
cleanup: function cleanup() {
|
cleanup: function cleanup() {
|
||||||
for (let hive in values(this.hives))
|
for (let hive in values(this.hives))
|
||||||
dactyl.trapErrors("cleanup", hive);
|
dactyl.trapErrors("cleanup", hive);
|
||||||
|
|
||||||
|
this.hives = [];
|
||||||
|
for (let hive in keys(Group.hiveMap))
|
||||||
|
delete this[hive];
|
||||||
},
|
},
|
||||||
destroy: function destroy() {
|
destroy: function destroy() {
|
||||||
for (let hive in values(this.hives))
|
for (let hive in values(this.hives))
|
||||||
@@ -29,8 +33,6 @@ var Group = Class("Group", {
|
|||||||
|
|
||||||
get builtin() contexts.builtinGroups.indexOf(this) >= 0,
|
get builtin() contexts.builtinGroups.indexOf(this) >= 0,
|
||||||
|
|
||||||
hives: {}
|
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
compileFilter: function (patterns) {
|
compileFilter: function (patterns) {
|
||||||
|
|
||||||
@@ -165,17 +167,22 @@ var Contexts = Module("contexts", {
|
|||||||
if (group)
|
if (group)
|
||||||
name = group.name;
|
name = group.name;
|
||||||
|
|
||||||
if (replace)
|
if (!group) {
|
||||||
this.removeGroup(name);
|
|
||||||
|
|
||||||
if (!group || replace) {
|
|
||||||
dactyl.assert(name !== "default", "Illegal group name");
|
|
||||||
|
|
||||||
group = Group(name, description, filter, persist);
|
group = Group(name, description, filter, persist);
|
||||||
this.groupList.unshift(group);
|
this.groupList.unshift(group);
|
||||||
this.groupMap[name] = group;
|
this.groupMap[name] = group;
|
||||||
this.hiveProto.__defineGetter__(name, function () group[this._hive]);
|
this.hiveProto.__defineGetter__(name, function () group[this._hive]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (replace) {
|
||||||
|
dactyl.trapErrors("cleanup", group);
|
||||||
|
if (description)
|
||||||
|
group.description = description;
|
||||||
|
if (filter)
|
||||||
|
group.filter = filter
|
||||||
|
group.persist = persist;
|
||||||
|
}
|
||||||
|
|
||||||
delete this.groups;
|
delete this.groups;
|
||||||
return group;
|
return group;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -770,14 +770,18 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
try {
|
try {
|
||||||
let xmlhttp = services.Xmlhttp();
|
let xmlhttp = services.Xmlhttp();
|
||||||
xmlhttp.mozBackgroundRequest = true;
|
xmlhttp.mozBackgroundRequest = true;
|
||||||
if (params.callback) {
|
|
||||||
xmlhttp.onload = function handler(event) { util.trapErrors(params.callback, params, xmlhttp, event) };
|
let async = params.callback || params.onload || params.onerror;
|
||||||
xmlhttp.onerror = xmlhttp.onload;
|
if (async) {
|
||||||
|
xmlhttp.onload = function handler(event) { util.trapErrors(params.onload || params.callback, params, xmlhttp, event) };
|
||||||
|
xmlhttp.onerror = function handler(event) { util.trapErrors(params.onerror || params.callback, params, xmlhttp, event) };
|
||||||
}
|
}
|
||||||
if (params.mimeType)
|
if (params.mimeType)
|
||||||
xmlhttp.overrideMimeType(params.mimeType);
|
xmlhttp.overrideMimeType(params.mimeType);
|
||||||
|
|
||||||
xmlhttp.open(params.method || "GET", url, !!params.callback, params.user, params.pass);
|
xmlhttp.open(params.method || "GET", url, async,
|
||||||
|
params.user, params.pass);
|
||||||
|
|
||||||
xmlhttp.send(null);
|
xmlhttp.send(null);
|
||||||
return xmlhttp;
|
return xmlhttp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user