From a59d88fee7d07204db52dd2db8d6ff1bf0a8fa6f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 2 Oct 2010 10:44:19 -0400 Subject: [PATCH] Basic Songbird 1.9a support. --HG-- rename : xulmus/AUTHORS => melodactyl/AUTHORS rename : xulmus/Makefile => melodactyl/Makefile rename : xulmus/NEWS => melodactyl/NEWS rename : xulmus/TODO => melodactyl/TODO rename : xulmus/chrome.manifest => melodactyl/chrome.manifest rename : xulmus/components/commandline-handler.js => melodactyl/components/commandline-handler.js rename : xulmus/components/protocols.js => melodactyl/components/protocols.js rename : xulmus/content/config.js => melodactyl/content/config.js rename : xulmus/content/dactyl.dtd => melodactyl/content/dactyl.dtd rename : xulmus/content/library.js => melodactyl/content/library.js rename : xulmus/content/logo.png => melodactyl/content/logo.png rename : xulmus/content/xulmus.xul => melodactyl/content/melodactyl.xul rename : xulmus/content/player.js => melodactyl/content/player.js rename : xulmus/content/xulmus.svg => melodactyl/content/xulmus.svg rename : xulmus/contrib/vim/Makefile => melodactyl/contrib/vim/Makefile rename : xulmus/contrib/vim/ftdetect/xulmus.vim => melodactyl/contrib/vim/ftdetect/melodactyl.vim rename : xulmus/contrib/vim/mkvimball.txt => melodactyl/contrib/vim/mkvimball.txt rename : xulmus/contrib/vim/syntax/xulmus.vim => melodactyl/contrib/vim/syntax/melodactyl.vim rename : xulmus/defaults/preferences/dactyl.js => melodactyl/defaults/preferences/dactyl.js rename : xulmus/install.rdf => melodactyl/install.rdf rename : xulmus/locale/en-US/all.xml => melodactyl/locale/en-US/all.xml rename : xulmus/locale/en-US/autocommands.xml => melodactyl/locale/en-US/autocommands.xml rename : xulmus/locale/en-US/browsing.xml => melodactyl/locale/en-US/browsing.xml rename : xulmus/locale/en-US/dactyl.dtd => melodactyl/locale/en-US/dactyl.dtd rename : xulmus/locale/en-US/gui.xml => melodactyl/locale/en-US/gui.xml rename : xulmus/locale/en-US/intro.xml => melodactyl/locale/en-US/intro.xml rename : xulmus/locale/en-US/player.xml => melodactyl/locale/en-US/player.xml rename : xulmus/locale/en-US/tabs.xml => melodactyl/locale/en-US/tabs.xml rename : xulmus/skin/icon.png => melodactyl/skin/icon.png --- common/content/bookmarks.js | 20 ++++------ common/content/completion.js | 6 +-- common/content/dactyl.xul | 5 +-- common/content/javascript.js | 8 ++-- common/modules/base.jsm | 3 +- {xulmus => melodactyl}/AUTHORS | 0 melodactyl/Makefile | 11 ++++++ {xulmus => melodactyl}/NEWS | 0 {xulmus => melodactyl}/TODO | 0 melodactyl/chrome.manifest | 37 ++++++++++++++++++ melodactyl/components/commandline-handler.js | 1 + .../components/protocols.js | 0 {xulmus => melodactyl}/content/config.js | 2 +- {xulmus => melodactyl}/content/dactyl.dtd | 1 + {xulmus => melodactyl}/content/library.js | 0 {xulmus => melodactyl}/content/logo.png | Bin .../content/melodactyl.xul | 0 {xulmus => melodactyl}/content/player.js | 0 {xulmus => melodactyl}/content/xulmus.svg | 0 {xulmus => melodactyl}/contrib/vim/Makefile | 0 .../contrib/vim/ftdetect/melodactyl.vim | 0 .../contrib/vim/mkvimball.txt | 0 .../contrib/vim/syntax/melodactyl.vim | 0 melodactyl/defaults/preferences/dactyl.js | 4 ++ {xulmus => melodactyl}/install.rdf | 16 ++++---- {xulmus => melodactyl}/locale/en-US/all.xml | 0 .../locale/en-US/autocommands.xml | 0 .../locale/en-US/browsing.xml | 0 .../locale/en-US/dactyl.dtd | 0 {xulmus => melodactyl}/locale/en-US/gui.xml | 0 {xulmus => melodactyl}/locale/en-US/intro.xml | 0 .../locale/en-US/player.xml | 0 {xulmus => melodactyl}/locale/en-US/tabs.xml | 0 {xulmus => melodactyl}/skin/icon.png | Bin pentadactyl/content/dactyl.dtd | 1 + teledactyl/content/dactyl.dtd | 1 + xulmus/Makefile | 5 --- xulmus/chrome.manifest | 37 ------------------ xulmus/components/commandline-handler.js | 1 - xulmus/defaults/preferences/dactyl.js | 4 -- 40 files changed, 84 insertions(+), 79 deletions(-) rename {xulmus => melodactyl}/AUTHORS (100%) create mode 100644 melodactyl/Makefile rename {xulmus => melodactyl}/NEWS (100%) rename {xulmus => melodactyl}/TODO (100%) create mode 100644 melodactyl/chrome.manifest create mode 120000 melodactyl/components/commandline-handler.js rename {xulmus => melodactyl}/components/protocols.js (100%) rename {xulmus => melodactyl}/content/config.js (99%) rename {xulmus => melodactyl}/content/dactyl.dtd (91%) rename {xulmus => melodactyl}/content/library.js (100%) rename {xulmus => melodactyl}/content/logo.png (100%) rename xulmus/content/xulmus.xul => melodactyl/content/melodactyl.xul (100%) rename {xulmus => melodactyl}/content/player.js (100%) rename {xulmus => melodactyl}/content/xulmus.svg (100%) rename {xulmus => melodactyl}/contrib/vim/Makefile (100%) rename xulmus/contrib/vim/ftdetect/xulmus.vim => melodactyl/contrib/vim/ftdetect/melodactyl.vim (100%) rename {xulmus => melodactyl}/contrib/vim/mkvimball.txt (100%) rename xulmus/contrib/vim/syntax/xulmus.vim => melodactyl/contrib/vim/syntax/melodactyl.vim (100%) create mode 100644 melodactyl/defaults/preferences/dactyl.js rename {xulmus => melodactyl}/install.rdf (59%) rename {xulmus => melodactyl}/locale/en-US/all.xml (100%) rename {xulmus => melodactyl}/locale/en-US/autocommands.xml (100%) rename {xulmus => melodactyl}/locale/en-US/browsing.xml (100%) rename {xulmus => melodactyl}/locale/en-US/dactyl.dtd (100%) rename {xulmus => melodactyl}/locale/en-US/gui.xml (100%) rename {xulmus => melodactyl}/locale/en-US/intro.xml (100%) rename {xulmus => melodactyl}/locale/en-US/player.xml (100%) rename {xulmus => melodactyl}/locale/en-US/tabs.xml (100%) rename {xulmus => melodactyl}/skin/icon.png (100%) delete mode 100644 xulmus/Makefile delete mode 100644 xulmus/chrome.manifest delete mode 100644 xulmus/components/commandline-handler.js delete mode 100644 xulmus/defaults/preferences/dactyl.js diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 5a1f297e..2f4700dc 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -117,24 +117,20 @@ const Bookmarks = Module("bookmarks", { // also ensures that each search engine has a Dactyl-friendly alias getSearchEngines: function getSearchEngines() { let searchEngines = []; + let aliases = {}; for (let [, engine] in Iterator(services.get("browserSearch").getVisibleEngines({}))) { let alias = engine.alias; - if (!alias || !/^[a-z0-9_-]+$/.test(alias)) + if (!alias || !/^[a-z_-]+$/.test(alias)) alias = engine.name.replace(/^\W*([a-zA-Z_-]+).*/, "$1").toLowerCase(); if (!alias) alias = "search"; // for search engines which we can't find a suitable alias - // make sure we can use search engines which would have the same alias (add numbers at the end) - let newAlias = alias; - for (let j = 1; j <= 10; j++) { // <=10 is intentional - if (!searchEngines.some(function (item) item[0] == newAlias)) - break; - - newAlias = alias + j; - } - // only write when it changed, writes are really slow - if (engine.alias != newAlias) - engine.alias = newAlias; + if (set.has(aliases, alias)) + alias += ++aliases[alias]; + else + aliases[alias] = 0; + if (engine.alias != alias) + engine.alias = alias; searchEngines.push([engine.alias, engine.description, engine.iconURI && engine.iconURI.spec]); } diff --git a/common/content/completion.js b/common/content/completion.js index a741302c..26846834 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -316,7 +316,7 @@ const CompletionContext = Class("CompletionContext", { get message() this._message || (this.waitingForTab ? "Waiting for " : null), set message(val) this._message = val, - get proto() { + get itemPrototype() { let res = {}; function result(quote) { yield ["result", quote ? function () quote[0] + quote[1](this.text) + quote[2] @@ -444,9 +444,9 @@ const CompletionContext = Class("CompletionContext", { try { // Item prototypes - let proto = this.proto; + let proto = this.itemPrototype; if (!this.cache.constructed) - this.cache.constructed = items.map(function (item) Object.create(proto, { item: { value: item, enumerable: true } })); + this.cache.constructed = items.map(function (item) ({ __proto__: proto, item: item })); // Filters let filtered = this.filterFunc(this.cache.constructed); diff --git a/common/content/dactyl.xul b/common/content/dactyl.xul index 683b9561..1e95af9a 100644 --- a/common/content/dactyl.xul +++ b/common/content/dactyl.xul @@ -53,9 +53,8 @@ oncommandupdate="&events;.onSelectionChange(event);"/> - - + +