From d6238f84a43b848b86bca5ba55b465fad9bdba73 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 25 Mar 2009 01:58:39 +0000 Subject: [PATCH 1/5] Treat strings containing / as URLs In lieu of getting proper hostname detection, allow localhost/ and other similar URLs to work. --- common/content/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/content/util.js b/common/content/util.js index 8ea3d22a..24a167e2 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -675,7 +675,7 @@ const util = { //{{{ // Ok, not a valid proto. If it looks like URL-ish (foo.com/bar), // let Gecko figure it out. - if (/[.]/.test(url) && !/\s/.test(url) || /^[\w-.]+:\d+(?:\/|$)/.test(url)) + if (/[.\/]/.test(url) && !/\s/.test(url) || /^[\w-.]+:\d+(?:\/|$)/.test(url)) return url; // TODO: it would be clearer if the appropriate call to From bda0c5bda592560fb131c832259be3ab6edfb3e1 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 26 Mar 2009 02:48:55 +0000 Subject: [PATCH 2/5] Fix #180. User can no-longer interrupt macros. Buffers any keystrokes recieved during a macro expansion and plays them after it has finished. --- common/content/events.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index 5e1b7e02..3c58afc2 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -898,6 +898,7 @@ function Events() //{{{ let wasFeeding = this.feedingKeys; this.feedingKeys = true; + this.duringFeed = this.duringFeed || ""; let wasSilent = commandline.silent; if (silent) commandline.silent = silent; @@ -993,6 +994,15 @@ function Events() //{{{ this.feedingKeys = wasFeeding; if (silent) commandline.silent = wasSilent; + + if (this.duringFeed != "") + { + //Create a scalar constant for closure. + let duringFeed = this.duringFeed; + this.duringFeed = ""; + + setTimeout(function () events.feedkeys(duringFeed, false, false, true), 0); + } } return i == keys.length; }, @@ -1370,9 +1380,9 @@ function Events() //{{{ // we can differentiate between a recorded // interrupting whatever it's started and a real // interrupting our playback. - if (events.feedingKeys) + if (events.feedingKeys && !event.isMacro) { - if (key == "" && !event.isMacro) + if (key == "") { events.feedingKeys = false; if (modes.isReplaying) @@ -1384,6 +1394,13 @@ function Events() //{{{ event.stopPropagation(); return true; } + else + { + events.duringFeed += key; + event.preventDefault(); + event.stopPropagation(); + return true; + } } let stop = true; // set to false if we should NOT consume this event but let Firefox handle it From 4282b07d77372c549efd6ec8209d7a6be2aaacdb Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 26 Mar 2009 03:11:17 +0000 Subject: [PATCH 3/5] Fix uploading of files by relative path name. Use io.getFile(path).path instead of just path in order to create an absolute path. --- common/content/buffer.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 4cd9fdeb..a9cb4831 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1021,7 +1021,16 @@ function Buffer() //{{{ } else if (elemTagName == "input" && elem.getAttribute('type').toLowerCase() == "file") { - commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value}); + commandline.input("Upload file: ", function (path) + { + let file = io.getFile(path); + + if (!file.exists()) + return liberator.beep(); + + elem.value = file.path; + } + , {completer: completion.file, default: elem.value}); return; } @@ -1131,7 +1140,16 @@ function Buffer() //{{{ } else if (localName == "input" && elem.getAttribute('type').toLowerCase() == "file") { - commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value}); + commandline.input("Upload file: ", function (path) + { + let file = io.getFile(path); + + if (!file.exists()) + return liberator.beep(); + + elem.value = file.path; + } + , {completer: completion.file, default: elem.value}); return; } From 702f8f9a3eceeb9729f95ac6a793c45c72eed85e Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Thu, 26 Mar 2009 09:34:10 +0200 Subject: [PATCH 4/5] Doc fixes (thanks Xie&Tian) --- vimperator/AUTHORS | 2 +- vimperator/locale/en-US/browsing.txt | 2 +- vimperator/locale/en-US/buffer.txt | 26 +++++++++++++------------- vimperator/locale/en-US/eval.txt | 2 +- vimperator/locale/en-US/gui.txt | 4 ++-- vimperator/locale/en-US/index.txt | 8 ++++---- vimperator/locale/en-US/map.txt | 2 +- vimperator/locale/en-US/marks.txt | 4 ++-- vimperator/locale/en-US/options.txt | 10 +++++----- vimperator/locale/en-US/repeat.txt | 2 +- vimperator/locale/en-US/tutorial.txt | 2 +- vimperator/locale/en-US/various.txt | 6 +++--- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/vimperator/AUTHORS b/vimperator/AUTHORS index 7f809a95..d2ec10d5 100644 --- a/vimperator/AUTHORS +++ b/vimperator/AUTHORS @@ -19,7 +19,7 @@ Inactive/former developers: Patches (in no special order): * Ruud Grosmann ('followhints' option) - * Xie&Tian (multibyte support for hints) + * Xie&Tian (multibyte support for hints, doc fixes) * Juergen Descher * Kazuo (count support for ctrl-^) * Daniel Schaffrath (;b support) diff --git a/vimperator/locale/en-US/browsing.txt b/vimperator/locale/en-US/browsing.txt index c2a7dbba..95a4cbe4 100644 --- a/vimperator/locale/en-US/browsing.txt +++ b/vimperator/locale/en-US/browsing.txt @@ -51,7 +51,7 @@ Each token is analyzed and in this order: to set a custom name, you can change it with [c]:dialog searchengines[c]. 3. Opened with the default search engine or keyword (specified with the 'defsearch' option) if the first word is no search engine ([c]:open linus - torvalds[c] opens a Google search for linux torvalds). + torvalds[c] opens a Google search for linus torvalds). 4. Passed directly to Firefox in all other cases ([c]:open www.osnews.com, www.slashdot.org[c] opens OSNews in the current, and Slashdot in a new background tab). diff --git a/vimperator/locale/en-US/buffer.txt b/vimperator/locale/en-US/buffer.txt index 95d6bab0..0fe91f6e 100644 --- a/vimperator/locale/en-US/buffer.txt +++ b/vimperator/locale/en-US/buffer.txt @@ -123,6 +123,16 @@ set). ________________________________________________________________________________ +|| |l| + +||[count]l|| +________________________________________________________________________________ +Scroll document to the right. If [count] is specified then move [count] times +as much to the right. + +If the document cannot scroll more, a beep is emitted (unless 'visualbell' is +set). +________________________________________________________________________________ + + || + ||[count]|| ________________________________________________________________________________ @@ -141,16 +151,6 @@ first set to this value. ________________________________________________________________________________ -|| |l| + -||[count]l|| -________________________________________________________________________________ -Scroll document to the right. If [count] is specified then move [count] times -as much to the right. + -If the document cannot scroll more, a beep is emitted (unless 'visualbell' is -set). -________________________________________________________________________________ - - || || || + ||[count]|| ________________________________________________________________________________ @@ -235,7 +235,7 @@ default zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%, The available zoom range can be changed by setting the \'http://kb.mozillazine.org/Zoom.minPercent[zoom.minPercent]' and -\'http://kb.mozillazine.org/Zoom.minPercent[zoom.maxPercent]' Firefox +\'http://kb.mozillazine.org/Zoom.maxPercent[zoom.maxPercent]' Firefox preferences. The zoom levels can be changed using the \'http://kb.mozillazine.org/Toolkit.zoomManager.zoomValues[toolkit.ZoomManager.zoomLevels]' preference. @@ -274,7 +274,7 @@ ________________________________________________________________________________ |zz| + ||[count]zz|| ________________________________________________________________________________ -Set text zoom value of current web page. Zoom value can be between 30 and 300%. +Set text zoom value of current web page. Zoom value can be between 30% and 300%. If it is omitted, text zoom is reset to 100%. ________________________________________________________________________________ @@ -320,7 +320,7 @@ ________________________________________________________________________________ ||:zo[om][!] +{value} | -{value}|| + ________________________________________________________________________________ Set zoom value of current web page. [a][value][a] can be an absolute value -between 30 and 300% or a relative value if prefixed with "-" or "+". If +between 30% and 300% or a relative value if prefixed with "-" or "+". If [a][value][a] is omitted, zoom is reset to 100%. Normally this command operates on the text zoom, if used with [!] it operates diff --git a/vimperator/locale/en-US/eval.txt b/vimperator/locale/en-US/eval.txt index 17c71dda..bbc0d5ba 100644 --- a/vimperator/locale/en-US/eval.txt +++ b/vimperator/locale/en-US/eval.txt @@ -70,7 +70,7 @@ ________________________________________________________________________________ ________________________________________________________________________________ Sets or lists a variable. Sets the variable {var-name} to the value of the expression {expr1}. If no expression is given, the value of the variable is -displayed.Without arguments, displays a list of all variables. +displayed. Without arguments, displays a list of all variables. ________________________________________________________________________________ diff --git a/vimperator/locale/en-US/gui.txt b/vimperator/locale/en-US/gui.txt index 4da826c5..bec1f78b 100644 --- a/vimperator/locale/en-US/gui.txt +++ b/vimperator/locale/en-US/gui.txt @@ -20,7 +20,7 @@ ________________________________________________________________________________ |:addo| |:addons| + ||:addo[ns]|| ________________________________________________________________________________ -Show available Browser Extensions and Themes. +Show available browser Extensions and Themes. You can add/remove/disable browser extensions from this dialog. Be aware that not all Firefox extensions work, because Vimperator overrides some key bindings and changes Firefox's GUI. @@ -34,7 +34,7 @@ Open a Firefox dialog. Available dialogs: `------------------`----------------------------------- -*about* About Firefox +*about* About Mozilla Firefox *addbookmark* Add bookmark for the current page *addons* Manage Add-ons *bookmarks* List your bookmarks diff --git a/vimperator/locale/en-US/index.txt b/vimperator/locale/en-US/index.txt index 5a6a2fbb..085792e3 100644 --- a/vimperator/locale/en-US/index.txt +++ b/vimperator/locale/en-US/index.txt @@ -170,7 +170,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:delmarks[c]|| Delete the specified marks + ||[c]:delqmarks[c]|| Delete the specified QuickMarks + ||[c]:delstyle[c]|| Delete any matching styles + -||[c]:dialog[c]|| Open a undefined dialog + +||[c]:dialog[c]|| Open a Firefox dialog + ||[c]:doautoall[c]|| Apply the autocommands matching the specified URL to all buffers + ||[c]:doautocmd[c]|| Apply the autocommands matching the specified URL to the current buffer + ||[c]:downloads[c]|| Show progress of current downloads + @@ -217,11 +217,11 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:qmark[c]|| Mark a URL with a letter for quick access + ||[c]:qmarks[c]|| Show all QuickMarks + ||[c]:quit[c]|| Quit current tab + -||[c]:quitall[c]|| Quit undefined + +||[c]:quitall[c]|| Quit Vimperator + ||[c]:redraw[c]|| Redraw the screen + ||[c]:reload[c]|| Reload current page + ||[c]:reloadall[c]|| Reload all tab pages + -||[c]:restart[c]|| Force undefined to restart + +||[c]:restart[c]|| Force the browser to restart + ||[c]:runtime[c]|| Source the specified file from each directory in 'runtimepath' + ||[c]:saveas[c]|| Save current document to disk + ||[c]:sbclose[c]|| Close the sidebar window + @@ -261,7 +261,7 @@ section:Options[option-index] ||'activate'|| Define when tabs are automatically activated + ||'cdpath'|| List of directories searched when executing [c]:cd[c] + -||'complete'|| Items which are completed at the [c]:[tab]open prompt[c] + +||'complete'|| Items which are completed at the [c]:[tab]open[c] prompt + ||'defsearch'|| Set the default search engine + ||'editor'|| Set the external text editor + ||'errorbells'|| Ring the bell when an error message is displayed + diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt index 6dce047a..b1073ffe 100644 --- a/vimperator/locale/en-US/map.txt +++ b/vimperator/locale/en-US/map.txt @@ -346,7 +346,7 @@ Custom completion Custom completion can be provided by specifying the "custom,{func}" argument to -complete. The {func} is called with two arguments, a completion context, and an object describing the command's arguments. It should set the context's -\'completions' property, or return an object, with \'start' and \'items' +\'completions' property, or return an object, with \'items' and \'start' properties, describing the completions and where the replacement is to start. *start* is the index into the word being completed at which the returned values diff --git a/vimperator/locale/en-US/marks.txt b/vimperator/locale/en-US/marks.txt index 837268be..7a6e1239 100644 --- a/vimperator/locale/en-US/marks.txt +++ b/vimperator/locale/en-US/marks.txt @@ -80,7 +80,7 @@ section:History[history] ||[count]|| ________________________________________________________________________________ Go to an older position in the jump list. The jump list is just the browser -history for now. +history for now. If [count] is specified go back [count] pages. ________________________________________________________________________________ @@ -88,7 +88,7 @@ ________________________________________________________________________________ ||[count]|| ________________________________________________________________________________ Go to a newer position in the jump list. The jump list is just the browser -history for now. +history for now. If [count] is specified go forward [count] pages. ________________________________________________________________________________ diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index bf042502..c434cb79 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -252,7 +252,7 @@ Sets the default search engine. The default search engine name is used in the [c]:[tab]open [arg][c] command if [a][arg][a] neither looks like a URL or like a specified search engine/keyword. -This means, it you set 'defsearch' to "youtube", then [c]:open arnold +This means, if you set 'defsearch' to "youtube", then [c]:open arnold schwarzenegger[c] will be exactly the same as [c]:open youtube arnold schwarzenegger[c]. Therefore, you need to add a keyword or search engine "youtube" first. @@ -472,7 +472,7 @@ ____ |\'nolpl'| |\'lpl'| |\'noloadplugins'| |\'loadplugins'| -||'loadplugins' 'lpl'|| boolean (default on) +||'loadplugins' 'lpl'|| boolean (default: on) ____ Load plugin scripts when starting up. When on, yet unloaded plugins are automatically loaded after the vimperatorrc file has been sourced. To @@ -527,7 +527,7 @@ ____ |\'noonline'| |\'online'| -||'online'|| boolean (default on) +||'online'|| boolean (default: on) ____ Show and set the \'work offline' behavior. ____ @@ -571,7 +571,7 @@ ____ |\'nopreload'| |\'preload'| ||'preload' 'nopreload'|| boolean (default: on) ____ -Speed up first time history/bookmark completion +Speed up first time history/bookmark completion. History access can be quite slow for a large history. Vimperator maintains a cache to speed it up significantly on subsequent access. @@ -751,7 +751,7 @@ ____ |\'wildcase'| |\'wic'| ||'wildcase' 'wic'|| string (default: "smart") ____ -Defines how completions are matched with regard to character case. +Defines how completions are matched with regard to character case. Possible values: `---------------`------------------------ "smart" Case is significant when capital letters are typed diff --git a/vimperator/locale/en-US/repeat.txt b/vimperator/locale/en-US/repeat.txt index 975cbea7..8d1adb3a 100644 --- a/vimperator/locale/en-US/repeat.txt +++ b/vimperator/locale/en-US/repeat.txt @@ -132,7 +132,7 @@ section:Profiling[profile,profiling] |:time| ||:[count]time[!] {code|:command}|| + ________________________________________________________________________________ -Profile a piece of code or a command. Run {code} [count] times (default 1) +Profile a piece of code or a command. Run {code} [count] times (default: 1) and returns the elapsed time. {code} is always passed to JavaScript's eval(), which might be slow, so take the results with a grain of salt. diff --git a/vimperator/locale/en-US/tutorial.txt b/vimperator/locale/en-US/tutorial.txt index 21b5e285..f85af34f 100644 --- a/vimperator/locale/en-US/tutorial.txt +++ b/vimperator/locale/en-US/tutorial.txt @@ -57,7 +57,7 @@ Similarly, help on configurable options is available with [c]:help '{option_name}'[c]. (Note the single quotes around the option name as in Vim.) Information on all available options is, predictably, [c]:help options[c]. -and you can find out about the [m]gt[m] and [m]gT[m] mapping with +And you can find out about the [m]gt[m] and [m]gT[m] mapping with \{nbsp}[c]:help gt[c] + \{nbsp}[c]:help gT[c] diff --git a/vimperator/locale/en-US/various.txt b/vimperator/locale/en-US/various.txt index 79d485dc..7110495f 100644 --- a/vimperator/locale/en-US/various.txt +++ b/vimperator/locale/en-US/various.txt @@ -11,9 +11,9 @@ ________________________________________________________________________________ || |CTRL-L| |:redr| |:redraw| + ||:redr[aw]|| -____ +________________________________________________________________________________ Redraws the screen. Useful to update the screen halfway executing a script or function. -____ +________________________________________________________________________________ |:norm| |:normal| ||:norm[al][!] {commands}|| + @@ -54,7 +54,7 @@ ________________________________________________________________________________ Open help window. The default page, as specified by 'helpfile' is shown unless [a][subject][a] is specified. If you need help for a specific topic, try [c]:help overview[c]. -____________________________________________________________________________ +________________________________________________________________________________ |:exu| |:exusage| + From 26fec12cade6cf62a3e30b8d51fbb8c1b20c6018 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 27 Mar 2009 13:31:31 +1100 Subject: [PATCH 5/5] Fix #204. Fixes #204 (statusbar should follow "site identification button" color codes). --- common/content/events.js | 11 +++++++---- common/content/style.js | 7 ++++--- common/content/ui.js | 4 +++- vimperator/locale/en-US/styling.txt | 1 + 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index 3c58afc2..51d1ecb8 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1684,13 +1684,16 @@ function Events() //{{{ } }, // for notifying the user about secure web pages - onSecurityChange: function (webProgress, aRequest, aState) + onSecurityChange: function (webProgress, request, state) { - if (aState & Ci.nsIWebProgressListener.STATE_IS_INSECURE) + // TODO: do something useful with STATE_SECURE_MED and STATE_SECURE_LOW + if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE) statusline.setClass("insecure"); - else if (aState & Ci.nsIWebProgressListener.STATE_IS_BROKEN) + else if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN) statusline.setClass("broken"); - else if (aState & Ci.nsIWebProgressListener.STATE_IS_SECURE) + else if (state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) + statusline.setClass("extended"); + else if (state & Ci.nsIWebProgressListener.STATE_SECURE_HIGH) statusline.setClass("secure"); }, onStatusChange: function (webProgress, request, status, message) diff --git a/common/content/style.js b/common/content/style.js index d994dbd6..24a05657 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -71,9 +71,10 @@ Highlights.prototype.CSS =