Browse Source

For the sake of my sanity, just ignore this...

master
John ShaggyTwoDope Jenkins 7 years ago
parent
commit
2b94a63ed6
  1. 8
      vimperator/PKGBUILD
  2. BIN
      vimperator/pkg/vimperator/.MTREE
  3. 10
      vimperator/pkg/vimperator/.PKGINFO
  4. 18
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/NEWS
  5. 6
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/chrome.manifest
  6. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/bookmarks.js
  7. 46
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/browser.js
  8. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/buffer.js
  9. 45
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/commandline.js
  10. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/commands.js
  11. 45
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/editor.js
  12. 5
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/events.js
  13. 1
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/finder.js
  14. 51
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/hints.js
  15. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/io.js
  16. 10
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/javascript.js
  17. 9
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/liberator-overlay.js
  18. 32
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/liberator.js
  19. 8
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/marks.js
  20. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/options.js
  21. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/quickmarks.js
  22. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/sanitizer.js
  23. 4
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/services.js
  24. 8
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/statusline.js
  25. 6
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/style.js
  26. 8
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/template.js
  27. 76
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/util.js
  28. 4
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/en-US/hints.xml
  29. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/en-US/map.xml
  30. 22
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/en-US/options.xml
  31. 40
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/all.xml
  32. 101
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/autocommands.xml
  33. 541
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/browsing.xml
  34. 564
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/buffer.xml
  35. 119
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/cmdline.xml
  36. 222
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/developer.xml
  37. 124
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/eval.xml
  38. 252
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/gui.xml
  39. 104
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/hints.xml
  40. 441
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/index.xml
  41. 50
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/insert.xml
  42. 609
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/map.xml
  43. 364
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/marks.xml
  44. 82
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/message.xml
  45. 1303
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/options.xml
  46. 99
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/pattern.xml
  47. 42
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/print.xml
  48. 218
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/repeat.xml
  49. 149
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/starting.xml
  50. 183
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/styling.xml
  51. 369
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/tabs.xml
  52. 206
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/various.xml
  53. 11
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/modules/CheckTemplate.jsm
  54. 10
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/modules/storage.jsm
  55. 19
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/modules/template-tag-old.js
  56. 400
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/modules/template-tag.js
  57. 1
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/modules/template.js
  58. 4
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/components/protocols.js
  59. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/content/about.html
  60. 5
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/content/config.js
  61. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/content/tabgroup.js
  62. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/install.rdf
  63. 2
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/en-US/browsing.xml
  64. 5
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/en-US/tutorial.xml
  65. 14
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/all.xml
  66. 43
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/autocommands.xml
  67. 83
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/browsing.xml
  68. 41
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/gui.xml
  69. 204
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/intro.xml
  70. 4
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/liberator.dtd
  71. 67
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/options.xml
  72. 144
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/tabs.xml
  73. 329
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/locale/ja/tutorial.xml
  74. 1
      vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/vimperator-3.9.0-fx.xpi
  75. BIN
      vimperator/vimperator-3.9-1-any.pkg.tar.xz
  76. BIN
      vimperator/vimperator-3.9-1.src.tar.gz
  77. BIN
      vimperator/vimperator-3.9-2.src.tar.gz
  78. BIN
      vimperator/vimperator-3.9.xpi

8
vimperator/PKGBUILD

