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