1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:17:59 +01:00

whitespace fixes

This commit is contained in:
Doug Kearns
2008-05-27 15:15:36 +00:00
parent 1d0f4e29e5
commit c1390135d2
14 changed files with 104 additions and 104 deletions

View File

@@ -200,7 +200,7 @@ liberator.Buffer = function () //{{{
liberator.mappings.add(modes, ["<C-c>"], liberator.mappings.add(modes, ["<C-c>"],
"Stop loading", "Stop loading",
function() { BrowserStop(); }); function () { BrowserStop(); });
// scrolling // scrolling
liberator.mappings.add(modes, ["j", "<Down>", "<C-e>"], liberator.mappings.add(modes, ["j", "<Down>", "<C-e>"],

View File

@@ -445,8 +445,8 @@ liberator.Commands = function () //{{{
// Idea: If v.commands.add() specifies args or opts in extraInfo, don't call the function // Idea: If v.commands.add() specifies args or opts in extraInfo, don't call the function
// with args as a string, but already pass an object like: // with args as a string, but already pass an object like:
// args = { -option: value, -anotheroption: true, arguments: [] } // args = { -option: value, -anotheroption: true, arguments: [] }
getOption: function(opts, option, def) { return getOption(opts, option, def); }, getOption: function (opts, option, def) { return getOption(opts, option, def); },
parseArgs: function(str, options) { return parseArgs(str, options); }, parseArgs: function (str, options) { return parseArgs(str, options); },
OPTION_ANY: 0, // can be given no argument or an argument of any type, OPTION_ANY: 0, // can be given no argument or an argument of any type,
// caller is responsible for parsing the return value // caller is responsible for parsing the return value

View File

@@ -178,7 +178,7 @@ liberator.Completion = function () //{{{
return [0, buildLongestCommonSubstring(mapped, filter)]; return [0, buildLongestCommonSubstring(mapped, filter)];
}, },
searchEngineSuggest: function(filter, engineAliases) searchEngineSuggest: function (filter, engineAliases)
{ {
if (!filter) if (!filter)
return [0,null]; return [0,null];
@@ -189,7 +189,7 @@ liberator.Completion = function () //{{{
.getService(Components.interfaces.nsIBrowserSearchService); .getService(Components.interfaces.nsIBrowserSearchService);
var completions = []; var completions = [];
engineList.forEach (function(name) engineList.forEach (function (name)
{ {
var query = filter; var query = filter;
var queryURI; var queryURI;
@@ -211,7 +211,7 @@ liberator.Completion = function () //{{{
if (!results) if (!results)
return; return;
results.forEach(function(item) results.forEach(function (item)
{ {
completions.push([(matches ? matches[1] : "") + item, name + " suggestion"]); completions.push([(matches ? matches[1] : "") + item, name + " suggestion"]);
}); });
@@ -407,7 +407,7 @@ liberator.Completion = function () //{{{
{ {
var prefs = Components.classes["@mozilla.org/preferences-service;1"] var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(Components.interfaces.nsIPrefBranch);
var prefArray = prefs.getChildList("", {value: 0}); var prefArray = prefs.getChildList("", { value: 0 });
prefArray.sort(); prefArray.sort();
if (filter.length > 0 && filter.lastIndexOf("=") == filter.length - 1) if (filter.length > 0 && filter.lastIndexOf("=") == filter.length - 1)

View File

@@ -408,7 +408,7 @@ liberator.Editor = function () //{{{
if (pos >= 0) if (pos >= 0)
liberator.editor.moveToPosition(pos, true, liberator.mode == liberator.modes.VISUAL); liberator.editor.moveToPosition(pos, true, liberator.mode == liberator.modes.VISUAL);
}, },
{ flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT}); { flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT });
liberator.mappings.add([liberator.modes.TEXTAREA, liberator.modes.VISUAL], liberator.mappings.add([liberator.modes.TEXTAREA, liberator.modes.VISUAL],
["F"], "Move to a charater on the current line before the cursor", ["F"], "Move to a charater on the current line before the cursor",
@@ -418,7 +418,7 @@ liberator.Editor = function () //{{{
if (pos >= 0) if (pos >= 0)
liberator.editor.moveToPosition(pos, false, liberator.mode == liberator.modes.VISUAL); liberator.editor.moveToPosition(pos, false, liberator.mode == liberator.modes.VISUAL);
}, },
{ flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT}); { flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT });
liberator.mappings.add([liberator.modes.TEXTAREA, liberator.modes.VISUAL], liberator.mappings.add([liberator.modes.TEXTAREA, liberator.modes.VISUAL],
["t"], "Move before a character on the current line", ["t"], "Move before a character on the current line",
@@ -428,7 +428,7 @@ liberator.Editor = function () //{{{
if (pos >= 0) if (pos >= 0)
liberator.editor.moveToPosition(pos - 1, true, liberator.mode == liberator.modes.VISUAL); liberator.editor.moveToPosition(pos - 1, true, liberator.mode == liberator.modes.VISUAL);
}, },
{ flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT}); { flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT });
liberator.mappings.add([liberator.modes.TEXTAREA, liberator.modes.VISUAL], liberator.mappings.add([liberator.modes.TEXTAREA, liberator.modes.VISUAL],
["T"], "Move before a character on the current line, backwards", ["T"], "Move before a character on the current line, backwards",
@@ -438,7 +438,7 @@ liberator.Editor = function () //{{{
if (pos >= 0) if (pos >= 0)
liberator.editor.moveToPosition(pos + 1, false, liberator.mode == liberator.modes.VISUAL); liberator.editor.moveToPosition(pos + 1, false, liberator.mode == liberator.modes.VISUAL);
}, },
{ flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT}); { flags: liberator.Mappings.flags.ARGUMENT | liberator.Mappings.flags.COUNT });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////
@@ -801,7 +801,7 @@ liberator.Editor = function () //{{{
editor.selection.addRange(wholeDocRange); editor.selection.addRange(wholeDocRange);
editor.selection.deleteFromDocument(); editor.selection.deleteFromDocument();
editor.insertText(val); editor.insertText(val);
//setTimeout(function() { //setTimeout(function () {
// document.getElementById("content-frame").contentDocument.designMode = "off"; // document.getElementById("content-frame").contentDocument.designMode = "off";
//}, 100); //}, 100);
} }

