mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 18:07:58 +01:00
change all references to "settings" to "options"
This commit is contained in:
@@ -414,7 +414,7 @@ function Commands()//{{{
|
||||
"Make sure you use the full vim notation when jumping to {subject}. This means:<br/>"+
|
||||
"<ul>"+
|
||||
"<li><code class=\"command\">:help :help</code> for commands (: prefix)</li>"+
|
||||
"<li><code class=\"command\">:help 'complete'</code> for settings (surrounded by ' and ')</li>"+
|
||||
"<li><code class=\"command\">:help 'complete'</code> for options (surrounded by ' and ')</li>"+
|
||||
"<li><code class=\"command\">:help o</code> for mappings (no pre- or postfix)</li>"+
|
||||
"</ul>"+
|
||||
"You can however use partial stings in the tab completion, so <code class=\"command\">:help he<Tab></code> will complete <code class=\"command\">:help :help</code>.",
|
||||
@@ -494,14 +494,14 @@ function Commands()//{{{
|
||||
"<li>Opened with the specified search engine if the token looks like a search string "+
|
||||
"and the first word of the token is the name of a search engine (<code class=\"command\">:open wikipedia linus torvalds</code> "+
|
||||
"will open the wikipedia entry for linux torvalds).</li>"+
|
||||
" <li>Opened with the default search engine or keyword (specified with the <code class=\"setting\">'defsearch'</code> setting) "+
|
||||
" <li>Opened with the default search engine or keyword (specified with the <code class=\"option\">'defsearch'</code> option) "+
|
||||
"if the first word is no search engine (<code class=\"command\">:open linus torvalds</code> will open a google search for linux torvalds).</li>"+
|
||||
" <li>Passed directly to Firefox in all other cases (<code class=\"command\">:open www.osnews.com | www.slashdot.org</code> will "+
|
||||
"open OSNews in the current, and Slashdot in a new background tab).</li>"+
|
||||
"</ol>"+
|
||||
"You WILL be able to use <code class=\"command\">:open [-T \"linux\"] torvalds<Tab></code> to complete bookmarks "+
|
||||
"with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<br/>"+
|
||||
"The items which are completed on <code><Tab></code> are specified in the <code class=\"setting\">'complete'</code> option.<br/>"+
|
||||
"The items which are completed on <code><Tab></code> are specified in the <code class=\"option\">'complete'</code> option.<br/>"+
|
||||
"Without argument, reloads the current page.<br/>"+
|
||||
"Without argument but with !, reloads the current page skipping the cache.",
|
||||
completer: function(filter) { return get_url_completions(filter); }
|
||||
@@ -584,7 +584,7 @@ function Commands()//{{{
|
||||
"<code class=\"command\">:set option?</code> or <code class=\"command\">:set option</code> shows the current value of the option.<br/>"+
|
||||
"<code class=\"command\">:set option&</code> resets 'option' to the default value.<br/>"+
|
||||
"<code class=\"command\">:set option+=foo</code> and <code class=\"command\">:set option-=foo</code> WILL add/remove foo from list options.<br/>",
|
||||
completer: function(filter) { return get_settings_completions(filter); }
|
||||
completer: function(filter) { return get_options_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new Command(["so[urce]"],
|
||||
@@ -652,7 +652,7 @@ function Commands()//{{{
|
||||
usage: ["tabopen [url] [| url]"],
|
||||
short_help: "Open one or more URLs in a new tab",
|
||||
help: "Like <code class=\"command\">:open</code> but open URLs in a new tab.<br/>"+
|
||||
"If used with !, the 'tabopen' value of the 'activate' setting is negated.",
|
||||
"If used with !, the 'tabopen' value of the 'activate' option is negated.",
|
||||
completer: function (filter) { return get_url_completions(filter); }
|
||||
}
|
||||
));
|
||||
@@ -1517,15 +1517,15 @@ function set(args, special)
|
||||
|
||||
var no = true; if (matches[1] == undefined) no = false;
|
||||
var opt = matches[2];
|
||||
var setting = get_setting(opt);
|
||||
if (!setting)
|
||||
var option = get_option(opt);
|
||||
if (!option)
|
||||
{
|
||||
vimperator.echoerr("E518: Unknown option: " + opt);
|
||||
return;
|
||||
}
|
||||
|
||||
var get = false; if (matches[3] == "?" ||
|
||||
(setting[TYPE] != 'boolean' && matches[4] == undefined)) get = true;
|
||||
(option[TYPE] != 'boolean' && matches[4] == undefined)) get = true;
|
||||
var reset = false; if (matches[3] == "&") reset = true;
|
||||
var oper = matches[5];
|
||||
var val = matches[6]; if (val == undefined) val = "";
|
||||
@@ -1533,42 +1533,42 @@ function set(args, special)
|
||||
// reset a variable to its default value.
|
||||
if (reset)
|
||||
{
|
||||
var def = setting[DEFAULT];
|
||||
setting[SETFUNC].call(this, def);
|
||||
var def = option[DEFAULT];
|
||||
option[SETFUNC].call(this, def);
|
||||
}
|
||||
// read access
|
||||
else if (get)
|
||||
{
|
||||
var cur_val = setting[GETFUNC].call(this);
|
||||
vimperator.echo(" " + setting[COMMANDS][0] + "=" + cur_val);
|
||||
var cur_val = option[GETFUNC].call(this);
|
||||
vimperator.echo(" " + option[COMMANDS][0] + "=" + cur_val);
|
||||
}
|
||||
// write access
|
||||
else
|
||||
{
|
||||
var type = setting[TYPE];
|
||||
var type = option[TYPE];
|
||||
if (type == "boolean")
|
||||
{
|
||||
setting[SETFUNC].call(this, !no);
|
||||
option[SETFUNC].call(this, !no);
|
||||
}
|
||||
else if (type == "number")
|
||||
{
|
||||
var num = parseInt(val, 10);
|
||||
if (isNaN(num))
|
||||
vimperator.echoerr("Invalid argument type to option " + setting[COMMANDS][0] + ": Expects number");
|
||||
vimperator.echoerr("Invalid argument type to option " + option[COMMANDS][0] + ": Expects number");
|
||||
else
|
||||
{
|
||||
var cur_val = setting[GETFUNC].call(this);
|
||||
var cur_val = option[GETFUNC].call(this);
|
||||
if (oper == '+') num = cur_val + num;
|
||||
if (oper == '-') num = cur_val - num;
|
||||
if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, num) == false)
|
||||
vimperator.echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details");
|
||||
if (option[CHECKFUNC] != null && option[CHECKFUNC].call(this, num) == false)
|
||||
vimperator.echoerr("Invalid argument to option " + option[COMMANDS][0] + ": Check help for more details");
|
||||
else // all checks passed, execute option handler
|
||||
setting[SETFUNC].call(this, num);
|
||||
option[SETFUNC].call(this, num);
|
||||
}
|
||||
}
|
||||
else if (type == "charlist" || type == "stringlist" || type == "string")
|
||||
{
|
||||
var cur_val = setting[GETFUNC].call(this);
|
||||
var cur_val = option[GETFUNC].call(this);
|
||||
if (type == "charlist" || type == "string")
|
||||
{
|
||||
if (oper == '+' && !cur_val.match(val))
|
||||
@@ -1585,10 +1585,10 @@ function set(args, special)
|
||||
val = val.replace(/^,?/, '');
|
||||
}
|
||||
}
|
||||
if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, val) == false)
|
||||
vimperator.echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details");
|
||||
if (option[CHECKFUNC] != null && option[CHECKFUNC].call(this, val) == false)
|
||||
vimperator.echoerr("Invalid argument to option " + option[COMMANDS][0] + ": Check help for more details");
|
||||
else // all checks passed, execute option handler
|
||||
setting[SETFUNC].call(this, val);
|
||||
option[SETFUNC].call(this, val);
|
||||
}
|
||||
else
|
||||
vimperator.echoerr("Internal error, option format `" + type + "' not supported");
|
||||
|
||||
@@ -97,7 +97,7 @@ function build_longest_starting_substring(list, filter)/*{{{*/
|
||||
return filtered;
|
||||
}/*}}}*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* filter a list of urls
|
||||
*
|
||||
* may consist of searchengines, filenames, bookmarks and history,
|
||||
@@ -255,7 +255,7 @@ function get_help_completions(filter)/*{{{*/
|
||||
{
|
||||
var help_array = [[["mappings"], "Normal mode commands"],
|
||||
[["commands"], "Ex commands"],
|
||||
[["settings"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages'
|
||||
[["options"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages'
|
||||
g_substrings = [];
|
||||
for (var command in vimperator.commands)
|
||||
{
|
||||
@@ -264,8 +264,8 @@ function get_help_completions(filter)/*{{{*/
|
||||
}),
|
||||
command.short_help])
|
||||
}
|
||||
settings = get_settings_completions(filter, true);
|
||||
help_array = help_array.concat(settings.map(function($_) {
|
||||
options = get_options_completions(filter, true);
|
||||
help_array = help_array.concat(options.map(function($_) {
|
||||
return [
|
||||
$_[COMMANDS].map(function($_) { return "'" + $_ + "'"; }),
|
||||
$_[1]
|
||||
@@ -298,23 +298,23 @@ function get_command_completions(filter)/*{{{*/
|
||||
return build_longest_starting_substring(completions, filter);
|
||||
}/*}}}*/
|
||||
|
||||
function get_settings_completions(filter, unfiltered)/*{{{*/
|
||||
function get_options_completions(filter, unfiltered)/*{{{*/
|
||||
{
|
||||
g_substrings = [];
|
||||
var settings_completions = [];
|
||||
var options_completions = [];
|
||||
var no_mode = false;
|
||||
if (filter.indexOf("no") == 0) // boolean option
|
||||
{
|
||||
no_mode = true;
|
||||
filter = filter.substr(2);
|
||||
}
|
||||
if (unfiltered) return g_settings.filter(function($_) {
|
||||
if (unfiltered) return g_options.filter(function($_) {
|
||||
if (no_mode && $_[TYPE] != "boolean") return false;
|
||||
else return true;
|
||||
}).map(function($_) {
|
||||
return [$_[COMMANDS], $_[SHORTHELP]];
|
||||
});
|
||||
if (!filter) return g_settings.filter(function($_) {
|
||||
if (!filter) return g_options.filter(function($_) {
|
||||
if (no_mode && $_[TYPE] != "boolean") return false;
|
||||
else return true;
|
||||
}).map(function($_) {
|
||||
@@ -326,49 +326,49 @@ function get_settings_completions(filter, unfiltered)/*{{{*/
|
||||
else if(filter.length > 0 && filter.lastIndexOf("=") == filter.length -1)
|
||||
{
|
||||
filter = filter.substr(0, filter.length-1);
|
||||
for(var i=0; i<g_settings.length; i++)
|
||||
for(var i=0; i<g_options.length; i++)
|
||||
{
|
||||
for(var j=0; j<g_settings[i][COMMANDS].length; j++)
|
||||
for(var j=0; j<g_options[i][COMMANDS].length; j++)
|
||||
{
|
||||
if (g_settings[i][COMMANDS][j] == filter)
|
||||
if (g_options[i][COMMANDS][j] == filter)
|
||||
{
|
||||
settings_completions.push([filter + "=" + g_settings[i][GETFUNC].call(this), ""]);
|
||||
return settings_completions;
|
||||
options_completions.push([filter + "=" + g_options[i][GETFUNC].call(this), ""]);
|
||||
return options_completions;
|
||||
}
|
||||
}
|
||||
}
|
||||
return settings_completions;
|
||||
return options_completions;
|
||||
}
|
||||
|
||||
// can't use b_l_s_s, since this has special requirements (the prefix)
|
||||
var filter_length = filter.length;
|
||||
for (var i = 0; i < g_settings.length; i++)
|
||||
for (var i = 0; i < g_options.length; i++)
|
||||
{
|
||||
if (no_mode && g_settings[i][TYPE] != "boolean")
|
||||
if (no_mode && g_options[i][TYPE] != "boolean")
|
||||
continue;
|
||||
|
||||
var prefix = no_mode ? 'no' : '';
|
||||
for (var j = 0; j < g_settings[i][COMMANDS].length; j++)
|
||||
for (var j = 0; j < g_options[i][COMMANDS].length; j++)
|
||||
{
|
||||
if (g_settings[i][COMMANDS][j].indexOf(filter) != 0) continue;
|
||||
if (g_options[i][COMMANDS][j].indexOf(filter) != 0) continue;
|
||||
if (g_substrings.length == 0)
|
||||
{
|
||||
var length = g_settings[i][COMMANDS][j].length;
|
||||
var length = g_options[i][COMMANDS][j].length;
|
||||
for (var k = filter_length; k <= length; k++)
|
||||
g_substrings.push(prefix + g_settings[i][COMMANDS][j].substring(0, k));
|
||||
g_substrings.push(prefix + g_options[i][COMMANDS][j].substring(0, k));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_substrings = g_substrings.filter(function($_) {
|
||||
return g_settings[i][COMMANDS][j].indexOf($_) == 0;
|
||||
return g_options[i][COMMANDS][j].indexOf($_) == 0;
|
||||
});
|
||||
}
|
||||
settings_completions.push([prefix + g_settings[i][COMMANDS][j], g_settings[i][SHORTHELP]]);
|
||||
options_completions.push([prefix + g_options[i][COMMANDS][j], g_options[i][SHORTHELP]]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return settings_completions;
|
||||
return options_completions;
|
||||
}/*}}}*/
|
||||
|
||||
function get_buffer_completions(filter)/*{{{*/
|
||||
@@ -394,7 +394,6 @@ function get_buffer_completions(filter)/*{{{*/
|
||||
if (title.indexOf(filter) == -1 && url.indexOf(filter) == -1)
|
||||
continue;
|
||||
|
||||
|
||||
if (title.indexOf(filter) != -1 || url.indexOf(filter) != -1)
|
||||
{
|
||||
if (title == "")
|
||||
|
||||
@@ -79,7 +79,7 @@ table.commands {
|
||||
table.mappings {
|
||||
background-color: rgb(230, 240, 250);
|
||||
}
|
||||
table.settings {
|
||||
table.options {
|
||||
background-color: rgb(240, 250, 230);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ fieldset.paypal {
|
||||
|
||||
.command { font-weight: bold; color: #632610; }
|
||||
.mapping { font-weight: bold; color: #102663; }
|
||||
.setting { font-weight: bold; color: #106326; }
|
||||
.option { font-weight: bold; color: #106326; }
|
||||
.argument { color: #6A97D4; }
|
||||
.version {
|
||||
position: absolute;
|
||||
@@ -102,7 +102,7 @@ fieldset.paypal {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
.shorthelp { font-weight: bold; }
|
||||
.shorthelp { font-weight: bold; }
|
||||
|
||||
.status_insecure, .status_insecure * {
|
||||
background-color: transparent;
|
||||
|
||||
@@ -34,15 +34,15 @@ function help(section, easter)
|
||||
return;
|
||||
}
|
||||
if ((arguments[3] && arguments[3].inTab))// || !window.content.document.open)
|
||||
openURLsInNewTab("", true);
|
||||
openURLsInNewTab("", true);
|
||||
else
|
||||
openURLs("about:blank");
|
||||
|
||||
// xxx: for firebug: :js Firebug.toggleBar(true)
|
||||
|
||||
/* commands = array where help information is located
|
||||
* beg = string which is printed before the commmand/setting/mapping name
|
||||
* end = string which is printed after the commmand/setting/mapping name
|
||||
* beg = string which is printed before the commmand/option/mapping name
|
||||
* end = string which is printed after the commmand/option/mapping name
|
||||
* func = called with 'command', result is a string is prepended to the help text
|
||||
*/
|
||||
function makeHelpString(commands, beg, end, func)
|
||||
@@ -64,8 +64,8 @@ function help(section, easter)
|
||||
usage = usage.replace(/\\n/g, "<br/>");
|
||||
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
|
||||
usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=\"argument\">$2</span>");
|
||||
// and the 'setting' in a different color
|
||||
usage = usage.replace(/^'(\w+)'/gm, "'<span class=\"setting\">$1</span>'");
|
||||
// and the 'option' in a different color
|
||||
usage = usage.replace(/^'(\w+)'/gm, "'<span class=\"option\">$1</span>'");
|
||||
ret += "<code>" +beg+ usage +end+ '</code><br/>';
|
||||
}
|
||||
ret += '</td><td valign="top">';
|
||||
@@ -76,7 +76,7 @@ function help(section, easter)
|
||||
ret += '<span class="shorthelp">';
|
||||
ret += commands[i][SHORTHELP]; // the help description
|
||||
ret += "</span><br/>";
|
||||
if(func) // for settings whe print default values here, e.g.
|
||||
if(func) // for options we print default values here, e.g.
|
||||
{
|
||||
ret += func.call(this, commands[i]);
|
||||
ret += "<br/>";
|
||||
@@ -110,7 +110,7 @@ function help(section, easter)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function makeSettingsHelpString(command)
|
||||
function makeOptionsHelpString(command)
|
||||
{
|
||||
var ret = "";
|
||||
ret = command[TYPE] + ' (default: <span style="font-family: monospace;">';
|
||||
@@ -132,7 +132,7 @@ function help(section, easter)
|
||||
ret += "</span>)<br/>";
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
var header = '<h1>Vimperator</h1>\n' +
|
||||
'<p class="tagline">First there was a Navigator, then there was an Explorer.<br/>\n' +
|
||||
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)</p>\n';
|
||||
@@ -186,10 +186,10 @@ function help(section, easter)
|
||||
'now dead, unfortunately. So now you might wonder what the meaning of death<br/>' +
|
||||
'is...</p>\n';
|
||||
|
||||
var settings = '<div><h2 id="settings">Settings</h2></div>\n' +
|
||||
'<table class="vimperator settings">\n';
|
||||
settings += makeHelpString(g_settings, "'", "'", makeSettingsHelpString);
|
||||
settings += '</table>';
|
||||
var options = '<div><h2 id="options">Options</h2></div>\n' +
|
||||
'<table class="vimperator options">\n';
|
||||
options += makeHelpString(g_options, "'", "'", makeOptionsHelpString);
|
||||
options += '</table>';
|
||||
|
||||
var fulldoc = '<?xml version="1.0"?>\n' +
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n' +
|
||||
@@ -202,7 +202,7 @@ function help(section, easter)
|
||||
introduction +
|
||||
mappings +
|
||||
commands +
|
||||
settings +
|
||||
options +
|
||||
'\n</div>\n</body>\n</html>';
|
||||
|
||||
var doc = window.content.document;
|
||||
@@ -218,7 +218,7 @@ function help(section, easter)
|
||||
if (arguments[3] && arguments[3].recursive)
|
||||
return false;
|
||||
|
||||
openURLs("about:blank");
|
||||
openURLs("about:blank");
|
||||
setTimeout(function () { help(section, false, null, {recursive: true}); }, 250);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ function Mappings()//{{{
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["gP"], function(count) { openURLsInNewTab(readFromClipboard(), false); },
|
||||
{
|
||||
short_help: "Open (put) an URL based on the current clipboard contents in a new buffer",
|
||||
help: "Works like <code class=\"mapping\">P</code>, but inverts the <code class=\"setting\">'activate'</code> setting."
|
||||
help: "Works like <code class=\"mapping\">P</code>, but inverts the <code class=\"option\">'activate'</code> option."
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["gt", "<C-n>", "<C-Tab>"], function(count) { vimperator.tabs.select(count > 0 ? count -1: "+1", count > 0 ? false : true); },
|
||||
@@ -276,14 +276,14 @@ function Mappings()//{{{
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["p", "<MiddleMouse>"], function(count) { openURLs(readFromClipboard()); },
|
||||
{
|
||||
short_help: "Open (put) an URL based on the current clipboard contents in the current buffer",
|
||||
help: "You can also just select some non-URL text, and search for it with the default search engine or keyword (specified by the <code class=\"setting\">'defsearch'</code> setting) with <code class=\"mapping\">p</code>."
|
||||
help: "You can also just select some non-URL text, and search for it with the default search engine or keyword (specified by the <code class=\"option\">'defsearch'</code> option) with <code class=\"mapping\">p</code>."
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["P"], function(count) { openURLsInNewTab(readFromClipboard(), true); },
|
||||
{
|
||||
short_help: "Open (put) an URL based on the current clipboard contents in a new buffer",
|
||||
help: "Works like <code class=\"mapping\">p</code>, but opens a new tab.<br/>" +
|
||||
"Whether the new buffer is activated, depends on the <code class=\"setting\">'activate'</code> setting."
|
||||
"Whether the new buffer is activated, depends on the <code class=\"option\">'activate'</code> option."
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["r"], function(count) { reload(getBrowser().mCurrentTab, false); },
|
||||
@@ -406,7 +406,7 @@ function Mappings()//{{{
|
||||
{
|
||||
short_help: "Scroll document to the left",
|
||||
help: "Count is supported: <code class=\"mapping\">10h</code> will move 10 times as much to the left.<br/>" +
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"setting\">'beep'</code> is turned off).",
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"option\">'beep'</code> is turned off).",
|
||||
flags: Mappings.flags.COUNT
|
||||
}
|
||||
));
|
||||
@@ -414,7 +414,7 @@ function Mappings()//{{{
|
||||
{
|
||||
short_help: "Scroll document down",
|
||||
help: "Count is supported: <code class=\"mapping\">10j</code> will move 10 times as much down.<br/>" +
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"setting\">'beep'</code> is turned off).",
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"option\">'beep'</code> is turned off).",
|
||||
flags: Mappings.flags.COUNT
|
||||
}
|
||||
));
|
||||
@@ -422,7 +422,7 @@ function Mappings()//{{{
|
||||
{
|
||||
short_help: "Scroll document up",
|
||||
help: "Count is supported: <code class=\"mapping\">10k</code> will move 10 times as much up.<br/>" +
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"setting\">'beep'</code> is turned off).",
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"option\">'beep'</code> is turned off).",
|
||||
flags: Mappings.flags.COUNT
|
||||
}
|
||||
));
|
||||
@@ -430,7 +430,7 @@ function Mappings()//{{{
|
||||
{
|
||||
short_help: "Scroll document to the right",
|
||||
help: "Count is supported: <code class=\"mapping\">10l</code> will move 10 times as much to the right.<br/>" +
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"setting\">'beep'</code> is turned off).",
|
||||
"If the document cannot scroll more, a beep is emmited (unless <code class=\"option\">'beep'</code> is turned off).",
|
||||
flags: Mappings.flags.COUNT
|
||||
}
|
||||
));
|
||||
@@ -495,7 +495,7 @@ function Mappings()//{{{
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["f"], function(count) { hah.enableHahMode(vimperator.modes.QUICK_HINT); },
|
||||
{
|
||||
short_help: "Start QuickHint mode",
|
||||
help: "In QuickHint mode, every hintable item (according to the <code class=\"setting\">'hinttags'</code> XPath query) is assigned a label.<br/>" +
|
||||
help: "In QuickHint mode, every hintable item (according to the <code class=\"option\">'hinttags'</code> XPath query) is assigned a label.<br/>" +
|
||||
"If you then press the keys for a label, it is followed as soon as it can be uniquely identified and this mode is stopped. Or press <code class=\"mapping\"><Esc></code> to stop this mode.<br/>" +
|
||||
"If you write the hint in ALLCAPS, the hint is followed in a background tab."
|
||||
}
|
||||
@@ -503,7 +503,7 @@ function Mappings()//{{{
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["F"], function(count) { hah.enableHahMode(vimperator.modes.ALWAYS_HINT); },
|
||||
{
|
||||
short_help: "Start AlwaysHint mode",
|
||||
help: "In AlwaysHint mode, every hintable item (according to the <code class=\"setting\">'hinttags'</code> XPath query) is assigned a label.<br/>" +
|
||||
help: "In AlwaysHint mode, every hintable item (according to the <code class=\"option\">'hinttags'</code> XPath query) is assigned a label.<br/>" +
|
||||
"If you then press the keys for a label, it is followed as soon as it can be uniquely identified. Labels stay active after following a hint in this mode, press <code class=\"mapping\"><Esc></code> to stop this mode.<br/>" +
|
||||
"This hint mode is especially useful for browsing large sites like Forums as hints are automatically regenerated when switching to a new document.<br/>" +
|
||||
"Also, most <code class=\"mapping\">Ctrl</code>-prefixed short_helpcut keys are available in this mode for navigation."
|
||||
@@ -527,7 +527,7 @@ function Mappings()//{{{
|
||||
"<li><code class=\"mapping\"><C-w></code> to open its destination in a new window</li>" +
|
||||
"</ul>" +
|
||||
"Multiple hints can be seperated by commas where it makes sense. <code class=\"mapping\">;ab,ac,adt</code> opens <code>AB</code>, <code>AC</code> and <code>AD</code> in a new tab.<br/>" +
|
||||
"Hintable elements for this mode can be set in the <code class=\"setting\">'extendedhinttags'</code> XPath string."
|
||||
"Hintable elements for this mode can be set in the <code class=\"option\">'extendedhinttags'</code> XPath string."
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// settings.js
|
||||
// options.js
|
||||
//
|
||||
// handles all persistent storage of information
|
||||
// to and from the firefox registry
|
||||
@@ -10,7 +10,7 @@ const DEFAULT = 8;
|
||||
const CHECKFUNC = 9;
|
||||
|
||||
|
||||
// the global handle to the root of the firefox settings
|
||||
// the global handle to the root of the firefox options
|
||||
var g_firefox_prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
var g_vimperator_prefs = null;
|
||||
|
||||
@@ -18,10 +18,10 @@ var g_vimperator_prefs = null;
|
||||
var opt_usermode = false;
|
||||
var opt_fullscreen = false;
|
||||
|
||||
/* all user-setable vimperator settings
|
||||
/* all user-setable vimperator options
|
||||
* format:
|
||||
* [
|
||||
* 0: [all names of this setting],
|
||||
* 0: [all names of this option],
|
||||
* 1: usage,
|
||||
* 2: shorthelp
|
||||
* 3: help text,
|
||||
@@ -33,7 +33,7 @@ var opt_fullscreen = false;
|
||||
* 9: checkfunc,
|
||||
* ]
|
||||
*/
|
||||
var g_settings = [/*{{{*/
|
||||
var g_options = [/*{{{*/
|
||||
[
|
||||
["activate"],
|
||||
["activate"],
|
||||
@@ -68,7 +68,7 @@ var g_settings = [/*{{{*/
|
||||
"<li><b>b</b>: Bookmarks</li>" +
|
||||
"<li><b>h</b>: History</li></ul>" +
|
||||
"The order is important, so <code class=\"command\">:set complete=bs</code> would list bookmarks first, and then any available quick searches.<br/>"+
|
||||
"Add 'sort' to the <code class=\"setting\">'wildoptions'</code> setting if you want all entries sorted.",
|
||||
"Add 'sort' to the <code class=\"option\">'wildoptions'</code> option if you want all entries sorted.",
|
||||
"charlist",
|
||||
null,
|
||||
function(value) { set_pref("complete", value); },
|
||||
@@ -271,7 +271,7 @@ var g_settings = [/*{{{*/
|
||||
"string",
|
||||
null,
|
||||
function(value) { set_pref("titlestring", value); set_titlestring(value); },
|
||||
function() { return get_pref("titlestring"); },
|
||||
function() { return get_pref("titlestring"); },
|
||||
"Vimperator",
|
||||
null
|
||||
],
|
||||
@@ -279,7 +279,7 @@ var g_settings = [/*{{{*/
|
||||
["usermode", "um", "nousermode", "noum"],
|
||||
["usermode", "um"],
|
||||
"Show current website with a minimal stylesheet to make it easily accessible",
|
||||
"Note that this is a local setting for now, later it may be split into a global and <code class=\"command\">:setlocal</code> part",
|
||||
"Note that this is a local option for now, later it may be split into a global and <code class=\"command\">:setlocal</code> part",
|
||||
"boolean",
|
||||
null,
|
||||
function(value) { opt_usermode = value; setStyleDisabled(value); },
|
||||
@@ -319,7 +319,7 @@ var g_settings = [/*{{{*/
|
||||
"A list of words that change how command line completion is done.<br/>"+
|
||||
"Currently only one word is allowed:<br/>"+
|
||||
"<table>"+
|
||||
"<tr><td><b>sort</b></td><td>Always sorts completion list, overriding the <code class=\"setting\">'complete'</code> option.</td></tr>" +
|
||||
"<tr><td><b>sort</b></td><td>Always sorts completion list, overriding the <code class=\"option\">'complete'</code> option.</td></tr>" +
|
||||
"</table>",
|
||||
"stringlist",
|
||||
null,
|
||||
@@ -330,7 +330,7 @@ var g_settings = [/*{{{*/
|
||||
]
|
||||
|
||||
// TODO: make more performant and then enable
|
||||
/*,[
|
||||
/*,[
|
||||
["numbertabs", "nt"],
|
||||
["numbertabs", "nt"],
|
||||
"Turns tab numbering on or off",
|
||||
@@ -353,17 +353,17 @@ var g_settings = [/*{{{*/
|
||||
|
||||
]/*}}}*/
|
||||
|
||||
// return null, if the cmd cannot be found in our g_settings array, or
|
||||
// return null, if the cmd cannot be found in our g_options array, or
|
||||
// otherwise a refernce to our command
|
||||
function get_setting(cmd)/*{{{*/
|
||||
function get_option(cmd)/*{{{*/
|
||||
{
|
||||
for (var i=0; i < g_settings.length; i++)
|
||||
for (var i=0; i < g_options.length; i++)
|
||||
{
|
||||
for (var j=0; j < g_settings[i][COMMANDS].length; j++)
|
||||
for (var j=0; j < g_options[i][COMMANDS].length; j++)
|
||||
{
|
||||
if (g_settings[i][COMMANDS][j] == cmd)
|
||||
if (g_options[i][COMMANDS][j] == cmd)
|
||||
{
|
||||
return g_settings[i];
|
||||
return g_options[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -401,11 +401,11 @@ function get_pref(name, forced_default)
|
||||
default_value = forced_default;
|
||||
else
|
||||
{
|
||||
for (var i=0; i<g_settings.length; i++)
|
||||
for (var i=0; i<g_options.length; i++)
|
||||
{
|
||||
if (g_settings[i][COMMANDS][0] == name) // only first name is searched
|
||||
if (g_options[i][COMMANDS][0] == name) // only first name is searched
|
||||
{
|
||||
default_value = g_settings[i][DEFAULT];
|
||||
default_value = g_options[i][DEFAULT];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
|
||||
|
||||
<!-- The stylesheet which is used for the :help command -->
|
||||
<?xml-stylesheet href="chrome://vimperator/content/default.css" type="text/css"?>
|
||||
@@ -35,14 +35,14 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
||||
<overlay id="vimperator"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript;version=1.7" src="help.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="vimperator.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="commands.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="ui.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="settings.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="options.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="completion.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="bookmarks.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="hints.js"/>
|
||||
|
||||
Reference in New Issue
Block a user