1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 04:44:11 +01:00

Make Melodactyl minimally functional. Closes issue #340.

--HG--
rename : pentadactyl/chrome.manifest => common/chrome.manifest
This commit is contained in:
Kris Maglione
2011-02-22 10:01:56 -05:00
parent d92f3f2c9c
commit 8299257422
13 changed files with 259 additions and 338 deletions

22
common/chrome.manifest Normal file
View File

@@ -0,0 +1,22 @@
resource dactyl-local-content content/
resource dactyl-local-skin skin/
resource dactyl-local-locale locale/
resource dactyl ../common/modules/
resource dactyl-content ../common/content/
resource dactyl-skin ../common/skin/
resource dactyl-locale ../common/locale/
content dactyl ../common/content/
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
contract @mozilla.org/commandlinehandler/general-startup;1?type=dactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
category command-line-handler m-dactyl @mozilla.org/commandlinehandler/general-startup;1?type=dactyl
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}

View File

@@ -263,63 +263,56 @@ var Bookmarks = Module("bookmarks", {
* @returns {[string, string | null] | null} * @returns {[string, string | null] | null}
*/ */
getSearchURL: function getSearchURL(text, useDefsearch) { getSearchURL: function getSearchURL(text, useDefsearch) {
let searchString = (useDefsearch ? options["defsearch"] + " " : "") + text; let query = (useDefsearch ? options["defsearch"] + " " : "") + text;
// ripped from Firefox // ripped from Firefox
function getShortcutOrURI(url) { var keyword = query;
var keyword = url; var param = "";
var param = ""; var offset = query.indexOf(" ");
var offset = url.indexOf(" "); if (offset > 0) {
if (offset > 0) { keyword = query.substr(0, offset);
keyword = url.substr(0, offset); param = query.substr(offset + 1);
param = url.substr(offset + 1);
}
var engine = bookmarks.searchEngines[keyword];
if (engine) {
if (engine.searchForm && !param)
return [engine.searchForm, null];
let submission = engine.getSubmission(param, null);
return [submission.uri.spec, submission.postData];
}
let [shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword);
if (!shortcutURL)
return [url, null];
let bmark = bookmarkcache.keywords[keyword];
let data = window.unescape(postData || "");
if (/%s/i.test(shortcutURL) || /%s/i.test(data)) {
var charset = "";
var matches = shortcutURL.match(/^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/);
if (matches)
[, shortcutURL, charset] = matches;
else
try {
charset = services.history.getCharsetForURI(util.newURI(shortcutURL));
}
catch (e) {}
if (charset)
var encodedParam = escape(window.convertFromUnicode(charset, param));
else
encodedParam = bmark.encodeURIComponent(param);
shortcutURL = shortcutURL.replace(/%s/g, encodedParam).replace(/%S/g, param);
if (/%s/i.test(data))
postData = window.getPostDataStream(data, param, encodedParam, "application/x-www-form-urlencoded");
}
else if (param)
return [shortcutURL, null];
return [shortcutURL, postData];
} }
let [url, postData] = getShortcutOrURI(searchString); var engine = bookmarks.searchEngines[keyword];
if (engine) {
if (engine.searchForm && !param)
return engine.searchForm;
let submission = engine.getSubmission(param, null);
return [submission.uri.spec, submission.postData];
}
if (url == searchString) let [url, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword);
if (!url)
return null; return null;
let data = window.unescape(postData || "");
if (/%s/i.test(url) || /%s/i.test(data)) {
var charset = "";
var matches = url.match(/^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/);
if (matches)
[, url, charset] = matches;
else
try {
charset = services.history.getCharsetForURI(util.newURI(url));
}
catch (e) {}
if (charset)
var encodedParam = escape(window.convertFromUnicode(charset, param));
else
encodedParam = bookmarkcache.keywords[keyword].encodeURIComponent(param);
url = url.replace(/%s/g, encodedParam).replace(/%S/g, param);
if (/%s/i.test(data))
postData = window.getPostDataStream(data, param, encodedParam, "application/x-www-form-urlencoded");
}
else if (param)
postData = null;
if (postData) if (postData)
return [url, postData]; return [url, postData];
return url; // can be null return url;
}, },
/** /**

View File

@@ -13,7 +13,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("config", { defineModule("config", {
exports: ["ConfigBase", "Config", "config"], exports: ["ConfigBase", "Config", "config"],
require: ["services", "storage", "util", "template"], require: ["services", "storage", "util", "template"],
use: ["io"] use: ["io", "prefs"]
}, this); }, this);
var ConfigBase = Class("ConfigBase", { var ConfigBase = Class("ConfigBase", {

View File

@@ -47,11 +47,13 @@ var Group = Class("Group", {
get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0, get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0,
}, { }, {
compileFilter: function (patterns) { compileFilter: function (patterns, default_) {
if (arguments.length < 2)
default_ = false;
function siteFilter(uri) function siteFilter(uri)
let (match = array.nth(siteFilter.filters, function (f) f(uri), 0)) let (match = array.nth(siteFilter.filters, function (f) f(uri), 0))
match && match.result; match ? match.result : default_;
return update(siteFilter, { return update(siteFilter, {
toString: function () this.filters.join(","), toString: function () this.filters.join(","),

View File

@@ -166,6 +166,7 @@ var Overlay = Module("Overlay", {
"options", "options",
"overlay", "overlay",
"prefs", "prefs",
"sanitizer",
"services", "services",
"storage", "storage",
"styles", "styles",
@@ -276,7 +277,7 @@ var Overlay = Module("Overlay", {
modules.config.scripts.forEach(modules.load); modules.config.scripts.forEach(modules.load);
frobModules(); frobModules();
defineModule.modules.forEach(function ({ lazyInit, constructor: { className } }) { defineModule.modules.forEach(function defModule({ lazyInit, constructor: { className } }) {
if (!lazyInit) { if (!lazyInit) {
frob(className); frob(className);
modules[className] = modules[className]; modules[className] = modules[className];

View File

@@ -1,36 +0,0 @@
# 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
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=dactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
#category command-line-handler m-dactyl @mozilla.org/commandlinehandler/general-startup;1?type=dactyl
#
#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://melodactyl/content/melodactyl.xul
#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://dactyl/content/dactyl.xul
#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://melodactyl/content/melodactyl.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://melodactyl/content/melodactyl.xul

1
melodactyl/chrome.manifest Symbolic link
View File

@@ -0,0 +1 @@
../common/chrome.manifest

View File

@@ -10,20 +10,134 @@
Components.utils.import("resource://gre/modules/utils.js"); // XXX: PlacesUtils Components.utils.import("resource://gre/modules/utils.js"); // XXX: PlacesUtils
const Config = Module("config", ConfigBase, { const Config = Module("config", ConfigBase, {
init: function init() { name: "melodactyl",
init.supercall(this); appName: "Melodactyl",
idName: "MELODACTYL",
host: "Songbird",
hostbin: "songbird",
// TODO: mention this to SB devs, they seem keen to provide these commandContainer: "mainplayer",
// functions to make porting from FF as simple as possible.
window.toJavaScriptConsole = function () { Local: function Local(dactyl, modules, window) let ({ config } = modules, { document } = window) {
toOpenWindowByType("global:console", "chrome://global/content/console.xul"); init: function init() {
}; init.supercall(this);
// TODO: mention this to SB devs, they seem keen to provide these
// functions to make porting from FF as simple as possible.
window.toJavaScriptConsole = function () {
toOpenWindowByType("global:console", "chrome://global/content/console.xul");
};
},
// FIXME: unless I'm seeing double in in the wee small hours gBrowser is
// first set from getBrowser which they've deprecated in FF.
get browser() window.getBrowser(),
get tabbrowser() window.getBrowser(),
dialogs: {
about: ["About Songbird",
function () { window.openDialog("chrome://songbird/content/xul/about.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
addons: ["Manage Add-ons",
function () { window.SBOpenPreferences("paneAddons"); }],
checkupdates: ["Check for updates",
function () { window.checkForUpdates(); }],
cookies: ["List your cookies",
function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
console: ["JavaScript console",
function () { window.toJavaScriptConsole(); }],
dominspector: ["DOM Inspector",
function () { window.inspectDOMDocument(window.content.document); },
function () "inspectDOMDocument" in window],
downloads: ["Manage Downloads",
function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
newsmartplaylist: ["Open the file selector dialog",
function () { window.SBNewSmartPlaylist(); }],
openfile: ["Open the file selector dialog",
function () { window.SBFileOpen(); }],
pagesource: ["View page source",
function () { window.BrowserViewSourceOfDocument(window.content.document); }],
preferences: ["Show Songbird preferences dialog",
function () { window.openPreferences(); }],
printsetup: ["Setup the page size and orientation before printing",
function () { window.PrintUtils.showPageSetup(); }],
print: ["Show print dialog",
function () { window.PrintUtils.print(); }],
saveframe: ["Save frame to disk",
function () { window.saveFrameDocument(); }],
savepage: ["Save page to disk",
function () { window.saveDocument(window.content.document); }],
searchengines: ["Manage installed search engines",
function () { window.openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
selectionsource: ["View selection source",
function () { modules.buffer.viewSelectionSource(); }],
subscribe: ["Add a new subscription",
function () { window.SBSubscribe(); }]
},
// TODO: clean this up
focusChange: function (win) {
const { modes } = modules;
// Switch to -- PLAYER -- mode for Songbird Media Player.
if (this.isPlayerWindow)
modes.set(modes.PLAYER);
else
if (modes.main == modes.PLAYER)
modes.pop();
},
get isPlayerWindow() SBGetBrowser().mCurrentTab == SBGetBrowser().mediaTab,
/**
* Shows or hides the main service pane.
*
* @param {boolean} value Show the service pane if true, hide it if false.
*/
showServicePane: function (value) {
const key = "splitter.servicepane_splitter.was_collapsed";
window.gServicePane.open = value;
window.SBDataSetBoolValue(key, window.gServicePane.open);
},
/**
* Opens the display panel with the specified *id*.
*
* @param {string} id The ID of the display pane.
*/
openDisplayPane: function (id) {
if (id == "servicepane")
this.showServicePane(true);
else {
let pane = document.getElementById(id);
let manager = services.displayPaneManager;
let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue);
if (!paneinfo)
paneinfo = manager.defaultPaneInfo;
pane.loadContent(paneinfo);
}
},
/**
* Closes the display panel with the specified *id*
*
* @param {string} id The ID of the display pane.
*/
closeDisplayPane: function (id) {
if (id == "servicepane")
this.showServicePane(false);
else
document.getElementById(id).hide();
}
}, },
/*** optional options, there are checked for existence and a fallback provided ***/ /*** optional options, there are checked for existence and a fallback provided ***/
features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "player"], features: set(["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "player"]),
defaults: { defaults: {
guioptions: "smprb", guioptions: "bCmprs",
showtabline: 2, showtabline: 2,
get titlestring() config.name get titlestring() config.name
}, },
@@ -34,9 +148,7 @@ const Config = Module("config", ConfigBase, {
p: ["Player controls", ["player_wrapper"]] p: ["Player controls", ["player_wrapper"]]
}, },
get isPlayerWindow() SBGetBrowser().mCurrentTab == SBGetBrowser().mediaTab, overlayChrome: ["chrome://purplerain/content/xul/mainplayer.xul"],
// focusContent() focuses this widget gSongbirdWindowController takes care of the focus.
get visualbellWindow() document.getElementById(this.mainWindowId),
styleableChrome: ["chrome://purplerain/content/xul/mainplayer.xul"], styleableChrome: ["chrome://purplerain/content/xul/mainplayer.xul"],
@@ -71,64 +183,7 @@ const Config = Module("config", ConfigBase, {
song: "song" song: "song"
}, this.__proto__.completers)), }, this.__proto__.completers)),
dialogs: {
about: ["About Songbird",
function () { window.openDialog("chrome://songbird/content/xul/about.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
addons: ["Manage Add-ons",
function () { SBOpenPreferences("paneAddons"); }],
checkupdates: ["Check for updates",
function () { window.checkForUpdates(); }],
cleardata: ["Clear private data",
function () { Sanitizer.showUI(); }],
cookies: ["List your cookies",
function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
console: ["JavaScript console",
function () { window.toJavaScriptConsole(); }],
dominspector: ["DOM Inspector",
function () { try { window.inspectDOMDocument(content.document); } catch (e) { dactyl.echoerr("DOM Inspector extension not installed"); } }],
downloads: ["Manage Downloads",
function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
newsmartplaylist: ["Open the file selector dialog",
function () { SBNewSmartPlaylist(); }],
openfile: ["Open the file selector dialog",
function () { SBFileOpen(); }],
pagesource: ["View page source",
function () { window.BrowserViewSourceOfDocument(content.document); }],
preferences: ["Show Songbird preferences dialog",
function () { window.openPreferences(); }],
printsetup: ["Setup the page size and orientation before printing",
function () { PrintUtils.showPageSetup(); }],
print: ["Show print dialog",
function () { PrintUtils.print(); }],
saveframe: ["Save frame to disk",
function () { window.saveFrameDocument(); }],
savepage: ["Save page to disk",
function () { window.saveDocument(window.content.document); }],
searchengines: ["Manage installed search engines",
function () { window.openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }],
selectionsource: ["View selection source",
function () { buffer.viewSelectionSource(); }],
subscribe: ["Add a new subscription",
function () { SBSubscribe(); }]
},
// TODO: clean this up
focusChange: function (win) {
// Switch to -- PLAYER -- mode for Songbird Media Player.
if (config.isPlayerWindow)
modes.set(modes.PLAYER);
else
if (modes.main == modes.PLAYER)
modes.pop();
},
hasTabbrowser: true, hasTabbrowser: true,
// FIXME: unless I'm seeing double in in the wee small hours gBrowser is
// first set from getBrowser which they've deprecated in FF.
get tabbrowser() window.getBrowser(),
get browser() window.getBrowser(),
modes: [["PLAYER", { char: "p" }]],
removeTab: function (tab) { removeTab: function (tab) {
if (config.tabbrowser.mTabs.length > 1) if (config.tabbrowser.mTabs.length > 1)
@@ -153,55 +208,18 @@ const Config = Module("config", ConfigBase, {
"library" "library"
], ],
sidebars: {
viewAddons: ["Add-ons", "A", "chrome://mozapps/content/extensions/extensions.xul"],
viewConsole: ["Console", "C", "chrome://global/content/console.xul"],
viewDownloads: ["Downloads", "D", "chrome://mozapps/content/downloads/downloads.xul"],
viewPreferences: ["Preferences", "P", "about:config"]
},
// FIXME: tab arg and media tab exception? // FIXME: tab arg and media tab exception?
stop: function (tab) { stop: function (tab) {
SBGetBrowser().mCurrentBrowser.stop(); SBGetBrowser().mCurrentBrowser.stop();
} }
}, { }, {
/**
* Shows or hides the main service pane.
*
* @param {boolean} value Show the service pane if true, hide it if false.
*/
showServicePane: function (value) {
const key = "splitter.servicepane_splitter.was_collapsed";
gServicePane.open = value;
SBDataSetBoolValue(key, gServicePane.open);
},
/**
* Opens the display panel with the specified *id*.
*
* @param {string} id The ID of the display pane.
*/
openDisplayPane: function (id) {
if (id == "servicepane")
this.showServicePane(true);
else {
let pane = document.getElementById(id);
let manager = services.displayPaneManager;
let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue);
if (!paneinfo)
paneinfo = manager.defaultPaneInfo;
pane.loadContent(paneinfo);
}
},
/**
* Closes the display panel with the specified *id*
*
* @param {string} id The ID of the display pane.
*/
closeDisplayPane: function (id) {
if (id == "servicepane")
this.showServicePane(false);
else
document.getElementById(id).hide();
},
/** /**
* @property {object} A map of display pane command argument strings to * @property {object} A map of display pane command argument strings to
* panel element IDs. * panel element IDs.
@@ -213,13 +231,15 @@ const Config = Module("config", ConfigBase, {
"rightsidebar" : "displaypane_right_sidebar" "rightsidebar" : "displaypane_right_sidebar"
} }
}, { }, {
commands: function () { commands: function initCommands(dactyl, modules, window) {
const { commands, completion, options } = modules;
commands.add(["dpcl[ose]"], commands.add(["dpcl[ose]"],
"Close a display pane", "Close a display pane",
function (args) { function (args) {
let arg = args.literalArg; let arg = args.literalArg;
dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg); dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg);
Config.closeDisplayPane(Config.displayPanes[arg]); config.closeDisplayPane(Config.displayPanes[arg]);
}, },
{ {
argCount: "1", argCount: "1",
@@ -234,7 +254,7 @@ const Config = Module("config", ConfigBase, {
let arg = args.literalArg; let arg = args.literalArg;
dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg); dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg);
// TODO: focus when we have better key handling of these extended modes // TODO: focus when we have better key handling of these extended modes
Config.openDisplayPane(Config.displayPanes[arg]); config.openDisplayPane(Config.displayPanes[arg]);
}, },
{ {
argCount: "1", argCount: "1",
@@ -258,22 +278,31 @@ const Config = Module("config", ConfigBase, {
bang: true bang: true
}); });
}, },
completion: function () { completion: function initCompletion(dactyl, modules, window) {
const completion = require("completion");
completion.displayPane = function (context) { completion.displayPane = function (context) {
context.title = ["Display Pane"]; context.title = ["Display Pane"];
context.completions = Config.displayPanes; // FIXME: useful description etc context.completions = Config.displayPanes; // FIXME: useful description etc
}; };
}, },
modes: function () { modes: function initModes(dactyl, modules, window) {
const { modes } = modules;
this.ignoreKeys = { this.ignoreKeys = {
"<Return>": modes.NORMAL | modes.INSERT, "<Return>": modes.NORMAL | modes.INSERT,
"<Space>": modes.NORMAL | modes.INSERT, "<Space>": modes.NORMAL | modes.INSERT,
"<Up>": modes.NORMAL | modes.INSERT, "<Up>": modes.NORMAL | modes.INSERT,
"<Down>": modes.NORMAL | modes.INSERT "<Down>": modes.NORMAL | modes.INSERT
}; };
config.modes.forEach(function (mode) { modes.addMode.apply(modes, mode); }); // XXX
modes.addMode("PLAYER", {
char: "p"
});
}, },
options: function () { options: function initOptions(dactyl, modules, window) {
const { options } = modules;
// TODO: SB doesn't explicitly support an offline mode. Should we? --djk // TODO: SB doesn't explicitly support an offline mode. Should we? --djk
options.add(["online"], options.add(["online"],
"Set the 'work offline' option", "Set the 'work offline' option",
@@ -288,12 +317,13 @@ const Config = Module("config", ConfigBase, {
getter: function () !services.io.offline getter: function () !services.io.offline
}); });
}, },
services: function () { services: function initServices(dactyl, modules, window) {
services.add("displayPaneManager", "@songbirdnest.com/Songbird/DisplayPane/Manager;1", Ci.sbIDisplayPaneManager); services.add("displayPaneManager", "@songbirdnest.com/Songbird/DisplayPane/Manager;1", Ci.sbIDisplayPaneManager);
services.add("mediaPageManager", "@songbirdnest.com/Songbird/MediaPageManager;1", Ci.sbIMediaPageManager); services.add("mediaPageManager", "@songbirdnest.com/Songbird/MediaPageManager;1", Ci.sbIMediaPageManager);
services.add("propertyManager","@songbirdnest.com/Songbird/Properties/PropertyManager;1", Ci.sbIPropertyManager); services.add("propertyManager", "@songbirdnest.com/Songbird/Properties/PropertyManager;1", Ci.sbIPropertyManager);
services.addClass("mutablePropertyArray", "@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1", services.addClass("mutablePropertyArray", "@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1",
Ci.sbIMutablePropertyArray); Ci.sbIMutablePropertyArray);
} }
}); });

View File

@@ -1,52 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://melodactyl/skin/melodactyl.css" type="text/css"?>
<overlay id="melodactyl"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<menupopup id="viewSidebarMenu">
<menuitem observes="melodactyl-viewAddonsSidebar" label="Add-ons" accesskey="A"/>
<menuitem observes="melodactyl-viewConsoleSidebar" label="Console" accesskey="C"/>
<menuitem observes="melodactyl-viewDownloadsSidebar" label="Downloads" accesskey="D"/>
<menuitem observes="melodactyl-viewPreferencesSidebar" label="Preferences" accesskey="P"/>
</menupopup>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="melodactyl-viewAddonsSidebar"
autoCheck="false"
type="checkbox"
group="sidebar"
sidebarurl="chrome://mozapps/content/extensions/extensions.xul"
sidebartitle="Add-ons"
oncommand="toggleSidebar('melodactyl-viewAddonsSidebar');"/>
<broadcaster id="melodactyl-viewConsoleSidebar"
autoCheck="false"
type="checkbox"
group="sidebar"
sidebarurl="chrome://global/content/console.xul"
sidebartitle="Console"
oncommand="toggleSidebar('melodactyl-viewConsoleSidebar');"/>
<broadcaster id="melodactyl-viewDownloadsSidebar"
autoCheck="false"
type="checkbox"
group="sidebar"
sidebarurl="chrome://mozapps/content/downloads/downloads.xul"
sidebartitle="Downloads"
oncommand="toggleSidebar('melodactyl-viewDownloadsSidebar');"/>
<broadcaster id="melodactyl-viewPreferencesSidebar"
autoCheck="false"
type="checkbox"
group="sidebar"
sidebarurl="about:config"
sidebartitle="Preferences"
oncommand="toggleSidebar('melodactyl-viewPreferencesSidebar');"/>
</broadcasterset>
</overlay>
<!-- vim: set fdm=marker sw=4 ts=4 et: -->

View File

@@ -440,10 +440,36 @@ const Player = Module("player", {
} }
}, { }, {
}, { }, {
modes: function initModes(dactyl, modules, window) {
modes.addMode("SEARCH_VIEW", {
description: "Search View mode",
bases: [modes.COMMAND_LINE],
});
modes.addMode("SEARCH_VIEW_FORWARD", {
description: "Forward Search View mode",
bases: [modes.SEARCH_VIEW]
});
modes.addMode("SEARCH_VIEW_BACKWARD", {
description: "Backward Search View mode",
bases: [modes.SEARCH_VIEW]
});
},
commandline: function () { commandline: function () {
commandline.registerCallback("change", modes.SEARCH_VIEW_FORWARD, this.closure.onSearchKeyPress); player.CommandMode = Class("CommandSearchViewMode", modules.CommandMode, {
commandline.registerCallback("submit", modes.SEARCH_VIEW_FORWARD, this.closure.onSearchSubmit); init: function init(mode) {
commandline.registerCallback("cancel", modes.SEARCH_VIEW_FORWARD, this.closure.onSearchCancel); this.mode = mode;
init.supercall(this);
},
historyKey: "search-view",
get prompt() this.mode === modules.modes.SEARCH_VIEW_BACKWARD ? "?" : "/",
get onCancel() player.closure.onSearchCancel,
get onChange() player.closure.onSearchKeyPress,
get onSubmit() player.closure.onSearchSubmit
});
}, },
commands: function () { commands: function () {
commands.add(["f[ilter]"], commands.add(["f[ilter]"],
@@ -754,7 +780,7 @@ const Player = Module("player", {
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["/"], "Search forward for a track", ["/"], "Search forward for a track",
function () { commandline.open("/", "", modes.SEARCH_VIEW_FORWARD); }); function () { player.CommandMode(modes.SEARCH_VIEW_FORWARD).open(); });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["n"], "Find the next track", ["n"], "Find the next track",

View File

@@ -1,22 +0,0 @@
resource dactyl-local-content content/
resource dactyl-local-skin skin/
resource dactyl-local-locale locale/
resource dactyl ../common/modules/
resource dactyl-content ../common/content/
resource dactyl-skin ../common/skin/
resource dactyl-locale ../common/locale/
content dactyl ../common/content/
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
contract @mozilla.org/commandlinehandler/general-startup;1?type=dactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
category command-line-handler m-dactyl @mozilla.org/commandlinehandler/general-startup;1?type=dactyl
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}

1
pentadactyl/chrome.manifest Symbolic link
View File

@@ -0,0 +1 @@
../common/chrome.manifest

View File

@@ -32,8 +32,6 @@ var Config = Module("config", ConfigBase, {
checkupdates: ["Check for updates", checkupdates: ["Check for updates",
function () { window.checkForUpdates(); }, function () { window.checkForUpdates(); },
function () "checkForUpdates" in window], function () "checkForUpdates" in window],
cleardata: ["Clear private data",
function () { Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],
cookies: ["List your cookies", cookies: ["List your cookies",
function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }], function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
console: ["JavaScript console", console: ["JavaScript console",
@@ -80,8 +78,6 @@ var Config = Module("config", ConfigBase, {
function () "start_venkman" in window] function () "start_venkman" in window]
}, },
get visualbellWindow() this.browser.mPanelContainer,
removeTab: function removeTab(tab) { removeTab: function removeTab(tab) {
if (this.tabbrowser.mTabs.length > 1) if (this.tabbrowser.mTabs.length > 1)
this.tabbrowser.removeTab(tab); this.tabbrowser.removeTab(tab);

View File

@@ -1,22 +0,0 @@
resource dactyl-local-content content/
resource dactyl-local-skin skin/
resource dactyl-local-locale locale/
resource dactyl ../common/modules/
resource dactyl-content ../common/content/
resource dactyl-skin ../common/skin/
resource dactyl-locale ../common/locale/
content dactyl ../common/content/
component {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69} components/commandline-handler.js
contract @mozilla.org/commandlinehandler/general-startup;1?type=dactyl {16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}
category command-line-handler m-dactyl @mozilla.org/commandlinehandler/general-startup;1?type=dactyl
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}

1
teledactyl/chrome.manifest Symbolic link
View File

@@ -0,0 +1 @@
../common/chrome.manifest

View File

@@ -1,20 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK ***** {{{
Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
This work is licensed for reuse under an MIT license. Details are
given in the LICENSE.txt file included with this file.
}}} ***** END LICENSE BLOCK ***** -->
<!--?xml-stylesheet href="chrome://browser/skin/" type="text/css"?-->
<overlay id="teledactyl"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
</overlay>
<!-- vim: set fdm=marker sw=4 ts=4 et: -->