From f82b03f7961164a179ac75a092ddbe3607a25530 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 1 Mar 2009 02:49:18 +1100 Subject: [PATCH 01/20] Fix escaped path separator in messages on Windows. --- common/content/events.js | 2 +- common/content/io.js | 22 +++++++++++----------- common/content/liberator.js | 6 +++--- vimperator/TODO | 2 -- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index 3c9db52a..6c655cf7 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -639,7 +639,7 @@ function Events() //{{{ { for (let [,dir] in Iterator(dirs)) { - liberator.echomsg('Searching for "macros/*" in ' + dir.path.quote(), 2); + liberator.echomsg('Searching for "macros/*" in "' + dir.path + '"', 2); liberator.log("Sourcing macros directory: " + dir.path + "...", 3); diff --git a/common/content/io.js b/common/content/io.js index 4acb103c..ef3c3abd 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -250,7 +250,7 @@ function IO() //{{{ if (!found) { - liberator.echoerr("E344: Can't find directory " + arg.quote() + " in cdpath\n" + liberator.echoerr("E344: Can't find directory \"" + arg + "\" in cdpath\n" + "E472: Command failed"); } } @@ -283,7 +283,7 @@ function IO() //{{{ if (file.exists() && !args.bang) { - liberator.echoerr("E189: " + filename.quote() + " exists (add ! to override)"); + liberator.echoerr("E189: \"" + filename + "\" exists (add ! to override)"); return; } @@ -302,7 +302,7 @@ function IO() //{{{ } catch (e) { - liberator.echoerr("E190: Cannot open " + filename.quote() + " for writing"); + liberator.echoerr("E190: Cannot open \"" + filename + "\" for writing"); liberator.log("Could not write to " + file.path + ": " + e.message); // XXX } }, @@ -524,7 +524,7 @@ function IO() //{{{ if (!dir.exists() || !dir.isDirectory()) { - liberator.echoerr("E344: Can't find directory " + dir.path.quote() + " in path"); + liberator.echoerr("E344: Can't find directory \"" + dir.path + "\" in path"); return null; } @@ -842,7 +842,7 @@ lookup: let found = false; // FIXME: should use original arg string - liberator.echomsg("Searching for " + paths.join(" ").quote() + " in " + options["runtimepath"].quote(), 2); + liberator.echomsg("Searching for \"" + paths.join(" ") + "\" in \"" + options["runtimepath"] + "\"", 2); outer: for (let [,dir] in Iterator(dirs)) @@ -851,7 +851,7 @@ lookup: { let file = joinPaths(dir, path); - liberator.echomsg("Searching for " + file.path.quote(), 3); + liberator.echomsg("Searching for \"" + file.path + "\"", 3); if (file.exists() && file.isFile() && file.isReadable()) { @@ -865,7 +865,7 @@ lookup: } if (!found) - liberator.echomsg("not found in 'runtimepath': " + paths.join(" ").quote(), 1); // FIXME: should use original arg string + liberator.echomsg("not found in 'runtimepath': \"" + paths.join(" ") + "\"", 1); // FIXME: should use original arg string return found; }, @@ -892,9 +892,9 @@ lookup: if (!silent) { if (file.exists() && file.isDirectory()) - liberator.echomsg("Cannot source a directory: " + filename.quote(), 0); + liberator.echomsg("Cannot source a directory: \"" + filename + "\"", 0); else - liberator.echomsg("could not source: " + filename.quote(), 1); + liberator.echomsg("could not source: \"" + filename + "\"", 1); liberator.echoerr("E484: Can't open file " + filename); } @@ -902,7 +902,7 @@ lookup: return; } - liberator.echomsg("sourcing " + filename.quote(), 2); + liberator.echomsg("sourcing \"" + filename + "\"", 2); let str = self.readFile(file); let uri = services.get("io").newFileURI(file); @@ -1012,7 +1012,7 @@ lookup: if (scriptNames.indexOf(file.path) == -1) scriptNames.push(file.path); - liberator.echomsg("finished sourcing " + filename.quote(), 2); + liberator.echomsg("finished sourcing \"" + filename + "\"", 2); liberator.log("Sourced: " + filename, 3); } diff --git a/common/content/liberator.js b/common/content/liberator.js index 7135755e..9433eab8 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1029,11 +1029,11 @@ const liberator = (function () //{{{ return; } - liberator.echomsg('Searching for "plugin/**/*.{js,vimp}" in ' - + [dir.path.replace(/.plugin$/, "") for each (dir in dirs)].join(",").quote(), 2); + liberator.echomsg('Searching for "plugin/**/*.{js,vimp}" in "' + + [dir.path.replace(/.plugin$/, "") for each (dir in dirs)].join(",") + '"', 2); dirs.forEach(function (dir) { - liberator.echomsg("Searching for " + (dir.path + "/**/*.{js,vimp}").quote(), 3); + liberator.echomsg("Searching for \"" + (dir.path + "/**/*.{js,vimp}") + "\"", 3); sourceDirectory(dir); }); }, diff --git a/vimperator/TODO b/vimperator/TODO index cfe79cf4..1a7dc341 100644 --- a/vimperator/TODO +++ b/vimperator/TODO @@ -37,8 +37,6 @@ BUGS: - completion height is broken, try :a...., when it wraps it's totally off. and even if it is not totally off, i had it jump by one pixel when wrapping around. If that's unfixable, i propose reverting the new completion height stuff. -- Windows paths have escaped backslashes in messages - presumably due to - String#quote change. - :messages is _very_ slow for message history of several thousand lines -> Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere) - :hardcopy! seems to be broken for me From 3c3f6c1ee909f1569106aa952f3eeebe39a0dd11 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Sat, 28 Feb 2009 12:46:47 +0100 Subject: [PATCH 02/20] added/updated Donor names --- vimperator/Donors | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vimperator/Donors b/vimperator/Donors index 638ede86..e94055cb 100644 --- a/vimperator/Donors +++ b/vimperator/Donors @@ -2,10 +2,12 @@ Continuous donations: * Daniel Bainton (web hosting) 2009: +* Gavin Sinclair +* Stephen Borchert * Convolution * Brian Hall * Daniel Hahler -* Per-Henrik Persson +* Per-Henrik Lundblom * David C Foor * Oliver Schaefer * Paul Moss From 226e7e6add1bad127bc3d82bfa590e9f5c27b8c8 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 1 Mar 2009 02:59:08 +1100 Subject: [PATCH 03/20] Remove a trailing comma from an object literal. --- common/content/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index 6fdf8239..b006d116 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -1210,7 +1210,7 @@ function CommandLine() //{{{ submit: callback, change: extra.onChange, complete: extra.completer, - cancel: extra.onCancel, + cancel: extra.onCancel }; modes.push(modes.COMMAND_LINE, modes.PROMPT); @@ -1710,7 +1710,7 @@ function ItemList(id) //{{{ if (!iframe) { liberator.log("No iframe with id: " + id + " found, strange things may happen!"); // "The truth is out there..." -- djk - return; + return; // XXX } function dom(xml, map) util.xmlToDom(xml, doc, map); From 4cd6c1b271966e01761a9dd2b607486e3488ae4f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 1 Mar 2009 04:27:31 +1100 Subject: [PATCH 04/20] Explicitly describe how to disable all bells in 'vb' help. --- vimperator/locale/en-US/options.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index a16aa9f6..64073f7b 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -738,6 +738,9 @@ ____ ____ Use visual bell instead of beeping on errors. The visual bell style is controlled by [c]:hi Bell[c]. + +To disable both the audible and visual bells use [c]:set visualbell[c] and +[c]:hi Bell display: none;[c] ____ From 614ab6082ca53cc6a7464022621a32f19b38bc61 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 3 Mar 2009 00:14:37 +1100 Subject: [PATCH 05/20] Fix ;t and ;b extended hint modes in the MOW. --- common/content/ui.js | 79 +++++++++++++++++++++++--------------------- vimperator/TODO | 12 +++---- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index b006d116..cdfee132 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -1412,25 +1412,53 @@ function CommandLine() //{{{ let closeWindow = false; let passEvent = false; - function isScrollable() !win.scrollMaxY == 0; - function atEnd() win.scrollY / win.scrollMaxY >= 1; + let key = events.toString(event); - if (event.type == "click") + // TODO: Wouldn't multiple handlers be cleaner? --djk + if (event.type == "click" && event.target instanceof HTMLAnchorElement) { - if (event.target instanceof HTMLAnchorElement && event.button < 2) + function openLink(where) { event.preventDefault(); - let target = event.button == 0 ? liberator.CURRENT_TAB : liberator.NEW_TAB; + // FIXME: Why is this needed? --djk if (event.target.getAttribute("href") == "#") - liberator.open(event.target.textContent, target); + liberator.open(event.target.textContent, where); else - liberator.open(event.target.href, target); + liberator.open(event.target.href, where); } + + switch (key) + { + case "": + // FIXME: the :ls output no longer wraps the buffer URL in an anchor element + if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list") + { + event.preventDefault(); + tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1); + } + else + { + openLink(liberator.CURRENT_TAB); + } + break; + case "": + case "": + case "": + openLink(liberator.NEW_BACKGROUND_TAB); + break; + case "": + case "": + case "": + openLink(liberator.NEW_TAB); + break; + case "": + openLink(liberator.NEW_WINDOW); + break; + } + return; } - let key = events.toString(event); - if (startHints) { statusline.updateInputBuffer(""); @@ -1439,6 +1467,9 @@ function CommandLine() //{{{ return; } + function isScrollable() !win.scrollMaxY == 0; + function atEnd() win.scrollY / win.scrollMaxY >= 1; + switch (key) { case "": @@ -1488,34 +1519,6 @@ function CommandLine() //{{{ break; // TODO: on the prompt line should scroll one page - case "": - if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list") - { - tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1); - closeWindow = true; - break; - } - else if (event.originalTarget.localName.toLowerCase() == "a") - { - liberator.open(event.originalTarget.textContent); - break; - } - case "": // for those not owning a 3-button mouse - case "": - if (event.originalTarget.localName.toLowerCase() == "a") - { - let where = /\btabopen\b/.test(options["activate"]) ? - liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB; - liberator.open(event.originalTarget.textContent, where); - } - break; - - // let Firefox handle those to select table cells or show a context menu - case "": - case "": - case "": - break; - // page down case "f": if (options["more"] && isScrollable()) @@ -1606,7 +1609,7 @@ function CommandLine() //{{{ if (passEvent) events.onKeyPress(event); } - else // set update the prompt string + else { commandline.updateMorePrompt(showMorePrompt, showMoreHelpPrompt); } diff --git a/vimperator/TODO b/vimperator/TODO index 1a7dc341..be67703e 100644 --- a/vimperator/TODO +++ b/vimperator/TODO @@ -17,7 +17,6 @@ BUGS: - insert abbreviations broken on - :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar) - ;s saves the page rather than the image -- http://cgiirc.blitzed.org?chan=%23debug is unusable after login in - "g<" fails without a trailing escape because both "g<" and "g" are mapped. Vimp should recognize "" as an atom that should not be matched literally. In fact, typing "g" out literally is @@ -33,14 +32,13 @@ BUGS: => it often overwrites the open command line while editing etc. - and autocmd 'keywords' are not available when adding a bookmark - they're being set after the observer triggers the autocmd event. -- MOW rendering is broken for multiple commands when open E.g. :ls | ls -- completion height is broken, try :a...., when it wraps it's totally off. - and even if it is not totally off, i had it jump by one pixel when wrapping around. - If that's unfixable, i propose reverting the new completion height stuff. +- MOW rendering is broken for multiple commands when open (E.g. :ls | ls) This + appears to be the result of using the Message class when appending multiline + output to an open MOW. - :messages is _very_ slow for message history of several thousand lines -> Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere) -- :hardcopy! seems to be broken for me -- some extended hint commands aren't working in the MOW (;; ;t ;b ;? ;F) +- The MOW shouldn't close when executing hints and ;F isn't working. +- URLs in :ls output are no longer hyperlinks FEATURES: 9 finish :help TODOs From 866940886d4f73779ec07c5a55b207f261bafeea Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 3 Mar 2009 00:51:38 +1100 Subject: [PATCH 06/20] Set the href of links in the output of :jumps to the actual URL. template.highlightURL should probably have the same change applied but I'm not sure of the intent there. --- common/content/template.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/content/template.js b/common/content/template.js index b4f14bfd..ea6cf3a1 100644 --- a/common/content/template.js +++ b/common/content/template.js @@ -224,6 +224,7 @@ const template = { return s + <>{str.substr(start)}; }, + // FIXME: why is href="#"? highlightURL: function highlightURL(str, force) { if (force || /^[a-zA-Z]+:\/\//.test(str)) @@ -263,7 +264,7 @@ const template = { {idx == index ? ">" : ""} {Math.abs(idx - index)} {val.title} - {val.URI.spec} + {val.URI.spec} ) } ); From 0c8045d134711c87bd496c252e730f0031af236d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 3 Mar 2009 02:37:11 +1100 Subject: [PATCH 07/20] Remove TODO item regarding 'flashblock' query return value. The problem lies with the plugin. The 'flashblock' setter is returning a string rather than a boolean. --- vimperator/TODO | 2 -- 1 file changed, 2 deletions(-) diff --git a/vimperator/TODO b/vimperator/TODO index be67703e..c2175204 100644 --- a/vimperator/TODO +++ b/vimperator/TODO @@ -23,8 +23,6 @@ BUGS: equivalent to typing "g" and then . (recent CVS regressions): -- :set noflashblock seems broken (= :set fb? afterwards says "fb"), let's see if that's a - plugin or a vimp issue. - visual caret mode is broken, requires a manual page focus first anyway or else it chucks, I haven't investigated --djk - messages is still broken in several ways - needs testing. From 00458601b58d3e74c14db3048a88d51c240d40e5 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 3 Mar 2009 03:01:20 +1100 Subject: [PATCH 08/20] Document the "h" value of 'cpt' (#168). --- vimperator/locale/en-US/options.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index 64073f7b..3ef438a5 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -233,11 +233,15 @@ Items which are completed at the [c]:[tab]open[c] prompt. Available items: *f* Local files *l* Firefox location bar entries (bookmarks and history sorted in an intelligent way) *b* Bookmarks +*h* History *S* Suggest engines ------------------------------------------------------------------------------------- The order is important, so [c]:set complete=bs[c] would list bookmarks first, and then any available quick searches. + +Warning: Using *b* and *h* can make completion very slow if there are many +items. ____ From 8e85219443de76cca3ecb4de897b4422471d1be1 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Tue, 3 Mar 2009 15:53:42 +0200 Subject: [PATCH 09/20] Fix vimperator for the latest firefox nightlies --- common/content/completion.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 9cd8010a..61bee794 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -658,7 +658,6 @@ CompletionContext.prototype = { this.tabPressed = false; this.title = ["Completions"]; this.updateAsync = false; - this.waitingForTab = false; this.cancelAll(); @@ -677,7 +676,6 @@ CompletionContext.prototype = { for each (let context in this.contexts) { context.hasItems = false; - context.incomplete = false; } }, From 1e7158b3978e81a46ce64d771554a7c27bfa372f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 4 Mar 2009 17:10:20 +1100 Subject: [PATCH 10/20] Fix accessing help topics on the current help page. Only those beneath the current page position were accessible. --- vimperator/locale/en-US/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/locale/en-US/help.js b/vimperator/locale/en-US/help.js index ece4273f..27413a00 100644 --- a/vimperator/locale/en-US/help.js +++ b/vimperator/locale/en-US/help.js @@ -6,7 +6,7 @@ function checkFragment() return; let elem = document.evaluate('//*[@class="tag" and text()="' + frag + '"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0); if (elem) - window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context + window.content.scrollTo(0, window.content.scrollY + elem.getBoundingClientRect().top - 10); // 10px context } document.addEventListener("load", checkFragment, true); From 033aab5e5a5a1cce6b1bb7fca3c6494d29ee6689 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 4 Mar 2009 20:28:55 +1100 Subject: [PATCH 11/20] Trivial help formatting improvements. --- vimperator/locale/en-US/map.txt | 4 ++-- vimperator/locale/en-US/styling.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt index 4e9af03a..449f5b78 100644 --- a/vimperator/locale/en-US/map.txt +++ b/vimperator/locale/en-US/map.txt @@ -8,7 +8,7 @@ The key mapping commands can be used to either redefine the standard key bindings or define new ones. A mapping consists of a key, or sequence of keys, which are translated to a string of characters. Example: - :map :echo new Date().toDateString() +\{nbsp}[c]:map :echo new Date().toDateString()[c] will echo the current date to the command line when [m][m] is pressed. @@ -406,7 +406,7 @@ section:Examples[command-examples] Add a :Google command to search via google: - :command -nargs=* Google open google +\{nbsp}[c]:command -nargs=* Google open google [c] // TODO: add decent examples diff --git a/vimperator/locale/en-US/styling.txt b/vimperator/locale/en-US/styling.txt index bf1c6515..62138ea9 100644 --- a/vimperator/locale/en-US/styling.txt +++ b/vimperator/locale/en-US/styling.txt @@ -105,7 +105,7 @@ ________________________________________________________________________________ Add CSS styles to the browser or to web pages. {filter} is a comma separated list of URLs to match. URLs ending with *\** are matched as prefixes, URLs not containing any *:* or */* characters are -matched as domains. If {name} (short option: [c]-n[c]) is provided, any +matched as domains. If {name} (short option: *-n*) is provided, any existing style with the same name is overridden, and the style may later be deleted using {name}. If *-append* (short option: *-a*) is provided along with *-name*, {css} and {filter} are appended to its current @@ -118,9 +118,9 @@ ________________________________________________________________________________ ||:dels[tyle] [-name={name}] [-index={index}] [{filter}] [{css}]|| + ________________________________________________________________________________ Delete any matching styles. If {filter} is provided, only matching elements of -the filter are disabled. For instance, a filter [c]mozilla.org[c], given a -style for [c]www.google.com,mozilla.org[c], will result in a style for -[c]www.google.com[c]. The available options are: +the filter are disabled. For instance, a filter [a]mozilla.org[a], given a +style for [a]www.google.com,mozilla.org[a], will result in a style for +[a]www.google.com[a]. The available options are: * *-name*: The name provided to [c]:style[c] (short option: *-n*) * *-index*: For unnamed styles, the index listed by [c]:style[c] From c14f5eed2bdcc7698d3dcb1078ac453f4734c219 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 4 Mar 2009 20:42:34 +1100 Subject: [PATCH 12/20] Fix typo in :cabbrev help. --- vimperator/locale/en-US/map.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt index 449f5b78..6dce047a 100644 --- a/vimperator/locale/en-US/map.txt +++ b/vimperator/locale/en-US/map.txt @@ -209,7 +209,7 @@ ________________________________________________________________________________ ||:ca[bbrev] {lhs}|| + ||:ca[bbrev]|| ________________________________________________________________________________ -Abbreviate a key sequence for Command-line mode. Same as [c]:ab[reviate][c], +Abbreviate a key sequence for Command-line mode. Same as [c]:ab[breviate][c], but for Command-line mode only. ________________________________________________________________________________ From 1117fc7ad0c86dfee5df13c21ecc1119954055b4 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 4 Mar 2009 21:19:34 +1100 Subject: [PATCH 13/20] Sync help and wiki donation blurbs. --- vimperator/locale/en-US/intro.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/vimperator/locale/en-US/intro.txt b/vimperator/locale/en-US/intro.txt index 98c9a70d..5cacc1af 100644 --- a/vimperator/locale/en-US/intro.txt +++ b/vimperator/locale/en-US/intro.txt @@ -20,13 +20,17 @@ are hidden. + If you really need them, type: [c]:set guioptions+=mT[c] to get them back. + If you don't like Vimperator at all, you can uninstall it by typing [c]:addons[c] and remove/disable it. + -If you like it but can't remember the shortcuts, then press [m]F1[m] or +If you like it but can't remember the shortcuts, then press [m][m] or [c]:help[c] to get this help window back. |author| |donation| + -Vimperator was written by mailto:stubenschrott@gmx.net[Martin Stubenschrott]. -If you appreciate my work on Vimperator and want to encourage me working on it -more, you can either send me greetings, patches or make a donation: +Vimperator was initially written by mailto:stubenschrott@gmx.net[Martin +Stubenschrott] but has found many other +http://vimperator.org/trac/wiki/Vimperator/Authors[contributors] in the +meanwhile. If you appreciate the work on Vimperator and want to encourage us +working on it more, you can send us greetings, patches, or donations (thanks a +lot to http://vimperator.org/trac/wiki/Vimperator/Donors[these people] who +already did): ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -37,9 +41,11 @@ more, you can either send me greetings, patches or make a donation: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -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 :) +If you prefer getting some nice products for your money, you can also support +us by buying some cool http://www.zazzle.com/maxauthority*[merchandise] like +t-shirts or mugs. Of course, as we believe in free, open source software, only +support us financially if you really like Vimperator and the money doesn't hurt +- otherwise just use it, recommend it, and like it :) section:Help{nbsp}topics[overview] From 9d3a5ec9398b5183048647f99df75badf59136b7 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 5 Mar 2009 01:27:41 +1100 Subject: [PATCH 14/20] Fix help links whose destination is the current page. (#169) --- common/content/liberator.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/content/liberator.js b/common/content/liberator.js index 9433eab8..f2ddc6b6 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1428,7 +1428,11 @@ window.addEventListener("liberatorHelpLink", function (event) { if (tag) var page = liberator.findHelp(tag); if (page) + { elem.href = "chrome://liberator/locale/" + page; + if (buffer.URL.replace(/#.*/, "") == elem.href.replace(/#.*/, "")) // XXX + setTimeout(function () { content.postMessage("fragmentChange", "*"); }, 0); + } }, true, true); From 5f190d34434b11cc6faab1e4f3074f8c68c00322 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 7 Mar 2009 00:50:28 +1100 Subject: [PATCH 15/20] Strip leading counts and trailing bangs from help tag links. --- common/content/liberator.js | 10 +++++++--- vimperator/locale/en-US/cmdline.txt | 4 ++-- vimperator/locale/en-US/intro.txt | 2 +- vimperator/locale/en-US/tutorial.txt | 10 +++++----- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index f2ddc6b6..19fe896f 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1421,20 +1421,24 @@ window.liberator = liberator; // FIXME: Ugly, etc. window.addEventListener("liberatorHelpLink", function (event) { let elem = event.target; + if (/^(option|mapping|command)$/.test(elem.className)) var tag = elem.textContent.replace(/\s.*/, ""); + if (/^(mapping|command)$/.test(elem.className)) + tag = tag.replace(/^\d+/, ""); if (elem.className == "command") - tag = tag.replace(/\[.*?\]/g, ""); + tag = tag.replace(/\[.*?\]/g, "").replace(/!$/, ""); + if (tag) var page = liberator.findHelp(tag); + if (page) { elem.href = "chrome://liberator/locale/" + page; if (buffer.URL.replace(/#.*/, "") == elem.href.replace(/#.*/, "")) // XXX setTimeout(function () { content.postMessage("fragmentChange", "*"); }, 0); } - }, - true, true); + }, true, true); // called when the chrome is fully loaded and before the main window is shown window.addEventListener("load", liberator.startup, false); diff --git a/vimperator/locale/en-US/cmdline.txt b/vimperator/locale/en-US/cmdline.txt index 9eabc590..ddf50772 100644 --- a/vimperator/locale/en-US/cmdline.txt +++ b/vimperator/locale/en-US/cmdline.txt @@ -2,8 +2,8 @@ HEADER |Command-line-mode| |Command-line| |mode-cmdline| + -Command-line mode is used to enter Ex commands (":") and text search patterns -("/" and "?"). +Command-line mode is used to enter Ex commands ("[m]:[m]") and text search patterns +("[m]/[m]" and "[m]?[m]"). |:| + ||:|| diff --git a/vimperator/locale/en-US/intro.txt b/vimperator/locale/en-US/intro.txt index 5cacc1af..9462ebc7 100644 --- a/vimperator/locale/en-US/intro.txt +++ b/vimperator/locale/en-US/intro.txt @@ -100,7 +100,7 @@ section:Features[features] with support for Firefox keyword bookmarks and search engines * Count supported for many commands ([m]3[m] will go back 3 pages) * Beep on errors -* Marks support ([m]ma[m] to set mark a on a web page, [m]'a[m] to go there) +* Marks support ([m]m[m][a]a[a] to set mark a on a web page, [m]'[m][a]a[a] to go there) * QuickMarks support (quickly go to previously marked web pages with [m]go[m][a]\\{a-zA-Z0-9\\}[a]) * [c]:map[c] and [c]:command[c] support (and feedkeys() for script writers) * [c]:time[c] support for profiling diff --git a/vimperator/locale/en-US/tutorial.txt b/vimperator/locale/en-US/tutorial.txt index 461a6aed..21b5e285 100644 --- a/vimperator/locale/en-US/tutorial.txt +++ b/vimperator/locale/en-US/tutorial.txt @@ -22,8 +22,8 @@ If you're a veteran Vim user, this may look familiar. It should. However, in this author's opinion, the best way to get familiar with Vimperator is to leave these disabled for now. (The above action can be -reversed with [c]:set go=[c]) You can look at the entry for -[o]guioptions[o] in help:options[options.html] for more information on this. +reversed with [c]:set go=[c]) You can look at the entry for 'guioptions' in +help:options[options.html] for more information on this. section:Vimperator's{nbsp}modal{nbsp}interface[modal] @@ -36,8 +36,8 @@ When Vimperator starts, it is in Normal mode by default. This is probably where you will spend the majority of your time. The other core mode of Vimperator, Command-line mode, can be entered from -Normal mode by typing a \':' (colon). You will frequently see Vimperator -commands start with a \':', indicating that what follows is a command. +Normal mode by typing a \'[m]:[m]' (colon). You will frequently see Vimperator +commands start with a \'[m]:[m]', indicating that what follows is a command. To return to Normal mode from Command-line mode, type [m][m]. Pressing [m][m] will also return you to Normal mode from most other modes in @@ -142,7 +142,7 @@ type uniquely identifies any given link, Vimperator will follow that link immediately without any further user input. Whichever way you choose to indicate your target link, once Vimperator has -highlighted the link you want, simply hit to open it. +highlighted the link you want, simply hit [m][m] to open it. The most common hint mode is called help:QuickHint{nbsp}mode[various.html,f]. To activate QuickHint mode, press either [m]f[m] or [m]F[m]. The lower-case From db0b6ad62950663c73b47c1de4d626b2ab708df8 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 7 Mar 2009 00:59:58 +1100 Subject: [PATCH 16/20] Add help links to Mozilla KB preference documentation. --- vimperator/locale/en-US/buffer.txt | 9 ++++++--- vimperator/locale/en-US/options.txt | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/vimperator/locale/en-US/buffer.txt b/vimperator/locale/en-US/buffer.txt index 91022f27..95d6bab0 100644 --- a/vimperator/locale/en-US/buffer.txt +++ b/vimperator/locale/en-US/buffer.txt @@ -233,9 +233,12 @@ zoom range (default: 30%--300%). The zoom levels are used by default zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%, 170%, 200%, 240%, 300%. -The available zoom range can be changed by setting the \'zoom.minPercent' and -\'zoom.maxPercent' Firefox preferences. The zoom levels can be changed using -the \'toolkit.ZoomManager.zoomLevels' preference. +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 +preferences. The zoom levels can be changed using the +\'http://kb.mozillazine.org/Toolkit.zoomManager.zoomValues[toolkit.ZoomManager.zoomLevels]' +preference. Note: \'toolkit.ZoomManager.zoomLevels' is specified as a list of values between 0 and 1, not as a percentage. diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index 3ef438a5..2e2be474 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -189,10 +189,10 @@ they can be changed to a different value in your RC file using The following preferences are set: -* browser.startup.page -* dom.popup_allowed_events -* accessibility.typeaheadfind.autostart -* accessibility.typeaheadfind +* http://kb.mozillazine.org/Browser.startup.page[browser.startup.page] +* http://kb.mozillazine.org/Dom.popup_allowed_events[dom.popup_allowed_events] +* http://kb.mozillazine.org/Accessibility.typeaheadfind.autostart[accessibility.typeaheadfind.autostart] +* http://kb.mozillazine.org/Accessibility.typeaheadfind[accessibility.typeaheadfind] // TODO: others? From 31a5605158a2f62a65b004fca5868740fcdbadbf Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 7 Mar 2009 01:11:51 +1100 Subject: [PATCH 17/20] Fix links in :help contact text. --- vimperator/locale/en-US/intro.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vimperator/locale/en-US/intro.txt b/vimperator/locale/en-US/intro.txt index 9462ebc7..ec5156fb 100644 --- a/vimperator/locale/en-US/intro.txt +++ b/vimperator/locale/en-US/intro.txt @@ -112,10 +112,13 @@ section:Features[features] section:Contact[contact] -Please send comments/bug reports/patches to the mailing list, where I will -properly answer any questions. You can also join the #vimperator IRC channel -on irc.freenode.net or check the Wiki for frequently asked questions. Make -sure, you have read the TODO file first, as I am aware of many things which -can be improved when I find time for it or get patches. +Please send comments/bug reports/patches to the mailing list, where we will +properly answer any questions. You can also join the ++++#vimperator+++ IRC channel +on http://www.freenode.net/[Freenode] or check the +http://vimperator.org/trac/wiki/Vimperator/Wiki[Wiki] for +http://vimperator.org/trac/wiki/Vimperator/FAQ[frequently asked questions +(FAQ)]. Make sure, you have read the TODO file first, as we are aware of many +things which can be improved when we find time for it or receive patches. // vim: set filetype=asciidoc: From 8c2adfefb12657021ad0095af661f3f09ce23157 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 7 Mar 2009 02:40:20 +1100 Subject: [PATCH 18/20] Rename an oddly named variable in util.readFromClipboard. --- common/content/util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/content/util.js b/common/content/util.js index 5409d0c9..ad41bd18 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -577,7 +577,7 @@ const util = { //{{{ */ readFromClipboard: function readFromClipboard() { - let url; + let str; try { @@ -599,12 +599,12 @@ const util = { //{{{ if (data) { data = data.value.QueryInterface(Ci.nsISupportsString); - url = data.data.substring(0, dataLen.value / 2); + str = data.data.substring(0, dataLen.value / 2); } } catch (e) {} - return url; + return str; }, /** From 52956a9aa1d49dc5c101c8fb5d91441f60a83d97 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 9 Mar 2009 01:18:57 +1100 Subject: [PATCH 19/20] Replace use of editor.pasteClipboard with executeCommand("cmd_paste"). This fixes #93 ( in the bottom of a long textarea bounces up) as well. --- common/content/editor.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index b62aad98..9f75488c 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -339,7 +339,7 @@ function Editor() //{{{ mappings.add(myModes, [""], "Insert clipboard/selection", - function () { editor.pasteClipboard(); }); + function () { editor.executeCommand("cmd_paste"); }); mappings.add([modes.INSERT, modes.TEXTAREA, modes.COMPOSE], [""], "Edit text field with an external editor", @@ -621,25 +621,6 @@ function Editor() //{{{ return text.substring(getEditor().selectionStart, getEditor().selectionEnd); }, - pasteClipboard: function () - { - let elem = window.document.commandDispatcher.focusedElement; - - if (elem.setSelectionRange && util.readFromClipboard()) - // readFromClipboard would return 'undefined' if not checked - // dunno about .setSelectionRange - { - let rangeStart = elem.selectionStart; // caret position - let rangeEnd = elem.selectionEnd; - let tempStr1 = elem.value.substring(0, rangeStart); - let tempStr2 = util.readFromClipboard(); - let tempStr3 = elem.value.substring(rangeEnd); - elem.value = tempStr1 + tempStr2 + tempStr3; - elem.selectionStart = rangeStart + tempStr2.length; - elem.selectionEnd = elem.selectionStart; - } - }, - // count is optional, defaults to 1 executeCommand: function (cmd, count) { From 466e521230d67b41d55af3369fdfa4cbaa4093e2 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Sun, 8 Mar 2009 20:35:16 +0200 Subject: [PATCH 20/20] Revert "Replace use of editor.pasteClipboard with executeCommand("cmd_paste")." This reverts commit 7e8db4743b24368ba1784420e6cdf6b4838958df. The commit breaks selection pasting in linux, so reverting. --- common/content/editor.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/common/content/editor.js b/common/content/editor.js index 9f75488c..b62aad98 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -339,7 +339,7 @@ function Editor() //{{{ mappings.add(myModes, [""], "Insert clipboard/selection", - function () { editor.executeCommand("cmd_paste"); }); + function () { editor.pasteClipboard(); }); mappings.add([modes.INSERT, modes.TEXTAREA, modes.COMPOSE], [""], "Edit text field with an external editor", @@ -621,6 +621,25 @@ function Editor() //{{{ return text.substring(getEditor().selectionStart, getEditor().selectionEnd); }, + pasteClipboard: function () + { + let elem = window.document.commandDispatcher.focusedElement; + + if (elem.setSelectionRange && util.readFromClipboard()) + // readFromClipboard would return 'undefined' if not checked + // dunno about .setSelectionRange + { + let rangeStart = elem.selectionStart; // caret position + let rangeEnd = elem.selectionEnd; + let tempStr1 = elem.value.substring(0, rangeStart); + let tempStr2 = util.readFromClipboard(); + let tempStr3 = elem.value.substring(rangeEnd); + elem.value = tempStr1 + tempStr2 + tempStr3; + elem.selectionStart = rangeStart + tempStr2.length; + elem.selectionEnd = elem.selectionStart; + } + }, + // count is optional, defaults to 1 executeCommand: function (cmd, count) {