mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 07:28:00 +01:00
Rename -liberator command-line option to -[config-name].
This commit is contained in:
@@ -1,87 +0,0 @@
|
|||||||
/* Adds support for data: URIs with chrome privileges
|
|
||||||
* and fragment identifiers.
|
|
||||||
*
|
|
||||||
* "chrome-data:" <content-type> [; <flag>]* "," [<data>]
|
|
||||||
*
|
|
||||||
* By Kris Maglione, ideas from Ed Anuff's nsChromeExtensionHandler.
|
|
||||||
*
|
|
||||||
* Licenced under the MIT License, which allows for sublicensing
|
|
||||||
* under any compatible license, including the GNU GPL and the MPL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
|
|
||||||
const NS_BINDING_ABORTED = 0x804b0002;
|
|
||||||
const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler;
|
|
||||||
|
|
||||||
const ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
|
||||||
.getService(Components.interfaces.nsIIOService);
|
|
||||||
|
|
||||||
let channel = Components.classesByID["{61ba33c0-3031-11d3-8cd0-0060b0fc14a3}"]
|
|
||||||
.getService(Components.interfaces.nsIProtocolHandler)
|
|
||||||
.newChannel(ioService.newURI("chrome://liberator/content/data", null, null))
|
|
||||||
.QueryInterface(Components.interfaces.nsIRequest);
|
|
||||||
const systemPrincipal = channel.owner;
|
|
||||||
channel.cancel(NS_BINDING_ABORTED);
|
|
||||||
delete channel;
|
|
||||||
|
|
||||||
var instance;
|
|
||||||
function ChromeData() {}
|
|
||||||
ChromeData.prototype = {
|
|
||||||
contractID: "@mozilla.org/network/protocol;1?name=chrome-data",
|
|
||||||
classID: Components.ID("{c1b67a07-18f7-4e13-b361-2edcc35a5a0d}"),
|
|
||||||
classDescription: "Data URIs with chrome privileges",
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
|
|
||||||
_xpcom_factory: {
|
|
||||||
createInstance: function (outer, iid)
|
|
||||||
{
|
|
||||||
if (!instance)
|
|
||||||
instance = new ChromeData();
|
|
||||||
if (outer != null)
|
|
||||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
|
||||||
return instance.QueryInterface(iid);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
scheme: "chrome-data",
|
|
||||||
defaultPort: -1,
|
|
||||||
allowPort: function (port, scheme) false,
|
|
||||||
protocolFlags: nsIProtocolHandler.URI_NORELATIVE
|
|
||||||
| nsIProtocolHandler.URI_NOAUTH
|
|
||||||
| nsIProtocolHandler.URI_IS_UI_RESOURCE,
|
|
||||||
|
|
||||||
newURI: function (spec, charset, baseURI)
|
|
||||||
{
|
|
||||||
var uri = Components.classes["@mozilla.org/network/standard-url;1"]
|
|
||||||
.createInstance(Components.interfaces.nsIStandardURL)
|
|
||||||
.QueryInterface(Components.interfaces.nsIURI);
|
|
||||||
uri.init(1, -1, spec, charset, null);
|
|
||||||
return uri;
|
|
||||||
},
|
|
||||||
|
|
||||||
newChannel: function (uri)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (uri.scheme == this.scheme)
|
|
||||||
{
|
|
||||||
let newURI = ioService.newURI(uri.spec.replace(/^.*?:\/*(.*)(?:#.*)?/, "data:$1"), null, null);
|
|
||||||
let channel = ioService.newChannelFromURI(newURI);
|
|
||||||
channel.owner = systemPrincipal;
|
|
||||||
channel.originalURI = uri;
|
|
||||||
return channel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
throw Components.results.NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var components = [ChromeData];
|
|
||||||
|
|
||||||
function NSGetModule(compMgr, fileSpec)
|
|
||||||
{
|
|
||||||
return XPCOMUtils.generateModule(components);
|
|
||||||
}
|
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
|
|
||||||
function CommandLineHandler()
|
|
||||||
{
|
|
||||||
this.wrappedJSObject = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
CommandLineHandler.prototype = {
|
|
||||||
|
|
||||||
classDescription: "Liberator Command-line Handler",
|
|
||||||
|
|
||||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
|
||||||
|
|
||||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=liberator",
|
|
||||||
|
|
||||||
_xpcom_categories: [{
|
|
||||||
category: "command-line-handler",
|
|
||||||
entry: "m-liberator"
|
|
||||||
}],
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
|
||||||
|
|
||||||
handle: function (commandLine)
|
|
||||||
{
|
|
||||||
// TODO: handle remote launches differently?
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.optionValue = commandLine.handleFlagWithParam("liberator", false);
|
|
||||||
}
|
|
||||||
catch (e)
|
|
||||||
{
|
|
||||||
//"liberator: option -liberator requires an argument"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
|
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
|
||||||
@@ -93,7 +93,6 @@ function Services()
|
|||||||
self.add("autoCompleteSearch", "@mozilla.org/autocomplete/search;1?name=history", Ci.nsIAutoCompleteSearch);
|
self.add("autoCompleteSearch", "@mozilla.org/autocomplete/search;1?name=history", Ci.nsIAutoCompleteSearch);
|
||||||
self.add("browserSearch", "@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService);
|
self.add("browserSearch", "@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService);
|
||||||
self.add("cache", "@mozilla.org/network/cache-service;1", Ci.nsICacheService);
|
self.add("cache", "@mozilla.org/network/cache-service;1", Ci.nsICacheService);
|
||||||
self.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=liberator", Ci.nsICommandLineHandler);
|
|
||||||
self.add("console", "@mozilla.org/consoleservice;1", Ci.nsIConsoleService);
|
self.add("console", "@mozilla.org/consoleservice;1", Ci.nsIConsoleService);
|
||||||
self.add("directory", "@mozilla.org/file/directory_service;1", Ci.nsIProperties);
|
self.add("directory", "@mozilla.org/file/directory_service;1", Ci.nsIProperties);
|
||||||
self.add("environment", "@mozilla.org/process/environment;1", Ci.nsIEnvironment);
|
self.add("environment", "@mozilla.org/process/environment;1", Ci.nsIEnvironment);
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ function CommandLineHandler()
|
|||||||
|
|
||||||
CommandLineHandler.prototype = {
|
CommandLineHandler.prototype = {
|
||||||
|
|
||||||
classDescription: "Liberator Command-line Handler",
|
classDescription: "Muttator Command-line Handler",
|
||||||
|
|
||||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
classID: Components.ID("{6e03e01a-3e2c-4a59-ac45-f1b4efb02ddb}"),
|
||||||
|
|
||||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=liberator",
|
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=muttator",
|
||||||
|
|
||||||
_xpcom_categories: [{
|
_xpcom_categories: [{
|
||||||
category: "command-line-handler",
|
category: "command-line-handler",
|
||||||
entry: "m-liberator"
|
entry: "m-muttator"
|
||||||
}],
|
}],
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||||
@@ -25,11 +25,11 @@ CommandLineHandler.prototype = {
|
|||||||
// TODO: handle remote launches differently?
|
// TODO: handle remote launches differently?
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.optionValue = commandLine.handleFlagWithParam("liberator", false);
|
this.optionValue = commandLine.handleFlagWithParam("muttator", false);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
//"liberator: option -liberator requires an argument"
|
//"muttator: option -muttator requires an argument"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -197,6 +197,9 @@ const config = (function () //{{{
|
|||||||
|
|
||||||
init: function ()
|
init: function ()
|
||||||
{
|
{
|
||||||
|
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=muttator",
|
||||||
|
Ci.nsICommandLineHandler);
|
||||||
|
|
||||||
// don't wait too long when selecting new messages
|
// don't wait too long when selecting new messages
|
||||||
// GetThreadTree()._selectDelay = 300; // TODO: make configurable
|
// GetThreadTree()._selectDelay = 300; // TODO: make configurable
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ ARCHITECTURE:
|
|||||||
- modular help system
|
- modular help system
|
||||||
- I made a quick attempt at parameterizing it using attributes but it
|
- I made a quick attempt at parameterizing it using attributes but it
|
||||||
breaks Asciidoc formatting in certain unpredictable (to me at least)
|
breaks Asciidoc formatting in certain unpredictable (to me at least)
|
||||||
contexts. *sigh* --djk
|
contexts. --djk
|
||||||
- move as much as possible to common/*
|
- move as much as possible to common/*
|
||||||
- decide on how to document Arrays in our jsdoc(ish) documentation. Is there
|
- decide on how to document Arrays in our jsdoc(ish) documentation. Is there
|
||||||
even a documentation tool that can parse our source sensibly?
|
even a documentation tool that can parse our source sensibly?
|
||||||
|
- update build system to generate config specific components from templates in
|
||||||
|
common/components/* and copy others -
|
||||||
|
a739cdeab8f1648fd771f17d8a4885533032376f attempt at linking didn't work.
|
||||||
|
|
||||||
BUGS:
|
BUGS:
|
||||||
- add window resize support to hints
|
- add window resize support to hints
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ function CommandLineHandler()
|
|||||||
|
|
||||||
CommandLineHandler.prototype = {
|
CommandLineHandler.prototype = {
|
||||||
|
|
||||||
classDescription: "Liberator Command-line Handler",
|
classDescription: "Vimperator Command-line Handler",
|
||||||
|
|
||||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
||||||
|
|
||||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=liberator",
|
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=vimperator",
|
||||||
|
|
||||||
_xpcom_categories: [{
|
_xpcom_categories: [{
|
||||||
category: "command-line-handler",
|
category: "command-line-handler",
|
||||||
entry: "m-liberator"
|
entry: "m-vimperator"
|
||||||
}],
|
}],
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||||
@@ -25,11 +25,11 @@ CommandLineHandler.prototype = {
|
|||||||
// TODO: handle remote launches differently?
|
// TODO: handle remote launches differently?
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.optionValue = commandLine.handleFlagWithParam("liberator", false);
|
this.optionValue = commandLine.handleFlagWithParam("vimperator", false);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
//"liberator: option -liberator requires an argument"
|
//"vimperator: option -vimperator requires an argument"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ const config = { //{{{
|
|||||||
|
|
||||||
init: function ()
|
init: function ()
|
||||||
{
|
{
|
||||||
|
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=vimperator",
|
||||||
|
Ci.nsICommandLineHandler);
|
||||||
|
|
||||||
// load Vimperator specific modules
|
// load Vimperator specific modules
|
||||||
// FIXME: Why aren't these listed in config.scripts?
|
// FIXME: Why aren't these listed in config.scripts?
|
||||||
// FIXME: Why isn't this automatic? -> how would one know which classes to load where? --mst
|
// FIXME: Why isn't this automatic? -> how would one know which classes to load where? --mst
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ heading::Starting{nbsp}Vimperator[starting]
|
|||||||
|
|
||||||
|startup-options| +
|
|startup-options| +
|
||||||
|
|
||||||
Command-line options can be passed to Vimperator via the -liberator Firefox
|
Command-line options can be passed to Vimperator via the -vimperator Firefox
|
||||||
option. These are passed as single string argument.
|
option. These are passed as single string argument.
|
||||||
E.g firefox -liberator "$$++cmd='set exrc' +u='tempRcFile' ++noplugin$$"
|
E.g firefox -vimperator "$$++cmd 'set exrc' +u 'tempRcFile' ++noplugin$$"
|
||||||
|
|
||||||
|+c| +
|
|+c| +
|
||||||
||+c={command}||
|
||+c {command}||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Execute a single Ex command after all initialization has been performed. See
|
Execute a single Ex command after all initialization has been performed. See
|
||||||
[j]initialization[j].
|
[j]initialization[j].
|
||||||
@@ -17,7 +17,7 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
|
|
||||||
|$$++cmd$$| +
|
|$$++cmd$$| +
|
||||||
||$$++cmd={command}$$||
|
||$$++cmd {command}$$||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Execute a single Ex command before any initialization has been performed. See
|
Execute a single Ex command before any initialization has been performed. See
|
||||||
[j]initialization[j].
|
[j]initialization[j].
|
||||||
@@ -27,7 +27,7 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
|
|
||||||
|+u| +
|
|+u| +
|
||||||
||+u={rcfile}||
|
||+u {rcfile}||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
The file {rcfile} is used for user initialization commands. If {rcfile} is
|
The file {rcfile} is used for user initialization commands. If {rcfile} is
|
||||||
"NORC" then no startup initialization is performed except for the loading of
|
"NORC" then no startup initialization is performed except for the loading of
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ function CommandLineHandler()
|
|||||||
|
|
||||||
CommandLineHandler.prototype = {
|
CommandLineHandler.prototype = {
|
||||||
|
|
||||||
classDescription: "Liberator Command-line Handler",
|
classDescription: "Xulmus Command-line Handler",
|
||||||
|
|
||||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
classID: Components.ID("{155807a6-02da-4812-981c-e910aa7eba42}"),
|
||||||
|
|
||||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=liberator",
|
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=xulmus",
|
||||||
|
|
||||||
_xpcom_categories: [{
|
_xpcom_categories: [{
|
||||||
category: "command-line-handler",
|
category: "command-line-handler",
|
||||||
entry: "m-liberator"
|
entry: "m-xulmus"
|
||||||
}],
|
}],
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||||
@@ -25,11 +25,11 @@ CommandLineHandler.prototype = {
|
|||||||
// TODO: handle remote launches differently?
|
// TODO: handle remote launches differently?
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.optionValue = commandLine.handleFlagWithParam("liberator", false);
|
this.optionValue = commandLine.handleFlagWithParam("xulmus", false);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
//"liberator: option -liberator requires an argument"
|
//"xulmus: option -xulmus requires an argument"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -196,6 +196,9 @@ const config = { //{{{
|
|||||||
|
|
||||||
init: function ()
|
init: function ()
|
||||||
{
|
{
|
||||||
|
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=xulmus",
|
||||||
|
Ci.nsICommandLineHandler);
|
||||||
|
|
||||||
// Adding a mode for Player
|
// Adding a mode for Player
|
||||||
//modes.addMode("PLAYER"); // Player mode for songbird
|
//modes.addMode("PLAYER"); // Player mode for songbird
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ heading::Starting{nbsp}Xulmus[starting]
|
|||||||
|
|
||||||
|startup-options| +
|
|startup-options| +
|
||||||
|
|
||||||
Command-line options can be passed to Xulmus via the -liberator Firefox
|
Command-line options can be passed to Xulmus via the -xulmus Songbird
|
||||||
option. These are passed as single string argument.
|
option. These are passed as single string argument.
|
||||||
E.g firefox -liberator "$$++cmd='set exrc' +u='tempRcFile' ++noplugin$$"
|
E.g songbird -xulmus "$$++cmd 'set exrc' +u 'tempRcFile' ++noplugin$$"
|
||||||
|
|
||||||
|+c| +
|
|+c| +
|
||||||
||+c={command}||
|
||+c {command}||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Execute a single Ex command after all initialization has been performed. See
|
Execute a single Ex command after all initialization has been performed. See
|
||||||
[j]initialization[j].
|
[j]initialization[j].
|
||||||
@@ -17,7 +17,7 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
|
|
||||||
|$$++cmd$$| +
|
|$$++cmd$$| +
|
||||||
||$$++cmd={command}$$||
|
||$$++cmd {command}$$||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Execute a single Ex command before any initialization has been performed. See
|
Execute a single Ex command before any initialization has been performed. See
|
||||||
[j]initialization[j].
|
[j]initialization[j].
|
||||||
@@ -27,7 +27,7 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
|
|
||||||
|+u| +
|
|+u| +
|
||||||
||+u={rcfile}||
|
||+u {rcfile}||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
The file {rcfile} is used for user initialization commands. If {rcfile} is
|
The file {rcfile} is used for user initialization commands. If {rcfile} is
|
||||||
"NORC" then no startup initialization is performed except for the loading of
|
"NORC" then no startup initialization is performed except for the loading of
|
||||||
|
|||||||
Reference in New Issue
Block a user