/***** BEGIN LICENSE BLOCK ***** {{{
Version: MPL 1.1/GPL 2.0/LGPL 2.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
(c) 2006-2007: Martin Stubenschrott First there was a Navigator, then there was an Explorer. Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor. Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden. Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme. Vimperator was written by Martin Stubenschrott. If you appreciate my work on Vimperator, you can either';
for (var j=0; j < commands[i][USAGE].length; j++)
{
var usage = commands[i][USAGE][j];
// keep
//usage = usage.replace(/<([^b][^r].*>)/g, "<$1");
//usage = usage.replace(/[^b][^r][^\/]>/g, ">");
usage = usage.replace(//g, ">");
usage = usage.replace(/\\n/g, "
");
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
usage = usage.replace(/(^|;|\n|\s|\]|\}|=|
)({.*?}|\[.*?\])/gm, "$1$2");
// and the 'setting' in a different color
usage = usage.replace(/^'(\w+)'/gm, "'$1'");
ret += "" +beg+ usage +end+ '
';
}
ret += '';
// the actual help text with the first line in bold
if (commands[i][SHORTHELP])
{
ret += "";
ret += commands[i][SHORTHELP]; // the help description
ret += "
";
if(func) // for settings whe print default values here, e.g.
{
ret += func.call(this, commands[i]);
ret += "
";
}
if (commands[i][HELP])
ret += commands[i][HELP]; // the help description
}
else
ret += "Sorry, no help available";
// the tags which are printed on the top right
//ret += ' ';
// add more space between entries
if (i < commands.length-1)
ret += '====================================';
ret += ' ';
for (var j=0; j < commands[i][COMMANDS].length; j++)
{
var cmd_name = commands[i][COMMANDS][j];
cmd_name = cmd_name.replace(//g, ">");
ret += ' ' +beg+ cmd_name +end+ '
';
}
ret += ' ';
}
return ret;
}
function makeSettingsHelpString(command)
{
var ret = "";
ret = command[TYPE] + ' (default: ';
if (command[TYPE] == "boolean")
{
if(command[DEFAULT] == true)
ret += "on";
else
ret += "off";
}
else
{
if (typeof command[DEFAULT] == 'string' && command[DEFAULT].length == 0)
ret += "''";
else
ret += command[DEFAULT];
}
ret += ")
";
return ret;
}
var header = 'Vimperator
' +
'
'+
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)Introduction
' +
'
' +
'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.
'+
'If you really need them, type: :set guioptions=mT to get it back.
' +
'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
' +
'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.
'+
'For best experience, I therefore recommend the Whitehart theme.
'+
'send me greetings, patches or make a donation: ' +
'
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.
'+ 'What is the meaning of life, the universe and everything?
' +
'Douglas Adams, the only person who knew what this question really was about is
' +
'now dead, unfortunately. So now you might wonder what the meaning of death
' +
'is...
| ' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox header + introduction + mappings + commands + settings + ' |