1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 13:47: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:
Kris Maglione
2010-10-02 10:44:19 -04:00
parent c0a5a680b8
commit a59d88fee7
40 changed files with 84 additions and 79 deletions

View File

@@ -117,24 +117,20 @@ const Bookmarks = Module("bookmarks", {
// also ensures that each search engine has a Dactyl-friendly alias // also ensures that each search engine has a Dactyl-friendly alias
getSearchEngines: function getSearchEngines() { getSearchEngines: function getSearchEngines() {
let searchEngines = []; let searchEngines = [];
let aliases = {};
for (let [, engine] in Iterator(services.get("browserSearch").getVisibleEngines({}))) { for (let [, engine] in Iterator(services.get("browserSearch").getVisibleEngines({}))) {
let alias = engine.alias; 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(); alias = engine.name.replace(/^\W*([a-zA-Z_-]+).*/, "$1").toLowerCase();
if (!alias) if (!alias)
alias = "search"; // for search engines which we can't find a suitable 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) if (set.has(aliases, alias))
let newAlias = alias; alias += ++aliases[alias];
for (let j = 1; j <= 10; j++) { // <=10 is intentional else
if (!searchEngines.some(function (item) item[0] == newAlias)) aliases[alias] = 0;
break; if (engine.alias != alias)
engine.alias = alias;
newAlias = alias + j;
}
// only write when it changed, writes are really slow
if (engine.alias != newAlias)
engine.alias = newAlias;
searchEngines.push([engine.alias, engine.description, engine.iconURI && engine.iconURI.spec]); searchEngines.push([engine.alias, engine.description, engine.iconURI && engine.iconURI.spec]);
} }

View File

@@ -316,7 +316,7 @@ const CompletionContext = Class("CompletionContext", {
get message() this._message || (this.waitingForTab ? "Waiting for <Tab>" : null), get message() this._message || (this.waitingForTab ? "Waiting for <Tab>" : null),
set message(val) this._message = val, set message(val) this._message = val,
get proto() { get itemPrototype() {
let res = {}; let res = {};
function result(quote) { function result(quote) {
yield ["result", quote ? function () quote[0] + quote[1](this.text) + quote[2] yield ["result", quote ? function () quote[0] + quote[1](this.text) + quote[2]
@@ -444,9 +444,9 @@ const CompletionContext = Class("CompletionContext", {
try { try {
// Item prototypes // Item prototypes
let proto = this.proto; let proto = this.itemPrototype;
if (!this.cache.constructed) 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 // Filters
let filtered = this.filterFunc(this.cache.constructed); let filtered = this.filterFunc(this.cache.constructed);

View File

@@ -53,9 +53,8 @@
oncommandupdate="&events;.onSelectionChange(event);"/> oncommandupdate="&events;.onSelectionChange(event);"/>
</window> </window>
<vbox id="browser-bottombox"> <vbox id="&dactyl.commandContainer;">
<!-- 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"> <vbox class="dactyl-container" hidden="false" collapsed="true">
<iframe id="dactyl-multiline-output" src="chrome://dactyl/content/buffer.xhtml" <iframe id="dactyl-multiline-output" src="chrome://dactyl/content/buffer.xhtml"
flex="1" hidden="false" collapsed="false" flex="1" hidden="false" collapsed="false"

View File

@@ -610,10 +610,10 @@ const JavaScript = Module("javascript", {
"ROCSSPrimitiveValue", "RangeError", "ReferenceError", "RegExp", "ROCSSPrimitiveValue", "RangeError", "ReferenceError", "RegExp",
"StopIteration", "String", "SyntaxError", "TypeError", "URIError", "StopIteration", "String", "SyntaxError", "TypeError", "URIError",
"Uint16Array", "Uint32Array", "Uint8Array", "XML", "Uint16Array", "Uint32Array", "Uint8Array", "XML",
"XMLHttpProgressEvent", "XMLList", "XMLSerializer", "XULControllers", "XMLHttpProgressEvent", "XMLList", "XMLSerializer", "XPCNativeWrapper",
"decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "XPCSafeJSWrapper", "XULControllers", "decodeURI", "decodeURIComponent",
"eval", "isFinite", "isNaN", "isXMLName", "parseFloat", "parseInt", "encodeURI", "encodeURIComponent", "eval", "isFinite", "isNaN",
"undefined", "uneval" "isXMLName", "parseFloat", "parseInt", "undefined", "uneval"
].concat([k.substr(6) for (k in keys(Ci)) if (/^nsIDOM/.test(k))]) ].concat([k.substr(6) for (k in keys(Ci)) if (/^nsIDOM/.test(k))])
.concat([k.substr(3) for (k in keys(Ci)) if (/^nsI/.test(k))]) .concat([k.substr(3) for (k in keys(Ci)) if (/^nsI/.test(k))])
.filter(function (k) k in window))), .filter(function (k) k in window))),

View File

@@ -572,7 +572,8 @@ function update(target) {
if (typeof desc.value == "function" && Object.getPrototypeOf(target)) { if (typeof desc.value == "function" && Object.getPrototypeOf(target)) {
let func = desc.value; let func = desc.value;
desc.value.superapply = function (self, args) desc.value.superapply = function (self, args)
Object.getPrototypeOf(target)[k].apply(self, args); let (meth = Object.getPrototypeOf(target)[k])
meth && meth.apply(self, args);
desc.value.supercall = function (self) desc.value.supercall = function (self)
func.superapply(self, Array.slice(arguments, 1)); func.superapply(self, Array.slice(arguments, 1));
} }

11
melodactyl/Makefile Normal file
View File

@@ -0,0 +1,11 @@
#### configuration
NAME = melodactyl
FIREFOX ?= songbird
HOSTAPP ?= $(SONGBIRD)
PROFILEPATHS ?= "$$HOME/.songbird" \
"$$HOME/Library/Songbird" \
"$$APPDATA/Songbird"
include ../common/Makefile

View File

@@ -0,0 +1,37 @@
# Songbird
content melodactyl content/
skin melodactyl classic/1.0 skin/
locale melodactyl en-US locale/en-US/
locale dactyl en-US ../common/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://melodactyl/content/dactyl.dtd
override chrome://dactyl/content/config.js chrome://melodactyl/content/config.js
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://melodactyl/content/melodactyl.xul
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://dactyl/content/dactyl.xul
#component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
#contract @mozilla.org/commandlinehandler/general-startup;1?type=melodactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
#category command-line-handler m-melodactyl @mozilla.org/commandlinehandler/general-startup;1?type=melodactyl
#
#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=melodactyl {81495d80-89ee-4c36-a88d-ea7c4e5ac63f}
#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://xulmus/content/xulmus.xul
#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://dactyl/content/dactyl.xul
#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://xulmus/content/xulmus.xul
#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://dactyl/content/dactyl.xul
#overlay windowtype:Songbird:Main chrome://dactyl/content/dactyl.xul
#overlay windowtype:Songbird:Main chrome://xulmus/content/xulmus.xul

View File

@@ -0,0 +1 @@
../../common/components/commandline-handler.js

View File

@@ -44,7 +44,7 @@ const Config = Module("config", ConfigBase, {
// focusContent() focuses this widget gSongbirdWindowController takes care of the focus. // focusContent() focuses this widget gSongbirdWindowController takes care of the focus.
get visualbellWindow() document.getElementById(this.mainWindowId), get visualbellWindow() document.getElementById(this.mainWindowId),
styleableChrome: ["chrome://gonzo/content/xul/mainplayer.xul"], styleableChrome: ["chrome://purplerain/content/xul/mainplayer.xul"],
autocommands: { autocommands: {
BookmarkAdd: "Triggered after a page is bookmarked", BookmarkAdd: "Triggered after a page is bookmarked",

View File

@@ -3,6 +3,7 @@
%dactylBranding; %dactylBranding;
<!ENTITY dactyl.mainWindow "mainplayer"> <!ENTITY dactyl.mainWindow "mainplayer">
<!ENTITY dactyl.commandContainer "&dactyl.mainWindow;">
<!ENTITY dactyl.name "xulmus"> <!ENTITY dactyl.name "xulmus">
<!ENTITY dactyl.appName "Xulmus"> <!ENTITY dactyl.appName "Xulmus">
<!ENTITY dactyl.idName "XULMUS"> <!ENTITY dactyl.idName "XULMUS">

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,4 @@
pref("extensions.dactyl.name", "melodactyl");
pref("extensions.dactyl.appName", "Melodactyl");
pref("extensions.dactyl.idName", "MELODACTYL");
pref("extensions.dactyl.host", "Songbird");

View File

@@ -3,20 +3,20 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"
xmlns:songbird="http://www.songbirdnest.com/2007/addon-metadata-rdf#"> xmlns:songbird="http://www.songbirdnest.com/2007/addon-metadata-rdf#">
<Description about="urn:mozilla:install-manifest"> <Description about="urn:mozilla:install-manifest">
<em:id>xulmus@vimperator.org</em:id> <em:id>melodactyl@dactyl.googlecode.com</em:id>
<em:type>2</em:type> <em:type>2</em:type>
<em:name>Xulmus</em:name> <em:name>Melodactyl</em:name>
<em:version>0.2a1pre</em:version> <em:version>0.1a1pre</em:version>
<em:description>Makes Songbird behave like Vim and CMus.</em:description> <em:description>Songbird for Vim and CMus junkies.</em:description>
<em:creator>Prathyush Thota</em:creator> <em:creator>Prathyush Thota</em:creator>
<em:homepageURL>http://vimperator.org</em:homepageURL> <em:homepageURL>http://dactyl.sourceforge.net/</em:homepageURL>
<em:iconURL>chrome://xulmus/skin/icon.png</em:iconURL> <em:iconURL>chrome://melodactyl/skin/icon.png</em:iconURL>
<em:optionsURL>chrome://dactyl/content/preferences.xul</em:optionsURL> <em:optionsURL>chrome://dactyl/content/preferences.xul</em:optionsURL>
<em:targetApplication> <em:targetApplication>
<Description> <Description>
<em:id>songbird@songbirdnest.com</em:id> <em:id>songbird@songbirdnest.com</em:id>
<em:minVersion>0.8.0pre</em:minVersion> <em:minVersion>1.8.0</em:minVersion>
<em:maxVersion>1.4.0</em:maxVersion> <em:maxVersion>1.9.0</em:maxVersion>
</Description> </Description>
</em:targetApplication> </em:targetApplication>
</Description> </Description>

View File

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 465 B

View File

@@ -3,6 +3,7 @@
%dactylBranding; %dactylBranding;
<!ENTITY dactyl.mainWindow "main-window"> <!ENTITY dactyl.mainWindow "main-window">
<!ENTITY dactyl.commandContainer "browser-bottom-box">
<!ENTITY dactyl.name "pentadactyl"> <!ENTITY dactyl.name "pentadactyl">
<!ENTITY dactyl.version "1.0"> <!ENTITY dactyl.version "1.0">
<!ENTITY dactyl.idName "PENTADACTYL"> <!ENTITY dactyl.idName "PENTADACTYL">

View File

@@ -3,6 +3,7 @@
%dactylBranding; %dactylBranding;
<!ENTITY dactyl.mainWindow "messengerWindow"> <!ENTITY dactyl.mainWindow "messengerWindow">
<!ENTITY dactyl.commandContainer "&dactyl.mainWindow;">
<!ENTITY dactyl.name "teledactyl"> <!ENTITY dactyl.name "teledactyl">
<!ENTITY dactyl.idName "TELEDACTYL"> <!ENTITY dactyl.idName "TELEDACTYL">
<!ENTITY dactyl.appName "Teledactyl"> <!ENTITY dactyl.appName "Teledactyl">

View File

@@ -1,5 +0,0 @@
#### configuration
NAME = xulmus
include ../common/Makefile

View File

@@ -1,37 +0,0 @@
# Songbird
content xulmus content/
skin xulmus classic/1.0 skin/
locale xulmus en-US locale/en-US/
locale dactyl en-US ../common/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://xulmus/content/dactyl.dtd
override chrome://dactyl/content/config.js chrome://xulmus/content/config.js
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://xulmus/content/xulmus.xul
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://dactyl/content/dactyl.xul
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
contract @mozilla.org/commandlinehandler/general-startup;1?type=xulmus {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
category command-line-handler m-xulmus @mozilla.org/commandlinehandler/general-startup;1?type=xulmus
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=xulmus {81495d80-89ee-4c36-a88d-ea7c4e5ac63f}
#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://xulmus/content/xulmus.xul
#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://dactyl/content/dactyl.xul
#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://xulmus/content/xulmus.xul
#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://dactyl/content/dactyl.xul
#overlay windowtype:Songbird:Main chrome://dactyl/content/dactyl.xul
#overlay windowtype:Songbird:Main chrome://xulmus/content/xulmus.xul

View File

@@ -1 +0,0 @@
../../common/components/commandline-handler.js

View File

@@ -1,4 +0,0 @@
pref("extensions.dactyl.name", "xulmus");
pref("extensions.dactyl.appName", "Xulmus");
pref("extensions.dactyl.idName", "XULMUS");
pref("extensions.dactyl.host", "Songbird");