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>
|
||||
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.
|
||||
|
||||
|
||||
@@ -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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -35,6 +35,7 @@ function makeChannel(url, orig) {
|
||||
url = dataURL.apply(null, url());
|
||||
let uri = ioService.newURI(url, null, null);
|
||||
let channel = ioService.newChannelFromURI(uri);
|
||||
channel.contentCharset = "UTF-8";
|
||||
channel.owner = systemPrincipal;
|
||||
channel.originalURI = orig;
|
||||
return channel;
|
||||
@@ -45,6 +46,27 @@ function redirect(to, orig, time) {
|
||||
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() {}
|
||||
ChromeData.prototype = {
|
||||
contractID: "@mozilla.org/network/protocol;1?name=chrome-data",
|
||||
@@ -53,10 +75,10 @@ ChromeData.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
||||
_xpcom_factory: {
|
||||
createInstance: function (outer, iid) {
|
||||
if (!ChromeData.instance)
|
||||
ChromeData.instance = new ChromeData();
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
if (!ChromeData.instance)
|
||||
ChromeData.instance = new ChromeData();
|
||||
return ChromeData.instance.QueryInterface(iid);
|
||||
}
|
||||
},
|
||||
@@ -89,7 +111,6 @@ ChromeData.prototype = {
|
||||
function Dactyl() {
|
||||
this.wrappedJSObject = this;
|
||||
|
||||
const self = this;
|
||||
this.HELP_TAGS = {};
|
||||
this.FILE_MAP = {};
|
||||
this.OVERLAY_MAP = {};
|
||||
@@ -101,14 +122,16 @@ Dactyl.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
||||
_xpcom_factory: {
|
||||
createInstance: function (outer, iid) {
|
||||
if (!Dactyl.instance)
|
||||
Dactyl.instance = new Dactyl();
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
if (!Dactyl.instance)
|
||||
Dactyl.instance = new Dactyl();
|
||||
return Dactyl.instance.QueryInterface(iid);
|
||||
}
|
||||
},
|
||||
|
||||
__proto__: Cc["@dactyl.googlecode.com/base/dactyl"].getService().wrappedJSObject,
|
||||
|
||||
init: function (obj) {
|
||||
for each (let prop in ["HELP_TAGS", "FILE_MAP", "OVERLAY_MAP"]) {
|
||||
this[prop] = this[prop].constructor();
|
||||
@@ -125,9 +148,9 @@ Dactyl.prototype = {
|
||||
| nsIProtocolHandler.URI_IS_LOCAL_RESOURCE,
|
||||
|
||||
newURI: function (spec, charset, baseURI) {
|
||||
var uri = Components.classes["@mozilla.org/network/standard-url;1"]
|
||||
.createInstance(Components.interfaces.nsIStandardURL)
|
||||
.QueryInterface(Components.interfaces.nsIURI);
|
||||
var uri = Cc["@mozilla.org/network/standard-url;1"]
|
||||
.createInstance(Ci.nsIStandardURL)
|
||||
.QueryInterface(Ci.nsIURI);
|
||||
uri.init(uri.URLTYPE_STANDARD, this.defaultPort, spec, charset, baseURI);
|
||||
return uri;
|
||||
},
|
||||
@@ -138,16 +161,16 @@ Dactyl.prototype = {
|
||||
return redirect(uri.spec, uri, 1);
|
||||
|
||||
switch(uri.host) {
|
||||
case "help":
|
||||
let url = this.FILE_MAP[uri.path.replace(/^\/|#.*/g, "")];
|
||||
return makeChannel(url, uri);
|
||||
case "help-overlay":
|
||||
url = this.OVERLAY_MAP[uri.path.replace(/^\/|#.*/g, "")];
|
||||
return makeChannel(url, uri);
|
||||
case "help-tag":
|
||||
let tag = uri.path.substr(1);
|
||||
if (tag in this.HELP_TAGS)
|
||||
return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag, uri);
|
||||
case "help":
|
||||
let url = this.FILE_MAP[decodeURIComponent(uri.path.replace(/^\/|#.*/g, ""))];
|
||||
return makeChannel(url, uri);
|
||||
case "help-overlay":
|
||||
url = this.OVERLAY_MAP[decodeURIComponent(uri.path.replace(/^\/|#.*/g, ""))];
|
||||
return makeChannel(url, uri);
|
||||
case "help-tag":
|
||||
let tag = decodeURIComponent(uri.path.substr(1));
|
||||
if (tag in this.HELP_TAGS)
|
||||
return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag, uri);
|
||||
}
|
||||
}
|
||||
catch (e) {}
|
||||
@@ -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)
|
||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeData, Dactyl]);
|
||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||
else
|
||||
const NSGetModule = XPCOMUtils.generateNSGetModule([ChromeData, Dactyl]);
|
||||
const NSGetModule = XPCOMUtils.generateNSGetModule([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||
|
||||
// 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) 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -18,7 +18,7 @@ const AutoCommands = Module("autocommands", {
|
||||
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
|
||||
@@ -94,7 +94,7 @@ const AutoCommands = Module("autocommands", {
|
||||
+
|
||||
template.map(items, function (item)
|
||||
<tr>
|
||||
<td> {item.pattern.source}</td>
|
||||
<td> {item.pattern.source}</td>
|
||||
<td>{item.command}</td>
|
||||
</tr>))
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// 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
|
||||
const Bookmarks = Module("bookmarks", {
|
||||
init: function () {
|
||||
let bookmarkObserver = function (key, event, arg) {
|
||||
storage.addObserver("bookmark-cache", function (key, event, arg) {
|
||||
if (event == "add")
|
||||
autocommands.trigger("BookmarkAdd", arg);
|
||||
statusline.updateUrl();
|
||||
};
|
||||
|
||||
storage.addObserver("bookmark-cache", bookmarkObserver, window);
|
||||
}, window);
|
||||
},
|
||||
|
||||
get format() ({
|
||||
@@ -36,7 +34,8 @@ const Bookmarks = Module("bookmarks", {
|
||||
add: function add(starOnly, title, url, keyword, tags, force) {
|
||||
try {
|
||||
let uri = util.createURI(url);
|
||||
if (!force) {
|
||||
if (!force && bookmarks.isBookmarked(uri.spec)) {
|
||||
// WTF? This seems wrong... --Kris
|
||||
for (let bmark in bookmarkcache) {
|
||||
if (bmark[0] == uri.spec) {
|
||||
var id = bmark[5];
|
||||
@@ -74,21 +73,22 @@ const Bookmarks = Module("bookmarks", {
|
||||
|
||||
let count = this.remove(url);
|
||||
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 {
|
||||
let title = buffer.title || url;
|
||||
let extra = "";
|
||||
if (title != url)
|
||||
extra = " (" + title + ")";
|
||||
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) {
|
||||
try {
|
||||
return services.get("bookmarks").getBookmarkIdsForURI(makeURI(url), {})
|
||||
.some(bookmarkcache.isRegularBookmark);
|
||||
return services.get("bookmarks")
|
||||
.getBookmarkIdsForURI(makeURI(url), {})
|
||||
.some(bookmarkcache.closure.isRegularBookmark);
|
||||
}
|
||||
catch (e) {
|
||||
return false;
|
||||
@@ -99,13 +99,14 @@ const Bookmarks = Module("bookmarks", {
|
||||
remove: function remove(url) {
|
||||
try {
|
||||
let uri = util.newURI(url);
|
||||
let bmarks = services.get("bookmarks").getBookmarkIdsForURI(uri, {})
|
||||
.filter(bookmarkcache.isRegularBookmark);
|
||||
let bmarks = services.get("bookmarks")
|
||||
.getBookmarkIdsForURI(uri, {})
|
||||
.filter(bookmarkcache.closure.isRegularBookmark);
|
||||
bmarks.forEach(services.get("bookmarks").removeItem);
|
||||
return bmarks.length;
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.log(e, 0);
|
||||
dactyl.reportError(e);
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
@@ -287,7 +288,7 @@ const Bookmarks = Module("bookmarks", {
|
||||
args.completeFilter = have.pop();
|
||||
|
||||
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)];
|
||||
},
|
||||
@@ -330,7 +331,8 @@ const Bookmarks = Module("bookmarks", {
|
||||
|
||||
if (bookmarks.add(false, title, url, keyword, tags, args.bang)) {
|
||||
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
|
||||
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 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) {
|
||||
let rest = item.url.length - end.length;
|
||||
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 {
|
||||
item.url = decodeURIComponent(query.replace(/#.*/, ""));
|
||||
item.url = decodeURIComponent(query.replace(/#.*/, "").replace(/\+/g, " "));
|
||||
return item;
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
return null;
|
||||
}).filter(util.identity);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// 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) 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
|
||||
// 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;
|
||||
let cacheKey = doc.location.toString().replace(/#.*$/, "");
|
||||
|
||||
for (let proto in util.Array.itervalues(["HTTP", "FTP"])) {
|
||||
for (let proto in array.itervalues(["HTTP", "FTP"])) {
|
||||
try {
|
||||
var cacheEntryDescriptor = services.get("cache").createSession(proto, 0, true)
|
||||
.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
|
||||
// page is loaded in a background tab
|
||||
onPageLoad: function onPageLoad(event) {
|
||||
if (!dactyl.helpInitialized && event.originalTarget instanceof Document)
|
||||
if (/^dactyl:/.test(event.originalTarget.location.href))
|
||||
if (event.originalTarget instanceof Document)
|
||||
if (/^dactyl:/.test(event.originalTarget.location.href)) {
|
||||
dactyl.initHelp();
|
||||
config.styleHelp();
|
||||
}
|
||||
|
||||
if (event.originalTarget instanceof HTMLDocument) {
|
||||
let doc = event.originalTarget;
|
||||
@@ -197,7 +199,7 @@ const Buffer = Module("buffer", {
|
||||
doc.pageIsFullyLoaded = 1;
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -206,7 +208,11 @@ const Buffer = Module("buffer", {
|
||||
/**
|
||||
* @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()
|
||||
onStateChange: function onStateChange(webProgress, request, flags, status) {
|
||||
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
|
||||
// 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); },
|
||||
dactyl.mode == modes.HINTS ? 500 : 0);
|
||||
}
|
||||
@@ -1012,7 +1018,7 @@ const Buffer = Module("buffer", {
|
||||
if (win.scrollMaxX > 0 || win.scrollMaxY > 0)
|
||||
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)
|
||||
return frame;
|
||||
|
||||
@@ -1314,39 +1320,39 @@ const Buffer = Module("buffer", {
|
||||
group[1].push([i, tab.linkedBrowser]);
|
||||
});
|
||||
|
||||
let orig = context;
|
||||
for (let [id, [name, browsers]] in Iterator(tabGroups)) {
|
||||
context = orig.fork(id, 0);
|
||||
context.anchored = false;
|
||||
context.title = [name || "Buffers"];
|
||||
context.keys = { text: "text", description: "url", icon: "icon" };
|
||||
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.pushProcessor(0, function (item, text, next) <>
|
||||
<span highlight="Indicator" style="display: inline-block;">{item.item.indicator}</span>
|
||||
{ next.call(this, item, text) }
|
||||
</>);
|
||||
context.process[1] = function (item, text) template.highlightURL(text);
|
||||
|
||||
context.completions = util.map(util.Array.itervalues(browsers), function ([i, browser]) {
|
||||
let indicator = " ";
|
||||
if (i == tabs.index())
|
||||
indicator = "%"
|
||||
else if (i == tabs.index(tabs.alternate))
|
||||
indicator = "#";
|
||||
context.anchored = false;
|
||||
context.keys = { text: "text", description: "url", icon: "icon" };
|
||||
context.compare = CompletionContext.Sort.number;
|
||||
|
||||
let tab = tabs.getTab(i);
|
||||
let url = browser.contentDocument.location.href;
|
||||
i = i + 1;
|
||||
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 = " ";
|
||||
if (i == tabs.index())
|
||||
indicator = "%"
|
||||
else if (i == tabs.index(tabs.alternate))
|
||||
indicator = "#";
|
||||
|
||||
return {
|
||||
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
||||
url: template.highlightURL(url),
|
||||
indicator: indicator,
|
||||
icon: tab.image || DEFAULT_FAVICON
|
||||
};
|
||||
});
|
||||
}
|
||||
let tab = tabs.getTab(i);
|
||||
let url = browser.contentDocument.location.href;
|
||||
i = i + 1;
|
||||
|
||||
return {
|
||||
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
||||
url: url,
|
||||
indicator: indicator,
|
||||
icon: tab.image || DEFAULT_FAVICON
|
||||
};
|
||||
});
|
||||
}, vals);
|
||||
};
|
||||
},
|
||||
events: function () {
|
||||
@@ -1354,6 +1360,15 @@ const Buffer = Module("buffer", {
|
||||
config.browser.removeProgressListener(window.XULBrowserWindow);
|
||||
}
|
||||
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);
|
||||
window.XULBrowserWindow = this.progressListener;
|
||||
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
@@ -1503,7 +1518,8 @@ const Buffer = Module("buffer", {
|
||||
if (elem.readOnly || elem instanceof HTMLInputElement && !set.has(Events.editableInputs, elem.type))
|
||||
return false;
|
||||
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);
|
||||
@@ -1617,13 +1633,13 @@ const Buffer = Module("buffer", {
|
||||
function () { buffer.showPageInfo(true); });
|
||||
},
|
||||
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",
|
||||
"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",
|
||||
"stringlist", "\\bprev|previous\\b,^<$,^(<<|\u00AB)$,^(<|\u00AB),(<|\u00AB)$");
|
||||
"stringlist", UTF8("\\bprev|previous\\b,^<$,^(<<|«)$,^(<|«),(<|«)$"));
|
||||
|
||||
options.add(["pageinfo", "pa"],
|
||||
"Desired info in the :pageinfo output",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -103,31 +103,32 @@ const CommandLine = Module("commandline", {
|
||||
////////////////////// VARIABLES ///////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
this._completionList = ItemList("dactyl-completions");
|
||||
memoize(this, "_completionList", function () ItemList("dactyl-completions"));
|
||||
this._completions = null;
|
||||
this._history = null;
|
||||
|
||||
this._startHints = false; // whether we're waiting to start hints mode
|
||||
this._lastSubstring = "";
|
||||
|
||||
this.widgets = {
|
||||
commandline: document.getElementById("dactyl-commandline"),
|
||||
prompt: document.getElementById("dactyl-commandline-prompt"),
|
||||
command: document.getElementById("dactyl-commandline-command"),
|
||||
memoize(this, "widgets", function () {
|
||||
let widgets = {
|
||||
commandline: document.getElementById("dactyl-commandline"),
|
||||
prompt: document.getElementById("dactyl-commandline-prompt"),
|
||||
command: document.getElementById("dactyl-commandline-command"),
|
||||
|
||||
message: document.getElementById("dactyl-message"),
|
||||
message: document.getElementById("dactyl-message"),
|
||||
|
||||
multilineOutput: document.getElementById("dactyl-multiline-output"),
|
||||
multilineInput: document.getElementById("dactyl-multiline-input"),
|
||||
};
|
||||
multilineOutput: document.getElementById("dactyl-multiline-output"),
|
||||
multilineInput: document.getElementById("dactyl-multiline-input"),
|
||||
};
|
||||
|
||||
this.widgets.command.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
||||
this.widgets.message.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
||||
widgets.command.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
||||
widgets.message.inputField.QueryInterface(Ci.nsIDOMNSEditableElement);
|
||||
widgets.mowContainer = widgets.multilineOutput.parentNode;
|
||||
|
||||
// the widget used for multiline output
|
||||
this._outputContainer = this.widgets.multilineOutput.parentNode;
|
||||
|
||||
this.widgets.multilineOutput.contentDocument.body.id = "dactyl-multiline-output-content";
|
||||
widgets.multilineOutput.contentDocument.body.id = "dactyl-multiline-output-content";
|
||||
return widgets;
|
||||
});
|
||||
|
||||
// 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"
|
||||
@@ -181,12 +182,14 @@ const CommandLine = Module("commandline", {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Highlight the messageBox according to <b>group</b>.
|
||||
*/
|
||||
_setHighlightGroup: function (group) {
|
||||
this.widgets.message.setAttributeNS(NS.uri, "highlight", group);
|
||||
set highlightGroup(group) {
|
||||
highlight.highlightNode(this.widgets.message, group);
|
||||
},
|
||||
get highlightGroup() this.widgets.message.getAttributeNS(NS.uri, "highlight"),
|
||||
|
||||
/**
|
||||
* Determines whether the command line should be visible.
|
||||
@@ -206,7 +209,7 @@ const CommandLine = Module("commandline", {
|
||||
this.widgets.prompt.value = val;
|
||||
this.widgets.prompt.size = val.length;
|
||||
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
|
||||
* messages move to the MOW.
|
||||
*/
|
||||
_echoLine: function (str, highlightGroup, forceSingle) {
|
||||
this._setHighlightGroup(highlightGroup);
|
||||
_echoLine: function echoLine(str, highlightGroup, forceSingle) {
|
||||
this.highlightGroup = highlightGroup;
|
||||
this.widgets.message.value = str;
|
||||
|
||||
dactyl.triggerObserver("echoLine", str, highlightGroup, forceSingle);
|
||||
@@ -250,7 +253,7 @@ const CommandLine = Module("commandline", {
|
||||
* @param {string} highlightGroup
|
||||
*/
|
||||
// TODO: resize upon a window resize
|
||||
_echoMultiline: function (str, highlightGroup) {
|
||||
_echoMultiline: function echoMultiline(str, highlightGroup) {
|
||||
let doc = this.widgets.multilineOutput.contentDocument;
|
||||
let win = this.widgets.multilineOutput.contentWindow;
|
||||
|
||||
@@ -260,14 +263,15 @@ const CommandLine = Module("commandline", {
|
||||
// Otherwise, white space is significant.
|
||||
// The problem elsewhere is that E4X tends to insert new lines
|
||||
// after interpolated data.
|
||||
XML.ignoreWhitespace = typeof str != "xml";
|
||||
this._lastMowOutput = <div class="ex-command-output" style="white-space: nowrap" highlight={highlightGroup}>{template.maybeXML(str)}</div>;
|
||||
XML.ignoreWhitespace = false;
|
||||
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);
|
||||
XML.ignoreWhitespace = true;
|
||||
|
||||
// FIXME: need to make sure an open MOW is closed when commands
|
||||
// that don't generate output are executed
|
||||
if (this._outputContainer.collapsed)
|
||||
if (this.widgets.mowContainer.collapsed)
|
||||
doc.body.innerHTML = "";
|
||||
|
||||
doc.body.appendChild(output);
|
||||
@@ -417,6 +421,8 @@ const CommandLine = Module("commandline", {
|
||||
this._currentExtendedMode = null;
|
||||
commandline.triggerCallback("cancel", mode);
|
||||
|
||||
if (this._completions)
|
||||
this._completions.previewClear();
|
||||
if (this._history)
|
||||
this._history.save();
|
||||
|
||||
@@ -431,11 +437,11 @@ const CommandLine = Module("commandline", {
|
||||
this._completionList.hide();
|
||||
|
||||
if (!this._keepCommand || this._silent || this._quiet) {
|
||||
this._outputContainer.collapsed = true;
|
||||
this.widgets.mowContainer.collapsed = true;
|
||||
commandline.updateMorePrompt();
|
||||
this.hide();
|
||||
}
|
||||
if (!this._outputContainer.collapsed) {
|
||||
if (!this.widgets.mowContainer.collapsed) {
|
||||
modes.set(modes.COMMAND_LINE, modes.OUTPUT_MULTILINE);
|
||||
commandline.updateMorePrompt();
|
||||
}
|
||||
@@ -492,39 +498,42 @@ const CommandLine = Module("commandline", {
|
||||
|
||||
if (flags & this.APPEND_TO_MESSAGES) {
|
||||
let message = isobject(str) ? str : { message: str };
|
||||
this._messageHistory.add(update({ highlight: highlightGroup }, str));
|
||||
this._messageHistory.add(update({ highlight: highlightGroup }, message));
|
||||
str = message.message;
|
||||
}
|
||||
|
||||
if ((flags & this.ACTIVE_WINDOW) &&
|
||||
window != services.get("windowWatcher").activeWindow &&
|
||||
services.get("windowWatcher").activeWindow.dactyl)
|
||||
return;
|
||||
|
||||
if ((flags & this.DISALLOW_MULTILINE) && !this._outputContainer.collapsed)
|
||||
if ((flags & this.DISALLOW_MULTILINE) && !this.widgets.mowContainer.collapsed)
|
||||
return;
|
||||
|
||||
let single = flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE);
|
||||
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)
|
||||
this._lastEcho = null;
|
||||
else {
|
||||
if (this.widgets.message.value == this._lastEcho)
|
||||
this._echoMultiline(<span highlight="Message">{this._lastEcho}</span>,
|
||||
this.widgets.message.getAttributeNS(NS.uri, "highlight"));
|
||||
this.highlightGroup);
|
||||
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)
|
||||
action.call(this, str, highlightGroup, single);
|
||||
}),
|
||||
@@ -937,7 +946,7 @@ const CommandLine = Module("commandline", {
|
||||
* and what they do.
|
||||
*/
|
||||
updateMorePrompt: function updateMorePrompt(force, showHelp) {
|
||||
if (this._outputContainer.collapsed) {
|
||||
if (this.widgets.mowContainer.collapsed) {
|
||||
this._echoLine("", this.HL_NORMAL);
|
||||
return;
|
||||
}
|
||||
@@ -960,19 +969,25 @@ const CommandLine = Module("commandline", {
|
||||
* @param {boolean} open If true, the widget will be opened if it's not
|
||||
* already so.
|
||||
*/
|
||||
updateOutputHeight: function updateOutputHeight(open) {
|
||||
if (!open && this._outputContainer.collapsed)
|
||||
updateOutputHeight: function updateOutputHeight(open, extra) {
|
||||
if (!open && this.widgets.mowContainer.collapsed)
|
||||
return;
|
||||
|
||||
let doc = this.widgets.multilineOutput.contentDocument;
|
||||
|
||||
let availableHeight = config.outputHeight;
|
||||
if (!this._outputContainer.collapsed)
|
||||
availableHeight += parseFloat(this._outputContainer.height);
|
||||
if (!this.widgets.mowContainer.collapsed)
|
||||
availableHeight += parseFloat(this.widgets.mowContainer.height);
|
||||
availableHeight -= extra || 0;
|
||||
|
||||
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 = "";
|
||||
this._outputContainer.collapsed = false;
|
||||
this.widgets.mowContainer.collapsed = false;
|
||||
},
|
||||
|
||||
resetCompletions: function resetCompletions() {
|
||||
@@ -1015,7 +1030,12 @@ const CommandLine = Module("commandline", {
|
||||
if (/^\s*$/.test(str))
|
||||
return;
|
||||
this.store.mutate("filter", function (line) (line.value || line) != str);
|
||||
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) });
|
||||
try {
|
||||
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) });
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.reportError(e);
|
||||
}
|
||||
this.store.truncate(options["history"], true);
|
||||
},
|
||||
/**
|
||||
@@ -1142,6 +1162,8 @@ const CommandLine = Module("commandline", {
|
||||
|
||||
get wildtype() this.wildtypes[this.wildIndex] || "",
|
||||
|
||||
get wildtypes() this.wildmode.values,
|
||||
|
||||
complete: function complete(show, tabPressed) {
|
||||
this.context.reset();
|
||||
this.context.tabPressed = tabPressed;
|
||||
@@ -1162,7 +1184,7 @@ const CommandLine = Module("commandline", {
|
||||
let substring = "";
|
||||
switch (this.wildtype.replace(/.*:/, "")) {
|
||||
case "":
|
||||
substring = this.items[0].text;
|
||||
substring = this.items[0].result;
|
||||
break;
|
||||
case "longest":
|
||||
if (this.items.length > 1) {
|
||||
@@ -1173,7 +1195,7 @@ const CommandLine = Module("commandline", {
|
||||
case "full":
|
||||
let item = this.items[this.selected != null ? this.selected + 1 : 0];
|
||||
if (item)
|
||||
substring = item.text;
|
||||
substring = item.result;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1227,14 +1249,14 @@ const CommandLine = Module("commandline", {
|
||||
this.wildIndex = 0;
|
||||
}
|
||||
|
||||
this.wildtypes = this.wildmode.values;
|
||||
this.preview();
|
||||
},
|
||||
|
||||
_reset: function _reset() {
|
||||
this.prefix = this.context.value.substring(0, this.start);
|
||||
this.value = this.context.value.substring(this.start, this.caret);
|
||||
this.suffix = this.context.value.substring(this.caret);
|
||||
let value = this.editor.selection.focusNode.textContent;
|
||||
this.prefix = value.substring(0, this.start);
|
||||
this.value = value.substring(this.start, this.caret);
|
||||
this.suffix = value.substring(this.caret);
|
||||
|
||||
this.itemList.reset();
|
||||
this.itemList.selectItem(this.selected);
|
||||
@@ -1301,7 +1323,7 @@ const CommandLine = Module("commandline", {
|
||||
return;
|
||||
|
||||
this.selected = idx;
|
||||
this.completion = this.items[idx].text;
|
||||
this.completion = this.items[idx].result;
|
||||
}
|
||||
|
||||
this.itemList.selectItem(idx);
|
||||
@@ -1320,6 +1342,8 @@ const CommandLine = Module("commandline", {
|
||||
return;
|
||||
|
||||
while (this.tabs.length) {
|
||||
this.wildIndex = Math.min(this.wildIndex, this.wildtypes.length - 1);
|
||||
|
||||
reverse = this.tabs.shift();
|
||||
switch (this.wildtype.replace(/.*:/, "")) {
|
||||
case "":
|
||||
@@ -1340,7 +1364,7 @@ const CommandLine = Module("commandline", {
|
||||
if (this.haveType("list"))
|
||||
this.itemList.show();
|
||||
|
||||
this.wildIndex = Math.constrain(this.wildIndex + 1, 0, this.wildtypes.length - 1);
|
||||
this.wildIndex++;
|
||||
this.preview();
|
||||
|
||||
commandline._statusTimer.tell();
|
||||
@@ -1373,7 +1397,7 @@ const CommandLine = Module("commandline", {
|
||||
|
||||
if (typeof arg === "object")
|
||||
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>;
|
||||
else
|
||||
arg = String(arg);
|
||||
@@ -1533,7 +1557,7 @@ const CommandLine = Module("commandline", {
|
||||
styles: function () {
|
||||
let fontSize = util.computedStyle(document.getElementById(config.mainWindowId)).fontSize;
|
||||
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 + "; }");
|
||||
}
|
||||
});
|
||||
@@ -1542,7 +1566,7 @@ const CommandLine = Module("commandline", {
|
||||
* The list which is used for the completion box (and QuickFix window in
|
||||
* 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
|
||||
* necessary.
|
||||
*/
|
||||
@@ -1579,12 +1603,15 @@ const ItemList = Class("ItemList", {
|
||||
|
||||
this._minHeight = Math.max(this._minHeight,
|
||||
this._win.scrollY + this._divNodes.completions.getBoundingClientRect().bottom);
|
||||
this._container.height = this._minHeight;
|
||||
|
||||
if (this._container.collapsed)
|
||||
this._div.style.minWidth = "";
|
||||
|
||||
// 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);
|
||||
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)))
|
||||
nodes[i] = row;
|
||||
for (let [i, row] in util.Array.iteritems(nodes)) {
|
||||
for (let [i, row] in array.iteritems(nodes)) {
|
||||
if (!row)
|
||||
continue;
|
||||
let display = (i >= start && i < end);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -171,16 +171,10 @@ const Command = Class("Command", {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasName: function (name) {
|
||||
for (let [, spec] in Iterator(this.specs)) {
|
||||
let fullName = spec.replace(/\[(\w+)]$/, "$1");
|
||||
let index = spec.indexOf("[");
|
||||
let min = index == -1 ? fullName.length : index;
|
||||
|
||||
if (fullName.indexOf(name) == 0 && name.length >= min)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return this.specs.some(function (spec) {
|
||||
let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/);
|
||||
return name.indexOf(head) == 0 && (head + (tail || "")).indexOf(name) == 0;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -340,25 +334,29 @@ const Commands = Module("commands", {
|
||||
/** @property {Iterator(Command)} @private */
|
||||
__iterator__: function () {
|
||||
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. */
|
||||
repeat: null,
|
||||
|
||||
_addCommand: function (command, replace) {
|
||||
if (command.name in this._exMap) {
|
||||
if (command.user && replace)
|
||||
commands.removeUserCommand(command.name);
|
||||
else {
|
||||
dactyl.log("Warning: :" + command.name + " already exists, NOT replacing existing command.", 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
_addCommand: function (args, replace) {
|
||||
let names = array.flatten(Command.parseSpecs(args[0]));
|
||||
dactyl.assert(!names.some(function (name) name in this._exMap && !this._exMap[name].user, this),
|
||||
"E182: Can't replace non-user command: " + args[0]);
|
||||
if (!replace && args[3] && args[3].user)
|
||||
dactyl.assert(!names.some(function (name) name in this._exMap, this),
|
||||
"Not replacing command " + args[0]);
|
||||
for (let name in names)
|
||||
if (name in this._exMap)
|
||||
commands.removeUserCommand(name);
|
||||
|
||||
this._exCommands.push(command);
|
||||
for (let [,name] in Iterator(command.names))
|
||||
this._exMap[name] = command;
|
||||
let name = names[0];
|
||||
let closure = function () commands._exMap[name];
|
||||
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;
|
||||
},
|
||||
@@ -375,7 +373,7 @@ const Commands = Module("commands", {
|
||||
* @optional
|
||||
*/
|
||||
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;
|
||||
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) {
|
||||
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 || {})) {
|
||||
let chr = /^-.$/.test(opt) ? " " : "=";
|
||||
@@ -431,8 +429,8 @@ const Commands = Module("commands", {
|
||||
* any of the command's names.
|
||||
* @returns {Command}
|
||||
*/
|
||||
get: function (name) {
|
||||
return this._exMap[name] || this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null;
|
||||
get: function (name, full) {
|
||||
return this._exMap[name] || !full && this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -573,7 +571,7 @@ const Commands = Module("commands", {
|
||||
argCount = "*";
|
||||
|
||||
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.literalArg = "";
|
||||
|
||||
@@ -833,11 +831,11 @@ const Commands = Module("commands", {
|
||||
* any of the command's names.
|
||||
*/
|
||||
removeUserCommand: function (name) {
|
||||
for (let [,cmd] in Iterator(this._exCommands))
|
||||
if (cmd.user && cmd.hasName(name))
|
||||
for (let [,name] in Iterator(cmd.names))
|
||||
delete this._exMap[name];
|
||||
this._exCommands = this._exCommands.filter(function (cmd) !(cmd.user && cmd.hasName(name)));
|
||||
let cmd = this.get(name);
|
||||
dactyl.assert(cmd.user, "E184: No such user-defined command: " + name);
|
||||
for (let name in values(cmd.names))
|
||||
delete this._exMap[name];
|
||||
this._exCommands = this._exCommands.filter(function (c) c != cmd);
|
||||
},
|
||||
|
||||
// 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]
|
||||
parseArg: function (str) {
|
||||
let arg = "";
|
||||
@@ -918,7 +914,7 @@ const Commands = Module("commands", {
|
||||
// dynamically get completions as specified with the command's completer function
|
||||
let command = commands.get(cmd);
|
||||
if (!command) {
|
||||
context.highlight(0, cmd.length, "SPELLCHECK");
|
||||
context.highlight(0, cmd && cmd.length, "SPELLCHECK");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -936,7 +932,8 @@ const Commands = Module("commands", {
|
||||
cmdContext.filter = args.completeFilter;
|
||||
try {
|
||||
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] };
|
||||
if (compObject != null) {
|
||||
cmdContext.advance(compObject.start);
|
||||
@@ -1041,14 +1038,13 @@ const Commands = Module("commands", {
|
||||
function completerToString(completer) {
|
||||
if (completer)
|
||||
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
|
||||
// : 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
|
||||
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)
|
||||
commandline.commandOutput(
|
||||
@@ -1101,7 +1097,7 @@ const Commands = Module("commands", {
|
||||
serialize: function () [ {
|
||||
command: this.name,
|
||||
bang: true,
|
||||
options: util.Array.toObject(
|
||||
options: array.toObject(
|
||||
[[v, typeof cmd[k] == "boolean" ? null : cmd[k]]
|
||||
// FIXME: this map is expressed multiple times
|
||||
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) {
|
||||
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("", "\\\\'"), "'"],
|
||||
"": ["", quote("", "\\\\ "), ""]
|
||||
"": ["", quote("", "\\\\ '\""), ""]
|
||||
};
|
||||
|
||||
Commands.quoteArg = {
|
||||
'"': quote('"', '\n\t"\\\\'),
|
||||
"'": quote("'", "\\\\'"),
|
||||
"": quote("", "\\\\ ")
|
||||
"": quote("", "\\\\ '\"")
|
||||
};
|
||||
|
||||
Commands.parseBool = function (arg) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// 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)
|
||||
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.__defineGetter__("value", function () this.top.value);
|
||||
@@ -90,14 +90,34 @@ const CompletionContext = Class("CompletionContext", {
|
||||
this._value = editor;
|
||||
else
|
||||
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
|
||||
* a completion window with Esc or Ctrl-c. Usually this callback
|
||||
* is only needed for long, asynchronous completions
|
||||
*/
|
||||
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.
|
||||
* @default Selects all results which match every predicate in the
|
||||
@@ -114,20 +134,6 @@ const CompletionContext = Class("CompletionContext", {
|
||||
* results.
|
||||
*/
|
||||
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
|
||||
* { key: value }, getKey(item, key) will return values as such:
|
||||
@@ -146,6 +152,9 @@ const CompletionContext = Class("CompletionContext", {
|
||||
* {@link #updateAsync} is true.
|
||||
*/
|
||||
this.onUpdate = function () true;
|
||||
|
||||
this.runCount = 0;
|
||||
|
||||
/**
|
||||
* @property {CompletionContext} The top-level completion context.
|
||||
*/
|
||||
@@ -190,6 +199,7 @@ const CompletionContext = Class("CompletionContext", {
|
||||
: item.item[key];
|
||||
return this;
|
||||
},
|
||||
|
||||
// Temporary
|
||||
/**
|
||||
* @property {Object}
|
||||
@@ -202,7 +212,7 @@ const CompletionContext = Class("CompletionContext", {
|
||||
get allItems() {
|
||||
try {
|
||||
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)
|
||||
minStart = 0;
|
||||
let items = this.contextList.map(function (context) {
|
||||
@@ -214,7 +224,7 @@ const CompletionContext = Class("CompletionContext", {
|
||||
__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) {
|
||||
dactyl.reportError(e);
|
||||
@@ -235,7 +245,7 @@ const CompletionContext = Class("CompletionContext", {
|
||||
lists.pop());
|
||||
if (!substrings) // FIXME: How is this undefined?
|
||||
return [];
|
||||
return util.Array.uniq(Array.slice(substrings));
|
||||
return array.uniq(Array.slice(substrings));
|
||||
},
|
||||
// Temporary
|
||||
get longestAllSubstring() {
|
||||
@@ -253,14 +263,16 @@ const CompletionContext = Class("CompletionContext", {
|
||||
// Accept a generator
|
||||
if (!isarray(items))
|
||||
items = [x for (x in Iterator(items))];
|
||||
delete this.cache.filtered;
|
||||
delete this.cache.filter;
|
||||
this.cache.rows = [];
|
||||
this.hasItems = items.length > 0;
|
||||
this._completions = items;
|
||||
let self = this;
|
||||
if (this._completions !== items) {
|
||||
delete this.cache.filtered;
|
||||
delete this.cache.filter;
|
||||
this.cache.rows = [];
|
||||
this.hasItems = items.length > 0;
|
||||
this._completions = items;
|
||||
this.itemCache[this.key] = items;
|
||||
}
|
||||
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
|
||||
@@ -293,14 +305,18 @@ const CompletionContext = Class("CompletionContext", {
|
||||
|
||||
get proto() {
|
||||
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;
|
||||
if (typeof v == "string" && /^[.[]/.test(v))
|
||||
// This is only allowed to be a simple accessor, and shouldn't
|
||||
// reference any variables. Don't bother with eval context.
|
||||
v = Function("i", "return i" + v);
|
||||
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
|
||||
res.__defineGetter__(k, function () Class.replaceProperty(this, k, this.item[v]));
|
||||
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]; },
|
||||
|
||||
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.cache.offset = this.offset;
|
||||
if (!this.itemCache[this.key])
|
||||
this.itemCache[this.key] = this._generate.call(this) || [];
|
||||
this.cache.offset = this.offset;
|
||||
this.lastActivated = this.top.runCount;
|
||||
}
|
||||
if (!this.itemCache[this.key]) {
|
||||
let res = this._generate.call(this) || [];
|
||||
if (res != null)
|
||||
this.itemCache[this.key] = res;
|
||||
}
|
||||
return this.itemCache[this.key];
|
||||
},
|
||||
set generate(arg) {
|
||||
@@ -354,16 +375,27 @@ const CompletionContext = Class("CompletionContext", {
|
||||
get items() {
|
||||
if (!this.hasItems || this.backgroundLock)
|
||||
return [];
|
||||
if (this.cache.filtered && this.cache.filter == this.filter)
|
||||
return this.cache.filtered;
|
||||
this.cache.rows = [];
|
||||
let items = this.completions;
|
||||
|
||||
// Regenerate completions if we must
|
||||
if (this.generate && !this.background) {
|
||||
// XXX
|
||||
this.noUpdate = true;
|
||||
this.completions = items = this.generate();
|
||||
this.completions = this.generate();
|
||||
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;
|
||||
if (items == null)
|
||||
return items;
|
||||
@@ -371,6 +403,7 @@ const CompletionContext = Class("CompletionContext", {
|
||||
let self = this;
|
||||
delete this._substrings;
|
||||
|
||||
// Item matchers
|
||||
if (this.ignoreCase)
|
||||
this.matchString = this.anchored ?
|
||||
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;
|
||||
|
||||
// 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 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)
|
||||
filtered = filtered.slice(0, this.maxItems);
|
||||
|
||||
// Sorting
|
||||
if (this.sortResults && 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;
|
||||
},
|
||||
|
||||
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() {
|
||||
let items = this.items;
|
||||
if (items.length == 0 || !this.hasItems)
|
||||
@@ -418,7 +443,10 @@ const CompletionContext = Class("CompletionContext", {
|
||||
return this._substrings;
|
||||
|
||||
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);
|
||||
if (this.anchored) {
|
||||
var compare = function compare(text, s) text.substr(0, s.length) == s;
|
||||
@@ -521,7 +549,6 @@ const CompletionContext = Class("CompletionContext", {
|
||||
context.waitingForTab = true;
|
||||
else if (completer)
|
||||
return completer.apply(self || this, [context].concat(Array.slice(arguments, fork.length)));
|
||||
|
||||
if (completer)
|
||||
return null;
|
||||
return context;
|
||||
@@ -535,20 +562,24 @@ const CompletionContext = Class("CompletionContext", {
|
||||
},
|
||||
|
||||
highlight: function highlight(start, length, type) {
|
||||
try { // Gecko < 1.9.1 doesn't have repaintSelection
|
||||
this.selectionTypes[type] = null;
|
||||
if (arguments.length == 0) {
|
||||
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 editor = this.editor;
|
||||
let sel = editor.selectionController.getSelection(selType);
|
||||
let sel = this.editor.selectionController.getSelection(selType);
|
||||
if (length == 0)
|
||||
sel.removeAllRanges();
|
||||
else {
|
||||
let range = editor.selection.getRangeAt(0).cloneRange();
|
||||
let range = this.editor.selection.getRangeAt(0).cloneRange();
|
||||
range.setStart(range.startContainer, this.offset + start);
|
||||
range.setEnd(range.startContainer, this.offset + start + length);
|
||||
sel.addRange(range);
|
||||
}
|
||||
editor.selectionController.repaintSelection(selType);
|
||||
}
|
||||
catch (e) {}
|
||||
},
|
||||
@@ -557,23 +588,19 @@ const CompletionContext = Class("CompletionContext", {
|
||||
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() {
|
||||
let self = this;
|
||||
if (this.parent)
|
||||
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.process = [];
|
||||
this.selectionTypes = {};
|
||||
this.process = [template.icon, function (item, k) k];
|
||||
this.filters = [CompletionContext.Filter.text];
|
||||
this.tabPressed = false;
|
||||
this.title = ["Completions"];
|
||||
this.updateAsync = false;
|
||||
@@ -595,6 +622,10 @@ const CompletionContext = Class("CompletionContext", {
|
||||
if (context != context.top)
|
||||
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(
|
||||
<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)
|
||||
template.completionRow(context.title, "CompTitle") +
|
||||
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");
|
||||
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 = [
|
||||
function (item, text) highlight.call(this, item, item.text, 0),
|
||||
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) 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
|
||||
// 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.
|
||||
*/
|
||||
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.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
|
||||
* 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
|
||||
@@ -105,45 +130,41 @@ const ConfigBase = Class(ModuleBase, {
|
||||
* @property {string} The leaf name of any temp files created by
|
||||
* {@link io.createTempFile}.
|
||||
*/
|
||||
get tempFile() this.name.toLowerCase() + ".tmp",
|
||||
get tempFile() this.name + ".tmp",
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @property {string} The default highlighting rules. They have the
|
||||
* form:
|
||||
* rule ::= selector space space+ css
|
||||
* selector ::= group
|
||||
* | group "," css-selector
|
||||
* | group "," css-selector "," scope
|
||||
* group ::= groupname
|
||||
* | groupname css-selector
|
||||
* @property {string} The default highlighting rules.
|
||||
* See {@link Highlights#loadCSS} for details.
|
||||
*/
|
||||
// <css>
|
||||
CSS: <![CDATA[
|
||||
Boolean color: red;
|
||||
Function color: navy;
|
||||
Null color: blue;
|
||||
Number color: blue;
|
||||
Object color: maroon;
|
||||
String color: green;
|
||||
CSS: UTF8(<><![CDATA[
|
||||
// <css>
|
||||
Boolean color: red;
|
||||
Function color: navy;
|
||||
Null color: blue;
|
||||
Number color: blue;
|
||||
Object color: maroon;
|
||||
String color: green;
|
||||
|
||||
Key font-weight: bold;
|
||||
Key font-weight: bold;
|
||||
|
||||
Enabled color: blue;
|
||||
Disabled color: red;
|
||||
Enabled color: blue;
|
||||
Disabled color: red;
|
||||
|
||||
Normal color: black; background: white;
|
||||
ErrorMsg color: white; background: red; font-weight: bold;
|
||||
InfoMsg color: black; background: white;
|
||||
ModeMsg color: black; background: white;
|
||||
MoreMsg color: green; background: white;
|
||||
WarningMsg color: red; background: white;
|
||||
Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block;
|
||||
NonText color: blue; min-height: 16px; padding-left: 2px;
|
||||
Preview color: gray;
|
||||
!Normal color: black !important; background: white !important;
|
||||
ErrorMsg color: white !important; background: red !important; font-weight: bold !important;
|
||||
InfoMsg color: black !important; background: white !important;
|
||||
LineNr color: orange !important; background: white !important;
|
||||
ModeMsg color: black !important; background: white !important;
|
||||
MoreMsg color: green !important; background: white !important;
|
||||
Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block;
|
||||
NonText color: blue; min-height: 16px; padding-left: 2px;
|
||||
*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;
|
||||
CmdOutput white-space: pre;
|
||||
!CmdLine;>* font-family: monospace !important; padding: 1px !important;
|
||||
CmdOutput white-space: pre;
|
||||
|
||||
CompGroup
|
||||
CompGroup:not(:first-of-type) margin-top: .5em;
|
||||
@@ -158,9 +179,10 @@ const ConfigBase = Class(ModuleBase, {
|
||||
CompResult width: 45%; overflow: hidden;
|
||||
CompDesc color: gray; width: 50%;
|
||||
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::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;
|
||||
GradientLeft background-color: magenta;
|
||||
@@ -172,19 +194,16 @@ const ConfigBase = Class(ModuleBase, {
|
||||
Keyword color: red;
|
||||
Tag color: blue;
|
||||
|
||||
LineNr color: orange; background: white;
|
||||
Question color: green; background: white; font-weight: bold;
|
||||
!StatusLine color: white !important; background: black !important
|
||||
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;
|
||||
StatusLineBroken color: black; background: #FFa0a0 /* light-red */
|
||||
StatusLineSecure color: black; background: #a0a0FF /* light-blue */
|
||||
StatusLineExtended color: black; background: #a0FFa0 /* light-green */
|
||||
|
||||
TabClose,.tab-close-button
|
||||
TabIcon,.tab-icon
|
||||
TabText,.tab-text
|
||||
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;
|
||||
color: white;
|
||||
text-align: center;
|
||||
@@ -195,47 +214,52 @@ const ConfigBase = Class(ModuleBase, {
|
||||
URL text-decoration: none; color: green; background: inherit;
|
||||
URL:hover text-decoration: underline; cursor: pointer;
|
||||
|
||||
FrameIndicator,,* {
|
||||
background-color: red;
|
||||
opacity: 0.5;
|
||||
z-index: 999;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
FrameIndicator;;* {
|
||||
/* This gets released into the wild, so everything is important */
|
||||
background-color: red !important;
|
||||
opacity: 0.5 !important;
|
||||
z-index: 999999 !important;
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
bottom: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
}
|
||||
|
||||
Bell border: none; background-color: black;
|
||||
Hint,,* {
|
||||
font-family: monospace;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
background-color: red;
|
||||
border-color: ButtonShadow;
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
padding: 0px 1px 0px 1px;
|
||||
!Bell border: none; background-color: black;
|
||||
Hint;;* {
|
||||
/* This gets released into the wild, so everything is important */
|
||||
font: bold 10px monospace !important;
|
||||
background-color: red !important;
|
||||
color: white !important;
|
||||
border: 0px solid ButtonShadow !important;
|
||||
padding: 0px 1px !important;
|
||||
}
|
||||
Hint::after,,* content: attr(number);
|
||||
HintElem,,* background-color: yellow; color: black;
|
||||
HintActive,,* background-color: #88FF00; color: black;
|
||||
HintImage,,* opacity: .5;
|
||||
!Hint::after;;* content: attr(number) !important;
|
||||
!HintElem;;* background-color: yellow !important; color: black !important;
|
||||
!HintActive;;* background-color: #88FF00 !important; color: black !important;
|
||||
!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;
|
||||
HelpOptionalArg color: #6A97D4;
|
||||
|
||||
HelpBody display: block; margin: 1em auto; max-width: 100ex;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
HelpEm,html|em,dactyl://help/* font-weight: bold; font-style: normal;
|
||||
HelpDescription display: block; clear: right;
|
||||
HelpDescription[short] clear: none;
|
||||
HelpEm;html|em;dactyl://help/* font-weight: bold; font-style: normal;
|
||||
|
||||
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;
|
||||
|
||||
HelpKey color: #102663;
|
||||
HelpKeyword font-weight: bold; color: navy;
|
||||
|
||||
HelpLink,html|a,dactyl://help/* text-decoration: none;
|
||||
HelpLink[href]:hover text-decoration: underline;
|
||||
HelpLink;html|a;dactyl://help/* text-decoration: none !important;
|
||||
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,html|ol,dactyl://help/* display: block; list-style: outside decimal;
|
||||
HelpListItem,html|li,dactyl://help/* display: list-item;
|
||||
HelpOrderedList;ol[level="1"],ol;dactyl://help/* display: block; list-style: outside decimal;
|
||||
HelpOrderedList2;ol[level="2"],ol ol;dactyl://help/* list-style: outside upper-alpha;
|
||||
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;
|
||||
|
||||
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;
|
||||
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::after content: '"';
|
||||
HelpString[delim]::before content: attr(delim);
|
||||
HelpString[delim]::after content: attr(delim);
|
||||
|
||||
HelpHead,html|h1,dactyl://help/* {
|
||||
HelpHead;html|h1;dactyl://help/* {
|
||||
display: block;
|
||||
margin: 1em 0;
|
||||
margin: 2em 0 1em;
|
||||
padding-bottom: .2ex;
|
||||
border-bottom-width: 1px;
|
||||
font-size: 2em;
|
||||
@@ -282,9 +316,9 @@ const ConfigBase = Class(ModuleBase, {
|
||||
color: #527BBD;
|
||||
clear: both;
|
||||
}
|
||||
HelpSubhead,html|h2,dactyl://help/* {
|
||||
HelpSubhead;html|h2;dactyl://help/* {
|
||||
display: block;
|
||||
margin: 1em 0;
|
||||
margin: 2em 0 1em;
|
||||
padding-bottom: .2ex;
|
||||
border-bottom-width: 1px;
|
||||
font-size: 1.2em;
|
||||
@@ -292,7 +326,7 @@ const ConfigBase = Class(ModuleBase, {
|
||||
color: #527BBD;
|
||||
clear: both;
|
||||
}
|
||||
HelpSubsubhead,html|h3,dactyl://help/* {
|
||||
HelpSubsubhead;html|h3;dactyl://help/* {
|
||||
display: block;
|
||||
margin: 1em 0;
|
||||
padding-bottom: .2ex;
|
||||
@@ -305,12 +339,20 @@ const ConfigBase = Class(ModuleBase, {
|
||||
HelpTOC
|
||||
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;
|
||||
HelpTabColumn,html|column,dactyl://help/* display: table-column;
|
||||
HelpTabColumn:first-child width: 25%;
|
||||
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;
|
||||
HelpTabRow,html|dl>html|tr,dactyl://help/* display: table-row;
|
||||
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;
|
||||
}
|
||||
HelpTabColumn;html|column;dactyl://help/* display: table-column;
|
||||
HelpTabColumn:first-child width: 25%;
|
||||
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;
|
||||
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;
|
||||
HelpTags display: block; float: right; clear: right;
|
||||
@@ -319,15 +361,31 @@ const ConfigBase = Class(ModuleBase, {
|
||||
|
||||
HelpWarning color: red; font-weight: bold;
|
||||
|
||||
Logo
|
||||
|
||||
Search,,* {
|
||||
font-size: inherit;
|
||||
padding: 0;
|
||||
color: black;
|
||||
background-color: yellow;
|
||||
HelpXML color: #C5F779; background-color: #444444; font-family: Terminus, Fixed, monospace;
|
||||
HelpXMLBlock { white-space: pre; color: #C5F779; background-color: #444444;
|
||||
border: 1px dashed #aaaaaa;
|
||||
display: block;
|
||||
margin-left: 2em;
|
||||
font-family: Terminus, Fixed, monospace;
|
||||
}
|
||||
]]>.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:
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
return;
|
||||
}
|
||||
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);
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -30,6 +32,7 @@
|
||||
catch (e) {
|
||||
dump("dactyl: Loading script " + script + ": " + e.result + " " + e + "\n");
|
||||
dump(Error().stack + "\n");
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,7 +67,7 @@
|
||||
"template",
|
||||
].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);
|
||||
})();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// 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.
|
||||
*/
|
||||
dump: function () {
|
||||
dump: function dump() {
|
||||
let msg = Array.map(arguments, function (msg) {
|
||||
if (typeof msg == "object")
|
||||
msg = util.objectToString(msg);
|
||||
return msg;
|
||||
}).join(", ");
|
||||
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 {number} frames The number of frames to print.
|
||||
*/
|
||||
dumpStack: function (msg, frames) {
|
||||
dumpStack: function dumpStack(msg, frames) {
|
||||
let stack = Error().stack.replace(/(?:.*\n){2}/, "");
|
||||
if (frames != null)
|
||||
[stack] = stack.match(RegExp("(?:.*\n){0," + frames + "}"));
|
||||
@@ -234,7 +234,7 @@ const Dactyl = Module("dactyl", {
|
||||
* @param {number} flags These control the multiline message behaviour.
|
||||
* See {@link CommandLine#echo}.
|
||||
*/
|
||||
echo: function (str, flags) {
|
||||
echo: function echo(str, 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.
|
||||
* See {@link CommandLine#echo}.
|
||||
*/
|
||||
echoerr: function (str, flags) {
|
||||
echoerr: function echoerr(str, flags) {
|
||||
flags |= commandline.APPEND_TO_MESSAGES;
|
||||
|
||||
if (isinstance(str, ["Error", "Exception"]))
|
||||
@@ -293,8 +293,6 @@ const Dactyl = Module("dactyl", {
|
||||
* should be loaded.
|
||||
*/
|
||||
loadScript: function (uri, context) {
|
||||
XML.ignoreWhiteSpace = false;
|
||||
XML.prettyPrinting = false;
|
||||
services.get("subscriptLoader").loadSubScript(uri, context);
|
||||
},
|
||||
|
||||
@@ -395,7 +393,7 @@ const Dactyl = Module("dactyl", {
|
||||
let command = commands.get(cmd);
|
||||
|
||||
if (command === null) {
|
||||
err = "E492: Not a " + config.name.toLowerCase() + " command: " + str;
|
||||
err = "E492: Not a " + config.name + " command: " + str;
|
||||
dactyl.focusContent();
|
||||
}
|
||||
else if (command.action === null)
|
||||
@@ -486,27 +484,19 @@ const Dactyl = Module("dactyl", {
|
||||
* Initialize the help system.
|
||||
*/
|
||||
initHelp: function () {
|
||||
if ("noscriptOverlay" in window) {
|
||||
noscriptOverlay.safeAllow("chrome-data:", true, false);
|
||||
noscriptOverlay.safeAllow("dactyl:", true, false);
|
||||
}
|
||||
if (!this.helpInitialized) {
|
||||
if ("noscriptOverlay" in window) {
|
||||
noscriptOverlay.safeAllow("chrome-data:", true, false);
|
||||
noscriptOverlay.safeAllow("dactyl:", true, false);
|
||||
}
|
||||
|
||||
if(!this.helpInitialized) {
|
||||
let namespaces = [config.name.toLowerCase(), "dactyl"];
|
||||
let namespaces = [config.name, "dactyl"];
|
||||
services.get("dactyl:").init({});
|
||||
|
||||
let tagMap = services.get("dactyl:").HELP_TAGS;
|
||||
let fileMap = services.get("dactyl:").FILE_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.
|
||||
function findHelpFile(file) {
|
||||
let result = [];
|
||||
@@ -525,23 +515,20 @@ const Dactyl = Module("dactyl", {
|
||||
}
|
||||
// Find the tags in the document.
|
||||
function addTags(file, doc) {
|
||||
doc = XSLT.transformToDocument(doc);
|
||||
for (let elem in util.evaluateXPath("//xhtml:a/@id", doc))
|
||||
tagMap[elem.value] = file;
|
||||
for (let elem in util.evaluateXPath("//@tag|//dactyl:tags/text()|//dactyl:tag/text()", doc))
|
||||
for (let tag in array((elem.value || elem.textContent).split(/\s+/)).compact().itervalues())
|
||||
tagMap[tag] = file;
|
||||
}
|
||||
|
||||
const XSLT = XSLTProcessor("chrome://dactyl/content/help-single.xsl");
|
||||
|
||||
// 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.
|
||||
tagMap.all = "all";
|
||||
let files = findHelpFile("all").map(function (doc)
|
||||
[f.value for (f in util.evaluateXPath(
|
||||
"//dactyl:include/@href", doc))]);
|
||||
[f.value for (f in util.evaluateXPath("//dactyl:include/@href", doc))]);
|
||||
|
||||
// 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) {
|
||||
addTags(file, doc);
|
||||
});
|
||||
@@ -550,7 +537,6 @@ const Dactyl = Module("dactyl", {
|
||||
// Process plugin help entries.
|
||||
XML.ignoreWhiteSpace = false;
|
||||
XML.prettyPrinting = false;
|
||||
XML.prettyIndent = 4;
|
||||
|
||||
let body = XML();
|
||||
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> +
|
||||
context.INFO;
|
||||
|
||||
let help = '<?xml version="1.0"?>\n' +
|
||||
'<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>\n' +
|
||||
'<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">' +
|
||||
let help =
|
||||
'<?xml version="1.0"?>\n' +
|
||||
'<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>\n' +
|
||||
'<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">\n' +
|
||||
<document xmlns={NS}
|
||||
name="plugins" title={config.name + " Plugins"}>
|
||||
name="plugins" title={config.appname + " Plugins"}>
|
||||
<h1 tag="using-plugins">Using Plugins</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
@@ -589,11 +576,11 @@ const Dactyl = Module("dactyl", {
|
||||
function addDataEntry(file, data) // Inideal to an extreme.
|
||||
addURIEntry(file, "data:text/plain;charset=UTF-8," + encodeURI(data));
|
||||
|
||||
let empty = util.Array.toObject(
|
||||
"area base basefont br col frame hr img input isindex link meta param"
|
||||
.split(" ").map(Array.concat));
|
||||
let empty = set("area base basefont br col frame hr img input isindex link meta param"
|
||||
.split(" "));
|
||||
|
||||
let chrome = {};
|
||||
let styles = {};
|
||||
for (let [file,] in Iterator(services.get("dactyl:").FILE_MAP)) {
|
||||
dactyl.open("dactyl://help/" + file);
|
||||
dactyl.modules.events.waitForPageLoad();
|
||||
@@ -612,10 +599,11 @@ const Dactyl = Module("dactyl", {
|
||||
if (node instanceof HTMLHtmlElement)
|
||||
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") {
|
||||
name = "class";
|
||||
value = "hl-" + value;
|
||||
set.add(styles, value);
|
||||
}
|
||||
if (name == "href") {
|
||||
if (value.indexOf("dactyl://help-tag/") == 0)
|
||||
@@ -651,11 +639,11 @@ const Dactyl = Module("dactyl", {
|
||||
addDataEntry(file + ".xhtml", data.join(""));
|
||||
}
|
||||
|
||||
let data = [h.selector.replace(/^\[.*?=(.*?)\]/, ".hl-$1").replace(/html\|/, "") +
|
||||
"\t{" + h.value + "}"
|
||||
for (h in highlight) if (/^Help|^Logo/.test(h.class))];
|
||||
|
||||
data = data.join("\n");
|
||||
let data = [h for (h in highlight) if (set.has(styles, h.class) || /^Help/.test(h.class))]
|
||||
.map(function (h)
|
||||
h.selector.replace(/^\[.*?=(.*?)\]/, ".hl-$1").replace(/html\|/, "") + "\t" +
|
||||
"{" + h.value + "}")
|
||||
.join("\n");
|
||||
addDataEntry("help.css", data.replace(/chrome:[^ ")]+\//g, ""));
|
||||
|
||||
let re = /(chrome:[^ ");]+\/)([^ ");]+)/g;
|
||||
@@ -668,6 +656,49 @@ const Dactyl = Module("dactyl", {
|
||||
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
|
||||
* exists.
|
||||
@@ -692,8 +723,6 @@ const Dactyl = Module("dactyl", {
|
||||
dactyl.assert(page != null, "E149: Sorry, no help for " + topic);
|
||||
|
||||
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) {
|
||||
dactyl.log("No user plugin directory found", 3);
|
||||
return;
|
||||
}
|
||||
|
||||
dactyl.echomsg('Searching for "plugin/**/*.{js,vimp}" in '
|
||||
+ [dir.path.replace(/.plugin$/, "") for ([, dir] in Iterator(dirs))]
|
||||
dactyl.echomsg('Searching for "plugins/**/*.{js,vimp}" in '
|
||||
+ [dir.path.replace(/.plugins$/, "") for ([, dir] in Iterator(dirs))]
|
||||
.join(",").quote(), 2);
|
||||
|
||||
dirs.forEach(function (dir) {
|
||||
@@ -765,20 +794,33 @@ const Dactyl = Module("dactyl", {
|
||||
if (typeof msg == "object")
|
||||
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
|
||||
* false on error.
|
||||
*
|
||||
* @param {string|string[]} urls Either a URL string or an array of URLs.
|
||||
* The array can look like this:
|
||||
* ["url1", "url2", "url3", ...]
|
||||
* or:
|
||||
* [["url1", postdata1], ["url2", postdata2], ...]
|
||||
* @param {number|Object} where If ommited, CURRENT_TAB is assumed but NEW_TAB
|
||||
* is set when dactyl.forceNewTab is true.
|
||||
* @param {string|Array} urls A representation of the URLs to open. May be
|
||||
* either a string, which will be bassed to
|
||||
* {@see Dactyl#stringToURLArray}, or an array in the same format as
|
||||
* would be returned by the same.
|
||||
* @param {object} params A set of parameters specifing to open the
|
||||
* URLs. The following properties are recognized:
|
||||
*
|
||||
* • 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
|
||||
* tabs.
|
||||
* @returns {boolean}
|
||||
@@ -787,30 +829,29 @@ const Dactyl = Module("dactyl", {
|
||||
if (typeof urls == "string")
|
||||
urls = dactyl.stringToURLArray(urls);
|
||||
|
||||
if (urls.length > 20 && !force) {
|
||||
commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no]) ",
|
||||
if (urls.length > 20 && !force)
|
||||
return commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no]) ",
|
||||
function (resp) {
|
||||
if (resp && resp.match(/^y(es)?$/i))
|
||||
dactyl.open(urls, params, true);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let flags = 0;
|
||||
params = params || {};
|
||||
if (isarray(params))
|
||||
params = { where: params };
|
||||
|
||||
let flags = 0;
|
||||
for (let [opt, flag] in Iterator({ replace: "REPLACE_HISTORY", hide: "BYPASS_HISTORY" }))
|
||||
if (params[opt])
|
||||
flags |= Ci.nsIWebNavigation["LOAD_FLAGS_" + flag];
|
||||
flags |= params[opt] && Ci.nsIWebNavigation["LOAD_FLAGS_" + flag];
|
||||
|
||||
let where = params.where || dactyl.CURRENT_TAB;
|
||||
let background = ("background" in params) ? params.background : params.where == dactyl.NEW_BACKGROUND_TAB;
|
||||
if ("from" in params && dactyl.has("tabs")) {
|
||||
if (!('where' in params) && options.get("newtab").has("all", params.from))
|
||||
let background = ("background" in params) ? params.background
|
||||
: params.where == dactyl.NEW_BACKGROUND_TAB;
|
||||
|
||||
if (params.from && dactyl.has("tabs")) {
|
||||
if (!params.where && options.get("newtab").has("all", params.from))
|
||||
where = dactyl.NEW_TAB;
|
||||
background = !options.get("activate").has("all", params.from);
|
||||
background ^= !options.get("activate").has("all", params.from);
|
||||
}
|
||||
|
||||
if (urls.length == 0)
|
||||
@@ -829,10 +870,8 @@ const Dactyl = Module("dactyl", {
|
||||
break;
|
||||
|
||||
case dactyl.NEW_TAB:
|
||||
if (!dactyl.has("tabs")) {
|
||||
open(urls, dactyl.NEW_WINDOW);
|
||||
return;
|
||||
}
|
||||
if (!dactyl.has("tabs"))
|
||||
return open(urls, dactyl.NEW_WINDOW);
|
||||
|
||||
options.withContext(function () {
|
||||
options.setPref("browser.tabs.loadInBackground", true);
|
||||
@@ -849,6 +888,9 @@ const Dactyl = Module("dactyl", {
|
||||
}
|
||||
}
|
||||
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)
|
||||
@@ -860,6 +902,7 @@ const Dactyl = Module("dactyl", {
|
||||
|
||||
for (let [, url] in Iterator(urls)) {
|
||||
open(url, where);
|
||||
where = dactyl.NEW_TAB;
|
||||
background = true;
|
||||
}
|
||||
},
|
||||
@@ -1037,12 +1080,10 @@ const Dactyl = Module("dactyl", {
|
||||
services.get("observer").notifyObservers(null, "quit-application-granted", null);
|
||||
|
||||
// enumerate all windows and call shutdown handlers
|
||||
let windows = services.get("windowMediator").getEnumerator(null);
|
||||
while (windows.hasMoreElements()) {
|
||||
let win = windows.getNext();
|
||||
for (let win in iter(services.get("windowMediator").getEnumerator(null)))
|
||||
if (("tryToClose" in win) && !win.tryToClose())
|
||||
return;
|
||||
}
|
||||
|
||||
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
|
||||
* open windows.
|
||||
*/
|
||||
get windows() {
|
||||
let windows = [];
|
||||
let enumerator = services.get("windowMediator").getEnumerator("navigator:browser");
|
||||
while (enumerator.hasMoreElements())
|
||||
windows.push(enumerator.getNext());
|
||||
|
||||
return windows;
|
||||
}
|
||||
get windows() [win for (win in iter(services.get("windowMediator").getEnumerator("navigator:browser")))],
|
||||
|
||||
}, {
|
||||
// initially hide all GUI elements, they are later restored unless the user
|
||||
@@ -1193,26 +1227,27 @@ const Dactyl = Module("dactyl", {
|
||||
this);
|
||||
let class_ = dir.map(function (dir) "html|html > xul|scrollbar[orient=" + dir + "]");
|
||||
|
||||
if (class_.length)
|
||||
styles.addSheet(true, "scrollbar", "*", class_.join(", ") + " { visibility: collapse !important; }", true);
|
||||
else
|
||||
styles.removeSheet(true, "scrollbar");
|
||||
styles.addSheet(true, "scrollbar", "*",
|
||||
class_.length ? class_.join(", ") + " { visibility: collapse !important; }" : "");
|
||||
|
||||
options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2,
|
||||
"See 'guioptions' scrollbar flags.");
|
||||
},
|
||||
validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0)
|
||||
},
|
||||
tab: {
|
||||
feature: "tabs",
|
||||
opts: {
|
||||
n: ["Tab number", highlight.selector("TabNumber")],
|
||||
N: ["Tab number over icon", highlight.selector("TabIconNumber")]
|
||||
},
|
||||
setter: function (opts) {
|
||||
const self = this;
|
||||
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);
|
||||
tabs.tabsBound = Array.some(opts, function (k) k in self.opts);
|
||||
|
||||
styles.addSheet(true, "taboptions", "chrome://*",
|
||||
classes.length ? classes.join(",") + "{ display: none; }" : "");
|
||||
|
||||
tabs.tabBinding.enabled = Array.some(opts, function (k) k in this.opts, this);
|
||||
statusline.updateTabCount();
|
||||
}
|
||||
}
|
||||
@@ -1230,13 +1265,14 @@ const Dactyl = Module("dactyl", {
|
||||
"charlist", config.defaults.guioptions || "", {
|
||||
setter: function (value) {
|
||||
for (let [, group] in Iterator(groups))
|
||||
group.setter(value);
|
||||
if (!group.feature || dactyl.has(group.feature))
|
||||
group.setter(value);
|
||||
return value;
|
||||
},
|
||||
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))]);
|
||||
return util.Array.flatten(opts);
|
||||
return array.flatten(opts);
|
||||
},
|
||||
validator: function (val) Option.validateCompleter.call(this, 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"],
|
||||
"Change the title of the window",
|
||||
"string", config.defaults.titlestring || config.hostApplication,
|
||||
"string", config.defaults.titlestring || config.host,
|
||||
{
|
||||
setter: function (value) {
|
||||
let win = document.documentElement;
|
||||
@@ -1330,13 +1366,13 @@ const Dactyl = Module("dactyl", {
|
||||
{ argCount: "0" });
|
||||
|
||||
commands.add(["dia[log]"],
|
||||
"Open a " + config.name + " dialog",
|
||||
"Open a " + config.appname + " dialog",
|
||||
function (args) {
|
||||
let arg = args[0];
|
||||
let dialog = args[0];
|
||||
|
||||
dactyl.assert(dialog in config.dialogs, "E475: Invalid argument: " + dialog);
|
||||
try {
|
||||
dactyl.assert(args[0] in config.dialogs, "E475: Invalid argument: " + arg);
|
||||
config.dialogs[args[0]][1]();
|
||||
config.dialogs[dialog][1]();
|
||||
}
|
||||
catch (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 = {
|
||||
getInstallForFile: function (file, callback, mimetype) {
|
||||
callback({
|
||||
install: function () {
|
||||
services.get("extensionManager").installItemFromFile(file, "app-profile");
|
||||
}
|
||||
});
|
||||
},
|
||||
getAddonById: function (id, callback) {
|
||||
let addon = id;
|
||||
if (!isobject(addon))
|
||||
@@ -1438,11 +1467,19 @@ const Dactyl = Module("dactyl", {
|
||||
.getItemList(Ci.nsIUpdateItem["TYPE_" + type.toUpperCase()], {})))
|
||||
res.append(this.getAddonById(item));
|
||||
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) {
|
||||
@@ -1467,7 +1504,7 @@ const Dactyl = Module("dactyl", {
|
||||
}, {
|
||||
argCount: "1",
|
||||
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);
|
||||
}
|
||||
});
|
||||
@@ -1483,13 +1520,13 @@ const Dactyl = Module("dactyl", {
|
||||
name: "exte[nable]",
|
||||
description: "Enable an extension",
|
||||
action: function (addon) addon.userDisabled = false,
|
||||
filter: function ({ item: e }) e.userDisabled
|
||||
filter: function ({ item }) item.userDisabled
|
||||
},
|
||||
{
|
||||
name: "extd[isable]",
|
||||
description: "Disable an extension",
|
||||
action: function (addon) addon.userDisabled = true,
|
||||
filter: function ({ item: e }) !e.userDisabled
|
||||
filter: function ({ item }) !item.userDisabled
|
||||
}
|
||||
].forEach(function (command) {
|
||||
commands.add([command.name],
|
||||
@@ -1535,7 +1572,7 @@ const Dactyl = Module("dactyl", {
|
||||
bang: true,
|
||||
completer: function (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
|
||||
});
|
||||
@@ -1543,6 +1580,23 @@ const Dactyl = Module("dactyl", {
|
||||
commands.add(["extens[ions]", "exts"],
|
||||
"List available extensions",
|
||||
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) {
|
||||
if (args[0])
|
||||
extensions = extensions.filter(function (extension) extension.name.indexOf(args[0]) >= 0);
|
||||
@@ -1555,12 +1609,7 @@ const Dactyl = Module("dactyl", {
|
||||
e.version,
|
||||
(e.isActive ? <span highlight="Enabled">enabled</span>
|
||||
: <span highlight="Disabled">disabled</span>) +
|
||||
((e.userDisabled || e.appDisabled) == !e.isActive ? XML() :
|
||||
<> ({e.userDisabled || e.appDisabled
|
||||
? <span highlight="Disabled">disabled</span>
|
||||
: <span highlight="Enabled">enabled</span>}
|
||||
on restart)
|
||||
</>),
|
||||
addonExtra(e),
|
||||
e.description]
|
||||
for ([, e] in Iterator(extensions)))));
|
||||
else if (filter)
|
||||
@@ -1658,7 +1707,7 @@ const Dactyl = Module("dactyl", {
|
||||
});
|
||||
|
||||
commands.add(["res[tart]"],
|
||||
"Force " + config.name + " to restart",
|
||||
"Force " + config.appname + " to restart",
|
||||
function () { dactyl.restart(); },
|
||||
{ argCount: "0" });
|
||||
|
||||
@@ -1810,7 +1859,7 @@ const Dactyl = Module("dactyl", {
|
||||
dactyl.open("about:");
|
||||
else
|
||||
commandline.commandOutput(<>
|
||||
{config.name} {dactyl.version} running on:<br/>{navigator.userAgent}
|
||||
{config.appname} {dactyl.version} running on:<br/>{navigator.userAgent}
|
||||
</>);
|
||||
}, {
|
||||
argCount: "0",
|
||||
@@ -1836,11 +1885,13 @@ const Dactyl = Module("dactyl", {
|
||||
context.title = ["Extension"];
|
||||
context.anchored = false;
|
||||
context.keys = { text: "name", description: "description", icon: "iconURL" },
|
||||
context.incomplete = true;
|
||||
AddonManager.getAddonsByTypes(["extension"], function (addons) {
|
||||
context.incomplete = false;
|
||||
context.completions = addons;
|
||||
});
|
||||
context.generate = function () {
|
||||
context.incomplete = true;
|
||||
AddonManager.getAddonsByTypes(["extension"], function (addons) {
|
||||
context.incomplete = false;
|
||||
context.completions = addons;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
completion.help = function help(context, unchunked) {
|
||||
@@ -1877,7 +1928,7 @@ const Dactyl = Module("dactyl", {
|
||||
|
||||
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;
|
||||
if (commandline) {
|
||||
@@ -1892,7 +1943,7 @@ const Dactyl = Module("dactyl", {
|
||||
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);
|
||||
|
||||
// first time intro message
|
||||
const firstTime = "extensions." + config.name.toLowerCase() + ".firsttime";
|
||||
const firstTime = "extensions." + config.name + ".firsttime";
|
||||
if (options.getPref(firstTime, true)) {
|
||||
util.timeout(function () {
|
||||
dactyl.help();
|
||||
@@ -1904,7 +1955,7 @@ const Dactyl = Module("dactyl", {
|
||||
modes.reset();
|
||||
|
||||
// TODO: we should have some class where all this guioptions stuff fits well
|
||||
Dactyl.hideGUI();
|
||||
// Dactyl.hideGUI();
|
||||
|
||||
if (dactyl.commandLineOptions.preCommands)
|
||||
dactyl.commandLineOptions.preCommands.forEach(function (cmd) {
|
||||
@@ -1914,7 +1965,7 @@ const Dactyl = Module("dactyl", {
|
||||
// finally, read the RC file and source plugins
|
||||
// make sourcing asynchronous, otherwise commands that open new tabs won't work
|
||||
util.timeout(function () {
|
||||
let extensionName = config.name.toUpperCase();
|
||||
let extensionName = config.idname;
|
||||
let init = services.get("environment").get(extensionName + "_INIT");
|
||||
let rcFile = io.getRCFile("~");
|
||||
|
||||
@@ -1951,13 +2002,18 @@ const Dactyl = Module("dactyl", {
|
||||
// after sourcing the initialization files, this function will set
|
||||
// all gui options to their default values, if they have not been
|
||||
// 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.
|
||||
// Probably a wrong value is set into the option,
|
||||
// if current page's encoging is not UTF-8.
|
||||
if (option.name != "encoding" && option.setter)
|
||||
option.value = option.value;
|
||||
}
|
||||
try {
|
||||
if (option.name != "encoding");
|
||||
option.value = option.value;
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.reportError(e);
|
||||
}
|
||||
|
||||
if (dactyl.commandLineOptions.postCommands)
|
||||
dactyl.commandLineOptions.postCommands.forEach(function (cmd) {
|
||||
@@ -1969,7 +2025,7 @@ const Dactyl = Module("dactyl", {
|
||||
}, 0);
|
||||
|
||||
statusline.update();
|
||||
dactyl.log(config.name + " fully initialized", 0);
|
||||
dactyl.log(config.appname + " fully initialized", 0);
|
||||
dactyl.initialized = true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,11 +23,6 @@
|
||||
<script type="application/x-javascript;version=1.8" src="&dactyl.content;dactyl-overlay.js"/>
|
||||
|
||||
<window id="&dactyl.mainWindow;">
|
||||
<stringbundleset id="dactyl-stringbundles">
|
||||
<stringbundle id="dactyl-charset-bundle"
|
||||
src="chrome://global/locale/charsetTitles.properties"/>
|
||||
</stringbundleset>
|
||||
|
||||
<keyset id="mainKeyset">
|
||||
<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();"/>
|
||||
@@ -43,13 +38,13 @@
|
||||
<commandset id="onPentadactylFocus"
|
||||
commandupdater="true"
|
||||
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"
|
||||
commandupdater="true"
|
||||
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 -->
|
||||
<vbox class="dactyl-container" hidden="false" collapsed="true">
|
||||
<iframe id="dactyl-multiline-output" src="chrome://dactyl/content/buffer.xhtml"
|
||||
@@ -81,7 +76,6 @@
|
||||
oninput="window.dactyl ∧ dactyl.modules.commandline.onMultilineInputEvent(event);"
|
||||
onblur="window.dactyl ∧ dactyl.modules.commandline.onMultilineInputEvent(event);"/>
|
||||
</vbox>
|
||||
|
||||
</window>
|
||||
|
||||
<statusbar id="status-bar" dactyl:highlight="StatusLine">
|
||||
@@ -98,7 +92,6 @@
|
||||
<statusbarpanel id="statusbar-display" hidden="true"/>
|
||||
<statusbarpanel id="statusbar-progresspanel" hidden="true"/>
|
||||
</statusbar>
|
||||
|
||||
</overlay>
|
||||
|
||||
<!-- vim: set fdm=marker sw=4 ts=4 et: -->
|
||||
|
||||
@@ -569,7 +569,7 @@ const Editor = Module("editor", {
|
||||
let list = this.getAbbreviations(filter, lhs);
|
||||
|
||||
if (!list.length)
|
||||
dactyl.echomsg("No this._abbreviations found");
|
||||
dactyl.echomsg("No abbreviations found");
|
||||
else if (list.length == 1) {
|
||||
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
|
||||
// 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
|
||||
// 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) 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -1173,7 +1173,7 @@ const Events = Module("events", {
|
||||
function () { document.commandDispatcher.rewindFocus(); });
|
||||
|
||||
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; });
|
||||
|
||||
mappings.add(modes.all,
|
||||
|
||||
@@ -27,20 +27,25 @@ const RangeFinder = Module("rangefinder", {
|
||||
|
||||
let highlighted = this.rangeFind && this.rangeFind.highlighted;
|
||||
let selections = this.rangeFind && this.rangeFind.selections;
|
||||
let regex = false;
|
||||
let matchCase = !(options["ignorecase"] || options["smartcase"] && !/[A-Z]/.test(str));
|
||||
let linksOnly = options["linksearch"];
|
||||
|
||||
str = str.replace(/\\(.|$)/g, function (m, n1) {
|
||||
if (n1 == "l")
|
||||
linksOnly = true;
|
||||
else if (n1 == "L")
|
||||
linksOnly = false;
|
||||
else if (n1 == "c")
|
||||
if (n1 == "c")
|
||||
matchCase = false;
|
||||
else if (n1 == "C")
|
||||
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
|
||||
return n1;
|
||||
return m;
|
||||
return "";
|
||||
});
|
||||
|
||||
@@ -49,12 +54,13 @@ const RangeFinder = Module("rangefinder", {
|
||||
if (!this.rangeFind
|
||||
|| this.rangeFind.window.get() != window
|
||||
|| linksOnly != !!this.rangeFind.elementPath
|
||||
|| regex != this.rangeFind.regex
|
||||
|| matchCase != this.rangeFind.matchCase
|
||||
|| !!backward != this.rangeFind.reverse) {
|
||||
|
||||
if (this.rangeFind)
|
||||
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.selections = selections;
|
||||
}
|
||||
@@ -201,7 +207,7 @@ const RangeFinder = Module("rangefinder", {
|
||||
|
||||
},
|
||||
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
|
||||
options.safeSetPref("accessibility.typeaheadfind", false);
|
||||
|
||||
@@ -262,13 +268,14 @@ const RangeFinder = Module("rangefinder", {
|
||||
* large amounts of data are concerned (e.g., for API documents).
|
||||
*/
|
||||
const RangeFind = Class("RangeFind", {
|
||||
init: function (matchCase, backward, elementPath) {
|
||||
init: function (matchCase, backward, elementPath, regex) {
|
||||
this.window = Cu.getWeakReference(window);
|
||||
this.elementPath = elementPath || null;
|
||||
this.matchCase = Boolean(matchCase);
|
||||
this.reverse = Boolean(backward);
|
||||
|
||||
this.finder = services.create("find");
|
||||
this.finder.caseSensitive = this.matchCase;
|
||||
this.matchCase = Boolean(matchCase);
|
||||
this.regex = Boolean(regex);
|
||||
|
||||
this.ranges = this.makeFrameList(content);
|
||||
|
||||
@@ -281,6 +288,12 @@ const RangeFind = Class("RangeFind", {
|
||||
|
||||
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 selectedRange() {
|
||||
@@ -437,7 +450,7 @@ const RangeFind = Class("RangeFind", {
|
||||
let pageStart = RangeFind.endpoint(pageRange, true);
|
||||
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();
|
||||
if (util.computedStyle(frame.frameElement).visibility == "visible") {
|
||||
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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -13,9 +13,6 @@ function checkFragment() {
|
||||
}
|
||||
|
||||
document.addEventListener("load", checkFragment, true);
|
||||
window.addEventListener("message", function (event) {
|
||||
if (event.data == "fragmentChange")
|
||||
checkFragment();
|
||||
}, true);
|
||||
document.addEventListener("hashChange", checkFragment, true);
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
|
||||
@@ -6,40 +6,27 @@
|
||||
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">
|
||||
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"/>
|
||||
|
||||
<!-- 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 -->
|
||||
|
||||
<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:param name="elem"/>
|
||||
<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:for-each>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$overlaydoc/*[@replace=$tag] and not($elem[@replace])">
|
||||
<xsl:for-each select="$overlaydoc/*[@replace=$tag]">
|
||||
<xsl:when test="ancestor::*/dactyl:overlay/*[@replace=$tag] and not($elem[@replace])">
|
||||
<xsl:for-each select="ancestor::*/dactyl:overlay/*[@replace=$tag]">
|
||||
<xsl:apply-templates select="." mode="overlay-2"/>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
@@ -49,7 +36,7 @@
|
||||
</xsl:for-each>
|
||||
</xsl:otherwise>
|
||||
</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:for-each>
|
||||
</xsl:template>
|
||||
@@ -75,9 +62,32 @@
|
||||
|
||||
<!-- 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">
|
||||
<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>
|
||||
</xsl:template>
|
||||
|
||||
@@ -93,22 +103,39 @@
|
||||
<!-- Root {{{1 -->
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:for-each select="$root/dactyl:document">
|
||||
<html dactyl:highlight="Help">
|
||||
<head>
|
||||
<title><xsl:value-of select="@title"/></title>
|
||||
<script type="text/javascript"
|
||||
src="chrome://dactyl/content/help.js"/>
|
||||
</head>
|
||||
<body dactyl:highlight="HelpBody">
|
||||
<div dactyl:highlight="Logo"/>
|
||||
<xsl:call-template name="parse-tags">
|
||||
<xsl:with-param name="text" select="concat(@name, '.html')"/>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- 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">
|
||||
<head>
|
||||
<title><xsl:value-of select="@title"/></title>
|
||||
<script type="text/javascript" src="chrome://dactyl/content/help.js"/>
|
||||
</head>
|
||||
<body dactyl:highlight="HelpBody">
|
||||
<xsl:apply-templates select="exsl:node-set($doc2)/dactyl:document/node()" mode="help-1"/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Table of Contents {{{1 -->
|
||||
@@ -125,14 +152,14 @@
|
||||
local-name() = $tag and not(preceding::*[local-name() = $lasttag][position() = 1 and not(.=$context)])]"/>
|
||||
|
||||
<xsl:if test="$nodes">
|
||||
<ol dactyl:highlight="HelpOrderedList">
|
||||
<ol level="{$level}" dactyl:highlight="HelpOrderedList">
|
||||
<xsl:for-each select="$nodes">
|
||||
<li>
|
||||
<a>
|
||||
<xsl:if test="@tag">
|
||||
<xsl:attribute name="href"><xsl:value-of select="concat('#', substring-before(concat(@tag, ' '), ' '))"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="node()"/>
|
||||
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||
</a>
|
||||
<xsl:call-template name="toc">
|
||||
<xsl:with-param name="level" select="$level + 1"/>
|
||||
@@ -144,7 +171,7 @@
|
||||
</ol>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<xsl:template match="dactyl:toc" mode="pass-2">
|
||||
<xsl:template match="dactyl:toc" mode="help-2">
|
||||
<xsl:variable name="TOC">
|
||||
<context/>
|
||||
<xsl:for-each
|
||||
@@ -174,36 +201,38 @@
|
||||
|
||||
<!-- Items {{{1 -->
|
||||
|
||||
<xsl:template match="dactyl:strut" mode="pass-2">
|
||||
<xsl:template match="dactyl:strut" mode="help-2">
|
||||
<div style="clear: both"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="dactyl:item" mode="pass-2">
|
||||
<xsl:template match="dactyl:item" mode="help-2">
|
||||
<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)">
|
||||
<hr style="border: 0; height: 0; margin: 0; width: 100%; float: right;"/>
|
||||
<div dactyl:highlight="HelpOptInfo">
|
||||
<xsl:apply-templates select="dactyl:type|dactyl:default"/>
|
||||
<div style="clear: both;"/>
|
||||
</div>
|
||||
<xsl:if test="dactyl:type|dactyl:default">
|
||||
<div dactyl:highlight="HelpOptInfo">
|
||||
<xsl:apply-templates select="dactyl:type|dactyl:default" mode="help-1"/>
|
||||
<div style="clear: both;"/>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="dactyl:description"/>
|
||||
<xsl:apply-templates select="dactyl:description" mode="help-1"/>
|
||||
<div style="clear: both;"/>
|
||||
</div>
|
||||
</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 dactyl:highlight="HelpSpec">
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
<div dactyl:highlight="HelpSpec"><xsl:apply-templates mode="help-1"/></div>
|
||||
</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]"/>
|
||||
<span dactyl:highlight="HelpDefault">(default:<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<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:otherwise>
|
||||
<span>
|
||||
@@ -214,22 +243,32 @@
|
||||
<xsl:when test="$type = 'charlist'">String</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||
</span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>)
|
||||
</span>
|
||||
</xsl:choose>)</span>
|
||||
</xsl:template>
|
||||
|
||||
<!-- 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"/>
|
||||
<xsl:call-template name="parse-tags">
|
||||
<xsl:with-param name="text" select="."/>
|
||||
</xsl:call-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:with-param name="text" select="."/>
|
||||
</xsl:call-template>
|
||||
@@ -249,31 +288,40 @@
|
||||
<xsl:param name="contents" select="text()"/>
|
||||
<xsl:variable name="tag" select="str:tokenize($contents, ' [!')[1]"/>
|
||||
<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:if>
|
||||
<xsl:value-of select="$contents"/>
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dactyl:o" mode="pass-2">
|
||||
<span dactyl:highlight="HelpOption">
|
||||
<xsl:template match="dactyl:o" mode="help-2">
|
||||
<span dactyl:highlight="HelpOpt">
|
||||
<xsl:call-template name="linkify-tag">
|
||||
<xsl:with-param name="contents" select='concat("'", text(), "'")'/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
</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">
|
||||
<xsl:call-template name="linkify-tag"/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
<xsl:template match="dactyl:k" mode="pass-2">
|
||||
<xsl:template match="dactyl:k" mode="help-2">
|
||||
<span dactyl:highlight="HelpKey">
|
||||
<xsl:call-template name="linkify-tag"/>
|
||||
</span>
|
||||
</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">
|
||||
<xsl:call-template name="linkify-tag">
|
||||
<xsl:with-param name="contents" select="concat('<', @name, '>', .)"/>
|
||||
@@ -283,100 +331,117 @@
|
||||
|
||||
<!-- HTML-ish elements {{{1 -->
|
||||
|
||||
<xsl:template match="dactyl:dl" mode="pass-2">
|
||||
<xsl:template match="dactyl:dl" mode="help-2">
|
||||
<dl>
|
||||
<column/>
|
||||
<column/>
|
||||
<xsl:for-each select="dactyl:dt">
|
||||
<tr>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:apply-templates select="following-sibling::dactyl:dd[1]"/>
|
||||
<xsl:apply-templates select="." mode="help-1"/>
|
||||
<xsl:apply-templates select="following-sibling::dactyl:dd[1]" mode="help-1"/>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</dl>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dactyl:link" mode="pass-2">
|
||||
<a href="{@topic}"><xsl:apply-templates select="@*|node()"/></a>
|
||||
<xsl:template match="dactyl:link" mode="help-2">
|
||||
<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 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 |
|
||||
dactyl:dt | dactyl:dd |
|
||||
dactyl:ol | dactyl:ul | dactyl:li |
|
||||
dactyl:h1 | dactyl:h2 | dactyl:h3"
|
||||
mode="pass-2">
|
||||
<xsl:element name="html:{local-name()}">
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
mode="help-2">
|
||||
<xsl:element name="{local-name()}">
|
||||
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dactyl:code" mode="pass-2">
|
||||
<pre dactyl:highlight="HelpCode"><xsl:apply-templates select="@*|node()"/></pre>
|
||||
<xsl:template match="dactyl:code" mode="help-2">
|
||||
<pre dactyl:highlight="HelpCode"><xsl:apply-templates select="@*|node()" mode="help-1"/></pre>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Help elements {{{1 -->
|
||||
|
||||
<xsl:template match="dactyl:a" mode="pass-2">
|
||||
<span dactyl:highlight="HelpArg">{<xsl:apply-templates select="@*|node()"/>}</span>
|
||||
<xsl:template match="dactyl:a" mode="help-2">
|
||||
<span dactyl:highlight="HelpArg">{<xsl:apply-templates select="@*|node()" mode="help-1"/>}</span>
|
||||
</xsl:template>
|
||||
<xsl:template match="dactyl:oa" mode="pass-2">
|
||||
<span dactyl:highlight="HelpOptionalArg">[<xsl:apply-templates select="@*|node()"/>]</span>
|
||||
<xsl:template match="dactyl:oa" mode="help-2">
|
||||
<span dactyl:highlight="HelpOptionalArg">[<xsl:apply-templates select="@*|node()" mode="help-1"/>]</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dactyl:note" mode="pass-2">
|
||||
<xsl:template match="dactyl:note" mode="help-2">
|
||||
<p style="clear: both;">
|
||||
<xsl:apply-templates select="@*"/>
|
||||
<xsl:apply-templates select="@*" mode="help-1"/>
|
||||
<div style="clear: both;"/>
|
||||
<span dactyl:highlight="HelpNote">Note:</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="node()"/>
|
||||
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||
</p>
|
||||
</xsl:template>
|
||||
<xsl:template match="dactyl:warning" mode="pass-2">
|
||||
<xsl:template match="dactyl:warning" mode="help-2">
|
||||
<p style="clear: both;">
|
||||
<xsl:apply-templates select="@*"/>
|
||||
<xsl:apply-templates select="@*" mode="help-1"/>
|
||||
<div style="clear: both;"/>
|
||||
<span dactyl:highlight="HelpWarning">Warning:</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="node()"/>
|
||||
<xsl:apply-templates select="node()" mode="help-1"/>
|
||||
</p>
|
||||
</xsl:template>
|
||||
<xsl:template match="dactyl:default" mode="pass-2">
|
||||
<span dactyl:highlight="HelpDefault">
|
||||
(default:<xsl:text> </xsl:text><xsl:apply-templates select="@*|node()"/>)
|
||||
</span>
|
||||
<xsl:template match="dactyl:default" mode="help-2">
|
||||
<span dactyl:highlight="HelpDefault">(default:<xsl:text> </xsl:text><xsl:apply-templates select="@*|node()" mode="help-1"/>)</span>
|
||||
</xsl:template>
|
||||
|
||||
<!-- 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">
|
||||
<xsl:variable name="tag" select="str:tokenize(text(), ' [!')[1]"/>
|
||||
<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:if>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:apply-templates mode="help-1"/>
|
||||
</a>
|
||||
</span>
|
||||
</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>
|
||||
<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: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>
|
||||
</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>
|
||||
<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:apply-templates select="@*|node()"/>
|
||||
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||
</span>
|
||||
</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 -->
|
||||
|
||||
@@ -400,59 +465,133 @@
|
||||
</span>
|
||||
</div>
|
||||
</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:with-param name="label" select="'Author'"/>
|
||||
<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:call-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:with-param name="label" select="'Author'"/>
|
||||
</xsl:call-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:with-param name="label" select="'License'"/>
|
||||
</xsl:call-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:with-param name="label" select="'Plugin'"/>
|
||||
<xsl:with-param name="nodes">
|
||||
<span><xsl:value-of select="@name"/></span>
|
||||
</xsl:with-param>
|
||||
</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>
|
||||
|
||||
<!-- Special Element Templates {{{1 -->
|
||||
|
||||
<xsl:template match="dactyl:logo">
|
||||
<xsl:template match="dactyl:logo" mode="help-1">
|
||||
<span dactyl:highlight="Logo"/>
|
||||
</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 -->
|
||||
|
||||
<xsl:template match="@*|node()" mode="pass-2">
|
||||
<xsl:template match="@*|node()" mode="help-2">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
<xsl:apply-templates select="@*|node()" mode="help-1"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:apply-templates select="." mode="pass-2"/>
|
||||
<xsl:template match="@*|node()" mode="help-1">
|
||||
<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:stylesheet>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -36,26 +36,26 @@ const Hints = Module("hints", {
|
||||
function images() util.makeXPath(["img"]);
|
||||
|
||||
this._hintModes = {
|
||||
";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended),
|
||||
"?": Mode("Show information for hint", function (elem) buffer.showElementInfo(elem), extended),
|
||||
";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended),
|
||||
"?": Mode("Show information for hint", function (elem) buffer.showElementInfo(elem), extended),
|
||||
s: Mode("Save hint", function (elem) buffer.saveLink(elem, true)),
|
||||
a: Mode("Save hint with prompt", function (elem) buffer.saveLink(elem, false)),
|
||||
f: Mode("Focus frame", function (elem) elem.ownerDocument.defaultView.focus(), function () ["body"]),
|
||||
o: Mode("Follow hint", function (elem) buffer.followLink(elem, dactyl.CURRENT_TAB)),
|
||||
t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, dactyl.NEW_TAB)),
|
||||
b: Mode("Follow hint in a background tab", function (elem) buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB)),
|
||||
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, dactyl.NEW_WINDOW), extended),
|
||||
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, dactyl.NEW_WINDOW), extended),
|
||||
F: Mode("Open multiple hints in tabs", function (elem) { buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB); hints.show("F") }),
|
||||
O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
||||
T: Mode("Generate a ':tabopen URL' using hint", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
||||
W: Mode("Generate a ':winopen URL' using hint", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
||||
v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended),
|
||||
V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended),
|
||||
v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended),
|
||||
V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended),
|
||||
y: Mode("Yank hint location", function (elem, loc) dactyl.clipboardWrite(loc, true)),
|
||||
Y: Mode("Yank hint description", function (elem) dactyl.clipboardWrite(elem.textContent || "", true), extended),
|
||||
c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended),
|
||||
i: Mode("Show image", function (elem) dactyl.open(elem.src), images),
|
||||
I: Mode("Show image in a new tab", function (elem) dactyl.open(elem.src, dactyl.NEW_TAB), images)
|
||||
c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended),
|
||||
i: Mode("Show image", function (elem) dactyl.open(elem.src), images),
|
||||
I: Mode("Show image in a new tab", function (elem) dactyl.open(elem.src, dactyl.NEW_TAB), images)
|
||||
};
|
||||
},
|
||||
|
||||
@@ -351,7 +351,7 @@ const Hints = Module("hints", {
|
||||
|
||||
if (hint.text == "" && hint.elem.firstChild && hint.elem.firstChild instanceof HTMLImageElement) {
|
||||
if (!hint.imgSpan) {
|
||||
var rect = hint.elem.firstChild.getBoundingClientRect();
|
||||
let rect = hint.elem.firstChild.getBoundingClientRect();
|
||||
if (!rect)
|
||||
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."],
|
||||
["firstletters", "Behaves like wordstartswith, but all groups much match a sequence of words."],
|
||||
["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) 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -45,11 +45,12 @@ const History = Module("history", {
|
||||
let sh = window.getWebNavigation().sessionHistory;
|
||||
let obj = [];
|
||||
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)) {
|
||||
obj[i] = { index: i, __proto__: sh.getEntryAtIndex(i, false) };
|
||||
util.memoize(obj[i], "icon",
|
||||
function (obj) services.get("favicon").getFaviconImageForPage(obj.URI).spec);
|
||||
obj[i] = update(Object.create(sh.getEntryAtIndex(i, false)),
|
||||
{ index: i });
|
||||
memoize(obj[i], "icon",
|
||||
function () services.get("favicon").getFaviconImageForPage(this.URI).spec);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
@@ -64,7 +65,10 @@ const History = Module("history", {
|
||||
dactyl.beep();
|
||||
else {
|
||||
let index = Math.constrain(current + steps, start, end);
|
||||
window.getWebNavigation().gotoIndex(index);
|
||||
try {
|
||||
window.getWebNavigation().gotoIndex(index);
|
||||
}
|
||||
catch (e) {} // We get NS_ERROR_FILE_NOT_FOUND if files in history don't exist
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
@@ -19,16 +19,15 @@ function Script(file) {
|
||||
}
|
||||
self = { __proto__: plugins };
|
||||
plugins.contexts[file.path] = self;
|
||||
plugins[file.path] = self;
|
||||
self.NAME = file.leafName.replace(/\..*/, "").replace(/-([a-z])/g, function (m, n1) n1.toUpperCase());
|
||||
self.PATH = file.path;
|
||||
self.__context__ = self;
|
||||
self.__proto__ = plugins;
|
||||
|
||||
// This belongs elsewhere
|
||||
for (let [, dir] in Iterator(io.getRuntimeDirectories("plugin"))) {
|
||||
if (dir.contains(file, false))
|
||||
plugins[self.NAME] = self;
|
||||
}
|
||||
if (io.getRuntimeDirectories("plugins").some(
|
||||
function (dir) dir.contains(file, false)))
|
||||
plugins[self.NAME] = self;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -54,7 +53,8 @@ const IO = Module("io", {
|
||||
let file = download.targetFile.path;
|
||||
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 });
|
||||
}
|
||||
},
|
||||
@@ -179,8 +179,8 @@ const IO = Module("io", {
|
||||
getRCFile: function (dir, always) {
|
||||
dir = dir || "~";
|
||||
|
||||
let rcFile1 = File.joinPaths(dir, "." + config.name.toLowerCase() + "rc");
|
||||
let rcFile2 = File.joinPaths(dir, "_" + config.name.toLowerCase() + "rc");
|
||||
let rcFile1 = File.joinPaths(dir, "." + config.name + "rc");
|
||||
let rcFile2 = File.joinPaths(dir, "_" + config.name + "rc");
|
||||
|
||||
if (dactyl.has("Win32"))
|
||||
[rcFile1, rcFile2] = [rcFile2, rcFile1];
|
||||
@@ -346,6 +346,8 @@ lookup:
|
||||
dactyl.helpInitialized = false;
|
||||
}
|
||||
catch (e) {
|
||||
if (isstring(e))
|
||||
e = { message: e };
|
||||
let err = new Error();
|
||||
for (let [k, v] in Iterator(e))
|
||||
err[k] = v;
|
||||
@@ -508,10 +510,10 @@ lookup:
|
||||
* variable.
|
||||
*/
|
||||
get runtimePath() {
|
||||
const rtpvar = config.name.toUpperCase() + "_RUNTIME";
|
||||
const rtpvar = config.idname + "_RUNTIME";
|
||||
let rtp = services.get("environment").get(rtpvar);
|
||||
if (!rtp) {
|
||||
rtp = "~/" + (dactyl.has("Win32") ? "" : ".") + config.name.toLowerCase();
|
||||
rtp = "~/" + (dactyl.has("Win32") ? "" : ".") + config.name;
|
||||
services.get("environment").set(rtpvar, rtp);
|
||||
}
|
||||
return rtp;
|
||||
@@ -582,7 +584,7 @@ lookup:
|
||||
{ argCount: "0" });
|
||||
|
||||
// "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",
|
||||
function (args) {
|
||||
dactyl.assert(args.length <= 1, "E172: Only one file name allowed");
|
||||
@@ -595,7 +597,7 @@ lookup:
|
||||
|
||||
// TODO: Use a set/specifiable list here:
|
||||
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
|
||||
lines.unshift('"' + dactyl.version + "\n");
|
||||
@@ -608,7 +610,7 @@ lookup:
|
||||
arguments: [filename + ".local"]
|
||||
}));
|
||||
|
||||
lines.push("\n\" vim: set ft=" + config.name.toLowerCase() + ":");
|
||||
lines.push("\n\" vim: set ft=" + config.name + ":");
|
||||
|
||||
try {
|
||||
file.write(lines.join("\n"));
|
||||
@@ -669,9 +671,13 @@ lookup:
|
||||
|
||||
// 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
|
||||
arg = arg.replace(/(\\)*!/g,
|
||||
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
||||
);
|
||||
|
||||
// This is an asinine and irritating feature when we have searchable
|
||||
// command-line history. --Kris
|
||||
if (options["banghist"])
|
||||
arg = arg.replace(/(\\)*!/g,
|
||||
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
|
||||
);
|
||||
|
||||
io._lastRunCommand = arg;
|
||||
|
||||
@@ -691,19 +697,20 @@ lookup:
|
||||
completion: function () {
|
||||
completion.charset = function (context) {
|
||||
context.anchored = false;
|
||||
context.generate = function () {
|
||||
let names = util.Array(
|
||||
"more1 more2 more3 more4 more5 unicode".split(" ").map(function (key)
|
||||
options.getPref("intl.charsetmenu.browser." + key).split(', '))
|
||||
).flatten().uniq();
|
||||
let bundle = document.getElementById("dactyl-charset-bundle");
|
||||
return names.map(function (name) [name, bundle.getString(name.toLowerCase() + ".title")]);
|
||||
let bundle = services.get("stringBundle").createBundle(
|
||||
"chrome://global/locale/charsetTitles.properties");
|
||||
context.keys = {
|
||||
text: util.identity,
|
||||
description: function (charset) bundle.GetStringFromName(charset.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) {
|
||||
this.file(context, full);
|
||||
context.filters.push(function ({ item: f }) f.isDirectory());
|
||||
context.filters.push(function ({ item }) item.isDirectory());
|
||||
};
|
||||
|
||||
completion.environment = function environment(context) {
|
||||
@@ -737,7 +744,7 @@ lookup:
|
||||
|
||||
if (options["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;
|
||||
@@ -765,7 +772,7 @@ lookup:
|
||||
}
|
||||
}
|
||||
|
||||
return util.Array.flatten(commands);
|
||||
return array.flatten(commands);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -795,6 +802,10 @@ lookup:
|
||||
shellcmdflag = "-c";
|
||||
}
|
||||
|
||||
options.add(["banghist", "bh"],
|
||||
"Replace occurances of ! with the previous command when executing external commands",
|
||||
"banghist", true);
|
||||
|
||||
options.add(["fileencoding", "fenc"],
|
||||
"Sets the character encoding of read and written files",
|
||||
"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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -41,11 +41,13 @@ const JavaScript = Module("javascript", {
|
||||
let seen = {};
|
||||
for (let key in properties(obj, !toplevel)) {
|
||||
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))
|
||||
if (!set.has(seen, key))
|
||||
yield [key, this.getKey(obj, key)];
|
||||
if (key in obj && !set.has(seen, key))
|
||||
yield key;
|
||||
},
|
||||
|
||||
objectKeys: function objectKeys(obj, toplevel) {
|
||||
@@ -110,15 +112,14 @@ const JavaScript = Module("javascript", {
|
||||
},
|
||||
|
||||
_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)
|
||||
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
|
||||
// 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.
|
||||
@@ -139,11 +140,13 @@ const JavaScript = Module("javascript", {
|
||||
|
||||
// Reuse the old stack.
|
||||
if (this._str && filter.substr(0, this._str.length) == this._str) {
|
||||
this.context.highlight(0, 0, "FIND");
|
||||
this._i = this._str.length;
|
||||
if (this.popStatement)
|
||||
this._top.statements.pop();
|
||||
}
|
||||
else {
|
||||
this.context.highlight();
|
||||
this._stack = [];
|
||||
this._functions = [];
|
||||
this._push("#root");
|
||||
@@ -239,7 +242,7 @@ const JavaScript = Module("javascript", {
|
||||
_getObj: function (frame, stop) {
|
||||
let statement = this._get(frame, 0, "statements") || 0; // Current statement.
|
||||
let prev = statement;
|
||||
let obj;
|
||||
let obj = null;
|
||||
let cacheKey;
|
||||
for (let [, dot] in Iterator(this._get(frame).dots.concat(stop))) {
|
||||
if (dot < statement)
|
||||
@@ -285,19 +288,19 @@ const JavaScript = Module("javascript", {
|
||||
return [dot + 1 + space.length, obj, key];
|
||||
},
|
||||
|
||||
_fill: function (context, obj, name, compl, anchored, key, last, offset) {
|
||||
context.title = [name];
|
||||
context.anchored = anchored;
|
||||
context.filter = key;
|
||||
_fill: function (context, args) {
|
||||
context.title = [args.name];
|
||||
context.anchored = args.anchored;
|
||||
context.filter = args.filter;
|
||||
context.itemCache = context.parent.itemCache;
|
||||
context.key = name + last;
|
||||
context.key = args.name + args.last;
|
||||
|
||||
if (last != null)
|
||||
context.quote = [last, function (text) util.escapeString(text.substr(offset), ""), last];
|
||||
if (args.last != null)
|
||||
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
|
||||
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) {
|
||||
@@ -309,7 +312,10 @@ const JavaScript = Module("javascript", {
|
||||
let orig = compl;
|
||||
if (!compl) {
|
||||
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:
|
||||
// Numbers are sorted as numbers, rather than strings, and appear first.
|
||||
// Constants are unsorted, and appear before other non-null strings.
|
||||
@@ -321,14 +327,15 @@ const JavaScript = Module("javascript", {
|
||||
return a.key - b.key;
|
||||
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) {
|
||||
let key = item[0];
|
||||
if (!isNaN(key))
|
||||
return parseInt(key);
|
||||
else if (/^[A-Z_][A-Z0-9_]*$/.test(key))
|
||||
if (/^[A-Z_][A-Z0-9_]*$/.test(key))
|
||||
return ""
|
||||
return key;
|
||||
return item;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -339,37 +346,51 @@ const JavaScript = Module("javascript", {
|
||||
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.
|
||||
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,
|
||||
obj[0], obj[1], compl,
|
||||
true, filter, last, key.length);
|
||||
}
|
||||
update(args, {
|
||||
obj: obj[0],
|
||||
name: obj[1],
|
||||
}));
|
||||
|
||||
if (orig)
|
||||
return;
|
||||
|
||||
for (let [, obj] in Iterator(objects)) {
|
||||
let name = obj[1] + " (prototypes)";
|
||||
this.context.fork(name, this._top.offset, this, this._fill,
|
||||
obj[0], name, function (a, b) compl(a, b, true),
|
||||
true, filter, last, key.length);
|
||||
}
|
||||
for (let [, obj] in Iterator(objects))
|
||||
this.context.fork(obj[1] + "/prototypes", this._top.offset, this, this._fill,
|
||||
update(args, {
|
||||
obj: obj[0],
|
||||
name: obj[1] + " (prototypes)",
|
||||
completer: function (a, b) compl(a, b, true)
|
||||
}));
|
||||
|
||||
for (let [, obj] in Iterator(objects)) {
|
||||
let name = obj[1] + " (substrings)";
|
||||
this.context.fork(name, this._top.offset, this, this._fill,
|
||||
obj[0], name, compl,
|
||||
false, filter, last, key.length);
|
||||
}
|
||||
for (let [, obj] in Iterator(objects))
|
||||
this.context.fork(obj[1] + "/substrings", this._top.offset, this, this._fill,
|
||||
update(args, {
|
||||
obj: obj[0],
|
||||
name: obj[1] + " (substrings)",
|
||||
anchored: false,
|
||||
completer: compl
|
||||
}));
|
||||
|
||||
for (let [, obj] in Iterator(objects)) {
|
||||
let name = obj[1] + " (prototype substrings)";
|
||||
this.context.fork(name, this._top.offset, this, this._fill,
|
||||
obj[0], name, function (a, b) compl(a, b, true),
|
||||
false, filter, last, key.length);
|
||||
}
|
||||
for (let [, obj] in Iterator(objects))
|
||||
this.context.fork(obj[1] + "/prototypes/substrings", this._top.offset, this, this._fill,
|
||||
update(args, {
|
||||
obj: obj[0],
|
||||
name: obj[1] + " (prototype substrings)",
|
||||
anchored: false,
|
||||
completer: function (a, b) compl(a, b, true)
|
||||
}));
|
||||
},
|
||||
|
||||
_getKey: function () {
|
||||
@@ -398,7 +419,7 @@ const JavaScript = Module("javascript", {
|
||||
}
|
||||
|
||||
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.
|
||||
|
||||
@@ -478,7 +499,7 @@ const JavaScript = Module("javascript", {
|
||||
for (let [i, idx] in Iterator(this._get(-2).comma)) {
|
||||
let arg = this._str.substring(prev + 1, idx);
|
||||
prev = idx;
|
||||
util.memoize(args, i, function () self.evalled(arg));
|
||||
memoize(args, i, function () self.evalled(arg));
|
||||
}
|
||||
let key = this._getKey();
|
||||
args.push(key + string);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -383,7 +383,7 @@ const Mappings = Module("mappings", {
|
||||
let [lhs, rhs] = args;
|
||||
|
||||
if (!rhs) // list the mapping
|
||||
mappings.list(modes, this._expandLeader(lhs));
|
||||
mappings.list(modes, mappings._expandLeader(lhs));
|
||||
else {
|
||||
// this matches Vim's behaviour
|
||||
if (/^<Nop>$/i.test(rhs))
|
||||
@@ -467,7 +467,7 @@ const Mappings = Module("mappings", {
|
||||
addMapCommands("", [modes.NORMAL, modes.VISUAL], "");
|
||||
|
||||
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,
|
||||
[m.mask for (m in modes.mainModes) if (m.char == mode.char)],
|
||||
[mode.disp.toLowerCase()]);
|
||||
@@ -489,8 +489,7 @@ const Mappings = Module("mappings", {
|
||||
null,
|
||||
function (context, obj, args) {
|
||||
let mode = args[0];
|
||||
return util.Array.flatten(
|
||||
[
|
||||
return array.flatten([
|
||||
[[name, map.description] for ([i, name] in Iterator(map.names))]
|
||||
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) 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
|
||||
// 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 });
|
||||
|
||||
try {
|
||||
if(isarray(Iterator(this._localMarks).next()));
|
||||
if(isarray(Iterator(this._localMarks).next()[1]))
|
||||
this._localMarks.clear();
|
||||
}
|
||||
catch(e) {}
|
||||
@@ -31,7 +31,7 @@ const Marks = Module("marks", {
|
||||
*/
|
||||
get all() {
|
||||
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]));
|
||||
},
|
||||
@@ -54,9 +54,7 @@ const Marks = Module("marks", {
|
||||
let win = window.content;
|
||||
let doc = win.document;
|
||||
|
||||
if (!doc.body)
|
||||
return;
|
||||
if (doc.body instanceof HTMLFrameSetElement) {
|
||||
if (doc.body && doc.body instanceof HTMLFrameSetElement) {
|
||||
if (!silent)
|
||||
dactyl.echoerr("Marks support for frameset pages not implemented yet");
|
||||
return;
|
||||
@@ -72,8 +70,8 @@ const Marks = Module("marks", {
|
||||
dactyl.log("Adding URL mark: " + Marks.markToString(mark, res), 5);
|
||||
}
|
||||
else if (Marks.isLocalMark(mark)) {
|
||||
let marks = this._localMarks.get(doc.URL, {});
|
||||
marks[mark] = { location: doc.URL, position: position, timestamp: Date.now()*1000 };
|
||||
let marks = this._localMarks.get(doc.documentURI, {});
|
||||
marks[mark] = { location: doc.documentURI, position: position, timestamp: Date.now()*1000 };
|
||||
this._localMarks.changed();
|
||||
if (!silent)
|
||||
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
|
||||
// deletes any valid marks in the arg list, up to the first
|
||||
// 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
|
||||
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) 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -120,7 +120,7 @@ const Modes = Module("modes", {
|
||||
|
||||
NONE: 0,
|
||||
|
||||
__iterator__: function () util.Array.itervalues(this.all),
|
||||
__iterator__: function () array.itervalues(this.all),
|
||||
|
||||
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)],
|
||||
|
||||
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: 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -15,7 +15,7 @@ const ModuleBase = Class("ModuleBase", {
|
||||
*/
|
||||
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);
|
||||
|
||||
Module.list.forEach(function(module) {
|
||||
modules.__defineGetter__(module.name, function() {
|
||||
delete modules[module.name];
|
||||
return load(module.name, null, Components.stack.caller);
|
||||
modules.__defineGetter__(module.classname, function() {
|
||||
delete modules[module.classname];
|
||||
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 deferredInit = { load: [] };
|
||||
const seen = set();
|
||||
const loaded = set(["init"]);
|
||||
modules.loaded = loaded;
|
||||
|
||||
function init(module) {
|
||||
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)) {
|
||||
if (mod in loaded)
|
||||
init(func)();
|
||||
init(func, mod)();
|
||||
else {
|
||||
deferredInit[mod] = deferredInit[mod] || [];
|
||||
deferredInit[mod].push(init(func, mod));
|
||||
@@ -112,34 +115,35 @@ window.addEventListener("load", function onLoad() {
|
||||
}
|
||||
|
||||
try {
|
||||
if (module.name in loaded)
|
||||
if (module.classname in loaded)
|
||||
return;
|
||||
if (module.name in seen)
|
||||
if (module.classname in seen)
|
||||
throw Error("Module dependency loop.");
|
||||
set.add(seen, module.name);
|
||||
set.add(seen, module.classname);
|
||||
|
||||
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)
|
||||
defmodule.loadLog.push(" from: " + frame.filename + ":" + frame.lineNumber);
|
||||
|
||||
delete modules[module.name];
|
||||
modules[module.name] = defmodule.time(module.name, "init", module);
|
||||
delete modules[module.classname];
|
||||
modules[module.classname] = defmodule.time(module.classname, "init", module);
|
||||
|
||||
init(modules[module.name]);
|
||||
for (let [, fn] in iter(deferredInit[module.name] || []))
|
||||
init(modules[module.classname]);
|
||||
for (let [, fn] in iter(deferredInit[module.classname] || []))
|
||||
fn();
|
||||
}
|
||||
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);
|
||||
deferredInit["load"].forEach(call);
|
||||
modules.times = update({}, defmodule.times);
|
||||
|
||||
dump("Loaded in " + (Date.now() - start) + "ms");
|
||||
}, false);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -23,6 +23,8 @@
|
||||
* completer - see {@link Option#completer}
|
||||
* domains - see {@link Option#domains}
|
||||
* getter - see {@link Option#getter}
|
||||
* initialValue - Initial value is loaded from getter
|
||||
* persist - see {@link Option#persist}
|
||||
* privateData - see {@link Option#privateData}
|
||||
* scope - see {@link Option#scope}
|
||||
* setter - see {@link Option#setter}
|
||||
@@ -56,9 +58,9 @@ const Option = Class("Option", {
|
||||
|
||||
// add no{option} variant of boolean {option} to this.names
|
||||
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);
|
||||
},
|
||||
|
||||
@@ -295,6 +297,13 @@ const Option = Class("Option", {
|
||||
*/
|
||||
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
|
||||
* option may contain private data which should be purged from
|
||||
@@ -363,18 +372,23 @@ const Option = Class("Option", {
|
||||
let re = RegExp(val);
|
||||
re.bang = bang;
|
||||
re.result = arguments.length == 2 ? result : !bang;
|
||||
re.toString = function () Option.unparseRegex(this);
|
||||
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: {
|
||||
stringlist: function (k) this.values.indexOf(k) >= 0,
|
||||
get charlist() this.stringlist,
|
||||
|
||||
regexlist: function (k) {
|
||||
for (let re in values(this.values))
|
||||
if (re.test(k))
|
||||
return re.result;
|
||||
return null;
|
||||
}
|
||||
},
|
||||
get regexmap() this.regexlist
|
||||
},
|
||||
|
||||
joinValues: {
|
||||
@@ -382,6 +396,7 @@ const Option = Class("Option", {
|
||||
stringlist: function (vals) vals.join(","),
|
||||
stringmap: function (vals) [k + ":" + v for ([k, v] in Iterator(vals))].join(","),
|
||||
regexlist: function (vals) vals.map(Option.unparseRegex).join(","),
|
||||
get regexmap() this.regexlist
|
||||
},
|
||||
|
||||
parseValues: {
|
||||
@@ -430,10 +445,10 @@ const Option = Class("Option", {
|
||||
|
||||
switch (operator) {
|
||||
case "+":
|
||||
return util.Array.uniq(Array.concat(orig, values), true);
|
||||
return array.uniq(Array.concat(orig, values), true);
|
||||
case "^":
|
||||
// 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 "-":
|
||||
return orig.filter(function (item) values.indexOf(item) == -1);
|
||||
case "=":
|
||||
@@ -452,10 +467,10 @@ const Option = Class("Option", {
|
||||
values = Array.concat(values);
|
||||
switch (operator) {
|
||||
case "+":
|
||||
return util.Array.uniq(Array.concat(this.values, values), true);
|
||||
return array.uniq(Array.concat(this.values, values), true);
|
||||
case "^":
|
||||
// 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 "-":
|
||||
return this.values.filter(function (item) values.indexOf(item) == -1);
|
||||
case "=":
|
||||
@@ -468,6 +483,9 @@ const Option = Class("Option", {
|
||||
}
|
||||
return null;
|
||||
},
|
||||
get charlist() this.stringlist,
|
||||
get regexlist() this.stringlist,
|
||||
get regexmap() this.stringlist,
|
||||
|
||||
string: function (operator, values, scope, invert) {
|
||||
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
|
||||
*/
|
||||
const Options = Module("options", {
|
||||
init: function () {
|
||||
this._optionHash = {};
|
||||
this.needInit = [];
|
||||
this._options = [];
|
||||
this._optionMap = {};
|
||||
this._prefContexts = [];
|
||||
|
||||
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.
|
||||
let opt = options.get(option);
|
||||
if (event == "change" && opt)
|
||||
opt.setValues(opt.globalValue, Option.SCOPE_GLOBAL, true);
|
||||
}
|
||||
}, window);
|
||||
|
||||
storage.newMap("options", { store: false });
|
||||
storage.addObserver("options", optionObserver, window);
|
||||
|
||||
this.prefObserver.register();
|
||||
this._branch = services.get("pref").getBranch("").QueryInterface(Ci.nsIPrefBranch2);
|
||||
this._branch.addObserver("", this, false);
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
this.prefObserver.unregister();
|
||||
this._branch.removeObserver("", this);
|
||||
},
|
||||
|
||||
/** @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.addObserver("", this, false);
|
||||
},
|
||||
|
||||
unregister: function () {
|
||||
if (this._branch)
|
||||
this._branch.removeObserver("", this);
|
||||
},
|
||||
|
||||
observe: function (subject, topic, data) {
|
||||
if (topic != "nsPref:changed")
|
||||
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)
|
||||
// data is the name of the pref that's been changed (relative to subject)
|
||||
switch (data) {
|
||||
@@ -588,7 +582,7 @@ const Options = Module("options", {
|
||||
dactyl.mode = value ? modes.CARET : modes.NORMAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -601,29 +595,28 @@ const Options = Module("options", {
|
||||
* @param {Object} extra An optional extra configuration hash (see
|
||||
* {@link Map#extraInfo}).
|
||||
* @optional
|
||||
* @returns {boolean} Whether the option was created.
|
||||
*/
|
||||
add: function (names, description, type, defaultValue, extraInfo) {
|
||||
if (!extraInfo)
|
||||
extraInfo = {};
|
||||
|
||||
let option = Option(names, description, type, defaultValue, extraInfo);
|
||||
|
||||
if (!option)
|
||||
return false;
|
||||
|
||||
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;
|
||||
let name = names[0];
|
||||
if (name in this._optionMap) {
|
||||
dactyl.log("Warning: " + name.quote() + " already exists: replacing existing option.", 1);
|
||||
this.remove(name);
|
||||
}
|
||||
|
||||
// quickly access options with options["wildmode"]:
|
||||
this.__defineGetter__(option.name, function () option.value);
|
||||
this.__defineSetter__(option.name, function (value) { option.value = value; });
|
||||
let closure = function () options._optionMap[name];
|
||||
memoize(this._options, this._options.length, closure);
|
||||
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;
|
||||
return true;
|
||||
// quickly access options with options["wildmode"]:
|
||||
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)
|
||||
scope = Option.SCOPE_BOTH;
|
||||
|
||||
if (name in this._optionHash)
|
||||
return (this._optionHash[name].scope & scope) && this._optionHash[name];
|
||||
|
||||
for (let opt in values(this._optionHash))
|
||||
if (opt.hasName(name))
|
||||
return (opt.scope & scope) && opt;
|
||||
if (name in this._optionMap && (this._optionMap[name].scope & scope))
|
||||
return this._optionMap[name];
|
||||
return null;
|
||||
},
|
||||
|
||||
@@ -734,7 +723,7 @@ const Options = Module("options", {
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
[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.onlyNonDefault = false; // used for :set to print non-default options
|
||||
@@ -760,8 +749,13 @@ const Options = Module("options", {
|
||||
ret.onlyNonDefault = true;
|
||||
}
|
||||
|
||||
if (matches)
|
||||
if (matches) {
|
||||
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.postfix = postfix;
|
||||
@@ -795,10 +789,10 @@ const Options = Module("options", {
|
||||
* any of the options's names.
|
||||
*/
|
||||
remove: function (name) {
|
||||
for each (let option in this._optionHash) {
|
||||
if (option.hasName(name))
|
||||
delete this._optionHash[option.name];
|
||||
}
|
||||
let opt = this.get(name);
|
||||
for (let name in values(opt.names))
|
||||
delete this._optionMap[name];
|
||||
this._options = this._options.filter(function (o) o != opt);
|
||||
},
|
||||
|
||||
/** @property {Object} The options store. */
|
||||
@@ -1023,7 +1017,7 @@ const Options = Module("options", {
|
||||
}
|
||||
|
||||
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) {
|
||||
if (resp == "yes")
|
||||
for (let pref in values(options.allPrefs()))
|
||||
@@ -1037,20 +1031,14 @@ const Options = Module("options", {
|
||||
else if (invertBoolean)
|
||||
options.invertPref(name);
|
||||
else if (valueGiven) {
|
||||
switch (value) {
|
||||
case undefined:
|
||||
if (value == undefined)
|
||||
value = "";
|
||||
break;
|
||||
case "true":
|
||||
else if (value == "true")
|
||||
value = true;
|
||||
break;
|
||||
case "false":
|
||||
value = false;
|
||||
break;
|
||||
default:
|
||||
if (/^\d+$/.test(value))
|
||||
value = parseInt(value, 10);
|
||||
}
|
||||
else if (value == "false")
|
||||
value = true;
|
||||
else if (/^\d+$/.test(value))
|
||||
value = parseInt(value, 10);
|
||||
options.setPref(name, value);
|
||||
}
|
||||
else
|
||||
@@ -1123,7 +1111,7 @@ const Options = Module("options", {
|
||||
context.completions = [
|
||||
[options._loadPreference(filter, null, false), "Current Value"],
|
||||
[options._loadPreference(filter, null, true), "Default Value"]
|
||||
].filter(function ([k]) k != null);
|
||||
].filter(function ([k]) k != null && k.length < 200);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1134,15 +1122,10 @@ const Options = Module("options", {
|
||||
let prefix = opt.prefix;
|
||||
|
||||
if (context.filter.indexOf("=") == -1) {
|
||||
if (prefix)
|
||||
context.filters.push(function ({ item: opt }) opt.type == "boolean" || prefix == "inv" && opt.values instanceof Array);
|
||||
return completion.option(context, opt.scope);
|
||||
if (false && prefix)
|
||||
context.filters.push(function ({ item }) item.type == "boolean" || prefix == "inv" && isarray(item.values));
|
||||
return completion.option(context, opt.scope, prefix);
|
||||
}
|
||||
else if (prefix == "no")
|
||||
return null;
|
||||
|
||||
if (prefix)
|
||||
context.advance(prefix.length);
|
||||
|
||||
let option = opt.option;
|
||||
context.advance(context.filter.indexOf("=") + 1);
|
||||
@@ -1155,17 +1138,33 @@ const Options = Module("options", {
|
||||
if (opt.get || opt.reset || !option || prefix)
|
||||
return null;
|
||||
|
||||
if (!opt.value) {
|
||||
if (!opt.value && !opt.operator && !opt.invert) {
|
||||
context.fork("default", 0, this, function (context) {
|
||||
context.title = ["Extra Completions"];
|
||||
context.completions = [
|
||||
[option.value, "Current 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"],
|
||||
@@ -1321,17 +1320,21 @@ const Options = Module("options", {
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
completion.option = function option(context, scope) {
|
||||
completion.option = function option(context, scope, prefix) {
|
||||
context.title = ["Option"];
|
||||
context.keys = { text: "names", description: "description" };
|
||||
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)
|
||||
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 completer = opt.completer;
|
||||
completer = completer || opt.completer;
|
||||
if (!completer)
|
||||
return;
|
||||
|
||||
@@ -1372,31 +1375,24 @@ const Options = Module("options", {
|
||||
context.advance(context.filter.length - len);
|
||||
|
||||
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
|
||||
// that it's worth breaking compatibility.
|
||||
if (isarray(newValues)) {
|
||||
completions = completions.filter(function (val) newValues.indexOf(val[0]) == -1);
|
||||
switch (op) {
|
||||
case "+":
|
||||
completions = completions.filter(function (val) curValues.indexOf(val[0]) == -1);
|
||||
break;
|
||||
case "-":
|
||||
completions = completions.filter(function (val) curValues.indexOf(val[0]) > -1);
|
||||
break;
|
||||
}
|
||||
context.filters.push(function (i) newValues.indexOf(i.text) == -1);
|
||||
if (op == "+")
|
||||
context.filters.push(function (i) curValues.indexOf(i.text) == -1);
|
||||
if (op == "-")
|
||||
context.filters.push(function (i) curValues.indexOf(i.text) > -1);
|
||||
}
|
||||
context.completions = completions;
|
||||
|
||||
let res = completer.call(opt, context);
|
||||
if (res)
|
||||
context.completions = res;
|
||||
};
|
||||
|
||||
completion.preference = function preference(context) {
|
||||
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.completions = options.allPrefs();
|
||||
};
|
||||
@@ -1404,14 +1400,14 @@ const Options = Module("options", {
|
||||
javascript: function () {
|
||||
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],
|
||||
[function () options.allPrefs().map(function (pref) [pref, ""])]);
|
||||
[function (context) (context.anchored=false, options.allPrefs().map(function (pref) [pref, ""]))]);
|
||||
},
|
||||
sanitizer: function () {
|
||||
sanitizer.addItem("options", {
|
||||
description: "Options containing hostname data",
|
||||
action: function (timespan, 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)
|
||||
try {
|
||||
opt.values = opt.filterDomain(host, opt.values);
|
||||
@@ -1421,12 +1417,12 @@ const Options = Module("options", {
|
||||
}
|
||||
},
|
||||
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)))
|
||||
opt.oldValue = opt.value;
|
||||
},
|
||||
privateLeave: function () {
|
||||
for (let opt in values(options._optionHash))
|
||||
for (let opt in values(options._options))
|
||||
if (opt.oldValue != null) {
|
||||
opt.value = opt.oldValue;
|
||||
opt.oldValue = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -26,7 +26,7 @@ const QuickMarks = Module("quickmarks", {
|
||||
*/
|
||||
add: function add(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) 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
|
||||
// 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
|
||||
|
||||
// our status bar fields
|
||||
this.widgets = dict(["status", "url", "inputbuffer", "progress", "tabcount", "bufferposition", "zoomlevel"].map(
|
||||
function (field) [field, document.getElementById("dactyl-statusline-field-" + field)]));
|
||||
this.widgets = array(["status", "url", "inputbuffer", "progress", "tabcount", "bufferposition", "zoomlevel"]
|
||||
.map(function (field) [field, document.getElementById("dactyl-statusline-field-" + field)]))
|
||||
.toObject();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -36,7 +37,7 @@ const StatusLine = Module("statusline", {
|
||||
insecure: "StatusLine"
|
||||
};
|
||||
|
||||
this._statusBar.setAttributeNS(NS.uri, "highlight", highlightGroup[type]);
|
||||
highlight.highlightNode(this._statusBar, highlightGroup[type]);
|
||||
},
|
||||
|
||||
// update all fields of the statusline
|
||||
@@ -115,8 +116,8 @@ const StatusLine = Module("statusline", {
|
||||
}
|
||||
if (modules.bookmarks) {
|
||||
if (bookmarks.isBookmarked(buffer.URL))
|
||||
modified += "\u2764"; // a heart symbol: ❤
|
||||
//modified += "\u2665"; // a heart symbol: ♥
|
||||
modified += UTF8("❤");
|
||||
//modified += UTF8("♥");
|
||||
}
|
||||
|
||||
if (modified)
|
||||
@@ -206,7 +207,9 @@ const StatusLine = Module("statusline", {
|
||||
let win = document.commandDispatcher.focusedWindow;
|
||||
if (!win)
|
||||
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 = "";
|
||||
@@ -255,11 +258,11 @@ const StatusLine = Module("statusline", {
|
||||
{
|
||||
setter: function setter(value) {
|
||||
if (value == 0)
|
||||
document.getElementById("status-bar").collapsed = true;
|
||||
statusline._statusBar.collapsed = true;
|
||||
else if (value == 1)
|
||||
dactyl.echoerr("show status line only with > 1 window not implemented yet");
|
||||
else
|
||||
document.getElementById("status-bar").collapsed = false;
|
||||
statusline._statusBar.collapsed = false;
|
||||
|
||||
return value;
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -21,6 +21,13 @@ const Tabs = Module("tabs", {
|
||||
this._lastBufferSwitchArgs = "";
|
||||
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
|
||||
// on startup
|
||||
if (config.hasTabbrowser)
|
||||
@@ -74,22 +81,6 @@ const Tabs = Module("tabs", {
|
||||
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),
|
||||
|
||||
/**
|
||||
@@ -721,7 +712,7 @@ const Tabs = Module("tabs", {
|
||||
});
|
||||
|
||||
commands.add(["quita[ll]", "qa[ll]"],
|
||||
"Quit " + config.name,
|
||||
"Quit " + config.appname,
|
||||
function (args) { dactyl.quit(false, args.bang); }, {
|
||||
argCount: "0",
|
||||
bang: true
|
||||
@@ -831,7 +822,7 @@ const Tabs = Module("tabs", {
|
||||
argCount: "+",
|
||||
completer: function (context, args) {
|
||||
if (args.completeArg == 0) {
|
||||
context.filters.push(function ({ item: win }) win != window);
|
||||
context.filters.push(function ({ item }) item != window);
|
||||
completion.window(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -97,7 +97,7 @@ syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity Jav
|
||||
|
||||
syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||
|
||||
syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public
|
||||
syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public
|
||||
|
||||
"" DOM/HTML/CSS specified things
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<document
|
||||
name="all"
|
||||
title="&dactyl.appname; All"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<tags>all</tags>
|
||||
|
||||
<toc/>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<document
|
||||
name="autocommands"
|
||||
title="&dactyl.appname; Autocommands"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="autocommands">Automatic commands</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
@@ -18,48 +18,57 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>Execute commands automatically on events.</p>
|
||||
|
||||
<p><ex>:au[tocmd]</ex> <a>event</a> <a>pat</a> <a>cmd</a></p>
|
||||
|
||||
<p>
|
||||
If the <em>-javascript</em> (short name <em>-js</em>)
|
||||
option is specified, <a>cmd</a> is executed as JavaScript
|
||||
code, with any supplied arguments available as
|
||||
variables.
|
||||
When <oa>cmd</oa> is not given, list all commands
|
||||
defined for the given <oa>events</oa> and <oa>pat</oa>.
|
||||
When <oa>!</oa> is given, delete the matching commands
|
||||
rather than listing them.
|
||||
</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>
|
||||
<li><ex>:autocmd[!]</ex> <a>events</a> <a>pat</a>: list/remove autocommands filtered by <a>events</a> and <a>pat</a></li>
|
||||
<li><ex>:autocmd[!]</ex> <a>events</a>: list/remove autocommands matching <a>events</a></li>
|
||||
<li><ex>:autocmd[!]</ex> <a>pat</a>: list/remove autocommands matching <a>pat</a></li>
|
||||
<li><ex>:autocmd[!]</ex>: list/remove all autocommands</li>
|
||||
</ul>
|
||||
<note>
|
||||
This behavior differs from Vim's implementation in that
|
||||
<oa>pat</oa> is a regular expression rather than a glob.
|
||||
</note>
|
||||
|
||||
<p>Available <a>events</a>:</p>
|
||||
<p>Available <oa>events</oa>:</p>
|
||||
|
||||
<dl tag="autocommand-list"/>
|
||||
|
||||
<p><a>pat</a> is a regular expression, use <tt>.*</tt> if you want to match all URLs.</p>
|
||||
|
||||
<note>This differs from Vim which uses a glob rather than a regex for <a>pat</a>.</note>
|
||||
|
||||
<p>The following keywords are available where relevant:</p>
|
||||
<p>
|
||||
For ex <oa>cmd</oa>s, the following keywords are
|
||||
replaced with the appropriate value before the commands
|
||||
are executed. For JavaScript commands, they may be
|
||||
accessed as ordinary variables, sans angle brackets.
|
||||
</p>
|
||||
|
||||
<dl tag="autocommand-args"/>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<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.
|
||||
</p>
|
||||
</description>
|
||||
@@ -67,11 +76,12 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
Apply the autocommands matching the specified URL to the current buffer. If no
|
||||
<oa>url</oa> is specified use the current URL.
|
||||
Apply all autocommands matching the specified
|
||||
<oa>url</oa> to the current buffer. If no <oa>url</oa>
|
||||
is specified use the current URL.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -91,7 +101,7 @@
|
||||
|
||||
<code><!-- Why is the XSLT processor mangling newlines? -->
|
||||
<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>
|
||||
|
||||
</document>
|
||||
|
||||
@@ -6,26 +6,27 @@
|
||||
<document
|
||||
name="browsing"
|
||||
title="&dactyl.appname; Browsing"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="surfing browsing">Browsing</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
&dactyl.appname; overrides nearly all &dactyl.host; keys in order to make browsing more
|
||||
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
|
||||
have 2 possibilities:
|
||||
<h2 tag="bypassing-&dactyl.name;">Bypassing &dactyl.appname;</h2>
|
||||
|
||||
&dactyl.appname; overrides nearly all &dactyl.host; keys in order to
|
||||
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>
|
||||
<tags><![CDATA[pass-through <C-z> CTRL-Z]]></tags>
|
||||
<spec>CTRL-Z</spec>
|
||||
<description>
|
||||
<p>
|
||||
Disable all &dactyl.appname; keys except <k name="Esc"/> and pass them to the next event
|
||||
handler. This is especially useful if JavaScript controlled forms (e.g., the
|
||||
RichEdit form fields of Gmail) don't work anymore. To exit this mode, press
|
||||
<k name="Esc"/>. If you also need to pass <k name="Esc"/> in this mode to the web page,
|
||||
prepend it with <k name="C-v"/>.
|
||||
Pass all keys except for <k name="Esc"/> directly to
|
||||
&dactyl.host;. When <k name="Esc"/> is pressed,
|
||||
resume normal key handling. This is especially useful
|
||||
for web sites which make heavy use of key bindings.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -36,11 +37,7 @@ have 2 possibilities:
|
||||
<spec>CTRL-V</spec>
|
||||
<description>
|
||||
<p>
|
||||
If you only need to pass a single key to a JavaScript form field or another
|
||||
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.
|
||||
Pass the next key press directly to &dactyl.host;.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -54,52 +51,55 @@ have 2 possibilities:
|
||||
<spec>o</spec>
|
||||
<description>
|
||||
<p>
|
||||
Open one or more URLs in the current tab.
|
||||
Multiple URLs can be separated with <o>urlseparator</o> (default: ", " Note that the
|
||||
space after the comma is required.)
|
||||
The first URL is opened in the current tab, and all other URLs are
|
||||
opened in new tabs.
|
||||
Each token is analyzed and in this order:
|
||||
Open a single URL in the current tab, or multiple URLs
|
||||
in the current tab and background tabs. URLs may be
|
||||
separated with <o>urlseparator</o>, in which case the
|
||||
first URL is opened in the current tab and the rest are
|
||||
opened in new background tabs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Each URL may be one of the following:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
Opened as a local file if it is an existing relative or absolute filename.
|
||||
<ul>
|
||||
<li><ex>:open /etc/fstab</ex> shows the file system table.</li>
|
||||
<li><ex>:open ../other/foo.html</ex> in your home directory opens <tt>/home/other/foo.html</tt></li>
|
||||
</ul>
|
||||
A local filename, if it begins with <em>/</em>,
|
||||
<em>./</em>, or <em>~/</em> and the specified file
|
||||
exists.
|
||||
</li>
|
||||
<li>
|
||||
Opened with the specified search engine if the
|
||||
token looks like a search string and the first word
|
||||
is the name of a search engine (
|
||||
<ex>:open wikipedia linus torvalds</ex> opens the Wikipedia entry for
|
||||
linus torvalds). The short name of a search engine
|
||||
is automatically guessed from its name. If you want
|
||||
to set a custom name, you can change it with
|
||||
<ex>:dialog searchengines</ex>.
|
||||
<p>
|
||||
A search or bookmark keyword, or a search engine
|
||||
name, followed by search arguments.
|
||||
</p>
|
||||
<example><ex>:open wikipedia Linus Torvalds</ex></example>
|
||||
<p>
|
||||
Search engines can be edited via
|
||||
<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>
|
||||
Opened with the default search engine or keyword
|
||||
(specified with the <o>defsearch</o> option) if the first
|
||||
word is no search engine (<ex>:open linus torvalds</ex>
|
||||
opens a Google search for linus torvalds).
|
||||
<p>
|
||||
Any search string which does not look like a URL or
|
||||
hostname, which will be passed to the default
|
||||
search engine (see <o>defsearch</o>).
|
||||
</p>
|
||||
<example><ex>:open Linus Torvalds</ex></example>
|
||||
</li>
|
||||
<li>
|
||||
Passed directly to &dactyl.host; in all other cases
|
||||
(<ex>:open www.osnews.com, www.slashdot.org</ex>
|
||||
opens OSNews in the current, and Slashdot in a new
|
||||
background tab).
|
||||
Any other value is passed directly &dactyl.host; and
|
||||
must be a valid URL or hostname.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
You can use <ex>:open -tags linux torvalds<k name="Tab"/></ex> to complete bookmarks with
|
||||
tag "linux" and which contain "torvalds". Note that -tags support is only
|
||||
available for tab completion, not for the actual command.
|
||||
The items which are completed on <k name="Tab"/> are specified in the <o>complete</o>
|
||||
option.
|
||||
<ex>:open</ex> provides powerful URL completion from
|
||||
several possible sources, which can be adjusted via the
|
||||
<o>complete</o> option.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -111,8 +111,9 @@ have 2 possibilities:
|
||||
<spec>t</spec>
|
||||
<description>
|
||||
<p>
|
||||
Just like <ex>:open</ex> but also uses a new tab for the first URL. When
|
||||
used with <oa>!</oa>, the <em>tabopen</em> value of the <o>activate</o> option is negated.
|
||||
Like <ex>:open</ex>, but all arguments are opened in new
|
||||
tabs. The first new tab is activated if <o>activate</o>
|
||||
contains <str>tabopen</str> or <oa>!</oa> is provided.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -121,10 +122,9 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>T</tags>
|
||||
<spec>T</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>
|
||||
Show a <ex>:tabopen</ex> prompt containing the current URL. Useful if you want to
|
||||
go somewhere by editing the URL of the current page.
|
||||
Open a <ex>:tabopen</ex> prompt followed by the current URL.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -135,9 +135,9 @@ have 2 possibilities:
|
||||
<spec>:<oa>count</oa>tabdu<oa>plicate</oa><oa>!</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Duplicates current tab <oa>count</oa> times. Uses <em>tabopen</em> value of the <o>activate</o>
|
||||
option to determine if the last cloned tab should be activated. When used with
|
||||
<oa>!</oa>, <em>tabopen</em> value is negated.
|
||||
Duplicates current tab <oa>count</oa> times. The first
|
||||
new tab is activated if <o>activate</o> contains
|
||||
<str>tabopen</str> or <oa>!</oa> is provided.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -146,10 +146,9 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>O</tags>
|
||||
<spec>O</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>
|
||||
Show an <ex>:open</ex> prompt containing the current URL. Useful if you want to
|
||||
go somewhere by editing the URL of the current page.
|
||||
Open an <ex>:open</ex> prompt followed by the current URL.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -160,7 +159,10 @@ have 2 possibilities:
|
||||
<spec>:wino<oa>pen</oa><oa>!</oa> <oa>arg1</oa>, <oa>arg2</oa>, …</spec>
|
||||
<spec>w</spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -168,10 +170,9 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>W</tags>
|
||||
<spec>W</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>
|
||||
Open one or more URLs in a new window based on current location. Works like
|
||||
<k>w</k> but preselects current URL in the <ex>:winopen</ex> query.
|
||||
Open a <ex>:winopen</ex> prompt followed by the current URL.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -179,13 +180,14 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<MiddleMouse> p]]></tags>
|
||||
<strut/>
|
||||
<spec>p</spec>
|
||||
<description>
|
||||
<p>
|
||||
Open (put) a URL based on the current clipboard contents in the current buffer.
|
||||
You can also just select (for non-X11 users: copy) some non-URL text, and
|
||||
search for it with the default search engine or keyword (specified by the
|
||||
<o>defsearch</o> option) with <k>p</k>.
|
||||
Open (put) a URL based on the current clipboard
|
||||
contents, or, on X11 systems, the currently selected
|
||||
text. All white space is stripped from the selection and
|
||||
it is opened in the same manner as <ex>:open</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -193,14 +195,14 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>P</tags>
|
||||
<strut/>
|
||||
<spec>P</spec>
|
||||
<description>
|
||||
<p>
|
||||
Open (put) a URL based on the current clipboard contents in a new buffer. Works
|
||||
like <k>p</k> but opens a new tab.
|
||||
</p>
|
||||
<p>
|
||||
Whether the new buffer is activated, depends on the <o>activate</o> option.
|
||||
Open (put) a URL based on the current clipboard contents
|
||||
in a new buffer. Works like <k>p</k> but opens a new
|
||||
tab. The new tab is activated if <o>activate</o>
|
||||
contains <str>paste</str>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -208,11 +210,13 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>gP</tags>
|
||||
<strut/>
|
||||
<spec>gP</spec>
|
||||
<description>
|
||||
<p>
|
||||
Open (put) a URL based on the current clipboard contents in a new buffer.
|
||||
Works like <k>P</k> but inverts the <o>activate</o> option.
|
||||
Open (put) a URL based on the current clipboard contents
|
||||
in a new buffer. The new tab is activated if <o>activate</o>
|
||||
does <em>not</em> contain <str>paste</str>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -220,12 +224,14 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-x>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-x></spec>
|
||||
<description>
|
||||
<p>
|
||||
Decrements the last number in URL by 1, or by <oa>count</oa> if given. Negative
|
||||
numbers are not supported, as this is not generally useful, so the number cannot
|
||||
be decremented past 0.
|
||||
Decrements the last number in URL by 1, or by
|
||||
<oa>count</oa> if given. Negative numbers are not
|
||||
supported as trailing numbers in URLs are often preceded
|
||||
by hyphens.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -233,9 +239,13 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-a>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-a></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -243,11 +253,8 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>~</tags>
|
||||
<spec>~</spec>
|
||||
<description>
|
||||
<p>
|
||||
Open home directory. You can also use the hints and have the probably fastest
|
||||
file browser on earth. :)
|
||||
</p>
|
||||
<description short="true">
|
||||
<p>Open home directory. Equivalent to <ex>:open ~/</ex></p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -261,9 +268,10 @@ have 2 possibilities:
|
||||
<spec>CTRL-o</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go <oa>count</oa> pages back in the browser history. If <oa>url</oa> is specified go back to
|
||||
the first matching URL. The special version <ex>:back!</ex> goes to the beginning
|
||||
of the browser history.
|
||||
Go <oa>count</oa> pages back in the browser history. If
|
||||
<oa>url</oa> is specified go back to the first matching
|
||||
URL. The special version <ex>:back!</ex> goes to the
|
||||
beginning of the browser history.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -276,9 +284,10 @@ have 2 possibilities:
|
||||
<spec>CTRL-i</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go <oa>count</oa> pages forward in the browser history. If <oa>url</oa> is specified go
|
||||
forward to the first matching URL. The special version <ex>:forward!</ex> goes to
|
||||
the end of the browser history.
|
||||
Go <oa>count</oa> pages forward in the browser history.
|
||||
If <oa>url</oa> is specified go forward to the first
|
||||
matching URL. The special version <ex>:forward!</ex>
|
||||
goes to the end of the browser history.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -288,11 +297,12 @@ have 2 possibilities:
|
||||
<tags>:ju :jumps</tags>
|
||||
<spec>:ju<oa>mps</oa></spec>
|
||||
<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>
|
||||
Current history position is marked with >, jump numbers are counters to be used
|
||||
with <ex>:back</ex> (above zero record) or <ex>:forward</ex> (below zero record).
|
||||
Current history position is marked with <em>></em>.
|
||||
Jump numbers may be used as counts for with
|
||||
<ex>:back</ex> or <ex>:forward</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -301,7 +311,7 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>gh</tags>
|
||||
<spec>gh</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Go home. Opens the homepage in the current tab.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -309,11 +319,13 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>gH</tags>
|
||||
<strut/>
|
||||
<spec>gH</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go home in a new tab. Opens the homepage in a new tab. Whether the new tab is
|
||||
activated or not depends on the <o>activate</o> option.
|
||||
Go home in a new tab. Opens the homepage in a new tab.
|
||||
The new tab is activated if <o>activate</o> contains
|
||||
<str>homepage</str>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -322,13 +334,13 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>gu</tags>
|
||||
<spec><oa>count</oa>gu</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Go to <oa>count</oa>th parent directory.</p>
|
||||
|
||||
<p>
|
||||
<k>2gu</k> on
|
||||
<tt>http://www.example.com/dir1/dir2/file.htm</tt> opens
|
||||
<tt>http://www.example.com/dir1/</tt>.
|
||||
For example, at the URL
|
||||
<tt>http://www.example.com/dir1/dir2/file.htm</tt>,
|
||||
<k>2gu</k> opens <tt>http://www.example.com/dir1/</tt>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -337,13 +349,13 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>gU</tags>
|
||||
<spec>gU</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Go to the root of the web site.</p>
|
||||
|
||||
<p>
|
||||
<k>gU</k> on <tt>http://www.example.com/dir1/dir2/file.htm</tt> opens
|
||||
<tt>http://www.example.com/</tt>.
|
||||
When browsing a local directory, it goes to the root directory.
|
||||
For example, at the URL
|
||||
<tt>http://www.example.com/dir1/dir2/file.htm</tt>,
|
||||
<k>gU</k> opens <tt>http://www.example.com/</tt>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -354,8 +366,8 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>r</tags>
|
||||
<spec>r</spec>
|
||||
<description>
|
||||
<p>Force reloading of the current web page.</p>
|
||||
<description short="true">
|
||||
<p>Reload the current web page.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -363,8 +375,8 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>R</tags>
|
||||
<spec>R</spec>
|
||||
<description>
|
||||
<p>Force reloading of the current web page skipping the cache.</p>
|
||||
<description short="true">
|
||||
<p>Reload the current web page without using the cache.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -374,8 +386,8 @@ have 2 possibilities:
|
||||
<spec>:re<oa>load</oa><oa>!</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Reload current web page. Forces reloading of the current page. If <oa>!</oa> is given,
|
||||
skip the cache.
|
||||
Reload current web page. If <oa>!</oa> is given, reload
|
||||
without using the cache.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -385,7 +397,10 @@ have 2 possibilities:
|
||||
<tags>:reloada :reloadall</tags>
|
||||
<spec>:reloada<oa>ll</oa><oa>!</oa></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -393,18 +408,11 @@ have 2 possibilities:
|
||||
<h2 tag="stopping">Stopping</h2>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-c>]]></tags>
|
||||
<tags><![CDATA[<C-c> :st :stop]]></tags>
|
||||
<spec><C-c></spec>
|
||||
<description>
|
||||
<p>Stop loading the current web page.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<tags>:st :stop</tags>
|
||||
<strut/>
|
||||
<spec>:st<oa>op</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Stop loading the current web page.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -413,7 +421,7 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>:stopa :stopall</tags>
|
||||
<spec>:stopa<oa>ll</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Stop loading all web pages.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -423,11 +431,14 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>:w :write :sav :saveas</tags>
|
||||
<strut/>
|
||||
<spec>:sav<oa>eas</oa><oa>!</oa> <oa>file</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Save current web page to disk. If <oa>file</oa> is omitted, save to the page's
|
||||
default filename. Existing documents will only be overwritten if <oa>!</oa> is given.
|
||||
Save current web page to disk. If <oa>file</oa> is
|
||||
omitted, save to the page's default filename. Existing
|
||||
documents will only be overwritten if <oa>!</oa> is
|
||||
given.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -437,12 +448,12 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>:q :quit</tags>
|
||||
<strut/>
|
||||
<spec>:q<oa>uit</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Quit current tab. If this is the last tab in the window, close the window. If
|
||||
this was the last window, close &dactyl.appname;. When quitting &dactyl.appname;, the
|
||||
session is not stored.
|
||||
Quit current tab. If this is the last tab in the window,
|
||||
close the window.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -450,11 +461,12 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>:qa :qall :quita :quitall</tags>
|
||||
<strut/>
|
||||
<spec>:quita<oa>ll</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Quit &dactyl.appname;. Quit &dactyl.appname;, no matter how many tabs/windows are open.
|
||||
The session is not stored.
|
||||
Quit &dactyl.appname;, no matter how many tabs/windows
|
||||
are open. The session is not stored.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -463,8 +475,8 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>:wc :wclose :winc :winclose</tags>
|
||||
<spec>:winc<oa>lose</oa></spec>
|
||||
<description>
|
||||
<p>Close window.</p>
|
||||
<description short="true">
|
||||
<p>Close the current window.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -472,8 +484,8 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>:winon :winonly</tags>
|
||||
<spec>:winon<oa>ly</oa></spec>
|
||||
<description>
|
||||
<p>Close all other windows.</p>
|
||||
<description short="true">
|
||||
<p>Close all windows but the current.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -481,14 +493,14 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>:xa :xall :wq :wqa :wqall</tags>
|
||||
<spec>:wqa<oa>ll</oa></spec>
|
||||
<strut/>
|
||||
<spec>:xa<oa>ll</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Save the session and quit. Quit &dactyl.appname;, no matter how many tabs/windows
|
||||
are open. The session is stored. <ex>:wq</ex> is different from Vim, as it
|
||||
closes the window instead of just one tab by popular demand. Complain on the
|
||||
mailing list if you want to change that.
|
||||
</p>
|
||||
<description short="true">
|
||||
<p>Save the current session and quit.</p>
|
||||
<note>
|
||||
Unlike Vim, <ex>:wq</ex> closes the entire window rather
|
||||
than just the current tab.
|
||||
</note>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -496,7 +508,7 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>ZQ</tags>
|
||||
<spec>ZQ</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Quit and don't save the session. Works like <ex>:qall</ex>.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -505,10 +517,10 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>ZZ</tags>
|
||||
<spec>ZZ</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>
|
||||
Quit and save the session. Quit &dactyl.appname;, no matter how many tabs/windows
|
||||
are open. The session is stored. Works like <ex>:xall</ex>.
|
||||
Quit &dactyl.appname; and save the session. Works like
|
||||
<ex>:xall</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -518,9 +530,14 @@ have 2 possibilities:
|
||||
|
||||
<item>
|
||||
<tags>:chd :chdir :cd</tags>
|
||||
<spec>:cd <oa>-|path</oa></spec>
|
||||
<strut/>
|
||||
<spec>:cd <oa>path</oa></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -528,7 +545,7 @@ have 2 possibilities:
|
||||
<item>
|
||||
<tags>:pw :pwd</tags>
|
||||
<spec>:pw<oa>d</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Print the current directory name.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,23 +6,29 @@
|
||||
<document
|
||||
name="buffer"
|
||||
title="&dactyl.appname; Buffer"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="buffer document">Buffer</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
&dactyl.appname; holds exactly one buffer object for each tab. It is usually an
|
||||
(X)HTML document with advanced features.
|
||||
<p>
|
||||
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>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-g>]]></tags>
|
||||
<strut/>
|
||||
<spec><C-g></spec>
|
||||
<description>
|
||||
<p>
|
||||
Print the current file name. Also shows some additional file information like
|
||||
file size or the last modified date.
|
||||
Print the current file name along with basic page
|
||||
information including last modification time, the number
|
||||
of feeds present, and the page title.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -31,7 +37,7 @@
|
||||
<item>
|
||||
<tags><![CDATA[g<C-g>]]></tags>
|
||||
<spec>g<C-g></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Print file information. Same as <ex>:pa<oa>geinfo</oa></ex>.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -39,15 +45,20 @@
|
||||
|
||||
<item>
|
||||
<tags>:pa :pageinfo</tags>
|
||||
<spec>:pa<oa>geinfo</oa></spec>
|
||||
<spec>:pa<oa>geinfo</oa> <oa>items</oa></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<tags>gf</tags>
|
||||
<strut/>
|
||||
<spec>gf</spec>
|
||||
<description>
|
||||
<p>
|
||||
@@ -60,12 +71,15 @@
|
||||
|
||||
<item>
|
||||
<tags>gF</tags>
|
||||
<strut/>
|
||||
<spec>gF</spec>
|
||||
<description>
|
||||
<p>
|
||||
View source with an external editor. Opens the source code of the current web
|
||||
site with the external editor specified by the <o>editor</o> option. For now the
|
||||
external editor must be able to download and open files from a remote URL.
|
||||
View source with an external editor. Opens the source
|
||||
code of the current web site with the external editor
|
||||
specified by the <o>editor</o> option. The external
|
||||
editor must be able to download and open files from a
|
||||
remote URL.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -76,8 +90,9 @@
|
||||
<spec>:vie<oa>wsource</oa><oa>!</oa> <oa>url</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
View source code of current document. If <oa>url</oa> is specified then view the
|
||||
source of that document. When <oa>!</oa> is given, it is opened with the external
|
||||
View source code of current document. If <oa>url</oa> is
|
||||
specified then view the source of that document. When
|
||||
<oa>!</oa> is given, it is opened with the external
|
||||
editor.
|
||||
</p>
|
||||
</description>
|
||||
@@ -88,11 +103,12 @@
|
||||
|
||||
<item>
|
||||
<tags>^ 0</tags>
|
||||
<strut/>
|
||||
<spec>0</spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll to the absolute left of the document. Unlike in Vim, <k>0</k> and <k>^</k>
|
||||
work exactly the same way.
|
||||
Scroll to the absolute left of the document. Unlike in
|
||||
Vim, <k>0</k> and <k>^</k> work exactly the same way.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -101,7 +117,7 @@
|
||||
<item>
|
||||
<tags>$</tags>
|
||||
<spec>$</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Scroll to the absolute right of the document</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -109,11 +125,13 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Home> gg]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>gg</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go to the top of the document. When used with <oa>count</oa> like in <k>35gg</k>, it
|
||||
scrolls to 35% of the document.
|
||||
Go to the top of the document. With <oa>count</oa>,
|
||||
scroll vertically to <oa>count</oa> percent of the
|
||||
document.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -121,11 +139,12 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<End> G]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>G</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go to the end of the document. When used with <oa>count</oa> like in <k>35G</k>, it
|
||||
scrolls to 35% of the document.
|
||||
Go to the end of the document. With <oa>count</oa>,
|
||||
behaves exactly the same as <oa>gg</oa>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -134,7 +153,7 @@
|
||||
<item>
|
||||
<tags>N%</tags>
|
||||
<spec><a>count</a>%</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Scroll to <a>count</a> percent of the document.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -142,15 +161,12 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Left> h]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>h</spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll document to the left. If <oa>count</oa> is specified then move <oa>count</oa> times as
|
||||
much to the left.
|
||||
</p>
|
||||
<p>
|
||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
||||
set).
|
||||
Scroll document to the left. If <oa>count</oa> is specified,
|
||||
repeat <oa>count</oa> times.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -158,15 +174,12 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-e> <Down> j]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>j</spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll document down. If <oa>count</oa> is specified then move <oa>count</oa> times as much
|
||||
down.
|
||||
</p>
|
||||
<p>
|
||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
||||
set).
|
||||
Scroll document to the down. If <oa>count</oa> is specified,
|
||||
repeat <oa>count</oa> times.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -174,14 +187,12 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-y> <Up> k]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>k</spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll document up. If <oa>count</oa> is specified then move <oa>count</oa> times as much up.
|
||||
</p>
|
||||
<p>
|
||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
||||
set).
|
||||
Scroll document to the up. If <oa>count</oa> is specified,
|
||||
repeat <oa>count</oa> times.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -189,15 +200,12 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Right> l]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>l</spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll document to the right. If <oa>count</oa> is specified then move <oa>count</oa> times
|
||||
as much to the right.
|
||||
</p>
|
||||
<p>
|
||||
If the document cannot scroll more, a beep is emitted (unless <o>visualbell</o> is
|
||||
set).
|
||||
Scroll document to the right. If <oa>count</oa> is specified,
|
||||
repeat <oa>count</oa> times.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -205,12 +213,13 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-d>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-d></spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll window downwards in the buffer. The number of lines is set by the
|
||||
<o>scroll</o> option which defaults to half a page. If <oa>count</oa> is given <o>scroll</o> is
|
||||
first set to this value.
|
||||
Scroll window downwards by the amount specified in the
|
||||
<o>scroll</o> option. With <oa>count</oa>, scroll as if
|
||||
<o>scroll</o> were set to <o>count</o>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -218,12 +227,13 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-u>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-u></spec>
|
||||
<description>
|
||||
<p>
|
||||
Scroll window upwards in the buffer. The number of lines is set by the
|
||||
<o>scroll</o> option which defaults to half a page. If <oa>count</oa> is given <o>scroll</o> is
|
||||
first set to this value.
|
||||
Scroll window upwards by the amount specified in the
|
||||
<o>scroll</o> option. With <oa>count</oa>, scroll as if
|
||||
<o>scroll</o> were set to <o>count</o>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -231,18 +241,26 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<S-Space> <PageUp> <C-b>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-b></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Space> <PageDown> <C-f>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-f></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -252,7 +270,7 @@
|
||||
<item>
|
||||
<tags><![CDATA[<Tab>]]></tags>
|
||||
<spec><Tab></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Advance keyboard focus to the next element.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -261,7 +279,7 @@
|
||||
<item>
|
||||
<tags><![CDATA[<S-Tab>]]></tags>
|
||||
<spec><S-Tab></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Rewind keyboard focus to the previous element.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -269,12 +287,13 @@
|
||||
|
||||
<item>
|
||||
<tags>gi</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>gi</spec>
|
||||
<description>
|
||||
<p>
|
||||
Focus last used input field. If there is no last input field, it focuses the
|
||||
first input field. When used with <oa>count</oa> it directly jumps to the <oa>count</oa>th input
|
||||
field.
|
||||
Focus last used input field. If there is no last input
|
||||
field, focus the first input field. With <oa>count</oa>,
|
||||
focus the <oa>count</oa>th input field.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -282,11 +301,13 @@
|
||||
|
||||
<item>
|
||||
<tags>]f</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>]f</spec>
|
||||
<description>
|
||||
<p>
|
||||
Focus next frame. Transfer keyboard focus to the <oa>count</oa>th next frame in
|
||||
order. The newly focused frame is briefly colored red. Does not wrap.
|
||||
Transfer keyboard focus to the <oa>count</oa>th next
|
||||
frame. The newly focused frame is briefly highlighted
|
||||
with <h>FrameIndicator</h>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -294,11 +315,13 @@
|
||||
|
||||
<item>
|
||||
<tags>[f</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>[f</spec>
|
||||
<description>
|
||||
<p>
|
||||
Focus previous frame. Transfer keyboard focus to the <oa>count</oa>th previous frame
|
||||
in order. The newly focused frame is briefly colored red. Does not wrap.
|
||||
Transfer keyboard focus to the <oa>count</oa>th next
|
||||
previous frame. The newly focused frame is briefly highlighted
|
||||
with <h>FrameIndicator</h>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -306,13 +329,13 @@
|
||||
|
||||
<item>
|
||||
<tags>]]</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>]]</spec>
|
||||
<description>
|
||||
<p>
|
||||
Follow the link labeled <str>next</str> or <str>></str>
|
||||
if it exists. Useful when browsing forums or
|
||||
documentation. Change <o>nextpattern</o> to modify its
|
||||
behavior. It follows relations between files too.
|
||||
Follow the last link matching <o>nextpattern</o>. Used,
|
||||
for instance, to move to the next page of search
|
||||
results.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -320,14 +343,13 @@
|
||||
|
||||
<item>
|
||||
<tags>[[</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>[[</spec>
|
||||
<description>
|
||||
<p>
|
||||
Follow the link labeled <str>prev</str>,
|
||||
<str>previous</str> or <str><</str> if it exists. Useful
|
||||
when browsing forums or documentation. Change
|
||||
<o>previouspattern</o> to modify its behavior. It
|
||||
follows relations between files too.
|
||||
Follow the last link matching <o>previouspattern</o>. Used,
|
||||
for instance, to move to the previous page of search
|
||||
results.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -335,31 +357,40 @@
|
||||
|
||||
<h2 tag="zooming zoom">Zooming</h2>
|
||||
|
||||
The zooming commands are dependent on two properties -- a zoom range and a
|
||||
series of levels within that range.
|
||||
<p>
|
||||
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
|
||||
zoom range (default: 30%--300%). The zoom levels are used by
|
||||
<k>zi</k>/<k>zo</k>, and similar commands, to change the zoom value in steps. The
|
||||
default zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%,
|
||||
170%, 200%, 240%, 300%.
|
||||
<p>
|
||||
The absolute value of the page zoom is limited to a value within
|
||||
the configured zoom range (default: 30%–300%). By default,
|
||||
commands which zoom in or out select between the zoom levels,
|
||||
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
|
||||
<link topic="http://kb.mozillazine.org/Zoom.minPercent">'zoom.minPercent'</link> and
|
||||
<link topic="http://kb.mozillazine.org/Zoom.maxPercent">'zoom.maxPercent'</link> &dactyl.host;
|
||||
preferences. The zoom levels can be changed using the
|
||||
<link topic="http://kb.mozillazine.org/Toolkit.zoomManager.zoomValues">'toolkit.ZoomManager.zoomLevels'</link>
|
||||
preference.
|
||||
<p>
|
||||
The available zoom range can be changed by setting the
|
||||
<pref>zoom.minPercent</pref>
|
||||
and
|
||||
<pref>zoom.maxPercent</pref>
|
||||
&dactyl.host; preferences. The zoom levels can be changed using the
|
||||
<pref>toolkit.zoomManager.zoomValues</pref>
|
||||
preference.
|
||||
</p>
|
||||
|
||||
<note>
|
||||
'toolkit.ZoomManager.zoomLevels' is specified as a list of
|
||||
values between 0 and 1, not as a percentage.
|
||||
<pref>toolkit.zoomManager.zoomValues</pref> is specified as a
|
||||
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>
|
||||
|
||||
<item>
|
||||
<tags>+ zi</tags>
|
||||
<spec><oa>count</oa>zi</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Enlarge text zoom of current web page. Mnemonic: zoom in.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -367,6 +398,7 @@ preference.
|
||||
|
||||
<item>
|
||||
<tags>zm</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>zm</spec>
|
||||
<description>
|
||||
<p>Enlarge text zoom of current web page by a larger amount. Mnemonic: zoom more.</p>
|
||||
@@ -377,7 +409,7 @@ preference.
|
||||
<item>
|
||||
<tags>- zo</tags>
|
||||
<spec><oa>count</oa>zo</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Reduce text zoom of current web page. Mnemonic: zoom out.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -386,7 +418,7 @@ preference.
|
||||
<item>
|
||||
<tags>zr</tags>
|
||||
<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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -394,11 +426,13 @@ preference.
|
||||
|
||||
<item>
|
||||
<tags>zz</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>zz</spec>
|
||||
<description>
|
||||
<p>
|
||||
Set text zoom value of current web page. Zoom value can be between 30% and 300%.
|
||||
If it is omitted, text zoom is reset to 100%.
|
||||
Set text zoom value of current web page. Zoom value can
|
||||
be between 30% and 300%. If it is omitted, text zoom is
|
||||
reset to 100%.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -407,7 +441,7 @@ preference.
|
||||
<item>
|
||||
<tags>ZI zI</tags>
|
||||
<spec><oa>count</oa>ZI</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Enlarge full zoom of current web page. Mnemonic: zoom in.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -415,6 +449,7 @@ preference.
|
||||
|
||||
<item>
|
||||
<tags>ZM zM</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>ZM</spec>
|
||||
<description>
|
||||
<p>Enlarge full zoom of current web page by a larger amount. Mnemonic: zoom more.</p>
|
||||
@@ -425,7 +460,7 @@ preference.
|
||||
<item>
|
||||
<tags>ZO zO</tags>
|
||||
<spec><oa>count</oa>ZO</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Reduce full zoom of current web page. Mnemonic: zoom out.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -434,7 +469,7 @@ preference.
|
||||
<item>
|
||||
<tags>ZR zR</tags>
|
||||
<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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -442,6 +477,7 @@ preference.
|
||||
|
||||
<item>
|
||||
<tags>ZZ zZ</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>ZZ</spec>
|
||||
<description>
|
||||
<p>
|
||||
@@ -455,7 +491,8 @@ preference.
|
||||
<item>
|
||||
<tags>:zo :zoom</tags>
|
||||
<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>
|
||||
<p>
|
||||
Set zoom value of current web page. <oa>value</oa> can be an absolute value
|
||||
@@ -476,7 +513,7 @@ preference.
|
||||
<item>
|
||||
<tags>:frameo :frameonly</tags>
|
||||
<spec>:frameo<oa>nly</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Show only the current frame's page.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -484,18 +521,17 @@ preference.
|
||||
|
||||
<h2 tag="copying yanking">Copying text</h2>
|
||||
|
||||
When running in X11, the text of the following commands is not only
|
||||
copied to the clipboard but is also put into the X11 selection, which
|
||||
can be pasted with the middle mouse button:
|
||||
<p>
|
||||
When running in X11, the text of the following commands is not only
|
||||
copied to the clipboard but is also put into the X11 selection, which
|
||||
can be pasted with the middle mouse button:
|
||||
</p>
|
||||
|
||||
<item>
|
||||
<tags>y</tags>
|
||||
<spec>y</spec>
|
||||
<description>
|
||||
<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 short="true">
|
||||
<p>Yank current location to the clipboard.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -503,7 +539,7 @@ can be pasted with the middle mouse button:
|
||||
<item>
|
||||
<tags>Y</tags>
|
||||
<spec>Y</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Copy currently selected text to the system clipboard.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -511,16 +547,18 @@ can be pasted with the middle mouse button:
|
||||
|
||||
<h2 tag="alternate-stylesheet">Alternate style sheets</h2>
|
||||
|
||||
Page authors may specify alternate style sheets for an HTML document. Users can
|
||||
then switch between these various style sheets, selecting their favorite.
|
||||
Page authors may specify alternate style sheets for an HTML
|
||||
document. Users can then switch between these various style sheets,
|
||||
selecting their favorite.
|
||||
|
||||
<item>
|
||||
<tags>:pagest :pagestyle</tags>
|
||||
<spec>:pagest<oa>yle</oa> <oa>stylesheet</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Select the author style sheet to apply. If <oa>stylesheet</oa> is not specified
|
||||
the page's default style sheet is used.
|
||||
Select the author style sheet to apply. If
|
||||
<oa>stylesheet</oa> is not specified the page's default
|
||||
style sheet is used.
|
||||
</p>
|
||||
|
||||
<p>All author styling can be removed by setting the <o>usermode</o> option.</p>
|
||||
|
||||
@@ -6,33 +6,52 @@
|
||||
<document
|
||||
name="cmdline"
|
||||
title="&dactyl.appname; Command-line"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<h1 tag="Command-line-mode Command-line mode-cmdline">Command-line mode</h1>
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="command-line-mode command-line mode-cmdline">Command-line mode</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
Command-line mode is used to enter Ex commands (<k>:</k>) and text search patterns
|
||||
(<k>/</k> and <k>?</k>).
|
||||
<p>
|
||||
&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>
|
||||
<tags>:</tags>
|
||||
<strut/>
|
||||
<spec>:</spec>
|
||||
<description>
|
||||
<p>
|
||||
Start Command-line mode. In Command-line mode, you can perform extended
|
||||
commands, which may require arguments.
|
||||
Opens the command-line in ex mode. This is the mode used
|
||||
for entering the various commands listed in
|
||||
<t>ex-cmd-index</t>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
|
||||
<h2 tag="cmdline-editing">Command-line editing</h2>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[c_<C-c>]]></tags>
|
||||
<spec><C-c></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Quit Command-line mode without executing.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -41,7 +60,7 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
||||
<item>
|
||||
<tags><![CDATA[c_<C-]>]]></tags>
|
||||
<spec><C-]></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Expand a command-line abbreviation.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -49,11 +68,12 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[c_<Up>]]></tags>
|
||||
<strut/>
|
||||
<spec><Up></spec>
|
||||
<description>
|
||||
<p>
|
||||
Recall the previous command line from the history list which matches the
|
||||
current command line.
|
||||
Recall from command history the previous command-line
|
||||
which begins with the current input value.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -61,11 +81,12 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[c_<Down>]]></tags>
|
||||
<strut/>
|
||||
<spec><Down></spec>
|
||||
<description>
|
||||
<p>
|
||||
Recall the next command line from the history list which matches the current
|
||||
command line.
|
||||
Recall from command history the next command-line
|
||||
which begins with the current input value.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -74,6 +95,7 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
||||
<item>
|
||||
<tags><![CDATA[c_<S-Up> c_<PageUp>]]></tags>
|
||||
<spec><S-Up></spec>
|
||||
<strut/>
|
||||
<spec><PageUp></spec>
|
||||
<description>
|
||||
<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>
|
||||
<tags><![CDATA[c_<Tab>]]></tags>
|
||||
<strut/>
|
||||
<spec><Tab></spec>
|
||||
<description>
|
||||
<p>
|
||||
Complete the word in front of the cursor according to the behavior specified in
|
||||
<o>wildmode</o>. If <o>wildmode</o> contains "list" and there are multiple matches then
|
||||
the completion menu window is opened.
|
||||
Complete the word in front of the cursor according to the behavior
|
||||
specified in <o>wildmode</o>. If <o>wildmode</o> contains
|
||||
<str>list</str> and there are multiple matches then the completion
|
||||
menu window is opened.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -108,9 +132,10 @@ Command-line mode is used to enter Ex commands (<k>:</k>) and text search patter
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[c_<S-Tab>]]></tags>
|
||||
<strut/>
|
||||
<spec><S-Tab></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
|
||||
@@ -8,62 +8,39 @@
|
||||
<document
|
||||
name="developer"
|
||||
title="&dactyl.appname; Developer information"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="developer-information">Developer information</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<h2 tag="writing-docs documentation">Writing documentation</h2>
|
||||
|
||||
<p>
|
||||
For every new feature, writing documentation is <em>mandatory</em> for the
|
||||
patch to be accepted. The docs are written in an XML dialect similar to
|
||||
XHTML, with a few tags specific to our documentation. For example:
|
||||
In order for any user-visible change to be accepted into the mainline, it
|
||||
must be accompanied by accurate documentation. The docs are written in an
|
||||
XML dialect similar to XHTML, with a few tags specific to our
|
||||
documentation. For example:
|
||||
</p>
|
||||
|
||||
<code><![CDATA[
|
||||
<item>
|
||||
<tags><![CDATA[<F1> :help :h help]]]]><![CDATA[></tags>
|
||||
<spec>:h<oa>elp</oa> <a>subject</a></spec>
|
||||
<spec><![CDATA[<F1>]]]]><![CDATA[></spec>
|
||||
<xml-block><item>
|
||||
<tags><F1> :help :h help</tags>
|
||||
<spec>:h<oa>elp</oa> <oa>subject</oa></spec>
|
||||
<spec><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>.
|
||||
Open the help page. The default page, as specified by <o>helpfile</o> is shown
|
||||
unless <oa>subject</oa> is specified. If you need help for a specific topic, try
|
||||
<ex>:help overview</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
]]></code>
|
||||
</item></xml-block>
|
||||
|
||||
<p>
|
||||
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
|
||||
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.
|
||||
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>
|
||||
|
||||
<h3 tag="help-tags help-xml">Help tags</h3>
|
||||
@@ -80,8 +57,9 @@
|
||||
<dt>h2</dt> <dd>A second-level heading (HelpSubhead)</dd>
|
||||
<dt>h3</dt> <dd>A third-level heading (HelpSubsubhead)</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>warning</dt> <dd><warning style="margin: 0;">A warning paragraph. (HelpWarning)</warning></dd>
|
||||
<dt>note</dt> <dd><note>A note paragraph. (HelpNote)</note></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>
|
||||
<dt>Generic</dt><dd/>
|
||||
@@ -96,19 +74,21 @@
|
||||
<dt>item</dt> <dd>A help entry (HelpItem)</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;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.
|
||||
<em>number</em>, <em>boolean</em>, <em>string</em>, <em>string</em>, <em>stringlist</em>, or <em>charlist</em>.
|
||||
(HelpType)
|
||||
</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;&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>oa</dt> <dd>Optional <oa>argument</oa>. (HelpOptionalArg)</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<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>@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>
|
||||
<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>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;@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.
|
||||
</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>
|
||||
|
||||
<p>
|
||||
Writing &dactyl.appname; plugins is incredibly simple.
|
||||
Plugins are simply JavaScript files which run with full chrome
|
||||
privileges and have full access to the &dactyl.appname; and
|
||||
&dactyl.host; APIs. Each plugin has its own global object,
|
||||
which means that the variables and functions that you create
|
||||
won't pollute the global <em>window</em> or private
|
||||
<em>dactyl</em> namespaces. This means that there's no need
|
||||
to wrap your plugin in a closure, as is often the practice in
|
||||
JavaScript development. Furthermore, any plugin which is
|
||||
installed in your <o>runtimepath</o><em>/plugin</em> directory
|
||||
will find its context stored in
|
||||
<em>plugins.<pluginName></em>, which is often invaluable
|
||||
during development and testing.
|
||||
Writing &dactyl.appname; plugins is incredibly simple. Plugins are
|
||||
simply JavaScript files which run with full chrome privileges and
|
||||
have full access to the &dactyl.appname; and &dactyl.host; APIs.
|
||||
Each plugin has its own global object, which means that the
|
||||
variables and functions that you create won't pollute the global
|
||||
<em>window</em> or private <em>dactyl</em> namespaces. This means
|
||||
that there's no need to wrap your plugin in a closure, as is often
|
||||
the practice in JavaScript development. Furthermore, any plugin
|
||||
which is installed in your <o>runtimepath</o><em>/plugins</em>
|
||||
directory will find its context stored in
|
||||
<em>plugins.<pluginName></em>, which is often invaluable 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>
|
||||
|
||||
<h3 tag="plugin-documentation">Plugin documentation</h3>
|
||||
|
||||
<p>
|
||||
Plugins may provide inline documentation, which will appear on
|
||||
the <ex>:help plugins</ex> page. The markup for help entries
|
||||
is the same as the above, with a few more plugin specific
|
||||
entries. Here is an example from the popular
|
||||
<em>flashblock</em> extension:
|
||||
Plugins should provide inline documentation, which will appear on the
|
||||
<ex>:help plugins</ex> page. The markup for help entries is the same
|
||||
as the above, along with a few extra plugin-specific entries. Here is an
|
||||
example from the popular <em>flashblock</em> extension:
|
||||
</p>
|
||||
|
||||
<code><![CDATA[
|
||||
var INFO =
|
||||
<plugin name="flashblock" version="1.0"
|
||||
href="http://ticket.vimperator.org/9"
|
||||
summary="Flash Blocker"
|
||||
xmlns="http://vimperator.org/namespaces/liberator">
|
||||
<xml-block><escape><hl key="HelpXMLString">use strict</hl>;
|
||||
XML.ignoreWhitespace = <hl key="Boolean">false</hl>;
|
||||
XML.prettyPrinting = <hl key="Boolean">false</hl>;
|
||||
<hl key="HelpXML">var</hl> INFO = <!-- Cursed manual XML highlighting! -->
|
||||
<hl key="HelpXMLTagStart"><plugin
|
||||
<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>
|
||||
<license href="http://opensource.org/licenses/mit-license.php">MIT</license>
|
||||
<project name="Pentadactyl" minVersion="2.0"/>
|
||||
<project name="Pentadactyl" minVersion="1.0"/>
|
||||
<p>
|
||||
This plugin provides the same features as the ever popular FlashBlock
|
||||
Firefox addon. Flash animations are substituted with place holders which
|
||||
play the original animation when clicked. Additionally, this plugin provides
|
||||
options to control which sites can play animations without restrictions, and
|
||||
triggers to toggle the playing of animation on the current page.
|
||||
commandline from the data in a given form.
|
||||
</p>
|
||||
<item>
|
||||
<tags>'flashblock' 'fb'</tags>
|
||||
@@ -206,25 +201,30 @@ var INFO =
|
||||
holders are substituted for flash animations on untrusted sites.
|
||||
</p>
|
||||
</description>
|
||||
</item>]]>
|
||||
<em>…</em><![CDATA[
|
||||
</plugin>;
|
||||
]]>
|
||||
</code>
|
||||
</item>
|
||||
<escape><oa>...</oa>
|
||||
<hl key="HelpXMLTagEnd"></plugin></hl></escape>;</xml-block>
|
||||
|
||||
<p>
|
||||
The inline XML is made possible by
|
||||
<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
|
||||
to find it. 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.
|
||||
to find it. The XML property changes are not compulsory, but
|
||||
they do prevent certain formatting problems that may occur
|
||||
otherwise. Beginning your file with <str>use strict</str>, while
|
||||
not required, helps to prevent a lot of common errors.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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>
|
||||
|
||||
</document>
|
||||
|
||||
@@ -6,23 +6,40 @@
|
||||
<document
|
||||
name="eval"
|
||||
title="&dactyl.appname; Expression Evaluation"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<h1 tag="expression expr eval">Expression evaluation</h1>
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="expression expr eval javascript">Expression evaluation</h1>
|
||||
<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>
|
||||
<tags>:ec :echo</tags>
|
||||
<spec>:ec<oa>ho</oa> <a>expr</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Echo the expression. Useful for showing informational messages. Multiple lines
|
||||
can be separated by \n. <a>expr</a> can either be a quoted string, or any expression
|
||||
which can be fed to eval() like 4+5. You can also view the source code of
|
||||
objects and functions if the return value of <a>expr</a> is an object or function.
|
||||
Echo a JavaScript expression. <a>expr</a> may be a simple quoted
|
||||
string, in which case it is shown in the statusline, or any
|
||||
arbitrary JavaScript expression. If the expression results in
|
||||
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>See also <ex>:javascript</ex></p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -56,12 +73,15 @@
|
||||
<spec>:exe<oa>cute</oa> <a>expr</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Execute the string that results from the evaluation of <a>expr</a> as an Ex command.
|
||||
Example: <ex>:execute "source " + io.getRCFile().path</ex> sources the appropriate
|
||||
RC file.
|
||||
Execute the ex command string that results from the evaluation of
|
||||
the JavaScript expression <a>expr</a>. For example,
|
||||
</p>
|
||||
<code><ex>:execute "open " + content.location.host</ex></code>
|
||||
<p>
|
||||
opens the homepage of the currently opened site.
|
||||
</p>
|
||||
|
||||
<p>Note: Unlike Vim this currently only supports a single argument.</p>
|
||||
<note>Unlike Vim this only supports a single argument.</note>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -69,30 +89,51 @@
|
||||
<item>
|
||||
<tags>:js :javas :javascript</tags>
|
||||
<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>
|
||||
<description>
|
||||
<p>
|
||||
Run any JavaScript command through eval(). Acts as a JavaScript interpreter by
|
||||
passing the argument to <tt>eval()</tt>.
|
||||
<ex>:javascript alert(<str>Hello world</str>)</ex> shows
|
||||
a dialog box with the text "Hello world".
|
||||
<ex>:javascript <<EOF</ex> reads all the lines
|
||||
until a line starting with "EOF"
|
||||
is found, and interpret them with the JavaScript <em>eval()</em> function.
|
||||
Evaluates the given <a>cmd</a> as JavaScript. Behaves exactly as
|
||||
<ex>:echo</ex>, except that the result is not printed. Any
|
||||
exception raised by the evaluation will, however, be displayed as
|
||||
an error message and appended to <ex>:messages</ex>.
|
||||
</p>
|
||||
|
||||
<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>
|
||||
The special version <ex>:javascript!</ex> opens the JavaScript console of
|
||||
&dactyl.host;.
|
||||
</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>
|
||||
</item>
|
||||
|
||||
@@ -104,9 +145,10 @@
|
||||
<spec>:let</spec>
|
||||
<description>
|
||||
<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
|
||||
displayed. Without arguments, displays a list of all variables.
|
||||
This functionality has few useful applications and so is deprecated.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -117,8 +159,8 @@
|
||||
<spec>:unl<oa>et</oa><oa>!</oa> <a>name</a> …</spec>
|
||||
<description>
|
||||
<p>
|
||||
Deletes the variable <a>name</a>. Several variable names can be given. When used
|
||||
with <oa>!</oa> no error message is output for non-existing variables.
|
||||
Deletes the named variables. When <oa>!</oa> is given, no error
|
||||
message is output for non-existing variables.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,29 +6,33 @@
|
||||
<document
|
||||
name="gui"
|
||||
title="&dactyl.appname; GUI"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<h1 tag="gui">&dactyl.appname;'s GUI</h1>
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:dactyl="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="gui">&dactyl.host;'s GUI</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<p>
|
||||
Although &dactyl.appname; offers the most frequently used &dactyl.host; functionality via
|
||||
Ex and Normal mode commands there may be times when directly accessing the GUI
|
||||
is required. There are commands for accessing the menu system, standard dialogs
|
||||
and the sidebar.
|
||||
Although &dactyl.appname; offers access to the most frequently used
|
||||
&dactyl.host; functionality via Ex and Normal mode commands, there may be
|
||||
times when direct access to the &dactyl.host; GUI is required. For such
|
||||
eventualities, there there are commands to access menu items and to launch
|
||||
standard &dactyl.host; dialogs.
|
||||
</p>
|
||||
|
||||
<h2 tag="menu">Menus</h2>
|
||||
|
||||
<item>
|
||||
<tags>:emenu</tags>
|
||||
<strut/>
|
||||
<spec>:emenu <a>menu</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
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
|
||||
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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -38,13 +42,14 @@
|
||||
|
||||
<item>
|
||||
<tags>:addo :addons</tags>
|
||||
<strut/>
|
||||
<spec>:addo<oa>ns</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Show available &dactyl.host; Extensions and Themes.
|
||||
You can add/remove/disable browser extensions from this dialog.
|
||||
Be aware that not all &dactyl.host; extensions work, because &dactyl.appname; overrides
|
||||
some key bindings and changes &dactyl.host;'s GUI.
|
||||
Opens the &dactyl.host; addon manager, where extensions and themes
|
||||
may be installed, removed, disabled, and configured. See also
|
||||
<ex>:extenstions</ex>, <ex>:extinstall</ex>, <ex>:extoptions</ex>,
|
||||
<ex>:extenable</ex>, <ex>:extdisable</ex>, and <ex>:extdelete</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -54,9 +59,8 @@
|
||||
<tags>:dia :dialog</tags>
|
||||
<spec>:dia<oa>log</oa> <oa>&dactyl.host;-dialog</oa></spec>
|
||||
<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">
|
||||
<dt>about</dt> <dd>About Mozilla &dactyl.host;;</dd>
|
||||
<dt>addbookmark</dt> <dd>Add bookmark for the current page</dd>
|
||||
@@ -90,11 +94,13 @@
|
||||
|
||||
<item>
|
||||
<tags>:dl :downl :downloads</tags>
|
||||
<strut/>
|
||||
<spec>:downl<oa>oads</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Show progress of current downloads. Open the original &dactyl.host; download dialog
|
||||
in a new tab. Here, downloads can be paused, canceled and resumed.
|
||||
Show progress of current downloads. Open the standard &dactyl.host;
|
||||
download dialog in a new tab. Here, downloads can be paused,
|
||||
resumed, and canceled.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -104,9 +110,12 @@
|
||||
|
||||
<item>
|
||||
<tags>:exta :extadd</tags>
|
||||
<spec>:exta<oa>dd</oa> <a>file</a></spec>
|
||||
<spec>:exta<oa>dd</oa> <a>file|url</a></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -162,8 +171,8 @@
|
||||
|
||||
<item>
|
||||
<tags>:exto :extoptions</tags>
|
||||
<tags>:extp :extpreferences</tags>
|
||||
<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>
|
||||
<description>
|
||||
<p>
|
||||
@@ -179,7 +188,7 @@
|
||||
<item>
|
||||
<tags>:sbcl :sbclose</tags>
|
||||
<spec>:sbcl<oa>ose</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Close the sidebar window.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -212,36 +221,43 @@
|
||||
|
||||
<ul>
|
||||
<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.
|
||||
</li>
|
||||
<li>
|
||||
History and bookmark status ([+-❤]): The position of the current page in
|
||||
the tab's session history; + and - indicate that it's possible to move
|
||||
<em>History and bookmark status</em> (<em>[+-❤]</em>): The position of the current page in
|
||||
the tab's session history; + and - indicate that it is possible to move
|
||||
backwards and forwards through the history respectively. ❤ indicates that
|
||||
the current page is bookmarked.
|
||||
</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.
|
||||
</li>
|
||||
<li>
|
||||
Vertical scroll: The vertical scroll percentage of the current buffer.
|
||||
This is a percentage or Top for 0% and Bot for 100%.
|
||||
<em>Vertical scroll</em>: The vertical scroll percentage of the current buffer,
|
||||
or Top or Bot for the top and bottom of the buffer respectively.
|
||||
</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
|
||||
current security status of the loaded page.
|
||||
<ul>
|
||||
<li>black – the site's identity is unverified and the connection is unencrypted</li>
|
||||
<li>blue – the site's domain has been verified and the connection is encrypted</li>
|
||||
<li>green – the site's domain and owner have been fully verified via an</li>
|
||||
</ul>
|
||||
Extended Validation certificate and the connection is encrypted
|
||||
<dl>
|
||||
<dt style="border:1px solid white" dactyl:highlight="StatusLine">black</dt>
|
||||
<dd>The site's identity is unverified and the connection is unencrypted</dd>
|
||||
|
||||
<dt style="border:1px solid white" dactyl:highlight="StatusLineBroken">red</dt>
|
||||
<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>
|
||||
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.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -6,102 +6,127 @@
|
||||
<document
|
||||
name="hints"
|
||||
title="&dactyl.appname; Hints"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="quick-hints hints">Hints</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
Hints are the way in which &dactyl.appname; allows you to follow links on a page. By
|
||||
providing each link with a suitable hint, you can access all links with a
|
||||
similar amount of minimal effort. This contrasts strongly with the traditional
|
||||
approaches offered by the mouse, in which you must first find and then aim for
|
||||
the link you would like, and by using repeated tabbing which quickly becomes
|
||||
tedious unless you always visit the first link on a page.
|
||||
<p>
|
||||
Hints are an easy way to interact with web pages without using
|
||||
your mouse. In hint mode, &dactyl.appname; highlights and
|
||||
numbers all clickable elements. The elements can be selected
|
||||
either by typing their numbers, or typing parts of their text to
|
||||
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>
|
||||
<tags>f</tags>
|
||||
<tags>quick-hints</tags>
|
||||
<tags>f QuickHint</tags>
|
||||
<strut/>
|
||||
<spec>f<a>hint</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Start QuickHint mode. In QuickHint mode, every hintable item
|
||||
(according to the <o>hinttags</o> XPath query) is assigned a
|
||||
unique number. You can either type this number or type part of the
|
||||
link text as specified by the <o>hintmatching</o> option, and it
|
||||
is followed as soon as it can be uniquely identified. Often it can
|
||||
be useful to combine these techniques to narrow down results with
|
||||
some letters, and then typing a single digit to make the match
|
||||
unique. Pressing <k name="Leader"/> (defaults to
|
||||
<ex>:let mapleader = "\"</ex>) toggles "escape-mode", where numbers are
|
||||
treated as normal text. <k name="Esc"/> stops this mode at any
|
||||
time.
|
||||
Start <t>QuickHint</t> mode. In this mode, every clickable
|
||||
element (as definied by the <o>hinttags</o> option) is
|
||||
highlighted and numbered. Elements can be selected
|
||||
either by typing their number, or by typing part of
|
||||
their text to narrow down the result. When an element
|
||||
has been selected, it is automatically clicked and hint
|
||||
mode ends. Additionally, the following keys have
|
||||
special meanings in QuickHint mode:
|
||||
</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>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<tags>F</tags>
|
||||
<strut/>
|
||||
<spec>F<a>hint</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Start QuickHint mode, but open link in a new tab. Like normal QuickHint
|
||||
mode (activated with <k>f</k>) but opens the link in a new tab. The new
|
||||
tab will be loaded in background according to the
|
||||
<str>browser.tabs.loadInBackground</str> &dactyl.host; preference.
|
||||
Start <t>QuickHint</t> mode, but the selected elements
|
||||
are clicked with the <k name="Shift"/> key pressed,
|
||||
which has the normal effect of opening it in a new tab
|
||||
(depending on the value of the
|
||||
<pref>browser.tabs.loadInBackground</pref> preference).
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
<tags>extended-hints</tags>
|
||||
|
||||
<item>
|
||||
<tags>;</tags>
|
||||
<spec>;<a>mode</a><a>empty</a><a>hint</a></spec>
|
||||
<tags>extended-hints</tags>
|
||||
<tags>; ExtendedHint</tags>
|
||||
<strut/>
|
||||
<spec>;<a>mode</a><a>hint</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Start an extended hint mode. ExtendedHint mode is useful for
|
||||
performing operations on hinted elements other than the default
|
||||
left mouse click. For example, you can yank link locations, open
|
||||
them in a new window or save images. If you want to yank the
|
||||
location of hint <em>24</em>, press <k>;y</k> to start this hint
|
||||
mode. Then press <em>24</em> to copy the hint location.
|
||||
Start an extended hint mode. <t>ExtendedHint</t> mode is
|
||||
exactly like <t>QuickHint</t> mode, except that each
|
||||
sub-mode highlights a more specialized set of elements,
|
||||
and performs a unique action on the selected link.
|
||||
Because of the panoply of extend hint modes available,
|
||||
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><a>mode</a> can be one of:</p>
|
||||
<p><a>mode</a> may be one of:</p>
|
||||
|
||||
<ul>
|
||||
<li><tag>;;</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>;s</tag> <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>;f</tag> <em>f</em> to focus a frame</li>
|
||||
<li><tag>;o</tag> <em>o</em> to open its location in the current tab</li>
|
||||
<li><tag>;t</tag> <em>t</em> to open its location in a new tab</li>
|
||||
<li><tag>;b</tag> <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>;F</tag> <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>;T</tag> <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>;v</tag> <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>;y</tag> <em>y</em> to yank its destination location</li>
|
||||
<li><tag>;Y</tag> <em>Y</em> to yank its text description</li>
|
||||
<li><tag>;c</tag> <em>c</em> to open its context menu</li>
|
||||
<li><tag>;i</tag> <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=";;"><em>;</em> to focus a link and hover it with the mouse</li>
|
||||
<li tag=";?"><em>?</em> to show information about the element (incomplete)</li>
|
||||
<li tag=";s"><em>s</em> to save its destination</li>
|
||||
<li tag=";a"><em>a</em> to save its destination (prompting for save location)</li>
|
||||
<li tag=";f"><em>f</em> to focus a frame</li>
|
||||
<li tag=";o"><em>o</em> to open its location in the current tab</li>
|
||||
<li tag=";t"><em>t</em> to open its location in a new tab</li>
|
||||
<li tag=";b"><em>b</em> to open its location in a new background tab</li>
|
||||
<li tag=";w"><em>w</em> to open its destination in a new window</li>
|
||||
<li tag=";F"><em>F</em> to follow a sequence of <k name="CR"/>-delimited hints in background tabs</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"><em>T</em> to generate a <ex>:tabopen</ex> with hint's URL (like <k>;T</k>)</li>
|
||||
<li tag=";W"><em>W</em> to generate a <ex>:winopen</ex> with hint's URL</li>
|
||||
<li tag=";v"><em>v</em> to view its destination source</li>
|
||||
<li tag=";V"><em>V</em> to view its destination source in the external editor</li>
|
||||
<li tag=";y"><em>y</em> to yank its destination location</li>
|
||||
<li tag=";Y"><em>Y</em> to yank its text description</li>
|
||||
<li tag=";c"><em>c</em> to open its context menu</li>
|
||||
<li tag=";i"><em>i</em> to open an image</li>
|
||||
<li tag=";I"><em>I</em> to open an image in a new tab.</li>
|
||||
</ul>
|
||||
|
||||
<!-- TODO: These are completely arbitrary and need to be
|
||||
- changed before release. Hopefully they will be...
|
||||
-->
|
||||
<p>
|
||||
Depending on the value of <o>complete</o>, you can get a list of
|
||||
extended hint modes by pressing <k name="Tab"/> from the <k>;</k>
|
||||
prompt.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Hintable elements for all extended hint modes can be set in the
|
||||
<o>extendedhinttags</o> XPath string.
|
||||
Of the previous modes, the value of the <o>hinttags</o>
|
||||
option os used to choose the highlighted elements for
|
||||
the modes, <k>;;</k>, <k>;?</k>, <k>;w</k>, <k>;v</k>,
|
||||
<k>;V</k>, <k>;Y</k> and <k>;c</k>. The value of
|
||||
<o>extendedhinttags</o> is used to choose the elements
|
||||
for, <k>;s</k>, <k>;a</k>, <k>;o</k>, <k>;t</k>,
|
||||
<k>;b</k>, <k>;O</k>, <k>;T</k>, <k>;W</k>, <k>;y</k>,
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<document
|
||||
name="index"
|
||||
title="&dactyl.appname; Index"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="index">Index</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
|
||||
@@ -6,21 +6,23 @@
|
||||
<document
|
||||
name="insert"
|
||||
title="&dactyl.appname; Insert Mode"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="Insert-mode Insert mode-insert">Insert mode</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<!-- TODO: This makes no sense. Rewrite. -->
|
||||
|
||||
<p>
|
||||
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
|
||||
Insert mode.
|
||||
the <o>insertmode</o> option is set, insert mode is immediately
|
||||
entered when focusing a text area.
|
||||
</p>
|
||||
|
||||
<item>
|
||||
<tags>i_i</tags>
|
||||
<spec>i_i</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Starts Insert mode in text areas when <o>insertmode</o> is not set.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -32,7 +34,7 @@
|
||||
<item>
|
||||
<tags><![CDATA[i_<C-i>]]></tags>
|
||||
<spec><C-i></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Launch the external editor. See the <o>editor</o> option.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -41,7 +43,7 @@
|
||||
<item>
|
||||
<tags><![CDATA[i_<C-]>]]></tags>
|
||||
<spec><C-]></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Expand an Insert-mode abbreviation.</p>
|
||||
</description>
|
||||
</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"?>
|
||||
|
||||
<!DOCTYPE document SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||
@@ -6,39 +6,71 @@
|
||||
<document
|
||||
name="map"
|
||||
title="&dactyl.appname; Key Mappings"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<h1>Key mappings, abbreviations, and user-defined commands</h1>
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="keyboard-shortcuts">Keyboard shortcuts and commands</h1>
|
||||
<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>
|
||||
|
||||
<p>
|
||||
The key mapping commands can be used to either redefine the standard key
|
||||
bindings or define new ones. A mapping consists of a key, or <t>key-sequence</t>,
|
||||
which is translated to a string of characters. Example:
|
||||
</p>
|
||||
<code><ex>:map <k name="F2"/> :echo new Date().toDateString()<k name="CR"/></ex></code>
|
||||
<p>
|
||||
will echo the current date to the command line when <k name="F2"/> is pressed.
|
||||
Key mappings are the most basic means &dactyl.appname; provides
|
||||
for altering the actions of key presses. Each key mapping is
|
||||
associated with a mode, such as <link topic="insert-mode">insert</link>,
|
||||
<link topic="normal-mode">normal</link>, or
|
||||
<link topic="command-line-mode">command-line</link>, and only
|
||||
has effect when that mode is active. Although each mode has a
|
||||
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>
|
||||
|
||||
<tags>:map-modes</tags>
|
||||
<code><ex>:map <k name="F2"/></ex> <ex>:echo Date()<k name="CR"/></ex></code>
|
||||
|
||||
<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>
|
||||
|
||||
<ul>
|
||||
<li>Normal mode: When browsing normally</li>
|
||||
<li>Visual mode: When selecting text with the cursor keys</li>
|
||||
<li>Insert mode: When interacting with text fields on a website</li>
|
||||
<li>Command-line mode: When typing into the &dactyl.appname; command line</li>
|
||||
</ul>
|
||||
<p tag=":map-modes">
|
||||
Standard key mapping commands are provided for the four most
|
||||
common modes,
|
||||
</p>
|
||||
|
||||
<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>
|
||||
Mappings are NOT saved between sessions, make sure you put them in your
|
||||
&dactyl.name;rc file!
|
||||
It is important to note that mappings are <em>not</em>
|
||||
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>
|
||||
|
||||
<h3 tag=":map-commands">Map commands</h3>
|
||||
@@ -56,8 +88,16 @@
|
||||
<spec>:cm<oa>ap</oa> <a>lhs</a> <a>rhs</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for the applicable mode(s). The <a>rhs</a> is
|
||||
remapped, allowing for nested and recursive mappings.
|
||||
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for
|
||||
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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -76,9 +116,14 @@
|
||||
<spec>:cno<oa>remap</oa> <a>lhs</a> <a>rhs</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for the applicable mode(s). No remapping of
|
||||
the <a>rhs</a> is performed.
|
||||
Map the <t>key-sequence</t> <a>lhs</a> to <a>rhs</a> for
|
||||
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>
|
||||
<code><ex>:noremap d D</ex>
|
||||
<ex>:noremap D d</ex></code>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -113,8 +158,7 @@
|
||||
<spec>:cmapc<oa>lear</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Remove all mappings for the applicable mode(s). All user-defined mappings are
|
||||
cleared.
|
||||
Remove all user-defined mappings for the applicable mode(s).
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -155,12 +199,12 @@
|
||||
<tags>:map-<silent></tags>
|
||||
|
||||
<p>
|
||||
When the first argument to one of the mapping commands is <k name="silent"/>,
|
||||
<a>rhs</a> is not echoed to the command line, nor, for that matter, anything
|
||||
else until the command has completed.
|
||||
When the first argument to one of the mapping commands is
|
||||
<k name="silent"/>, the keys in <a>rhs</a> are not shown in the
|
||||
command line as they are generated. Nor, for that matter, is
|
||||
anything else until the command has completed.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
Below is an overview of which modes each map command applies to:
|
||||
</p>
|
||||
@@ -175,70 +219,110 @@
|
||||
:cmap :cnoremap :cunmap :cmapclear – Command-line mode
|
||||
</code>
|
||||
|
||||
<h3 tag="key-notation,key-sequence">Key sequences</h3>
|
||||
<h3 tag="key-notation key-sequence">Key sequences</h3>
|
||||
|
||||
<p>
|
||||
For most keys, the key-sequence is the same as the character you see when you
|
||||
type that key, however there are some exceptions which allow for a much larger
|
||||
number of keys to be used in mappings.
|
||||
Most keys in key sequences are represented simply by the
|
||||
character that you see on the screen when you type them.
|
||||
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>
|
||||
|
||||
<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>
|
||||
<k name="Left"/> <k name="Right"/> <k name="Up"/>
|
||||
<k name="Down"/> <k name="PageUp"/> <k name="PageDown"/>
|
||||
<k name="Esc"/> <k name="CR"/> (for carriage return/enter)
|
||||
The first argument to the <ex>:map</ex> commands must be
|
||||
<link topic="quoting">quoted</link> if it contains spaces,
|
||||
quotation marks or back-slashes. A space may additionally be
|
||||
typed as <k name="Space"/>.
|
||||
</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="K0"/> through <k name="K9"/> represent keys on the
|
||||
numeric keypad.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Most keyboards have some modifiers such as the control, alt or meta keys. In
|
||||
order to create a mapping that uses these keys the correct prefix must be used
|
||||
within the angle brackets.
|
||||
In order to represent key presses using the Control, Alt, Meta,
|
||||
or Shift keys, the following prefixes may be used,
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li><k name="C-x"/>: The control or ctrl key.</li>
|
||||
<li><k name="A-x"/>: The alt key.</li>
|
||||
<li><k name="M-x"/>: The meta key, windows key, or command key</li>
|
||||
<li><k name="S-x"/>: The shift key.</li>
|
||||
<li><k name="C-␣"/>: The control or ctrl key.</li>
|
||||
<li><k name="A-␣"/>: The alt key.</li>
|
||||
<li><k name="M-␣"/>: The meta key, windows key, or command key</li>
|
||||
<li><k name="S-␣"/>: The shift key.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
These prefixes can be combined however you see fit, though you should note that
|
||||
within angle brackets all alphabetic characters are read as lowercase. In order
|
||||
to force them to be uppercase, you must specify the S- prefix as well.
|
||||
Additionally, you should never use the S- prefix with a number or piece of
|
||||
punctuation, even if you require a shift to type that character; doing so will
|
||||
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:
|
||||
These prefixes can be combined however you see fit, though you
|
||||
should note that within angle brackets all alphabetic characters
|
||||
are read as lowercase. Uppercase characters can only be
|
||||
specified with the <em>S-</em> modifier. The following key
|
||||
sequences are interperated as described,
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li><k>xc</k>: type x, and then type c</li>
|
||||
<li><k name="C-x">c</k>: hold control and type x, then type c without control</li>
|
||||
<li><k name="C-2"/>: type 2 while holding control</li>
|
||||
<li><k name="C-@"/>: type @ while holding control</li>
|
||||
<li><k name="S-Space"/>: press space while holding shift</li>
|
||||
<li><k name="C-A-j"/>: press j while holding control and alt</li>
|
||||
<li><k name="C-A-J"/>: exactly the same as above</li>
|
||||
<li><k name="C-A-S-j"/>: press J while holding control and alt</li>
|
||||
</ol>
|
||||
<dl>
|
||||
<dt><k>xc</k></dt>
|
||||
<dd>Type the ‘X’ key followed by the ‘C’ key</dd>
|
||||
|
||||
<dt><k name="C-x">c</k></dt>
|
||||
<dd>
|
||||
Type the ‘X’ key while holding the ‘Control’ key, followed
|
||||
by the ‘C’ key.
|
||||
</dd>
|
||||
|
||||
<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>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Nop>]]></tags>
|
||||
<strut/>
|
||||
<spec><Nop></spec>
|
||||
<description>
|
||||
<p>
|
||||
Do nothing. This command is useful for disabling a specific mapping.
|
||||
<ex>:map <k name="C-n"/> <k name="Nop"/></ex> will prevent <k name="C-n"/> from doing anything.
|
||||
Do nothing. This pseudo-key is useful for disabling a
|
||||
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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -246,6 +330,7 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<CR> map_return]]></tags>
|
||||
<strut/>
|
||||
<spec><CR></spec>
|
||||
<description>
|
||||
<p>
|
||||
@@ -258,20 +343,21 @@
|
||||
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Leader> mapleader]]></tags>
|
||||
<tags><![CDATA[<Leader> mapleader \]]></tags>
|
||||
<strut/>
|
||||
<spec><Leader></spec>
|
||||
<description>
|
||||
<p>
|
||||
Expands to the value of the "mapleader" variable in key mapping. If
|
||||
"mapleader" is unset or empty then <str>\</str> is used. Example:
|
||||
Expands to the value of the ‘mapleader’ variable in key mapping. If
|
||||
‘mapleader’ is unset or empty then ‘\’ is used. For example, by default,
|
||||
</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>
|
||||
<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>
|
||||
<code><ex>let mapleader = <str>,</str></ex></code>
|
||||
<code><ex>:let mapleader = <str>,</str></ex></code>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
@@ -279,27 +365,27 @@
|
||||
<h2 tag="abbreviations">Abbreviations</h2>
|
||||
|
||||
<p>
|
||||
&dactyl.appname; can automatically replace words identified as abbreviations,
|
||||
which may be used to save typing or to correct commonly misspelled
|
||||
words. An abbreviation can be one of three types that are defined by the
|
||||
types of constituent characters. Whitespace and quotes are non-keyword
|
||||
types, and all other characters are keyword types.
|
||||
In addition to basic mappings, &dactyl.appname; can also
|
||||
automatically replace whole words after they've been typed.
|
||||
These shortcuts are known as abbreviations, and are most often
|
||||
useful for correcting spelling of commonly mistyped words, as
|
||||
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>
|
||||
|
||||
<ol>
|
||||
<li>A "full-id" abbreviation consists 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>A "non-id" abbreviation ends in a non-keyword character but otherwise contains any non-whitespace character (e.g., "def'").</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>‘full-id’ abbreviations consist entirely of keyword characters (e.g., ‘teh’, ‘msoft’).</li>
|
||||
<li>‘end-id’ abbreviations end in keyword character but otherwise contains all non-keyword characters (e.g., ‘'i’).</li>
|
||||
<li>‘non-id’ abbreviations end in a non-keyword character but otherwise contains any non-whitespace character (e.g., ‘def'’).</li>
|
||||
<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>
|
||||
Strings that cannot be abbreviations include "a'b" and "a b".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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.
|
||||
For the purposes of abbreviations, keyword characters include
|
||||
all non-whitespace characters except for single or double
|
||||
quotation marks. Abbreviations are expanded as soon as any
|
||||
non-keyword character, or the key <k name="C-]"/>, is typed.
|
||||
</p>
|
||||
|
||||
<item>
|
||||
@@ -309,9 +395,10 @@
|
||||
<spec>:ab<oa>breviate</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Abbreviate a key sequence. Abbreviate <a>lhs</a> to <a>rhs</a>. If only <a>lhs</a> is given,
|
||||
list all abbreviations that start with <a>lhs</a>. If no arguments are given,
|
||||
list all abbreviations.
|
||||
Abbreviate <a>lhs</a> to <a>rhs</a>. If only <a>lhs</a>
|
||||
is given, list all abbreviations that start with
|
||||
<a>lhs</a>. If no arguments are given, list all
|
||||
abbreviations.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -324,8 +411,9 @@
|
||||
<spec>:ca<oa>bbrev</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Abbreviate a key sequence for Command-line mode. Same as <ex>:ab<oa>breviate</oa></ex>,
|
||||
but for Command-line mode only.
|
||||
Abbreviate a key sequence for Command-line mode. Same as
|
||||
<ex>:ab<oa>breviate</oa></ex>, but for
|
||||
<t>command-line</t> mode only.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -338,8 +426,8 @@
|
||||
<spec>:ia<oa>bbrev</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Abbreviate a key sequence for Insert mode. Same as <ex>:ab<oa>breviate</oa></ex> but
|
||||
for Insert mode only.
|
||||
Abbreviate a key sequence for Insert mode. Same as
|
||||
<ex>:ab<oa>breviate</oa></ex>, but for insert mode only.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -359,8 +447,9 @@
|
||||
<spec>:cuna<oa>bbrev</oa> <a>lhs</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Remove an abbreviation for Command-line mode. Same as <ex>:una<oa>bbreviate</oa></ex>,
|
||||
but for Command-line mode only.
|
||||
Remove an abbreviation for Command-line mode. Same as
|
||||
<ex>:una<oa>bbreviate</oa></ex>, but for
|
||||
<t>command-line</t> mode only.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -371,8 +460,9 @@
|
||||
<spec>:iuna<oa>bbrev</oa> <a>lhs</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Remove an abbreviation for Insert mode. Same as <ex>:una<oa>bbreviate</oa></ex> but for
|
||||
Insert mode only.
|
||||
Remove an abbreviation for Insert mode. Same as
|
||||
<ex>:una<oa>bbreviate</oa></ex> but for Insert mode
|
||||
only.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -381,7 +471,7 @@
|
||||
<item>
|
||||
<tags>:abc :abclear</tags>
|
||||
<spec>:abc<oa>lear</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Remove all abbreviations.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -390,8 +480,8 @@
|
||||
<item>
|
||||
<tags>:cabc :cabclear</tags>
|
||||
<spec>:cabc<oa>lear</oa></spec>
|
||||
<description>
|
||||
<p>Remove all abbreviations for Command-line mode.</p>
|
||||
<description short="true">
|
||||
<p>Remove all abbreviations for command-line mode.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -399,7 +489,7 @@
|
||||
<item>
|
||||
<tags>:iabc :iabclear</tags>
|
||||
<spec>:iabc<oa>lear</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Remove all abbreviations for Insert mode.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -407,10 +497,21 @@
|
||||
|
||||
<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>
|
||||
<tags>:com :command</tags>
|
||||
<spec>:com<oa>mand</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>List all user-defined commands.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -428,22 +529,34 @@
|
||||
<spec>:com<oa>mand</oa><oa>!</oa> <oa><a>attr</a>…</oa> <a>cmd</a> <a>rep</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Define a new user command. The name of the command is <a>cmd</a> and its replacement
|
||||
text is <a>rep</a>. The command's attributes are <a>attr</a>. If a command with this name
|
||||
already exists an error is reported unless <oa>!</oa> is specified, in which case the
|
||||
command is redefined. Unlike Vim, the command may start with a lowercase
|
||||
letter.
|
||||
Define a new user command. The name of the command is
|
||||
<a>cmd</a> and its replacement text is <a>rep</a>. If a
|
||||
command with this name already exists, an error is
|
||||
reported unless <oa>!</oa> is specified, in which case
|
||||
the command is redefined. Unlike Vim, the command may
|
||||
start with a lowercase letter.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The command's behavior can be specified by providing attributes when the
|
||||
command is defined.
|
||||
The new command is usually defined by a string to be
|
||||
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 tag="E175 E176 :command-nargs">
|
||||
Argument handling
|
||||
<p>
|
||||
The command's behavior can be altered by providing
|
||||
attributes when the command is defined.
|
||||
</p>
|
||||
|
||||
<h3 tag="E175 E176 :command-nargs">Argument handling</h3>
|
||||
|
||||
<p>
|
||||
By default user commands accept no arguments. This can be changed by specifying
|
||||
the -nargs attribute.
|
||||
@@ -459,9 +572,7 @@
|
||||
<dt>-nargs=+</dt><dd>One or more arguments are allowed</dd>
|
||||
</dl>
|
||||
|
||||
<p tag="E180 E181 :command-complete">
|
||||
Argument completion
|
||||
</p>
|
||||
<h3 tag="E180 E181 :command-complete">Argument completion</h3>
|
||||
|
||||
<p>
|
||||
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>
|
||||
</dl>
|
||||
|
||||
<p tag="E467 E468 :command-completion-custom">
|
||||
Custom completion
|
||||
</p>
|
||||
<h3 tag="E467 E468 :command-completion-custom">Custom completion</h3>
|
||||
|
||||
<p>
|
||||
Custom completion can be provided by specifying the <str>custom,<a>func</a></str> argument to
|
||||
@@ -516,9 +625,7 @@
|
||||
|
||||
<!-- TODO: add examples -->
|
||||
|
||||
<p tag="E177 E178 :command-count">
|
||||
Count handling
|
||||
</p>
|
||||
<h3 tag="E177 E178 :command-count">Count handling</h3>
|
||||
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
|
||||
<p tag=":command-bang">
|
||||
Special cases
|
||||
</p>
|
||||
<h3 tag=":command-bang">Special cases</h3>
|
||||
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
|
||||
<p tag=":command-description">
|
||||
Command description
|
||||
</p>
|
||||
<h3 tag=":command-description">Command description</h3>
|
||||
|
||||
<p>
|
||||
The command's description text can be set with -description. Otherwise it will
|
||||
default to "User-defined command".
|
||||
</p>
|
||||
|
||||
<p tag=":command-replacement-text">
|
||||
Replacement text
|
||||
</p>
|
||||
<h3 tag=":command-replacement-text">Replacement text</h3>
|
||||
|
||||
<p>
|
||||
The replacement text <a>rep</a> is scanned for escape sequences and these are
|
||||
@@ -580,7 +681,7 @@
|
||||
<item>
|
||||
<tags>:comc :comclear</tags>
|
||||
<spec>:comc<oa>lear</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Delete all user-defined commands.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,89 +6,131 @@
|
||||
<document
|
||||
name="marks"
|
||||
title="&dactyl.appname; Marks"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<h1 tag="different-marks marks">Marks</h1>
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="marks">Marks</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<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>
|
||||
|
||||
<ul>
|
||||
<li>Bookmarks which allow you to mark a web page as one of your favorites for easy access.</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>Local marks to store the position within a 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>Bookmarks</em> are the standard marks of &dactyl.host;, and are fully supported.</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><em>Local marks</em> allow you to store and return to a position within the current web page.</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>
|
||||
|
||||
<h1 tag="bookmarks">Bookmarks</h1>
|
||||
<toc start="2"/>
|
||||
<h2 tag="bookmarks">Bookmarks</h2>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
<description>
|
||||
<p>Add a bookmark.</p>
|
||||
|
||||
<p>The following options are interpreted:</p>
|
||||
<p>The following options are available,</p>
|
||||
|
||||
<ul>
|
||||
<li>-title="custom title" (short option: -t)</li>
|
||||
<li>-tag=comma,separated,tag,list (short option: -T)</li>
|
||||
<li>-keyword=keyword (short option: -k)</li>
|
||||
</ul>
|
||||
<dl>
|
||||
<dt>-title</dt>
|
||||
<dd>
|
||||
The title of the bookmark.
|
||||
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>
|
||||
If [!] is present, a new bookmark is always added. Otherwise, the first
|
||||
bookmark matching <oa>url</oa> is updated.
|
||||
If <oa>url</oa> is omitted, the URL currently loaded web
|
||||
page is used.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When creating a new bookmark, if <oa>-title</oa> isn't given, either the web
|
||||
page's title or URL is used. You can omit the optional <oa>url</oa> argument, so
|
||||
just do <ex>:bmark</ex> to bookmark the currently loaded web page with a default
|
||||
title and without any tags.
|
||||
If <oa>!</oa> is present, a new bookmark is always
|
||||
added. Otherwise, the first bookmark matching
|
||||
<oa>url</oa> is updated.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>A</tags>
|
||||
<strut/>
|
||||
<spec>A</spec>
|
||||
<description>
|
||||
<p>
|
||||
Toggle bookmarked state of current URL. Add/remove a bookmark for the current
|
||||
location, depending on if it is already bookmarked or not. In contrast to the
|
||||
<ex>:bmark</ex> command, the bookmark is just <em>starred</em> which means it is placed
|
||||
in the <em>Unfiled Bookmarks Folder</em> instead of the bookmarks menu.
|
||||
Toggle bookmarked state of current URL. Add/remove a
|
||||
bookmark for the current location, depending on whether
|
||||
it is currently bookmarked. New bookmarks are placed in
|
||||
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>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>:bmarks</tags>
|
||||
<spec>:bmarks[!] <oa>filter</oa></spec>
|
||||
<spec>:bmarks<oa>!</oa> <oa>filter</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
List or open multiple bookmarks. Open the message window at the bottom of the
|
||||
screen with all bookmarks which match <oa>filter</oa> either in the title or
|
||||
URL. You can then use extended hint commands like <k>;o</k> to open the desired
|
||||
bookmark.
|
||||
List or open multiple bookmarks. Opens the message window
|
||||
at the bottom of the screen with all bookmarks with
|
||||
titles or URLs matching <oa>filter</oa>. The resulting
|
||||
URLs can be clicked, or accessed via extended hint modes
|
||||
such as <k>;o</k>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The special version <ex>:bmarks!</ex> works the same as <ex>:bmarks</ex> except it
|
||||
opens all the found bookmarks in new tabs.
|
||||
The special version <ex>:bmarks!</ex> works the same as
|
||||
<ex>:bmarks</ex> except that it opens all all matching
|
||||
bookmarks in new tabs rather than listing them.
|
||||
</p>
|
||||
|
||||
<p>Filter can also contain the following options:</p>
|
||||
<p>The bookmarks may also be filtered via the following options,</p>
|
||||
|
||||
<ul>
|
||||
<li>-tag=comma,separated,tag,list (short option: -T)</li>
|
||||
<li>-max=N (short options: -m)</li>
|
||||
</ul>
|
||||
<dl>
|
||||
<dt>-tag</dt>
|
||||
<dd>
|
||||
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>
|
||||
</item>
|
||||
|
||||
@@ -98,43 +140,59 @@
|
||||
<spec>:delbm[arks]!</spec>
|
||||
<description>
|
||||
<p>
|
||||
Delete a bookmark. Deletes <em>all</em> bookmarks which match the <oa>url</oa>. If
|
||||
omitted, <oa>url</oa> defaults to the URL of the current buffer. Use <k name="Tab"/>
|
||||
key on a string to complete the URL which you want to delete.
|
||||
Deletes <em>all</em> bookmarks which match <oa>url</oa>.
|
||||
If omitted, <oa>url</oa> defaults to the URL of the
|
||||
current buffer.
|
||||
</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>
|
||||
</item>
|
||||
<!-- TODO: why is this duplicated in browsing? -->
|
||||
<h1 tag="history">History</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<h2 tag="history">History</h2>
|
||||
|
||||
<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>
|
||||
<tags><![CDATA[<C-o>]]></tags>
|
||||
<strut/>
|
||||
<spec><![CDATA[[count]<C-o>]]></spec>
|
||||
<description>
|
||||
<p>
|
||||
Go to an older position in the jump list. The jump list is just the browser
|
||||
history for now. If <oa>count</oa> is specified go back <oa>count</oa> pages.
|
||||
Go to an older position in the jump list. This currently
|
||||
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>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-i>]]></tags>
|
||||
<strut/>
|
||||
<spec><![CDATA[[count]<C-i>]]></spec>
|
||||
<description>
|
||||
<p>
|
||||
Go to a newer position in the jump list. The jump list
|
||||
is just the browser history for now. If <oa>count</oa>
|
||||
is specified go forward <oa>count</oa> pages.
|
||||
Go to an newer position in the jump list. This currently
|
||||
entails moving forward in page history, but in the
|
||||
future will take into account page positions as well.
|
||||
If <oa>count</oa> is specified go forward <oa>count</oa> pages.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<M-Left> <A-Left> H]]></tags>
|
||||
<strut/>
|
||||
<spec>[count]H</spec>
|
||||
<description>
|
||||
<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>
|
||||
<tags><![CDATA[<M-Right> <A-Right> L]]></tags>
|
||||
<spec>[count]L</spec>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>L</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go forward in the browser history. If <oa>count</oa> is specified go forward <oa>count</oa>
|
||||
@@ -154,8 +213,8 @@
|
||||
|
||||
<item>
|
||||
<tags>:ba :back</tags>
|
||||
<spec>:[count]ba[ck] <oa>url</oa></spec>
|
||||
<spec>:[count]ba[ck]!</spec>
|
||||
<spec>:<oa>count</oa>ba<oa>ck</oa> <oa>url</oa></spec>
|
||||
<spec>:<oa>count</oa>ba<oa>ck</oa>!</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go back in the browser history. If <oa>count</oa> is specified go back <oa>count</oa> pages.
|
||||
@@ -168,8 +227,8 @@
|
||||
|
||||
<item>
|
||||
<tags>:fw :fo :forward</tags>
|
||||
<spec>:[count]fo[rward] <oa>url</oa></spec>
|
||||
<spec>:[count]fo[rward]!</spec>
|
||||
<spec>:<oa>count</oa>fo<oa>rward</oa> <oa>url</oa></spec>
|
||||
<spec>:<oa>count</oa>fo<oa>rward</oa>!</spec>
|
||||
<description>
|
||||
<p>
|
||||
Go forward in the browser history. If <oa>count</oa> is specified go forward <oa>count</oa>
|
||||
@@ -183,78 +242,87 @@
|
||||
|
||||
<item>
|
||||
<tags>:hs :hist :history</tags>
|
||||
<spec>:hist[ory][!] <oa>filter</oa></spec>
|
||||
<spec>:hist<oa>ory</oa><oa>!</oa> <oa>filter</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Show recently visited URLs. Open the message window at the bottom of the screen
|
||||
with all history items which match <oa>filter</oa> either in the title or URL.
|
||||
Show recently visited URLs. Opens the message window at the bottom of the screen
|
||||
with all history items whose page titles or URLs match
|
||||
<oa>filter</oa>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The special version <ex>:history!</ex> works the same as <ex>:history</ex> except
|
||||
it opens all the found items in new tabs.
|
||||
The special version <ex>:history!</ex> works the same as
|
||||
<ex>:history</ex> except that it opens all all matching
|
||||
pages in new tabs rather than listing them.
|
||||
</p>
|
||||
|
||||
<p>Filter can also contain the following options:</p>
|
||||
<p>The pages may also be filtered via the following options,</p>
|
||||
|
||||
<ul>
|
||||
<li>-max=N (short options: -m)</li>
|
||||
</ul>
|
||||
<dl>
|
||||
<dt>-max</dt>
|
||||
<dd>
|
||||
The maximum number of items to list or open
|
||||
(short name <em>-m</em>).
|
||||
</dd>
|
||||
</dl>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<h1 tag="quickmarks">QuickMarks</h1>
|
||||
<toc start="2"/>
|
||||
<h2 tag="quickmarks">QuickMarks</h2>
|
||||
|
||||
<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>
|
||||
<tags>go</tags>
|
||||
<spec>a-zA-Z0-9</spec>
|
||||
<strut/>
|
||||
<spec>go<a>a-zA-Z0-9</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Jump to a QuickMark in the current tab. Open any QuickMark in the current tab.
|
||||
You can mark any URLs with <k>M</k><a>a-zA-Z0-9</a>. These QuickMarks are
|
||||
persistent across browser sessions.
|
||||
Jump to a QuickMark in the current tab. See also
|
||||
<k>M</k> and <ex>:qmark</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>gn</tags>
|
||||
<spec>a-zA-Z0-9</spec>
|
||||
<strut/>
|
||||
<spec>gn<a>a-zA-Z0-9</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Jump to a QuickMark in a new tab. Works like
|
||||
<k>go</k><a>a-zA-Z0-9</a> but opens the QuickMark in a
|
||||
new tab. Whether the new tab is activated or not depends
|
||||
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.
|
||||
Jump to a QuickMark in a new tab. The new tab is focused
|
||||
only if <o>activate</o> contains <em>quickmark</em> or
|
||||
<em>all</em>. See also <k>M</k> and <ex>:qmark</ex>.
|
||||
</p>
|
||||
<p>Mnemonic: Go in a new tab.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>:delqm :delqmarks</tags>
|
||||
<spec>marks</spec>
|
||||
<spec>:delqm[arks]!</spec>
|
||||
<spec>:delqm<oa>arks</oa> <a>arg</a></spec>
|
||||
<spec>:delqm<oa>arks</oa>!</spec>
|
||||
<description>
|
||||
<p>Delete the specified QuickMarks. QuickMarks are presented as a list.</p>
|
||||
<p>Delete the specified QuickMarks.</p>
|
||||
|
||||
<p>Examples:</p>
|
||||
|
||||
@@ -268,35 +336,56 @@
|
||||
|
||||
<item>
|
||||
<tags>:qma :qmark</tags>
|
||||
<spec>a-zA-Z0-9</spec>
|
||||
<spec>:qmark <a>a-zA-Z0-9</a> <a>url</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Mark a URL with a letter for quick access. You can also mark whole groups
|
||||
like this:
|
||||
Mark <a>url</a> with a letter for quick access. See also
|
||||
<k>go</k>, <k>gn</k>, and <k>M</k>.
|
||||
</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>
|
||||
|
||||
<code><ex>:qmark f http://wwww.pandora.com, google Tim Minchin</ex></code>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>:qmarks</tags>
|
||||
<strut/>
|
||||
<spec>:qmarks <oa>arg</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Show all QuickMarks. If <oa>arg</oa> is specified then
|
||||
limit the list to those QuickMarks mentioned.
|
||||
List QuickMarks. If <oa>arg</oa> is given then limit the
|
||||
list to those QuickMarks mentioned, otherwise list them
|
||||
all.
|
||||
</p>
|
||||
</description>
|
||||
</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>
|
||||
<tags>m</tags>
|
||||
<spec>a-zA-Z</spec>
|
||||
<strut/>
|
||||
<spec>m<a>a-zA-Z</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Set mark at the cursor position. Marks a-z are local to the buffer, whereas
|
||||
@@ -307,7 +396,8 @@
|
||||
|
||||
<item>
|
||||
<tags>` '</tags>
|
||||
<spec>a-zA-Z</spec>
|
||||
<strut/>
|
||||
<spec>'<a>a-zA-Z</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Jump to the mark. Marks a-z are local to the buffer, whereas A-Z are valid
|
||||
@@ -318,15 +408,15 @@
|
||||
|
||||
<item>
|
||||
<tags>:delm :delmarks</tags>
|
||||
<spec>marks</spec>
|
||||
<spec>:delm[arks]!</spec>
|
||||
<spec>:delm<oa>arks</oa> <a>arg</a></spec>
|
||||
<spec>:delm<oa>arks</oa>!</spec>
|
||||
<description>
|
||||
<p>Delete the specified marks. Marks are presented as a list.</p>
|
||||
<p>Delete the specified marks.</p>
|
||||
|
||||
<p>Examples:</p>
|
||||
|
||||
<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!</ex> deletes all marks for the current buffer</li>
|
||||
</ul>
|
||||
@@ -336,20 +426,21 @@
|
||||
|
||||
<item>
|
||||
<tags>:ma :mark</tags>
|
||||
<spec>a-zA-Z</spec>
|
||||
<description>
|
||||
<spec>:mark <a>a-zA-Z</a></spec>
|
||||
<description short="true">
|
||||
<p>Mark current location within the web page.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>:marks</tags>
|
||||
<strut/>
|
||||
<spec>:marks <oa>arg</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Show all location marks of the current web page. If
|
||||
<oa>arg</oa> is specified then limit the list to those
|
||||
marks mentioned.
|
||||
Show all local marks for the current web page and all
|
||||
URL marks. If <oa>arg</oa> is specified then limit the
|
||||
list to those marks mentioned.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,25 +6,25 @@
|
||||
<document
|
||||
name="message"
|
||||
title="&dactyl.appname; Messages"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:dactyl="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="messages">Error and informational messages</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<tags>message-history</tags>
|
||||
|
||||
<p>
|
||||
&dactyl.appname; stores all info and error messages in a message
|
||||
history. The type of info messages output can be controlled by
|
||||
the <o>verbose</o> option. The number of stored messages can be set
|
||||
with the <o>messages</o> option.
|
||||
the <o>verbose</o> option. The maximum number of stored messages
|
||||
can be limited with the <o>messages</o> option.
|
||||
</p>
|
||||
|
||||
<item>
|
||||
<tags>:mes :messages</tags>
|
||||
<spec>:mes<oa>sages</oa></spec>
|
||||
<description>
|
||||
<p>Display previously given messages.</p>
|
||||
<description short="true">
|
||||
<p>Display previously shown messages.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<item>
|
||||
<tags>:messc :messclear</tags>
|
||||
<spec>:messc<oa>lear</oa></spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Clear the message history.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[g<]]></tags>
|
||||
<strut/>
|
||||
<spec>g<</spec>
|
||||
<description>
|
||||
<p>
|
||||
@@ -49,34 +50,37 @@
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<!-- FIXME: Everything the follows is horrendous. -->
|
||||
|
||||
<tags>pager more-prompt</tags>
|
||||
|
||||
<code>
|
||||
<code dactyl:highlight="MoreMsg">
|
||||
-- More --
|
||||
-- More -- SPACE/d/j: screen/page/line down, b/u/k: up, q: quit
|
||||
</code>
|
||||
|
||||
<p>
|
||||
This message is given when the message window is filled with messages. It is
|
||||
only given when the <o>more</o> option is on. It is highlighted with the <em>MoreMsg</em>
|
||||
group.
|
||||
This message is displayed when the message window is filled with
|
||||
messages and the <o>more</o> option is set. It is styled with
|
||||
the <em>MoreMsg</em> <ex>:highlight</ex> group. When the more
|
||||
message is shown, the following key mappings are available:
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<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><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><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><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>b or <k name="PageUp"/> </dt><dd>back a screen</dd>
|
||||
<dt>g </dt><dd>back to the start</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>b or <k name="PageUp"/></dt> <dd>back a screen</dd>
|
||||
<dt>g</dt> <dd>back to the start</dd>
|
||||
<dt/><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>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>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>start an <t>extended-hints</t> command</dd>
|
||||
<dt><k name="C-Y"/></dt> <dd>yank (copy) a modeless selection to the clipboard</dd>
|
||||
</dl>
|
||||
|
||||
</document>
|
||||
|
||||
@@ -6,21 +6,46 @@
|
||||
<document
|
||||
name="pattern"
|
||||
title="&dactyl.appname; Patterns"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="text-search-commands">Text search commands</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<p>
|
||||
&dactyl.appname; provides a Vim-like interface to &dactyl.host;'s standard text search
|
||||
functionality. There is no support for using regular expressions in search
|
||||
commands as &dactyl.host; does not provide native regex support. It is unlikely that
|
||||
this will ever be available.
|
||||
&dactyl.appname; provides a Vim-like incremental search interface to
|
||||
replace &dactyl.host;'s crippled Typeahead Find. Among other improvements,
|
||||
our search service:
|
||||
</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>
|
||||
|
||||
<item>
|
||||
<tags>/</tags>
|
||||
<spec>/<a>pattern</a>[/]<CR></spec>
|
||||
<spec>/<a>pattern</a><oa>/</oa><k name="CR"/></spec>
|
||||
<description>
|
||||
<p>Search forward for the first occurrence of <a>pattern</a>.</p>
|
||||
|
||||
@@ -31,13 +56,19 @@
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<dt>\c</dt> <dd>Perform case insensitive search (default
|
||||
if <o>ignorecase</o> is set).</dd>
|
||||
<dt>\c</dt> <dd>Perform case insensitive search (default if <o>ignorecase</o> is set).</dd>
|
||||
<dt>\C</dt> <dd>Perform case sensitive search</dd>
|
||||
<dt>\l</dt> <dd>Search only in links, as defined by
|
||||
<o>hinttags</o>. (default if <o>linksearch</o> is
|
||||
set).</dd>
|
||||
<dt>\L</dt> <dd>Do not search only in links.</dd>
|
||||
<dt>\l</dt> <dd>Search only in links, as defined by <o>hinttags</o>. (default if <o>linksearch</o> is set).</dd>
|
||||
<dt>\L</dt> <dd>Search the entire page.</dd>
|
||||
</dl>
|
||||
|
||||
<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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -45,13 +76,9 @@
|
||||
|
||||
<item>
|
||||
<tags>?</tags>
|
||||
<spec>?<a>pattern</a>[?]<CR></spec>
|
||||
<spec>?<a>pattern</a><oa>?</oa><k name="CR"/></spec>
|
||||
<description>
|
||||
<p>Search backwards for <a>pattern</a>.</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>
|
||||
<p>Search backward for <a>pattern</a>, in exactly the same manner as <k>/</k>.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -59,7 +86,7 @@
|
||||
<item>
|
||||
<tags>n</tags>
|
||||
<spec>n</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Find next. Repeat the last search.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -68,7 +95,7 @@
|
||||
<item>
|
||||
<tags>N</tags>
|
||||
<spec>N</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Find previous. Repeat the last search in the opposite direction.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -77,7 +104,7 @@
|
||||
<item>
|
||||
<tags>*</tags>
|
||||
<spec>*</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Search forward for the next word under the cursor.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -86,7 +113,7 @@
|
||||
<item>
|
||||
<tags>#</tags>
|
||||
<spec>#</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Search backward for the previous word under the cursor.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -94,11 +121,13 @@
|
||||
|
||||
<item>
|
||||
<tags>:noh :nohlsearch</tags>
|
||||
<strut/>
|
||||
<spec>:noh<oa>lsearch</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Remove the search highlighting. The document highlighting is turned back on
|
||||
when another search command is used or the <o>hlsearch</o> option is set.
|
||||
Remove the search highlighting. The document is highlighted again
|
||||
when another search command is used or the <o>hlsearch</o> option
|
||||
is set.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<document
|
||||
name="print"
|
||||
title="&dactyl.appname; Printing"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="printing">Printing</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
|
||||
@@ -6,23 +6,28 @@
|
||||
<document
|
||||
name="repeat"
|
||||
title="&dactyl.appname; Repeating Commands"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="repeating">Repeating commands</h1>
|
||||
<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>
|
||||
|
||||
<item>
|
||||
<tags>.</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>.</spec>
|
||||
<description>
|
||||
<p>
|
||||
Repeat the last keyboard mapping <oa>count</oa> times. Note that, unlike in Vim, this
|
||||
does not apply solely to editing commands, mainly because &dactyl.appname; doesn't
|
||||
have them.
|
||||
Repeat the last keyboard mapping <oa>count</oa> times. Note that,
|
||||
unlike in Vim, this does not apply solely to editing commands,
|
||||
mainly because &dactyl.appname; doesn't have them.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -30,6 +35,7 @@
|
||||
|
||||
<item>
|
||||
<tags>@:</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>@:</spec>
|
||||
<description>
|
||||
<p>Repeat the last Ex command <oa>count</oa> times.</p>
|
||||
@@ -42,12 +48,14 @@
|
||||
|
||||
<item>
|
||||
<tags>q</tags>
|
||||
<strut/>
|
||||
<spec>q<a>0-9a-zA-Z</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Record a key sequence into a macro.
|
||||
Available macros are {0-9a-zA-Z} (uppercase to append).
|
||||
Type <k>q</k> to stop recording.
|
||||
Record a key sequence as a macro. Available macros are
|
||||
<a>0-9a-zA-Z</a>. If the macro is an uppercase letter, the
|
||||
recorded keys are appended to the lowercase macro of the same
|
||||
name. Typing <k>q</k> again stops the recording.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -58,8 +66,8 @@
|
||||
<spec>:mac<oa>ros</oa> <oa>pat</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
List recorded macros matching the optional regular expression <oa>pat</oa>. If
|
||||
no regex is given, list all macros.
|
||||
List recorded macros matching the optional regular expression
|
||||
<oa>pat</oa>. If no regex is given, list all macros.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -67,12 +75,12 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<description>
|
||||
<p>
|
||||
Delete recorded macros matching the regular expression <a>args</a>. If <oa>!</oa> is given
|
||||
all macros are deleted.
|
||||
Delete recorded macros matching the regular expression
|
||||
<a>pat</a>. If <em>!</em> is given, all macros are deleted.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -80,12 +88,12 @@
|
||||
|
||||
<item>
|
||||
<tags>@ :play</tags>
|
||||
<spec>:pl<oa>ay</oa> <a>arg</a></spec>
|
||||
<spec><oa>count</oa>@<a>arg</a></spec>
|
||||
<spec>:pl<oa>ay</oa> <a>a-z0-9</a></spec>
|
||||
<spec><oa>count</oa>@<a>a-z0-9</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Plays the contents of macro with name <a>arg</a> <oa>count</oa> times. The <k>@</k> mapping
|
||||
only accepts {0-9a-z} as <a>arg</a>.
|
||||
Plays the contents of macro with name <a>a-z0-9</a> <oa>count</oa>
|
||||
times.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -94,7 +102,7 @@
|
||||
<item>
|
||||
<tags>@@</tags>
|
||||
<spec><oa>count</oa>@@</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Replay the last executed macro <oa>count</oa> times.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -108,57 +116,91 @@
|
||||
<spec>:so<oa>urce</oa><oa>!</oa> <a>file</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Read Ex commands, JavaScript, or CSS from <a>file</a>. You can either source files
|
||||
which mostly contain Ex commands like <ex>map < gt</ex> and put JavaScript code
|
||||
within a:
|
||||
Read Ex commands, JavaScript, or CSS from <a>file</a>. Files are
|
||||
interperated based on their extensions. Files when end in
|
||||
<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>
|
||||
|
||||
<code><![CDATA[
|
||||
js <<EOF
|
||||
hello = function () {
|
||||
alert("Hello world");
|
||||
<p>
|
||||
Environment variables in <a>file</a> are expanded to their current
|
||||
value, and the prefix <em>~</em> is replaced with the value of
|
||||
<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
|
||||
]]></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>
|
||||
<em>EOF</em></code>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<tags>:lpl :loadplugins</tags>
|
||||
<strut/>
|
||||
<spec>:loadplugins</spec>
|
||||
<description>
|
||||
<p>
|
||||
Load all unloaded plugins immediately. Because plugins are automatically
|
||||
loaded after &dactyl.name;rc is sourced, this command must be placed early
|
||||
in the &dactyl.name;rc file if &dactyl.name;rc also includes commands that are
|
||||
implemented by plugins. Additionally, this command allows for sourcing
|
||||
new plugins without restarting &dactyl.appname;.
|
||||
Immediately load all plugins which have yet to be loaded. Because
|
||||
plugins are not automatically loaded until after &dactyl.name;rc
|
||||
is sourced, this command must be placed early in the
|
||||
&dactyl.name;rc file if &dactyl.name;rc uses commands or options
|
||||
which are defined by plugins. Additionally, this command allows
|
||||
newly installed plugins to be easily loaded without restarting
|
||||
&dactyl.appname;.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -169,13 +211,12 @@ function hello2() {
|
||||
<spec>:runt<oa>ime</oa><oa>!</oa> <a>file</a> …</spec>
|
||||
<description>
|
||||
<p>
|
||||
Source the specified file from each directory in <o>runtimepath</o>. Example:
|
||||
</p>
|
||||
<code><ex>:runtime plugin/foobar.vimp</ex></code>
|
||||
<p>
|
||||
Only the first found file is sourced. When <oa>!</oa> is given, all found files are
|
||||
sourced.
|
||||
Source the specified file from the first directory in
|
||||
<o>runtimepath</o> in which it exists. When <oa>!</oa> is given,
|
||||
source the specified from all directories in <o>runtimepath</o> in
|
||||
which it exists.
|
||||
</p>
|
||||
<example><ex>:runtime plugins/foobar.js</ex></example>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -191,11 +232,12 @@ function hello2() {
|
||||
|
||||
<item>
|
||||
<tags>:fini :finish</tags>
|
||||
<strut/>
|
||||
<spec>:fini<oa>sh</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Stop sourcing a script file. This can only be called from within a &dactyl.appname;
|
||||
script file.
|
||||
Stop sourcing a script file. This can only be called from within a
|
||||
&dactyl.appname; script file.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -208,16 +250,17 @@ function hello2() {
|
||||
<spec>:<oa>count</oa>time<oa>!</oa> <a>code|:command</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Profile a piece of code or a command. Run <a>code</a> <oa>count</oa> times (default: 1)
|
||||
and returns the elapsed time. <a>code</a> is always passed to JavaScript's eval(),
|
||||
which might be slow, so take the results with a grain of salt.
|
||||
Profile a piece of JavaScript code or an Ex command. Run
|
||||
<a>code</a> <oa>count</oa> times and print the elapsed time.
|
||||
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>If <a>code</a> starts with a <ex>:</ex>, it is executed as a &dactyl.appname; command.</p>
|
||||
|
||||
<p>
|
||||
Use the special version with <oa>!</oa> if you just want to run any command multiple
|
||||
times without showing profiling statistics.
|
||||
When <oa>!</oa> is given, <a>code</a> is executed <oa>count</oa>
|
||||
times, but no statistics are printed.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<document
|
||||
name="starting"
|
||||
title="&dactyl.appname; Starting"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="starting">Starting &dactyl.appname;</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<tags>startup-options</tags>
|
||||
<h2 tag="startup-options">Command-line options</h2>
|
||||
|
||||
<p>
|
||||
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>
|
||||
|
||||
<ol>
|
||||
<li> &dactyl.appname; can perform user initialization commands. When
|
||||
one of the following is successfully located, it is executed,
|
||||
and no further locations are tried.
|
||||
<li>
|
||||
<p>
|
||||
&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>
|
||||
<li tag="$&dactyl.idname;_INIT">
|
||||
<em>$&dactyl.idname;_INIT</em> — May contain a single Ex command (e.g.,
|
||||
"<ex>:source <a>file</a></ex>").
|
||||
<em>$&dactyl.idname;_INIT</em>
|
||||
<strut/>
|
||||
May contain a single Ex command (e.g., "<ex>:source <a>file</a></ex>").
|
||||
</li>
|
||||
<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.
|
||||
</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>
|
||||
</ol>
|
||||
</li>
|
||||
<li>
|
||||
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
|
||||
sourced.
|
||||
<p>
|
||||
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
|
||||
sourced.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
All directories in <o>runtimepath</o> are searched for a
|
||||
"plugin" subdirectory and all yet unloaded plugins are loaded.
|
||||
For each plugin directory, all <tt>*.{js,vimp}</tt> files (including
|
||||
those in further subdirectories) are sourced alphabetically. No
|
||||
plugins will be sourced if:
|
||||
<p>
|
||||
All directories in <o>runtimepath</o> are searched for a
|
||||
‘plugins’ subdirectory and all yet unloaded plugins are loaded.
|
||||
For each plugins directory, all <tt>*.{js,vimp}</tt> files (including
|
||||
those in further subdirectories) are sourced alphabetically. No
|
||||
plugins will be sourced if,
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><o>noloadplugins</o> is set.</li>
|
||||
<li>the ++noplugin command-line option was specified.</li>
|
||||
<li>the +u=NONE command-line option specified set.</li>
|
||||
<li><o>noloadplugins</o> is set,</li>
|
||||
<li>the ++noplugin command-line option was specified, or</li>
|
||||
<li>the +u=NONE command-line option was specified.</li>
|
||||
</ul>
|
||||
|
||||
Any particular plugin will not be loaded if it has already been
|
||||
loaded (e.g., by an earlier <ex>:loadplugins</ex> command).
|
||||
<p>
|
||||
Any plugin which was already loaded (e.g., by an earlier
|
||||
invocation of the <ex>:loadplugins</ex> command) will be skipped.
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
The user's ~ (i.e., "home") directory is determined as follows:
|
||||
<p>
|
||||
The user's home directory is determined as follows:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<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.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Warning: this differs from Vim's behavior which defaults to writing the file
|
||||
in the current directory.
|
||||
</p>
|
||||
<warning>
|
||||
This behavior differs differs from that of Vim, which defaults to
|
||||
writing the file in the current directory.
|
||||
</warning>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
@@ -6,16 +6,17 @@
|
||||
<document
|
||||
name="styling"
|
||||
title="&dactyl.appname; Styling"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="styling">Styling the GUI and web pages</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<p>
|
||||
&dactyl.appname; allows you to style both the browser and any web pages you view. All
|
||||
styling is specified via CSS. Although you may style any user interface element
|
||||
via the <ex>:style</ex> command, most &dactyl.appname; elements can be styled with the
|
||||
<ex>:highlight</ex> command, for convenience.
|
||||
&dactyl.appname; allows you to apply custom CSS styling to the web pages
|
||||
you view as well as to the browser itself. Although it is possible to
|
||||
style any user interface element via the <ex>:style</ex> command, most
|
||||
&dactyl.appname; elements can be styled more easily by means of the
|
||||
more specialized <ex>:highlight</ex> command.
|
||||
</p>
|
||||
|
||||
<item>
|
||||
@@ -24,7 +25,7 @@
|
||||
<description>
|
||||
<p>
|
||||
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>
|
||||
@@ -37,66 +38,70 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
Highlight <a>group</a> with <a>css</a>. <a>css</a> is one or more comma separated CSS
|
||||
declarations (E.g. <em>color: blue; background-color: red</em>). Normally, <a>css</a> is
|
||||
checked for valid syntax before it's applied. Once you're certain it's valid,
|
||||
<oa>!</oa> can be used to skip the check to speed up &dactyl.appname; startup. <a>selector</a>
|
||||
can be any valid CSS selector, such as <ex>:hover</ex>, and, if provided, will
|
||||
restrict the match to matching elements.
|
||||
Highlight <a>group</a> with <oa>css</oa>. <oa>css</oa> is one or more
|
||||
semicolon-separated CSS declarations (E.g. <em>color: blue;
|
||||
background-color: red</em>). <oa>selector</oa>, if provided, may
|
||||
be any valid CSS selector (such as <em>:hover</em> or
|
||||
<em>[href]</em>), and will restrict the highlighting to matching
|
||||
elements.
|
||||
</p>
|
||||
|
||||
<p>Valid groups are:</p>
|
||||
<p>Valid groups include:</p>
|
||||
|
||||
<dl>
|
||||
<dt>Bell</dt> <dd>&dactyl.appname;'s visual bell</dd>
|
||||
<dt>Boolean</dt> <dd>A JavaScript Boolean object</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>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>CompItem</dt> <dd>A 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>CompItem[selected]</dt><dd> A selected row of completion list</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>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>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>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>Function</dt> <dd>A JavaScript Function object</dd>
|
||||
<dt>Gradient</dt> <dd></dd>
|
||||
<dt>GradientLeft</dt> <dd></dd>
|
||||
<dt>GradientRight</dt> <dd></dd>
|
||||
<dt>Gradient</dt> <dd>The gradient dividers used in the completion lists</dd>
|
||||
<dt>GradientLeft</dt> <dd>The color to the left of the Gradient</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>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>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>Key</dt> <dd>Generally a keyword used in syntax highlighting.</dd>
|
||||
<dt>Keyword</dt> <dd>A bookmark keyword for a URL</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>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>Null</dt> <dd>A JavaScript Null object</dd>
|
||||
<dt>Number</dt> <dd>A JavaScript Number 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>Search</dt> <dd>Highlighted search results in a web page</dd>
|
||||
<dt>StatusLine</dt> <dd>The status bar</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>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>TabClose</dt> <dd>The close button of a browser tab</dd>
|
||||
<dt>TabIcon</dt> <dd>The icon of a browser tab</dd>
|
||||
@@ -110,10 +115,17 @@
|
||||
</dl>
|
||||
|
||||
<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 matching
|
||||
<a>group</a> are listed, or all styles if no <a>group</a> provided.
|
||||
The help system also has a comprehensive set of styling groups
|
||||
which are not explained here, but many of which are described
|
||||
along with <t>writing-docs</t>.
|
||||
</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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -121,11 +133,11 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
Reset the highlighting for <a>group</a> to its default value. If
|
||||
<a>group</a> is not given, reset all highlighting groups.
|
||||
Reset the highlighting for <oa>group</oa> to its default value. If
|
||||
<oa>group</oa> is not given, reset all highlighting groups.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -133,43 +145,46 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
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
|
||||
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>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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
|
||||
<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.
|
||||
</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>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
Delete any matching styles. If <a>filter</a> is provided, only matching elements of
|
||||
the filter are disabled. For instance, a filter <str>mozilla.org</str>, given a
|
||||
style for <str>www.google.com,mozilla.org</str>, will result in a style for
|
||||
<str>www.google.com</str>. The available options are:
|
||||
Delete any matching styles. If <oa>filter</oa> is provided, only
|
||||
matching elements of the filter are disabled. For instance, when
|
||||
run with a filter <str>mozilla.org</str>, an existing style with a
|
||||
filter <str>www.google.com,mozilla.org</str>, will result in a
|
||||
style for <str>www.google.com</str>.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
(short option: <em>-i</em>)</li>
|
||||
</ul>
|
||||
<p>The available options are:</p>
|
||||
|
||||
<dl>
|
||||
<dt>-name</dt> <dd>The name provided to <ex>:style</ex> (short option: <em>-n</em>)</dd>
|
||||
<dt>-index</dt> <dd>For unnamed styles, the index listed by <ex>:style</ex>
|
||||
(short option: <em>-i</em>)</dd>
|
||||
</dl>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -177,7 +192,7 @@
|
||||
<item>
|
||||
<tags>:styleenable :stylee</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>
|
||||
<p>Enable any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
||||
</description>
|
||||
@@ -187,7 +202,7 @@
|
||||
<item>
|
||||
<tags>:styledisable :styled</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>
|
||||
<p>Disable any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
||||
</description>
|
||||
@@ -197,7 +212,7 @@
|
||||
<item>
|
||||
<tags>:styletoggle :stylet</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>
|
||||
<p>Toggle any matching styles. Arguments are the same as for <ex>:delstyle</ex>.</p>
|
||||
</description>
|
||||
|
||||
@@ -6,15 +6,23 @@
|
||||
<document
|
||||
name="tabs"
|
||||
title="&dactyl.appname; Tabs"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<h1 tag="tabs">Tabs</h1>
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1 tag="tabs buffers">Tabs and buffers</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
<p>
|
||||
Tabs are used to be able to view many web pages at the same time. Each tab
|
||||
contains exactly one buffer—multiple buffers per tab are not supported. As a
|
||||
result many buffer and tab commands are interchangeable.
|
||||
Tabs allow you to keep many web pages open at the same time and to quickly
|
||||
switch between them. Each tab contains exactly one buffer. If your version
|
||||
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>
|
||||
|
||||
<h2 tag="listing-tabs">Listing tabs</h2>
|
||||
@@ -25,15 +33,16 @@
|
||||
<spec>B</spec>
|
||||
<description>
|
||||
<p>
|
||||
Show a list of buffers (=tabs) matching <oa>filter</oa>. Without <oa>filter</oa>
|
||||
list all tabs.
|
||||
Show a list of buffers matching <oa>filter</oa>. Buffers are
|
||||
listed according to their tab groups, whether they are visible or
|
||||
not.
|
||||
</p>
|
||||
|
||||
<p>A buffer may be marked with one of the following indicators:</p>
|
||||
|
||||
<dl>
|
||||
<dt>%</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 current buffer</dd>
|
||||
<dt><hl key="Indicator">#</hl></dt><dd>The alternate buffer for <ex>:e #</ex> and <k name="C-^"/></dd>
|
||||
</dl>
|
||||
</description>
|
||||
</item>
|
||||
@@ -52,21 +61,13 @@
|
||||
|
||||
<item>
|
||||
<tags>:tab</tags>
|
||||
<strut/>
|
||||
<spec>:tab <a>cmd</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Execute <a>cmd</a> and tell it to output in a new tab. Works only for commands that
|
||||
support it, currently:
|
||||
Execute <a>cmd</a>, but open any new pages in a new tab rather
|
||||
than the currently focused tab.
|
||||
</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>
|
||||
</item>
|
||||
|
||||
@@ -77,8 +78,8 @@
|
||||
<spec>:wind<oa>ow</oa> <a>cmd</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Execute <a>cmd</a> and tell it to output in a new window. See <ex>:tab</ex> for the
|
||||
list of supported commands.
|
||||
Execute <a>cmd</a>, but open any new pages in a new window rather
|
||||
than the currently focused tab.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -89,20 +90,22 @@
|
||||
<spec>:<oa>count</oa>tabdu<oa>plicate</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Duplicate the current tab and switch to the duplicate. If <oa>count</oa> is given,
|
||||
duplicate the tab <oa>count</oa> times.
|
||||
Duplicate the current tab and focus the duplicate. If
|
||||
<oa>count</oa> is given, duplicate the tab <oa>count</oa> times.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<item>
|
||||
<tags>gb</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>gb</spec>
|
||||
<description>
|
||||
<p>
|
||||
@@ -115,11 +118,11 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
<item>
|
||||
<tags>gB</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>gB</spec>
|
||||
<description>
|
||||
<p>
|
||||
Repeat last <ex>:buffer<oa>!</oa></ex> command in reverse direction. Just like <k>gb</k>
|
||||
but in the other direction.
|
||||
Repeat last <ex>:buffer<oa>!</oa></ex> command in the reverse direction.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -127,10 +130,11 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
<item>
|
||||
<tags>gt</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>gt</spec>
|
||||
<description>
|
||||
<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.
|
||||
</p>
|
||||
</description>
|
||||
@@ -139,10 +143,11 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-PageDown> <C-Tab> <C-n>]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa><C-n></spec>
|
||||
<description>
|
||||
<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.
|
||||
</p>
|
||||
</description>
|
||||
@@ -151,10 +156,11 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-PageUp> <C-S-Tab> <C-p> gT]]></tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>gT</spec>
|
||||
<description>
|
||||
<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.
|
||||
</p>
|
||||
</description>
|
||||
@@ -162,9 +168,11 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
|
||||
<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>
|
||||
<tags>:tn :tnext</tags>
|
||||
<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>
|
||||
<description>
|
||||
<p>
|
||||
@@ -176,12 +184,14 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
|
||||
<item>
|
||||
<tags>:bN :bNext :bp :bprevious :tN :tNext :tabN :tabNext :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>
|
||||
<spec>:<oa>count</oa>tabN<oa>ext</oa> <oa>count</oa></spec>
|
||||
<tags>:bN :bNext :bp :bprevious</tags>
|
||||
<spec>:<oa>count</oa>bp<oa>revious</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>
|
||||
<p>
|
||||
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>
|
||||
<description>
|
||||
<p>
|
||||
Go to the specified buffer from the buffer list. Argument can be either the
|
||||
buffer index or the full URL. If <oa>count</oa> is given, go to the <oa>count</oa>th buffer.
|
||||
Go to the specified buffer from the buffer list. Argument can be
|
||||
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>
|
||||
@@ -228,13 +240,17 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
|
||||
<item>
|
||||
<tags>g^ g0 :bf :bfirst :br :brewind :tabfir :tabfirst :tabr :tabrewind</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>
|
||||
<tags>g^ g0</tags>
|
||||
<spec>g0</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>
|
||||
<p>Switch to the first tab.</p>
|
||||
</description>
|
||||
@@ -254,12 +270,13 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
<item>
|
||||
<tags>:tabde :tabdetach</tags>
|
||||
<strut/>
|
||||
<spec>:tabde<oa>tach</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Detach the current tab, and open it in its own window. As each window must
|
||||
contain at least one tab it is not possible to detach the only tab in a window.
|
||||
Use <ex>:tabduplicate</ex> to copy the tab then call <ex>:tabdetach</ex>.
|
||||
Detach the current tab, and open it in its own window. As each
|
||||
window must contain at least one buffer, it is not possible to detach
|
||||
the last buffer in a window.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -267,13 +284,14 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
Attach the current tab to another window. {window-index} is an index into the
|
||||
list of open windows and <oa>tab-index</oa> is the index at which to insert the
|
||||
tab in the other window's tab list. If this is the last tab in a window, the
|
||||
window will be closed.
|
||||
Attach the current tab to another window. <a>window-index</a> is
|
||||
an index into the list of open windows and <oa>buffer-index</oa>
|
||||
is the index at which to insert the tab in the other window's
|
||||
buffer list. If this is the last buffer in a window, the window
|
||||
will be closed.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -289,7 +307,7 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
<p>
|
||||
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
|
||||
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
|
||||
tab list.
|
||||
</p>
|
||||
@@ -301,19 +319,21 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
<h2 tag="closing-tabs">Closing tabs</h2>
|
||||
|
||||
<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>d</spec>
|
||||
<description>
|
||||
<p>
|
||||
Delete current buffer (=tab). 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.
|
||||
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 tabs is selected.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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
|
||||
URL and also the title of the tab. Use with care.
|
||||
currently opened hostname. With <oa>!</oa>, remove all tabs for which
|
||||
the currently opened page's URL or title contains <oa>arg</oa>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -322,8 +342,8 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
<item>
|
||||
<tags>D</tags>
|
||||
<spec><oa>count</oa>D</spec>
|
||||
<description>
|
||||
<p>Like <k>d</k> but selects the tab to the left of the deleted tab.</p>
|
||||
<description short="true">
|
||||
<p>Like <k>d</k> but selects the tab to the left of the deleted tabs after deletion..</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -331,8 +351,8 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
<item>
|
||||
<tags>:tabo :tabonly</tags>
|
||||
<spec>:tabo<oa>nly</oa></spec>
|
||||
<description>
|
||||
<p>Close all other tabs.</p>
|
||||
<description short="true">
|
||||
<p>Close all buffers other than the currently visible tab.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -343,8 +363,9 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
<spec><oa>count</oa>u</spec>
|
||||
<description>
|
||||
<p>
|
||||
Undo closing of a tab. If a count is given, don't undo the last but the
|
||||
<oa>count</oa>th last closed tab. With <oa>url</oa> restores the tab matching the URL.
|
||||
Restore a closed tab. If a <oa>count</oa> is given, restore the
|
||||
<oa>count</oa>th closed tab. With <oa>url</oa>, restores most
|
||||
recently closed tab with a matching URL.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -353,11 +374,8 @@ See <t>opening</t> for other ways to open new tabs.
|
||||
<item>
|
||||
<tags>:undoa :undoall</tags>
|
||||
<spec>:undoa<oa>ll</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Undo closing of all closed tabs. &dactyl.host; stores up to 10 closed tabs, even
|
||||
after a browser restart.
|
||||
</p>
|
||||
<description short="true">
|
||||
<p>Restore all closed tabs in the closed tabs list.</p>
|
||||
</description>
|
||||
</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>
|
||||
<description>
|
||||
<p>
|
||||
Execute <a>cmd</a> in each tab. <a>cmd</a> is executed in each tab starting with the
|
||||
first and ending with the last which becomes the current tab.
|
||||
Execute <a>cmd</a> once in each buffer. Each buffer is focused, in
|
||||
turn, and <a>cmd</a> is executed therein. The last buffer remains
|
||||
focused after execution.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<document
|
||||
name="various"
|
||||
title="&dactyl.appname; Other"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<h1>Other help</h1>
|
||||
<toc start="2"/>
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
|
||||
<item>
|
||||
<tags>:beep</tags>
|
||||
<strut/>
|
||||
<spec>:beep</spec>
|
||||
<description>
|
||||
<p>
|
||||
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>
|
||||
</description>
|
||||
</item>
|
||||
@@ -31,12 +32,13 @@
|
||||
<description>
|
||||
<p>
|
||||
Lists the completion contexts used during the completion of its
|
||||
arguments. These context names are used in options such as
|
||||
<o>autocomplete</o> and <o>wildcase</o>. Note that completion must
|
||||
be triggered in order for this command to be effective, so if
|
||||
autocompletion is not active, you'll need to press the
|
||||
<k name="Tab"/> key at least once. You should also be aware that
|
||||
this command is only useful from the commandline.
|
||||
arguments. These context names may used to tune the function of
|
||||
the completion system via options like <o>autocomplete</o> and
|
||||
<o>wildcase</o>. Note that completion must be triggered in order
|
||||
for this command to be effective, so if autocompletion is not
|
||||
active, you'll need to press the <k name="Tab"/> key at least
|
||||
once. You should also be aware that this command is only useful
|
||||
from the commandline.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -44,14 +46,14 @@
|
||||
|
||||
<item>
|
||||
<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>
|
||||
<p>
|
||||
Execute Normal mode commands <a>commands</a>. This makes it possible to execute
|
||||
Normal mode commands typed on the command line. <a>commands</a> is executed like it
|
||||
is typed. If the <oa>!</oa> is given, mappings will not be used. <a>commands</a> should be
|
||||
a complete command. <a>commands</a> cannot start with a space. Put 1 space before
|
||||
it, 1 space is one space.
|
||||
Execute key mappings for <a>keys</a> as if they were typed in
|
||||
Normal mode. If <oa>!</oa> is provided, only builtin key mappings
|
||||
are executed. This makes it possible to fake Normal mode key
|
||||
presses from scripts, key mappings, autocommands, and the command
|
||||
line.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -59,27 +61,24 @@
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-l> CTRL-L :redr :redraw]]></tags>
|
||||
<strut/>
|
||||
<spec>:redr<oa>aw</oa></spec>
|
||||
<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>
|
||||
</item>
|
||||
|
||||
|
||||
<item>
|
||||
<tags>:run :! :!cmd</tags>
|
||||
<strut/>
|
||||
<spec>:!<a>cmd</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Run a command. Runs <a>cmd</a> through system() and displays its output. Any '!' in
|
||||
<a>cmd</a> is replaced with the previous external command, but not when there is a
|
||||
backslash before the '!', then the backslash is removed.
|
||||
</p>
|
||||
|
||||
<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>).
|
||||
Run an extenral command command. Runs <a>cmd</a> through system()
|
||||
and displays its output. Any ‘!’ in <a>cmd</a> is replaced with
|
||||
the previous external command, so long as it is not preceded by a
|
||||
backslash and <o>banghist</o> is enabled.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -88,7 +87,7 @@
|
||||
<item>
|
||||
<tags>:!!</tags>
|
||||
<spec>:!!</spec>
|
||||
<description>
|
||||
<description short="true">
|
||||
<p>Repeat last <ex>:!<a>cmd</a></ex>.</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -99,9 +98,9 @@
|
||||
<spec>:sil<oa>ent</oa> <a>command</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Execute a command silently. Normal messages and error messages generated by the
|
||||
command invocation will not be given and will not be added to the message
|
||||
history.
|
||||
Execute a command silently. Normal messages and error messages
|
||||
generated by the command invocation will not be displayed and will
|
||||
not be added to the message history.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -112,8 +111,8 @@
|
||||
<spec>:<oa>count</oa>verb<oa>ose</oa> <a>command</a></spec>
|
||||
<description>
|
||||
<p>
|
||||
Execute a command with <o>verbose</o> set to <oa>count</oa>. If <oa>count</oa> is not specified
|
||||
then 1 is used as the value.
|
||||
Execute a command with <o>verbose</o> set to <oa>count</oa>. If
|
||||
<oa>count</oa> is not specified then 1 is used.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -121,11 +120,12 @@
|
||||
|
||||
<item>
|
||||
<tags>:ve :version</tags>
|
||||
<strut/>
|
||||
<spec>:ve<oa>rsion</oa><oa>!</oa></spec>
|
||||
<description>
|
||||
<p>
|
||||
Show version information. You can show the &dactyl.host; version page with
|
||||
<ex>:version!</ex>.
|
||||
Print &dactyl.appname; and &dactyl.host; version information. When
|
||||
<oa>!</oa> is provided, show the &dactyl.host; version page.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -134,19 +134,20 @@
|
||||
|
||||
<p>
|
||||
Part of &dactyl.appname;'s user efficiency comes at the cost of storing a
|
||||
lot of potentially private data, including command-line history, page
|
||||
marks, and the like. Because we know that keeping a detailed trail of all
|
||||
of your activities isn't always welcome, &dactyl.appname; provides
|
||||
comprehensive facilities for erasing potentially sensitive data.
|
||||
lot of potentially private data, including <t>command-line</t> history, page
|
||||
marks, visited page history, and the like. Because we know that keeping a
|
||||
detailed trail of all of your activities isn't always welcome,
|
||||
&dactyl.appname; provides comprehensive facilities for erasing potentially
|
||||
sensitive data.
|
||||
</p>
|
||||
|
||||
<p tag="private-mode porn-mode">
|
||||
<strut/>
|
||||
&dactyl.appname; fully supports &dactyl.host;'s private browsing mode.
|
||||
When in private browsing mode, no other than Bookmarks and QuickMarks are
|
||||
written to disk. Further, upon exiting private mode, all new data,
|
||||
including command-line history, local and URL marks, and macros, are
|
||||
purged. For more information, see <o>private</o>.
|
||||
When in private browsing mode, no data other than Bookmarks and QuickMarks
|
||||
are written to disk. Further, upon exiting private mode, all new data,
|
||||
including <t>command-line</t> history, local and URL marks, and macros,
|
||||
are purged. For more information, see <o>private</o>.
|
||||
</p>
|
||||
|
||||
<p tag="sanitizing clearing-data">
|
||||
@@ -157,7 +158,7 @@
|
||||
&dactyl.host;'s own sanitization facility, and so automatically clears any
|
||||
domain data and session history when requested. Further, &dactyl.appname;
|
||||
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>
|
||||
|
||||
<item>
|
||||
@@ -242,9 +243,10 @@
|
||||
<spec><F1></spec>
|
||||
<description>
|
||||
<p>
|
||||
Open the help page. The default page, as specified by <o>helpfile</o> is shown
|
||||
unless <oa>subject</oa> is specified. If you need help for a specific topic, try
|
||||
<ex>:help overview</ex>.
|
||||
Open a help page for <oa>subject</oa>. If <oa>subject</oa> is
|
||||
omitted, open the default pate as specified in <o>helpfile</o>.
|
||||
If you're not sure of the exact topic you need help with, try
|
||||
<k name="Tab"/> completion or <ex>:help overview</ex>.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -254,7 +256,7 @@
|
||||
<tags>:helpall :helpa help-all</tags>
|
||||
<spec>:helpa<oa>ll</oa> <oa>subject</oa></spec>
|
||||
<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>
|
||||
</description>
|
||||
@@ -300,22 +302,23 @@
|
||||
|
||||
<tags>42</tags>
|
||||
|
||||
What is the meaning of life, the universe and everything?
|
||||
Douglas Adams, the only person who knew what this question really was about is
|
||||
now dead, unfortunately. So now you might wonder what the meaning of death
|
||||
is…
|
||||
<p>
|
||||
What is the meaning of life, the universe and everything? Douglas Adams,
|
||||
the only person who knew what this question really was about is now dead,
|
||||
unfortunately. So now you might wonder what the meaning of death is...
|
||||
</p>
|
||||
|
||||
|
||||
<h2 tag="uncategorized">Uncategorized help</h2>
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<C-[> <Esc>]]></tags>
|
||||
<strut/>
|
||||
<spec><Esc></spec>
|
||||
<description>
|
||||
<p>
|
||||
Focus content. Exits Command-line or Hints mode and returns to Normal
|
||||
mode. Also focuses the web page in case a form field has focus and eats
|
||||
our key presses.
|
||||
Exits <t>command-line</t>, Insert, or Hints mode and returns to
|
||||
Normal mode. Focuses the content web page.
|
||||
</p>
|
||||
</description>
|
||||
</item>
|
||||
@@ -323,12 +326,13 @@ is…
|
||||
|
||||
<item>
|
||||
<tags><![CDATA[<Insert> i]]></tags>
|
||||
<strut/>
|
||||
<spec>i</spec>
|
||||
<description>
|
||||
<p>
|
||||
Start caret mode. This mode resembles the Vim's Normal mode where you see a
|
||||
text cursor and can move around. If you want to select text in this mode, press
|
||||
<k>v</k> to start its Visual mode.
|
||||
Start Caret mode. This mode resembles the Vim's Normal mode where
|
||||
the text cursor is visible on the web page. The <k>v</k> key
|
||||
enters visual mode, where text is selected as the cursor moves.
|
||||
</p>
|
||||
</description>
|
||||
</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
|
||||
// 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");
|
||||
|
||||
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 loaded = {};
|
||||
let currentModule;
|
||||
@@ -30,17 +98,21 @@ function defmodule(name, module, params) {
|
||||
}
|
||||
currentModule = module;
|
||||
}
|
||||
|
||||
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.times = {};
|
||||
defmodule.time = function (major, minor, func, self) {
|
||||
defmodule.times = { all: 0 };
|
||||
defmodule.time = function time(major, minor, func, self) {
|
||||
let time = Date.now();
|
||||
let res = func.apply(self, Array.slice(arguments, 4));
|
||||
let delta = Date.now() - time;
|
||||
defmodule.times.all += 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;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -66,12 +138,12 @@ defmodule("base", this, {
|
||||
// sed -n 's/^(const|function) ([a-zA-Z0-9_]+).*/ "\2",/p' base.jsm | sort | fmt
|
||||
exports: [
|
||||
"Cc", "Ci", "Class", "Cr", "Cu", "Module", "Object", "Runnable",
|
||||
"Struct", "StructBase", "Timer", "XPCOMUtils", "allkeys", "array",
|
||||
"call", "callable", "curry", "debuggerProperties", "defmodule", "dict",
|
||||
"Struct", "StructBase", "Timer", "UTF8", "XPCOMUtils", "array",
|
||||
"call", "callable", "curry", "debuggerProperties", "defmodule",
|
||||
"endmodule", "extend", "foreach", "isarray", "isgenerator",
|
||||
"isinstance", "isobject", "isstring", "issubclass", "iter", "keys",
|
||||
"memoize", "properties", "requiresMainThread", "set", "update",
|
||||
"values",
|
||||
"isinstance", "isobject", "isstring", "issubclass", "iter", "iterall",
|
||||
"keys", "memoize", "properties", "requiresMainThread", "set",
|
||||
"update", "values",
|
||||
],
|
||||
use: ["services"]
|
||||
});
|
||||
@@ -83,33 +155,13 @@ function Runnable(self, func, args) {
|
||||
};
|
||||
}
|
||||
|
||||
function allkeys(obj) {
|
||||
let ret = {};
|
||||
try {
|
||||
for (; obj; obj = obj.__proto__) {
|
||||
services.get("debugger").wrapValue(obj).getProperties(ret, {});
|
||||
for (let prop in values(ret.value))
|
||||
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__;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all of the top-level properties of an object, by
|
||||
* way of the debugger.
|
||||
*
|
||||
* @param {object} obj
|
||||
* @returns [jsdIProperty]
|
||||
*/
|
||||
function debuggerProperties(obj) {
|
||||
if (loaded.services && services.get("debugger").isOn) {
|
||||
let ret = {};
|
||||
@@ -118,58 +170,89 @@ function debuggerProperties(obj) {
|
||||
}
|
||||
}
|
||||
|
||||
let hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
if (!Object.keys)
|
||||
Object.keys = function keys(obj) [k for (k in obj) if (hasOwnProperty.call(obj, k))];
|
||||
|
||||
if (!Object.getOwnPropertyNames)
|
||||
Object.getOwnPropertyNames = function getOwnPropertyNames(obj) {
|
||||
let res = debuggerProperties(obj);
|
||||
if (res)
|
||||
return [prop.name.stringValue for (prop in values(res))];
|
||||
return Object.keys(obj);
|
||||
}
|
||||
|
||||
function properties(obj, prototypes) {
|
||||
/**
|
||||
* Iterates over the names of all of the top-level properties of an
|
||||
* object or, if prototypes is given, all of the properties in the
|
||||
* prototype chain below the top. Uses the debugger if possible.
|
||||
*
|
||||
* @param {object} obj The object to inspect.
|
||||
* @param {boolean} properties Whether to inspect the prototype chain
|
||||
* @default false
|
||||
* @returns {Generator}
|
||||
*/
|
||||
function properties(obj, prototypes, debugger_) {
|
||||
let orig = obj;
|
||||
let seen = {};
|
||||
for (; obj; obj = prototypes && obj.__proto__) {
|
||||
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))));
|
||||
}
|
||||
|
||||
for (let key in iter)
|
||||
if (!prototypes || !set.add(seen, key) && obj != orig)
|
||||
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) {
|
||||
for (var k in obj)
|
||||
if (hasOwnProperty.call(obj, 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) {
|
||||
for (var k in obj)
|
||||
if (hasOwnProperty.call(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) {
|
||||
for (let val in iter)
|
||||
fn.call(self, val);
|
||||
}
|
||||
|
||||
function dict(ary) {
|
||||
var obj = {};
|
||||
for (var i = 0; i < ary.length; i++) {
|
||||
var val = ary[i];
|
||||
obj[val[0]] = val[1];
|
||||
}
|
||||
return obj;
|
||||
/**
|
||||
* Iterates over each iterable argument in turn, yielding each value.
|
||||
*
|
||||
* @returns {Generator}
|
||||
*/
|
||||
function iterall() {
|
||||
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) {
|
||||
let obj = {};
|
||||
if (ary)
|
||||
@@ -177,33 +260,86 @@ function set(ary) {
|
||||
obj[ary[i]] = true;
|
||||
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) {
|
||||
let res = this.has(set, key);
|
||||
set[key] = true;
|
||||
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.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) {
|
||||
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]))
|
||||
return array.iteritems(obj);
|
||||
if (obj instanceof Ci.nsIDOMNamedNodeMap)
|
||||
@@ -217,14 +353,51 @@ function iter(obj) {
|
||||
yield obj.row;
|
||||
obj.reset();
|
||||
})(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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
return src === targ ||
|
||||
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) {
|
||||
const types = {
|
||||
boolean: Boolean,
|
||||
@@ -234,8 +407,8 @@ function isinstance(targ, src) {
|
||||
}
|
||||
src = Array.concat(src);
|
||||
for (var i = 0; i < src.length; i++) {
|
||||
if (typeof src[i] == "string") {
|
||||
if (Object.prototype.toString.call(targ) == "[object " + src[i] + "]")
|
||||
if (typeof src[i] === "string") {
|
||||
if (objproto.toString.call(targ) === "[object " + src[i] + "]")
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -249,9 +422,10 @@ function isinstance(targ, src) {
|
||||
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
|
||||
@@ -259,9 +433,8 @@ function isobject(obj) {
|
||||
* any window, frame, namespace, or execution context, which
|
||||
* is not the case when using (obj instanceof Array).
|
||||
*/
|
||||
function isarray(val) {
|
||||
return Object.prototype.toString.call(val) == "[object Array]";
|
||||
}
|
||||
const isarray = Array.isArray ||
|
||||
function isarray(val) objproto.toString.call(val) == "[object Array]";
|
||||
|
||||
/**
|
||||
* 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
|
||||
* statements such as (x for (x in obj)).
|
||||
*/
|
||||
function isgenerator(val) {
|
||||
return Object.prototype.toString.call(val) == "[object Generator]";
|
||||
}
|
||||
function isgenerator(val) objproto.toString.call(val) == "[object Generator]";
|
||||
|
||||
/**
|
||||
* 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
|
||||
* using (obj instanceof String) or (typeof obj == "string").
|
||||
*/
|
||||
function isstring(val) {
|
||||
return Object.prototype.toString.call(val) == "[object String]";
|
||||
}
|
||||
function isstring(val) objproto.toString.call(val) == "[object String]";
|
||||
|
||||
/**
|
||||
* Returns true if and only if its sole argument may be called
|
||||
* as a function. This includes classes and function objects.
|
||||
*/
|
||||
function callable(val) {
|
||||
return typeof val === "function";
|
||||
}
|
||||
function callable(val) typeof val === "function";
|
||||
|
||||
function call(fn) {
|
||||
fn.apply(arguments[1], Array.slice(arguments, 2));
|
||||
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) {
|
||||
obj.__defineGetter__(key, function () {
|
||||
delete obj[key];
|
||||
return obj[key] = getter(obj, key);
|
||||
});
|
||||
obj.__defineGetter__(key, function ()
|
||||
Class.replaceProperty(this, key, getter.call(this, key)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,24 +563,15 @@ function update(target) {
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
let src = arguments[i];
|
||||
Object.getOwnPropertyNames(src || {}).forEach(function (k) {
|
||||
var get = src.__lookupGetter__(k),
|
||||
set = src.__lookupSetter__(k);
|
||||
if (!get && !set) {
|
||||
var v = src[k];
|
||||
target[k] = v;
|
||||
if (target.__proto__ && callable(v)) {
|
||||
v.superapply = function (self, args) {
|
||||
return target.__proto__[k].apply(self, args);
|
||||
};
|
||||
v.supercall = function (self) {
|
||||
return v.superapply(self, Array.slice(arguments, 1));
|
||||
};
|
||||
}
|
||||
let desc = Object.getOwnPropertyDescriptor(src, k);
|
||||
if (desc.value && callable(desc.value) && Object.getPrototypeOf(target)) {
|
||||
let func = desc.value;
|
||||
desc.value.superapply = function (self, args)
|
||||
Object.getPrototypeOf(target)[k].apply(self, args);
|
||||
desc.value.supercall = function (self)
|
||||
func.superapply(self, Array.slice(arguments, 1));
|
||||
}
|
||||
if (get)
|
||||
target.__defineGetter__(k, get);
|
||||
if (set)
|
||||
target.__defineSetter__(k, set);
|
||||
Object.defineProperty(target, k, desc);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
@@ -424,14 +588,19 @@ function update(target) {
|
||||
* @param {Object} overrides @optional
|
||||
*/
|
||||
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);
|
||||
|
||||
subclass.superclass = superclass.prototype;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -459,22 +628,6 @@ function extend(subclass, superclass, overrides) {
|
||||
* @returns {function} The constructor for the resulting 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);
|
||||
if (isstring(args[0]))
|
||||
@@ -483,21 +636,43 @@ function Class() {
|
||||
if (callable(args[0]))
|
||||
superclass = args.shift();
|
||||
|
||||
var Constructor = eval("(function " + (name || superclass.name).replace(/\W/g, "_") +
|
||||
String.substr(constructor, 20) + ")");
|
||||
Constructor.__proto__ = superclass;
|
||||
Constructor.name = name || superclass.name;
|
||||
var Constructor = eval(String.replace(<![CDATA[
|
||||
(function constructor() {
|
||||
let self = Object.create(Constructor.prototype, {
|
||||
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)) {
|
||||
var superc = superclass;
|
||||
if ("init" in superclass.prototype)
|
||||
Constructor.__proto__ = superclass;
|
||||
else {
|
||||
let superc = superclass;
|
||||
superclass = function Shim() {};
|
||||
extend(superclass, superc, {
|
||||
init: superc
|
||||
});
|
||||
superclass.__proto__ = superc;
|
||||
}
|
||||
|
||||
extend(Constructor, superclass, args[0]);
|
||||
update(Constructor, args[1]);
|
||||
Constructor.__proto__ = superclass;
|
||||
args = args.slice(2);
|
||||
Array.forEach(args, function (obj) {
|
||||
if (callable(obj))
|
||||
@@ -506,18 +681,11 @@ function Class() {
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
if (Object.defineProperty)
|
||||
Class.replaceProperty = function (obj, prop, value) {
|
||||
Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: value, writable: true });
|
||||
return value;
|
||||
};
|
||||
else
|
||||
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.replaceProperty = function (obj, prop, value) {
|
||||
Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: value, writable: true });
|
||||
return value;
|
||||
};
|
||||
Class.toString = function () "[class " + this.classname + "]";
|
||||
Class.prototype = {
|
||||
/**
|
||||
* Initializes new instances of this class. Called automatically
|
||||
@@ -525,7 +693,7 @@ Class.prototype = {
|
||||
*/
|
||||
init: function () {},
|
||||
|
||||
toString: function () "[instance " + this.constructor.name + "]",
|
||||
toString: function () "[instance " + this.constructor.classname + "]",
|
||||
|
||||
/**
|
||||
* Executes 'callback' after 'timeout' milliseconds. The value of
|
||||
@@ -558,9 +726,9 @@ function Module(name, prototype) {
|
||||
let init = callable(prototype) ? 4 : 3;
|
||||
const module = Class.apply(Class, Array.slice(arguments, 0, init));
|
||||
let instance = module();
|
||||
module.name = name.toLowerCase();
|
||||
module.classname = name.toLowerCase();
|
||||
instance.INIT = arguments[init] || {};
|
||||
currentModule[module.name] = instance;
|
||||
currentModule[module.classname] = instance;
|
||||
defmodule.modules.push(instance);
|
||||
return module;
|
||||
}
|
||||
@@ -597,7 +765,7 @@ else
|
||||
*/
|
||||
function Struct() {
|
||||
let args = Array.slice(arguments);
|
||||
const Struct = Class("Struct", Struct_Base, {
|
||||
const Struct = Class("Struct", StructBase, {
|
||||
length: args.length,
|
||||
members: args
|
||||
});
|
||||
@@ -607,7 +775,7 @@ function Struct() {
|
||||
});
|
||||
return Struct;
|
||||
}
|
||||
let Struct_Base = Class("StructBase", Array, {
|
||||
let StructBase = Class("StructBase", Array, {
|
||||
init: function () {
|
||||
for (let i = 0; i < arguments.length; i++)
|
||||
if (arguments[i] != undefined)
|
||||
@@ -639,7 +807,7 @@ let Struct_Base = Class("StructBase", Array, {
|
||||
*/
|
||||
defaultValue: function (key, val) {
|
||||
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)
|
||||
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.
|
||||
*/
|
||||
const array = Class("util.Array", Array, {
|
||||
const array = Class("array", Array, {
|
||||
init: function (ary) {
|
||||
if (isinstance(ary, ["Iterator", "Generator"]))
|
||||
ary = [k for (k in ary)];
|
||||
@@ -714,23 +898,19 @@ const array = Class("util.Array", Array, {
|
||||
__proto__: ary,
|
||||
__iterator__: function () this.iteritems(),
|
||||
__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))
|
||||
return array(res);
|
||||
return res;
|
||||
},
|
||||
toString: function () this.__proto__.toString(),
|
||||
concat: function () this.__proto__.concat.apply(this.__proto__, arguments),
|
||||
array: ary,
|
||||
toString: function () this.array.toString(),
|
||||
concat: function () this.array.concat.apply(this.array, arguments),
|
||||
filter: function () this.__noSuchMethod__("filter", 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
|
||||
* array of key-value pairs, which maps directly to an object,
|
||||
@@ -834,6 +1014,6 @@ const array = Class("util.Array", Array, {
|
||||
|
||||
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:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
defmodule("bookmarkcache", this, {
|
||||
exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"],
|
||||
require: ["services", "util"]
|
||||
require: ["services", "storage", "util"]
|
||||
});
|
||||
|
||||
|
||||
@@ -26,11 +26,10 @@ const name = "bookmark-cache";
|
||||
|
||||
const BookmarkCache = Module("BookmarkCache", {
|
||||
init: function init() {
|
||||
|
||||
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()),
|
||||
|
||||
@@ -38,9 +37,9 @@ const BookmarkCache = Module("BookmarkCache", {
|
||||
.map(function (s) bookmarks[s]),
|
||||
|
||||
_deleteBookmark: function deleteBookmark(id) {
|
||||
let length = bookmarks.length;
|
||||
bookmarks = bookmarks.filter(function (item) item.id != id);
|
||||
return bookmarks.length < length;
|
||||
let length = this.bookmarks.length;
|
||||
this.bookmarks = this.bookmarks.filter(function (item) item.id != id);
|
||||
return this.bookmarks.length < length;
|
||||
},
|
||||
|
||||
_loadBookmark: function loadBookmark(node) {
|
||||
@@ -118,7 +117,7 @@ const BookmarkCache = Module("BookmarkCache", {
|
||||
onItemMoved: function onItemMoved() {},
|
||||
onItemAdded: function onItemAdded(itemId, folder, index) {
|
||||
if (bookmarks.getItemType(itemId) == bookmarks.TYPE_BOOKMARK) {
|
||||
if (self.isBookmark(itemId)) {
|
||||
if (this.isBookmark(itemId)) {
|
||||
let bmark = this._loadBookmark(this.readBookmark(itemId));
|
||||
this.bookmarks.push(bmark);
|
||||
storage.fireEvent(name, "add", bmark);
|
||||
|
||||
@@ -8,22 +8,40 @@ Components.utils.import("resource://dactyl/base.jsm");
|
||||
defmodule("highlight", this, {
|
||||
exports: ["Highlight", "Highlights", "highlight"],
|
||||
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 ()
|
||||
this.base ? this.base.filter :
|
||||
["chrome://dactyl/*",
|
||||
"dactyl:*",
|
||||
"file://*"].concat(highlight.styleableChrome).join(","));
|
||||
Highlight.defaultValue("baseClass", function () /^(\w*)/.exec(this.class)[0]);
|
||||
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("base", function () {
|
||||
let base = /^(\w*)/.exec(this.class)[0];
|
||||
return (base != this.class && base in highlight.highlight) ? highlight.highlight[base] : null;
|
||||
});
|
||||
|
||||
Highlight.prototype.__defineGetter__("base", function ()
|
||||
this.baseClass != this.class && highlight.highlight[this.baseClass] || null);
|
||||
Highlight.prototype.__defineGetter__("css", function ()
|
||||
this.selector + "{" + this.value + "}");
|
||||
Highlight.prototype.toString = function ()
|
||||
"Highlight(" + this.class + ")\n\t"
|
||||
+ [k + ": " + String.quote(v) for ([k, v] in this)]
|
||||
@@ -38,12 +56,47 @@ Highlight.prototype.toString = function ()
|
||||
const Highlights = Module("Highlight", {
|
||||
init: function () {
|
||||
this.highlight = {};
|
||||
this.loaded = {};
|
||||
},
|
||||
|
||||
keys: function keys() Object.keys(this.highlight).sort(),
|
||||
|
||||
__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],
|
||||
set: function (key, newStyle, force, append) {
|
||||
let [, class_, selectors] = key.match(/^([a-zA-Z_-]+)(.*)/);
|
||||
@@ -51,35 +104,40 @@ const Highlights = Module("Highlight", {
|
||||
if (!(class_ in this.highlight))
|
||||
return "Unknown highlight keyword: " + class_;
|
||||
|
||||
let style = this.highlight[key] || Highlight(key);
|
||||
let highlight = this.highlight[key] || this._create(false, [key]);
|
||||
|
||||
if (append)
|
||||
newStyle = (style.value || "").replace(/;?\s*$/, "; " + newStyle);
|
||||
newStyle = (highlight.value || "").replace(/;?\s*$/, "; " + newStyle);
|
||||
if (/^\s*$/.test(newStyle))
|
||||
newStyle = null;
|
||||
if (newStyle == null) {
|
||||
if (style.default == null) {
|
||||
styles.removeSheet(true, style.selector);
|
||||
delete this.highlight[style.class];
|
||||
if (highlight.default == null) {
|
||||
highlight.style.enabled = false;
|
||||
delete this.loaded[highlight.class];
|
||||
delete this.highlight[highlight.class];
|
||||
return null;
|
||||
}
|
||||
newStyle = style.default;
|
||||
newStyle = highlight.default;
|
||||
}
|
||||
|
||||
if (!style.loaded || style.value != newStyle) {
|
||||
styles.removeSheet(true, style.selector);
|
||||
let css = newStyle.replace(/(?:!\s*important\s*)?(?:;?\s*$|;)/g, "!important;")
|
||||
.replace(";!important;", ";", "g"); // Seeming Spidermonkey bug
|
||||
if (!/^\s*(?:!\s*important\s*)?;*\s*$/.test(css)) {
|
||||
css = style.selector + " { " + css + " }";
|
||||
highlight.value = newStyle;
|
||||
if (force)
|
||||
highlight.style.enabled = true;
|
||||
this.highlight[highlight.class] = highlight;
|
||||
return highlight;
|
||||
},
|
||||
|
||||
styles.addSheet(true, "highlight:" + style.class, style.filter, css, true);
|
||||
style.loaded = true;
|
||||
}
|
||||
}
|
||||
style.value = newStyle;
|
||||
this.highlight[style.class] = style;
|
||||
return null;
|
||||
/**
|
||||
* Highlights a node with the given group, and ensures that said
|
||||
* group is loaded.
|
||||
*
|
||||
* @param {Node} node
|
||||
* @param {string} group
|
||||
*/
|
||||
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);
|
||||
},
|
||||
|
||||
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 {boolean} eager When true, load all provided rules immediately.
|
||||
*/
|
||||
loadCSS: function (css) {
|
||||
css.replace(/^(\s*\S*\s+)\{((?:.|\n)*?)\}\s*$/gm, function (_, _1, _2) _1 + " " + _2.replace(/\n\s*/g, " "))
|
||||
.split("\n").filter(function (s) /\S/.test(s))
|
||||
.forEach(function (style) {
|
||||
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;
|
||||
loadCSS: function (css, eager) {
|
||||
String.replace(css, this.groupRegexp, function (m, m1, m2) m1 + " " + m2.replace(/\n\s*/g, " "))
|
||||
.split("\n").filter(function (s) /\S/.test(s) && !/^\s*\/\//.test(s))
|
||||
.forEach(function (highlight) {
|
||||
|
||||
let old = this.highlight[style.class];
|
||||
if (!old)
|
||||
this.highlight[style.class] = style;
|
||||
else if (old.value == old.default)
|
||||
old.value = style.value;
|
||||
}, this);
|
||||
for (let [class_, hl] in Iterator(this.highlight))
|
||||
if (hl.value == hl.default)
|
||||
this.set(class_);
|
||||
let bang = eager || /^\s*!/.test(highlight);
|
||||
let star = /^\s*!?\*/.test(highlight);
|
||||
highlight = this._create(star, this.sheetRegexp.exec(highlight).slice(1));
|
||||
if (bang)
|
||||
highlight.style.enabled = true;
|
||||
}, this);
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
@@ -181,11 +278,8 @@ const Highlights = Module("Highlight", {
|
||||
if (!key || h.class.indexOf(key) > -1))));
|
||||
else if (!key && clear)
|
||||
highlight.clear();
|
||||
else {
|
||||
let error = highlight.set(key, css, clear, "-append" in args);
|
||||
if (error)
|
||||
dactyl.echoerr(error);
|
||||
}
|
||||
else
|
||||
highlight.set(key, css, clear, "-append" in args);
|
||||
},
|
||||
{
|
||||
// TODO: add this as a standard highlight completion function?
|
||||
@@ -221,7 +315,7 @@ const Highlights = Module("Highlight", {
|
||||
completion.colorScheme = function colorScheme(context) {
|
||||
context.title = ["Color Scheme", "Runtime 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(
|
||||
function (dir) dir.readDirectory().filter(
|
||||
function (file) /\.vimp$/.test(file.leafName))))
|
||||
@@ -232,6 +326,12 @@ const Highlights = Module("Highlight", {
|
||||
context.title = ["Highlight Group", "Value"];
|
||||
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").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);
|
||||
}
|
||||
else {
|
||||
@@ -185,12 +185,12 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, {
|
||||
prefToArg: function (pref) pref.replace(/.*\./, "").toLowerCase(),
|
||||
|
||||
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))
|
||||
yield c;
|
||||
},
|
||||
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)))
|
||||
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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -9,6 +9,9 @@ defmodule("services", this, {
|
||||
exports: ["Services", "services"]
|
||||
});
|
||||
|
||||
/**
|
||||
* A lazily-instantiated XPCOM class and service cache.
|
||||
*/
|
||||
const Services = Module("Services", {
|
||||
init: function () {
|
||||
this.classes = {};
|
||||
@@ -33,12 +36,13 @@ const Services = Module("Services", {
|
||||
this.add("json", "@mozilla.org/dom/json;1", Ci.nsIJSON, "createInstance");
|
||||
this.add("livemark", "@mozilla.org/browser/livemark-service;2", Ci.nsILivemarkService);
|
||||
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("profile", "@mozilla.org/toolkit/profile-service;1", Ci.nsIToolkitProfileService);
|
||||
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("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("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", Ci.mozIJSSubScriptLoader);
|
||||
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");
|
||||
},
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param {string} name The service's cache key.
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -1,24 +1,7 @@
|
||||
/***** BEGIN LICENSE BLOCK ***** {{{
|
||||
Copyright ©2008-2009 by Kris Maglione <maglione.k at Gmail>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
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 *****/
|
||||
// Copyright (c) 2008-2010 by Kris Maglione <maglione.k at Gmail>
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
const myObject = Object;
|
||||
@@ -98,38 +81,6 @@ const StoreBase = Class("StoreBase", {
|
||||
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, {
|
||||
_constructor: Array,
|
||||
|
||||
@@ -176,12 +127,51 @@ const ArrayStore = Class("ArrayStore", StoreBase, {
|
||||
__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 observers = {};
|
||||
|
||||
const Storage = Module("Storage", {
|
||||
alwaysReload: {},
|
||||
|
||||
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 this && !(params.reload || this.alwaysReload[key]))
|
||||
throw Error();
|
||||
@@ -198,7 +188,7 @@ const Storage = Module("Storage", {
|
||||
},
|
||||
|
||||
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) {
|
||||
@@ -295,7 +285,7 @@ const File = Class("File", {
|
||||
let file = services.create("file");
|
||||
|
||||
if (path instanceof Ci.nsIFile)
|
||||
file = path;
|
||||
file = path.QueryInterface(Ci.nsIFile);
|
||||
else if (/file:\/\//.test(path))
|
||||
file = services.create("file:").getFileFromURLSpec(path);
|
||||
else {
|
||||
@@ -317,9 +307,8 @@ const File = Class("File", {
|
||||
iterDirectory: function () {
|
||||
if (!this.isDirectory())
|
||||
throw Error("Not a directory");
|
||||
let entries = this.directoryEntries;
|
||||
while (entries.hasMoreElements())
|
||||
yield File(entries.getNext().QueryInterface(Ci.nsIFile));
|
||||
for (let file in iter(this.directoryEntries))
|
||||
yield File(file);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -409,6 +398,8 @@ const File = Class("File", {
|
||||
|
||||
if (!perms)
|
||||
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);
|
||||
let ocstream = getStream(0);
|
||||
@@ -567,8 +558,8 @@ const File = Class("File", {
|
||||
replacePathSep: function (path) path.replace("/", File.PATH_SEP, "g")
|
||||
});
|
||||
|
||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n");}
|
||||
|
||||
endmodule();
|
||||
|
||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
||||
|
||||
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
Components.utils.import("resource://dactyl/base.jsm");
|
||||
defmodule("styles", this, {
|
||||
exports: ["Style", "Styles", "styles"],
|
||||
require: ["services", "util"]
|
||||
require: ["services", "util"],
|
||||
use: ["template"]
|
||||
});
|
||||
|
||||
const sss = services.get("stylesheet");
|
||||
@@ -17,6 +18,35 @@ const namespace = "@namespace html " + XHTML.uri.quote() + ";\n" +
|
||||
"@namespace dactyl " + NS.uri.quote() + ";\n";
|
||||
|
||||
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() {
|
||||
let filter = this.sites;
|
||||
let css = this.css;
|
||||
@@ -29,23 +59,8 @@ Sheet.prototype.__defineGetter__("fullCSS", function wrapCSS() {
|
||||
: "domain")
|
||||
+ '("' + part.replace(/"/g, "%22").replace(/\*$/, "") + '")')
|
||||
.join(", ");
|
||||
return "/* Dactyl style #" + this.id + " */ " + 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);
|
||||
return "/* Dactyl style #" + this.id + (this.agent ? " (agent)" : "") + " */ "
|
||||
+ namespace + " @-moz-document " + selectors + "{\n" + css + "\n}\n";
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -64,7 +79,7 @@ const Styles = Module("Styles", {
|
||||
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)),
|
||||
|
||||
@@ -81,25 +96,27 @@ const Styles = Module("Styles", {
|
||||
* "*" is matched as a prefix.
|
||||
* @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 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;
|
||||
}
|
||||
catch (e) {
|
||||
return e.echoerr || e;
|
||||
}
|
||||
sheets.push(sheet);
|
||||
|
||||
if (name)
|
||||
names[name] = sheet;
|
||||
return null;
|
||||
return sheet;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -129,14 +146,13 @@ const Styles = Module("Styles", {
|
||||
*/
|
||||
findSheets: function findSheets(system, name, filter, css, index) {
|
||||
let sheets = system ? this.systemSheets : this.userSheets;
|
||||
let names = system ? this.systemNames : this.userNames;
|
||||
|
||||
// Grossly inefficient.
|
||||
let matches = [k for ([k, v] in Iterator(sheets))];
|
||||
if (index)
|
||||
matches = String(index).split(",").filter(function (i) i in sheets);
|
||||
if (name)
|
||||
matches = matches.filter(function (i) sheets[i] == names[name]);
|
||||
matches = matches.filter(function (i) sheets[i].name == name);
|
||||
if (css)
|
||||
matches = matches.filter(function (i) sheets[i].css == css);
|
||||
if (filter)
|
||||
@@ -178,18 +194,18 @@ const Styles = Module("Styles", {
|
||||
return null;
|
||||
|
||||
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) {
|
||||
let sites = sheet.sites.filter(function (f) f != filter);
|
||||
if (sites.length)
|
||||
this.addSheet(system, name, sites.join(","), css, sheet.agent);
|
||||
if (sites.length) {
|
||||
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;
|
||||
},
|
||||
@@ -256,7 +272,7 @@ const Styles = Module("Styles", {
|
||||
["min-width: 1em; text-align: center; color: red; font-weight: bold;",
|
||||
"padding: 0 1em 0 1ex; vertical-align: top;",
|
||||
"padding: 0 1em 0 0; vertical-align: top;"],
|
||||
([sheet.enabled ? "" : "\u00d7",
|
||||
([sheet.enabled ? "" : UTF8("×"),
|
||||
key,
|
||||
sheet.sites.join(","),
|
||||
sheet.css]
|
||||
@@ -271,9 +287,7 @@ const Styles = Module("Styles", {
|
||||
css = sheet.css + " " + css;
|
||||
}
|
||||
}
|
||||
let err = styles.addSheet(false, name, filter, css);
|
||||
if (err)
|
||||
dactyl.echoerr(err);
|
||||
styles.addSheet(false, name, filter, css);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -377,4 +391,6 @@ const Styles = Module("Styles", {
|
||||
|
||||
endmodule();
|
||||
|
||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
||||
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -40,6 +40,8 @@ const Template = Module("Template", {
|
||||
if (typeof xml == "xml")
|
||||
return xml;
|
||||
try {
|
||||
XML.ignoreWhitespace = false;
|
||||
XML.prettyPrinting = false;
|
||||
return new XMLList(xml);
|
||||
}
|
||||
catch (e) {}
|
||||
@@ -48,7 +50,7 @@ const Template = Module("Template", {
|
||||
|
||||
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) ? "" :
|
||||
<span class="extra-info">
|
||||
@@ -72,8 +74,8 @@ const Template = Module("Template", {
|
||||
var desc = item[1] || "";
|
||||
}
|
||||
else {
|
||||
var text = this.process[0].call(this, item, item.text);
|
||||
var desc = this.process[1].call(this, item, item.description);
|
||||
var text = this.processor[0].call(this, item, item.result);
|
||||
var desc = this.processor[1].call(this, item, item.description);
|
||||
}
|
||||
|
||||
// <e4x>
|
||||
@@ -82,8 +84,8 @@ const Template = Module("Template", {
|
||||
- from pushing the baseline down and enlarging
|
||||
- the row.
|
||||
-->
|
||||
<li highlight="CompResult">{text} </li>
|
||||
<li highlight="CompDesc">{desc} </li>
|
||||
<li highlight="CompResult">{text} </li>
|
||||
<li highlight="CompDesc">{desc} </li>
|
||||
</div>;
|
||||
// </e4x>
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||
// 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -10,7 +10,7 @@ Components.utils.import("resource://dactyl/base.jsm");
|
||||
defmodule("util", this, {
|
||||
exports: ["Math", "NS", "Util", "XHTML", "XUL", "util"],
|
||||
require: ["services"],
|
||||
use: ["template"]
|
||||
use: ["highlight", "template"]
|
||||
});
|
||||
|
||||
const XHTML = Namespace("html", "http://www.w3.org/1999/xhtml");
|
||||
@@ -206,7 +206,7 @@ const Util = Module("Util", {
|
||||
function rec(acc) {
|
||||
if (acc.length == patterns.length)
|
||||
res.push(array(substrings).zip(acc).flatten().join(""));
|
||||
else
|
||||
else
|
||||
for (let [, pattern] in Iterator(patterns[acc.length]))
|
||||
rec(acc.concat(pattern));
|
||||
}
|
||||
@@ -295,12 +295,12 @@ const Util = Module("Util", {
|
||||
null
|
||||
);
|
||||
|
||||
return {
|
||||
__proto__: result,
|
||||
__iterator__: asIterator
|
||||
? function () { let elem; while ((elem = this.iterateNext())) yield elem; }
|
||||
: function () { for (let i = 0; i < this.snapshotLength; i++) yield this.snapshotItem(i); }
|
||||
}
|
||||
return Object.create(result, {
|
||||
__iterator__: {
|
||||
value: asIterator ? function () { let elem; while ((elem = this.iterateNext())) yield elem; }
|
||||
: function () { for (let i = 0; i < this.snapshotLength; i++) yield this.snapshotItem(i); }
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
extend: function extend(dest) {
|
||||
@@ -388,18 +388,17 @@ const Util = Module("Util", {
|
||||
try {
|
||||
let xmlhttp = services.create("xmlhttp");
|
||||
xmlhttp.mozBackgroundRequest = true;
|
||||
if (callback) {
|
||||
if (callback)
|
||||
xmlhttp.onreadystatechange = function () {
|
||||
if (xmlhttp.readyState == 4)
|
||||
callback(xmlhttp);
|
||||
};
|
||||
}
|
||||
xmlhttp.open("GET", url, !!callback);
|
||||
xmlhttp.send(null);
|
||||
return xmlhttp;
|
||||
}
|
||||
catch (e) {
|
||||
util.dactyl.log("Error opening " + String.quote(url) + ": " + e, 1);
|
||||
util.dactyl.log("Error opening " + String.quote(url) + ": " + e, 1);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
@@ -460,9 +459,9 @@ const Util = Module("Util", {
|
||||
* @returns {string}
|
||||
*/
|
||||
makeXPath: function makeXPath(nodes) {
|
||||
return util.Array(nodes).map(util.debrace).flatten()
|
||||
.map(function (node) [node, "xhtml:" + node]).flatten()
|
||||
.map(function (node) "//" + node).join(" | ");
|
||||
return array(nodes).map(util.debrace).flatten()
|
||||
.map(function (node) [node, "xhtml:" + node]).flatten()
|
||||
.map(function (node) "//" + node).join(" | ");
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -480,18 +479,6 @@ const Util = Module("Util", {
|
||||
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),
|
||||
|
||||
/**
|
||||
@@ -524,34 +511,47 @@ const Util = Module("Util", {
|
||||
if (object === null)
|
||||
return "null\n";
|
||||
|
||||
if (typeof object != "object")
|
||||
if (typeof object !== "object")
|
||||
return false;
|
||||
|
||||
const NAMESPACES = util.Array.toObject([
|
||||
[NS, 'dactyl'],
|
||||
[XHTML, 'html'],
|
||||
[XUL, 'xul']
|
||||
]);
|
||||
if (object instanceof Ci.nsIDOMElement) {
|
||||
const NAMESPACES = array.toObject([
|
||||
[NS, "dactyl"],
|
||||
[XHTML, "html"],
|
||||
[XUL, "xul"]
|
||||
]);
|
||||
let elem = object;
|
||||
if (elem.nodeType == elem.TEXT_NODE)
|
||||
return elem.data;
|
||||
|
||||
function namespaced(node) {
|
||||
var ns = NAMESPACES[node.namespaceURI];
|
||||
if (ns)
|
||||
return ns + ":" + node.localName;
|
||||
return node.localName.toLowerCase();
|
||||
var ns = NAMESPACES[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[0];
|
||||
if (!ns)
|
||||
return node.localName;
|
||||
if (color)
|
||||
return <><span highlight="HelpXMLNamespace">{ns}</span>{node.localName}</>
|
||||
return ns + ":" + node.localName;
|
||||
}
|
||||
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(
|
||||
[namespaced(a) + "=" + template.highlight(a.value, true)
|
||||
for ([i, a] in util.Array.iteritems(elem.attributes))]).join(" ");
|
||||
|
||||
if (!elem.firstChild || /^\s*$/.test(elem.firstChild) && !elem.firstChild.nextSibling)
|
||||
tag += '/>';
|
||||
else
|
||||
tag += '>...</' + namespaced(elem) + '>';
|
||||
return tag;
|
||||
for ([i, a] in array.iteritems(elem.attributes))]).join(" ");
|
||||
return tag + (hasChildren ? "/>" : ">...</" + namespaced(elem) + ">");
|
||||
}
|
||||
catch (e) {
|
||||
return {}.toString.call(elem);
|
||||
@@ -562,13 +562,15 @@ const Util = Module("Util", {
|
||||
var obj = String(object);
|
||||
}
|
||||
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>);
|
||||
let string = <><span highlight="Title Object">{obj}</span>::<br/>
</>;
|
||||
let string = <><span highlight="Title Object">{obj}</span>::<br/>
</>;
|
||||
|
||||
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"]));
|
||||
if (object.dactyl && object.modules && object.modules.modules == object.modules) {
|
||||
object = Iterator(object);
|
||||
@@ -593,7 +595,7 @@ const Util = Module("Util", {
|
||||
i = parseInt(i);
|
||||
else if (/^[A-Z_]+$/.test(i))
|
||||
i = "";
|
||||
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}<br/>
</>]);
|
||||
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}<br/>
</>]);
|
||||
}
|
||||
}
|
||||
catch (e) {}
|
||||
@@ -672,7 +674,6 @@ const Util = Module("Util", {
|
||||
selectionController: function (win)
|
||||
win.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell)
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsISelectionDisplay)
|
||||
.QueryInterface(Ci.nsISelectionController),
|
||||
@@ -714,6 +715,7 @@ const Util = Module("Util", {
|
||||
* string.
|
||||
*
|
||||
* util.split("a, b, c, d, e", /, /, 3) -> ["a", "b", "c, d, e"]
|
||||
*
|
||||
* @param {string} str The string to split.
|
||||
* @param {RegExp|string} re The regular expression on which to split the string.
|
||||
* @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 {Document} doc
|
||||
@@ -797,7 +801,14 @@ const Util = Module("Util", {
|
||||
case "element":
|
||||
let domnode = doc.createElementNS(node.namespace(), node.localName());
|
||||
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.*)
|
||||
domnode.appendChild(xmlToDom(child, doc, nodes));
|
||||
if (nodes && node.@key)
|
||||
@@ -816,9 +827,7 @@ const Util = Module("Util", {
|
||||
* @singleton
|
||||
*/
|
||||
const GlobalMath = Math;
|
||||
var Math = {
|
||||
__proto__: GlobalMath,
|
||||
|
||||
var Math = update(Object.create(GlobalMath), {
|
||||
/**
|
||||
* Returns the specified <b>value</b> constrained to the range <b>min</b> -
|
||||
* <b>max</b>.
|
||||
@@ -829,9 +838,9 @@ var Math = {
|
||||
* @returns {number}
|
||||
*/
|
||||
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();
|
||||
|
||||
|
||||
@@ -156,8 +156,6 @@ statusbarpanel {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#dactyl-completions-content *,
|
||||
#dactyl-multiline-output-content *,
|
||||
#dactyl-commandline-prompt *,
|
||||
#dactyl-commandline-command {
|
||||
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:
|
||||
* Use only visible tabs for tab numbering, gt/gn/gN, etc.
|
||||
* Group tabs in :buffer completions by panorama groups
|
||||
* Extensive Firefox 4 support, including:
|
||||
- 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 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.
|
||||
'|' key binding has been removed.
|
||||
* :open now only opens files begining with /, ./, or ~/
|
||||
* Page zoom information is now shown in the status bar
|
||||
The | key binding has been removed.
|
||||
* :open now only opens files begining with /, ./, ../, or ~/
|
||||
* '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
|
||||
* Add basic plugin authorship documentation
|
||||
* Plugins may now provide full-fleged ':help' documentation
|
||||
* The help system is newly modularized
|
||||
* Asciidoc is no longer for building
|
||||
* Remove [c]:edit[c], [c]:tabedit[c], and [c]:winedit[c]
|
||||
* Major help system improvements:
|
||||
- Plugins may now provide full-fleged ':help' documentation
|
||||
- Add basic plugin authorship documentation
|
||||
- The help system is newly modularized and features significant
|
||||
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 "addons", "downloads", "extoptions" and "help" to the 'activate' option.
|
||||
|
||||
@@ -22,17 +44,6 @@
|
||||
tri-license to the MIT license.
|
||||
* IMPORTANT: Map.flags has been replaced with individual properties.
|
||||
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>
|
||||
and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
|
||||
* 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.
|
||||
|
||||
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
|
||||
8 Document Textarea, Caret and Visual modes.
|
||||
8 Replace config.name tests in dactyl with more specific feature
|
||||
|
||||
@@ -14,15 +14,19 @@ 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://pentadactyl/content/pentadactyl.xul
|
||||
|
||||
component {81495d80-89ee-4c36-a88d-ea7c4e5ac63f} components/about-handler.js
|
||||
contract @mozilla.org/network/protocol/about;1?what=pentadactyl {81495d80-89ee-4c36-a88d-ea7c4e5ac63f}
|
||||
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=pentadactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
|
||||
category command-line-handler m-pentadactyl @mozilla.org/commandlinehandler/general-startup;1?type=pentadactyl
|
||||
|
||||
component {c1b67a07-18f7-4e13-b361-2edcc35a5a0d} components/protocols.js
|
||||
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 {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=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) 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
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
const Config = Module("config", ConfigBase, {
|
||||
name: "Pentadactyl",
|
||||
hostApplication: "Firefox",
|
||||
|
||||
get visualbellWindow() getBrowser().mPanelContainer,
|
||||
styleableChrome: ["chrome://browser/content/browser.xul"],
|
||||
|
||||
@@ -150,7 +147,7 @@ const Config = Module("config", ConfigBase, {
|
||||
{ argCount: "0" });
|
||||
|
||||
commands.add(["pref[erences]", "prefs"],
|
||||
"Show " + config.hostApplication + " preferences",
|
||||
"Show " + config.host + " preferences",
|
||||
function (args) {
|
||||
if (args.bang) { // open Firefox settings GUI dialog
|
||||
dactyl.open("about:config",
|
||||
@@ -242,6 +239,7 @@ const Config = Module("config", ConfigBase, {
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
dactyl.dump("Load completion\n");
|
||||
var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589
|
||||
completion.location = function location(context) {
|
||||
if (!services.get("autoCompleteSearch"))
|
||||
|
||||
@@ -4,12 +4,19 @@
|
||||
|
||||
<!ENTITY dactyl.mainWindow "main-window">
|
||||
<!ENTITY dactyl.name "pentadactyl">
|
||||
<!ENTITY dactyl.version "1.0">
|
||||
<!ENTITY dactyl.idname "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.host "&brandShortName;">
|
||||
<!ENTITY dactyl.hostbin "firefox">
|
||||
<!ENTITY dactyl.statusBefore "statusbar-display">
|
||||
<!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:name>Pentadactyl</em:name>
|
||||
<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: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: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>
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>3.5</em:minVersion>
|
||||
<em:maxVersion>4.0b5pre</em:maxVersion>
|
||||
<em:maxVersion>4.0b7pre</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="chrome://dactyl/content/help.xsl"?>
|
||||
<?xml version="&xmlns.dactyl;>
|
||||
<?xml-stylesheet type="&xmlns.html;" href="chrome://dactyl/content/help.xsl"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||
|
||||
<overlay
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
|
||||
<dl tag="autocommand-list" replace="autocommand-list">
|
||||
<dt>BookmarkAdd</dt> <dd>Triggered after a page is bookmarked</dd>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<!DOCTYPE overlay SYSTEM "chrome://dactyl/content/dactyl.dtd">
|
||||
|
||||
<overlay
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
|
||||
<dl tag="dialog-list" replace="dialog-list">
|
||||
<dt>about</dt> <dd>About Mozilla &dactyl.host;;</dd>
|
||||
|
||||
@@ -6,36 +6,35 @@
|
||||
<document
|
||||
name="intro"
|
||||
title="&dactyl.appname; Introduction"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
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>
|
||||
|
||||
<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.
|
||||
<p>
|
||||
<link topic="&dactyl.apphome;">&dactyl.appname;</link> is a
|
||||
free browser add-on for &dactyl.host;, designed to make browsing more
|
||||
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">
|
||||
To provide the most authentic Vim experience, the &dactyl.host;
|
||||
menubar and toolbar are hidden.
|
||||
|
||||
<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 disable it
|
||||
with <ex>:extdisable &dactyl.appname;</ex>
|
||||
</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>
|
||||
<p tag="first-run">
|
||||
If this is your first time running &dactyl.appname;, you may need some
|
||||
time to adjust to the standard interface, which hides the menu,
|
||||
navigation, and tool bars by default. If you find it uncomfortable to work
|
||||
without them, you can re-enable them by typing,
|
||||
</p>
|
||||
<code><ex>:set</ex> <link topic="'guioptions'"><hl key="HelpOpt">guioptions</hl></link><hl key="HelpEx">+=mT</hl><k name="Return"/></code>
|
||||
<p>
|
||||
If you have trouble remembering commands or keyboard shortcuts, you can
|
||||
bring up this help page at any time by typing <ex>:help</ex> or the
|
||||
<k name="F1"/>. If you find that you don't like &dactyl.appname; at all,
|
||||
you can disable it by typing <ex>:extdisable &dactyl.appname;</ex> or
|
||||
delete it entirely by typing <ex>:extdelete &dactyl.appname;</ex>
|
||||
</p>
|
||||
|
||||
<h2 tag="overview">Help topics</h2>
|
||||
|
||||
@@ -46,16 +45,17 @@ text editor.
|
||||
</li>
|
||||
<li>
|
||||
<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>
|
||||
<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).
|
||||
Basic key mappings and commands needed for a browsing
|
||||
session (how to open a web page, go back in history, etc.)
|
||||
</li>
|
||||
<li>
|
||||
<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>
|
||||
<link topic="cmdline">Command-line mode</link>:
|
||||
@@ -82,7 +82,7 @@ text editor.
|
||||
Selecting hyperlinks and other page elements.
|
||||
</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.
|
||||
</li>
|
||||
<li>
|
||||
@@ -115,19 +115,19 @@ text editor.
|
||||
</li>
|
||||
<li>
|
||||
<link topic="message">Error and informational messages</link>:
|
||||
A description of messages and error messages.
|
||||
A description of informational and error messages.
|
||||
</li>
|
||||
<li>
|
||||
<link topic="developer">Developer information</link>:
|
||||
How to write docs or plugins.
|
||||
How to write plugins and documentation.
|
||||
</li>
|
||||
<li>
|
||||
<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>
|
||||
<link topic="plugins">Plugins</link>:
|
||||
Documentation for any plugins you may have installed.
|
||||
Documentation for any plugins you have installed.
|
||||
</li>
|
||||
<li>
|
||||
<link topic="index">Index</link>:
|
||||
@@ -136,7 +136,8 @@ text editor.
|
||||
</ol>
|
||||
|
||||
<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>
|
||||
|
||||
<example><ex>:help :help</ex></example>
|
||||
@@ -144,26 +145,23 @@ text editor.
|
||||
<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>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>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>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>Advanced completion of bookmark and history URLs</li>
|
||||
<li>Vim-like status line with a Wget-like progress bar</li>
|
||||
<li>Minimal GUI (easily hide superfluous menubar and toolbar with <ex>:set guioptions=</ex>)</li>
|
||||
<li>Ability to <ex>:source</ex> JavaScript, CSS, and &dactyl.appname; command files.</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>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>Visual bell for errors (<o>visualbell</o>)</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><link topic="marks#quickmarks">QuickMark</link> support</li>
|
||||
<li><ex>:map</ex>, <ex>:command</ex>, <ex>:feedkeys</ex>, and <t>macros</t></li>
|
||||
<li><link topic="i_<C-i>">Editing of text fields</link> with an <link topic="'editor'">external editor</link></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>
|
||||
|
||||
<h2 tag="contact">Contact</h2>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<document
|
||||
name="tutorial"
|
||||
title="&dactyl.appname; Tutorial"
|
||||
xmlns="http://vimperator.org/namespaces/liberator"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
xmlns="&xmlns.dactyl;"
|
||||
xmlns:html="&xmlns.html;">
|
||||
<!-- Initial revision: Sun Jun 8 10:07:05 UTC 2008 (penryu) -->
|
||||
|
||||
<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
|
||||