mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 17:05:46 +01:00
Merge default.
--HG-- branch : mode-refactoring
This commit is contained in:
@@ -1025,6 +1025,25 @@ const Dactyl = Module("dactyl", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
wrapCallback: function (callback, self) {
|
||||||
|
self = self || this;
|
||||||
|
let save = ["forceNewTab", "forceNewWindow"];
|
||||||
|
let saved = save.map(function (p) dactyl[p]);
|
||||||
|
return function wrappedCallback() {
|
||||||
|
let vals = save.map(function (p) dactyl[p]);
|
||||||
|
saved.forEach(function (p, i) dactyl[save[i]] = p);
|
||||||
|
try {
|
||||||
|
return callback.apply(self, arguments);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
dactyl.reportError(e, true);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
vals.forEach(function (p, i) dactyl[save[i]] = p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {Window[]} Returns an array of all the host application's
|
* @property {Window[]} Returns an array of all the host application's
|
||||||
* open windows.
|
* open windows.
|
||||||
@@ -1415,6 +1434,34 @@ const Dactyl = Module("dactyl", {
|
|||||||
onInstallFailed: listener("installation", "failed")
|
onInstallFailed: listener("installation", "failed")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateAddons = Class("UpgradeListener", {
|
||||||
|
init: function init(addons) {
|
||||||
|
this.remaining = addons;
|
||||||
|
this.upgrade = [];
|
||||||
|
dactyl.echomsg("Checking updates for addons: " + addons.map(function (a) a.name).join(", "));
|
||||||
|
for (let addon in values(addons))
|
||||||
|
addon.findUpdates(this, AddonManager.UPDATE_WHEN_USER_REQUESTED, null, null);
|
||||||
|
},
|
||||||
|
addonListener: {
|
||||||
|
__proto__: addonListener,
|
||||||
|
onDownloadStarted: function () {},
|
||||||
|
onDownloadEnded: function () {}
|
||||||
|
},
|
||||||
|
onUpdateAvailable: function (addon, install) {
|
||||||
|
this.upgrade.push(addon);
|
||||||
|
install.addListener(this.addonListener);
|
||||||
|
install.install();
|
||||||
|
},
|
||||||
|
onUpdateFinished: function (addon, error) {
|
||||||
|
this.remaining = this.remaining.filter(function (a) a != addon);
|
||||||
|
if (!this.remaining.length)
|
||||||
|
dactyl.echomsg(
|
||||||
|
this.upgrade.length
|
||||||
|
? "Installing updates for addons: " + this.upgrade.map(function (i) i.name).join(", ")
|
||||||
|
: "No addon updates found");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
function callResult(method) {
|
function callResult(method) {
|
||||||
@@ -1470,6 +1517,13 @@ const Dactyl = Module("dactyl", {
|
|||||||
action: function (addon) addon.userDisabled = true,
|
action: function (addon) addon.userDisabled = true,
|
||||||
filter: function ({ item }) !item.userDisabled,
|
filter: function ({ item }) !item.userDisabled,
|
||||||
perm: "disable"
|
perm: "disable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "extu[update]",
|
||||||
|
description: "Update an extension",
|
||||||
|
actions: updateAddons,
|
||||||
|
filter: function ({ item }) !item.userDisabled,
|
||||||
|
perm: "upgrade"
|
||||||
}
|
}
|
||||||
].forEach(function (command) {
|
].forEach(function (command) {
|
||||||
let perm = AddonManager["PERM_CAN_" + command.perm.toUpperCase()];
|
let perm = AddonManager["PERM_CAN_" + command.perm.toUpperCase()];
|
||||||
@@ -1483,13 +1537,16 @@ const Dactyl = Module("dactyl", {
|
|||||||
else
|
else
|
||||||
dactyl.assert(name, "E471: Argument required");
|
dactyl.assert(name, "E471: Argument required");
|
||||||
|
|
||||||
AddonManager.getAddonsByTypes(["extension"], function (list) {
|
AddonManager.getAddonsByTypes(["extension"], dactyl.wrapCallback(function (list) {
|
||||||
if (!args.bang)
|
if (!args.bang)
|
||||||
list = list.filter(function (extension) extension.name == name);
|
list = list.filter(function (extension) extension.name == name);
|
||||||
if (!args.bang && !list.every(ok))
|
if (!args.bang && !list.every(ok))
|
||||||
return dactyl.echoerr("Permission denied");
|
return dactyl.echoerr("Permission denied");
|
||||||
list.forEach(command.action);
|
if (command.actions)
|
||||||
});
|
command.actions(list);
|
||||||
|
else
|
||||||
|
list.forEach(command.action);
|
||||||
|
}));
|
||||||
}, {
|
}, {
|
||||||
argCount: "?", // FIXME: should be "1"
|
argCount: "?", // FIXME: should be "1"
|
||||||
bang: true,
|
bang: true,
|
||||||
@@ -1506,16 +1563,15 @@ const Dactyl = Module("dactyl", {
|
|||||||
commands.add(["exto[ptions]", "extp[references]"],
|
commands.add(["exto[ptions]", "extp[references]"],
|
||||||
"Open an extension's preference dialog",
|
"Open an extension's preference dialog",
|
||||||
function (args) {
|
function (args) {
|
||||||
let tab = dactyl.forceNewTab;
|
AddonManager.getAddonsByTypes(["extension"], dactyl.wrapCallback(function (list) {
|
||||||
AddonManager.getAddonsByTypes(["extension"], function (list) {
|
|
||||||
list = list.filter(function (extension) extension.name == args[0]);
|
list = list.filter(function (extension) extension.name == args[0]);
|
||||||
if (!list.length || !list[0].optionsURL)
|
if (!list.length || !list[0].optionsURL)
|
||||||
dactyl.echoerr("E474: Invalid argument");
|
dactyl.echoerr("E474: Invalid argument");
|
||||||
else if (args.bang)
|
else if (args.bang)
|
||||||
window.openDialog(list[0].optionsURL, "_blank", "chrome");
|
window.openDialog(list[0].optionsURL, "_blank", "chrome");
|
||||||
else
|
else
|
||||||
dactyl.open(list[0].optionsURL, { from: "extoptions", where: tab && dactyl.NEW_TAB });
|
dactyl.open(list[0].optionsURL, { from: "extoptions" });
|
||||||
});
|
}));
|
||||||
}, {
|
}, {
|
||||||
argCount: "1",
|
argCount: "1",
|
||||||
bang: true,
|
bang: true,
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<tags>:exta :extadd</tags>
|
<tags>:exta :extadd</tags>
|
||||||
<spec>:exta<oa>dd</oa> <a>file|url</a></spec>
|
<spec>:exta<oa>dd</oa> <a>file|url</a></spec>
|
||||||
|
<strut/>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Install an extension. <a>file|uri</a> must be the local file
|
Install an extension. <a>file|uri</a> must be the local file
|
||||||
@@ -93,6 +94,7 @@
|
|||||||
<tags>:extde :extdelete</tags>
|
<tags>:extde :extdelete</tags>
|
||||||
<spec>:extde<oa>lete</oa> <a>extension</a></spec>
|
<spec>:extde<oa>lete</oa> <a>extension</a></spec>
|
||||||
<spec>:extde<oa>lete</oa>!</spec>
|
<spec>:extde<oa>lete</oa>!</spec>
|
||||||
|
<strut/>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Uninstall an extension. <a>extension</a> is the extension's name. When <oa>!</oa> is given
|
Uninstall an extension. <a>extension</a> is the extension's name. When <oa>!</oa> is given
|
||||||
@@ -105,6 +107,7 @@
|
|||||||
<tags>:extd :extdisable</tags>
|
<tags>:extd :extdisable</tags>
|
||||||
<spec>:extd<oa>isable</oa> <a>extension</a></spec>
|
<spec>:extd<oa>isable</oa> <a>extension</a></spec>
|
||||||
<spec>:extd<oa>isable</oa>!</spec>
|
<spec>:extd<oa>isable</oa>!</spec>
|
||||||
|
<strut/>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Disable an extension. <a>extension</a> is the extension's name. When <oa>!</oa> is given
|
Disable an extension. <a>extension</a> is the extension's name. When <oa>!</oa> is given
|
||||||
@@ -117,6 +120,7 @@
|
|||||||
<tags>:exte :extenable</tags>
|
<tags>:exte :extenable</tags>
|
||||||
<spec>:exte<oa>nable</oa> <a>extension</a></spec>
|
<spec>:exte<oa>nable</oa> <a>extension</a></spec>
|
||||||
<spec>:exte<oa>nable</oa>!</spec>
|
<spec>:exte<oa>nable</oa>!</spec>
|
||||||
|
<strut/>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Enable an extension. <a>extension</a> is the extension's name. When <oa>!</oa> is given all
|
Enable an extension. <a>extension</a> is the extension's name. When <oa>!</oa> is given all
|
||||||
@@ -129,6 +133,7 @@
|
|||||||
<tags>:exts :extens :extensions</tags>
|
<tags>:exts :extens :extensions</tags>
|
||||||
<spec>:extens<oa>ions</oa></spec>
|
<spec>:extens<oa>ions</oa></spec>
|
||||||
<spec>:exts</spec>
|
<spec>:exts</spec>
|
||||||
|
<strut/>
|
||||||
<description>
|
<description>
|
||||||
<p>List all installed extensions.</p>
|
<p>List all installed extensions.</p>
|
||||||
</description>
|
</description>
|
||||||
@@ -147,6 +152,17 @@
|
|||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<tags>:extu :extupdate</tags>
|
||||||
|
<spec>:extu<oa>pdate</oa><oa>!</oa> <a>extension</a></spec>
|
||||||
|
<description>
|
||||||
|
<p>
|
||||||
|
Update an extension. When <oa>!</oa> is given, update all
|
||||||
|
extensions.
|
||||||
|
</p>
|
||||||
|
</description>
|
||||||
|
</item>
|
||||||
|
|
||||||
<h2 tag="sidebar">Sidebar</h2>
|
<h2 tag="sidebar">Sidebar</h2>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
* Added BookmarkChange, BookmarkRemove autocommands.
|
* Added BookmarkChange, BookmarkRemove autocommands.
|
||||||
* Added -keyword, -tags, -title to :delbmarks.
|
* Added -keyword, -tags, -title to :delbmarks.
|
||||||
* Added "passwords" and "venkman" dialogs to :dialog.
|
* Added "passwords" and "venkman" dialogs to :dialog.
|
||||||
|
* Added :extupdate command
|
||||||
* Added 'hintkeys' option.
|
* Added 'hintkeys' option.
|
||||||
* Added "transliterated" option to 'hintmatching'.
|
* Added "transliterated" option to 'hintmatching'.
|
||||||
* Replaced 'focuscontent' with 'strictfocus'.
|
* Replaced 'focuscontent' with 'strictfocus'.
|
||||||
|
|||||||
@@ -6,10 +6,25 @@
|
|||||||
em:name="Pentadactyl"
|
em:name="Pentadactyl"
|
||||||
em:version="1.0b3pre"
|
em:version="1.0b3pre"
|
||||||
em:description="Firefox for Vim and Links addicts"
|
em:description="Firefox for Vim and Links addicts"
|
||||||
em:creator="Kris Maglione"
|
|
||||||
em:homepageURL="http://dactyl.sourceforge.net/pentadactyl"
|
em:homepageURL="http://dactyl.sourceforge.net/pentadactyl"
|
||||||
em:iconURL="chrome://pentadactyl/skin/icon.png"
|
em:iconURL="chrome://pentadactyl/skin/icon.png"
|
||||||
em:optionsURL="chrome://dactyl/content/preferences.xul">
|
em:optionsURL="chrome://dactyl/content/preferences.xul">
|
||||||
|
|
||||||
|
<em:creator>Kris Maglione, Doug Kearns</em:creator>
|
||||||
|
<em:developer>Štěpán Němec</em:developer>
|
||||||
|
|
||||||
|
<em:contributor>anekos</em:contributor>
|
||||||
|
<em:contributor>teramako</em:contributor>
|
||||||
|
<em:contributor>Viktor Kojouharov (Виктор Кожухаров)</em:contributor>
|
||||||
|
<em:contributor>Marco Candrian</em:contributor>
|
||||||
|
<em:contributor>Daniel Bainton</em:contributor>
|
||||||
|
<em:contributor>Konstantin Stepanov</em:contributor>
|
||||||
|
<em:contributor>Tim Hammerquist</em:contributor>
|
||||||
|
<em:contributor>Ted Pavlic</em:contributor>
|
||||||
|
<em:contributor>janus_wel</em:contributor>
|
||||||
|
<em:contributor>Martin Stubenschrott</em:contributor>
|
||||||
|
<em:contributor>Conrad Irwin</em:contributor>
|
||||||
|
|
||||||
<em:targetApplication>
|
<em:targetApplication>
|
||||||
<Description
|
<Description
|
||||||
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
|
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
|
||||||
|
|||||||
Reference in New Issue
Block a user