1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 06:57: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);
}
catch(e)
catch (e)
{
return val
}
}
return [
function() getBrowser().webNavigation,
function(webNav) webNav.sessionHistory.QueryInterface(Ci.nsIWebNavigation)
function () getBrowser().webNavigation,
function (webNav) webNav.sessionHistory.QueryInterface(Ci.nsIWebNavigation)
].reduce(call, null);
}
@@ -161,8 +161,8 @@ function Buffer() //{{{
"string", "UTF-8",
{
scope: options.OPTION_SCOPE_LOCAL,
getter: function() getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset,
setter: function(val)
getter: function () getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset,
setter: function (val)
{
// Stolen from browser.jar/content/browser/browser.js, more or
// less.
@@ -174,7 +174,7 @@ function Buffer() //{{{
}
catch (e) { liberator.reportError(e) }
},
completer: function(context) completion.charset(context)
completer: function (context) completion.charset(context)
});
// FIXME: Most certainly belongs elsewhere.
@@ -256,7 +256,7 @@ function Buffer() //{{{
"Stop loading",
function ()
{
if(config.stop)
if (config.stop)
config.stop();
else
window.BrowserStop();
@@ -1076,7 +1076,7 @@ function Buffer() //{{{
}
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);
@@ -1195,7 +1195,7 @@ function Buffer() //{{{
}
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);

View File

@@ -1454,15 +1454,16 @@ function Completion() //{{{
});
},
charset: function(context) {
charset: function (context)
{
context.anchored = false;
context.generate = function() {
context.generate = function () {
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(', ')))
.flatten().uniq();
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 ()
{
this.spans.forEach(function (span)
this.spans.forEach(function (span)
{
if (span.parentNode)
{
@@ -250,7 +250,7 @@ function Search() //{{{
})
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
// <select> Use the text of the selected item or label or name
text = "";
let type = elem.type ? elem.type.toLowerCase() : "";
let type = elem.type ? elem.type.toLowerCase() : "";
if (tagname == "input" && (type == "submit" || type == "button" || type == "reset"))
return [elem.value, false]
return [elem.value, false]
else
{
for each (let option in options["hintinputs"].split(","))
@@ -645,12 +645,12 @@ function Hints() //{{{
{
let hintStrings = tokenize(/\s+/, hintString);
let wordSplitRegex = RegExp(options["wordseparators"]);
/**
* Match a set of characters to the start of words.
*
* 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
* --Daniel
*
@@ -716,7 +716,7 @@ function Hints() //{{{
*
* @param {Array(String)} strings The strings to search for.
* @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.
*
* @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 css = classes.length ? classes.join(",") + "{ display: none; }" : "";
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();
}
}

View File

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

View File

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

View File

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