mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 09:48:00 +01:00
Merge default.
--HG-- branch : mode-refactoring
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
|
|
||||||
// if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder
|
// if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder
|
||||||
add: function add(starOnly, title, url, keyword, tags, force) {
|
add: function add(starOnly, title, url, keyword, tags, force) {
|
||||||
|
// FIXME
|
||||||
|
if (isObject(starOnly))
|
||||||
|
var { starOnly, title, url, keyword, tags, post, force } = starOnly;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let uri = util.createURI(url);
|
let uri = util.createURI(url);
|
||||||
if (!force && bookmarks.isBookmarked(uri.spec))
|
if (!force && bookmarks.isBookmarked(uri.spec))
|
||||||
@@ -54,6 +58,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
if (!id)
|
if (!id)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
PlacesUtils.setPostDataForBookmark(id, post);
|
||||||
if (keyword)
|
if (keyword)
|
||||||
services.get("bookmarks").setKeywordForBookmark(id, keyword);
|
services.get("bookmarks").setKeywordForBookmark(id, keyword);
|
||||||
}
|
}
|
||||||
@@ -65,6 +70,17 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addSearchKeyword: function (elem) {
|
||||||
|
let [url, post] = util.parseForm(elem);
|
||||||
|
let options = { "-title": "Search " + elem.ownerDocument.title };
|
||||||
|
if (post != null)
|
||||||
|
options["-post"] = post;
|
||||||
|
|
||||||
|
commandline.open(":",
|
||||||
|
commands.commandToString({ command: "bmark", options: options, arguments: [url] }) + " -keyword ",
|
||||||
|
modes.EX);
|
||||||
|
},
|
||||||
|
|
||||||
toggle: function toggle(url) {
|
toggle: function toggle(url) {
|
||||||
if (!url)
|
if (!url)
|
||||||
return;
|
return;
|
||||||
@@ -104,11 +120,16 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
.getBookmarkIdsForURI(uri, {})
|
.getBookmarkIdsForURI(uri, {})
|
||||||
.filter(bookmarkcache.closure.isRegularBookmark);
|
.filter(bookmarkcache.closure.isRegularBookmark);
|
||||||
}
|
}
|
||||||
bmarks.forEach(services.get("bookmarks").removeItem);
|
bmarks.forEach(function (id) {
|
||||||
|
let bmark = bookmarkcache.bookmarks[id];
|
||||||
|
if (bmark)
|
||||||
|
PlacesUtils.tagging.untagURI(util.newURI(bmark.url), null);
|
||||||
|
services.get("bookmarks").removeItem(id);
|
||||||
|
});
|
||||||
return bmarks.length;
|
return bmarks.length;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.reportError(e);
|
dactyl.reportError(e, true);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -132,7 +153,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
if (engine.alias != alias)
|
if (engine.alias != alias)
|
||||||
engine.alias = alias;
|
engine.alias = alias;
|
||||||
|
|
||||||
searchEngines.push([engine.alias, engine.description, engine.iconURI && engine.iconURI.spec]);
|
searchEngines.push({ keyword: engine.alias, title: engine.description, icon: engine.iconURI && engine.iconURI.spec });
|
||||||
}
|
}
|
||||||
|
|
||||||
return searchEngines;
|
return searchEngines;
|
||||||
@@ -286,10 +307,9 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
args.completeFilter = have.pop();
|
args.completeFilter = have.pop();
|
||||||
|
|
||||||
let prefix = filter.substr(0, filter.length - args.completeFilter.length);
|
let prefix = filter.substr(0, filter.length - args.completeFilter.length);
|
||||||
let tags = array.uniq(array.flatten([b.tags for ([k, b] in Iterator(bookmarkcache.bookmarks)) if (b.tags)]));
|
context.generate = function () array(b.tags for (b in bookmarkcache) if (b.tags)).flatten().uniq().array;
|
||||||
|
context.keys = { text: function (tag) prefix + tag, description: util.identity };
|
||||||
context.keys = { text: 0, description: 1 };
|
context.filters.push(function (tag) have.indexOf(tag) < 0);
|
||||||
return [[prefix + tag, tag] for ([i, tag] in Iterator(tags)) if (have.indexOf(tag) < 0)];
|
|
||||||
},
|
},
|
||||||
type: CommandOption.LIST
|
type: CommandOption.LIST
|
||||||
};
|
};
|
||||||
@@ -310,6 +330,17 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
type: CommandOption.STRING
|
type: CommandOption.STRING
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const post = {
|
||||||
|
names: ["-post", "-p"],
|
||||||
|
description: "Bookmark POST data",
|
||||||
|
completer: function post(context, args) {
|
||||||
|
context.keys.text = "post";
|
||||||
|
context.keys.description = "url";
|
||||||
|
return bookmarks.get(args.join(" "), args["-tags"], null, { keyword: args["-keyword"], post: context.filter });
|
||||||
|
},
|
||||||
|
type: CommandOption.STRING
|
||||||
|
};
|
||||||
|
|
||||||
const keyword = {
|
const keyword = {
|
||||||
names: ["-keyword", "-k"],
|
names: ["-keyword", "-k"],
|
||||||
description: "Keyword by which this bookmark may be opened (:open {keyword})",
|
description: "Keyword by which this bookmark may be opened (:open {keyword})",
|
||||||
@@ -324,18 +355,23 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
commands.add(["bma[rk]"],
|
commands.add(["bma[rk]"],
|
||||||
"Add a bookmark",
|
"Add a bookmark",
|
||||||
function (args) {
|
function (args) {
|
||||||
let url = args.length == 0 ? buffer.URL : args[0];
|
let opts = {
|
||||||
let title = args["-title"] || (args.length == 0 ? buffer.title : null);
|
force: args.bang,
|
||||||
let keyword = args["-keyword"] || null;
|
starOnly: false,
|
||||||
let tags = args["-tags"] || [];
|
keyword: args["-keyword"] || null,
|
||||||
|
post: args["-post"] || null,
|
||||||
|
tags: args["-tags"] || [],
|
||||||
|
title: args["-title"] || (args.length === 0 ? buffer.title : null),
|
||||||
|
url: args.length === 0 ? buffer.URL : args[0]
|
||||||
|
};
|
||||||
|
|
||||||
if (bookmarks.add(false, title, url, keyword, tags, args.bang)) {
|
if (bookmarks.add(opts)) {
|
||||||
let extra = (title == url) ? "" : " (" + title + ")";
|
let extra = (opts.title == opts.url) ? "" : " (" + opts.title + ")";
|
||||||
dactyl.echomsg({ domains: [util.getHost(url)], message: "Added bookmark: " + url + extra },
|
dactyl.echomsg({ domains: [util.getHost(opts.url)], message: "Added bookmark: " + opts.url + extra },
|
||||||
1, commandline.FORCE_SINGLELINE);
|
1, commandline.FORCE_SINGLELINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dactyl.echoerr("Exxx: Could not add bookmark " + title.quote(), commandline.FORCE_SINGLELINE);
|
dactyl.echoerr("Exxx: Could not add bookmark " + opts.title.quote(), commandline.FORCE_SINGLELINE);
|
||||||
}, {
|
}, {
|
||||||
argCount: "?",
|
argCount: "?",
|
||||||
bang: true,
|
bang: true,
|
||||||
@@ -350,7 +386,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
}
|
}
|
||||||
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });
|
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });
|
||||||
},
|
},
|
||||||
options: [title, tags, keyword]
|
options: [keyword, title, tags, post]
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["bmarks"],
|
commands.add(["bmarks"],
|
||||||
@@ -383,7 +419,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
commandline.input("This will delete all bookmarks. Would you like to continue? (yes/[no]) ",
|
commandline.input("This will delete all bookmarks. Would you like to continue? (yes/[no]) ",
|
||||||
function (resp) {
|
function (resp) {
|
||||||
if (resp && resp.match(/^y(es)?$/i)) {
|
if (resp && resp.match(/^y(es)?$/i)) {
|
||||||
bookmarkcache.bookmarks.forEach(function (bmark) { services.get("bookmarks").removeItem(bmark.id); });
|
Object.keys(bookmarkcache.bookmarks).forEach(function (id) { services.get("bookmarks").removeItem(id); });
|
||||||
dactyl.echomsg("All bookmarks deleted", 1, commandline.FORCE_SINGLELINE);
|
dactyl.echomsg("All bookmarks deleted", 1, commandline.FORCE_SINGLELINE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -477,7 +513,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
if (v != null)
|
if (v != null)
|
||||||
context.filters.push(function (item) item.item[k] != null && this.matchString(v, item.item[k]));
|
context.filters.push(function (item) item.item[k] != null && this.matchString(v, item.item[k]));
|
||||||
});
|
});
|
||||||
context.completions = bookmarkcache.bookmarks;
|
context.generate = function () values(bookmarkcache.bookmarks);
|
||||||
completion.urls(context, tags);
|
completion.urls(context, tags);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -487,8 +523,8 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
let engines = bookmarks.getSearchEngines();
|
let engines = bookmarks.getSearchEngines();
|
||||||
|
|
||||||
context.title = ["Search Keywords"];
|
context.title = ["Search Keywords"];
|
||||||
context.completions = keywords.concat(engines);
|
context.completions = array(values(keywords)).concat(engines).array;
|
||||||
context.keys = { text: 0, description: 1, icon: 2 };
|
context.keys = { text: "keyword", description: "title", icon: "icon" };
|
||||||
|
|
||||||
if (!space || noSuggest)
|
if (!space || noSuggest)
|
||||||
return;
|
return;
|
||||||
@@ -496,7 +532,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
context.fork("suggest", keyword.length + space.length, this, "searchEngineSuggest",
|
context.fork("suggest", keyword.length + space.length, this, "searchEngineSuggest",
|
||||||
keyword, true);
|
keyword, true);
|
||||||
|
|
||||||
let item = keywords.filter(function (k) k.keyword == keyword)[0];
|
let item = keywords[keyword];
|
||||||
if (item && item.url.indexOf("%s") > -1)
|
if (item && item.url.indexOf("%s") > -1)
|
||||||
context.fork("keyword/" + keyword, keyword.length + space.length, null, function (context) {
|
context.fork("keyword/" + keyword, keyword.length + space.length, null, function (context) {
|
||||||
context.format = history.format;
|
context.format = history.format;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
const Browser = Module("browser", {
|
const Browser = Module("browser", {
|
||||||
}, {
|
}, {
|
||||||
// TODO: support 'nrformats'? -> probably not worth it --mst
|
|
||||||
incrementURL: function (count) {
|
incrementURL: function (count) {
|
||||||
let matches = buffer.URL.match(/(.*?)(\d+)(\D*)$/);
|
let matches = buffer.URL.match(/(.*?)(\d+)(\D*)$/);
|
||||||
dactyl.assert(matches);
|
dactyl.assert(matches);
|
||||||
@@ -122,10 +121,8 @@ const Browser = Module("browser", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count < 1)
|
count = Math.max(count, 1);
|
||||||
count = 1;
|
|
||||||
|
|
||||||
// XXX
|
|
||||||
let url = buffer.URL;
|
let url = buffer.URL;
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
if (isDirectory(url))
|
if (isDirectory(url))
|
||||||
|
|||||||
@@ -1649,7 +1649,7 @@ const Buffer = Module("buffer", {
|
|||||||
let elements = frames.map(function (win) [m for (m in util.evaluateXPath(xpath, win.document))])
|
let elements = frames.map(function (win) [m for (m in util.evaluateXPath(xpath, win.document))])
|
||||||
.flatten().filter(function (elem) {
|
.flatten().filter(function (elem) {
|
||||||
|
|
||||||
if (elem.readOnly || elem instanceof HTMLInputElement && !set.has(Events.editableInputs, elem.type))
|
if (elem.readOnly || elem instanceof HTMLInputElement && !set.has(util.editableInputs, elem.type))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
let computedStyle = util.computedStyle(elem);
|
let computedStyle = util.computedStyle(elem);
|
||||||
|
|||||||
@@ -555,7 +555,6 @@ const CommandLine = Module("commandline", {
|
|||||||
* @param {string} str
|
* @param {string} str
|
||||||
* @param {string} highlightGroup
|
* @param {string} highlightGroup
|
||||||
*/
|
*/
|
||||||
// TODO: resize upon a window resize
|
|
||||||
_echoMultiline: function echoMultiline(str, highlightGroup) {
|
_echoMultiline: function echoMultiline(str, highlightGroup) {
|
||||||
let doc = this.widgets.multilineOutput.contentDocument;
|
let doc = this.widgets.multilineOutput.contentDocument;
|
||||||
let win = this.widgets.multilineOutput.contentWindow;
|
let win = this.widgets.multilineOutput.contentWindow;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ CommandOption.defaultValue("description", function () "");
|
|||||||
CommandOption.defaultValue("type", function () CommandOption.NOARG);
|
CommandOption.defaultValue("type", function () CommandOption.NOARG);
|
||||||
CommandOption.defaultValue("multiple", function () false);
|
CommandOption.defaultValue("multiple", function () false);
|
||||||
update(CommandOption, {
|
update(CommandOption, {
|
||||||
// FIXME: remove later, when our option handler is better
|
|
||||||
/**
|
/**
|
||||||
* @property {number} The option argument is unspecified. Any argument
|
* @property {number} The option argument is unspecified. Any argument
|
||||||
* is accepted and caller is responsible for parsing the return
|
* is accepted and caller is responsible for parsing the return
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const ConfigBase = Class(ModuleBase, {
|
|||||||
* @property {Object} A map between key names for key events should be ignored,
|
* @property {Object} A map between key names for key events should be ignored,
|
||||||
* and a mask of the modes in which they should be ignored.
|
* and a mask of the modes in which they should be ignored.
|
||||||
*/
|
*/
|
||||||
ignoreKeys: {}, // XXX: be aware you can't put useful values in here, as "modes.NORMAL" etc. are not defined at this time
|
ignoreKeys: {}, // NOTE: be aware you can't put useful values in here, as "modes.NORMAL" etc. are not defined at this time
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {string} The ID of the application's main XUL window.
|
* @property {string} The ID of the application's main XUL window.
|
||||||
|
|||||||
@@ -294,7 +294,8 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
context = userContext;
|
context = userContext;
|
||||||
return Cu.evalInSandbox("with (window) {" + str + "}", context, "1.8", fileName, lineNumber);
|
context[EVAL_STRING] = str;
|
||||||
|
return Cu.evalInSandbox("with (window) { eval(" + EVAL_STRING + ") }", context, "1.8", fileName, lineNumber);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -630,7 +631,6 @@ const Dactyl = Module("dactyl", {
|
|||||||
</item></>.toXMLString(), true);
|
</item></>.toXMLString(), true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the help page containing the specified <b>topic</b> if it
|
* Opens the help page containing the specified <b>topic</b> if it
|
||||||
* exists.
|
* exists.
|
||||||
@@ -824,7 +824,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(e) {}
|
catch (e) {}
|
||||||
// Unfortunately, failed page loads throw exceptions and
|
// Unfortunately, failed page loads throw exceptions and
|
||||||
// cause a lot of unwanted noise. This solution means that
|
// cause a lot of unwanted noise. This solution means that
|
||||||
// any genuine errors go unreported.
|
// any genuine errors go unreported.
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ const Events = Module("events", {
|
|||||||
if (elem && elem.readOnly)
|
if (elem && elem.readOnly)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (elem instanceof HTMLInputElement && set.has(Events.editableInputs, elem.type) ||
|
if (elem instanceof HTMLInputElement && set.has(util.editableInputs, elem.type) ||
|
||||||
elem instanceof HTMLSelectElement) {
|
elem instanceof HTMLSelectElement) {
|
||||||
dactyl.mode = modes.INSERT;
|
dactyl.mode = modes.INSERT;
|
||||||
if (hasHTMLDocument(win))
|
if (hasHTMLDocument(win))
|
||||||
@@ -697,7 +697,7 @@ const Events = Module("events", {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isinstance(elem, [HTMLEmbedElement, HTMLEmbedElement])) {
|
if (isinstance(elem, [HTMLEmbedElement, HTMLEmbedElement])) {
|
||||||
dactyl.mode = modes.EMBED;
|
dactyl.mode = modes.EMBED;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -982,7 +982,7 @@ const Events = Module("events", {
|
|||||||
onMouseDown: function (event) {
|
onMouseDown: function (event) {
|
||||||
let elem = event.target;
|
let elem = event.target;
|
||||||
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
|
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
|
||||||
for(; win; win = win != win.parent && win.parent)
|
for (; win; win = win != win.parent && win.parent)
|
||||||
win.dactylFocusAllowed = true;
|
win.dactylFocusAllowed = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1022,9 +1022,6 @@ const Events = Module("events", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
editableInputs: set(["date", "datetime", "datetime-local", "email", "file",
|
|
||||||
"month", "number", "password", "range", "search",
|
|
||||||
"tel", "text", "time", "url", "week"]),
|
|
||||||
isContentNode: function (node) {
|
isContentNode: function (node) {
|
||||||
let win = (node.ownerDocument || node).defaultView;
|
let win = (node.ownerDocument || node).defaultView;
|
||||||
for (; win; win = win.parent != win && win.parent)
|
for (; win; win = win.parent != win && win.parent)
|
||||||
@@ -1034,7 +1031,7 @@ const Events = Module("events", {
|
|||||||
},
|
},
|
||||||
isInputElemFocused: function () {
|
isInputElemFocused: function () {
|
||||||
let elem = dactyl.focus;
|
let elem = dactyl.focus;
|
||||||
return elem instanceof HTMLInputElement && set.has(Events.editableInputs, elem.type) ||
|
return elem instanceof HTMLInputElement && set.has(util.editableInputs, elem.type) ||
|
||||||
isinstance(elem, [HTMLIsIndexElement, HTMLEmbedElement,
|
isinstance(elem, [HTMLIsIndexElement, HTMLEmbedElement,
|
||||||
HTMLObjectElement, HTMLTextAreaElement]);
|
HTMLObjectElement, HTMLTextAreaElement]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
// Called when the search is canceled - for example if someone presses
|
// Called when the search is canceled - for example if someone presses
|
||||||
// escape while typing a search
|
// escape while typing a search
|
||||||
onCancel: function () {
|
onCancel: function () {
|
||||||
// TODO: code to reposition the document to the place before search started
|
|
||||||
if (this.rangeFind)
|
if (this.rangeFind)
|
||||||
this.rangeFind.cancel();
|
this.rangeFind.cancel();
|
||||||
},
|
},
|
||||||
@@ -152,11 +151,9 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
modes.addMode("FIND_BACKWARD", true);
|
modes.addMode("FIND_BACKWARD", true);
|
||||||
},
|
},
|
||||||
commandline: function () {
|
commandline: function () {
|
||||||
// Event handlers for search - closure is needed
|
|
||||||
commandline.registerCallback("change", modes.FIND_FORWARD, this.closure.onKeyPress);
|
commandline.registerCallback("change", modes.FIND_FORWARD, this.closure.onKeyPress);
|
||||||
commandline.registerCallback("submit", modes.FIND_FORWARD, this.closure.onSubmit);
|
commandline.registerCallback("submit", modes.FIND_FORWARD, this.closure.onSubmit);
|
||||||
commandline.registerCallback("cancel", modes.FIND_FORWARD, this.closure.onCancel);
|
commandline.registerCallback("cancel", modes.FIND_FORWARD, this.closure.onCancel);
|
||||||
// TODO: allow advanced myModes in register/triggerCallback
|
|
||||||
commandline.registerCallback("change", modes.FIND_BACKWARD, this.closure.onKeyPress);
|
commandline.registerCallback("change", modes.FIND_BACKWARD, this.closure.onKeyPress);
|
||||||
commandline.registerCallback("submit", modes.FIND_BACKWARD, this.closure.onSubmit);
|
commandline.registerCallback("submit", modes.FIND_BACKWARD, this.closure.onSubmit);
|
||||||
commandline.registerCallback("cancel", modes.FIND_BACKWARD, this.closure.onCancel);
|
commandline.registerCallback("cancel", modes.FIND_BACKWARD, this.closure.onCancel);
|
||||||
|
|||||||
@@ -54,9 +54,10 @@ const Hints = Module("hints", {
|
|||||||
this.addMode("t", "Follow hint in a new tab", function (elem) buffer.followLink(elem, dactyl.NEW_TAB));
|
this.addMode("t", "Follow hint in a new tab", function (elem) buffer.followLink(elem, dactyl.NEW_TAB));
|
||||||
this.addMode("b", "Follow hint in a background tab", function (elem) buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB));
|
this.addMode("b", "Follow hint in a background tab", function (elem) buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB));
|
||||||
this.addMode("w", "Follow hint in a new window", function (elem) buffer.followLink(elem, dactyl.NEW_WINDOW));
|
this.addMode("w", "Follow hint in a new window", function (elem) buffer.followLink(elem, dactyl.NEW_WINDOW));
|
||||||
this.addMode("O", "Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX));
|
this.addMode("O", "Generate an ‘:open URL’ prompt", function (elem, loc) commandline.open(":", "open " + loc, modes.EX));
|
||||||
this.addMode("T", "Generate a ':tabopen URL' using hint", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX));
|
this.addMode("T", "Generate a ‘:tabopen URL’ prompt", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX));
|
||||||
this.addMode("W", "Generate a ':winopen URL' using hint", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX));
|
this.addMode("W", "Generate a ‘:winopen URL’ prompt", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX));
|
||||||
|
this.addMode("S", "Add a search keyword", function (elem) bookmarks.addSearchKeyword(elem));
|
||||||
this.addMode("v", "View hint source", function (elem, loc) buffer.viewSource(loc, false));
|
this.addMode("v", "View hint source", function (elem, loc) buffer.viewSource(loc, false));
|
||||||
this.addMode("V", "View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true));
|
this.addMode("V", "View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true));
|
||||||
this.addMode("y", "Yank hint location", function (elem, loc) dactyl.clipboardWrite(loc, true));
|
this.addMode("y", "Yank hint location", function (elem, loc) dactyl.clipboardWrite(loc, true));
|
||||||
@@ -128,7 +129,7 @@ const Hints = Module("hints", {
|
|||||||
|
|
||||||
let type = elem.type;
|
let type = elem.type;
|
||||||
|
|
||||||
if (elem instanceof HTMLInputElement && set.has(Events.editableInputs, elem.type))
|
if (elem instanceof HTMLInputElement && set.has(util.editableInputs, elem.type))
|
||||||
return [elem.value, false];
|
return [elem.value, false];
|
||||||
else {
|
else {
|
||||||
for (let [, option] in Iterator(options["hintinputs"])) {
|
for (let [, option] in Iterator(options["hintinputs"])) {
|
||||||
@@ -494,8 +495,9 @@ const Hints = Module("hints", {
|
|||||||
if ((modes.extended & modes.HINTS) && !this._continue)
|
if ((modes.extended & modes.HINTS) && !this._continue)
|
||||||
modes.pop();
|
modes.pop();
|
||||||
commandline._lastEcho = null; // Hack.
|
commandline._lastEcho = null; // Hack.
|
||||||
this._hintMode.action(elem, elem.href || elem.src || "",
|
dactyl.trapErrors(this._hintMode.action, this._hintMode,
|
||||||
this._extendedhintCount, top);
|
elem, elem.href || elem.src || "",
|
||||||
|
this._extendedhintCount, top);
|
||||||
}, timeout);
|
}, timeout);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@@ -766,7 +768,7 @@ const Hints = Module("hints", {
|
|||||||
this._hintMode = this._hintModes[minor];
|
this._hintMode = this._hintModes[minor];
|
||||||
dactyl.assert(this._hintMode);
|
dactyl.assert(this._hintMode);
|
||||||
|
|
||||||
commandline.input(this._hintMode.prompt + ": ", null, {
|
commandline.input(UTF8(this._hintMode.prompt) + ": ", null, {
|
||||||
extended: modes.HINTS,
|
extended: modes.HINTS,
|
||||||
leave: function (stack) {
|
leave: function (stack) {
|
||||||
if (!stack.push)
|
if (!stack.push)
|
||||||
@@ -917,18 +919,6 @@ const Hints = Module("hints", {
|
|||||||
this._processHints(followFirst);
|
this._processHints(followFirst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: add resize support
|
|
||||||
// window.addEventListener("resize", onResize, null);
|
|
||||||
|
|
||||||
// function onResize(event)
|
|
||||||
// {
|
|
||||||
// if (event)
|
|
||||||
// doc = event.originalTarget;
|
|
||||||
// else
|
|
||||||
// doc = window.content.document;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}}}
|
//}}}
|
||||||
}, {
|
}, {
|
||||||
translitTable: Class.memoize(function () {
|
translitTable: Class.memoize(function () {
|
||||||
@@ -1087,7 +1077,9 @@ const Hints = Module("hints", {
|
|||||||
"XPath string of hintable elements activated by ';'",
|
"XPath string of hintable elements activated by ';'",
|
||||||
"regexmap", "[iI]:" + Option.quote(util.makeXPath(["img"])) +
|
"regexmap", "[iI]:" + Option.quote(util.makeXPath(["img"])) +
|
||||||
",[OTivVWy]:" + Option.quote(util.makeXPath(
|
",[OTivVWy]:" + Option.quote(util.makeXPath(
|
||||||
["{a,area}[@href]", "{img,iframe}[@src]"])),
|
["{a,area}[@href]", "{img,iframe}[@src]"])) +
|
||||||
|
",[S]:" + Option.quote(util.makeXPath(
|
||||||
|
["input[not(@type='hidden')]", "textarea", "button", "select"])),
|
||||||
{ validator: Option.validateXPath });
|
{ validator: Option.validateXPath });
|
||||||
|
|
||||||
options.add(["hinttags", "ht"],
|
options.add(["hinttags", "ht"],
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ const History = Module("history", {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: better names
|
|
||||||
stepTo: function stepTo(steps) {
|
stepTo: function stepTo(steps) {
|
||||||
let start = 0;
|
let start = 0;
|
||||||
let end = window.getWebNavigation().sessionHistory.count - 1;
|
let end = window.getWebNavigation().sessionHistory.count - 1;
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ const IO = Module("io", {
|
|||||||
services.get("downloadManager").addListener(this.downloadListener);
|
services.get("downloadManager").addListener(this.downloadListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// TODO: there seems to be no way, short of a new component, to change
|
// TODO: there seems to be no way, short of a new component, to change
|
||||||
// the process's CWD - see https://bugzilla.mozilla.org/show_bug.cgi?id=280953
|
// the process's CWD - see https://bugzilla.mozilla.org/show_bug.cgi?id=280953
|
||||||
/**
|
/**
|
||||||
@@ -392,9 +391,11 @@ lookup:
|
|||||||
dactyl.execute(line, { setFrom: file });
|
dactyl.execute(line, { setFrom: file });
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.echoerr("Error detected while processing " + file.path);
|
if (!silent) {
|
||||||
dactyl.echomsg("line\t" + this.sourcing.line + ":");
|
dactyl.echoerr("Error detected while processing " + file.path);
|
||||||
dactyl.reportError(e, true);
|
dactyl.echomsg("line\t" + this.sourcing.line + ":");
|
||||||
|
dactyl.reportError(e, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,7 +408,8 @@ lookup:
|
|||||||
dactyl.log("Sourced: " + filename, 3);
|
dactyl.log("Sourced: " + filename, 3);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.reportError(e);
|
if (!(e instanceof FailedAssertion))
|
||||||
|
dactyl.reportError(e);
|
||||||
let message = "Sourcing file: " + (e.echoerr || file.path + ": " + e);
|
let message = "Sourcing file: " + (e.echoerr || file.path + ": " + e);
|
||||||
if (!silent)
|
if (!silent)
|
||||||
dactyl.echoerr(message);
|
dactyl.echoerr(message);
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ const Marks = Module("marks", {
|
|||||||
this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: replacer, store: true });
|
this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: replacer, store: true });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(isArray(Iterator(this._localMarks).next()[1]))
|
if (isArray(Iterator(this._localMarks).next()[1]))
|
||||||
this._localMarks.clear();
|
this._localMarks.clear();
|
||||||
}
|
}
|
||||||
catch(e) {}
|
catch (e) {}
|
||||||
|
|
||||||
this._pendingJumps = [];
|
this._pendingJumps = [];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1166,7 +1166,6 @@ const Options = Module("options", {
|
|||||||
if (options["verbose"] > 0 && option.setFrom)
|
if (options["verbose"] > 0 && option.setFrom)
|
||||||
msg += "\n Last set from " + option.setFrom.path;
|
msg += "\n Last set from " + option.setFrom.path;
|
||||||
|
|
||||||
// FIXME: Message highlight group wrapping messes up the indent up for multi-arg verbose :set queries
|
|
||||||
dactyl.echo(<span highlight="CmdOutput">{msg}</span>);
|
dactyl.echo(<span highlight="CmdOutput">{msg}</span>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ const QuickMarks = Module("quickmarks", {
|
|||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the URL of the given QuickMark, or null if none exists.
|
||||||
|
*
|
||||||
|
* @param {string} mark The mark to find.
|
||||||
|
* @returns {string} The mark's URL.
|
||||||
|
*/
|
||||||
|
get: function (mark) this._qmarks.get(mark) || null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the specified quickmarks. The <b>filter</b> is a list of
|
* Deletes the specified quickmarks. The <b>filter</b> is a list of
|
||||||
* quickmarks and ranges are supported. Eg. "ab c d e-k".
|
* quickmarks and ranges are supported. Eg. "ab c d e-k".
|
||||||
@@ -77,7 +85,7 @@ const QuickMarks = Module("quickmarks", {
|
|||||||
* URL. See {@link Dactyl#open}.
|
* URL. See {@link Dactyl#open}.
|
||||||
*/
|
*/
|
||||||
jumpTo: function jumpTo(qmark, where) {
|
jumpTo: function jumpTo(qmark, where) {
|
||||||
let url = this._qmarks.get(qmark);
|
let url = this.get(qmark);
|
||||||
|
|
||||||
if (url)
|
if (url)
|
||||||
dactyl.open(url, where);
|
dactyl.open(url, where);
|
||||||
@@ -148,8 +156,17 @@ const QuickMarks = Module("quickmarks", {
|
|||||||
{
|
{
|
||||||
argCount: "+",
|
argCount: "+",
|
||||||
completer: function (context, args) {
|
completer: function (context, args) {
|
||||||
if (args.length == 2)
|
if (args.length == 1)
|
||||||
return completion.url(context);
|
return completion.quickmark(context);
|
||||||
|
if (args.length == 2) {
|
||||||
|
context.fork("current", 0, this, function (context) {
|
||||||
|
context.title = ["Extra Completions"];
|
||||||
|
context.completions = [
|
||||||
|
[quickmarks.get(args[0]), "Current Value"]
|
||||||
|
].filter(function ([k, v]) k);
|
||||||
|
});
|
||||||
|
context.fork("url", 0, completion, "url");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
literal: 1
|
literal: 1
|
||||||
});
|
});
|
||||||
@@ -168,6 +185,12 @@ const QuickMarks = Module("quickmarks", {
|
|||||||
literal: 0
|
literal: 0
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
completion: function () {
|
||||||
|
completion.quickmark = function (context) {
|
||||||
|
context.title = ["QuickMark", "URL"];
|
||||||
|
context.generate = function () Iterator(quickmarks._qmarks);
|
||||||
|
}
|
||||||
|
},
|
||||||
mappings: function () {
|
mappings: function () {
|
||||||
var myModes = config.browserModes;
|
var myModes = config.browserModes;
|
||||||
|
|
||||||
|
|||||||
@@ -100,9 +100,10 @@
|
|||||||
<li tag=";t"><em>t</em> to open its location in a new tab</li>
|
<li tag=";t"><em>t</em> to open its location in a new tab</li>
|
||||||
<li tag=";b"><em>b</em> to open its location in a new background tab</li>
|
<li tag=";b"><em>b</em> to open its location in a new background tab</li>
|
||||||
<li tag=";w"><em>w</em> to open its destination in a new window</li>
|
<li tag=";w"><em>w</em> to open its destination in a new window</li>
|
||||||
<li tag=";O"><em>O</em> to generate an <ex>:open</ex> with hint's URL (like <k>;O</k>)</li>
|
<li tag=";O"><em>O</em> to generate an <ex>:open</ex> prompt with hint’s URL</li>
|
||||||
<li tag=";T"><em>T</em> to generate a <ex>:tabopen</ex> with hint's URL (like <k>;T</k>)</li>
|
<li tag=";T"><em>T</em> to generate a <ex>:tabopen</ex> prompt with hint’s URL (like <k>;O</k>)</li>
|
||||||
<li tag=";W"><em>W</em> to generate a <ex>:winopen</ex> with hint's URL</li>
|
<li tag=";W"><em>W</em> to generate a <ex>:winopen</ex> prompt with hint’s URL (like <k>;T</k>)</li>
|
||||||
|
<li tag=";S"><em>S</em> to add a search keyword for the hint’s form</li>
|
||||||
<li tag=";v"><em>v</em> to view its destination source</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=";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 destination location</li>
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ This file contains a list of all available commands, mappings and options.
|
|||||||
<dt><ex>:extenable</ex></dt> <dd>Enable an extension</dd>
|
<dt><ex>:extenable</ex></dt> <dd>Enable an extension</dd>
|
||||||
<dt><ex>:extensions</ex></dt> <dd>List all installed extensions</dd>
|
<dt><ex>:extensions</ex></dt> <dd>List all installed extensions</dd>
|
||||||
<dt><ex>:extoptions</ex></dt> <dd>Open an extension's preference dialog</dd>
|
<dt><ex>:extoptions</ex></dt> <dd>Open an extension's preference dialog</dd>
|
||||||
|
<dt><ex>:extupdate</ex></dt> <dd>Update an extension</dd>
|
||||||
<dt><ex>:exusage</ex></dt> <dd>List all Ex commands with a short description</dd>
|
<dt><ex>:exusage</ex></dt> <dd>List all Ex commands with a short description</dd>
|
||||||
<dt><ex>:finish</ex></dt> <dd>Stop sourcing a script file</dd>
|
<dt><ex>:finish</ex></dt> <dd>Stop sourcing a script file</dd>
|
||||||
<dt><ex>:forward</ex></dt> <dd>Go forward in the browser history</dd>
|
<dt><ex>:forward</ex></dt> <dd>Go forward in the browser history</dd>
|
||||||
|
|||||||
@@ -46,18 +46,6 @@
|
|||||||
<p>The following options are available,</p>
|
<p>The following options are available,</p>
|
||||||
|
|
||||||
<dl>
|
<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>-tags</dt>
|
|
||||||
<dd>
|
|
||||||
Comma-separated list of tags for grouping and later
|
|
||||||
access (short name <em>-T</em>).
|
|
||||||
</dd>
|
|
||||||
<dt>-keyword</dt>
|
<dt>-keyword</dt>
|
||||||
<dd>
|
<dd>
|
||||||
A keyword which may be used to open the bookmark via
|
A keyword which may be used to open the bookmark via
|
||||||
@@ -67,6 +55,23 @@
|
|||||||
is opened.
|
is opened.
|
||||||
(short name <em>-k</em>)
|
(short name <em>-k</em>)
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt>-post</dt>
|
||||||
|
<dd>
|
||||||
|
Data to be POSTed to the server when the bookmark is
|
||||||
|
opened.
|
||||||
|
</dd>
|
||||||
|
<dt>-tags</dt>
|
||||||
|
<dd>
|
||||||
|
Comma-separated list of tags for grouping and later
|
||||||
|
access (short name <em>-T</em>).
|
||||||
|
</dd>
|
||||||
|
<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>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -560,7 +560,12 @@
|
|||||||
[OTivVWy]:'//a[@href] | //xhtml:a[@href] |
|
[OTivVWy]:'//a[@href] | //xhtml:a[@href] |
|
||||||
//area[@href] | //xhtml:area[@href] |
|
//area[@href] | //xhtml:area[@href] |
|
||||||
//img[@src] | //xhtml:img[@src] |
|
//img[@src] | //xhtml:img[@src] |
|
||||||
//iframe[@src] | //xhtml:iframe[@src]'</default>
|
//iframe[@src] | //xhtml:iframe[@src]',
|
||||||
|
[S]:'//input[not(@type=''hidden'')] |
|
||||||
|
//xhtml:input[not(@type=''hidden'')] |
|
||||||
|
//textarea | //xhtml:textarea |
|
||||||
|
//button | //xhtml:button |
|
||||||
|
//select | //xhtml:select' </default>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Defines specialized XPath expressions for arbitrary
|
Defines specialized XPath expressions for arbitrary
|
||||||
|
|||||||
@@ -98,10 +98,10 @@ function defineModule(name, params) {
|
|||||||
module.NAME = name;
|
module.NAME = name;
|
||||||
module.EXPORTED_SYMBOLS = params.exports || [];
|
module.EXPORTED_SYMBOLS = params.exports || [];
|
||||||
defineModule.loadLog.push("defineModule " + name);
|
defineModule.loadLog.push("defineModule " + name);
|
||||||
for(let [, mod] in Iterator(params.require || []))
|
for (let [, mod] in Iterator(params.require || []))
|
||||||
require(module, mod);
|
require(module, mod);
|
||||||
|
|
||||||
for(let [, mod] in Iterator(params.use || []))
|
for (let [, mod] in Iterator(params.use || []))
|
||||||
if (loaded.hasOwnProperty(mod))
|
if (loaded.hasOwnProperty(mod))
|
||||||
require(module, mod, "use");
|
require(module, mod, "use");
|
||||||
else {
|
else {
|
||||||
@@ -142,7 +142,7 @@ defineModule.time = function time(major, minor, func, self) {
|
|||||||
|
|
||||||
function endModule() {
|
function endModule() {
|
||||||
defineModule.loadLog.push("endModule " + currentModule.NAME);
|
defineModule.loadLog.push("endModule " + currentModule.NAME);
|
||||||
for(let [, mod] in Iterator(use[currentModule.NAME] || []))
|
for (let [, mod] in Iterator(use[currentModule.NAME] || []))
|
||||||
require(mod, currentModule.NAME, "use");
|
require(mod, currentModule.NAME, "use");
|
||||||
loaded[currentModule.NAME] = 1;
|
loaded[currentModule.NAME] = 1;
|
||||||
}
|
}
|
||||||
@@ -373,7 +373,7 @@ set.remove = function (set, key) {
|
|||||||
* @returns {Generator}
|
* @returns {Generator}
|
||||||
*/
|
*/
|
||||||
function iter(obj) {
|
function iter(obj) {
|
||||||
if (ctypes && obj instanceof ctypes.CData) {
|
if (ctypes && ctypes.CData && obj instanceof ctypes.CData) {
|
||||||
while (obj.constructor instanceof ctypes.PointerType)
|
while (obj.constructor instanceof ctypes.PointerType)
|
||||||
obj = obj.contents;
|
obj = obj.contents;
|
||||||
if (obj.constructor instanceof ctypes.ArrayType)
|
if (obj.constructor instanceof ctypes.ArrayType)
|
||||||
@@ -1128,7 +1128,7 @@ const array = Class("array", Array, {
|
|||||||
*/
|
*/
|
||||||
zip: function zip(ary1, ary2) {
|
zip: function zip(ary1, ary2) {
|
||||||
let res = [];
|
let res = [];
|
||||||
for(let [i, item] in Iterator(ary1))
|
for (let [i, item] in Iterator(ary1))
|
||||||
res.push([item, i in ary2 ? ary2[i] : ""]);
|
res.push([item, i in ary2 ? ary2[i] : ""]);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ defineModule("bookmarkcache", {
|
|||||||
require: ["services", "storage", "util"]
|
require: ["services", "storage", "util"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const Bookmark = Struct("url", "title", "icon", "post", "keyword", "tags", "id");
|
||||||
const Bookmark = Struct("url", "title", "icon", "keyword", "tags", "id");
|
|
||||||
const Keyword = Struct("keyword", "title", "icon", "url");
|
const Keyword = Struct("keyword", "title", "icon", "url");
|
||||||
Bookmark.defaultValue("icon", function () BookmarkCache.getFavicon(this.url));
|
Bookmark.defaultValue("icon", function () BookmarkCache.getFavicon(this.url));
|
||||||
Bookmark.prototype.__defineGetter__("extra", function () [
|
Bookmark.prototype.__defineGetter__("extra", function () [
|
||||||
@@ -19,12 +18,15 @@ Bookmark.prototype.__defineGetter__("extra", function () [
|
|||||||
["tags", this.tags.join(", "), "Tag"]
|
["tags", this.tags.join(", "), "Tag"]
|
||||||
].filter(function (item) item[1]));
|
].filter(function (item) item[1]));
|
||||||
|
|
||||||
const bookmarks = services.get("bookmarks");
|
const annotation = services.get("annotation");
|
||||||
const history = services.get("history");
|
const bookmarks = services.get("bookmarks");
|
||||||
const tagging = services.get("tagging");
|
const history = services.get("history");
|
||||||
const name = "bookmark-cache";
|
const tagging = services.get("tagging");
|
||||||
|
const name = "bookmark-cache";
|
||||||
|
|
||||||
const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
|
const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
|
||||||
|
POST: "bookmarkProperties/POSTData",
|
||||||
|
|
||||||
init: function init() {
|
init: function init() {
|
||||||
bookmarks.addObserver(this, false);
|
bookmarks.addObserver(this, false);
|
||||||
},
|
},
|
||||||
@@ -33,17 +35,14 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
|
|
||||||
get bookmarks() Class.replaceProperty(this, "bookmarks", this.load()),
|
get bookmarks() Class.replaceProperty(this, "bookmarks", this.load()),
|
||||||
|
|
||||||
|
get keywords() array.toObject([[b.keyword, b] for (b in this) if (b.keyword)]),
|
||||||
|
|
||||||
rootFolders: ["toolbarFolder", "bookmarksMenuFolder", "unfiledBookmarksFolder"]
|
rootFolders: ["toolbarFolder", "bookmarksMenuFolder", "unfiledBookmarksFolder"]
|
||||||
.map(function (s) bookmarks[s]),
|
.map(function (s) bookmarks[s]),
|
||||||
|
|
||||||
_deleteBookmark: function deleteBookmark(id) {
|
_deleteBookmark: function deleteBookmark(id) {
|
||||||
let length = this.bookmarks.length;
|
let result = this.bookmarks[item.id] || null;
|
||||||
let result;
|
delete this.bookmarks[id];
|
||||||
this.bookmarks = this.bookmarks.filter(function (item) {
|
|
||||||
if (item.id == id)
|
|
||||||
result = item;
|
|
||||||
return item.id != id;
|
|
||||||
});
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -53,7 +52,8 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
let uri = util.newURI(node.uri);
|
let uri = util.newURI(node.uri);
|
||||||
let keyword = bookmarks.getKeywordForBookmark(node.itemId);
|
let keyword = bookmarks.getKeywordForBookmark(node.itemId);
|
||||||
let tags = tagging.getTagsForURI(uri, {}) || [];
|
let tags = tagging.getTagsForURI(uri, {}) || [];
|
||||||
return Bookmark(node.uri, node.title, node.icon && node.icon.spec, keyword, tags, node.itemId);
|
let post = BookmarkCache.getAnnotation(node.itemId, this.POST);
|
||||||
|
return Bookmark(node.uri, node.title, node.icon && node.icon.spec, post, keyword, tags, node.itemId);
|
||||||
},
|
},
|
||||||
|
|
||||||
readBookmark: function readBookmark(id) {
|
readBookmark: function readBookmark(id) {
|
||||||
@@ -84,11 +84,9 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
return this.rootFolders.indexOf(root) >= 0;
|
return this.rootFolders.indexOf(root) >= 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
get keywords() [Keyword(k.keyword, k.title, k.icon, k.url) for ([, k] in Iterator(this.bookmarks)) if (k.keyword)],
|
|
||||||
|
|
||||||
// Should be made thread safe.
|
// Should be made thread safe.
|
||||||
load: function load() {
|
load: function load() {
|
||||||
let bookmarks = [];
|
let bookmarks = {};
|
||||||
|
|
||||||
let folders = this.rootFolders.slice();
|
let folders = this.rootFolders.slice();
|
||||||
let query = history.getNewQuery();
|
let query = history.getNewQuery();
|
||||||
@@ -106,7 +104,7 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
if (node.type == node.RESULT_TYPE_FOLDER) // folder
|
if (node.type == node.RESULT_TYPE_FOLDER) // folder
|
||||||
folders.push(node.itemId);
|
folders.push(node.itemId);
|
||||||
else if (node.type == node.RESULT_TYPE_URI) // bookmark
|
else if (node.type == node.RESULT_TYPE_URI) // bookmark
|
||||||
bookmarks.push(this._loadBookmark(node));
|
bookmarks[node.itemId] = this._loadBookmark(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
// close a container after using it!
|
// close a container after using it!
|
||||||
@@ -120,7 +118,7 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
if (bookmarks.getItemType(itemId) == bookmarks.TYPE_BOOKMARK) {
|
if (bookmarks.getItemType(itemId) == bookmarks.TYPE_BOOKMARK) {
|
||||||
if (this.isBookmark(itemId)) {
|
if (this.isBookmark(itemId)) {
|
||||||
let bmark = this._loadBookmark(this.readBookmark(itemId));
|
let bmark = this._loadBookmark(this.readBookmark(itemId));
|
||||||
this.bookmarks.push(bmark);
|
this.bookmarks[bmark.id] = bmark;
|
||||||
storage.fireEvent(name, "add", bmark);
|
storage.fireEvent(name, "add", bmark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,8 +130,12 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
},
|
},
|
||||||
onItemChanged: function onItemChanged(itemId, property, isAnnotation, value) {
|
onItemChanged: function onItemChanged(itemId, property, isAnnotation, value) {
|
||||||
if (isAnnotation)
|
if (isAnnotation)
|
||||||
return;
|
if (property === this.POST)
|
||||||
let bookmark = bookmarkcache.bookmarks.filter(function (item) item.id == itemId)[0];
|
[property, value] = ["post", BookmarkCache.getAnnotation(itemId, this.POST)];
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
let bookmark = this.bookmarks[itemId];
|
||||||
if (bookmark) {
|
if (bookmark) {
|
||||||
if (property == "tags")
|
if (property == "tags")
|
||||||
value = tagging.getTagsForURI(util.newURI(bookmark.url), {});
|
value = tagging.getTagsForURI(util.newURI(bookmark.url), {});
|
||||||
@@ -144,6 +146,9 @@ const BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
getAnnotation: function getAnnotation(item, anno)
|
||||||
|
annotation.itemHasAnnotation(item, anno) ?
|
||||||
|
annotation.getItemAnnotation(item, anno) : null,
|
||||||
getFavicon: function getFavicon(uri) {
|
getFavicon: function getFavicon(uri) {
|
||||||
try {
|
try {
|
||||||
return service.get("favicon").getFaviconImageForPage(util.newURI(uri)).spec;
|
return service.get("favicon").getFaviconImageForPage(util.newURI(uri)).spec;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const Services = Module("Services", {
|
|||||||
this.classes = {};
|
this.classes = {};
|
||||||
this.services = {};
|
this.services = {};
|
||||||
|
|
||||||
|
this.add("annotation", "@mozilla.org/browser/annotation-service;1", Ci.nsIAnnotationService);
|
||||||
this.add("appStartup", "@mozilla.org/toolkit/app-startup;1", Ci.nsIAppStartup);
|
this.add("appStartup", "@mozilla.org/toolkit/app-startup;1", Ci.nsIAppStartup);
|
||||||
this.add("autoCompleteSearch", "@mozilla.org/autocomplete/search;1?name=history", Ci.nsIAutoCompleteSearch);
|
this.add("autoCompleteSearch", "@mozilla.org/autocomplete/search;1?name=history", Ci.nsIAutoCompleteSearch);
|
||||||
this.add("bookmarks", "@mozilla.org/browser/nav-bookmarks-service;1", Ci.nsINavBookmarksService);
|
this.add("bookmarks", "@mozilla.org/browser/nav-bookmarks-service;1", Ci.nsINavBookmarksService);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const Util = Module("Util", {
|
|||||||
dactyl: {
|
dactyl: {
|
||||||
__noSuchMethod__: function (meth, args) {
|
__noSuchMethod__: function (meth, args) {
|
||||||
let win = util.activeWindow;
|
let win = util.activeWindow;
|
||||||
if(win && win.dactyl)
|
if (win && win.dactyl)
|
||||||
return win.dactyl[meth].apply(win.dactyl, args);
|
return win.dactyl[meth].apply(win.dactyl, args);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -247,6 +247,10 @@ const Util = Module("Util", {
|
|||||||
util.dump((arguments.length == 0 ? "Stack" : msg) + "\n" + stack + "\n");
|
util.dump((arguments.length == 0 ? "Stack" : msg) + "\n" + stack + "\n");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editableInputs: set(["date", "datetime", "datetime-local", "email", "file",
|
||||||
|
"month", "number", "password", "range", "search",
|
||||||
|
"tel", "text", "time", "url", "week"]),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts HTML special characters in <b>str</b> to the equivalent HTML
|
* Converts HTML special characters in <b>str</b> to the equivalent HTML
|
||||||
* entities.
|
* entities.
|
||||||
@@ -522,9 +526,7 @@ const Util = Module("Util", {
|
|||||||
* @returns {nsIURI}
|
* @returns {nsIURI}
|
||||||
*/
|
*/
|
||||||
// FIXME: createURI needed too?
|
// FIXME: createURI needed too?
|
||||||
newURI: function (uri) {
|
newURI: function (uri, charset, base) services.get("io").newURI(uri, charset, base),
|
||||||
return services.get("io").newURI(uri, null, null);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pretty print a JavaScript object. Use HTML markup to color certain items
|
* Pretty print a JavaScript object. Use HTML markup to color certain items
|
||||||
@@ -642,6 +644,50 @@ const Util = Module("Util", {
|
|||||||
return color ? string : [s for each (s in string)].join("");
|
return color ? string : [s for each (s in string)].join("");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the fields of a form and returns a URL/POST-data pair
|
||||||
|
* that is the equivalent of submitting the form.
|
||||||
|
*
|
||||||
|
* @param {nsINode} field One of the fields of the given form.
|
||||||
|
*/
|
||||||
|
// Nuances gleaned from browser.jar/content/browser/browser.js
|
||||||
|
parseForm: function parseForm(field) {
|
||||||
|
function encode(name, value, param) {
|
||||||
|
if (param)
|
||||||
|
value = "%s";
|
||||||
|
if (post)
|
||||||
|
return name + "=" + value;
|
||||||
|
return encodeURIComponent(name) + "=" + (param ? value : encodeURIComponent(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
let form = field.form;
|
||||||
|
let doc = form.ownerDocument;
|
||||||
|
let charset = doc.charset;
|
||||||
|
let uri = util.newURI(doc.baseURI.replace(/\?.*/, ""), charset);
|
||||||
|
let url = util.newURI(form.action, charset, uri).spec;
|
||||||
|
|
||||||
|
let post = form.method.toUpperCase() == "POST";
|
||||||
|
|
||||||
|
let elems = [];
|
||||||
|
if (field instanceof Ci.nsIDOMHTMLInputElement && field.type == "submit")
|
||||||
|
elems.push(encode(field.name, field.value));
|
||||||
|
|
||||||
|
for (let [,elem] in iter(form.elements)) {
|
||||||
|
if (set.has(util.editableInputs, elem.type)
|
||||||
|
|| /^(?:hidden|textarea)$/.test(elem.type)
|
||||||
|
|| elem.checked && /^(?:checkbox|radio)$/.test(elem.type))
|
||||||
|
elems.push(encode(elem.name, elem.value, elem === field));
|
||||||
|
else if (elem instanceof Ci.nsIDOMHTMLSelectElement) {
|
||||||
|
for (let [,opt] in Iterator(elem.options))
|
||||||
|
if (opt.selected)
|
||||||
|
elems.push(encode(elem.name, opt.value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (post)
|
||||||
|
return [url, elems.map(encodeURIComponent).join('&'), elems];
|
||||||
|
return [url + "?" + elems.join('&'), null];
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A generator that returns the values between <b>start</b> and <b>end</b>,
|
* A generator that returns the values between <b>start</b> and <b>end</b>,
|
||||||
* in <b>step</b> increments.
|
* in <b>step</b> increments.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/utils.js"); // XXX
|
Components.utils.import("resource://gre/modules/utils.js"); // XXX
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
// TODO: flesh this out
|
// TODO: flesh this out
|
||||||
const Library = Module("library", {
|
const Library = Module("library", {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const Player = Module("player", {
|
const Player = Module("player", {
|
||||||
init: function init() {
|
init: function init() {
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ syn keyword melodactylCommand run ab[breviate] abc[lear] addo[ns] au[tocmd] ba[c
|
|||||||
\ bma[rk] bmarks b[uffer] buffers files ls tabs ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap] colo[rscheme]
|
\ bma[rk] bmarks b[uffer] buffers files ls tabs ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap] colo[rscheme]
|
||||||
\ comc[lear] com[mand] contexts cuna[bbrev] cunm[ap] delbm[arks] delc[ommand] delmac[ros] delm[arks] delqm[arks] dels[tyle]
|
\ comc[lear] com[mand] contexts cuna[bbrev] cunm[ap] delbm[arks] delc[ommand] delmac[ros] delm[arks] delqm[arks] dels[tyle]
|
||||||
\ dia[log] displayp[ane] dp[ane] dpope[n] doautoa[ll] do[autocmd] downl[oads] dl dpcl[ose] ec[ho] echoe[rr] echom[sg] em[enu]
|
\ dia[log] displayp[ane] dp[ane] dpope[n] doautoa[ll] do[autocmd] downl[oads] dl dpcl[ose] ec[ho] echoe[rr] echom[sg] em[enu]
|
||||||
\ exe[cute] exta[dd] extde[lete] extd[isable] exte[nable] extens[ions] exts exto[ptions] extp[references] exu[sage] fini[sh]
|
\ exe[cute] exta[dd] extde[lete] extd[isable] exte[nable] extens[ions] exts exto[ptions] extp[references] extu[pdate]
|
||||||
\ fo[rward] fw frameo[nly] ha[rdcopy] h[elp] helpa[ll] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear]
|
\ exu[sage] fini[sh] fo[rward] fw frameo[nly] ha[rdcopy] h[elp] helpa[ll] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap]
|
||||||
\ ino[remap] iuna[bbrev] iunm[ap] javas[cript] js ju[mps] keepa[lt] let loadplugins lpl macros map mapc[lear] ma[rk] marks
|
\ imapc[lear] ino[remap] iuna[bbrev] iunm[ap] javas[cript] js ju[mps] keepa[lt] let loadplugins lpl macros map mapc[lear]
|
||||||
\ mes[sages] messc[lear] mkm[elodactylrc] nm[ap] nmapc[lear] nno[remap] noh[lsearch] no[remap] norm[al] nunm[ap] o[pen]
|
\ ma[rk] marks mes[sages] messc[lear] mkm[elodactylrc] nm[ap] nmapc[lear] nno[remap] noh[lsearch] no[remap] norm[al] nunm[ap]
|
||||||
\ optionu[sage] pa[geinfo] pagest[yle] pas pref[erences] prefs pw[d] qma[rk] qmarks q[uit] quita[ll] qa[ll] redr[aw] re[load]
|
\ o[pen] optionu[sage] pa[geinfo] pagest[yle] pas pref[erences] prefs pw[d] qma[rk] qmarks q[uit] quita[ll] qa[ll] redr[aw]
|
||||||
\ reloada[ll] res[tart] runt[ime] sav[eas] w[rite] scrip[tnames] se[t] setg[lobal] setl[ocal] sil[ent] so[urce] st[op]
|
\ re[load] reloada[ll] res[tart] runt[ime] sav[eas] w[rite] scrip[tnames] se[t] setg[lobal] setl[ocal] sil[ent] so[urce]
|
||||||
\ stopa[ll] sty[le] styled[isable] styd[isable] stylee[nable] stye[nable] stylet[oggle] styt[oggle] tab taba[ttach]
|
\ st[op] stopa[ll] sty[le] styled[isable] styd[isable] stylee[nable] stye[nable] stylet[oggle] styt[oggle] tab taba[ttach]
|
||||||
\ tabde[tach] tabd[o] bufd[o] tabdu[plicate] tabl[ast] bl[ast] tabm[ove] tabn[ext] tn[ext] bn[ext] tabo[nly] tabopen t[open]
|
\ tabde[tach] tabd[o] bufd[o] tabdu[plicate] tabl[ast] bl[ast] tabm[ove] tabn[ext] tn[ext] bn[ext] tabo[nly] tabopen t[open]
|
||||||
\ tabnew tabp[revious] tp[revious] tabN[ext] tN[ext] bp[revious] bN[ext] tabr[ewind] tabfir[st] br[ewind] bf[irst] time
|
\ tabnew tabp[revious] tp[revious] tabN[ext] tN[ext] bp[revious] bN[ext] tabr[ewind] tabfir[st] br[ewind] bf[irst] time
|
||||||
\ toolbarh[ide] tbh[ide] toolbars[how] tbs[how] toolbart[oggle] tbt[oggle] una[bbreviate] unl[et] unm[ap] verb[ose] ve[rsion]
|
\ toolbarh[ide] tbh[ide] toolbars[how] tbs[how] toolbart[oggle] tbt[oggle] una[bbreviate] unl[et] unm[ap] verb[ose] ve[rsion]
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ FEATURES:
|
|||||||
8 <C-o>/<C-i> should work as in vim (i.e., save page positions as well as
|
8 <C-o>/<C-i> should work as in vim (i.e., save page positions as well as
|
||||||
locations in the history list).
|
locations in the history list).
|
||||||
8 jump to the next heading with ]h, next image ]i, previous textbox [t and so on
|
8 jump to the next heading with ]h, next image ]i, previous textbox [t and so on
|
||||||
|
7 consider generating most of :help :index
|
||||||
7 use ctrl-n/p in insert mode for word completion
|
7 use ctrl-n/p in insert mode for word completion
|
||||||
7 implement QuickFix window based on ItemList
|
7 implement QuickFix window based on ItemList
|
||||||
7 wherever possible: get rid of dialogs and ask console-like dialog questions
|
7 wherever possible: get rid of dialogs and ask console-like dialog questions
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const Config = Module("config", ConfigBase, {
|
const Config = Module("config", ConfigBase, {
|
||||||
get visualbellWindow() getBrowser().mPanelContainer,
|
get visualbellWindow() getBrowser().mPanelContainer,
|
||||||
|
|||||||
@@ -23,18 +23,18 @@ syn keyword pentadactylCommand run ab[breviate] abc[lear] addo[ns] au[tocmd] ba[
|
|||||||
\ tabc[lose] bma[rk] bmarks b[uffer] buffers files ls tabs ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap]
|
\ tabc[lose] bma[rk] bmarks b[uffer] buffers files ls tabs ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap]
|
||||||
\ colo[rscheme] comc[lear] com[mand] contexts cuna[bbrev] cunm[ap] delbm[arks] delc[ommand] delmac[ros] delm[arks] delqm[arks]
|
\ colo[rscheme] comc[lear] com[mand] contexts cuna[bbrev] cunm[ap] delbm[arks] delc[ommand] delmac[ros] delm[arks] delqm[arks]
|
||||||
\ dels[tyle] dia[log] doautoa[ll] do[autocmd] downl[oads] dl ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] exta[dd] extde[lete]
|
\ dels[tyle] dia[log] doautoa[ll] do[autocmd] downl[oads] dl ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] exta[dd] extde[lete]
|
||||||
\ extd[isable] exte[nable] extens[ions] exts exto[ptions] extp[references] exu[sage] fini[sh] fo[rward] fw frameo[nly]
|
\ extd[isable] exte[nable] extens[ions] exts exto[ptions] extp[references] extu[pdate] exu[sage] fini[sh] fo[rward] fw
|
||||||
\ ha[rdcopy] h[elp] helpa[ll] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iuna[bbrev] iunm[ap]
|
\ frameo[nly] ha[rdcopy] h[elp] helpa[ll] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap]
|
||||||
\ javas[cript] js ju[mps] keepa[lt] let loadplugins lpl macros map mapc[lear] ma[rk] marks mes[sages] messc[lear]
|
\ iuna[bbrev] iunm[ap] javas[cript] js ju[mps] keepa[lt] let loadplugins lpl macros map mapc[lear] ma[rk] marks mes[sages]
|
||||||
\ mkp[entadactylrc] nm[ap] nmapc[lear] nno[remap] noh[lsearch] no[remap] norm[al] nunm[ap] o[pen] optionu[sage] pa[geinfo]
|
\ messc[lear] mkp[entadactylrc] nm[ap] nmapc[lear] nno[remap] noh[lsearch] no[remap] norm[al] nunm[ap] o[pen] optionu[sage]
|
||||||
\ pagest[yle] pas pref[erences] prefs pw[d] qma[rk] qmarks q[uit] quita[ll] qa[ll] redr[aw] re[load] reloada[ll] res[tart]
|
\ pa[geinfo] pagest[yle] pas pref[erences] prefs pw[d] qma[rk] qmarks q[uit] quita[ll] qa[ll] redr[aw] re[load] reloada[ll]
|
||||||
\ runt[ime] sa[nitize] sav[eas] w[rite] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] sb[ar] sbope[n]
|
\ res[tart] runt[ime] sa[nitize] sav[eas] w[rite] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] sb[ar]
|
||||||
\ sil[ent] so[urce] st[op] stopa[ll] sty[le] styled[isable] styd[isable] stylee[nable] stye[nable] stylet[oggle] styt[oggle]
|
\ sbope[n] sil[ent] so[urce] st[op] stopa[ll] sty[le] styled[isable] styd[isable] stylee[nable] stye[nable] stylet[oggle]
|
||||||
\ tab taba[ttach] tabde[tach] tabd[o] bufd[o] tabdu[plicate] tabl[ast] bl[ast] tabm[ove] tabn[ext] tn[ext] bn[ext] tabo[nly]
|
\ styt[oggle] tab taba[ttach] tabde[tach] tabd[o] bufd[o] tabdu[plicate] tabl[ast] bl[ast] tabm[ove] tabn[ext] tn[ext] bn[ext]
|
||||||
\ tabopen t[open] tabnew tabp[revious] tp[revious] tabN[ext] tN[ext] bp[revious] bN[ext] tabr[ewind] tabfir[st] br[ewind]
|
\ tabo[nly] tabopen t[open] tabnew tabp[revious] tp[revious] tabN[ext] tN[ext] bp[revious] bN[ext] tabr[ewind] tabfir[st]
|
||||||
\ bf[irst] time toolbarh[ide] tbh[ide] toolbars[how] tbs[how] toolbart[oggle] tbt[oggle] una[bbreviate] u[ndo] undoa[ll]
|
\ br[ewind] bf[irst] time toolbarh[ide] tbh[ide] toolbars[how] tbs[how] toolbart[oggle] tbt[oggle] una[bbreviate] u[ndo]
|
||||||
\ unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] vno[remap] vunm[ap] winc[lose] wc[lose]
|
\ undoa[ll] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] vno[remap] vunm[ap] winc[lose]
|
||||||
\ wind[ow] winon[ly] wino[pen] wo[pen] wqa[ll] wq xa[ll] zo[om]
|
\ wc[lose] wind[ow] winon[ly] wino[pen] wo[pen] wqa[ll] wq xa[ll] zo[om]
|
||||||
\ contained
|
\ contained
|
||||||
|
|
||||||
syn match pentadactylCommand "!" contained
|
syn match pentadactylCommand "!" contained
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const Addressbook = Module("addressbook", {
|
const Addressbook = Module("addressbook", {
|
||||||
init: function () {
|
init: function () {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function Compose() { //{{{
|
function Compose() { //{{{
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const Config = Module("config", ConfigBase, {
|
const Config = Module("config", ConfigBase, {
|
||||||
init: function init() {
|
init: function init() {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const Mail = Module("mail", {
|
const Mail = Module("mail", {
|
||||||
init: function () {
|
init: function () {
|
||||||
|
|||||||
@@ -19,19 +19,18 @@ unlet b:current_syntax
|
|||||||
|
|
||||||
syn match teledactylCommandStart "\%(^\s*:\=\)\@<=" nextgroup=teledactylCommand,teledactylAutoCmd
|
syn match teledactylCommandStart "\%(^\s*:\=\)\@<=" nextgroup=teledactylCommand,teledactylAutoCmd
|
||||||
|
|
||||||
syn keyword teledactylCommand run ab[breviate] abc[lear] addo[ns] au[tocmd] bd[elete] bw[ipeout] bun[load] tabc[lose]
|
syn keyword teledactylCommand run ab[breviate] abc[lear] addo[ns] au[tocmd] bd[elete] bw[ipeout] bun[load] tabc[lose] ca[bbrev]
|
||||||
\ ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap] colo[rscheme] comc[lear] com[mand] con[tact] contacts
|
\ cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap] colo[rscheme] comc[lear] com[mand] con[tact] contacts addr[essbook] contexts
|
||||||
\ addr[essbook] contexts copy[to] cuna[bbrev] cunm[ap] delc[ommand] delmac[ros] delm[arks] dels[tyle] dia[log] doautoa[ll]
|
\ copy[to] cuna[bbrev] cunm[ap] delc[ommand] delmac[ros] delm[arks] dels[tyle] dia[log] doautoa[ll] do[autocmd] ec[ho] echoe[rr]
|
||||||
\ do[autocmd] ec[ho] echoe[rr] echom[sg] em[enu] empty[trash] exe[cute] exta[dd] extde[lete] extd[isable] exte[nable]
|
\ echom[sg] em[enu] empty[trash] exe[cute] exta[dd] extde[lete] extd[isable] exte[nable] extens[ions] exts exto[ptions]
|
||||||
\ extens[ions] exts exto[ptions] extp[references] exu[sage] fini[sh] frameo[nly] get[messages] go[to] ha[rdcopy] h[elp]
|
\ extp[references] extu[pdate] exu[sage] fini[sh] frameo[nly] get[messages] go[to] ha[rdcopy] h[elp] helpa[ll] hi[ghlight]
|
||||||
\ helpa[ll] hi[ghlight] ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iuna[bbrev] iunm[ap] javas[cript] js keepa[lt] let
|
\ ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iuna[bbrev] iunm[ap] javas[cript] js keepa[lt] let loadplugins lpl macros
|
||||||
\ loadplugins lpl macros m[ail] map mapc[lear] ma[rk] marks mes[sages] messc[lear] mkt[eledactylrc] move[to] nm[ap]
|
\ m[ail] map mapc[lear] ma[rk] marks mes[sages] messc[lear] mkt[eledactylrc] move[to] nm[ap] nmapc[lear] nno[remap] noh[lsearch]
|
||||||
\ nmapc[lear] nno[remap] noh[lsearch] no[remap] norm[al] nunm[ap] optionu[sage] pa[geinfo] pagest[yle] pas pref[erences] prefs
|
\ no[remap] norm[al] nunm[ap] optionu[sage] pa[geinfo] pagest[yle] pas pref[erences] prefs pw[d] q[uit] re[load] res[tart] runt[ime]
|
||||||
\ pw[d] q[uit] re[load] res[tart] runt[ime] sav[eas] w[rite] scrip[tnames] se[t] setg[lobal] setl[ocal] sil[ent] so[urce]
|
\ sav[eas] w[rite] scrip[tnames] se[t] setg[lobal] setl[ocal] sil[ent] so[urce] st[op] sty[le] styled[isable] styd[isable]
|
||||||
\ st[op] sty[le] styled[isable] styd[isable] stylee[nable] stye[nable] stylet[oggle] styt[oggle] tab tabd[o] bufd[o] tabl[ast]
|
\ stylee[nable] stye[nable] stylet[oggle] styt[oggle] tab tabd[o] bufd[o] tabl[ast] bl[ast] tabn[ext] tn[ext] bn[ext] tabp[revious]
|
||||||
\ bl[ast] tabn[ext] tn[ext] bn[ext] tabp[revious] tp[revious] tabN[ext] tN[ext] bp[revious] bN[ext] tabr[ewind] tabfir[st]
|
\ tp[revious] tabN[ext] tN[ext] bp[revious] bN[ext] tabr[ewind] tabfir[st] br[ewind] bf[irst] time una[bbreviate] unl[et] unm[ap]
|
||||||
\ br[ewind] bf[irst] time una[bbreviate] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear]
|
\ verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] vno[remap] vunm[ap] zo[om]
|
||||||
\ vno[remap] vunm[ap] zo[om]
|
|
||||||
\ contained
|
\ contained
|
||||||
|
|
||||||
syn match teledactylCommand "!" contained
|
syn match teledactylCommand "!" contained
|
||||||
|
|||||||
Reference in New Issue
Block a user