mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 07:58:00 +01:00
whitespace and semicolon fixes
This commit is contained in:
@@ -200,7 +200,7 @@ function Bookmarks() //{{{
|
|||||||
if (event == "add")
|
if (event == "add")
|
||||||
autocommands.trigger("BookmarkAdd", arg);
|
autocommands.trigger("BookmarkAdd", arg);
|
||||||
statusline.updateUrl();
|
statusline.updateUrl();
|
||||||
}
|
};
|
||||||
|
|
||||||
var cache = storage.newObject("bookmark-cache", Cache, false);
|
var cache = storage.newObject("bookmark-cache", Cache, false);
|
||||||
storage.addObserver("bookmark-cache", bookmarkObserver);
|
storage.addObserver("bookmark-cache", bookmarkObserver);
|
||||||
@@ -835,7 +835,7 @@ function History() //{{{
|
|||||||
{
|
{
|
||||||
url: item[0],
|
url: item[0],
|
||||||
title: item[1],
|
title: item[1],
|
||||||
icon: bookmarks.getFavicon(item[0]),
|
icon: bookmarks.getFavicon(item[0])
|
||||||
} for each ([i, item] in Iterator(items)) if (i < 1000)));
|
} for each ([i, item] in Iterator(items)) if (i < 1000)));
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1083,12 +1083,11 @@ function Buffer() //{{{
|
|||||||
elem.focus();
|
elem.focus();
|
||||||
|
|
||||||
var evt = doc.createEvent("MouseEvents");
|
var evt = doc.createEvent("MouseEvents");
|
||||||
["mousedown", "mouseup", "click"].forEach(function (event)
|
["mousedown", "mouseup", "click"].forEach(function (event) {
|
||||||
{
|
|
||||||
evt.initMouseEvent(event, true, true, view, 1, offsetX, offsetY, 0, 0,
|
evt.initMouseEvent(event, true, true, view, 1, offsetX, offsetY, 0, 0,
|
||||||
ctrlKey, /*altKey*/0, shiftKey, /*metaKey*/ ctrlKey, 0, null);
|
ctrlKey, /*altKey*/0, shiftKey, /*metaKey*/ ctrlKey, 0, null);
|
||||||
elem.dispatchEvent(evt);
|
elem.dispatchEvent(evt);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
get selectionController() getBrowser().docShell
|
get selectionController() getBrowser().docShell
|
||||||
@@ -1289,8 +1288,7 @@ function Buffer() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
let option = options["pageinfo"];
|
let option = options["pageinfo"];
|
||||||
let list = template.map(option, function (option)
|
let list = template.map(option, function (option) {
|
||||||
{
|
|
||||||
let opt = pageInfo[option];
|
let opt = pageInfo[option];
|
||||||
if (opt)
|
if (opt)
|
||||||
return template.table(opt[1], opt[0](true));
|
return template.table(opt[1], opt[0](true));
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ function Commands() //{{{
|
|||||||
["int", parseInt],
|
["int", parseInt],
|
||||||
["float", parseFloat],
|
["float", parseFloat],
|
||||||
["list", function (arg) arg && arg.split(/\s*,\s*/)]
|
["list", function (arg) arg && arg.split(/\s*,\s*/)]
|
||||||
].map(function (x) x && ArgType.apply(null, x));;
|
].map(function (x) x && ArgType.apply(null, x));
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||||
|
|||||||
@@ -465,7 +465,8 @@ function Events() //{{{
|
|||||||
let args = {
|
let args = {
|
||||||
url: doc.location.href,
|
url: doc.location.href,
|
||||||
title: doc.title
|
title: doc.title
|
||||||
}
|
};
|
||||||
|
|
||||||
if (liberator.has("tabs"))
|
if (liberator.has("tabs"))
|
||||||
args.tab = tabs.getContentIndex(doc) + 1;
|
args.tab = tabs.getContentIndex(doc) + 1;
|
||||||
|
|
||||||
@@ -559,7 +560,7 @@ function Events() //{{{
|
|||||||
if (Components.utils.reportError)
|
if (Components.utils.reportError)
|
||||||
Components.utils.reportError(e);
|
Components.utils.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// return true when load successful, or false otherwise
|
// return true when load successful, or false otherwise
|
||||||
@@ -1348,7 +1349,7 @@ function Events() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// others are left to generate the 'input' event or handled by firefox
|
// others are left to generate the 'input' event or handled by firefox
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ function Search() //{{{
|
|||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
};
|
||||||
|
|
||||||
var start = new Point(win.pageXOffset, win.pageYOffset);
|
var start = new Point(win.pageXOffset, win.pageYOffset);
|
||||||
let selection = sel.getSelection(sel.SELECTION_NORMAL);
|
let selection = sel.getSelection(sel.SELECTION_NORMAL);
|
||||||
@@ -226,14 +226,14 @@ function Search() //{{{
|
|||||||
sel.scrollSelectionIntoView(sel.SELECTION_NORMAL, 0, false);
|
sel.scrollSelectionIntoView(sel.SELECTION_NORMAL, 0, false);
|
||||||
lastRange = range.cloneRange();
|
lastRange = range.cloneRange();
|
||||||
return range;
|
return range;
|
||||||
}
|
};
|
||||||
|
|
||||||
this.cancel = function ()
|
this.cancel = function ()
|
||||||
{
|
{
|
||||||
selection.removeAllRanges();
|
selection.removeAllRanges();
|
||||||
selection.addRange(startRange);
|
selection.addRange(startRange);
|
||||||
win.scrollTo(start.x, start.y);
|
win.scrollTo(start.x, start.y);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stolen from toolkit.jar in Firefox, for the time being. The private
|
/* Stolen from toolkit.jar in Firefox, for the time being. The private
|
||||||
|
|||||||
@@ -336,7 +336,9 @@ function Hints() //{{{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (validHints.length > 1)
|
else if (validHints.length > 1)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var timeout = followFirst || events.feedingKeys ? 0 : 500;
|
var timeout = followFirst || events.feedingKeys ? 0 : 500;
|
||||||
@@ -598,15 +600,15 @@ function Hints() //{{{
|
|||||||
|
|
||||||
mappings.add(myModes, ["f"],
|
mappings.add(myModes, ["f"],
|
||||||
"Start QuickHint mode",
|
"Start QuickHint mode",
|
||||||
function () { hints.show("o") });
|
function () { hints.show("o"); });
|
||||||
|
|
||||||
mappings.add(myModes, ["F"],
|
mappings.add(myModes, ["F"],
|
||||||
"Start QuickHint mode, but open link in a new tab",
|
"Start QuickHint mode, but open link in a new tab",
|
||||||
function () { hints.show("t") });
|
function () { hints.show("t"); });
|
||||||
|
|
||||||
mappings.add(myModes, [";"],
|
mappings.add(myModes, [";"],
|
||||||
"Start an extended hint mode",
|
"Start an extended hint mode",
|
||||||
function (arg) { hints.show(arg) },
|
function (arg) { hints.show(arg); },
|
||||||
{ flags: Mappings.flags.ARGUMENT });
|
{ flags: Mappings.flags.ARGUMENT });
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ function IO() //{{{
|
|||||||
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", lastRunCommand)
|
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", lastRunCommand)
|
||||||
);
|
);
|
||||||
|
|
||||||
lastRunCommand = args
|
lastRunCommand = args;
|
||||||
|
|
||||||
let output = io.system(args);
|
let output = io.system(args);
|
||||||
let command = ":" + util.escapeHTML(commandline.getCommand()) + "<br/>";
|
let command = ":" + util.escapeHTML(commandline.getCommand()) + "<br/>";
|
||||||
@@ -787,7 +787,7 @@ lookup:
|
|||||||
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
loader.loadSubScript(uri.spec, modules)
|
loader.loadSubScript(uri.spec, modules);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ const liberator = (function () //{{{
|
|||||||
|
|
||||||
const tabopts = [
|
const tabopts = [
|
||||||
["n", "Tab number", null, ".hl-TabNumber"],
|
["n", "Tab number", null, ".hl-TabNumber"],
|
||||||
["N", "Tab number over icon", null, ".hl-TabIconNumber"],
|
["N", "Tab number over icon", null, ".hl-TabIconNumber"]
|
||||||
];
|
];
|
||||||
options.add(["guioptions", "go"],
|
options.add(["guioptions", "go"],
|
||||||
"Show or hide certain GUI elements like the menu or toolbar",
|
"Show or hide certain GUI elements like the menu or toolbar",
|
||||||
@@ -141,7 +141,7 @@ const liberator = (function () //{{{
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
registerObserver("load_mappings", function ()
|
registerObserver("load_mappings", function ()
|
||||||
{
|
{
|
||||||
@@ -159,7 +159,7 @@ const liberator = (function () //{{{
|
|||||||
mappings.add([modes.NORMAL], ["ZZ"],
|
mappings.add([modes.NORMAL], ["ZZ"],
|
||||||
"Quit and save the session",
|
"Quit and save the session",
|
||||||
function () { liberator.quit(true); });
|
function () { liberator.quit(true); });
|
||||||
})
|
});
|
||||||
|
|
||||||
registerObserver("load_commands", function ()
|
registerObserver("load_commands", function ()
|
||||||
{
|
{
|
||||||
@@ -530,7 +530,7 @@ const liberator = (function () //{{{
|
|||||||
argCount: "0",
|
argCount: "0",
|
||||||
bang: true
|
bang: true
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
// initially hide all GUI, it is later restored unless the user has :set go= or something
|
// initially hide all GUI, it is later restored unless the user has :set go= or something
|
||||||
// similar in his config
|
// similar in his config
|
||||||
|
|||||||
@@ -171,13 +171,13 @@ function Options() //{{{
|
|||||||
// Trigger any setters.
|
// Trigger any setters.
|
||||||
let opt = options.get(option);
|
let opt = options.get(option);
|
||||||
if (event == "change" && opt)
|
if (event == "change" && opt)
|
||||||
opt.set(opt.value, options.OPTION_SCOPE_GLOBAL)
|
opt.set(opt.value, options.OPTION_SCOPE_GLOBAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
storage.newMap("options", false);
|
storage.newMap("options", false);
|
||||||
storage.addObserver("options", optionObserver);
|
storage.addObserver("options", optionObserver);
|
||||||
liberator.registerObserver("shutdown", function () {
|
liberator.registerObserver("shutdown", function () {
|
||||||
storage.removeObserver("options", optionObserver)
|
storage.removeObserver("options", optionObserver);
|
||||||
});
|
});
|
||||||
|
|
||||||
function storePreference(name, value)
|
function storePreference(name, value)
|
||||||
@@ -440,8 +440,8 @@ function Options() //{{{
|
|||||||
ret.prefix = prefix;
|
ret.prefix = prefix;
|
||||||
ret.postfix = postfix;
|
ret.postfix = postfix;
|
||||||
|
|
||||||
ret.all = (ret.name == "all")
|
ret.all = (ret.name == "all");
|
||||||
ret.get = (ret.all || postfix == "?" || (ret.option && ret.option.type != "boolean" && !valueGiven))
|
ret.get = (ret.all || postfix == "?" || (ret.option && ret.option.type != "boolean" && !valueGiven));
|
||||||
ret.invert = (prefix == "inv" || postfix == "!");
|
ret.invert = (prefix == "inv" || postfix == "!");
|
||||||
ret.reset = (postfix == "&");
|
ret.reset = (postfix == "&");
|
||||||
ret.unsetBoolean = (prefix == "no");
|
ret.unsetBoolean = (prefix == "no");
|
||||||
@@ -761,7 +761,7 @@ function Options() //{{{
|
|||||||
switch (option.type)
|
switch (option.type)
|
||||||
{
|
{
|
||||||
case "boolean":
|
case "boolean":
|
||||||
completer = function () [["true", ""], ["false", ""]]
|
completer = function () [["true", ""], ["false", ""]];
|
||||||
break;
|
break;
|
||||||
case "stringlist":
|
case "stringlist":
|
||||||
len = opt.valueHas.pop().length;
|
len = opt.valueHas.pop().length;
|
||||||
@@ -930,7 +930,7 @@ function Options() //{{{
|
|||||||
}
|
}
|
||||||
yield option;
|
yield option;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
let list = template.options("Options", opts());
|
let list = template.options("Options", opts());
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
@@ -964,7 +964,7 @@ function Options() //{{{
|
|||||||
|
|
||||||
yield option;
|
yield option;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
let list = template.options(config.hostApplication + " Options", prefs());
|
let list = template.options(config.hostApplication + " Options", prefs());
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const util = { //{{{
|
|||||||
{
|
{
|
||||||
this.doneAt = Date.now() + minInterval;
|
this.doneAt = Date.now() + minInterval;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
this.tell = function (arg)
|
this.tell = function (arg)
|
||||||
{
|
{
|
||||||
if (arg !== undefined)
|
if (arg !== undefined)
|
||||||
@@ -115,17 +115,17 @@ const util = { //{{{
|
|||||||
this.latest = now + maxInterval;
|
this.latest = now + maxInterval;
|
||||||
timer.initWithCallback(this, Math.max(timeout, 0), timer.TYPE_ONE_SHOT);
|
timer.initWithCallback(this, Math.max(timeout, 0), timer.TYPE_ONE_SHOT);
|
||||||
this.doneAt = -1;
|
this.doneAt = -1;
|
||||||
}
|
};
|
||||||
this.reset = function ()
|
this.reset = function ()
|
||||||
{
|
{
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
this.doneAt = 0;
|
this.doneAt = 0;
|
||||||
}
|
};
|
||||||
this.flush = function ()
|
this.flush = function ()
|
||||||
{
|
{
|
||||||
if (this.latest)
|
if (this.latest)
|
||||||
this.notify();
|
this.notify();
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
ciCompare: function (a, b)
|
ciCompare: function (a, b)
|
||||||
|
|||||||
Reference in New Issue
Block a user