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

whitespace fixes and revert some overly aggressive use of expression closures

This commit is contained in:
Doug Kearns
2008-10-04 10:18:53 +00:00
parent 156fa5d56f
commit 6ef73cf313
16 changed files with 84 additions and 71 deletions

View File

@@ -82,7 +82,10 @@ liberator.Addressbook = function () //{{{
{ {
to = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor; to = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor;
} }
catch (e) { liberator.beep(); } catch (e)
{
liberator.beep();
}
if (!to) if (!to)
return; return;
@@ -134,7 +137,7 @@ liberator.Addressbook = function () //{{{
liberator.commands.add(["contacts", "addr[essbook]"], liberator.commands.add(["contacts", "addr[essbook]"],
"List or open multiple addresses", "List or open multiple addresses",
function (args, special) liberator.addressbook.list(args, special), function (args, special) { liberator.addressbook.list(args, special); },
{ bangAllowed: true }); { bangAllowed: true });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -165,7 +165,8 @@ liberator.Bookmarks = function () //{{{
liberator.storage.fireEvent(name, "change", itemId); liberator.storage.fireEvent(name, "change", itemId);
} }
}, },
QueryInterface: function (iid) { QueryInterface: function (iid)
{
if (iid.equals(Components.interfaces.nsINavBookmarkObserver) || iid.equals(Components.interfaces.nsISupports)) if (iid.equals(Components.interfaces.nsINavBookmarkObserver) || iid.equals(Components.interfaces.nsISupports))
return this; return this;
throw Components.results.NS_ERROR_NO_INTERFACE; throw Components.results.NS_ERROR_NO_INTERFACE;
@@ -221,7 +222,7 @@ liberator.Bookmarks = function () //{{{
liberator.mappings.add(modes, ["A"], liberator.mappings.add(modes, ["A"],
"Toggle bookmarked state of current URL", "Toggle bookmarked state of current URL",
function () liberator.bookmarks.toggle(liberator.buffer.URL)); function () { liberator.bookmarks.toggle(liberator.buffer.URL); });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////
@@ -264,7 +265,7 @@ liberator.Bookmarks = function () //{{{
argCount: "?", argCount: "?",
options: [[["-title", "-t"], liberator.commands.OPTION_STRING], options: [[["-title", "-t"], liberator.commands.OPTION_STRING],
[["-tags", "-T"], liberator.commands.OPTION_LIST], [["-tags", "-T"], liberator.commands.OPTION_LIST],
[["-keyword", "-k"], liberator.commands.OPTION_STRING, function (arg) { return /\w/.test(arg); }]] [["-keyword", "-k"], liberator.commands.OPTION_STRING, function (arg) /\w/.test(arg)]]
}); });
liberator.commands.add(["bmarks"], liberator.commands.add(["bmarks"],
@@ -513,7 +514,7 @@ liberator.History = function () //{{{
var cachedHistory = []; // add pages here after loading the initial Places history var cachedHistory = []; // add pages here after loading the initial Places history
if (liberator.options["preload"]) if (liberator.options["preload"])
setTimeout(function () load(), 100); setTimeout(function () { load(); }, 100);
function load() function load()
{ {
@@ -667,7 +668,7 @@ liberator.History = function () //{{{
liberator.commands.add(["hist[ory]", "hs"], liberator.commands.add(["hist[ory]", "hs"],
"Show recently visited URLs", "Show recently visited URLs",
function (args, special) liberator.history.list(args, special), function (args, special) { liberator.history.list(args, special); },
{ {
bangAllowed: true, bangAllowed: true,
completer: function (filter) [0, liberator.history.get(filter)] completer: function (filter) [0, liberator.history.get(filter)]

View File

@@ -130,11 +130,14 @@ liberator.Buffer = function () //{{{
while (true) while (true)
{ {
try { try
{
// Throws NS_ERROR_DOM_INVALID_ACCESS_ERR if not finished loading // Throws NS_ERROR_DOM_INVALID_ACCESS_ERR if not finished loading
doc.styleSheets[0].cssRules.length; doc.styleSheets[0].cssRules.length;
break; break;
} catch (e) { }
catch (e)
{
if (e.name != "NS_ERROR_DOM_INVALID_ACCESS_ERR") if (e.name != "NS_ERROR_DOM_INVALID_ACCESS_ERR")
return [e.toString()]; return [e.toString()];
liberator.sleep(10); liberator.sleep(10);
@@ -608,7 +611,7 @@ liberator.Buffer = function () //{{{
liberator.commands.add(["pa[geinfo]"], liberator.commands.add(["pa[geinfo]"],
"Show various page information", "Show various page information",
function () liberator.buffer.showPageInfo(true), function () { liberator.buffer.showPageInfo(true); },
{ argCount: "0" }); { argCount: "0" });
liberator.commands.add(["pagest[yle]"], liberator.commands.add(["pagest[yle]"],
@@ -632,7 +635,7 @@ liberator.Buffer = function () //{{{
liberator.commands.add(["re[load]"], liberator.commands.add(["re[load]"],
"Reload current page", "Reload current page",
function (args, special) liberator.tabs.reload(getBrowser().mCurrentTab, special), function (args, special) { liberator.tabs.reload(getBrowser().mCurrentTab, special); },
{ {
bangAllowed: true, bangAllowed: true,
argCount: "0" argCount: "0"
@@ -657,7 +660,7 @@ liberator.Buffer = function () //{{{
liberator.commands.add(["st[op]"], liberator.commands.add(["st[op]"],
"Stop loading", "Stop loading",
function () BrowserStop(), function () { BrowserStop(); },
{ argCount: "0" }); { argCount: "0" });
liberator.commands.add(["sty[le]"], liberator.commands.add(["sty[le]"],
@@ -692,7 +695,7 @@ liberator.Buffer = function () //{{{
liberator.commands.add(["dels[tyle]"], liberator.commands.add(["dels[tyle]"],
"Remove a user stylesheet", "Remove a user stylesheet",
function (args) styles.removeSheet(parseInt(args.arguments[0])), function (args) { styles.removeSheet(parseInt(args.arguments[0])); },
{ {
completer: function (filter) [0, [[i, s[0] + ": " + s[1].replace("\n", "\\n")] for ([i, s] in styles)]], completer: function (filter) [0, [[i, s[0] + ": " + s[1].replace("\n", "\\n")] for ([i, s] in styles)]],
argCount: 1 argCount: 1
@@ -700,7 +703,7 @@ liberator.Buffer = function () //{{{
liberator.commands.add(["vie[wsource]"], liberator.commands.add(["vie[wsource]"],
"View source code of current document", "View source code of current document",
function (args, special) liberator.buffer.viewSource(args, special), function (args, special) { liberator.buffer.viewSource(args, special); },
{ bangAllowed: true }); { bangAllowed: true });
liberator.commands.add(["zo[om]"], liberator.commands.add(["zo[om]"],
@@ -801,7 +804,8 @@ liberator.Buffer = function () //{{{
// put feeds rss into pageFeeds[] // put feeds rss into pageFeeds[]
let nFeed = 0; let nFeed = 0;
var linkNodes = doc.getElementsByTagName("link"); var linkNodes = doc.getElementsByTagName("link");
for (link in arrayIter(linkNodes)) { for (link in arrayIter(linkNodes))
{
if (!link.href) if (!link.href)
return; return;
@@ -1384,7 +1388,7 @@ liberator.Buffer = function () //{{{
doc.body.appendChild(liberator.util.xmlToDom(indicator)); doc.body.appendChild(liberator.util.xmlToDom(indicator));
// remove the frame indicator // remove the frame indicator
setTimeout(function () doc.body.removeChild(indicator), 500); setTimeout(function () { doc.body.removeChild(indicator); }, 500);
}, },
// similar to pageInfo // similar to pageInfo
@@ -1876,7 +1880,7 @@ liberator.template = {
return xml; return xml;
try try
{ {
return new XMLList(xml) return new XMLList(xml);
} }
catch (e) {} catch (e) {}
return <>{xml}</>; return <>{xml}</>;
@@ -1884,7 +1888,7 @@ liberator.template = {
generic: function (xml) generic: function (xml)
{ {
return <>:{liberator.commandline.getCommand()}<br/></> + xml return <>:{liberator.commandline.getCommand()}<br/></> + xml;
}, },
bookmarks: function (header, items) bookmarks: function (header, items)

View File

@@ -740,7 +740,7 @@ liberator.Commands = function () //{{{
"Delete all user-defined commands", "Delete all user-defined commands",
function () function ()
{ {
liberator.commands.getUserCommands().forEach(function (cmd) liberator.commands.removeUserCommand(cmd.name)); liberator.commands.getUserCommands().forEach(function (cmd) { liberator.commands.removeUserCommand(cmd.name); });
}, },
{ argCount: "0" }); { argCount: "0" });

View File

@@ -174,11 +174,11 @@ liberator.Editor = function () //{{{
liberator.commands.add([ch ? ch + "una[bbrev]" : "una[bbreviate]"], liberator.commands.add([ch ? ch + "una[bbrev]" : "una[bbreviate]"],
"Remove an abbreviation" + modeDescription, "Remove an abbreviation" + modeDescription,
function (args) liberator.editor.removeAbbreviation(mode, args)); function (args) { liberator.editor.removeAbbreviation(mode, args); });
liberator.commands.add([ch + "abc[lear]"], liberator.commands.add([ch + "abc[lear]"],
"Remove all abbreviations" + modeDescription, "Remove all abbreviations" + modeDescription,
function () liberator.editor.removeAllAbbreviations(mode), function () { liberator.editor.removeAllAbbreviations(mode); },
{ argCount: "0" }); { argCount: "0" });
} }
@@ -290,7 +290,7 @@ liberator.Editor = function () //{{{
liberator.mappings.add([liberator.modes.INSERT], liberator.mappings.add([liberator.modes.INSERT],
["<Space>", "<Return>"], "Expand insert mode abbreviation", ["<Space>", "<Return>"], "Expand insert mode abbreviation",
function () { return liberator.editor.expandAbbreviation("i"); }, function () { liberator.editor.expandAbbreviation("i"); },
{ flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING }); { flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING });
liberator.mappings.add([liberator.modes.INSERT], liberator.mappings.add([liberator.modes.INSERT],

View File

@@ -296,7 +296,7 @@ liberator.Events = function () //{{{
liberator.tabs.updateSelectionHistory(); liberator.tabs.updateSelectionHistory();
if (liberator.options["focuscontent"]) if (liberator.options["focuscontent"])
setTimeout(function () liberator.focusContent(true), 10); // just make sure, that no widget has focus setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
}, false); }, false);
} }
@@ -873,7 +873,8 @@ liberator.Events = function () //{{{
evt.isMacro = true; evt.isMacro = true;
elem.dispatchEvent(evt); elem.dispatchEvent(evt);
// stop feeding keys if page loading failed // stop feeding keys if page loading failed
if (wasReplaying) { if (wasReplaying)
{
if (!liberator.modes.isReplaying) if (!liberator.modes.isReplaying)
break; break;
if (!waitForPageLoaded()) if (!waitForPageLoaded())
@@ -1455,7 +1456,7 @@ liberator.Events = function () //{{{
// is not the focused frame // is not the focused frame
if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow) if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow)
{ {
setTimeout(function () liberator.modes.reset(false), setTimeout(function () { liberator.modes.reset(false); },
liberator.mode == liberator.modes.HINTS ? 500 : 0); liberator.mode == liberator.modes.HINTS ? 500 : 0);
} }
} }
@@ -1494,7 +1495,7 @@ liberator.Events = function () //{{{
liberator.autocommands.trigger("LocationChange", liberator.buffer.URL); liberator.autocommands.trigger("LocationChange", liberator.buffer.URL);
// if this is not delayed we get the position of the old buffer // if this is not delayed we get the position of the old buffer
setTimeout(function () liberator.statusline.updateBufferPosition(), 100); setTimeout(function () { liberator.statusline.updateBufferPosition(); }, 100);
}, },
// called at the very end of a page load // called at the very end of a page load
asyncUpdateUI: function () asyncUpdateUI: function ()

View File

@@ -155,7 +155,8 @@ liberator.Search = function () //{{{
if (!doc || !(doc instanceof HTMLDocument)) if (!doc || !(doc instanceof HTMLDocument))
return; return;
if (!aWord) { if (!aWord)
{
let elems = doc.getElementsByClassName("__liberator-search"); let elems = doc.getElementsByClassName("__liberator-search");
for (let i = elems.length; --i >= 0;) for (let i = elems.length; --i >= 0;)
{ {
@@ -195,7 +196,8 @@ liberator.Search = function () //{{{
this.endPt.setStart(body, count); this.endPt.setStart(body, count);
this.endPt.setEnd(body, count); this.endPt.setEnd(body, count);
for (let retRange in this.search(aWord, caseSensitive)) { for (let retRange in this.search(aWord, caseSensitive))
{
// Highlight // Highlight
var nodeSurround = baseNode.cloneNode(true); var nodeSurround = baseNode.cloneNode(true);
var node = this.highlight(retRange, nodeSurround); var node = this.highlight(retRange, nodeSurround);
@@ -305,7 +307,7 @@ liberator.Search = function () //{{{
liberator.commands.add(["noh[lsearch]"], liberator.commands.add(["noh[lsearch]"],
"Remove the search highlighting", "Remove the search highlighting",
function () liberator.search.clear(), function () { liberator.search.clear(); },
{ argCount: "0" }); { argCount: "0" });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -344,7 +346,7 @@ liberator.Search = function () //{{{
found = fastFind.find(searchString, linksOnly) != Components.interfaces.nsITypeAheadFind.FIND_NOTFOUND; found = fastFind.find(searchString, linksOnly) != Components.interfaces.nsITypeAheadFind.FIND_NOTFOUND;
if (!found) if (!found)
setTimeout(function () liberator.echoerr("E486: Pattern not found: " + searchPattern), 0); setTimeout(function () { liberator.echoerr("E486: Pattern not found: " + searchPattern); }, 0);
return found; return found;
}, },
@@ -417,7 +419,7 @@ liberator.Search = function () //{{{
// TODO: move to find() when reverse incremental searching is kludged in // TODO: move to find() when reverse incremental searching is kludged in
// need to find again for reverse searching // need to find again for reverse searching
if (backwards) if (backwards)
setTimeout(function () liberator.search.findAgain(false), 0); setTimeout(function () { liberator.search.findAgain(false); }, 0);
if (liberator.options["hlsearch"]) if (liberator.options["hlsearch"])
this.highlight(searchString); this.highlight(searchString);

View File

@@ -340,8 +340,8 @@ liberator.Hints = function () //{{{
case "V": liberator.buffer.viewSource(loc, true); break; case "V": liberator.buffer.viewSource(loc, true); break;
case "w": liberator.buffer.followLink(elem, liberator.NEW_WINDOW); break; case "w": liberator.buffer.followLink(elem, liberator.NEW_WINDOW); break;
case "W": liberator.commandline.open(":", "winopen " + loc, liberator.modes.EX); break; case "W": liberator.commandline.open(":", "winopen " + loc, liberator.modes.EX); break;
case "y": setTimeout(function () liberator.util.copyToClipboard(loc, true), timeout + 50); break; case "y": setTimeout(function () { liberator.util.copyToClipboard(loc, true); }, timeout + 50); break;
case "Y": setTimeout(function () liberator.util.copyToClipboard(elem.textContent || "", true), timeout + 50); break; case "Y": setTimeout(function () { liberator.util.copyToClipboard(elem.textContent || "", true); }, timeout + 50); break;
default: default:
liberator.echoerr("INTERNAL ERROR: unknown submode: " + submode); liberator.echoerr("INTERNAL ERROR: unknown submode: " + submode);
} }
@@ -804,7 +804,7 @@ liberator.Hints = function () //{{{
{ {
var timeout = liberator.options["hinttimeout"]; var timeout = liberator.options["hinttimeout"];
if (timeout > 0) if (timeout > 0)
activeTimeout = setTimeout(function () processHints(true), timeout); activeTimeout = setTimeout(function () { processHints(true); }, timeout);
return false; return false;
} }

View File

@@ -193,7 +193,7 @@ liberator.IO = function () //{{{
liberator.commands.add(["pw[d]"], liberator.commands.add(["pw[d]"],
"Print the current directory name", "Print the current directory name",
function () liberator.echo(liberator.io.getCurrentDirectory()), function () { liberator.echo(liberator.io.getCurrentDirectory()); },
{ argCount: "0" }); { argCount: "0" });
// mkv[imperatorrc] or mkm[uttatorrc] // mkv[imperatorrc] or mkm[uttatorrc]

View File

@@ -156,7 +156,7 @@ const liberator = (function () //{{{
liberator.commands.add(["beep"], liberator.commands.add(["beep"],
"Play a system beep", "Play a system beep",
function () liberator.beep(), function () { liberator.beep(); },
{ argCount: "0" }); { argCount: "0" });
liberator.commands.add(["dia[log]"], liberator.commands.add(["dia[log]"],
@@ -343,7 +343,7 @@ const liberator = (function () //{{{
liberator.commands.add(["norm[al]"], liberator.commands.add(["norm[al]"],
"Execute Normal mode commands", "Execute Normal mode commands",
function (args, special) liberator.events.feedkeys(args.string, special), function (args, special) { liberator.events.feedkeys(args.string, special); },
{ {
argCount: "+", argCount: "+",
bangAllowed: true bangAllowed: true
@@ -365,7 +365,7 @@ const liberator = (function () //{{{
liberator.commands.add(["res[tart]"], liberator.commands.add(["res[tart]"],
"Force " + liberator.config.name + " to restart", "Force " + liberator.config.name + " to restart",
function () liberator.restart(), function () { liberator.restart(); },
{ argCount: "0" }); { argCount: "0" });
liberator.commands.add(["time"], liberator.commands.add(["time"],
@@ -621,7 +621,7 @@ const liberator = (function () //{{{
popup.height = box.height; popup.height = box.height;
popup.width = box.width; popup.width = box.width;
popup.openPopup(win, "overlap", 0, 0, false, false); popup.openPopup(win, "overlap", 0, 0, false, false);
setTimeout(function () popup.hidePopup(), 50); setTimeout(function () { popup.hidePopup(); }, 50);
} }
} }
else else

View File

@@ -139,12 +139,12 @@ liberator.Mail = function () //{{{
if (copy) if (copy)
{ {
MsgCopyMessage(folders[0]); MsgCopyMessage(folders[0]);
setTimeout(function () liberator.echo(count + " message(s) copied to " + folders[0].prettyName), 100); setTimeout(function () { liberator.echo(count + " message(s) copied to " + folders[0].prettyName); }, 100);
} }
else else
{ {
MsgMoveMessage(folders[0]); MsgMoveMessage(folders[0]);
setTimeout(function () liberator.echo(count + " message(s) moved to " + folders[0].prettyName), 100); setTimeout(function () { liberator.echo(count + " message(s) moved to " + folders[0].prettyName); }, 100);
} }
return true; return true;
} }
@@ -263,7 +263,7 @@ liberator.Mail = function () //{{{
liberator.mappings.add(modes, ["<Space>"], liberator.mappings.add(modes, ["<Space>"],
"Scroll message or select next unread one", "Scroll message or select next unread one",
function () { return true; }, function () true,
{ flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING }); { flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING });
liberator.mappings.add(modes, ["t"], liberator.mappings.add(modes, ["t"],
@@ -591,7 +591,7 @@ liberator.Mail = function () //{{{
"Mark all messages as read", "Mark all messages as read",
function () function ()
{ {
liberator.mail.getFolders("", false).forEach(function (folder) folder.markAllMessagesRead()); liberator.mail.getFolders("", false).forEach(function (folder) { folder.markAllMessagesRead(); });
}); });
// DISPLAY OPTIONS // DISPLAY OPTIONS
@@ -711,17 +711,17 @@ liberator.Mail = function () //{{{
liberator.commands.add(["copy[to]"], liberator.commands.add(["copy[to]"],
"Copy selected messages", "Copy selected messages",
function (args) moveOrCopy(true, args), function (args) { moveOrCopy(true, args); },
{ completer: function (filter) getFolderCompletions(filter) }); { completer: function (filter) getFolderCompletions(filter) });
liberator.commands.add(["move[to]"], liberator.commands.add(["move[to]"],
"Move selected messages", "Move selected messages",
function (args) moveOrCopy(false, args), function (args) { moveOrCopy(false, args); },
{ completer: function (filter) getFolderCompletions(filter) }); { completer: function (filter) getFolderCompletions(filter) });
liberator.commands.add(["empty[trash]"], liberator.commands.add(["empty[trash]"],
"Empty trash of the current account", "Empty trash of the current account",
function () goDoCommand("cmd_emptyTrash"), function () { goDoCommand("cmd_emptyTrash"); },
{ argCount: "0" }); { argCount: "0" });
liberator.commands.add(["get[messages]"], liberator.commands.add(["get[messages]"],
@@ -740,7 +740,8 @@ liberator.Mail = function () //{{{
get currentAccount() this.currentFolder.rootFolder, get currentAccount() this.currentFolder.rootFolder,
get currentFolder() { get currentFolder()
{
var tree = GetFolderTree(); var tree = GetFolderTree();
return GetFolderResource(tree, tree.currentIndex). return GetFolderResource(tree, tree.currentIndex).
QueryInterface(Components.interfaces.nsIMsgFolder); QueryInterface(Components.interfaces.nsIMsgFolder);

View File

@@ -88,7 +88,7 @@ liberator.Mappings = function () //{{{
function addMap(map, userMap) function addMap(map, userMap)
{ {
var where = userMap ? user : main; var where = userMap ? user : main;
map.modes.forEach(function (mode) where[mode].push(map)); map.modes.forEach(function (mode) { where[mode].push(map); });
} }
function getMap(mode, cmd, stack) function getMap(mode, cmd, stack)
@@ -202,12 +202,12 @@ liberator.Mappings = function () //{{{
liberator.commands.add([ch ? ch + "m[ap]" : "map"], liberator.commands.add([ch ? ch + "m[ap]" : "map"],
"Map a key sequence" + modeDescription, "Map a key sequence" + modeDescription,
function (args) map(args, modes, false), function (args) { map(args, modes, false); },
{ completer: function (filter) liberator.completion.userMapping(filter, modes) }); { completer: function (filter) liberator.completion.userMapping(filter, modes) });
liberator.commands.add([ch + "no[remap]"], liberator.commands.add([ch + "no[remap]"],
"Map a key sequence without remapping keys" + modeDescription, "Map a key sequence without remapping keys" + modeDescription,
function (args) map(args, modes, true)); function (args) { map(args, modes, true); });
liberator.commands.add([ch + "mapc[lear]"], liberator.commands.add([ch + "mapc[lear]"],
"Remove all mappings" + modeDescription, "Remove all mappings" + modeDescription,

View File

@@ -69,7 +69,7 @@ liberator.Option = function (names, description, type, defaultValue, extraInfo)
} }
this.__defineGetter__("globalvalue", function () liberator.options.store.get(cannonName)); this.__defineGetter__("globalvalue", function () liberator.options.store.get(cannonName));
this.__defineSetter__("globalvalue", function (val) liberator.options.store.set(cannonName, val)); this.__defineSetter__("globalvalue", function (val) { liberator.options.store.set(cannonName, val); });
if (this.globalvalue == undefined) if (this.globalvalue == undefined)
this.globalvalue = this.defaultValue; this.globalvalue = this.defaultValue;
@@ -887,7 +887,7 @@ liberator.Options = function () //{{{
} }
// quickly access options with liberator.options["wildmode"]: // quickly access options with liberator.options["wildmode"]:
this.__defineGetter__(option.name, function () { return option.value; }); this.__defineGetter__(option.name, function () option.value);
this.__defineSetter__(option.name, function (value) { option.value = value; }); this.__defineSetter__(option.name, function (value) { option.value = value; });
// TODO: sort option // TODO: sort option

View File

@@ -43,10 +43,10 @@ liberator.Tabs = function () //{{{
if (!tabmail) if (!tabmail)
{ {
tabmail = document.getElementById('tabmail'); tabmail = document.getElementById('tabmail');
tabmail.__defineGetter__('mTabContainer', function () { return this.tabContainer; }); tabmail.__defineGetter__('mTabContainer', function () this.tabContainer);
tabmail.__defineGetter__('mTabs', function () { return this.tabContainer.childNodes; }); tabmail.__defineGetter__('mTabs', function () this.tabContainer.childNodes);
tabmail.__defineGetter__('mCurrentTab', function () { return this.tabContainer.selectedItem; }); tabmail.__defineGetter__('mCurrentTab', function () this.tabContainer.selectedItem);
tabmail.__defineGetter__('mStrip', function () { return this.tabStrip; }); tabmail.__defineGetter__('mStrip', function () this.tabStrip);
} }
return tabmail; return tabmail;
}; };
@@ -427,7 +427,7 @@ liberator.Tabs = function () //{{{
liberator.commands.add(["tabr[ewind]", "tabfir[st]", "br[ewind]", "bf[irst]"], liberator.commands.add(["tabr[ewind]", "tabfir[st]", "br[ewind]", "bf[irst]"],
"Switch to the first tab", "Switch to the first tab",
function () liberator.tabs.select(0, false), function () { liberator.tabs.select(0, false); },
{ argCount: "0" }); { argCount: "0" });
if (liberator.config.name == "Vimperator") if (liberator.config.name == "Vimperator")
@@ -462,7 +462,7 @@ liberator.Tabs = function () //{{{
liberator.commands.add(["buffers", "files", "ls", "tabs"], liberator.commands.add(["buffers", "files", "ls", "tabs"],
"Show a list of all buffers", "Show a list of all buffers",
function (args, special) liberator.tabs.list(special), function (args, special) { liberator.tabs.list(special); },
{ {
argCount: "0", argCount: "0",
bangAllowed: true bangAllowed: true
@@ -470,7 +470,7 @@ liberator.Tabs = function () //{{{
liberator.commands.add(["quita[ll]", "qa[ll]"], liberator.commands.add(["quita[ll]", "qa[ll]"],
"Quit " + liberator.config.name, "Quit " + liberator.config.name,
function (args, special) liberator.quit(false, special), function (args, special) { liberator.quit(false, special); },
{ {
argCount: "0", argCount: "0",
bangAllowed: true bangAllowed: true
@@ -478,7 +478,7 @@ liberator.Tabs = function () //{{{
liberator.commands.add(["reloada[ll]"], liberator.commands.add(["reloada[ll]"],
"Reload all tab pages", "Reload all tab pages",
function (args, special) liberator.tabs.reloadAll(special), function (args, special) { liberator.tabs.reloadAll(special); },
{ {
argCount: "0", argCount: "0",
bangAllowed: true bangAllowed: true
@@ -505,7 +505,7 @@ liberator.Tabs = function () //{{{
liberator.commands.add(["tabo[nly]"], liberator.commands.add(["tabo[nly]"],
"Close all other tabs", "Close all other tabs",
function () liberator.tabs.keepOnly(getBrowser().mCurrentTab), function () { liberator.tabs.keepOnly(getBrowser().mCurrentTab); },
{ argCount: "0" }); { argCount: "0" });
liberator.commands.add(["tabopen", "t[open]", "tabnew", "tabe[dit]"], liberator.commands.add(["tabopen", "t[open]", "tabnew", "tabe[dit]"],
@@ -528,7 +528,7 @@ liberator.Tabs = function () //{{{
liberator.commands.add(["tabde[tach]"], liberator.commands.add(["tabde[tach]"],
"Detach current tab to its own window", "Detach current tab to its own window",
function (args, special, count) liberator.tabs.detachTab(null), function (args, special, count) { liberator.tabs.detachTab(null); },
{ {
argCount: "0", argCount: "0",
bangAllowed: true bangAllowed: true

View File

@@ -661,7 +661,7 @@ liberator.CommandLine = function () //{{{
multilineInputWidget.value = ""; multilineInputWidget.value = "";
autosizeMultilineInputWidget(); autosizeMultilineInputWidget();
setTimeout(function () multilineInputWidget.focus(), 10); setTimeout(function () { multilineInputWidget.focus(); }, 10);
}, },
onEvent: function (event) onEvent: function (event)
@@ -911,7 +911,7 @@ liberator.CommandLine = function () //{{{
else if (event.type == "blur") else if (event.type == "blur")
{ {
if (liberator.modes.extended & liberator.modes.INPUT_MULTILINE) if (liberator.modes.extended & liberator.modes.INPUT_MULTILINE)
setTimeout(function () multilineInputWidget.inputField.focus(), 0); setTimeout(function () { multilineInputWidget.inputField.focus(); }, 0);
} }
else if (event.type == "input") else if (event.type == "input")
{ {
@@ -931,8 +931,8 @@ liberator.CommandLine = function () //{{{
var closeWindow = false; var closeWindow = false;
var passEvent = false; var passEvent = false;
function isScrollable() { return !win.scrollMaxY == 0; } function isScrollable() !win.scrollMaxY == 0;
function atEnd() { return win.scrollY / win.scrollMaxY >= 1; } function atEnd() win.scrollY / win.scrollMaxY >= 1;
var key = liberator.events.toString(event); var key = liberator.events.toString(event);
@@ -1248,7 +1248,7 @@ liberator.ItemList = function (id) //{{{
var height = getHeight(); var height = getHeight();
if (height == 0) // sometimes we don't have the correct size at this point if (height == 0) // sometimes we don't have the correct size at this point
setTimeout(function () container.height = getHeight(), 10); setTimeout(function () { container.height = getHeight(); }, 10);
else else
container.height = height; container.height = height;
} }
@@ -1322,7 +1322,7 @@ liberator.ItemList = function (id) //{{{
clear: function () { this.setItems([]); doc.body.innerHTML = ""; }, clear: function () { this.setItems([]); doc.body.innerHTML = ""; },
hide: function () { container.collapsed = true; }, hide: function () { container.collapsed = true; },
show: function () { container.collapsed = false; }, show: function () { container.collapsed = false; },
visible: function () { return !container.collapsed; }, visible: function () !container.collapsed,
// if @param selectedItem is given, show the list and select that item // if @param selectedItem is given, show the list and select that item
setItems: function (items, selectedItem) setItems: function (items, selectedItem)

View File

@@ -310,7 +310,8 @@ liberator.util = { //{{{
value = "<no value>"; value = "<no value>";
} }
if (color) { if (color)
{
value = this.colorize(value, true).toXMLString(); value = this.colorize(value, true).toXMLString();
i = <span style="font-weight: bold;">{i}</span>.toXMLString(); i = <span style="font-weight: bold;">{i}</span>.toXMLString();
} }