1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 08:27:59 +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();

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

@@ -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();
}, },