mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 17:27:57 +01:00
merge those pesky missing semicolons
This commit is contained in:
@@ -32,7 +32,7 @@ vimperator.Buffer = function() //{{{
|
|||||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
// used for the "B" mapping to remember the last :buffer[!] command
|
// used for the "B" mapping to remember the last :buffer[!] command
|
||||||
var lastBufferSwitchArgs = "";
|
var lastBufferSwitchArgs = "";
|
||||||
var lastBufferSwitchSpecial = true;
|
var lastBufferSwitchSpecial = true;
|
||||||
|
|
||||||
var zoom_manager = ZoomManager.prototype.getInstance();
|
var zoom_manager = ZoomManager.prototype.getInstance();
|
||||||
|
|||||||
@@ -113,10 +113,14 @@ vimperator.Command.prototype.hasName = function(name)
|
|||||||
for (var i = 0; i < this.specs.length; i++)
|
for (var i = 0; i < this.specs.length; i++)
|
||||||
{
|
{
|
||||||
if (this.specs[i] == name) // literal command name
|
if (this.specs[i] == name) // literal command name
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
else if (this.specs[i].match(/^(\w+|!)\[\w+\]$/)) // abbreviation spec
|
else if (this.specs[i].match(/^(\w+|!)\[\w+\]$/)) // abbreviation spec
|
||||||
|
{
|
||||||
if (matchAbbreviation(name, this.specs[i]))
|
if (matchAbbreviation(name, this.specs[i]))
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -413,7 +417,7 @@ vimperator.Commands = function() //{{{
|
|||||||
if (special && args)
|
if (special && args)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E474: Invalid argument");
|
vimperator.echoerr("E474: Invalid argument");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
var matches;
|
var matches;
|
||||||
if (matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/))
|
if (matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/))
|
||||||
@@ -467,7 +471,7 @@ vimperator.Commands = function() //{{{
|
|||||||
if (special && args)
|
if (special && args)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E474: Invalid argument");
|
vimperator.echoerr("E474: Invalid argument");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (special)
|
if (special)
|
||||||
@@ -788,7 +792,7 @@ vimperator.Commands = function() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/)
|
var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/);
|
||||||
var [lhs, rhs] = [matches[1], matches[2]];
|
var [lhs, rhs] = [matches[1], matches[2]];
|
||||||
var leader_reg = /<Leader>/i;
|
var leader_reg = /<Leader>/i;
|
||||||
|
|
||||||
@@ -874,7 +878,7 @@ vimperator.Commands = function() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var filter = args.replace(/[^a-zA-Z]/g, '');
|
var filter = args.replace(/[^a-zA-Z]/g, '');
|
||||||
vimperator.marks.list(filter)
|
vimperator.marks.list(filter);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
usage: ["marks [arg]"],
|
usage: ["marks [arg]"],
|
||||||
@@ -884,20 +888,20 @@ vimperator.Commands = function() //{{{
|
|||||||
));
|
));
|
||||||
addDefaultCommand(new vimperator.Command(["mkv[imperatorrc]"],
|
addDefaultCommand(new vimperator.Command(["mkv[imperatorrc]"],
|
||||||
function(args, special)
|
function(args, special)
|
||||||
{
|
{
|
||||||
var filename;
|
var filename;
|
||||||
|
|
||||||
// TODO: "E172: Only one file name allowed"
|
// TODO: "E172: Only one file name allowed"
|
||||||
if (args)
|
if (args)
|
||||||
filename = args;
|
filename = args;
|
||||||
else
|
else
|
||||||
filename = vimperator.io.expandPath(navigator.platform == "Win32" ? "~/_vimperatorrc" : "~/.vimperatorrc");
|
filename = vimperator.io.expandPath(navigator.platform == "Win32" ? "~/_vimperatorrc" : "~/.vimperatorrc");
|
||||||
|
|
||||||
var file = vimperator.io.getFile(filename);
|
var file = vimperator.io.getFile(filename);
|
||||||
if (file.exists() && !special)
|
if (file.exists() && !special)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E189: \".vimperatorrc\" exists (add ! to override)");
|
vimperator.echoerr("E189: \".vimperatorrc\" exists (add ! to override)");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var line = "\" " + vimperator.version + "\n";
|
var line = "\" " + vimperator.version + "\n";
|
||||||
@@ -910,7 +914,7 @@ vimperator.Commands = function() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (var option in vimperator.options)
|
for (var option in vimperator.options)
|
||||||
{
|
{
|
||||||
// TODO: options should be queried for this info
|
// TODO: options should be queried for this info
|
||||||
// TODO: string/list options might need escaping in future
|
// TODO: string/list options might need escaping in future
|
||||||
if (!/fullscreen|usermode/.test(option.name) && option.value != option.default_value)
|
if (!/fullscreen|usermode/.test(option.name) && option.value != option.default_value)
|
||||||
@@ -926,7 +930,7 @@ vimperator.Commands = function() //{{{
|
|||||||
|
|
||||||
vimperator.io.writeFile(file, line);
|
vimperator.io.writeFile(file, line);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
usage: ["mkv[imperatorrc] [file]"],
|
usage: ["mkv[imperatorrc] [file]"],
|
||||||
short_help: "Write current keymappings and changed options to [file]",
|
short_help: "Write current keymappings and changed options to [file]",
|
||||||
help: "If no <code class=\"argument\">[file]</code> is specified then ~/.vimperatorrc is written unless this file already exists. " +
|
help: "If no <code class=\"argument\">[file]</code> is specified then ~/.vimperatorrc is written unless this file already exists. " +
|
||||||
@@ -1207,7 +1211,7 @@ vimperator.Commands = function() //{{{
|
|||||||
var only_non_default = false; //used for :set to print non-default options
|
var only_non_default = false; //used for :set to print non-default options
|
||||||
if (!args)
|
if (!args)
|
||||||
{
|
{
|
||||||
args = "all?"
|
args = "all?";
|
||||||
only_non_default = true;
|
only_non_default = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1389,14 +1393,14 @@ vimperator.Commands = function() //{{{
|
|||||||
// do nothing if the requested sidebar is already open
|
// do nothing if the requested sidebar is already open
|
||||||
if (document.getElementById("sidebar-title").value == args)
|
if (document.getElementById("sidebar-title").value == args)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var menu = document.getElementById("viewSidebarMenu")
|
var menu = document.getElementById("viewSidebarMenu");
|
||||||
|
|
||||||
for (var i = 0; i < menu.childNodes.length; i++)
|
for (var i = 0; i < menu.childNodes.length; i++)
|
||||||
{
|
{
|
||||||
if (menu.childNodes[i].label == args)
|
if (menu.childNodes[i].label == args)
|
||||||
{
|
{
|
||||||
eval(menu.childNodes[i].getAttribute('oncommand'))
|
eval(menu.childNodes[i].getAttribute('oncommand'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1557,11 +1561,15 @@ vimperator.Commands = function() //{{{
|
|||||||
var before_time = Date.now();
|
var before_time = Date.now();
|
||||||
|
|
||||||
if (args && args[0] == ":")
|
if (args && args[0] == ":")
|
||||||
|
{
|
||||||
while (i--)
|
while (i--)
|
||||||
vimperator.execute(args);
|
vimperator.execute(args);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
while (i--)
|
while (i--)
|
||||||
eval(args);
|
eval(args);
|
||||||
|
}
|
||||||
|
|
||||||
if (special)
|
if (special)
|
||||||
return;
|
return;
|
||||||
@@ -1700,7 +1708,7 @@ vimperator.Commands = function() //{{{
|
|||||||
short_help: "Undo closing of all closed tabs",
|
short_help: "Undo closing of all closed tabs",
|
||||||
help: "Firefox stores up to 10 closed tabs, even after a browser restart."
|
help: "Firefox stores up to 10 closed tabs, even after a browser restart."
|
||||||
}
|
}
|
||||||
)),
|
));
|
||||||
addDefaultCommand(new vimperator.Command(["unl[et]"],
|
addDefaultCommand(new vimperator.Command(["unl[et]"],
|
||||||
function(args, special)
|
function(args, special)
|
||||||
{
|
{
|
||||||
@@ -1780,7 +1788,7 @@ vimperator.Commands = function() //{{{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
usage: ["winc[ose] [url] [, url]"],
|
usage: ["winc[ose] [url] [, url]"],
|
||||||
short_help: "Close window",
|
short_help: "Close window"
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"],
|
addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"],
|
||||||
@@ -1862,7 +1870,7 @@ vimperator.Commands = function() //{{{
|
|||||||
args = args.replace(/(^|[^\\])!/g, "$1" + last_run_command);
|
args = args.replace(/(^|[^\\])!/g, "$1" + last_run_command);
|
||||||
last_run_command = args;
|
last_run_command = args;
|
||||||
|
|
||||||
var output = vimperator.system(args)
|
var output = vimperator.system(args);
|
||||||
if (output)
|
if (output)
|
||||||
vimperator.echo(vimperator.util.escapeHTML(output));
|
vimperator.echo(vimperator.util.escapeHTML(output));
|
||||||
},
|
},
|
||||||
@@ -1910,7 +1918,7 @@ String.prototype.toURLArray = function() // {{{
|
|||||||
{
|
{
|
||||||
var location = window.content.document.location;
|
var location = window.content.document.location;
|
||||||
var tail = matches[1] ? matches[1] : "";
|
var tail = matches[1] ? matches[1] : "";
|
||||||
urls[url] = location.protocol + "//" + location.host + "/" + tail
|
urls[url] = location.protocol + "//" + location.host + "/" + tail;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1919,7 +1927,7 @@ String.prototype.toURLArray = function() // {{{
|
|||||||
// or keyword bookmark
|
// or keyword bookmark
|
||||||
if (/\s/.test(urls[url]) || !/[.:\/]/.test(urls[url]))
|
if (/\s/.test(urls[url]) || !/[.:\/]/.test(urls[url]))
|
||||||
{
|
{
|
||||||
matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/)
|
matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/);
|
||||||
|
|
||||||
var alias = matches[1];
|
var alias = matches[1];
|
||||||
var text = matches[2] ? matches[2] : null;
|
var text = matches[2] ? matches[2] : null;
|
||||||
|
|||||||
@@ -278,12 +278,7 @@ vimperator.Completion = function() // {{{
|
|||||||
[["options"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages'
|
[["options"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages'
|
||||||
g_substrings = [];
|
g_substrings = [];
|
||||||
for (var command in vimperator.commands)
|
for (var command in vimperator.commands)
|
||||||
{
|
help_array.push([command.long_names.map(function($_) { return ":" + $_; }), command.short_help]);
|
||||||
help_array.push([command.long_names.map(function($_) {
|
|
||||||
return ":" + $_;
|
|
||||||
}),
|
|
||||||
command.short_help])
|
|
||||||
}
|
|
||||||
options = this.get_options_completions(filter, true);
|
options = this.get_options_completions(filter, true);
|
||||||
help_array = help_array.concat(options.map(function($_) {
|
help_array = help_array.concat(options.map(function($_) {
|
||||||
return [
|
return [
|
||||||
@@ -292,7 +287,7 @@ vimperator.Completion = function() // {{{
|
|||||||
];
|
];
|
||||||
}));
|
}));
|
||||||
for (var map in vimperator.mappings)
|
for (var map in vimperator.mappings)
|
||||||
help_array.push([map.names, map.short_help])
|
help_array.push([map.names, map.short_help]);
|
||||||
|
|
||||||
if (!filter) return help_array.map(function($_) {
|
if (!filter) return help_array.map(function($_) {
|
||||||
return [$_[0][0], $_[1]]; // unfiltered, use the first command
|
return [$_[0][0], $_[1]]; // unfiltered, use the first command
|
||||||
@@ -304,7 +299,7 @@ vimperator.Completion = function() // {{{
|
|||||||
get_command_completions: function(filter) //{{{
|
get_command_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
g_substrings = [];
|
g_substrings = [];
|
||||||
var completions = []
|
var completions = [];
|
||||||
if (!filter)
|
if (!filter)
|
||||||
{
|
{
|
||||||
for (var command in vimperator.commands)
|
for (var command in vimperator.commands)
|
||||||
@@ -333,7 +328,7 @@ vimperator.Completion = function() // {{{
|
|||||||
{
|
{
|
||||||
if (prefix && option.type != "boolean")
|
if (prefix && option.type != "boolean")
|
||||||
continue;
|
continue;
|
||||||
options.push([option.names, option.short_help])
|
options.push([option.names, option.short_help]);
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
@@ -345,7 +340,7 @@ vimperator.Completion = function() // {{{
|
|||||||
{
|
{
|
||||||
if (prefix && option.type != "boolean")
|
if (prefix && option.type != "boolean")
|
||||||
continue;
|
continue;
|
||||||
options.push([prefix + option.name, option.short_help])
|
options.push([prefix + option.name, option.short_help]);
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
@@ -447,7 +442,7 @@ vimperator.Completion = function() // {{{
|
|||||||
var mapped = nodes.map(function(node) {
|
var mapped = nodes.map(function(node) {
|
||||||
return [[node[0]], node[1]];
|
return [[node[0]], node[1]];
|
||||||
});
|
});
|
||||||
|
|
||||||
return build_longest_common_substring(mapped, filter);
|
return build_longest_common_substring(mapped, filter);
|
||||||
}, //}}}
|
}, //}}}
|
||||||
|
|
||||||
@@ -489,7 +484,7 @@ vimperator.Completion = function() // {{{
|
|||||||
}
|
}
|
||||||
object = matches[1].substr(start+1) || "window";
|
object = matches[1].substr(start+1) || "window";
|
||||||
|
|
||||||
var completions = [];
|
var completions = [];
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
completions = eval(
|
completions = eval(
|
||||||
@@ -513,7 +508,11 @@ vimperator.Completion = function() // {{{
|
|||||||
" else {" +
|
" else {" +
|
||||||
" comp.push([[i], type]); }" +
|
" comp.push([[i], type]); }" +
|
||||||
"} comp;");
|
"} comp;");
|
||||||
} catch (e) { completions = []; };
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
completions = [];
|
||||||
|
}
|
||||||
|
|
||||||
return build_longest_starting_substring(completions, filter);
|
return build_longest_starting_substring(completions, filter);
|
||||||
}, // }}}
|
}, // }}}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ vimperator.Events = function() //{{{
|
|||||||
// any tab related events
|
// any tab related events
|
||||||
var tabcontainer = getBrowser().tabContainer;
|
var tabcontainer = getBrowser().tabContainer;
|
||||||
tabcontainer.addEventListener("TabMove", function(event) {
|
tabcontainer.addEventListener("TabMove", function(event) {
|
||||||
vimperator.statusline.updateTabCount()
|
vimperator.statusline.updateTabCount();
|
||||||
vimperator.buffer.updateBufferList();
|
vimperator.buffer.updateBufferList();
|
||||||
}, false);
|
}, false);
|
||||||
tabcontainer.addEventListener("TabOpen", function(event) {
|
tabcontainer.addEventListener("TabOpen", function(event) {
|
||||||
@@ -48,7 +48,7 @@ vimperator.Events = function() //{{{
|
|||||||
vimperator.buffer.updateBufferList();
|
vimperator.buffer.updateBufferList();
|
||||||
}, false);
|
}, false);
|
||||||
tabcontainer.addEventListener("TabClose", function(event) {
|
tabcontainer.addEventListener("TabClose", function(event) {
|
||||||
vimperator.statusline.updateTabCount()
|
vimperator.statusline.updateTabCount();
|
||||||
vimperator.buffer.updateBufferList();
|
vimperator.buffer.updateBufferList();
|
||||||
}, false);
|
}, false);
|
||||||
tabcontainer.addEventListener("TabSelect", function(event) {
|
tabcontainer.addEventListener("TabSelect", function(event) {
|
||||||
@@ -152,7 +152,7 @@ vimperator.Events = function() //{{{
|
|||||||
[ KeyEvent.DOM_VK_F21, ["F21"] ],
|
[ KeyEvent.DOM_VK_F21, ["F21"] ],
|
||||||
[ KeyEvent.DOM_VK_F22, ["F22"] ],
|
[ KeyEvent.DOM_VK_F22, ["F22"] ],
|
||||||
[ KeyEvent.DOM_VK_F23, ["F23"] ],
|
[ KeyEvent.DOM_VK_F23, ["F23"] ],
|
||||||
[ KeyEvent.DOM_VK_F24, ["F24"] ],
|
[ KeyEvent.DOM_VK_F24, ["F24"] ]
|
||||||
];
|
];
|
||||||
|
|
||||||
function getKeyCode(str)
|
function getKeyCode(str)
|
||||||
@@ -372,13 +372,13 @@ vimperator.Events = function() //{{{
|
|||||||
switch (event.button)
|
switch (event.button)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
key = "LeftMouse"
|
key = "LeftMouse";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
key = "MiddleMouse"
|
key = "MiddleMouse";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
key = "RightMouse"
|
key = "RightMouse";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -774,9 +774,9 @@ vimperator.Events = function() //{{{
|
|||||||
},
|
},
|
||||||
|
|
||||||
// stub functions for the interfaces
|
// stub functions for the interfaces
|
||||||
setJSStatus : function(status) { ; },
|
setJSStatus: function(status) { ; },
|
||||||
setJSDefaultStatus : function(status) { ; },
|
setJSDefaultStatus: function(status) { ; },
|
||||||
setDefaultStatus : function(status) { ; },
|
setDefaultStatus: function(status) { ; },
|
||||||
onLinkIconAvailable: function() { ; }
|
onLinkIconAvailable: function() { ; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ vimperator.Search = function() //{{{
|
|||||||
links_only = false;
|
links_only = false;
|
||||||
|
|
||||||
// strip links-only modifiers
|
// strip links-only modifiers
|
||||||
pattern = pattern.replace(/(\\)?\\[uU]/g, function($0, $1) { return $1 ? $0 : "" });
|
pattern = pattern.replace(/(\\)?\\[uU]/g, function($0, $1) { return $1 ? $0 : ""; });
|
||||||
|
|
||||||
// case sensitivity - \c wins if both modifiers specified
|
// case sensitivity - \c wins if both modifiers specified
|
||||||
if (/\c/.test(pattern))
|
if (/\c/.test(pattern))
|
||||||
@@ -96,10 +96,10 @@ vimperator.Search = function() //{{{
|
|||||||
case_sensitive = true;
|
case_sensitive = true;
|
||||||
|
|
||||||
// strip case-sensitive modifiers
|
// strip case-sensitive modifiers
|
||||||
pattern = pattern.replace(/(\\)?\\[cC]/g, function($0, $1) { return $1 ? $0 : "" });
|
pattern = pattern.replace(/(\\)?\\[cC]/g, function($0, $1) { return $1 ? $0 : ""; });
|
||||||
|
|
||||||
// remove any modifer escape \
|
// remove any modifer escape \
|
||||||
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1')
|
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1');
|
||||||
|
|
||||||
search_string = pattern;
|
search_string = pattern;
|
||||||
}
|
}
|
||||||
@@ -246,8 +246,8 @@ vimperator.Search = function() //{{{
|
|||||||
(function(win)
|
(function(win)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < win.frames.length; i++)
|
for (var i = 0; i < win.frames.length; i++)
|
||||||
arguments.callee(win.frames[i])
|
arguments.callee(win.frames[i]);
|
||||||
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document)
|
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document);
|
||||||
for (var i = 0; i < spans.snapshotLength; i++)
|
for (var i = 0; i < spans.snapshotLength; i++)
|
||||||
spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]);
|
spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]);
|
||||||
})(window.content);
|
})(window.content);
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ vimperator.help = function(section, easter) //{{{
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
var header = '<h1><img src="chrome://vimperator/content/logo_white.png" alt="Vimperator"/></h1>' +
|
var header = '<h1><img src="chrome://vimperator/content/logo_white.png" alt="Vimperator"/></h1>' +
|
||||||
'<p class="tagline">First there was a Navigator, then there was an Explorer.\n' +
|
'<p class="tagline">First there was a Navigator, then there was an Explorer.\n' +
|
||||||
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)</p>';
|
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)</p>';
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ vimperator.help = function(section, easter) //{{{
|
|||||||
'<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBDDJfc+lXLBSAM9XSWv/ebzG/L7PTqYiIXaWVg8pfinDsfYaAcifcgCTuApg4v/VaZIQ/hLODzQu2EvmjGXP0twErA/Q8G5gx0l197PJSyVXb1sLwd1mgOdLF4t0HmDCdEI9z3H6CMhsb3xVwlfpzllSfCIqzlSpx4QtdzEZGzLDELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI8ZOwn5QkHgaAgZjjtPQxB7Vw2rS7Voap9y+xdVLoczUQ97hw+bOdZLcGykBtfoVjdn76MS51QKjGp1fEmxkqTuQ+Fxv8+OVtHu0QF/qlrhmC3fJBRJ0IFWxKdXS+Wod4615BDaG2X1hzvCL443ffka8XlLSiFTuW43BumQs/O+6Jqsk2hcReP3FIQOvtWMSgGTALnZx7x5c60u/3NSKW5qvyWKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw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dmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA3MDMyMTIyMzI1OFowIwYJKoZIhvcNAQkEMRYEFCirrvlwYVHQiNEEbM6ikfx9+Dm5MA0GCSqGSIb3DQEBAQUABIGAtbsR8GdCdURLziozXLSdtY+zJZUPPeQFXXy2V1S/3ldiN+pRvd4HI7xz8mOY1UaKJZpwZnOosy9MflL1/hbiEtEyQ2Dm/s4jnTcJng/NjLIZu+0NYxXRJhB+zMJubnMMMjzNrGlqI4F2HAB/bCA1eOJ5B83Of3dA4rk/T/8GoSQ=-----END PKCS7-----"/>' +
|
||||||
'</fieldset></form>' +
|
'</fieldset></form>' +
|
||||||
|
|
||||||
'<p>Of course as a believer in free open source software, only make a donation if you really like Vimperator and the money doesn\'t hurt - otherwise just use it, recommend it and like it :)</p>'
|
'<p>Of course as a believer in free open source software, only make a donation if you really like Vimperator and the money doesn\'t hurt - otherwise just use it, recommend it and like it :)</p>';
|
||||||
|
|
||||||
var initialization = '<span style="float: right"><code class="tag">initialization</code></span><h2 id="initialization">Initialization</h2>' +
|
var initialization = '<span style="float: right"><code class="tag">initialization</code></span><h2 id="initialization">Initialization</h2>' +
|
||||||
'<p>At startup Vimperator sources a user RC file, containing Ex commands, and any JavaScript files found in the plugin directory.</p>' +
|
'<p>At startup Vimperator sources a user RC file, containing Ex commands, and any JavaScript files found in the plugin directory.</p>' +
|
||||||
@@ -178,7 +178,7 @@ vimperator.help = function(section, easter) //{{{
|
|||||||
|
|
||||||
var mappings = '<span style="float: right"><code class="tag">mappings</code></span><h2 id="mappings">Mappings</h2>' +
|
var mappings = '<span style="float: right"><code class="tag">mappings</code></span><h2 id="mappings">Mappings</h2>' +
|
||||||
'<p>The denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.</p>'+
|
'<p>The denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.</p>'+
|
||||||
'<table class="vimperator mappings">'
|
'<table class="vimperator mappings">';
|
||||||
mappings += makeHelpString(vimperator.mappings, "", "", null);
|
mappings += makeHelpString(vimperator.mappings, "", "", null);
|
||||||
mappings += '</table>';
|
mappings += '</table>';
|
||||||
if (section && section == 'holy-grail')
|
if (section && section == 'holy-grail')
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ vimperator.Hints = function() //{{{
|
|||||||
showHints(null, 0);
|
showHints(null, 0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables the HaH-mode by hiding the hints and disabling the input mode
|
* Disables the HaH-mode by hiding the hints and disabling the input mode
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ the provisions above, a recipient may use your version of this file under
|
|||||||
the terms of any one of the MPL, the GPL or the LGPL.
|
the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
}}} ***** END LICENSE BLOCK *****/
|
}}} ***** END LICENSE BLOCK *****/
|
||||||
|
|
||||||
vimperator.IO = function()
|
vimperator.IO = function()
|
||||||
{
|
{
|
||||||
var environment_service = Components.classes["@mozilla.org/process/environment;1"]
|
var environment_service = Components.classes["@mozilla.org/process/environment;1"]
|
||||||
.getService(Components.interfaces.nsIEnvironment);
|
.getService(Components.interfaces.nsIEnvironment);
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
{
|
{
|
||||||
if (names[j] == cmd)
|
if (names[j] == cmd)
|
||||||
{
|
{
|
||||||
names.splice(j, 1)
|
names.splice(j, 1);
|
||||||
|
|
||||||
if (names.length == 0)
|
if (names.length == 0)
|
||||||
maps.splice(i, 1);
|
maps.splice(i, 1);
|
||||||
@@ -260,7 +260,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
for (var j = 0; j < map.names.length; j++)
|
for (var j = 0; j < map.names.length; j++)
|
||||||
{
|
{
|
||||||
if (map.names[j].indexOf(cmd) == 0)
|
if (map.names[j].indexOf(cmd) == 0)
|
||||||
matches.push(map)
|
matches.push(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
for (var j = 0; j < maps[i].names.length; j++)
|
for (var j = 0; j < maps[i].names.length; j++)
|
||||||
{
|
{
|
||||||
list += "<tr>";
|
list += "<tr>";
|
||||||
list += "<td> " + vimperator.util.escapeHTML(maps[i].names[j]) + "</td>"
|
list += "<td> " + vimperator.util.escapeHTML(maps[i].names[j]) + "</td>";
|
||||||
if (maps[i].rhs)
|
if (maps[i].rhs)
|
||||||
list += "<td> " + vimperator.util.escapeHTML(maps[i].rhs) + "</td>"
|
list += "<td> " + vimperator.util.escapeHTML(maps[i].rhs) + "</td>"
|
||||||
list += "</tr>";
|
list += "</tr>";
|
||||||
@@ -446,7 +446,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ["go"],
|
addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ["go"],
|
||||||
function(arg) { vimperator.quickmarks.jumpTo(arg, vimperator.CURRENT_TAB) },
|
function(arg) { vimperator.quickmarks.jumpTo(arg, vimperator.CURRENT_TAB); },
|
||||||
{
|
{
|
||||||
short_help: "Jump to a QuickMark in the current tab",
|
short_help: "Jump to a QuickMark in the current tab",
|
||||||
usage: ["go{a-zA-Z0-9}"],
|
usage: ["go{a-zA-Z0-9}"],
|
||||||
@@ -516,7 +516,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
// should probably reopen the closed tab when a 'deleted'
|
// should probably reopen the closed tab when a 'deleted'
|
||||||
// alternate is selected
|
// alternate is selected
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
vimperator.echoerr("E86: Buffer does not exist") // TODO: This should read "Buffer N does not exist"
|
vimperator.echoerr("E86: Buffer does not exist"); // TODO: This should read "Buffer N does not exist"
|
||||||
else
|
else
|
||||||
vimperator.tabs.select(index);
|
vimperator.tabs.select(index);
|
||||||
},
|
},
|
||||||
@@ -535,7 +535,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vimperator.marks.add(arg)
|
vimperator.marks.add(arg);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
short_help: "Set mark at the cursor position",
|
short_help: "Set mark at the cursor position",
|
||||||
@@ -545,7 +545,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ["'", "`"],
|
addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ["'", "`"],
|
||||||
function(arg) { vimperator.marks.jumpTo(arg) },
|
function(arg) { vimperator.marks.jumpTo(arg); },
|
||||||
{
|
{
|
||||||
short_help: "Jump to the mark in the current buffer",
|
short_help: "Jump to the mark in the current buffer",
|
||||||
usage: ["'{a-zA-Z}"],
|
usage: ["'{a-zA-Z}"],
|
||||||
@@ -562,7 +562,7 @@ vimperator.Mappings = function() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vimperator.quickmarks.add(arg, vimperator.buffer.URL)
|
vimperator.quickmarks.add(arg, vimperator.buffer.URL);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
short_help: "Add new QuickMark for current URL",
|
short_help: "Add new QuickMark for current URL",
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ vimperator.Options = function() //{{{
|
|||||||
"</ul>" +
|
"</ul>" +
|
||||||
"The order matters",
|
"The order matters",
|
||||||
default_value: "gm",
|
default_value: "gm",
|
||||||
validator: function (value) { if (/[^gm]/.test(value) || value.length > 2 ||
|
validator: function (value) { if (/[^gm]/.test(value) || value.length > 2 ||
|
||||||
value.length < 1) return false; else return true; }
|
value.length < 1) return false; else return true; }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -256,7 +256,8 @@ vimperator.Tabs = function() //{{{
|
|||||||
{
|
{
|
||||||
this.reload(getBrowser().mTabs[i], bypass_cache)
|
this.reload(getBrowser().mTabs[i], bypass_cache)
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e)
|
||||||
|
{
|
||||||
// FIXME: can we do anything useful here without stopping the
|
// FIXME: can we do anything useful here without stopping the
|
||||||
// other tabs from reloading?
|
// other tabs from reloading?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ vimperator.CommandLine = function() //{{{
|
|||||||
|
|
||||||
// for the example command "open sometext| othertext" (| is the cursor pos):
|
// for the example command "open sometext| othertext" (| is the cursor pos):
|
||||||
var completion_start_index = 0; // will be 5 because we want to complete arguments for the :open command
|
var completion_start_index = 0; // will be 5 because we want to complete arguments for the :open command
|
||||||
var completion_prefix = "" // will be: "open sometext"
|
var completion_prefix = ""; // will be: "open sometext"
|
||||||
var completion_postfix = ""; // will be: " othertext"
|
var completion_postfix = ""; // will be: " othertext"
|
||||||
|
|
||||||
var wild_index = 0; // keep track how often we press <Tab> in a row
|
var wild_index = 0; // keep track how often we press <Tab> in a row
|
||||||
@@ -682,7 +682,7 @@ vimperator.CommandLine = function() //{{{
|
|||||||
if (vimperator.options["more"] && isScrollable() && !atEnd())
|
if (vimperator.options["more"] && isScrollable() && !atEnd())
|
||||||
win.scrollByLines(1);
|
win.scrollByLines(1);
|
||||||
else
|
else
|
||||||
close_window = true;; // don't propagate the event for accept keys
|
close_window = true; // don't propagate the event for accept keys
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// up a line
|
// up a line
|
||||||
@@ -807,7 +807,7 @@ vimperator.CommandLine = function() //{{{
|
|||||||
|
|
||||||
// close the window
|
// close the window
|
||||||
case "q":
|
case "q":
|
||||||
close_window = true;;
|
close_window = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// unmapped key
|
// unmapped key
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
|||||||
|
|
||||||
vimperator.util = {
|
vimperator.util = {
|
||||||
escapeHTML: function(str)
|
escapeHTML: function(str)
|
||||||
{
|
{
|
||||||
var e = window.content.document.createElement("div");
|
var e = window.content.document.createElement("div");
|
||||||
e.appendChild(window.content.document.createTextNode(str));
|
e.appendChild(window.content.document.createTextNode(str));
|
||||||
return e.innerHTML;
|
return e.innerHTML;
|
||||||
@@ -51,7 +51,7 @@ vimperator.util = {
|
|||||||
arg = '"' + vimperator.util.escapeHTML(arg.replace(/\n/, "\\n")) + '"';
|
arg = '"' + vimperator.util.escapeHTML(arg.replace(/\n/, "\\n")) + '"';
|
||||||
|
|
||||||
return "<span style=\"color: green;\">" + arg + "</span>";
|
return "<span style=\"color: green;\">" + arg + "</span>";
|
||||||
}
|
}
|
||||||
else if (type == "boolean")
|
else if (type == "boolean")
|
||||||
{
|
{
|
||||||
return "<span style=\"color: blue;\">" + arg + "</span>";
|
return "<span style=\"color: blue;\">" + arg + "</span>";
|
||||||
@@ -62,9 +62,9 @@ vimperator.util = {
|
|||||||
}
|
}
|
||||||
else if (type == "object" || type == "function")
|
else if (type == "object" || type == "function")
|
||||||
{
|
{
|
||||||
// for java packages value.toString() would crash so badly
|
// for java packages value.toString() would crash so badly
|
||||||
// that we cannot even try/catch it
|
// that we cannot even try/catch it
|
||||||
if (/^\[JavaPackage.*\]$/.test(arg))
|
if (/^\[JavaPackage.*\]$/.test(arg))
|
||||||
return "[JavaPackage]";
|
return "[JavaPackage]";
|
||||||
|
|
||||||
var str = arg.toString();
|
var str = arg.toString();
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ const vimperator = (function() //{{{
|
|||||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||||
.getService(Components.interfaces.nsIWindowMediator);
|
.getService(Components.interfaces.nsIWindowMediator);
|
||||||
whichwindow = wm.getMostRecentWindow("navigator:browser");
|
whichwindow = wm.getMostRecentWindow("navigator:browser");
|
||||||
whichwindow.loadURI(url, null, postdata)
|
whichwindow.loadURI(url, null, postdata);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -559,7 +559,7 @@ const vimperator = (function() //{{{
|
|||||||
|
|
||||||
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
|
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
|
||||||
process.init(file);
|
process.init(file);
|
||||||
|
|
||||||
var ec = process.run(blocking, args, args.length);
|
var ec = process.run(blocking, args, args.length);
|
||||||
return ec;
|
return ec;
|
||||||
},
|
},
|
||||||
@@ -801,16 +801,16 @@ const vimperator = (function() //{{{
|
|||||||
|
|
||||||
sleep: function(ms)
|
sleep: function(ms)
|
||||||
{
|
{
|
||||||
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
|
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
|
||||||
var mainThread = threadManager.mainThread;
|
var mainThread = threadManager.mainThread;
|
||||||
|
|
||||||
var then = new Date().getTime(), now = then;
|
var then = new Date().getTime(), now = then;
|
||||||
for (; now - then < ms; now = new Date().getTime()) {
|
for (; now - then < ms; now = new Date().getTime()) {
|
||||||
mainThread.processNextEvent(true);
|
mainThread.processNextEvent(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
get windows()
|
get windows()
|
||||||
{
|
{
|
||||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
|
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
|
||||||
var wa = [];
|
var wa = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user