1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 09:27:58 +01:00

add missing semicolons

This commit is contained in:
Doug Kearns
2008-12-19 23:00:14 +11:00
parent d65b23be3d
commit d60c81ef23
14 changed files with 44 additions and 38 deletions

View File

@@ -120,7 +120,7 @@ Command.prototype = {
if (matches && matches[2]) if (matches && matches[2])
{ {
commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"), commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
function (args) { exec(matches[1] + "\n" + args) }); function (args) { exec(matches[1] + "\n" + args); });
return; return;
} }
} }
@@ -169,7 +169,7 @@ function Commands() //{{{
const quoteMap = { const quoteMap = {
"\n": "n", "\n": "n",
"\t": "t" "\t": "t"
} };
function quote(q, list) function quote(q, list)
{ {
let re = RegExp("[" + list + "]", "g"); let re = RegExp("[" + list + "]", "g");
@@ -184,7 +184,7 @@ function Commands() //{{{
'"': quote('"', '\n\t"\\\\'), '"': quote('"', '\n\t"\\\\'),
"'": quote("'", "\\\\'"), "'": quote("'", "\\\\'"),
"": quote("", "\\\\ ") "": quote("", "\\\\ ")
} };
const ArgType = new Struct("description", "parse"); const ArgType = new Struct("description", "parse");
const argTypes = [ const argTypes = [
@@ -555,7 +555,7 @@ function Commands() //{{{
if (complete) if (complete)
{ {
if (argCount == "0" || args.length > 0 && (/[1?]/.test(argCount))) if (argCount == "0" || args.length > 0 && (/[1?]/.test(argCount)))
complete.highlight(i, sub.length, "SPELLCHECK") complete.highlight(i, sub.length, "SPELLCHECK");
} }
if (args.length == literal) if (args.length == literal)

View File

@@ -857,7 +857,7 @@ function Editor() //{{{
editor.selection.deleteFromDocument(); editor.selection.deleteFromDocument();
editor.insertText(val); editor.insertText(val);
} }
}, this) }, this);
if (res == false) if (res == false)
throw "Couldn't create temporary file"; throw "Couldn't create temporary file";
} }

View File

