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

some trivial formatting fixes

This commit is contained in:
Doug Kearns
2007-08-14 15:24:49 +00:00
parent 96b3fe093a
commit 9f79ec4d71
9 changed files with 47 additions and 26 deletions

View File

@@ -127,7 +127,8 @@ function Bookmarks() //{{{
{
bmResource = bmResources.getNext();
type = BookmarksUtils.resolveType(bmResource);
if (type != "ImmutableBookmark") {
if (type != "ImmutableBookmark")
{
ptype = BookmarksUtils.resolveType(BMSVC.getParent(bmResource));
// alert(type);
// if ( type == "Folder") // store the current folder
@@ -172,7 +173,7 @@ function Bookmarks() //{{{
var newalias = alias;
for (var j = 1; j <= 10; j++) // <=10 is intentional
{
if (!search_engines.some( function(item) { return (item[0] == newalias); } ))
if (!search_engines.some(function(item) { return (item[0] == newalias); }))
break;
newalias = alias + j;

View File

@@ -556,8 +556,14 @@ function Commands() //{{{
{
vimperator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
function(code) {
try { eval(matches[1] + "\n" + code); }
catch (e) { vimperator.echoerr(e.name + ": " + e.message); }
try
{
eval(matches[1] + "\n" + code);
}
catch (e)
{
vimperator.echoerr(e.name + ": " + e.message);
}
});
}
else // single line javascript code
@@ -654,11 +660,13 @@ function Commands() //{{{
addDefaultCommand(new Command(["ma[rk]"],
function(args)
{
if (!args) {
if (!args)
{
vimperator.echoerr("E471: Argument required");
return;
}
if (args.length > 1) {
if (args.length > 1)
{
vimperator.echoerr("E488: Trailing characters");
return;
}
@@ -823,7 +831,8 @@ function Commands() //{{{
addDefaultCommand(new Command(["qma[rk]"],
function(args)
{
if (!args) {
if (!args)
{
vimperator.echoerr("E471: Argument required");
return;
}

View File

@@ -39,7 +39,7 @@ vimperator.completion = (function() // {{{
//var filter_length = filter.length;
//filter = filter.toLowerCase();
var ignorecase = false;
if(filter == filter.toLowerCase())
if (filter == filter.toLowerCase())
ignorecase = true;
for (var i = 0; i < list.length; i++)
@@ -47,7 +47,7 @@ vimperator.completion = (function() // {{{
for (var j = 0; j < list[i][0].length; j++)
{
var item = list[i][0][j];
if(ignorecase)
if (ignorecase)
item = item.toLowerCase();
if (item.indexOf(filter) == -1)
@@ -122,7 +122,7 @@ vimperator.completion = (function() // {{{
//var filter_length = filter.length;
var ignorecase = false;
if(filter == filter.toLowerCase())
if (filter == filter.toLowerCase())
ignorecase = true;
/*
@@ -134,7 +134,7 @@ vimperator.completion = (function() // {{{
{
var url = urls[i][0] || "";
var title = urls[i][1] || "";
if(ignorecase)
if (ignorecase)
{
url = url.toLowerCase();
title = title.toLowerCase();
@@ -257,9 +257,12 @@ vimperator.completion = (function() // {{{
return [];
var compl = match[2] || '';
try {
try
{
var fd = vimperator.fopen(dir, "<");
} catch(e) {
}
catch(e)
{
// thrown if file does not exist
return [ ];
}
@@ -369,7 +372,7 @@ vimperator.completion = (function() // {{{
}
// check if filter ends with =, then complete current value
else if(filter.length > 0 && filter.lastIndexOf("=") == filter.length -1)
else if (filter.length > 0 && filter.lastIndexOf("=") == filter.length -1)
{
filter = filter.substr(0, filter.length-1);
for (var option in vimperator.options)
@@ -459,7 +462,7 @@ vimperator.completion = (function() // {{{
// if there is no space between the command name and the cursor
// then get completions of the command name
var matches = str.match(/^(:*\d*)\w*$/);
if(matches)
if (matches)
{
completions = this.get_command_completions(cmd);
start = matches[1].length;

View File

@@ -265,7 +265,7 @@ function Events() //{{{
evt.initKeyEvent('keypress', true, true, view, ctrl, alt, shift, meta, keyCode, charCode );
var elem = window.document.commandDispatcher.focusedElement;
if(!elem)
if (!elem)
elem = window;
elem.dispatchEvent(evt);
@@ -278,7 +278,7 @@ function Events() //{{{
// null if unknown key
this.toString = function(event) //{{{
{
if(!event)
if (!event)
return;
var key = null;

View File

@@ -132,7 +132,7 @@ function fo_read(max)
{
var entries = this.localFile.directoryEntries;
var array = [];
while(entries.hasMoreElements())
while (entries.hasMoreElements())
{
var entry = entries.getNext();
entry.QueryInterface(Components.interfaces.nsIFile);

View File

@@ -196,7 +196,7 @@ function clearHighlight()
var docfrag = doc.createDocumentFragment();
var next = elem.nextSibling;
var parent = elem.parentNode;
while((child = elem.firstChild)) {
while ((child = elem.firstChild)) {
docfrag.appendChild(child);
}
parent.removeChild(elem);

View File

@@ -652,7 +652,10 @@ function InformationList(id, options) //{{{
// remove all old items first
var items = widget.getElementsByTagName("listitem");
while (items.length > 0) { widget.removeChild(items[0]);}
while (items.length > 0)
{
widget.removeChild(items[0]);
}
if (!incremental_fill)
{

View File

@@ -326,9 +326,14 @@ const vimperator = (function() //{{{
for (var i in object)
{
var value;
try {
try
{
var value = object[i];
} catch (e) { value = '' }
}
catch (e)
{
value = '';
}
string += i + ': ' + value + '\n';
}
@@ -594,7 +599,7 @@ const vimperator = (function() //{{{
vimperator.source(file.path, false);
});
}
catch(e)
catch (e)
{
// thrown if directory does not exist
//vimperator.log("Error sourcing plugin directory: " + e);