From 5a60b27cf91c20d9139e109dde0adca008cd904a Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Thu, 19 Feb 2009 16:40:45 +0200 Subject: [PATCH 01/46] Vimperator 2.0 beta2 --- vimperator/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/Makefile b/vimperator/Makefile index b292b37f..9ca5b334 100644 --- a/vimperator/Makefile +++ b/vimperator/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 2.0b2pre +VERSION = 2.0b2 NAME = vimperator include ../common/Makefile.common From 6be11c7cc28d650b85b9dc7e922d5678394f8995 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Thu, 19 Feb 2009 18:00:32 +0200 Subject: [PATCH 02/46] update makefile for 2.0 beta3 pre --- vimperator/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/Makefile b/vimperator/Makefile index 9ca5b334..639ea591 100644 --- a/vimperator/Makefile +++ b/vimperator/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 2.0b2 +VERSION = 2.0b3pre NAME = vimperator include ../common/Makefile.common From 79e1a8d9e0ba9841bbc445b71a91c67cb1a14806 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Thu, 19 Feb 2009 22:41:49 +0100 Subject: [PATCH 03/46] updated donors --- vimperator/Donors | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vimperator/Donors b/vimperator/Donors index 9a96542d..478ef6e5 100644 --- a/vimperator/Donors +++ b/vimperator/Donors @@ -2,6 +2,10 @@ Contiuous donations: * Daniel Bainton (web hosting) 2009: +* Convolution +* Brian Hall +* Daniel Hahler +* Per-Henrik Persson * David C Foor * Oliver Schaefer * Paul Moss From bbb22074a90da7d40ad9f00921c69c6cede70631 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Feb 2009 15:58:59 +1100 Subject: [PATCH 04/46] Fix make clean and distclean. --- common/Makefile.common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/Makefile.common b/common/Makefile.common index d0e1210b..0ae474c3 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -81,11 +81,11 @@ $(RDF): $(RDF_IN) Makefile < $< > $@ @echo "SUCCESS: $@" -clean: $(LOCALES:%=%.clean) +clean: ${LOCALEDIR}/$(LOCALES:%=%.clean) @echo "General $(NAME) cleanup..." rm -f $(JAR) $(XPI) -distclean: $(LOCALES:%=%.distclean) clean +distclean: ${LOCALEDIR}/$(LOCALES:%=%.distclean) clean @echo "More $(NAME) cleanup..." rm -rf $(BUILD_DIR) From e459c7c867cd0fb5ebb650e47bb48a9094a1fffc Mon Sep 17 00:00:00 2001 From: anekos Date: Mon, 23 Feb 2009 04:55:51 +0900 Subject: [PATCH 05/46] Escaping the error. A error occurs if the element has been removed when "elem.selectionStart" is executed. e.g. Press "gi" on --- common/content/editor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index b24422bf..b62aad98 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -607,8 +607,12 @@ function Editor() //{{{ unselectText: function () { let elem = window.document.commandDispatcher.focusedElement; - if (elem && elem.selectionEnd) - elem.selectionEnd = elem.selectionStart; + // A error occurs if the element has been removed when "elem.selectionStart" is executed. + try { + if (elem && elem.selectionEnd) + elem.selectionEnd = elem.selectionStart; + } + catch (e) {} }, selectedText: function () From 530670f1a080182dc8b7b8879e310c69c10c2f09 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Mon, 23 Feb 2009 08:18:03 +0200 Subject: [PATCH 06/46] case-insensitivity for :sidebar and :dialog --- common/content/liberator.js | 2 +- vimperator/NEWS | 1 + vimperator/content/config.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index a26ed8fa..d1d29227 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -255,7 +255,7 @@ const liberator = (function () //{{{ "Open a " + config.name + " dialog", function (args) { - let arg = args[0]; + let arg = args[0].toLowerCase(); try { diff --git a/vimperator/NEWS b/vimperator/NEWS index ee0079c8..75c5d29a 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -82,6 +82,7 @@ * stop macro playback on * :bmark now updates a bookmark, if possible. :bmark! adds a new one * many bug fixes + * :dialog and :sidebar now doesn't care about case for arguments 2008-08-16: * version 1.2 diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 69cddbbb..13c9c632 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -371,10 +371,10 @@ const config = { //{{{ "Open the sidebar window", function (args) { - let arg = args.literalArg; + let arg = args.literalArg.toLowerCase(); // focus if the requested sidebar is already open - if (document.getElementById("sidebar-title").value == arg) + if (document.getElementById("sidebar-title").value.toLowerCase() == arg) { document.getElementById("sidebar-box").focus(); return; @@ -384,7 +384,7 @@ const config = { //{{{ for (let [,panel] in Iterator(menu.childNodes)) { - if (panel.label == arg) + if (panel.label.toLowerCase() == arg) { panel.doCommand(); return; From eb74df729e33a68a6ab2b1994602066e9106d405 Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Mon, 23 Feb 2009 10:14:16 -0500 Subject: [PATCH 07/46] Change two Makefile.common var references to use $() over ${}. Both are legal in Makefiles, but $() matches local convention, and $() prevents confusion about when the variable is expanded (i.e., shell vs. make). --- common/Makefile.common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/Makefile.common b/common/Makefile.common index 0ae474c3..c1458a87 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -81,11 +81,11 @@ $(RDF): $(RDF_IN) Makefile < $< > $@ @echo "SUCCESS: $@" -clean: ${LOCALEDIR}/$(LOCALES:%=%.clean) +clean: $(LOCALEDIR)/$(LOCALES:%=%.clean) @echo "General $(NAME) cleanup..." rm -f $(JAR) $(XPI) -distclean: ${LOCALEDIR}/$(LOCALES:%=%.distclean) clean +distclean: $(LOCALEDIR)/$(LOCALES:%=%.distclean) clean @echo "More $(NAME) cleanup..." rm -rf $(BUILD_DIR) From e318da707362554d30065e2df1b7f245d3da80b5 Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Mon, 23 Feb 2009 10:30:07 -0500 Subject: [PATCH 08/46] Made and look the same to events.js --- common/content/events.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/content/events.js b/common/content/events.js index 8d25106d..3c9db52a 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -932,6 +932,8 @@ function Events() //{{{ { if (!ctrl && !alt && !shift && !meta) return false; // an invalid key like + else if (shift) + keyname = keyname.toUpperCase(); charCode = keyname.charCodeAt(0); } else if (keyname.toLowerCase() == "space") From 60791f64af4fba16af15729f62837dddcc0b17b3 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 24 Feb 2009 15:09:01 +1100 Subject: [PATCH 09/46] Ignore case in :sidebar and :dialog completion. Also fixes these to report the original arg in error messages again. --- common/content/liberator.js | 10 +++++++--- vimperator/NEWS | 2 +- vimperator/content/config.js | 13 +++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index d1d29227..7135755e 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -255,7 +255,7 @@ const liberator = (function () //{{{ "Open a " + config.name + " dialog", function (args) { - let arg = args[0].toLowerCase(); + let arg = args[0]; try { @@ -264,7 +264,7 @@ const liberator = (function () //{{{ for (let [,dialog] in Iterator(dialogs)) { - if (arg == dialog[0]) + if (util.compareIgnoreCase(arg, dialog[0]) == 0) { dialog[2](); return; @@ -281,7 +281,11 @@ const liberator = (function () //{{{ { argCount: "1", bang: true, - completer: function (context, args) completion.dialog(context) + completer: function (context) + { + context.ignoreCase = true; + return completion.dialog(context); + } }); commands.add(["em[enu]"], diff --git a/vimperator/NEWS b/vimperator/NEWS index 75c5d29a..8cd7d8b1 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -81,8 +81,8 @@ * :qa! and :q! quit forcefully, as in vim * stop macro playback on * :bmark now updates a bookmark, if possible. :bmark! adds a new one + * :dialog and :sidebar arguments are now case-insensitive * many bug fixes - * :dialog and :sidebar now doesn't care about case for arguments 2008-08-16: * version 1.2 diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 13c9c632..1a37841a 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -371,10 +371,11 @@ const config = { //{{{ "Open the sidebar window", function (args) { - let arg = args.literalArg.toLowerCase(); + let arg = args.literalArg; + function compare(a, b) util.compareIgnoreCase(a, b) == 0 // focus if the requested sidebar is already open - if (document.getElementById("sidebar-title").value.toLowerCase() == arg) + if (compare(document.getElementById("sidebar-title").value, arg)) { document.getElementById("sidebar-box").focus(); return; @@ -384,7 +385,7 @@ const config = { //{{{ for (let [,panel] in Iterator(menu.childNodes)) { - if (panel.label.toLowerCase() == arg) + if (compare(panel.label, arg)) { panel.doCommand(); return; @@ -395,7 +396,11 @@ const config = { //{{{ }, { argCount: "1", - completer: function (context) completion.sidebar(context), + completer: function (context) + { + context.ignoreCase = true; + return completion.sidebar(context); + }, literal: 0 }); From e0d95a115b7e556cdd7b4b9cd3d814364bb34f78 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Tue, 24 Feb 2009 17:44:55 +0200 Subject: [PATCH 10/46] Fix typo in Donors --- vimperator/Donors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/Donors b/vimperator/Donors index 478ef6e5..638ede86 100644 --- a/vimperator/Donors +++ b/vimperator/Donors @@ -1,4 +1,4 @@ -Contiuous donations: +Continuous donations: * Daniel Bainton (web hosting) 2009: From 09e82c7914ce3827b06c4ff89213fc5ad06b3e22 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 26 Feb 2009 14:48:21 +1100 Subject: [PATCH 11/46] Fix version.html generation for POSIX sed. --- common/Makefile.doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/Makefile.doc b/common/Makefile.doc index 6eba6b8d..9fed1d5e 100644 --- a/common/Makefile.doc +++ b/common/Makefile.doc @@ -57,5 +57,6 @@ $(ADC_FILES): %.html: %.txt $(BASE)/Makefile.doc $(ADC_DEPS) version.html: ../../NEWS $(BASE)/Makefile.doc $(ADC_DEPS) @echo "DOC locale/$(LOCALE)/$@" # NOTE: asciidoc doesn't source the conf file implicitly when processing stdin - sed -e '1i\HEADER' -e '/^[0-9]/d' -e '/^ \+\* version /s/.*version \+\([0-9.]\+\).*/section:Version{nbsp}\1[version-\1]\ + sed -e '1i\ +HEADER' -e '/^[0-9]/d' -e '/^ \+\* version /s/.*version \+\([0-9.]\+\).*/section:Version{nbsp}\1[version-\1]\ /' ../../NEWS | ${ASCIIDOC} -f asciidoc.conf -a doctitle=version.html -o version.html - From f28f6bc5fb7cc3328ab9ae8a999bc366ac016563 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Feb 2009 22:05:26 +1100 Subject: [PATCH 12/46] Update TODO with current MOW hinting status. --- vimperator/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/TODO b/vimperator/TODO index 6abd5099..cfe79cf4 100644 --- a/vimperator/TODO +++ b/vimperator/TODO @@ -42,7 +42,7 @@ BUGS: - :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 -- MOW hinting is broken, perhaps this should be properly disabled for 2.0 +- some extended hint commands aren't working in the MOW (;; ;t ;b ;? ;F) FEATURES: 9 finish :help TODOs From b3a5f279fc70e03ac2e3e4ab0bbe430957fc69ac Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 1 Mar 2009 01:55:11 +1100 Subject: [PATCH 13/46] Fix arg markup in :delstyle help section. --- vimperator/locale/en-US/styling.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vimperator/locale/en-US/styling.txt b/vimperator/locale/en-US/styling.txt index a4ba91a2..bf1c6515 100644 --- a/vimperator/locale/en-US/styling.txt +++ b/vimperator/locale/en-US/styling.txt @@ -122,9 +122,8 @@ 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: - * [c]-name[c]: The name provided to [c]:style[c] (short option: - *-n*) - * [c]-index[c]: For unnamed styles, the index listed by [c]:style[c] + * *-name*: The name provided to [c]:style[c] (short option: *-n*) + * *-index*: For unnamed styles, the index listed by [c]:style[c] (short option: *-i*) ________________________________________________________________________________ From f82b03f7961164a179ac75a092ddbe3607a25530 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 1 Mar 2009 02:49:18 +1100 Subject: [PATCH 14/46] 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 15/46] 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 16/46] 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 17/46] 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 18/46] 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 19/46] 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 20/46] 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 21/46] 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 22/46] 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 23/46] 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 24/46] 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 25/46] 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 26/46] 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 27/46] 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 28/46] 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 29/46] 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 30/46] 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 31/46] 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 32/46] 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 33/46] 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) { From 8b658634882c5d90c3f6612bcd837797522dcbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Tue, 10 Mar 2009 20:54:31 +0100 Subject: [PATCH 34/46] Fix disappearing 'q{0-9a-zA-Z}' in repeat.html Bonus: typo in regressions.js, downcase 'Command-line' in cmdline.txt (as it's not speaking about mode, hope thesnowdog will agree) Signed-off-by: Doug Kearns --- vimperator/locale/en-US/cmdline.txt | 2 +- vimperator/locale/en-US/repeat.txt | 2 +- vimperator/regressions.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vimperator/locale/en-US/cmdline.txt b/vimperator/locale/en-US/cmdline.txt index ddf50772..3ee75fef 100644 --- a/vimperator/locale/en-US/cmdline.txt +++ b/vimperator/locale/en-US/cmdline.txt @@ -25,7 +25,7 @@ ________________________________________________________________________________ |c_| + |||| ________________________________________________________________________________ -Expand a Command-line abbreviation. +Expand a command-line abbreviation. ________________________________________________________________________________ diff --git a/vimperator/locale/en-US/repeat.txt b/vimperator/locale/en-US/repeat.txt index 2817c980..975cbea7 100644 --- a/vimperator/locale/en-US/repeat.txt +++ b/vimperator/locale/en-US/repeat.txt @@ -7,7 +7,7 @@ Vimperator can repeat a number of commands and record macros. section:Macros[macros,complex-repeat] |q| -||q{0-9a-zA-Z}|| + +||q\\{0-9a-zA-Z}|| + ____________________________________________________________________________ Record a key sequence into a macro. Available macros are {0-9a-zA-Z} (uppercase to append). diff --git a/vimperator/regressions.js b/vimperator/regressions.js index fd7f043a..36f96192 100644 --- a/vimperator/regressions.js +++ b/vimperator/regressions.js @@ -1,7 +1,7 @@ // Script to find regressions // // It should use as few liberator methods as possible, but fall back to standard mozilla/DOM methods -// The reason it, we don't want to find regressions in the regressions script, and it should survive +// The reason is, we don't want to find regressions in the regressions script, and it should survive // massive changes in the internal liberator API, but just test for functionality of // user-visible commands/mappings // From f909cc128e4f9749e68ea1e7fcf3350d9e5ae611 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 12 Mar 2009 00:31:59 +1100 Subject: [PATCH 35/46] Cancel the isReplaying macro mode when a macro is interrupted. --- common/content/events.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/content/events.js b/common/content/events.js index 6c655cf7..c7449d64 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1375,8 +1375,11 @@ function Events() //{{{ if (key == "" && !event.isMacro) { events.feedingKeys = false; - if (lastMacro) + if (modes.isReplaying) + { + modes.isReplaying = false; setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'"); }, 100); + } event.preventDefault(); event.stopPropagation(); return true; From 93f59df6e730de8ec5d302dbd5b0522bfb4f9d38 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 12 Mar 2009 22:00:46 -0400 Subject: [PATCH 36/46] Fix some bugs---which bugs, I have no idea. --- common/content/completion.js | 15 ++++++++++++--- common/content/events.js | 13 +++++++------ common/content/tabs.js | 1 + common/content/ui.js | 5 +---- vimperator/content/bookmarks.js | 2 ++ 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 9cd8010a..ee86368d 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -658,7 +658,11 @@ CompletionContext.prototype = { this.tabPressed = false; this.title = ["Completions"]; this.updateAsync = false; - this.waitingForTab = false; + try + { + this.waitingForTab = false; + } + catch (e) {} this.cancelAll(); @@ -677,7 +681,11 @@ CompletionContext.prototype = { for each (let context in this.contexts) { context.hasItems = false; - context.incomplete = false; + try + { + context.incomplete = false; + } + catch (e) {} } }, @@ -685,8 +693,9 @@ CompletionContext.prototype = { * Wait for all subcontexts to complete. * * @param {boolean} interruptible When true, the call may be interrupted - * via . In this case, "Interrupted" may be thrown. + * via , in which case, "Interrupted" may be thrown. * @param {number} timeout The maximum time, in milliseconds, to wait. + * If 0 or null, wait indefinately. */ wait: function wait(interruptable, timeout) { diff --git a/common/content/events.js b/common/content/events.js index a8d6290c..622aacdb 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1695,7 +1695,7 @@ function Events() //{{{ { setTimeout(statusline.updateUrl, 100); }, - setOverLink : function (link, b) + setOverLink: function (link, b) { let ssli = options["showstatuslinks"]; if (link && ssli) @@ -1759,11 +1759,12 @@ function Events() //{{{ window.XULBrowserWindow = self.progressListener; window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShellTreeItem).treeOwner - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIXULWindow) - .XULBrowserWindow = window.XULBrowserWindow; + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShellTreeItem) + .treeOwner + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIXULWindow) + .XULBrowserWindow = self.progressListener; try { getBrowser().addProgressListener(self.progressListener, Ci.nsIWebProgress.NOTIFY_ALL); diff --git a/common/content/tabs.js b/common/content/tabs.js index 8f5f6578..3d44fbcb 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -623,6 +623,7 @@ function Tabs() //{{{ completer: function (context) { context.anchored = false; + context.compare = CompletionContext.Sort.unsorted; context.keys = { text: function (item) item.state.entries[0].url, description: "title" }; context.completions = tabs.closedTabs; }, diff --git a/common/content/ui.js b/common/content/ui.js index f9b90b4f..de7052e1 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -1273,20 +1273,17 @@ function CommandLine() //{{{ } else if (event.type == "input") { - //liberator.dump("input: " + command); this.resetCompletions(); liberator.triggerCallback("change", currentExtendedMode, command); } else if (event.type == "keypress") { + let key = events.toString(event); if (completions) completions.previewClear(); if (!currentExtendedMode) return true; - let key = events.toString(event); - //liberator.log("command line handling key: " + key + "\n"); - // user pressed ENTER to carry out a command // user pressing ESCAPE is handled in the global onEscape // FIXME: should trigger "cancel" event diff --git a/vimperator/content/bookmarks.js b/vimperator/content/bookmarks.js index f099b36e..3a9ad0ec 100644 --- a/vimperator/content/bookmarks.js +++ b/vimperator/content/bookmarks.js @@ -737,6 +737,7 @@ function History() //{{{ context.anchored = false; context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index, 0, -1))]; context.keys = { text: function (item) item.URI.spec, description: "title" }; + context.compare = CompletionContext.Sort.unsorted; }, count: true, literal: 0 @@ -783,6 +784,7 @@ function History() //{{{ context.anchored = false; context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index + 1, sh.count))]; context.keys = { text: function (item) item.URI.spec, description: "title" }; + context.compare = CompletionContext.Sort.unsorted; }, count: true, literal: 0 From a37f61028d9c1d47e281edf02e086eaf7344d964 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 12 Mar 2009 22:44:13 +1100 Subject: [PATCH 37/46] Fix editor#pasteClipboard on Windows. --- common/content/editor.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/content/editor.js b/common/content/editor.js index b62aad98..8c983475 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -623,6 +623,13 @@ function Editor() //{{{ pasteClipboard: function () { + if (liberator.has("Win32")) + { + this.executeCommand("cmd_paste"); + return; + } + + // FIXME: #93 ( in the bottom of a long textarea bounces up) let elem = window.document.commandDispatcher.focusedElement; if (elem.setSelectionRange && util.readFromClipboard()) From 7955e6ce246ab33c617b05ed02c09a226ee493e7 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 14 Mar 2009 17:08:30 +1100 Subject: [PATCH 38/46] Fix mode string case in 'editor' help. --- vimperator/locale/en-US/options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index 2e2be474..bf042502 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -266,7 +266,7 @@ ____ ||'editor'|| string (default: "gvim -f") ____ Set the external text editor. -Sets the editor to run when [m][m] is pressed in INSERT and TEXTAREA +Sets the editor to run when [m][m] is pressed in Insert and TextArea modes. Warning: Vimperator will not behave correctly if the editor forks its own From 4d9cefa754a6e2a07a2ea34fbf6668396a75d809 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 14 Mar 2009 17:11:24 +1100 Subject: [PATCH 39/46] Fix regressions.js modeline. --- vimperator/regressions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/regressions.js b/vimperator/regressions.js index 36f96192..6c4d53ec 100644 --- a/vimperator/regressions.js +++ b/vimperator/regressions.js @@ -249,4 +249,4 @@ commands.addUserCommand(["regr[essions]"], count: true }); -// vimperator: set et sts=4 sw=4 : +// vim: set et sts=4 sw=4 : From 9de03780e4266015b22e2adc50fff078593b78dc Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 14 Mar 2009 17:14:17 +1100 Subject: [PATCH 40/46] Add @returns attribute to io#getRCFile documentation. --- common/content/io.js | 1 + 1 file changed, 1 insertion(+) diff --git a/common/content/io.js b/common/content/io.js index ef3c3abd..ffebc794 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -555,6 +555,7 @@ function IO() //{{{ * * @param {string} dir The directory to search. * @default $HOME. + * @returns {nsIFile} The RC file or null if none is found. */ getRCFile: function (dir) { From b23c9289221fb27f868dcf962d8afe5d3cf75589 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 14 Mar 2009 18:10:44 +1100 Subject: [PATCH 41/46] Don't source the user RC file twice when 'exrc' is set. When started from $HOME, the 'exrc' file and the user RC file are the same file. --- common/content/liberator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index 19fe896f..c0798fae 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1291,12 +1291,12 @@ const liberator = (function () //{{{ setTimeout(function () { let init = services.get("environment").get(config.name.toUpperCase() + "_INIT"); + let rcFile = io.getRCFile("~"); + if (init) liberator.execute(init); else { - let rcFile = io.getRCFile("~"); - if (rcFile) io.source(rcFile.path, true); else @@ -1306,7 +1306,7 @@ const liberator = (function () //{{{ if (options["exrc"]) { let localRCFile = io.getRCFile(io.getCurrentDirectory().path); - if (localRCFile) + if (localRCFile && !localRCFile.equals(rcFile)) io.source(localRCFile.path, true); } From 079bc1a933b44de46d1604827542c69bd2ba4ee4 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Sat, 14 Mar 2009 12:37:01 +0200 Subject: [PATCH 42/46] Vimperator 2.0 beta 3 --- vimperator/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/Makefile b/vimperator/Makefile index 639ea591..954aa83a 100644 --- a/vimperator/Makefile +++ b/vimperator/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 2.0b3pre +VERSION = 2.0b3 NAME = vimperator include ../common/Makefile.common From 5c2d82468f38b156be40ff1f00668e3afe507e86 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Sat, 14 Mar 2009 12:43:26 +0200 Subject: [PATCH 43/46] Post Vimperator 2.0 beta 3 --- vimperator/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/Makefile b/vimperator/Makefile index 954aa83a..5eea2ebb 100644 --- a/vimperator/Makefile +++ b/vimperator/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 2.0b3 +VERSION = 2.0b4pre NAME = vimperator include ../common/Makefile.common From ae150a373e7992b68732c006989be2a0a282d177 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Sun, 15 Mar 2009 03:24:29 +0200 Subject: [PATCH 44/46] Fix bug #93 the hacky way, thanks to Conrad Irwin for the patch. --- common/content/editor.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/content/editor.js b/common/content/editor.js index 8c983475..59d1c9dd 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -636,6 +636,10 @@ function Editor() //{{{ // readFromClipboard would return 'undefined' if not checked // dunno about .setSelectionRange { + // This is a hacky fix - but it works. + let curTop = elem.scrollTop; + let curLeft = elem.scrollLeft; + let rangeStart = elem.selectionStart; // caret position let rangeEnd = elem.selectionEnd; let tempStr1 = elem.value.substring(0, rangeStart); @@ -644,6 +648,9 @@ function Editor() //{{{ elem.value = tempStr1 + tempStr2 + tempStr3; elem.selectionStart = rangeStart + tempStr2.length; elem.selectionEnd = elem.selectionStart; + + elem.scrollTop = curTop; + elem.scrollLeft = curLeft; } }, From c1ec3989a973a7ee591c0ccd2dd2c96c9be4d50f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 15 Mar 2009 13:39:58 +1100 Subject: [PATCH 45/46] Add support for image map hinting (Conrad Irwin). --- common/content/hints.js | 72 +++++++++++++++++++++++++++++++++++++++-- vimperator/AUTHORS | 1 + 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/common/content/hints.js b/common/content/hints.js index cf877078..5e27d0c4 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -165,8 +165,76 @@ function Hints() //{{{ text = elem.textContent.toLowerCase(); span = baseNodeAbsolute.cloneNode(true); - span.style.left = Math.max((rect.left + scrollX), scrollX) + "px"; - span.style.top = Math.max((rect.top + scrollY), scrollY) + "px"; + + let leftpos = Math.max((rect.left + scrollX), scrollX); + let toppos = Math.max((rect.top + scrollY), scrollY); + + if (tagname == "area") + { + // TODO: Maybe put the following into a seperate function + try + { + // Need to add the offset to the area element. + // Always try to find the top-left point, as per vimperator default. + let shape = elem.getAttribute("shape").toLowerCase(); + let coordstr = elem.getAttribute("coords"); + // Technically it should be only commas, but hey + coordstr = coordstr.replace(/\s+[;,]\s+/g, ",").replace(/\s+/g, ","); + let coords = coordstr.split(",").map(Number); + + if ((shape == "rect" || shape == "rectangle") && coords.length == 4) + { + leftpos += coords[0]; + toppos += coords[1]; + } + else if (shape == "circle" && coords.length == 3) + { + leftpos += coords[0] - coords[2] / Math.sqrt(2); + toppos += coords[1] - coords[2] / Math.sqrt(2); + } + else if ((shape == "poly" || shape == "polygon") && coords.length % 2 == 0) + { + let leftbound = Infinity; + let topbound = Infinity; + + // First find the top-left corner of the bounding rectangle (offset from image topleft can be noticably suboptimal) + for (let i = 0; i < coords.length; i += 2) + { + leftbound = Math.min(coords[i], leftbound); + topbound = Math.min(coords[i+1], topbound); + } + + let curtop = null; + let curleft = null; + let curdist = Infinity; + + // Then find the closest vertex. (we could generalise to nearest point on an edge, but I doubt there is a need) + for (let i = 0; i < coords.length; i += 2) + { + let leftoffset = coords[i] - leftbound; + let topoffset = coords[i+1] - topbound; + let dist = Math.sqrt(leftoffset * leftoffset + topoffset * topoffset); + if (dist < curdist) + { + curdist = dist; + curleft = coords[i]; + curtop = coords[i+1]; + } + } + + // If we found a satisfactory offset, let's use it. + if (curdist < Infinity) + { + leftpos += curleft; + toppos += curtop; + } + } + } + catch (e) {} //badly formed document, or shape == "default" in which case we don't move the hint + } + + span.style.left = leftpos + "px"; + span.style.top = toppos + "px"; fragment.appendChild(span); pageHints.push([elem, text, span, null, elem.style.backgroundColor, elem.style.color]); diff --git a/vimperator/AUTHORS b/vimperator/AUTHORS index 8d939af8..b8d2e205 100644 --- a/vimperator/AUTHORS +++ b/vimperator/AUTHORS @@ -38,3 +38,4 @@ Patches (in no special order): * Ryan Zheng (ctrl-x/a support) * Dan Boger (:set online support) * Štěpán Němec (help copy-editing and favicon support) + * Conrad Irwin (image map hints) From c8a405cec529f3c06c095493e2a40724f1865c85 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 16 Mar 2009 16:28:05 +1100 Subject: [PATCH 46/46] Move Conrad to the developers list. --- vimperator/AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimperator/AUTHORS b/vimperator/AUTHORS index b8d2e205..7f809a95 100644 --- a/vimperator/AUTHORS +++ b/vimperator/AUTHORS @@ -11,6 +11,7 @@ Developers: * anekos * teramako * janus_wel + * Conrad Irwin Inactive/former developers: * Viktor Kojouharov (Виктор Кожухаров) @@ -38,4 +39,3 @@ Patches (in no special order): * Ryan Zheng (ctrl-x/a support) * Dan Boger (:set online support) * Štěpán Němec (help copy-editing and favicon support) - * Conrad Irwin (image map hints)