1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-22 07:45:45 +01:00

Fix user :commands and other minor cleanup.

--HG--
extra : rebase_source : 1cff53f18c70b12a984d120e73d121dc2267dcc9
This commit is contained in:
Kris Maglione
2010-12-31 12:40:44 -05:00
parent 4eb8682f28
commit c6f5b04cda
5 changed files with 13 additions and 11 deletions

View File

@@ -25,12 +25,15 @@ services.subscriptLoader.loadSubScript("chrome://browser/content/sanitize.js", t
tmp.Sanitizer.prototype.__proto__ = Class.prototype;
var Range = Struct("min", "max");
Range.prototype.contains = function (date)
date == null || (this.min == null || date >= this.min) && (this.max == null || date <= this.max);
Range.prototype.__defineGetter__("isEternity", function () this.max == null && this.min == null);
Range.prototype.__defineGetter__("isSession", function () this.max == null && this.min == sanitizer.sessionStart);
Range.prototype.__defineGetter__("native", function ()
this.isEternity ? null : [range.min || 0, range.max == null ? Number.MAX_VALUE : range.max]);
update(Range.prototype, {
contains: function (date) date == null ||
(this.min == null || date >= this.min) && (this.max == null || date <= this.max),
get isEternity() this.max == null && this.min == null,
get isSession() this.max == null && this.min == sanitizer.sessionStart,
get native() this.isEternity ? null : [range.min || 0, range.max == null ? Number.MAX_VALUE : range.max]
});
var Item = Class("Item", {
init: function (name) {