mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 22:17:59 +01:00
some trivial formatting fixes
This commit is contained in:
@@ -127,7 +127,8 @@ function Bookmarks() //{{{
|
|||||||
{
|
{
|
||||||
bmResource = bmResources.getNext();
|
bmResource = bmResources.getNext();
|
||||||
type = BookmarksUtils.resolveType(bmResource);
|
type = BookmarksUtils.resolveType(bmResource);
|
||||||
if (type != "ImmutableBookmark") {
|
if (type != "ImmutableBookmark")
|
||||||
|
{
|
||||||
ptype = BookmarksUtils.resolveType(BMSVC.getParent(bmResource));
|
ptype = BookmarksUtils.resolveType(BMSVC.getParent(bmResource));
|
||||||
// alert(type);
|
// alert(type);
|
||||||
// if ( type == "Folder") // store the current folder
|
// if ( type == "Folder") // store the current folder
|
||||||
@@ -172,7 +173,7 @@ function Bookmarks() //{{{
|
|||||||
var newalias = alias;
|
var newalias = alias;
|
||||||
for (var j = 1; j <= 10; j++) // <=10 is intentional
|
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;
|
break;
|
||||||
|
|
||||||
newalias = alias + j;
|
newalias = alias + j;
|
||||||
|
|||||||
@@ -556,8 +556,14 @@ function Commands() //{{{
|
|||||||
{
|
{
|
||||||
vimperator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
|
vimperator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
|
||||||
function(code) {
|
function(code) {
|
||||||
try { eval(matches[1] + "\n" + code); }
|
try
|
||||||
catch (e) { vimperator.echoerr(e.name + ": " + e.message); }
|
{
|
||||||
|
eval(matches[1] + "\n" + code);
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
vimperator.echoerr(e.name + ": " + e.message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else // single line javascript code
|
else // single line javascript code
|
||||||
@@ -654,11 +660,13 @@ function Commands() //{{{
|
|||||||
addDefaultCommand(new Command(["ma[rk]"],
|
addDefaultCommand(new Command(["ma[rk]"],
|
||||||
function(args)
|
function(args)
|
||||||
{
|
{
|
||||||
if (!args) {
|
if (!args)
|
||||||
|
{
|
||||||
vimperator.echoerr("E471: Argument required");
|
vimperator.echoerr("E471: Argument required");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (args.length > 1) {
|
if (args.length > 1)
|
||||||
|
{
|
||||||
vimperator.echoerr("E488: Trailing characters");
|
vimperator.echoerr("E488: Trailing characters");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -823,7 +831,8 @@ function Commands() //{{{
|
|||||||
addDefaultCommand(new Command(["qma[rk]"],
|
addDefaultCommand(new Command(["qma[rk]"],
|
||||||
function(args)
|
function(args)
|
||||||
{
|
{
|
||||||
if (!args) {
|
if (!args)
|
||||||
|
{
|
||||||
vimperator.echoerr("E471: Argument required");
|
vimperator.echoerr("E471: Argument required");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ vimperator.completion = (function() // {{{
|
|||||||
//var filter_length = filter.length;
|
//var filter_length = filter.length;
|
||||||
//filter = filter.toLowerCase();
|
//filter = filter.toLowerCase();
|
||||||
var ignorecase = false;
|
var ignorecase = false;
|
||||||
if(filter == filter.toLowerCase())
|
if (filter == filter.toLowerCase())
|
||||||
ignorecase = true;
|
ignorecase = true;
|
||||||
|
|
||||||
for (var i = 0; i < list.length; i++)
|
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++)
|
for (var j = 0; j < list[i][0].length; j++)
|
||||||
{
|
{
|
||||||
var item = list[i][0][j];
|
var item = list[i][0][j];
|
||||||
if(ignorecase)
|
if (ignorecase)
|
||||||
item = item.toLowerCase();
|
item = item.toLowerCase();
|
||||||
|
|
||||||
if (item.indexOf(filter) == -1)
|
if (item.indexOf(filter) == -1)
|
||||||
@@ -122,7 +122,7 @@ vimperator.completion = (function() // {{{
|
|||||||
|
|
||||||
//var filter_length = filter.length;
|
//var filter_length = filter.length;
|
||||||
var ignorecase = false;
|
var ignorecase = false;
|
||||||
if(filter == filter.toLowerCase())
|
if (filter == filter.toLowerCase())
|
||||||
ignorecase = true;
|
ignorecase = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -134,7 +134,7 @@ vimperator.completion = (function() // {{{
|
|||||||
{
|
{
|
||||||
var url = urls[i][0] || "";
|
var url = urls[i][0] || "";
|
||||||
var title = urls[i][1] || "";
|
var title = urls[i][1] || "";
|
||||||
if(ignorecase)
|
if (ignorecase)
|
||||||
{
|
{
|
||||||
url = url.toLowerCase();
|
url = url.toLowerCase();
|
||||||
title = title.toLowerCase();
|
title = title.toLowerCase();
|
||||||
@@ -257,9 +257,12 @@ vimperator.completion = (function() // {{{
|
|||||||
return [];
|
return [];
|
||||||
|
|
||||||
var compl = match[2] || '';
|
var compl = match[2] || '';
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var fd = vimperator.fopen(dir, "<");
|
var fd = vimperator.fopen(dir, "<");
|
||||||
} catch(e) {
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
// thrown if file does not exist
|
// thrown if file does not exist
|
||||||
return [ ];
|
return [ ];
|
||||||
}
|
}
|
||||||
@@ -369,7 +372,7 @@ vimperator.completion = (function() // {{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if filter ends with =, then complete current value
|
// 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);
|
filter = filter.substr(0, filter.length-1);
|
||||||
for (var option in vimperator.options)
|
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
|
// if there is no space between the command name and the cursor
|
||||||
// then get completions of the command name
|
// then get completions of the command name
|
||||||
var matches = str.match(/^(:*\d*)\w*$/);
|
var matches = str.match(/^(:*\d*)\w*$/);
|
||||||
if(matches)
|
if (matches)
|
||||||
{
|
{
|
||||||
completions = this.get_command_completions(cmd);
|
completions = this.get_command_completions(cmd);
|
||||||
start = matches[1].length;
|
start = matches[1].length;
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ function Events() //{{{
|
|||||||
evt.initKeyEvent('keypress', true, true, view, ctrl, alt, shift, meta, keyCode, charCode );
|
evt.initKeyEvent('keypress', true, true, view, ctrl, alt, shift, meta, keyCode, charCode );
|
||||||
|
|
||||||
var elem = window.document.commandDispatcher.focusedElement;
|
var elem = window.document.commandDispatcher.focusedElement;
|
||||||
if(!elem)
|
if (!elem)
|
||||||
elem = window;
|
elem = window;
|
||||||
|
|
||||||
elem.dispatchEvent(evt);
|
elem.dispatchEvent(evt);
|
||||||
@@ -278,7 +278,7 @@ function Events() //{{{
|
|||||||
// null if unknown key
|
// null if unknown key
|
||||||
this.toString = function(event) //{{{
|
this.toString = function(event) //{{{
|
||||||
{
|
{
|
||||||
if(!event)
|
if (!event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var key = null;
|
var key = null;
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ function fo_read(max)
|
|||||||
{
|
{
|
||||||
var entries = this.localFile.directoryEntries;
|
var entries = this.localFile.directoryEntries;
|
||||||
var array = [];
|
var array = [];
|
||||||
while(entries.hasMoreElements())
|
while (entries.hasMoreElements())
|
||||||
{
|
{
|
||||||
var entry = entries.getNext();
|
var entry = entries.getNext();
|
||||||
entry.QueryInterface(Components.interfaces.nsIFile);
|
entry.QueryInterface(Components.interfaces.nsIFile);
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ function clearHighlight()
|
|||||||
var docfrag = doc.createDocumentFragment();
|
var docfrag = doc.createDocumentFragment();
|
||||||
var next = elem.nextSibling;
|
var next = elem.nextSibling;
|
||||||
var parent = elem.parentNode;
|
var parent = elem.parentNode;
|
||||||
while((child = elem.firstChild)) {
|
while ((child = elem.firstChild)) {
|
||||||
docfrag.appendChild(child);
|
docfrag.appendChild(child);
|
||||||
}
|
}
|
||||||
parent.removeChild(elem);
|
parent.removeChild(elem);
|
||||||
|
|||||||
@@ -652,7 +652,10 @@ function InformationList(id, options) //{{{
|
|||||||
|
|
||||||
// remove all old items first
|
// remove all old items first
|
||||||
var items = widget.getElementsByTagName("listitem");
|
var items = widget.getElementsByTagName("listitem");
|
||||||
while (items.length > 0) { widget.removeChild(items[0]);}
|
while (items.length > 0)
|
||||||
|
{
|
||||||
|
widget.removeChild(items[0]);
|
||||||
|
}
|
||||||
|
|
||||||
if (!incremental_fill)
|
if (!incremental_fill)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -326,9 +326,14 @@ const vimperator = (function() //{{{
|
|||||||
for (var i in object)
|
for (var i in object)
|
||||||
{
|
{
|
||||||
var value;
|
var value;
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var value = object[i];
|
var value = object[i];
|
||||||
} catch (e) { value = '' }
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
|
|
||||||
string += i + ': ' + value + '\n';
|
string += i + ': ' + value + '\n';
|
||||||
}
|
}
|
||||||
@@ -594,7 +599,7 @@ const vimperator = (function() //{{{
|
|||||||
vimperator.source(file.path, false);
|
vimperator.source(file.path, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e)
|
catch (e)
|
||||||
{
|
{
|
||||||
// thrown if directory does not exist
|
// thrown if directory does not exist
|
||||||
//vimperator.log("Error sourcing plugin directory: " + e);
|
//vimperator.log("Error sourcing plugin directory: " + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user