@@ -1,4 +1,4 @@
try { __liberator_eval_result = eval(__liberator_eval_string) try { __liberator_eval_result = eval(__liberator_eval_string);
} }
catch (e) catch (e)
{ {

View File

@@ -689,7 +689,7 @@ function Events() //{{{
commands.add(["macros"], commands.add(["macros"],
"List all macros", "List all macros",
function (args) { completion.listCompleter("macro", args[0]) }, function (args) { completion.listCompleter("macro", args[0]); },
{ {
argCount: "?", argCount: "?",
completer: function (context) completion.macro(context) completer: function (context) completion.macro(context)
@@ -1283,7 +1283,7 @@ function Events() //{{{
{ {
events.feedingKeys = false; events.feedingKeys = false;
if (lastMacro) if (lastMacro)
setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'") }, 100); setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'"); }, 100);
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
return true; return true;

View File

@@ -176,7 +176,7 @@ function Search() //{{{
return; return;
} }
var baseNode = <span highlight="Search"/> var baseNode = <span highlight="Search"/>;
baseNode = util.xmlToDom(baseNode, window.content.document); baseNode = util.xmlToDom(baseNode, window.content.document);
var body = doc.body; var body = doc.body;

View File

@@ -237,7 +237,7 @@ function Hints() //{{{
hint[IMGSPAN] = imgspan; hint[IMGSPAN] = imgspan;
span.parentNode.appendChild(imgspan); span.parentNode.appendChild(imgspan);
} }
setClass(imgspan, activeHint == hintnum) setClass(imgspan, activeHint == hintnum);
} }
span.setAttribute("number", hintnum); span.setAttribute("number", hintnum);
@@ -289,7 +289,7 @@ function Hints() //{{{
// animate the disappearance of the first hint // animate the disappearance of the first hint
if (timeout && firstElem) if (timeout && firstElem)
setTimeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight") }, timeout); setTimeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout);
} }
styles.removeSheet("hint-positions", null, null, null, true); styles.removeSheet("hint-positions", null, null, null, true);
@@ -374,7 +374,7 @@ function Hints() //{{{
{ {
linkText = linkText.toLowerCase(); linkText = linkText.toLowerCase();
return tokens.every(function (token) linkText.indexOf(token) >= 0); return tokens.every(function (token) linkText.indexOf(token) >= 0);
} };
} //}}} } //}}}
function wordStartsWithMatcher(hintString, allowWordOverleaping) //{{{ function wordStartsWithMatcher(hintString, allowWordOverleaping) //{{{
@@ -502,7 +502,7 @@ function Hints() //{{{
return charsAtBeginningOfWords(hintStrings[0], words, allowWordOverleaping); return charsAtBeginningOfWords(hintStrings[0], words, allowWordOverleaping);
else else
return stringsAtBeginningOfWords(hintStrings, words, allowWordOverleaping); return stringsAtBeginningOfWords(hintStrings, words, allowWordOverleaping);
} };
} //}}} } //}}}
let hintMatching = options["hintmatching"]; let hintMatching = options["hintmatching"];
@@ -584,7 +584,7 @@ function Hints() //{{{
function (count) function (count)
{ {
extendedhintCount = count; extendedhintCount = count;
commandline.input(";", function (arg) { setTimeout(function () hints.show(arg), 0) }, commandline.input(";", function (arg) { setTimeout(function () hints.show(arg), 0); },
{ {
promptHighlight: "Normal", promptHighlight: "Normal",
completer: function (context) completer: function (context)

View File

@@ -30,7 +30,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
plugins.contexts = {}; plugins.contexts = {};
function Script(file) function Script(file)
{ {
let self = plugins.contexts[file.path] let self = plugins.contexts[file.path];
if (self) if (self)
{ {
if (self.onUnload) if (self.onUnload)

View File

@@ -13,7 +13,7 @@
{ {
try try
{ {
loader.loadSubScript(base + script, modules) loader.loadSubScript(base + script, modules);
return; return;
} }
catch (e) catch (e)

View File

@@ -109,7 +109,7 @@ const liberator = (function () //{{{
.forEach(function (elem) .forEach(function (elem)
{ {
if (elem) if (elem)
elem.collapsed = (opts.indexOf(opt) == -1) elem.collapsed = (opts.indexOf(opt) == -1);
}); });
} }
} }

View File

@@ -73,7 +73,7 @@ function Option(names, description, type, defaultValue, extraInfo) //{{{
} }
Option.prototype = { Option.prototype = {
get globalvalue() options.store.get(this.name), get globalvalue() options.store.get(this.name),
set globalvalue(val) { options.store.set(this.name, val) }, set globalvalue(val) { options.store.set(this.name, val); },
parseValues: function (value) parseValues: function (value)
{ {
@@ -164,8 +164,8 @@ Option.prototype = {
if (this.checkHas) if (this.checkHas)
test = function (val) values.some(function (value) self.checkHas(value, val)); test = function (val) values.some(function (value) self.checkHas(value, val));
let values = this.values; let values = this.values;
/* Return whether some argument matches */ // return whether some argument matches
return Array.some(arguments, function (val) test(val)) return Array.some(arguments, function (val) test(val));
}, },
hasName: function (name) this.names.indexOf(name) >= 0, hasName: function (name) this.names.indexOf(name) >= 0,

View File

@@ -166,7 +166,7 @@ function Highlights(name, store, serial)
return error; return error;
style.value = newStyle; style.value = newStyle;
highlight[style.class] = style; highlight[style.class] = style;
} };
this.selector = function (class) this.selector = function (class)
{ {
@@ -200,7 +200,7 @@ function Highlights(name, store, serial)
if (hl.value == hl.default) if (hl.value == hl.default)
this.set(class); this.set(class);
} }
} };
} }
function Styles(name, store, serial) function Styles(name, store, serial)
@@ -264,7 +264,7 @@ function Styles(name, store, serial)
names[name] = sheet; names[name] = sheet;
} }
return null; return null;
} };
this.findSheets = function (name, filter, css, index, system) this.findSheets = function (name, filter, css, index, system)
{ {
@@ -324,7 +324,7 @@ function Styles(name, store, serial)
} }
} }
return matches.length; return matches.length;
} };
this.registerSheet = function (uri, doCheckSyntax, reload) this.registerSheet = function (uri, doCheckSyntax, reload)
{ {
@@ -336,14 +336,14 @@ function Styles(name, store, serial)
uri = ios.newURI(uri, null, null); uri = ios.newURI(uri, null, null);
if (reload || !sss.sheetRegistered(uri, sss.USER_SHEET)) if (reload || !sss.sheetRegistered(uri, sss.USER_SHEET))
sss.loadAndRegisterSheet(uri, sss.USER_SHEET); sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
} };
this.unregisterSheet = function (uri) this.unregisterSheet = function (uri)
{ {
uri = ios.newURI(uri, null, null); uri = ios.newURI(uri, null, null);
if (sss.sheetRegistered(uri, sss.USER_SHEET)) if (sss.sheetRegistered(uri, sss.USER_SHEET))
sss.unregisterSheet(uri, sss.USER_SHEET); sss.unregisterSheet(uri, sss.USER_SHEET);
} };
// FIXME // FIXME
this.registerAgentSheet = function (uri) this.registerAgentSheet = function (uri)
@@ -351,14 +351,14 @@ function Styles(name, store, serial)
this.unregisterAgentSheet(uri); this.unregisterAgentSheet(uri);
uri = ios.newURI(uri, null, null); uri = ios.newURI(uri, null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET); sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} };
this.unregisterAgentSheet = function (uri) this.unregisterAgentSheet = function (uri)
{ {
uri = ios.newURI(uri, null, null); uri = ios.newURI(uri, null, null);
if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) if (sss.sheetRegistered(uri, sss.AGENT_SHEET))
sss.unregisterSheet(uri, sss.AGENT_SHEET); sss.unregisterSheet(uri, sss.AGENT_SHEET);
} };
function wrapCSS(sheet) function wrapCSS(sheet)
{ {
@@ -425,7 +425,7 @@ function Styles(name, store, serial)
if (errors.length) if (errors.length)
{ {
let err = new Error("", errors[0].sourceName.replace(/^(chrome-data:text\/css,).*/, "$1..."), errors[0].lineNumber); let err = new Error("", errors[0].sourceName.replace(/^(chrome-data:text\/css,).*/, "$1..."), errors[0].lineNumber);
err.name = "CSSError" err.name = "CSSError";
err.message = errors.reduce(function (msg, e) msg + "; " + e.lineNumber + ": " + e.errorMessage, err.message = errors.reduce(function (msg, e) msg + "; " + e.lineNumber + ": " + e.errorMessage,
errors.shift().errorMessage); errors.shift().errorMessage);
err.echoerr = err.fileName + ":" + err.lineNumber + ": " + err.message; err.echoerr = err.fileName + ":" + err.lineNumber + ": " + err.message;
@@ -516,7 +516,7 @@ liberator.registerObserver("load_commands", function ()
} }
catch (e) {} catch (e) {}
context.anchored = false; context.anchored = false;
context.completions = compl.concat([[s, ""] for each (s in styles.sites)]) context.completions = compl.concat([[s, ""] for each (s in styles.sites)]);
} }
else if (args.completeArg == 1) else if (args.completeArg == 1)
{ {

View File

@@ -598,7 +598,7 @@ function Tabs() //{{{
function (args) function (args)
{ {
let count = args.count; let count = args.count;
args = args[0] args = args[0];
if (count < 1) if (count < 1)
count = 1; count = 1;

View File

@@ -238,7 +238,7 @@ function Bookmarks() //{{{
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);
liberator.registerObserver("shutdown", function () { liberator.registerObserver("shutdown", function () {
storage.removeObserver("bookmark-cache", bookmarkObserver) storage.removeObserver("bookmark-cache", bookmarkObserver);
}); });
liberator.registerObserver("enter", function () { liberator.registerObserver("enter", function () {
@@ -358,7 +358,7 @@ function Bookmarks() //{{{
if (!args.bang) if (!args.bang)
{ {
context.completions = [[content.document.documentURI, "Current Location"]]; context.completions = [[content.document.documentURI, "Current Location"]];
return return;
} }
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });
}, },
@@ -784,7 +784,7 @@ function History() //{{{
function (args) { history.list(args.join(" "), args.bang, args["-max"] || 1000); }, function (args) { history.list(args.join(" "), args.bang, args["-max"] || 1000); },
{ {
bang: true, bang: true,
completer: function (context) { context.quote = null, completion.history(context) }, completer: function (context) { context.quote = null, completion.history(context); },
options: [[["-max", "-m"], options.OPTION_INT]] options: [[["-max", "-m"], options.OPTION_INT]]
// completer: function (filter) completion.history(filter) // completer: function (filter) completion.history(filter)
}); });
@@ -823,7 +823,7 @@ function History() //{{{
url: node.uri, url: node.uri,
title: node.title, title: node.title,
icon: node.icon ? node.icon.spec : DEFAULT_FAVICON icon: node.icon ? node.icon.spec : DEFAULT_FAVICON
} };
}); });
root.containerOpen = false; // close a container after using it! root.containerOpen = false; // close a container after using it!
@@ -844,7 +844,10 @@ function History() //{{{
{ {
let index = window.getWebNavigation().sessionHistory.index; let index = window.getWebNavigation().sessionHistory.index;
if (index == 0) if (index == 0)
return liberator.beep(); // really wanted? {
liberator.beep(); // XXX: really wanted?
return;
}
window.getWebNavigation().gotoIndex(0); window.getWebNavigation().gotoIndex(0);
}, },
@@ -853,7 +856,10 @@ function History() //{{{
{ {
let index = window.getWebNavigation().sessionHistory.index; let index = window.getWebNavigation().sessionHistory.index;
if (index == window.getWebNavigation().sessionHistory.count - 1) if (index == window.getWebNavigation().sessionHistory.count - 1)
return liberator.beep(); {
liberator.beep();
return;
}
window.getWebNavigation().gotoIndex(max); window.getWebNavigation().gotoIndex(max);
}, },

View File

@@ -171,7 +171,7 @@ const config = { //{{{
</> + "}", </> + "}",
true); true);
delete img; delete img;
} };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
////////////////////// MAPPINGS //////////////////////////////////////////////// ////////////////////// MAPPINGS ////////////////////////////////////////////////