diff --git a/chrome/content/vimperator/default.css b/chrome/content/vimperator/default.css index 75036dc3..716f9281 100644 --- a/chrome/content/vimperator/default.css +++ b/chrome/content/vimperator/default.css @@ -78,4 +78,4 @@ table.settings { .mapping { font-weight: bold; color: #102663; } .setting { font-weight: bold; color: #106326; } .argument { color: #6A97D4; } -.version { position:absolute; top:10px; right:2%; color:#B0B0B0; text-align:right; } +.version { position:absolute; top:10px; right:2%; color:#C0C0C0; text-align:right; } diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js index 6af725c5..e194215a 100644 --- a/chrome/content/vimperator/help.js +++ b/chrome/content/vimperator/help.js @@ -104,7 +104,7 @@ function help(section, easter) // add more space between entries if (i < commands.length-1) - ret += '
'; + ret += '
\\n'; } return ret; } @@ -131,24 +131,24 @@ function help(section, easter) return ret; } - var header = '

Vimperator

' + - '

First there was a Navigator, then there was an Explorer.
'+ - 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)

'; + 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

' + '

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.

' + + '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.
'+ - 'If you really need them, type: :set guioptions=mT to get it back.
' + + '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.

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

' + + '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: ' + + 'send me greetings, patches or make a donation: \\n' + '

' + '' + @@ -156,42 +156,42 @@ function help(section, easter) '' + '' + - '
' + + '\\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 :)

' + '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

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

'+ '

' mappings += makeHelpString(g_mappings, "#102663", "", "", null); mappings += '

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

Commands

' + var commands = '

Commands

\\n'; commands += makeHelpString(g_commands, "#632610", ":", "", 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...

'; + 'is...

\\n'; - var settings = '

Settings

' + var settings = '

Settings

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

'; - var fulldoc = 'Vimperator help' + + var fulldoc = '\\n\\nVimperator help\\n' + // XXX: stylesheet broken here? Have to add it in the vimperator.xul file - ''+ - '
' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox - 'version ' + g_vimperator_version + ''+ + '\\n'+ + '\\n
\\n
\\n' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox + 'version ' + g_vimperator_version + '\\n'+ header + introduction + mappings + commands + settings + - '
' + '\\n
\\n
\\n' doc.open(); diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index 2b139bed..5e369163 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -283,6 +283,11 @@ function onVimperatorKeypress(event)/*{{{*/ if (key == null) return false; + // XXX: ugly hack for now pass certain keys to firefox as they are without beeping + // also fixes key navigation in menus, etc. + if (key == "" || key == "" || key == "" || key == "" || key == "") + return false; + // XXX: for now only, later: input mappings if form element focused if (isFormElemFocused()) return false; @@ -968,15 +973,17 @@ function createCursorPositionString() function isFormElemFocused() { var elt = document.commandDispatcher.focusedElement; - if (elt == null) return false; + if (elt == null) + return false; - var tagName = elt.localName.toUpperCase(); + var tagname = elt.localName.toLowerCase(); + var type = elt.type.toLowerCase(); - if (tagName == "INPUT" || - tagName == "TEXTAREA" || - tagName == "SELECT" || - tagName == "BUTTON" || - tagName == "ISINDEX") + if ( (tagname == "input" && (type != "image")) || + tagname == "textarea" || +// tagName == "SELECT" || +// tagName == "BUTTON" || + tagname == "isindex") // isindex is deprecated one-line input box return true; return false;