1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 05:45:46 +01:00

Merge default.

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-08 22:43:42 -05:00
7 changed files with 34 additions and 18 deletions

4
common/bootstrap.js vendored
View File

@@ -175,11 +175,11 @@ function init() {
reportError(e); reportError(e);
} }
if (JSMLoader && JSMLoader.bump != 3) // Temporary hack if (JSMLoader && JSMLoader.bump !== 4) // Temporary hack
Services.scriptloader.loadSubScript("resource://dactyl" + suffix + "/bootstrap.jsm", Services.scriptloader.loadSubScript("resource://dactyl" + suffix + "/bootstrap.jsm",
Cu.import("resource://dactyl/bootstrap.jsm", global)); Cu.import("resource://dactyl/bootstrap.jsm", global));
if (!JSMLoader || JSMLoader.bump != 3) if (!JSMLoader || JSMLoader.bump !== 4)
Cu.import("resource://dactyl/bootstrap.jsm", global); Cu.import("resource://dactyl/bootstrap.jsm", global);
JSMLoader.load("resource://dactyl/bootstrap.jsm", global); JSMLoader.load("resource://dactyl/bootstrap.jsm", global);

View File

@@ -1594,13 +1594,21 @@ var Buffer = Module("buffer", {
}); });
context.pushProcessor(0, function (item, text, next) <> context.pushProcessor(0, function (item, text, next) <>
<span highlight="Indicator" style="display: inline-block;">{item.item.indicator}</span> <span highlight="Indicator" style="display: inline-block;">{item.indicator}</span>
{ next.call(this, item, text) } { next.call(this, item, text) }
</>); </>);
context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter)); context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter));
context.anchored = false; context.anchored = false;
context.keys = { text: "text", description: "url", icon: "icon", id: "id", command: function () "tabs.select" }; context.keys = {
text: "text",
description: "url",
indicator: function (item) item.tab === tabs.getTab() ? "%" :
item.tab === tabs.alternate ? "#" : " ",
icon: "icon",
id: "id",
command: function () "tabs.select"
};
context.compare = CompletionContext.Sort.number; context.compare = CompletionContext.Sort.number;
context.filters = [CompletionContext.Filter.textDescription]; context.filters = [CompletionContext.Filter.textDescription];
@@ -1621,9 +1629,9 @@ var Buffer = Module("buffer", {
return { return {
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
tab: tab,
id: i - 1, id: i - 1,
url: url, url: url,
indicator: indicator,
icon: tab.image || DEFAULT_FAVICON icon: tab.image || DEFAULT_FAVICON
}; };
}); });

View File

@@ -456,8 +456,8 @@ var Tabs = Module("tabs", {
if (buffer == "#") if (buffer == "#")
return tabs.selectAlternateTab(); return tabs.selectAlternateTab();
count = Math.max(1, count || 1);
reverse = Boolean(reverse); reverse = Boolean(reverse);
count = Math.max(1, count || 1) * (1 + -2 * reverse);
let matches = buffer.match(/^(\d+):?/); let matches = buffer.match(/^(\d+):?/);
if (matches) if (matches)
@@ -467,17 +467,21 @@ var Tabs = Module("tabs", {
if (matches) if (matches)
return tabs.select(matches, false); return tabs.select(matches, false);
matches = completion.runCompleter("buffer", buffer); matches = completion.runCompleter("buffer", buffer).map(function (obj) obj.tab);
if (matches.length == 0) if (matches.length == 0)
dactyl.echoerr("E94: No matching buffer for " + buffer); dactyl.echoerr("E94: No matching buffer for " + buffer);
else if (matches.length > 1 && !allowNonUnique) else if (matches.length > 1 && !allowNonUnique)
dactyl.echoerr("E93: More than one match for " + buffer); dactyl.echoerr("E93: More than one match for " + buffer);
else { else {
let index = (count - 1) % matches.length; let start = matches.indexOf(tabs.getTab());
if (reverse) if (start == -1 && reverse)
index = matches.length - index - 1; start++;
tabs.select(matches[index].id, false);
let index = (start + count) % matches.length;
if (index < 0)
index = matches.length + index;
tabs.select(matches[index], false);
} }
}, },

View File

@@ -676,7 +676,8 @@ function Class() {
return res !== undefined ? res : self; return res !== undefined ? res : self;
})]]>, })]]>,
"constructor", (name || superclass.className).replace(/\W/g, "_")) "constructor", (name || superclass.className).replace(/\W/g, "_"))
.replace("PARAMS", /^function .*?\((.*?)\)/.exec(args[0] && args[0].init || Class.prototype.init)[1])); .replace("PARAMS", /^function .*?\((.*?)\)/.exec(args[0] && args[0].init || Class.prototype.init)[1]
.replace(/\b(self|res|Constructor)\b/g, "$1_")));
Constructor.className = name || superclass.className || superclass.name; Constructor.className = name || superclass.className || superclass.name;

View File

@@ -14,9 +14,9 @@ var storage = Components.classes["@mozilla.org/fuel/application;1"]
var JSMLoader = storage.get("dactyl.JSMLoader", undefined); var JSMLoader = storage.get("dactyl.JSMLoader", undefined);
if (!JSMLoader || JSMLoader.bump != 3) if (!JSMLoader || JSMLoader.bump != 4)
JSMLoader = { JSMLoader = {
bump: 3, bump: 4,
builtin: Components.utils.Sandbox(this), builtin: Components.utils.Sandbox(this),
canonical: {}, canonical: {},
factories: [], factories: [],
@@ -33,7 +33,7 @@ if (!JSMLoader || JSMLoader.bump != 3)
this.storage.set("dactyl.JSMLoader", this); this.storage.set("dactyl.JSMLoader", this);
let base = JSMLoader.load("base.jsm", global); let base = this.load("base.jsm", global);
global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS; global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS;
global.JSMLoader = this; global.JSMLoader = this;
base.JSMLoader = this; base.JSMLoader = this;

View File

@@ -754,6 +754,6 @@ config.INIT = update(Object.create(config.INIT), config.INIT, {
endModule(); endModule();
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); } } catch(e){ if (typeof e === "string") e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 sts=4 et ft=javascript: // vim: set fdm=marker sw=4 sts=4 et ft=javascript:

View File

@@ -497,10 +497,13 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
case "list": case "list":
modules.commandline.commandOutput(template.tabular( modules.commandline.commandOutput(template.tabular(
["Host", "Session", "Path", "Value"], ["padding-right: 1em", "padding-right: 1em", "padding-right: 1em"], ["Host", "Expiry (UTC)", "Path", "Name", "Value"],
["padding-right: 1em", "padding-right: 1em", "padding-right: 1em", "max-width: 12em; overflow: hidden;", "padding-left: 1ex;"],
([c.host, ([c.host,
<span highlight={c.isSession ? "Enabled" : "Disabled"}>{c.isSession ? "session" : "persistent"}</span>, c.isSession ? <span highlight="Enabled">session</span>
: (new Date(c.expiry * 1000).toJSON() || "Never").replace(/:\d\d\.000Z/, "").replace("T", " ").replace(/-/g, "/"),
c.path, c.path,
c.name,
c.value] c.value]
for (c in Sanitizer.iterCookies(host))))); for (c in Sanitizer.iterCookies(host)))));
return; return;