@ -2,16 +2,16 @@ @@ -2,16 +2,16 @@
# Contributor: Gustavo Dutra <mechamo@gustavodutra.com>
pkgname=vimperator
license=("MIT")
pkgver=3.9.0
pkgver=3.9
pkgrel=1
pkgdesc="Make firefox look and behave like Vim"
arch=('any')
url="http://vimperator.org/vimperator"
depends=('firefox>=26')
_extensionId="vimperator@mozdev.org"
_fileName=vimperator-$pkgver-fx.xpi
source=(https://addons.mozilla.org/firefox/downloads/file/283350/$_fileName)
md5sums=('f876c35a4c0b64abed8f86a6e6d46802')
_fileName=vimperator-$pkgver.xpi
source=(https://github.com/vimperator/vimperator-labs/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.xpi)
md5sums=('11449e9ed1a8e3fccf38a7570a700dd5')
conflicts=('vimperator-hg' 'vimperator-git')
package() {

BIN
vimperator/pkg/vimperator/.MTREE

Binary file not shown.

10
vimperator/pkg/vimperator/.PKGINFO

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
# Generated by makepkg 4.2.0
# Generated by makepkg 4.2.1
# using fakeroot version 1.20.2
# Fri Feb 20 13:43:12 UTC 2015
# Wed Apr 1 09:25:39 UTC 2015
pkgname = vimperator
pkgver = 3.9.0-1
pkgver = 3.9-1
pkgdesc = Make firefox look and behave like Vim
url = http://vimperator.org/vimperator
builddate = 1424439792
builddate = 1427880339
packager = Unknown Packager
size = 1587200
size = 1879040
arch = any
license = MIT
conflict = vimperator-hg

18
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/NEWS

@ -1,3 +1,21 @@ @@ -1,3 +1,21 @@
2015-02-15: Missed Valentine's day
* Version 3.9
* We don't override <S-Insert> in textboxes anymore, so it does the default
action (which is pasting the clipboard). For Windows and Mac users, this doesn't
change anything. For Linux, this means it pasts the clipboard instead of the X11
selection, but that's actually also the default for most GUI apps on Linux nowadays.
On the other hand, it also fixes an annying bug where the first completion stayed
active when using <S-Insert> in the command line.
* Finally remove local file completions from the :open prompt which causes lots of problems (and
slowdowns) for many people. If you want them back, use :set complete=slf
to get back the old default value.
* Make <Ctrl-[> key always behave like <Esc> key (was missing from the command line handler)
* Add support for :set hintmatching=fuzzy as a new, alternative way for hintmatching.
* Don't display help message in command line for a normal click.
* Keep search history and command line history private in 'Private Browsing' mode (also remove
old, unused 'private' option)
* Fix set encoding= for new Firefoxs (thanks Genki-S)
2014-11-09
* Version 3.8.3
* Many compatibility fixes with new Firefox versions (up to Firefox 35)

6
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/chrome.manifest

@ -1,8 +1,6 @@ @@ -1,8 +1,6 @@
# Firefox
content vimperator content/
skin vimperator classic/1.0 skin/
locale vimperator en-US locale/en-US/
locale liberator en-US common/locale/en-US/
content liberator common/content/
resource liberator common/modules/
@ -27,3 +25,7 @@ component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler. @@ -27,3 +25,7 @@ component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.
contract @mozilla.org/commandlinehandler/general-startup;1?type=vimperator {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
category command-line-handler m-Vimperator @mozilla.org/commandlinehandler/general-startup;1?type=vimperator
locale vimperator en-US locale/en-US/
locale liberator en-US common/locale/en-US/
locale vimperator ja locale/ja/
locale liberator ja common/locale/ja/

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/bookmarks.js

@ -620,7 +620,7 @@ const Bookmarks = Module("bookmarks", { @@ -620,7 +620,7 @@ const Bookmarks = Module("bookmarks", {
let url = args.string || buffer.URL;
let deletedCount = bookmarks.remove(url);
liberator.echomsg("Deleted " + deletedCount + " bookmark(s) with url: " + url.quote());
liberator.echomsg("Deleted " + deletedCount + " bookmark(s) with url: " + JSON.stringify(url));
}
},

46
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/browser.js

@ -43,7 +43,10 @@ const Browser = Module("browser", { @@ -43,7 +43,10 @@ const Browser = Module("browser", {
// Stolen from browser.jar/content/browser/browser.js, more or less.
try {
config.browser.docShell.QueryInterface(Ci.nsIDocCharset).charset = val;
PlacesUtils.history.setCharsetForURI(getWebNavigation().currentURI, val);
if (PlacesUtils.history.setCharsetForURI)
PlacesUtils.history.setCharsetForURI(getWebNavigation().currentURI, val);
else
PlacesUtils.setCharsetForURI(getWebNavigation().currentURI, val);
getWebNavigation().reload(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
}
catch (e) { liberator.echoerr(e); }
@ -52,47 +55,6 @@ const Browser = Module("browser", { @@ -52,47 +55,6 @@ const Browser = Module("browser", {
completer: function (context) completion.charset(context)
});
// only available in FF 3.5-19
// TODO: remove when FF ESR's version is over 20. privateBrowsing will be per-window from FF 20+
// XXX: on Fx20, nsIPrivateBrowsingService exists yet but has no properties
let pb = services.get("privateBrowsing");
if (pb && "privateBrowsingEnabled" in pb) {
options.add(["private", "pornmode"],
"Set the 'private browsing' option",
"boolean", false,
{
setter: function (value) services.get("privateBrowsing").privateBrowsingEnabled = value,
getter: function () services.get("privateBrowsing").privateBrowsingEnabled
});
let services = modules.services; // Storage objects are global to all windows, 'modules' isn't.
storage.newObject("private-mode", function () {
({
init: function () {
services.get("obs").addObserver(this, "private-browsing", false);
services.get("obs").addObserver(this, "quit-application", false);
this.private = services.get("privateBrowsing").privateBrowsingEnabled;
},
observe: function (subject, topic, data) {
if (topic == "private-browsing") {
if (data == "enter")
storage.privateMode = true;
else if (data == "exit")
storage.privateMode = false;
storage.fireEvent("private-mode", "change", storage.privateMode);
}
else if (topic == "quit-application") {
services.get("obs").removeObserver(this, "quit-application");
services.get("obs").removeObserver(this, "private-browsing");
}
}
}).init();
}, { store: false });
storage.addObserver("private-mode",
function (key, event, value) {
autocommands.trigger("PrivateMode", { state: value });
}, window);
}
options.add(["urlseparator"],
"Set the separator regex used to separate multiple URL args",
"string", ",\\s");

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/buffer.js

@ -912,7 +912,7 @@ const Buffer = Module("buffer", { @@ -912,7 +912,7 @@ const Buffer = Module("buffer", {
if (bookmarks.isBookmarked(this.URL))
xml["+="](info, ", bookmarked");
let pageInfoText = xml`${file.quote()} [${info}] ${title}`;
let pageInfoText = xml`${JSON.stringify(file)} [${info}] ${title}`;
liberator.echo(pageInfoText, commandline.FORCE_SINGLELINE);
return;
}

45
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/commandline.js

@ -19,8 +19,10 @@ const CommandLine = Module("commandline", { @@ -19,8 +19,10 @@ const CommandLine = Module("commandline", {
this._callbacks = {};
storage.newArray("history-search", { store: true, privateData: true });
storage.newArray("history-command", { store: true, privateData: true });
["search", "command"].forEach(function (mode) {
let isPrivate = liberator.isPrivateWindow();
storage.newArray(liberator.storeName(mode, isPrivate), { store: !isPrivate});
}, this);
// Really inideal.
let services = modules.services; // Storage objects are global to all windows, 'modules' isn't.
@ -28,20 +30,31 @@ const CommandLine = Module("commandline", { @@ -28,20 +30,31 @@ const CommandLine = Module("commandline", {
({
CLEAR: "browser:purge-session-history",
QUIT: "quit-application",
PRIVATE_END: "last-pb-context-exited",
init: function () {
services.get("obs").addObserver(this, this.CLEAR, false);
services.get("obs").addObserver(this, this.QUIT, false);
services.get("obs").addObserver(this, this.PRIVATE_END, false);
},
observe: function (subject, topic, data) {
switch (topic) {
case this.CLEAR:
["search", "command"].forEach(function (mode) {
CommandLine.History(null, mode).sanitize();
});
CommandLine.History(null, mode, liberator.isPrivateWindow()).sanitize();
}, this);
break;
case this.PRIVATE_END:
for (let [key, obj] in Iterator(storage)) {
if (key.match(/^private-[0-9]/)) {
delete storage[key];
}
}
break;
case this.QUIT:
services.get("obs").removeObserver(this, this.CLEAR);
services.get("obs").removeObserver(this, this.QUIT);
services.get("obs").removeObserver(this, this.PRIVATE_END);
break;
}
}
@ -471,7 +484,9 @@ const CommandLine = Module("commandline", { @@ -471,7 +484,9 @@ const CommandLine = Module("commandline", {
this.show();
this._history = CommandLine.History(this._commandWidget.inputField, (modes.extended == modes.EX) ? "command" : "search");
this._history = CommandLine.History(this._commandWidget.inputField,
(modes.extended == modes.EX) ? "command" : "search",
liberator.isPrivateWindow());
this._completions = CommandLine.Completions(this._commandWidget.inputField);
// open the completion list automatically if wanted
@ -609,7 +624,7 @@ const CommandLine = Module("commandline", { @@ -609,7 +624,7 @@ const CommandLine = Module("commandline", {
action = this._echoMultiline;
}
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || typeof str == "xml" || str instanceof TemplateSupportsXML ) && !(flags & this.FORCE_SINGLELINE))
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || str instanceof TemplateSupportsXML ) && !(flags & this.FORCE_SINGLELINE))
action = this._echoMultiline;
if (single)
@ -662,7 +677,9 @@ const CommandLine = Module("commandline", { @@ -662,7 +677,9 @@ const CommandLine = Module("commandline", {
this.show();
this._commandWidget.focus();
this._history = CommandLine.History(this._commandWidget.inputField, (modes.extended == modes.EX) ? "command" : "search");
this._history = CommandLine.History(this._commandWidget.inputField,
(modes.extended == modes.EX) ? "command" : "search",
liberator.isPrivateWindow());
this._completions = CommandLine.Completions(this._commandWidget.inputField);
},
@ -852,6 +869,9 @@ const CommandLine = Module("commandline", { @@ -852,6 +869,9 @@ const CommandLine = Module("commandline", {
break;
}
}
if (event.type == "click") {
return;
}
@ -860,6 +880,7 @@ const CommandLine = Module("commandline", { @@ -860,6 +880,7 @@ const CommandLine = Module("commandline", {
switch (key) {
// close the window
case "<Esc>":
case "<C-[>":
case "q":
modes.reset();
return; // handled globally in events.js:onEscape()
@ -1028,10 +1049,11 @@ const CommandLine = Module("commandline", { @@ -1028,10 +1049,11 @@ const CommandLine = Module("commandline", {
* @param {string} mode The mode for which we need history.
*/
History: Class("History", {
init: function (inputField, mode) {
init: function (inputField, mode, privateBrowsing) {
this.mode = mode;
this.input = inputField;
this.store = storage["history-" + mode];
this.storeName = liberator.storeName(mode, privateBrowsing);
this.store = storage[this.storeName];
this.reset();
},
/**
@ -1072,10 +1094,9 @@ const CommandLine = Module("commandline", { @@ -1072,10 +1094,9 @@ const CommandLine = Module("commandline", {
if (liberator.has("sanitizer") && (timespan || options["sanitizetimespan"]))
range = sanitizer.getClearRange(timespan || options["sanitizetimespan"]);
const self = this;
this.store.mutate("filter", function (item) {
let timestamp = (item.timestamp || Date.now()/1000) * 1000;
return !line.privateData || timestamp < self.range[0] || timestamp > self.range[1];
return !item.privateData || timestamp < range[0] || timestamp > range[1];
});
},
/**
@ -1556,7 +1577,7 @@ const CommandLine = Module("commandline", { @@ -1556,7 +1577,7 @@ const CommandLine = Module("commandline", {
options.add(["complete", "cpt"],
"Items which are completed at the :open prompts",
"charlist", typeof(config.defaults["complete"]) == "string" ? config.defaults["complete"] : "slf",
"charlist", typeof(config.defaults["complete"]) == "string" ? config.defaults["complete"] : "sl",
{
completer: function (context) array(values(completion.urlCompleters))
});

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/commands.js

@ -1068,7 +1068,7 @@ const Commands = Module("commands", { @@ -1068,7 +1068,7 @@ const Commands = Module("commands", {
var completer = liberator.eval(completeOpt);
if (!(completer instanceof Function))
throw new TypeError("User-defined custom completer " + completeOpt.quote() + " is not a function");
throw new TypeError("User-defined custom completer " + JSON.stringify(completeOpt) + " is not a function");
}
catch (e) {
liberator.echoerr("Unknown function: " + completeOpt);

45
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/editor.js

@ -62,36 +62,6 @@ const Editor = Module("editor", { @@ -62,36 +62,6 @@ const Editor = Module("editor", {
return text.substring(e.selectionStart, e.selectionEnd);
},
pasteClipboard: function () {
if (liberator.has("Windows")) {
this.executeCommand("cmd_paste");
return;
}
// FIXME: #93 (<s-insert> in the bottom of a long textarea bounces up)
let elem = liberator.focus;
if (elem.setSelectionRange && util.readFromClipboard()) {
// 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);
let tempStr2 = util.readFromClipboard();
let tempStr3 = elem.value.substring(rangeEnd);
elem.value = tempStr1 + tempStr2 + tempStr3;
elem.selectionStart = rangeStart + tempStr2.length;
elem.selectionEnd = elem.selectionStart;
elem.scrollTop = curTop;
elem.scrollLeft = curLeft;
}
},
// count is optional, defaults to 1
executeCommand: function (cmd, count) {
let controller = Editor.getController(cmd);
@ -669,17 +639,18 @@ const Editor = Module("editor", { @@ -669,17 +639,18 @@ const Editor = Module("editor", {
["<C-End>"], "Move cursor to end of text field",
function () { editor.executeCommand("cmd_moveBottom", 1); });*/
mappings.add(myModes,
["<S-Insert>"], "Insert clipboard/selection",
function () { editor.pasteClipboard(); });
mappings.add(modes.getCharModes("i"),
["<C-i>"], "Edit text field with an external editor",
function () { editor.editFieldExternally(); });
mappings.add([modes.INSERT],
["<C-t>"], "Edit text field in Vi mode",
function () { liberator.mode = modes.TEXTAREA; });
function () {
let edtr = Editor.getEditor();
if (edtr.setSelectionRange)
edtr.setSelectionRange(edtr.selectionStart - 1, edtr.selectionStart - 1);
liberator.mode = modes.TEXTAREA;
});
mappings.add([modes.INSERT],
["<Space>", "<Return>"], "Expand insert mode abbreviation",
@ -812,7 +783,7 @@ const Editor = Module("editor", { @@ -812,7 +783,7 @@ const Editor = Module("editor", {
function (count, arg) {
let pos = editor.findCharForward(arg, count);
if (pos >= 0)
editor.moveToPosition(pos, true, liberator.mode == modes.VISUAL);
editor.moveToPosition(pos - 1, true, liberator.mode == modes.VISUAL);
},
{ arg: true, count: true });
@ -830,7 +801,7 @@ const Editor = Module("editor", { @@ -830,7 +801,7 @@ const Editor = Module("editor", {
function (count, arg) {
let pos = editor.findCharForward(arg, count);
if (pos >= 0)
editor.moveToPosition(pos - 1, true, liberator.mode == modes.VISUAL);
editor.moveToPosition(pos - 2, true, liberator.mode == modes.VISUAL);
},
{ arg: true, count: true });

5
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/events.js

@ -24,7 +24,7 @@ const Events = Module("events", { @@ -24,7 +24,7 @@ const Events = Module("events", {
this.sessionListeners = [];
this._macros = storage.newMap("macros", { store: true, privateData: true });
this._macros = storage.newMap("macros", { store: true });
// NOTE: the order of ["Esc", "Escape"] or ["Escape", "Esc"]
// matters, so use that string as the first item, that you
@ -1125,7 +1125,8 @@ const Events = Module("events", { @@ -1125,7 +1125,8 @@ const Events = Module("events", {
return ((elem instanceof HTMLInputElement && !/image/.test(elem.type)) ||
elem instanceof HTMLTextAreaElement ||
elem instanceof HTMLObjectElement ||
elem instanceof HTMLEmbedElement);
elem instanceof HTMLEmbedElement ||
(elem && elem.contentEditable === "true"));
}
}, {
commands: function () {

1
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/finder.js

@ -120,6 +120,7 @@ const Finder = Module("finder", { @@ -120,6 +120,7 @@ const Finder = Module("finder", {
this._processUserPattern(str);
let result = fastFind.find(str, this._linksOnly);
window.gFindBar._findField.value = str;
this._displayFindResult(result, this._backwards);
} :
// FIXME: remove when minVersion >= 25
function (str) {

51
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/hints.js

@ -155,7 +155,7 @@ const Hints = Module("hints", { @@ -155,7 +155,7 @@ const Hints = Module("hints", {
case "label":
if (elem.id) {
// TODO: (possibly) do some guess work for label-like objects
let label = util.evaluateXPath(["label[@for=" + elem.id.quote() + "]"], doc).snapshotItem(0);
let label = util.evaluateXPath(["label[@for=" + JSON.stringify(elem.id) + "]"], doc).snapshotItem(0);
if (label)
return [label.textContent.toLowerCase(), true];
}
@ -496,6 +496,10 @@ const Hints = Module("hints", { @@ -496,6 +496,10 @@ const Hints = Module("hints", {
}
}
if (firstHint === null) {
return false;
}
this._tabNavigation[firstHint].prev = lastHint;
this._tabNavigation[lastHint].next = firstHint;
@ -503,9 +507,9 @@ const Hints = Module("hints", { @@ -503,9 +507,9 @@ const Hints = Module("hints", {
let css = [];
// FIXME: Broken for imgspans.
for (let { doc } of this._docs) {
for (let elem in util.evaluateXPath(" {//*[@liberator:highlight and @number]", doc)) {
for (let elem in util.evaluateXPath("//*[@liberator:highlight and @number]", doc)) {
let group = elem.getAttributeNS(NS.uri, "highlight");
css.push(highlight.selector(group) + "[number=" + elem.getAttribute("number").quote() + "] { " + elem.style.cssText + " }");
css.push(highlight.selector(group) + "[number=" + JSON.stringify(elem.getAttribute("number")) + "] { " + elem.style.cssText + " }");
}
}
styles.addSheet(true, "hint-positions", "*", css.join("\n"));
@ -829,6 +833,43 @@ const Hints = Module("hints", { @@ -829,6 +833,43 @@ const Hints = Module("hints", {
};
} //}}}
/**
* Get a hint matcher for hintmatching=fuzzy
*
* The user input can be anything. The matcher looks for occurances of
* the characters in the user input. If all occurances are found in the
* link, in order, the link is relevant.
*
* @param {string} hintString The string typed by the user.
* @returns {function(string):boolean} A function that takes the text
* of a hint and returns true if all characters of the input are
* found in the link.
*/
function fuzzyMatcher(hintString) {
var expression = '';
// Build a regex for fuzzy matching with the input.
//
// If the input is 'abc', the regex will be '[^a]*a[^b]*b[^c]c'.
var escapeChar = new Set("()[{?.*+^$|\\");
for (var i = 0, j = hintString.length; i < j; i ++) {
var char = hintString[i];
if (escapeChar.has(char))
char = "\\" + char;
expression += '[^' + char + ']*' + char;
}
var re = new RegExp(expression, 'i');
return function(linkText) {
var found = linkText.search(re) != -1;
return found;
};
}
let indexOf = String.indexOf;
if (options.get("hintmatching").has("transliterated"))
indexOf = Hints.indexOf;
@ -837,6 +878,7 @@ const Hints = Module("hints", { @@ -837,6 +878,7 @@ const Hints = Module("hints", {
case "contains" : return containsMatcher(hintString);
case "wordstartswith": return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ true);
case "firstletters" : return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ false);
case "fuzzy" : return fuzzyMatcher(hintString);
case "custom" : return liberator.plugins.customHintMatcher(hintString);
default : liberator.echoerr("Invalid hintmatching type: " + hintMatching);
}
@ -1212,7 +1254,7 @@ const Hints = Module("hints", { @@ -1212,7 +1254,7 @@ const Hints = Module("hints", {
},
options: function () {
const DEFAULT_HINTTAGS =
util.makeXPath(["input[not(@type='hidden')]", "a", "area", "iframe", "textarea", "button", "select"])
util.makeXPath(["input[not(@type='hidden' or @disabled)]", "a", "area", "iframe", "textarea", "button", "select"])
+ " | //*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link'or @role='button' or @role='checkbox' or @role='combobox' or @role='listbox' or @role='listitem' or @role='menuitem' or @role='menuitemcheckbox' or @role='menuitemradio' or @role='option' or @role='radio' or @role='scrollbar' or @role='slider' or @role='spinbutton' or @role='tab' or @role='textbox' or @role='treeitem' or @tabindex]"
+ (config.name == "Muttator" ?
" | //xhtml:div[@class='wrappedsender']/xhtml:div[contains(@class,'link')]" :
@ -1264,6 +1306,7 @@ const Hints = Module("hints", { @@ -1264,6 +1306,7 @@ const Hints = Module("hints", {
["contains", "The typed characters are split on whitespace. The resulting groups must all appear in the hint."],
["wordstartswith", "The typed characters are split on whitespace. The resulting groups must all match the beginings of words, in order."],
["firstletters", "Behaves like wordstartswith, but all groups much match a sequence of words."],
["fuzzy", "Hints are matched according to the fuzzy search algorithm."],
["custom", "Delegate to a custom function: liberator.plugins.customHintMatcher(hintString)"],
["transliterated", "When true, special latin characters are translated to their ascii equivalent (e.g., \u00e9 -> e)"]
]

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/io.js

@ -886,7 +886,7 @@ lookup: @@ -886,7 +886,7 @@ lookup:
}
if (!found)
liberator.echoerr("Can't find directory " + arg.quote() + " in cdpath\n" + "Command failed");
liberator.echoerr("Can't find directory " + JSON.stringify(arg) + " in cdpath\n" + "Command failed");
}
}, {
argCount: "?",

10
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/javascript.js

@ -637,8 +637,12 @@ const JavaScript = Module("javascript", { @@ -637,8 +637,12 @@ const JavaScript = Module("javascript", {
options.add(["inspectcontentobjects"],
"Allow completion of JavaScript objects coming from web content. POSSIBLY INSECURE!",
"boolean", false);
options.add(["expandtemplate"],
"Expand TemplateLiteral",
"boolean", !("XMLList" in window));
// TODO: delete me when minVersion is greater than 34
if (!liberator.has("template")) {
options.add(["expandtemplate"],
"Expand TemplateLiteral",
"boolean", !("XMLList" in window));
}
}
})

9
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/liberator-overlay.js

@ -5,7 +5,10 @@ @@ -5,7 +5,10 @@
(function () {
const modules = {};
const BASE = "liberator://template/chrome://liberator/content/"
// TODO: FIXME when minVersion is greater than 34
var {isSupport: TemplateIsSupport} = Components.utils.import("resource://liberator/CheckTemplate.jsm", {});
const BASE = TemplateIsSupport ?
"chrome://liberator/content/" : "liberator://template/chrome://liberator/content/";
modules.modules = modules;
@ -30,8 +33,8 @@ @@ -30,8 +33,8 @@
let prefix = [BASE];
//Cu.import("resource://liberator/template-tag.js", modules);
loader.loadSubScript("resource://liberator/template-tag.js", modules);
// TODO: FIXME when minVersion is greater than 34
Components.utils.import("resource://liberator/template-tag" + (TemplateIsSupport ? ".js" : "-old.js"), modules);
// TODO: This list is much too long, we should try to minimize
// the number of required components for easier porting to new applications

32
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/liberator.js

@ -130,7 +130,7 @@ const Liberator = Module("liberator", { @@ -130,7 +130,7 @@ const Liberator = Module("liberator", {
forceNewPrivateWindow: false,
/** @property {string} The Liberator version string. */
version: "3.8.3 (created: 2014/11/09 13:19:01)", // these VERSION and DATE tokens are replaced by the Makefile
version: "3.9 (created: 2015/02/15 15:49:05)", // these VERSION and DATE tokens are replaced by the Makefile
/**
* @property {Object} The map of command-line options. These are
@ -254,6 +254,25 @@ const Liberator = Module("liberator", { @@ -254,6 +254,25 @@ const Liberator = Module("liberator", {
window.dump(msg.replace(/^./gm, ("config" in modules && config.name.toLowerCase()) + ": $&"));
},
isPrivateWindow: function () {
return window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext)
.usePrivateBrowsing;
},
windowID: function() {
return window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.outerWindowID;
},
storeName: function(mode, isPrivate) {
let prefix = isPrivate ? "private-" + this.windowID() + "-" : "";
return prefix + "history-" + mode ;
},
/**
* Outputs a plain message to the command line.
*
@ -332,6 +351,7 @@ const Liberator = Module("liberator", { @@ -332,6 +351,7 @@ const Liberator = Module("liberator", {
* should be loaded.
*/
loadScript: function (uri, context) {
// TODO: delete me when minVersion is greater than 34
if (options.expandtemplate) {
var prefix = "liberator://template/";
if (uri.lastIndexOf(prefix, 0) === -1)
@ -345,6 +365,7 @@ const Liberator = Module("liberator", { @@ -345,6 +365,7 @@ const Liberator = Module("liberator", {
if (!context)
context = userContext;
// TODO: delete me when minVersion is greater than 34
if (options.expandtemplate) {
var obj = new Object;
Cu.import("resource://liberator/template.js", obj);
@ -644,7 +665,7 @@ const Liberator = Module("liberator", { @@ -644,7 +665,7 @@ const Liberator = Module("liberator", {
if (helpFile in services.get("liberator:").FILE_MAP)
liberator.open("liberator://help/" + helpFile, { from: "help" });
else
liberator.echomsg("Sorry, help file " + helpFile.quote() + " not found");
liberator.echomsg("Sorry, help file " + JSON.stringify(helpFile) + " not found");
return;
}
@ -1169,10 +1190,7 @@ const Liberator = Module("liberator", { @@ -1169,10 +1190,7 @@ const Liberator = Module("liberator", {
win.setAttribute("titlemodifier_normal", value);
win.setAttribute("titlemodifier_privatebrowsing", value + suffix);
if (window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext)
.usePrivateBrowsing) {
if (liberator.isPrivateWindow()) {
win.setAttribute("titlemodifier", value + suffix);
}
else
@ -1355,7 +1373,7 @@ const Liberator = Module("liberator", { @@ -1355,7 +1373,7 @@ const Liberator = Module("liberator", {
liberator.echoerr("Invalid argument: " + arg);
}
catch (e) {
liberator.echoerr("Error opening " + arg.quote() + ": " + e);
liberator.echoerr("Error opening " + JSON.stringify(arg) + ": " + e);
}
}, {
argCount: "1",

8
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/marks.js

@ -11,8 +11,8 @@ const Marks = Module("marks", { @@ -11,8 +11,8 @@ const Marks = Module("marks", {
requires: ["config", "storage"],
init: function init() {
this._localMarks = storage.newMap("local-marks", { store: true, privateData: true });
this._urlMarks = storage.newMap("url-marks", { store: false, privateData: true });
this._localMarks = storage.newMap("local-marks", { store: true });
this._urlMarks = storage.newMap("url-marks", { store: false });
this._pendingJumps = [];
},
@ -166,7 +166,7 @@ const Marks = Module("marks", { @@ -166,7 +166,7 @@ const Marks = Module("marks", {
if (filter.length > 0) {
marks = marks.filter(function (mark) filter.indexOf(mark[0]) >= 0);
liberator.assert(marks.length > 0, "No matching marks for: " + filter.quote());
liberator.assert(marks.length > 0, "No matching marks for: " + JSON.stringify(filter));
}
let list = template.tabular(
@ -306,7 +306,7 @@ const Marks = Module("marks", { @@ -306,7 +306,7 @@ const Marks = Module("marks", {
// ignore invalid mark characters unless there are no valid mark chars
liberator.assert(!args || /[a-zA-Z]/.test(args),
"No matching marks for: " + args.quote());
"No matching marks for: " + JSON.stringify(args));
let filter = args.replace(/[^a-zA-Z]/g, "");
marks.list(filter);

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/options.js

@ -532,7 +532,7 @@ const Options = Module("options", { @@ -532,7 +532,7 @@ const Options = Module("options", {
if (option.name in this._optionHash) {
// never replace for now
liberator.echomsg("Option '" + names[0].quote() + "' already exists, NOT replacing existing option.");
liberator.echomsg("Option '" + JSON.stringify(names[0]) + "' already exists, NOT replacing existing option.");
return false;
}

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/quickmarks.js

@ -12,7 +12,7 @@ const QuickMarks = Module("quickmarks", { @@ -12,7 +12,7 @@ const QuickMarks = Module("quickmarks", {
requires: ["config", "storage"],
init: function () {
this._qmarks = storage.newMap("quickmarks", { store: true, privateData: true });
this._qmarks = storage.newMap("quickmarks", { store: true });
},
/**

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/sanitizer.js

@ -74,7 +74,7 @@ const Sanitizer = Module("sanitizer", { @@ -74,7 +74,7 @@ const Sanitizer = Module("sanitizer", {
commands.add(["sa[nitize]"],
"Clear private data",
function (args) {
liberator.assert(!options['private'], "Cannot sanitize items in private mode");
liberator.assert(!liberator.isPrivateWindow(), "Cannot sanitize items in private mode");
let timespan = args["-timespan"] == undefined ? options["sanitizetimespan"] : args["-timespan"];

4
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/services.js

@ -42,10 +42,6 @@ const Services = Module("services", { @@ -42,10 +42,6 @@ const Services = Module("services", {
class_: "@mozilla.org/browser/nav-history-service;1",
iface: [Ci.nsINavHistoryService, Ci.nsIBrowserHistory]
},
"privateBrowsing": {
class_: "@mozilla.org/privatebrowsing;1",
iface: Ci.nsIPrivateBrowsingService
},
"profile": {
class_: "@mozilla.org/toolkit/profile-service;1",
iface: Ci.nsIToolkitProfileService

8
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/statusline.js

@ -8,9 +8,9 @@ @@ -8,9 +8,9 @@
/**
* @param {String} name
* @param {String} description
* @param {String|TemplateXML} node
* @param {String|TemplateSupportsXML} node
* String : the id attribute value of the existing node
* TemplateXML: a TemplateXML instance. e.g) xml`<xul:label ...>`
* TemplateSupportsXML: a TemplateSupportsXML instance. e.g) xml`<xul:label ...>`
* @param {Function} updater
* @param {Object} extraInfo
*/
@ -26,13 +26,13 @@ const StatusField = Class("StatusField", { @@ -26,13 +26,13 @@ const StatusField = Class("StatusField", {
if (!this.node)
throw new Error('the element is not found: "' + node + '"');
}
else if (node instanceof TemplateXML) {
else if (node instanceof TemplateSupportsXML) {
this.node = util.xmlToDom(node, document);
this.node.setAttribute("id", "liberator-status-" + name);
statusline._statuslineWidget.appendChild(this.node);
}
else
throw new TypeError("the argument node must be String or TemplateXML: " + node);
throw new TypeError("the argument node must be String or TemplateSupportsXML: " + node);
this.node.hidden = true;
if (extraInfo)

6
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/style.js

@ -339,9 +339,9 @@ function Styles(name, store) { @@ -339,9 +339,9 @@ function Styles(name, store) {
const storage = modules.storage;
const ios = services.get("io");
const sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
const namespace = "@namespace html " + XHTML.uri.quote() + ";\n" +
"@namespace xul " + XUL.uri.quote() + ";\n" +
"@namespace liberator " + NS.uri.quote() + ";\n";
const namespace = "@namespace html " + JSON.stringify(XHTML.uri) + ";\n" +
"@namespace xul " + JSON.stringify(XUL.uri) + ";\n" +
"@namespace liberator " + JSON.stringify(NS.uri) + ";\n";
const Sheet = Struct("name", "id", "sites", "css", "system", "agent");
Sheet.prototype.__defineGetter__("fullCSS", function wrapCSS() {

8
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/template.js

@ -33,7 +33,7 @@ const Template = Module("template", { @@ -33,7 +33,7 @@ const Template = Module("template", {
},
maybeXML: function maybeXML(val) {
if (typeof val == "xml" || val instanceof TemplateSupportsXML)
if (val instanceof TemplateSupportsXML)
return val;
try {
@ -98,7 +98,7 @@ const Template = Module("template", { @@ -98,7 +98,7 @@ const Template = Module("template", {
return xml`<span highlight="Number">${str}</span>`;
case "string":
if (processStrings)
str = str.quote();
str = JSON.stringify(str);
return xml`<span highlight="String">${str}</span>`;
case "boolean":
return xml`<span highlight="Boolean">${str}</span>`;
@ -120,8 +120,6 @@ const Template = Module("template", { @@ -120,8 +120,6 @@ const Template = Module("template", {
if (processStrings && false)
str = template.highlightFilter(str, "\n", function () xml`<span highlight="NonText">^J</span>`);
return xml`<span highlight="Object">${str}</span>`;
case "xml":
return arg;
default:
return `<unknown type>`;
}
@ -181,7 +179,7 @@ const Template = Module("template", { @@ -181,7 +179,7 @@ const Template = Module("template", {
},
highlightSubstrings: function highlightSubstrings(str, iter, highlight) {
if (typeof str == "xml" || str instanceof TemplateSupportsXML)
if (str instanceof TemplateSupportsXML)
return str;
if (str == "")
return xml`${str}`;

76
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/content/util.js

@ -5,22 +5,18 @@ @@ -5,22 +5,18 @@
/** @scope modules */
//xxx:
this.$$Namespace = function (prefix, uri) {
return "XMLList" in window ? Namespace(prefix, uri)
: {
prefix: prefix,
uri: uri,
toString: function () {
return this.uri;
},
const {XHTML, XUL, NS} = (function () {
function Namespace(prefix, uri) {
this.prefix = prefix;
this.uri = uri;
}
Namespace.prototype.toString = function toString() { return this.uri; };
return {
XHTML: new Namespace("html", "http://www.w3.org/1999/xhtml"),
XUL : new Namespace("xul", "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"),
NS : new Namespace("liberator", "http://vimperator.org/namespaces/liberator"),
};
}
const XHTML = $$Namespace("html", "http://www.w3.org/1999/xhtml");
const XUL = $$Namespace("xul", "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
const NS = $$Namespace("liberator", "http://vimperator.org/namespaces/liberator");
if ("XMLList" in window) eval("default xml namespace = XHTML");
delete this.$$Namespace;
})();
const Util = Module("util", {
init: function () {
@ -285,7 +281,7 @@ const Util = Module("util", { @@ -285,7 +281,7 @@ const Util = Module("util", {
data.push("<"); data.push(node.localName);
if (node instanceof HTMLHtmlElement)
data.push(" xmlns=" + XHTML.uri.quote());
data.push(" xmlns=" + JSON.stringify(XHTML.uri));
for (let { name: name, value: value } in util.Array.itervalues(node.attributes)) {
if (name == "liberator:highlight") {
@ -408,9 +404,15 @@ const Util = Module("util", { @@ -408,9 +404,15 @@ const Util = Module("util", {
if (services.get("vc").compare(Application.version, "33") >= 0
&& Cu.isXrayWrapper(result)) {
let (xr = result, s = asIterator ? "iterateNext" : "snapshotItem") {
result = Object.create(xr);
result[s] = xr[s].bind(xr);
let xr = result;
if (asIterator) {
result = { iterateNext: function iterateNext() xr.iterateNext()};
} else {
result = {
snapshotItem: function snapshotItem(num) xr.snapshotItem(num),
get snapshotLength() xr.snapshotLength,
};
}
}
@ -731,9 +733,6 @@ const Util = Module("util", { @@ -731,9 +733,6 @@ const Util = Module("util", {
* @returns {Node|DocumentFragment}
*/
xmlToDom: function xmlToDom(node, doc, nodes) {
if (typeof node === "xml")
return this.xmlToDomForE4X(node, doc, nodes);
var dom = this.xmlToDomForTemplate(node, doc, nodes);
//xxx: change highlight's namespace
@ -747,39 +746,6 @@ const Util = Module("util", { @@ -747,39 +746,6 @@ const Util = Module("util", {
}
return dom;
},
/**
* Converts an E4X XML literal to a DOM node.
*
* @param {Node} node
* @param {Document} doc
* @param {Object} nodes
* @returns {Node}
* @deprecated
* @see util.xmlToDom
*/
xmlToDomForE4X: function xmlToDomForE4X(node, doc, nodes) {
if (node.length() != 1) {
let domnode = doc.createDocumentFragment();
for each (let child in node)
domnode.appendChild(arguments.callee(child, doc, nodes));
return domnode;
}
switch (node.nodeKind()) {
case "text":
return doc.createTextNode(String(node));
case "element":
let domnode = doc.createElementNS(node.namespace(), node.localName());
for each (let attr in node.attributes())
domnode.setAttributeNS(attr.name() == "highlight" ? NS.uri : attr.namespace(), attr.name(), String(attr));
for each (let child in node.children())
domnode.appendChild(arguments.callee(child, doc, nodes));
if (nodes && node.attribute("key"))
nodes[node.attribute("key")] = domnode;
return domnode;
default:
return null;
}
},
/**
* Converts an string of TemplateXML object to a DOM node.
*

4
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/en-US/hints.xml

@ -76,7 +76,7 @@ tedious unless you always visit the first link on a page. @@ -76,7 +76,7 @@ tedious unless you always visit the first link on a page.
<li><tag>;s</tag> <em>s</em> to save a link's destination</li>
<li><tag>;S</tag> <em>S</em> to save a media object</li>
<li><tag>;a</tag> <em>a</em> to save a link's destination (prompting for save location)</li>
<li><tag>;A</tag> <em>B</em> to save a media object (prompting for save location)</li>
<li><tag>;A</tag> <em>A</em> to save a media object (prompting for save location)</li>
<li><tag>;f</tag> <em>f</em> to focus a frame</li>
<li><tag>;o</tag> <em>o</em> to open its location in the current tab</li>
<li><tag>;t</tag> <em>t</em> to open its location in a new tab</li>
@ -93,7 +93,7 @@ tedious unless you always visit the first link on a page. @@ -93,7 +93,7 @@ tedious unless you always visit the first link on a page.
<li><tag>;c</tag> <em>c</em> to open its context menu</li>
<li><tag>;i</tag> <em>i</em> to open a media object</li>
<li><tag>;I</tag> <em>I</em> to open a media object in a new tab</li>
<li><tag>;x</tag> <em>A</em> to display an element's title text, or alt text if none.</li>
<li><tag>;x</tag> <em>x</em> to display an element's title text, or alt text if none.</li>
</ul>
<p>

2
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/en-US/map.xml

@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
<item>
<tags>:unm :unmap</tags>
<spec>:map <a>lhs</a> <a>rhs</a></spec>
<spec>:unm<oa>ap</oa> <a>lhs</a> <a>rhs</a></spec>
<tags>:nun :nunmap</tags>
<spec>:nun<oa>map</oa> <a>lhs</a> <a>rhs</a></spec>
<tags>:vun :vunmap</tags>

22
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/en-US/options.xml

@ -326,7 +326,7 @@ @@ -326,7 +326,7 @@
<tags>'cpt' 'complete'</tags>
<spec>'complete' 'cpt'</spec>
<type>charlist</type>
<default>slf</default>
<default>sl</default>
<description>
<p>Items which are completed at the <ex>:open</ex> prompts. Available items:</p>
@ -596,6 +596,7 @@ @@ -596,6 +596,7 @@
<dt>contains</dt> <dd>The typed characters are split on whitespace, and these character groups have to match anywhere inside the text of the link.</dd>
<dt>wordstartswith</dt> <dd>The typed characters are matched with the beginning of the first word (see <o>wordseparators</o>) in the link as long as possible. If no matches occur in the current word, then the matching is continued at the beginning of the next word. The words are worked through in the order they appear in the link. If the typed characters contain spaces, then the characters are split on whitespace. These character groups are then matched with the beginning of the words, beginning at the first one and continuing with the following words in the order they appear in the link.</dd>
<dt>firstletters</dt> <dd>Behaves like wordstartswith, but non-matching words aren't overleaped.</dd>
<dt>fuzzy</dt> <dd>Hints are matched according to the fuzzy search algorithm.</dd>
<dt>custom</dt> <dd>Delegate to a custom function: liberator.plugins.customHintMatcher(hintString)</dd>
</dl>
</description>
@ -606,7 +607,7 @@ @@ -606,7 +607,7 @@
<tags>'ht' 'hinttags'</tags>
<spec>'hinttags' 'ht'</spec>
<type>string</type>
<default>//input[not(@type='hidden')] | //xhtml:input[not(@type='hidden')] | //a | //xhtml:a | //area | //xhtml:area | //iframe | //xhtml:iframe | //textarea | //xhtml:textarea | //button | //xhtml:button | //select | //xhtml:select | //*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link'or @role='button' or @role='checkbox' or @role='combobox' or @role='listbox' or @role='listitem' or @role='menuitem' or @role='menuitemcheckbox' or @role='menuitemradio' or @role='option' or @role='radio' or @role='scrollbar' or @role='slider' or @role='spinbutton' or @role='tab' or @role='textbox' or @role='treeitem' or @tabindex]</default>
<default>//input[not(@type='hidden' or @disabled)] | //xhtml:input[not(@type='hidden')] | //a | //xhtml:a | //area | //xhtml:area | //iframe | //xhtml:iframe | //textarea | //xhtml:textarea | //button | //xhtml:button | //select | //xhtml:select | //*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link'or @role='button' or @role='checkbox' or @role='combobox' or @role='listbox' or @role='listitem' or @role='menuitem' or @role='menuitemcheckbox' or @role='menuitemradio' or @role='option' or @role='radio' or @role='scrollbar' or @role='slider' or @role='spinbutton' or @role='tab' or @role='textbox' or @role='treeitem' or @tabindex]</default>
<description>
<p>XPath string of hintable elements activated by <k>f</k> and <k>F</k></p>
</description>
@ -639,23 +640,6 @@ @@ -639,23 +640,6 @@
</item>
<item>
<tags>'noprivate' 'private'</tags>
<spec>'private'</spec>
<type>boolean</type>
<default>off</default>
<description>
<p>
Set the <str>private browsing</str> option. In private browsing mode
history, cache files, cookies, form data, passwords, download list
entries, local and URL marks, command-line history and macros are
available only for the duration of the private browsing session and
deleted when returning to normal browsing mode.
</p>
</description>
</item>
<item>
<tags>'nohls' 'nohlsearch'</tags>
<tags>'hls' 'hlsearch'</tags>

40
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/all.xml

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/help.xsl"?>
<!DOCTYPE document SYSTEM "chrome://liberator/content/liberator.dtd">
<document
name="all"
title="&liberator.appname; All"
xmlns="http://vimperator.org/namespaces/liberator"
xmlns:html="http://www.w3.org/1999/xhtml">
<tags>all</tags>
<toc/>
<include href="intro" tag="intro.html"/>
<include href="starting" tag="starting.html"/>
<include href="browsing" tag="browsing.html"/>
<include href="buffer" tag="buffer.html"/>
<include href="cmdline" tag="cmdline.html"/>
<include href="insert" tag="insert.html"/>
<include href="options" tag="options.html"/>
<include href="pattern" tag="pattern.html"/>
<include href="tabs" tag="tabs.html"/>
<include href="hints" tag="hints.html"/>
<include href="map" tag="map.html"/>
<include href="eval" tag="eval.html"/>
<include href="marks" tag="marks.html"/>
<include href="repeat" tag="repeat.html"/>
<include href="autocommands" tag="autocommands.html"/>
<include href="print" tag="print.html"/>
<include href="gui" tag="gui.html"/>
<include href="styling" tag="styling.html"/>
<include href="message" tag="message.html"/>
<include href="developer" tag="developer.html"/>
<include href="various" tag="various.html"/>
<include href="plugins" tag="plugins.html"/>
<include href="index" tag="index.html"/>
</document>
<!-- vim:se sts=4 sw=4 et: -->

101
vimperator/pkg/vimperator/usr/lib/firefox/browser/extensions/vimperator@mozdev.org/common/locale/ja/autocommands.xml

@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/help.xsl"?>
<!DOCTYPE document SYSTEM "chrome://liberator/content/liberator.dtd">
<document
name="autocommands"
title="&liberator.appname; Autocommands"
xmlns="http://vimperator.org/namespaces/liberator"
xmlns:html="http://www.w3.org/1999/xhtml">
<h1 tag="autocommands">オートコマンド</h1>
<toc start="2"/>
<p>
オートコマンドは特定のイベントが発生した際にコードを自動的に
実行する手段です。
</p>
<item>
<tags>:au :autocmd</tags>
<spec>:au[tocmd]</spec>
<description>
<p>イベントが発生した際にコマンドを自動的に実行します。</p>
<p><ex>:au[tocmd]</ex> <a>event</a> <a>pat</a> <a>cmd</a></p>
<p>
もし、<em>-javascript</em>(短縮名:<em>-js</em>)がしてされた場合、
<a>cmd</a>は、JavaScriptコードとして実行されます。
また、どの変数も引数として渡されます。
</p>
<p>
<a>pat</a>にマッチする URL で<a>event</a>が発生した際に &liberator.appname;
が実行するコマンドのリストに<a>cmd</a>を追加します:
</p>
<ul>
<li><ex>:autocmd[!]</ex> <a>events</a> <a>pat</a>: <a>events</a><a>pat</a>にマッチするオートコマンドを一覧表示/削除します</li>
<li><ex>:autocmd[!]</ex> <a>events</a>: <a>events</a>にマッチするオートコマンドを一覧表示/削除します</li>
<li><ex>:autocmd[!]</ex> <a>pat</a>: <a>pat</a>にマッチするオートコマンドを一覧表示/削除します</li>
<li><ex>:autocmd[!]</ex>: すべてのオートコマンドを一覧表示/削除します</li>
</ul>
<p>利用可能な<a>events</a>:</p>
<dl tag="autocommand-list"/>
<p><a>pat</a>は正規表現です。すべての URL にマッチさせたい場合、<tt>.*</tt>を使ってください。</p>
<note><a>pat</a>に正規表現ではなくグロブを使う Vim とは異なります。</note>
<p>関連するイベントにおいて以下のキーワードが利用可能です:</p>
<dl tag="autocommand-args"/>
</description>
</item>
<item