mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 09:27:58 +01:00
Fix some symlink woes. Closes issue #140.
--HG-- rename : common/components/about-handler.js => muttator/components/about-handler.js rename : common/components/commandline-handler.js => muttator/components/commandline-handler.js rename : common/components/about-handler.js => vimperator/components/about-handler.js rename : common/components/commandline-handler.js => vimperator/components/commandline-handler.js rename : common/components/about-handler.js => xulmus/components/about-handler.js rename : common/components/commandline-handler.js => xulmus/components/commandline-handler.js
This commit is contained in:
@@ -1919,6 +1919,9 @@ const liberator = (function () //{{{
|
||||
|
||||
liberator.log("All modules loaded", 3);
|
||||
|
||||
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=" + config.name.toLowerCase(),
|
||||
Ci.nsICommandLineHandler);
|
||||
|
||||
let commandline = services.get("commandLineHandler").wrappedJSObject.optionValue;
|
||||
if (commandline)
|
||||
{
|
||||
|
||||
48
common/modules/commandline-handler.jsm
Normal file
48
common/modules/commandline-handler.jsm
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
var EXPORTED_SYMBOLS = ["CommandLineHandler", "NSGetModule"];
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var CommandLineHandler;
|
||||
|
||||
function initCommandLineHandler(Name) {
|
||||
var name = Name.toLowerCase();
|
||||
CommandLineHandler = function CommandLineHandler()
|
||||
{
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
CommandLineHandler.prototype = {
|
||||
|
||||
classDescription: Name + " Command-line Handler",
|
||||
|
||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
||||
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
||||
|
||||
_xpcom_categories: [{
|
||||
category: "command-line-handler",
|
||||
entry: "m-" + name
|
||||
}],
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||
|
||||
handle: function (commandLine)
|
||||
{
|
||||
// TODO: handle remote launches differently?
|
||||
try
|
||||
{
|
||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
//"vimperator: option -vimperator requires an argument"
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
|
||||
|
||||
// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
|
||||
@@ -1 +0,0 @@
|
||||
../common/components
|
||||
43
muttator/components/about-handler.js
Normal file
43
muttator/components/about-handler.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// Header:
|
||||
const Name = "Muttator";
|
||||
// The following doesn't work here, so this module's code is sadly suplicated:
|
||||
// Components.utils.import("resource://liberator/about-handler.jsm");
|
||||
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const name = Name.toLowerCase();
|
||||
function AboutHandler() {}
|
||||
AboutHandler.prototype = {
|
||||
|
||||
classDescription: "About " + Name + " Page",
|
||||
|
||||
classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),
|
||||
|
||||
contractID: "@mozilla.org/network/protocol/about;1?what=" + name,
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
||||
|
||||
newChannel: function (uri)
|
||||
{
|
||||
let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
|
||||
.newChannel("chrome://" + name + "/content/about.html", null, null);
|
||||
|
||||
channel.originalURI = uri;
|
||||
|
||||
return channel;
|
||||
},
|
||||
|
||||
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler]);
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
49
muttator/components/commandline-handler.js
Normal file
49
muttator/components/commandline-handler.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// Header:
|
||||
const Name = "Muttator";
|
||||
// The following doesn't work here, so this module's code is sadly suplicated:
|
||||
// Components.utils.import("resource://liberator/commandline-handler.jsm");
|
||||
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const name = Name.toLowerCase();
|
||||
function CommandLineHandler()
|
||||
{
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
CommandLineHandler.prototype = {
|
||||
|
||||
classDescription: Name + " Command-line Handler",
|
||||
|
||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
||||
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
||||
|
||||
_xpcom_categories: [{
|
||||
category: "command-line-handler",
|
||||
entry: "m-" + name
|
||||
}],
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||
|
||||
handle: function (commandLine)
|
||||
{
|
||||
// TODO: handle remote launches differently?
|
||||
try
|
||||
{
|
||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
//"vimperator: option -vimperator requires an argument"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
|
||||
|
||||
// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
|
||||
@@ -175,9 +175,6 @@ const config = (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
|
||||
// GetThreadTree()._selectDelay = 300; // TODO: make configurable
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../common/components
|
||||
43
vimperator/components/about-handler.js
Normal file
43
vimperator/components/about-handler.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// Header:
|
||||
const Name = "Vimperator";
|
||||
// The following doesn't work here, so this module's code is sadly suplicated:
|
||||
// Components.utils.import("resource://liberator/about-handler.jsm");
|
||||
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const name = Name.toLowerCase();
|
||||
function AboutHandler() {}
|
||||
AboutHandler.prototype = {
|
||||
|
||||
classDescription: "About " + Name + " Page",
|
||||
|
||||
classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),
|
||||
|
||||
contractID: "@mozilla.org/network/protocol/about;1?what=" + name,
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
||||
|
||||
newChannel: function (uri)
|
||||
{
|
||||
let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
|
||||
.newChannel("chrome://" + name + "/content/about.html", null, null);
|
||||
|
||||
channel.originalURI = uri;
|
||||
|
||||
return channel;
|
||||
},
|
||||
|
||||
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler]);
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
49
vimperator/components/commandline-handler.js
Normal file
49
vimperator/components/commandline-handler.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// Header:
|
||||
const Name = "Vimperator";
|
||||
// The following doesn't work here, so this module's code is sadly suplicated:
|
||||
// Components.utils.import("resource://liberator/commandline-handler.jsm");
|
||||
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const name = Name.toLowerCase();
|
||||
function CommandLineHandler()
|
||||
{
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
CommandLineHandler.prototype = {
|
||||
|
||||
classDescription: Name + " Command-line Handler",
|
||||
|
||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
||||
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
||||
|
||||
_xpcom_categories: [{
|
||||
category: "command-line-handler",
|
||||
entry: "m-" + name
|
||||
}],
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||
|
||||
handle: function (commandLine)
|
||||
{
|
||||
// TODO: handle remote launches differently?
|
||||
try
|
||||
{
|
||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
//"vimperator: option -vimperator requires an argument"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
|
||||
|
||||
// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
|
||||
@@ -128,9 +128,6 @@ const config = { //{{{
|
||||
|
||||
init: function ()
|
||||
{
|
||||
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=vimperator",
|
||||
Ci.nsICommandLineHandler);
|
||||
|
||||
// load Vimperator specific modules
|
||||
// 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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../common/components
|
||||
@@ -1,3 +1,8 @@
|
||||
// Header:
|
||||
const Name = "Xulmus";
|
||||
// The following doesn't work here, so this module's code is sadly suplicated:
|
||||
// Components.utils.import("resource://liberator/about-handler.jsm");
|
||||
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
@@ -8,22 +13,22 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const name = Name.toLowerCase();
|
||||
function AboutHandler() {}
|
||||
|
||||
AboutHandler.prototype = {
|
||||
|
||||
classDescription: "About Vimperator Page",
|
||||
classDescription: "About " + Name + " Page",
|
||||
|
||||
classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),
|
||||
|
||||
contractID: "@mozilla.org/network/protocol/about;1?what=vimperator",
|
||||
contractID: "@mozilla.org/network/protocol/about;1?what=" + name,
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
||||
|
||||
newChannel: function (uri)
|
||||
{
|
||||
let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
|
||||
.newChannel("chrome://vimperator/content/about.html", null, null);
|
||||
.newChannel("chrome://" + name + "/content/about.html", null, null);
|
||||
|
||||
channel.originalURI = uri;
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
// Header:
|
||||
const Name = "Xulmus";
|
||||
// The following doesn't work here, so this module's code is sadly suplicated:
|
||||
// Components.utils.import("resource://liberator/commandline-handler.jsm");
|
||||
|
||||
// Copyright (c) 2009 by Doug Kearns
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const name = Name.toLowerCase();
|
||||
function CommandLineHandler()
|
||||
{
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
CommandLineHandler.prototype = {
|
||||
|
||||
classDescription: "Vimperator Command-line Handler",
|
||||
classDescription: Name + " Command-line Handler",
|
||||
|
||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
||||
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=vimperator",
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
||||
|
||||
_xpcom_categories: [{
|
||||
category: "command-line-handler",
|
||||
entry: "m-vimperator"
|
||||
entry: "m-" + name
|
||||
}],
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||
@@ -31,7 +35,7 @@ CommandLineHandler.prototype = {
|
||||
// TODO: handle remote launches differently?
|
||||
try
|
||||
{
|
||||
this.optionValue = commandLine.handleFlagWithParam("vimperator", false);
|
||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
@@ -42,4 +46,4 @@ CommandLineHandler.prototype = {
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
|
||||
@@ -163,9 +163,6 @@ const config = { //{{{
|
||||
|
||||
init: function ()
|
||||
{
|
||||
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=xulmus",
|
||||
Ci.nsICommandLineHandler);
|
||||
|
||||
// Adding a mode for Player
|
||||
//modes.addMode("PLAYER"); // Player mode for songbird
|
||||
|
||||
|
||||
Reference in New Issue
Block a user