mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-09 00:04:11 +01:00
Check for the existence of certain dialogs. Closes issue #129.
This commit is contained in:
@@ -1319,6 +1319,8 @@ const Dactyl = Module("dactyl", {
|
||||
let dialog = args[0];
|
||||
|
||||
dactyl.assert(dialog in config.dialogs, "E475: Invalid argument: " + dialog);
|
||||
dactyl.assert(!config.dialogs[dialog][2] || config.dialogs[dialog][2](),
|
||||
"Dialog " + dialog + " not available");
|
||||
try {
|
||||
config.dialogs[dialog][1]();
|
||||
}
|
||||
@@ -1916,7 +1918,8 @@ const Dactyl = Module("dactyl", {
|
||||
completion: function () {
|
||||
completion.dialog = function dialog(context) {
|
||||
context.title = ["Dialog"];
|
||||
context.completions = [[k, v[0]] for ([k, v] in Iterator(config.dialogs))];
|
||||
context.filters.push(function ({ item }) !item[2] || item[2]());
|
||||
context.completions = [[k, v[0], v[2]] for ([k, v] in Iterator(config.dialogs))];
|
||||
};
|
||||
|
||||
completion.extension = function extension(context) {
|
||||
|
||||
@@ -46,7 +46,8 @@ const Config = Module("config", ConfigBase, {
|
||||
bookmarks: ["List your bookmarks",
|
||||
function () { window.openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }],
|
||||
checkupdates: ["Check for updates",
|
||||
function () { window.checkForUpdates(); }],
|
||||
function () { window.checkForUpdates(); },
|
||||
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",
|
||||
@@ -56,7 +57,8 @@ const Config = Module("config", ConfigBase, {
|
||||
customizetoolbar: ["Customize the Toolbar",
|
||||
function () { window.BrowserCustomizeToolbar(); }],
|
||||
dominspector: ["DOM Inspector",
|
||||
function () { try { window.inspectDOMDocument(content.document); } catch (e) { dactyl.echoerr("DOM Inspector extension not installed"); } }],
|
||||
function () { window.inspectDOMDocument(content.document); },
|
||||
function () "inspectDOMDocument" in window],
|
||||
downloads: ["Manage Downloads",
|
||||
function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }],
|
||||
history: ["List your history",
|
||||
@@ -90,7 +92,8 @@ const Config = Module("config", ConfigBase, {
|
||||
selectionsource: ["View selection source",
|
||||
function () { buffer.viewSelectionSource(); }],
|
||||
venkman: ["The JavaScript debugger",
|
||||
function () { dactyl.assert("start_venkman" in window, "Venkman is not installed"); start_venkman() }]
|
||||
function () { dactyl.assert("start_venkman" in window, "Venkman is not installed"); start_venkman() },
|
||||
function () "start_venkman" in window]
|
||||
},
|
||||
|
||||
features: [
|
||||
|
||||
Reference in New Issue
Block a user