diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 64d44ad2..b5e1da91 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -381,6 +381,13 @@ function Commands()//{{{ help: ":execute "echo test" would show a message with the text "test".
" } )); + addDefaultCommand(new Command(["exu[sage]"], + function () { help("commands"); }, + { + usage: ["exu[sage]"], + short_help: "Show help for Ex commands" + } + )); addDefaultCommand(new Command(["fo[rward]", "fw"], function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); }, { @@ -608,6 +615,22 @@ function Commands()//{{{ "Example: :tab help tab opens the help in a new tab." } )); + addDefaultCommand(new Command(["tabl[ast]"], + function(args, count) { vimperator.tabs.select("$", false); }, + { + usage: ["tabl[ast]"], + short_help: "Switch to the last tab" + } + )); + addDefaultCommand(new Command(["tabm[ove]"], + function(args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); }, + { + usage: ["tabm[ove] [N]", "tabm[ove][!] [+|-N]"], + short_help: "Move the current tab after tab N", + help: "When N is 0 the current tab is made the first one. Without N the current tab is made the last one. " + + "N can also be prefixed with '+' or '-' to indicate a relative movement. If ! is specified the movement wraps around the start or end of the tab list." + } + )); addDefaultCommand(new Command(["tabn[ext]", "tn[ext]"], function(args, special, count) { vimperator.tabs.select("+1", true); }, { @@ -616,6 +639,13 @@ function Commands()//{{{ help: "Cycles to the first tab, when the last is selected." } )); + addDefaultCommand(new Command(["tabo[nly]"], + function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); }, + { + usage: ["tabo[nly]"], + short_help: "Close all other tabs" + } + )); addDefaultCommand(new Command(["tabopen", "t[open]", "tabnew", "tabe[dit]"], function (args, special) { if (args.length > 0) openURLsInNewTab(args, !special); else openURLsInNewTab("about:blank", true); }, { @@ -626,22 +656,6 @@ function Commands()//{{{ completer: function (filter) { return get_url_completions(filter); } } )); - addDefaultCommand(new Command(["tabo[nly]"], - function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); }, - { - usage: ["tabo[nly]"], - short_help: "Close all other tabs" - } - )); - addDefaultCommand(new Command(["tabm[ove]"], - function(args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); }, - { - usage: ["tabm[ove] [N]", "tabm[ove][!] [+|-N]"], - short_help: "Move the current tab after tab N", - help: "When N is 0 the current tab is made the first one. Without N the current tab is made the last one. " + - "N can also be prefixed with '+' or '-' to indicate a relative movement. If ! is specified the movement wraps around the start or end of the tab list." - } - )); addDefaultCommand(new Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"], function(args, count) { vimperator.tabs.select("-1", true); }, { @@ -657,13 +671,6 @@ function Commands()//{{{ short_help: "Switch to the first tab" } )); - addDefaultCommand(new Command(["tabl[ast]"], - function(args, count) { vimperator.tabs.select("$", false); }, - { - usage: ["tabl[ast]"], - short_help: "Switch to the last tab" - } - )); addDefaultCommand(new Command(["u[ndo]"], function(args, special, count) { if(count < 1) count = 1; undoCloseTab(count-1); }, { @@ -706,6 +713,13 @@ function Commands()//{{{ help: "You can show the Firefox version page with :version!." } )); + addDefaultCommand(new Command(["viu[sage]"], + function () { help("mappings"); }, + { + usage: ["viu[sage]"], + short_help: "Show help for normal mode commands" + } + )); addDefaultCommand(new Command(["wino[pen]", "w[open]", "wine[dit]"], function () { vimperator.echo("winopen not yet implemented"); }, { diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js index a9d24e3f..55c7ea5b 100644 --- a/chrome/content/vimperator/completion.js +++ b/chrome/content/vimperator/completion.js @@ -253,7 +253,9 @@ function get_file_completions(filter)/*{{{*/ function get_help_completions(filter)/*{{{*/ { - var help_array = []; + var help_array = [[["mappings"], "Normal mode commands"], + [["commands"], "Ex commands"], + [["settings"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages' g_substrings = []; for (var command in vimperator.commands) { diff --git a/chrome/content/vimperator/default.css b/chrome/content/vimperator/default.css index fcd4a962..a0acd346 100644 --- a/chrome/content/vimperator/default.css +++ b/chrome/content/vimperator/default.css @@ -1,15 +1,25 @@ +div.main { + font-family: monospace; + font-size: 12px; + width: 800px; + margin-left: auto; + margin-right: auto; +} + +h1 { + text-align: center; +} + +p.tagline { + text-align: center; + font-weight: bold; +} + /* the text in the tables is too large without that */ table { font-size: 1.0em; } -table.main { - border-width: 0px; - border-style: none; - margin-left: auto; /* for centering the table */ - margin-right: auto; - width: 800px !important; -} table.vimperator { border-width: 1px 1px 1px 1px; border-style: dotted dotted dotted dotted; @@ -17,6 +27,7 @@ table.vimperator { margin-left: auto; /* for centering the table */ margin-right: auto; width: 800px !important; + white-space: -moz-pre-wrap !important; } table.vimperator td { border-width: 0px 0px 0px 0px; @@ -39,7 +50,7 @@ hr { /* horizontal lines */ td.tag { text-align: right; vertical-align: top; - white-space: -moz-pre-wrap !important; + /* white-space: -moz-pre-wrap !important; // DJK */ border-spacing: 13px 10px; border-width: 0px 10px 0px 10px; border-color: blue !important; @@ -72,21 +83,37 @@ table.settings { background-color: rgb(240, 250, 230); } +fieldset.paypal { + border: none; +} .command { font-weight: bold; color: #632610; } .mapping { font-weight: bold; color: #102663; } .setting { font-weight: bold; color: #106326; } .argument { color: #6A97D4; } -.version { position:absolute; top:10px; right:2%; color:#C0C0C0; text-align:right; } +.version { + position: absolute; + top: 10px; + right: 2%; + color: #C0C0C0; + text-align: right; +} +.warning { + font-weight: bold; + color: red; +} +.shorthelp { font-weight: bold; } .status_insecure, .status_insecure * { background-color: transparent; } .status_secure, .status_secure * { - background-color: #B0FF00; /* light green */ + background-color: yellow; color: black; } .status_broken, .status_broken * { - background-color: #FF6060; /* light red */ + background-color: #ff9900; color: black; } + +/* vim: set fdm=marker sw=4 ts=4 et: */ diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js index d6640f48..1dadbb70 100644 --- a/chrome/content/vimperator/help.js +++ b/chrome/content/vimperator/help.js @@ -41,12 +41,11 @@ function help(section, easter) // xxx: for firebug: :js Firebug.toggleBar(true) /* commands = array where help information is located - * color = used for background of the table * beg = string which is printed before the commmand/setting/mapping name * end = string which is printed after the commmand/setting/mapping name * func = called with 'command', result is a string is prepended to the help text */ - function makeHelpString(commands, color, beg, end, func) + function makeHelpString(commands, beg, end, func) { var ret = ""; for (var i=0; i < commands.length; i++) @@ -74,9 +73,9 @@ function help(section, easter) // the actual help text with the first line in bold if (commands[i][SHORTHELP]) { - ret += ""; + ret += ''; ret += commands[i][SHORTHELP]; // the help description - ret += "
"; + ret += "
"; if(func) // for settings whe print default values here, e.g. { ret += func.call(this, commands[i]); @@ -134,76 +133,80 @@ function help(section, easter) return ret; } - var header = '

Vimperator

\n' + - '

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 :)

