1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 02:08:00 +01:00

Source formatting fixes *yawn*.

This commit is contained in:
Doug Kearns
2009-04-30 22:09:08 +10:00
parent c65f88f8a2
commit 6b9564635a
8 changed files with 31 additions and 26 deletions

View File

@@ -145,14 +145,14 @@ function Buffer() //{{{
{ {
return fn(val); return fn(val);
} }
catch(e) catch (e)
{ {
return val return val
} }
} }
return [ return [
function() getBrowser().webNavigation, function () getBrowser().webNavigation,
function(webNav) webNav.sessionHistory.QueryInterface(Ci.nsIWebNavigation) function (webNav) webNav.sessionHistory.QueryInterface(Ci.nsIWebNavigation)
].reduce(call, null); ].reduce(call, null);
} }
@@ -161,8 +161,8 @@ function Buffer() //{{{
"string", "UTF-8", "string", "UTF-8",
{ {
scope: options.OPTION_SCOPE_LOCAL, scope: options.OPTION_SCOPE_LOCAL,
getter: function() getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset, getter: function () getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset,
setter: function(val) setter: function (val)
{ {
// Stolen from browser.jar/content/browser/browser.js, more or // Stolen from browser.jar/content/browser/browser.js, more or
// less. // less.
@@ -174,7 +174,7 @@ function Buffer() //{{{
} }
catch (e) { liberator.reportError(e) } catch (e) { liberator.reportError(e) }
}, },
completer: function(context) completion.charset(context) completer: function (context) completion.charset(context)
}); });
// FIXME: Most certainly belongs elsewhere. // FIXME: Most certainly belongs elsewhere.
@@ -256,7 +256,7 @@ function Buffer() //{{{
"Stop loading", "Stop loading",
function () function ()
{ {
if(config.stop) if (config.stop)
config.stop(); config.stop();
else else
window.BrowserStop(); window.BrowserStop();
@@ -1076,7 +1076,7 @@ function Buffer() //{{{
} }
else if (elemTagName == "input" && elem.getAttribute('type').toLowerCase() == "file") else if (elemTagName == "input" && elem.getAttribute('type').toLowerCase() == "file")
{ {
commandline.input("Upload file: ", function (path) commandline.input("Upload file: ", function (path)
{ {
let file = io.getFile(path); let file = io.getFile(path);
@@ -1195,7 +1195,7 @@ function Buffer() //{{{
} }
else if (localName == "input" && elem.getAttribute('type').toLowerCase() == "file") else if (localName == "input" && elem.getAttribute('type').toLowerCase() == "file")
{ {
commandline.input("Upload file: ", function (path) commandline.input("Upload file: ", function (path)
{ {
let file = io.getFile(path); let file = io.getFile(path);

View File

@@ -1454,15 +1454,16 @@ function Completion() //{{{
}); });
}, },
charset: function(context) { charset: function (context)
{
context.anchored = false; context.anchored = false;
context.generate = function() { context.generate = function () {
let names = util.Array( let names = util.Array(
'more1 more2 more3 more4 more5 unicode'.split(' ').map(function(key) 'more1 more2 more3 more4 more5 unicode'.split(' ').map(function (key)
options.getPref('intl.charsetmenu.browser.' + key).split(', '))) options.getPref('intl.charsetmenu.browser.' + key).split(', ')))
.flatten().uniq(); .flatten().uniq();
let bundle = document.getElementById('liberator-charset-bundle'); let bundle = document.getElementById('liberator-charset-bundle');
return names.map(function(name) [name, bundle.getString(name.toLowerCase() + '.title')]); return names.map(function (name) [name, bundle.getString(name.toLowerCase() + '.title')]);
}; };
}, },

View File

@@ -234,7 +234,7 @@ function Search() //{{{
*/ */
clear: function () clear: function ()
{ {
this.spans.forEach(function (span) this.spans.forEach(function (span)
{ {
if (span.parentNode) if (span.parentNode)
{ {
@@ -250,7 +250,7 @@ function Search() //{{{
}) })
this.spans = [] this.spans = []
}, },
getSpans: function (doc) this.spans getSpans: function (doc) this.spans
}; };
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -152,10 +152,10 @@ function Hints() //{{{
// <input type="hidden"> Never gets here // <input type="hidden"> Never gets here
// <select> Use the text of the selected item or label or name // <select> Use the text of the selected item or label or name
text = ""; text = "";
let type = elem.type ? elem.type.toLowerCase() : ""; let type = elem.type ? elem.type.toLowerCase() : "";
if (tagname == "input" && (type == "submit" || type == "button" || type == "reset")) if (tagname == "input" && (type == "submit" || type == "button" || type == "reset"))
return [elem.value, false] return [elem.value, false]
else else
{ {
for each (let option in options["hintinputs"].split(",")) for each (let option in options["hintinputs"].split(","))
@@ -645,12 +645,12 @@ function Hints() //{{{
{ {
let hintStrings = tokenize(/\s+/, hintString); let hintStrings = tokenize(/\s+/, hintString);
let wordSplitRegex = RegExp(options["wordseparators"]); let wordSplitRegex = RegExp(options["wordseparators"]);
/** /**
* Match a set of characters to the start of words. * Match a set of characters to the start of words.
* *
* What the **** does this do? --Kris * What the **** does this do? --Kris
* This function matches hintStrings like 'hekho' to links * This function matches hintStrings like 'hekho' to links
* like 'Hey Kris, how are you?' -> [HE]y [K]ris [HO]w are you * like 'Hey Kris, how are you?' -> [HE]y [K]ris [HO]w are you
* --Daniel * --Daniel
* *
@@ -716,7 +716,7 @@ function Hints() //{{{
* *
* @param {Array(String)} strings The strings to search for. * @param {Array(String)} strings The strings to search for.
* @param {Array(String)} words The words to search in. * @param {Array(String)} words The words to search in.
* @param {boolean} allowWordOverleaping Whether matches may be * @param {boolean} allowWordOverleaping Whether matches may be
* non-contiguous. * non-contiguous.
* *
* @return boolean Whether all the strings matched. * @return boolean Whether all the strings matched.

View File

@@ -140,7 +140,7 @@ const liberator = (function () //{{{
let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)]; let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)];
let css = classes.length ? classes.join(",") + "{ display: none; }" : ""; let css = classes.length ? classes.join(",") + "{ display: none; }" : "";
styles.addSheet(true, "taboptions", "chrome://*", css); styles.addSheet(true, "taboptions", "chrome://*", css);
tabs.tabsBound = Array.some(opts, function(k) k in self.opts); tabs.tabsBound = Array.some(opts, function (k) k in self.opts);
statusline.updateTabCount(); statusline.updateTabCount();
} }
} }

View File

@@ -410,7 +410,8 @@ const util = { //{{{
[XHTML, 'html'], [XHTML, 'html'],
[XUL, 'xul'], [XUL, 'xul'],
]); ]);
if (object instanceof Node && !(object instanceof Document)) { if (object instanceof Node && !(object instanceof Document))
{
let elem = object; let elem = object;
if (elem.nodeType == elem.TEXT_NODE) if (elem.nodeType == elem.TEXT_NODE)
return elem.data; return elem.data;
@@ -674,7 +675,7 @@ const util = { //{{{
util.Array = function Array(ary) { util.Array = function Array(ary) {
var obj = { var obj = {
__proto__: ary, __proto__: ary,
__iterator__: function() this.iteritems(), __iterator__: function () this.iteritems(),
__noSuchMethod__: function (meth, args) { __noSuchMethod__: function (meth, args) {
let res = util.Array(util.Array[meth].apply(null, [this.__proto__].concat(args))) let res = util.Array(util.Array[meth].apply(null, [this.__proto__].concat(args)))
if (res instanceof Array) if (res instanceof Array)

View File

@@ -102,7 +102,8 @@ const config = { //{{{
function () { buffer.viewSelectionSource(); }]*/ function () { buffer.viewSelectionSource(); }]*/
], ],
focusChange: function(win) { focusChange: function (win)
{
// we switch to -- MESSAGE -- mode for Muttator, when the main HTML widget gets focus // we switch to -- MESSAGE -- mode for Muttator, when the main HTML widget gets focus
if (win && win.document instanceof HTMLDocument || liberator.focus instanceof HTMLAnchorElement) if (win && win.document instanceof HTMLDocument || liberator.focus instanceof HTMLAnchorElement)
{ {

View File

@@ -141,7 +141,8 @@ const config = { //{{{
function () { SBSubscribe(); }] function () { SBSubscribe(); }]
], ],
focusChange: function() { focusChange: function ()
{
// Switch to -- PLAYER -- mode for Songbird Media Player. // Switch to -- PLAYER -- mode for Songbird Media Player.
if (config.isPlayerWindow) if (config.isPlayerWindow)
liberator.mode = modes.PLAYER; liberator.mode = modes.PLAYER;
@@ -173,7 +174,8 @@ const config = { //{{{
"library.js" "library.js"
], ],
stop: function() { stop: function ()
{
SBGetBrowser().mCurrentBrowser.stop(); SBGetBrowser().mCurrentBrowser.stop();
}, },