mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-30 22:52:28 +01:00
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
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user