\n'; + var header = '

Vimperator

\n' + + '

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 :)

\n'; - var introduction = '

Introduction

' + + var introduction = '

Introduction

' + '

Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor.
' + 'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.

\n' + - '

Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
'+ + '

Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
' + 'If you really need them, type: :set guioptions=mT to get it back.
\n' + - '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.

\n' + + '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.

\n' + - '

Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.
'+ - 'For best experience, I therefore recommend the Whitehart theme.

\n' + + '

Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.
' + + 'For best experience, I therefore recommend the Whitehart theme.

\n' + - '

Vimperator was written by Martin Stubenschrott. If you appreciate my work on Vimperator, you can either
'+ - 'send me greetings, patches or make a donation: \n' + + '

Vimperator was written by Martin Stubenschrott. If you appreciate my work on Vimperator, you can either send me greetings, patches or make a donation:

\n' + - '
' + + '\n
' + '' + - '' + + '' + - '' + + '' + '' + - '\n' + + '
\n\n' + - '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 :)

\n' + '

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 :)

\n' - var mappings = '

Mappings

\n'+ + var mappings = '

Mappings

\n' + '

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.

'+ - '

' + '
' // FIXME: fix this when Command() is added and help patch is merged -- djk var all_maps = []; for (var map in vimperator.mappings) all_maps.push([map.commands, [map.usage], map.short_help, map.help]) - mappings += makeHelpString(all_maps, "#102663", "", "", null); - mappings += '

'; + mappings += makeHelpString(all_maps, "", "", null); + mappings += ''; if (section && section == 'holy-grail') mappings += 'You found it, Arthur!\n'; - var commands = '