View File

@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL. the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/ }}} ***** END LICENSE BLOCK *****/
liberator.AutoCommands = function() //{{{ liberator.AutoCommands = function () //{{{
{ {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION ///////////////////////////////////////// ////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -503,7 +503,7 @@ liberator.Events = function () //{{{
// load all macros inside ~/.vimperator/macros/ // load all macros inside ~/.vimperator/macros/
// setTimeout needed since liberator.io. is loaded after liberator.events. // setTimeout needed since liberator.io. is loaded after liberator.events.
setTimeout (function() { setTimeout (function () {
try try
{ {
var files = liberator.io.readDirectory(liberator.io.getSpecialDirectory("macros")); var files = liberator.io.readDirectory(liberator.io.getSpecialDirectory("macros"));
@@ -959,7 +959,7 @@ liberator.Events = function () //{{{
{ {
dump("Compose editor got focus\n"); dump("Compose editor got focus\n");
liberator.modes.set(liberator.modes.INSERT, liberator.modes.TEXTAREA); liberator.modes.set(liberator.modes.INSERT, liberator.modes.TEXTAREA);
//setTimeout(function(){liberator.editor.editWithExternalEditor();}, 100); //setTimeout(function (){ liberator.editor.editWithExternalEditor(); }, 100);
win.blur(); win.blur();
//liberator.editor.editWithExternalEditor(); //liberator.editor.editWithExternalEditor();
} }

View File

@@ -129,7 +129,7 @@ liberator.Hints = function () //{{{
} }
doc.body.appendChild(fragment); doc.body.appendChild(fragment);
docs.push({ doc: doc, start: start, end: hints.length - 1}); docs.push({ doc: doc, start: start, end: hints.length - 1 });
// also generate hints for frames // also generate hints for frames
for (var i = 0; i < win.frames.length; i++) for (var i = 0; i < win.frames.length; i++)
@@ -338,8 +338,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);
} }

View File

@@ -45,7 +45,7 @@ const liberator = (function () //{{{
var guioptions = liberator.config.guioptions || {}; var guioptions = liberator.config.guioptions || {};
for (let option in guioptions) for (let option in guioptions)
{ {
guioptions[option].forEach( function(elem) guioptions[option].forEach(function (elem)
{ {
try try
{ {
@@ -385,7 +385,7 @@ const liberator = (function () //{{{
var guioptions = liberator.config.guioptions || {}; var guioptions = liberator.config.guioptions || {};
for (let option in guioptions) for (let option in guioptions)
{ {
guioptions[option].forEach( function(elem) guioptions[option].forEach(function (elem)
{ {
try try
{ {
@@ -612,10 +612,10 @@ const liberator = (function () //{{{
has: function (feature) has: function (feature)
{ {
var features = liberator.config.features || []; var features = liberator.config.features || [];
return features.some (function(feat) { return feat == feature; }); return features.some (function (feat) { return feat == feature; });
}, },
help: function(topic) help: function (topic)
{ {
var where = (liberator.options.newtab && (liberator.options.newtab == "all" || liberator.options.newtab.split(",").indexOf("help") != -1)) ? var where = (liberator.options.newtab && (liberator.options.newtab == "all" || liberator.options.newtab.split(",").indexOf("help") != -1)) ?
liberator.NEW_TAB : liberator.CURRENT_TAB; liberator.NEW_TAB : liberator.CURRENT_TAB;
@@ -623,7 +623,7 @@ const liberator = (function () //{{{
function jumpToTag(file, tag) function jumpToTag(file, tag)
{ {
liberator.open("chrome://" + liberator.config.name.toLowerCase() + "/locale/" + file, where); liberator.open("chrome://" + liberator.config.name.toLowerCase() + "/locale/" + file, where);
setTimeout(function() { setTimeout(function () {
var elem = liberator.buffer.getElement('@class="tag" and text()="' + tag + '"'); var elem = liberator.buffer.getElement('@class="tag" and text()="' + tag + '"');
if (elem) if (elem)
window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context

View File

@@ -38,15 +38,15 @@ liberator.Mail = function () //{{{
var selectMessageReverse = false; var selectMessageReverse = false;
var folderListener = { var folderListener = {
OnItemAdded: function(parentItem, item) { }, OnItemAdded: function (parentItem, item) { },
OnItemRemoved: function(parentItem, item) { }, OnItemRemoved: function (parentItem, item) { },
OnItemPropertyChanged: function(item, property, oldValue, newValue) { }, OnItemPropertyChanged: function (item, property, oldValue, newValue) { },
OnItemIntPropertyChanged: function(item, property, oldValue, newValue) { }, OnItemIntPropertyChanged: function (item, property, oldValue, newValue) { },
OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) { }, OnItemBoolPropertyChanged: function (item, property, oldValue, newValue) { },
OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue) { }, OnItemUnicharPropertyChanged: function (item, property, oldValue, newValue) { },
OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) { }, OnItemPropertyFlagChanged: function (item, property, oldFlag, newFlag) { },
OnItemEvent: function(folder, event) OnItemEvent: function (folder, event)
{ {
var eventType = event.toString(); var eventType = event.toString();
if (eventType == "FolderLoaded") if (eventType == "FolderLoaded")
@@ -119,12 +119,12 @@ liberator.Mail = function () //{{{
if (copy) if (copy)
{ {
MsgCopyMessage(folders[0].URI); MsgCopyMessage(folders[0].URI);
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].URI); MsgMoveMessage(folders[0].URI);
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;
} }
@@ -296,7 +296,7 @@ liberator.Mail = function () //{{{
try try
{ {
var author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase(); var author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
liberator.mail.selectMessage(function(msg) { return msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0; }, true, true, false, count); liberator.mail.selectMessage(function (msg) { return msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0; }, true, true, false, count);
} }
catch (e) { liberator.beep(); } catch (e) { liberator.beep(); }
}, },
@@ -309,7 +309,7 @@ liberator.Mail = function () //{{{
try try
{ {
var author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase(); var author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
liberator.mail.selectMessage(function(msg) { return msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0; }, true, true, true, count); liberator.mail.selectMessage(function (msg) { return msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0; }, true, true, true, count);
} }
catch (e) { liberator.beep(); } catch (e) { liberator.beep(); }
}, },
@@ -415,22 +415,22 @@ liberator.Mail = function () //{{{
liberator.mappings.add(modes, ["]s"], liberator.mappings.add(modes, ["]s"],
"Select next starred message", "Select next starred message",
function (count) { liberator.mail.selectMessage(function(msg) { return msg.isFlagged; }, true, true, false, count); }, function (count) { liberator.mail.selectMessage(function (msg) { return msg.isFlagged; }, true, true, false, count); },
{ flags: liberator.Mappings.flags.COUNT }); { flags: liberator.Mappings.flags.COUNT });
liberator.mappings.add(modes, ["[s"], liberator.mappings.add(modes, ["[s"],
"Select previous starred message", "Select previous starred message",
function (count) { liberator.mail.selectMessage(function(msg) { return msg.isFlagged; }, true, true, true, count); }, function (count) { liberator.mail.selectMessage(function (msg) { return msg.isFlagged; }, true, true, true, count); },
{ flags: liberator.Mappings.flags.COUNT }); { flags: liberator.Mappings.flags.COUNT });
liberator.mappings.add(modes, ["]a"], liberator.mappings.add(modes, ["]a"],
"Select next message with an attachment", "Select next message with an attachment",
function (count) { liberator.mail.selectMessage(function(msg) { return gDBView.db.HasAttachments(msg.messageKey); }, true, true, false, count); }, function (count) { liberator.mail.selectMessage(function (msg) { return gDBView.db.HasAttachments(msg.messageKey); }, true, true, false, count); },
{ flags: liberator.Mappings.flags.COUNT }); { flags: liberator.Mappings.flags.COUNT });
liberator.mappings.add(modes, ["[a"], liberator.mappings.add(modes, ["[a"],
"Select previous message with an attachment", "Select previous message with an attachment",
function (count) { liberator.mail.selectMessage(function(msg) { return gDBView.db.HasAttachments(msg.messageKey); }, true, true, true, count); }, function (count) { liberator.mail.selectMessage(function (msg) { return gDBView.db.HasAttachments(msg.messageKey); }, true, true, true, count); },
{ flags: liberator.Mappings.flags.COUNT }); { flags: liberator.Mappings.flags.COUNT });
// FOLDER SWITCHING // FOLDER SWITCHING
@@ -587,7 +587,7 @@ liberator.Mail = function () //{{{
"Mark all messages as read", "Mark all messages as read",
function () function ()
{ {
liberator.mail.getFolders("", false).forEach(function(folder) { liberator.mail.getFolders("", false).forEach(function (folder) {
folder.markAllMessagesRead(); folder.markAllMessagesRead();
}); });
}); });
@@ -667,7 +667,7 @@ liberator.Mail = function () //{{{
QueryInterface(Components.interfaces.nsIMsgFolder); QueryInterface(Components.interfaces.nsIMsgFolder);
}, },
getFolders: function(filter, includeServers, includeMsgFolders) getFolders: function (filter, includeServers, includeMsgFolders)
{ {
var folders = []; var folders = [];
if (!filter) if (!filter)
@@ -695,15 +695,15 @@ liberator.Mail = function () //{{{
return folders; return folders;
}, },
getNewMessages: function(currentAccountOnly) getNewMessages: function (currentAccountOnly)
{ {
var accounts = currentAccountOnly ? [this.currentAccount] var accounts = currentAccountOnly ? [this.currentAccount]
: this.getFolders("", true, false); : this.getFolders("", true, false);
accounts.forEach( function(account) { account.getNewMessages(msgWindow, null); }); accounts.forEach(function (account) { account.getNewMessages(msgWindow, null); });
}, },
getStatistics: function(currentAccountOnly) getStatistics: function (currentAccountOnly)
{ {
var accounts = currentAccountOnly ? [this.currentAccount] var accounts = currentAccountOnly ? [this.currentAccount]
: this.getFolders("", true, false); : this.getFolders("", true, false);
@@ -720,7 +720,7 @@ liberator.Mail = function () //{{{
return { numUnread: unreadCount, numTotal: totalCount, numNew: newCount } return { numUnread: unreadCount, numTotal: totalCount, numNew: newCount }
}, },
collapseThread: function() collapseThread: function ()
{ {
var tree = GetThreadTree(); var tree = GetThreadTree();
if (tree) if (tree)
@@ -736,7 +736,7 @@ liberator.Mail = function () //{{{
return false; return false;
}, },
expandThread: function() expandThread: function ()
{ {
var tree = GetThreadTree(); var tree = GetThreadTree();
if (tree) if (tree)
@@ -755,7 +755,7 @@ liberator.Mail = function () //{{{
* @param openThreads: should we open closed threads? * @param openThreads: should we open closed threads?
* @param reverse: change direction of searching * @param reverse: change direction of searching
*/ */
selectMessage: function(validatorFunc, canWrap, openThreads, reverse, count) selectMessage: function (validatorFunc, canWrap, openThreads, reverse, count)
{ {
function closedThread(index) function closedThread(index)
{ {

View File

@@ -38,7 +38,7 @@ liberator.Map = function (modes, cmds, description, action, extraInfo) //{{{
this.modes = modes; this.modes = modes;
// only store keysyms with uppercase modifier strings // only store keysyms with uppercase modifier strings
this.names = cmds.map(function (cmd) { return cmd.replace(/[casm]-/g, function (name) { return name.toUpperCase(); });}); this.names = cmds.map(function (cmd) { return cmd.replace(/[casm]-/g, function (name) { return name.toUpperCase(); }); });
this.action = action; this.action = action;
this.flags = extraInfo.flags || 0; this.flags = extraInfo.flags || 0;

View File

@@ -46,48 +46,48 @@ liberator.config = {
dialogs: [ dialogs: [
["about", "About Thunderbird", //XXX: Shredder ? ["about", "About Thunderbird", //XXX: Shredder ?
function() { openAboutDialog(); }], function () { openAboutDialog(); }],
["addons", "Manage Add-ons", ["addons", "Manage Add-ons",
function() { openAddonsMgr(); }], function () { openAddonsMgr(); }],
["checkupdates", "Check for updates", ["checkupdates", "Check for updates",
function() { checkForUpdates(); }], function () { checkForUpdates(); }],
/*["cleardata", "Clear private data", /*["cleardata", "Clear private data",
function() { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],*/ function () { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],*/
["console", "JavaScript console", ["console", "JavaScript console",
function() { toJavaScriptConsole(); }], function () { toJavaScriptConsole(); }],
/*["customizetoolbar", "Customize the Toolbar", /*["customizetoolbar", "Customize the Toolbar",
function() { BrowserCustomizeToolbar(); }],*/ function () { BrowserCustomizeToolbar(); }],*/
["dominspector", "DOM Inspector", ["dominspector", "DOM Inspector",
function() { inspectDOMDocument(content.document); }], function () { inspectDOMDocument(content.document); }],
["downloads", "Manage Downloads", ["downloads", "Manage Downloads",
function() { toOpenWindowByType('Download:Manager', 'chrome://mozapps/content/downloads/downloads.xul', 'chrome,dialog=no,resizable'); }], function () { toOpenWindowByType('Download:Manager', 'chrome://mozapps/content/downloads/downloads.xul', 'chrome,dialog=no,resizable'); }],
/*["import", "Import Preferences, Bookmarks, History, etc. from other browsers", /*["import", "Import Preferences, Bookmarks, History, etc. from other browsers",
function() { BrowserImport(); }], function () { BrowserImport(); }],
["openfile", "Open the file selector dialog", ["openfile", "Open the file selector dialog",
function() { BrowserOpenFileWindow(); }], function () { BrowserOpenFileWindow(); }],
["pageinfo", "Show information about the current page", ["pageinfo", "Show information about the current page",
function() { BrowserPageInfo(); }], function () { BrowserPageInfo(); }],
["pagesource", "View page source", ["pagesource", "View page source",
function() { BrowserViewSourceOfDocument(content.document); }], function () { BrowserViewSourceOfDocument(content.document); }],
["preferences", "Show Firefox preferences dialog", ["preferences", "Show Firefox preferences dialog",
function() { openPreferences(); }], function () { openPreferences(); }],
["printpreview", "Preview the page before printing", ["printpreview", "Preview the page before printing",
function() { PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); }],*/ function () { PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); }],*/
["printsetup", "Setup the page size and orientation before printing", ["printsetup", "Setup the page size and orientation before printing",
function() { PrintUtils.showPageSetup(); }], function () { PrintUtils.showPageSetup(); }],
["print", "Show print dialog", ["print", "Show print dialog",
function() { PrintUtils.print(); }], function () { PrintUtils.print(); }],
["saveframe", "Save frame to disk", ["saveframe", "Save frame to disk",
function() { saveFrameDocument(); }], function () { saveFrameDocument(); }],
["savepage", "Save page to disk", ["savepage", "Save page to disk",
function() { saveDocument(window.content.document); }], function () { saveDocument(window.content.document); }],
/*["searchengines", "Manage installed search engines", /*["searchengines", "Manage installed search engines",
function() { openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], function () { openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
["selectionsource", "View selection source", ["selectionsource", "View selection source",
function() { liberator.buffer.viewSelectionSource(); }]*/ function () { liberator.buffer.viewSelectionSource(); }]*/
], ],
init: function() init: function ()
{ {
liberator.mappings.add([liberator.modes.NORMAL], liberator.mappings.add([liberator.modes.NORMAL],
["o"], "Open a message", ["o"], "Open a message",
@@ -112,20 +112,20 @@ liberator.config = {
if (this.isComposeWindow) if (this.isComposeWindow)
{ {
/*setTimeout(function() { /*setTimeout(function () {
document.getElementById("content-frame").contentDocument.designMode = "off"; document.getElementById("content-frame").contentDocument.designMode = "off";
document.getElementById("content-frame").focus(); document.getElementById("content-frame").focus();
}, 500);*/ }, 500);*/
//document.getElementById("content-frame").contentWindow.addEventListener("load", function() { //document.getElementById("content-frame").contentWindow.addEventListener("load", function () {
/*window.addEventListener("load", function() { /*window.addEventListener("load", function () {
alert("load"); alert("load");
if (! liberator.editor.editWithExternalEditor()) if (! liberator.editor.editWithExternalEditor())
liberator.echoerr("Editing with external editor failed. Be sure to :set editor correctly"); liberator.echoerr("Editing with external editor failed. Be sure to :set editor correctly");
}, true); }, true);
document.getElementById("content-frame").contentDocument.addEventListener("load", function() { document.getElementById("content-frame").contentDocument.addEventListener("load", function () {
alert("load1"); alert("load1");
}, true);*/ }, true);*/
/*document.getElementById("content-frame").addEventListener("DOMContentLoaded", function() { /*document.getElementById("content-frame").addEventListener("DOMContentLoaded", function () {
alert("load2"); alert("load2");
}, true);*/ }, true);*/
} }

View File

@@ -684,7 +684,7 @@ liberator.Options = function () //{{{
if (!filter) if (!filter)
filter = ""; filter = "";
var prefArray = prefService.getChildList("", {value: 0}); var prefArray = prefService.getChildList("", { value: 0 });
prefArray.sort(); prefArray.sort();
var list = ":" + liberator.util.escapeHTML(liberator.commandline.getCommand()) + "<br/>" + var list = ":" + liberator.util.escapeHTML(liberator.commandline.getCommand()) + "<br/>" +
"<table><tr align=\"left\" class=\"hl-Title\"><th>--- " + liberator.config.hostApplication + "<table><tr align=\"left\" class=\"hl-Title\"><th>--- " + liberator.config.hostApplication +

View File

@@ -92,7 +92,7 @@ liberator.Tabs = function () //{{{
"Define which commands should output in a new tab by default", "Define which commands should output in a new tab by default",
"stringlist", "", "stringlist", "",
{ {
validator: function(value) validator: function (value)
{ {
return value == "all" || value.split(",").every(function (item) { return /^(addons|downloads|help|javascript|prefs|)$/.test(item); }); return value == "all" || value.split(",").every(function (item) { return /^(addons|downloads|help|javascript|prefs|)$/.test(item); });
} }
@@ -639,7 +639,7 @@ liberator.Tabs = function () //{{{
// "buffer" is a string which matches the URL or title of a buffer, if it // "buffer" is a string which matches the URL or title of a buffer, if it
// is null, the last used string is used again // is null, the last used string is used again
switchTo: function(buffer, allowNonUnique, count, reverse) switchTo: function (buffer, allowNonUnique, count, reverse)
{ {
if (buffer == "") if (buffer == "")
{ {

View File

@@ -247,7 +247,7 @@ liberator.util = { //{{{
}, },
// same as Firefox's readFromClipboard function, but needed for apps like Thunderbird // same as Firefox's readFromClipboard function, but needed for apps like Thunderbird
readFromClipboard: function() readFromClipboard: function ()
{ {
var url; var url;
try try

View File

@@ -37,56 +37,56 @@ liberator.config = { //{{{
dialogs: [ dialogs: [
["about", "About Firefox", ["about", "About Firefox",
function() { openDialog("chrome://browser/content/aboutDialog.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], function () { openDialog("chrome://browser/content/aboutDialog.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
["addbookmark", "Add bookmark for the current page", ["addbookmark", "Add bookmark for the current page",
function() { PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksRootId); }], function () { PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksRootId); }],
["addons", "Manage Add-ons", ["addons", "Manage Add-ons",
function() { BrowserOpenAddonsMgr(); }], function () { BrowserOpenAddonsMgr(); }],
["bookmarks", "List your bookmarks", ["bookmarks", "List your bookmarks",
function() { openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }], function () { openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }],
["checkupdates", "Check for updates", ["checkupdates", "Check for updates",
function() { checkForUpdates(); }], function () { checkForUpdates(); }],
["cleardata", "Clear private data", ["cleardata", "Clear private data",
function() { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }], function () { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],
["console", "JavaScript console", ["console", "JavaScript console",
function() { toJavaScriptConsole(); }], function () { toJavaScriptConsole(); }],
["customizetoolbar", "Customize the Toolbar", ["customizetoolbar", "Customize the Toolbar",
function() { BrowserCustomizeToolbar(); }], function () { BrowserCustomizeToolbar(); }],
["dominspector", "DOM Inspector", ["dominspector", "DOM Inspector",
function() { inspectDOMDocument(content.document); }], function () { inspectDOMDocument(content.document); }],
["downloads", "Manage Downloads", ["downloads", "Manage Downloads",
function() { toOpenWindowByType('Download:Manager', 'chrome://mozapps/content/downloads/downloads.xul', 'chrome,dialog=no,resizable'); }], function () { toOpenWindowByType('Download:Manager', 'chrome://mozapps/content/downloads/downloads.xul', 'chrome,dialog=no,resizable'); }],
["history", "List your history", ["history", "List your history",
function() { openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }], function () { openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }],
["import", "Import Preferences, Bookmarks, History, etc. from other browsers", ["import", "Import Preferences, Bookmarks, History, etc. from other browsers",
function() { BrowserImport(); }], function () { BrowserImport(); }],
["openfile", "Open the file selector dialog", ["openfile", "Open the file selector dialog",
function() { BrowserOpenFileWindow(); }], function () { BrowserOpenFileWindow(); }],
["pageinfo", "Show information about the current page", ["pageinfo", "Show information about the current page",
function() { BrowserPageInfo(); }], function () { BrowserPageInfo(); }],
["pagesource", "View page source", ["pagesource", "View page source",
function() { BrowserViewSourceOfDocument(content.document); }], function () { BrowserViewSourceOfDocument(content.document); }],
["places", "Places Organizer: Manage your bookmarks and history", ["places", "Places Organizer: Manage your bookmarks and history",
function() { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }], function () { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }],
["preferences", "Show Firefox preferences dialog", ["preferences", "Show Firefox preferences dialog",
function() { openPreferences(); }], function () { openPreferences(); }],
["printpreview", "Preview the page before printing", ["printpreview", "Preview the page before printing",
function() { PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); }], function () { PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); }],
["printsetup", "Setup the page size and orientation before printing", ["printsetup", "Setup the page size and orientation before printing",
function() { PrintUtils.showPageSetup(); }], function () { PrintUtils.showPageSetup(); }],
["print", "Show print dialog", ["print", "Show print dialog",
function() { PrintUtils.print(); }], function () { PrintUtils.print(); }],
["saveframe", "Save frame to disk", ["saveframe", "Save frame to disk",
function() { saveFrameDocument(); }], function () { saveFrameDocument(); }],
["savepage", "Save page to disk", ["savepage", "Save page to disk",
function() { saveDocument(window.content.document); }], function () { saveDocument(window.content.document); }],
["searchengines", "Manage installed search engines", ["searchengines", "Manage installed search engines",
function() { openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], function () { openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
["selectionsource", "View selection source", ["selectionsource", "View selection source",
function() { liberator.buffer.viewSelectionSource(); }] function () { liberator.buffer.viewSelectionSource(); }]
], ],
init: function() init: function ()
{ {
function incrementURL(count) function incrementURL(count)
{ {
@@ -152,7 +152,7 @@ liberator.config = { //{{{
liberator.mappings.add([liberator.modes.NORMAL], ["gh"], liberator.mappings.add([liberator.modes.NORMAL], ["gh"],
"Open homepage", "Open homepage",
function() { BrowserHome(); }); function () { BrowserHome(); });
liberator.mappings.add([liberator.modes.NORMAL], ["gH"], liberator.mappings.add([liberator.modes.NORMAL], ["gH"],
"Open homepage in a new tab", "Open homepage in a new tab",