Major documentation updates and formatting fixes, and many, many other changes thanks to an MQ glitch, including:
* Significant completion speed improvements * Significantly improve startup speed, in large part by lazily instantiating Options and Commands, lazily installing highlight stylesheets, etc. * Update logos and icons, fix atrocious about page * Fix Teledactyl * JavaScript completion now avoids accessing property values * Add Option#persist to define which options are saved with :mkp * Add new Dactyl component which holds add-on-specific configuration information and removes need for separate components for each dactyl host * Several fixes for latest nightlies * Significant code cleanup and many bug fixes --HG-- rename : muttator/AUTHORS => teledactyl/AUTHORS rename : muttator/Donors => teledactyl/Donors rename : muttator/Makefile => teledactyl/Makefile rename : muttator/NEWS => teledactyl/NEWS rename : muttator/TODO => teledactyl/TODO rename : muttator/chrome.manifest => teledactyl/chrome.manifest rename : muttator/components/commandline-handler.js => teledactyl/components/commandline-handler.js rename : muttator/components/protocols.js => teledactyl/components/protocols.js rename : muttator/content/addressbook.js => teledactyl/content/addressbook.js rename : muttator/content/compose/compose.js => teledactyl/content/compose/compose.js rename : muttator/content/compose/compose.xul => teledactyl/content/compose/compose.xul rename : muttator/content/compose/dactyl.dtd => teledactyl/content/compose/dactyl.dtd rename : muttator/content/compose/dactyl.xul => teledactyl/content/compose/dactyl.xul rename : muttator/content/config.js => teledactyl/content/config.js rename : muttator/content/dactyl.dtd => teledactyl/content/dactyl.dtd rename : muttator/content/logo.png => teledactyl/content/logo.png rename : muttator/content/mail.js => teledactyl/content/mail.js rename : muttator/content/muttator.xul => teledactyl/content/pentadactyl.xul rename : muttator/contrib/vim/Makefile => teledactyl/contrib/vim/Makefile rename : muttator/contrib/vim/ftdetect/muttator.vim => teledactyl/contrib/vim/ftdetect/muttator.vim rename : muttator/contrib/vim/mkvimball.txt => teledactyl/contrib/vim/mkvimball.txt rename : muttator/contrib/vim/syntax/muttator.vim => teledactyl/contrib/vim/syntax/muttator.vim rename : muttator/install.rdf => teledactyl/install.rdf rename : muttator/locale/en-US/Makefile => teledactyl/locale/en-US/Makefile rename : muttator/locale/en-US/all.xml => teledactyl/locale/en-US/all.xml rename : muttator/locale/en-US/autocommands.xml => teledactyl/locale/en-US/autocommands.xml rename : muttator/locale/en-US/gui.xml => teledactyl/locale/en-US/gui.xml rename : muttator/locale/en-US/intro.xml => teledactyl/locale/en-US/intro.xml rename : muttator/skin/icon.png => teledactyl/skin/icon.png
@@ -1,6 +1,6 @@
|
|||||||
Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
2008-2009 by Kris Maglione <maglione.k at Gmail>
|
2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
|
|
||||||
For a full list of authors, refer the AUTHORS file.
|
For a full list of authors, refer the AUTHORS file.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2009 Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -35,6 +35,7 @@ function makeChannel(url, orig) {
|
|||||||
url = dataURL.apply(null, url());
|
url = dataURL.apply(null, url());
|
||||||
let uri = ioService.newURI(url, null, null);
|
let uri = ioService.newURI(url, null, null);
|
||||||
let channel = ioService.newChannelFromURI(uri);
|
let channel = ioService.newChannelFromURI(uri);
|
||||||
|
channel.contentCharset = "UTF-8";
|
||||||
channel.owner = systemPrincipal;
|
channel.owner = systemPrincipal;
|
||||||
channel.originalURI = orig;
|
channel.originalURI = orig;
|
||||||
return channel;
|
return channel;
|
||||||
@@ -45,6 +46,27 @@ function redirect(to, orig, time) {
|
|||||||
return makeChannel(dataURL('text/html', html), ioService.newURI(to, null, null));
|
return makeChannel(dataURL('text/html', html), ioService.newURI(to, null, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AboutHandler() {}
|
||||||
|
AboutHandler.prototype = {
|
||||||
|
|
||||||
|
classDescription: "About " + Dactyl.prototype.name + " Page",
|
||||||
|
|
||||||
|
classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),
|
||||||
|
|
||||||
|
contractID: "@mozilla.org/network/protocol/about;1?what=" + Dactyl.prototype.appname,
|
||||||
|
|
||||||
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
||||||
|
|
||||||
|
newChannel: function (uri) {
|
||||||
|
let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
|
||||||
|
.newChannel("chrome://dactyl/content/about.xul", null, null);
|
||||||
|
channel.originalURI = uri;
|
||||||
|
return channel;
|
||||||
|
},
|
||||||
|
|
||||||
|
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
|
||||||
|
};
|
||||||
|
|
||||||
function ChromeData() {}
|
function ChromeData() {}
|
||||||
ChromeData.prototype = {
|
ChromeData.prototype = {
|
||||||
contractID: "@mozilla.org/network/protocol;1?name=chrome-data",
|
contractID: "@mozilla.org/network/protocol;1?name=chrome-data",
|
||||||
@@ -53,10 +75,10 @@ ChromeData.prototype = {
|
|||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
||||||
_xpcom_factory: {
|
_xpcom_factory: {
|
||||||
createInstance: function (outer, iid) {
|
createInstance: function (outer, iid) {
|
||||||
if (!ChromeData.instance)
|
|
||||||
ChromeData.instance = new ChromeData();
|
|
||||||
if (outer != null)
|
if (outer != null)
|
||||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||||
|
if (!ChromeData.instance)
|
||||||
|
ChromeData.instance = new ChromeData();
|
||||||
return ChromeData.instance.QueryInterface(iid);
|
return ChromeData.instance.QueryInterface(iid);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -89,7 +111,6 @@ ChromeData.prototype = {
|
|||||||
function Dactyl() {
|
function Dactyl() {
|
||||||
this.wrappedJSObject = this;
|
this.wrappedJSObject = this;
|
||||||
|
|
||||||
const self = this;
|
|
||||||
this.HELP_TAGS = {};
|
this.HELP_TAGS = {};
|
||||||
this.FILE_MAP = {};
|
this.FILE_MAP = {};
|
||||||
this.OVERLAY_MAP = {};
|
this.OVERLAY_MAP = {};
|
||||||
@@ -101,14 +122,16 @@ Dactyl.prototype = {
|
|||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
||||||
_xpcom_factory: {
|
_xpcom_factory: {
|
||||||
createInstance: function (outer, iid) {
|
createInstance: function (outer, iid) {
|
||||||
if (!Dactyl.instance)
|
|
||||||
Dactyl.instance = new Dactyl();
|
|
||||||
if (outer != null)
|
if (outer != null)
|
||||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||||
|
if (!Dactyl.instance)
|
||||||
|
Dactyl.instance = new Dactyl();
|
||||||
return Dactyl.instance.QueryInterface(iid);
|
return Dactyl.instance.QueryInterface(iid);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
__proto__: Cc["@dactyl.googlecode.com/base/dactyl"].getService().wrappedJSObject,
|
||||||
|
|
||||||
init: function (obj) {
|
init: function (obj) {
|
||||||
for each (let prop in ["HELP_TAGS", "FILE_MAP", "OVERLAY_MAP"]) {
|
for each (let prop in ["HELP_TAGS", "FILE_MAP", "OVERLAY_MAP"]) {
|
||||||
this[prop] = this[prop].constructor();
|
this[prop] = this[prop].constructor();
|
||||||
@@ -125,9 +148,9 @@ Dactyl.prototype = {
|
|||||||
| nsIProtocolHandler.URI_IS_LOCAL_RESOURCE,
|
| nsIProtocolHandler.URI_IS_LOCAL_RESOURCE,
|
||||||
|
|
||||||
newURI: function (spec, charset, baseURI) {
|
newURI: function (spec, charset, baseURI) {
|
||||||
var uri = Components.classes["@mozilla.org/network/standard-url;1"]
|
var uri = Cc["@mozilla.org/network/standard-url;1"]
|
||||||
.createInstance(Components.interfaces.nsIStandardURL)
|
.createInstance(Ci.nsIStandardURL)
|
||||||
.QueryInterface(Components.interfaces.nsIURI);
|
.QueryInterface(Ci.nsIURI);
|
||||||
uri.init(uri.URLTYPE_STANDARD, this.defaultPort, spec, charset, baseURI);
|
uri.init(uri.URLTYPE_STANDARD, this.defaultPort, spec, charset, baseURI);
|
||||||
return uri;
|
return uri;
|
||||||
},
|
},
|
||||||
@@ -139,13 +162,13 @@ Dactyl.prototype = {
|
|||||||
|
|
||||||
switch(uri.host) {
|
switch(uri.host) {
|
||||||
case "help":
|
case "help":
|
||||||
let url = this.FILE_MAP[uri.path.replace(/^\/|#.*/g, "")];
|
let url = this.FILE_MAP[decodeURIComponent(uri.path.replace(/^\/|#.*/g, ""))];
|
||||||
return makeChannel(url, uri);
|
return makeChannel(url, uri);
|
||||||
case "help-overlay":
|
case "help-overlay":
|
||||||
url = this.OVERLAY_MAP[uri.path.replace(/^\/|#.*/g, "")];
|
url = this.OVERLAY_MAP[decodeURIComponent(uri.path.replace(/^\/|#.*/g, ""))];
|
||||||
return makeChannel(url, uri);
|
return makeChannel(url, uri);
|
||||||
case "help-tag":
|
case "help-tag":
|
||||||
let tag = uri.path.substr(1);
|
let tag = decodeURIComponent(uri.path.substr(1));
|
||||||
if (tag in this.HELP_TAGS)
|
if (tag in this.HELP_TAGS)
|
||||||
return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag, uri);
|
return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag, uri);
|
||||||
}
|
}
|
||||||
@@ -155,9 +178,19 @@ Dactyl.prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// A hack to get infermation about interfaces.
|
||||||
|
// Doesn't belong here.
|
||||||
|
function Shim() {}
|
||||||
|
Shim.prototype = {
|
||||||
|
contractID: "@dactyl.googlecode.com/base/xpc-interface-shim",
|
||||||
|
classID: Components.ID("{f4506a17-5b4d-4cd9-92d4-2eb4630dc388}"),
|
||||||
|
classDescription: "XPCOM empty interface shim",
|
||||||
|
QueryInterface: function () this
|
||||||
|
};
|
||||||
|
|
||||||
if (XPCOMUtils.generateNSGetFactory)
|
if (XPCOMUtils.generateNSGetFactory)
|
||||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeData, Dactyl]);
|
const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||||
else
|
else
|
||||||
const NSGetModule = XPCOMUtils.generateNSGetModule([ChromeData, Dactyl]);
|
const NSGetModule = XPCOMUtils.generateNSGetModule([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -18,7 +18,7 @@ const AutoCommands = Module("autocommands", {
|
|||||||
this._store = [];
|
this._store = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
__iterator__: function () util.Array.itervalues(this._store),
|
__iterator__: function () array.itervalues(this._store),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new autocommand. <b>cmd</b> will be executed when one of the
|
* Adds a new autocommand. <b>cmd</b> will be executed when one of the
|
||||||
@@ -94,7 +94,7 @@ const AutoCommands = Module("autocommands", {
|
|||||||
+
|
+
|
||||||
template.map(items, function (item)
|
template.map(items, function (item)
|
||||||
<tr>
|
<tr>
|
||||||
<td> {item.pattern.source}</td>
|
<td> {item.pattern.source}</td>
|
||||||
<td>{item.command}</td>
|
<td>{item.command}</td>
|
||||||
</tr>))
|
</tr>))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -11,13 +11,11 @@ const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";
|
|||||||
// also includes methods for dealing with keywords and search engines
|
// also includes methods for dealing with keywords and search engines
|
||||||
const Bookmarks = Module("bookmarks", {
|
const Bookmarks = Module("bookmarks", {
|
||||||
init: function () {
|
init: function () {
|
||||||
let bookmarkObserver = function (key, event, arg) {
|
storage.addObserver("bookmark-cache", function (key, event, arg) {
|
||||||
if (event == "add")
|
if (event == "add")
|
||||||
autocommands.trigger("BookmarkAdd", arg);
|
autocommands.trigger("BookmarkAdd", arg);
|
||||||
statusline.updateUrl();
|
statusline.updateUrl();
|
||||||
};
|
}, window);
|
||||||
|
|
||||||
storage.addObserver("bookmark-cache", bookmarkObserver, window);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get format() ({
|
get format() ({
|
||||||
@@ -36,7 +34,8 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
add: function add(starOnly, title, url, keyword, tags, force) {
|
add: function add(starOnly, title, url, keyword, tags, force) {
|
||||||
try {
|
try {
|
||||||
let uri = util.createURI(url);
|
let uri = util.createURI(url);
|
||||||
if (!force) {
|
if (!force && bookmarks.isBookmarked(uri.spec)) {
|
||||||
|
// WTF? This seems wrong... --Kris
|
||||||
for (let bmark in bookmarkcache) {
|
for (let bmark in bookmarkcache) {
|
||||||
if (bmark[0] == uri.spec) {
|
if (bmark[0] == uri.spec) {
|
||||||
var id = bmark[5];
|
var id = bmark[5];
|
||||||
@@ -74,21 +73,22 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
|
|
||||||
let count = this.remove(url);
|
let count = this.remove(url);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
commandline.echo("Removed bookmark: " + url, commandline.HL_NORMAL, commandline.FORCE_SINGLELINE);
|
dactyl.echomsg({ domains: [util.getHost(url)], message: "Removed bookmark: " + url });
|
||||||
else {
|
else {
|
||||||
let title = buffer.title || url;
|
let title = buffer.title || url;
|
||||||
let extra = "";
|
let extra = "";
|
||||||
if (title != url)
|
if (title != url)
|
||||||
extra = " (" + title + ")";
|
extra = " (" + title + ")";
|
||||||
this.add(true, title, url);
|
this.add(true, title, url);
|
||||||
commandline.echo("Added bookmark: " + url + extra, commandline.HL_NORMAL, commandline.FORCE_SINGLELINE);
|
dactyl.echomsg({ domains: [util.getHost(url)], message: "Added bookmark: " + url + extra });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isBookmarked: function isBookmarked(url) {
|
isBookmarked: function isBookmarked(url) {
|
||||||
try {
|
try {
|
||||||
return services.get("bookmarks").getBookmarkIdsForURI(makeURI(url), {})
|
return services.get("bookmarks")
|
||||||
.some(bookmarkcache.isRegularBookmark);
|
.getBookmarkIdsForURI(makeURI(url), {})
|
||||||
|
.some(bookmarkcache.closure.isRegularBookmark);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return false;
|
return false;
|
||||||
@@ -99,13 +99,14 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
remove: function remove(url) {
|
remove: function remove(url) {
|
||||||
try {
|
try {
|
||||||
let uri = util.newURI(url);
|
let uri = util.newURI(url);
|
||||||
let bmarks = services.get("bookmarks").getBookmarkIdsForURI(uri, {})
|
let bmarks = services.get("bookmarks")
|
||||||
.filter(bookmarkcache.isRegularBookmark);
|
.getBookmarkIdsForURI(uri, {})
|
||||||
|
.filter(bookmarkcache.closure.isRegularBookmark);
|
||||||
bmarks.forEach(services.get("bookmarks").removeItem);
|
bmarks.forEach(services.get("bookmarks").removeItem);
|
||||||
return bmarks.length;
|
return bmarks.length;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.log(e, 0);
|
dactyl.reportError(e);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -287,7 +288,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
args.completeFilter = have.pop();
|
args.completeFilter = have.pop();
|
||||||
|
|
||||||
let prefix = filter.substr(0, filter.length - args.completeFilter.length);
|
let prefix = filter.substr(0, filter.length - args.completeFilter.length);
|
||||||
let tags = array.uniq(util.Array.flatten([b.tags for ([k, b] in Iterator(bookmarkcache.bookmarks))]));
|
let tags = array.uniq(array.flatten([b.tags for ([k, b] in Iterator(bookmarkcache.bookmarks))]));
|
||||||
|
|
||||||
return [[prefix + tag, tag] for ([i, tag] in Iterator(tags)) if (have.indexOf(tag) < 0)];
|
return [[prefix + tag, tag] for ([i, tag] in Iterator(tags)) if (have.indexOf(tag) < 0)];
|
||||||
},
|
},
|
||||||
@@ -330,7 +331,8 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
|
|
||||||
if (bookmarks.add(false, title, url, keyword, tags, args.bang)) {
|
if (bookmarks.add(false, title, url, keyword, tags, args.bang)) {
|
||||||
let extra = (title == url) ? "" : " (" + title + ")";
|
let extra = (title == url) ? "" : " (" + title + ")";
|
||||||
dactyl.echomsg("Added bookmark: " + url + extra, 1, commandline.FORCE_SINGLELINE);
|
dactyl.echomsg({ domains: [util.getHost(url)], message: "Added bookmark: " + url + extra },
|
||||||
|
1, commandline.FORCE_SINGLELINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dactyl.echoerr("Exxx: Could not add bookmark " + title.quote(), commandline.FORCE_SINGLELINE);
|
dactyl.echoerr("Exxx: Could not add bookmark " + title.quote(), commandline.FORCE_SINGLELINE);
|
||||||
@@ -385,7 +387,8 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
let url = args.string || buffer.URL;
|
let url = args.string || buffer.URL;
|
||||||
let deletedCount = bookmarks.remove(url);
|
let deletedCount = bookmarks.remove(url);
|
||||||
|
|
||||||
dactyl.echomsg(deletedCount + " bookmark(s) with url " + url.quote() + " deleted", 1, commandline.FORCE_SINGLELINE);
|
dactyl.echomsg({ domains: [util.getHost(url)], message: deletedCount + " bookmark(s) with url " + url.quote() + " deleted" },
|
||||||
|
1, commandline.FORCE_SINGLELINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -493,13 +496,12 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
return history.get({ uri: window.makeURI(begin), uriIsPrefix: true }).map(function (item) {
|
return history.get({ uri: window.makeURI(begin), uriIsPrefix: true }).map(function (item) {
|
||||||
let rest = item.url.length - end.length;
|
let rest = item.url.length - end.length;
|
||||||
let query = item.url.substring(begin.length, rest);
|
let query = item.url.substring(begin.length, rest);
|
||||||
if (item.url.substr(rest) == end && query.indexOf("&") == -1) {
|
if (item.url.substr(rest) == end && query.indexOf("&") == -1)
|
||||||
try {
|
try {
|
||||||
item.url = decodeURIComponent(query.replace(/#.*/, ""));
|
item.url = decodeURIComponent(query.replace(/#.*/, "").replace(/\+/g, " "));
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}).filter(util.identity);
|
}).filter(util.identity);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -84,7 +84,7 @@ const Buffer = Module("buffer", {
|
|||||||
const ACCESS_READ = Ci.nsICache.ACCESS_READ;
|
const ACCESS_READ = Ci.nsICache.ACCESS_READ;
|
||||||
let cacheKey = doc.location.toString().replace(/#.*$/, "");
|
let cacheKey = doc.location.toString().replace(/#.*$/, "");
|
||||||
|
|
||||||
for (let proto in util.Array.itervalues(["HTTP", "FTP"])) {
|
for (let proto in array.itervalues(["HTTP", "FTP"])) {
|
||||||
try {
|
try {
|
||||||
var cacheEntryDescriptor = services.get("cache").createSession(proto, 0, true)
|
var cacheEntryDescriptor = services.get("cache").createSession(proto, 0, true)
|
||||||
.openCacheEntry(cacheKey, ACCESS_READ, false);
|
.openCacheEntry(cacheKey, ACCESS_READ, false);
|
||||||
@@ -174,9 +174,11 @@ const Buffer = Module("buffer", {
|
|||||||
// event listener which is is called on each page load, even if the
|
// event listener which is is called on each page load, even if the
|
||||||
// page is loaded in a background tab
|
// page is loaded in a background tab
|
||||||
onPageLoad: function onPageLoad(event) {
|
onPageLoad: function onPageLoad(event) {
|
||||||
if (!dactyl.helpInitialized && event.originalTarget instanceof Document)
|
if (event.originalTarget instanceof Document)
|
||||||
if (/^dactyl:/.test(event.originalTarget.location.href))
|
if (/^dactyl:/.test(event.originalTarget.location.href)) {
|
||||||
dactyl.initHelp();
|
dactyl.initHelp();
|
||||||
|
config.styleHelp();
|
||||||
|
}
|
||||||
|
|
||||||
if (event.originalTarget instanceof HTMLDocument) {
|
if (event.originalTarget instanceof HTMLDocument) {
|
||||||
let doc = event.originalTarget;
|
let doc = event.originalTarget;
|
||||||
@@ -197,7 +199,7 @@ const Buffer = Module("buffer", {
|
|||||||
doc.pageIsFullyLoaded = 1;
|
doc.pageIsFullyLoaded = 1;
|
||||||
|
|
||||||
if (doc != config.browser.contentDocument)
|
if (doc != config.browser.contentDocument)
|
||||||
dactyl.echomsg("Background tab loaded: " + doc.title || doc.location.href, 3);
|
dactyl.echomsg({ domains: [util.getHost(doc.location.href)], message: "Background tab loaded: " + doc.title || doc.location.href }, 3);
|
||||||
|
|
||||||
this._triggerLoadAutocmd("PageLoad", doc);
|
this._triggerLoadAutocmd("PageLoad", doc);
|
||||||
}
|
}
|
||||||
@@ -206,7 +208,11 @@ const Buffer = Module("buffer", {
|
|||||||
/**
|
/**
|
||||||
* @property {Object} The document loading progress listener.
|
* @property {Object} The document loading progress listener.
|
||||||
*/
|
*/
|
||||||
progressListener: update({ __proto__: window.XULBrowserWindow }, {
|
progressListener: update(Object.create(window.XULBrowserWindow), {
|
||||||
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIWebProgressListener]),
|
||||||
|
|
||||||
|
loadCount: 0,
|
||||||
|
|
||||||
// XXX: function may later be needed to detect a canceled synchronous openURL()
|
// XXX: function may later be needed to detect a canceled synchronous openURL()
|
||||||
onStateChange: function onStateChange(webProgress, request, flags, status) {
|
onStateChange: function onStateChange(webProgress, request, flags, status) {
|
||||||
onStateChange.superapply(this, arguments);
|
onStateChange.superapply(this, arguments);
|
||||||
@@ -223,7 +229,7 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
// don't reset mode if a frame of the frameset gets reloaded which
|
// don't reset mode if a frame of the frameset gets reloaded which
|
||||||
// is not the focused frame
|
// is not the focused frame
|
||||||
if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow) {
|
if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow && this.loadCount++) {
|
||||||
util.timeout(function () { modes.reset(false); },
|
util.timeout(function () { modes.reset(false); },
|
||||||
dactyl.mode == modes.HINTS ? 500 : 0);
|
dactyl.mode == modes.HINTS ? 500 : 0);
|
||||||
}
|
}
|
||||||
@@ -1012,7 +1018,7 @@ const Buffer = Module("buffer", {
|
|||||||
if (win.scrollMaxX > 0 || win.scrollMaxY > 0)
|
if (win.scrollMaxX > 0 || win.scrollMaxY > 0)
|
||||||
return win;
|
return win;
|
||||||
|
|
||||||
for (let frame in util.Array.itervalues(win.frames))
|
for (let frame in array.itervalues(win.frames))
|
||||||
if (frame.scrollMaxX > 0 || frame.scrollMaxY > 0)
|
if (frame.scrollMaxX > 0 || frame.scrollMaxY > 0)
|
||||||
return frame;
|
return frame;
|
||||||
|
|
||||||
@@ -1314,21 +1320,21 @@ const Buffer = Module("buffer", {
|
|||||||
group[1].push([i, tab.linkedBrowser]);
|
group[1].push([i, tab.linkedBrowser]);
|
||||||
});
|
});
|
||||||
|
|
||||||
let orig = context;
|
context.pushProcessor(0, function (item, text, next) <>
|
||||||
for (let [id, [name, browsers]] in Iterator(tabGroups)) {
|
<span highlight="Indicator" style="display: inline-block;">{item.item.indicator}</span>
|
||||||
context = orig.fork(id, 0);
|
{ next.call(this, item, text) }
|
||||||
|
</>);
|
||||||
|
context.process[1] = function (item, text) template.highlightURL(text);
|
||||||
|
|
||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.title = [name || "Buffers"];
|
|
||||||
context.keys = { text: "text", description: "url", icon: "icon" };
|
context.keys = { text: "text", description: "url", icon: "icon" };
|
||||||
context.compare = CompletionContext.Sort.number;
|
context.compare = CompletionContext.Sort.number;
|
||||||
let process = context.process[0];
|
|
||||||
context.process = [function (item, text)
|
|
||||||
<>
|
|
||||||
<span highlight="Indicator" style="display: inline-block;">{item.item.indicator}</span>
|
|
||||||
{ process.call(this, item, text) }
|
|
||||||
</>];
|
|
||||||
|
|
||||||
context.completions = util.map(util.Array.itervalues(browsers), function ([i, browser]) {
|
for (let [id, vals] in Iterator(tabGroups))
|
||||||
|
context.fork(id, 0, this, function (context, [name, browsers]) {
|
||||||
|
context.title = [name || "Buffers"];
|
||||||
|
context.generate = function ()
|
||||||
|
util.map(array.itervalues(browsers), function ([i, browser]) {
|
||||||
let indicator = " ";
|
let indicator = " ";
|
||||||
if (i == tabs.index())
|
if (i == tabs.index())
|
||||||
indicator = "%"
|
indicator = "%"
|
||||||
@@ -1341,12 +1347,12 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
||||||
url: template.highlightURL(url),
|
url: url,
|
||||||
indicator: indicator,
|
indicator: indicator,
|
||||||
icon: tab.image || DEFAULT_FAVICON
|
icon: tab.image || DEFAULT_FAVICON
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}, vals);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
events: function () {
|
events: function () {
|
||||||
@@ -1354,6 +1360,15 @@ const Buffer = Module("buffer", {
|
|||||||
config.browser.removeProgressListener(window.XULBrowserWindow);
|
config.browser.removeProgressListener(window.XULBrowserWindow);
|
||||||
}
|
}
|
||||||
catch (e) {} // Why? --djk
|
catch (e) {} // Why? --djk
|
||||||
|
|
||||||
|
// I hate this whole hack. --Kris
|
||||||
|
let obj = window.XULBrowserWindow, getter;
|
||||||
|
for (let p in properties(obj))
|
||||||
|
if ((getter = obj.__lookupGetter__(p)) && !obj.__lookupSetter__(p)) {
|
||||||
|
this.progressListener.__defineGetter__(p, getter);
|
||||||
|
delete obj[p];
|
||||||
|
}
|
||||||
|
|
||||||
config.browser.addProgressListener(this.progressListener, Ci.nsIWebProgress.NOTIFY_ALL);
|
config.browser.addProgressListener(this.progressListener, Ci.nsIWebProgress.NOTIFY_ALL);
|
||||||
window.XULBrowserWindow = this.progressListener;
|
window.XULBrowserWindow = this.progressListener;
|
||||||
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
@@ -1503,7 +1518,8 @@ const Buffer = Module("buffer", {
|
|||||||
if (elem.readOnly || elem instanceof HTMLInputElement && !set.has(Events.editableInputs, elem.type))
|
if (elem.readOnly || elem instanceof HTMLInputElement && !set.has(Events.editableInputs, elem.type))
|
||||||
return false;
|
return false;
|
||||||
let computedStyle = util.computedStyle(elem);
|
let computedStyle = util.computedStyle(elem);
|
||||||
return computedStyle.visibility != "hidden" && computedStyle.display != "none";
|
return computedStyle.visibility != "hidden" && computedStyle.display != "none" &&
|
||||||
|
computedStyle.MozUserFocus != "ignore";
|
||||||
});
|
});
|
||||||
|
|
||||||
dactyl.assert(elements.length > 0);
|
dactyl.assert(elements.length > 0);
|
||||||
@@ -1617,13 +1633,13 @@ const Buffer = Module("buffer", {
|
|||||||
function () { buffer.showPageInfo(true); });
|
function () { buffer.showPageInfo(true); });
|
||||||
},
|
},
|
||||||
options: function () {
|
options: function () {
|
||||||
options.add(["nextpattern"], // \u00BB is » (>> in a single char)
|
options.add(["nextpattern"],
|
||||||
"Patterns to use when guessing the 'next' page in a document sequence",
|
"Patterns to use when guessing the 'next' page in a document sequence",
|
||||||
"stringlist", "\\bnext\\b,^>$,^(>>|\u00BB)$,^(>|\u00BB),(>|\u00BB)$,\\bmore\\b");
|
"stringlist", UTF8("\\bnext\\b,^>$,^(>>|»)$,^(>|»),(>|»)$,\\bmore\\b"));
|
||||||
|
|
||||||
options.add(["previouspattern"], // \u00AB is « (<< in a single char)
|
options.add(["previouspattern"],
|
||||||
"Patterns to use when guessing the 'previous' page in a document sequence",
|
"Patterns to use when guessing the 'previous' page in a document sequence",
|
||||||
"stringlist", "\\bprev|previous\\b,^<$,^(<<|\u00AB)$,^(<|\u00AB),(<|\u00AB)$");
|
"stringlist", UTF8("\\bprev|previous\\b,^<$,^(<<|«)$,^(<|«),(<|«)$"));
|
||||||
|
|
||||||
options.add(["pageinfo", "pa"],
|
options.add(["pageinfo", "pa"],
|
||||||
"Desired info in the :pageinfo output",
|
"Desired info in the :pageinfo output",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -103,14 +103,15 @@ const CommandLine = Module("commandline", {
|
|||||||
////////////////////// VARIABLES ///////////////////////////////////////////////
|
////////////////////// VARIABLES ///////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
this._completionList = ItemList("dactyl-completions");
|
memoize(this, "_completionList", function () ItemList("dactyl-completions"));
|
||||||
this._completions = null;
|
this._completions = null;
|
||||||
this._history = null;
|
this._history = null;
|
||||||
|
|
||||||
this._startHints = false; // whether we're waiting to start hints mode
|
this._startHints = false; // whether we're waiting to start hints mode
|
||||||
this._lastSubstring = "";
|
this._lastSubstring = "";
|
||||||
|
|
||||||
this.widgets = {
|
memoize(this, "widgets", function () {
|
||||||
|
let widgets = {
|
||||||
commandline: document.getElementById("dactyl-commandline"),
|
commandline: document.getElementById("dactyl-commandline"),
|
||||||
prompt: document.getElementById("dactyl-commandline-prompt"),
|
prompt: document.getElementById("dactyl-commandline-prompt"),
|
||||||
command: document.getElementById("dactyl-commandline-command"),
|
command: document.getElementById("dactyl-commandline-command"),
|
||||||
@@ -121,13 +122,13 @@ const CommandLine = Module("commandline", {
|
|||||||
multilineInput: document.getElementById("dactyl-multiline-input"),
|
multilineInput: document.getElementById("dactyl-multiline-input"),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.widgets.command.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
widgets.command.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
||||||
this.widgets.message.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
widgets.message.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
||||||
|
widgets.mowContainer = widgets.multilineOutput.parentNode;
|
||||||
|
|
||||||
// the widget used for multiline output
|
widgets.multilineOutput.contentDocument.body.id = "dactyl-multiline-output-content";
|
||||||
this._outputContainer = this.widgets.multilineOutput.parentNode;
|
return widgets;
|
||||||
|
});
|
||||||
this.widgets.multilineOutput.contentDocument.body.id = "dactyl-multiline-output-content";
|
|
||||||
|
|
||||||
// we need to save the mode which were in before opening the command line
|
// we need to save the mode which were in before opening the command line
|
||||||
// this is then used if we focus the command line again without the "official"
|
// this is then used if we focus the command line again without the "official"
|
||||||
@@ -181,12 +182,14 @@ const CommandLine = Module("commandline", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Highlight the messageBox according to <b>group</b>.
|
* Highlight the messageBox according to <b>group</b>.
|
||||||
*/
|
*/
|
||||||
_setHighlightGroup: function (group) {
|
set highlightGroup(group) {
|
||||||
this.widgets.message.setAttributeNS(NS.uri, "highlight", group);
|
highlight.highlightNode(this.widgets.message, group);
|
||||||
},
|
},
|
||||||
|
get highlightGroup() this.widgets.message.getAttributeNS(NS.uri, "highlight"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether the command line should be visible.
|
* Determines whether the command line should be visible.
|
||||||
@@ -206,7 +209,7 @@ const CommandLine = Module("commandline", {
|
|||||||
this.widgets.prompt.value = val;
|
this.widgets.prompt.value = val;
|
||||||
this.widgets.prompt.size = val.length;
|
this.widgets.prompt.size = val.length;
|
||||||
this.widgets.prompt.collapsed = (val == "");
|
this.widgets.prompt.collapsed = (val == "");
|
||||||
this.widgets.prompt.setAttributeNS(NS.uri, "highlight", highlightGroup || commandline.HL_NORMAL);
|
highlight.highlightNode(this.widgets.prompt, highlightGroup || commandline.HL_NORMAL);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,8 +232,8 @@ const CommandLine = Module("commandline", {
|
|||||||
* @param {boolean} forceSingle If provided, don't let over-long
|
* @param {boolean} forceSingle If provided, don't let over-long
|
||||||
* messages move to the MOW.
|
* messages move to the MOW.
|
||||||
*/
|
*/
|
||||||
_echoLine: function (str, highlightGroup, forceSingle) {
|
_echoLine: function echoLine(str, highlightGroup, forceSingle) {
|
||||||
this._setHighlightGroup(highlightGroup);
|
this.highlightGroup = highlightGroup;
|
||||||
this.widgets.message.value = str;
|
this.widgets.message.value = str;
|
||||||
|
|
||||||
dactyl.triggerObserver("echoLine", str, highlightGroup, forceSingle);
|
dactyl.triggerObserver("echoLine", str, highlightGroup, forceSingle);
|
||||||
@@ -250,7 +253,7 @@ const CommandLine = Module("commandline", {
|
|||||||
* @param {string} highlightGroup
|
* @param {string} highlightGroup
|
||||||
*/
|
*/
|
||||||
// TODO: resize upon a window resize
|
// TODO: resize upon a window resize
|
||||||
_echoMultiline: function (str, highlightGroup) {
|
_echoMultiline: function echoMultiline(str, highlightGroup) {
|
||||||
let doc = this.widgets.multilineOutput.contentDocument;
|
let doc = this.widgets.multilineOutput.contentDocument;
|
||||||
let win = this.widgets.multilineOutput.contentWindow;
|
let win = this.widgets.multilineOutput.contentWindow;
|
||||||
|
|
||||||
@@ -260,14 +263,15 @@ const CommandLine = Module("commandline", {
|
|||||||
// Otherwise, white space is significant.
|
// Otherwise, white space is significant.
|
||||||
// The problem elsewhere is that E4X tends to insert new lines
|
// The problem elsewhere is that E4X tends to insert new lines
|
||||||
// after interpolated data.
|
// after interpolated data.
|
||||||
XML.ignoreWhitespace = typeof str != "xml";
|
XML.ignoreWhitespace = false;
|
||||||
this._lastMowOutput = <div class="ex-command-output" style="white-space: nowrap" highlight={highlightGroup}>{template.maybeXML(str)}</div>;
|
XML.prettyPrinting = false;
|
||||||
|
let style = typeof str === "string" ? "pre" : "nowrap";
|
||||||
|
this._lastMowOutput = <div class="ex-command-output" style={"white-space: " + style} highlight={highlightGroup}>{str}</div>;
|
||||||
let output = util.xmlToDom(this._lastMowOutput, doc);
|
let output = util.xmlToDom(this._lastMowOutput, doc);
|
||||||
XML.ignoreWhitespace = true;
|
|
||||||
|
|
||||||
// FIXME: need to make sure an open MOW is closed when commands
|
// FIXME: need to make sure an open MOW is closed when commands
|
||||||
// that don't generate output are executed
|
// that don't generate output are executed
|
||||||
if (this._outputContainer.collapsed)
|
if (this.widgets.mowContainer.collapsed)
|
||||||
doc.body.innerHTML = "";
|
doc.body.innerHTML = "";
|
||||||
|
|
||||||
doc.body.appendChild(output);
|
doc.body.appendChild(output);
|
||||||
@@ -417,6 +421,8 @@ const CommandLine = Module("commandline", {
|
|||||||
this._currentExtendedMode = null;
|
this._currentExtendedMode = null;
|
||||||
commandline.triggerCallback("cancel", mode);
|
commandline.triggerCallback("cancel", mode);
|
||||||
|
|
||||||
|
if (this._completions)
|
||||||
|
this._completions.previewClear();
|
||||||
if (this._history)
|
if (this._history)
|
||||||
this._history.save();
|
this._history.save();
|
||||||
|
|
||||||
@@ -431,11 +437,11 @@ const CommandLine = Module("commandline", {
|
|||||||
this._completionList.hide();
|
this._completionList.hide();
|
||||||
|
|
||||||
if (!this._keepCommand || this._silent || this._quiet) {
|
if (!this._keepCommand || this._silent || this._quiet) {
|
||||||
this._outputContainer.collapsed = true;
|
this.widgets.mowContainer.collapsed = true;
|
||||||
commandline.updateMorePrompt();
|
commandline.updateMorePrompt();
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
if (!this._outputContainer.collapsed) {
|
if (!this.widgets.mowContainer.collapsed) {
|
||||||
modes.set(modes.COMMAND_LINE, modes.OUTPUT_MULTILINE);
|
modes.set(modes.COMMAND_LINE, modes.OUTPUT_MULTILINE);
|
||||||
commandline.updateMorePrompt();
|
commandline.updateMorePrompt();
|
||||||
}
|
}
|
||||||
@@ -492,39 +498,42 @@ const CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
if (flags & this.APPEND_TO_MESSAGES) {
|
if (flags & this.APPEND_TO_MESSAGES) {
|
||||||
let message = isobject(str) ? str : { message: str };
|
let message = isobject(str) ? str : { message: str };
|
||||||
this._messageHistory.add(update({ highlight: highlightGroup }, str));
|
this._messageHistory.add(update({ highlight: highlightGroup }, message));
|
||||||
str = message.message;
|
str = message.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & this.ACTIVE_WINDOW) &&
|
if ((flags & this.ACTIVE_WINDOW) &&
|
||||||
window != services.get("windowWatcher").activeWindow &&
|
window != services.get("windowWatcher").activeWindow &&
|
||||||
services.get("windowWatcher").activeWindow.dactyl)
|
services.get("windowWatcher").activeWindow.dactyl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((flags & this.DISALLOW_MULTILINE) && !this._outputContainer.collapsed)
|
if ((flags & this.DISALLOW_MULTILINE) && !this.widgets.mowContainer.collapsed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let single = flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE);
|
let single = flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE);
|
||||||
let action = this._echoLine;
|
let action = this._echoLine;
|
||||||
|
|
||||||
// TODO: this is all a bit convoluted - clean up.
|
|
||||||
// assume that FORCE_MULTILINE output is fully styled
|
|
||||||
if (!(flags & this.FORCE_MULTILINE) && !single && (!this._outputContainer.collapsed || this.widgets.message.value == this._lastEcho)) {
|
|
||||||
highlightGroup += " Message";
|
|
||||||
action = this._echoMultiline;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || typeof str == "xml") && !(flags & this.FORCE_SINGLELINE))
|
|
||||||
action = this._echoMultiline;
|
|
||||||
|
|
||||||
if (single)
|
if (single)
|
||||||
this._lastEcho = null;
|
this._lastEcho = null;
|
||||||
else {
|
else {
|
||||||
if (this.widgets.message.value == this._lastEcho)
|
if (this.widgets.message.value == this._lastEcho)
|
||||||
this._echoMultiline(<span highlight="Message">{this._lastEcho}</span>,
|
this._echoMultiline(<span highlight="Message">{this._lastEcho}</span>,
|
||||||
this.widgets.message.getAttributeNS(NS.uri, "highlight"));
|
this.highlightGroup);
|
||||||
this._lastEcho = (action == this._echoLine) && str;
|
this._lastEcho = (action == this._echoLine) && str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: this is all a bit convoluted - clean up.
|
||||||
|
// assume that FORCE_MULTILINE output is fully styled
|
||||||
|
if (!(flags & this.FORCE_MULTILINE) && !single
|
||||||
|
&& (!this.widgets.mowContainer.collapsed || this.widgets.message.value == this._lastEcho)) {
|
||||||
|
|
||||||
|
highlightGroup += " Message";
|
||||||
|
action = this._echoMultiline;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || typeof str == "xml") && !(flags & this.FORCE_SINGLELINE))
|
||||||
|
action = this._echoMultiline;
|
||||||
|
|
||||||
if (action)
|
if (action)
|
||||||
action.call(this, str, highlightGroup, single);
|
action.call(this, str, highlightGroup, single);
|
||||||
}),
|
}),
|
||||||
@@ -937,7 +946,7 @@ const CommandLine = Module("commandline", {
|
|||||||
* and what they do.
|
* and what they do.
|
||||||
*/
|
*/
|
||||||
updateMorePrompt: function updateMorePrompt(force, showHelp) {
|
updateMorePrompt: function updateMorePrompt(force, showHelp) {
|
||||||
if (this._outputContainer.collapsed) {
|
if (this.widgets.mowContainer.collapsed) {
|
||||||
this._echoLine("", this.HL_NORMAL);
|
this._echoLine("", this.HL_NORMAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -960,19 +969,25 @@ const CommandLine = Module("commandline", {
|
|||||||
* @param {boolean} open If true, the widget will be opened if it's not
|
* @param {boolean} open If true, the widget will be opened if it's not
|
||||||
* already so.
|
* already so.
|
||||||
*/
|
*/
|
||||||
updateOutputHeight: function updateOutputHeight(open) {
|
updateOutputHeight: function updateOutputHeight(open, extra) {
|
||||||
if (!open && this._outputContainer.collapsed)
|
if (!open && this.widgets.mowContainer.collapsed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let doc = this.widgets.multilineOutput.contentDocument;
|
let doc = this.widgets.multilineOutput.contentDocument;
|
||||||
|
|
||||||
let availableHeight = config.outputHeight;
|
let availableHeight = config.outputHeight;
|
||||||
if (!this._outputContainer.collapsed)
|
if (!this.widgets.mowContainer.collapsed)
|
||||||
availableHeight += parseFloat(this._outputContainer.height);
|
availableHeight += parseFloat(this.widgets.mowContainer.height);
|
||||||
|
availableHeight -= extra || 0;
|
||||||
|
|
||||||
doc.body.style.minWidth = this.widgets.commandline.scrollWidth + "px";
|
doc.body.style.minWidth = this.widgets.commandline.scrollWidth + "px";
|
||||||
this._outputContainer.height = Math.min(doc.height, availableHeight) + "px";
|
this.widgets.mowContainer.height = Math.min(doc.height, availableHeight) + "px";
|
||||||
|
this.timeout(function ()
|
||||||
|
this.widgets.mowContainer.height = Math.min(doc.height, availableHeight) + "px",
|
||||||
|
0);
|
||||||
|
|
||||||
doc.body.style.minWidth = "";
|
doc.body.style.minWidth = "";
|
||||||
this._outputContainer.collapsed = false;
|
this.widgets.mowContainer.collapsed = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
resetCompletions: function resetCompletions() {
|
resetCompletions: function resetCompletions() {
|
||||||
@@ -1015,7 +1030,12 @@ const CommandLine = Module("commandline", {
|
|||||||
if (/^\s*$/.test(str))
|
if (/^\s*$/.test(str))
|
||||||
return;
|
return;
|
||||||
this.store.mutate("filter", function (line) (line.value || line) != str);
|
this.store.mutate("filter", function (line) (line.value || line) != str);
|
||||||
|
try {
|
||||||
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) });
|
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) });
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
dactyl.reportError(e);
|
||||||
|
}
|
||||||
this.store.truncate(options["history"], true);
|
this.store.truncate(options["history"], true);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -1142,6 +1162,8 @@ const CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
get wildtype() this.wildtypes[this.wildIndex] || "",
|
get wildtype() this.wildtypes[this.wildIndex] || "",
|
||||||
|
|
||||||
|
get wildtypes() this.wildmode.values,
|
||||||
|
|
||||||
complete: function complete(show, tabPressed) {
|
complete: function complete(show, tabPressed) {
|
||||||
this.context.reset();
|
this.context.reset();
|
||||||
this.context.tabPressed = tabPressed;
|
this.context.tabPressed = tabPressed;
|
||||||
@@ -1162,7 +1184,7 @@ const CommandLine = Module("commandline", {
|
|||||||
let substring = "";
|
let substring = "";
|
||||||
switch (this.wildtype.replace(/.*:/, "")) {
|
switch (this.wildtype.replace(/.*:/, "")) {
|
||||||
case "":
|
case "":
|
||||||
substring = this.items[0].text;
|
substring = this.items[0].result;
|
||||||
break;
|
break;
|
||||||
case "longest":
|
case "longest":
|
||||||
if (this.items.length > 1) {
|
if (this.items.length > 1) {
|
||||||
@@ -1173,7 +1195,7 @@ const CommandLine = Module("commandline", {
|
|||||||
case "full":
|
case "full":
|
||||||
let item = this.items[this.selected != null ? this.selected + 1 : 0];
|
let item = this.items[this.selected != null ? this.selected + 1 : 0];
|
||||||
if (item)
|
if (item)
|
||||||
substring = item.text;
|
substring = item.result;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1227,14 +1249,14 @@ const CommandLine = Module("commandline", {
|
|||||||
this.wildIndex = 0;
|
this.wildIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.wildtypes = this.wildmode.values;
|
|
||||||
this.preview();
|
this.preview();
|
||||||
},
|
},
|
||||||
|
|
||||||
_reset: function _reset() {
|
_reset: function _reset() {
|
||||||
this.prefix = this.context.value.substring(0, this.start);
|
let value = this.editor.selection.focusNode.textContent;
|
||||||
this.value = this.context.value.substring(this.start, this.caret);
|
this.prefix = value.substring(0, this.start);
|
||||||
this.suffix = this.context.value.substring(this.caret);
|
this.value = value.substring(this.start, this.caret);
|
||||||
|
this.suffix = value.substring(this.caret);
|
||||||
|
|
||||||
this.itemList.reset();
|
this.itemList.reset();
|
||||||
this.itemList.selectItem(this.selected);
|
this.itemList.selectItem(this.selected);
|
||||||
@@ -1301,7 +1323,7 @@ const CommandLine = Module("commandline", {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.selected = idx;
|
this.selected = idx;
|
||||||
this.completion = this.items[idx].text;
|
this.completion = this.items[idx].result;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.itemList.selectItem(idx);
|
this.itemList.selectItem(idx);
|
||||||
@@ -1320,6 +1342,8 @@ const CommandLine = Module("commandline", {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
while (this.tabs.length) {
|
while (this.tabs.length) {
|
||||||
|
this.wildIndex = Math.min(this.wildIndex, this.wildtypes.length - 1);
|
||||||
|
|
||||||
reverse = this.tabs.shift();
|
reverse = this.tabs.shift();
|
||||||
switch (this.wildtype.replace(/.*:/, "")) {
|
switch (this.wildtype.replace(/.*:/, "")) {
|
||||||
case "":
|
case "":
|
||||||
@@ -1340,7 +1364,7 @@ const CommandLine = Module("commandline", {
|
|||||||
if (this.haveType("list"))
|
if (this.haveType("list"))
|
||||||
this.itemList.show();
|
this.itemList.show();
|
||||||
|
|
||||||
this.wildIndex = Math.constrain(this.wildIndex + 1, 0, this.wildtypes.length - 1);
|
this.wildIndex++;
|
||||||
this.preview();
|
this.preview();
|
||||||
|
|
||||||
commandline._statusTimer.tell();
|
commandline._statusTimer.tell();
|
||||||
@@ -1373,7 +1397,7 @@ const CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
if (typeof arg === "object")
|
if (typeof arg === "object")
|
||||||
arg = util.objectToString(arg, useColor);
|
arg = util.objectToString(arg, useColor);
|
||||||
else if (typeof arg == "string" && /\n/.test(arg))
|
else if (typeof arg === "string" && /\n/.test(arg))
|
||||||
arg = <span highlight="CmdOutput">{arg}</span>;
|
arg = <span highlight="CmdOutput">{arg}</span>;
|
||||||
else
|
else
|
||||||
arg = String(arg);
|
arg = String(arg);
|
||||||
@@ -1533,7 +1557,7 @@ const CommandLine = Module("commandline", {
|
|||||||
styles: function () {
|
styles: function () {
|
||||||
let fontSize = util.computedStyle(document.getElementById(config.mainWindowId)).fontSize;
|
let fontSize = util.computedStyle(document.getElementById(config.mainWindowId)).fontSize;
|
||||||
styles.registerSheet("chrome://dactyl/skin/dactyl.css");
|
styles.registerSheet("chrome://dactyl/skin/dactyl.css");
|
||||||
let error = styles.addSheet(true, "font-size", "chrome://dactyl/content/buffer.xhtml",
|
styles.addSheet(true, "font-size", "chrome://dactyl/content/buffer.xhtml",
|
||||||
"body { font-size: " + fontSize + "; }");
|
"body { font-size: " + fontSize + "; }");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1542,7 +1566,7 @@ const CommandLine = Module("commandline", {
|
|||||||
* The list which is used for the completion box (and QuickFix window in
|
* The list which is used for the completion box (and QuickFix window in
|
||||||
* future).
|
* future).
|
||||||
*
|
*
|
||||||
* @param {string} id The id of the <iframe> which will display the list. It
|
* @param {string} id The id of the iframe which will display the list. It
|
||||||
* must be in its own container element, whose height it will update as
|
* must be in its own container element, whose height it will update as
|
||||||
* necessary.
|
* necessary.
|
||||||
*/
|
*/
|
||||||
@@ -1579,12 +1603,15 @@ const ItemList = Class("ItemList", {
|
|||||||
|
|
||||||
this._minHeight = Math.max(this._minHeight,
|
this._minHeight = Math.max(this._minHeight,
|
||||||
this._win.scrollY + this._divNodes.completions.getBoundingClientRect().bottom);
|
this._win.scrollY + this._divNodes.completions.getBoundingClientRect().bottom);
|
||||||
this._container.height = this._minHeight;
|
|
||||||
|
|
||||||
if (this._container.collapsed)
|
if (this._container.collapsed)
|
||||||
this._div.style.minWidth = "";
|
this._div.style.minWidth = "";
|
||||||
|
|
||||||
// FIXME: Belongs elsewhere.
|
// FIXME: Belongs elsewhere.
|
||||||
|
commandline.updateOutputHeight(false, Math.max(0, this._minHeight - this._container.height));
|
||||||
|
|
||||||
|
this._container.height = this._minHeight;
|
||||||
|
this._container.height -= commandline.getSpaceNeeded()
|
||||||
commandline.updateOutputHeight(false);
|
commandline.updateOutputHeight(false);
|
||||||
this.timeout(function () { this._container.height -= commandline.getSpaceNeeded(); }, 0);
|
this.timeout(function () { this._container.height -= commandline.getSpaceNeeded(); }, 0);
|
||||||
},
|
},
|
||||||
@@ -1678,7 +1705,7 @@ const ItemList = Class("ItemList", {
|
|||||||
|
|
||||||
for (let [i, row] in Iterator(context.getRows(start, end, this._doc)))
|
for (let [i, row] in Iterator(context.getRows(start, end, this._doc)))
|
||||||
nodes[i] = row;
|
nodes[i] = row;
|
||||||
for (let [i, row] in util.Array.iteritems(nodes)) {
|
for (let [i, row] in array.iteritems(nodes)) {
|
||||||
if (!row)
|
if (!row)
|
||||||
continue;
|
continue;
|
||||||
let display = (i >= start && i < end);
|
let display = (i >= start && i < end);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -171,16 +171,10 @@ const Command = Class("Command", {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
hasName: function (name) {
|
hasName: function (name) {
|
||||||
for (let [, spec] in Iterator(this.specs)) {
|
return this.specs.some(function (spec) {
|
||||||
let fullName = spec.replace(/\[(\w+)]$/, "$1");
|
let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/);
|
||||||
let index = spec.indexOf("[");
|
return name.indexOf(head) == 0 && (head + (tail || "")).indexOf(name) == 0;
|
||||||
let min = index == -1 ? fullName.length : index;
|
});
|
||||||
|
|
||||||
if (fullName.indexOf(name) == 0 && name.length >= min)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -340,25 +334,29 @@ const Commands = Module("commands", {
|
|||||||
/** @property {Iterator(Command)} @private */
|
/** @property {Iterator(Command)} @private */
|
||||||
__iterator__: function () {
|
__iterator__: function () {
|
||||||
let sorted = this._exCommands.sort(function (a, b) a.name > b.name);
|
let sorted = this._exCommands.sort(function (a, b) a.name > b.name);
|
||||||
return util.Array.itervalues(sorted);
|
return array.itervalues(sorted);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @property {string} The last executed Ex command line. */
|
/** @property {string} The last executed Ex command line. */
|
||||||
repeat: null,
|
repeat: null,
|
||||||
|
|
||||||
_addCommand: function (command, replace) {
|
_addCommand: function (args, replace) {
|
||||||
if (command.name in this._exMap) {
|
let names = array.flatten(Command.parseSpecs(args[0]));
|
||||||
if (command.user && replace)
|
dactyl.assert(!names.some(function (name) name in this._exMap && !this._exMap[name].user, this),
|
||||||
commands.removeUserCommand(command.name);
|
"E182: Can't replace non-user command: " + args[0]);
|
||||||
else {
|
if (!replace && args[3] && args[3].user)
|
||||||
dactyl.log("Warning: :" + command.name + " already exists, NOT replacing existing command.", 1);
|
dactyl.assert(!names.some(function (name) name in this._exMap, this),
|
||||||
return false;
|
"Not replacing command " + args[0]);
|
||||||
}
|
for (let name in names)
|
||||||
}
|
if (name in this._exMap)
|
||||||
|
commands.removeUserCommand(name);
|
||||||
|
|
||||||
this._exCommands.push(command);
|
let name = names[0];
|
||||||
for (let [,name] in Iterator(command.names))
|
let closure = function () commands._exMap[name];
|
||||||
this._exMap[name] = command;
|
memoize(this._exMap, name, function () Command.apply(null, args));
|
||||||
|
memoize(this._exCommands, this._exCommands.length, closure);
|
||||||
|
for (let alias in values(names.slice(1)))
|
||||||
|
memoize(this._exMap, alias, closure);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@@ -375,7 +373,7 @@ const Commands = Module("commands", {
|
|||||||
* @optional
|
* @optional
|
||||||
*/
|
*/
|
||||||
add: function (names, description, action, extra) {
|
add: function (names, description, action, extra) {
|
||||||
return this._addCommand(Command(names, description, action, extra), false);
|
return this._addCommand([names, description, action, extra], false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -395,7 +393,7 @@ const Commands = Module("commands", {
|
|||||||
extra.user = true;
|
extra.user = true;
|
||||||
description = description || "User defined command";
|
description = description || "User defined command";
|
||||||
|
|
||||||
return this._addCommand(Command(names, description, action, extra), replace);
|
return this._addCommand([names, description, action, extra], replace);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -407,7 +405,7 @@ const Commands = Module("commands", {
|
|||||||
*/
|
*/
|
||||||
commandToString: function (args) {
|
commandToString: function (args) {
|
||||||
let res = [args.command + (args.bang ? "!" : "")];
|
let res = [args.command + (args.bang ? "!" : "")];
|
||||||
function quote(str) Commands.quoteArg[/[\s"'\\]|^$/.test(str) ? '"' : ""](str);
|
function quote(str) Commands.quoteArg[/[\s"'\\]|^$/.test(str) ? "'" : ""](str);
|
||||||
|
|
||||||
for (let [opt, val] in Iterator(args.options || {})) {
|
for (let [opt, val] in Iterator(args.options || {})) {
|
||||||
let chr = /^-.$/.test(opt) ? " " : "=";
|
let chr = /^-.$/.test(opt) ? " " : "=";
|
||||||
@@ -431,8 +429,8 @@ const Commands = Module("commands", {
|
|||||||
* any of the command's names.
|
* any of the command's names.
|
||||||
* @returns {Command}
|
* @returns {Command}
|
||||||
*/
|
*/
|
||||||
get: function (name) {
|
get: function (name, full) {
|
||||||
return this._exMap[name] || this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null;
|
return this._exMap[name] || !full && this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -573,7 +571,7 @@ const Commands = Module("commands", {
|
|||||||
argCount = "*";
|
argCount = "*";
|
||||||
|
|
||||||
var args = []; // parsed options
|
var args = []; // parsed options
|
||||||
args.__iterator__ = function () util.Array.iteritems(this);
|
args.__iterator__ = function () array.iteritems(this);
|
||||||
args.string = str; // for access to the unparsed string
|
args.string = str; // for access to the unparsed string
|
||||||
args.literalArg = "";
|
args.literalArg = "";
|
||||||
|
|
||||||
@@ -833,11 +831,11 @@ const Commands = Module("commands", {
|
|||||||
* any of the command's names.
|
* any of the command's names.
|
||||||
*/
|
*/
|
||||||
removeUserCommand: function (name) {
|
removeUserCommand: function (name) {
|
||||||
for (let [,cmd] in Iterator(this._exCommands))
|
let cmd = this.get(name);
|
||||||
if (cmd.user && cmd.hasName(name))
|
dactyl.assert(cmd.user, "E184: No such user-defined command: " + name);
|
||||||
for (let [,name] in Iterator(cmd.names))
|
for (let name in values(cmd.names))
|
||||||
delete this._exMap[name];
|
delete this._exMap[name];
|
||||||
this._exCommands = this._exCommands.filter(function (cmd) !(cmd.user && cmd.hasName(name)));
|
this._exCommands = this._exCommands.filter(function (c) c != cmd);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: still belong here? Also used for autocommand parameters.
|
// FIXME: still belong here? Also used for autocommand parameters.
|
||||||
@@ -867,8 +865,6 @@ const Commands = Module("commands", {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
QUOTE_STYLE: "rc-ish",
|
|
||||||
|
|
||||||
// returns [count, parsed_argument]
|
// returns [count, parsed_argument]
|
||||||
parseArg: function (str) {
|
parseArg: function (str) {
|
||||||
let arg = "";
|
let arg = "";
|
||||||
@@ -918,7 +914,7 @@ const Commands = Module("commands", {
|
|||||||
// dynamically get completions as specified with the command's completer function
|
// dynamically get completions as specified with the command's completer function
|
||||||
let command = commands.get(cmd);
|
let command = commands.get(cmd);
|
||||||
if (!command) {
|
if (!command) {
|
||||||
context.highlight(0, cmd.length, "SPELLCHECK");
|
context.highlight(0, cmd && cmd.length, "SPELLCHECK");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,7 +932,8 @@ const Commands = Module("commands", {
|
|||||||
cmdContext.filter = args.completeFilter;
|
cmdContext.filter = args.completeFilter;
|
||||||
try {
|
try {
|
||||||
let compObject = command.completer.call(command, cmdContext, args);
|
let compObject = command.completer.call(command, cmdContext, args);
|
||||||
if (compObject instanceof Array) // for now at least, let completion functions return arrays instead of objects
|
|
||||||
|
if (isarray(compObject)) // for now at least, let completion functions return arrays instead of objects
|
||||||
compObject = { start: compObject[0], items: compObject[1] };
|
compObject = { start: compObject[0], items: compObject[1] };
|
||||||
if (compObject != null) {
|
if (compObject != null) {
|
||||||
cmdContext.advance(compObject.start);
|
cmdContext.advance(compObject.start);
|
||||||
@@ -1041,14 +1038,13 @@ const Commands = Module("commands", {
|
|||||||
function completerToString(completer) {
|
function completerToString(completer) {
|
||||||
if (completer)
|
if (completer)
|
||||||
return [k for ([k, v] in Iterator(completeOptionMap)) if (completer == completion[v])][0] || "custom";
|
return [k for ([k, v] in Iterator(completeOptionMap)) if (completer == completion[v])][0] || "custom";
|
||||||
else
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: using an array comprehension here generates flakey results across repeated calls
|
// TODO: using an array comprehension here generates flakey results across repeated calls
|
||||||
// : perhaps we shouldn't allow options in a list call but just ignore them for now
|
// : perhaps we shouldn't allow options in a list call but just ignore them for now
|
||||||
// : No, array comprehensions are fine, generator statements aren't. --Kris
|
// : No, array comprehensions are fine, generator statements aren't. --Kris
|
||||||
let cmds = this._exCommands.filter(function (c) c.user && (!cmd || c.name.match("^" + cmd)));
|
let cmds = commands._exCommands.filter(function (c) c.user && (!cmd || c.name.match("^" + cmd)));
|
||||||
|
|
||||||
if (cmds.length > 0)
|
if (cmds.length > 0)
|
||||||
commandline.commandOutput(
|
commandline.commandOutput(
|
||||||
@@ -1101,7 +1097,7 @@ const Commands = Module("commands", {
|
|||||||
serialize: function () [ {
|
serialize: function () [ {
|
||||||
command: this.name,
|
command: this.name,
|
||||||
bang: true,
|
bang: true,
|
||||||
options: util.Array.toObject(
|
options: array.toObject(
|
||||||
[[v, typeof cmd[k] == "boolean" ? null : cmd[k]]
|
[[v, typeof cmd[k] == "boolean" ? null : cmd[k]]
|
||||||
// FIXME: this map is expressed multiple times
|
// FIXME: this map is expressed multiple times
|
||||||
for ([k, v] in Iterator({ argCount: "-nargs", bang: "-bang", count: "-count", description: "-description" }))
|
for ([k, v] in Iterator({ argCount: "-nargs", bang: "-bang", count: "-count", description: "-description" }))
|
||||||
@@ -1162,17 +1158,20 @@ const Commands = Module("commands", {
|
|||||||
};
|
};
|
||||||
function quote(q, list) {
|
function quote(q, list) {
|
||||||
let re = RegExp("[" + list + "]", "g");
|
let re = RegExp("[" + list + "]", "g");
|
||||||
return function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q;
|
let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q;
|
||||||
|
res.list = list;
|
||||||
|
return res;
|
||||||
};
|
};
|
||||||
Commands.complQuote = { // FIXME
|
Commands.complQuote = {
|
||||||
'"': ['"', quote("", '\n\t"\\\\'), '"'],
|
'"': ['"', quote("", '\n\t"\\\\'), '"'],
|
||||||
"'": ["'", quote("", "\\\\'"), "'"],
|
"'": ["'", quote("", "\\\\'"), "'"],
|
||||||
"": ["", quote("", "\\\\ "), ""]
|
"": ["", quote("", "\\\\ '\""), ""]
|
||||||
};
|
};
|
||||||
|
|
||||||
Commands.quoteArg = {
|
Commands.quoteArg = {
|
||||||
'"': quote('"', '\n\t"\\\\'),
|
'"': quote('"', '\n\t"\\\\'),
|
||||||
"'": quote("'", "\\\\'"),
|
"'": quote("'", "\\\\'"),
|
||||||
"": quote("", "\\\\ ")
|
"": quote("", "\\\\ '\"")
|
||||||
};
|
};
|
||||||
|
|
||||||
Commands.parseBool = function (arg) {
|
Commands.parseBool = function (arg) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -54,7 +54,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
|
|
||||||
["filters", "keys", "title", "quote"].forEach(function (key)
|
["filters", "keys", "title", "quote"].forEach(function (key)
|
||||||
self[key] = parent[key] && util.cloneObject(parent[key]));
|
self[key] = parent[key] && util.cloneObject(parent[key]));
|
||||||
["anchored", "compare", "editor", "_filter", "filterFunc", "keys", "_process", "top"].forEach(function (key)
|
["anchored", "compare", "editor", "_filter", "filterFunc", "keys", "process", "top"].forEach(function (key)
|
||||||
self[key] = parent[key]);
|
self[key] = parent[key]);
|
||||||
|
|
||||||
self.__defineGetter__("value", function () this.top.value);
|
self.__defineGetter__("value", function () this.top.value);
|
||||||
@@ -90,14 +90,34 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
this._value = editor;
|
this._value = editor;
|
||||||
else
|
else
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
this.compare = function (a, b) String.localeCompare(a.text, b.text);
|
/**
|
||||||
|
* @property {boolean} Specifies whether this context results must
|
||||||
|
* match the filter at the beginning of the string.
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
this.anchored = true;
|
||||||
|
|
||||||
|
this.compare = function (a, b) String.localeCompare(a.text, b.text);
|
||||||
/**
|
/**
|
||||||
* @property {function} This function is called when we close
|
* @property {function} This function is called when we close
|
||||||
* a completion window with Esc or Ctrl-c. Usually this callback
|
* a completion window with Esc or Ctrl-c. Usually this callback
|
||||||
* is only needed for long, asynchronous completions
|
* is only needed for long, asynchronous completions
|
||||||
*/
|
*/
|
||||||
this.cancel = null;
|
this.cancel = null;
|
||||||
|
/**
|
||||||
|
* @property {[CompletionContext]} A list of active
|
||||||
|
* completion contexts, in the order in which they were
|
||||||
|
* instantiated.
|
||||||
|
*/
|
||||||
|
this.contextList = [];
|
||||||
|
/**
|
||||||
|
* @property {Object} A map of all contexts, keyed on their names.
|
||||||
|
* Names are assigned when a context is forked, with its specified
|
||||||
|
* name appended, after a '/', to its parent's name. May
|
||||||
|
* contain inactive contexts. For active contexts, see
|
||||||
|
* {@link #contextList}.
|
||||||
|
*/
|
||||||
|
this.contexts = { "": this };
|
||||||
/**
|
/**
|
||||||
* @property {function} The function used to filter the results.
|
* @property {function} The function used to filter the results.
|
||||||
* @default Selects all results which match every predicate in the
|
* @default Selects all results which match every predicate in the
|
||||||
@@ -114,20 +134,6 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
* results.
|
* results.
|
||||||
*/
|
*/
|
||||||
this.filters = [CompletionContext.Filter.text];
|
this.filters = [CompletionContext.Filter.text];
|
||||||
/**
|
|
||||||
* @property {boolean} Specifies whether this context results must
|
|
||||||
* match the filter at the beginning of the string.
|
|
||||||
* @default true
|
|
||||||
*/
|
|
||||||
this.anchored = true;
|
|
||||||
/**
|
|
||||||
* @property {Object} A map of all contexts, keyed on their names.
|
|
||||||
* Names are assigned when a context is forked, with its specified
|
|
||||||
* name appended, after a '/', to its parent's name. May
|
|
||||||
* contain inactive contexts. For active contexts, see
|
|
||||||
* {@link #contextList}.
|
|
||||||
*/
|
|
||||||
this.contexts = { "": this };
|
|
||||||
/**
|
/**
|
||||||
* @property {Object} A mapping of keys, for {@link #getKey}. Given
|
* @property {Object} A mapping of keys, for {@link #getKey}. Given
|
||||||
* { key: value }, getKey(item, key) will return values as such:
|
* { key: value }, getKey(item, key) will return values as such:
|
||||||
@@ -146,6 +152,9 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
* {@link #updateAsync} is true.
|
* {@link #updateAsync} is true.
|
||||||
*/
|
*/
|
||||||
this.onUpdate = function () true;
|
this.onUpdate = function () true;
|
||||||
|
|
||||||
|
this.runCount = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {CompletionContext} The top-level completion context.
|
* @property {CompletionContext} The top-level completion context.
|
||||||
*/
|
*/
|
||||||
@@ -190,6 +199,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
: item.item[key];
|
: item.item[key];
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Temporary
|
// Temporary
|
||||||
/**
|
/**
|
||||||
* @property {Object}
|
* @property {Object}
|
||||||
@@ -202,7 +212,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
get allItems() {
|
get allItems() {
|
||||||
try {
|
try {
|
||||||
let self = this;
|
let self = this;
|
||||||
let minStart = Math.min.apply(Math, [context.offset for ([k, context] in Iterator(this.contexts)) if (context.items.length && context.hasItems)]);
|
let minStart = Math.min.apply(Math, [context.offset for ([k, context] in Iterator(this.contexts)) if (context.hasItems && context.items.length)]);
|
||||||
if (minStart == Infinity)
|
if (minStart == Infinity)
|
||||||
minStart = 0;
|
minStart = 0;
|
||||||
let items = this.contextList.map(function (context) {
|
let items = this.contextList.map(function (context) {
|
||||||
@@ -214,7 +224,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
__proto__: item
|
__proto__: item
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
return { start: minStart, items: util.Array.flatten(items), longestSubstring: this.longestAllSubstring };
|
return { start: minStart, items: array.flatten(items), longestSubstring: this.longestAllSubstring };
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.reportError(e);
|
dactyl.reportError(e);
|
||||||
@@ -235,7 +245,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
lists.pop());
|
lists.pop());
|
||||||
if (!substrings) // FIXME: How is this undefined?
|
if (!substrings) // FIXME: How is this undefined?
|
||||||
return [];
|
return [];
|
||||||
return util.Array.uniq(Array.slice(substrings));
|
return array.uniq(Array.slice(substrings));
|
||||||
},
|
},
|
||||||
// Temporary
|
// Temporary
|
||||||
get longestAllSubstring() {
|
get longestAllSubstring() {
|
||||||
@@ -253,14 +263,16 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
// Accept a generator
|
// Accept a generator
|
||||||
if (!isarray(items))
|
if (!isarray(items))
|
||||||
items = [x for (x in Iterator(items))];
|
items = [x for (x in Iterator(items))];
|
||||||
|
if (this._completions !== items) {
|
||||||
delete this.cache.filtered;
|
delete this.cache.filtered;
|
||||||
delete this.cache.filter;
|
delete this.cache.filter;
|
||||||
this.cache.rows = [];
|
this.cache.rows = [];
|
||||||
this.hasItems = items.length > 0;
|
this.hasItems = items.length > 0;
|
||||||
this._completions = items;
|
this._completions = items;
|
||||||
let self = this;
|
this.itemCache[this.key] = items;
|
||||||
|
}
|
||||||
if (this.updateAsync && !this.noUpdate)
|
if (this.updateAsync && !this.noUpdate)
|
||||||
util.callInMainThread(function () { self.onUpdate.call(self); });
|
util.callInMainThread(function () { this.onUpdate(); }, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
get createRow() this._createRow || template.completionRow, // XXX
|
get createRow() this._createRow || template.completionRow, // XXX
|
||||||
@@ -293,14 +305,18 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
|
|
||||||
get proto() {
|
get proto() {
|
||||||
let res = {};
|
let res = {};
|
||||||
for (let i in Iterator(this.keys)) {
|
function result(quote) {
|
||||||
|
yield ["result", quote ? function () quote[0] + quote[1](this.text) + quote[2]
|
||||||
|
: function () this.text]
|
||||||
|
};
|
||||||
|
for (let i in iterall(this.keys, result(this.quote))) {
|
||||||
let [k, v] = i;
|
let [k, v] = i;
|
||||||
if (typeof v == "string" && /^[.[]/.test(v))
|
if (typeof v == "string" && /^[.[]/.test(v))
|
||||||
// This is only allowed to be a simple accessor, and shouldn't
|
// This is only allowed to be a simple accessor, and shouldn't
|
||||||
// reference any variables. Don't bother with eval context.
|
// reference any variables. Don't bother with eval context.
|
||||||
v = Function("i", "return i" + v);
|
v = Function("i", "return i" + v);
|
||||||
if (typeof v == "function")
|
if (typeof v == "function")
|
||||||
res.__defineGetter__(k, function () Class.replaceProperty(this, k, v(this.item)));
|
res.__defineGetter__(k, function () Class.replaceProperty(this, k, v.call(this, this.item)));
|
||||||
else
|
else
|
||||||
res.__defineGetter__(k, function () Class.replaceProperty(this, k, this.item[v]));
|
res.__defineGetter__(k, function () Class.replaceProperty(this, k, this.item[v]));
|
||||||
res.__defineSetter__(k, function (val) Class.replaceProperty(this, k, val));
|
res.__defineSetter__(k, function (val) Class.replaceProperty(this, k, val));
|
||||||
@@ -312,11 +328,16 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
set regenerate(val) { if (val) delete this.itemCache[this.key]; },
|
set regenerate(val) { if (val) delete this.itemCache[this.key]; },
|
||||||
|
|
||||||
get generate() !this._generate ? null : function () {
|
get generate() !this._generate ? null : function () {
|
||||||
if (this.offset != this.cache.offset)
|
if (this.offset != this.cache.offset || this.lastActivated != this.top.runCount) {
|
||||||
this.itemCache = {};
|
this.itemCache = {};
|
||||||
this.cache.offset = this.offset;
|
this.cache.offset = this.offset;
|
||||||
if (!this.itemCache[this.key])
|
this.lastActivated = this.top.runCount;
|
||||||
this.itemCache[this.key] = this._generate.call(this) || [];
|
}
|
||||||
|
if (!this.itemCache[this.key]) {
|
||||||
|
let res = this._generate.call(this) || [];
|
||||||
|
if (res != null)
|
||||||
|
this.itemCache[this.key] = res;
|
||||||
|
}
|
||||||
return this.itemCache[this.key];
|
return this.itemCache[this.key];
|
||||||
},
|
},
|
||||||
set generate(arg) {
|
set generate(arg) {
|
||||||
@@ -354,16 +375,27 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
get items() {
|
get items() {
|
||||||
if (!this.hasItems || this.backgroundLock)
|
if (!this.hasItems || this.backgroundLock)
|
||||||
return [];
|
return [];
|
||||||
if (this.cache.filtered && this.cache.filter == this.filter)
|
|
||||||
return this.cache.filtered;
|
// Regenerate completions if we must
|
||||||
this.cache.rows = [];
|
|
||||||
let items = this.completions;
|
|
||||||
if (this.generate && !this.background) {
|
if (this.generate && !this.background) {
|
||||||
// XXX
|
// XXX
|
||||||
this.noUpdate = true;
|
this.noUpdate = true;
|
||||||
this.completions = items = this.generate();
|
this.completions = this.generate();
|
||||||
this.noUpdate = false;
|
this.noUpdate = false;
|
||||||
}
|
}
|
||||||
|
let items = this.completions;
|
||||||
|
|
||||||
|
// Check for cache miss
|
||||||
|
if (this.cache.completions !== this.completions) {
|
||||||
|
this.cache.completions = this.completions;
|
||||||
|
this.cache.constructed = null;
|
||||||
|
this.cache.filtered = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.cache.filtered && this.cache.filter == this.filter)
|
||||||
|
return this.cache.filtered;
|
||||||
|
|
||||||
|
this.cache.rows = [];
|
||||||
this.cache.filter = this.filter;
|
this.cache.filter = this.filter;
|
||||||
if (items == null)
|
if (items == null)
|
||||||
return items;
|
return items;
|
||||||
@@ -371,6 +403,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
let self = this;
|
let self = this;
|
||||||
delete this._substrings;
|
delete this._substrings;
|
||||||
|
|
||||||
|
// Item matchers
|
||||||
if (this.ignoreCase)
|
if (this.ignoreCase)
|
||||||
this.matchString = this.anchored ?
|
this.matchString = this.anchored ?
|
||||||
function (filter, str) String.toLowerCase(str).indexOf(filter.toLowerCase()) == 0 :
|
function (filter, str) String.toLowerCase(str).indexOf(filter.toLowerCase()) == 0 :
|
||||||
@@ -380,36 +413,28 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
function (filter, str) String.indexOf(str, filter) == 0 :
|
function (filter, str) String.indexOf(str, filter) == 0 :
|
||||||
function (filter, str) String.indexOf(str, filter) >= 0;
|
function (filter, str) String.indexOf(str, filter) >= 0;
|
||||||
|
|
||||||
|
// Item formatters
|
||||||
|
this.processor = Array.slice(this.process);
|
||||||
|
if (!this.anchored)
|
||||||
|
this.processor[0] = function (item, text) self.process[0].call(self, item,
|
||||||
|
template.highlightFilter(item.text, self.filter));
|
||||||
|
|
||||||
|
// Item prototypes
|
||||||
let proto = this.proto;
|
let proto = this.proto;
|
||||||
let filtered = this.filterFunc(items.map(function (item) ({ __proto__: proto, item: item })));
|
if (!this.cache.constructed)
|
||||||
|
this.cache.constructed = items.map(function (item) Object.create(proto, { item: { value: item, enumerable: true } }));
|
||||||
|
|
||||||
|
// Filters
|
||||||
|
let filtered = this.filterFunc(this.cache.constructed);
|
||||||
if (this.maxItems)
|
if (this.maxItems)
|
||||||
filtered = filtered.slice(0, this.maxItems);
|
filtered = filtered.slice(0, this.maxItems);
|
||||||
|
|
||||||
|
// Sorting
|
||||||
if (this.sortResults && this.compare)
|
if (this.sortResults && this.compare)
|
||||||
filtered.sort(this.compare);
|
filtered.sort(this.compare);
|
||||||
let quote = this.quote;
|
|
||||||
if (quote)
|
|
||||||
filtered.forEach(function (item) {
|
|
||||||
item.unquoted = item.text;
|
|
||||||
item.text = quote[0] + quote[1](item.text) + quote[2];
|
|
||||||
});
|
|
||||||
return this.cache.filtered = filtered;
|
return this.cache.filtered = filtered;
|
||||||
},
|
},
|
||||||
|
|
||||||
get process() { // FIXME
|
|
||||||
let self = this;
|
|
||||||
let process = this._process;
|
|
||||||
process = [process[0] || template.icon, process[1] || function (item, k) k];
|
|
||||||
let first = process[0];
|
|
||||||
let filter = this.filter;
|
|
||||||
if (!this.anchored)
|
|
||||||
process[0] = function (item, text) first.call(self, item, template.highlightFilter(item.text, filter));
|
|
||||||
return process;
|
|
||||||
},
|
|
||||||
set process(process) {
|
|
||||||
this._process = process;
|
|
||||||
},
|
|
||||||
|
|
||||||
get substrings() {
|
get substrings() {
|
||||||
let items = this.items;
|
let items = this.items;
|
||||||
if (items.length == 0 || !this.hasItems)
|
if (items.length == 0 || !this.hasItems)
|
||||||
@@ -418,7 +443,10 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
return this._substrings;
|
return this._substrings;
|
||||||
|
|
||||||
let fixCase = this.ignoreCase ? String.toLowerCase : util.identity;
|
let fixCase = this.ignoreCase ? String.toLowerCase : util.identity;
|
||||||
let text = fixCase(items[0].unquoted || items[0].text);
|
let text = fixCase(items[0].text);
|
||||||
|
// Exceedingly long substrings cause Gecko to go into convulsions
|
||||||
|
if (text.length > 100)
|
||||||
|
text = text.substr(0, 100);
|
||||||
let filter = fixCase(this.filter);
|
let filter = fixCase(this.filter);
|
||||||
if (this.anchored) {
|
if (this.anchored) {
|
||||||
var compare = function compare(text, s) text.substr(0, s.length) == s;
|
var compare = function compare(text, s) text.substr(0, s.length) == s;
|
||||||
@@ -521,7 +549,6 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
context.waitingForTab = true;
|
context.waitingForTab = true;
|
||||||
else if (completer)
|
else if (completer)
|
||||||
return completer.apply(self || this, [context].concat(Array.slice(arguments, fork.length)));
|
return completer.apply(self || this, [context].concat(Array.slice(arguments, fork.length)));
|
||||||
|
|
||||||
if (completer)
|
if (completer)
|
||||||
return null;
|
return null;
|
||||||
return context;
|
return context;
|
||||||
@@ -535,20 +562,24 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
highlight: function highlight(start, length, type) {
|
highlight: function highlight(start, length, type) {
|
||||||
try { // Gecko < 1.9.1 doesn't have repaintSelection
|
if (arguments.length == 0) {
|
||||||
this.selectionTypes[type] = null;
|
for (let type in this.selectionTypes)
|
||||||
|
this.highlight(0, 0, type);
|
||||||
|
this.selectionTypes = {};
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// Requires Gecko >= 1.9.1
|
||||||
|
this.selectionTypes[type] = true;
|
||||||
const selType = Ci.nsISelectionController["SELECTION_" + type];
|
const selType = Ci.nsISelectionController["SELECTION_" + type];
|
||||||
const editor = this.editor;
|
let sel = this.editor.selectionController.getSelection(selType);
|
||||||
let sel = editor.selectionController.getSelection(selType);
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
sel.removeAllRanges();
|
sel.removeAllRanges();
|
||||||
else {
|
else {
|
||||||
let range = editor.selection.getRangeAt(0).cloneRange();
|
let range = this.editor.selection.getRangeAt(0).cloneRange();
|
||||||
range.setStart(range.startContainer, this.offset + start);
|
range.setStart(range.startContainer, this.offset + start);
|
||||||
range.setEnd(range.startContainer, this.offset + start + length);
|
range.setEnd(range.startContainer, this.offset + start + length);
|
||||||
sel.addRange(range);
|
sel.addRange(range);
|
||||||
}
|
}
|
||||||
editor.selectionController.repaintSelection(selType);
|
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
},
|
},
|
||||||
@@ -557,23 +588,19 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
return this.matchString(this.filter, str);
|
return this.matchString(this.filter, str);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
pushProcessor: function pushProcess(i, fn) {
|
||||||
|
let next = this.process[i];
|
||||||
|
this.process[i] = function (item, text) fn(item, text, next);
|
||||||
|
},
|
||||||
|
|
||||||
reset: function reset() {
|
reset: function reset() {
|
||||||
let self = this;
|
let self = this;
|
||||||
if (this.parent)
|
if (this.parent)
|
||||||
throw Error();
|
throw Error();
|
||||||
// Not ideal.
|
|
||||||
for (let type in this.selectionTypes)
|
|
||||||
this.highlight(0, 0, type);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {[CompletionContext]} A list of active
|
|
||||||
* completion contexts, in the order in which they were
|
|
||||||
* instantiated.
|
|
||||||
*/
|
|
||||||
this.contextList = [];
|
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
this.process = [];
|
this.process = [template.icon, function (item, k) k];
|
||||||
this.selectionTypes = {};
|
this.filters = [CompletionContext.Filter.text];
|
||||||
this.tabPressed = false;
|
this.tabPressed = false;
|
||||||
this.title = ["Completions"];
|
this.title = ["Completions"];
|
||||||
this.updateAsync = false;
|
this.updateAsync = false;
|
||||||
@@ -595,6 +622,10 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
if (context != context.top)
|
if (context != context.top)
|
||||||
context.incomplete = false;
|
context.incomplete = false;
|
||||||
}
|
}
|
||||||
|
this.runCount++;
|
||||||
|
for each (let context in this.contextList)
|
||||||
|
context.lastActivated = this.runCount;
|
||||||
|
this.contextList = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -668,7 +699,7 @@ const Completion = Module("completion", {
|
|||||||
|
|
||||||
commandline.commandOutput(
|
commandline.commandOutput(
|
||||||
<div highlight="Completions">
|
<div highlight="Completions">
|
||||||
{ template.map(context.contextList.filter(function (c) c.hasItems),
|
{ template.map(context.contextList.filter(function (c) c.hasItems && c.items.length),
|
||||||
function (context)
|
function (context)
|
||||||
template.completionRow(context.title, "CompTitle") +
|
template.completionRow(context.title, "CompTitle") +
|
||||||
template.map(context.items, function (item) context.createRow(item), null, 100)) }
|
template.map(context.items, function (item) context.createRow(item), null, 100)) }
|
||||||
@@ -747,7 +778,7 @@ const Completion = Module("completion", {
|
|||||||
|
|
||||||
let re = RegExp(tokens.filter(util.identity).map(util.escapeRegex).join("|"), "g");
|
let re = RegExp(tokens.filter(util.identity).map(util.escapeRegex).join("|"), "g");
|
||||||
function highlight(item, text, i) process[i].call(this, item, template.highlightRegexp(text, re));
|
function highlight(item, text, i) process[i].call(this, item, template.highlightRegexp(text, re));
|
||||||
let process = [template.icon, function (item, k) k];
|
let process = context.process;
|
||||||
context.process = [
|
context.process = [
|
||||||
function (item, text) highlight.call(this, item, item.text, 0),
|
function (item, text) highlight.call(this, item, item.text, 0),
|
||||||
function (item, text) highlight.call(this, item, text, 1)
|
function (item, text) highlight.call(this, item, text, 1)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -12,8 +12,33 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
* initialization code. Must call superclass's init function.
|
* initialization code. Must call superclass's init function.
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
|
this.name = services.get("dactyl:").name;
|
||||||
|
this.appname = services.get("dactyl:").appname;
|
||||||
|
this.host = services.get("dactyl:").host;
|
||||||
|
|
||||||
highlight.styleableChrome = this.styleableChrome;
|
highlight.styleableChrome = this.styleableChrome;
|
||||||
highlight.loadCSS(this.CSS);
|
highlight.loadCSS(this.CSS);
|
||||||
|
highlight.loadCSS(this.helpCSS);
|
||||||
|
|
||||||
|
let img = Image();
|
||||||
|
img.src = this.logo || "chrome://" + this.name + "/content/logo.png";
|
||||||
|
img.onload = function () {
|
||||||
|
highlight.set("Logo", String(<>
|
||||||
|
display: inline-block;
|
||||||
|
background: url({img.src});
|
||||||
|
width: {img.width}px;
|
||||||
|
height: {img.height}px;
|
||||||
|
</>));
|
||||||
|
img = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
styleHelp: function () {
|
||||||
|
if (!this.helpStyled)
|
||||||
|
for (let k in keys(highlight.loaded))
|
||||||
|
if (/^(Help|StatusLine)|^(Boolean|Indicator|MoreMsg|Number|Logo|Key(word)?|String)$/.test(k))
|
||||||
|
highlight.loaded[k] = true;
|
||||||
|
this.helpCSS = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,7 +117,7 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
* @property {number} The height (px) that is available to the output
|
* @property {number} The height (px) that is available to the output
|
||||||
* window.
|
* window.
|
||||||
*/
|
*/
|
||||||
get outputHeight() config.browser.mPanelContainer.boxObject.height,
|
get outputHeight() this.browser.mPanelContainer.boxObject.height,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {[string]} A list of extra scripts in the dactyl or
|
* @property {[string]} A list of extra scripts in the dactyl or
|
||||||
@@ -105,21 +130,15 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
* @property {string} The leaf name of any temp files created by
|
* @property {string} The leaf name of any temp files created by
|
||||||
* {@link io.createTempFile}.
|
* {@link io.createTempFile}.
|
||||||
*/
|
*/
|
||||||
get tempFile() this.name.toLowerCase() + ".tmp",
|
get tempFile() this.name + ".tmp",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constant
|
* @constant
|
||||||
* @property {string} The default highlighting rules. They have the
|
* @property {string} The default highlighting rules.
|
||||||
* form:
|
* See {@link Highlights#loadCSS} for details.
|
||||||
* rule ::= selector space space+ css
|
|
||||||
* selector ::= group
|
|
||||||
* | group "," css-selector
|
|
||||||
* | group "," css-selector "," scope
|
|
||||||
* group ::= groupname
|
|
||||||
* | groupname css-selector
|
|
||||||
*/
|
*/
|
||||||
|
CSS: UTF8(<><![CDATA[
|
||||||
// <css>
|
// <css>
|
||||||
CSS: <![CDATA[
|
|
||||||
Boolean color: red;
|
Boolean color: red;
|
||||||
Function color: navy;
|
Function color: navy;
|
||||||
Null color: blue;
|
Null color: blue;
|
||||||
@@ -132,17 +151,19 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
Enabled color: blue;
|
Enabled color: blue;
|
||||||
Disabled color: red;
|
Disabled color: red;
|
||||||
|
|
||||||
Normal color: black; background: white;
|
!Normal color: black !important; background: white !important;
|
||||||
ErrorMsg color: white; background: red; font-weight: bold;
|
ErrorMsg color: white !important; background: red !important; font-weight: bold !important;
|
||||||
InfoMsg color: black; background: white;
|
InfoMsg color: black !important; background: white !important;
|
||||||
ModeMsg color: black; background: white;
|
LineNr color: orange !important; background: white !important;
|
||||||
MoreMsg color: green; background: white;
|
ModeMsg color: black !important; background: white !important;
|
||||||
WarningMsg color: red; background: white;
|
MoreMsg color: green !important; background: white !important;
|
||||||
Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block;
|
Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block;
|
||||||
NonText color: blue; min-height: 16px; padding-left: 2px;
|
NonText color: blue; min-height: 16px; padding-left: 2px;
|
||||||
Preview color: gray;
|
*Preview color: gray;
|
||||||
|
Question color: green !important; background: white !important; font-weight: bold !important;
|
||||||
|
WarningMsg color: red !important; background: white !important;
|
||||||
|
|
||||||
CmdLine,>* font-family: monospace; padding: 1px;
|
!CmdLine;>* font-family: monospace !important; padding: 1px !important;
|
||||||
CmdOutput white-space: pre;
|
CmdOutput white-space: pre;
|
||||||
|
|
||||||
CompGroup
|
CompGroup
|
||||||
@@ -158,9 +179,10 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
CompResult width: 45%; overflow: hidden;
|
CompResult width: 45%; overflow: hidden;
|
||||||
CompDesc color: gray; width: 50%;
|
CompDesc color: gray; width: 50%;
|
||||||
CompLess text-align: center; height: 0; line-height: .5ex; padding-top: 1ex;
|
CompLess text-align: center; height: 0; line-height: .5ex; padding-top: 1ex;
|
||||||
CompLess::after content: "\2303" /* Unicode up arrowhead */
|
CompLess::after content: "⌃";
|
||||||
CompMore text-align: center; height: .5ex; line-height: .5ex; margin-bottom: -.5ex;
|
CompMore text-align: center; height: .5ex; line-height: .5ex; margin-bottom: -.5ex;
|
||||||
CompMore::after content: "\2304" /* Unicode down arrowhead */
|
CompMore::after content: "⌄";
|
||||||
|
CompGroup:last-of-type padding-bottom: 1.5ex;
|
||||||
|
|
||||||
Gradient height: 1px; margin-bottom: -1px; margin-top: -1px;
|
Gradient height: 1px; margin-bottom: -1px; margin-top: -1px;
|
||||||
GradientLeft background-color: magenta;
|
GradientLeft background-color: magenta;
|
||||||
@@ -172,19 +194,16 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
Keyword color: red;
|
Keyword color: red;
|
||||||
Tag color: blue;
|
Tag color: blue;
|
||||||
|
|
||||||
LineNr color: orange; background: white;
|
!StatusLine color: white !important; background: black !important
|
||||||
Question color: green; background: white; font-weight: bold;
|
StatusLineBroken color: black !important; background: #FFa0a0 !important /* light-red */
|
||||||
|
StatusLineSecure color: black !important; background: #a0a0FF !important /* light-blue */
|
||||||
|
StatusLineExtended color: black !important; background: #a0FFa0 !important /* light-green */
|
||||||
|
|
||||||
StatusLine color: white; background: black;
|
TabClose;.tab-close-button
|
||||||
StatusLineBroken color: black; background: #FFa0a0 /* light-red */
|
TabIcon;.tab-icon
|
||||||
StatusLineSecure color: black; background: #a0a0FF /* light-blue */
|
TabText;.tab-text
|
||||||
StatusLineExtended color: black; background: #a0FFa0 /* light-green */
|
!TabNumber font-weight: bold; margin: 0px; padding-right: .3ex;
|
||||||
|
!TabIconNumber {
|
||||||
TabClose,.tab-close-button
|
|
||||||
TabIcon,.tab-icon
|
|
||||||
TabText,.tab-text
|
|
||||||
TabNumber font-weight: bold; margin: 0px; padding-right: .3ex;
|
|
||||||
TabIconNumber {
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -195,47 +214,52 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
URL text-decoration: none; color: green; background: inherit;
|
URL text-decoration: none; color: green; background: inherit;
|
||||||
URL:hover text-decoration: underline; cursor: pointer;
|
URL:hover text-decoration: underline; cursor: pointer;
|
||||||
|
|
||||||
FrameIndicator,,* {
|
FrameIndicator;;* {
|
||||||
background-color: red;
|
/* This gets released into the wild, so everything is important */
|
||||||
opacity: 0.5;
|
background-color: red !important;
|
||||||
z-index: 999;
|
opacity: 0.5 !important;
|
||||||
position: fixed;
|
z-index: 999999 !important;
|
||||||
top: 0;
|
position: fixed !important;
|
||||||
bottom: 0;
|
top: 0 !important;
|
||||||
left: 0;
|
bottom: 0 !important;
|
||||||
right: 0;
|
left: 0 !important;
|
||||||
|
right: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bell border: none; background-color: black;
|
!Bell border: none; background-color: black;
|
||||||
Hint,,* {
|
Hint;;* {
|
||||||
font-family: monospace;
|
/* This gets released into the wild, so everything is important */
|
||||||
font-size: 10px;
|
font: bold 10px monospace !important;
|
||||||
font-weight: bold;
|
background-color: red !important;
|
||||||
color: white;
|
color: white !important;
|
||||||
background-color: red;
|
border: 0px solid ButtonShadow !important;
|
||||||
border-color: ButtonShadow;
|
padding: 0px 1px !important;
|
||||||
border-width: 0px;
|
|
||||||
border-style: solid;
|
|
||||||
padding: 0px 1px 0px 1px;
|
|
||||||
}
|
}
|
||||||
Hint::after,,* content: attr(number);
|
!Hint::after;;* content: attr(number) !important;
|
||||||
HintElem,,* background-color: yellow; color: black;
|
!HintElem;;* background-color: yellow !important; color: black !important;
|
||||||
HintActive,,* background-color: #88FF00; color: black;
|
!HintActive;;* background-color: #88FF00 !important; color: black !important;
|
||||||
HintImage,,* opacity: .5;
|
!HintImage;;* opacity: .5 !important;
|
||||||
|
|
||||||
Help font-size: 8pt; line-height: 1.4em; font-family: -moz-fixed;
|
!Logo
|
||||||
|
// </css>
|
||||||
|
]]></>),
|
||||||
|
|
||||||
|
helpCSS: UTF8(<><![CDATA[
|
||||||
|
// <css>
|
||||||
|
Help font-size: 8pt; line-height: 1.4em; font-family: -moz-fixed, monospace;
|
||||||
|
|
||||||
HelpArg color: #6A97D4;
|
HelpArg color: #6A97D4;
|
||||||
HelpOptionalArg color: #6A97D4;
|
HelpOptionalArg color: #6A97D4;
|
||||||
|
|
||||||
HelpBody display: block; margin: 1em auto; max-width: 100ex;
|
HelpBody display: block; margin: 1em auto; max-width: 100ex; padding-bottom: 1em; margin-bottom: 4em; border-bottom-width: 1px;
|
||||||
HelpBorder,*,dactyl://help/* border-color: silver; border-width: 0px; border-style: solid;
|
HelpBorder;*;dactyl://help/* border-color: silver; border-width: 0px; border-style: solid;
|
||||||
HelpCode display: block; white-space: pre; margin-left: 2em; font-family: Terminus, Fixed, monospace;
|
HelpCode display: block; white-space: pre; margin-left: 2em; font-family: monospace;
|
||||||
|
|
||||||
HelpDefault margin-right: 1ex; white-space: pre;
|
HelpDefault display: inline-block; margin-right: 1ex; white-space: pre;
|
||||||
|
|
||||||
HelpDescription display: block;
|
HelpDescription display: block; clear: right;
|
||||||
HelpEm,html|em,dactyl://help/* font-weight: bold; font-style: normal;
|
HelpDescription[short] clear: none;
|
||||||
|
HelpEm;html|em;dactyl://help/* font-weight: bold; font-style: normal;
|
||||||
|
|
||||||
HelpEx display: inline-block; color: #527BBD; font-weight: bold;
|
HelpEx display: inline-block; color: #527BBD; font-weight: bold;
|
||||||
|
|
||||||
@@ -249,32 +273,42 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
HelpItem display: block; margin: 1em 1em 1em 10em; clear: both;
|
HelpItem display: block; margin: 1em 1em 1em 10em; clear: both;
|
||||||
|
|
||||||
HelpKey color: #102663;
|
HelpKey color: #102663;
|
||||||
|
HelpKeyword font-weight: bold; color: navy;
|
||||||
|
|
||||||
HelpLink,html|a,dactyl://help/* text-decoration: none;
|
HelpLink;html|a;dactyl://help/* text-decoration: none !important;
|
||||||
HelpLink[href]:hover text-decoration: underline;
|
HelpLink[href]:hover text-decoration: underline !important;
|
||||||
|
HelpLink[href^="mailto:"]::after content: "✉"; padding-left: .2em;
|
||||||
|
HelpLink[rel=external] {
|
||||||
|
/* Thanks, Wikipedia */
|
||||||
|
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAFVBMVEVmmcwzmcyZzP8AZswAZv////////9E6giVAAAAB3RSTlP///////8AGksDRgAAADhJREFUGFcly0ESAEAEA0Ei6/9P3sEcVB8kmrwFyni0bOeyyDpy9JTLEaOhQq7Ongf5FeMhHS/4AVnsAZubxDVmAAAAAElFTkSuQmCC) no-repeat scroll right center;
|
||||||
|
padding-right: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
HelpList,html|ul,dactyl://help/* display: block; list-style: outside disc;
|
HelpOrderedList;ol[level="1"],ol;dactyl://help/* display: block; list-style: outside decimal;
|
||||||
HelpOrderedList,html|ol,dactyl://help/* display: block; list-style: outside decimal;
|
HelpOrderedList2;ol[level="2"],ol ol;dactyl://help/* list-style: outside upper-alpha;
|
||||||
HelpListItem,html|li,dactyl://help/* display: list-item;
|
HelpOrderedList3;ol[level="3"],ol ol ol;dactyl://help/* list-style: outside lower-roman;
|
||||||
|
HelpList;html|ul;dactyl://help/* display: block; list-style: outside disc;
|
||||||
|
HelpListItem;html|li;dactyl://help/* display: list-item;
|
||||||
|
|
||||||
HelpNote color: red; font-weight: bold;
|
HelpNote color: red; font-weight: bold;
|
||||||
|
|
||||||
HelpOpt color: #106326;
|
HelpOpt color: #106326;
|
||||||
HelpOptInfo display: inline-block; margin-bottom: 1ex;
|
HelpOptInfo display: block; margin-bottom: 1ex; padding-left: 4em;
|
||||||
|
|
||||||
HelpParagraph,html|p,dactyl://help/* display: block; margin: 1em 0em;
|
HelpParagraph;html|p;dactyl://help/* display: block; margin: 1em 0em;
|
||||||
HelpParagraph:first-child margin-top: 0;
|
HelpParagraph:first-child margin-top: 0;
|
||||||
HelpSpec display: block; margin-left: -10em; float: left; clear: left; color: #527BBD; margin-right: 2em;
|
HelpParagraph:last-child margin-bottom: 0;
|
||||||
|
HelpSpec display: block; margin-left: -10em; float: left; clear: left; color: #527BBD; margin-right: 1em;
|
||||||
|
|
||||||
HelpString display: inline-block; color: green; font-weight: normal; vertical-align: text-top;
|
HelpString color: green; font-weight: normal;
|
||||||
HelpString::before content: '"';
|
HelpString::before content: '"';
|
||||||
HelpString::after content: '"';
|
HelpString::after content: '"';
|
||||||
HelpString[delim]::before content: attr(delim);
|
HelpString[delim]::before content: attr(delim);
|
||||||
HelpString[delim]::after content: attr(delim);
|
HelpString[delim]::after content: attr(delim);
|
||||||
|
|
||||||
HelpHead,html|h1,dactyl://help/* {
|
HelpHead;html|h1;dactyl://help/* {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 1em 0;
|
margin: 2em 0 1em;
|
||||||
padding-bottom: .2ex;
|
padding-bottom: .2ex;
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
@@ -282,9 +316,9 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
color: #527BBD;
|
color: #527BBD;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
HelpSubhead,html|h2,dactyl://help/* {
|
HelpSubhead;html|h2;dactyl://help/* {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 1em 0;
|
margin: 2em 0 1em;
|
||||||
padding-bottom: .2ex;
|
padding-bottom: .2ex;
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
@@ -292,7 +326,7 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
color: #527BBD;
|
color: #527BBD;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
HelpSubsubhead,html|h3,dactyl://help/* {
|
HelpSubsubhead;html|h3;dactyl://help/* {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
padding-bottom: .2ex;
|
padding-bottom: .2ex;
|
||||||
@@ -305,12 +339,20 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
HelpTOC
|
HelpTOC
|
||||||
HelpTOC>ol ol margin-left: -1em;
|
HelpTOC>ol ol margin-left: -1em;
|
||||||
|
|
||||||
HelpTab,html|dl,dactyl://help/* display: table; width: 100%; margin: 1em 0; border-bottom-width: 1px; border-top-width: 1px; padding: .5ex 0; table-layout: fixed;
|
HelpTab;html|dl;dactyl://help/* {
|
||||||
HelpTabColumn,html|column,dactyl://help/* display: table-column;
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
margin: 1em 0;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-top-width: 1px;
|
||||||
|
padding: .5ex 0;
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
HelpTabColumn;html|column;dactyl://help/* display: table-column;
|
||||||
HelpTabColumn:first-child width: 25%;
|
HelpTabColumn:first-child width: 25%;
|
||||||
HelpTabTitle,html|dt,dactyl://help/* display: table-cell; padding: .1ex 1ex; font-weight: bold;
|
HelpTabTitle;html|dt;dactyl://help/* display: table-cell; padding: .1ex 1ex; font-weight: bold;
|
||||||
HelpTabDescription,html|dd,dactyl://help/* display: table-cell; padding: .1ex 1ex; border-width: 0px;
|
HelpTabDescription;html|dd;dactyl://help/* display: table-cell; padding: .1ex 1ex; border-width: 0px;
|
||||||
HelpTabRow,html|dl>html|tr,dactyl://help/* display: table-row;
|
HelpTabRow;html|dl>html|tr;dactyl://help/* display: table-row;
|
||||||
|
|
||||||
HelpTag display: inline-block; color: #527BBD; margin-left: 1ex; font-size: 8pt; font-weight: bold;
|
HelpTag display: inline-block; color: #527BBD; margin-left: 1ex; font-size: 8pt; font-weight: bold;
|
||||||
HelpTags display: block; float: right; clear: right;
|
HelpTags display: block; float: right; clear: right;
|
||||||
@@ -319,15 +361,31 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
|
|
||||||
HelpWarning color: red; font-weight: bold;
|
HelpWarning color: red; font-weight: bold;
|
||||||
|
|
||||||
Logo
|
HelpXML color: #C5F779; background-color: #444444; font-family: Terminus, Fixed, monospace;
|
||||||
|
HelpXMLBlock { white-space: pre; color: #C5F779; background-color: #444444;
|
||||||
Search,,* {
|
border: 1px dashed #aaaaaa;
|
||||||
font-size: inherit;
|
display: block;
|
||||||
padding: 0;
|
margin-left: 2em;
|
||||||
color: black;
|
font-family: Terminus, Fixed, monospace;
|
||||||
background-color: yellow;
|
|
||||||
}
|
}
|
||||||
]]>.toString()
|
HelpXMLAttribute color: #C5F779;
|
||||||
|
HelpXMLAttribute::after color: #E5E5E5; content: "=";
|
||||||
|
HelpXMLComment color: #444444;
|
||||||
|
HelpXMLComment::before content: "<!--";
|
||||||
|
HelpXMLComment::after content: "-->";
|
||||||
|
HelpXMLProcessing color: #C5F779;
|
||||||
|
HelpXMLProcessing::before color: #444444; content: "<?";
|
||||||
|
HelpXMLProcessing::after color: #444444; content: "?>";
|
||||||
|
HelpXMLString color: #C5F779; white-space: pre;
|
||||||
|
HelpXMLString::before content: '"';
|
||||||
|
HelpXMLString::after content: '"';
|
||||||
|
HelpXMLNamespace color: #FFF796;
|
||||||
|
HelpXMLNamespace::after color: #777777; content: ":";
|
||||||
|
HelpXMLTagStart color: #FFF796; white-space: normal; display: inline-block; text-indent: -1.5em; padding-left: 1.5em;
|
||||||
|
HelpXMLTagEnd color: #71BEBE;
|
||||||
|
HelpXMLText color: #E5E5E5;
|
||||||
|
// </css>
|
||||||
|
]]></>)
|
||||||
});
|
});
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -20,8 +20,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e !== "Error opening input stream (invalid filename?)")
|
if (e !== "Error opening input stream (invalid filename?)") {
|
||||||
dump("dactyl: Trying: " + (base + script + ".js") + ": " + e + "\n" + e.stack);
|
dump("dactyl: Trying: " + (base + script + ".js") + ": " + e + "\n" + e.stack);
|
||||||
|
Components.utils.reportError(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -30,6 +32,7 @@
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
dump("dactyl: Loading script " + script + ": " + e.result + " " + e + "\n");
|
dump("dactyl: Loading script " + script + ": " + e.result + " " + e + "\n");
|
||||||
dump(Error().stack + "\n");
|
dump(Error().stack + "\n");
|
||||||
|
Components.utils.reportError(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -64,7 +67,7 @@
|
|||||||
"template",
|
"template",
|
||||||
].forEach(modules.load);
|
].forEach(modules.load);
|
||||||
|
|
||||||
prefix.unshift("chrome://" + modules.Config.prototype.name.toLowerCase() + "/content/");
|
prefix.unshift("chrome://" + modules.services.get("dactyl:").name + "/content/");
|
||||||
modules.Config.prototype.scripts.forEach(modules.load);
|
modules.Config.prototype.scripts.forEach(modules.load);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -204,14 +204,14 @@ const Dactyl = Module("dactyl", {
|
|||||||
*
|
*
|
||||||
* @param {string|Object} msg The message to print.
|
* @param {string|Object} msg The message to print.
|
||||||
*/
|
*/
|
||||||
dump: function () {
|
dump: function dump() {
|
||||||
let msg = Array.map(arguments, function (msg) {
|
let msg = Array.map(arguments, function (msg) {
|
||||||
if (typeof msg == "object")
|
if (typeof msg == "object")
|
||||||
msg = util.objectToString(msg);
|
msg = util.objectToString(msg);
|
||||||
return msg;
|
return msg;
|
||||||
}).join(", ");
|
}).join(", ");
|
||||||
msg = String.replace(msg, /\n?$/, "\n");
|
msg = String.replace(msg, /\n?$/, "\n");
|
||||||
window.dump(msg.replace(/^./gm, ("config" in modules && config.name.toLowerCase()) + ": $&"));
|
window.dump(msg.replace(/^./gm, ("config" in modules && config.name) + ": $&"));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,7 +220,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @param {string} msg The trace message.
|
* @param {string} msg The trace message.
|
||||||
* @param {number} frames The number of frames to print.
|
* @param {number} frames The number of frames to print.
|
||||||
*/
|
*/
|
||||||
dumpStack: function (msg, frames) {
|
dumpStack: function dumpStack(msg, frames) {
|
||||||
let stack = Error().stack.replace(/(?:.*\n){2}/, "");
|
let stack = Error().stack.replace(/(?:.*\n){2}/, "");
|
||||||
if (frames != null)
|
if (frames != null)
|
||||||
[stack] = stack.match(RegExp("(?:.*\n){0," + frames + "}"));
|
[stack] = stack.match(RegExp("(?:.*\n){0," + frames + "}"));
|
||||||
@@ -234,7 +234,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @param {number} flags These control the multiline message behaviour.
|
* @param {number} flags These control the multiline message behaviour.
|
||||||
* See {@link CommandLine#echo}.
|
* See {@link CommandLine#echo}.
|
||||||
*/
|
*/
|
||||||
echo: function (str, flags) {
|
echo: function echo(str, flags) {
|
||||||
commandline.echo(str, commandline.HL_NORMAL, flags);
|
commandline.echo(str, commandline.HL_NORMAL, flags);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @param {number} flags These control the multiline message behaviour.
|
* @param {number} flags These control the multiline message behaviour.
|
||||||
* See {@link CommandLine#echo}.
|
* See {@link CommandLine#echo}.
|
||||||
*/
|
*/
|
||||||
echoerr: function (str, flags) {
|
echoerr: function echoerr(str, flags) {
|
||||||
flags |= commandline.APPEND_TO_MESSAGES;
|
flags |= commandline.APPEND_TO_MESSAGES;
|
||||||
|
|
||||||
if (isinstance(str, ["Error", "Exception"]))
|
if (isinstance(str, ["Error", "Exception"]))
|
||||||
@@ -293,8 +293,6 @@ const Dactyl = Module("dactyl", {
|
|||||||
* should be loaded.
|
* should be loaded.
|
||||||
*/
|
*/
|
||||||
loadScript: function (uri, context) {
|
loadScript: function (uri, context) {
|
||||||
XML.ignoreWhiteSpace = false;
|
|
||||||
XML.prettyPrinting = false;
|
|
||||||
services.get("subscriptLoader").loadSubScript(uri, context);
|
services.get("subscriptLoader").loadSubScript(uri, context);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -395,7 +393,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
let command = commands.get(cmd);
|
let command = commands.get(cmd);
|
||||||
|
|
||||||
if (command === null) {
|
if (command === null) {
|
||||||
err = "E492: Not a " + config.name.toLowerCase() + " command: " + str;
|
err = "E492: Not a " + config.name + " command: " + str;
|
||||||
dactyl.focusContent();
|
dactyl.focusContent();
|
||||||
}
|
}
|
||||||
else if (command.action === null)
|
else if (command.action === null)
|
||||||
@@ -486,27 +484,19 @@ const Dactyl = Module("dactyl", {
|
|||||||
* Initialize the help system.
|
* Initialize the help system.
|
||||||
*/
|
*/
|
||||||
initHelp: function () {
|
initHelp: function () {
|
||||||
|
if (!this.helpInitialized) {
|
||||||
if ("noscriptOverlay" in window) {
|
if ("noscriptOverlay" in window) {
|
||||||
noscriptOverlay.safeAllow("chrome-data:", true, false);
|
noscriptOverlay.safeAllow("chrome-data:", true, false);
|
||||||
noscriptOverlay.safeAllow("dactyl:", true, false);
|
noscriptOverlay.safeAllow("dactyl:", true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.helpInitialized) {
|
let namespaces = [config.name, "dactyl"];
|
||||||
let namespaces = [config.name.toLowerCase(), "dactyl"];
|
|
||||||
services.get("dactyl:").init({});
|
services.get("dactyl:").init({});
|
||||||
|
|
||||||
let tagMap = services.get("dactyl:").HELP_TAGS;
|
let tagMap = services.get("dactyl:").HELP_TAGS;
|
||||||
let fileMap = services.get("dactyl:").FILE_MAP;
|
let fileMap = services.get("dactyl:").FILE_MAP;
|
||||||
let overlayMap = services.get("dactyl:").OVERLAY_MAP;
|
let overlayMap = services.get("dactyl:").OVERLAY_MAP;
|
||||||
|
|
||||||
// Left as an XPCOM instantiation so it can easilly be moved
|
|
||||||
// into XPCOM code.
|
|
||||||
function XSLTProcessor(sheet) {
|
|
||||||
let xslt = Cc["@mozilla.org/document-transformer;1?type=xslt"].createInstance(Ci.nsIXSLTProcessor);
|
|
||||||
xslt.importStylesheet(util.httpGet(sheet).responseXML);
|
|
||||||
return xslt;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find help and overlay files with the given name.
|
// Find help and overlay files with the given name.
|
||||||
function findHelpFile(file) {
|
function findHelpFile(file) {
|
||||||
let result = [];
|
let result = [];
|
||||||
@@ -525,23 +515,20 @@ const Dactyl = Module("dactyl", {
|
|||||||
}
|
}
|
||||||
// Find the tags in the document.
|
// Find the tags in the document.
|
||||||
function addTags(file, doc) {
|
function addTags(file, doc) {
|
||||||
doc = XSLT.transformToDocument(doc);
|
for (let elem in util.evaluateXPath("//@tag|//dactyl:tags/text()|//dactyl:tag/text()", doc))
|
||||||
for (let elem in util.evaluateXPath("//xhtml:a/@id", doc))
|
for (let tag in array((elem.value || elem.textContent).split(/\s+/)).compact().itervalues())
|
||||||
tagMap[elem.value] = file;
|
tagMap[tag] = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
const XSLT = XSLTProcessor("chrome://dactyl/content/help-single.xsl");
|
|
||||||
|
|
||||||
// Scrape the list of help files from all.xml
|
// Scrape the list of help files from all.xml
|
||||||
// Always process main and overlay files, since XSLTProcessor and
|
// Manually process main and overlay files, since XSLTProcessor and
|
||||||
// XMLHttpRequest don't allow access to chrome documents.
|
// XMLHttpRequest don't allow access to chrome documents.
|
||||||
tagMap.all = "all";
|
tagMap.all = "all";
|
||||||
let files = findHelpFile("all").map(function (doc)
|
let files = findHelpFile("all").map(function (doc)
|
||||||
[f.value for (f in util.evaluateXPath(
|
[f.value for (f in util.evaluateXPath("//dactyl:include/@href", doc))]);
|
||||||
"//dactyl:include/@href", doc))]);
|
|
||||||
|
|
||||||
// Scrape the tags from the rest of the help files.
|
// Scrape the tags from the rest of the help files.
|
||||||
util.Array.flatten(files).forEach(function (file) {
|
array.flatten(files).forEach(function (file) {
|
||||||
findHelpFile(file).forEach(function (doc) {
|
findHelpFile(file).forEach(function (doc) {
|
||||||
addTags(file, doc);
|
addTags(file, doc);
|
||||||
});
|
});
|
||||||
@@ -550,7 +537,6 @@ const Dactyl = Module("dactyl", {
|
|||||||
// Process plugin help entries.
|
// Process plugin help entries.
|
||||||
XML.ignoreWhiteSpace = false;
|
XML.ignoreWhiteSpace = false;
|
||||||
XML.prettyPrinting = false;
|
XML.prettyPrinting = false;
|
||||||
XML.prettyIndent = 4;
|
|
||||||
|
|
||||||
let body = XML();
|
let body = XML();
|
||||||
for (let [, context] in Iterator(plugins.contexts))
|
for (let [, context] in Iterator(plugins.contexts))
|
||||||
@@ -558,11 +544,12 @@ const Dactyl = Module("dactyl", {
|
|||||||
body += <h2 xmlns={NS.uri} tag={context.INFO.@name + '-plugin'}>{context.INFO.@summary}</h2> +
|
body += <h2 xmlns={NS.uri} tag={context.INFO.@name + '-plugin'}>{context.INFO.@summary}</h2> +
|
||||||
context.INFO;
|
context.INFO;
|
||||||
|
|
||||||
let help = '<?xml version="1.0"?>\n' +
|
let help =
|
||||||
|
'<?xml version="1.0"?>\n' +
|
||||||
'<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>\n' +
|
'<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>\n' +
|
||||||
'<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">' +
|
'<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">\n' +
|
||||||
<document xmlns={NS}
|
<document xmlns={NS}
|
||||||
name="plugins" title={config.name + " Plugins"}>
|
name="plugins" title={config.appname + " Plugins"}>
|
||||||
<h1 tag="using-plugins">Using Plugins</h1>
|
<h1 tag="using-plugins">Using Plugins</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
@@ -589,11 +576,11 @@ const Dactyl = Module("dactyl", {
|
|||||||
function addDataEntry(file, data) // Inideal to an extreme.
|
function addDataEntry(file, data) // Inideal to an extreme.
|
||||||
addURIEntry(file, "data:text/plain;charset=UTF-8," + encodeURI(data));
|
addURIEntry(file, "data:text/plain;charset=UTF-8," + encodeURI(data));
|
||||||
|
|
||||||
let empty = util.Array.toObject(
|
let empty = set("area base basefont br col frame hr img input isindex link meta param"
|
||||||
"area base basefont br col frame hr img input isindex link meta param"
|
.split(" "));
|
||||||
.split(" ").map(Array.concat));
|
|
||||||
|
|
||||||
let chrome = {};
|
let chrome = {};
|
||||||
|
let styles = {};
|
||||||
for (let [file,] in Iterator(services.get("dactyl:").FILE_MAP)) {
|
for (let [file,] in Iterator(services.get("dactyl:").FILE_MAP)) {
|
||||||
dactyl.open("dactyl://help/" + file);
|
dactyl.open("dactyl://help/" + file);
|
||||||
dactyl.modules.events.waitForPageLoad();
|
dactyl.modules.events.waitForPageLoad();
|
||||||
@@ -612,10 +599,11 @@ const Dactyl = Module("dactyl", {
|
|||||||
if (node instanceof HTMLHtmlElement)
|
if (node instanceof HTMLHtmlElement)
|
||||||
data.push(" xmlns=" + XHTML.uri.quote());
|
data.push(" xmlns=" + XHTML.uri.quote());
|
||||||
|
|
||||||
for (let { name: name, value: value } in util.Array.itervalues(node.attributes)) {
|
for (let { name, value } in array.itervalues(node.attributes)) {
|
||||||
if (name == "dactyl:highlight") {
|
if (name == "dactyl:highlight") {
|
||||||
name = "class";
|
name = "class";
|
||||||
value = "hl-" + value;
|
value = "hl-" + value;
|
||||||
|
set.add(styles, value);
|
||||||
}
|
}
|
||||||
if (name == "href") {
|
if (name == "href") {
|
||||||
if (value.indexOf("dactyl://help-tag/") == 0)
|
if (value.indexOf("dactyl://help-tag/") == 0)
|
||||||
@@ -651,11 +639,11 @@ const Dactyl = Module("dactyl", {
|
|||||||
addDataEntry(file + ".xhtml", data.join(""));
|
addDataEntry(file + ".xhtml", data.join(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = [h.selector.replace(/^\[.*?=(.*?)\]/, ".hl-$1").replace(/html\|/, "") +
|
let data = [h for (h in highlight) if (set.has(styles, h.class) || /^Help/.test(h.class))]
|
||||||
"\t{" + h.value + "}"
|
.map(function (h)
|
||||||
for (h in highlight) if (/^Help|^Logo/.test(h.class))];
|
h.selector.replace(/^\[.*?=(.*?)\]/, ".hl-$1").replace(/html\|/, "") + "\t" +
|
||||||
|
"{" + h.value + "}")
|
||||||
data = data.join("\n");
|
.join("\n");
|
||||||
addDataEntry("help.css", data.replace(/chrome:[^ ")]+\//g, ""));
|
addDataEntry("help.css", data.replace(/chrome:[^ ")]+\//g, ""));
|
||||||
|
|
||||||
let re = /(chrome:[^ ");]+\/)([^ ");]+)/g;
|
let re = /(chrome:[^ ");]+\/)([^ ");]+)/g;
|
||||||
@@ -668,6 +656,49 @@ const Dactyl = Module("dactyl", {
|
|||||||
zip.close();
|
zip.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a help entry.
|
||||||
|
*
|
||||||
|
* @param {Command|Map|Option} obj A dactyl <b>Command</b>,
|
||||||
|
* <b>Map</b> or <b>Option</b> object
|
||||||
|
* @param {XMLList} extraHelp Extra help text beyond the description.
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
generateHelp: function generateHelp(obj, extraHelp)
|
||||||
|
{
|
||||||
|
default xml namespace = "";
|
||||||
|
let spec = util.identity;
|
||||||
|
let tag = util.identity;
|
||||||
|
if (obj instanceof Command)
|
||||||
|
tag = spec = function (cmd) <>:{cmd}</>;
|
||||||
|
else if (obj instanceof Map && obj.count)
|
||||||
|
spec = function (map) <><oa>count</oa>{map}</>;
|
||||||
|
else if (obj instanceof Option)
|
||||||
|
tag = spec = function (opt) <>'{opt}'</>;
|
||||||
|
|
||||||
|
XML.prettyPrinting = false;
|
||||||
|
XML.ignoreWhitespace = false;
|
||||||
|
|
||||||
|
// E4X has its warts.
|
||||||
|
let br = <>
|
||||||
|
</>;
|
||||||
|
|
||||||
|
return <>
|
||||||
|
<item>
|
||||||
|
<tags>{template.map(obj.names, tag, " ")}</tags>
|
||||||
|
<spec>{spec((obj.specs || obj.names)[0])}</spec>{
|
||||||
|
!obj.type ? "" : <>
|
||||||
|
<type>{obj.type}</type>
|
||||||
|
<default>{obj.defaultValue}</default></>}
|
||||||
|
<description>{
|
||||||
|
obj.description ? br+<p>{obj.description.replace(/\.?$/, ".")}</p> : "" }{
|
||||||
|
extraHelp ? br+extraHelp : "" }{
|
||||||
|
!(extraHelp || obj.description) ? br+<p>Sorry, no help available.</p> : "" }
|
||||||
|
</description>
|
||||||
|
</item></>.toXMLString();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the help page containing the specified <b>topic</b> if it
|
* Opens the help page containing the specified <b>topic</b> if it
|
||||||
* exists.
|
* exists.
|
||||||
@@ -692,8 +723,6 @@ const Dactyl = Module("dactyl", {
|
|||||||
dactyl.assert(page != null, "E149: Sorry, no help for " + topic);
|
dactyl.assert(page != null, "E149: Sorry, no help for " + topic);
|
||||||
|
|
||||||
dactyl.open("dactyl://help/" + page, { from: "help" });
|
dactyl.open("dactyl://help/" + page, { from: "help" });
|
||||||
if (options.get("activate").has("all", "help"))
|
|
||||||
content.postMessage("fragmentChange", "*");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -723,15 +752,15 @@ const Dactyl = Module("dactyl", {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let dirs = io.getRuntimeDirectories("plugin");
|
let dirs = io.getRuntimeDirectories("plugins");
|
||||||
|
|
||||||
if (dirs.length == 0) {
|
if (dirs.length == 0) {
|
||||||
dactyl.log("No user plugin directory found", 3);
|
dactyl.log("No user plugin directory found", 3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dactyl.echomsg('Searching for "plugin/**/*.{js,vimp}" in '
|
dactyl.echomsg('Searching for "plugins/**/*.{js,vimp}" in '
|
||||||
+ [dir.path.replace(/.plugin$/, "") for ([, dir] in Iterator(dirs))]
|
+ [dir.path.replace(/.plugins$/, "") for ([, dir] in Iterator(dirs))]
|
||||||
.join(",").quote(), 2);
|
.join(",").quote(), 2);
|
||||||
|
|
||||||
dirs.forEach(function (dir) {
|
dirs.forEach(function (dir) {
|
||||||
@@ -765,20 +794,33 @@ const Dactyl = Module("dactyl", {
|
|||||||
if (typeof msg == "object")
|
if (typeof msg == "object")
|
||||||
msg = util.objectToString(msg, false);
|
msg = util.objectToString(msg, false);
|
||||||
|
|
||||||
services.get("console").logStringMessage(config.name.toLowerCase() + ": " + msg);
|
services.get("console").logStringMessage(config.name + ": " + msg);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens one or more URLs. Returns true when load was initiated, or
|
* Opens one or more URLs. Returns true when load was initiated, or
|
||||||
* false on error.
|
* false on error.
|
||||||
*
|
*
|
||||||
* @param {string|string[]} urls Either a URL string or an array of URLs.
|
* @param {string|Array} urls A representation of the URLs to open. May be
|
||||||
* The array can look like this:
|
* either a string, which will be bassed to
|
||||||
* ["url1", "url2", "url3", ...]
|
* {@see Dactyl#stringToURLArray}, or an array in the same format as
|
||||||
* or:
|
* would be returned by the same.
|
||||||
* [["url1", postdata1], ["url2", postdata2], ...]
|
* @param {object} params A set of parameters specifing to open the
|
||||||
* @param {number|Object} where If ommited, CURRENT_TAB is assumed but NEW_TAB
|
* URLs. The following properties are recognized:
|
||||||
* is set when dactyl.forceNewTab is true.
|
*
|
||||||
|
* • background If true, new tabs are opened in the background.
|
||||||
|
*
|
||||||
|
* • from The desgination of the opener, as appears in
|
||||||
|
* 'activate' and 'newtab' options. If present,
|
||||||
|
* the newtab option provides the default 'where'
|
||||||
|
* parameter, and the value of the 'activate'
|
||||||
|
* parameter is inverted if 'background' is true.
|
||||||
|
*
|
||||||
|
* • where One of CURRENT_TAB, NEW_TAB, or NEW_WINDOW
|
||||||
|
*
|
||||||
|
* As a deprecated special case, the where paramater may be provided
|
||||||
|
* by itself, in which case it is transformed into { where: params }.
|
||||||
|
*
|
||||||
* @param {boolean} force Don't prompt whether to open more than 20
|
* @param {boolean} force Don't prompt whether to open more than 20
|
||||||
* tabs.
|
* tabs.
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
@@ -787,30 +829,29 @@ const Dactyl = Module("dactyl", {
|
|||||||
if (typeof urls == "string")
|
if (typeof urls == "string")
|
||||||
urls = dactyl.stringToURLArray(urls);
|
urls = dactyl.stringToURLArray(urls);
|
||||||
|
|
||||||
if (urls.length > 20 && !force) {
|
if (urls.length > 20 && !force)
|
||||||
commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no]) ",
|
return commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no]) ",
|
||||||
function (resp) {
|
function (resp) {
|
||||||
if (resp && resp.match(/^y(es)?$/i))
|
if (resp && resp.match(/^y(es)?$/i))
|
||||||
dactyl.open(urls, params, true);
|
dactyl.open(urls, params, true);
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let flags = 0;
|
|
||||||
params = params || {};
|
params = params || {};
|
||||||
if (isarray(params))
|
if (isarray(params))
|
||||||
params = { where: params };
|
params = { where: params };
|
||||||
|
|
||||||
|
let flags = 0;
|
||||||
for (let [opt, flag] in Iterator({ replace: "REPLACE_HISTORY", hide: "BYPASS_HISTORY" }))
|
for (let [opt, flag] in Iterator({ replace: "REPLACE_HISTORY", hide: "BYPASS_HISTORY" }))
|
||||||
if (params[opt])
|
flags |= params[opt] && Ci.nsIWebNavigation["LOAD_FLAGS_" + flag];
|
||||||
flags |= Ci.nsIWebNavigation["LOAD_FLAGS_" + flag];
|
|
||||||
|
|
||||||
let where = params.where || dactyl.CURRENT_TAB;
|
let where = params.where || dactyl.CURRENT_TAB;
|
||||||
let background = ("background" in params) ? params.background : params.where == dactyl.NEW_BACKGROUND_TAB;
|
let background = ("background" in params) ? params.background
|
||||||
if ("from" in params && dactyl.has("tabs")) {
|
: params.where == dactyl.NEW_BACKGROUND_TAB;
|
||||||
if (!('where' in params) && options.get("newtab").has("all", params.from))
|
|
||||||
|
if (params.from && dactyl.has("tabs")) {
|
||||||
|
if (!params.where && options.get("newtab").has("all", params.from))
|
||||||
where = dactyl.NEW_TAB;
|
where = dactyl.NEW_TAB;
|
||||||
background = !options.get("activate").has("all", params.from);
|
background ^= !options.get("activate").has("all", params.from);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urls.length == 0)
|
if (urls.length == 0)
|
||||||
@@ -829,10 +870,8 @@ const Dactyl = Module("dactyl", {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case dactyl.NEW_TAB:
|
case dactyl.NEW_TAB:
|
||||||
if (!dactyl.has("tabs")) {
|
if (!dactyl.has("tabs"))
|
||||||
open(urls, dactyl.NEW_WINDOW);
|
return open(urls, dactyl.NEW_WINDOW);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
options.withContext(function () {
|
options.withContext(function () {
|
||||||
options.setPref("browser.tabs.loadInBackground", true);
|
options.setPref("browser.tabs.loadInBackground", true);
|
||||||
@@ -849,6 +888,9 @@ const Dactyl = Module("dactyl", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(e) {}
|
catch(e) {}
|
||||||
|
// Unfortunately, failed page loads throw exceptions and
|
||||||
|
// cause a lot of unwanted noise. This solution means that
|
||||||
|
// any genuine errors go unreported.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dactyl.forceNewTab)
|
if (dactyl.forceNewTab)
|
||||||
@@ -860,6 +902,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
for (let [, url] in Iterator(urls)) {
|
for (let [, url] in Iterator(urls)) {
|
||||||
open(url, where);
|
open(url, where);
|
||||||
|
where = dactyl.NEW_TAB;
|
||||||
background = true;
|
background = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1037,12 +1080,10 @@ const Dactyl = Module("dactyl", {
|
|||||||
services.get("observer").notifyObservers(null, "quit-application-granted", null);
|
services.get("observer").notifyObservers(null, "quit-application-granted", null);
|
||||||
|
|
||||||
// enumerate all windows and call shutdown handlers
|
// enumerate all windows and call shutdown handlers
|
||||||
let windows = services.get("windowMediator").getEnumerator(null);
|
for (let win in iter(services.get("windowMediator").getEnumerator(null)))
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
let win = windows.getNext();
|
|
||||||
if (("tryToClose" in win) && !win.tryToClose())
|
if (("tryToClose" in win) && !win.tryToClose())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
services.get("appStartup").quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
|
services.get("appStartup").quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1092,14 +1133,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @property {Window[]} Returns an array of all the host application's
|
* @property {Window[]} Returns an array of all the host application's
|
||||||
* open windows.
|
* open windows.
|
||||||
*/
|
*/
|
||||||
get windows() {
|
get windows() [win for (win in iter(services.get("windowMediator").getEnumerator("navigator:browser")))],
|
||||||
let windows = [];
|
|
||||||
let enumerator = services.get("windowMediator").getEnumerator("navigator:browser");
|
|
||||||
while (enumerator.hasMoreElements())
|
|
||||||
windows.push(enumerator.getNext());
|
|
||||||
|
|
||||||
return windows;
|
|
||||||
}
|
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
// initially hide all GUI elements, they are later restored unless the user
|
// initially hide all GUI elements, they are later restored unless the user
|
||||||
@@ -1193,26 +1227,27 @@ const Dactyl = Module("dactyl", {
|
|||||||
this);
|
this);
|
||||||
let class_ = dir.map(function (dir) "html|html > xul|scrollbar[orient=" + dir + "]");
|
let class_ = dir.map(function (dir) "html|html > xul|scrollbar[orient=" + dir + "]");
|
||||||
|
|
||||||
if (class_.length)
|
styles.addSheet(true, "scrollbar", "*",
|
||||||
styles.addSheet(true, "scrollbar", "*", class_.join(", ") + " { visibility: collapse !important; }", true);
|
class_.length ? class_.join(", ") + " { visibility: collapse !important; }" : "");
|
||||||
else
|
|
||||||
styles.removeSheet(true, "scrollbar");
|
|
||||||
options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2,
|
options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2,
|
||||||
"See 'guioptions' scrollbar flags.");
|
"See 'guioptions' scrollbar flags.");
|
||||||
},
|
},
|
||||||
validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0)
|
validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0)
|
||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
|
feature: "tabs",
|
||||||
opts: {
|
opts: {
|
||||||
n: ["Tab number", highlight.selector("TabNumber")],
|
n: ["Tab number", highlight.selector("TabNumber")],
|
||||||
N: ["Tab number over icon", highlight.selector("TabIconNumber")]
|
N: ["Tab number over icon", highlight.selector("TabIconNumber")]
|
||||||
},
|
},
|
||||||
setter: function (opts) {
|
setter: function (opts) {
|
||||||
const self = this;
|
|
||||||
let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)];
|
let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)];
|
||||||
let css = classes.length ? classes.join(",") + "{ display: none; }" : "";
|
|
||||||
styles.addSheet(true, "taboptions", "chrome://*", css);
|
styles.addSheet(true, "taboptions", "chrome://*",
|
||||||
tabs.tabsBound = Array.some(opts, function (k) k in self.opts);
|
classes.length ? classes.join(",") + "{ display: none; }" : "");
|
||||||
|
|
||||||
|
tabs.tabBinding.enabled = Array.some(opts, function (k) k in this.opts, this);
|
||||||
statusline.updateTabCount();
|
statusline.updateTabCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1230,13 +1265,14 @@ const Dactyl = Module("dactyl", {
|
|||||||
"charlist", config.defaults.guioptions || "", {
|
"charlist", config.defaults.guioptions || "", {
|
||||||
setter: function (value) {
|
setter: function (value) {
|
||||||
for (let [, group] in Iterator(groups))
|
for (let [, group] in Iterator(groups))
|
||||||
|
if (!group.feature || dactyl.has(group.feature))
|
||||||
group.setter(value);
|
group.setter(value);
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
completer: function (context) {
|
completer: function (context) {
|
||||||
let opts = [v.opts for ([k, v] in Iterator(groups))];
|
let opts = [v.opts for ([k, v] in Iterator(groups)) if (!v.feature || dactyl.has(v.feature))];
|
||||||
opts = opts.map(function (opt) [[k, v[0]] for ([k, v] in Iterator(opt))]);
|
opts = opts.map(function (opt) [[k, v[0]] for ([k, v] in Iterator(opt))]);
|
||||||
return util.Array.flatten(opts);
|
return array.flatten(opts);
|
||||||
},
|
},
|
||||||
validator: function (val) Option.validateCompleter.call(this, val) &&
|
validator: function (val) Option.validateCompleter.call(this, val) &&
|
||||||
[v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val))
|
[v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val))
|
||||||
@@ -1252,7 +1288,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
options.add(["titlestring"],
|
options.add(["titlestring"],
|
||||||
"Change the title of the window",
|
"Change the title of the window",
|
||||||
"string", config.defaults.titlestring || config.hostApplication,
|
"string", config.defaults.titlestring || config.host,
|
||||||
{
|
{
|
||||||
setter: function (value) {
|
setter: function (value) {
|
||||||
let win = document.documentElement;
|
let win = document.documentElement;
|
||||||
@@ -1330,13 +1366,13 @@ const Dactyl = Module("dactyl", {
|
|||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
|
|
||||||
commands.add(["dia[log]"],
|
commands.add(["dia[log]"],
|
||||||
"Open a " + config.name + " dialog",
|
"Open a " + config.appname + " dialog",
|
||||||
function (args) {
|
function (args) {
|
||||||
let arg = args[0];
|
let dialog = args[0];
|
||||||
|
|
||||||
|
dactyl.assert(dialog in config.dialogs, "E475: Invalid argument: " + dialog);
|
||||||
try {
|
try {
|
||||||
dactyl.assert(args[0] in config.dialogs, "E475: Invalid argument: " + arg);
|
config.dialogs[dialog][1]();
|
||||||
config.dialogs[args[0]][1]();
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.echoerr("Error opening " + arg.quote() + ": " + e);
|
dactyl.echoerr("Error opening " + arg.quote() + ": " + e);
|
||||||
@@ -1383,15 +1419,8 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if (typeof AddonManager == "undefined") {
|
if (typeof AddonManager == "undefined")
|
||||||
modules.AddonManager = {
|
modules.AddonManager = {
|
||||||
getInstallForFile: function (file, callback, mimetype) {
|
|
||||||
callback({
|
|
||||||
install: function () {
|
|
||||||
services.get("extensionManager").installItemFromFile(file, "app-profile");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getAddonById: function (id, callback) {
|
getAddonById: function (id, callback) {
|
||||||
let addon = id;
|
let addon = id;
|
||||||
if (!isobject(addon))
|
if (!isobject(addon))
|
||||||
@@ -1438,11 +1467,19 @@ const Dactyl = Module("dactyl", {
|
|||||||
.getItemList(Ci.nsIUpdateItem["TYPE_" + type.toUpperCase()], {})))
|
.getItemList(Ci.nsIUpdateItem["TYPE_" + type.toUpperCase()], {})))
|
||||||
res.append(this.getAddonById(item));
|
res.append(this.getAddonById(item));
|
||||||
return res;
|
return res;
|
||||||
|
},
|
||||||
|
getInstallForFile: function (file, callback, mimetype) {
|
||||||
|
callback({
|
||||||
|
install: function () {
|
||||||
|
services.get("extensionManager").installItemFromFile(file, "app-profile");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getInstallForURL: function (url, callback, mimetype) {
|
||||||
|
dactyl.assert(false, "Install by URL not implimented");
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
function callResult(method) {
|
function callResult(method) {
|
||||||
@@ -1467,7 +1504,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
}, {
|
}, {
|
||||||
argCount: "1",
|
argCount: "1",
|
||||||
completer: function (context) {
|
completer: function (context) {
|
||||||
context.filters.push(function ({ item: f }) f.isDirectory() || /\.xpi$/.test(f.leafName));
|
context.filters.push(function ({ item }) item.isDirectory() || /\.xpi$/.test(item.leafName));
|
||||||
completion.file(context);
|
completion.file(context);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1483,13 +1520,13 @@ const Dactyl = Module("dactyl", {
|
|||||||
name: "exte[nable]",
|
name: "exte[nable]",
|
||||||
description: "Enable an extension",
|
description: "Enable an extension",
|
||||||
action: function (addon) addon.userDisabled = false,
|
action: function (addon) addon.userDisabled = false,
|
||||||
filter: function ({ item: e }) e.userDisabled
|
filter: function ({ item }) item.userDisabled
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "extd[isable]",
|
name: "extd[isable]",
|
||||||
description: "Disable an extension",
|
description: "Disable an extension",
|
||||||
action: function (addon) addon.userDisabled = true,
|
action: function (addon) addon.userDisabled = true,
|
||||||
filter: function ({ item: e }) !e.userDisabled
|
filter: function ({ item }) !item.userDisabled
|
||||||
}
|
}
|
||||||
].forEach(function (command) {
|
].forEach(function (command) {
|
||||||
commands.add([command.name],
|
commands.add([command.name],
|
||||||
@@ -1535,7 +1572,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
bang: true,
|
bang: true,
|
||||||
completer: function (context) {
|
completer: function (context) {
|
||||||
completion.extension(context);
|
completion.extension(context);
|
||||||
context.filters.push(function ({ item: e }) e.isActive && e.optionsURL);
|
context.filters.push(function ({ item }) item.isActive && item.optionsURL);
|
||||||
},
|
},
|
||||||
literal: 0
|
literal: 0
|
||||||
});
|
});
|
||||||
@@ -1543,6 +1580,23 @@ const Dactyl = Module("dactyl", {
|
|||||||
commands.add(["extens[ions]", "exts"],
|
commands.add(["extens[ions]", "exts"],
|
||||||
"List available extensions",
|
"List available extensions",
|
||||||
function (args) {
|
function (args) {
|
||||||
|
function addonExtra(e) {
|
||||||
|
let extra;
|
||||||
|
if (e.pendingOperations & AddonManager.PENDING_UNINSTALL)
|
||||||
|
extra = ["Disabled", "uninstalled"];
|
||||||
|
else if (e.pendingOperations & AddonManager.PENDING_DISABLE)
|
||||||
|
extra = ["Disabled", "disabled"];
|
||||||
|
else if (e.pendingOperations & AddonManager.PENDING_INSTALL)
|
||||||
|
extra = ["Enabled", "installed"];
|
||||||
|
else if (e.pendingOperations & AddonManager.PENDING_ENABLE)
|
||||||
|
extra = ["Enabled", "enabled"];
|
||||||
|
else if (e.pendingOperations & AddonManager.PENDING_UPGRADE)
|
||||||
|
extra = ["Enabled", "upgraded"];
|
||||||
|
if (extra)
|
||||||
|
return <> (<span highlight={extra[0]}>{extra[1]}</span>
|
||||||
|
 on restart)</>;
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
AddonManager.getAddonsByTypes(["extension"], function (extensions) {
|
AddonManager.getAddonsByTypes(["extension"], function (extensions) {
|
||||||
if (args[0])
|
if (args[0])
|
||||||
extensions = extensions.filter(function (extension) extension.name.indexOf(args[0]) >= 0);
|
extensions = extensions.filter(function (extension) extension.name.indexOf(args[0]) >= 0);
|
||||||
@@ -1555,12 +1609,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
e.version,
|
e.version,
|
||||||
(e.isActive ? <span highlight="Enabled">enabled</span>
|
(e.isActive ? <span highlight="Enabled">enabled</span>
|
||||||
: <span highlight="Disabled">disabled</span>) +
|
: <span highlight="Disabled">disabled</span>) +
|
||||||
((e.userDisabled || e.appDisabled) == !e.isActive ? XML() :
|
addonExtra(e),
|
||||||
<> ({e.userDisabled || e.appDisabled
|
|
||||||
? <span highlight="Disabled">disabled</span>
|
|
||||||
: <span highlight="Enabled">enabled</span>}
|
|
||||||
on restart)
|
|
||||||
</>),
|
|
||||||
e.description]
|
e.description]
|
||||||
for ([, e] in Iterator(extensions)))));
|
for ([, e] in Iterator(extensions)))));
|
||||||
else if (filter)
|
else if (filter)
|
||||||
@@ -1658,7 +1707,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["res[tart]"],
|
commands.add(["res[tart]"],
|
||||||
"Force " + config.name + " to restart",
|
"Force " + config.appname + " to restart",
|
||||||
function () { dactyl.restart(); },
|
function () { dactyl.restart(); },
|
||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
|
|
||||||
@@ -1810,7 +1859,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
dactyl.open("about:");
|
dactyl.open("about:");
|
||||||
else
|
else
|
||||||
commandline.commandOutput(<>
|
commandline.commandOutput(<>
|
||||||
{config.name} {dactyl.version} running on:<br/>{navigator.userAgent}
|
{config.appname} {dactyl.version} running on:<br/>{navigator.userAgent}
|
||||||
</>);
|
</>);
|
||||||
}, {
|
}, {
|
||||||
argCount: "0",
|
argCount: "0",
|
||||||
@@ -1836,12 +1885,14 @@ const Dactyl = Module("dactyl", {
|
|||||||
context.title = ["Extension"];
|
context.title = ["Extension"];
|
||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.keys = { text: "name", description: "description", icon: "iconURL" },
|
context.keys = { text: "name", description: "description", icon: "iconURL" },
|
||||||
|
context.generate = function () {
|
||||||
context.incomplete = true;
|
context.incomplete = true;
|
||||||
AddonManager.getAddonsByTypes(["extension"], function (addons) {
|
AddonManager.getAddonsByTypes(["extension"], function (addons) {
|
||||||
context.incomplete = false;
|
context.incomplete = false;
|
||||||
context.completions = addons;
|
context.completions = addons;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
completion.help = function help(context, unchunked) {
|
completion.help = function help(context, unchunked) {
|
||||||
dactyl.initHelp();
|
dactyl.initHelp();
|
||||||
@@ -1877,7 +1928,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
dactyl.log("All modules loaded", 3);
|
dactyl.log("All modules loaded", 3);
|
||||||
|
|
||||||
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=" + config.name.toLowerCase());
|
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=" + config.name);
|
||||||
|
|
||||||
let commandline = services.get("commandLineHandler").optionValue;
|
let commandline = services.get("commandLineHandler").optionValue;
|
||||||
if (commandline) {
|
if (commandline) {
|
||||||
@@ -1892,7 +1943,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);
|
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);
|
||||||
|
|
||||||
// first time intro message
|
// first time intro message
|
||||||
const firstTime = "extensions." + config.name.toLowerCase() + ".firsttime";
|
const firstTime = "extensions." + config.name + ".firsttime";
|
||||||
if (options.getPref(firstTime, true)) {
|
if (options.getPref(firstTime, true)) {
|
||||||
util.timeout(function () {
|
util.timeout(function () {
|
||||||
dactyl.help();
|
dactyl.help();
|
||||||
@@ -1904,7 +1955,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
modes.reset();
|
modes.reset();
|
||||||
|
|
||||||
// TODO: we should have some class where all this guioptions stuff fits well
|
// TODO: we should have some class where all this guioptions stuff fits well
|
||||||
Dactyl.hideGUI();
|
// Dactyl.hideGUI();
|
||||||
|
|
||||||
if (dactyl.commandLineOptions.preCommands)
|
if (dactyl.commandLineOptions.preCommands)
|
||||||
dactyl.commandLineOptions.preCommands.forEach(function (cmd) {
|
dactyl.commandLineOptions.preCommands.forEach(function (cmd) {
|
||||||
@@ -1914,7 +1965,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
// finally, read the RC file and source plugins
|
// finally, read the RC file and source plugins
|
||||||
// make sourcing asynchronous, otherwise commands that open new tabs won't work
|
// make sourcing asynchronous, otherwise commands that open new tabs won't work
|
||||||
util.timeout(function () {
|
util.timeout(function () {
|
||||||
let extensionName = config.name.toUpperCase();
|
let extensionName = config.idname;
|
||||||
let init = services.get("environment").get(extensionName + "_INIT");
|
let init = services.get("environment").get(extensionName + "_INIT");
|
||||||
let rcFile = io.getRCFile("~");
|
let rcFile = io.getRCFile("~");
|
||||||
|
|
||||||
@@ -1951,13 +2002,18 @@ const Dactyl = Module("dactyl", {
|
|||||||
// after sourcing the initialization files, this function will set
|
// after sourcing the initialization files, this function will set
|
||||||
// all gui options to their default values, if they have not been
|
// all gui options to their default values, if they have not been
|
||||||
// set before by any RC file
|
// set before by any RC file
|
||||||
for (let option in options) {
|
for (let option in values(options.needInit))
|
||||||
|
// FIXME:
|
||||||
// 'encoding' option should not be set at this timing.
|
// 'encoding' option should not be set at this timing.
|
||||||
// Probably a wrong value is set into the option,
|
// Probably a wrong value is set into the option,
|
||||||
// if current page's encoging is not UTF-8.
|
// if current page's encoging is not UTF-8.
|
||||||
if (option.name != "encoding" && option.setter)
|
try {
|
||||||
|
if (option.name != "encoding");
|
||||||
option.value = option.value;
|
option.value = option.value;
|
||||||
}
|
}
|
||||||
|
catch (e) {
|
||||||
|
dactyl.reportError(e);
|
||||||
|
}
|
||||||
|
|
||||||
if (dactyl.commandLineOptions.postCommands)
|
if (dactyl.commandLineOptions.postCommands)
|
||||||
dactyl.commandLineOptions.postCommands.forEach(function (cmd) {
|
dactyl.commandLineOptions.postCommands.forEach(function (cmd) {
|
||||||
@@ -1969,7 +2025,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
statusline.update();
|
statusline.update();
|
||||||
dactyl.log(config.name + " fully initialized", 0);
|
dactyl.log(config.appname + " fully initialized", 0);
|
||||||
dactyl.initialized = true;
|
dactyl.initialized = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,11 +23,6 @@
|
|||||||
<script type="application/x-javascript;version=1.8" src="&dactyl.content;dactyl-overlay.js"/>
|
<script type="application/x-javascript;version=1.8" src="&dactyl.content;dactyl-overlay.js"/>
|
||||||
|
|
||||||
<window id="&dactyl.mainWindow;">
|
<window id="&dactyl.mainWindow;">
|
||||||
<stringbundleset id="dactyl-stringbundles">
|
|
||||||
<stringbundle id="dactyl-charset-bundle"
|
|
||||||
src="chrome://global/locale/charsetTitles.properties"/>
|
|
||||||
</stringbundleset>
|
|
||||||
|
|
||||||
<keyset id="mainKeyset">
|
<keyset id="mainKeyset">
|
||||||
<key id="key_open_vimbar" key=":" oncommand="window.dactyl ∧ dactyl.modules.commandline.open(':', '', dactyl.modules.modes.EX);" modifiers=""/>
|
<key id="key_open_vimbar" key=":" oncommand="window.dactyl ∧ dactyl.modules.commandline.open(':', '', dactyl.modules.modes.EX);" modifiers=""/>
|
||||||
<key id="key_stop" keycode="VK_ESCAPE" oncommand="window.dactyl ∧ dactyl.modules.events.onEscape();"/>
|
<key id="key_stop" keycode="VK_ESCAPE" oncommand="window.dactyl ∧ dactyl.modules.events.onEscape();"/>
|
||||||
@@ -43,13 +38,13 @@
|
|||||||
<commandset id="onPentadactylFocus"
|
<commandset id="onPentadactylFocus"
|
||||||
commandupdater="true"
|
commandupdater="true"
|
||||||
events="focus"
|
events="focus"
|
||||||
oncommandupdate="if (window.dactyl ∧ dactyl.modules.events != undefined) dactyl.modules.events.onFocusChange(event);"/>
|
oncommandupdate="if (window.dactyl ∧ dactyl.modules.loaded.events) dactyl.modules.events.onFocusChange(event);"/>
|
||||||
<commandset id="onPentadactylSelect"
|
<commandset id="onPentadactylSelect"
|
||||||
commandupdater="true"
|
commandupdater="true"
|
||||||
events="select"
|
events="select"
|
||||||
oncommandupdate="if (window.dactyl ∧ dactyl.modules.events != undefined) dactyl.modules.events.onSelectionChange(event);"/>
|
oncommandupdate="if (window.dactyl ∧ dactyl.modules.loaded.events) dactyl.modules.events.onSelectionChange(event);"/>
|
||||||
|
|
||||||
<!-- As of Firefox 3.1pre, <iframe>.height changes do not seem to have immediate effect,
|
<!-- As of Firefox 3.1pre, iframe.height changes do not seem to have immediate effect,
|
||||||
therefore we need to put them into a <vbox> for which that works just fine -->
|
therefore we need to put them into a <vbox> for which that works just fine -->
|
||||||
<vbox class="dactyl-container" hidden="false" collapsed="true">
|
<vbox class="dactyl-container" hidden="false" collapsed="true">
|
||||||
<iframe id="dactyl-multiline-output" src="chrome://dactyl/content/buffer.xhtml"
|
<iframe id="dactyl-multiline-output" src="chrome://dactyl/content/buffer.xhtml"
|
||||||
@@ -81,7 +76,6 @@
|
|||||||
oninput="window.dactyl ∧ dactyl.modules.commandline.onMultilineInputEvent(event);"
|
oninput="window.dactyl ∧ dactyl.modules.commandline.onMultilineInputEvent(event);"
|
||||||
onblur="window.dactyl ∧ dactyl.modules.commandline.onMultilineInputEvent(event);"/>
|
onblur="window.dactyl ∧ dactyl.modules.commandline.onMultilineInputEvent(event);"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
</window>
|
</window>
|
||||||
|
|
||||||
<statusbar id="status-bar" dactyl:highlight="StatusLine">
|
<statusbar id="status-bar" dactyl:highlight="StatusLine">
|
||||||
@@ -98,7 +92,6 @@
|
|||||||
<statusbarpanel id="statusbar-display" hidden="true"/>
|
<statusbarpanel id="statusbar-display" hidden="true"/>
|
||||||
<statusbarpanel id="statusbar-progresspanel" hidden="true"/>
|
<statusbarpanel id="statusbar-progresspanel" hidden="true"/>
|
||||||
</statusbar>
|
</statusbar>
|
||||||
|
|
||||||
</overlay>
|
</overlay>
|
||||||
|
|
||||||
<!-- vim: set fdm=marker sw=4 ts=4 et: -->
|
<!-- vim: set fdm=marker sw=4 ts=4 et: -->
|
||||||
|
|||||||
@@ -569,7 +569,7 @@ const Editor = Module("editor", {
|
|||||||
let list = this.getAbbreviations(filter, lhs);
|
let list = this.getAbbreviations(filter, lhs);
|
||||||
|
|
||||||
if (!list.length)
|
if (!list.length)
|
||||||
dactyl.echomsg("No this._abbreviations found");
|
dactyl.echomsg("No abbreviations found");
|
||||||
else if (list.length == 1) {
|
else if (list.length == 1) {
|
||||||
let [mode, lhs, rhs] = list[0];
|
let [mode, lhs, rhs] = list[0];
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ catch (e) { __dactyl_eval_error = e; }
|
|||||||
// IMPORTANT: The eval statement *must* remain on the first line
|
// IMPORTANT: The eval statement *must* remain on the first line
|
||||||
// in order for line numbering in any errors to remain correct.
|
// in order for line numbering in any errors to remain correct.
|
||||||
|
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -1173,7 +1173,7 @@ const Events = Module("events", {
|
|||||||
function () { document.commandDispatcher.rewindFocus(); });
|
function () { document.commandDispatcher.rewindFocus(); });
|
||||||
|
|
||||||
mappings.add(modes.all,
|
mappings.add(modes.all,
|
||||||
["<C-z>"], "Temporarily ignore all " + config.name + " key bindings",
|
["<C-z>"], "Temporarily ignore all " + config.appname + " key bindings",
|
||||||
function () { modes.passAllKeys = true; });
|
function () { modes.passAllKeys = true; });
|
||||||
|
|
||||||
mappings.add(modes.all,
|
mappings.add(modes.all,
|
||||||
|
|||||||
@@ -27,20 +27,25 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
|
|
||||||
let highlighted = this.rangeFind && this.rangeFind.highlighted;
|
let highlighted = this.rangeFind && this.rangeFind.highlighted;
|
||||||
let selections = this.rangeFind && this.rangeFind.selections;
|
let selections = this.rangeFind && this.rangeFind.selections;
|
||||||
|
let regex = false;
|
||||||
let matchCase = !(options["ignorecase"] || options["smartcase"] && !/[A-Z]/.test(str));
|
let matchCase = !(options["ignorecase"] || options["smartcase"] && !/[A-Z]/.test(str));
|
||||||
let linksOnly = options["linksearch"];
|
let linksOnly = options["linksearch"];
|
||||||
|
|
||||||
str = str.replace(/\\(.|$)/g, function (m, n1) {
|
str = str.replace(/\\(.|$)/g, function (m, n1) {
|
||||||
if (n1 == "l")
|
if (n1 == "c")
|
||||||
linksOnly = true;
|
|
||||||
else if (n1 == "L")
|
|
||||||
linksOnly = false;
|
|
||||||
else if (n1 == "c")
|
|
||||||
matchCase = false;
|
matchCase = false;
|
||||||
else if (n1 == "C")
|
else if (n1 == "C")
|
||||||
matchCase = true;
|
matchCase = true;
|
||||||
|
else if (n1 == "l")
|
||||||
|
linksOnly = true;
|
||||||
|
else if (n1 == "L")
|
||||||
|
linksOnly = false;
|
||||||
|
else if (n1 == "r")
|
||||||
|
regex = true;
|
||||||
|
else if (n1 == "R")
|
||||||
|
regex = false;
|
||||||
else
|
else
|
||||||
return n1;
|
return m;
|
||||||
return "";
|
return "";
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -49,12 +54,13 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
if (!this.rangeFind
|
if (!this.rangeFind
|
||||||
|| this.rangeFind.window.get() != window
|
|| this.rangeFind.window.get() != window
|
||||||
|| linksOnly != !!this.rangeFind.elementPath
|
|| linksOnly != !!this.rangeFind.elementPath
|
||||||
|
|| regex != this.rangeFind.regex
|
||||||
|| matchCase != this.rangeFind.matchCase
|
|| matchCase != this.rangeFind.matchCase
|
||||||
|| !!backward != this.rangeFind.reverse) {
|
|| !!backward != this.rangeFind.reverse) {
|
||||||
|
|
||||||
if (this.rangeFind)
|
if (this.rangeFind)
|
||||||
this.rangeFind.cancel();
|
this.rangeFind.cancel();
|
||||||
this.rangeFind = RangeFind(matchCase, backward, linksOnly && options["hinttags"]);
|
this.rangeFind = RangeFind(matchCase, backward, linksOnly && options["hinttags"], regex);
|
||||||
this.rangeFind.highlighted = highlighted;
|
this.rangeFind.highlighted = highlighted;
|
||||||
this.rangeFind.selections = selections;
|
this.rangeFind.selections = selections;
|
||||||
}
|
}
|
||||||
@@ -201,7 +207,7 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
|
|
||||||
},
|
},
|
||||||
options: function () {
|
options: function () {
|
||||||
options.safeSetPref("accessibility.typeaheadfind.autostart", false);
|
// options.safeSetPref("accessibility.typeaheadfind.autostart", false);
|
||||||
// The above should be sufficient, but: https://bugzilla.mozilla.org/show_bug.cgi?id=348187
|
// The above should be sufficient, but: https://bugzilla.mozilla.org/show_bug.cgi?id=348187
|
||||||
options.safeSetPref("accessibility.typeaheadfind", false);
|
options.safeSetPref("accessibility.typeaheadfind", false);
|
||||||
|
|
||||||
@@ -262,13 +268,14 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
* large amounts of data are concerned (e.g., for API documents).
|
* large amounts of data are concerned (e.g., for API documents).
|
||||||
*/
|
*/
|
||||||
const RangeFind = Class("RangeFind", {
|
const RangeFind = Class("RangeFind", {
|
||||||
init: function (matchCase, backward, elementPath) {
|
init: function (matchCase, backward, elementPath, regex) {
|
||||||
this.window = Cu.getWeakReference(window);
|
this.window = Cu.getWeakReference(window);
|
||||||
this.elementPath = elementPath || null;
|
this.elementPath = elementPath || null;
|
||||||
this.matchCase = Boolean(matchCase);
|
|
||||||
this.reverse = Boolean(backward);
|
this.reverse = Boolean(backward);
|
||||||
|
|
||||||
this.finder = services.create("find");
|
this.finder = services.create("find");
|
||||||
this.finder.caseSensitive = this.matchCase;
|
this.matchCase = Boolean(matchCase);
|
||||||
|
this.regex = Boolean(regex);
|
||||||
|
|
||||||
this.ranges = this.makeFrameList(content);
|
this.ranges = this.makeFrameList(content);
|
||||||
|
|
||||||
@@ -281,6 +288,12 @@ const RangeFind = Class("RangeFind", {
|
|||||||
|
|
||||||
get backward() this.finder.findBackwards,
|
get backward() this.finder.findBackwards,
|
||||||
|
|
||||||
|
get matchCase() this.finder.caseSensitive,
|
||||||
|
set matchCase(val) this.finder.caseSensitive = Boolean(val),
|
||||||
|
|
||||||
|
get regex() this.finder.regularExpression,
|
||||||
|
set regex(val) this.finder.regularExpression = Boolean(val),
|
||||||
|
|
||||||
get searchString() this.lastString,
|
get searchString() this.lastString,
|
||||||
|
|
||||||
get selectedRange() {
|
get selectedRange() {
|
||||||
@@ -437,7 +450,7 @@ const RangeFind = Class("RangeFind", {
|
|||||||
let pageStart = RangeFind.endpoint(pageRange, true);
|
let pageStart = RangeFind.endpoint(pageRange, true);
|
||||||
let pageEnd = RangeFind.endpoint(pageRange, false);
|
let pageEnd = RangeFind.endpoint(pageRange, false);
|
||||||
|
|
||||||
for (let frame in util.Array.itervalues(win.frames)) {
|
for (let frame in array.itervalues(win.frames)) {
|
||||||
let range = doc.createRange();
|
let range = doc.createRange();
|
||||||
if (util.computedStyle(frame.frameElement).visibility == "visible") {
|
if (util.computedStyle(frame.frameElement).visibility == "visible") {
|
||||||
range.selectNode(frame.frameElement);
|
range.selectNode(frame.frameElement);
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
|
||||||
|
|
||||||
<xsl:stylesheet version="1.0"
|
|
||||||
xmlns="http://www.w3.org/1999/xhtml"
|
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
|
||||||
xmlns:dactyl="http://vimperator.org/namespaces/liberator"
|
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
||||||
xmlns:str="http://exslt.org/strings"
|
|
||||||
xmlns:exsl="http://exslt.org/common"
|
|
||||||
extension-element-prefixes="exsl str">
|
|
||||||
|
|
||||||
<xsl:output method="xml" indent="no"/>
|
|
||||||
|
|
||||||
<xsl:variable name="root" select="/dactyl:document"/>
|
|
||||||
<xsl:variable name="tags">
|
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
<xsl:for-each select="$root//@tag|$root//dactyl:tags/text()|$root//dactyl:tag/text()">
|
|
||||||
<xsl:value-of select="concat(., ' ')"/>
|
|
||||||
</xsl:for-each>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:template name="parse-tags">
|
|
||||||
<xsl:param name="text"/>
|
|
||||||
<div dactyl:highlight="HelpTags">
|
|
||||||
<xsl:for-each select="str:tokenize($text)">
|
|
||||||
<a id="{.}" dactyl:highlight="HelpTag"><xsl:value-of select="."/></a>
|
|
||||||
</xsl:for-each>
|
|
||||||
</div>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="/">
|
|
||||||
<xsl:call-template name="parse-tags">
|
|
||||||
<xsl:with-param name="text" select="$tags"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:template>
|
|
||||||
</xsl:stylesheet>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009 by Kris Maglione <kris@vimperator.org>
|
// Copyright (c) 2009-2010 by Kris Maglione <kris@vimperator.org>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -13,9 +13,6 @@ function checkFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("load", checkFragment, true);
|
document.addEventListener("load", checkFragment, true);
|
||||||
window.addEventListener("message", function (event) {
|
document.addEventListener("hashChange", checkFragment, true);
|
||||||
if (event.data == "fragmentChange")
|
|
||||||
checkFragment();
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -6,40 +6,27 @@
|
|||||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:dactyl="http://vimperator.org/namespaces/liberator"
|
xmlns:dactyl="http://vimperator.org/namespaces/liberator"
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns:str="http://exslt.org/strings"
|
|
||||||
xmlns:exsl="http://exslt.org/common"
|
xmlns:exsl="http://exslt.org/common"
|
||||||
extension-element-prefixes="exsl str">
|
xmlns:regexp="http://exslt.org/regular-expressions"
|
||||||
|
xmlns:str="http://exslt.org/strings"
|
||||||
|
extension-element-prefixes="exsl regexp str">
|
||||||
|
|
||||||
<xsl:output method="xml" indent="no"/>
|
<xsl:output method="xml" indent="no"/>
|
||||||
|
|
||||||
<!-- Variable Definitions {{{1 -->
|
<!-- Variable Definitions {{{1 -->
|
||||||
|
|
||||||
<xsl:variable name="doc">
|
|
||||||
<xsl:apply-templates select="/dactyl:document" mode="overlay"/>
|
|
||||||
</xsl:variable>
|
|
||||||
<xsl:variable name="root" select="exsl:node-set($doc)"/>
|
|
||||||
|
|
||||||
<xsl:variable name="tags">
|
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
<xsl:for-each select="$root//@tag|$root//dactyl:tags/text()|$root//dactyl:tag/text()">
|
|
||||||
<xsl:value-of select="concat(., ' ')"/>
|
|
||||||
</xsl:for-each>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<!-- Process Overlays {{{1 -->
|
<!-- Process Overlays {{{1 -->
|
||||||
|
|
||||||
<xsl:variable name="overlay" select="concat('dactyl://help-overlay/', /dactyl:document/@name)"/>
|
|
||||||
<xsl:variable name="overlaydoc" select="document($overlay)/dactyl:overlay"/>
|
|
||||||
|
|
||||||
<xsl:template name="splice-overlays">
|
<xsl:template name="splice-overlays">
|
||||||
<xsl:param name="elem"/>
|
<xsl:param name="elem"/>
|
||||||
<xsl:param name="tag"/>
|
<xsl:param name="tag"/>
|
||||||
<xsl:for-each select="$overlaydoc/*[@insertbefore=$tag]">
|
<xsl:for-each select="ancestor::*/dactyl:overlay/*[@insertbefore=$tag]">
|
||||||
<xsl:apply-templates select="." mode="overlay"/>
|
<xsl:apply-templates select="." mode="overlay"/>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$overlaydoc/*[@replace=$tag] and not($elem[@replace])">
|
<xsl:when test="ancestor::*/dactyl:overlay/*[@replace=$tag] and not($elem[@replace])">
|
||||||
<xsl:for-each select="$overlaydoc/*[@replace=$tag]">
|
<xsl:for-each select="ancestor::*/dactyl:overlay/*[@replace=$tag]">
|
||||||
<xsl:apply-templates select="." mode="overlay-2"/>
|
<xsl:apply-templates select="." mode="overlay-2"/>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
@@ -49,7 +36,7 @@
|
|||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
<xsl:for-each select="$overlaydoc/*[@insertafter=$tag]">
|
<xsl:for-each select="ancestor::*/dactyl:overlay/*[@insertafter=$tag]">
|
||||||
<xsl:apply-templates select="." mode="overlay"/>
|
<xsl:apply-templates select="." mode="overlay"/>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
@@ -75,9 +62,32 @@
|
|||||||
|
|
||||||
<!-- Process Inclusions {{{1 -->
|
<!-- Process Inclusions {{{1 -->
|
||||||
|
|
||||||
|
<xsl:template name="include">
|
||||||
|
<xsl:param name="root-node" select="."/>
|
||||||
|
<xsl:param name="overlay" select="concat('dactyl://help-overlay/', $root-node/@name)"/>
|
||||||
|
|
||||||
|
<!-- Ridiculous three-pass processing is needed to deal with
|
||||||
|
- lack of dynamic variable scope in XSL 1.0. -->
|
||||||
|
|
||||||
|
<!-- Store a copy of the overlay for the current document. -->
|
||||||
|
<xsl:variable name="doc">
|
||||||
|
<dactyl:document>
|
||||||
|
<xsl:copy-of select="document($overlay)/dactyl:overlay"/>
|
||||||
|
<xsl:copy-of select="$root-node/node()"/>
|
||||||
|
</dactyl:document>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<xsl:call-template name="parse-tags">
|
||||||
|
<xsl:with-param name="text" select="concat($root-node/@name, '.xml')"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:apply-templates select="exsl:node-set($doc)/dactyl:document/node()[position() != 1]" mode="overlay"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:include" mode="overlay-2">
|
<xsl:template match="dactyl:include" mode="overlay-2">
|
||||||
<div dactyl:highlight="HelpInclude">
|
<div dactyl:highlight="HelpInclude">
|
||||||
<xsl:apply-templates select="document(@href)/dactyl:document/node()" mode="overlay"/>
|
<xsl:call-template name="include">
|
||||||
|
<xsl:with-param name="root-node" select="document(@href)/dactyl:document"/>
|
||||||
|
</xsl:call-template>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
@@ -93,22 +103,39 @@
|
|||||||
<!-- Root {{{1 -->
|
<!-- Root {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<xsl:for-each select="$root/dactyl:document">
|
|
||||||
|
<!-- Ridiculous three-pass processing is needed to deal with
|
||||||
|
- lack of dynamic variable scope in XSL 1.0. -->
|
||||||
|
|
||||||
|
<xsl:variable name="doc1">
|
||||||
|
<xsl:call-template name="include">
|
||||||
|
<xsl:with-param name="root-node" select="dactyl:document"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:variable name="root" select="exsl:node-set($doc1)"/>
|
||||||
|
|
||||||
|
<!-- Store a cache of all tags defined -->
|
||||||
|
<xsl:variable name="doc2">
|
||||||
|
<dactyl:document>
|
||||||
|
<xsl:attribute name="document-tags">
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
<xsl:for-each select="$root//@tag|$root//dactyl:tags/text()|$root//dactyl:tag/text()">
|
||||||
|
<xsl:value-of select="concat(., ' ')"/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:copy-of select="$root/node()"/>
|
||||||
|
</dactyl:document>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
<html dactyl:highlight="Help">
|
<html dactyl:highlight="Help">
|
||||||
<head>
|
<head>
|
||||||
<title><xsl:value-of select="@title"/></title>
|
<title><xsl:value-of select="@title"/></title>
|
||||||
<script type="text/javascript"
|
<script type="text/javascript" src="chrome://dactyl/content/help.js"/>
|
||||||
src="chrome://dactyl/content/help.js"/>
|
|
||||||
</head>
|
</head>
|
||||||
<body dactyl:highlight="HelpBody">
|
<body dactyl:highlight="HelpBody">
|
||||||
<div dactyl:highlight="Logo"/>
|
<xsl:apply-templates select="exsl:node-set($doc2)/dactyl:document/node()" mode="help-1"/>
|
||||||
<xsl:call-template name="parse-tags">
|
|
||||||
<xsl:with-param name="text" select="concat(@name, '.html')"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:apply-templates/>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</xsl:for-each>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Table of Contents {{{1 -->
|
<!-- Table of Contents {{{1 -->
|
||||||
@@ -125,14 +152,14 @@
|
|||||||
local-name() = $tag and not(preceding::*[local-name() = $lasttag][position() = 1 and not(.=$context)])]"/>
|
local-name() = $tag and not(preceding::*[local-name() = $lasttag][position() = 1 and not(.=$context)])]"/>
|
||||||
|
|
||||||
<xsl:if test="$nodes">
|
<xsl:if test="$nodes">
|
||||||
<ol dactyl:highlight="HelpOrderedList">
|
<ol level="{$level}" dactyl:highlight="HelpOrderedList">
|
||||||
<xsl:for-each select="$nodes">
|
<xsl:for-each select="$nodes">
|
||||||
<li>
|
<li>
|
||||||
<a>
|
<a>
|
||||||
<xsl:if test="@tag">
|
<xsl:if test="@tag">
|
||||||
<xsl:attribute name="href"><xsl:value-of select="concat('#', substring-before(concat(@tag, ' '), ' '))"/></xsl:attribute>
|
<xsl:attribute name="href"><xsl:value-of select="concat('#', substring-before(concat(@tag, ' '), ' '))"/></xsl:attribute>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:apply-templates select="node()"/>
|
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||||
</a>
|
</a>
|
||||||
<xsl:call-template name="toc">
|
<xsl:call-template name="toc">
|
||||||
<xsl:with-param name="level" select="$level + 1"/>
|
<xsl:with-param name="level" select="$level + 1"/>
|
||||||
@@ -144,7 +171,7 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:toc" mode="pass-2">
|
<xsl:template match="dactyl:toc" mode="help-2">
|
||||||
<xsl:variable name="TOC">
|
<xsl:variable name="TOC">
|
||||||
<context/>
|
<context/>
|
||||||
<xsl:for-each
|
<xsl:for-each
|
||||||
@@ -174,36 +201,38 @@
|
|||||||
|
|
||||||
<!-- Items {{{1 -->
|
<!-- Items {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="dactyl:strut" mode="pass-2">
|
<xsl:template match="dactyl:strut" mode="help-2">
|
||||||
<div style="clear: both"/>
|
<div style="clear: both"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:item" mode="pass-2">
|
<xsl:template match="dactyl:item" mode="help-2">
|
||||||
<div dactyl:highlight="HelpItem">
|
<div dactyl:highlight="HelpItem">
|
||||||
<xsl:apply-templates select="dactyl:tags|dactyl:spec|dactyl:strut"/>
|
<xsl:apply-templates select="dactyl:tags|dactyl:spec|dactyl:strut" mode="help-1"/>
|
||||||
<xsl:if test="not(dactyl:description/@short)">
|
<xsl:if test="not(dactyl:description/@short)">
|
||||||
<hr style="border: 0; height: 0; margin: 0; width: 100%; float: right;"/>
|
<hr style="border: 0; height: 0; margin: 0; width: 100%; float: right;"/>
|
||||||
|
<xsl:if test="dactyl:type|dactyl:default">
|
||||||
<div dactyl:highlight="HelpOptInfo">
|
<div dactyl:highlight="HelpOptInfo">
|
||||||
<xsl:apply-templates select="dactyl:type|dactyl:default"/>
|
<xsl:apply-templates select="dactyl:type|dactyl:default" mode="help-1"/>
|
||||||
<div style="clear: both;"/>
|
<div style="clear: both;"/>
|
||||||
</div>
|
</div>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:apply-templates select="dactyl:description"/>
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="dactyl:description" mode="help-1"/>
|
||||||
<div style="clear: both;"/>
|
<div style="clear: both;"/>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:spec[preceding-sibling::dactyl:spec]" mode="pass-2">
|
<!--
|
||||||
|
<xsl:template match="dactyl:item/dactyl:spec[position() = last()]" mode="help-2">
|
||||||
<div style="clear: both;"/>
|
<div style="clear: both;"/>
|
||||||
<div dactyl:highlight="HelpSpec">
|
<div dactyl:highlight="HelpSpec"><xsl:apply-templates mode="help-1"/></div>
|
||||||
<xsl:apply-templates/>
|
|
||||||
</div>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
-->
|
||||||
|
|
||||||
<xsl:template match="dactyl:default[not(@type='plain')]" mode="pass-2">
|
<xsl:template match="dactyl:default[not(@type='plain')]" mode="help-2">
|
||||||
<xsl:variable name="type" select="preceding-sibling::dactyl:type[1] | following-sibling::dactyl:type[1]"/>
|
<xsl:variable name="type" select="preceding-sibling::dactyl:type[1] | following-sibling::dactyl:type[1]"/>
|
||||||
<span dactyl:highlight="HelpDefault">(default:<xsl:text> </xsl:text>
|
<span dactyl:highlight="HelpDefault">(default:<xsl:text> </xsl:text>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="starts-with($type, 'string') or starts-with($type, 'regex')">
|
<xsl:when test="starts-with($type, 'string') or starts-with($type, 'regex')">
|
||||||
<span dactyl:highlight="HelpString"><xsl:apply-templates/></span>
|
<span dactyl:highlight="HelpString"><xsl:apply-templates mode="help-1"/></span>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<span>
|
<span>
|
||||||
@@ -214,22 +243,32 @@
|
|||||||
<xsl:when test="$type = 'charlist'">String</xsl:when>
|
<xsl:when test="$type = 'charlist'">String</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:apply-templates/>
|
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||||
</span>
|
</span>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>)
|
</xsl:choose>)</span>
|
||||||
</span>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Tag Definitions {{{1 -->
|
<!-- Tag Definitions {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="dactyl:tags" mode="pass-2">
|
<xsl:template match="dactyl:item/dactyl:tags[position() = last()]" mode="help-2">
|
||||||
<div style="clear: right"/>
|
<div style="clear: right"/>
|
||||||
<xsl:call-template name="parse-tags">
|
<xsl:call-template name="parse-tags">
|
||||||
<xsl:with-param name="text" select="."/>
|
<xsl:with-param name="text" select="."/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:tag|@tag" mode="pass-2">
|
<xsl:template match="dactyl:tags" mode="help-2">
|
||||||
|
<xsl:call-template name="parse-tags">
|
||||||
|
<xsl:with-param name="text" select="."/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="@tag[parent::dactyl:p]" mode="help-2">
|
||||||
|
<xsl:call-template name="parse-tags">
|
||||||
|
<xsl:with-param name="text" select="."/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<div style="clear: right"/>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="dactyl:tag|@tag" mode="help-2">
|
||||||
<xsl:call-template name="parse-tags">
|
<xsl:call-template name="parse-tags">
|
||||||
<xsl:with-param name="text" select="."/>
|
<xsl:with-param name="text" select="."/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@@ -249,31 +288,40 @@
|
|||||||
<xsl:param name="contents" select="text()"/>
|
<xsl:param name="contents" select="text()"/>
|
||||||
<xsl:variable name="tag" select="str:tokenize($contents, ' [!')[1]"/>
|
<xsl:variable name="tag" select="str:tokenize($contents, ' [!')[1]"/>
|
||||||
<a href="dactyl://help-tag/{$tag}" style="color: inherit;">
|
<a href="dactyl://help-tag/{$tag}" style="color: inherit;">
|
||||||
<xsl:if test="contains($tags, concat(' ', $tag, ' '))">
|
<xsl:if test="contains(ancestor::*/@document-tags, concat(' ', $tag, ' '))">
|
||||||
<xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute>
|
<xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:value-of select="$contents"/>
|
<xsl:value-of select="$contents"/>
|
||||||
</a>
|
</a>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:o" mode="pass-2">
|
<xsl:template match="dactyl:o" mode="help-2">
|
||||||
<span dactyl:highlight="HelpOption">
|
<span dactyl:highlight="HelpOpt">
|
||||||
<xsl:call-template name="linkify-tag">
|
<xsl:call-template name="linkify-tag">
|
||||||
<xsl:with-param name="contents" select='concat("'", text(), "'")'/>
|
<xsl:with-param name="contents" select='concat("'", text(), "'")'/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</span>
|
</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:t" mode="pass-2">
|
<xsl:template match="dactyl:pref" mode="help-2">
|
||||||
|
<a href="http://kb.mozillazine.org/{text()}" dactyl:highlight="HelpOpt"
|
||||||
|
>'<xsl:apply-templates select="@*|node()" mode="help-1"/>'</a>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="dactyl:t" mode="help-2">
|
||||||
<span dactyl:highlight="HelpTopic">
|
<span dactyl:highlight="HelpTopic">
|
||||||
<xsl:call-template name="linkify-tag"/>
|
<xsl:call-template name="linkify-tag"/>
|
||||||
</span>
|
</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:k" mode="pass-2">
|
<xsl:template match="dactyl:k" mode="help-2">
|
||||||
<span dactyl:highlight="HelpKey">
|
<span dactyl:highlight="HelpKey">
|
||||||
<xsl:call-template name="linkify-tag"/>
|
<xsl:call-template name="linkify-tag"/>
|
||||||
</span>
|
</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:k[@name]" mode="pass-2">
|
<xsl:template match="dactyl:kwd" mode="help-2">
|
||||||
|
<span dactyl:highlight="HelpKeyword">
|
||||||
|
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="dactyl:k[@name]" mode="help-2">
|
||||||
<span dactyl:highlight="HelpKey">
|
<span dactyl:highlight="HelpKey">
|
||||||
<xsl:call-template name="linkify-tag">
|
<xsl:call-template name="linkify-tag">
|
||||||
<xsl:with-param name="contents" select="concat('<', @name, '>', .)"/>
|
<xsl:with-param name="contents" select="concat('<', @name, '>', .)"/>
|
||||||
@@ -283,100 +331,117 @@
|
|||||||
|
|
||||||
<!-- HTML-ish elements {{{1 -->
|
<!-- HTML-ish elements {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="dactyl:dl" mode="pass-2">
|
<xsl:template match="dactyl:dl" mode="help-2">
|
||||||
<dl>
|
<dl>
|
||||||
<column/>
|
<column/>
|
||||||
<column/>
|
<column/>
|
||||||
<xsl:for-each select="dactyl:dt">
|
<xsl:for-each select="dactyl:dt">
|
||||||
<tr>
|
<tr>
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:apply-templates select="." mode="help-1"/>
|
||||||
<xsl:apply-templates select="following-sibling::dactyl:dd[1]"/>
|
<xsl:apply-templates select="following-sibling::dactyl:dd[1]" mode="help-1"/>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</dl>
|
</dl>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:link" mode="pass-2">
|
<xsl:template match="dactyl:link" mode="help-2">
|
||||||
<a href="{@topic}"><xsl:apply-templates select="@*|node()"/></a>
|
<a href="{@topic}">
|
||||||
|
<xsl:if test="regexp:match(@topic, '^[a-zA-Z]*:', '')
|
||||||
|
and not(starts-with(@topic, 'mailto:'))">
|
||||||
|
<xsl:attribute name="rel">external</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||||
|
</a>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="dactyl:hl" mode="help-2">
|
||||||
|
<span dactyl:highlight="{@key}"><xsl:apply-templates select="@*|node()" mode="help-1"/></span>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="dactyl:h" mode="help-2">
|
||||||
|
<em><xsl:apply-templates select="@*|node()" mode="help-1"/></em>
|
||||||
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:em | dactyl:tt | dactyl:p |
|
<xsl:template match="dactyl:em | dactyl:tt | dactyl:p |
|
||||||
dactyl:dt | dactyl:dd |
|
dactyl:dt | dactyl:dd |
|
||||||
dactyl:ol | dactyl:ul | dactyl:li |
|
dactyl:ol | dactyl:ul | dactyl:li |
|
||||||
dactyl:h1 | dactyl:h2 | dactyl:h3"
|
dactyl:h1 | dactyl:h2 | dactyl:h3"
|
||||||
mode="pass-2">
|
mode="help-2">
|
||||||
<xsl:element name="html:{local-name()}">
|
<xsl:element name="{local-name()}">
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:code" mode="pass-2">
|
<xsl:template match="dactyl:code" mode="help-2">
|
||||||
<pre dactyl:highlight="HelpCode"><xsl:apply-templates select="@*|node()"/></pre>
|
<pre dactyl:highlight="HelpCode"><xsl:apply-templates select="@*|node()" mode="help-1"/></pre>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Help elements {{{1 -->
|
<!-- Help elements {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="dactyl:a" mode="pass-2">
|
<xsl:template match="dactyl:a" mode="help-2">
|
||||||
<span dactyl:highlight="HelpArg">{<xsl:apply-templates select="@*|node()"/>}</span>
|
<span dactyl:highlight="HelpArg">{<xsl:apply-templates select="@*|node()" mode="help-1"/>}</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:oa" mode="pass-2">
|
<xsl:template match="dactyl:oa" mode="help-2">
|
||||||
<span dactyl:highlight="HelpOptionalArg">[<xsl:apply-templates select="@*|node()"/>]</span>
|
<span dactyl:highlight="HelpOptionalArg">[<xsl:apply-templates select="@*|node()" mode="help-1"/>]</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:note" mode="pass-2">
|
<xsl:template match="dactyl:note" mode="help-2">
|
||||||
<p style="clear: both;">
|
<p style="clear: both;">
|
||||||
<xsl:apply-templates select="@*"/>
|
<xsl:apply-templates select="@*" mode="help-1"/>
|
||||||
<div style="clear: both;"/>
|
<div style="clear: both;"/>
|
||||||
<span dactyl:highlight="HelpNote">Note:</span>
|
<span dactyl:highlight="HelpNote">Note:</span>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="node()"/>
|
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||||
</p>
|
</p>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:warning" mode="pass-2">
|
<xsl:template match="dactyl:warning" mode="help-2">
|
||||||
<p style="clear: both;">
|
<p style="clear: both;">
|
||||||
<xsl:apply-templates select="@*"/>
|
<xsl:apply-templates select="@*" mode="help-1"/>
|
||||||
<div style="clear: both;"/>
|
<div style="clear: both;"/>
|
||||||
<span dactyl:highlight="HelpWarning">Warning:</span>
|
<span dactyl:highlight="HelpWarning">Warning:</span>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="node()"/>
|
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||||
</p>
|
</p>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:default" mode="pass-2">
|
<xsl:template match="dactyl:default" mode="help-2">
|
||||||
<span dactyl:highlight="HelpDefault">
|
<span dactyl:highlight="HelpDefault">(default:<xsl:text> </xsl:text><xsl:apply-templates select="@*|node()" mode="help-1"/>)</span>
|
||||||
(default:<xsl:text> </xsl:text><xsl:apply-templates select="@*|node()"/>)
|
|
||||||
</span>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- HTML-ify other elements {{{1 -->
|
<!-- HTML-ify other elements {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="dactyl:ex" mode="pass-2">
|
<xsl:template match="dactyl:ex" mode="help-2">
|
||||||
<span dactyl:highlight="HelpEx">
|
<span dactyl:highlight="HelpEx">
|
||||||
<xsl:variable name="tag" select="str:tokenize(text(), ' [!')[1]"/>
|
<xsl:variable name="tag" select="str:tokenize(text(), ' [!')[1]"/>
|
||||||
<a href="dactyl://help-tag/{$tag}" style="color: inherit;">
|
<a href="dactyl://help-tag/{$tag}" style="color: inherit;">
|
||||||
<xsl:if test="contains($tags, concat(' ', $tag, ' '))">
|
<xsl:if test="contains(ancestor::*/@document-tags, concat(' ', $tag, ' '))">
|
||||||
<xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute>
|
<xsl:attribute name="href">#<xsl:value-of select="$tag"/></xsl:attribute>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:apply-templates/>
|
<xsl:apply-templates mode="help-1"/>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:description | dactyl:example | dactyl:spec" mode="pass-2">
|
<xsl:template match="dactyl:description | dactyl:example | dactyl:spec" mode="help-2">
|
||||||
<div>
|
<div>
|
||||||
<xsl:if test="self::dactyl:description"><xsl:attribute name="dactyl:highlight">HelpDescription</xsl:attribute></xsl:if>
|
<xsl:if test="self::dactyl:description"><xsl:attribute name="dactyl:highlight">HelpDescription</xsl:attribute></xsl:if>
|
||||||
<xsl:if test="self::dactyl:example"><xsl:attribute name="dactyl:highlight">HelpExample</xsl:attribute></xsl:if>
|
<xsl:if test="self::dactyl:example"><xsl:attribute name="dactyl:highlight">HelpExample</xsl:attribute></xsl:if>
|
||||||
<xsl:if test="self::dactyl:spec"><xsl:attribute name="dactyl:highlight">HelpSpec</xsl:attribute></xsl:if>
|
<xsl:if test="self::dactyl:spec"><xsl:attribute name="dactyl:highlight">HelpSpec</xsl:attribute></xsl:if>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:str | dactyl:t | dactyl:type" mode="pass-2">
|
<xsl:template match="dactyl:str | dactyl:type" mode="help-2">
|
||||||
<span>
|
<span>
|
||||||
<xsl:if test="self::dactyl:str"><xsl:attribute name="dactyl:highlight">HelpString</xsl:attribute></xsl:if>
|
<xsl:if test="self::dactyl:str"><xsl:attribute name="dactyl:highlight">HelpString</xsl:attribute></xsl:if>
|
||||||
<xsl:if test="self::dactyl:t"><xsl:attribute name="dactyl:highlight">HelpTopic</xsl:attribute></xsl:if>
|
|
||||||
<xsl:if test="self::dactyl:type"><xsl:attribute name="dactyl:highlight">HelpType</xsl:attribute></xsl:if>
|
<xsl:if test="self::dactyl:type"><xsl:attribute name="dactyl:highlight">HelpType</xsl:attribute></xsl:if>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||||
</span>
|
</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
<xsl:template match="dactyl:xml-block" mode="help-2">
|
||||||
|
<div dactyl:highlight="HelpXMLBlock">
|
||||||
|
<xsl:call-template name="xml-highlight"/>
|
||||||
|
</div>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="dactyl:xml-highlight" mode="help-2">
|
||||||
|
<xsl:call-template name="xml-highlight"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Plugins {{{1 -->
|
<!-- Plugins {{{1 -->
|
||||||
|
|
||||||
@@ -400,59 +465,133 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:author[@email]" mode="pass-2">
|
<xsl:template match="dactyl:author[@email]" mode="help-2">
|
||||||
<xsl:call-template name="info">
|
<xsl:call-template name="info">
|
||||||
<xsl:with-param name="label" select="'Author'"/>
|
<xsl:with-param name="label" select="'Author'"/>
|
||||||
<xsl:with-param name="extra">
|
<xsl:with-param name="extra">
|
||||||
<xsl:text> </xsl:text><a href="mailto:{@email}">✉</a>
|
<xsl:text> </xsl:text><a href="mailto:{@email}"></a>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:author" mode="pass-2">
|
<xsl:template match="dactyl:author" mode="help-2">
|
||||||
<xsl:call-template name="info">
|
<xsl:call-template name="info">
|
||||||
<xsl:with-param name="label" select="'Author'"/>
|
<xsl:with-param name="label" select="'Author'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:license" mode="pass-2">
|
<xsl:template match="dactyl:license" mode="help-2">
|
||||||
<xsl:call-template name="info">
|
<xsl:call-template name="info">
|
||||||
<xsl:with-param name="label" select="'License'"/>
|
<xsl:with-param name="label" select="'License'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="dactyl:plugin" mode="pass-2">
|
<xsl:template match="dactyl:plugin" mode="help-2">
|
||||||
<xsl:call-template name="info">
|
<xsl:call-template name="info">
|
||||||
<xsl:with-param name="label" select="'Plugin'"/>
|
<xsl:with-param name="label" select="'Plugin'"/>
|
||||||
<xsl:with-param name="nodes">
|
<xsl:with-param name="nodes">
|
||||||
<span><xsl:value-of select="@name"/></span>
|
<span><xsl:value-of select="@name"/></span>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:apply-templates/>
|
<xsl:if test="@version">
|
||||||
|
<xsl:call-template name="info">
|
||||||
|
<xsl:with-param name="label" select="'Version'"/>
|
||||||
|
<xsl:with-param name="link" select="''"/>
|
||||||
|
<xsl:with-param name="nodes">
|
||||||
|
<span><xsl:value-of select="@version"/></span>
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates mode="help-1"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Special Element Templates {{{1 -->
|
<!-- Special Element Templates {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="dactyl:logo">
|
<xsl:template match="dactyl:logo" mode="help-1">
|
||||||
<span dactyl:highlight="Logo"/>
|
<span dactyl:highlight="Logo"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="dactyl:pan[dactyl:handle]">
|
|
||||||
<form style="text-align:center" xmlns="http://www.w3.org/1999/xhtml"
|
|
||||||
action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
|
||||||
<input type="hidden" name="cmd" value="_s-xclick"/>
|
|
||||||
<input type="image" src="chrome://dactyl/content/x-click-but21.png" border="0" name="submit" alt="Donate with PayPal"/>
|
|
||||||
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAUOJADCwiik68MpIUKcMAtNfs4Cx6RY7604ZujgKj7WVaiELWyhUUDSaq8+iLYaNkRUq+dDld96KwhfodqP3MEmIzpQ/qKvh5+4JzTWSBU5G1lHzc4NJQw6TpXKloPxxXhuGKzZ84/asKZIZpLfkP5i8VtqVFecu7qYc0q1U2KoDELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIWR7nX4WwgcqAgZgO41g/NtgfBwI14LlJx3p5Hc4nHsQD2wyu5l4BMndkc3mc0uRTXvzutcfPBxYC4aGV5UDn6c+XPzsne+OAdSs4/0a2DJe85SBDOlVyOekz3rRhy5+6XKpKQ7qfiMpKROladi4opfMac/aDUPhGeVsY0jtQCtelIE199iaVKhlbiDvfE7nzV5dLU4d3VZwSDuWBIrIIi9GMtKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA4MDYwNTE0NDk1OFowIwYJKoZIhvcNAQkEMRYEFBpY8FafLq7i3V0czWS9TbR/RjyQMA0GCSqGSIb3DQEBAQUABIGAPvYR9EC2ynooWAvX0iw9aZYTrpX2XrTl6lYkZaLrhM1zKn4RuaiL33sPtq0o0uSKm98gQHzh4P6wmzES0jzHucZjCU4VlpW0fC+/pJxswbW7Qux+ObsNx3f45OcvprqMMZyJiEOULcNhxkm9pCeXQMUGwlHoRRtAxYK2T8L/rQQ=-----END PKCS7-----
|
|
||||||
"/>
|
|
||||||
</form>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- Process Tree {{{1 -->
|
<!-- Process Tree {{{1 -->
|
||||||
|
|
||||||
<xsl:template match="@*|node()" mode="pass-2">
|
<xsl:template match="@*|node()" mode="help-2">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="@*|node()">
|
<xsl:template match="@*|node()" mode="help-1">
|
||||||
<xsl:apply-templates select="." mode="pass-2"/>
|
<xsl:apply-templates select="." mode="help-2"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- XML Highlighting (xsl:import doesn't work in Firefox 3.x) {{{1 -->
|
||||||
|
<xsl:template name="xml-highlight">
|
||||||
|
<div dactyl:highlight="HelpXML">
|
||||||
|
<xsl:apply-templates mode="xml-highlight"/>
|
||||||
|
</div>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template name="xml-namespace">
|
||||||
|
<xsl:param name="node" select="."/>
|
||||||
|
<xsl:if test="name($node) != local-name($node)">
|
||||||
|
<span dactyl:highlight="HelpXMLNamespace">
|
||||||
|
<xsl:value-of select="substring-before(name($node), ':')"/>
|
||||||
|
</span>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:value-of select="local-name($node)"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="*" mode="xml-highlight">
|
||||||
|
<span dactyl:highlight="HelpXMLTagStart">
|
||||||
|
<xsl:text><</xsl:text>
|
||||||
|
<xsl:call-template name="xml-namespace"/>
|
||||||
|
<xsl:apply-templates select="@*" mode="xml-highlight"/>
|
||||||
|
<xsl:text>/></xsl:text>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="*[node()]" mode="xml-highlight">
|
||||||
|
<span dactyl:highlight="HelpXMLTagStart">
|
||||||
|
<xsl:text><</xsl:text>
|
||||||
|
<xsl:call-template name="xml-namespace"/>
|
||||||
|
<xsl:apply-templates select="@*" mode="xml-highlight"/>
|
||||||
|
<xsl:text>></xsl:text>
|
||||||
|
</span>
|
||||||
|
<xsl:apply-templates select="node()" mode="xml-highlight"/>
|
||||||
|
<span dactyl:highlight="HelpXMLTagEnd">
|
||||||
|
<xsl:text></</xsl:text>
|
||||||
|
<xsl:call-template name="xml-namespace"/>
|
||||||
|
<xsl:text>></xsl:text>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="dactyl:escape | dactyl:escape[node()]" mode="xml-highlight">
|
||||||
|
<span dactyl:highlight="HelpXMLText">
|
||||||
|
<xsl:apply-templates mode="help-1"/>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="@*" mode="xml-highlight">
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
<span dactyl:highlight="HelpXMLAttribute">
|
||||||
|
<xsl:call-template name="xml-namespace"/>
|
||||||
|
</span>
|
||||||
|
<span dactyl:highlight="HelpXMLString">
|
||||||
|
<xsl:value-of select="regexp:replace(., '"', 'g', '&quot;')"/>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="comment()" mode="xml-highlight">
|
||||||
|
<span dactyl:highlight="HelpXMLComment">
|
||||||
|
<xsl:value-of select="."/>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="processing-instruction()" mode="xml-highlight">
|
||||||
|
<span dactyl:highlight="HelpXMLProcessing">
|
||||||
|
<xsl:value-of select="."/>
|
||||||
|
</span>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="text()" mode="xml-highlight">
|
||||||
|
<span dactyl:highlight="HelpXMLText">
|
||||||
|
<xsl:value-of select="regexp:replace(., '<', 'g', '&lt;')"/>
|
||||||
|
</span>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -351,7 +351,7 @@ const Hints = Module("hints", {
|
|||||||
|
|
||||||
if (hint.text == "" && hint.elem.firstChild && hint.elem.firstChild instanceof HTMLImageElement) {
|
if (hint.text == "" && hint.elem.firstChild && hint.elem.firstChild instanceof HTMLImageElement) {
|
||||||
if (!hint.imgSpan) {
|
if (!hint.imgSpan) {
|
||||||
var rect = hint.elem.firstChild.getBoundingClientRect();
|
let rect = hint.elem.firstChild.getBoundingClientRect();
|
||||||
if (!rect)
|
if (!rect)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1054,7 +1054,7 @@ const Hints = Module("hints", {
|
|||||||
["wordstartswith", "The typed characters are split on whitespace. The resulting groups must all match the beginings of words, in order."],
|
["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."],
|
["firstletters", "Behaves like wordstartswith, but all groups much match a sequence of words."],
|
||||||
["custom", "Delegate to a custom function: dactyl.plugins.customHintMatcher(hintString)"],
|
["custom", "Delegate to a custom function: dactyl.plugins.customHintMatcher(hintString)"],
|
||||||
["transliterated", "When true, special latin characters are translated to their ascii equivalent (e.g., \u00e9 -> e)"]
|
["transliterated", UTF8("When true, special latin characters are translated to their ascii equivalent (e.g., é -> e)")]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -45,11 +45,12 @@ const History = Module("history", {
|
|||||||
let sh = window.getWebNavigation().sessionHistory;
|
let sh = window.getWebNavigation().sessionHistory;
|
||||||
let obj = [];
|
let obj = [];
|
||||||
obj.index = sh.index;
|
obj.index = sh.index;
|
||||||
obj.__iterator__ = function () util.Array.iteritems(this);
|
obj.__iterator__ = function () array.iteritems(this);
|
||||||
for (let i in util.range(0, sh.count)) {
|
for (let i in util.range(0, sh.count)) {
|
||||||
obj[i] = { index: i, __proto__: sh.getEntryAtIndex(i, false) };
|
obj[i] = update(Object.create(sh.getEntryAtIndex(i, false)),
|
||||||
util.memoize(obj[i], "icon",
|
{ index: i });
|
||||||
function (obj) services.get("favicon").getFaviconImageForPage(obj.URI).spec);
|
memoize(obj[i], "icon",
|
||||||
|
function () services.get("favicon").getFaviconImageForPage(this.URI).spec);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -64,8 +65,11 @@ const History = Module("history", {
|
|||||||
dactyl.beep();
|
dactyl.beep();
|
||||||
else {
|
else {
|
||||||
let index = Math.constrain(current + steps, start, end);
|
let index = Math.constrain(current + steps, start, end);
|
||||||
|
try {
|
||||||
window.getWebNavigation().gotoIndex(index);
|
window.getWebNavigation().gotoIndex(index);
|
||||||
}
|
}
|
||||||
|
catch (e) {} // We get NS_ERROR_FILE_NOT_FOUND if files in history don't exist
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
goToStart: function goToStart() {
|
goToStart: function goToStart() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
// Some code based on Venkman
|
// Some code based on Venkman
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
@@ -19,16 +19,15 @@ function Script(file) {
|
|||||||
}
|
}
|
||||||
self = { __proto__: plugins };
|
self = { __proto__: plugins };
|
||||||
plugins.contexts[file.path] = self;
|
plugins.contexts[file.path] = self;
|
||||||
|
plugins[file.path] = self;
|
||||||
self.NAME = file.leafName.replace(/\..*/, "").replace(/-([a-z])/g, function (m, n1) n1.toUpperCase());
|
self.NAME = file.leafName.replace(/\..*/, "").replace(/-([a-z])/g, function (m, n1) n1.toUpperCase());
|
||||||
self.PATH = file.path;
|
self.PATH = file.path;
|
||||||
self.__context__ = self;
|
self.__context__ = self;
|
||||||
self.__proto__ = plugins;
|
|
||||||
|
|
||||||
// This belongs elsewhere
|
// This belongs elsewhere
|
||||||
for (let [, dir] in Iterator(io.getRuntimeDirectories("plugin"))) {
|
if (io.getRuntimeDirectories("plugins").some(
|
||||||
if (dir.contains(file, false))
|
function (dir) dir.contains(file, false)))
|
||||||
plugins[self.NAME] = self;
|
plugins[self.NAME] = self;
|
||||||
}
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +53,8 @@ const IO = Module("io", {
|
|||||||
let file = download.targetFile.path;
|
let file = download.targetFile.path;
|
||||||
let size = download.size;
|
let size = download.size;
|
||||||
|
|
||||||
dactyl.echomsg("Download of " + title + " to " + file + " finished", 1, commandline.ACTIVE_WINDOW);
|
dactyl.echomsg({ domains: [util.getHost(url)], message: "Download of " + title + " to " + file + " finished" },
|
||||||
|
1, commandline.ACTIVE_WINDOW);
|
||||||
autocommands.trigger("DownloadPost", { url: url, title: title, file: file, size: size });
|
autocommands.trigger("DownloadPost", { url: url, title: title, file: file, size: size });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -179,8 +179,8 @@ const IO = Module("io", {
|
|||||||
getRCFile: function (dir, always) {
|
getRCFile: function (dir, always) {
|
||||||
dir = dir || "~";
|
dir = dir || "~";
|
||||||
|
|
||||||
let rcFile1 = File.joinPaths(dir, "." + config.name.toLowerCase() + "rc");
|
let rcFile1 = File.joinPaths(dir, "." + config.name + "rc");
|
||||||
let rcFile2 = File.joinPaths(dir, "_" + config.name.toLowerCase() + "rc");
|
let rcFile2 = File.joinPaths(dir, "_" + config.name + "rc");
|
||||||
|
|
||||||
if (dactyl.has("Win32"))
|
if (dactyl.has("Win32"))
|
||||||
[rcFile1, rcFile2] = [rcFile2, rcFile1];
|
[rcFile1, rcFile2] = [rcFile2, rcFile1];
|
||||||
@@ -346,6 +346,8 @@ lookup:
|
|||||||
dactyl.helpInitialized = false;
|
dactyl.helpInitialized = false;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
if (isstring(e))
|
||||||
|
e = { message: e };
|
||||||
let err = new Error();
|
let err = new Error();
|
||||||
for (let [k, v] in Iterator(e))
|
for (let [k, v] in Iterator(e))
|
||||||
err[k] = v;
|
err[k] = v;
|
||||||
@@ -508,10 +510,10 @@ lookup:
|
|||||||
* variable.
|
* variable.
|
||||||
*/
|
*/
|
||||||
get runtimePath() {
|
get runtimePath() {
|
||||||
const rtpvar = config.name.toUpperCase() + "_RUNTIME";
|
const rtpvar = config.idname + "_RUNTIME";
|
||||||
let rtp = services.get("environment").get(rtpvar);
|
let rtp = services.get("environment").get(rtpvar);
|
||||||
if (!rtp) {
|
if (!rtp) {
|
||||||
rtp = "~/" + (dactyl.has("Win32") ? "" : ".") + config.name.toLowerCase();
|
rtp = "~/" + (dactyl.has("Win32") ? "" : ".") + config.name;
|
||||||
services.get("environment").set(rtpvar, rtp);
|
services.get("environment").set(rtpvar, rtp);
|
||||||
}
|
}
|
||||||
return rtp;
|
return rtp;
|
||||||
@@ -582,7 +584,7 @@ lookup:
|
|||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
|
|
||||||
// "mkv[imperatorrc]" or "mkm[uttatorrc]"
|
// "mkv[imperatorrc]" or "mkm[uttatorrc]"
|
||||||
commands.add([config.name.toLowerCase().replace(/(.)(.*)/, "mk$1[$2rc]")],
|
commands.add([config.name.replace(/(.)(.*)/, "mk$1[$2rc]")],
|
||||||
"Write current key mappings and changed options to the config file",
|
"Write current key mappings and changed options to the config file",
|
||||||
function (args) {
|
function (args) {
|
||||||
dactyl.assert(args.length <= 1, "E172: Only one file name allowed");
|
dactyl.assert(args.length <= 1, "E172: Only one file name allowed");
|
||||||
@@ -595,7 +597,7 @@ lookup:
|
|||||||
|
|
||||||
// TODO: Use a set/specifiable list here:
|
// TODO: Use a set/specifiable list here:
|
||||||
let lines = [cmd.serialize().map(commands.commandToString) for (cmd in commands) if (cmd.serialize)];
|
let lines = [cmd.serialize().map(commands.commandToString) for (cmd in commands) if (cmd.serialize)];
|
||||||
lines = util.Array.flatten(lines);
|
lines = array.flatten(lines);
|
||||||
|
|
||||||
// source a user .pentadactylrc file
|
// source a user .pentadactylrc file
|
||||||
lines.unshift('"' + dactyl.version + "\n");
|
lines.unshift('"' + dactyl.version + "\n");
|
||||||
@@ -608,7 +610,7 @@ lookup:
|
|||||||
arguments: [filename + ".local"]
|
arguments: [filename + ".local"]
|
||||||
}));
|
}));
|
||||||
|
|
||||||
lines.push("\n\" vim: set ft=" + config.name.toLowerCase() + ":");
|
lines.push("\n\" vim: set ft=" + config.name + ":");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
file.write(lines.join("\n"));
|
file.write(lines.join("\n"));
|
||||||
@@ -669,6 +671,10 @@ lookup:
|
|||||||
|
|
||||||
// NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable?
|
// NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable?
|
||||||
// pass through a raw bang when escaped or substitute the last command
|
// pass through a raw bang when escaped or substitute the last command
|
||||||
|
|
||||||
|
// This is an asinine and irritating feature when we have searchable
|
||||||
|
// command-line history. --Kris
|
||||||
|
if (options["banghist"])
|
||||||
arg = arg.replace(/(\\)*!/g,
|
arg = arg.replace(/(\\)*!/g,
|
||||||
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
||||||
);
|
);
|
||||||
@@ -691,19 +697,20 @@ lookup:
|
|||||||
completion: function () {
|
completion: function () {
|
||||||
completion.charset = function (context) {
|
completion.charset = function (context) {
|
||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.generate = function () {
|
let bundle = services.get("stringBundle").createBundle(
|
||||||
let names = util.Array(
|
"chrome://global/locale/charsetTitles.properties");
|
||||||
"more1 more2 more3 more4 more5 unicode".split(" ").map(function (key)
|
context.keys = {
|
||||||
options.getPref("intl.charsetmenu.browser." + key).split(', '))
|
text: util.identity,
|
||||||
).flatten().uniq();
|
description: function (charset) bundle.GetStringFromName(charset.toLowerCase() + ".title")
|
||||||
let bundle = document.getElementById("dactyl-charset-bundle");
|
|
||||||
return names.map(function (name) [name, bundle.getString(name.toLowerCase() + ".title")]);
|
|
||||||
};
|
};
|
||||||
|
context.generate = function () array("more1 more2 more3 more4 more5 unicode".split(" "))
|
||||||
|
.map(function (key) options.getPref("intl.charsetmenu.browser." + key).split(', '))
|
||||||
|
.flatten().uniq().array;
|
||||||
};
|
};
|
||||||
|
|
||||||
completion.directory = function directory(context, full) {
|
completion.directory = function directory(context, full) {
|
||||||
this.file(context, full);
|
this.file(context, full);
|
||||||
context.filters.push(function ({ item: f }) f.isDirectory());
|
context.filters.push(function ({ item }) item.isDirectory());
|
||||||
};
|
};
|
||||||
|
|
||||||
completion.environment = function environment(context) {
|
completion.environment = function environment(context) {
|
||||||
@@ -737,7 +744,7 @@ lookup:
|
|||||||
|
|
||||||
if (options["wildignore"]) {
|
if (options["wildignore"]) {
|
||||||
let wig = options.get("wildignore");
|
let wig = options.get("wildignore");
|
||||||
context.filters.push(function ({item: f}) f.isDirectory() || !wig.getKey(this.name));
|
context.filters.push(function ({ item }) item.isDirectory() || !wig.getKey(this.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// context.background = true;
|
// context.background = true;
|
||||||
@@ -765,7 +772,7 @@ lookup:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return util.Array.flatten(commands);
|
return array.flatten(commands);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -795,6 +802,10 @@ lookup:
|
|||||||
shellcmdflag = "-c";
|
shellcmdflag = "-c";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.add(["banghist", "bh"],
|
||||||
|
"Replace occurances of ! with the previous command when executing external commands",
|
||||||
|
"banghist", true);
|
||||||
|
|
||||||
options.add(["fileencoding", "fenc"],
|
options.add(["fileencoding", "fenc"],
|
||||||
"Sets the character encoding of read and written files",
|
"Sets the character encoding of read and written files",
|
||||||
"string", "UTF-8", {
|
"string", "UTF-8", {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -41,11 +41,13 @@ const JavaScript = Module("javascript", {
|
|||||||
let seen = {};
|
let seen = {};
|
||||||
for (let key in properties(obj, !toplevel)) {
|
for (let key in properties(obj, !toplevel)) {
|
||||||
set.add(seen, key);
|
set.add(seen, key);
|
||||||
yield [key, this.getKey(obj, key)];
|
yield key;
|
||||||
}
|
}
|
||||||
|
// Properties aren't visible in an XPCNativeWrapper until
|
||||||
|
// they're accessed.
|
||||||
for (let key in properties(this.getKey(obj, "wrappedJSObject"), !toplevel))
|
for (let key in properties(this.getKey(obj, "wrappedJSObject"), !toplevel))
|
||||||
if (!set.has(seen, key))
|
if (key in obj && !set.has(seen, key))
|
||||||
yield [key, this.getKey(obj, key)];
|
yield key;
|
||||||
},
|
},
|
||||||
|
|
||||||
objectKeys: function objectKeys(obj, toplevel) {
|
objectKeys: function objectKeys(obj, toplevel) {
|
||||||
@@ -110,15 +112,14 @@ const JavaScript = Module("javascript", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_pop: function pop(arg) {
|
_pop: function pop(arg) {
|
||||||
if (this._top.char != arg) {
|
|
||||||
this.context.highlight(this._top.offset, this._i - this._top.offset, "SPELLCHECK");
|
|
||||||
this.context.highlight(this._top.offset, 1, "FIND");
|
|
||||||
throw new Error("Invalid JS");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._i == this.context.caret - 1)
|
if (this._i == this.context.caret - 1)
|
||||||
this.context.highlight(this._top.offset, 1, "FIND");
|
this.context.highlight(this._top.offset, 1, "FIND");
|
||||||
|
|
||||||
|
if (this._top.char != arg) {
|
||||||
|
this.context.highlight(this._top.offset, this._i - this._top.offset, "SPELLCHECK");
|
||||||
|
throw Error("Invalid JS");
|
||||||
|
}
|
||||||
|
|
||||||
// The closing character of this stack frame will have pushed a new
|
// The closing character of this stack frame will have pushed a new
|
||||||
// statement, leaving us with an empty statement. This doesn't matter,
|
// statement, leaving us with an empty statement. This doesn't matter,
|
||||||
// now, as we simply throw away the frame when we pop it, but it may later.
|
// now, as we simply throw away the frame when we pop it, but it may later.
|
||||||
@@ -139,11 +140,13 @@ const JavaScript = Module("javascript", {
|
|||||||
|
|
||||||
// Reuse the old stack.
|
// Reuse the old stack.
|
||||||
if (this._str && filter.substr(0, this._str.length) == this._str) {
|
if (this._str && filter.substr(0, this._str.length) == this._str) {
|
||||||
|
this.context.highlight(0, 0, "FIND");
|
||||||
this._i = this._str.length;
|
this._i = this._str.length;
|
||||||
if (this.popStatement)
|
if (this.popStatement)
|
||||||
this._top.statements.pop();
|
this._top.statements.pop();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
this.context.highlight();
|
||||||
this._stack = [];
|
this._stack = [];
|
||||||
this._functions = [];
|
this._functions = [];
|
||||||
this._push("#root");
|
this._push("#root");
|
||||||
@@ -239,7 +242,7 @@ const JavaScript = Module("javascript", {
|
|||||||
_getObj: function (frame, stop) {
|
_getObj: function (frame, stop) {
|
||||||
let statement = this._get(frame, 0, "statements") || 0; // Current statement.
|
let statement = this._get(frame, 0, "statements") || 0; // Current statement.
|
||||||
let prev = statement;
|
let prev = statement;
|
||||||
let obj;
|
let obj = null;
|
||||||
let cacheKey;
|
let cacheKey;
|
||||||
for (let [, dot] in Iterator(this._get(frame).dots.concat(stop))) {
|
for (let [, dot] in Iterator(this._get(frame).dots.concat(stop))) {
|
||||||
if (dot < statement)
|
if (dot < statement)
|
||||||
@@ -285,19 +288,19 @@ const JavaScript = Module("javascript", {
|
|||||||
return [dot + 1 + space.length, obj, key];
|
return [dot + 1 + space.length, obj, key];
|
||||||
},
|
},
|
||||||
|
|
||||||
_fill: function (context, obj, name, compl, anchored, key, last, offset) {
|
_fill: function (context, args) {
|
||||||
context.title = [name];
|
context.title = [args.name];
|
||||||
context.anchored = anchored;
|
context.anchored = args.anchored;
|
||||||
context.filter = key;
|
context.filter = args.filter;
|
||||||
context.itemCache = context.parent.itemCache;
|
context.itemCache = context.parent.itemCache;
|
||||||
context.key = name + last;
|
context.key = args.name + args.last;
|
||||||
|
|
||||||
if (last != null)
|
if (args.last != null)
|
||||||
context.quote = [last, function (text) util.escapeString(text.substr(offset), ""), last];
|
context.quote = [args.last, function (text) util.escapeString(text.substr(args.offset), ""), args.last];
|
||||||
else // We're not looking for a quoted string, so filter out anything that's not a valid identifier
|
else // We're not looking for a quoted string, so filter out anything that's not a valid identifier
|
||||||
context.filters.push(function (item) /^[a-zA-Z_$][\w$]*$/.test(item.text));
|
context.filters.push(function (item) /^[a-zA-Z_$][\w$]*$/.test(item.text));
|
||||||
|
|
||||||
compl.call(self, context, obj);
|
args.completer.call(self, context, args.obj);
|
||||||
},
|
},
|
||||||
|
|
||||||
_complete: function (objects, key, compl, string, last) {
|
_complete: function (objects, key, compl, string, last) {
|
||||||
@@ -309,7 +312,10 @@ const JavaScript = Module("javascript", {
|
|||||||
let orig = compl;
|
let orig = compl;
|
||||||
if (!compl) {
|
if (!compl) {
|
||||||
compl = function (context, obj, recurse) {
|
compl = function (context, obj, recurse) {
|
||||||
context.process = [null, function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true)];
|
|
||||||
|
context.process[1] = function highlight(item, v)
|
||||||
|
template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true);
|
||||||
|
|
||||||
// Sort in a logical fashion for object keys:
|
// Sort in a logical fashion for object keys:
|
||||||
// Numbers are sorted as numbers, rather than strings, and appear first.
|
// Numbers are sorted as numbers, rather than strings, and appear first.
|
||||||
// Constants are unsorted, and appear before other non-null strings.
|
// Constants are unsorted, and appear before other non-null strings.
|
||||||
@@ -321,14 +327,15 @@ const JavaScript = Module("javascript", {
|
|||||||
return a.key - b.key;
|
return a.key - b.key;
|
||||||
return isnan(b.key) - isnan(a.key) || compare(a, b);
|
return isnan(b.key) - isnan(a.key) || compare(a, b);
|
||||||
};
|
};
|
||||||
context.keys = { text: 0, description: 1,
|
context.keys = {
|
||||||
|
text: util.identity,
|
||||||
|
description: function (item) self.getKey(obj, item),
|
||||||
key: function (item) {
|
key: function (item) {
|
||||||
let key = item[0];
|
|
||||||
if (!isNaN(key))
|
if (!isNaN(key))
|
||||||
return parseInt(key);
|
return parseInt(key);
|
||||||
else if (/^[A-Z_][A-Z0-9_]*$/.test(key))
|
if (/^[A-Z_][A-Z0-9_]*$/.test(key))
|
||||||
return ""
|
return ""
|
||||||
return key;
|
return item;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -339,37 +346,51 @@ const JavaScript = Module("javascript", {
|
|||||||
context.generate = function () self.objectKeys(obj, !recurse);
|
context.generate = function () self.objectKeys(obj, !recurse);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let args = {
|
||||||
|
completer: compl,
|
||||||
|
anchored: true,
|
||||||
|
filter: key + (string || ""),
|
||||||
|
last: last,
|
||||||
|
offset: key.length
|
||||||
|
};
|
||||||
|
|
||||||
// TODO: Make this a generic completion helper function.
|
// TODO: Make this a generic completion helper function.
|
||||||
let filter = key + (string || "");
|
for (let [, obj] in Iterator(objects))
|
||||||
for (let [, obj] in Iterator(objects)) {
|
|
||||||
this.context.fork(obj[1], this._top.offset, this, this._fill,
|
this.context.fork(obj[1], this._top.offset, this, this._fill,
|
||||||
obj[0], obj[1], compl,
|
update(args, {
|
||||||
true, filter, last, key.length);
|
obj: obj[0],
|
||||||
}
|
name: obj[1],
|
||||||
|
}));
|
||||||
|
|
||||||
if (orig)
|
if (orig)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (let [, obj] in Iterator(objects)) {
|
for (let [, obj] in Iterator(objects))
|
||||||
let name = obj[1] + " (prototypes)";
|
this.context.fork(obj[1] + "/prototypes", this._top.offset, this, this._fill,
|
||||||
this.context.fork(name, this._top.offset, this, this._fill,
|
update(args, {
|
||||||
obj[0], name, function (a, b) compl(a, b, true),
|
obj: obj[0],
|
||||||
true, filter, last, key.length);
|
name: obj[1] + " (prototypes)",
|
||||||
}
|
completer: function (a, b) compl(a, b, true)
|
||||||
|
}));
|
||||||
|
|
||||||
for (let [, obj] in Iterator(objects)) {
|
for (let [, obj] in Iterator(objects))
|
||||||
let name = obj[1] + " (substrings)";
|
this.context.fork(obj[1] + "/substrings", this._top.offset, this, this._fill,
|
||||||
this.context.fork(name, this._top.offset, this, this._fill,
|
update(args, {
|
||||||
obj[0], name, compl,
|
obj: obj[0],
|
||||||
false, filter, last, key.length);
|
name: obj[1] + " (substrings)",
|
||||||
}
|
anchored: false,
|
||||||
|
completer: compl
|
||||||
|
}));
|
||||||
|
|
||||||
for (let [, obj] in Iterator(objects)) {
|
for (let [, obj] in Iterator(objects))
|
||||||
let name = obj[1] + " (prototype substrings)";
|
this.context.fork(obj[1] + "/prototypes/substrings", this._top.offset, this, this._fill,
|
||||||
this.context.fork(name, this._top.offset, this, this._fill,
|
update(args, {
|
||||||
obj[0], name, function (a, b) compl(a, b, true),
|
obj: obj[0],
|
||||||
false, filter, last, key.length);
|
name: obj[1] + " (prototype substrings)",
|
||||||
}
|
anchored: false,
|
||||||
|
completer: function (a, b) compl(a, b, true)
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
_getKey: function () {
|
_getKey: function () {
|
||||||
@@ -398,7 +419,7 @@ const JavaScript = Module("javascript", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.context.getCache("evalled", Object);
|
this.context.getCache("evalled", Object);
|
||||||
this.context.getCache("evalContext", function () ({ __proto__: userContext }));;
|
this.context.getCache("evalContext", function () ({ __proto__: userContext }));
|
||||||
|
|
||||||
// Okay, have parse stack. Figure out what we're completing.
|
// Okay, have parse stack. Figure out what we're completing.
|
||||||
|
|
||||||
@@ -478,7 +499,7 @@ const JavaScript = Module("javascript", {
|
|||||||
for (let [i, idx] in Iterator(this._get(-2).comma)) {
|
for (let [i, idx] in Iterator(this._get(-2).comma)) {
|
||||||
let arg = this._str.substring(prev + 1, idx);
|
let arg = this._str.substring(prev + 1, idx);
|
||||||
prev = idx;
|
prev = idx;
|
||||||
util.memoize(args, i, function () self.evalled(arg));
|
memoize(args, i, function () self.evalled(arg));
|
||||||
}
|
}
|
||||||
let key = this._getKey();
|
let key = this._getKey();
|
||||||
args.push(key + string);
|
args.push(key + string);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -383,7 +383,7 @@ const Mappings = Module("mappings", {
|
|||||||
let [lhs, rhs] = args;
|
let [lhs, rhs] = args;
|
||||||
|
|
||||||
if (!rhs) // list the mapping
|
if (!rhs) // list the mapping
|
||||||
mappings.list(modes, this._expandLeader(lhs));
|
mappings.list(modes, mappings._expandLeader(lhs));
|
||||||
else {
|
else {
|
||||||
// this matches Vim's behaviour
|
// this matches Vim's behaviour
|
||||||
if (/^<Nop>$/i.test(rhs))
|
if (/^<Nop>$/i.test(rhs))
|
||||||
@@ -467,7 +467,7 @@ const Mappings = Module("mappings", {
|
|||||||
addMapCommands("", [modes.NORMAL, modes.VISUAL], "");
|
addMapCommands("", [modes.NORMAL, modes.VISUAL], "");
|
||||||
|
|
||||||
for (let mode in modes.mainModes)
|
for (let mode in modes.mainModes)
|
||||||
if (mode.char && !commands.get(mode.char + "map"))
|
if (mode.char && !commands.get(mode.char + "map", true))
|
||||||
addMapCommands(mode.char,
|
addMapCommands(mode.char,
|
||||||
[m.mask for (m in modes.mainModes) if (m.char == mode.char)],
|
[m.mask for (m in modes.mainModes) if (m.char == mode.char)],
|
||||||
[mode.disp.toLowerCase()]);
|
[mode.disp.toLowerCase()]);
|
||||||
@@ -489,8 +489,7 @@ const Mappings = Module("mappings", {
|
|||||||
null,
|
null,
|
||||||
function (context, obj, args) {
|
function (context, obj, args) {
|
||||||
let mode = args[0];
|
let mode = args[0];
|
||||||
return util.Array.flatten(
|
return array.flatten([
|
||||||
[
|
|
||||||
[[name, map.description] for ([i, name] in Iterator(map.names))]
|
[[name, map.description] for ([i, name] in Iterator(map.names))]
|
||||||
for ([i, map] in Iterator(mappings._user[mode].concat(mappings._main[mode])))
|
for ([i, map] in Iterator(mappings._user[mode].concat(mappings._main[mode])))
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -17,7 +17,7 @@ const Marks = Module("marks", {
|
|||||||
this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: replacer, store: true });
|
this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: replacer, store: true });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(isarray(Iterator(this._localMarks).next()));
|
if(isarray(Iterator(this._localMarks).next()[1]))
|
||||||
this._localMarks.clear();
|
this._localMarks.clear();
|
||||||
}
|
}
|
||||||
catch(e) {}
|
catch(e) {}
|
||||||
@@ -31,7 +31,7 @@ const Marks = Module("marks", {
|
|||||||
*/
|
*/
|
||||||
get all() {
|
get all() {
|
||||||
let lmarks = array(Iterator(this._localMarks.get(this.localURI) || {}));
|
let lmarks = array(Iterator(this._localMarks.get(this.localURI) || {}));
|
||||||
let umarks = array(Iterator(this._urlMarks)).__proto__;
|
let umarks = array(Iterator(this._urlMarks)).array;
|
||||||
|
|
||||||
return lmarks.concat(umarks).sort(function (a, b) String.localeCompare(a[0], b[0]));
|
return lmarks.concat(umarks).sort(function (a, b) String.localeCompare(a[0], b[0]));
|
||||||
},
|
},
|
||||||
@@ -54,9 +54,7 @@ const Marks = Module("marks", {
|
|||||||
let win = window.content;
|
let win = window.content;
|
||||||
let doc = win.document;
|
let doc = win.document;
|
||||||
|
|
||||||
if (!doc.body)
|
if (doc.body && doc.body instanceof HTMLFrameSetElement) {
|
||||||
return;
|
|
||||||
if (doc.body instanceof HTMLFrameSetElement) {
|
|
||||||
if (!silent)
|
if (!silent)
|
||||||
dactyl.echoerr("Marks support for frameset pages not implemented yet");
|
dactyl.echoerr("Marks support for frameset pages not implemented yet");
|
||||||
return;
|
return;
|
||||||
@@ -72,8 +70,8 @@ const Marks = Module("marks", {
|
|||||||
dactyl.log("Adding URL mark: " + Marks.markToString(mark, res), 5);
|
dactyl.log("Adding URL mark: " + Marks.markToString(mark, res), 5);
|
||||||
}
|
}
|
||||||
else if (Marks.isLocalMark(mark)) {
|
else if (Marks.isLocalMark(mark)) {
|
||||||
let marks = this._localMarks.get(doc.URL, {});
|
let marks = this._localMarks.get(doc.documentURI, {});
|
||||||
marks[mark] = { location: doc.URL, position: position, timestamp: Date.now()*1000 };
|
marks[mark] = { location: doc.documentURI, position: position, timestamp: Date.now()*1000 };
|
||||||
this._localMarks.changed();
|
this._localMarks.changed();
|
||||||
if (!silent)
|
if (!silent)
|
||||||
dactyl.log("Adding local mark: " + Marks.markToString(mark, marks[mark]), 5);
|
dactyl.log("Adding local mark: " + Marks.markToString(mark, marks[mark]), 5);
|
||||||
@@ -237,7 +235,7 @@ const Marks = Module("marks", {
|
|||||||
// NOTE: this currently differs from Vim's behavior which
|
// NOTE: this currently differs from Vim's behavior which
|
||||||
// deletes any valid marks in the arg list, up to the first
|
// deletes any valid marks in the arg list, up to the first
|
||||||
// invalid arg, as well as giving the error message.
|
// invalid arg, as well as giving the error message.
|
||||||
dactyl.assert(!matches, "E475: Invalid argument: " + matches[0]);
|
dactyl.assert(!matches, "E475: Invalid argument: " + (matches && matches[0]));
|
||||||
|
|
||||||
// check for illegal ranges - only allow a-z A-Z 0-9
|
// check for illegal ranges - only allow a-z A-Z 0-9
|
||||||
if ((matches = args.match(/[a-zA-Z0-9]-[a-zA-Z0-9]/g))) {
|
if ((matches = args.match(/[a-zA-Z0-9]-[a-zA-Z0-9]/g))) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -120,7 +120,7 @@ const Modes = Module("modes", {
|
|||||||
|
|
||||||
NONE: 0,
|
NONE: 0,
|
||||||
|
|
||||||
__iterator__: function () util.Array.itervalues(this.all),
|
__iterator__: function () array.itervalues(this.all),
|
||||||
|
|
||||||
get all() this._mainModes.slice(),
|
get all() this._mainModes.slice(),
|
||||||
|
|
||||||
@@ -155,7 +155,8 @@ const Modes = Module("modes", {
|
|||||||
|
|
||||||
getCharModes: function (chr) [m for (m in values(this._modeMap)) if (m.char == chr)],
|
getCharModes: function (chr) [m for (m in values(this._modeMap)) if (m.char == chr)],
|
||||||
|
|
||||||
matchModes: function (obj) [m for (m in values(this._modeMap)) if (Object.keys(obj).every(function (k) obj[k] == (m[k] || false)))],
|
matchModes: function (obj)
|
||||||
|
[m for (m in values(this._modeMap)) if (Object.keys(obj).every(function (k) obj[k] == (m[k] || false)))],
|
||||||
|
|
||||||
// show the current mode string in the command line
|
// show the current mode string in the command line
|
||||||
show: function () {
|
show: function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2009-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -15,7 +15,7 @@ const ModuleBase = Class("ModuleBase", {
|
|||||||
*/
|
*/
|
||||||
requires: [],
|
requires: [],
|
||||||
|
|
||||||
toString: function () "[module " + this.constructor.name + "]"
|
toString: function () "[module " + this.constructor.classname + "]"
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,26 +76,29 @@ window.addEventListener("load", function onLoad() {
|
|||||||
window.removeEventListener("load", onLoad, false);
|
window.removeEventListener("load", onLoad, false);
|
||||||
|
|
||||||
Module.list.forEach(function(module) {
|
Module.list.forEach(function(module) {
|
||||||
modules.__defineGetter__(module.name, function() {
|
modules.__defineGetter__(module.classname, function() {
|
||||||
delete modules[module.name];
|
delete modules[module.classname];
|
||||||
return load(module.name, null, Components.stack.caller);
|
return load(module.classname, null, Components.stack.caller);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, Config.prototype.name.toLowerCase() + ": "));
|
function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, services.get("dactyl:").name + ": "));
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
const deferredInit = { load: [] };
|
const deferredInit = { load: [] };
|
||||||
const seen = set();
|
const seen = set();
|
||||||
const loaded = set(["init"]);
|
const loaded = set(["init"]);
|
||||||
|
modules.loaded = loaded;
|
||||||
|
|
||||||
function init(module) {
|
function init(module) {
|
||||||
function init(func, mod)
|
function init(func, mod)
|
||||||
function () defmodule.time(module.name || module.constructor.name, mod, func, module, dactyl, modules, window);
|
function () defmodule.time(module.classname || module.constructor.classname, mod,
|
||||||
|
func, module,
|
||||||
|
dactyl, modules, window);
|
||||||
|
|
||||||
set.add(loaded, module.constructor.name);
|
set.add(loaded, module.constructor.classname);
|
||||||
for (let [mod, func] in Iterator(module.INIT)) {
|
for (let [mod, func] in Iterator(module.INIT)) {
|
||||||
if (mod in loaded)
|
if (mod in loaded)
|
||||||
init(func)();
|
init(func, mod)();
|
||||||
else {
|
else {
|
||||||
deferredInit[mod] = deferredInit[mod] || [];
|
deferredInit[mod] = deferredInit[mod] || [];
|
||||||
deferredInit[mod].push(init(func, mod));
|
deferredInit[mod].push(init(func, mod));
|
||||||
@@ -112,34 +115,35 @@ window.addEventListener("load", function onLoad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (module.name in loaded)
|
if (module.classname in loaded)
|
||||||
return;
|
return;
|
||||||
if (module.name in seen)
|
if (module.classname in seen)
|
||||||
throw Error("Module dependency loop.");
|
throw Error("Module dependency loop.");
|
||||||
set.add(seen, module.name);
|
set.add(seen, module.classname);
|
||||||
|
|
||||||
for (let dep in values(module.requires))
|
for (let dep in values(module.requires))
|
||||||
load(Module.constructors[dep], module.name);
|
load(Module.constructors[dep], module.classname);
|
||||||
|
|
||||||
defmodule.loadLog.push("Load" + (isstring(prereq) ? " " + prereq + " dependency: " : ": ") + module.name);
|
defmodule.loadLog.push("Load" + (isstring(prereq) ? " " + prereq + " dependency: " : ": ") + module.classname);
|
||||||
if (frame && frame.filename)
|
if (frame && frame.filename)
|
||||||
defmodule.loadLog.push(" from: " + frame.filename + ":" + frame.lineNumber);
|
defmodule.loadLog.push(" from: " + frame.filename + ":" + frame.lineNumber);
|
||||||
|
|
||||||
delete modules[module.name];
|
delete modules[module.classname];
|
||||||
modules[module.name] = defmodule.time(module.name, "init", module);
|
modules[module.classname] = defmodule.time(module.classname, "init", module);
|
||||||
|
|
||||||
init(modules[module.name]);
|
init(modules[module.classname]);
|
||||||
for (let [, fn] in iter(deferredInit[module.name] || []))
|
for (let [, fn] in iter(deferredInit[module.classname] || []))
|
||||||
fn();
|
fn();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dump("Loading " + (module && module.name) + ": " + e + "\n" + (e.stack || ""));
|
dump("Loading " + (module && module.classname) + ": " + e + "\n" + (e.stack || ""));
|
||||||
}
|
}
|
||||||
return modules[module.name];
|
return modules[module.classname];
|
||||||
}
|
}
|
||||||
|
|
||||||
Module.list.forEach(load);
|
Module.list.forEach(load);
|
||||||
deferredInit["load"].forEach(call);
|
deferredInit["load"].forEach(call);
|
||||||
|
modules.times = update({}, defmodule.times);
|
||||||
|
|
||||||
dump("Loaded in " + (Date.now() - start) + "ms");
|
dump("Loaded in " + (Date.now() - start) + "ms");
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
* completer - see {@link Option#completer}
|
* completer - see {@link Option#completer}
|
||||||
* domains - see {@link Option#domains}
|
* domains - see {@link Option#domains}
|
||||||
* getter - see {@link Option#getter}
|
* getter - see {@link Option#getter}
|
||||||
|
* initialValue - Initial value is loaded from getter
|
||||||
|
* persist - see {@link Option#persist}
|
||||||
* privateData - see {@link Option#privateData}
|
* privateData - see {@link Option#privateData}
|
||||||
* scope - see {@link Option#scope}
|
* scope - see {@link Option#scope}
|
||||||
* setter - see {@link Option#setter}
|
* setter - see {@link Option#setter}
|
||||||
@@ -56,9 +58,9 @@ const Option = Class("Option", {
|
|||||||
|
|
||||||
// add no{option} variant of boolean {option} to this.names
|
// add no{option} variant of boolean {option} to this.names
|
||||||
if (this.type == "boolean")
|
if (this.type == "boolean")
|
||||||
this.names = array([name, "no" + name] for (name in values(names))).flatten().__proto__;
|
this.names = array([name, "no" + name] for (name in values(names))).flatten().array;
|
||||||
|
|
||||||
if (this.globalValue == undefined)
|
if (this.globalValue == undefined && !this.initialValue)
|
||||||
this.globalValue = this.parseValues(this.defaultValue);
|
this.globalValue = this.parseValues(this.defaultValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -295,6 +297,13 @@ const Option = Class("Option", {
|
|||||||
*/
|
*/
|
||||||
getter: null,
|
getter: null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {boolean} When true, this options values will be saved
|
||||||
|
* when generating a configuration file.
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
persist: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {boolean|function(values)} When true, values of this
|
* @property {boolean|function(values)} When true, values of this
|
||||||
* option may contain private data which should be purged from
|
* option may contain private data which should be purged from
|
||||||
@@ -363,18 +372,23 @@ const Option = Class("Option", {
|
|||||||
let re = RegExp(val);
|
let re = RegExp(val);
|
||||||
re.bang = bang;
|
re.bang = bang;
|
||||||
re.result = arguments.length == 2 ? result : !bang;
|
re.result = arguments.length == 2 ? result : !bang;
|
||||||
|
re.toString = function () Option.unparseRegex(this);
|
||||||
return re;
|
return re;
|
||||||
},
|
},
|
||||||
unparseRegex: function (re) re.bang + re.source + (typeof re.result == "string" ? ":" + re.result : ""),
|
unparseRegex: function (re) re.bang + re.source.replace(/\\(.)/g, function (m, n1) n1 == "/" ? n1 : m) +
|
||||||
|
(typeof re.result == "string" ? ":" + re.result : ""),
|
||||||
|
|
||||||
getKey: {
|
getKey: {
|
||||||
stringlist: function (k) this.values.indexOf(k) >= 0,
|
stringlist: function (k) this.values.indexOf(k) >= 0,
|
||||||
|
get charlist() this.stringlist,
|
||||||
|
|
||||||
regexlist: function (k) {
|
regexlist: function (k) {
|
||||||
for (let re in values(this.values))
|
for (let re in values(this.values))
|
||||||
if (re.test(k))
|
if (re.test(k))
|
||||||
return re.result;
|
return re.result;
|
||||||
return null;
|
return null;
|
||||||
}
|
},
|
||||||
|
get regexmap() this.regexlist
|
||||||
},
|
},
|
||||||
|
|
||||||
joinValues: {
|
joinValues: {
|
||||||
@@ -382,6 +396,7 @@ const Option = Class("Option", {
|
|||||||
stringlist: function (vals) vals.join(","),
|
stringlist: function (vals) vals.join(","),
|
||||||
stringmap: function (vals) [k + ":" + v for ([k, v] in Iterator(vals))].join(","),
|
stringmap: function (vals) [k + ":" + v for ([k, v] in Iterator(vals))].join(","),
|
||||||
regexlist: function (vals) vals.map(Option.unparseRegex).join(","),
|
regexlist: function (vals) vals.map(Option.unparseRegex).join(","),
|
||||||
|
get regexmap() this.regexlist
|
||||||
},
|
},
|
||||||
|
|
||||||
parseValues: {
|
parseValues: {
|
||||||
@@ -430,10 +445,10 @@ const Option = Class("Option", {
|
|||||||
|
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
case "+":
|
case "+":
|
||||||
return util.Array.uniq(Array.concat(orig, values), true);
|
return array.uniq(Array.concat(orig, values), true);
|
||||||
case "^":
|
case "^":
|
||||||
// NOTE: Vim doesn't prepend if there's a match in the current value
|
// NOTE: Vim doesn't prepend if there's a match in the current value
|
||||||
return util.Array.uniq(Array.concat(values, orig), true);
|
return array.uniq(Array.concat(values, orig), true);
|
||||||
case "-":
|
case "-":
|
||||||
return orig.filter(function (item) values.indexOf(item) == -1);
|
return orig.filter(function (item) values.indexOf(item) == -1);
|
||||||
case "=":
|
case "=":
|
||||||
@@ -452,10 +467,10 @@ const Option = Class("Option", {
|
|||||||
values = Array.concat(values);
|
values = Array.concat(values);
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
case "+":
|
case "+":
|
||||||
return util.Array.uniq(Array.concat(this.values, values), true);
|
return array.uniq(Array.concat(this.values, values), true);
|
||||||
case "^":
|
case "^":
|
||||||
// NOTE: Vim doesn't prepend if there's a match in the current value
|
// NOTE: Vim doesn't prepend if there's a match in the current value
|
||||||
return util.Array.uniq(Array.concat(values, this.values), true);
|
return array.uniq(Array.concat(values, this.values), true);
|
||||||
case "-":
|
case "-":
|
||||||
return this.values.filter(function (item) values.indexOf(item) == -1);
|
return this.values.filter(function (item) values.indexOf(item) == -1);
|
||||||
case "=":
|
case "=":
|
||||||
@@ -468,6 +483,9 @@ const Option = Class("Option", {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
get charlist() this.stringlist,
|
||||||
|
get regexlist() this.stringlist,
|
||||||
|
get regexmap() this.stringlist,
|
||||||
|
|
||||||
string: function (operator, values, scope, invert) {
|
string: function (operator, values, scope, invert) {
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
@@ -503,21 +521,14 @@ const Option = Class("Option", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Option.joinValues["regexmap"] = Option.joinValues["regexlist"];
|
|
||||||
|
|
||||||
Option.getKey["charlist"] = Option.getKey["stringlist"];
|
|
||||||
Option.getKey["regexmap"] = Option.getKey["regexlist"];
|
|
||||||
|
|
||||||
Option.ops["charlist"] = Option.ops["stringlist"];
|
|
||||||
Option.ops["regexlist"] = Option.ops["stringlist"];
|
|
||||||
Option.ops["regexmap"] = Option.ops["stringlist"];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @instance options
|
* @instance options
|
||||||
*/
|
*/
|
||||||
const Options = Module("options", {
|
const Options = Module("options", {
|
||||||
init: function () {
|
init: function () {
|
||||||
this._optionHash = {};
|
this.needInit = [];
|
||||||
|
this._options = [];
|
||||||
|
this._optionMap = {};
|
||||||
this._prefContexts = [];
|
this._prefContexts = [];
|
||||||
|
|
||||||
for (let [, pref] in Iterator(this.allPrefs(Options.OLD_SAVED))) {
|
for (let [, pref] in Iterator(this.allPrefs(Options.OLD_SAVED))) {
|
||||||
@@ -541,45 +552,28 @@ const Options = Module("options", {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function optionObserver(key, event, option) {
|
storage.newMap("options", { store: false });
|
||||||
|
storage.addObserver("options", function optionObserver(key, event, option) {
|
||||||
// Trigger any setters.
|
// Trigger any setters.
|
||||||
let opt = options.get(option);
|
let opt = options.get(option);
|
||||||
if (event == "change" && opt)
|
if (event == "change" && opt)
|
||||||
opt.setValues(opt.globalValue, Option.SCOPE_GLOBAL, true);
|
opt.setValues(opt.globalValue, Option.SCOPE_GLOBAL, true);
|
||||||
}
|
}, window);
|
||||||
|
|
||||||
storage.newMap("options", { store: false });
|
|
||||||
storage.addObserver("options", optionObserver, window);
|
|
||||||
|
|
||||||
this.prefObserver.register();
|
|
||||||
},
|
|
||||||
|
|
||||||
destroy: function () {
|
|
||||||
this.prefObserver.unregister();
|
|
||||||
},
|
|
||||||
|
|
||||||
/** @property {Iterator(Option)} @private */
|
|
||||||
__iterator__: function ()
|
|
||||||
array(values(this._optionHash)).sort(function (a, b) String.localeCompare(a.name, b.name))
|
|
||||||
.itervalues(),
|
|
||||||
|
|
||||||
/** @property {Object} Observes preference value changes. */
|
|
||||||
prefObserver: {
|
|
||||||
register: function () {
|
|
||||||
// better way to monitor all changes?
|
|
||||||
this._branch = services.get("pref").getBranch("").QueryInterface(Ci.nsIPrefBranch2);
|
this._branch = services.get("pref").getBranch("").QueryInterface(Ci.nsIPrefBranch2);
|
||||||
this._branch.addObserver("", this, false);
|
this._branch.addObserver("", this, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
unregister: function () {
|
destroy: function () {
|
||||||
if (this._branch)
|
|
||||||
this._branch.removeObserver("", this);
|
this._branch.removeObserver("", this);
|
||||||
},
|
},
|
||||||
|
|
||||||
observe: function (subject, topic, data) {
|
/** @property {Iterator(Option)} @private */
|
||||||
if (topic != "nsPref:changed")
|
__iterator__: function ()
|
||||||
return;
|
values(this._options.sort(function (a, b) String.localeCompare(a.name, b.name))),
|
||||||
|
|
||||||
|
observe: function (subject, topic, data) {
|
||||||
|
if (topic == "nsPref:changed") {
|
||||||
// subject is the nsIPrefBranch we're observing (after appropriate QI)
|
// subject is the nsIPrefBranch we're observing (after appropriate QI)
|
||||||
// data is the name of the pref that's been changed (relative to subject)
|
// data is the name of the pref that's been changed (relative to subject)
|
||||||
switch (data) {
|
switch (data) {
|
||||||
@@ -601,29 +595,28 @@ const Options = Module("options", {
|
|||||||
* @param {Object} extra An optional extra configuration hash (see
|
* @param {Object} extra An optional extra configuration hash (see
|
||||||
* {@link Map#extraInfo}).
|
* {@link Map#extraInfo}).
|
||||||
* @optional
|
* @optional
|
||||||
* @returns {boolean} Whether the option was created.
|
|
||||||
*/
|
*/
|
||||||
add: function (names, description, type, defaultValue, extraInfo) {
|
add: function (names, description, type, defaultValue, extraInfo) {
|
||||||
if (!extraInfo)
|
if (!extraInfo)
|
||||||
extraInfo = {};
|
extraInfo = {};
|
||||||
|
|
||||||
let option = Option(names, description, type, defaultValue, extraInfo);
|
let name = names[0];
|
||||||
|
if (name in this._optionMap) {
|
||||||
if (!option)
|
dactyl.log("Warning: " + name.quote() + " already exists: replacing existing option.", 1);
|
||||||
return false;
|
this.remove(name);
|
||||||
|
|
||||||
if (option.name in this._optionHash) {
|
|
||||||
// never replace for now
|
|
||||||
dactyl.log("Warning: " + names[0].quote() + " already exists, NOT replacing existing option.", 1);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// quickly access options with options["wildmode"]:
|
let closure = function () options._optionMap[name];
|
||||||
this.__defineGetter__(option.name, function () option.value);
|
memoize(this._options, this._options.length, closure);
|
||||||
this.__defineSetter__(option.name, function (value) { option.value = value; });
|
memoize(this._optionMap, name, function () Option(names, description, type, defaultValue, extraInfo));
|
||||||
|
for (let alias in values(names.slice(1)))
|
||||||
|
memoize(this._optionMap, alias, closure);
|
||||||
|
if (extraInfo.setter)
|
||||||
|
memoize(this.needInit, this.needInit.length, closure);
|
||||||
|
|
||||||
this._optionHash[option.name] = option;
|
// quickly access options with options["wildmode"]:
|
||||||
return true;
|
this.__defineGetter__(name, function () this._optionMap[name].value);
|
||||||
|
this.__defineSetter__(name, function (value) { this._optionMap[name].value = value; });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -646,12 +639,8 @@ const Options = Module("options", {
|
|||||||
if (!scope)
|
if (!scope)
|
||||||
scope = Option.SCOPE_BOTH;
|
scope = Option.SCOPE_BOTH;
|
||||||
|
|
||||||
if (name in this._optionHash)
|
if (name in this._optionMap && (this._optionMap[name].scope & scope))
|
||||||
return (this._optionHash[name].scope & scope) && this._optionHash[name];
|
return this._optionMap[name];
|
||||||
|
|
||||||
for (let opt in values(this._optionHash))
|
|
||||||
if (opt.hasName(name))
|
|
||||||
return (opt.scope & scope) && opt;
|
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -734,7 +723,7 @@ const Options = Module("options", {
|
|||||||
};
|
};
|
||||||
|
|
||||||
commandline.commandOutput(
|
commandline.commandOutput(
|
||||||
template.options(config.hostApplication + " Options", prefs()));
|
template.options(config.host + " Options", prefs()));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -751,7 +740,7 @@ const Options = Module("options", {
|
|||||||
let matches, prefix, postfix, valueGiven;
|
let matches, prefix, postfix, valueGiven;
|
||||||
|
|
||||||
[matches, prefix, ret.name, postfix, valueGiven, ret.operator, ret.value] =
|
[matches, prefix, ret.name, postfix, valueGiven, ret.operator, ret.value] =
|
||||||
args.match(/^\s*(no|inv)?([a-z_]*)([?&!])?\s*(([-+^]?)=(.*))?\s*$/) || [];
|
args.match(/^\s*(no|inv)?([a-z_-]*?)([?&!])?\s*(([-+^]?)=(.*))?\s*$/) || [];
|
||||||
|
|
||||||
ret.args = args;
|
ret.args = args;
|
||||||
ret.onlyNonDefault = false; // used for :set to print non-default options
|
ret.onlyNonDefault = false; // used for :set to print non-default options
|
||||||
@@ -760,8 +749,13 @@ const Options = Module("options", {
|
|||||||
ret.onlyNonDefault = true;
|
ret.onlyNonDefault = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matches)
|
if (matches) {
|
||||||
ret.option = options.get(ret.name, ret.scope);
|
ret.option = options.get(ret.name, ret.scope);
|
||||||
|
if (!ret.option && (ret.option = options.get(prefix + ret.name, ret.scope))) {
|
||||||
|
ret.name = prefix + ret.name;
|
||||||
|
prefix = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret.prefix = prefix;
|
ret.prefix = prefix;
|
||||||
ret.postfix = postfix;
|
ret.postfix = postfix;
|
||||||
@@ -795,10 +789,10 @@ const Options = Module("options", {
|
|||||||
* any of the options's names.
|
* any of the options's names.
|
||||||
*/
|
*/
|
||||||
remove: function (name) {
|
remove: function (name) {
|
||||||
for each (let option in this._optionHash) {
|
let opt = this.get(name);
|
||||||
if (option.hasName(name))
|
for (let name in values(opt.names))
|
||||||
delete this._optionHash[option.name];
|
delete this._optionMap[name];
|
||||||
}
|
this._options = this._options.filter(function (o) o != opt);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @property {Object} The options store. */
|
/** @property {Object} The options store. */
|
||||||
@@ -1023,7 +1017,7 @@ const Options = Module("options", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name == "all" && reset)
|
if (name == "all" && reset)
|
||||||
commandline.input("Warning: Resetting all preferences may make " + config.hostApplication + " unusable. Continue (yes/[no]): ",
|
commandline.input("Warning: Resetting all preferences may make " + config.host + " unusable. Continue (yes/[no]): ",
|
||||||
function (resp) {
|
function (resp) {
|
||||||
if (resp == "yes")
|
if (resp == "yes")
|
||||||
for (let pref in values(options.allPrefs()))
|
for (let pref in values(options.allPrefs()))
|
||||||
@@ -1037,20 +1031,14 @@ const Options = Module("options", {
|
|||||||
else if (invertBoolean)
|
else if (invertBoolean)
|
||||||
options.invertPref(name);
|
options.invertPref(name);
|
||||||
else if (valueGiven) {
|
else if (valueGiven) {
|
||||||
switch (value) {
|
if (value == undefined)
|
||||||
case undefined:
|
|
||||||
value = "";
|
value = "";
|
||||||
break;
|
else if (value == "true")
|
||||||
case "true":
|
|
||||||
value = true;
|
value = true;
|
||||||
break;
|
else if (value == "false")
|
||||||
case "false":
|
value = true;
|
||||||
value = false;
|
else if (/^\d+$/.test(value))
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (/^\d+$/.test(value))
|
|
||||||
value = parseInt(value, 10);
|
value = parseInt(value, 10);
|
||||||
}
|
|
||||||
options.setPref(name, value);
|
options.setPref(name, value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1123,7 +1111,7 @@ const Options = Module("options", {
|
|||||||
context.completions = [
|
context.completions = [
|
||||||
[options._loadPreference(filter, null, false), "Current Value"],
|
[options._loadPreference(filter, null, false), "Current Value"],
|
||||||
[options._loadPreference(filter, null, true), "Default Value"]
|
[options._loadPreference(filter, null, true), "Default Value"]
|
||||||
].filter(function ([k]) k != null);
|
].filter(function ([k]) k != null && k.length < 200);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1134,15 +1122,10 @@ const Options = Module("options", {
|
|||||||
let prefix = opt.prefix;
|
let prefix = opt.prefix;
|
||||||
|
|
||||||
if (context.filter.indexOf("=") == -1) {
|
if (context.filter.indexOf("=") == -1) {
|
||||||
if (prefix)
|
if (false && prefix)
|
||||||
context.filters.push(function ({ item: opt }) opt.type == "boolean" || prefix == "inv" && opt.values instanceof Array);
|
context.filters.push(function ({ item }) item.type == "boolean" || prefix == "inv" && isarray(item.values));
|
||||||
return completion.option(context, opt.scope);
|
return completion.option(context, opt.scope, prefix);
|
||||||
}
|
}
|
||||||
else if (prefix == "no")
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (prefix)
|
|
||||||
context.advance(prefix.length);
|
|
||||||
|
|
||||||
let option = opt.option;
|
let option = opt.option;
|
||||||
context.advance(context.filter.indexOf("=") + 1);
|
context.advance(context.filter.indexOf("=") + 1);
|
||||||
@@ -1155,17 +1138,33 @@ const Options = Module("options", {
|
|||||||
if (opt.get || opt.reset || !option || prefix)
|
if (opt.get || opt.reset || !option || prefix)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!opt.value) {
|
if (!opt.value && !opt.operator && !opt.invert) {
|
||||||
context.fork("default", 0, this, function (context) {
|
context.fork("default", 0, this, function (context) {
|
||||||
context.title = ["Extra Completions"];
|
context.title = ["Extra Completions"];
|
||||||
context.completions = [
|
context.completions = [
|
||||||
[option.value, "Current value"],
|
[option.value, "Current value"],
|
||||||
[option.defaultValue, "Default value"]
|
[option.defaultValue, "Default value"]
|
||||||
].filter(function (f) f[0] != "");
|
].filter(function (f) f[0] != "" && f[0].length < 200);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return context.fork("values", 0, completion, "optionValue", opt.name, opt.operator);
|
let optcontext = context.fork("values");
|
||||||
|
completion.optionValue(optcontext, opt.name, opt.operator);
|
||||||
|
|
||||||
|
// Fill in the current values if we're removing
|
||||||
|
if (opt.operator == "-" && isarray(opt.values)) {
|
||||||
|
let have = set([i.text for (i in context.allItems)]);
|
||||||
|
context = context.fork("current-values", 0);
|
||||||
|
context.anchored = optcontext.anchored
|
||||||
|
context.maxItems = optcontext.maxItems
|
||||||
|
|
||||||
|
context.filters.push(function (i) !set.has(have, i.text));
|
||||||
|
completion.optionValue(context, opt.name, opt.operator, null,
|
||||||
|
function (context) {
|
||||||
|
context.generate = function () option.values.map(function (o) [o, ""])
|
||||||
|
});
|
||||||
|
context.title = ["Current values"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
commands.add(["let"],
|
commands.add(["let"],
|
||||||
@@ -1321,17 +1320,21 @@ const Options = Module("options", {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
completion: function () {
|
completion: function () {
|
||||||
completion.option = function option(context, scope) {
|
completion.option = function option(context, scope, prefix) {
|
||||||
context.title = ["Option"];
|
context.title = ["Option"];
|
||||||
context.keys = { text: "names", description: "description" };
|
context.keys = { text: "names", description: "description" };
|
||||||
context.completions = options;
|
context.completions = options;
|
||||||
|
if (prefix == "inv")
|
||||||
|
context.keys.text = function (opt)
|
||||||
|
opt.type == "boolean" || isarray(opt.values) ? opt.names.map(function (n) "inv" + n)
|
||||||
|
: opt.names;
|
||||||
if (scope)
|
if (scope)
|
||||||
context.filters.push(function ({ item: opt }) opt.scope & scope);
|
context.filters.push(function ({ item }) item.scope & scope);
|
||||||
};
|
};
|
||||||
|
|
||||||
completion.optionValue = function (context, name, op, curValue) {
|
completion.optionValue = function (context, name, op, curValue, completer) {
|
||||||
let opt = options.get(name);
|
let opt = options.get(name);
|
||||||
let completer = opt.completer;
|
completer = completer || opt.completer;
|
||||||
if (!completer)
|
if (!completer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1372,31 +1375,24 @@ const Options = Module("options", {
|
|||||||
context.advance(context.filter.length - len);
|
context.advance(context.filter.length - len);
|
||||||
|
|
||||||
context.title = ["Option Value"];
|
context.title = ["Option Value"];
|
||||||
let completions = completer(context);
|
|
||||||
if (!isarray(completions))
|
|
||||||
completions = array(completions).__proto__;
|
|
||||||
if (!completions)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Not Vim compatible, but is a significant enough improvement
|
// Not Vim compatible, but is a significant enough improvement
|
||||||
// that it's worth breaking compatibility.
|
// that it's worth breaking compatibility.
|
||||||
if (isarray(newValues)) {
|
if (isarray(newValues)) {
|
||||||
completions = completions.filter(function (val) newValues.indexOf(val[0]) == -1);
|
context.filters.push(function (i) newValues.indexOf(i.text) == -1);
|
||||||
switch (op) {
|
if (op == "+")
|
||||||
case "+":
|
context.filters.push(function (i) curValues.indexOf(i.text) == -1);
|
||||||
completions = completions.filter(function (val) curValues.indexOf(val[0]) == -1);
|
if (op == "-")
|
||||||
break;
|
context.filters.push(function (i) curValues.indexOf(i.text) > -1);
|
||||||
case "-":
|
|
||||||
completions = completions.filter(function (val) curValues.indexOf(val[0]) > -1);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
context.completions = completions;
|
let res = completer.call(opt, context);
|
||||||
|
if (res)
|
||||||
|
context.completions = res;
|
||||||
};
|
};
|
||||||
|
|
||||||
completion.preference = function preference(context) {
|
completion.preference = function preference(context) {
|
||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.title = [config.hostApplication + " Preference", "Value"];
|
context.title = [config.host + " Preference", "Value"];
|
||||||
context.keys = { text: function (item) item, description: function (item) options.getPref(item) };
|
context.keys = { text: function (item) item, description: function (item) options.getPref(item) };
|
||||||
context.completions = options.allPrefs();
|
context.completions = options.allPrefs();
|
||||||
};
|
};
|
||||||
@@ -1404,14 +1400,14 @@ const Options = Module("options", {
|
|||||||
javascript: function () {
|
javascript: function () {
|
||||||
JavaScript.setCompleter(this.get, [function () ([o.name, o.description] for (o in options))]);
|
JavaScript.setCompleter(this.get, [function () ([o.name, o.description] for (o in options))]);
|
||||||
JavaScript.setCompleter([this.getPref, this.safeSetPref, this.setPref, this.resetPref, this.invertPref],
|
JavaScript.setCompleter([this.getPref, this.safeSetPref, this.setPref, this.resetPref, this.invertPref],
|
||||||
[function () options.allPrefs().map(function (pref) [pref, ""])]);
|
[function (context) (context.anchored=false, options.allPrefs().map(function (pref) [pref, ""]))]);
|
||||||
},
|
},
|
||||||
sanitizer: function () {
|
sanitizer: function () {
|
||||||
sanitizer.addItem("options", {
|
sanitizer.addItem("options", {
|
||||||
description: "Options containing hostname data",
|
description: "Options containing hostname data",
|
||||||
action: function (timespan, host) {
|
action: function (timespan, host) {
|
||||||
if (host)
|
if (host)
|
||||||
for (let opt in values(options._optionHash))
|
for (let opt in values(options._options))
|
||||||
if (timespan.contains(opt.lastSet * 1000) && opt.domains)
|
if (timespan.contains(opt.lastSet * 1000) && opt.domains)
|
||||||
try {
|
try {
|
||||||
opt.values = opt.filterDomain(host, opt.values);
|
opt.values = opt.filterDomain(host, opt.values);
|
||||||
@@ -1421,12 +1417,12 @@ const Options = Module("options", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
privateEnter: function () {
|
privateEnter: function () {
|
||||||
for (let opt in values(options._optionHash))
|
for (let opt in values(options._options))
|
||||||
if (opt.privateData && (!callable(opt.privateData) || opt.privateData(opt.values)))
|
if (opt.privateData && (!callable(opt.privateData) || opt.privateData(opt.values)))
|
||||||
opt.oldValue = opt.value;
|
opt.oldValue = opt.value;
|
||||||
},
|
},
|
||||||
privateLeave: function () {
|
privateLeave: function () {
|
||||||
for (let opt in values(options._optionHash))
|
for (let opt in values(options._options))
|
||||||
if (opt.oldValue != null) {
|
if (opt.oldValue != null) {
|
||||||
opt.value = opt.oldValue;
|
opt.value = opt.oldValue;
|
||||||
opt.oldValue = null;
|
opt.oldValue = null;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -26,7 +26,7 @@ const QuickMarks = Module("quickmarks", {
|
|||||||
*/
|
*/
|
||||||
add: function add(qmark, location) {
|
add: function add(qmark, location) {
|
||||||
this._qmarks.set(qmark, location);
|
this._qmarks.set(qmark, location);
|
||||||
dactyl.echomsg("Added Quick Mark '" + qmark + "': " + location, 1);
|
dactyl.echomsg({ domains: [util.getHost(location)], message: "Added Quick Mark '" + qmark + "': " + location }, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -14,8 +14,9 @@ const StatusLine = Module("statusline", {
|
|||||||
this._statusBar.collapsed = true; // it is later restored unless the user sets laststatus=0
|
this._statusBar.collapsed = true; // it is later restored unless the user sets laststatus=0
|
||||||
|
|
||||||
// our status bar fields
|
// our status bar fields
|
||||||
this.widgets = dict(["status", "url", "inputbuffer", "progress", "tabcount", "bufferposition", "zoomlevel"].map(
|
this.widgets = array(["status", "url", "inputbuffer", "progress", "tabcount", "bufferposition", "zoomlevel"]
|
||||||
function (field) [field, document.getElementById("dactyl-statusline-field-" + field)]));
|
.map(function (field) [field, document.getElementById("dactyl-statusline-field-" + field)]))
|
||||||
|
.toObject();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +37,7 @@ const StatusLine = Module("statusline", {
|
|||||||
insecure: "StatusLine"
|
insecure: "StatusLine"
|
||||||
};
|
};
|
||||||
|
|
||||||
this._statusBar.setAttributeNS(NS.uri, "highlight", highlightGroup[type]);
|
highlight.highlightNode(this._statusBar, highlightGroup[type]);
|
||||||
},
|
},
|
||||||
|
|
||||||
// update all fields of the statusline
|
// update all fields of the statusline
|
||||||
@@ -115,8 +116,8 @@ const StatusLine = Module("statusline", {
|
|||||||
}
|
}
|
||||||
if (modules.bookmarks) {
|
if (modules.bookmarks) {
|
||||||
if (bookmarks.isBookmarked(buffer.URL))
|
if (bookmarks.isBookmarked(buffer.URL))
|
||||||
modified += "\u2764"; // a heart symbol: ❤
|
modified += UTF8("❤");
|
||||||
//modified += "\u2665"; // a heart symbol: ♥
|
//modified += UTF8("♥");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modified)
|
if (modified)
|
||||||
@@ -206,7 +207,9 @@ const StatusLine = Module("statusline", {
|
|||||||
let win = document.commandDispatcher.focusedWindow;
|
let win = document.commandDispatcher.focusedWindow;
|
||||||
if (!win)
|
if (!win)
|
||||||
return;
|
return;
|
||||||
percent = win.scrollMaxY == 0 ? -1 : win.scrollY / win.scrollMaxY;
|
win.scrollY;
|
||||||
|
percent = win.scrollY == 0 ? 0 : // This prevents a forced rendering
|
||||||
|
win.scrollMaxY == 0 ? -1 : win.scrollY / win.scrollMaxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
let bufferPositionStr = "";
|
let bufferPositionStr = "";
|
||||||
@@ -255,11 +258,11 @@ const StatusLine = Module("statusline", {
|
|||||||
{
|
{
|
||||||
setter: function setter(value) {
|
setter: function setter(value) {
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
document.getElementById("status-bar").collapsed = true;
|
statusline._statusBar.collapsed = true;
|
||||||
else if (value == 1)
|
else if (value == 1)
|
||||||
dactyl.echoerr("show status line only with > 1 window not implemented yet");
|
dactyl.echoerr("show status line only with > 1 window not implemented yet");
|
||||||
else
|
else
|
||||||
document.getElementById("status-bar").collapsed = false;
|
statusline._statusBar.collapsed = false;
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -21,6 +21,13 @@ const Tabs = Module("tabs", {
|
|||||||
this._lastBufferSwitchArgs = "";
|
this._lastBufferSwitchArgs = "";
|
||||||
this._lastBufferSwitchSpecial = true;
|
this._lastBufferSwitchSpecial = true;
|
||||||
|
|
||||||
|
let fragment = dactyl.has("MacUnix") ? "tab-mac" : "tab";
|
||||||
|
this.tabBinding = styles.addSheet(true, "tab-binding", "chrome://browser/content/browser.xul",
|
||||||
|
".tabbrowser-tab { -moz-binding: url(chrome://dactyl/content/bindings.xml#" + fragment + ") !important; }" +
|
||||||
|
// FIXME: better solution for themes?
|
||||||
|
".tabbrowser-tab[busy] > .tab-icon > .tab-icon-image { list-style-image: url('chrome://global/skin/icons/loading_16.png') !important; }",
|
||||||
|
false, true);
|
||||||
|
|
||||||
// hide tabs initially to prevent flickering when 'stal' would hide them
|
// hide tabs initially to prevent flickering when 'stal' would hide them
|
||||||
// on startup
|
// on startup
|
||||||
if (config.hasTabbrowser)
|
if (config.hasTabbrowser)
|
||||||
@@ -74,22 +81,6 @@ const Tabs = Module("tabs", {
|
|||||||
return store.options;
|
return store.options;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {boolean} Whether the tab numbering XBL binding has been
|
|
||||||
* applied.
|
|
||||||
*/
|
|
||||||
get tabsBound() Boolean(styles.get(true, "tab-binding")),
|
|
||||||
set tabsBound(val) {
|
|
||||||
let fragment = dactyl.has("MacUnix") ? "tab-mac" : "tab";
|
|
||||||
if (!val)
|
|
||||||
styles.removeSheet(true, "tab-binding");
|
|
||||||
else if (!this.tabsBound)
|
|
||||||
styles.addSheet(true, "tab-binding", "chrome://browser/content/browser.xul",
|
|
||||||
".tabbrowser-tab { -moz-binding: url(chrome://dactyl/content/bindings.xml#" + fragment + ") !important; }" +
|
|
||||||
// FIXME: better solution for themes?
|
|
||||||
".tabbrowser-tab[busy] > .tab-icon > .tab-icon-image { list-style-image: url('chrome://global/skin/icons/loading_16.png') !important; }");
|
|
||||||
},
|
|
||||||
|
|
||||||
get visibleTabs() config.tabbrowser.visibleTabs || this.allTabs.filter(function (tab) !tab.hidden),
|
get visibleTabs() config.tabbrowser.visibleTabs || this.allTabs.filter(function (tab) !tab.hidden),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -721,7 +712,7 @@ const Tabs = Module("tabs", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["quita[ll]", "qa[ll]"],
|
commands.add(["quita[ll]", "qa[ll]"],
|
||||||
"Quit " + config.name,
|
"Quit " + config.appname,
|
||||||
function (args) { dactyl.quit(false, args.bang); }, {
|
function (args) { dactyl.quit(false, args.bang); }, {
|
||||||
argCount: "0",
|
argCount: "0",
|
||||||
bang: true
|
bang: true
|
||||||
@@ -831,7 +822,7 @@ const Tabs = Module("tabs", {
|
|||||||
argCount: "+",
|
argCount: "+",
|
||||||
completer: function (context, args) {
|
completer: function (context, args) {
|
||||||
if (args.completeArg == 0) {
|
if (args.completeArg == 0) {
|
||||||
context.filters.push(function ({ item: win }) win != window);
|
context.filters.push(function ({ item }) item != window);
|
||||||
completion.window(context);
|
completion.window(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -6,8 +6,8 @@
|
|||||||
<document
|
<document
|
||||||
name="all"
|
name="all"
|
||||||
title="&dactyl.appname; All"
|
title="&dactyl.appname; All"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<tags>all</tags>
|
<tags>all</tags>
|
||||||
|
|
||||||
<toc/>
|
<toc/>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<document
|
<document
|
||||||
name="autocommands"
|
name="autocommands"
|
||||||
title="&dactyl.appname; Autocommands"
|
title="&dactyl.appname; Autocommands"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="autocommands">Automatic commands</h1>
|
<h1 tag="autocommands">Automatic commands</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
@@ -18,48 +18,57 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:au :autocmd</tags>
|
<tags>:au :autocmd</tags>
|
||||||
<spec>:au[tocmd]</spec>
|
<spec>:au<oa>tocmd</oa><oa>!</oa> <oa>events</oa> <oa>pat</oa> <oa>cmd</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Execute commands automatically on events.</p>
|
<p>Execute commands automatically on events.</p>
|
||||||
|
|
||||||
<p><ex>:au[tocmd]</ex> <a>event</a> <a>pat</a> <a>cmd</a></p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If the <em>-javascript</em> (short name <em>-js</em>)
|
When <oa>cmd</oa> is not given, list all commands
|
||||||
option is specified, <a>cmd</a> is executed as JavaScript
|
defined for the given <oa>events</oa> and <oa>pat</oa>.
|
||||||
code, with any supplied arguments available as
|
When <oa>!</oa> is given, delete the matching commands
|
||||||
variables.
|
rather than listing them.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Add <a>cmd</a> to the list of commands &dactyl.appname; will execute on <a>event</a> for a URL matching <a>pat</a>:</p>
|
<p>
|
||||||
|
When <oa>cmd</oa> is given, add it to the list of
|
||||||
|
commands to be executed when <oa>events</oa> occur for
|
||||||
|
pages matching the regular expression <oa>pat</oa>. If
|
||||||
|
the <em>-javascript</em> (short name <em>-js</em>)
|
||||||
|
option is given, <oa>cmd</oa> is interperated as
|
||||||
|
JavaScript code. Otherwise, it is interperated as an ex
|
||||||
|
command.
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<note>
|
||||||
<li><ex>:autocmd[!]</ex> <a>events</a> <a>pat</a>: list/remove autocommands filtered by <a>events</a> and <a>pat</a></li>
|
This behavior differs from Vim's implementation in that
|
||||||
<li><ex>:autocmd[!]</ex> <a>events</a>: list/remove autocommands matching <a>events</a></li>
|
<oa>pat</oa> is a regular expression rather than a glob.
|
||||||
<li><ex>:autocmd[!]</ex> <a>pat</a>: list/remove autocommands matching <a>pat</a></li>
|
</note>
|
||||||
<li><ex>:autocmd[!]</ex>: list/remove all autocommands</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>Available <a>events</a>:</p>
|
<p>Available <oa>events</oa>:</p>
|
||||||
|
|
||||||
<dl tag="autocommand-list"/>
|
<dl tag="autocommand-list"/>
|
||||||
|
|
||||||
<p><a>pat</a> is a regular expression, use <tt>.*</tt> if you want to match all URLs.</p>
|
<p>
|
||||||
|
For ex <oa>cmd</oa>s, the following keywords are
|
||||||
<note>This differs from Vim which uses a glob rather than a regex for <a>pat</a>.</note>
|
replaced with the appropriate value before the commands
|
||||||
|
are executed. For JavaScript commands, they may be
|
||||||
<p>The following keywords are available where relevant:</p>
|
accessed as ordinary variables, sans angle brackets.
|
||||||
|
</p>
|
||||||
|
|
||||||
<dl tag="autocommand-args"/>
|
<dl tag="autocommand-args"/>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:doautoa :doautoall</tags>
|
<tags>:doautoa :doautoall</tags>
|
||||||
<spec>:doautoa[ll] <a>event</a> <oa>url</oa></spec>
|
<spec>:doautoa<oa>ll</oa> <a>event</a> <oa>url</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Apply the autocommands matching the specified URL to all buffers. If no
|
Apply all <a>event</a> autocommands matching the
|
||||||
|
specified <oa>url</oa> to all buffers. If no
|
||||||
<oa>url</oa> is specified use the current URL.
|
<oa>url</oa> is specified use the current URL.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -67,11 +76,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:do :doautocmd</tags>
|
<tags>:do :doautocmd</tags>
|
||||||
<spec>:do[autocmd] <a>event</a> <oa>url</oa></spec>
|
<spec>:do<oa>autocmd</oa> <a>event</a> <oa>url</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Apply the autocommands matching the specified URL to the current buffer. If no
|
Apply all autocommands matching the specified
|
||||||
<oa>url</oa> is specified use the current URL.
|
<oa>url</oa> to the current buffer. If no <oa>url</oa>
|
||||||
|
is specified use the current URL.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -91,7 +101,7 @@
|
|||||||
|
|
||||||
<code><!-- Why is the XSLT processor mangling newlines? -->
|
<code><!-- Why is the XSLT processor mangling newlines? -->
|
||||||
<ex>:autocmd LocationChange .* :set editor=<str>gvim -f</str></ex>
|
<ex>:autocmd LocationChange .* :set editor=<str>gvim -f</str></ex>
|
||||||
<ex>:autocmd LocationChange mail\\.google\\.com :set editor=<str>gvim -f -c 'set ft=mail'</str></ex>
|
<ex>:autocmd LocationChange 'mail\.google\.com' :set editor=<str>gvim -f -c 'set ft=mail'</str></ex>
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
@@ -6,26 +6,27 @@
|
|||||||
<document
|
<document
|
||||||
name="browsing"
|
name="browsing"
|
||||||
title="&dactyl.appname; Browsing"
|
title="&dactyl.appname; Browsing"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="surfing browsing">Browsing</h1>
|
<h1 tag="surfing browsing">Browsing</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
&dactyl.appname; overrides nearly all &dactyl.host; keys in order to make browsing more
|
<h2 tag="bypassing-&dactyl.name;">Bypassing &dactyl.appname;</h2>
|
||||||
pleasant for Vim users. On the rare occasions when you want to pass a keystroke
|
|
||||||
to &dactyl.host;, or to the web page, and have it retain its original meaning you
|
&dactyl.appname; overrides nearly all &dactyl.host; keys in order to
|
||||||
have 2 possibilities:
|
make browsing more pleasant for Vim users. On the occasions when you
|
||||||
|
want to bypass &dactyl.appname;'s key handling and pass keys directly to
|
||||||
|
&dactyl.host; or to a web page, you have two options:
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[pass-through <C-z> CTRL-Z]]></tags>
|
<tags><![CDATA[pass-through <C-z> CTRL-Z]]></tags>
|
||||||
<spec>CTRL-Z</spec>
|
<spec>CTRL-Z</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Disable all &dactyl.appname; keys except <k name="Esc"/> and pass them to the next event
|
Pass all keys except for <k name="Esc"/> directly to
|
||||||
handler. This is especially useful if JavaScript controlled forms (e.g., the
|
&dactyl.host;. When <k name="Esc"/> is pressed,
|
||||||
RichEdit form fields of Gmail) don't work anymore. To exit this mode, press
|
resume normal key handling. This is especially useful
|
||||||
<k name="Esc"/>. If you also need to pass <k name="Esc"/> in this mode to the web page,
|
for web sites which make heavy use of key bindings.
|
||||||
prepend it with <k name="C-v"/>.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -36,11 +37,7 @@ have 2 possibilities:
|
|||||||
<spec>CTRL-V</spec>
|
<spec>CTRL-V</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
If you only need to pass a single key to a JavaScript form field or another
|
Pass the next key press directly to &dactyl.host;.
|
||||||
extension prefix the key with <k name="C-v"/>. Also works to unshadow &dactyl.host;
|
|
||||||
shortcuts like <k name="C-o"/> which are otherwise hidden in &dactyl.appname;. When
|
|
||||||
&dactyl.appname; mode is temporarily disabled with <k name="C-z"/>, <k name="C-v"/> will pass
|
|
||||||
the next key to &dactyl.appname; instead of the web page.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -54,52 +51,55 @@ have 2 possibilities:
|
|||||||
<spec>o</spec>
|
<spec>o</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Open one or more URLs in the current tab.
|
Open a single URL in the current tab, or multiple URLs
|
||||||
Multiple URLs can be separated with <o>urlseparator</o> (default: ", " Note that the
|
in the current tab and background tabs. URLs may be
|
||||||
space after the comma is required.)
|
separated with <o>urlseparator</o>, in which case the
|
||||||
The first URL is opened in the current tab, and all other URLs are
|
first URL is opened in the current tab and the rest are
|
||||||
opened in new tabs.
|
opened in new background tabs.
|
||||||
Each token is analyzed and in this order:
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Each URL may be one of the following:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
Opened as a local file if it is an existing relative or absolute filename.
|
A local filename, if it begins with <em>/</em>,
|
||||||
<ul>
|
<em>./</em>, or <em>~/</em> and the specified file
|
||||||
<li><ex>:open /etc/fstab</ex> shows the file system table.</li>
|
exists.
|
||||||
<li><ex>:open ../other/foo.html</ex> in your home directory opens <tt>/home/other/foo.html</tt></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Opened with the specified search engine if the
|
<p>
|
||||||
token looks like a search string and the first word
|
A search or bookmark keyword, or a search engine
|
||||||
is the name of a search engine (
|
name, followed by search arguments.
|
||||||
<ex>:open wikipedia linus torvalds</ex> opens the Wikipedia entry for
|
</p>
|
||||||
linus torvalds). The short name of a search engine
|
<example><ex>:open wikipedia Linus Torvalds</ex></example>
|
||||||
is automatically guessed from its name. If you want
|
<p>
|
||||||
to set a custom name, you can change it with
|
Search engines can be edited via
|
||||||
<ex>:dialog searchengines</ex>.
|
<ex>:dialog searchengines</ex> and search
|
||||||
|
keywords may be added by right clicking any
|
||||||
|
search box and selecting <str>Add a Keyword for
|
||||||
|
this Search</str>.
|
||||||
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Opened with the default search engine or keyword
|
<p>
|
||||||
(specified with the <o>defsearch</o> option) if the first
|
Any search string which does not look like a URL or
|
||||||
word is no search engine (<ex>:open linus torvalds</ex>
|
hostname, which will be passed to the default
|
||||||
opens a Google search for linus torvalds).
|
search engine (see <o>defsearch</o>).
|
||||||
|
</p>
|
||||||
|
<example><ex>:open Linus Torvalds</ex></example>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Passed directly to &dactyl.host; in all other cases
|
Any other value is passed directly &dactyl.host; and
|
||||||
(<ex>:open www.osnews.com, www.slashdot.org</ex>
|
must be a valid URL or hostname.
|
||||||
opens OSNews in the current, and Slashdot in a new
|
|
||||||
background tab).
|
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
You can use <ex>:open -tags linux torvalds<k name="Tab"/></ex> to complete bookmarks with
|
<ex>:open</ex> provides powerful URL completion from
|
||||||
tag "linux" and which contain "torvalds". Note that -tags support is only
|
several possible sources, which can be adjusted via the
|
||||||
available for tab completion, not for the actual command.
|
<o>complete</o> option.
|
||||||
The items which are completed on <k name="Tab"/> are specified in the <o>complete</o>
|
|
||||||
option.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -111,8 +111,9 @@ have 2 possibilities:
|
|||||||
<spec>t</spec>
|
<spec>t</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Just like <ex>:open</ex> but also uses a new tab for the first URL. When
|
Like <ex>:open</ex>, but all arguments are opened in new
|
||||||
used with <oa>!</oa>, the <em>tabopen</em> value of the <o>activate</o> option is negated.
|
tabs. The first new tab is activated if <o>activate</o>
|
||||||
|
contains <str>tabopen</str> or <oa>!</oa> is provided.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -121,10 +122,9 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>T</tags>
|
<tags>T</tags>
|
||||||
<spec>T</spec>
|
<spec>T</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>
|
||||||
Show a <ex>:tabopen</ex> prompt containing the current URL. Useful if you want to
|
Open a <ex>:tabopen</ex> prompt followed by the current URL.
|
||||||
go somewhere by editing the URL of the current page.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -135,9 +135,9 @@ have 2 possibilities:
|
|||||||
<spec>:<oa>count</oa>tabdu<oa>plicate</oa><oa>!</oa></spec>
|
<spec>:<oa>count</oa>tabdu<oa>plicate</oa><oa>!</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Duplicates current tab <oa>count</oa> times. Uses <em>tabopen</em> value of the <o>activate</o>
|
Duplicates current tab <oa>count</oa> times. The first
|
||||||
option to determine if the last cloned tab should be activated. When used with
|
new tab is activated if <o>activate</o> contains
|
||||||
<oa>!</oa>, <em>tabopen</em> value is negated.
|
<str>tabopen</str> or <oa>!</oa> is provided.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -146,10 +146,9 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>O</tags>
|
<tags>O</tags>
|
||||||
<spec>O</spec>
|
<spec>O</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>
|
||||||
Show an <ex>:open</ex> prompt containing the current URL. Useful if you want to
|
Open an <ex>:open</ex> prompt followed by the current URL.
|
||||||
go somewhere by editing the URL of the current page.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -160,7 +159,10 @@ have 2 possibilities:
|
|||||||
<spec>:wino<oa>pen</oa><oa>!</oa> <oa>arg1</oa>, <oa>arg2</oa>, …</spec>
|
<spec>:wino<oa>pen</oa><oa>!</oa> <oa>arg1</oa>, <oa>arg2</oa>, …</spec>
|
||||||
<spec>w</spec>
|
<spec>w</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Just like <ex>:tabopen</ex> but opens the resulting web page(s) in a new window.</p>
|
<p>
|
||||||
|
Like <ex>:tabopen</ex>, but all arguments are opened in
|
||||||
|
a single new window.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -168,10 +170,9 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>W</tags>
|
<tags>W</tags>
|
||||||
<spec>W</spec>
|
<spec>W</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>
|
||||||
Open one or more URLs in a new window based on current location. Works like
|
Open a <ex>:winopen</ex> prompt followed by the current URL.
|
||||||
<k>w</k> but preselects current URL in the <ex>:winopen</ex> query.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -179,13 +180,14 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<MiddleMouse> p]]></tags>
|
<tags><![CDATA[<MiddleMouse> p]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec>p</spec>
|
<spec>p</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Open (put) a URL based on the current clipboard contents in the current buffer.
|
Open (put) a URL based on the current clipboard
|
||||||
You can also just select (for non-X11 users: copy) some non-URL text, and
|
contents, or, on X11 systems, the currently selected
|
||||||
search for it with the default search engine or keyword (specified by the
|
text. All white space is stripped from the selection and
|
||||||
<o>defsearch</o> option) with <k>p</k>.
|
it is opened in the same manner as <ex>:open</ex>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -193,14 +195,14 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>P</tags>
|
<tags>P</tags>
|
||||||
|
<strut/>
|
||||||
<spec>P</spec>
|
<spec>P</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Open (put) a URL based on the current clipboard contents in a new buffer. Works
|
Open (put) a URL based on the current clipboard contents
|
||||||
like <k>p</k> but opens a new tab.
|
in a new buffer. Works like <k>p</k> but opens a new
|
||||||
</p>
|
tab. The new tab is activated if <o>activate</o>
|
||||||
<p>
|
contains <str>paste</str>.
|
||||||
Whether the new buffer is activated, depends on the <o>activate</o> option.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -208,11 +210,13 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gP</tags>
|
<tags>gP</tags>
|
||||||
|
<strut/>
|
||||||
<spec>gP</spec>
|
<spec>gP</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Open (put) a URL based on the current clipboard contents in a new buffer.
|
Open (put) a URL based on the current clipboard contents
|
||||||
Works like <k>P</k> but inverts the <o>activate</o> option.
|
in a new buffer. The new tab is activated if <o>activate</o>
|
||||||
|
does <em>not</em> contain <str>paste</str>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -220,12 +224,14 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-x>]]></tags>
|
<tags><![CDATA[<C-x>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-x></spec>
|
<spec><oa>count</oa><C-x></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Decrements the last number in URL by 1, or by <oa>count</oa> if given. Negative
|
Decrements the last number in URL by 1, or by
|
||||||
numbers are not supported, as this is not generally useful, so the number cannot
|
<oa>count</oa> if given. Negative numbers are not
|
||||||
be decremented past 0.
|
supported as trailing numbers in URLs are often preceded
|
||||||
|
by hyphens.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -233,9 +239,13 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-a>]]></tags>
|
<tags><![CDATA[<C-a>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-a></spec>
|
<spec><oa>count</oa><C-a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Increments the last number in URL by 1, or by <oa>count</oa> if given.</p>
|
<p>
|
||||||
|
Increments the last number in URL by 1, or by
|
||||||
|
<oa>count</oa> if given.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -243,11 +253,8 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>~</tags>
|
<tags>~</tags>
|
||||||
<spec>~</spec>
|
<spec>~</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>Open home directory. Equivalent to <ex>:open ~/</ex></p>
|
||||||
Open home directory. You can also use the hints and have the probably fastest
|
|
||||||
file browser on earth. :)
|
|
||||||
</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -261,9 +268,10 @@ have 2 possibilities:
|
|||||||
<spec>CTRL-o</spec>
|
<spec>CTRL-o</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go <oa>count</oa> pages back in the browser history. If <oa>url</oa> is specified go back to
|
Go <oa>count</oa> pages back in the browser history. If
|
||||||
the first matching URL. The special version <ex>:back!</ex> goes to the beginning
|
<oa>url</oa> is specified go back to the first matching
|
||||||
of the browser history.
|
URL. The special version <ex>:back!</ex> goes to the
|
||||||
|
beginning of the browser history.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -276,9 +284,10 @@ have 2 possibilities:
|
|||||||
<spec>CTRL-i</spec>
|
<spec>CTRL-i</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go <oa>count</oa> pages forward in the browser history. If <oa>url</oa> is specified go
|
Go <oa>count</oa> pages forward in the browser history.
|
||||||
forward to the first matching URL. The special version <ex>:forward!</ex> goes to
|
If <oa>url</oa> is specified go forward to the first
|
||||||
the end of the browser history.
|
matching URL. The special version <ex>:forward!</ex>
|
||||||
|
goes to the end of the browser history.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -288,11 +297,12 @@ have 2 possibilities:
|
|||||||
<tags>:ju :jumps</tags>
|
<tags>:ju :jumps</tags>
|
||||||
<spec>:ju<oa>mps</oa></spec>
|
<spec>:ju<oa>mps</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>List all jumps aka current tab's history aka session history.</p>
|
<p>List all jumps, i.e., the current tab's session history.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Current history position is marked with >, jump numbers are counters to be used
|
Current history position is marked with <em>></em>.
|
||||||
with <ex>:back</ex> (above zero record) or <ex>:forward</ex> (below zero record).
|
Jump numbers may be used as counts for with
|
||||||
|
<ex>:back</ex> or <ex>:forward</ex>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -301,7 +311,7 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>gh</tags>
|
<tags>gh</tags>
|
||||||
<spec>gh</spec>
|
<spec>gh</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Go home. Opens the homepage in the current tab.</p>
|
<p>Go home. Opens the homepage in the current tab.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -309,11 +319,13 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gH</tags>
|
<tags>gH</tags>
|
||||||
|
<strut/>
|
||||||
<spec>gH</spec>
|
<spec>gH</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go home in a new tab. Opens the homepage in a new tab. Whether the new tab is
|
Go home in a new tab. Opens the homepage in a new tab.
|
||||||
activated or not depends on the <o>activate</o> option.
|
The new tab is activated if <o>activate</o> contains
|
||||||
|
<str>homepage</str>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -322,13 +334,13 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>gu</tags>
|
<tags>gu</tags>
|
||||||
<spec><oa>count</oa>gu</spec>
|
<spec><oa>count</oa>gu</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Go to <oa>count</oa>th parent directory.</p>
|
<p>Go to <oa>count</oa>th parent directory.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<k>2gu</k> on
|
For example, at the URL
|
||||||
<tt>http://www.example.com/dir1/dir2/file.htm</tt> opens
|
<tt>http://www.example.com/dir1/dir2/file.htm</tt>,
|
||||||
<tt>http://www.example.com/dir1/</tt>.
|
<k>2gu</k> opens <tt>http://www.example.com/dir1/</tt>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -337,13 +349,13 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>gU</tags>
|
<tags>gU</tags>
|
||||||
<spec>gU</spec>
|
<spec>gU</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Go to the root of the web site.</p>
|
<p>Go to the root of the web site.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<k>gU</k> on <tt>http://www.example.com/dir1/dir2/file.htm</tt> opens
|
For example, at the URL
|
||||||
<tt>http://www.example.com/</tt>.
|
<tt>http://www.example.com/dir1/dir2/file.htm</tt>,
|
||||||
When browsing a local directory, it goes to the root directory.
|
<k>gU</k> opens <tt>http://www.example.com/</tt>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -354,8 +366,8 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>r</tags>
|
<tags>r</tags>
|
||||||
<spec>r</spec>
|
<spec>r</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Force reloading of the current web page.</p>
|
<p>Reload the current web page.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -363,8 +375,8 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>R</tags>
|
<tags>R</tags>
|
||||||
<spec>R</spec>
|
<spec>R</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Force reloading of the current web page skipping the cache.</p>
|
<p>Reload the current web page without using the cache.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -374,8 +386,8 @@ have 2 possibilities:
|
|||||||
<spec>:re<oa>load</oa><oa>!</oa></spec>
|
<spec>:re<oa>load</oa><oa>!</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Reload current web page. Forces reloading of the current page. If <oa>!</oa> is given,
|
Reload current web page. If <oa>!</oa> is given, reload
|
||||||
skip the cache.
|
without using the cache.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -385,7 +397,10 @@ have 2 possibilities:
|
|||||||
<tags>:reloada :reloadall</tags>
|
<tags>:reloada :reloadall</tags>
|
||||||
<spec>:reloada<oa>ll</oa><oa>!</oa></spec>
|
<spec>:reloada<oa>ll</oa><oa>!</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Reload all pages. Forces reloading of all pages. If <oa>!</oa> is given, skip the cache.</p>
|
<p>
|
||||||
|
Reload all tabs. If <oa>!</oa> is given, reload without
|
||||||
|
using the cache.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -393,18 +408,11 @@ have 2 possibilities:
|
|||||||
<h2 tag="stopping">Stopping</h2>
|
<h2 tag="stopping">Stopping</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-c>]]></tags>
|
<tags><![CDATA[<C-c> :st :stop]]></tags>
|
||||||
<spec><C-c></spec>
|
<spec><C-c></spec>
|
||||||
<description>
|
<strut/>
|
||||||
<p>Stop loading the current web page.</p>
|
|
||||||
</description>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
|
|
||||||
<item>
|
|
||||||
<tags>:st :stop</tags>
|
|
||||||
<spec>:st<oa>op</oa></spec>
|
<spec>:st<oa>op</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Stop loading the current web page.</p>
|
<p>Stop loading the current web page.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -413,7 +421,7 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>:stopa :stopall</tags>
|
<tags>:stopa :stopall</tags>
|
||||||
<spec>:stopa<oa>ll</oa></spec>
|
<spec>:stopa<oa>ll</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Stop loading all web pages.</p>
|
<p>Stop loading all web pages.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -423,11 +431,14 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:w :write :sav :saveas</tags>
|
<tags>:w :write :sav :saveas</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:sav<oa>eas</oa><oa>!</oa> <oa>file</oa></spec>
|
<spec>:sav<oa>eas</oa><oa>!</oa> <oa>file</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Save current web page to disk. If <oa>file</oa> is omitted, save to the page's
|
Save current web page to disk. If <oa>file</oa> is
|
||||||
default filename. Existing documents will only be overwritten if <oa>!</oa> is given.
|
omitted, save to the page's default filename. Existing
|
||||||
|
documents will only be overwritten if <oa>!</oa> is
|
||||||
|
given.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -437,12 +448,12 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:q :quit</tags>
|
<tags>:q :quit</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:q<oa>uit</oa></spec>
|
<spec>:q<oa>uit</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Quit current tab. If this is the last tab in the window, close the window. If
|
Quit current tab. If this is the last tab in the window,
|
||||||
this was the last window, close &dactyl.appname;. When quitting &dactyl.appname;, the
|
close the window.
|
||||||
session is not stored.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -450,11 +461,12 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:qa :qall :quita :quitall</tags>
|
<tags>:qa :qall :quita :quitall</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:quita<oa>ll</oa></spec>
|
<spec>:quita<oa>ll</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Quit &dactyl.appname;. Quit &dactyl.appname;, no matter how many tabs/windows are open.
|
Quit &dactyl.appname;, no matter how many tabs/windows
|
||||||
The session is not stored.
|
are open. The session is not stored.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -463,8 +475,8 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>:wc :wclose :winc :winclose</tags>
|
<tags>:wc :wclose :winc :winclose</tags>
|
||||||
<spec>:winc<oa>lose</oa></spec>
|
<spec>:winc<oa>lose</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Close window.</p>
|
<p>Close the current window.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -472,8 +484,8 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>:winon :winonly</tags>
|
<tags>:winon :winonly</tags>
|
||||||
<spec>:winon<oa>ly</oa></spec>
|
<spec>:winon<oa>ly</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Close all other windows.</p>
|
<p>Close all windows but the current.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -481,14 +493,14 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>:xa :xall :wq :wqa :wqall</tags>
|
<tags>:xa :xall :wq :wqa :wqall</tags>
|
||||||
<spec>:wqa<oa>ll</oa></spec>
|
<spec>:wqa<oa>ll</oa></spec>
|
||||||
|
<strut/>
|
||||||
<spec>:xa<oa>ll</oa></spec>
|
<spec>:xa<oa>ll</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>Save the current session and quit.</p>
|
||||||
Save the session and quit. Quit &dactyl.appname;, no matter how many tabs/windows
|
<note>
|
||||||
are open. The session is stored. <ex>:wq</ex> is different from Vim, as it
|
Unlike Vim, <ex>:wq</ex> closes the entire window rather
|
||||||
closes the window instead of just one tab by popular demand. Complain on the
|
than just the current tab.
|
||||||
mailing list if you want to change that.
|
</note>
|
||||||
</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -496,7 +508,7 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>ZQ</tags>
|
<tags>ZQ</tags>
|
||||||
<spec>ZQ</spec>
|
<spec>ZQ</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Quit and don't save the session. Works like <ex>:qall</ex>.</p>
|
<p>Quit and don't save the session. Works like <ex>:qall</ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -505,10 +517,10 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>ZZ</tags>
|
<tags>ZZ</tags>
|
||||||
<spec>ZZ</spec>
|
<spec>ZZ</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>
|
||||||
Quit and save the session. Quit &dactyl.appname;, no matter how many tabs/windows
|
Quit &dactyl.appname; and save the session. Works like
|
||||||
are open. The session is stored. Works like <ex>:xall</ex>.
|
<ex>:xall</ex>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -518,9 +530,14 @@ have 2 possibilities:
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:chd :chdir :cd</tags>
|
<tags>:chd :chdir :cd</tags>
|
||||||
<spec>:cd <oa>-|path</oa></spec>
|
<strut/>
|
||||||
|
<spec>:cd <oa>path</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Change the current directory. <ex>:cd -</ex> changes to the last directory.</p>
|
<p>
|
||||||
|
Change the current directory. If <oa>path</oa> is
|
||||||
|
<em>-</em>, change to the previous directory. If it is
|
||||||
|
omitted, change to the home directory.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -528,7 +545,7 @@ have 2 possibilities:
|
|||||||
<item>
|
<item>
|
||||||
<tags>:pw :pwd</tags>
|
<tags>:pw :pwd</tags>
|
||||||
<spec>:pw<oa>d</oa></spec>
|
<spec>:pw<oa>d</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Print the current directory name.</p>
|
<p>Print the current directory name.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,23 +6,29 @@
|
|||||||
<document
|
<document
|
||||||
name="buffer"
|
name="buffer"
|
||||||
title="&dactyl.appname; Buffer"
|
title="&dactyl.appname; Buffer"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="buffer document">Buffer</h1>
|
<h1 tag="buffer document">Buffer</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
&dactyl.appname; holds exactly one buffer object for each tab. It is usually an
|
<p>
|
||||||
(X)HTML document with advanced features.
|
A buffer the container that holds the given web page, including
|
||||||
|
all of its history and frames. Each tab contains exactly one
|
||||||
|
buffer, and for most purposes the two terms are interchangable.
|
||||||
|
See <t>tabs</t> for more.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2 tag="buffer-information">Buffer information</h2>
|
<h2 tag="buffer-information">Buffer information</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-g>]]></tags>
|
<tags><![CDATA[<C-g>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><C-g></spec>
|
<spec><C-g></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Print the current file name. Also shows some additional file information like
|
Print the current file name along with basic page
|
||||||
file size or the last modified date.
|
information including last modification time, the number
|
||||||
|
of feeds present, and the page title.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -31,7 +37,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[g<C-g>]]></tags>
|
<tags><![CDATA[g<C-g>]]></tags>
|
||||||
<spec>g<C-g></spec>
|
<spec>g<C-g></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Print file information. Same as <ex>:pa<oa>geinfo</oa></ex>.</p>
|
<p>Print file information. Same as <ex>:pa<oa>geinfo</oa></ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -39,15 +45,20 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:pa :pageinfo</tags>
|
<tags>:pa :pageinfo</tags>
|
||||||
<spec>:pa<oa>geinfo</oa></spec>
|
<spec>:pa<oa>geinfo</oa> <oa>items</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Show various page information. See <ex>:help <o>pageinfo</o></ex> for available options.</p>
|
<p>
|
||||||
|
Show various page information. The information provided
|
||||||
|
is determined by the value of <o>pageinfo</o>, or
|
||||||
|
<oa>items</oa> if present.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gf</tags>
|
<tags>gf</tags>
|
||||||
|
<strut/>
|
||||||
<spec>gf</spec>
|
<spec>gf</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -60,12 +71,15 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gF</tags>
|
<tags>gF</tags>
|
||||||
|
<strut/>
|
||||||
<spec>gF</spec>
|
<spec>gF</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
View source with an external editor. Opens the source code of the current web
|
View source with an external editor. Opens the source
|
||||||
site with the external editor specified by the <o>editor</o> option. For now the
|
code of the current web site with the external editor
|
||||||
external editor must be able to download and open files from a remote URL.
|
specified by the <o>editor</o> option. The external
|
||||||
|
editor must be able to download and open files from a
|
||||||
|
remote URL.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -76,8 +90,9 @@
|
|||||||
<spec>:vie<oa>wsource</oa><oa>!</oa> <oa>url</oa></spec>
|
<spec>:vie<oa>wsource</oa><oa>!</oa> <oa>url</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
View source code of current document. If <oa>url</oa> is specified then view the
|
View source code of current document. If <oa>url</oa> is
|
||||||
source of that document. When <oa>!</oa> is given, it is opened with the external
|
specified then view the source of that document. When
|
||||||
|
<oa>!</oa> is given, it is opened with the external
|
||||||
editor.
|
editor.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -88,11 +103,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>^ 0</tags>
|
<tags>^ 0</tags>
|
||||||
|
<strut/>
|
||||||
<spec>0</spec>
|
<spec>0</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll to the absolute left of the document. Unlike in Vim, <k>0</k> and <k>^</k>
|
Scroll to the absolute left of the document. Unlike in
|
||||||
work exactly the same way.
|
Vim, <k>0</k> and <k>^</k> work exactly the same way.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -101,7 +117,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>$</tags>
|
<tags>$</tags>
|
||||||
<spec>$</spec>
|
<spec>$</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Scroll to the absolute right of the document</p>
|
<p>Scroll to the absolute right of the document</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -109,11 +125,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Home> gg]]></tags>
|
<tags><![CDATA[<Home> gg]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>gg</spec>
|
<spec><oa>count</oa>gg</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to the top of the document. When used with <oa>count</oa> like in <k>35gg</k>, it
|
Go to the top of the document. With <oa>count</oa>,
|
||||||
scrolls to 35% of the document.
|
scroll vertically to <oa>count</oa> percent of the
|
||||||
|
document.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -121,11 +139,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<End> G]]></tags>
|
<tags><![CDATA[<End> G]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>G</spec>
|
<spec><oa>count</oa>G</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to the end of the document. When used with <oa>count</oa> like in <k>35G</k>, it
|
Go to the end of the document. With <oa>count</oa>,
|
||||||
scrolls to 35% of the document.
|
behaves exactly the same as <oa>gg</oa>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -134,7 +153,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>N%</tags>
|
<tags>N%</tags>
|
||||||
<spec><a>count</a>%</spec>
|
<spec><a>count</a>%</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Scroll to <a>count</a> percent of the document.</p>
|
<p>Scroll to <a>count</a> percent of the document.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -142,15 +161,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Left> h]]></tags>
|
<tags><![CDATA[<Left> h]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>h</spec>
|
<spec><oa>count</oa>h</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll document to the left. If <oa>count</oa> is specified then move <oa>count</oa> times as
|
Scroll document to the left. If <oa>count</oa> is specified,
|
||||||
much to the left.
|
repeat <oa>count</oa> times.
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
|
||||||
set).
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -158,15 +174,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-e> <Down> j]]></tags>
|
<tags><![CDATA[<C-e> <Down> j]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>j</spec>
|
<spec><oa>count</oa>j</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll document down. If <oa>count</oa> is specified then move <oa>count</oa> times as much
|
Scroll document to the down. If <oa>count</oa> is specified,
|
||||||
down.
|
repeat <oa>count</oa> times.
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
|
||||||
set).
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -174,14 +187,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-y> <Up> k]]></tags>
|
<tags><![CDATA[<C-y> <Up> k]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>k</spec>
|
<spec><oa>count</oa>k</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll document up. If <oa>count</oa> is specified then move <oa>count</oa> times as much up.
|
Scroll document to the up. If <oa>count</oa> is specified,
|
||||||
</p>
|
repeat <oa>count</oa> times.
|
||||||
<p>
|
|
||||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
|
||||||
set).
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -189,15 +200,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Right> l]]></tags>
|
<tags><![CDATA[<Right> l]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>l</spec>
|
<spec><oa>count</oa>l</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll document to the right. If <oa>count</oa> is specified then move <oa>count</oa> times
|
Scroll document to the right. If <oa>count</oa> is specified,
|
||||||
as much to the right.
|
repeat <oa>count</oa> times.
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
|
||||||
set).
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -205,12 +213,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-d>]]></tags>
|
<tags><![CDATA[<C-d>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-d></spec>
|
<spec><oa>count</oa><C-d></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll window downwards in the buffer. The number of lines is set by the
|
Scroll window downwards by the amount specified in the
|
||||||
<o>scroll</o> option which defaults to half a page. If <oa>count</oa> is given <o>scroll</o> is
|
<o>scroll</o> option. With <oa>count</oa>, scroll as if
|
||||||
first set to this value.
|
<o>scroll</o> were set to <o>count</o>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -218,12 +227,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-u>]]></tags>
|
<tags><![CDATA[<C-u>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-u></spec>
|
<spec><oa>count</oa><C-u></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Scroll window upwards in the buffer. The number of lines is set by the
|
Scroll window upwards by the amount specified in the
|
||||||
<o>scroll</o> option which defaults to half a page. If <oa>count</oa> is given <o>scroll</o> is
|
<o>scroll</o> option. With <oa>count</oa>, scroll as if
|
||||||
first set to this value.
|
<o>scroll</o> were set to <o>count</o>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -231,18 +241,26 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<S-Space> <PageUp> <C-b>]]></tags>
|
<tags><![CDATA[<S-Space> <PageUp> <C-b>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-b></spec>
|
<spec><oa>count</oa><C-b></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Scroll up a full page. Scroll window <oa>count</oa> pages Backwards (upwards) in the buffer.</p>
|
<p>
|
||||||
|
Scroll up a full page. With <oa>count</oa>, scroll up
|
||||||
|
<oa>count</oa> full pages.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Space> <PageDown> <C-f>]]></tags>
|
<tags><![CDATA[<Space> <PageDown> <C-f>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-f></spec>
|
<spec><oa>count</oa><C-f></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Scroll down a full page. Scroll window <oa>count</oa> pages Forwards (downwards) in the buffer.</p>
|
<p>
|
||||||
|
Scroll down a full page. With <oa>count</oa>, scroll
|
||||||
|
down <oa>count</oa> full pages.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -252,7 +270,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Tab>]]></tags>
|
<tags><![CDATA[<Tab>]]></tags>
|
||||||
<spec><Tab></spec>
|
<spec><Tab></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Advance keyboard focus to the next element.</p>
|
<p>Advance keyboard focus to the next element.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -261,7 +279,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<S-Tab>]]></tags>
|
<tags><![CDATA[<S-Tab>]]></tags>
|
||||||
<spec><S-Tab></spec>
|
<spec><S-Tab></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Rewind keyboard focus to the previous element.</p>
|
<p>Rewind keyboard focus to the previous element.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -269,12 +287,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gi</tags>
|
<tags>gi</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>gi</spec>
|
<spec><oa>count</oa>gi</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Focus last used input field. If there is no last input field, it focuses the
|
Focus last used input field. If there is no last input
|
||||||
first input field. When used with <oa>count</oa> it directly jumps to the <oa>count</oa>th input
|
field, focus the first input field. With <oa>count</oa>,
|
||||||
field.
|
focus the <oa>count</oa>th input field.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -282,11 +301,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>]f</tags>
|
<tags>]f</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>]f</spec>
|
<spec><oa>count</oa>]f</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Focus next frame. Transfer keyboard focus to the <oa>count</oa>th next frame in
|
Transfer keyboard focus to the <oa>count</oa>th next
|
||||||
order. The newly focused frame is briefly colored red. Does not wrap.
|
frame. The newly focused frame is briefly highlighted
|
||||||
|
with <h>FrameIndicator</h>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -294,11 +315,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>[f</tags>
|
<tags>[f</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>[f</spec>
|
<spec><oa>count</oa>[f</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Focus previous frame. Transfer keyboard focus to the <oa>count</oa>th previous frame
|
Transfer keyboard focus to the <oa>count</oa>th next
|
||||||
in order. The newly focused frame is briefly colored red. Does not wrap.
|
previous frame. The newly focused frame is briefly highlighted
|
||||||
|
with <h>FrameIndicator</h>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -306,13 +329,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>]]</tags>
|
<tags>]]</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>]]</spec>
|
<spec><oa>count</oa>]]</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Follow the link labeled <str>next</str> or <str>></str>
|
Follow the last link matching <o>nextpattern</o>. Used,
|
||||||
if it exists. Useful when browsing forums or
|
for instance, to move to the next page of search
|
||||||
documentation. Change <o>nextpattern</o> to modify its
|
results.
|
||||||
behavior. It follows relations between files too.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -320,14 +343,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>[[</tags>
|
<tags>[[</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>[[</spec>
|
<spec><oa>count</oa>[[</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Follow the link labeled <str>prev</str>,
|
Follow the last link matching <o>previouspattern</o>. Used,
|
||||||
<str>previous</str> or <str><</str> if it exists. Useful
|
for instance, to move to the previous page of search
|
||||||
when browsing forums or documentation. Change
|
results.
|
||||||
<o>previouspattern</o> to modify its behavior. It
|
|
||||||
follows relations between files too.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -335,31 +357,40 @@
|
|||||||
|
|
||||||
<h2 tag="zooming zoom">Zooming</h2>
|
<h2 tag="zooming zoom">Zooming</h2>
|
||||||
|
|
||||||
The zooming commands are dependent on two properties -- a zoom range and a
|
<p>
|
||||||
series of levels within that range.
|
The zooming commands are dependent on two properties—a zoom
|
||||||
|
range and a series of levels within that range.
|
||||||
|
</p>
|
||||||
|
|
||||||
The absolute value of the page zoom is limited to a value within the configured
|
<p>
|
||||||
zoom range (default: 30%--300%). The zoom levels are used by
|
The absolute value of the page zoom is limited to a value within
|
||||||
<k>zi</k>/<k>zo</k>, and similar commands, to change the zoom value in steps. The
|
the configured zoom range (default: 30%–300%). By default,
|
||||||
default zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%,
|
commands which zoom in or out select between the zoom levels,
|
||||||
170%, 200%, 240%, 300%.
|
30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%, 170%,
|
||||||
|
200%, 240%, 300%.
|
||||||
|
</p>
|
||||||
|
|
||||||
The available zoom range can be changed by setting the
|
<p>
|
||||||
<link topic="http://kb.mozillazine.org/Zoom.minPercent">'zoom.minPercent'</link> and
|
The available zoom range can be changed by setting the
|
||||||
<link topic="http://kb.mozillazine.org/Zoom.maxPercent">'zoom.maxPercent'</link> &dactyl.host;
|
<pref>zoom.minPercent</pref>
|
||||||
preferences. The zoom levels can be changed using the
|
and
|
||||||
<link topic="http://kb.mozillazine.org/Toolkit.zoomManager.zoomValues">'toolkit.ZoomManager.zoomLevels'</link>
|
<pref>zoom.maxPercent</pref>
|
||||||
preference.
|
&dactyl.host; preferences. The zoom levels can be changed using the
|
||||||
|
<pref>toolkit.zoomManager.zoomValues</pref>
|
||||||
|
preference.
|
||||||
|
</p>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
'toolkit.ZoomManager.zoomLevels' is specified as a list of
|
<pref>toolkit.zoomManager.zoomValues</pref> is specified as a
|
||||||
values between 0 and 1, not as a percentage.
|
list of values between <em>0</em> and <em>1</em> rather than
|
||||||
|
percentages. For instance, <em>0.5</em> is equivalent to
|
||||||
|
<em>50%</em>.
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>+ zi</tags>
|
<tags>+ zi</tags>
|
||||||
<spec><oa>count</oa>zi</spec>
|
<spec><oa>count</oa>zi</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Enlarge text zoom of current web page. Mnemonic: zoom in.</p>
|
<p>Enlarge text zoom of current web page. Mnemonic: zoom in.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -367,6 +398,7 @@ preference.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>zm</tags>
|
<tags>zm</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>zm</spec>
|
<spec><oa>count</oa>zm</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Enlarge text zoom of current web page by a larger amount. Mnemonic: zoom more.</p>
|
<p>Enlarge text zoom of current web page by a larger amount. Mnemonic: zoom more.</p>
|
||||||
@@ -377,7 +409,7 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>- zo</tags>
|
<tags>- zo</tags>
|
||||||
<spec><oa>count</oa>zo</spec>
|
<spec><oa>count</oa>zo</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Reduce text zoom of current web page. Mnemonic: zoom out.</p>
|
<p>Reduce text zoom of current web page. Mnemonic: zoom out.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -386,7 +418,7 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>zr</tags>
|
<tags>zr</tags>
|
||||||
<spec><oa>count</oa>zr</spec>
|
<spec><oa>count</oa>zr</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Reduce text zoom of current web page by a larger amount. Mnemonic: zoom reduce.</p>
|
<p>Reduce text zoom of current web page by a larger amount. Mnemonic: zoom reduce.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -394,11 +426,13 @@ preference.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>zz</tags>
|
<tags>zz</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>zz</spec>
|
<spec><oa>count</oa>zz</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Set text zoom value of current web page. Zoom value can be between 30% and 300%.
|
Set text zoom value of current web page. Zoom value can
|
||||||
If it is omitted, text zoom is reset to 100%.
|
be between 30% and 300%. If it is omitted, text zoom is
|
||||||
|
reset to 100%.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -407,7 +441,7 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>ZI zI</tags>
|
<tags>ZI zI</tags>
|
||||||
<spec><oa>count</oa>ZI</spec>
|
<spec><oa>count</oa>ZI</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Enlarge full zoom of current web page. Mnemonic: zoom in.</p>
|
<p>Enlarge full zoom of current web page. Mnemonic: zoom in.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -415,6 +449,7 @@ preference.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>ZM zM</tags>
|
<tags>ZM zM</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>ZM</spec>
|
<spec><oa>count</oa>ZM</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Enlarge full zoom of current web page by a larger amount. Mnemonic: zoom more.</p>
|
<p>Enlarge full zoom of current web page by a larger amount. Mnemonic: zoom more.</p>
|
||||||
@@ -425,7 +460,7 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>ZO zO</tags>
|
<tags>ZO zO</tags>
|
||||||
<spec><oa>count</oa>ZO</spec>
|
<spec><oa>count</oa>ZO</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Reduce full zoom of current web page. Mnemonic: zoom out.</p>
|
<p>Reduce full zoom of current web page. Mnemonic: zoom out.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -434,7 +469,7 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>ZR zR</tags>
|
<tags>ZR zR</tags>
|
||||||
<spec><oa>count</oa>ZR</spec>
|
<spec><oa>count</oa>ZR</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Reduce full zoom of current web page by a larger amount. Mnemonic: zoom reduce.</p>
|
<p>Reduce full zoom of current web page by a larger amount. Mnemonic: zoom reduce.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -442,6 +477,7 @@ preference.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>ZZ zZ</tags>
|
<tags>ZZ zZ</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>ZZ</spec>
|
<spec><oa>count</oa>ZZ</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -455,7 +491,8 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>:zo :zoom</tags>
|
<tags>:zo :zoom</tags>
|
||||||
<spec>:zo<oa>om</oa><oa>!</oa> <oa>value</oa></spec>
|
<spec>:zo<oa>om</oa><oa>!</oa> <oa>value</oa></spec>
|
||||||
<spec>:zo<oa>om</oa><oa>!</oa> +<a>value</a> | -<a>value</a></spec>
|
<spec>:zo<oa>om</oa><oa>!</oa> +<a>value</a></spec>
|
||||||
|
<spec>:zo<oa>om</oa><oa>!</oa> -<a>value</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Set zoom value of current web page. <oa>value</oa> can be an absolute value
|
Set zoom value of current web page. <oa>value</oa> can be an absolute value
|
||||||
@@ -476,7 +513,7 @@ preference.
|
|||||||
<item>
|
<item>
|
||||||
<tags>:frameo :frameonly</tags>
|
<tags>:frameo :frameonly</tags>
|
||||||
<spec>:frameo<oa>nly</oa></spec>
|
<spec>:frameo<oa>nly</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Show only the current frame's page.</p>
|
<p>Show only the current frame's page.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -484,18 +521,17 @@ preference.
|
|||||||
|
|
||||||
<h2 tag="copying yanking">Copying text</h2>
|
<h2 tag="copying yanking">Copying text</h2>
|
||||||
|
|
||||||
When running in X11, the text of the following commands is not only
|
<p>
|
||||||
copied to the clipboard but is also put into the X11 selection, which
|
When running in X11, the text of the following commands is not only
|
||||||
can be pasted with the middle mouse button:
|
copied to the clipboard but is also put into the X11 selection, which
|
||||||
|
can be pasted with the middle mouse button:
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>y</tags>
|
<tags>y</tags>
|
||||||
<spec>y</spec>
|
<spec>y</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>Yank current location to the clipboard.</p>
|
||||||
Yank current location to the clipboard. When running in X11 the location is
|
|
||||||
also put into the selection, which can be pasted with the middle mouse button.
|
|
||||||
</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -503,7 +539,7 @@ can be pasted with the middle mouse button:
|
|||||||
<item>
|
<item>
|
||||||
<tags>Y</tags>
|
<tags>Y</tags>
|
||||||
<spec>Y</spec>
|
<spec>Y</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Copy currently selected text to the system clipboard.</p>
|
<p>Copy currently selected text to the system clipboard.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -511,16 +547,18 @@ can be pasted with the middle mouse button:
|
|||||||
|
|
||||||
<h2 tag="alternate-stylesheet">Alternate style sheets</h2>
|
<h2 tag="alternate-stylesheet">Alternate style sheets</h2>
|
||||||
|
|
||||||
Page authors may specify alternate style sheets for an HTML document. Users can
|
Page authors may specify alternate style sheets for an HTML
|
||||||
then switch between these various style sheets, selecting their favorite.
|
document. Users can then switch between these various style sheets,
|
||||||
|
selecting their favorite.
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:pagest :pagestyle</tags>
|
<tags>:pagest :pagestyle</tags>
|
||||||
<spec>:pagest<oa>yle</oa> <oa>stylesheet</oa></spec>
|
<spec>:pagest<oa>yle</oa> <oa>stylesheet</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Select the author style sheet to apply. If <oa>stylesheet</oa> is not specified
|
Select the author style sheet to apply. If
|
||||||
the page's default style sheet is used.
|
<oa>stylesheet</oa> is not specified the page's default
|
||||||
|
style sheet is used.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>All author styling can be removed by setting the <o>usermode</o> option.</p>
|
<p>All author styling can be removed by setting the <o>usermode</o> option.</p>
|
||||||
|
|||||||
@@ -6,33 +6,52 @@
|
|||||||
<document
|
<document
|
||||||
name="cmdline"
|
name="cmdline"
|
||||||
title="&dactyl.appname; Command-line"
|
title="&dactyl.appname; Command-line"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="Command-line-mode Command-line mode-cmdline">Command-line mode</h1>
|
<h1 tag="command-line-mode command-line mode-cmdline">Command-line mode</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
Command-line mode is used to enter Ex commands (<k>:</k>) and text search patterns
|
<p>
|
||||||
(<k>/</k> and <k>?</k>).
|
&dactyl.appname;'s command-line mode is perhaps its most
|
||||||
|
powerful interface. In this mode, the command input bar at the
|
||||||
|
bottom of the window is given the keyboard focus for any of a
|
||||||
|
variety of required inputs. In addition to access to almost
|
||||||
|
every aspect of &dactyl.appname; and &dactyl.host;, the command
|
||||||
|
line provides power and comprehensive completion for all of its
|
||||||
|
commands, along with concise descriptions for each command and
|
||||||
|
all of its arguments. Couple this with persistent, searchable
|
||||||
|
command history, and you have a very efficient interface for
|
||||||
|
easily performing simple and complex tasks.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Included among the several command-line modes are ex command
|
||||||
|
mode (the standard mode for entering commands), find mode (for
|
||||||
|
searching the current page), prompt mode (for selecting files,
|
||||||
|
confirming actions), and hint mode (for selecting links and
|
||||||
|
other items on a page).
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:</tags>
|
<tags>:</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:</spec>
|
<spec>:</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Start Command-line mode. In Command-line mode, you can perform extended
|
Opens the command-line in ex mode. This is the mode used
|
||||||
commands, which may require arguments.
|
for entering the various commands listed in
|
||||||
|
<t>ex-cmd-index</t>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 tag="cmdline-editing">Command-line editing</h2>
|
<h2 tag="cmdline-editing">Command-line editing</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<C-c>]]></tags>
|
<tags><![CDATA[c_<C-c>]]></tags>
|
||||||
<spec><C-c></spec>
|
<spec><C-c></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Quit Command-line mode without executing.</p>
|
<p>Quit Command-line mode without executing.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -41,7 +60,7 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<C-]>]]></tags>
|
<tags><![CDATA[c_<C-]>]]></tags>
|
||||||
<spec><C-]></spec>
|
<spec><C-]></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Expand a command-line abbreviation.</p>
|
<p>Expand a command-line abbreviation.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -49,11 +68,12 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<Up>]]></tags>
|
<tags><![CDATA[c_<Up>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><Up></spec>
|
<spec><Up></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Recall the previous command line from the history list which matches the
|
Recall from command history the previous command-line
|
||||||
current command line.
|
which begins with the current input value.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -61,11 +81,12 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<Down>]]></tags>
|
<tags><![CDATA[c_<Down>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><Down></spec>
|
<spec><Down></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Recall the next command line from the history list which matches the current
|
Recall from command history the next command-line
|
||||||
command line.
|
which begins with the current input value.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -74,6 +95,7 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<S-Up> c_<PageUp>]]></tags>
|
<tags><![CDATA[c_<S-Up> c_<PageUp>]]></tags>
|
||||||
<spec><S-Up></spec>
|
<spec><S-Up></spec>
|
||||||
|
<strut/>
|
||||||
<spec><PageUp></spec>
|
<spec><PageUp></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Recall the previous command line from the history list.</p>
|
<p>Recall the previous command line from the history list.</p>
|
||||||
@@ -95,12 +117,14 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<Tab>]]></tags>
|
<tags><![CDATA[c_<Tab>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><Tab></spec>
|
<spec><Tab></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Complete the word in front of the cursor according to the behavior specified in
|
Complete the word in front of the cursor according to the behavior
|
||||||
<o>wildmode</o>. If <o>wildmode</o> contains "list" and there are multiple matches then
|
specified in <o>wildmode</o>. If <o>wildmode</o> contains
|
||||||
the completion menu window is opened.
|
<str>list</str> and there are multiple matches then the completion
|
||||||
|
menu window is opened.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -108,9 +132,10 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[c_<S-Tab>]]></tags>
|
<tags><![CDATA[c_<S-Tab>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><S-Tab></spec>
|
<spec><S-Tab></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Complete the previous full match when <o>wildmode</o> contains "full".</p>
|
<p>Complete the previous full match when <o>wildmode</o> contains <str>full</str>.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
@@ -8,62 +8,39 @@
|
|||||||
<document
|
<document
|
||||||
name="developer"
|
name="developer"
|
||||||
title="&dactyl.appname; Developer information"
|
title="&dactyl.appname; Developer information"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="developer-information">Developer information</h1>
|
<h1 tag="developer-information">Developer information</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<h2 tag="writing-docs documentation">Writing documentation</h2>
|
<h2 tag="writing-docs documentation">Writing documentation</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For every new feature, writing documentation is <em>mandatory</em> for the
|
In order for any user-visible change to be accepted into the mainline, it
|
||||||
patch to be accepted. The docs are written in an XML dialect similar to
|
must be accompanied by accurate documentation. The docs are written in an
|
||||||
XHTML, with a few tags specific to our documentation. For example:
|
XML dialect similar to XHTML, with a few tags specific to our
|
||||||
|
documentation. For example:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<code><![CDATA[
|
<xml-block><item>
|
||||||
<item>
|
<tags><F1> :help :h help</tags>
|
||||||
<tags><![CDATA[<F1> :help :h help]]]]><![CDATA[></tags>
|
<spec>:h<oa>elp</oa> <oa>subject</oa></spec>
|
||||||
<spec>:h<oa>elp</oa> <a>subject</a></spec>
|
<spec><F1></spec>
|
||||||
<spec><![CDATA[<F1>]]]]><![CDATA[></spec>
|
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Open help window.
|
Open the help page. The default page, as specified by <o>helpfile</o> is shown
|
||||||
The default section is shown unless <a>subject</a> is specified.
|
unless <oa>subject</oa> is specified. If you need help for a specific topic, try
|
||||||
If you need help for a specific topic, try <ex>:help overview</ex>.
|
<ex>:help overview</ex>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item></xml-block>
|
||||||
]]></code>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
creates a new help section for the command <ex>:help</ex> and for
|
creates a new help section for the command <ex>:help</ex> and for
|
||||||
the related key binding, <k name="F1"/>. It also creates help tags
|
the related key binding, <k name="F1"/>. It also creates help tags
|
||||||
for the command, its shortcuts, the key binding, and the general
|
for the command, its shortcuts, the key binding, and the general
|
||||||
topic, 'help'. These tags enable linking to this section when from
|
topic, ‘help’. These tags enable linking to this section when from
|
||||||
other mentions of the topic and from the <ex>:help</ex> command.
|
other mentions of the topic and from the <ex>:help</ex> command.
|
||||||
The above code displays as:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<html:div style="margin: 2em;">
|
|
||||||
<item>
|
|
||||||
<tags><![CDATA[<F1> :help :h help]]></tags>
|
|
||||||
<spec>:h<oa>elp</oa> <a>subject</a></spec>
|
|
||||||
<spec><![CDATA[<F1>]]></spec>
|
|
||||||
<description>
|
|
||||||
<p>
|
|
||||||
Open help window.
|
|
||||||
The default section is shown unless <a>subject</a> is specified.
|
|
||||||
If you need help for a specific topic, try <ex>:help overview</ex>.
|
|
||||||
</p>
|
|
||||||
</description>
|
|
||||||
</item>
|
|
||||||
</html:div>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
If you don't know in which file/section you should put some
|
|
||||||
documentation, ask on the mailing list or on
|
|
||||||
<link topic="irc://irc.freenode.net/pentadactyl">#pentadactyl</link>.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 tag="help-tags help-xml">Help tags</h3>
|
<h3 tag="help-tags help-xml">Help tags</h3>
|
||||||
@@ -80,8 +57,9 @@
|
|||||||
<dt>h2</dt> <dd>A second-level heading (HelpSubhead)</dd>
|
<dt>h2</dt> <dd>A second-level heading (HelpSubhead)</dd>
|
||||||
<dt>h3</dt> <dd>A third-level heading (HelpSubsubhead)</dd>
|
<dt>h3</dt> <dd>A third-level heading (HelpSubsubhead)</dd>
|
||||||
<dt>code</dt> <dd>A pre-formatted code block. (HelpCode)</dd>
|
<dt>code</dt> <dd>A pre-formatted code block. (HelpCode)</dd>
|
||||||
<dt>note</dt> <dd><note style="margin: 0;">A note paragraph. (HelpNote)</note></dd>
|
<dt>note</dt> <dd><note>A note paragraph. (HelpNote)</note></dd>
|
||||||
<dt>warning</dt> <dd><warning style="margin: 0;">A warning paragraph. (HelpWarning)</warning></dd>
|
<dt>strut</dt> <dd>A horizontal strut which prevents any previous floating elements from appearing below it.</dd>
|
||||||
|
<dt>warning</dt> <dd><warning>A warning paragraph. (HelpWarning)</warning></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Generic</dt><dd/>
|
<dt>Generic</dt><dd/>
|
||||||
@@ -96,19 +74,21 @@
|
|||||||
<dt>item</dt> <dd>A help entry (HelpItem)</dd>
|
<dt>item</dt> <dd>A help entry (HelpItem)</dd>
|
||||||
<dt>&tab;tags</dt> <dd>See the 'Tagging' section (HelpTags)</dd>
|
<dt>&tab;tags</dt> <dd>See the 'Tagging' section (HelpTags)</dd>
|
||||||
<dt>&tab;spec</dt> <dd>The specification for this item, such as an example command-line. (HelpSpec)</dd>
|
<dt>&tab;spec</dt> <dd>The specification for this item, such as an example command-line. (HelpSpec)</dd>
|
||||||
|
<dt>&tab;strut</dt> <dd>A horizontal formatting strut which ensures that all previous <tags> and <spec> elements appear above the ones that follow.</dd>
|
||||||
<dt>&tab;type</dt> <dd>For options, the type of the option.
|
<dt>&tab;type</dt> <dd>For options, the type of the option.
|
||||||
<em>number</em>, <em>boolean</em>, <em>string</em>, <em>string</em>, <em>stringlist</em>, or <em>charlist</em>.
|
<em>number</em>, <em>boolean</em>, <em>string</em>, <em>string</em>, <em>stringlist</em>, or <em>charlist</em>.
|
||||||
(HelpType)
|
(HelpType)
|
||||||
</dd>
|
</dd>
|
||||||
<dt>&tab;default</dt> <dd>For options, the default value. (HelpDefault)</dd>
|
<dt>&tab;default</dt> <dd>For options, the default value. (HelpDefault)</dd>
|
||||||
<dt>&tab;description</dt> <dd>The description of this help item. (HelpDescription)</dd>
|
<dt>&tab;description</dt> <dd>The description of this help item. (HelpDescription)</dd>
|
||||||
|
<dt>&tab;&tab;@short</dt> <dd>Indicates that this is a short description which should appear between the specs and tags.</dd>
|
||||||
<dt>a</dt> <dd>Required <a>argument</a>. (HelpArg)</dd>
|
<dt>a</dt> <dd>Required <a>argument</a>. (HelpArg)</dd>
|
||||||
<dt>oa</dt> <dd>Optional <oa>argument</oa>. (HelpOptionalArg)</dd>
|
<dt>oa</dt> <dd>Optional <oa>argument</oa>. (HelpOptionalArg)</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Tagging</dt><dd/>
|
<dt>Tagging</dt><dd/>
|
||||||
<dt>tags</dt> <dd>Space-separated list of strings to tag. Displayed right-aligned, and used for cross-linking. (HelpTags)</dd>
|
<dt>tags</dt> <dd>Space-separated list of strings to tag. Displayed right-aligned, and used for cross-linking. (HelpTags)</dd>
|
||||||
<dt>@tag</dt> <dd>The tag attribute. Applied to any element, generates a <tags> element with its value for its contents. (HelpTag)</dd>
|
<dt>@tag</dt> <dd>The tag attribute. Applied to any element, generates a <tags> element for the given tags. (HelpTag)</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Linking</dt><dd/>
|
<dt>Linking</dt><dd/>
|
||||||
@@ -129,7 +109,7 @@
|
|||||||
<dt>&tab;@summary</dt> <dd>A short description of the plugin, shown in its section head.</dd>
|
<dt>&tab;@summary</dt> <dd>A short description of the plugin, shown in its section head.</dd>
|
||||||
|
|
||||||
<dt>project</dt> <dd>The project for which this plugin was intended.</dd>
|
<dt>project</dt> <dd>The project for which this plugin was intended.</dd>
|
||||||
<dt>&tab;@name</dt> <dd>The name of the project (i.e., <str>&dactyl.name;</str>)</dd>
|
<dt>&tab;@name</dt> <dd>The name of the project (i.e., <str>&dactyl.appname;</str>)</dd>
|
||||||
<dt>&tab;@minVersion</dt> <dd>The minimum version of the project for which this plugin is intended to work.</dd>
|
<dt>&tab;@minVersion</dt> <dd>The minimum version of the project for which this plugin is intended to work.</dd>
|
||||||
<dt>&tab;@maxVersion</dt> <dd>The maximum version of the project for which this plugin is intended to work.</dd>
|
<dt>&tab;@maxVersion</dt> <dd>The maximum version of the project for which this plugin is intended to work.</dd>
|
||||||
|
|
||||||
@@ -148,52 +128,67 @@
|
|||||||
written a new command, mapping or option.
|
written a new command, mapping or option.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<example><ex>:echo util.generateHelp(commands.get(<str>addons</str>), <![CDATA[<p>Extra text</p>]]>)</ex></example>
|
<example><ex>:echo dactyl.generateHelp(commands.get(<str>addons</str>), <![CDATA[<p>Extra text</p>]]>)</ex></example>
|
||||||
|
|
||||||
<h2 tag="writing-plugins">Writing plugins</h2>
|
<h2 tag="writing-plugins">Writing plugins</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Writing &dactyl.appname; plugins is incredibly simple.
|
Writing &dactyl.appname; plugins is incredibly simple. Plugins are
|
||||||
Plugins are simply JavaScript files which run with full chrome
|
simply JavaScript files which run with full chrome privileges and
|
||||||
privileges and have full access to the &dactyl.appname; and
|
have full access to the &dactyl.appname; and &dactyl.host; APIs.
|
||||||
&dactyl.host; APIs. Each plugin has its own global object,
|
Each plugin has its own global object, which means that the
|
||||||
which means that the variables and functions that you create
|
variables and functions that you create won't pollute the global
|
||||||
won't pollute the global <em>window</em> or private
|
<em>window</em> or private <em>dactyl</em> namespaces. This means
|
||||||
<em>dactyl</em> namespaces. This means that there's no need
|
that there's no need to wrap your plugin in a closure, as is often
|
||||||
to wrap your plugin in a closure, as is often the practice in
|
the practice in JavaScript development. Furthermore, any plugin
|
||||||
JavaScript development. Furthermore, any plugin which is
|
which is installed in your <o>runtimepath</o><em>/plugins</em>
|
||||||
installed in your <o>runtimepath</o><em>/plugin</em> directory
|
directory will find its context stored in
|
||||||
will find its context stored in
|
<em>plugins.<pluginName></em>, which is often invaluable during
|
||||||
<em>plugins.<pluginName></em>, which is often invaluable
|
development and testing.
|
||||||
during development and testing.
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Plugins are always initialized after the main window is loaded, so
|
||||||
|
there is no need to write <str>load</str> event handlers. Beyond
|
||||||
|
that, what you may do with your plugins is practically limitless.
|
||||||
|
Plugins have full access to all of the chrome resources that
|
||||||
|
ordinary &dactyl.host; do, along with the entire power of the
|
||||||
|
&dactyl.appname; API. If you need a starting point, have a look at some
|
||||||
|
<link topic="&dactyl.plugins;">existing plugins</link> or
|
||||||
|
<link topic="http://addon.mozilla.org/">extensions</link>,
|
||||||
|
especially the
|
||||||
|
<link topic="&dactyl.code;source/browse/">&dactyl.appname;</link>
|
||||||
|
source.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 tag="plugin-documentation">Plugin documentation</h3>
|
<h3 tag="plugin-documentation">Plugin documentation</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Plugins may provide inline documentation, which will appear on
|
Plugins should provide inline documentation, which will appear on the
|
||||||
the <ex>:help plugins</ex> page. The markup for help entries
|
<ex>:help plugins</ex> page. The markup for help entries is the same
|
||||||
is the same as the above, with a few more plugin specific
|
as the above, along with a few extra plugin-specific entries. Here is an
|
||||||
entries. Here is an example from the popular
|
example from the popular <em>flashblock</em> extension:
|
||||||
<em>flashblock</em> extension:
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<code><![CDATA[
|
<xml-block><escape><hl key="HelpXMLString">use strict</hl>;
|
||||||
var INFO =
|
XML.ignoreWhitespace = <hl key="Boolean">false</hl>;
|
||||||
<plugin name="flashblock" version="1.0"
|
XML.prettyPrinting = <hl key="Boolean">false</hl>;
|
||||||
href="http://ticket.vimperator.org/9"
|
<hl key="HelpXML">var</hl> INFO = <!-- Cursed manual XML highlighting! -->
|
||||||
summary="Flash Blocker"
|
<hl key="HelpXMLTagStart"><plugin
|
||||||
xmlns="http://vimperator.org/namespaces/liberator">
|
<hl key="HelpXMLAttribute">name</hl><hl key="HelpXMLString">flashblock</hl>
|
||||||
|
<hl key="HelpXMLAttribute">version</hl><hl key="HelpXMLString">1.0</hl>
|
||||||
|
<hl key="HelpXMLAttribute">href</hl><hl key="HelpXMLString">http://ticket.vimperator.org/9</hl>
|
||||||
|
<hl key="HelpXMLAttribute">summary</hl><hl key="HelpXMLString">Flash Blocker</hl>
|
||||||
|
<hl key="HelpXMLAttribute">xmlns</hl>{NS}></hl></escape>
|
||||||
<author email="maglione.k@gmail.com">Kris Maglione</author>
|
<author email="maglione.k@gmail.com">Kris Maglione</author>
|
||||||
<license href="http://opensource.org/licenses/mit-license.php">MIT</license>
|
<license href="http://opensource.org/licenses/mit-license.php">MIT</license>
|
||||||
<project name="Pentadactyl" minVersion="2.0"/>
|
<project name="Pentadactyl" minVersion="1.0"/>
|
||||||
<p>
|
<p>
|
||||||
This plugin provides the same features as the ever popular FlashBlock
|
This plugin provides the same features as the ever popular FlashBlock
|
||||||
Firefox addon. Flash animations are substituted with place holders which
|
Firefox addon. Flash animations are substituted with place holders which
|
||||||
play the original animation when clicked. Additionally, this plugin provides
|
play the original animation when clicked. Additionally, this plugin provides
|
||||||
options to control which sites can play animations without restrictions, and
|
options to control which sites can play animations without restrictions, and
|
||||||
triggers to toggle the playing of animation on the current page.
|
triggers to toggle the playing of animation on the current page.
|
||||||
commandline from the data in a given form.
|
|
||||||
</p>
|
</p>
|
||||||
<item>
|
<item>
|
||||||
<tags>'flashblock' 'fb'</tags>
|
<tags>'flashblock' 'fb'</tags>
|
||||||
@@ -206,25 +201,30 @@ var INFO =
|
|||||||
holders are substituted for flash animations on untrusted sites.
|
holders are substituted for flash animations on untrusted sites.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>]]>
|
</item>
|
||||||
<em>…</em><![CDATA[
|
<escape><oa>...</oa>
|
||||||
</plugin>;
|
<hl key="HelpXMLTagEnd"></plugin></hl></escape>;</xml-block>
|
||||||
]]>
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The inline XML is made possible by
|
The inline XML is made possible by
|
||||||
<link topic="https://developer.mozilla.org/en/E4X">E4X</link>.
|
<link topic="https://developer.mozilla.org/en/E4X">E4X</link>.
|
||||||
It's important that the documentation be assigned to the
|
It is important that the documentation be assigned to the
|
||||||
<em>INFO</em> variable, or &dactyl.appname; will not be able
|
<em>INFO</em> variable, or &dactyl.appname; will not be able
|
||||||
to find it. The documentation that you provide behaves exactly
|
to find it. The XML property changes are not compulsory, but
|
||||||
as other &dactyl.appname; documentation, which means that
|
they do prevent certain formatting problems that may occur
|
||||||
the tags you provide are available via <ex>:help</ex> with
|
otherwise. Beginning your file with <str>use strict</str>, while
|
||||||
full tag completion and cross-referencing support. Although
|
not required, helps to prevent a lot of common errors.
|
||||||
documentation is not required, we strongly recommend that all
|
</p>
|
||||||
plugin authors provide at least basic documentation of the
|
|
||||||
functionality of their plugins and of each of the options,
|
<p>
|
||||||
commands, and especially mappings that they provide.
|
The documentation that you provide behaves exactly as other
|
||||||
|
&dactyl.appname; documentation, which means that the tags you
|
||||||
|
provide are available via <ex>:help</ex> with full tag
|
||||||
|
completion and cross-referencing support. Although documentation
|
||||||
|
is not required, we strongly recommend that all plugin authors
|
||||||
|
provide at least basic documentation of the functionality of
|
||||||
|
their plugins and of each of the options, commands, and
|
||||||
|
especially mappings that they provide.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
@@ -6,23 +6,40 @@
|
|||||||
<document
|
<document
|
||||||
name="eval"
|
name="eval"
|
||||||
title="&dactyl.appname; Expression Evaluation"
|
title="&dactyl.appname; Expression Evaluation"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="expression expr eval">Expression evaluation</h1>
|
<h1 tag="expression expr eval javascript">Expression evaluation</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<!-- INTRO TO BE WRITTEN… -->
|
<p>
|
||||||
|
Much of the power of &dactyl.appname; lies in its scriptable expression
|
||||||
|
evaluation. &dactyl.appname; understands two kinds of expressions: ex
|
||||||
|
commands, and JavaScript. Ex commands are simple, easy to type, and
|
||||||
|
readily accessible from the <t>command-line</t>. They form a core part of
|
||||||
|
the user interface. JavaScript, on the other hand, is much less
|
||||||
|
straightforward, but allows for any number of complex actions to be
|
||||||
|
executed, with full access to all of the internals of &dactyl.appname; and
|
||||||
|
&dactyl.host;. Both expression evaluation methods support sophisticated
|
||||||
|
expression completion, including option lists and descriptions thereof.
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:ec :echo</tags>
|
<tags>:ec :echo</tags>
|
||||||
<spec>:ec<oa>ho</oa> <a>expr</a></spec>
|
<spec>:ec<oa>ho</oa> <a>expr</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Echo the expression. Useful for showing informational messages. Multiple lines
|
Echo a JavaScript expression. <a>expr</a> may be a simple quoted
|
||||||
can be separated by \n. <a>expr</a> can either be a quoted string, or any expression
|
string, in which case it is shown in the statusline, or any
|
||||||
which can be fed to eval() like 4+5. You can also view the source code of
|
arbitrary JavaScript expression. If the expression results in
|
||||||
objects and functions if the return value of <a>expr</a> is an object or function.
|
anything other than a string, it is pretty-printed in a multiline
|
||||||
|
frame just above the command-line. The output depends on the type
|
||||||
|
of object. Functions display their source, DOM nodes display the
|
||||||
|
pretty-printed XML of the top-level node, XML literals are
|
||||||
|
rendered as page content, and all other objects display their
|
||||||
|
string representation and all of their enumerable properties.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>See also <ex>:javascript</ex></p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -56,12 +73,15 @@
|
|||||||
<spec>:exe<oa>cute</oa> <a>expr</a></spec>
|
<spec>:exe<oa>cute</oa> <a>expr</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute the string that results from the evaluation of <a>expr</a> as an Ex command.
|
Execute the ex command string that results from the evaluation of
|
||||||
Example: <ex>:execute "source " + io.getRCFile().path</ex> sources the appropriate
|
the JavaScript expression <a>expr</a>. For example,
|
||||||
RC file.
|
</p>
|
||||||
|
<code><ex>:execute "open " + content.location.host</ex></code>
|
||||||
|
<p>
|
||||||
|
opens the homepage of the currently opened site.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Note: Unlike Vim this currently only supports a single argument.</p>
|
<note>Unlike Vim this only supports a single argument.</note>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -69,30 +89,51 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:js :javas :javascript</tags>
|
<tags>:js :javas :javascript</tags>
|
||||||
<spec>:javas<oa>cript</oa> <a>cmd</a></spec>
|
<spec>:javas<oa>cript</oa> <a>cmd</a></spec>
|
||||||
<spec>:javascript <<<a>endpattern</a>\n<a>empty</a><a>script</a>\n<a>empty</a><a>endpattern</a></spec>
|
<spec>:javascript <<<a>endpattern</a>\n<a>cmd</a>\n<a>endpattern</a></spec>
|
||||||
<spec>:javascript<oa>!</oa></spec>
|
<spec>:javascript<oa>!</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Run any JavaScript command through eval(). Acts as a JavaScript interpreter by
|
Evaluates the given <a>cmd</a> as JavaScript. Behaves exactly as
|
||||||
passing the argument to <tt>eval()</tt>.
|
<ex>:echo</ex>, except that the result is not printed. Any
|
||||||
<ex>:javascript alert(<str>Hello world</str>)</ex> shows
|
exception raised by the evaluation will, however, be displayed as
|
||||||
a dialog box with the text "Hello world".
|
an error message and appended to <ex>:messages</ex>.
|
||||||
<ex>:javascript <<EOF</ex> reads all the lines
|
</p>
|
||||||
until a line starting with "EOF"
|
|
||||||
is found, and interpret them with the JavaScript <em>eval()</em> function.
|
<example>
|
||||||
|
<ex>:javascript alert(<str>Hello world</str>)</ex> will open a
|
||||||
|
dialog window with the message <str>Hello world</str>.
|
||||||
|
</example>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Moreover, multiline scripts can be executed with shell-like here
|
||||||
|
document syntax. For example, the following,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<code><ex>:jsavascript</ex> <<<em>EOF</em>
|
||||||
|
<kwd>for each</kwd> (<kwd>var</kwd> tab <kwd>in</kwd> tabs.visibleTabs)
|
||||||
|
tab.linkedBrowser.reload();
|
||||||
|
<em>EOF</em></code>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
will reload all visible tabs.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Moreover, sophisticated, context-sensitive <k name="Tab"/>
|
||||||
|
completion is available for JavaScript code, which extends to
|
||||||
|
property names, object keys, and programmable completion for
|
||||||
|
string function arguments. The completion code is designed to be
|
||||||
|
both as safe and as powerful as possible. Expressions in a given
|
||||||
|
command-line session will only be evaluated once, and, with
|
||||||
|
autocompletion turned on, any completion which requires a function
|
||||||
|
to be executed requires an explicit <k name="Tab"/> press to
|
||||||
|
commence.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The special version <ex>:javascript!</ex> opens the JavaScript console of
|
The special version <ex>:javascript!</ex> opens the JavaScript console of
|
||||||
&dactyl.host;.
|
&dactyl.host;.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
|
||||||
<k name="Tab"/> completion is available for <ex>:javascript <a>cmd</a><k name="Tab"/></ex> (but not
|
|
||||||
yet for the <ex>:js <<EOF</ex> multiline widget). Be aware that &dactyl.appname; needs
|
|
||||||
to run <a>cmd</a> through eval() to get the completions, which could have unwanted
|
|
||||||
side effects.
|
|
||||||
</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -104,9 +145,10 @@
|
|||||||
<spec>:let</spec>
|
<spec>:let</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Sets or lists a variable. Sets the variable {var-name} to the value of the
|
Sets or lists a variable. Sets the variable <a>var-name</a> to the value of the
|
||||||
expression <a>expr1</a>. If no expression is given, the value of the variable is
|
expression <a>expr1</a>. If no expression is given, the value of the variable is
|
||||||
displayed. Without arguments, displays a list of all variables.
|
displayed. Without arguments, displays a list of all variables.
|
||||||
|
This functionality has few useful applications and so is deprecated.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -117,8 +159,8 @@
|
|||||||
<spec>:unl<oa>et</oa><oa>!</oa> <a>name</a> …</spec>
|
<spec>:unl<oa>et</oa><oa>!</oa> <a>name</a> …</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Deletes the variable <a>name</a>. Several variable names can be given. When used
|
Deletes the named variables. When <oa>!</oa> is given, no error
|
||||||
with <oa>!</oa> no error message is output for non-existing variables.
|
message is output for non-existing variables.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,29 +6,33 @@
|
|||||||
<document
|
<document
|
||||||
name="gui"
|
name="gui"
|
||||||
title="&dactyl.appname; GUI"
|
title="&dactyl.appname; GUI"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:dactyl="&xmlns.dactyl;"
|
||||||
<h1 tag="gui">&dactyl.appname;'s GUI</h1>
|
xmlns:html="&xmlns.html;">
|
||||||
|
<h1 tag="gui">&dactyl.host;'s GUI</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Although &dactyl.appname; offers the most frequently used &dactyl.host; functionality via
|
Although &dactyl.appname; offers access to the most frequently used
|
||||||
Ex and Normal mode commands there may be times when directly accessing the GUI
|
&dactyl.host; functionality via Ex and Normal mode commands, there may be
|
||||||
is required. There are commands for accessing the menu system, standard dialogs
|
times when direct access to the &dactyl.host; GUI is required. For such
|
||||||
and the sidebar.
|
eventualities, there there are commands to access menu items and to launch
|
||||||
|
standard &dactyl.host; dialogs.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 tag="menu">Menus</h2>
|
<h2 tag="menu">Menus</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:emenu</tags>
|
<tags>:emenu</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:emenu <a>menu</a></spec>
|
<spec>:emenu <a>menu</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute <a>menu</a> from the command line. This command provides command-line access
|
Execute <a>menu</a> from the command line. This command provides command-line access
|
||||||
to all menu items available from the main &dactyl.host; menubar. <a>menu</a> is a
|
to all menu items available from the main &dactyl.host; menubar. <a>menu</a> is a
|
||||||
hierarchical path to the menu item with each submenu separated by a period.
|
hierarchical path to the menu item with each submenu separated by a period.
|
||||||
E.g. <ex>:emenu File.Open File…</ex>
|
E.g. <ex>:emenu File.Open File…</ex> launches the standard
|
||||||
|
&dactyl.host; ‘Open File’ dialog.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -38,13 +42,14 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:addo :addons</tags>
|
<tags>:addo :addons</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:addo<oa>ns</oa></spec>
|
<spec>:addo<oa>ns</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show available &dactyl.host; Extensions and Themes.
|
Opens the &dactyl.host; addon manager, where extensions and themes
|
||||||
You can add/remove/disable browser extensions from this dialog.
|
may be installed, removed, disabled, and configured. See also
|
||||||
Be aware that not all &dactyl.host; extensions work, because &dactyl.appname; overrides
|
<ex>:extenstions</ex>, <ex>:extinstall</ex>, <ex>:extoptions</ex>,
|
||||||
some key bindings and changes &dactyl.host;'s GUI.
|
<ex>:extenable</ex>, <ex>:extdisable</ex>, and <ex>:extdelete</ex>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -54,9 +59,8 @@
|
|||||||
<tags>:dia :dialog</tags>
|
<tags>:dia :dialog</tags>
|
||||||
<spec>:dia<oa>log</oa> <oa>&dactyl.host;-dialog</oa></spec>
|
<spec>:dia<oa>log</oa> <oa>&dactyl.host;-dialog</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Open a &dactyl.host; dialog.</p>
|
<p>Open a &dactyl.host; dialog. Available dialogs include,</p>
|
||||||
|
|
||||||
<p>Available dialogs:</p>
|
|
||||||
<dl tag="dialog-list">
|
<dl tag="dialog-list">
|
||||||
<dt>about</dt> <dd>About Mozilla &dactyl.host;;</dd>
|
<dt>about</dt> <dd>About Mozilla &dactyl.host;;</dd>
|
||||||
<dt>addbookmark</dt> <dd>Add bookmark for the current page</dd>
|
<dt>addbookmark</dt> <dd>Add bookmark for the current page</dd>
|
||||||
@@ -90,11 +94,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:dl :downl :downloads</tags>
|
<tags>:dl :downl :downloads</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:downl<oa>oads</oa></spec>
|
<spec>:downl<oa>oads</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show progress of current downloads. Open the original &dactyl.host; download dialog
|
Show progress of current downloads. Open the standard &dactyl.host;
|
||||||
in a new tab. Here, downloads can be paused, canceled and resumed.
|
download dialog in a new tab. Here, downloads can be paused,
|
||||||
|
resumed, and canceled.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -104,9 +110,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:exta :extadd</tags>
|
<tags>:exta :extadd</tags>
|
||||||
<spec>:exta<oa>dd</oa> <a>file</a></spec>
|
<spec>:exta<oa>dd</oa> <a>file|url</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Install an extension. <a>file</a> is an extension XPInstall file (*.xpi).</p>
|
<p>
|
||||||
|
Install an extension. <a>file|uri</a> must be the local file
|
||||||
|
path or URL of an XPInstall (.xpi) file.
|
||||||
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -162,8 +171,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:exto :extoptions</tags>
|
<tags>:exto :extoptions</tags>
|
||||||
<tags>:extp :extpreferences</tags>
|
|
||||||
<spec>:exto<oa>ptions</oa><oa>!</oa> <a>extension</a></spec>
|
<spec>:exto<oa>ptions</oa><oa>!</oa> <a>extension</a></spec>
|
||||||
|
<tags>:extp :extpreferences</tags>
|
||||||
<spec>:extp<oa>references</oa><oa>!</oa> <a>extension</a></spec>
|
<spec>:extp<oa>references</oa><oa>!</oa> <a>extension</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -179,7 +188,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:sbcl :sbclose</tags>
|
<tags>:sbcl :sbclose</tags>
|
||||||
<spec>:sbcl<oa>ose</oa></spec>
|
<spec>:sbcl<oa>ose</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Close the sidebar window.</p>
|
<p>Close the sidebar window.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -212,36 +221,43 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
URL: The URL of the currently loaded page. While the page is loading
|
<em>URL</em>: The URL of the currently loaded page. While the page is loading
|
||||||
progress messages are also output to this field.
|
progress messages are also output to this field.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
History and bookmark status ([+-❤]): The position of the current page in
|
<em>History and bookmark status</em> (<em>[+-❤]</em>): The position of the current page in
|
||||||
the tab's session history; + and - indicate that it's possible to move
|
the tab's session history; + and - indicate that it is possible to move
|
||||||
backwards and forwards through the history respectively. ❤ indicates that
|
backwards and forwards through the history respectively. ❤ indicates that
|
||||||
the current page is bookmarked.
|
the current page is bookmarked.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Tab index ([N/M]): N is the index of the currently selected tab and M is
|
<em>Tab index</em> (<em>[N/M]</em>): N is the index of the currently selected tab and M is
|
||||||
the total number of tabs in the current window.
|
the total number of tabs in the current window.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Vertical scroll: The vertical scroll percentage of the current buffer.
|
<em>Vertical scroll</em>: The vertical scroll percentage of the current buffer,
|
||||||
This is a percentage or Top for 0% and Bot for 100%.
|
or Top or Bot for the top and bottom of the buffer respectively.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Security: The security information button is displayed when appropriate
|
<em>Security</em>: The security information button is displayed when appropriate
|
||||||
as per &dactyl.host;. The color of the status bar also changes to reflect the
|
as per &dactyl.host;. The color of the status bar also changes to reflect the
|
||||||
current security status of the loaded page.
|
current security status of the loaded page.
|
||||||
<ul>
|
<dl>
|
||||||
<li>black – the site's identity is unverified and the connection is unencrypted</li>
|
<dt style="border:1px solid white" dactyl:highlight="StatusLine">black</dt>
|
||||||
<li>blue – the site's domain has been verified and the connection is encrypted</li>
|
<dd>The site's identity is unverified and the connection is unencrypted</dd>
|
||||||
<li>green – the site's domain and owner have been fully verified via an</li>
|
|
||||||
</ul>
|
<dt style="border:1px solid white" dactyl:highlight="StatusLineBroken">red</dt>
|
||||||
Extended Validation certificate and the connection is encrypted
|
<dd>The connection is encrypted, but the site's identity has not been verified or it contains unencrypted content</dd>
|
||||||
|
|
||||||
|
<dt style="border:1px solid white" dactyl:highlight="StatusLineSecure">blue</dt>
|
||||||
|
<dd>The site's domain has been verified and the connection is encrypted</dd>
|
||||||
|
|
||||||
|
<dt style="border:1px solid white" dactyl:highlight="StatusLineExtended">green</dt>
|
||||||
|
<dd>The site's domain and owner have been fully verified via an Extended Validation certificate and the connection is encrypted</dd>
|
||||||
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Extensions: Any extension buttons that would normally be installed to the
|
<em>Extensions</em>: Any extension buttons that would normally be installed to the
|
||||||
&dactyl.host; status bar are appended to the end of the status line.
|
&dactyl.host; status bar are appended to the end of the status line.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -6,102 +6,127 @@
|
|||||||
<document
|
<document
|
||||||
name="hints"
|
name="hints"
|
||||||
title="&dactyl.appname; Hints"
|
title="&dactyl.appname; Hints"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="quick-hints hints">Hints</h1>
|
<h1 tag="quick-hints hints">Hints</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
Hints are the way in which &dactyl.appname; allows you to follow links on a page. By
|
<p>
|
||||||
providing each link with a suitable hint, you can access all links with a
|
Hints are an easy way to interact with web pages without using
|
||||||
similar amount of minimal effort. This contrasts strongly with the traditional
|
your mouse. In hint mode, &dactyl.appname; highlights and
|
||||||
approaches offered by the mouse, in which you must first find and then aim for
|
numbers all clickable elements. The elements can be selected
|
||||||
the link you would like, and by using repeated tabbing which quickly becomes
|
either by typing their numbers, or typing parts of their text to
|
||||||
tedious unless you always visit the first link on a page.
|
narrow them down. While the default action is to click the
|
||||||
|
selected link, other actions are available, including saving the
|
||||||
|
resulting link, copying its URL, or saving an image. For each
|
||||||
|
of these actions, only the set of applicable elements is
|
||||||
|
highlighted.
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>f</tags>
|
<tags>quick-hints</tags>
|
||||||
|
<tags>f QuickHint</tags>
|
||||||
|
<strut/>
|
||||||
<spec>f<a>hint</a></spec>
|
<spec>f<a>hint</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Start QuickHint mode. In QuickHint mode, every hintable item
|
Start <t>QuickHint</t> mode. In this mode, every clickable
|
||||||
(according to the <o>hinttags</o> XPath query) is assigned a
|
element (as definied by the <o>hinttags</o> option) is
|
||||||
unique number. You can either type this number or type part of the
|
highlighted and numbered. Elements can be selected
|
||||||
link text as specified by the <o>hintmatching</o> option, and it
|
either by typing their number, or by typing part of
|
||||||
is followed as soon as it can be uniquely identified. Often it can
|
their text to narrow down the result. When an element
|
||||||
be useful to combine these techniques to narrow down results with
|
has been selected, it is automatically clicked and hint
|
||||||
some letters, and then typing a single digit to make the match
|
mode ends. Additionally, the following keys have
|
||||||
unique. Pressing <k name="Leader"/> (defaults to
|
special meanings in QuickHint mode:
|
||||||
<ex>:let mapleader = "\"</ex>) toggles "escape-mode", where numbers are
|
|
||||||
treated as normal text. <k name="Esc"/> stops this mode at any
|
|
||||||
time.
|
|
||||||
</p>
|
</p>
|
||||||
|
<dl>
|
||||||
|
<dt><k name="Return"/></dt>
|
||||||
|
<dd>Selects the first highlighted element, or that
|
||||||
|
fucused by <k name="Tab"/>.</dd>
|
||||||
|
|
||||||
|
<dt><k name="Tab"/></dt>
|
||||||
|
<dd>Moves the focus to the next hintable element</dd>
|
||||||
|
|
||||||
|
<dt><k name="Leader"/></dt>
|
||||||
|
<dd>Temporarilly treats all numbers as ordinary text</dd>
|
||||||
|
|
||||||
|
<dt><k name="Esc"/></dt>
|
||||||
|
<dd>Exitts hint mode without selecting an element</dd>
|
||||||
|
</dl>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>F</tags>
|
<tags>F</tags>
|
||||||
|
<strut/>
|
||||||
<spec>F<a>hint</a></spec>
|
<spec>F<a>hint</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Start QuickHint mode, but open link in a new tab. Like normal QuickHint
|
Start <t>QuickHint</t> mode, but the selected elements
|
||||||
mode (activated with <k>f</k>) but opens the link in a new tab. The new
|
are clicked with the <k name="Shift"/> key pressed,
|
||||||
tab will be loaded in background according to the
|
which has the normal effect of opening it in a new tab
|
||||||
<str>browser.tabs.loadInBackground</str> &dactyl.host; preference.
|
(depending on the value of the
|
||||||
|
<pref>browser.tabs.loadInBackground</pref> preference).
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<tags>extended-hints</tags>
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>;</tags>
|
<tags>extended-hints</tags>
|
||||||
<spec>;<a>mode</a><a>empty</a><a>hint</a></spec>
|
<tags>; ExtendedHint</tags>
|
||||||
|
<strut/>
|
||||||
|
<spec>;<a>mode</a><a>hint</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Start an extended hint mode. ExtendedHint mode is useful for
|
Start an extended hint mode. <t>ExtendedHint</t> mode is
|
||||||
performing operations on hinted elements other than the default
|
exactly like <t>QuickHint</t> mode, except that each
|
||||||
left mouse click. For example, you can yank link locations, open
|
sub-mode highlights a more specialized set of elements,
|
||||||
them in a new window or save images. If you want to yank the
|
and performs a unique action on the selected link.
|
||||||
location of hint <em>24</em>, press <k>;y</k> to start this hint
|
Because of the panoply of extend hint modes available,
|
||||||
mode. Then press <em>24</em> to copy the hint location.
|
after pressing <k>;</k>, pressing <k name="Tab"/> brings
|
||||||
|
up the <k>completion-list</k> with a list of each hint
|
||||||
|
mode and its description.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><a>mode</a> can be one of:</p>
|
<p><a>mode</a> may be one of:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><tag>;;</tag> <em>;</em> to focus a link and hover it with the mouse</li>
|
<li tag=";;"><em>;</em> to focus a link and hover it with the mouse</li>
|
||||||
<li><tag>;?</tag> <em>?</em> to show information about the element (incomplete)</li>
|
<li tag=";?"><em>?</em> to show information about the element (incomplete)</li>
|
||||||
<li><tag>;s</tag> <em>s</em> to save its destination</li>
|
<li tag=";s"><em>s</em> to save its destination</li>
|
||||||
<li><tag>;a</tag> <em>a</em> to save its destination (prompting for save location)</li>
|
<li tag=";a"><em>a</em> to save its destination (prompting for save location)</li>
|
||||||
<li><tag>;f</tag> <em>f</em> to focus a frame</li>
|
<li tag=";f"><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=";o"><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>
|
<li tag=";t"><em>t</em> to open its location in a new tab</li>
|
||||||
<li><tag>;b</tag> <em>b</em> to open its location in a new background tab</li>
|
<li tag=";b"><em>b</em> to open its location in a new background tab</li>
|
||||||
<li><tag>;w</tag> <em>w</em> to open its destination in a new window</li>
|
<li tag=";w"><em>w</em> to open its destination in a new window</li>
|
||||||
<li><tag>;F</tag> <em>F</em> to follow a sequence of <k name="CR"/>-delimited hints in background tabs</li>
|
<li tag=";F"><em>F</em> to follow a sequence of <k name="CR"/>-delimited hints in background tabs</li>
|
||||||
<li><tag>;O</tag> <em>O</em> to generate an <ex>:open</ex> with hint's URL (like <k>O</k>)</li>
|
<li tag=";O"><em>O</em> to generate an <ex>:open</ex> with hint's URL (like <k>;O</k>)</li>
|
||||||
<li><tag>;T</tag> <em>T</em> to generate a <ex>:tabopen</ex> with hint's URL (like <k>T</k>)</li>
|
<li tag=";T"><em>T</em> to generate a <ex>:tabopen</ex> with hint's URL (like <k>;T</k>)</li>
|
||||||
<li><tag>;W</tag> <em>W</em> to generate a <ex>:winopen</ex> with hint's URL</li>
|
<li tag=";W"><em>W</em> to generate a <ex>:winopen</ex> with hint's URL</li>
|
||||||
<li><tag>;v</tag> <em>v</em> to view its destination source</li>
|
<li tag=";v"><em>v</em> to view its destination source</li>
|
||||||
<li><tag>;V</tag> <em>V</em> to view its destination source in the external editor</li>
|
<li tag=";V"><em>V</em> to view its destination source in the external editor</li>
|
||||||
<li><tag>;y</tag> <em>y</em> to yank its destination location</li>
|
<li tag=";y"><em>y</em> to yank its destination location</li>
|
||||||
<li><tag>;Y</tag> <em>Y</em> to yank its text description</li>
|
<li tag=";Y"><em>Y</em> to yank its text description</li>
|
||||||
<li><tag>;c</tag> <em>c</em> to open its context menu</li>
|
<li tag=";c"><em>c</em> to open its context menu</li>
|
||||||
<li><tag>;i</tag> <em>i</em> to open an image</li>
|
<li tag=";i"><em>i</em> to open an image</li>
|
||||||
<li><tag>;I</tag> <em>I</em> to open an image in a new tab.</li>
|
<li tag=";I"><em>I</em> to open an image in a new tab.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<!-- TODO: These are completely arbitrary and need to be
|
||||||
|
- changed before release. Hopefully they will be...
|
||||||
|
-->
|
||||||
<p>
|
<p>
|
||||||
Depending on the value of <o>complete</o>, you can get a list of
|
Of the previous modes, the value of the <o>hinttags</o>
|
||||||
extended hint modes by pressing <k name="Tab"/> from the <k>;</k>
|
option os used to choose the highlighted elements for
|
||||||
prompt.
|
the modes, <k>;;</k>, <k>;?</k>, <k>;w</k>, <k>;v</k>,
|
||||||
</p>
|
<k>;V</k>, <k>;Y</k> and <k>;c</k>. The value of
|
||||||
|
<o>extendedhinttags</o> is used to choose the elements
|
||||||
<p>
|
for, <k>;s</k>, <k>;a</k>, <k>;o</k>, <k>;t</k>,
|
||||||
Hintable elements for all extended hint modes can be set in the
|
<k>;b</k>, <k>;O</k>, <k>;T</k>, <k>;W</k>, <k>;y</k>,
|
||||||
<o>extendedhinttags</o> XPath string.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<document
|
<document
|
||||||
name="index"
|
name="index"
|
||||||
title="&dactyl.appname; Index"
|
title="&dactyl.appname; Index"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="index">Index</h1>
|
<h1 tag="index">Index</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,21 +6,23 @@
|
|||||||
<document
|
<document
|
||||||
name="insert"
|
name="insert"
|
||||||
title="&dactyl.appname; Insert Mode"
|
title="&dactyl.appname; Insert Mode"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="Insert-mode Insert mode-insert">Insert mode</h1>
|
<h1 tag="Insert-mode Insert mode-insert">Insert mode</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
|
<!-- TODO: This makes no sense. Rewrite. -->
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Insert mode is used to enter text in text boxes and text areas. When
|
Insert mode is used to enter text in text boxes and text areas. When
|
||||||
<o>insertmode</o> is set, focusing on a text area immediately switches to
|
the <o>insertmode</o> option is set, insert mode is immediately
|
||||||
Insert mode.
|
entered when focusing a text area.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>i_i</tags>
|
<tags>i_i</tags>
|
||||||
<spec>i_i</spec>
|
<spec>i_i</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Starts Insert mode in text areas when <o>insertmode</o> is not set.</p>
|
<p>Starts Insert mode in text areas when <o>insertmode</o> is not set.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -32,7 +34,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[i_<C-i>]]></tags>
|
<tags><![CDATA[i_<C-i>]]></tags>
|
||||||
<spec><C-i></spec>
|
<spec><C-i></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Launch the external editor. See the <o>editor</o> option.</p>
|
<p>Launch the external editor. See the <o>editor</o> option.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -41,7 +43,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[i_<C-]>]]></tags>
|
<tags><![CDATA[i_<C-]>]]></tags>
|
||||||
<spec><C-]></spec>
|
<spec><C-]></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Expand an Insert-mode abbreviation.</p>
|
<p>Expand an Insert-mode abbreviation.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>
|
<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>
|
||||||
|
|
||||||
<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||||
@@ -6,39 +6,71 @@
|
|||||||
<document
|
<document
|
||||||
name="map"
|
name="map"
|
||||||
title="&dactyl.appname; Key Mappings"
|
title="&dactyl.appname; Key Mappings"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1>Key mappings, abbreviations, and user-defined commands</h1>
|
<h1 tag="keyboard-shortcuts">Keyboard shortcuts and commands</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
&dactyl.appname; provides a number commands to change the
|
||||||
|
behavior of key presses. This can be mean anythong from
|
||||||
|
automatically substituting one key for another, to automatically
|
||||||
|
replacing one typed word for another, to launching a dialog or
|
||||||
|
running a command.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2 tag="key-mapping mapping map macro">Key mapping</h2>
|
<h2 tag="key-mapping mapping map macro">Key mapping</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The key mapping commands can be used to either redefine the standard key
|
Key mappings are the most basic means &dactyl.appname; provides
|
||||||
bindings or define new ones. A mapping consists of a key, or <t>key-sequence</t>,
|
for altering the actions of key presses. Each key mapping is
|
||||||
which is translated to a string of characters. Example:
|
associated with a mode, such as <link topic="insert-mode">insert</link>,
|
||||||
</p>
|
<link topic="normal-mode">normal</link>, or
|
||||||
<code><ex>:map <k name="F2"/> :echo new Date().toDateString()<k name="CR"/></ex></code>
|
<link topic="command-line-mode">command-line</link>, and only
|
||||||
<p>
|
has effect when that mode is active. Although each mode has a
|
||||||
will echo the current date to the command line when <k name="F2"/> is pressed.
|
full suite of internal mappings, they may be easily augmented,
|
||||||
|
altered, or removed with the <ex>:map</ex> command and its
|
||||||
|
variants. These commands, in essence, allow the user to quickly
|
||||||
|
substitute one sequence of key presses for another.
|
||||||
|
For instance,
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<tags>:map-modes</tags>
|
<code><ex>:map <k name="F2"/></ex> <ex>:echo Date()<k name="CR"/></ex></code>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Keys can be mapped in four distinct modes:
|
causes “<ex>:echo Date()<k name="CR"/></ex>” to be typed out
|
||||||
|
whenever <k name="F2"/> is pressed, thus echoing the full date
|
||||||
|
to the command-line.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<p tag=":map-modes">
|
||||||
<li>Normal mode: When browsing normally</li>
|
Standard key mapping commands are provided for the four most
|
||||||
<li>Visual mode: When selecting text with the cursor keys</li>
|
common modes,
|
||||||
<li>Insert mode: When interacting with text fields on a website</li>
|
</p>
|
||||||
<li>Command-line mode: When typing into the &dactyl.appname; command line</li>
|
|
||||||
</ul>
|
<dl>
|
||||||
|
<dt>n</dt> <dd>Normal mode: When browsing normally</dd>
|
||||||
|
<dt>v</dt> <dd>Visual mode: When selecting text with the cursor keys</dd>
|
||||||
|
<dt>i</dt> <dd>Insert mode: When interacting with text fields on a website</dd>
|
||||||
|
<dt>c</dt> <dd>Command-line mode: When typing into the &dactyl.appname; command line</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The ordinary <ex>:map</ex> and <ex>:noremap</ex> commands
|
||||||
|
add mappings for normal and visual mode. In order to map key
|
||||||
|
bindings in a different mode, any of the mapping commands may be
|
||||||
|
prefixed with one of the above letters. For instance,
|
||||||
|
<ex>:imap</ex> creates a new key mapping in insert mode, while
|
||||||
|
<ex>:cunmap</ex> removes a key mapping from command-line mode.
|
||||||
|
Although other modes do exist, their mappings may currently only
|
||||||
|
be altered via JavaScript.
|
||||||
|
</p>
|
||||||
|
|
||||||
<warning>
|
<warning>
|
||||||
Mappings are NOT saved between sessions, make sure you put them in your
|
It is important to note that mappings are <em>not</em>
|
||||||
&dactyl.name;rc file!
|
automatically saved between sessions. In order to preserve them,
|
||||||
|
they must either be added to your <tt>&dactyl.name;rc</tt> or
|
||||||
|
saved via the <ex>:mk&dactyl.name;rc</ex> command.
|
||||||
</warning>
|
</warning>
|
||||||
|
|
||||||
<h3 tag=":map-commands">Map commands</h3>
|
<h3 tag=":map-commands">Map commands</h3>
|
||||||
@@ -56,8 +88,16 @@
|
|||||||
<spec>:cm<oa>ap</oa> <a>lhs</a> <a>rhs</a></spec>
|
<spec>:cm<oa>ap</oa> <a>lhs</a> <a>rhs</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for the applicable mode(s). The <a>rhs</a> is
|
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for
|
||||||
remapped, allowing for nested and recursive mappings.
|
the applicable mode(s). The keys of <a>rhs</a> respect
|
||||||
|
user-defined mappings, so the following will result in
|
||||||
|
an infinite loop,
|
||||||
|
</p>
|
||||||
|
<code><ex>:map a b</ex>
|
||||||
|
<ex>:map b a</ex></code>
|
||||||
|
<p>
|
||||||
|
In order to avoid this shortcoming, the
|
||||||
|
<ex>:noremap</ex> command may be used.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -76,9 +116,14 @@
|
|||||||
<spec>:cno<oa>remap</oa> <a>lhs</a> <a>rhs</a></spec>
|
<spec>:cno<oa>remap</oa> <a>lhs</a> <a>rhs</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for the applicable mode(s). No remapping of
|
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for
|
||||||
the <a>rhs</a> is performed.
|
the applicable mode(s). The keys in <a>rhs</a> do not
|
||||||
|
respect user-defined key mappings, so the following
|
||||||
|
effectively reverses the default meanings of the keys
|
||||||
|
<k>d</k> and <k>D</k>
|
||||||
</p>
|
</p>
|
||||||
|
<code><ex>:noremap d D</ex>
|
||||||
|
<ex>:noremap D d</ex></code>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -113,8 +158,7 @@
|
|||||||
<spec>:cmapc<oa>lear</oa></spec>
|
<spec>:cmapc<oa>lear</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Remove all mappings for the applicable mode(s). All user-defined mappings are
|
Remove all user-defined mappings for the applicable mode(s).
|
||||||
cleared.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -155,12 +199,12 @@
|
|||||||
<tags>:map-<silent></tags>
|
<tags>:map-<silent></tags>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When the first argument to one of the mapping commands is <k name="silent"/>,
|
When the first argument to one of the mapping commands is
|
||||||
<a>rhs</a> is not echoed to the command line, nor, for that matter, anything
|
<k name="silent"/>, the keys in <a>rhs</a> are not shown in the
|
||||||
else until the command has completed.
|
command line as they are generated. Nor, for that matter, is
|
||||||
|
anything else until the command has completed.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Below is an overview of which modes each map command applies to:
|
Below is an overview of which modes each map command applies to:
|
||||||
</p>
|
</p>
|
||||||
@@ -175,70 +219,110 @@
|
|||||||
:cmap :cnoremap :cunmap :cmapclear – Command-line mode
|
:cmap :cnoremap :cunmap :cmapclear – Command-line mode
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
<h3 tag="key-notation,key-sequence">Key sequences</h3>
|
<h3 tag="key-notation key-sequence">Key sequences</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For most keys, the key-sequence is the same as the character you see when you
|
Most keys in key sequences are represented simply by the
|
||||||
type that key, however there are some exceptions which allow for a much larger
|
character that you see on the screen when you type them.
|
||||||
number of keys to be used in mappings.
|
However, as a number of these characters have special meanings,
|
||||||
|
and a number of keys have no visual representation, a special
|
||||||
|
notation is required.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><k name="lt"/>, <k><</k>, <k name="Space"/>, <k>\ </k> allow a literal < or space character.</li>
|
|
||||||
<li>', " and \ must be used to avoid escaping issues when mapping a quote or backslash.</li>
|
|
||||||
<li>
|
<li>
|
||||||
<k name="Left"/> <k name="Right"/> <k name="Up"/>
|
The first argument to the <ex>:map</ex> commands must be
|
||||||
<k name="Down"/> <k name="PageUp"/> <k name="PageDown"/>
|
<link topic="quoting">quoted</link> if it contains spaces,
|
||||||
<k name="Esc"/> <k name="CR"/> (for carriage return/enter)
|
quotation marks or back-slashes. A space may additionally be
|
||||||
|
typed as <k name="Space"/>.
|
||||||
</li>
|
</li>
|
||||||
<li><k name="CapsLock"/> <k name="NumLock"/> <k name="Ins"/> <k name="Del"/> <k name="Tab"/> <k name="BS"/> (for a backspace)</li>
|
<li>
|
||||||
|
As special key names start with the <em><</em> character,
|
||||||
|
a literal < must be typed as <k name="lt"/>.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<k name="Left"/>, <k name="Right"/>, <k name="Up"/>,
|
||||||
|
and <k name="Down"/> represent the standard arrow keys.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<k name="CapsLock"/>, <k name="NumLock"/>, <k name="Ins"/>
|
||||||
|
<k name="Del"/>, <k name="Tab"/>, <k name="PageUp"/>,
|
||||||
|
<k name="PageDown"/>, and <k name="Esc"/> work as
|
||||||
|
expected.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<k name="Return"/> or <k name="CR"/> represent the carriage
|
||||||
|
return key.
|
||||||
|
</li>
|
||||||
|
<li><k name="BS"/> represents the backspace key.</li>
|
||||||
<li><k name="F1"/> through <k name="F12"/> work as expected</li>
|
<li><k name="F1"/> through <k name="F12"/> work as expected</li>
|
||||||
|
<li>
|
||||||
|
<k name="K0"/> through <k name="K9"/> represent keys on the
|
||||||
|
numeric keypad.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Most keyboards have some modifiers such as the control, alt or meta keys. In
|
In order to represent key presses using the Control, Alt, Meta,
|
||||||
order to create a mapping that uses these keys the correct prefix must be used
|
or Shift keys, the following prefixes may be used,
|
||||||
within the angle brackets.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li><k name="C-x"/>: The control or ctrl key.</li>
|
<li><k name="C-␣"/>: The control or ctrl key.</li>
|
||||||
<li><k name="A-x"/>: The alt key.</li>
|
<li><k name="A-␣"/>: The alt key.</li>
|
||||||
<li><k name="M-x"/>: The meta key, windows key, or command key</li>
|
<li><k name="M-␣"/>: The meta key, windows key, or command key</li>
|
||||||
<li><k name="S-x"/>: The shift key.</li>
|
<li><k name="S-␣"/>: The shift key.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
These prefixes can be combined however you see fit, though you should note that
|
These prefixes can be combined however you see fit, though you
|
||||||
within angle brackets all alphabetic characters are read as lowercase. In order
|
should note that within angle brackets all alphabetic characters
|
||||||
to force them to be uppercase, you must specify the S- prefix as well.
|
are read as lowercase. Uppercase characters can only be
|
||||||
Additionally, you should never use the S- prefix with a number or piece of
|
specified with the <em>S-</em> modifier. The following key
|
||||||
punctuation, even if you require a shift to type that character; doing so will
|
sequences are interperated as described,
|
||||||
give you a mapping that cannot be typed. With non-character keys, tab and
|
|
||||||
space, the S- modifier works just like C- A- and M-. Some examples may clarify
|
|
||||||
the situation:
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ol>
|
<dl>
|
||||||
<li><k>xc</k>: type x, and then type c</li>
|
<dt><k>xc</k></dt>
|
||||||
<li><k name="C-x">c</k>: hold control and type x, then type c without control</li>
|
<dd>Type the ‘X’ key followed by the ‘C’ key</dd>
|
||||||
<li><k name="C-2"/>: type 2 while holding control</li>
|
|
||||||
<li><k name="C-@"/>: type @ while holding control</li>
|
<dt><k name="C-x">c</k></dt>
|
||||||
<li><k name="S-Space"/>: press space while holding shift</li>
|
<dd>
|
||||||
<li><k name="C-A-j"/>: press j while holding control and alt</li>
|
Type the ‘X’ key while holding the ‘Control’ key, followed
|
||||||
<li><k name="C-A-J"/>: exactly the same as above</li>
|
by the ‘C’ key.
|
||||||
<li><k name="C-A-S-j"/>: press J while holding control and alt</li>
|
</dd>
|
||||||
</ol>
|
|
||||||
|
<dt><k name="C-2"/></dt>
|
||||||
|
<dd>Type the ‘2’ while holding the ‘Control’ key.</dd>
|
||||||
|
|
||||||
|
<dt><k name="C-@"/></dt>
|
||||||
|
<dd>Type the ‘2’ key @ while holding the ‘Control’ key.</dd>
|
||||||
|
|
||||||
|
<dt><k name="S-Space"/></dt>
|
||||||
|
<dd>Press the space bar while holding the ‘Shift’ key.</dd>
|
||||||
|
|
||||||
|
<dt><k name="C-A-j"/></dt>
|
||||||
|
<dd>Type the ‘J’ key while while holding both the ‘Control’ and ‘Alt’ keys.</dd>
|
||||||
|
|
||||||
|
<dt><k name="C-A-J"/></dt>
|
||||||
|
<dd>Exactly the same as above.</dd>
|
||||||
|
|
||||||
|
<dt><k name="C-A-S-j"/></dt>
|
||||||
|
<dd>Type the ‘J’ key while while holding both the ‘Control’, ‘Alt’, and ‘Shift’ keys.</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
<h3 tag=":map-special-chars">Special characters</h3>
|
<h3 tag=":map-special-chars">Special characters</h3>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Nop>]]></tags>
|
<tags><![CDATA[<Nop>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><Nop></spec>
|
<spec><Nop></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Do nothing. This command is useful for disabling a specific mapping.
|
Do nothing. This pseudo-key is useful for disabling a
|
||||||
<ex>:map <k name="C-n"/> <k name="Nop"/></ex> will prevent <k name="C-n"/> from doing anything.
|
specific builtin mapping. For example,
|
||||||
|
<ex>:map <k name="C-n"/> <k name="Nop"/></ex> will prevent <k name="C-n"/>
|
||||||
|
from doing anything.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -246,6 +330,7 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<CR> map_return]]></tags>
|
<tags><![CDATA[<CR> map_return]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><CR></spec>
|
<spec><CR></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -258,20 +343,21 @@
|
|||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Leader> mapleader]]></tags>
|
<tags><![CDATA[<Leader> mapleader \]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><Leader></spec>
|
<spec><Leader></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Expands to the value of the "mapleader" variable in key mapping. If
|
Expands to the value of the ‘mapleader’ variable in key mapping. If
|
||||||
"mapleader" is unset or empty then <str>\</str> is used. Example:
|
‘mapleader’ is unset or empty then ‘\’ is used. For example, by default,
|
||||||
</p>
|
</p>
|
||||||
<code><ex>:map <k name="Leader"/>h :echo <str>Hello</str><k name="CR"/></ex></code>
|
<code><ex>:map <k name="Leader"/>h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
|
||||||
<p>works like</p>
|
<p>works like</p>
|
||||||
<code><ex>:map \h :echo <str>Hello</str><k name="CR"/></ex></code>
|
<code><ex>:map \h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
|
||||||
<p>but after</p>
|
<p>but after</p>
|
||||||
<code><ex>let mapleader = <str>,</str></ex></code>
|
<code><ex>:let mapleader = <str>,</str></ex></code>
|
||||||
<p>it works like</p>
|
<p>it works like</p>
|
||||||
<code><ex>:map ,h :echo <str>Hello</str><k name="CR"/></ex></code>
|
<code><ex>:map ,h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -279,27 +365,27 @@
|
|||||||
<h2 tag="abbreviations">Abbreviations</h2>
|
<h2 tag="abbreviations">Abbreviations</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
&dactyl.appname; can automatically replace words identified as abbreviations,
|
In addition to basic mappings, &dactyl.appname; can also
|
||||||
which may be used to save typing or to correct commonly misspelled
|
automatically replace whole words after they've been typed.
|
||||||
words. An abbreviation can be one of three types that are defined by the
|
These shortcuts are known as abbreviations, and are most often
|
||||||
types of constituent characters. Whitespace and quotes are non-keyword
|
useful for correcting spelling of commonly mistyped words, as
|
||||||
types, and all other characters are keyword types.
|
well as shortening the typing of oft-typed but long words or
|
||||||
|
phrases. There are three basic types of abbreviations, defined
|
||||||
|
by the types of characters they contain,
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ol>
|
<ul>
|
||||||
<li>A "full-id" abbreviation consists entirely of keyword characters (e.g., "teh", "msoft").</li>
|
<li>‘full-id’ abbreviations consist entirely of keyword characters (e.g., ‘teh’, ‘msoft’).</li>
|
||||||
<li>An "end-id" abbreviation ends in keyword character but otherwise contains all non-keyword characters (e.g., "'i").</li>
|
<li>‘end-id’ abbreviations end in keyword character but otherwise contains all non-keyword characters (e.g., ‘'i’).</li>
|
||||||
<li>A "non-id" abbreviation ends in a non-keyword character but otherwise contains any non-whitespace character (e.g., "def'").</li>
|
<li>‘non-id’ abbreviations end in a non-keyword character but otherwise contains any non-whitespace character (e.g., ‘def'’).</li>
|
||||||
</ol>
|
<li>Strings which fit none of the above patterns can not be defined as abbreviations (e.g., ‘a'b’ and ‘a b’).</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Strings that cannot be abbreviations include "a'b" and "a b".
|
For the purposes of abbreviations, keyword characters include
|
||||||
</p>
|
all non-whitespace characters except for single or double
|
||||||
|
quotation marks. Abbreviations are expanded as soon as any
|
||||||
<p>
|
non-keyword character, or the key <k name="C-]"/>, is typed.
|
||||||
An abbreviation is recognized when a space, quote character, or
|
|
||||||
<k name="C-]"/> is typed after the abbreviation. There are no default
|
|
||||||
abbreviations, and abbreviations are never recursive.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
@@ -309,9 +395,10 @@
|
|||||||
<spec>:ab<oa>breviate</oa></spec>
|
<spec>:ab<oa>breviate</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Abbreviate a key sequence. Abbreviate <a>lhs</a> to <a>rhs</a>. If only <a>lhs</a> is given,
|
Abbreviate <a>lhs</a> to <a>rhs</a>. If only <a>lhs</a>
|
||||||
list all abbreviations that start with <a>lhs</a>. If no arguments are given,
|
is given, list all abbreviations that start with
|
||||||
list all abbreviations.
|
<a>lhs</a>. If no arguments are given, list all
|
||||||
|
abbreviations.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -324,8 +411,9 @@
|
|||||||
<spec>:ca<oa>bbrev</oa></spec>
|
<spec>:ca<oa>bbrev</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Abbreviate a key sequence for Command-line mode. Same as <ex>:ab<oa>breviate</oa></ex>,
|
Abbreviate a key sequence for Command-line mode. Same as
|
||||||
but for Command-line mode only.
|
<ex>:ab<oa>breviate</oa></ex>, but for
|
||||||
|
<t>command-line</t> mode only.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -338,8 +426,8 @@
|
|||||||
<spec>:ia<oa>bbrev</oa></spec>
|
<spec>:ia<oa>bbrev</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Abbreviate a key sequence for Insert mode. Same as <ex>:ab<oa>breviate</oa></ex> but
|
Abbreviate a key sequence for Insert mode. Same as
|
||||||
for Insert mode only.
|
<ex>:ab<oa>breviate</oa></ex>, but for insert mode only.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -359,8 +447,9 @@
|
|||||||
<spec>:cuna<oa>bbrev</oa> <a>lhs</a></spec>
|
<spec>:cuna<oa>bbrev</oa> <a>lhs</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Remove an abbreviation for Command-line mode. Same as <ex>:una<oa>bbreviate</oa></ex>,
|
Remove an abbreviation for Command-line mode. Same as
|
||||||
but for Command-line mode only.
|
<ex>:una<oa>bbreviate</oa></ex>, but for
|
||||||
|
<t>command-line</t> mode only.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -371,8 +460,9 @@
|
|||||||
<spec>:iuna<oa>bbrev</oa> <a>lhs</a></spec>
|
<spec>:iuna<oa>bbrev</oa> <a>lhs</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Remove an abbreviation for Insert mode. Same as <ex>:una<oa>bbreviate</oa></ex> but for
|
Remove an abbreviation for Insert mode. Same as
|
||||||
Insert mode only.
|
<ex>:una<oa>bbreviate</oa></ex> but for Insert mode
|
||||||
|
only.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -381,7 +471,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:abc :abclear</tags>
|
<tags>:abc :abclear</tags>
|
||||||
<spec>:abc<oa>lear</oa></spec>
|
<spec>:abc<oa>lear</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Remove all abbreviations.</p>
|
<p>Remove all abbreviations.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -390,8 +480,8 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:cabc :cabclear</tags>
|
<tags>:cabc :cabclear</tags>
|
||||||
<spec>:cabc<oa>lear</oa></spec>
|
<spec>:cabc<oa>lear</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Remove all abbreviations for Command-line mode.</p>
|
<p>Remove all abbreviations for command-line mode.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -399,7 +489,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:iabc :iabclear</tags>
|
<tags>:iabc :iabclear</tags>
|
||||||
<spec>:iabc<oa>lear</oa></spec>
|
<spec>:iabc<oa>lear</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Remove all abbreviations for Insert mode.</p>
|
<p>Remove all abbreviations for Insert mode.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -407,10 +497,21 @@
|
|||||||
|
|
||||||
<h2 tag="user-commands">User-defined commands</h2>
|
<h2 tag="user-commands">User-defined commands</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Defining new commands is perhaps the most straightforward way of
|
||||||
|
repeating commonly used actions. User-defined commands may be
|
||||||
|
entered from the command-line or scripts exactly like standard
|
||||||
|
commands, and may similarly accept arguments, options, counts,
|
||||||
|
and <oa>!</oa>s, as well as provide command-line completion.
|
||||||
|
These commands may be defined as either ordinary,
|
||||||
|
macro-interpolated Ex commands, or otherwise as plain
|
||||||
|
JavaScript statements.
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:com :command</tags>
|
<tags>:com :command</tags>
|
||||||
<spec>:com<oa>mand</oa></spec>
|
<spec>:com<oa>mand</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>List all user-defined commands.</p>
|
<p>List all user-defined commands.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -428,22 +529,34 @@
|
|||||||
<spec>:com<oa>mand</oa><oa>!</oa> <oa><a>attr</a>…</oa> <a>cmd</a> <a>rep</a></spec>
|
<spec>:com<oa>mand</oa><oa>!</oa> <oa><a>attr</a>…</oa> <a>cmd</a> <a>rep</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Define a new user command. The name of the command is <a>cmd</a> and its replacement
|
Define a new user command. The name of the command is
|
||||||
text is <a>rep</a>. The command's attributes are <a>attr</a>. If a command with this name
|
<a>cmd</a> and its replacement text is <a>rep</a>. If a
|
||||||
already exists an error is reported unless <oa>!</oa> is specified, in which case the
|
command with this name already exists, an error is
|
||||||
command is redefined. Unlike Vim, the command may start with a lowercase
|
reported unless <oa>!</oa> is specified, in which case
|
||||||
letter.
|
the command is redefined. Unlike Vim, the command may
|
||||||
|
start with a lowercase letter.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The command's behavior can be specified by providing attributes when the
|
The new command is usually defined by a string to be
|
||||||
command is defined.
|
executed as an Ex command. In this case, before
|
||||||
|
execution, strings of the form
|
||||||
|
<hl key="HelpKey"><<a>var</a>></hl> are interpolated
|
||||||
|
as described below, in order to insert arguments,
|
||||||
|
options, and the like. If the <em>-javascript</em> (short
|
||||||
|
name <em>-js</em>) flag is present, the command is
|
||||||
|
executed as JavaScript, and the arguments are present as
|
||||||
|
variables in its scope instead, and no interpolation is
|
||||||
|
performed.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p tag="E175 E176 :command-nargs">
|
<p>
|
||||||
Argument handling
|
The command's behavior can be altered by providing
|
||||||
|
attributes when the command is defined.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h3 tag="E175 E176 :command-nargs">Argument handling</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
By default user commands accept no arguments. This can be changed by specifying
|
By default user commands accept no arguments. This can be changed by specifying
|
||||||
the -nargs attribute.
|
the -nargs attribute.
|
||||||
@@ -459,9 +572,7 @@
|
|||||||
<dt>-nargs=+</dt><dd>One or more arguments are allowed</dd>
|
<dt>-nargs=+</dt><dd>One or more arguments are allowed</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p tag="E180 E181 :command-complete">
|
<h3 tag="E180 E181 :command-complete">Argument completion</h3>
|
||||||
Argument completion
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Completion for arguments to user defined commands is not available by default.
|
Completion for arguments to user defined commands is not available by default.
|
||||||
@@ -496,9 +607,7 @@
|
|||||||
<dt>custom,<a>func</a></dt><dd>custom completion, provided by <a>func</a></dd>
|
<dt>custom,<a>func</a></dt><dd>custom completion, provided by <a>func</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p tag="E467 E468 :command-completion-custom">
|
<h3 tag="E467 E468 :command-completion-custom">Custom completion</h3>
|
||||||
Custom completion
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Custom completion can be provided by specifying the <str>custom,<a>func</a></str> argument to
|
Custom completion can be provided by specifying the <str>custom,<a>func</a></str> argument to
|
||||||
@@ -516,9 +625,7 @@
|
|||||||
|
|
||||||
<!-- TODO: add examples -->
|
<!-- TODO: add examples -->
|
||||||
|
|
||||||
<p tag="E177 E178 :command-count">
|
<h3 tag="E177 E178 :command-count">Count handling</h3>
|
||||||
Count handling
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
By default user commands do not accept a count. Use the -count attribute if
|
By default user commands do not accept a count. Use the -count attribute if
|
||||||
@@ -526,9 +633,7 @@
|
|||||||
available for expansion as <count> in the argument.
|
available for expansion as <count> in the argument.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p tag=":command-bang">
|
<h3 tag=":command-bang">Special cases</h3>
|
||||||
Special cases
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
By default a user command does not have a special version, i.e. a version
|
By default a user command does not have a special version, i.e. a version
|
||||||
@@ -536,18 +641,14 @@
|
|||||||
and <bang> will be available in the argument.
|
and <bang> will be available in the argument.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p tag=":command-description">
|
<h3 tag=":command-description">Command description</h3>
|
||||||
Command description
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The command's description text can be set with -description. Otherwise it will
|
The command's description text can be set with -description. Otherwise it will
|
||||||
default to "User-defined command".
|
default to "User-defined command".
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p tag=":command-replacement-text">
|
<h3 tag=":command-replacement-text">Replacement text</h3>
|
||||||
Replacement text
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The replacement text <a>rep</a> is scanned for escape sequences and these are
|
The replacement text <a>rep</a> is scanned for escape sequences and these are
|
||||||
@@ -580,7 +681,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:comc :comclear</tags>
|
<tags>:comc :comclear</tags>
|
||||||
<spec>:comc<oa>lear</oa></spec>
|
<spec>:comc<oa>lear</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Delete all user-defined commands.</p>
|
<p>Delete all user-defined commands.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,89 +6,131 @@
|
|||||||
<document
|
<document
|
||||||
name="marks"
|
name="marks"
|
||||||
title="&dactyl.appname; Marks"
|
title="&dactyl.appname; Marks"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="different-marks marks">Marks</h1>
|
<h1 tag="marks">Marks</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
&dactyl.appname; supports a number of different marks:
|
&dactyl.appname; supports a number of different methods of
|
||||||
|
marking your place, in order to easily return later,
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Bookmarks which allow you to mark a web page as one of your favorites for easy access.</li>
|
<li><em>Bookmarks</em> are the standard marks of &dactyl.host;, and are fully supported.</li>
|
||||||
<li>QuickMarks allow you to define up to 62 (a-zA-Z0-9) web sites (or groups of web sites) which you visit most often.</li>
|
<li><em>QuickMarks</em> allow you to quickly save and return as many as 62 (a-zA-Z0-9) different web sites with a quick keyboard shortcut.</li>
|
||||||
<li>Local marks to store the position within a web page.</li>
|
<li><em>Local marks</em> allow you to store and return to a position within the current web page.</li>
|
||||||
<li>History is also a special type of marks, as &dactyl.appname; automatically remembers sites which you have visited in the past.</li>
|
<li><em>URL marks</em> allow you to store and return to the position and URL of the current web page.</li>
|
||||||
|
<li><em>History</em> marks every opened page with data on when and how often it has been visited.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h1 tag="bookmarks">Bookmarks</h1>
|
<h2 tag="bookmarks">Bookmarks</h2>
|
||||||
<toc start="2"/>
|
|
||||||
|
<p>
|
||||||
|
Bookmarks are the most traditional kind of marks supported by
|
||||||
|
&dactyl.appname;. They are accessible through &dactyl.host;'s
|
||||||
|
bookmark menu, sidebar, and toolbar, in addition to its location
|
||||||
|
bar completion system. &dactyl.appname; makes them accessible
|
||||||
|
not only via several commands and its completion system (see the
|
||||||
|
<o>complete</o> option), but also displays a ❤ in the status bar
|
||||||
|
when a bookmarked page is displayed.
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>a :bma :bmark</tags>
|
<tags>a :bma :bmark</tags>
|
||||||
<spec>:bma[rk][!] <oa>-title=title</oa> <oa>-keyword=kw</oa> <oa>-tag=tag1,tag2</oa> <oa>url</oa></spec>
|
<spec>:bma<oa>rk</oa><oa>!</oa> <oa>-title=...</oa> <oa>-keyword=...</oa> <oa>-tag=tag,...</oa> <oa>url</oa></spec>
|
||||||
<spec>a</spec>
|
<spec>a</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Add a bookmark.</p>
|
<p>Add a bookmark.</p>
|
||||||
|
|
||||||
<p>The following options are interpreted:</p>
|
<p>The following options are available,</p>
|
||||||
|
|
||||||
<ul>
|
<dl>
|
||||||
<li>-title="custom title" (short option: -t)</li>
|
<dt>-title</dt>
|
||||||
<li>-tag=comma,separated,tag,list (short option: -T)</li>
|
<dd>
|
||||||
<li>-keyword=keyword (short option: -k)</li>
|
The title of the bookmark.
|
||||||
</ul>
|
Defaults to the page title, if available, or
|
||||||
|
<oa>url</oa> otherwise.
|
||||||
|
(short name <em>-t</em>)
|
||||||
|
</dd>
|
||||||
|
<dt>-tag</dt>
|
||||||
|
<dd>
|
||||||
|
Comma-separated list of tags for grouping and later
|
||||||
|
access (short name <em>-T</em>).
|
||||||
|
</dd>
|
||||||
|
<dt>-keyword</dt>
|
||||||
|
<dd>
|
||||||
|
A keyword which may be used to open the bookmark via
|
||||||
|
the URL bar or <ex>:open</ex> prompt. If the
|
||||||
|
<oa>url</oa> contains the string <em>%s</em> it is
|
||||||
|
replaced by any text following the keyword when it
|
||||||
|
is opened.
|
||||||
|
(short name <em>-k</em>)
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If [!] is present, a new bookmark is always added. Otherwise, the first
|
If <oa>url</oa> is omitted, the URL currently loaded web
|
||||||
bookmark matching <oa>url</oa> is updated.
|
page is used.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When creating a new bookmark, if <oa>-title</oa> isn't given, either the web
|
If <oa>!</oa> is present, a new bookmark is always
|
||||||
page's title or URL is used. You can omit the optional <oa>url</oa> argument, so
|
added. Otherwise, the first bookmark matching
|
||||||
just do <ex>:bmark</ex> to bookmark the currently loaded web page with a default
|
<oa>url</oa> is updated.
|
||||||
title and without any tags.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>A</tags>
|
<tags>A</tags>
|
||||||
|
<strut/>
|
||||||
<spec>A</spec>
|
<spec>A</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Toggle bookmarked state of current URL. Add/remove a bookmark for the current
|
Toggle bookmarked state of current URL. Add/remove a
|
||||||
location, depending on if it is already bookmarked or not. In contrast to the
|
bookmark for the current location, depending on whether
|
||||||
<ex>:bmark</ex> command, the bookmark is just <em>starred</em> which means it is placed
|
it is currently bookmarked. New bookmarks are placed in
|
||||||
in the <em>Unfiled Bookmarks Folder</em> instead of the bookmarks menu.
|
the <em>Unfiled Bookmarks</em> folder, and don't appear
|
||||||
|
in the bookmarks menu or toolbar, but do appear in
|
||||||
|
location bar and <em>:open</em> completions, as well as
|
||||||
|
the <em>:bmarks</em> list.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:bmarks</tags>
|
<tags>:bmarks</tags>
|
||||||
<spec>:bmarks[!] <oa>filter</oa></spec>
|
<spec>:bmarks<oa>!</oa> <oa>filter</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
List or open multiple bookmarks. Open the message window at the bottom of the
|
List or open multiple bookmarks. Opens the message window
|
||||||
screen with all bookmarks which match <oa>filter</oa> either in the title or
|
at the bottom of the screen with all bookmarks with
|
||||||
URL. You can then use extended hint commands like <k>;o</k> to open the desired
|
titles or URLs matching <oa>filter</oa>. The resulting
|
||||||
bookmark.
|
URLs can be clicked, or accessed via extended hint modes
|
||||||
|
such as <k>;o</k>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The special version <ex>:bmarks!</ex> works the same as <ex>:bmarks</ex> except it
|
The special version <ex>:bmarks!</ex> works the same as
|
||||||
opens all the found bookmarks in new tabs.
|
<ex>:bmarks</ex> except that it opens all all matching
|
||||||
|
bookmarks in new tabs rather than listing them.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Filter can also contain the following options:</p>
|
<p>The bookmarks may also be filtered via the following options,</p>
|
||||||
|
|
||||||
<ul>
|
<dl>
|
||||||
<li>-tag=comma,separated,tag,list (short option: -T)</li>
|
<dt>-tag</dt>
|
||||||
<li>-max=N (short options: -m)</li>
|
<dd>
|
||||||
</ul>
|
A comma-separated list of tags, all of which must be
|
||||||
|
present for a match (short name <em>-T</em>).
|
||||||
|
</dd>
|
||||||
|
<dt>-max</dt>
|
||||||
|
<dd>
|
||||||
|
The maximum number of items to list or open
|
||||||
|
(short name <em>-m</em>).
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -98,43 +140,59 @@
|
|||||||
<spec>:delbm[arks]!</spec>
|
<spec>:delbm[arks]!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Delete a bookmark. Deletes <em>all</em> bookmarks which match the <oa>url</oa>. If
|
Deletes <em>all</em> bookmarks which match <oa>url</oa>.
|
||||||
omitted, <oa>url</oa> defaults to the URL of the current buffer. Use <k name="Tab"/>
|
If omitted, <oa>url</oa> defaults to the URL of the
|
||||||
key on a string to complete the URL which you want to delete.
|
current buffer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>If ! is specified then all bookmarks will be deleted.</p>
|
<p>If <oa>!</oa> is specified then all bookmarks will be deleted.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
<!-- TODO: why is this duplicated in browsing? -->
|
|
||||||
<h1 tag="history">History</h1>
|
<h2 tag="history">History</h2>
|
||||||
<toc start="2"/>
|
|
||||||
|
<p>
|
||||||
|
Though not traditionally considered a mark, history behaves very
|
||||||
|
similarly to bookmarks both in &dactyl.host; and
|
||||||
|
&dactyl.appname;. Every visited page is marked and weighted by
|
||||||
|
when and how often it is visited, and can be retrieved both in
|
||||||
|
history list and location completions. Indeed, the ‘frecency’
|
||||||
|
algorithm used to determine the results of location completions
|
||||||
|
(see the <o>complete</o> option) mean that history is often a
|
||||||
|
more effective type of mark than bookmarks themselves.
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-o>]]></tags>
|
<tags><![CDATA[<C-o>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><![CDATA[[count]<C-o>]]></spec>
|
<spec><![CDATA[[count]<C-o>]]></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to an older position in the jump list. The jump list is just the browser
|
Go to an older position in the jump list. This currently
|
||||||
history for now. If <oa>count</oa> is specified go back <oa>count</oa> pages.
|
entails moving backward in page history, but in the
|
||||||
|
future will take into account page positions as well.
|
||||||
|
If <oa>count</oa> is specified go back <oa>count</oa> pages.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-i>]]></tags>
|
<tags><![CDATA[<C-i>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><![CDATA[[count]<C-i>]]></spec>
|
<spec><![CDATA[[count]<C-i>]]></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to a newer position in the jump list. The jump list
|
Go to an newer position in the jump list. This currently
|
||||||
is just the browser history for now. If <oa>count</oa>
|
entails moving forward in page history, but in the
|
||||||
is specified go forward <oa>count</oa> pages.
|
future will take into account page positions as well.
|
||||||
|
If <oa>count</oa> is specified go forward <oa>count</oa> pages.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<M-Left> <A-Left> H]]></tags>
|
<tags><![CDATA[<M-Left> <A-Left> H]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec>[count]H</spec>
|
<spec>[count]H</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Go back in the browser history. If <oa>count</oa> is specified go back <oa>count</oa> pages.</p>
|
<p>Go back in the browser history. If <oa>count</oa> is specified go back <oa>count</oa> pages.</p>
|
||||||
@@ -143,7 +201,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<M-Right> <A-Right> L]]></tags>
|
<tags><![CDATA[<M-Right> <A-Right> L]]></tags>
|
||||||
<spec>[count]L</spec>
|
<strut/>
|
||||||
|
<spec><oa>count</oa>L</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go forward in the browser history. If <oa>count</oa> is specified go forward <oa>count</oa>
|
Go forward in the browser history. If <oa>count</oa> is specified go forward <oa>count</oa>
|
||||||
@@ -154,8 +213,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:ba :back</tags>
|
<tags>:ba :back</tags>
|
||||||
<spec>:[count]ba[ck] <oa>url</oa></spec>
|
<spec>:<oa>count</oa>ba<oa>ck</oa> <oa>url</oa></spec>
|
||||||
<spec>:[count]ba[ck]!</spec>
|
<spec>:<oa>count</oa>ba<oa>ck</oa>!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go back in the browser history. If <oa>count</oa> is specified go back <oa>count</oa> pages.
|
Go back in the browser history. If <oa>count</oa> is specified go back <oa>count</oa> pages.
|
||||||
@@ -168,8 +227,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:fw :fo :forward</tags>
|
<tags>:fw :fo :forward</tags>
|
||||||
<spec>:[count]fo[rward] <oa>url</oa></spec>
|
<spec>:<oa>count</oa>fo<oa>rward</oa> <oa>url</oa></spec>
|
||||||
<spec>:[count]fo[rward]!</spec>
|
<spec>:<oa>count</oa>fo<oa>rward</oa>!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go forward in the browser history. If <oa>count</oa> is specified go forward <oa>count</oa>
|
Go forward in the browser history. If <oa>count</oa> is specified go forward <oa>count</oa>
|
||||||
@@ -183,78 +242,87 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:hs :hist :history</tags>
|
<tags>:hs :hist :history</tags>
|
||||||
<spec>:hist[ory][!] <oa>filter</oa></spec>
|
<spec>:hist<oa>ory</oa><oa>!</oa> <oa>filter</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show recently visited URLs. Open the message window at the bottom of the screen
|
Show recently visited URLs. Opens the message window at the bottom of the screen
|
||||||
with all history items which match <oa>filter</oa> either in the title or URL.
|
with all history items whose page titles or URLs match
|
||||||
|
<oa>filter</oa>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The special version <ex>:history!</ex> works the same as <ex>:history</ex> except
|
The special version <ex>:history!</ex> works the same as
|
||||||
it opens all the found items in new tabs.
|
<ex>:history</ex> except that it opens all all matching
|
||||||
|
pages in new tabs rather than listing them.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Filter can also contain the following options:</p>
|
<p>The pages may also be filtered via the following options,</p>
|
||||||
|
|
||||||
<ul>
|
<dl>
|
||||||
<li>-max=N (short options: -m)</li>
|
<dt>-max</dt>
|
||||||
</ul>
|
<dd>
|
||||||
|
The maximum number of items to list or open
|
||||||
|
(short name <em>-m</em>).
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<h1 tag="quickmarks">QuickMarks</h1>
|
<h2 tag="quickmarks">QuickMarks</h2>
|
||||||
<toc start="2"/>
|
|
||||||
|
<p>
|
||||||
|
QuickMarks are bookmarks stripped to the bone for quickly
|
||||||
|
getting to the pages that you visit most. A QuickMark is very
|
||||||
|
simply a URL assigned to a letter or number. They can therefore
|
||||||
|
be saved or opened with only three key presses each.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<tags>M</tags>
|
||||||
|
<strut/>
|
||||||
|
<spec>M<a>a-zA-Z0-9</a></spec>
|
||||||
|
<description>
|
||||||
|
<p>
|
||||||
|
Add new QuickMark for current URL. You can later jump to
|
||||||
|
the mark with <k>go</k><a>a-zA-Z0-9</a>
|
||||||
|
<k>gn</k><a>a-zA-Z0-9</a>. QuickMarks are persistent
|
||||||
|
across browser sessions.
|
||||||
|
</p>
|
||||||
|
</description>
|
||||||
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>go</tags>
|
<tags>go</tags>
|
||||||
<spec>a-zA-Z0-9</spec>
|
<strut/>
|
||||||
|
<spec>go<a>a-zA-Z0-9</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Jump to a QuickMark in the current tab. Open any QuickMark in the current tab.
|
Jump to a QuickMark in the current tab. See also
|
||||||
You can mark any URLs with <k>M</k><a>a-zA-Z0-9</a>. These QuickMarks are
|
<k>M</k> and <ex>:qmark</ex>.
|
||||||
persistent across browser sessions.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gn</tags>
|
<tags>gn</tags>
|
||||||
<spec>a-zA-Z0-9</spec>
|
<strut/>
|
||||||
|
<spec>gn<a>a-zA-Z0-9</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Jump to a QuickMark in a new tab. Works like
|
Jump to a QuickMark in a new tab. The new tab is focused
|
||||||
<k>go</k><a>a-zA-Z0-9</a> but opens the QuickMark in a
|
only if <o>activate</o> contains <em>quickmark</em> or
|
||||||
new tab. Whether the new tab is activated or not depends
|
<em>all</em>. See also <k>M</k> and <ex>:qmark</ex>.
|
||||||
on the <o>activate</o> option.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Mnemonic: Go in a new tab. <k>gt</k> would make more
|
|
||||||
sense but is already taken.
|
|
||||||
</p>
|
|
||||||
</description>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item>
|
|
||||||
<tags>M</tags>
|
|
||||||
<spec>a-zA-Z0-9</spec>
|
|
||||||
<description>
|
|
||||||
<p>
|
|
||||||
Add new QuickMark for current URL. You can go to a
|
|
||||||
marked URL in the current tab with
|
|
||||||
<k>go</k><a>a-zA-Z0-9</a> or in a new tab with
|
|
||||||
<k>gn</k><a>a-zA-Z0-9</a>. These QuickMarks are
|
|
||||||
persistent across browser sessions.
|
|
||||||
</p>
|
</p>
|
||||||
|
<p>Mnemonic: Go in a new tab.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:delqm :delqmarks</tags>
|
<tags>:delqm :delqmarks</tags>
|
||||||
<spec>marks</spec>
|
<spec>:delqm<oa>arks</oa> <a>arg</a></spec>
|
||||||
<spec>:delqm[arks]!</spec>
|
<spec>:delqm<oa>arks</oa>!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Delete the specified QuickMarks. QuickMarks are presented as a list.</p>
|
<p>Delete the specified QuickMarks.</p>
|
||||||
|
|
||||||
<p>Examples:</p>
|
<p>Examples:</p>
|
||||||
|
|
||||||
@@ -268,35 +336,56 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:qma :qmark</tags>
|
<tags>:qma :qmark</tags>
|
||||||
<spec>a-zA-Z0-9</spec>
|
<spec>:qmark <a>a-zA-Z0-9</a> <a>url</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Mark a URL with a letter for quick access. You can also mark whole groups
|
Mark <a>url</a> with a letter for quick access. See also
|
||||||
like this:
|
<k>go</k>, <k>gn</k>, and <k>M</k>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<ex>:qmark f http://forum1.com, http://forum2.com, imdb some artist</ex>
|
In addition to simple URLs, <a>url</a> may be any string
|
||||||
|
that can be passed to <ex>:open</ex>, including bookmark
|
||||||
|
and search keywords and comma-separated lists of URLs to
|
||||||
|
be opened in multiple tabs, such as,
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<code><ex>:qmark f http://wwww.pandora.com, google Tim Minchin</ex></code>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:qmarks</tags>
|
<tags>:qmarks</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:qmarks <oa>arg</oa></spec>
|
<spec>:qmarks <oa>arg</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show all QuickMarks. If <oa>arg</oa> is specified then
|
List QuickMarks. If <oa>arg</oa> is given then limit the
|
||||||
limit the list to those QuickMarks mentioned.
|
list to those QuickMarks mentioned, otherwise list them
|
||||||
|
all.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
<h1 tag="localmarks">Local marks</h1>
|
|
||||||
<toc start="2"/>
|
<h2 tag="urlmarks localmarks">Local marks and URL marks</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Local and URL marks allow you to mark your position on the
|
||||||
|
current page to quickly return later. Each mark is assigned to a
|
||||||
|
letter. Lowercase letters behave as local marks, while uppercase
|
||||||
|
letters act as URL marks. The difference between the two is
|
||||||
|
that local marks apply uniquely to each page, while URL marks
|
||||||
|
mark a specific position on a specific page. So, while the mark
|
||||||
|
<em>m</em> may take you to the top of the page on Site 1, it may
|
||||||
|
take you to the middle on Site 2. The mark <em>M</em>, on the
|
||||||
|
other hand, will always return you to Site 1, no matter where
|
||||||
|
before hand.
|
||||||
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>m</tags>
|
<tags>m</tags>
|
||||||
<spec>a-zA-Z</spec>
|
<strut/>
|
||||||
|
<spec>m<a>a-zA-Z</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Set mark at the cursor position. Marks a-z are local to the buffer, whereas
|
Set mark at the cursor position. Marks a-z are local to the buffer, whereas
|
||||||
@@ -307,7 +396,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>` '</tags>
|
<tags>` '</tags>
|
||||||
<spec>a-zA-Z</spec>
|
<strut/>
|
||||||
|
<spec>'<a>a-zA-Z</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Jump to the mark. Marks a-z are local to the buffer, whereas A-Z are valid
|
Jump to the mark. Marks a-z are local to the buffer, whereas A-Z are valid
|
||||||
@@ -318,15 +408,15 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:delm :delmarks</tags>
|
<tags>:delm :delmarks</tags>
|
||||||
<spec>marks</spec>
|
<spec>:delm<oa>arks</oa> <a>arg</a></spec>
|
||||||
<spec>:delm[arks]!</spec>
|
<spec>:delm<oa>arks</oa>!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Delete the specified marks. Marks are presented as a list.</p>
|
<p>Delete the specified marks.</p>
|
||||||
|
|
||||||
<p>Examples:</p>
|
<p>Examples:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><ex>:delmarks Aa b p</ex> deletes marks A, a, b and p</li>
|
<li><ex>:delmarks Aa b p</ex> deletes marks A, a, b, and p</li>
|
||||||
<li><ex>:delmarks b-p</ex> deletes all marks in the range b to p</li>
|
<li><ex>:delmarks b-p</ex> deletes all marks in the range b to p</li>
|
||||||
<li><ex>:delmarks!</ex> deletes all marks for the current buffer</li>
|
<li><ex>:delmarks!</ex> deletes all marks for the current buffer</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -336,20 +426,21 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:ma :mark</tags>
|
<tags>:ma :mark</tags>
|
||||||
<spec>a-zA-Z</spec>
|
<spec>:mark <a>a-zA-Z</a></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Mark current location within the web page.</p>
|
<p>Mark current location within the web page.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:marks</tags>
|
<tags>:marks</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:marks <oa>arg</oa></spec>
|
<spec>:marks <oa>arg</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show all location marks of the current web page. If
|
Show all local marks for the current web page and all
|
||||||
<oa>arg</oa> is specified then limit the list to those
|
URL marks. If <oa>arg</oa> is specified then limit the
|
||||||
marks mentioned.
|
list to those marks mentioned.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,25 +6,25 @@
|
|||||||
<document
|
<document
|
||||||
name="message"
|
name="message"
|
||||||
title="&dactyl.appname; Messages"
|
title="&dactyl.appname; Messages"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:dactyl="&xmlns.dactyl;"
|
||||||
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="messages">Error and informational messages</h1>
|
<h1 tag="messages">Error and informational messages</h1>
|
||||||
<toc start="2"/>
|
|
||||||
|
|
||||||
<tags>message-history</tags>
|
<tags>message-history</tags>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
&dactyl.appname; stores all info and error messages in a message
|
&dactyl.appname; stores all info and error messages in a message
|
||||||
history. The type of info messages output can be controlled by
|
history. The type of info messages output can be controlled by
|
||||||
the <o>verbose</o> option. The number of stored messages can be set
|
the <o>verbose</o> option. The maximum number of stored messages
|
||||||
with the <o>messages</o> option.
|
can be limited with the <o>messages</o> option.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:mes :messages</tags>
|
<tags>:mes :messages</tags>
|
||||||
<spec>:mes<oa>sages</oa></spec>
|
<spec>:mes<oa>sages</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Display previously given messages.</p>
|
<p>Display previously shown messages.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:messc :messclear</tags>
|
<tags>:messc :messclear</tags>
|
||||||
<spec>:messc<oa>lear</oa></spec>
|
<spec>:messc<oa>lear</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Clear the message history.</p>
|
<p>Clear the message history.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[g<]]></tags>
|
<tags><![CDATA[g<]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec>g<</spec>
|
<spec>g<</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -49,34 +50,37 @@
|
|||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<!-- FIXME: Everything the follows is horrendous. -->
|
||||||
|
|
||||||
<tags>pager more-prompt</tags>
|
<tags>pager more-prompt</tags>
|
||||||
|
|
||||||
<code>
|
<code dactyl:highlight="MoreMsg">
|
||||||
-- More --
|
-- More --
|
||||||
-- More -- SPACE/d/j: screen/page/line down, b/u/k: up, q: quit
|
-- More -- SPACE/d/j: screen/page/line down, b/u/k: up, q: quit
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This message is given when the message window is filled with messages. It is
|
This message is displayed when the message window is filled with
|
||||||
only given when the <o>more</o> option is on. It is highlighted with the <em>MoreMsg</em>
|
messages and the <o>more</o> option is set. It is styled with
|
||||||
group.
|
the <em>MoreMsg</em> <ex>:highlight</ex> group. When the more
|
||||||
|
message is shown, the following key mappings are available:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt><k name="CR"/> or j or <k name="Down"/> </dt><dd>one more line</dd>
|
<dt><k name="CR"/> or j or <k name="Down"/></dt> <dd>one more line</dd>
|
||||||
<dt>d </dt><dd>down a page (half a screen)</dd>
|
<dt>d</dt> <dd>down a page (half a screen)</dd>
|
||||||
<dt><k name="Space"/> or <k name="PageDown"/></dt><dd>down a screen</dd>
|
<dt><k name="Space"/> or <k name="PageDown"/></dt><dd>down a screen</dd>
|
||||||
<dt>G </dt><dd>down all the way, until the hit-enter prompt</dd>
|
<dt>G</dt> <dd>down all the way, until the hit-enter prompt</dd>
|
||||||
<dt/><dd/>
|
<dt/><dd/>
|
||||||
<dt><k name="BS"/> or k or <k name="Up"/> </dt><dd>one line back</dd>
|
<dt><k name="BS"/> or k or <k name="Up"/></dt> <dd>one line back</dd>
|
||||||
<dt>u </dt><dd>up a page (half a screen)</dd>
|
<dt>u</dt> <dd>up a page (half a screen)</dd>
|
||||||
<dt>b or <k name="PageUp"/> </dt><dd>back a screen</dd>
|
<dt>b or <k name="PageUp"/></dt> <dd>back a screen</dd>
|
||||||
<dt>g </dt><dd>back to the start</dd>
|
<dt>g</dt> <dd>back to the start</dd>
|
||||||
<dt/><dd/>
|
<dt/><dd/>
|
||||||
<dt>q, <k name="Esc"/> or CTRL-C </dt><dd>stop the listing</dd>
|
<dt>q, <k name="Esc"/> or CTRL-C</dt> <dd>stop the listing</dd>
|
||||||
<dt>: </dt><dd>stop the listing and enter a command-line</dd>
|
<dt>:</dt> <dd>stop the listing and enter a command-line</dd>
|
||||||
<dt>; </dt><dd>start an <t>extended-hints</t> command</dd>
|
<dt>;</dt> <dd>start an <t>extended-hints</t> command</dd>
|
||||||
<dt><k name="C-Y"/> </dt><dd>yank (copy) a modeless selection to the clipboard</dd>
|
<dt><k name="C-Y"/></dt> <dd>yank (copy) a modeless selection to the clipboard</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
@@ -6,21 +6,46 @@
|
|||||||
<document
|
<document
|
||||||
name="pattern"
|
name="pattern"
|
||||||
title="&dactyl.appname; Patterns"
|
title="&dactyl.appname; Patterns"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="text-search-commands">Text search commands</h1>
|
<h1 tag="text-search-commands">Text search commands</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
&dactyl.appname; provides a Vim-like interface to &dactyl.host;'s standard text search
|
&dactyl.appname; provides a Vim-like incremental search interface to
|
||||||
functionality. There is no support for using regular expressions in search
|
replace &dactyl.host;'s crippled Typeahead Find. Among other improvements,
|
||||||
commands as &dactyl.host; does not provide native regex support. It is unlikely that
|
our search service:
|
||||||
this will ever be available.
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
Starts at the cursor position in the currently selected frame, unlike
|
||||||
|
&dactyl.host;, which always starts at the beginning of the first frame
|
||||||
|
for documents with more than one frame.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Returns the cursor and viewport to their original position on cancel.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Backtracks to the first successful match after pressing backspace,
|
||||||
|
unlike &dactyl.host;, which will always continue from the last match..
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Supports reverse incremental search.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Escape sequences to toggle link-only and case-sensitive searching.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Regular expression search, however, is not currently available unless the
|
||||||
|
/Find Bar/ service is installed, in which case it may be toggled on with
|
||||||
|
a search flag.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>/</tags>
|
<tags>/</tags>
|
||||||
<spec>/<a>pattern</a>[/]<CR></spec>
|
<spec>/<a>pattern</a><oa>/</oa><k name="CR"/></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Search forward for the first occurrence of <a>pattern</a>.</p>
|
<p>Search forward for the first occurrence of <a>pattern</a>.</p>
|
||||||
|
|
||||||
@@ -31,13 +56,19 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>\c</dt> <dd>Perform case insensitive search (default
|
<dt>\c</dt> <dd>Perform case insensitive search (default if <o>ignorecase</o> is set).</dd>
|
||||||
if <o>ignorecase</o> is set).</dd>
|
|
||||||
<dt>\C</dt> <dd>Perform case sensitive search</dd>
|
<dt>\C</dt> <dd>Perform case sensitive search</dd>
|
||||||
<dt>\l</dt> <dd>Search only in links, as defined by
|
<dt>\l</dt> <dd>Search only in links, as defined by <o>hinttags</o>. (default if <o>linksearch</o> is set).</dd>
|
||||||
<o>hinttags</o>. (default if <o>linksearch</o> is
|
<dt>\L</dt> <dd>Search the entire page.</dd>
|
||||||
set).</dd>
|
</dl>
|
||||||
<dt>\L</dt> <dd>Do not search only in links.</dd>
|
|
||||||
|
<p>
|
||||||
|
Additionally, if the /Find Bar/ extension is installed, the
|
||||||
|
following flags may be used,
|
||||||
|
</p>
|
||||||
|
<dl>
|
||||||
|
<dt>\r</dt> <dd>Process the entire pattern as a regular expression.</dd>
|
||||||
|
<dt>\R</dt> <dd>Process the entire pattern as an ordinary string.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -45,13 +76,9 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>?</tags>
|
<tags>?</tags>
|
||||||
<spec>?<a>pattern</a>[?]<CR></spec>
|
<spec>?<a>pattern</a><oa>?</oa><k name="CR"/></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Search backwards for <a>pattern</a>.</p>
|
<p>Search backward for <a>pattern</a>, in exactly the same manner as <k>/</k>.</p>
|
||||||
|
|
||||||
<p><a>pattern</a> can use the same modifiers as for <k>/</k>.</p>
|
|
||||||
|
|
||||||
<note>Incremental searching currently only works in the forward direction.</note>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -59,7 +86,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>n</tags>
|
<tags>n</tags>
|
||||||
<spec>n</spec>
|
<spec>n</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Find next. Repeat the last search.</p>
|
<p>Find next. Repeat the last search.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -68,7 +95,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>N</tags>
|
<tags>N</tags>
|
||||||
<spec>N</spec>
|
<spec>N</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Find previous. Repeat the last search in the opposite direction.</p>
|
<p>Find previous. Repeat the last search in the opposite direction.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -77,7 +104,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>*</tags>
|
<tags>*</tags>
|
||||||
<spec>*</spec>
|
<spec>*</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Search forward for the next word under the cursor.</p>
|
<p>Search forward for the next word under the cursor.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -86,7 +113,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>#</tags>
|
<tags>#</tags>
|
||||||
<spec>#</spec>
|
<spec>#</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Search backward for the previous word under the cursor.</p>
|
<p>Search backward for the previous word under the cursor.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -94,11 +121,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:noh :nohlsearch</tags>
|
<tags>:noh :nohlsearch</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:noh<oa>lsearch</oa></spec>
|
<spec>:noh<oa>lsearch</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Remove the search highlighting. The document highlighting is turned back on
|
Remove the search highlighting. The document is highlighted again
|
||||||
when another search command is used or the <o>hlsearch</o> option is set.
|
when another search command is used or the <o>hlsearch</o> option
|
||||||
|
is set.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<document
|
<document
|
||||||
name="print"
|
name="print"
|
||||||
title="&dactyl.appname; Printing"
|
title="&dactyl.appname; Printing"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="printing">Printing</h1>
|
<h1 tag="printing">Printing</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,28 @@
|
|||||||
<document
|
<document
|
||||||
name="repeat"
|
name="repeat"
|
||||||
title="&dactyl.appname; Repeating Commands"
|
title="&dactyl.appname; Repeating Commands"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="repeating">Repeating commands</h1>
|
<h1 tag="repeating">Repeating commands</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<p>&dactyl.appname; can repeat a number of commands and record macros.</p>
|
<p>
|
||||||
|
&dactyl.appname; can repeat commands in a number of ways, from repeating
|
||||||
|
the last command, to recording and playing macros, to saving its state and
|
||||||
|
executing scripts.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2 tag="single-repeat">Single repeats</h2>
|
<h2 tag="single-repeat">Single repeats</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>.</tags>
|
<tags>.</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>.</spec>
|
<spec><oa>count</oa>.</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Repeat the last keyboard mapping <oa>count</oa> times. Note that, unlike in Vim, this
|
Repeat the last keyboard mapping <oa>count</oa> times. Note that,
|
||||||
does not apply solely to editing commands, mainly because &dactyl.appname; doesn't
|
unlike in Vim, this does not apply solely to editing commands,
|
||||||
have them.
|
mainly because &dactyl.appname; doesn't have them.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -30,6 +35,7 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>@:</tags>
|
<tags>@:</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>@:</spec>
|
<spec><oa>count</oa>@:</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Repeat the last Ex command <oa>count</oa> times.</p>
|
<p>Repeat the last Ex command <oa>count</oa> times.</p>
|
||||||
@@ -42,12 +48,14 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>q</tags>
|
<tags>q</tags>
|
||||||
|
<strut/>
|
||||||
<spec>q<a>0-9a-zA-Z</a></spec>
|
<spec>q<a>0-9a-zA-Z</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Record a key sequence into a macro.
|
Record a key sequence as a macro. Available macros are
|
||||||
Available macros are {0-9a-zA-Z} (uppercase to append).
|
<a>0-9a-zA-Z</a>. If the macro is an uppercase letter, the
|
||||||
Type <k>q</k> to stop recording.
|
recorded keys are appended to the lowercase macro of the same
|
||||||
|
name. Typing <k>q</k> again stops the recording.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -58,8 +66,8 @@
|
|||||||
<spec>:mac<oa>ros</oa> <oa>pat</oa></spec>
|
<spec>:mac<oa>ros</oa> <oa>pat</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
List recorded macros matching the optional regular expression <oa>pat</oa>. If
|
List recorded macros matching the optional regular expression
|
||||||
no regex is given, list all macros.
|
<oa>pat</oa>. If no regex is given, list all macros.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -67,12 +75,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:delmac :delmacros</tags>
|
<tags>:delmac :delmacros</tags>
|
||||||
<spec>:delmac<oa>ros</oa> <a>args</a></spec>
|
<spec>:delmac<oa>ros</oa> <a>pat</a></spec>
|
||||||
<spec>:delmac<oa>ros</oa>!</spec>
|
<spec>:delmac<oa>ros</oa>!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Delete recorded macros matching the regular expression <a>args</a>. If <oa>!</oa> is given
|
Delete recorded macros matching the regular expression
|
||||||
all macros are deleted.
|
<a>pat</a>. If <em>!</em> is given, all macros are deleted.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -80,12 +88,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>@ :play</tags>
|
<tags>@ :play</tags>
|
||||||
<spec>:pl<oa>ay</oa> <a>arg</a></spec>
|
<spec>:pl<oa>ay</oa> <a>a-z0-9</a></spec>
|
||||||
<spec><oa>count</oa>@<a>arg</a></spec>
|
<spec><oa>count</oa>@<a>a-z0-9</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Plays the contents of macro with name <a>arg</a> <oa>count</oa> times. The <k>@</k> mapping
|
Plays the contents of macro with name <a>a-z0-9</a> <oa>count</oa>
|
||||||
only accepts {0-9a-z} as <a>arg</a>.
|
times.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -94,7 +102,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>@@</tags>
|
<tags>@@</tags>
|
||||||
<spec><oa>count</oa>@@</spec>
|
<spec><oa>count</oa>@@</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Replay the last executed macro <oa>count</oa> times.</p>
|
<p>Replay the last executed macro <oa>count</oa> times.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -108,57 +116,91 @@
|
|||||||
<spec>:so<oa>urce</oa><oa>!</oa> <a>file</a></spec>
|
<spec>:so<oa>urce</oa><oa>!</oa> <a>file</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Read Ex commands, JavaScript, or CSS from <a>file</a>. You can either source files
|
Read Ex commands, JavaScript, or CSS from <a>file</a>. Files are
|
||||||
which mostly contain Ex commands like <ex>map < gt</ex> and put JavaScript code
|
interperated based on their extensions. Files when end in
|
||||||
within a:
|
<em>.js</em> are executed as JavaScript, while those ending in
|
||||||
|
<em>.css</em> are loaded as Cascading Stylesheets, and anything
|
||||||
|
else is interperated as Ex commands. In normal cases, any errors
|
||||||
|
generated by the execution or non-existence of <a>file</a> are
|
||||||
|
printed to the <t>command-line</t> area. When <oa>!</oa> is
|
||||||
|
provided, these are suppressed.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<code><![CDATA[
|
<p>
|
||||||
js <<EOF
|
Environment variables in <a>file</a> are expanded to their current
|
||||||
hello = function () {
|
value, and the prefix <em>~</em> is replaced with the value of
|
||||||
alert("Hello world");
|
<em>$HOME</em>. See <t>expand-env</t> and <t>initialization</t>
|
||||||
|
for more information.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 tag=":source-css">Cascading Stylesheets</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
When a CSS file is sourced, its contents are applied to every web
|
||||||
|
page and every chrome document, including all browser windows and
|
||||||
|
dialogs. If the same file is sourced more than once, its previous
|
||||||
|
rules are cleared before it is applied again. Rules can be
|
||||||
|
restricted to specific documents by enclosing them
|
||||||
|
<link topic="https://developer.mozilla.org/en/CSS/@-moz-document">@-moz-document</link>
|
||||||
|
blocks.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 tag=":source-javascript">JavaScript</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
JavaScript files are executed with full chrome privileges in their
|
||||||
|
own global namespaces. These namespaces are stored as objects in
|
||||||
|
the <em>plugins</em> object, in the property named for the full
|
||||||
|
path of the sourced file. This means that any variables or
|
||||||
|
functions created by your script are stored as properties of that
|
||||||
|
object. Additionally, all properties of the global <em>window</em>
|
||||||
|
and <em>modules</em> objects are accessible to your script as
|
||||||
|
global variables.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Files in <em>~/.&dactyl.name;/plugins</em> may additionally be
|
||||||
|
accessed in <em>plugins.<a>filename</a></em> where <a>filename</a>
|
||||||
|
is the last component of the file's path stripped of any
|
||||||
|
extensions, with all hyphens stripped and any letter following a
|
||||||
|
hyphen capitalized. So, the file
|
||||||
|
<em>~/.&dactyl.name;/plugins/foo-bar.js</em> may be accessed as
|
||||||
|
<em>plugins.fooBar</em>. See also <t>writing-plugins</t>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 tag=":source-ex">Ex commands</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Ex command files are executed as if each line were entered into
|
||||||
|
the <t>command-line</t> individually. Additionally, certain
|
||||||
|
commands support the same ‘here document’ syntax supported by most
|
||||||
|
Unix shells and by the <t>command-line</t>. So, to execute a
|
||||||
|
JavaScript statement which does not comfortably fit on a single
|
||||||
|
line, you can use,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<code><ex>js</ex> <<<em>EOF</em>
|
||||||
|
<hl key="Object">var</hl> hello = <hl key="Key">function</hl> () {
|
||||||
|
alert(<str>Hello world</str>);
|
||||||
}
|
}
|
||||||
EOF
|
<em>EOF</em></code>
|
||||||
]]></code>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Or you can alternatively source a file which ends in <tt>.js</tt>. These files are
|
|
||||||
automatically sourced as pure JavaScript files.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Note: In both cases you must add functions to the global window object like
|
|
||||||
shown above, functions written as:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<code><![CDATA[
|
|
||||||
function hello2() {
|
|
||||||
alert("Hello world");
|
|
||||||
}
|
|
||||||
]]></code>
|
|
||||||
<p>are only available within the scope of the script.</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The <tt>.&dactyl.name;rc</tt> file in your home directory and any
|
|
||||||
files in <tt>~/.&dactyl.name;/plugin/</tt> are always
|
|
||||||
sourced at startup. <tt>~</tt> is supported as a
|
|
||||||
shortcut for the <tt>$HOME</tt> directory. If <oa>!</oa> is
|
|
||||||
specified, errors are not printed.
|
|
||||||
</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:lpl :loadplugins</tags>
|
<tags>:lpl :loadplugins</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:loadplugins</spec>
|
<spec>:loadplugins</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Load all unloaded plugins immediately. Because plugins are automatically
|
Immediately load all plugins which have yet to be loaded. Because
|
||||||
loaded after &dactyl.name;rc is sourced, this command must be placed early
|
plugins are not automatically loaded until after &dactyl.name;rc
|
||||||
in the &dactyl.name;rc file if &dactyl.name;rc also includes commands that are
|
is sourced, this command must be placed early in the
|
||||||
implemented by plugins. Additionally, this command allows for sourcing
|
&dactyl.name;rc file if &dactyl.name;rc uses commands or options
|
||||||
new plugins without restarting &dactyl.appname;.
|
which are defined by plugins. Additionally, this command allows
|
||||||
|
newly installed plugins to be easily loaded without restarting
|
||||||
|
&dactyl.appname;.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -169,13 +211,12 @@ function hello2() {
|
|||||||
<spec>:runt<oa>ime</oa><oa>!</oa> <a>file</a> …</spec>
|
<spec>:runt<oa>ime</oa><oa>!</oa> <a>file</a> …</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Source the specified file from each directory in <o>runtimepath</o>. Example:
|
Source the specified file from the first directory in
|
||||||
</p>
|
<o>runtimepath</o> in which it exists. When <oa>!</oa> is given,
|
||||||
<code><ex>:runtime plugin/foobar.vimp</ex></code>
|
source the specified from all directories in <o>runtimepath</o> in
|
||||||
<p>
|
which it exists.
|
||||||
Only the first found file is sourced. When <oa>!</oa> is given, all found files are
|
|
||||||
sourced.
|
|
||||||
</p>
|
</p>
|
||||||
|
<example><ex>:runtime plugins/foobar.js</ex></example>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -191,11 +232,12 @@ function hello2() {
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:fini :finish</tags>
|
<tags>:fini :finish</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:fini<oa>sh</oa></spec>
|
<spec>:fini<oa>sh</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Stop sourcing a script file. This can only be called from within a &dactyl.appname;
|
Stop sourcing a script file. This can only be called from within a
|
||||||
script file.
|
&dactyl.appname; script file.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -208,16 +250,17 @@ function hello2() {
|
|||||||
<spec>:<oa>count</oa>time<oa>!</oa> <a>code|:command</a></spec>
|
<spec>:<oa>count</oa>time<oa>!</oa> <a>code|:command</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Profile a piece of code or a command. Run <a>code</a> <oa>count</oa> times (default: 1)
|
Profile a piece of JavaScript code or an Ex command. Run
|
||||||
and returns the elapsed time. <a>code</a> is always passed to JavaScript's eval(),
|
<a>code</a> <oa>count</oa> times and print the elapsed time.
|
||||||
which might be slow, so take the results with a grain of salt.
|
If <a>code</a> begins with a <ex>:</ex>, it is executed as an Ex
|
||||||
|
command. Otherwise, it is executed as JavaScript, in which case it
|
||||||
|
is evaluated only once and stored as a function which is executed
|
||||||
|
<oa>count</oa> times.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>If <a>code</a> starts with a <ex>:</ex>, it is executed as a &dactyl.appname; command.</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Use the special version with <oa>!</oa> if you just want to run any command multiple
|
When <oa>!</oa> is given, <a>code</a> is executed <oa>count</oa>
|
||||||
times without showing profiling statistics.
|
times, but no statistics are printed.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
<document
|
<document
|
||||||
name="starting"
|
name="starting"
|
||||||
title="&dactyl.appname; Starting"
|
title="&dactyl.appname; Starting"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="starting">Starting &dactyl.appname;</h1>
|
<h1 tag="starting">Starting &dactyl.appname;</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<tags>startup-options</tags>
|
<h2 tag="startup-options">Command-line options</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Command-line options can be passed to &dactyl.appname; via the -&dactyl.name; &dactyl.host;
|
Command-line options can be passed to &dactyl.appname; via the -&dactyl.name; &dactyl.host;
|
||||||
@@ -75,48 +75,64 @@
|
|||||||
<p>At startup, &dactyl.appname; completes the following tasks in order. </p>
|
<p>At startup, &dactyl.appname; completes the following tasks in order. </p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li> &dactyl.appname; can perform user initialization commands. When
|
<li>
|
||||||
one of the following is successfully located, it is executed,
|
<p>
|
||||||
and no further locations are tried.
|
&dactyl.appname; first searches for user initialization commands in
|
||||||
|
the following locations. The first of these to be found is executed,
|
||||||
|
after which no further locations are searched.
|
||||||
|
</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li tag="$&dactyl.idname;_INIT">
|
<li tag="$&dactyl.idname;_INIT">
|
||||||
<em>$&dactyl.idname;_INIT</em> — May contain a single Ex command (e.g.,
|
<em>$&dactyl.idname;_INIT</em>
|
||||||
"<ex>:source <a>file</a></ex>").
|
<strut/>
|
||||||
|
May contain a single Ex command (e.g., "<ex>:source <a>file</a></ex>").
|
||||||
</li>
|
</li>
|
||||||
<li tag="$MY_&dactyl.idname;RC">
|
<li tag="$MY_&dactyl.idname;RC">
|
||||||
<em>~/&dactyl.name;rc</em> — Windows only. If this file exists, its contents
|
<em>~/&dactyl.name;rc</em>
|
||||||
|
<strut/>
|
||||||
|
Windows only. If this file exists, its contents
|
||||||
are executed and <em>$MY_&dactyl.idname;RC</em> set to its path.
|
are executed and <em>$MY_&dactyl.idname;RC</em> set to its path.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<em>~/.&dactyl.name;rc</em> — If this file exists, its contents are executed.
|
<em>~/.&dactyl.name;rc</em>
|
||||||
|
<strut/>
|
||||||
|
If this file exists, its contents are executed.
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<p>
|
||||||
If <o>exrc</o> is set and the +u command-line option was not
|
If <o>exrc</o> is set and the +u command-line option was not
|
||||||
specified, then any RC file in the current directory is also
|
specified, then any RC file in the current directory is also
|
||||||
sourced.
|
sourced.
|
||||||
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<p>
|
||||||
All directories in <o>runtimepath</o> are searched for a
|
All directories in <o>runtimepath</o> are searched for a
|
||||||
"plugin" subdirectory and all yet unloaded plugins are loaded.
|
‘plugins’ subdirectory and all yet unloaded plugins are loaded.
|
||||||
For each plugin directory, all <tt>*.{js,vimp}</tt> files (including
|
For each plugins directory, all <tt>*.{js,vimp}</tt> files (including
|
||||||
those in further subdirectories) are sourced alphabetically. No
|
those in further subdirectories) are sourced alphabetically. No
|
||||||
plugins will be sourced if:
|
plugins will be sourced if,
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><o>noloadplugins</o> is set.</li>
|
<li><o>noloadplugins</o> is set,</li>
|
||||||
<li>the ++noplugin command-line option was specified.</li>
|
<li>the ++noplugin command-line option was specified, or</li>
|
||||||
<li>the +u=NONE command-line option specified set.</li>
|
<li>the +u=NONE command-line option was specified.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Any particular plugin will not be loaded if it has already been
|
<p>
|
||||||
loaded (e.g., by an earlier <ex>:loadplugins</ex> command).
|
Any plugin which was already loaded (e.g., by an earlier
|
||||||
|
invocation of the <ex>:loadplugins</ex> command) will be skipped.
|
||||||
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
The user's ~ (i.e., "home") directory is determined as follows:
|
<p>
|
||||||
|
The user's home directory is determined as follows:
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>On Unix and Mac, the environment variable <em>$HOME</em> is used.</li>
|
<li>On Unix and Mac, the environment variable <em>$HOME</em> is used.</li>
|
||||||
@@ -141,10 +157,10 @@ The user's ~ (i.e., "home") directory is determined as follows:
|
|||||||
<oa>file</oa> if it exists.
|
<oa>file</oa> if it exists.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<warning>
|
||||||
Warning: this differs from Vim's behavior which defaults to writing the file
|
This behavior differs differs from that of Vim, which defaults to
|
||||||
in the current directory.
|
writing the file in the current directory.
|
||||||
</p>
|
</warning>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,17 @@
|
|||||||
<document
|
<document
|
||||||
name="styling"
|
name="styling"
|
||||||
title="&dactyl.appname; Styling"
|
title="&dactyl.appname; Styling"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="styling">Styling the GUI and web pages</h1>
|
<h1 tag="styling">Styling the GUI and web pages</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
&dactyl.appname; allows you to style both the browser and any web pages you view. All
|
&dactyl.appname; allows you to apply custom CSS styling to the web pages
|
||||||
styling is specified via CSS. Although you may style any user interface element
|
you view as well as to the browser itself. Although it is possible to
|
||||||
via the <ex>:style</ex> command, most &dactyl.appname; elements can be styled with the
|
style any user interface element via the <ex>:style</ex> command, most
|
||||||
<ex>:highlight</ex> command, for convenience.
|
&dactyl.appname; elements can be styled more easily by means of the
|
||||||
|
more specialized <ex>:highlight</ex> command.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Load a color scheme. <a>name</a> is found by searching the <o>runtimepath</o> for the
|
Load a color scheme. <a>name</a> is found by searching the <o>runtimepath</o> for the
|
||||||
first file matching colors/<a>name</a>.vimp.
|
first file matching <tt>colors/<a>name</a>.vimp</tt>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -37,66 +38,70 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:hi :highlight</tags>
|
<tags>:hi :highlight</tags>
|
||||||
<spec>:hi<oa>ghlight</oa><oa>!</oa> <oa>-append</oa> <a>group</a> [[<a>selector</a>] <a>css</a>]</spec>
|
<spec>:hi<oa>ghlight</oa><oa>!</oa> <a>group</a><oa>selector</oa></spec>
|
||||||
|
<spec>:hi<oa>ghlight</oa><oa>!</oa> <oa>-append</oa> <a>group</a><oa>selector</oa> <oa>css</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Highlight <a>group</a> with <a>css</a>. <a>css</a> is one or more comma separated CSS
|
Highlight <a>group</a> with <oa>css</oa>. <oa>css</oa> is one or more
|
||||||
declarations (E.g. <em>color: blue; background-color: red</em>). Normally, <a>css</a> is
|
semicolon-separated CSS declarations (E.g. <em>color: blue;
|
||||||
checked for valid syntax before it's applied. Once you're certain it's valid,
|
background-color: red</em>). <oa>selector</oa>, if provided, may
|
||||||
<oa>!</oa> can be used to skip the check to speed up &dactyl.appname; startup. <a>selector</a>
|
be any valid CSS selector (such as <em>:hover</em> or
|
||||||
can be any valid CSS selector, such as <ex>:hover</ex>, and, if provided, will
|
<em>[href]</em>), and will restrict the highlighting to matching
|
||||||
restrict the match to matching elements.
|
elements.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Valid groups are:</p>
|
<p>Valid groups include:</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Bell</dt> <dd>&dactyl.appname;'s visual bell</dd>
|
<dt>Bell</dt> <dd>&dactyl.appname;'s visual bell</dd>
|
||||||
<dt>Boolean</dt> <dd>A JavaScript Boolean object</dd>
|
<dt>Boolean</dt> <dd>A JavaScript Boolean object</dd>
|
||||||
<dt>CmdLine</dt> <dd>The command line</dd>
|
<dt>CmdLine</dt> <dd>The command line</dd>
|
||||||
<dt>CmdOutput</dt> <dd></dd>
|
<dt>CmdOutput</dt> <dd>The output of commands executed by <ex>:run</ex></dd>
|
||||||
<dt>CompDesc</dt> <dd>The description column of the completion list</dd>
|
<dt>CompDesc</dt> <dd>The description column of the completion list</dd>
|
||||||
<dt>CompGroup</dt> <dd></dd>
|
<dt>CompGroup</dt> <dd>The top-level container for a group of completion results</dd>
|
||||||
<dt>CompIcon</dt> <dd>The favicon of a completion row</dd>
|
<dt>CompIcon</dt> <dd>The favicon of a completion row</dd>
|
||||||
<dt>CompItem</dt> <dd>A row of completion list</dd>
|
<dt>CompItem</dt> <dd>A row of completion list</dd>
|
||||||
<dt>CompItem[selected]</dt><dd>A selected row of completion list</dd>
|
<dt>CompItem[selected]</dt><dd> A selected row of completion list</dd>
|
||||||
<dt>CompLess</dt> <dd>The indicator shown when completions may be scrolled up</dd>
|
|
||||||
<dt>CompLess::after</dt> <dd>The character of indicator shown when completions may be scrolled up</dd>
|
<dt>CompLess::after</dt> <dd>The character of indicator shown when completions may be scrolled up</dd>
|
||||||
<dt>CompMore</dt> <dd>The indicator shown when completions may be scrolled down</dd>
|
<dt>CompLess</dt> <dd>The indicator shown when completions may be scrolled up</dd>
|
||||||
<dt>CompMore::after</dt> <dd>The character of indicator shown when completions may be scrolled down</dd>
|
<dt>CompMore::after</dt> <dd>The character of indicator shown when completions may be scrolled down</dd>
|
||||||
<dt>CompMsg</dt> <dd></dd>
|
<dt>CompMore</dt> <dd>The indicator shown when completions may be scrolled down</dd>
|
||||||
|
<dt>CompMsg</dt> <dd>The message which may appear at the top of a group of completion results</dd>
|
||||||
<dt>CompResult</dt> <dd>The result column of the completion list</dd>
|
<dt>CompResult</dt> <dd>The result column of the completion list</dd>
|
||||||
<dt>CompTitle</dt> <dd>Completion row titles</dd>
|
<dt>CompTitle</dt> <dd>Completion row titles</dd>
|
||||||
|
<dt>Disabled</dt> <dd>Text indicating disabled status, such as of an extension or style group</dd>
|
||||||
|
<dt>Enabled</dt> <dd>Text indicating enabled status, such as of an extension or style group</dd>
|
||||||
<dt>ErrorMsg</dt> <dd>Error messages</dd>
|
<dt>ErrorMsg</dt> <dd>Error messages</dd>
|
||||||
<dt>Filter</dt> <dd>The matching text in a completion list</dd>
|
<dt>Filter</dt> <dd>The matching text in a completion list</dd>
|
||||||
<dt>FrameIndicator</dt> <dd>The indicator shown when a new frame is selected</dd>
|
<dt>FrameIndicator</dt> <dd>The indicator shown when a new frame is selected</dd>
|
||||||
<dt>Function</dt> <dd>A JavaScript Function object</dd>
|
<dt>Function</dt> <dd>A JavaScript Function object</dd>
|
||||||
<dt>Gradient</dt> <dd></dd>
|
<dt>Gradient</dt> <dd>The gradient dividers used in the completion lists</dd>
|
||||||
<dt>GradientLeft</dt> <dd></dd>
|
<dt>GradientLeft</dt> <dd>The color to the left of the Gradient</dd>
|
||||||
<dt>GradientRight</dt> <dd></dd>
|
<dt>GradientRight</dt> <dd>The color to the right of the Gradient</dd>
|
||||||
<dt>Hint</dt> <dd>A hint indicator. See <ex>:help hints</ex></dd>
|
<dt>Hint</dt> <dd>A hint indicator. See <ex>:help hints</ex></dd>
|
||||||
<dt>HintActive</dt> <dd>The hint element of link which will be followed by <k name="Return"/></dd>
|
<dt>HintActive</dt> <dd>The hint element of link which will be followed by <k name="Return"/></dd>
|
||||||
<dt>HintElem</dt> <dd>The hintable element</dd>
|
<dt>HintElem</dt> <dd>The hintable element</dd>
|
||||||
<dt>HintImage</dt> <dd>The indicator which floats above hinted images</dd>
|
<dt>HintImage</dt> <dd>The indicator which floats above hinted images</dd>
|
||||||
<dt>Indicator</dt> <dd></dd>
|
<dt>Indicator</dt> <dd>The <em>#</em> and <em>%</em> in the <ex>:buffers</ex> list</dd>
|
||||||
<dt>InfoMsg</dt> <dd>Information messages</dd>
|
<dt>InfoMsg</dt> <dd>Information messages</dd>
|
||||||
|
<dt>Key</dt> <dd>Generally a keyword used in syntax highlighting.</dd>
|
||||||
<dt>Keyword</dt> <dd>A bookmark keyword for a URL</dd>
|
<dt>Keyword</dt> <dd>A bookmark keyword for a URL</dd>
|
||||||
<dt>LineNr</dt> <dd>The line number of an error</dd>
|
<dt>LineNr</dt> <dd>The line number of an error</dd>
|
||||||
<dt>Message</dt> <dd></dd>
|
<dt>Message</dt> <dd>A message as displayed in <ex>:messages</ex></dd>
|
||||||
<dt>ModeMsg</dt> <dd>The mode indicator in the command line</dd>
|
<dt>ModeMsg</dt> <dd>The mode indicator in the command line</dd>
|
||||||
<dt>MoreMsg</dt> <dd>The indicator that there is more text to view</dd>
|
<dt>MoreMsg</dt> <dd>The indicator that there is more text to view</dd>
|
||||||
<dt>NonText</dt> <dd></dd>
|
<dt>NonText</dt> <dd>The <em>~</em> indicators which mark blank lines in the completion list</dd>
|
||||||
<dt>Normal</dt> <dd>Normal text in the command line</dd>
|
<dt>Normal</dt> <dd>Normal text in the command line</dd>
|
||||||
<dt>Null</dt> <dd>A JavaScript Null object</dd>
|
<dt>Null</dt> <dd>A JavaScript Null object</dd>
|
||||||
<dt>Number</dt> <dd>A JavaScript Number object</dd>
|
<dt>Number</dt> <dd>A JavaScript Number object</dd>
|
||||||
<dt>Object</dt> <dd>A JavaScript Object</dd>
|
<dt>Object</dt> <dd>A JavaScript Object</dd>
|
||||||
<dt>Preview</dt> <dd></dd>
|
<dt>Preview</dt> <dd>The completion preview displayed in the <t>command-line</t></dd>
|
||||||
<dt>Question</dt> <dd>A prompt for a decision</dd>
|
<dt>Question</dt> <dd>A prompt for a decision</dd>
|
||||||
<dt>Search</dt> <dd>Highlighted search results in a web page</dd>
|
<dt>Search</dt> <dd>Highlighted search results in a web page</dd>
|
||||||
<dt>StatusLine</dt> <dd>The status bar</dd>
|
<dt>StatusLine</dt> <dd>The status bar</dd>
|
||||||
<dt>StatusLineBroken</dt> <dd>The status bar for a broken web page</dd>
|
<dt>StatusLineBroken</dt> <dd>The status bar for a broken web page</dd>
|
||||||
|
<dt>StatusLineExtended</dt><dd> The status bar for a secure web page with an Extended Validation (EV) certificate</dd>
|
||||||
<dt>StatusLineSecure</dt> <dd>The status bar for a secure web page</dd>
|
<dt>StatusLineSecure</dt> <dd>The status bar for a secure web page</dd>
|
||||||
<dt>StatusLineExtended</dt><dd>The status bar for a secure web page with an Extended Validation(EV) certificate</dd>
|
|
||||||
<dt>String</dt> <dd>A JavaScript String object</dd>
|
<dt>String</dt> <dd>A JavaScript String object</dd>
|
||||||
<dt>TabClose</dt> <dd>The close button of a browser tab</dd>
|
<dt>TabClose</dt> <dd>The close button of a browser tab</dd>
|
||||||
<dt>TabIcon</dt> <dd>The icon of a browser tab</dd>
|
<dt>TabIcon</dt> <dd>The icon of a browser tab</dd>
|
||||||
@@ -110,10 +115,17 @@
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Every invocation completely replaces the styling of any previous invocation,
|
The help system also has a comprehensive set of styling groups
|
||||||
unless <em>-append</em> (short option: <em>-a</em>) is provided, in which case <a>css</a> is
|
which are not explained here, but many of which are described
|
||||||
appended to its current value. If <a>css</a> is not provided, any styles matching
|
along with <t>writing-docs</t>.
|
||||||
<a>group</a> are listed, or all styles if no <a>group</a> provided.
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Every invocation completely replaces the styling of any previous
|
||||||
|
invocation, unless <em>-append</em> (short option: <em>-a</em>) is
|
||||||
|
provided, in which case <a>css</a> is appended to its current
|
||||||
|
value. If <a>css</a> is not provided, any styles beginning with
|
||||||
|
<a>group</a> are listed.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -121,11 +133,11 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:highlight-clear</tags>
|
<tags>:highlight-clear</tags>
|
||||||
<spec>:hi<oa>ghlight</oa> clear <oa><a>group</a> <oa><a>selector</a></oa></oa></spec>
|
<spec>:hi<oa>ghlight</oa> clear <oa>group</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Reset the highlighting for <a>group</a> to its default value. If
|
Reset the highlighting for <oa>group</oa> to its default value. If
|
||||||
<a>group</a> is not given, reset all highlighting groups.
|
<oa>group</oa> is not given, reset all highlighting groups.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -133,43 +145,46 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:sty :style</tags>
|
<tags>:sty :style</tags>
|
||||||
<spec>:sty<oa>le</oa><oa>!</oa> <oa>-name=<a>name</a></oa> <oa>-append</oa> <a>filter</a> [<a>css</a>]</spec>
|
<spec>:sty<oa>le</oa><oa>!</oa> <oa>-name=<a>name</a></oa> <oa>-append</oa> <a>filter</a> <oa>css</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Add CSS styles to the browser or to web pages. <a>filter</a> is a comma separated
|
Add CSS styles to the browser or to web pages. <a>filter</a> is a comma separated
|
||||||
list of URLs to match. URLs ending with <em>*</em> are matched as prefixes, URLs not
|
list of URLs to match. URLs ending with <em>*</em> are matched as prefixes, URLs not
|
||||||
containing any <em>:</em> or <em>/</em> characters are matched as domains. <a>css</a> is a full
|
containing any <em>:</em> or <em>/</em> characters are matched as domains. <oa>css</oa> is a full
|
||||||
CSS rule set (e.g., <tt>body { color: blue; }</tt>).
|
CSS rule set (e.g., <tt>body { color: blue; }</tt>).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If <a>name</a> (short option: <em>-n</em>) is provided, any existing style with the same
|
If <a>name</a> (short option: <em>-n</em>) is provided, any existing style with the same
|
||||||
name is overridden, and the style may later be deleted using <a>name</a>. If
|
name is overridden, and the style may later be deleted using <a>name</a>. If
|
||||||
<em>-append</em> (short option: <em>-a</em>) is provided along with <em>-name</em>, <a>css</a> and
|
<em>-append</em> (short option: <em>-a</em>) is provided along with <em>-name</em>, <oa>css</oa> and
|
||||||
<a>filter</a> are appended to its current value.
|
<a>filter</a> are appended to its current value.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>If <a>css</a> isn't provided, matching styles are listed.</p>
|
<p>If <oa>css</oa> isn't provided, matching styles are listed.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:dels :delstyle</tags>
|
<tags>:dels :delstyle</tags>
|
||||||
<spec>:dels<oa>tyle</oa> [-name=<a>name</a>] [-index=<a>index</a>] [<a>filter</a>] [<a>css</a>]</spec>
|
<spec>:dels<oa>tyle</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <oa>filter</oa> <oa>css</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Delete any matching styles. If <a>filter</a> is provided, only matching elements of
|
Delete any matching styles. If <oa>filter</oa> is provided, only
|
||||||
the filter are disabled. For instance, a filter <str>mozilla.org</str>, given a
|
matching elements of the filter are disabled. For instance, when
|
||||||
style for <str>www.google.com,mozilla.org</str>, will result in a style for
|
run with a filter <str>mozilla.org</str>, an existing style with a
|
||||||
<str>www.google.com</str>. The available options are:
|
filter <str>www.google.com,mozilla.org</str>, will result in a
|
||||||
|
style for <str>www.google.com</str>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<p>The available options are:</p>
|
||||||
<li><em>-name</em>: The name provided to <ex>:style</ex> (short option: <em>-n</em>)</li>
|
|
||||||
<li><em>-index</em>: For unnamed styles, the index listed by <ex>:style</ex>
|
<dl>
|
||||||
(short option: <em>-i</em>)</li>
|
<dt>-name</dt> <dd>The name provided to <ex>:style</ex> (short option: <em>-n</em>)</dd>
|
||||||
</ul>
|
<dt>-index</dt> <dd>For unnamed styles, the index listed by <ex>:style</ex>
|
||||||
|
(short option: <em>-i</em>)</dd>
|
||||||
|
</dl>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -177,7 +192,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:styleenable :stylee</tags>
|
<tags>:styleenable :stylee</tags>
|
||||||
<tags>:styenable :stye</tags>
|
<tags>:styenable :stye</tags>
|
||||||
<spec>:styled<oa>isable</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <a>filter</a> <a>css</a></spec>
|
<spec>:styled<oa>isable</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <oa>filter</oa> <oa>css</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Enable any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
<p>Enable any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -187,7 +202,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:styledisable :styled</tags>
|
<tags>:styledisable :styled</tags>
|
||||||
<tags>:stydisable :styd</tags>
|
<tags>:stydisable :styd</tags>
|
||||||
<spec>:stylee<oa>nable</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <a>filter</a> <a>css</a></spec>
|
<spec>:stylee<oa>nable</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <oa>filter</oa> <oa>css</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Disable any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
<p>Disable any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -197,7 +212,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:styletoggle :stylet</tags>
|
<tags>:styletoggle :stylet</tags>
|
||||||
<tags>:stytoggle :styt</tags>
|
<tags>:stytoggle :styt</tags>
|
||||||
<spec>:stylet<oa>oggle</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <a>filter</a> <a>css</a></spec>
|
<spec>:stylet<oa>oggle</oa> <oa>-name=<a>name</a></oa> <oa>-index=<a>index</a></oa> <oa>filter</oa> <oa>css</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Toggle any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
<p>Toggle any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
|
|||||||
@@ -6,15 +6,23 @@
|
|||||||
<document
|
<document
|
||||||
name="tabs"
|
name="tabs"
|
||||||
title="&dactyl.appname; Tabs"
|
title="&dactyl.appname; Tabs"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1 tag="tabs">Tabs</h1>
|
<h1 tag="tabs buffers">Tabs and buffers</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Tabs are used to be able to view many web pages at the same time. Each tab
|
Tabs allow you to keep many web pages open at the same time and to quickly
|
||||||
contains exactly one buffer—multiple buffers per tab are not supported. As a
|
switch between them. Each tab contains exactly one buffer. If your version
|
||||||
result many buffer and tab commands are interchangeable.
|
of &dactyl.host; supports tab groups, only buffers in the active group
|
||||||
|
will be attached to visible tabs. Though all buffers may not always be
|
||||||
|
attached to visible tabs, they are all always accessible via the
|
||||||
|
buffer-centric commands and key bindings. Tab-centric commands and key
|
||||||
|
bindings, however, only operate on the set of visible tabs.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 tag="listing-tabs">Listing tabs</h2>
|
<h2 tag="listing-tabs">Listing tabs</h2>
|
||||||
@@ -25,15 +33,16 @@
|
|||||||
<spec>B</spec>
|
<spec>B</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show a list of buffers (=tabs) matching <oa>filter</oa>. Without <oa>filter</oa>
|
Show a list of buffers matching <oa>filter</oa>. Buffers are
|
||||||
list all tabs.
|
listed according to their tab groups, whether they are visible or
|
||||||
|
not.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>A buffer may be marked with one of the following indicators:</p>
|
<p>A buffer may be marked with one of the following indicators:</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>%</dt><dd>The current buffer</dd>
|
<dt><hl key="Indicator">%</hl></dt><dd>The current buffer</dd>
|
||||||
<dt>#</dt><dd>The alternate buffer for <ex>:e #</ex> and <k name="C-^"/></dd>
|
<dt><hl key="Indicator">#</hl></dt><dd>The alternate buffer for <ex>:e #</ex> and <k name="C-^"/></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -52,21 +61,13 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:tab</tags>
|
<tags>:tab</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:tab <a>cmd</a></spec>
|
<spec>:tab <a>cmd</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute <a>cmd</a> and tell it to output in a new tab. Works only for commands that
|
Execute <a>cmd</a>, but open any new pages in a new tab rather
|
||||||
support it, currently:
|
than the currently focused tab.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li><ex>:tab addons</ex></li>
|
|
||||||
<li><ex>:tab downloads</ex></li>
|
|
||||||
<li><ex>:tab extoptions</ex></li>
|
|
||||||
<li><ex>:tab help</ex></li>
|
|
||||||
<li><ex>:tab javascript!</ex></li>
|
|
||||||
<li><ex>:tab preferences!</ex></li>
|
|
||||||
</ul>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -77,8 +78,8 @@
|
|||||||
<spec>:wind<oa>ow</oa> <a>cmd</a></spec>
|
<spec>:wind<oa>ow</oa> <a>cmd</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute <a>cmd</a> and tell it to output in a new window. See <ex>:tab</ex> for the
|
Execute <a>cmd</a>, but open any new pages in a new window rather
|
||||||
list of supported commands.
|
than the currently focused tab.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -89,20 +90,22 @@
|
|||||||
<spec>:<oa>count</oa>tabdu<oa>plicate</oa></spec>
|
<spec>:<oa>count</oa>tabdu<oa>plicate</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Duplicate the current tab and switch to the duplicate. If <oa>count</oa> is given,
|
Duplicate the current tab and focus the duplicate. If
|
||||||
duplicate the tab <oa>count</oa> times.
|
<oa>count</oa> is given, duplicate the tab <oa>count</oa> times.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<!-- TODO: should the tab commands be moved back here? -->
|
<!-- TODO: should the tab commands be moved back here? -->
|
||||||
See <t>opening</t> for other ways to open new tabs.
|
<p>
|
||||||
|
See <t>opening</t> for other ways to open new tabs.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2 tag="changing-tabs">Changing tabs</h2>
|
<h2 tag="changing-tabs">Changing tabs</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gb</tags>
|
<tags>gb</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>gb</spec>
|
<spec><oa>count</oa>gb</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -115,11 +118,11 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gB</tags>
|
<tags>gB</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>gB</spec>
|
<spec><oa>count</oa>gB</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Repeat last <ex>:buffer<oa>!</oa></ex> command in reverse direction. Just like <k>gb</k>
|
Repeat last <ex>:buffer<oa>!</oa></ex> command in the reverse direction.
|
||||||
but in the other direction.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -127,10 +130,11 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>gt</tags>
|
<tags>gt</tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>gt</spec>
|
<spec><oa>count</oa>gt</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to the next tab. Cycles to the first tab when the last is selected. +
|
Go to the next tab. Cycles to the first tab when the last is selected.
|
||||||
If <oa>count</oa> is specified go to the <oa>count</oa>th tab.
|
If <oa>count</oa> is specified go to the <oa>count</oa>th tab.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -139,10 +143,11 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-PageDown> <C-Tab> <C-n>]]></tags>
|
<tags><![CDATA[<C-PageDown> <C-Tab> <C-n>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa><C-n></spec>
|
<spec><oa>count</oa><C-n></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to the next tab. Cycles to the first tab when the last is selected. +
|
Go to the next tab. Cycles to the first tab when the last is selected.
|
||||||
If <oa>count</oa> is specified go to the <oa>count</oa>th next tab.
|
If <oa>count</oa> is specified go to the <oa>count</oa>th next tab.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -151,10 +156,11 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-PageUp> <C-S-Tab> <C-p> gT]]></tags>
|
<tags><![CDATA[<C-PageUp> <C-S-Tab> <C-p> gT]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><oa>count</oa>gT</spec>
|
<spec><oa>count</oa>gT</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to the previous tab. Cycles to the last tab when the first is selected. +
|
Go to the previous tab. Cycles to the last tab when the first is selected.
|
||||||
If <oa>count</oa> is specified go to the <oa>count</oa>th previous tab.
|
If <oa>count</oa> is specified go to the <oa>count</oa>th previous tab.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -162,9 +168,11 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:bn :bnext :tn :tnext :tabn :tabnext</tags>
|
<tags>:tabn :tabnext</tags>
|
||||||
<spec>:<oa>count</oa>tabn<oa>ext</oa> <oa>count</oa></spec>
|
<spec>:<oa>count</oa>tabn<oa>ext</oa> <oa>count</oa></spec>
|
||||||
|
<tags>:tn :tnext</tags>
|
||||||
<spec>:<oa>count</oa>tn<oa>ext</oa> <oa>count</oa></spec>
|
<spec>:<oa>count</oa>tn<oa>ext</oa> <oa>count</oa></spec>
|
||||||
|
<tags>:bn :bnext</tags>
|
||||||
<spec>:<oa>count</oa>bn<oa>ext</oa> <oa>count</oa></spec>
|
<spec>:<oa>count</oa>bn<oa>ext</oa> <oa>count</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
@@ -176,12 +184,14 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:bN :bNext :bp :bprevious :tN :tNext :tabN :tabNext :tp :tprevious :tabp :tabprevious</tags>
|
<tags>:bN :bNext :bp :bprevious</tags>
|
||||||
<spec>:<oa>count</oa>tabp<oa>revious</oa> <oa>count</oa></spec>
|
|
||||||
<spec>:<oa>count</oa>tp<oa>revious</oa> <oa>count</oa></spec>
|
|
||||||
<spec>:<oa>count</oa>tabN<oa>ext</oa> <oa>count</oa></spec>
|
|
||||||
<spec>:<oa>count</oa>bp<oa>revious</oa> <oa>count</oa></spec>
|
<spec>:<oa>count</oa>bp<oa>revious</oa> <oa>count</oa></spec>
|
||||||
<spec>:<oa>count</oa>bN<oa>ext</oa> <oa>count</oa></spec>
|
<spec>:<oa>count</oa>bN<oa>ext</oa> <oa>count</oa></spec>
|
||||||
|
<tags>:tN :tNext :tabN :tabNext</tags>
|
||||||
|
<spec>:<oa>count</oa>tabN<oa>ext</oa> <oa>count</oa></spec>
|
||||||
|
<tags>:tp :tprevious :tabp :tabprevious</tags>
|
||||||
|
<spec>:<oa>count</oa>tabp<oa>revious</oa> <oa>count</oa></spec>
|
||||||
|
<spec>:<oa>count</oa>tp<oa>revious</oa> <oa>count</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Switch to the previous tab or go <oa>count</oa> tabs back. Wraps around from the
|
Switch to the previous tab or go <oa>count</oa> tabs back. Wraps around from the
|
||||||
@@ -209,8 +219,10 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<spec><oa>count</oa>b</spec>
|
<spec><oa>count</oa>b</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Go to the specified buffer from the buffer list. Argument can be either the
|
Go to the specified buffer from the buffer list. Argument can be
|
||||||
buffer index or the full URL. If <oa>count</oa> is given, go to the <oa>count</oa>th buffer.
|
either the buffer index or the full URL opened in an existing
|
||||||
|
buffer. If <oa>count</oa> is given, go to the <oa>count</oa>th
|
||||||
|
buffer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -228,13 +240,17 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>g^ g0 :bf :bfirst :br :brewind :tabfir :tabfirst :tabr :tabrewind</tags>
|
<tags>g^ g0</tags>
|
||||||
<spec>:tabr<oa>ewind</oa></spec>
|
|
||||||
<spec>:tabfir<oa>st</oa></spec>
|
|
||||||
<spec>:br<oa>ewind</oa></spec>
|
|
||||||
<spec>:bf<oa>irst</oa></spec>
|
|
||||||
<spec>g0</spec>
|
<spec>g0</spec>
|
||||||
<spec>g^</spec>
|
<spec>g^</spec>
|
||||||
|
|
||||||
|
<tags>:bf :bfirst :br :brewind</tags>
|
||||||
|
<spec>:br<oa>ewind</oa></spec>
|
||||||
|
<spec>:bf<oa>irst</oa></spec>
|
||||||
|
|
||||||
|
<tags>:tabfir :tabfirst :tabr :tabrewind</tags>
|
||||||
|
<spec>:tabr<oa>ewind</oa></spec>
|
||||||
|
<spec>:tabfir<oa>st</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Switch to the first tab.</p>
|
<p>Switch to the first tab.</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -254,12 +270,13 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:tabde :tabdetach</tags>
|
<tags>:tabde :tabdetach</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:tabde<oa>tach</oa></spec>
|
<spec>:tabde<oa>tach</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Detach the current tab, and open it in its own window. As each window must
|
Detach the current tab, and open it in its own window. As each
|
||||||
contain at least one tab it is not possible to detach the only tab in a window.
|
window must contain at least one buffer, it is not possible to detach
|
||||||
Use <ex>:tabduplicate</ex> to copy the tab then call <ex>:tabdetach</ex>.
|
the last buffer in a window.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -267,13 +284,14 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:taba :tabattach</tags>
|
<tags>:taba :tabattach</tags>
|
||||||
<spec>:taba<oa>ttach</oa> <a>window-index</a> <oa>tab-index</oa></spec>
|
<spec>:taba<oa>ttach</oa> <a>window-index</a> <oa>buffer-index</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Attach the current tab to another window. {window-index} is an index into the
|
Attach the current tab to another window. <a>window-index</a> is
|
||||||
list of open windows and <oa>tab-index</oa> is the index at which to insert the
|
an index into the list of open windows and <oa>buffer-index</oa>
|
||||||
tab in the other window's tab list. If this is the last tab in a window, the
|
is the index at which to insert the tab in the other window's
|
||||||
window will be closed.
|
buffer list. If this is the last buffer in a window, the window
|
||||||
|
will be closed.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -289,7 +307,7 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<p>
|
<p>
|
||||||
Move the current tab to a position after tab <oa>N</oa>. When <oa>N</oa> is 0, the
|
Move the current tab to a position after tab <oa>N</oa>. When <oa>N</oa> is 0, the
|
||||||
current tab is made the first one. Without <oa>N</oa> the current tab is made the
|
current tab is made the first one. Without <oa>N</oa> the current tab is made the
|
||||||
last one. <oa>N</oa> can also be prefixed with "+" or "-" to indicate a relative
|
last one. <oa>N</oa> can also be prefixed with ‘+’ or ‘-’ to indicate a relative
|
||||||
movement. If <oa>!</oa> is specified the movement wraps around the start or end of the
|
movement. If <oa>!</oa> is specified the movement wraps around the start or end of the
|
||||||
tab list.
|
tab list.
|
||||||
</p>
|
</p>
|
||||||
@@ -301,19 +319,21 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<h2 tag="closing-tabs">Closing tabs</h2>
|
<h2 tag="closing-tabs">Closing tabs</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>d :tabc :tabclose :bun :bunload :bw :bwipeout :bd :bdelete</tags>
|
<tags>d</tags>
|
||||||
|
<tags>:tabc :tabclose</tags>
|
||||||
|
<tags>:bun :bunload :bw :bwipeout :bd :bdelete</tags>
|
||||||
<spec>:<oa>count</oa>bd<oa>elete</oa><oa>!</oa> <oa>arg</oa></spec>
|
<spec>:<oa>count</oa>bd<oa>elete</oa><oa>!</oa> <oa>arg</oa></spec>
|
||||||
<spec><oa>count</oa>d</spec>
|
<spec><oa>count</oa>d</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Delete current buffer (=tab). If <oa>count</oa> is specified then <oa>count</oa> tabs are
|
Delete current buffer. If <oa>count</oa> is specified then <oa>count</oa> tabs are
|
||||||
removed. Afterwards, the tab to the right of the deleted tab(s) is selected.
|
removed. Afterwards, the tab to the right of the deleted tabs is selected.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When used with <oa>arg</oa>, remove all tabs which contain <oa>arg</oa> in the
|
When used with <oa>arg</oa>, remove all tabs which contain <oa>arg</oa> in the
|
||||||
hostname. <oa>!</oa> forces this command to also search for <oa>arg</oa> in the full
|
currently opened hostname. With <oa>!</oa>, remove all tabs for which
|
||||||
URL and also the title of the tab. Use with care.
|
the currently opened page's URL or title contains <oa>arg</oa>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -322,8 +342,8 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<item>
|
<item>
|
||||||
<tags>D</tags>
|
<tags>D</tags>
|
||||||
<spec><oa>count</oa>D</spec>
|
<spec><oa>count</oa>D</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Like <k>d</k> but selects the tab to the left of the deleted tab.</p>
|
<p>Like <k>d</k> but selects the tab to the left of the deleted tabs after deletion..</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -331,8 +351,8 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<item>
|
<item>
|
||||||
<tags>:tabo :tabonly</tags>
|
<tags>:tabo :tabonly</tags>
|
||||||
<spec>:tabo<oa>nly</oa></spec>
|
<spec>:tabo<oa>nly</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Close all other tabs.</p>
|
<p>Close all buffers other than the currently visible tab.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -343,8 +363,9 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<spec><oa>count</oa>u</spec>
|
<spec><oa>count</oa>u</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Undo closing of a tab. If a count is given, don't undo the last but the
|
Restore a closed tab. If a <oa>count</oa> is given, restore the
|
||||||
<oa>count</oa>th last closed tab. With <oa>url</oa> restores the tab matching the URL.
|
<oa>count</oa>th closed tab. With <oa>url</oa>, restores most
|
||||||
|
recently closed tab with a matching URL.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -353,11 +374,8 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<item>
|
<item>
|
||||||
<tags>:undoa :undoall</tags>
|
<tags>:undoa :undoall</tags>
|
||||||
<spec>:undoa<oa>ll</oa></spec>
|
<spec>:undoa<oa>ll</oa></spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>
|
<p>Restore all closed tabs in the closed tabs list.</p>
|
||||||
Undo closing of all closed tabs. &dactyl.host; stores up to 10 closed tabs, even
|
|
||||||
after a browser restart.
|
|
||||||
</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@@ -370,8 +388,9 @@ See <t>opening</t> for other ways to open new tabs.
|
|||||||
<spec>:tabd<oa>o</oa> <a>cmd</a></spec>
|
<spec>:tabd<oa>o</oa> <a>cmd</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute <a>cmd</a> in each tab. <a>cmd</a> is executed in each tab starting with the
|
Execute <a>cmd</a> once in each buffer. Each buffer is focused, in
|
||||||
first and ending with the last which becomes the current tab.
|
turn, and <a>cmd</a> is executed therein. The last buffer remains
|
||||||
|
focused after execution.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<document
|
<document
|
||||||
name="various"
|
name="various"
|
||||||
title="&dactyl.appname; Other"
|
title="&dactyl.appname; Other"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<h1>Other help</h1>
|
<h1>Other help</h1>
|
||||||
<toc start="2"/>
|
<toc start="2"/>
|
||||||
|
|
||||||
@@ -15,11 +15,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:beep</tags>
|
<tags>:beep</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:beep</spec>
|
<spec>:beep</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Play a system beep. This should not be used for any purpose other
|
Play a system beep. This should not be used for any purpose other
|
||||||
than testing the visual bell.
|
than testing the visual bell or annoying your co-workers.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -31,12 +32,13 @@
|
|||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Lists the completion contexts used during the completion of its
|
Lists the completion contexts used during the completion of its
|
||||||
arguments. These context names are used in options such as
|
arguments. These context names may used to tune the function of
|
||||||
<o>autocomplete</o> and <o>wildcase</o>. Note that completion must
|
the completion system via options like <o>autocomplete</o> and
|
||||||
be triggered in order for this command to be effective, so if
|
<o>wildcase</o>. Note that completion must be triggered in order
|
||||||
autocompletion is not active, you'll need to press the
|
for this command to be effective, so if autocompletion is not
|
||||||
<k name="Tab"/> key at least once. You should also be aware that
|
active, you'll need to press the <k name="Tab"/> key at least
|
||||||
this command is only useful from the commandline.
|
once. You should also be aware that this command is only useful
|
||||||
|
from the commandline.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -44,14 +46,14 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:norm :normal</tags>
|
<tags>:norm :normal</tags>
|
||||||
<spec>:norm<oa>al</oa><oa>!</oa> <a>commands</a></spec>
|
<spec>:norm<oa>al</oa><oa>!</oa> <a>keys</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute Normal mode commands <a>commands</a>. This makes it possible to execute
|
Execute key mappings for <a>keys</a> as if they were typed in
|
||||||
Normal mode commands typed on the command line. <a>commands</a> is executed like it
|
Normal mode. If <oa>!</oa> is provided, only builtin key mappings
|
||||||
is typed. If the <oa>!</oa> is given, mappings will not be used. <a>commands</a> should be
|
are executed. This makes it possible to fake Normal mode key
|
||||||
a complete command. <a>commands</a> cannot start with a space. Put 1 space before
|
presses from scripts, key mappings, autocommands, and the command
|
||||||
it, 1 space is one space.
|
line.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -59,27 +61,24 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-l> CTRL-L :redr :redraw]]></tags>
|
<tags><![CDATA[<C-l> CTRL-L :redr :redraw]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec>:redr<oa>aw</oa></spec>
|
<spec>:redr<oa>aw</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Redraws the screen. Useful to update the screen halfway executing a script or function.</p>
|
<p>Redraws the screen. Useful for updating the screen during the execution of a script or function.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:run :! :!cmd</tags>
|
<tags>:run :! :!cmd</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:!<a>cmd</a></spec>
|
<spec>:!<a>cmd</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Run a command. Runs <a>cmd</a> through system() and displays its output. Any '!' in
|
Run an extenral command command. Runs <a>cmd</a> through system()
|
||||||
<a>cmd</a> is replaced with the previous external command, but not when there is a
|
and displays its output. Any ‘!’ in <a>cmd</a> is replaced with
|
||||||
backslash before the '!', then the backslash is removed.
|
the previous external command, so long as it is not preceded by a
|
||||||
</p>
|
backslash and <o>banghist</o> is enabled.
|
||||||
|
|
||||||
<p>
|
|
||||||
Warning: Input redirection (< foo) not done, also do not run commands which
|
|
||||||
require stdin or it will hang &dactyl.host;! It is possible to launch background
|
|
||||||
processes, though (e.g. <ex>:! xterm &</ex>).
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -88,7 +87,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:!!</tags>
|
<tags>:!!</tags>
|
||||||
<spec>:!!</spec>
|
<spec>:!!</spec>
|
||||||
<description>
|
<description short="true">
|
||||||
<p>Repeat last <ex>:!<a>cmd</a></ex>.</p>
|
<p>Repeat last <ex>:!<a>cmd</a></ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -99,9 +98,9 @@
|
|||||||
<spec>:sil<oa>ent</oa> <a>command</a></spec>
|
<spec>:sil<oa>ent</oa> <a>command</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute a command silently. Normal messages and error messages generated by the
|
Execute a command silently. Normal messages and error messages
|
||||||
command invocation will not be given and will not be added to the message
|
generated by the command invocation will not be displayed and will
|
||||||
history.
|
not be added to the message history.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -112,8 +111,8 @@
|
|||||||
<spec>:<oa>count</oa>verb<oa>ose</oa> <a>command</a></spec>
|
<spec>:<oa>count</oa>verb<oa>ose</oa> <a>command</a></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Execute a command with <o>verbose</o> set to <oa>count</oa>. If <oa>count</oa> is not specified
|
Execute a command with <o>verbose</o> set to <oa>count</oa>. If
|
||||||
then 1 is used as the value.
|
<oa>count</oa> is not specified then 1 is used.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -121,11 +120,12 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>:ve :version</tags>
|
<tags>:ve :version</tags>
|
||||||
|
<strut/>
|
||||||
<spec>:ve<oa>rsion</oa><oa>!</oa></spec>
|
<spec>:ve<oa>rsion</oa><oa>!</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Show version information. You can show the &dactyl.host; version page with
|
Print &dactyl.appname; and &dactyl.host; version information. When
|
||||||
<ex>:version!</ex>.
|
<oa>!</oa> is provided, show the &dactyl.host; version page.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -134,19 +134,20 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Part of &dactyl.appname;'s user efficiency comes at the cost of storing a
|
Part of &dactyl.appname;'s user efficiency comes at the cost of storing a
|
||||||
lot of potentially private data, including command-line history, page
|
lot of potentially private data, including <t>command-line</t> history, page
|
||||||
marks, and the like. Because we know that keeping a detailed trail of all
|
marks, visited page history, and the like. Because we know that keeping a
|
||||||
of your activities isn't always welcome, &dactyl.appname; provides
|
detailed trail of all of your activities isn't always welcome,
|
||||||
comprehensive facilities for erasing potentially sensitive data.
|
&dactyl.appname; provides comprehensive facilities for erasing potentially
|
||||||
|
sensitive data.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p tag="private-mode porn-mode">
|
<p tag="private-mode porn-mode">
|
||||||
<strut/>
|
<strut/>
|
||||||
&dactyl.appname; fully supports &dactyl.host;'s private browsing mode.
|
&dactyl.appname; fully supports &dactyl.host;'s private browsing mode.
|
||||||
When in private browsing mode, no other than Bookmarks and QuickMarks are
|
When in private browsing mode, no data other than Bookmarks and QuickMarks
|
||||||
written to disk. Further, upon exiting private mode, all new data,
|
are written to disk. Further, upon exiting private mode, all new data,
|
||||||
including command-line history, local and URL marks, and macros, are
|
including <t>command-line</t> history, local and URL marks, and macros,
|
||||||
purged. For more information, see <o>private</o>.
|
are purged. For more information, see <o>private</o>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p tag="sanitizing clearing-data">
|
<p tag="sanitizing clearing-data">
|
||||||
@@ -157,7 +158,7 @@
|
|||||||
&dactyl.host;'s own sanitization facility, and so automatically clears any
|
&dactyl.host;'s own sanitization facility, and so automatically clears any
|
||||||
domain data and session history when requested. Further, &dactyl.appname;
|
domain data and session history when requested. Further, &dactyl.appname;
|
||||||
provides its own more granular sanitization facility, which allows, e.g.,
|
provides its own more granular sanitization facility, which allows, e.g.,
|
||||||
clearing the command-line and macro history for the past ten minutes.
|
clearing only the command-line and macro history for the past ten minutes.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
@@ -242,9 +243,10 @@
|
|||||||
<spec><F1></spec>
|
<spec><F1></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Open the help page. The default page, as specified by <o>helpfile</o> is shown
|
Open a help page for <oa>subject</oa>. If <oa>subject</oa> is
|
||||||
unless <oa>subject</oa> is specified. If you need help for a specific topic, try
|
omitted, open the default pate as specified in <o>helpfile</o>.
|
||||||
<ex>:help overview</ex>.
|
If you're not sure of the exact topic you need help with, try
|
||||||
|
<k name="Tab"/> completion or <ex>:help overview</ex>.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -254,7 +256,7 @@
|
|||||||
<tags>:helpall :helpa help-all</tags>
|
<tags>:helpall :helpa help-all</tags>
|
||||||
<spec>:helpa<oa>ll</oa> <oa>subject</oa></spec>
|
<spec>:helpa<oa>ll</oa> <oa>subject</oa></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>Open the single unchunked help page.</p>
|
<p>Open all help pages coalesced into a single page.</p>
|
||||||
|
|
||||||
<p>See <ex>:help</ex>.</p>
|
<p>See <ex>:help</ex>.</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -300,22 +302,23 @@
|
|||||||
|
|
||||||
<tags>42</tags>
|
<tags>42</tags>
|
||||||
|
|
||||||
What is the meaning of life, the universe and everything?
|
<p>
|
||||||
Douglas Adams, the only person who knew what this question really was about is
|
What is the meaning of life, the universe and everything? Douglas Adams,
|
||||||
now dead, unfortunately. So now you might wonder what the meaning of death
|
the only person who knew what this question really was about is now dead,
|
||||||
is…
|
unfortunately. So now you might wonder what the meaning of death is...
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<h2 tag="uncategorized">Uncategorized help</h2>
|
<h2 tag="uncategorized">Uncategorized help</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<C-[> <Esc>]]></tags>
|
<tags><![CDATA[<C-[> <Esc>]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec><Esc></spec>
|
<spec><Esc></spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Focus content. Exits Command-line or Hints mode and returns to Normal
|
Exits <t>command-line</t>, Insert, or Hints mode and returns to
|
||||||
mode. Also focuses the web page in case a form field has focus and eats
|
Normal mode. Focuses the content web page.
|
||||||
our key presses.
|
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
@@ -323,12 +326,13 @@ is…
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags><![CDATA[<Insert> i]]></tags>
|
<tags><![CDATA[<Insert> i]]></tags>
|
||||||
|
<strut/>
|
||||||
<spec>i</spec>
|
<spec>i</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Start caret mode. This mode resembles the Vim's Normal mode where you see a
|
Start Caret mode. This mode resembles the Vim's Normal mode where
|
||||||
text cursor and can move around. If you want to select text in this mode, press
|
the text cursor is visible on the web page. The <k>v</k> key
|
||||||
<k>v</k> to start its Visual mode.
|
enters visual mode, where text is selected as the cursor moves.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2009-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -11,6 +11,74 @@ const Cu = Components.utils;
|
|||||||
|
|
||||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
||||||
|
let objproto = Object.prototype;
|
||||||
|
let hasOwnProperty = objproto.hasOwnProperty;
|
||||||
|
|
||||||
|
if (!Object.create)
|
||||||
|
Object.create = function (proto, props) {
|
||||||
|
let obj = { __proto__: proto };
|
||||||
|
for (let k in properties(props || {}))
|
||||||
|
Object.defineProperty(obj, k, props[k]);
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
if (!Object.defineProperty)
|
||||||
|
Object.defineProperty = function (obj, prop, desc) {
|
||||||
|
let value = desc.value;
|
||||||
|
if ("value" in desc)
|
||||||
|
if (desc.writable && !objproto.__lookupGetter__.call(obj, prop)
|
||||||
|
&& !objproto.__lookupSetter__.call(obj, prop))
|
||||||
|
obj[prop] = value;
|
||||||
|
else {
|
||||||
|
objproto.__defineGetter__.call(obj, prop, function () value);
|
||||||
|
if (desc.writable)
|
||||||
|
objproto.__defineSetter__.call(obj, prop, function (val) { value = val; });
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("get" in desc)
|
||||||
|
objproto.__defineGetter__.call(obj, prop, desc.get);
|
||||||
|
if ("set" in desc)
|
||||||
|
objproto.__defineSetter__.call(obj, prop, desc.set);
|
||||||
|
}
|
||||||
|
if (!Object.getOwnPropertyDescriptor)
|
||||||
|
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(obj, prop) {
|
||||||
|
if (!hasOwnProperty.call(obj, prop))
|
||||||
|
return undefined;
|
||||||
|
let desc = {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: objproto.propertyIsEnumerable.call(obj, prop),
|
||||||
|
};
|
||||||
|
var get = obj.__lookupGetter__(prop),
|
||||||
|
set = obj.__lookupSetter__(prop);
|
||||||
|
if (!get && !set) {
|
||||||
|
desc.value = obj[prop];
|
||||||
|
desc.writable = true;
|
||||||
|
}
|
||||||
|
if (get)
|
||||||
|
desc.get = get;
|
||||||
|
if (set)
|
||||||
|
desc.set = set;
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
if (!Object.getOwnPropertyNames)
|
||||||
|
Object.getOwnPropertyNames = function getOwnPropertyNames(obj) {
|
||||||
|
// This is an ugly and unfortunately necessary hack.
|
||||||
|
if (hasOwnProperty.call(obj, "__iterator__")) {
|
||||||
|
var oldIter = obj.__iterator__;
|
||||||
|
delete obj.__iterator__;
|
||||||
|
}
|
||||||
|
let res = [k for (k in obj) if (hasOwnProperty.call(obj, k))];
|
||||||
|
if (oldIter !== undefined) {
|
||||||
|
obj.__iterator__ = oldIter;
|
||||||
|
res.push("__iterator__");
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
if (!Object.getPrototypeOf)
|
||||||
|
Object.getPrototypeOf = function (obj) obj.__proto__;
|
||||||
|
if (!Object.keys)
|
||||||
|
Object.keys = function (obj)
|
||||||
|
Object.getOwnPropertyNames(obj).filter(function (k) objproto.propertyIsEnumerable.call(obj, k));
|
||||||
|
|
||||||
let use = {};
|
let use = {};
|
||||||
let loaded = {};
|
let loaded = {};
|
||||||
let currentModule;
|
let currentModule;
|
||||||
@@ -30,17 +98,21 @@ function defmodule(name, module, params) {
|
|||||||
}
|
}
|
||||||
currentModule = module;
|
currentModule = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
defmodule.loadLog = [];
|
defmodule.loadLog = [];
|
||||||
// Object.defineProperty(defmodule.loadLog, "push", { value: function (val) { dump(val + "\n"); this[this.length] = val } });
|
Object.defineProperty(defmodule.loadLog, "push", { value: function (val) { dump(val + "\n"); this[this.length] = val } });
|
||||||
defmodule.modules = [];
|
defmodule.modules = [];
|
||||||
defmodule.times = {};
|
defmodule.times = { all: 0 };
|
||||||
defmodule.time = function (major, minor, func, self) {
|
defmodule.time = function time(major, minor, func, self) {
|
||||||
let time = Date.now();
|
let time = Date.now();
|
||||||
let res = func.apply(self, Array.slice(arguments, 4));
|
let res = func.apply(self, Array.slice(arguments, 4));
|
||||||
let delta = Date.now() - time;
|
let delta = Date.now() - time;
|
||||||
|
defmodule.times.all += delta;
|
||||||
defmodule.times[major] = (defmodule.times[major] || 0) + delta;
|
defmodule.times[major] = (defmodule.times[major] || 0) + delta;
|
||||||
if (minor)
|
if (minor) {
|
||||||
|
defmodule.times[":" + minor] = (defmodule.times[":" + minor] || 0) + delta;
|
||||||
defmodule.times[major + ":" + minor] = (defmodule.times[major + ":" + minor] || 0) + delta;
|
defmodule.times[major + ":" + minor] = (defmodule.times[major + ":" + minor] || 0) + delta;
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,12 +138,12 @@ defmodule("base", this, {
|
|||||||
// sed -n 's/^(const|function) ([a-zA-Z0-9_]+).*/ "\2",/p' base.jsm | sort | fmt
|
// sed -n 's/^(const|function) ([a-zA-Z0-9_]+).*/ "\2",/p' base.jsm | sort | fmt
|
||||||
exports: [
|
exports: [
|
||||||
"Cc", "Ci", "Class", "Cr", "Cu", "Module", "Object", "Runnable",
|
"Cc", "Ci", "Class", "Cr", "Cu", "Module", "Object", "Runnable",
|
||||||
"Struct", "StructBase", "Timer", "XPCOMUtils", "allkeys", "array",
|
"Struct", "StructBase", "Timer", "UTF8", "XPCOMUtils", "array",
|
||||||
"call", "callable", "curry", "debuggerProperties", "defmodule", "dict",
|
"call", "callable", "curry", "debuggerProperties", "defmodule",
|
||||||
"endmodule", "extend", "foreach", "isarray", "isgenerator",
|
"endmodule", "extend", "foreach", "isarray", "isgenerator",
|
||||||
"isinstance", "isobject", "isstring", "issubclass", "iter", "keys",
|
"isinstance", "isobject", "isstring", "issubclass", "iter", "iterall",
|
||||||
"memoize", "properties", "requiresMainThread", "set", "update",
|
"keys", "memoize", "properties", "requiresMainThread", "set",
|
||||||
"values",
|
"update", "values",
|
||||||
],
|
],
|
||||||
use: ["services"]
|
use: ["services"]
|
||||||
});
|
});
|
||||||
@@ -83,33 +155,13 @@ function Runnable(self, func, args) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function allkeys(obj) {
|
/**
|
||||||
let ret = {};
|
* Returns a list of all of the top-level properties of an object, by
|
||||||
try {
|
* way of the debugger.
|
||||||
for (; obj; obj = obj.__proto__) {
|
*
|
||||||
services.get("debugger").wrapValue(obj).getProperties(ret, {});
|
* @param {object} obj
|
||||||
for (let prop in values(ret.value))
|
* @returns [jsdIProperty]
|
||||||
yield prop.name.stringValue;
|
*/
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
|
|
||||||
let __iterator__ = obj.__iterator__;
|
|
||||||
try {
|
|
||||||
if ("__iterator__" in obj) {
|
|
||||||
yield "__iterator__";
|
|
||||||
delete obj.__iterator__;
|
|
||||||
}
|
|
||||||
for (let k in obj)
|
|
||||||
yield k;
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
if (__iterator__)
|
|
||||||
obj.__iterator__ = __iterator__;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function debuggerProperties(obj) {
|
function debuggerProperties(obj) {
|
||||||
if (loaded.services && services.get("debugger").isOn) {
|
if (loaded.services && services.get("debugger").isOn) {
|
||||||
let ret = {};
|
let ret = {};
|
||||||
@@ -118,58 +170,89 @@ function debuggerProperties(obj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let hasOwnProperty = Object.prototype.hasOwnProperty;
|
/**
|
||||||
if (!Object.keys)
|
* Iterates over the names of all of the top-level properties of an
|
||||||
Object.keys = function keys(obj) [k for (k in obj) if (hasOwnProperty.call(obj, k))];
|
* object or, if prototypes is given, all of the properties in the
|
||||||
|
* prototype chain below the top. Uses the debugger if possible.
|
||||||
if (!Object.getOwnPropertyNames)
|
*
|
||||||
Object.getOwnPropertyNames = function getOwnPropertyNames(obj) {
|
* @param {object} obj The object to inspect.
|
||||||
let res = debuggerProperties(obj);
|
* @param {boolean} properties Whether to inspect the prototype chain
|
||||||
if (res)
|
* @default false
|
||||||
return [prop.name.stringValue for (prop in values(res))];
|
* @returns {Generator}
|
||||||
return Object.keys(obj);
|
*/
|
||||||
}
|
function properties(obj, prototypes, debugger_) {
|
||||||
|
|
||||||
function properties(obj, prototypes) {
|
|
||||||
let orig = obj;
|
let orig = obj;
|
||||||
let seen = {};
|
let seen = {};
|
||||||
for (; obj; obj = prototypes && obj.__proto__) {
|
for (; obj; obj = prototypes && obj.__proto__) {
|
||||||
try {
|
try {
|
||||||
var iter = values(Object.getOwnPropertyNames(obj));
|
var iter = (!debugger_ || !services.get("debugger").isOn) && values(Object.getOwnPropertyNames(obj));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {}
|
||||||
|
if (!iter)
|
||||||
iter = (prop.name.stringValue for (prop in values(debuggerProperties(obj))));
|
iter = (prop.name.stringValue for (prop in values(debuggerProperties(obj))));
|
||||||
}
|
|
||||||
for (let key in iter)
|
for (let key in iter)
|
||||||
if (!prototypes || !set.add(seen, key) && obj != orig)
|
if (!prototypes || !set.add(seen, key) && obj != orig)
|
||||||
yield key
|
yield key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterates over all of the top-level, iterable property names of an
|
||||||
|
* object.
|
||||||
|
*
|
||||||
|
* @param {object} obj The object to inspect.
|
||||||
|
* @returns {Generator}
|
||||||
|
*/
|
||||||
function keys(obj) {
|
function keys(obj) {
|
||||||
for (var k in obj)
|
for (var k in obj)
|
||||||
if (hasOwnProperty.call(obj, k))
|
if (hasOwnProperty.call(obj, k))
|
||||||
yield k;
|
yield k;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Iterates over all of the top-level, iterable property values of an
|
||||||
|
* object.
|
||||||
|
*
|
||||||
|
* @param {object} obj The object to inspect.
|
||||||
|
* @returns {Generator}
|
||||||
|
*/
|
||||||
function values(obj) {
|
function values(obj) {
|
||||||
for (var k in obj)
|
for (var k in obj)
|
||||||
if (hasOwnProperty.call(obj, k))
|
if (hasOwnProperty.call(obj, k))
|
||||||
yield obj[k];
|
yield obj[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterates over an iterable object and calls a callback for each
|
||||||
|
* element.
|
||||||
|
*
|
||||||
|
* @param {object} iter The iterator.
|
||||||
|
* @param {function} fn The callback.
|
||||||
|
* @param {object} self The this object for 'fn'.
|
||||||
|
*/
|
||||||
function foreach(iter, fn, self) {
|
function foreach(iter, fn, self) {
|
||||||
for (let val in iter)
|
for (let val in iter)
|
||||||
fn.call(self, val);
|
fn.call(self, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dict(ary) {
|
/**
|
||||||
var obj = {};
|
* Iterates over each iterable argument in turn, yielding each value.
|
||||||
for (var i = 0; i < ary.length; i++) {
|
*
|
||||||
var val = ary[i];
|
* @returns {Generator}
|
||||||
obj[val[0]] = val[1];
|
*/
|
||||||
}
|
function iterall() {
|
||||||
return obj;
|
for (let i = 0; i < arguments.length; i++)
|
||||||
|
for (let j in Iterator(arguments[i]))
|
||||||
|
yield j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility for managing sets of strings. Given an array, returns an
|
||||||
|
* object with one key for each value thereof.
|
||||||
|
*
|
||||||
|
* @param {[string]} ary @optional
|
||||||
|
* @returns {object}
|
||||||
|
*/
|
||||||
function set(ary) {
|
function set(ary) {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
if (ary)
|
if (ary)
|
||||||
@@ -177,33 +260,86 @@ function set(ary) {
|
|||||||
obj[ary[i]] = true;
|
obj[ary[i]] = true;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Adds an element to a set and returns true if the element was
|
||||||
|
* previously contained.
|
||||||
|
*
|
||||||
|
* @param {object} set The set.
|
||||||
|
* @param {string} key The key to add.
|
||||||
|
* @returns boolean
|
||||||
|
*/
|
||||||
set.add = function (set, key) {
|
set.add = function (set, key) {
|
||||||
let res = this.has(set, key);
|
let res = this.has(set, key);
|
||||||
set[key] = true;
|
set[key] = true;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Returns true if the given set contains the given key.
|
||||||
|
*
|
||||||
|
* @param {object} set The set.
|
||||||
|
* @param {string} key The key to check.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
set.has = function (set, key) hasOwnProperty.call(set, key);
|
set.has = function (set, key) hasOwnProperty.call(set, key);
|
||||||
set.remove = function (set, key) { delete set[key]; }
|
/**
|
||||||
|
* Returns a new set containing the members of the first argument which
|
||||||
|
* do not exist in any of the other given arguments.
|
||||||
|
*
|
||||||
|
* @param {object} set The set.
|
||||||
|
* @returns {object}
|
||||||
|
*/
|
||||||
|
set.subtract = function (set) {
|
||||||
|
set = update({}, set);
|
||||||
|
for (let i = 1; i < arguments.length; i++)
|
||||||
|
for (let k in keys(arguments[i]))
|
||||||
|
delete set[k];
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Removes an element from a set and returns true if the element was
|
||||||
|
* previously contained.
|
||||||
|
*
|
||||||
|
* @param {object} set The set.
|
||||||
|
* @param {string} key The key to remove.
|
||||||
|
* @returns boolean
|
||||||
|
*/
|
||||||
|
set.remove = function (set, key) {
|
||||||
|
let res = set.has(set, key);
|
||||||
|
delete set[key];
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterates over an arbitrary object. The following iterators types are
|
||||||
|
* supported, and work as a user would expect:
|
||||||
|
*
|
||||||
|
* • nsIDOMNodeIterator
|
||||||
|
* • mozIStorageStatement
|
||||||
|
*
|
||||||
|
* Additionally, the following array-like objects yield a tuple of the
|
||||||
|
* form [index, element] for each contained element:
|
||||||
|
*
|
||||||
|
* • nsIDOMHTMLCollection
|
||||||
|
* • nsIDOMNodeList
|
||||||
|
*
|
||||||
|
* and the following likewise yield one element of the form
|
||||||
|
* [name, element] for each contained element:
|
||||||
|
*
|
||||||
|
* • nsIDOMNamedNodeMap
|
||||||
|
*
|
||||||
|
* Duck typing is implemented for the any other type. If the object
|
||||||
|
* contains the "enumerator" property, iter is called on that. If the
|
||||||
|
* property is a function, it is called first. If it contains the
|
||||||
|
* property "getNext" along with either "hasMoreItems" or "hasMore", it
|
||||||
|
* is iterated over appropriately.
|
||||||
|
*
|
||||||
|
* For all other cases, this function behaves exactly like the Iterator
|
||||||
|
* function.
|
||||||
|
*
|
||||||
|
* @param {object} obj
|
||||||
|
* @returns {Generator}
|
||||||
|
*/
|
||||||
function iter(obj) {
|
function iter(obj) {
|
||||||
if (obj instanceof Ci.nsISimpleEnumerator)
|
|
||||||
return (function () {
|
|
||||||
while (obj.hasMoreElements())
|
|
||||||
yield obj.getNext();
|
|
||||||
})();
|
|
||||||
if (isinstance(obj, [Ci.nsIStringEnumerator, Ci.nsIUTF8StringEnumerator]))
|
|
||||||
return (function () {
|
|
||||||
while (obj.hasMore())
|
|
||||||
yield obj.getNext();
|
|
||||||
})();
|
|
||||||
if (isinstance(obj, Ci.nsIDOMNodeIterator))
|
|
||||||
return (function () {
|
|
||||||
try {
|
|
||||||
while (true)
|
|
||||||
yield obj.nextNode();
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
})();
|
|
||||||
if (isinstance(obj, [Ci.nsIDOMHTMLCollection, Ci.nsIDOMNodeList]))
|
if (isinstance(obj, [Ci.nsIDOMHTMLCollection, Ci.nsIDOMNodeList]))
|
||||||
return array.iteritems(obj);
|
return array.iteritems(obj);
|
||||||
if (obj instanceof Ci.nsIDOMNamedNodeMap)
|
if (obj instanceof Ci.nsIDOMNamedNodeMap)
|
||||||
@@ -217,14 +353,51 @@ function iter(obj) {
|
|||||||
yield obj.row;
|
yield obj.row;
|
||||||
obj.reset();
|
obj.reset();
|
||||||
})(obj);
|
})(obj);
|
||||||
|
if ("getNext" in obj) {
|
||||||
|
if ("hasMoreElements" in obj)
|
||||||
|
return (function () {
|
||||||
|
while (obj.hasMoreElements())
|
||||||
|
yield obj.getNext();
|
||||||
|
})();
|
||||||
|
if ("hasMore" in obj)
|
||||||
|
return (function () {
|
||||||
|
while (obj.hasMore())
|
||||||
|
yield obj.getNext();
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
if ("enumerator" in obj) {
|
||||||
|
if (callable(obj.enumerator))
|
||||||
|
return iter(obj.enumerator());
|
||||||
|
return iter(obj.enumerator);
|
||||||
|
}
|
||||||
return Iterator(obj);
|
return Iterator(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if both arguments are functions and
|
||||||
|
* (targ() instaneof src) would also return true.
|
||||||
|
*
|
||||||
|
* @param {function} targ
|
||||||
|
* @param {function} src
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
function issubclass(targ, src) {
|
function issubclass(targ, src) {
|
||||||
return src === targ ||
|
return src === targ ||
|
||||||
targ && typeof targ === "function" && targ.prototype instanceof src;
|
targ && typeof targ === "function" && targ.prototype instanceof src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if targ is an instance or src. If src is an array,
|
||||||
|
* returns true if targ is an instance of any element of src. If src is
|
||||||
|
* the object form of a primitive type, returns true if targ is a
|
||||||
|
* non-boxed version of the type, i.e., if (typeof targ == "string"),
|
||||||
|
* isinstance(targ, String) is true. Finally, if src is a string,
|
||||||
|
* returns true if ({}.toString.call(targ) == "[object <src>]").
|
||||||
|
*
|
||||||
|
* @param {object} targ The object to check.
|
||||||
|
* @param {object|string|[object|string]} src The types to check targ against.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
function isinstance(targ, src) {
|
function isinstance(targ, src) {
|
||||||
const types = {
|
const types = {
|
||||||
boolean: Boolean,
|
boolean: Boolean,
|
||||||
@@ -234,8 +407,8 @@ function isinstance(targ, src) {
|
|||||||
}
|
}
|
||||||
src = Array.concat(src);
|
src = Array.concat(src);
|
||||||
for (var i = 0; i < src.length; i++) {
|
for (var i = 0; i < src.length; i++) {
|
||||||
if (typeof src[i] == "string") {
|
if (typeof src[i] === "string") {
|
||||||
if (Object.prototype.toString.call(targ) == "[object " + src[i] + "]")
|
if (objproto.toString.call(targ) === "[object " + src[i] + "]")
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -249,9 +422,10 @@ function isinstance(targ, src) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isobject(obj) {
|
/**
|
||||||
return typeof obj === "object" && obj != null;
|
* Returns true if obj is a non-null object.
|
||||||
}
|
*/
|
||||||
|
function isobject(obj) typeof obj === "object" && obj != null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if and only if its sole argument is an
|
* Returns true if and only if its sole argument is an
|
||||||
@@ -259,9 +433,8 @@ function isobject(obj) {
|
|||||||
* any window, frame, namespace, or execution context, which
|
* any window, frame, namespace, or execution context, which
|
||||||
* is not the case when using (obj instanceof Array).
|
* is not the case when using (obj instanceof Array).
|
||||||
*/
|
*/
|
||||||
function isarray(val) {
|
const isarray = Array.isArray ||
|
||||||
return Object.prototype.toString.call(val) == "[object Array]";
|
function isarray(val) objproto.toString.call(val) == "[object Array]";
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if and only if its sole argument is an
|
* Returns true if and only if its sole argument is an
|
||||||
@@ -269,9 +442,7 @@ function isarray(val) {
|
|||||||
* functions containing the 'yield' statement and generator
|
* functions containing the 'yield' statement and generator
|
||||||
* statements such as (x for (x in obj)).
|
* statements such as (x for (x in obj)).
|
||||||
*/
|
*/
|
||||||
function isgenerator(val) {
|
function isgenerator(val) objproto.toString.call(val) == "[object Generator]";
|
||||||
return Object.prototype.toString.call(val) == "[object Generator]";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if and only if its sole argument is a String,
|
* Returns true if and only if its sole argument is a String,
|
||||||
@@ -280,28 +451,30 @@ function isgenerator(val) {
|
|||||||
* namespace, or execution context, which is not the case when
|
* namespace, or execution context, which is not the case when
|
||||||
* using (obj instanceof String) or (typeof obj == "string").
|
* using (obj instanceof String) or (typeof obj == "string").
|
||||||
*/
|
*/
|
||||||
function isstring(val) {
|
function isstring(val) objproto.toString.call(val) == "[object String]";
|
||||||
return Object.prototype.toString.call(val) == "[object String]";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if and only if its sole argument may be called
|
* Returns true if and only if its sole argument may be called
|
||||||
* as a function. This includes classes and function objects.
|
* as a function. This includes classes and function objects.
|
||||||
*/
|
*/
|
||||||
function callable(val) {
|
function callable(val) typeof val === "function";
|
||||||
return typeof val === "function";
|
|
||||||
}
|
|
||||||
|
|
||||||
function call(fn) {
|
function call(fn) {
|
||||||
fn.apply(arguments[1], Array.slice(arguments, 2));
|
fn.apply(arguments[1], Array.slice(arguments, 2));
|
||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Memoizes an object property value.
|
||||||
|
*
|
||||||
|
* @param {object} obj The object to add the property to.
|
||||||
|
* @param {string} key The property name.
|
||||||
|
* @param {function} getter The function which will return the initial
|
||||||
|
* value of the property.
|
||||||
|
*/
|
||||||
function memoize(obj, key, getter) {
|
function memoize(obj, key, getter) {
|
||||||
obj.__defineGetter__(key, function () {
|
obj.__defineGetter__(key, function ()
|
||||||
delete obj[key];
|
Class.replaceProperty(this, key, getter.call(this, key)));
|
||||||
return obj[key] = getter(obj, key);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -390,24 +563,15 @@ function update(target) {
|
|||||||
for (let i = 1; i < arguments.length; i++) {
|
for (let i = 1; i < arguments.length; i++) {
|
||||||
let src = arguments[i];
|
let src = arguments[i];
|
||||||
Object.getOwnPropertyNames(src || {}).forEach(function (k) {
|
Object.getOwnPropertyNames(src || {}).forEach(function (k) {
|
||||||
var get = src.__lookupGetter__(k),
|
let desc = Object.getOwnPropertyDescriptor(src, k);
|
||||||
set = src.__lookupSetter__(k);
|
if (desc.value && callable(desc.value) && Object.getPrototypeOf(target)) {
|
||||||
if (!get && !set) {
|
let func = desc.value;
|
||||||
var v = src[k];
|
desc.value.superapply = function (self, args)
|
||||||
target[k] = v;
|
Object.getPrototypeOf(target)[k].apply(self, args);
|
||||||
if (target.__proto__ && callable(v)) {
|
desc.value.supercall = function (self)
|
||||||
v.superapply = function (self, args) {
|
func.superapply(self, Array.slice(arguments, 1));
|
||||||
return target.__proto__[k].apply(self, args);
|
|
||||||
};
|
|
||||||
v.supercall = function (self) {
|
|
||||||
return v.superapply(self, Array.slice(arguments, 1));
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
Object.defineProperty(target, k, desc);
|
||||||
if (get)
|
|
||||||
target.__defineGetter__(k, get);
|
|
||||||
if (set)
|
|
||||||
target.__defineSetter__(k, set);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
@@ -424,14 +588,19 @@ function update(target) {
|
|||||||
* @param {Object} overrides @optional
|
* @param {Object} overrides @optional
|
||||||
*/
|
*/
|
||||||
function extend(subclass, superclass, overrides) {
|
function extend(subclass, superclass, overrides) {
|
||||||
subclass.prototype = { __proto__: superclass.prototype };
|
subclass.superclass = superclass;
|
||||||
|
|
||||||
|
try {
|
||||||
|
subclass.prototype = Object.create(superclass.prototype);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
dump(e + "\n" + String.replace(e.stack, /^/gm, " ") + "\n\n");
|
||||||
|
}
|
||||||
update(subclass.prototype, overrides);
|
update(subclass.prototype, overrides);
|
||||||
|
|
||||||
subclass.superclass = superclass.prototype;
|
|
||||||
subclass.prototype.constructor = subclass;
|
subclass.prototype.constructor = subclass;
|
||||||
subclass.prototype.__class__ = subclass;
|
subclass.prototype._class_ = subclass;
|
||||||
|
|
||||||
if (superclass.prototype.constructor === Object.prototype.constructor)
|
if (superclass.prototype.constructor === objproto.constructor)
|
||||||
superclass.prototype.constructor = superclass;
|
superclass.prototype.constructor = superclass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,22 +628,6 @@ function extend(subclass, superclass, overrides) {
|
|||||||
* @returns {function} The constructor for the resulting class.
|
* @returns {function} The constructor for the resulting class.
|
||||||
*/
|
*/
|
||||||
function Class() {
|
function Class() {
|
||||||
function constructor() {
|
|
||||||
let self = {
|
|
||||||
__proto__: Constructor.prototype,
|
|
||||||
constructor: Constructor,
|
|
||||||
get closure() {
|
|
||||||
delete this.closure;
|
|
||||||
function closure(fn) function () fn.apply(self, arguments);
|
|
||||||
for (let k in this)
|
|
||||||
if (!this.__lookupGetter__(k) && callable(this[k]))
|
|
||||||
closure[k] = closure(self[k]);
|
|
||||||
return this.closure = closure;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var res = self.init.apply(self, arguments);
|
|
||||||
return res !== undefined ? res : self;
|
|
||||||
}
|
|
||||||
|
|
||||||
var args = Array.slice(arguments);
|
var args = Array.slice(arguments);
|
||||||
if (isstring(args[0]))
|
if (isstring(args[0]))
|
||||||
@@ -483,21 +636,43 @@ function Class() {
|
|||||||
if (callable(args[0]))
|
if (callable(args[0]))
|
||||||
superclass = args.shift();
|
superclass = args.shift();
|
||||||
|
|
||||||
var Constructor = eval("(function " + (name || superclass.name).replace(/\W/g, "_") +
|
var Constructor = eval(String.replace(<![CDATA[
|
||||||
String.substr(constructor, 20) + ")");
|
(function constructor() {
|
||||||
Constructor.__proto__ = superclass;
|
let self = Object.create(Constructor.prototype, {
|
||||||
Constructor.name = name || superclass.name;
|
constructor: { value: Constructor },
|
||||||
|
closure: {
|
||||||
|
configurable: true,
|
||||||
|
get: function () {
|
||||||
|
function closure(fn) function () fn.apply(self, arguments);
|
||||||
|
for (let k in iterall(properties(this),
|
||||||
|
properties(this, true)))
|
||||||
|
if (!this.__lookupGetter__(k) && callable(this[k]))
|
||||||
|
closure[k] = closure(self[k]);
|
||||||
|
Object.defineProperty(this, "closure", { value: closure });
|
||||||
|
return closure;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var res = self.init.apply(self, arguments);
|
||||||
|
return res !== undefined ? res : self;
|
||||||
|
})]]>,
|
||||||
|
"constructor", (name || superclass.classname).replace(/\W/g, "_")));
|
||||||
|
Constructor.classname = name || superclass.classname || superclass.name;
|
||||||
|
|
||||||
if (!("init" in superclass.prototype)) {
|
if ("init" in superclass.prototype)
|
||||||
var superc = superclass;
|
Constructor.__proto__ = superclass;
|
||||||
|
else {
|
||||||
|
let superc = superclass;
|
||||||
superclass = function Shim() {};
|
superclass = function Shim() {};
|
||||||
extend(superclass, superc, {
|
extend(superclass, superc, {
|
||||||
init: superc
|
init: superc
|
||||||
});
|
});
|
||||||
|
superclass.__proto__ = superc;
|
||||||
}
|
}
|
||||||
|
|
||||||
extend(Constructor, superclass, args[0]);
|
extend(Constructor, superclass, args[0]);
|
||||||
update(Constructor, args[1]);
|
update(Constructor, args[1]);
|
||||||
|
Constructor.__proto__ = superclass;
|
||||||
args = args.slice(2);
|
args = args.slice(2);
|
||||||
Array.forEach(args, function (obj) {
|
Array.forEach(args, function (obj) {
|
||||||
if (callable(obj))
|
if (callable(obj))
|
||||||
@@ -506,18 +681,11 @@ function Class() {
|
|||||||
});
|
});
|
||||||
return Constructor;
|
return Constructor;
|
||||||
}
|
}
|
||||||
if (Object.defineProperty)
|
Class.replaceProperty = function (obj, prop, value) {
|
||||||
Class.replaceProperty = function (obj, prop, value) {
|
|
||||||
Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: value, writable: true });
|
Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: value, writable: true });
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
else
|
Class.toString = function () "[class " + this.classname + "]";
|
||||||
Class.replaceProperty = function (obj, prop, value) {
|
|
||||||
obj.__defineGetter__(prop, function () value);
|
|
||||||
obj.__defineSetter__(prop, function (val) { value = val; });
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
Class.toString = function () "[class " + this.name + "]";
|
|
||||||
Class.prototype = {
|
Class.prototype = {
|
||||||
/**
|
/**
|
||||||
* Initializes new instances of this class. Called automatically
|
* Initializes new instances of this class. Called automatically
|
||||||
@@ -525,7 +693,7 @@ Class.prototype = {
|
|||||||
*/
|
*/
|
||||||
init: function () {},
|
init: function () {},
|
||||||
|
|
||||||
toString: function () "[instance " + this.constructor.name + "]",
|
toString: function () "[instance " + this.constructor.classname + "]",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes 'callback' after 'timeout' milliseconds. The value of
|
* Executes 'callback' after 'timeout' milliseconds. The value of
|
||||||
@@ -558,9 +726,9 @@ function Module(name, prototype) {
|
|||||||
let init = callable(prototype) ? 4 : 3;
|
let init = callable(prototype) ? 4 : 3;
|
||||||
const module = Class.apply(Class, Array.slice(arguments, 0, init));
|
const module = Class.apply(Class, Array.slice(arguments, 0, init));
|
||||||
let instance = module();
|
let instance = module();
|
||||||
module.name = name.toLowerCase();
|
module.classname = name.toLowerCase();
|
||||||
instance.INIT = arguments[init] || {};
|
instance.INIT = arguments[init] || {};
|
||||||
currentModule[module.name] = instance;
|
currentModule[module.classname] = instance;
|
||||||
defmodule.modules.push(instance);
|
defmodule.modules.push(instance);
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
@@ -597,7 +765,7 @@ else
|
|||||||
*/
|
*/
|
||||||
function Struct() {
|
function Struct() {
|
||||||
let args = Array.slice(arguments);
|
let args = Array.slice(arguments);
|
||||||
const Struct = Class("Struct", Struct_Base, {
|
const Struct = Class("Struct", StructBase, {
|
||||||
length: args.length,
|
length: args.length,
|
||||||
members: args
|
members: args
|
||||||
});
|
});
|
||||||
@@ -607,7 +775,7 @@ function Struct() {
|
|||||||
});
|
});
|
||||||
return Struct;
|
return Struct;
|
||||||
}
|
}
|
||||||
let Struct_Base = Class("StructBase", Array, {
|
let StructBase = Class("StructBase", Array, {
|
||||||
init: function () {
|
init: function () {
|
||||||
for (let i = 0; i < arguments.length; i++)
|
for (let i = 0; i < arguments.length; i++)
|
||||||
if (arguments[i] != undefined)
|
if (arguments[i] != undefined)
|
||||||
@@ -639,7 +807,7 @@ let Struct_Base = Class("StructBase", Array, {
|
|||||||
*/
|
*/
|
||||||
defaultValue: function (key, val) {
|
defaultValue: function (key, val) {
|
||||||
let i = this.prototype.members.indexOf(key);
|
let i = this.prototype.members.indexOf(key);
|
||||||
this.prototype.__defineGetter__(i, function () (this[i] = val.call(this), this[i])); // Kludge for FF 3.0
|
this.prototype.__defineGetter__(i, function () (this[i] = val.call(this)));
|
||||||
this.prototype.__defineSetter__(i, function (value)
|
this.prototype.__defineSetter__(i, function (value)
|
||||||
Class.replaceProperty(this, i, value));
|
Class.replaceProperty(this, i, value));
|
||||||
}
|
}
|
||||||
@@ -700,10 +868,26 @@ const Timer = Class("Timer", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the UTF-8 encoded value of a string mis-encoded into
|
||||||
|
* ISO-8859-1.
|
||||||
|
*
|
||||||
|
* @param {string} str
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
function UTF8(str) {
|
||||||
|
try {
|
||||||
|
return decodeURIComponent(escape(str))
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array utility methods.
|
* Array utility methods.
|
||||||
*/
|
*/
|
||||||
const array = Class("util.Array", Array, {
|
const array = Class("array", Array, {
|
||||||
init: function (ary) {
|
init: function (ary) {
|
||||||
if (isinstance(ary, ["Iterator", "Generator"]))
|
if (isinstance(ary, ["Iterator", "Generator"]))
|
||||||
ary = [k for (k in ary)];
|
ary = [k for (k in ary)];
|
||||||
@@ -714,23 +898,19 @@ const array = Class("util.Array", Array, {
|
|||||||
__proto__: ary,
|
__proto__: ary,
|
||||||
__iterator__: function () this.iteritems(),
|
__iterator__: function () this.iteritems(),
|
||||||
__noSuchMethod__: function (meth, args) {
|
__noSuchMethod__: function (meth, args) {
|
||||||
var res = array[meth].apply(null, [this.__proto__].concat(args));
|
var res = array[meth].apply(null, [this.array].concat(args));
|
||||||
|
|
||||||
if (isarray(res))
|
if (isarray(res))
|
||||||
return array(res);
|
return array(res);
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
toString: function () this.__proto__.toString(),
|
array: ary,
|
||||||
concat: function () this.__proto__.concat.apply(this.__proto__, arguments),
|
toString: function () this.array.toString(),
|
||||||
|
concat: function () this.array.concat.apply(this.array, arguments),
|
||||||
filter: function () this.__noSuchMethod__("filter", Array.slice(arguments)),
|
filter: function () this.__noSuchMethod__("filter", Array.slice(arguments)),
|
||||||
map: function () this.__noSuchMethod__("map", Array.slice(arguments))
|
map: function () this.__noSuchMethod__("map", Array.slice(arguments))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
isinstance: function isinstance(obj) {
|
|
||||||
return Object.prototype.toString.call(obj) == "[object Array]";
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an array to an object. As in lisp, an assoc is an
|
* Converts an array to an object. As in lisp, an assoc is an
|
||||||
* array of key-value pairs, which maps directly to an object,
|
* array of key-value pairs, which maps directly to an object,
|
||||||
@@ -834,6 +1014,6 @@ const array = Class("util.Array", Array, {
|
|||||||
|
|
||||||
endmodule();
|
endmodule();
|
||||||
|
|
||||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n");}
|
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
|
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
Components.utils.import("resource://dactyl/base.jsm");
|
Components.utils.import("resource://dactyl/base.jsm");
|
||||||
defmodule("bookmarkcache", this, {
|
defmodule("bookmarkcache", this, {
|
||||||
exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"],
|
exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"],
|
||||||
require: ["services", "util"]
|
require: ["services", "storage", "util"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -26,11 +26,10 @@ const name = "bookmark-cache";
|
|||||||
|
|
||||||
const BookmarkCache = Module("BookmarkCache", {
|
const BookmarkCache = Module("BookmarkCache", {
|
||||||
init: function init() {
|
init: function init() {
|
||||||
|
|
||||||
bookmarks.addObserver(this, false);
|
bookmarks.addObserver(this, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
__iterator__: function () (val for ([, val] in Iterator(self.bookmarks))),
|
__iterator__: function () (val for ([, val] in Iterator(this.bookmarks))),
|
||||||
|
|
||||||
get bookmarks() Class.replaceProperty(this, "bookmarks", this.load()),
|
get bookmarks() Class.replaceProperty(this, "bookmarks", this.load()),
|
||||||
|
|
||||||
@@ -38,9 +37,9 @@ const BookmarkCache = Module("BookmarkCache", {
|
|||||||
.map(function (s) bookmarks[s]),
|
.map(function (s) bookmarks[s]),
|
||||||
|
|
||||||
_deleteBookmark: function deleteBookmark(id) {
|
_deleteBookmark: function deleteBookmark(id) {
|
||||||
let length = bookmarks.length;
|
let length = this.bookmarks.length;
|
||||||
bookmarks = bookmarks.filter(function (item) item.id != id);
|
this.bookmarks = this.bookmarks.filter(function (item) item.id != id);
|
||||||
return bookmarks.length < length;
|
return this.bookmarks.length < length;
|
||||||
},
|
},
|
||||||
|
|
||||||
_loadBookmark: function loadBookmark(node) {
|
_loadBookmark: function loadBookmark(node) {
|
||||||
@@ -118,7 +117,7 @@ const BookmarkCache = Module("BookmarkCache", {
|
|||||||
onItemMoved: function onItemMoved() {},
|
onItemMoved: function onItemMoved() {},
|
||||||
onItemAdded: function onItemAdded(itemId, folder, index) {
|
onItemAdded: function onItemAdded(itemId, folder, index) {
|
||||||
if (bookmarks.getItemType(itemId) == bookmarks.TYPE_BOOKMARK) {
|
if (bookmarks.getItemType(itemId) == bookmarks.TYPE_BOOKMARK) {
|
||||||
if (self.isBookmark(itemId)) {
|
if (this.isBookmark(itemId)) {
|
||||||
let bmark = this._loadBookmark(this.readBookmark(itemId));
|
let bmark = this._loadBookmark(this.readBookmark(itemId));
|
||||||
this.bookmarks.push(bmark);
|
this.bookmarks.push(bmark);
|
||||||
storage.fireEvent(name, "add", bmark);
|
storage.fireEvent(name, "add", bmark);
|
||||||
|
|||||||
@@ -8,22 +8,40 @@ Components.utils.import("resource://dactyl/base.jsm");
|
|||||||
defmodule("highlight", this, {
|
defmodule("highlight", this, {
|
||||||
exports: ["Highlight", "Highlights", "highlight"],
|
exports: ["Highlight", "Highlights", "highlight"],
|
||||||
require: ["services", "styles"],
|
require: ["services", "styles"],
|
||||||
use: ["template"]
|
use: ["template", "util"]
|
||||||
});
|
});
|
||||||
|
|
||||||
const Highlight = Struct("class", "selector", "filter", "default", "value", "base");
|
const Highlight = Struct("class", "selector", "sites",
|
||||||
|
"default", "value", "agent",
|
||||||
|
"base", "baseClass", "style");
|
||||||
|
Highlight.liveProperty = function (name, prop) {
|
||||||
|
let i = this.prototype.members.indexOf(name);
|
||||||
|
this.prototype.__defineGetter__(name, function () this[i]);
|
||||||
|
this.prototype.__defineSetter__(name, function (val) {
|
||||||
|
this[i] = val;
|
||||||
|
this.style[prop || name] = this[prop || name];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Highlight.liveProperty("agent");
|
||||||
|
Highlight.liveProperty("value", "css");
|
||||||
|
Highlight.liveProperty("selector", "css");
|
||||||
|
Highlight.liveProperty("sites");
|
||||||
|
Highlight.liveProperty("style", "css");
|
||||||
|
|
||||||
Highlight.defaultValue("filter", function ()
|
Highlight.defaultValue("baseClass", function () /^(\w*)/.exec(this.class)[0]);
|
||||||
this.base ? this.base.filter :
|
|
||||||
["chrome://dactyl/*",
|
|
||||||
"dactyl:*",
|
|
||||||
"file://*"].concat(highlight.styleableChrome).join(","));
|
|
||||||
Highlight.defaultValue("selector", function () highlight.selector(this.class));
|
Highlight.defaultValue("selector", function () highlight.selector(this.class));
|
||||||
|
Highlight.defaultValue("sites", function ()
|
||||||
|
this.base ? this.base.sites
|
||||||
|
: ["chrome://dactyl/*", "dactyl:*", "file://*"].concat(
|
||||||
|
highlight.styleableChrome));
|
||||||
|
Highlight.defaultValue("style", function ()
|
||||||
|
styles.addSheet(true, "highlight:" + this.class, this.sites, this.css, this.agent, true));
|
||||||
Highlight.defaultValue("value", function () this.default);
|
Highlight.defaultValue("value", function () this.default);
|
||||||
Highlight.defaultValue("base", function () {
|
|
||||||
let base = /^(\w*)/.exec(this.class)[0];
|
Highlight.prototype.__defineGetter__("base", function ()
|
||||||
return (base != this.class && base in highlight.highlight) ? highlight.highlight[base] : null;
|
this.baseClass != this.class && highlight.highlight[this.baseClass] || null);
|
||||||
});
|
Highlight.prototype.__defineGetter__("css", function ()
|
||||||
|
this.selector + "{" + this.value + "}");
|
||||||
Highlight.prototype.toString = function ()
|
Highlight.prototype.toString = function ()
|
||||||
"Highlight(" + this.class + ")\n\t"
|
"Highlight(" + this.class + ")\n\t"
|
||||||
+ [k + ": " + String.quote(v) for ([k, v] in this)]
|
+ [k + ": " + String.quote(v) for ([k, v] in this)]
|
||||||
@@ -38,12 +56,47 @@ Highlight.prototype.toString = function ()
|
|||||||
const Highlights = Module("Highlight", {
|
const Highlights = Module("Highlight", {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.highlight = {};
|
this.highlight = {};
|
||||||
|
this.loaded = {};
|
||||||
},
|
},
|
||||||
|
|
||||||
keys: function keys() Object.keys(this.highlight).sort(),
|
keys: function keys() Object.keys(this.highlight).sort(),
|
||||||
|
|
||||||
__iterator__: function () values(this.highlight),
|
__iterator__: function () values(this.highlight),
|
||||||
|
|
||||||
|
_create: function (agent, args) {
|
||||||
|
let obj = Highlight.apply(Highlight, args);
|
||||||
|
|
||||||
|
if (!isarray(obj[2]))
|
||||||
|
obj[2] = obj[2].split(",");
|
||||||
|
obj[5] = agent;
|
||||||
|
|
||||||
|
let old = this.highlight[obj.class];
|
||||||
|
this.highlight[obj.class] = obj;
|
||||||
|
// This *must* come before any other property changes.
|
||||||
|
if (old)
|
||||||
|
obj.style = old.style;
|
||||||
|
|
||||||
|
if (/^[>+ ]/.test(obj.selector))
|
||||||
|
obj.selector = this.selector(obj.class) + obj.selector;
|
||||||
|
if (old && old.value != old.default)
|
||||||
|
obj.value = old.style;
|
||||||
|
|
||||||
|
if (!old && obj.base && obj.base.enabled)
|
||||||
|
obj.style.enabled = true;
|
||||||
|
else
|
||||||
|
this.loaded.__defineSetter__(obj.class, function () {
|
||||||
|
delete this[obj.class];
|
||||||
|
this[obj.class] = true;
|
||||||
|
|
||||||
|
if (obj.class === obj.baseClass)
|
||||||
|
for (let h in highlight)
|
||||||
|
if (h.baseClass === obj.class)
|
||||||
|
this[h.class] = true;
|
||||||
|
obj.style.enabled = true;
|
||||||
|
});
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
|
||||||
get: function (k) this.highlight[k],
|
get: function (k) this.highlight[k],
|
||||||
set: function (key, newStyle, force, append) {
|
set: function (key, newStyle, force, append) {
|
||||||
let [, class_, selectors] = key.match(/^([a-zA-Z_-]+)(.*)/);
|
let [, class_, selectors] = key.match(/^([a-zA-Z_-]+)(.*)/);
|
||||||
@@ -51,35 +104,40 @@ const Highlights = Module("Highlight", {
|
|||||||
if (!(class_ in this.highlight))
|
if (!(class_ in this.highlight))
|
||||||
return "Unknown highlight keyword: " + class_;
|
return "Unknown highlight keyword: " + class_;
|
||||||
|
|
||||||
let style = this.highlight[key] || Highlight(key);
|
let highlight = this.highlight[key] || this._create(false, [key]);
|
||||||
|
|
||||||
if (append)
|
if (append)
|
||||||
newStyle = (style.value || "").replace(/;?\s*$/, "; " + newStyle);
|
newStyle = (highlight.value || "").replace(/;?\s*$/, "; " + newStyle);
|
||||||
if (/^\s*$/.test(newStyle))
|
if (/^\s*$/.test(newStyle))
|
||||||
newStyle = null;
|
newStyle = null;
|
||||||
if (newStyle == null) {
|
if (newStyle == null) {
|
||||||
if (style.default == null) {
|
if (highlight.default == null) {
|
||||||
styles.removeSheet(true, style.selector);
|
highlight.style.enabled = false;
|
||||||
delete this.highlight[style.class];
|
delete this.loaded[highlight.class];
|
||||||
|
delete this.highlight[highlight.class];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
newStyle = style.default;
|
newStyle = highlight.default;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!style.loaded || style.value != newStyle) {
|
highlight.value = newStyle;
|
||||||
styles.removeSheet(true, style.selector);
|
if (force)
|
||||||
let css = newStyle.replace(/(?:!\s*important\s*)?(?:;?\s*$|;)/g, "!important;")
|
highlight.style.enabled = true;
|
||||||
.replace(";!important;", ";", "g"); // Seeming Spidermonkey bug
|
this.highlight[highlight.class] = highlight;
|
||||||
if (!/^\s*(?:!\s*important\s*)?;*\s*$/.test(css)) {
|
return highlight;
|
||||||
css = style.selector + " { " + css + " }";
|
},
|
||||||
|
|
||||||
styles.addSheet(true, "highlight:" + style.class, style.filter, css, true);
|
/**
|
||||||
style.loaded = true;
|
* Highlights a node with the given group, and ensures that said
|
||||||
}
|
* group is loaded.
|
||||||
}
|
*
|
||||||
style.value = newStyle;
|
* @param {Node} node
|
||||||
this.highlight[style.class] = style;
|
* @param {string} group
|
||||||
return null;
|
*/
|
||||||
|
highlightNode: function (node, group) {
|
||||||
|
node.setAttributeNS(NS.uri, "highlight", group);
|
||||||
|
for each (let h in group.split(" "))
|
||||||
|
this.loaded[h] = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,30 +162,69 @@ const Highlights = Module("Highlight", {
|
|||||||
this.set(k, null, true);
|
this.set(k, null, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
groupRegexp: RegExp(String.replace(<![CDATA[
|
||||||
|
^
|
||||||
|
(\s* (?:\S|\s\S)+ \s+)
|
||||||
|
\{ ([^}]*) \}
|
||||||
|
\s*
|
||||||
|
$
|
||||||
|
]]>, /\s*/g, ""), "gm"),
|
||||||
|
sheetRegexp: RegExp(String.replace(<![CDATA[
|
||||||
|
^\s*
|
||||||
|
!? \*?
|
||||||
|
( (?:[^;\s]|\s\S)+ )
|
||||||
|
(?:; ( (?:[^;\s]|\s\S)+ )? )?
|
||||||
|
(?:; ( (?:[^ \s]|\s\S)+ ) )?
|
||||||
|
\s* (.*)
|
||||||
|
$
|
||||||
|
]]>, /\s*/g, "")),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk loads new CSS rules.
|
* Bulk loads new CSS rules, in the format of,
|
||||||
|
*
|
||||||
|
* Rules ::= Rule | Rule "\n" Rule
|
||||||
|
* Rule ::= Bang? Star? MatchSpec Space Space* Css
|
||||||
|
* | Comment
|
||||||
|
* Comment ::= Space* "//" *
|
||||||
|
* Bang ::= "!"
|
||||||
|
* Star ::= "*"
|
||||||
|
* MatchSpec ::= Class
|
||||||
|
* | Class ";" Selector
|
||||||
|
* | Class ";" Selector ";" Sites
|
||||||
|
* CSS ::= CSSLine | "{" CSSLines "}"
|
||||||
|
* CSSLines ::= CSSLine | CSSLine "\n" CSSLines
|
||||||
|
*
|
||||||
|
* Where Class is the name of the sheet, Selector is the CSS
|
||||||
|
* selector for the style, Site is the comma-separated list of site
|
||||||
|
* filters to apply the style to.
|
||||||
|
*
|
||||||
|
* If Selector is not provided, it defaults to [dactyl|highlight~={Class}].
|
||||||
|
* If it is provided and begins with any of "+", ">" or " ", it is
|
||||||
|
* appended to the default.
|
||||||
|
*
|
||||||
|
* If Sites is not provided, it defaults to the chrome documents of
|
||||||
|
* the main application window, dactyl help files, and any other
|
||||||
|
* dactyl-specific documents.
|
||||||
|
*
|
||||||
|
* If Star is provided, the style is applied as an agent sheet.
|
||||||
|
*
|
||||||
|
* The new styles are lazily activated unless Bang or 'eager' is
|
||||||
|
* provided. See {@link Util#xmlToDom}.
|
||||||
*
|
*
|
||||||
* @param {string} css The rules to load. See {@link Highlights#css}.
|
* @param {string} css The rules to load. See {@link Highlights#css}.
|
||||||
|
* @param {boolean} eager When true, load all provided rules immediately.
|
||||||
*/
|
*/
|
||||||
loadCSS: function (css) {
|
loadCSS: function (css, eager) {
|
||||||
css.replace(/^(\s*\S*\s+)\{((?:.|\n)*?)\}\s*$/gm, function (_, _1, _2) _1 + " " + _2.replace(/\n\s*/g, " "))
|
String.replace(css, this.groupRegexp, function (m, m1, m2) m1 + " " + m2.replace(/\n\s*/g, " "))
|
||||||
.split("\n").filter(function (s) /\S/.test(s))
|
.split("\n").filter(function (s) /\S/.test(s) && !/^\s*\/\//.test(s))
|
||||||
.forEach(function (style) {
|
.forEach(function (highlight) {
|
||||||
style = Highlight.apply(Highlight,
|
|
||||||
Array.slice(style.match(/^\s*((?:[^,\s]|\s\S)+)(?:,((?:[^,\s]|\s\S)+)?)?(?:,((?:[^,\s]|\s\S)+))?\s*(.*)$/),
|
|
||||||
1));
|
|
||||||
if (/^[>+ ]/.test(style.selector))
|
|
||||||
style.selector = this.selector(style.class) + style.selector;
|
|
||||||
|
|
||||||
let old = this.highlight[style.class];
|
let bang = eager || /^\s*!/.test(highlight);
|
||||||
if (!old)
|
let star = /^\s*!?\*/.test(highlight);
|
||||||
this.highlight[style.class] = style;
|
highlight = this._create(star, this.sheetRegexp.exec(highlight).slice(1));
|
||||||
else if (old.value == old.default)
|
if (bang)
|
||||||
old.value = style.value;
|
highlight.style.enabled = true;
|
||||||
}, this);
|
}, this);
|
||||||
for (let [class_, hl] in Iterator(this.highlight))
|
|
||||||
if (hl.value == hl.default)
|
|
||||||
this.set(class_);
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
}, {
|
}, {
|
||||||
@@ -181,11 +278,8 @@ const Highlights = Module("Highlight", {
|
|||||||
if (!key || h.class.indexOf(key) > -1))));
|
if (!key || h.class.indexOf(key) > -1))));
|
||||||
else if (!key && clear)
|
else if (!key && clear)
|
||||||
highlight.clear();
|
highlight.clear();
|
||||||
else {
|
else
|
||||||
let error = highlight.set(key, css, clear, "-append" in args);
|
highlight.set(key, css, clear, "-append" in args);
|
||||||
if (error)
|
|
||||||
dactyl.echoerr(error);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// TODO: add this as a standard highlight completion function?
|
// TODO: add this as a standard highlight completion function?
|
||||||
@@ -221,7 +315,7 @@ const Highlights = Module("Highlight", {
|
|||||||
completion.colorScheme = function colorScheme(context) {
|
completion.colorScheme = function colorScheme(context) {
|
||||||
context.title = ["Color Scheme", "Runtime Path"];
|
context.title = ["Color Scheme", "Runtime Path"];
|
||||||
context.keys = { text: function (f) f.leafName.replace(/\.vimp$/, ""), description: ".parent.path" };
|
context.keys = { text: function (f) f.leafName.replace(/\.vimp$/, ""), description: ".parent.path" };
|
||||||
context.completions = util.Array.flatten(
|
context.completions = array.flatten(
|
||||||
modules.io.getRuntimeDirectories("colors").map(
|
modules.io.getRuntimeDirectories("colors").map(
|
||||||
function (dir) dir.readDirectory().filter(
|
function (dir) dir.readDirectory().filter(
|
||||||
function (file) /\.vimp$/.test(file.leafName))))
|
function (file) /\.vimp$/.test(file.leafName))))
|
||||||
@@ -232,6 +326,12 @@ const Highlights = Module("Highlight", {
|
|||||||
context.title = ["Highlight Group", "Value"];
|
context.title = ["Highlight Group", "Value"];
|
||||||
context.completions = [[v.class, v.value] for (v in highlight)];
|
context.completions = [[v.class, v.value] for (v in highlight)];
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
javascript: function (dactyl, modules, window) {
|
||||||
|
modules.JavaScript.setCompleter(["get", "set"].map(function (m) highlight[m]),
|
||||||
|
[ function (context, obj, args) Iterator(highlight.highlight) ]);
|
||||||
|
modules.JavaScript.setCompleter(["highlightNode"].map(function (m) highlight[m]),
|
||||||
|
[ null, function (context, obj, args) Iterator(highlight.highlight) ]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, {
|
|||||||
services.get("permissions").remove(util.createURI(p.host), p.type);
|
services.get("permissions").remove(util.createURI(p.host), p.type);
|
||||||
services.get("permissions").add(util.createURI(p.host), p.type, 0);
|
services.get("permissions").add(util.createURI(p.host), p.type, 0);
|
||||||
}
|
}
|
||||||
for (let p in iter(services.get("contentprefs").getPrefs(util.createURI(host)).enumerator))
|
for (let p in iter(services.get("contentprefs").getPrefs(util.createURI(host))))
|
||||||
services.get("contentprefs").removePref(util.createURI(host), p.QueryInterface(Ci.nsIProperty).name);
|
services.get("contentprefs").removePref(util.createURI(host), p.QueryInterface(Ci.nsIProperty).name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -185,12 +185,12 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, {
|
|||||||
prefToArg: function (pref) pref.replace(/.*\./, "").toLowerCase(),
|
prefToArg: function (pref) pref.replace(/.*\./, "").toLowerCase(),
|
||||||
|
|
||||||
iterCookies: function iterCookies(host) {
|
iterCookies: function iterCookies(host) {
|
||||||
for (let c in iter(services.get("cookies").enumerator))
|
for (let c in iter(services.get("cookies")))
|
||||||
if (!host || util.isSubdomain(c.QueryInterface(Ci.nsICookie2).rawHost, host))
|
if (!host || util.isSubdomain(c.QueryInterface(Ci.nsICookie2).rawHost, host))
|
||||||
yield c;
|
yield c;
|
||||||
},
|
},
|
||||||
iterPermissions: function iterPermissions(host) {
|
iterPermissions: function iterPermissions(host) {
|
||||||
for (let p in iter(services.get("permissions").enumerator))
|
for (let p in iter(services.get("permissions")))
|
||||||
if (p.QueryInterface(Ci.nsIPermission) && (!host || util.isSubdomain(p.host, host)))
|
if (p.QueryInterface(Ci.nsIPermission) && (!host || util.isSubdomain(p.host, host)))
|
||||||
yield p;
|
yield p;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2020 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -9,6 +9,9 @@ defmodule("services", this, {
|
|||||||
exports: ["Services", "services"]
|
exports: ["Services", "services"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A lazily-instantiated XPCOM class and service cache.
|
||||||
|
*/
|
||||||
const Services = Module("Services", {
|
const Services = Module("Services", {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.classes = {};
|
this.classes = {};
|
||||||
@@ -33,12 +36,13 @@ const Services = Module("Services", {
|
|||||||
this.add("json", "@mozilla.org/dom/json;1", Ci.nsIJSON, "createInstance");
|
this.add("json", "@mozilla.org/dom/json;1", Ci.nsIJSON, "createInstance");
|
||||||
this.add("livemark", "@mozilla.org/browser/livemark-service;2", Ci.nsILivemarkService);
|
this.add("livemark", "@mozilla.org/browser/livemark-service;2", Ci.nsILivemarkService);
|
||||||
this.add("observer", "@mozilla.org/observer-service;1", Ci.nsIObserverService);
|
this.add("observer", "@mozilla.org/observer-service;1", Ci.nsIObserverService);
|
||||||
this.add("pref", "@mozilla.org/preferences-service;1", [Ci.nsIPrefBranch, Ci.nsIPrefBranch2, Ci.nsIPrefService]);
|
this.add("pref", "@mozilla.org/preferences-service;1", [Ci.nsIPrefBranch2, Ci.nsIPrefService]);
|
||||||
this.add("privateBrowsing", "@mozilla.org/privatebrowsing;1", Ci.nsIPrivateBrowsingService);
|
this.add("privateBrowsing", "@mozilla.org/privatebrowsing;1", Ci.nsIPrivateBrowsingService);
|
||||||
this.add("profile", "@mozilla.org/toolkit/profile-service;1", Ci.nsIToolkitProfileService);
|
this.add("profile", "@mozilla.org/toolkit/profile-service;1", Ci.nsIToolkitProfileService);
|
||||||
this.add("runtime", "@mozilla.org/xre/runtime;1", [Ci.nsIXULAppInfo, Ci.nsIXULRuntime]);
|
this.add("runtime", "@mozilla.org/xre/runtime;1", [Ci.nsIXULAppInfo, Ci.nsIXULRuntime]);
|
||||||
this.add("rdf", "@mozilla.org/rdf/rdf-service;1", Ci.nsIRDFService);
|
this.add("rdf", "@mozilla.org/rdf/rdf-service;1", Ci.nsIRDFService);
|
||||||
this.add("sessionStore", "@mozilla.org/browser/sessionstore;1", Ci.nsISessionStore);
|
this.add("sessionStore", "@mozilla.org/browser/sessionstore;1", Ci.nsISessionStore);
|
||||||
|
this.add("stringBundle", "@mozilla.org/intl/stringbundle;1", Ci.nsIStringBundleService);
|
||||||
this.add("stylesheet", "@mozilla.org/content/style-sheet-service;1", Ci.nsIStyleSheetService);
|
this.add("stylesheet", "@mozilla.org/content/style-sheet-service;1", Ci.nsIStyleSheetService);
|
||||||
this.add("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", Ci.mozIJSSubScriptLoader);
|
this.add("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", Ci.mozIJSSubScriptLoader);
|
||||||
this.add("tagging", "@mozilla.org/browser/tagging-service;1", Ci.nsITaggingService);
|
this.add("tagging", "@mozilla.org/browser/tagging-service;1", Ci.nsITaggingService);
|
||||||
@@ -103,19 +107,19 @@ const Services = Module("Services", {
|
|||||||
return this.classes[name] = function () self._create(class_, ifaces, "createInstance");
|
return this.classes[name] = function () self._create(class_, ifaces, "createInstance");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new instance of the cached class with the specified name.
|
||||||
|
*
|
||||||
|
* @param {string} name The class's cache key.
|
||||||
|
*/
|
||||||
|
create: function (name) this.classes[name](),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the cached service with the specified name.
|
* Returns the cached service with the specified name.
|
||||||
*
|
*
|
||||||
* @param {string} name The service's cache key.
|
* @param {string} name The service's cache key.
|
||||||
*/
|
*/
|
||||||
get: function (name) this.services[name],
|
get: function (name) this.services[name],
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a new instance of the cached class with the specified name.
|
|
||||||
*
|
|
||||||
* @param {string} name The class's cache key.
|
|
||||||
*/
|
|
||||||
create: function (name) this.classes[name]()
|
|
||||||
}, {
|
}, {
|
||||||
}, {
|
}, {
|
||||||
init: function (dactyl, modules) {
|
init: function (dactyl, modules) {
|
||||||
|
|||||||
@@ -1,24 +1,7 @@
|
|||||||
/***** BEGIN LICENSE BLOCK ***** {{{
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
Copyright ©2008-2009 by Kris Maglione <maglione.k at Gmail>
|
//
|
||||||
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
// given in the LICENSE.txt file included with this file.
|
||||||
copy of this software and associated documentation files (the "Software"),
|
|
||||||
to deal in the Software without restriction, including without limitation
|
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
||||||
}}} ***** END LICENSE BLOCK *****/
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const myObject = Object;
|
const myObject = Object;
|
||||||
@@ -98,38 +81,6 @@ const StoreBase = Class("StoreBase", {
|
|||||||
save: function () { savePref(this); },
|
save: function () { savePref(this); },
|
||||||
});
|
});
|
||||||
|
|
||||||
const ObjectStore = Class("ObjectStore", StoreBase, {
|
|
||||||
_constructor: myObject,
|
|
||||||
|
|
||||||
clear: function () {
|
|
||||||
this._object = {};
|
|
||||||
this.fireEvent("clear");
|
|
||||||
},
|
|
||||||
|
|
||||||
get: function get(key, default_) key in this._object ? this._object[key] : this.set(key, default_),
|
|
||||||
|
|
||||||
keys: function keys() Object.keys(this._object),
|
|
||||||
|
|
||||||
remove: function remove(key) {
|
|
||||||
var ret = this._object[key];
|
|
||||||
delete this._object[key];
|
|
||||||
this.fireEvent("remove", key);
|
|
||||||
},
|
|
||||||
|
|
||||||
set: function set(key, val) {
|
|
||||||
var defined = key in this._object;
|
|
||||||
var orig = this._object[key];
|
|
||||||
this._object[key] = val;
|
|
||||||
if (!defined)
|
|
||||||
this.fireEvent("add", key);
|
|
||||||
else if (orig != val)
|
|
||||||
this.fireEvent("change", key);
|
|
||||||
return val;
|
|
||||||
},
|
|
||||||
|
|
||||||
__iterator__: function () Iterator(this._object),
|
|
||||||
});
|
|
||||||
|
|
||||||
const ArrayStore = Class("ArrayStore", StoreBase, {
|
const ArrayStore = Class("ArrayStore", StoreBase, {
|
||||||
_constructor: Array,
|
_constructor: Array,
|
||||||
|
|
||||||
@@ -176,12 +127,51 @@ const ArrayStore = Class("ArrayStore", StoreBase, {
|
|||||||
__iterator__: function () Iterator(this._object),
|
__iterator__: function () Iterator(this._object),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ObjectStore = Class("ObjectStore", StoreBase, {
|
||||||
|
_constructor: myObject,
|
||||||
|
|
||||||
|
clear: function () {
|
||||||
|
this._object = {};
|
||||||
|
this.fireEvent("clear");
|
||||||
|
},
|
||||||
|
|
||||||
|
get: function get(key, default_)
|
||||||
|
key in this._object ? this._object[key] :
|
||||||
|
arguments.length > 1 ? this.set(key, default_) :
|
||||||
|
undefined,
|
||||||
|
|
||||||
|
keys: function keys() Object.keys(this._object),
|
||||||
|
|
||||||
|
remove: function remove(key) {
|
||||||
|
var ret = this._object[key];
|
||||||
|
delete this._object[key];
|
||||||
|
this.fireEvent("remove", key);
|
||||||
|
},
|
||||||
|
|
||||||
|
set: function set(key, val) {
|
||||||
|
var defined = key in this._object;
|
||||||
|
var orig = this._object[key];
|
||||||
|
this._object[key] = val;
|
||||||
|
if (!defined)
|
||||||
|
this.fireEvent("add", key);
|
||||||
|
else if (orig != val)
|
||||||
|
this.fireEvent("change", key);
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
|
__iterator__: function () Iterator(this._object),
|
||||||
|
});
|
||||||
|
|
||||||
var keys = {};
|
var keys = {};
|
||||||
var observers = {};
|
var observers = {};
|
||||||
|
|
||||||
const Storage = Module("Storage", {
|
const Storage = Module("Storage", {
|
||||||
alwaysReload: {},
|
alwaysReload: {},
|
||||||
|
|
||||||
newObject: function newObject(key, constructor, params) {
|
newObject: function newObject(key, constructor, params) {
|
||||||
|
if (params == null || !isobject(params))
|
||||||
|
throw Error("Invalid argument type");
|
||||||
|
|
||||||
if (!(key in keys) || params.reload || this.alwaysReload[key]) {
|
if (!(key in keys) || params.reload || this.alwaysReload[key]) {
|
||||||
if (key in this && !(params.reload || this.alwaysReload[key]))
|
if (key in this && !(params.reload || this.alwaysReload[key]))
|
||||||
throw Error();
|
throw Error();
|
||||||
@@ -198,7 +188,7 @@ const Storage = Module("Storage", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
newArray: function newArray(key, options) {
|
newArray: function newArray(key, options) {
|
||||||
return this.newObject(key, ArrayStore, { type: Array, __proto__: options });
|
return this.newObject(key, ArrayStore, update({ type: Array }, options));
|
||||||
},
|
},
|
||||||
|
|
||||||
addObserver: function addObserver(key, callback, ref) {
|
addObserver: function addObserver(key, callback, ref) {
|
||||||
@@ -295,7 +285,7 @@ const File = Class("File", {
|
|||||||
let file = services.create("file");
|
let file = services.create("file");
|
||||||
|
|
||||||
if (path instanceof Ci.nsIFile)
|
if (path instanceof Ci.nsIFile)
|
||||||
file = path;
|
file = path.QueryInterface(Ci.nsIFile);
|
||||||
else if (/file:\/\//.test(path))
|
else if (/file:\/\//.test(path))
|
||||||
file = services.create("file:").getFileFromURLSpec(path);
|
file = services.create("file:").getFileFromURLSpec(path);
|
||||||
else {
|
else {
|
||||||
@@ -317,9 +307,8 @@ const File = Class("File", {
|
|||||||
iterDirectory: function () {
|
iterDirectory: function () {
|
||||||
if (!this.isDirectory())
|
if (!this.isDirectory())
|
||||||
throw Error("Not a directory");
|
throw Error("Not a directory");
|
||||||
let entries = this.directoryEntries;
|
for (let file in iter(this.directoryEntries))
|
||||||
while (entries.hasMoreElements())
|
yield File(file);
|
||||||
yield File(entries.getNext().QueryInterface(Ci.nsIFile));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -409,6 +398,8 @@ const File = Class("File", {
|
|||||||
|
|
||||||
if (!perms)
|
if (!perms)
|
||||||
perms = parseInt('0644', 8);
|
perms = parseInt('0644', 8);
|
||||||
|
if (!this.exists()) // OCREAT won't creat the directory
|
||||||
|
this.create(this.NORMAL_FILE_TYPE, perms);
|
||||||
|
|
||||||
ofstream.init(this, mode, perms, 0);
|
ofstream.init(this, mode, perms, 0);
|
||||||
let ocstream = getStream(0);
|
let ocstream = getStream(0);
|
||||||
@@ -567,8 +558,8 @@ const File = Class("File", {
|
|||||||
replacePathSep: function (path) path.replace("/", File.PATH_SEP, "g")
|
replacePathSep: function (path) path.replace("/", File.PATH_SEP, "g")
|
||||||
});
|
});
|
||||||
|
|
||||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n");}
|
|
||||||
|
|
||||||
endmodule();
|
endmodule();
|
||||||
|
|
||||||
|
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
|
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
Components.utils.import("resource://dactyl/base.jsm");
|
Components.utils.import("resource://dactyl/base.jsm");
|
||||||
defmodule("styles", this, {
|
defmodule("styles", this, {
|
||||||
exports: ["Style", "Styles", "styles"],
|
exports: ["Style", "Styles", "styles"],
|
||||||
require: ["services", "util"]
|
require: ["services", "util"],
|
||||||
|
use: ["template"]
|
||||||
});
|
});
|
||||||
|
|
||||||
const sss = services.get("stylesheet");
|
const sss = services.get("stylesheet");
|
||||||
@@ -17,6 +18,35 @@ const namespace = "@namespace html " + XHTML.uri.quote() + ";\n" +
|
|||||||
"@namespace dactyl " + NS.uri.quote() + ";\n";
|
"@namespace dactyl " + NS.uri.quote() + ";\n";
|
||||||
|
|
||||||
const Sheet = Struct("name", "id", "sites", "css", "system", "agent");
|
const Sheet = Struct("name", "id", "sites", "css", "system", "agent");
|
||||||
|
Sheet.liveProperty = function (name) {
|
||||||
|
let i = this.prototype.members.indexOf(name);
|
||||||
|
this.prototype.__defineGetter__(name, function () this[i]);
|
||||||
|
this.prototype.__defineSetter__(name, function (val) {
|
||||||
|
this[i] = val;
|
||||||
|
this.enabled = this.enabled;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Sheet.liveProperty("agent");
|
||||||
|
Sheet.liveProperty("css");
|
||||||
|
Sheet.liveProperty("sites");
|
||||||
|
Sheet.prototype.__defineGetter__("uri", function () cssUri(this.fullCSS));
|
||||||
|
Sheet.prototype.__defineGetter__("enabled", function () this._enabled);
|
||||||
|
Sheet.prototype.__defineSetter__("enabled", function (on) {
|
||||||
|
if (on != this._enabled || this.uri != this._uri) {
|
||||||
|
if (on)
|
||||||
|
this.enabled = false;
|
||||||
|
else if (!this._uri)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let meth = on ? "registerSheet" : "unregisterSheet";
|
||||||
|
styles[meth](on ? this.uri : this._uri,
|
||||||
|
on ? this.agent : this._agent);
|
||||||
|
|
||||||
|
this._agent = this.agent;
|
||||||
|
this._enabled = Boolean(on);
|
||||||
|
this._uri = this.uri;
|
||||||
|
}
|
||||||
|
});
|
||||||
Sheet.prototype.__defineGetter__("fullCSS", function wrapCSS() {
|
Sheet.prototype.__defineGetter__("fullCSS", function wrapCSS() {
|
||||||
let filter = this.sites;
|
let filter = this.sites;
|
||||||
let css = this.css;
|
let css = this.css;
|
||||||
@@ -29,23 +59,8 @@ Sheet.prototype.__defineGetter__("fullCSS", function wrapCSS() {
|
|||||||
: "domain")
|
: "domain")
|
||||||
+ '("' + part.replace(/"/g, "%22").replace(/\*$/, "") + '")')
|
+ '("' + part.replace(/"/g, "%22").replace(/\*$/, "") + '")')
|
||||||
.join(", ");
|
.join(", ");
|
||||||
return "/* Dactyl style #" + this.id + " */ " + namespace + " @-moz-document " + selectors + "{\n" + css + "\n}\n";
|
return "/* Dactyl style #" + this.id + (this.agent ? " (agent)" : "") + " */ "
|
||||||
});
|
+ namespace + " @-moz-document " + selectors + "{\n" + css + "\n}\n";
|
||||||
Sheet.prototype.__defineGetter__("css", function () this[3]);
|
|
||||||
Sheet.prototype.__defineSetter__("css", function (val) {
|
|
||||||
this.enabled = false;
|
|
||||||
this[3] = val;
|
|
||||||
this.enabled = true;
|
|
||||||
return val;
|
|
||||||
});
|
|
||||||
Sheet.prototype.__defineGetter__("enabled", function () this._enabled);
|
|
||||||
Sheet.prototype.__defineSetter__("enabled", function (on) {
|
|
||||||
this._enabled = Boolean(on);
|
|
||||||
let meth = on ? "registerSheet" : "unregisterSheet";
|
|
||||||
|
|
||||||
styles[meth](cssUri(this.fullCSS));
|
|
||||||
if (this.agent)
|
|
||||||
styles[meth](cssUri(this.fullCSS), true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,7 +79,7 @@ const Styles = Module("Styles", {
|
|||||||
this.systemNames = {};
|
this.systemNames = {};
|
||||||
},
|
},
|
||||||
|
|
||||||
get sites() array(this.userSheets).map(function (s) s.sites).flatten().uniq().__proto__,
|
get sites() array(this.userSheets).map(function (s) s.sites).flatten().uniq().array,
|
||||||
|
|
||||||
__iterator__: function () Iterator(this.userSheets.concat(this.systemSheets)),
|
__iterator__: function () Iterator(this.userSheets.concat(this.systemSheets)),
|
||||||
|
|
||||||
@@ -81,25 +96,27 @@ const Styles = Module("Styles", {
|
|||||||
* "*" is matched as a prefix.
|
* "*" is matched as a prefix.
|
||||||
* @param {string} css The CSS to be applied.
|
* @param {string} css The CSS to be applied.
|
||||||
*/
|
*/
|
||||||
addSheet: function addSheet(system, name, filter, css, agent) {
|
addSheet: function addSheet(system, name, filter, css, agent, lazy) {
|
||||||
let sheets = system ? this.systemSheets : this.userSheets;
|
let sheets = system ? this.systemSheets : this.userSheets;
|
||||||
let names = system ? this.systemNames : this.userNames;
|
let names = system ? this.systemNames : this.userNames;
|
||||||
if (name && name in names)
|
|
||||||
this.removeSheet(system, name);
|
|
||||||
|
|
||||||
let sheet = Sheet(name, this._id++, filter.split(",").filter(util.identity), String(css), null, system, agent);
|
if (!isarray(filter))
|
||||||
|
filter = filter.split(",");
|
||||||
|
if (name && name in names) {
|
||||||
|
var sheet = names[name];
|
||||||
|
sheet.filter = filter;
|
||||||
|
sheet.css = String(css);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sheet = Sheet(name, this._id++, filter.filter(util.identity), String(css), system, agent);
|
||||||
|
|
||||||
try {
|
if (!lazy)
|
||||||
sheet.enabled = true;
|
sheet.enabled = true;
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
return e.echoerr || e;
|
|
||||||
}
|
|
||||||
sheets.push(sheet);
|
sheets.push(sheet);
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
names[name] = sheet;
|
names[name] = sheet;
|
||||||
return null;
|
return sheet;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,14 +146,13 @@ const Styles = Module("Styles", {
|
|||||||
*/
|
*/
|
||||||
findSheets: function findSheets(system, name, filter, css, index) {
|
findSheets: function findSheets(system, name, filter, css, index) {
|
||||||
let sheets = system ? this.systemSheets : this.userSheets;
|
let sheets = system ? this.systemSheets : this.userSheets;
|
||||||
let names = system ? this.systemNames : this.userNames;
|
|
||||||
|
|
||||||
// Grossly inefficient.
|
// Grossly inefficient.
|
||||||
let matches = [k for ([k, v] in Iterator(sheets))];
|
let matches = [k for ([k, v] in Iterator(sheets))];
|
||||||
if (index)
|
if (index)
|
||||||
matches = String(index).split(",").filter(function (i) i in sheets);
|
matches = String(index).split(",").filter(function (i) i in sheets);
|
||||||
if (name)
|
if (name)
|
||||||
matches = matches.filter(function (i) sheets[i] == names[name]);
|
matches = matches.filter(function (i) sheets[i].name == name);
|
||||||
if (css)
|
if (css)
|
||||||
matches = matches.filter(function (i) sheets[i].css == css);
|
matches = matches.filter(function (i) sheets[i].css == css);
|
||||||
if (filter)
|
if (filter)
|
||||||
@@ -178,19 +194,19 @@ const Styles = Module("Styles", {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
for (let [, sheet] in Iterator(matches.reverse())) {
|
for (let [, sheet] in Iterator(matches.reverse())) {
|
||||||
sheet.enabled = false;
|
|
||||||
if (name)
|
|
||||||
delete names[name];
|
|
||||||
if (sheets.indexOf(sheet) > -1)
|
|
||||||
sheets.splice(sheets.indexOf(sheet), 1);
|
|
||||||
|
|
||||||
/* Re-add if we're only changing the site filter. */
|
|
||||||
if (filter) {
|
if (filter) {
|
||||||
let sites = sheet.sites.filter(function (f) f != filter);
|
let sites = sheet.sites.filter(function (f) f != filter);
|
||||||
if (sites.length)
|
if (sites.length) {
|
||||||
this.addSheet(system, name, sites.join(","), css, sheet.agent);
|
sheet.sites = sites;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sheet.enabled = false;
|
||||||
|
if (sheet.name)
|
||||||
|
delete names[sheet.name];
|
||||||
|
if (sheets.indexOf(sheet) > -1)
|
||||||
|
sheets.splice(sheets.indexOf(sheet), 1);
|
||||||
|
}
|
||||||
return matches.length;
|
return matches.length;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -256,7 +272,7 @@ const Styles = Module("Styles", {
|
|||||||
["min-width: 1em; text-align: center; color: red; font-weight: bold;",
|
["min-width: 1em; text-align: center; color: red; font-weight: bold;",
|
||||||
"padding: 0 1em 0 1ex; vertical-align: top;",
|
"padding: 0 1em 0 1ex; vertical-align: top;",
|
||||||
"padding: 0 1em 0 0; vertical-align: top;"],
|
"padding: 0 1em 0 0; vertical-align: top;"],
|
||||||
([sheet.enabled ? "" : "\u00d7",
|
([sheet.enabled ? "" : UTF8("×"),
|
||||||
key,
|
key,
|
||||||
sheet.sites.join(","),
|
sheet.sites.join(","),
|
||||||
sheet.css]
|
sheet.css]
|
||||||
@@ -271,9 +287,7 @@ const Styles = Module("Styles", {
|
|||||||
css = sheet.css + " " + css;
|
css = sheet.css + " " + css;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let err = styles.addSheet(false, name, filter, css);
|
styles.addSheet(false, name, filter, css);
|
||||||
if (err)
|
|
||||||
dactyl.echoerr(err);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -377,4 +391,6 @@ const Styles = Module("Styles", {
|
|||||||
|
|
||||||
endmodule();
|
endmodule();
|
||||||
|
|
||||||
|
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
||||||
|
|
||||||
// vim:se fdm=marker sw=4 ts=4 et ft=javascript:
|
// vim:se fdm=marker sw=4 ts=4 et ft=javascript:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -40,6 +40,8 @@ const Template = Module("Template", {
|
|||||||
if (typeof xml == "xml")
|
if (typeof xml == "xml")
|
||||||
return xml;
|
return xml;
|
||||||
try {
|
try {
|
||||||
|
XML.ignoreWhitespace = false;
|
||||||
|
XML.prettyPrinting = false;
|
||||||
return new XMLList(xml);
|
return new XMLList(xml);
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
@@ -48,7 +50,7 @@ const Template = Module("Template", {
|
|||||||
|
|
||||||
bookmarkDescription: function (item, text)
|
bookmarkDescription: function (item, text)
|
||||||
<>
|
<>
|
||||||
<a href={item.item.url} highlight="URL">{text}</a> 
|
<a href={item.item.url} highlight="URL">{text || ""}</a> 
|
||||||
{
|
{
|
||||||
!(item.extra && item.extra.length) ? "" :
|
!(item.extra && item.extra.length) ? "" :
|
||||||
<span class="extra-info">
|
<span class="extra-info">
|
||||||
@@ -72,8 +74,8 @@ const Template = Module("Template", {
|
|||||||
var desc = item[1] || "";
|
var desc = item[1] || "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var text = this.process[0].call(this, item, item.text);
|
var text = this.processor[0].call(this, item, item.result);
|
||||||
var desc = this.process[1].call(this, item, item.description);
|
var desc = this.processor[1].call(this, item, item.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <e4x>
|
// <e4x>
|
||||||
@@ -82,8 +84,8 @@ const Template = Module("Template", {
|
|||||||
- from pushing the baseline down and enlarging
|
- from pushing the baseline down and enlarging
|
||||||
- the row.
|
- the row.
|
||||||
-->
|
-->
|
||||||
<li highlight="CompResult">{text} </li>
|
<li highlight="CompResult">{text} </li>
|
||||||
<li highlight="CompDesc">{desc} </li>
|
<li highlight="CompDesc">{desc} </li>
|
||||||
</div>;
|
</div>;
|
||||||
// </e4x>
|
// </e4x>
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -10,7 +10,7 @@ Components.utils.import("resource://dactyl/base.jsm");
|
|||||||
defmodule("util", this, {
|
defmodule("util", this, {
|
||||||
exports: ["Math", "NS", "Util", "XHTML", "XUL", "util"],
|
exports: ["Math", "NS", "Util", "XHTML", "XUL", "util"],
|
||||||
require: ["services"],
|
require: ["services"],
|
||||||
use: ["template"]
|
use: ["highlight", "template"]
|
||||||
});
|
});
|
||||||
|
|
||||||
const XHTML = Namespace("html", "http://www.w3.org/1999/xhtml");
|
const XHTML = Namespace("html", "http://www.w3.org/1999/xhtml");
|
||||||
@@ -295,12 +295,12 @@ const Util = Module("Util", {
|
|||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return Object.create(result, {
|
||||||
__proto__: result,
|
__iterator__: {
|
||||||
__iterator__: asIterator
|
value: asIterator ? function () { let elem; while ((elem = this.iterateNext())) yield elem; }
|
||||||
? function () { let elem; while ((elem = this.iterateNext())) yield elem; }
|
|
||||||
: function () { for (let i = 0; i < this.snapshotLength; i++) yield this.snapshotItem(i); }
|
: function () { for (let i = 0; i < this.snapshotLength; i++) yield this.snapshotItem(i); }
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
extend: function extend(dest) {
|
extend: function extend(dest) {
|
||||||
@@ -388,12 +388,11 @@ const Util = Module("Util", {
|
|||||||
try {
|
try {
|
||||||
let xmlhttp = services.create("xmlhttp");
|
let xmlhttp = services.create("xmlhttp");
|
||||||
xmlhttp.mozBackgroundRequest = true;
|
xmlhttp.mozBackgroundRequest = true;
|
||||||
if (callback) {
|
if (callback)
|
||||||
xmlhttp.onreadystatechange = function () {
|
xmlhttp.onreadystatechange = function () {
|
||||||
if (xmlhttp.readyState == 4)
|
if (xmlhttp.readyState == 4)
|
||||||
callback(xmlhttp);
|
callback(xmlhttp);
|
||||||
};
|
};
|
||||||
}
|
|
||||||
xmlhttp.open("GET", url, !!callback);
|
xmlhttp.open("GET", url, !!callback);
|
||||||
xmlhttp.send(null);
|
xmlhttp.send(null);
|
||||||
return xmlhttp;
|
return xmlhttp;
|
||||||
@@ -460,7 +459,7 @@ const Util = Module("Util", {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
makeXPath: function makeXPath(nodes) {
|
makeXPath: function makeXPath(nodes) {
|
||||||
return util.Array(nodes).map(util.debrace).flatten()
|
return array(nodes).map(util.debrace).flatten()
|
||||||
.map(function (node) [node, "xhtml:" + node]).flatten()
|
.map(function (node) [node, "xhtml:" + node]).flatten()
|
||||||
.map(function (node) "//" + node).join(" | ");
|
.map(function (node) "//" + node).join(" | ");
|
||||||
},
|
},
|
||||||
@@ -480,18 +479,6 @@ const Util = Module("Util", {
|
|||||||
return ary;
|
return ary;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Memoize the lookup of a property in an object.
|
|
||||||
*
|
|
||||||
* @param {object} obj The object to alter.
|
|
||||||
* @param {string} key The name of the property to memoize.
|
|
||||||
* @param {function} getter A function of zero to two arguments which
|
|
||||||
* will return the property's value. <b>obj</b> is
|
|
||||||
* passed as the first argument, <b>key</b> as the
|
|
||||||
* second.
|
|
||||||
*/
|
|
||||||
memoize: memoize,
|
|
||||||
|
|
||||||
newThread: function () services.get("threadManager").newThread(0),
|
newThread: function () services.get("threadManager").newThread(0),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -524,34 +511,47 @@ const Util = Module("Util", {
|
|||||||
if (object === null)
|
if (object === null)
|
||||||
return "null\n";
|
return "null\n";
|
||||||
|
|
||||||
if (typeof object != "object")
|
if (typeof object !== "object")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const NAMESPACES = util.Array.toObject([
|
|
||||||
[NS, 'dactyl'],
|
|
||||||
[XHTML, 'html'],
|
|
||||||
[XUL, 'xul']
|
|
||||||
]);
|
|
||||||
if (object instanceof Ci.nsIDOMElement) {
|
if (object instanceof Ci.nsIDOMElement) {
|
||||||
|
const NAMESPACES = array.toObject([
|
||||||
|
[NS, "dactyl"],
|
||||||
|
[XHTML, "html"],
|
||||||
|
[XUL, "xul"]
|
||||||
|
]);
|
||||||
let elem = object;
|
let elem = object;
|
||||||
if (elem.nodeType == elem.TEXT_NODE)
|
if (elem.nodeType == elem.TEXT_NODE)
|
||||||
return elem.data;
|
return elem.data;
|
||||||
|
|
||||||
function namespaced(node) {
|
function namespaced(node) {
|
||||||
var ns = NAMESPACES[node.namespaceURI];
|
var ns = NAMESPACES[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[0];
|
||||||
if (ns)
|
if (!ns)
|
||||||
|
return node.localName;
|
||||||
|
if (color)
|
||||||
|
return <><span highlight="HelpXMLNamespace">{ns}</span>{node.localName}</>
|
||||||
return ns + ":" + node.localName;
|
return ns + ":" + node.localName;
|
||||||
return node.localName.toLowerCase();
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
let hasChildren = elem.firstChild && (!/^\s*$/.test(elem.firstChild) || elem.firstChild.nextSibling)
|
||||||
|
if (color)
|
||||||
|
return <span highlight="HelpXMLBlock"><span highlight="HelpXMLTagStart"><{
|
||||||
|
namespaced(elem)} {
|
||||||
|
template.map(array.itervalues(elem.attributes),
|
||||||
|
function (attr)
|
||||||
|
<span highlight="HelpXMLAttribute">{namespaced(attr)}</span> +
|
||||||
|
<span highlight="HelpXMLString">{attr.value}</span>,
|
||||||
|
<> </>)
|
||||||
|
}{ hasChildren ? "/>" : ">"
|
||||||
|
}</span>{ !hasChildren ? "" :
|
||||||
|
<>...</> +
|
||||||
|
<span highlight="HtmlTagEnd"><{namespaced(elem)}></span>
|
||||||
|
}</span>;
|
||||||
|
|
||||||
let tag = "<" + [namespaced(elem)].concat(
|
let tag = "<" + [namespaced(elem)].concat(
|
||||||
[namespaced(a) + "=" + template.highlight(a.value, true)
|
[namespaced(a) + "=" + template.highlight(a.value, true)
|
||||||
for ([i, a] in util.Array.iteritems(elem.attributes))]).join(" ");
|
for ([i, a] in array.iteritems(elem.attributes))]).join(" ");
|
||||||
|
return tag + (hasChildren ? "/>" : ">...</" + namespaced(elem) + ">");
|
||||||
if (!elem.firstChild || /^\s*$/.test(elem.firstChild) && !elem.firstChild.nextSibling)
|
|
||||||
tag += '/>';
|
|
||||||
else
|
|
||||||
tag += '>...</' + namespaced(elem) + '>';
|
|
||||||
return tag;
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return {}.toString.call(elem);
|
return {}.toString.call(elem);
|
||||||
@@ -562,13 +562,15 @@ const Util = Module("Util", {
|
|||||||
var obj = String(object);
|
var obj = String(object);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
obj = "[Object]";
|
obj = Object.prototype.toString.call(obj);
|
||||||
}
|
}
|
||||||
obj = template.highlightFilter(util.clip(obj, 150), "\n", !color ? function () "^J" : function () <span highlight="NonText">^J</span>);
|
obj = template.highlightFilter(util.clip(obj, 150), "\n", !color ? function () "^J" : function () <span highlight="NonText">^J</span>);
|
||||||
let string = <><span highlight="Title Object">{obj}</span>::<br/>
</>;
|
let string = <><span highlight="Title Object">{obj}</span>::<br/>
</>;
|
||||||
|
|
||||||
let keys = [];
|
let keys = [];
|
||||||
try { // window.content often does not want to be queried with "var i in object"
|
|
||||||
|
// window.content often does not want to be queried with "var i in object"
|
||||||
|
try {
|
||||||
let hasValue = !("__iterator__" in object || isinstance(object, ["Generator", "Iterator"]));
|
let hasValue = !("__iterator__" in object || isinstance(object, ["Generator", "Iterator"]));
|
||||||
if (object.dactyl && object.modules && object.modules.modules == object.modules) {
|
if (object.dactyl && object.modules && object.modules.modules == object.modules) {
|
||||||
object = Iterator(object);
|
object = Iterator(object);
|
||||||
@@ -593,7 +595,7 @@ const Util = Module("Util", {
|
|||||||
i = parseInt(i);
|
i = parseInt(i);
|
||||||
else if (/^[A-Z_]+$/.test(i))
|
else if (/^[A-Z_]+$/.test(i))
|
||||||
i = "";
|
i = "";
|
||||||
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}<br/>
</>]);
|
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}<br/>
</>]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
@@ -672,7 +674,6 @@ const Util = Module("Util", {
|
|||||||
selectionController: function (win)
|
selectionController: function (win)
|
||||||
win.QueryInterface(Ci.nsIInterfaceRequestor)
|
win.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
.getInterface(Ci.nsIWebNavigation)
|
.getInterface(Ci.nsIWebNavigation)
|
||||||
.QueryInterface(Ci.nsIDocShell)
|
|
||||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
.getInterface(Ci.nsISelectionDisplay)
|
.getInterface(Ci.nsISelectionDisplay)
|
||||||
.QueryInterface(Ci.nsISelectionController),
|
.QueryInterface(Ci.nsISelectionController),
|
||||||
@@ -714,6 +715,7 @@ const Util = Module("Util", {
|
|||||||
* string.
|
* string.
|
||||||
*
|
*
|
||||||
* util.split("a, b, c, d, e", /, /, 3) -> ["a", "b", "c, d, e"]
|
* util.split("a, b, c, d, e", /, /, 3) -> ["a", "b", "c, d, e"]
|
||||||
|
*
|
||||||
* @param {string} str The string to split.
|
* @param {string} str The string to split.
|
||||||
* @param {RegExp|string} re The regular expression on which to split the string.
|
* @param {RegExp|string} re The regular expression on which to split the string.
|
||||||
* @param {number} limit The maximum number of elements to return.
|
* @param {number} limit The maximum number of elements to return.
|
||||||
@@ -775,7 +777,9 @@ const Util = Module("Util", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an E4X XML literal to a DOM node.
|
* Converts an E4X XML literal to a DOM node. Any attribute named
|
||||||
|
* highlight is present, it is transformed into dactyl:highlight,
|
||||||
|
* and the named highlight groups are guaranteed to be loaded.
|
||||||
*
|
*
|
||||||
* @param {Node} node
|
* @param {Node} node
|
||||||
* @param {Document} doc
|
* @param {Document} doc
|
||||||
@@ -797,7 +801,14 @@ const Util = Module("Util", {
|
|||||||
case "element":
|
case "element":
|
||||||
let domnode = doc.createElementNS(node.namespace(), node.localName());
|
let domnode = doc.createElementNS(node.namespace(), node.localName());
|
||||||
for each (let attr in node.@*)
|
for each (let attr in node.@*)
|
||||||
domnode.setAttributeNS(attr.name() == "highlight" ? NS.uri : attr.namespace(), attr.name(), String(attr));
|
if (attr.name() != "highlight")
|
||||||
|
domnode.setAttributeNS(attr.namespace(), attr.name(), String(attr));
|
||||||
|
else {
|
||||||
|
domnode.setAttributeNS(NS.uri, "highlight", String(attr));
|
||||||
|
for each (let h in String.split(attr, " "))
|
||||||
|
highlight.loaded[h] = true;
|
||||||
|
}
|
||||||
|
|
||||||
for each (let child in node.*)
|
for each (let child in node.*)
|
||||||
domnode.appendChild(xmlToDom(child, doc, nodes));
|
domnode.appendChild(xmlToDom(child, doc, nodes));
|
||||||
if (nodes && node.@key)
|
if (nodes && node.@key)
|
||||||
@@ -816,9 +827,7 @@ const Util = Module("Util", {
|
|||||||
* @singleton
|
* @singleton
|
||||||
*/
|
*/
|
||||||
const GlobalMath = Math;
|
const GlobalMath = Math;
|
||||||
var Math = {
|
var Math = update(Object.create(GlobalMath), {
|
||||||
__proto__: GlobalMath,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the specified <b>value</b> constrained to the range <b>min</b> -
|
* Returns the specified <b>value</b> constrained to the range <b>min</b> -
|
||||||
* <b>max</b>.
|
* <b>max</b>.
|
||||||
@@ -829,9 +838,9 @@ var Math = {
|
|||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
constrain: function constrain(value, min, max) Math.min(Math.max(min, value), max)
|
constrain: function constrain(value, min, max) Math.min(Math.max(min, value), max)
|
||||||
};
|
});
|
||||||
|
|
||||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n");}
|
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
||||||
|
|
||||||
endmodule();
|
endmodule();
|
||||||
|
|
||||||
|
|||||||
@@ -156,8 +156,6 @@ statusbarpanel {
|
|||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dactyl-completions-content *,
|
|
||||||
#dactyl-multiline-output-content *,
|
|
||||||
#dactyl-commandline-prompt *,
|
#dactyl-commandline-prompt *,
|
||||||
#dactyl-commandline-command {
|
#dactyl-commandline-command {
|
||||||
font: inherit;
|
font: inherit;
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# Thunderbird
|
|
||||||
content muttator content/
|
|
||||||
skin muttator classic/1.0 skin/
|
|
||||||
locale dactyl en-US locale/en-US/
|
|
||||||
|
|
||||||
content dactyl ../common/content/
|
|
||||||
resource dactyl ../common/modules/
|
|
||||||
skin dactyl classic/1.0 ../common/skin/
|
|
||||||
|
|
||||||
override chrome://dactyl/content/dactyl.dtd chrome://muttator/content/dactyl.dtd
|
|
||||||
override chrome://dactyl/content/config.js chrome://muttator/content/config.js
|
|
||||||
|
|
||||||
overlay chrome://messenger/content/messenger.xul chrome://dactyl/content/dactyl.xul
|
|
||||||
overlay chrome://messenger/content/messenger.xul chrome://muttator/content/muttator.xul
|
|
||||||
|
|
||||||
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://muttator/content/compose/dactyl.xul
|
|
||||||
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://muttator/content/compose/compose.xul
|
|
||||||
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
// Header:
|
|
||||||
const Name = "Muttator";
|
|
||||||
/*
|
|
||||||
* We can't load our modules here, so the following code is sadly
|
|
||||||
* duplicated: .w !sh
|
|
||||||
vimdiff ../../*'/components/about-handler.js'
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Copyright (c) 2009 by Doug Kearns
|
|
||||||
//
|
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
|
||||||
// given in the LICENSE.txt file included with this file.
|
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
|
|
||||||
const Cc = Components.classes;
|
|
||||||
const Ci = Components.interfaces;
|
|
||||||
|
|
||||||
const name = Name.toLowerCase();
|
|
||||||
function AboutHandler() {}
|
|
||||||
AboutHandler.prototype = {
|
|
||||||
|
|
||||||
classDescription: "About " + Name + " Page",
|
|
||||||
|
|
||||||
classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),
|
|
||||||
|
|
||||||
contractID: "@mozilla.org/network/protocol/about;1?what=" + name,
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
|
||||||
|
|
||||||
newChannel: function (uri) {
|
|
||||||
let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
|
|
||||||
.newChannel("chrome://" + name + "/content/about.html", null, null);
|
|
||||||
channel.originalURI = uri;
|
|
||||||
return channel;
|
|
||||||
},
|
|
||||||
|
|
||||||
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
||||||
};
|
|
||||||
|
|
||||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler])
|
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
// Header:
|
|
||||||
const Name = "Muttator";
|
|
||||||
/*
|
|
||||||
* We can't load our modules here, so the following code is sadly
|
|
||||||
* duplicated: .w !sh
|
|
||||||
vimdiff ../../*'/components/commandline-handler.js'
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Copyright (c) 2009 by Doug Kearns
|
|
||||||
//
|
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
|
||||||
// given in the LICENSE.txt file included with this file.
|
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
|
|
||||||
const name = Name.toLowerCase();
|
|
||||||
function CommandLineHandler() {
|
|
||||||
this.wrappedJSObject = this;
|
|
||||||
}
|
|
||||||
CommandLineHandler.prototype = {
|
|
||||||
|
|
||||||
classDescription: Name + " Command-line Handler",
|
|
||||||
|
|
||||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
|
||||||
|
|
||||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
|
||||||
|
|
||||||
_xpcom_categories: [{
|
|
||||||
category: "command-line-handler",
|
|
||||||
entry: "m-" + name
|
|
||||||
}],
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
|
||||||
|
|
||||||
handle: function (commandLine) {
|
|
||||||
// TODO: handle remote launches differently?
|
|
||||||
try {
|
|
||||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
dump(name + ": option '-" + name + "' requires an argument\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler])
|
|
||||||
|
|
||||||
// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
|
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,88 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="135"
|
|
||||||
height="40"
|
|
||||||
id="svg2"
|
|
||||||
sodipodi:version="0.32"
|
|
||||||
inkscape:version="0.46"
|
|
||||||
version="1.0"
|
|
||||||
sodipodi:docbase="/home/maxauthority/code/pentadactyl"
|
|
||||||
sodipodi:docname="muttator.svg"
|
|
||||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
|
||||||
inkscape:export-filename="/home/maxauthority/code/pentadactyl/pentadactyl.png"
|
|
||||||
inkscape:export-xdpi="90"
|
|
||||||
inkscape:export-ydpi="90">
|
|
||||||
<defs
|
|
||||||
id="defs4">
|
|
||||||
<inkscape:perspective
|
|
||||||
sodipodi:type="inkscape:persp3d"
|
|
||||||
inkscape:vp_x="0 : 29 : 1"
|
|
||||||
inkscape:vp_y="0 : 1000 : 0"
|
|
||||||
inkscape:vp_z="185 : 29 : 1"
|
|
||||||
inkscape:persp3d-origin="92.5 : 19.333333 : 1"
|
|
||||||
id="perspective2403" />
|
|
||||||
</defs>
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
gridtolerance="10000"
|
|
||||||
guidetolerance="10"
|
|
||||||
objecttolerance="10"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="4"
|
|
||||||
inkscape:cx="65.848611"
|
|
||||||
inkscape:cy="6.75"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
width="185px"
|
|
||||||
height="58px"
|
|
||||||
showgrid="false" />
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(3,-3.3621826)">
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-size:24px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:DejaVu Sans Mono"
|
|
||||||
x="-2"
|
|
||||||
y="22.112183"
|
|
||||||
id="text2229"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2231"
|
|
||||||
x="-2"
|
|
||||||
y="22.112183">muttator_</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-size:24px;font-style:normal;font-weight:normal;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:DejaVu Sans Mono"
|
|
||||||
x="-1.859375"
|
|
||||||
y="45.399292"
|
|
||||||
id="text2233"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2235"
|
|
||||||
x="-1.859375"
|
|
||||||
y="45.399292">~</tspan></text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,387 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>
|
|
||||||
|
|
||||||
<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
|
||||||
|
|
||||||
<document
|
|
||||||
name="intro"
|
|
||||||
title="&dactyl.appname; Introduction"
|
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
|
||||||
|
|
||||||
<logo/>
|
|
||||||
|
|
||||||
<h1 tag="intro">Introduction</h1>
|
|
||||||
|
|
||||||
<link topic="http://vimperator.org">&dactyl.appname;</link> is a free browser add-on for &dactyl.host;,
|
|
||||||
which makes it look and behave like the
|
|
||||||
<link topic="http://www.vim.org">Vim</link>
|
|
||||||
text editor. It has similar key bindings, and you could call it a modal
|
|
||||||
web browser, as key bindings differ according to which mode you are in.
|
|
||||||
|
|
||||||
<warning tag="warning">
|
|
||||||
To provide the most authentic Vim experience, the &dactyl.host; menubar and toolbar are hidden.
|
|
||||||
</warning>
|
|
||||||
|
|
||||||
<p>If you really need them, type: <ex>:set guioptions+=mT</ex> to get them back.</p>
|
|
||||||
<p>
|
|
||||||
If you don't like &dactyl.appname; at all, you can uninstall it by typing
|
|
||||||
<ex>:extdelete &dactyl.appname;</ex> or <ex>:extdisable &dactyl.appname;</ex> to disable it.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If you like it but can't remember the shortcuts, then press
|
|
||||||
<key name="F1"/> or <ex>:help</ex> to get this help window back.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<tags>author donaton sponsor</tags>
|
|
||||||
<p>
|
|
||||||
&dactyl.appname; was initially written by
|
|
||||||
<link topic="mailto:stubenschrott@vimperator.org">Martin
|
|
||||||
Stubenschrott</link> but has found many other
|
|
||||||
<link topic="http://vimperator.org/trac/wiki/&dactyl.appname;/Authors">contributors</link>
|
|
||||||
in the meanwhile. If you appreciate the work on &dactyl.appname; and want to
|
|
||||||
encourage us working on it more, you can send us greetings, patches, or
|
|
||||||
donations (thanks a lot to
|
|
||||||
<link topic="http://vimperator.org/trac/wiki/&dactyl.appname;/Donors">these
|
|
||||||
people</link>
|
|
||||||
who already did):
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<html:form style="text-align: center;" action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
|
||||||
<input type="hidden" name="cmd" value="_s-xclick"/>
|
|
||||||
<input type="image" src="chrome://dactyl/content/x-click-but21.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
|
|
||||||
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBDDJfc+lXLBSAM9XSWv/ebzG/L7PTqYiIXaWVg8pfinDsfYaAcifcgCTuApg4v/VaZIQ/hLODzQu2EvmjGXP0twErA/Q8G5gx0l197PJSyVXb1sLwd1mgOdLF4t0HmDCdEI9z3H6CMhsb3xVwlfpzllSfCIqzlSpx4QtdzEZGzLDELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI8ZOwn5QkHgaAgZjjtPQxB7Vw2rS7Voap9y+xdVLoczUQ97hw+bOdZLcGykBtfoVjdn76MS51QKjGp1fEmxkqTuQ+Fxv8+OVtHu0QF/qlrhmC3fJBRJ0IFWxKdXS+Wod4615BDaG2X1hzvCL443ffka8XlLSiFTuW43BumQs/O+6Jqsk2hcReP3FIQOvtWMSgGTALnZx7x5c60u/3NSKW5qvyWKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA3MDMyMTIyMzI1OFowIwYJKoZIhvcNAQkEMRYEFCirrvlwYVHQiNEEbM6ikfx9+Dm5MA0GCSqGSIb3DQEBAQUABIGAtbsR8GdCdURLziozXLSdtY+zJZUPPeQFXXy2V1S/3ldiN+pRvd4HI7xz8mOY1UaKJZpwZnOosy9MflL1/hbiEtEyQ2Dm/s4jnTcJng/NjLIZu+0NYxXRJhB+zMJubnMMMjzNrGlqI4F2HAB/bCA1eOJ5B83Of3dA4rk/T/8GoSQ=-----END PKCS7-----"/>
|
|
||||||
</html:form>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
If you prefer getting some nice products for your money, you can also support
|
|
||||||
us by buying some cool
|
|
||||||
<link topic="http://www.zazzle.com/maxauthority*">merchandise</link> like
|
|
||||||
t-shirts or mugs. Of course, as we believe in free, open source software, only
|
|
||||||
support us financially if you really like &dactyl.appname; and the money doesn't hurt
|
|
||||||
— otherwise just use it, recommend it, and like it :)
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 tag="overview">Help topics</h2>
|
|
||||||
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<link topic="tutorial">Quick-start tutorial</link>:
|
|
||||||
A quick-start tutorial for new users.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="starting">Starting &dactyl.appname;</link>:
|
|
||||||
How &dactyl.appname; starts up, where it reads the config file…
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="browsing">Browsing</link>:
|
|
||||||
Basic mappings and commands needed for a browsing session (how to open
|
|
||||||
a web page or go back in history).
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="buffer">Buffer</link>:
|
|
||||||
Operations on the current document like scrolling or copying text.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="cmdline">Command-line mode</link>:
|
|
||||||
Command-line editing.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="insert">Insert mode</link>:
|
|
||||||
Insert-mode editing.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="options">Options</link>:
|
|
||||||
A description of all options.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="pattern">Text search commands</link>:
|
|
||||||
Searching for text in the current buffer.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="tabs">Tabs</link>:
|
|
||||||
Managing your tabbed browsing session.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="hints">Hints</link>:
|
|
||||||
Selecting hyperlinks and other page elements.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="">Key mappings, abbreviations, and user-defined commands</link>:
|
|
||||||
Defining new key mappings, abbreviations and user commands.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="eval">Expression evaluation</link>:
|
|
||||||
Executing JavaScript.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="marks">Marks</link>:
|
|
||||||
Using bookmarks, QuickMarks, history and local marks.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="repeat">Repeating commands</link>:
|
|
||||||
Using macros to repeat recurring workflows.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="autocommands">Automatic commands</link>:
|
|
||||||
Automatically executing code on certain events.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="print">Printing</link>:
|
|
||||||
Printing pages.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="gui">&dactyl.appname;'s GUI</link>:
|
|
||||||
Accessing &dactyl.host; menus, dialogs and the sidebar.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="styling">Styling the GUI and web pages</link>:
|
|
||||||
Changing the styling of content pages and &dactyl.appname; itself.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="message">Error and informational messages</link>:
|
|
||||||
A description of messages and error messages.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="developer">Developer information</link>:
|
|
||||||
How to write docs or plugins.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="various">Various commands</link>:
|
|
||||||
Other help which didn't fit into any other category.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="index">Index</link>:
|
|
||||||
An index of all commands and options.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
You can also jump directly to the help of a specific command with <ex>:help o</ex>
|
|
||||||
or <ex>:help :set</ex>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 tag="features">Features</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Vim-like keybindings (<k>h</k>, <k>j</k>, <k>k</k>, <k>l</k>, <k>gg</k>, <k>G</k>, <k>0</k>, <k>$</k>, <k>ZZ</k>, <k name="C-f"/>, etc.)</li>
|
|
||||||
<li>Ex commands (<ex>:quit</ex>, <ex>:open www.foo.com</ex>, …)</li>
|
|
||||||
<li>Tab completion available for all commands with support for "longest" matching when set in 'wildmode'</li>
|
|
||||||
<li>Hit-a-hint like navigation of links (start with <k>f</k> to follow a link)</li>
|
|
||||||
<li>Advanced completion of bookmark and history URLs (searching also in title, not only URL)</li>
|
|
||||||
<li>Vim-like statusline with a Wget-like progress bar</li>
|
|
||||||
<li>Minimal GUI (easily hide useless menubar and toolbar with <ex>:set guioptions=</ex>)</li>
|
|
||||||
<li>Ability to <ex>:source</ex> JavaScript files, and to use a <em>~/.pentadactylrc</em> file with syntax highlighting if you install pentadactyl.vim</li>
|
|
||||||
<li>Easy quick searches (<ex>:open foo</ex> will search for "foo" in google, <ex>:open ebay terminator</ex> will search for "terminator" on ebay) with support for &dactyl.host; keyword bookmarks and search engines</li>
|
|
||||||
<li>Count supported for many commands (<em>3</em><k name="C-o"/> will go back 3 pages)</li>
|
|
||||||
<li>Beep on errors</li>
|
|
||||||
<li>Marks support (<k>m</k><em>a</em> to set mark a on a web page, <k>'</k><em>a</em> to go there)</li>
|
|
||||||
<li>QuickMarks support (quickly go to previously marked web pages with <k>go</k><a>a-zA-Z0-9</a>)</li>
|
|
||||||
<li><ex>:map</ex> and <ex>:command</ex> support (and feedkeys() for script writers)</li>
|
|
||||||
<li><ex>:time</ex> support for profiling</li>
|
|
||||||
<li>Move the text cursor and select text with Vim keys and a Visual mode</li>
|
|
||||||
<li>External editor support</li>
|
|
||||||
<li>Macros to replay key strokes</li>
|
|
||||||
<li>AutoCommands to execute actions on certain events</li>
|
|
||||||
<li>A comprehensive help system, explaining all commands, mappings and options</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2 tag="contact">Contact</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Please send comments/bug reports/patches to the mailing list, where we will
|
|
||||||
properly answer any questions. You can also join the
|
|
||||||
<link topic="irc://irc.freenode.net/pentadactyl">#pentadactyl</link> IRC channel
|
|
||||||
on <link target="http://www.freenode.net/">Freenode</link> or check the
|
|
||||||
<link topic="http://vimperator.org/trac/wiki/&dactyl.appname;/Wiki">Wiki</link> for
|
|
||||||
<link topic="http://vimperator.org/trac/wiki/&dactyl.appname;/FAQ">
|
|
||||||
frequently asked questions (FAQ)
|
|
||||||
</link>. 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.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<logo/>
|
|
||||||
|
|
||||||
<html:p style="text-align: center; font-weight: bold;">
|
|
||||||
All mail clients suck. Mutt just sucks less. This one just sucks less than
|
|
||||||
mutt.
|
|
||||||
</html:p>
|
|
||||||
|
|
||||||
<h2 tag="intro">Introduction</h2>
|
|
||||||
|
|
||||||
http://vimperator.org/muttator[&dactyl.appname;] is a free browser add-on for
|
|
||||||
&dactyl.hostapp;, which makes it look and behave like the http://www.vim.org[Vim]
|
|
||||||
text editor. It has similar key bindings, and you could call it a modal mail
|
|
||||||
client, as key bindings differ according to which mode you are in.
|
|
||||||
|
|
||||||
|warning| +
|
|
||||||
Warning:
|
|
||||||
To provide the most authentic Vim experience, the &dactyl.hostapp; menubar and toolbar were hidden. +
|
|
||||||
If you really need them, type: <ex>:set guioptions+=mT</ex> to get them back. +
|
|
||||||
If you don't like &dactyl.appname; at all, you can uninstall it by typing
|
|
||||||
<ex>:addons</ex> and remove/disable it. +
|
|
||||||
If you like it, but can't remember the shortcuts, press <k>F1</k> or
|
|
||||||
<ex>:help</ex> to get this help window back.
|
|
||||||
|
|
||||||
|author| |donation| +
|
|
||||||
&dactyl.appname; was written by mailto:stubenschrott@vimperator.org[Martin Stubenschrott].
|
|
||||||
If you appreciate my work on &dactyl.appname; and want to encourage me working on it
|
|
||||||
more, you can either send me greetings, patches or make a donation:
|
|
||||||
|
|
||||||
NOTE: If this link does not work, go to http://vimperator.org/muttator and
|
|
||||||
click the donation button there, because &dactyl.hostapp; seems to have a problem
|
|
||||||
when this link is inside an e-mail (which this help screen actually is).
|
|
||||||
|
|
||||||
<pan><handle/></pan>
|
|
||||||
|
|
||||||
Of course as a believer in free open source software, only make a donation
|
|
||||||
if you really like &dactyl.appname; and the money doesn't hurt -- otherwise just use
|
|
||||||
it, recommend it and like it :)
|
|
||||||
|
|
||||||
<h2 tag="overview">Help topics</h2>
|
|
||||||
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<link topic="starting">Starting &dactyl.appname;</link>:
|
|
||||||
How &dactyl.appname; starts up, where it reads the config file…
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="browsing">Browsing</link>:
|
|
||||||
Basic mappings and commands needed for a browsing session (how to open
|
|
||||||
a web page or go back in history).
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="buffer">Buffer</link>:
|
|
||||||
Operations on the current document like scrolling or copying text.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="cmdline">Command-line mode</link>:
|
|
||||||
Command-line editing.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="insert">Insert mode</link>:
|
|
||||||
Insert-mode editing.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="options">Options</link>:
|
|
||||||
A description of all options.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="pattern">Text search commands</link>:
|
|
||||||
Searching for text in the current buffer.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="tabs">Tabs</link>:
|
|
||||||
Managing your tabbed browsing session.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="hints">Hints</link>:
|
|
||||||
Selecting hyperlinks and other page elements.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="">Key mappings, abbreviations, and user-defined commands</link>:
|
|
||||||
Defining new key mappings, abbreviations and user commands.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="eval">Expression evaluation</link>:
|
|
||||||
Executing JavaScript.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="marks">Marks</link>:
|
|
||||||
Using bookmarks, QuickMarks, history and local marks.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="repeat">Repeating commands</link>:
|
|
||||||
Using macros to repeat recurring workflows.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="autocommands">Automatic commands</link>:
|
|
||||||
Automatically executing code on certain events.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="print">Printing</link>:
|
|
||||||
Printing pages.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="gui">&dactyl.appname;'s GUI</link>:
|
|
||||||
Accessing &dactyl.host; menus, dialogs and the sidebar.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="styling">Styling the GUI and web pages</link>:
|
|
||||||
Changing the styling of content pages and &dactyl.appname; itself.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="message">Error and informational messages</link>:
|
|
||||||
A description of messages and error messages.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="developer">Developer information</link>:
|
|
||||||
How to write docs or plugins.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="various">Various commands</link>:
|
|
||||||
Other help which didn't fit into any other category.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<link topic="index">Index</link>:
|
|
||||||
An index of all commands and options.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<!-- TO BE WRITTEN... -->
|
|
||||||
|
|
||||||
For now use <ex>:viusage!</ex>, <ex>:exusage!</ex> and <ex>:optionusage!</ex> to find
|
|
||||||
out about available mappings, commands and options. When in Message mode
|
|
||||||
(activated by <k>i</k>), most mappings from &dactyl.appname; are available.
|
|
||||||
|
|
||||||
|
|
||||||
You can also jump directly to the help of a specific command with
|
|
||||||
<ex>:help o</ex> or <ex>:help :set</ex>.
|
|
||||||
|
|
||||||
<h2 tag="features">Features</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Vim-like keybindings (<k>h</k>, <k>j</k>, <k>k</k>, <k>l</k>,
|
|
||||||
<k>gg</k>, <k>G</k>, <k>0</k>, <k>$</k>, <k>ZZ</k>, <k name="C-f"/>, etc.)
|
|
||||||
</li>
|
|
||||||
<li>Ex-commands (<ex>:quit</ex>, <ex>:goto Inbox</ex>, ...)</li>
|
|
||||||
<li>
|
|
||||||
Tab completion available for all commands with support for "longest"
|
|
||||||
matching when set in 'wildmode'
|
|
||||||
</li>
|
|
||||||
<li>Hit-a-hint like navigation of links (start with <k>f</k> to follow a link)</li>
|
|
||||||
<li>
|
|
||||||
Minimal GUI (easily hide useless menubar and toolbar with <ex>:set
|
|
||||||
guioptions=f</ex>)
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Ability to <ex>:source</ex> JavaScript files, and to use a
|
|
||||||
[a]~/.muttatorrc[a] file with syntax highlighting if you install
|
|
||||||
http://code.google.com/p/pentadactyl-labs/issues/detail?id=51[muttator.vim]
|
|
||||||
</li>
|
|
||||||
<li>Count supported for many commands (<em>3</em><key name="C-o"/> will go back 3 messages)</li>
|
|
||||||
<li>Beep on errors</li>
|
|
||||||
<li><ex>:map</ex> support (and feedkeys() for script writers)</li>
|
|
||||||
<li><ex>:time</ex> support for profiling</li>
|
|
||||||
<li>Many other pentadactyl features are available when in <tt>-- MESSAGE --</tt> mode</li>
|
|
||||||
<li>A comprehensive help file, explaining all commands, mappings and options. </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2 tag="contact">Contact</h2>
|
|
||||||
|
|
||||||
Please send comments/bug reports/patches to the mailing list, where we will
|
|
||||||
properly answer any questions. You can also join the
|
|
||||||
<link topic="irc://irc.freenode.net/pentadactyl">#pentadactyl</link> IRC channel
|
|
||||||
on <link topic="http://www.freenode.net/">Freenode</link> or check the
|
|
||||||
<link topic="http://code.google.com/p/pentadactyl-labs/w/list?q=label%3Aproject-muttator">Wiki</link>
|
|
||||||
for
|
|
||||||
<link topic="http://code.google.com/p/pentadactyl-labs/wiki/&dactyl.appname;FAQ">
|
|
||||||
frequently asked questions (FAQ)</link>.
|
|
||||||
Make sure, you have read the
|
|
||||||
<link topic="http://pentadactyl-labs.googlecode.com/hg/muttator/TODO">TODO</link>
|
|
||||||
file first, as we are aware of many things which can be improved when we find
|
|
||||||
time for it or receive patches.
|
|
||||||
|
|
||||||
</document>
|
|
||||||
<!-- vim:se sts=4 sw=4 et: -->
|
|
||||||
|
Before Width: | Height: | Size: 492 B |
@@ -1,18 +1,40 @@
|
|||||||
2009-XX-XX:
|
2009-XX-XX:
|
||||||
* Use only visible tabs for tab numbering, gt/gn/gN, etc.
|
* Extensive Firefox 4 support, including:
|
||||||
* Group tabs in :buffer completions by panorama groups
|
- Tabs in :buffer completions and listings are grouped
|
||||||
|
by panorama groups
|
||||||
|
- Only visible tabs are considered in tab numbering,
|
||||||
|
gt/gn/gN, etc.
|
||||||
|
* Greatly improved startup time.
|
||||||
|
* Significant completion speed improvements, especially for
|
||||||
|
JavaScript.
|
||||||
|
* Greatly improved private mode support and :sanitize command.
|
||||||
|
* :extadd now supports URLs.
|
||||||
* Replaced 'focuscontent' with 'strictfocus'
|
* Replaced 'focuscontent' with 'strictfocus'
|
||||||
* Replaced previous incremental search implementation
|
* New and much more powerful incremental search implementation.
|
||||||
|
Improvements over the standard Firefox find include.
|
||||||
|
- Starts at the cursor position in the currently selected
|
||||||
|
frame, unlike Firefox, which always starts at the start of
|
||||||
|
the first frame.
|
||||||
|
- Returns the cursor and viewport to their original position
|
||||||
|
on cancel.
|
||||||
|
- Backtracks to the first successful match after pressing
|
||||||
|
backspace.
|
||||||
|
- Supports reverse incremental search.
|
||||||
* gf now toggles between source and content view.
|
* gf now toggles between source and content view.
|
||||||
'|' key binding has been removed.
|
The | key binding has been removed.
|
||||||
* :open now only opens files begining with /, ./, or ~/
|
* :open now only opens files begining with /, ./, ../, or ~/
|
||||||
* Page zoom information is now shown in the status bar
|
* 'complete' now defaults to ‘slf’ but file completion only
|
||||||
|
triggers when the URL begins as above.
|
||||||
|
* Page zoom information is now shown in the status bar, and
|
||||||
|
change in zoom status no longer appears in :messages.
|
||||||
* Added ZO, ZI, ZM, and ZR as aliases for zO, zI, zM, and zR
|
* Added ZO, ZI, ZM, and ZR as aliases for zO, zI, zM, and zR
|
||||||
* Add basic plugin authorship documentation
|
* Major help system improvements:
|
||||||
* Plugins may now provide full-fleged ':help' documentation
|
- Plugins may now provide full-fleged ':help' documentation
|
||||||
* The help system is newly modularized
|
- Add basic plugin authorship documentation
|
||||||
* Asciidoc is no longer for building
|
- The help system is newly modularized and features significant
|
||||||
* Remove [c]:edit[c], [c]:tabedit[c], and [c]:winedit[c]
|
updates, rewrites, and formatting improvements.
|
||||||
|
- Asciidoc is no longer for building
|
||||||
|
* Remove :edit, :tabedit, and :winedit aliases.
|
||||||
* Add 'jsdebugger' option - switch on/off javascript debugger service
|
* Add 'jsdebugger' option - switch on/off javascript debugger service
|
||||||
* Add "addons", "downloads", "extoptions" and "help" to the 'activate' option.
|
* Add "addons", "downloads", "extoptions" and "help" to the 'activate' option.
|
||||||
|
|
||||||
@@ -22,17 +44,6 @@
|
|||||||
tri-license to the MIT license.
|
tri-license to the MIT license.
|
||||||
* IMPORTANT: Map.flags has been replaced with individual properties.
|
* IMPORTANT: Map.flags has been replaced with individual properties.
|
||||||
Mappings defined in plugins with mappings.add will need to be updated.
|
Mappings defined in plugins with mappings.add will need to be updated.
|
||||||
...................................
|
|
||||||
E.g.
|
|
||||||
mappings.add(...,
|
|
||||||
{ flags: Mappings.flags.ARGUMENT |
|
|
||||||
Mappings.flags.COUNT |
|
|
||||||
Mappings.flags.MOTION |
|
|
||||||
Mappings.flags.ALLOW_EVENT_ROUTING });
|
|
||||||
is now
|
|
||||||
mappings.add(...,
|
|
||||||
{ arg: true, count: true, motion: true, route: true });
|
|
||||||
...................................
|
|
||||||
* IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a>
|
* IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a>
|
||||||
and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
|
and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
|
||||||
* IMPORTANT: 'popups' now takes a stringlist rather than a number.
|
* IMPORTANT: 'popups' now takes a stringlist rather than a number.
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ BUGS:
|
|||||||
- The MOW shouldn't close when executing hints and ;F isn't working.
|
- The MOW shouldn't close when executing hints and ;F isn't working.
|
||||||
|
|
||||||
FEATURES:
|
FEATURES:
|
||||||
|
9 Add quoting help tag
|
||||||
|
9 Add altwildmode
|
||||||
|
9 JavaScript completer: show function parameter spec
|
||||||
|
9 Fix the arbitrary distinction between 'hinttags' and
|
||||||
|
'extendedhinttags'
|
||||||
9 Support multiple bookmarks, -keyword, -tags in :delbmarks
|
9 Support multiple bookmarks, -keyword, -tags in :delbmarks
|
||||||
8 Document Textarea, Caret and Visual modes.
|
8 Document Textarea, Caret and Visual modes.
|
||||||
8 Replace config.name tests in dactyl with more specific feature
|
8 Replace config.name tests in dactyl with more specific feature
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ override chrome://dactyl/content/config.js chrome://pentadactyl/content/config
|
|||||||
overlay chrome://browser/content/browser.xul chrome://dactyl/content/dactyl.xul
|
overlay chrome://browser/content/browser.xul chrome://dactyl/content/dactyl.xul
|
||||||
overlay chrome://browser/content/browser.xul chrome://pentadactyl/content/pentadactyl.xul
|
overlay chrome://browser/content/browser.xul chrome://pentadactyl/content/pentadactyl.xul
|
||||||
|
|
||||||
component {81495d80-89ee-4c36-a88d-ea7c4e5ac63f} components/about-handler.js
|
component {8e4a8e2f-95a0-4d8f-90ac-fc9d7d8f5468} components/dactyl.js
|
||||||
contract @mozilla.org/network/protocol/about;1?what=pentadactyl {81495d80-89ee-4c36-a88d-ea7c4e5ac63f}
|
contract @dactyl.googlecode.com/base/dactyl {8e4a8e2f-95a0-4d8f-90ac-fc9d7d8f5468}
|
||||||
|
|
||||||
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
|
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
|
||||||
contract @mozilla.org/commandlinehandler/general-startup;1?type=pentadactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
|
contract @mozilla.org/commandlinehandler/general-startup;1?type=pentadactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
|
||||||
@@ -25,4 +25,8 @@ component {c1b67a07-18f7-4e13-b361-2edcc35a5a0d} components/protocols.js
|
|||||||
contract @mozilla.org/network/protocol;1?name=chrome-data {c1b67a07-18f7-4e13-b361-2edcc35a5a0d}
|
contract @mozilla.org/network/protocol;1?name=chrome-data {c1b67a07-18f7-4e13-b361-2edcc35a5a0d}
|
||||||
component {9c8f2530-51c8-4d41-b356-319e0b155c44} components/protocols.js
|
component {9c8f2530-51c8-4d41-b356-319e0b155c44} components/protocols.js
|
||||||
contract @mozilla.org/network/protocol;1?name=dactyl {9c8f2530-51c8-4d41-b356-319e0b155c44}
|
contract @mozilla.org/network/protocol;1?name=dactyl {9c8f2530-51c8-4d41-b356-319e0b155c44}
|
||||||
|
component {f4506a17-5b4d-4cd9-92d4-2eb4630dc388} components/protocols.js
|
||||||
|
contract @dactyl.googlecode.com/base/xpc-interface-shim {f4506a17-5b4d-4cd9-92d4-2eb4630dc388}
|
||||||
|
component {81495d80-89ee-4c36-a88d-ea7c4e5ac63f} components/protocols.js
|
||||||
|
contract @mozilla.org/network/protocol/about;1?what=pentadactyl {81495d80-89ee-4c36-a88d-ea7c4e5ac63f}
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
// Header:
|
|
||||||
"use strict";
|
|
||||||
const Name = "Pentadactyl";
|
|
||||||
/*
|
|
||||||
* We can't load our modules here, so the following code is sadly
|
|
||||||
* duplicated: .w !sh
|
|
||||||
vimdiff ../../*'/components/about-handler.js'
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Copyright (c) 2009 by Doug Kearns
|
|
||||||
//
|
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
|
||||||
// given in the LICENSE.txt file included with this file.
|
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
|
|
||||||
const Cc = Components.classes;
|
|
||||||
const Ci = Components.interfaces;
|
|
||||||
|
|
||||||
const name = Name.toLowerCase();
|
|
||||||
function AboutHandler() {}
|
|
||||||
AboutHandler.prototype = {
|
|
||||||
|
|
||||||
classDescription: "About " + Name + " Page",
|
|
||||||
|
|
||||||
classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),
|
|
||||||
|
|
||||||
contractID: "@mozilla.org/network/protocol/about;1?what=" + name,
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
|
||||||
|
|
||||||
newChannel: function (uri) {
|
|
||||||
let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
|
|
||||||
.newChannel("chrome://" + name + "/content/about.html", null, null);
|
|
||||||
channel.originalURI = uri;
|
|
||||||
return channel;
|
|
||||||
},
|
|
||||||
|
|
||||||
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (XPCOMUtils.generateNSGetFactory)
|
|
||||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler]);
|
|
||||||
else
|
|
||||||
const NSGetModule = XPCOMUtils.generateNSGetModule([AboutHandler]);
|
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
// Header:
|
|
||||||
"use strict";
|
|
||||||
const Name = "Pentadactyl";
|
|
||||||
/*
|
|
||||||
* We can't load our modules here, so the following code is sadly
|
|
||||||
* duplicated: .w !sh
|
|
||||||
vimdiff ../../*'/components/commandline-handler.js'
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Copyright (c) 2009 by Doug Kearns
|
|
||||||
//
|
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
|
||||||
// given in the LICENSE.txt file included with this file.
|
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
|
|
||||||
const name = Name.toLowerCase();
|
|
||||||
function CommandLineHandler() {
|
|
||||||
this.wrappedJSObject = this;
|
|
||||||
}
|
|
||||||
CommandLineHandler.prototype = {
|
|
||||||
|
|
||||||
classDescription: Name + " Command-line Handler",
|
|
||||||
|
|
||||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
|
||||||
|
|
||||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
|
||||||
|
|
||||||
_xpcom_categories: [{
|
|
||||||
category: "command-line-handler",
|
|
||||||
entry: "m-" + name
|
|
||||||
}],
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
|
||||||
|
|
||||||
handle: function (commandLine) {
|
|
||||||
// TODO: handle remote launches differently?
|
|
||||||
try {
|
|
||||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
dump(name + ": option '-" + name + "' requires an argument\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (XPCOMUtils.generateNSGetFactory)
|
|
||||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
|
|
||||||
else
|
|
||||||
const NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
|
|
||||||
|
|
||||||
// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
|
|
||||||
1
pentadactyl/components/commandline-handler.js
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../common/components/commandline-handler.js
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>About:Pentadactyl</title>
|
|
||||||
<link rel="stylesheet" href="chrome://pentadactyl/skin/about.css" type="text/css" />
|
|
||||||
<link rel="icon" href="chrome://pentadactyl/skin/icon.png" type="image/png" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="main-container">
|
|
||||||
<div id="img-container">
|
|
||||||
<div id="text-container">
|
|
||||||
<div style="text-align: center;">
|
|
||||||
<img src="chrome://pentadactyl/content/logo.png" alt="Pentadactyl" />
|
|
||||||
version ###VERSION###
|
|
||||||
by Kris Maglione et al.
|
|
||||||
Pentadactyl is open source and freely distributable
|
|
||||||
|
|
||||||
type :q<<span class="key">Enter</span>> to exit
|
|
||||||
type :help<<span class="key">Enter</span>> or <<span class="key">F1</span>> for on-line help
|
|
||||||
type :help version-2.1<<span class="key">Enter</span>> for version info
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
<!-- vim: set fdm=marker sw=4 ts=4 et: -->
|
|
||||||
|
Before Width: | Height: | Size: 221 KiB |
@@ -1,14 +1,11 @@
|
|||||||
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
// Copyright (c) 2007-2009 by Doug Kearns <dougkearns@gmail.com>
|
||||||
// Copyright (c) 2008-2009 by Kris Maglione <maglione.k at Gmail>
|
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
|
||||||
const Config = Module("config", ConfigBase, {
|
const Config = Module("config", ConfigBase, {
|
||||||
name: "Pentadactyl",
|
|
||||||
hostApplication: "Firefox",
|
|
||||||
|
|
||||||
get visualbellWindow() getBrowser().mPanelContainer,
|
get visualbellWindow() getBrowser().mPanelContainer,
|
||||||
styleableChrome: ["chrome://browser/content/browser.xul"],
|
styleableChrome: ["chrome://browser/content/browser.xul"],
|
||||||
|
|
||||||
@@ -150,7 +147,7 @@ const Config = Module("config", ConfigBase, {
|
|||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
|
|
||||||
commands.add(["pref[erences]", "prefs"],
|
commands.add(["pref[erences]", "prefs"],
|
||||||
"Show " + config.hostApplication + " preferences",
|
"Show " + config.host + " preferences",
|
||||||
function (args) {
|
function (args) {
|
||||||
if (args.bang) { // open Firefox settings GUI dialog
|
if (args.bang) { // open Firefox settings GUI dialog
|
||||||
dactyl.open("about:config",
|
dactyl.open("about:config",
|
||||||
@@ -242,6 +239,7 @@ const Config = Module("config", ConfigBase, {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
completion: function () {
|
completion: function () {
|
||||||
|
dactyl.dump("Load completion\n");
|
||||||
var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589
|
var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589
|
||||||
completion.location = function location(context) {
|
completion.location = function location(context) {
|
||||||
if (!services.get("autoCompleteSearch"))
|
if (!services.get("autoCompleteSearch"))
|
||||||
|
|||||||
@@ -4,12 +4,19 @@
|
|||||||
|
|
||||||
<!ENTITY dactyl.mainWindow "main-window">
|
<!ENTITY dactyl.mainWindow "main-window">
|
||||||
<!ENTITY dactyl.name "pentadactyl">
|
<!ENTITY dactyl.name "pentadactyl">
|
||||||
|
<!ENTITY dactyl.version "1.0">
|
||||||
<!ENTITY dactyl.idname "PENTADACTYL">
|
<!ENTITY dactyl.idname "PENTADACTYL">
|
||||||
<!ENTITY dactyl.appname "Pentadactyl">
|
<!ENTITY dactyl.appname "Pentadactyl">
|
||||||
<!ENTITY dactyl.apphome "http://dactyl.googlecode.com/">
|
<!ENTITY dactyl.apphome "http://dactyl.sf.net/">
|
||||||
|
<!ENTITY dactyl.code "http://code.google.com/p/dactyl/">
|
||||||
|
<!ENTITY dactyl.plugins "http://dactyl.sf.net/&dactyl.name;/plugins">
|
||||||
<!ENTITY dactyl.maillist "pentadactyl@googlegroups.com">
|
<!ENTITY dactyl.maillist "pentadactyl@googlegroups.com">
|
||||||
<!ENTITY dactyl.host "&brandShortName;">
|
<!ENTITY dactyl.host "&brandShortName;">
|
||||||
<!ENTITY dactyl.hostbin "firefox">
|
<!ENTITY dactyl.hostbin "firefox">
|
||||||
<!ENTITY dactyl.statusBefore "statusbar-display">
|
<!ENTITY dactyl.statusBefore "statusbar-display">
|
||||||
<!ENTITY dactyl.statusAfter "">
|
<!ENTITY dactyl.statusAfter "">
|
||||||
|
|
||||||
|
<!ENTITY xmlns.dactyl "http://vimperator.org/namespaces/liberator">
|
||||||
|
<!ENTITY xmlns.html "http://www.w3.org/1999/xhtml">
|
||||||
|
<!ENTITY xmlns.xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -1,88 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="162"
|
|
||||||
height="40"
|
|
||||||
id="svg2"
|
|
||||||
sodipodi:version="0.32"
|
|
||||||
inkscape:version="0.46"
|
|
||||||
version="1.0"
|
|
||||||
sodipodi:docbase="/home/maxauthority/code/pentadactyl"
|
|
||||||
sodipodi:docname="pentadactyl.svg"
|
|
||||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
|
||||||
inkscape:export-filename="/home/maxauthority/code/pentadactyl/pentadactyl.png"
|
|
||||||
inkscape:export-xdpi="90"
|
|
||||||
inkscape:export-ydpi="90">
|
|
||||||
<defs
|
|
||||||
id="defs4">
|
|
||||||
<inkscape:perspective
|
|
||||||
sodipodi:type="inkscape:persp3d"
|
|
||||||
inkscape:vp_x="0 : 29 : 1"
|
|
||||||
inkscape:vp_y="0 : 1000 : 0"
|
|
||||||
inkscape:vp_z="185 : 29 : 1"
|
|
||||||
inkscape:persp3d-origin="92.5 : 19.333333 : 1"
|
|
||||||
id="perspective2392" />
|
|
||||||
</defs>
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
gridtolerance="10000"
|
|
||||||
guidetolerance="10"
|
|
||||||
objecttolerance="10"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="4.04"
|
|
||||||
inkscape:cx="84.114858"
|
|
||||||
inkscape:cy="55.052209"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
width="185px"
|
|
||||||
height="58px"
|
|
||||||
showgrid="false" />
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(-5.4392018,-9.6624603)">
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-size:24px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans Mono"
|
|
||||||
x="6.2673268"
|
|
||||||
y="29.896835"
|
|
||||||
id="text2229"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2231"
|
|
||||||
x="6.2673268"
|
|
||||||
y="29.896835">pentadactyl_</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-size:24px;font-style:normal;font-weight:normal;fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans Mono"
|
|
||||||
x="6.4079518"
|
|
||||||
y="53.183945"
|
|
||||||
id="text2233"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2235"
|
|
||||||
x="6.4079518"
|
|
||||||
y="53.183945">~</tspan></text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -5,21 +5,16 @@
|
|||||||
<em:id>pentadactyl@dactyl.googlecode.com</em:id>
|
<em:id>pentadactyl@dactyl.googlecode.com</em:id>
|
||||||
<em:name>Pentadactyl</em:name>
|
<em:name>Pentadactyl</em:name>
|
||||||
<em:version>@VERSION@</em:version>
|
<em:version>@VERSION@</em:version>
|
||||||
<em:description>Make Firefox behave like Vim</em:description>
|
<em:description>Firefox for Vim and Links addicts</em:description>
|
||||||
<em:creator>Kris Maglione</em:creator>
|
<em:creator>Kris Maglione</em:creator>
|
||||||
<em:homepageURL>http://dactyl.sf.net/</em:homepageURL>
|
<em:homepageURL>http://dactyl.sf.net/Pentadactyl</em:homepageURL>
|
||||||
<em:iconURL>chrome://pentadactyl/skin/icon.png</em:iconURL>
|
<em:iconURL>chrome://pentadactyl/skin/icon.png</em:iconURL>
|
||||||
<em:optionsURL>chrome://dactyl/content/preferences.xul</em:optionsURL>
|
<em:optionsURL>chrome://dactyl/content/preferences.xul</em:optionsURL>
|
||||||
<em:file>
|
|
||||||
<Description about="urn:mozilla:extension:file:pentadactyl.jar">
|
|
||||||
<em:package>content/dactyl/</em:package>
|
|
||||||
</Description>
|
|
||||||
</em:file>
|
|
||||||
<em:targetApplication>
|
<em:targetApplication>
|
||||||
<Description>
|
<Description>
|
||||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||||
<em:minVersion>3.5</em:minVersion>
|
<em:minVersion>3.5</em:minVersion>
|
||||||
<em:maxVersion>4.0b5pre</em:maxVersion>
|
<em:maxVersion>4.0b7pre</em:maxVersion>
|
||||||
</Description>
|
</Description>
|
||||||
</em:targetApplication>
|
</em:targetApplication>
|
||||||
</Description>
|
</Description>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="&xmlns.dactyl;>
|
||||||
<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>
|
<?xml-stylesheet type="&xmlns.html;" href="chrome://dactyl/content/help.xsl"?>
|
||||||
|
|
||||||
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||||
|
|
||||||
<overlay
|
<overlay
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
|
|
||||||
<dl tag="autocommand-list" replace="autocommand-list">
|
<dl tag="autocommand-list" replace="autocommand-list">
|
||||||
<dt>BookmarkAdd</dt> <dd>Triggered after a page is bookmarked</dd>
|
<dt>BookmarkAdd</dt> <dd>Triggered after a page is bookmarked</dd>
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||||
|
|
||||||
<overlay
|
<overlay
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
|
|
||||||
<dl tag="dialog-list" replace="dialog-list">
|
<dl tag="dialog-list" replace="dialog-list">
|
||||||
<dt>about</dt> <dd>About Mozilla &dactyl.host;;</dd>
|
<dt>about</dt> <dd>About Mozilla &dactyl.host;;</dd>
|
||||||
|
|||||||
@@ -6,36 +6,35 @@
|
|||||||
<document
|
<document
|
||||||
name="intro"
|
name="intro"
|
||||||
title="&dactyl.appname; Introduction"
|
title="&dactyl.appname; Introduction"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
|
|
||||||
|
<html:div style="text-align: center; clear: right; margin-bottom: -2.2em; padding-right: 4em;"><logo/></html:div>
|
||||||
|
|
||||||
<h1 tag="intro">Introduction</h1>
|
<h1 tag="intro">Introduction</h1>
|
||||||
|
|
||||||
<link topic="http://vimperator.org">&dactyl.appname;</link> is a free browser add-on for &dactyl.host;,
|
<p>
|
||||||
which makes it look and behave like the
|
<link topic="&dactyl.apphome;">&dactyl.appname;</link> is a
|
||||||
<link topic="http://www.vim.org">Vim</link>
|
free browser add-on for &dactyl.host;, designed to make browsing more
|
||||||
text editor.
|
efficient and especially more keyboard accessible. Largely inspired by the
|
||||||
|
<link topic="http://www.vim.org">Vim</link> text editor, the appearance
|
||||||
|
and finger feel should be familiar to Vim users.
|
||||||
|
</p>
|
||||||
|
|
||||||
<warning tag="warning">
|
<p tag="first-run">
|
||||||
To provide the most authentic Vim experience, the &dactyl.host;
|
If this is your first time running &dactyl.appname;, you may need some
|
||||||
menubar and toolbar are hidden.
|
time to adjust to the standard interface, which hides the menu,
|
||||||
|
navigation, and tool bars by default. If you find it uncomfortable to work
|
||||||
<p>
|
without them, you can re-enable them by typing,
|
||||||
If you really need them, type: <ex>:set guioptions+=mT</ex> to
|
</p>
|
||||||
get them back.
|
<code><ex>:set</ex> <link topic="'guioptions'"><hl key="HelpOpt">guioptions</hl></link><hl key="HelpEx">+=mT</hl><k name="Return"/></code>
|
||||||
</p>
|
<p>
|
||||||
|
If you have trouble remembering commands or keyboard shortcuts, you can
|
||||||
<p>
|
bring up this help page at any time by typing <ex>:help</ex> or the
|
||||||
If you don't like &dactyl.appname; at all, you can uninstall it
|
<k name="F1"/>. If you find that you don't like &dactyl.appname; at all,
|
||||||
by typing <ex>:extdelete &dactyl.appname;</ex> or disable it
|
you can disable it by typing <ex>:extdisable &dactyl.appname;</ex> or
|
||||||
with <ex>:extdisable &dactyl.appname;</ex>
|
delete it entirely by typing <ex>:extdelete &dactyl.appname;</ex>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
|
||||||
If you like it but can't remember the shortcuts, then type
|
|
||||||
<key name="F1"/> or <ex>:help</ex> to get this help window back.
|
|
||||||
</p>
|
|
||||||
</warning>
|
|
||||||
|
|
||||||
<h2 tag="overview">Help topics</h2>
|
<h2 tag="overview">Help topics</h2>
|
||||||
|
|
||||||
@@ -46,16 +45,17 @@ text editor.
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="starting">Starting &dactyl.appname;</link>:
|
<link topic="starting">Starting &dactyl.appname;</link>:
|
||||||
How &dactyl.appname; starts up, where it reads the config file…
|
How &dactyl.appname; starts up, where it reads the config file, etc.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="browsing">Browsing</link>:
|
<link topic="browsing">Browsing</link>:
|
||||||
Basic mappings and commands needed for a browsing session (how to open
|
Basic key mappings and commands needed for a browsing
|
||||||
a web page or go back in history).
|
session (how to open a web page, go back in history, etc.)
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="buffer">Buffer</link>:
|
<link topic="buffer">Buffer</link>:
|
||||||
Operations on the current document like scrolling or copying text.
|
Operations on the current document (scrolling, copying text,
|
||||||
|
etc.)
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="cmdline">Command-line mode</link>:
|
<link topic="cmdline">Command-line mode</link>:
|
||||||
@@ -82,7 +82,7 @@ text editor.
|
|||||||
Selecting hyperlinks and other page elements.
|
Selecting hyperlinks and other page elements.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="">Key mappings, abbreviations, and user-defined commands</link>:
|
<link topic="map">Keyboard shorcuts and commands</link>:
|
||||||
Defining new key mappings, abbreviations and user commands.
|
Defining new key mappings, abbreviations and user commands.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -115,19 +115,19 @@ text editor.
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="message">Error and informational messages</link>:
|
<link topic="message">Error and informational messages</link>:
|
||||||
A description of messages and error messages.
|
A description of informational and error messages.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="developer">Developer information</link>:
|
<link topic="developer">Developer information</link>:
|
||||||
How to write docs or plugins.
|
How to write plugins and documentation.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="various">Various commands</link>:
|
<link topic="various">Various commands</link>:
|
||||||
Other help which didn't fit into any other category.
|
Other help which doesn't readily fit into any other category.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="plugins">Plugins</link>:
|
<link topic="plugins">Plugins</link>:
|
||||||
Documentation for any plugins you may have installed.
|
Documentation for any plugins you have installed.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<link topic="index">Index</link>:
|
<link topic="index">Index</link>:
|
||||||
@@ -136,7 +136,8 @@ text editor.
|
|||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
You can also jump directly to the help of a specific command via the <ex>:help</ex> command.
|
You can also jump directly to the help of a specific command,
|
||||||
|
key mapping, or topic via the <ex>:help</ex> command.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<example><ex>:help :help</ex></example>
|
<example><ex>:help :help</ex></example>
|
||||||
@@ -144,26 +145,23 @@ text editor.
|
|||||||
<h2 tag="features">Features</h2>
|
<h2 tag="features">Features</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Vim-like keybindings (<k>h</k>, <k>j</k>, <k>k</k>, <k>l</k>, <k>gg</k>, <k>G</k>, <k>0</k>, <k>$</k>, <k>ZZ</k>, <k name="C-f"/>, etc.)</li>
|
<li>Vim-like keybindings (<k>h</k>, <k>j</k>, <k>gg</k>, <k>ZZ</k>, <k name="C-f"/>, etc.)</li>
|
||||||
<li>Ex commands (<ex>:quit</ex>, <ex>:open www.foo.com</ex>, …)</li>
|
<li>Ex commands (<ex>:quit</ex>, <ex>:open www.foo.com</ex>, …)</li>
|
||||||
<li>Tab completion available for all commands with support for "longest" matching when set in 'wildmode'</li>
|
<li>Tab completion for all commands, highliy configurable via <o>wildmode</o> and <o>wildoptions</o></li>
|
||||||
<li>Hit-a-hint like navigation of links (start with <k>f</k> to follow a link)</li>
|
<li>Hit-a-hint like navigation of links (start with <k>f</k> to follow a link)</li>
|
||||||
<li>Advanced completion of bookmark and history URLs (searching also in title, not only URL)</li>
|
<li>Advanced completion of bookmark and history URLs</li>
|
||||||
<li>Vim-like statusline with a Wget-like progress bar</li>
|
<li>Vim-like status line with a Wget-like progress bar</li>
|
||||||
<li>Minimal GUI (easily hide useless menubar and toolbar with <ex>:set guioptions=</ex>)</li>
|
<li>Minimal GUI (easily hide superfluous menubar and toolbar with <ex>:set guioptions=</ex>)</li>
|
||||||
<li>Ability to <ex>:source</ex> JavaScript files, and to use a <em>~/.pentadactylrc</em> file with syntax highlighting if you install pentadactyl.vim</li>
|
<li>Ability to <ex>:source</ex> JavaScript, CSS, and &dactyl.appname; command files.</li>
|
||||||
<li>Easy quick searches (<ex>:open foo</ex> will search for "foo" in google, <ex>:open ebay terminator</ex> will search for "terminator" on ebay) with support for &dactyl.host; keyword bookmarks and search engines</li>
|
<li>Easy quick searches (see <ex>:open</ex>)</li>
|
||||||
<li>Count supported for many commands (<em>3</em><k name="C-o"/> will go back 3 pages)</li>
|
<li>Count supported for many commands (<em>3</em><k name="C-o"/> will go back 3 pages)</li>
|
||||||
<li>Beep on errors</li>
|
<li>Visual bell for errors (<o>visualbell</o>)</li>
|
||||||
<li>Marks support (<k>m</k><em>a</em> to set mark a on a web page, <k>'</k><em>a</em> to go there)</li>
|
<li>Marks support (<k>m</k><em>a</em> to set mark a, <k>'</k><em>a</em> to jump to it)</li>
|
||||||
<li>QuickMarks support (quickly go to previously marked web pages with <k>go</k><a>a-zA-Z0-9</a>)</li>
|
<li><link topic="marks#quickmarks">QuickMark</link> support</li>
|
||||||
<li><ex>:map</ex> and <ex>:command</ex> support (and feedkeys() for script writers)</li>
|
<li><ex>:map</ex>, <ex>:command</ex>, <ex>:feedkeys</ex>, and <t>macros</t></li>
|
||||||
<li><ex>:time</ex> support for profiling</li>
|
<li><link topic="i_<C-i>">Editing of text fields</link> with an <link topic="'editor'">external editor</link></li>
|
||||||
<li>Move the text cursor and select text with Vim keys and a Visual mode</li>
|
|
||||||
<li>External editor support</li>
|
|
||||||
<li>Macros to replay key strokes</li>
|
|
||||||
<li>AutoCommands to execute actions on certain events</li>
|
<li>AutoCommands to execute actions on certain events</li>
|
||||||
<li>A comprehensive help system, explaining all commands, mappings and options</li>
|
<li>A comprehensive help system, explaining all commands, mappings, options, and plugins</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 tag="contact">Contact</h2>
|
<h2 tag="contact">Contact</h2>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<document
|
<document
|
||||||
name="tutorial"
|
name="tutorial"
|
||||||
title="&dactyl.appname; Tutorial"
|
title="&dactyl.appname; Tutorial"
|
||||||
xmlns="http://vimperator.org/namespaces/liberator"
|
xmlns="&xmlns.dactyl;"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
xmlns:html="&xmlns.html;">
|
||||||
<!-- Initial revision: Sun Jun 8 10:07:05 UTC 2008 (penryu) -->
|
<!-- Initial revision: Sun Jun 8 10:07:05 UTC 2008 (penryu) -->
|
||||||
|
|
||||||
<h1 tag="tutorial">Quick-start tutorial</h1>
|
<h1 tag="tutorial">Quick-start tutorial</h1>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 464 B |
34
teledactyl/chrome.manifest
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Thunderbird
|
||||||
|
content teledactyl content/
|
||||||
|
skin teledactyl classic/1.0 skin/
|
||||||
|
locale dactyl en-US locale/en-US/
|
||||||
|
|
||||||
|
content dactyl ../common/content/
|
||||||
|
resource dactyl ../common/modules/
|
||||||
|
skin dactyl classic/1.0 ../common/skin/
|
||||||
|
|
||||||
|
override chrome://dactyl/content/dactyl.dtd chrome://teledactyl/content/dactyl.dtd
|
||||||
|
override chrome://dactyl/content/config.js chrome://teledactyl/content/config.js
|
||||||
|
|
||||||
|
overlay chrome://messenger/content/messenger.xul chrome://dactyl/content/dactyl.xul
|
||||||
|
overlay chrome://messenger/content/messenger.xul chrome://teledactyl/content/teledactyl.xul
|
||||||
|
|
||||||
|
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://teledactyl/content/compose/dactyl.xul
|
||||||
|
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://teledactyl/content/compose/compose.xul
|
||||||
|
|
||||||
|
component {8e4a8e2f-95a0-4d8f-90ac-fc9d7d8f5468} components/dactyl.js
|
||||||
|
contract @dactyl.googlecode.com/base/dactyl {8e4a8e2f-95a0-4d8f-90ac-fc9d7d8f5468}
|
||||||
|
|
||||||
|
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
|
||||||
|
contract @mozilla.org/commandlinehandler/general-startup;1?type=teledactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
|
||||||
|
category command-line-handler m-teledactyl @mozilla.org/commandlinehandler/general-startup;1?type=pentadactyl
|
||||||
|
|
||||||
|
component {c1b67a07-18f7-4e13-b361-2edcc35a5a0d} components/protocols.js
|
||||||
|
contract @mozilla.org/network/protocol;1?name=chrome-data {c1b67a07-18f7-4e13-b361-2edcc35a5a0d}
|
||||||
|
component {9c8f2530-51c8-4d41-b356-319e0b155c44} components/protocols.js
|
||||||
|
contract @mozilla.org/network/protocol;1?name=dactyl {9c8f2530-51c8-4d41-b356-319e0b155c44}
|
||||||
|
component {f4506a17-5b4d-4cd9-92d4-2eb4630dc388} components/protocols.js
|
||||||
|
contract @dactyl.googlecode.com/base/xpc-interface-shim {f4506a17-5b4d-4cd9-92d4-2eb4630dc388}
|
||||||
|
component {81495d80-89ee-4c36-a88d-ea7c4e5ac63f} components/protocols.js
|
||||||
|
contract @mozilla.org/network/protocol/about;1?what=teledactyl {81495d80-89ee-4c36-a88d-ea7c4e5ac63f}
|
||||||
|
|
||||||
1
teledactyl/components/commandline-handler.js
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../common/components/commandline-handler.js
|
||||||