Commands

\n'; + var commands = '

Commands

\n' + + '
\n'; var all_commands = []; for (var command in vimperator.commands) all_commands.push([command.names, command.usage, command.short_help, command.help]); - commands += makeHelpString(all_commands, "#632610", ":", "", null); - commands += '

'; + commands += makeHelpString(all_commands, ":", "", null); + commands += ''; if (section && section == '42') commands += '

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...

\n'; - var settings = '

Settings

\n'; - settings += makeHelpString(g_settings, "#106326", "'", "'", makeSettingsHelpString); - settings += '

'; + var settings = '

Settings

\n' + + '\n'; + settings += makeHelpString(g_settings, "'", "'", makeSettingsHelpString); + settings += '
'; - var fulldoc = '\n\nVimperator help\n' + + var fulldoc = '\n' + + '\n' + + '\n\nVimperator help\n' + // XXX: stylesheet broken here? Have to add it in the vimperator.xul file - '\n'+ - '\n
\n
\n' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox - 'version ' + vimperator.ver + '\n'+ + '\n' + + '\n\n
\n' + + 'version ' + vimperator.ver + '\n' + header + introduction + mappings + commands + settings + - '\n
\n
\n'; + '\n\n\n'; var doc = window.content.document; + try { doc.open(); @@ -258,8 +261,9 @@ function help(section, easter) vimperator.echoerr("E149: Sorry, no help for " + section); return; } + // FIXME: H2 elements are currently wrapped in DIVs so this works var pos = cumulativeOffset(element.parentNode); - // horizontal offset is annyoing, set it to 0 (use pos[0] if you want horizontal offset) + // horizontal offset is annoying, set it to 0 (use pos[0] if you want horizontal offset) window.content.scrollTo(0, pos[1]); } } diff --git a/chrome/content/vimperator/mappings.js b/chrome/content/vimperator/mappings.js index b14b6862..08ac4d4f 100644 --- a/chrome/content/vimperator/mappings.js +++ b/chrome/content/vimperator/mappings.js @@ -516,14 +516,15 @@ function Mappings()//{{{ "E.g., if you want to yank the location of hint AB, press ; to start this hint mode.
" + "Then press AB to select the hint. Now press y to yank its location.
" + "Actions for selected hints in ExtendedHint mode are:
" + - "", + "
  • s: original Firefox statusbar
  • ", "charlist", null, function(value) { set_pref("guioptions", value); set_guioptions(value); }, @@ -235,10 +234,10 @@ var g_settings = [/*{{{*/ ["showstatuslinks", "ssli"], "Show the destination of the link under the cursor in the status bar", "Also links which are focused by keyboard commands like <Tab> are shown. "+ - "Possible values:
    "+ - "", + "Possible values:
    ", "number", null, function(value) { set_pref("showstatuslinks", value); }, @@ -250,10 +249,10 @@ var g_settings = [/*{{{*/ ["showtabline", "stal"], ["showtabline", "stal"], "Control when to show the tab bar of opened web pages", - "Possible values:
    "+ - ""+ + "Possible values:
    "+ "Not implemented yet.", "number", null, @@ -297,14 +296,14 @@ var g_settings = [/*{{{*/ "specifies the behavior for the first use of the completion key, the second part " + "for the second use, etc.
    " + "These are the possible values for each part:
    " + - "
    "+
    +        "
    "+ "" + "" + "" + "" + "" + "" + - "
    ''Complete only the first match
    'full'Complete the next full match. After the last, the original string is used.
    'longest'Complete till the longest common string.
    'list'When more than one match, list all matches.
    'list:full'When more than one match, list all matches and complete first match.
    'list:longest'When more than one match, list all matches and complete till the longest common string.
    " + + "" + "When there is only a single match, it is fully completed regardless of the case.", "stringlist", null, @@ -319,9 +318,9 @@ var g_settings = [/*{{{*/ "Change how command line completion is done", "A list of words that change how command line completion is done.
    "+ "Currently only one word is allowed:
    "+ - "
    "+
    +        "
    "+ "" + - "
    sortAlways sorts completion list, overriding the 'complete' option.
    ", + "", "stringlist", null, function(value) { set_pref("wildoptions", value); }, diff --git a/chrome/content/vimperator/vimperator.xul b/chrome/content/vimperator/vimperator.xul index 6374621f..514e4efd 100644 --- a/chrome/content/vimperator/vimperator.xul +++ b/chrome/content/vimperator/vimperator.xul @@ -30,7 +30,7 @@ the terms of any one of the MPL, the GPL or the LGPL. - +