mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 18:47:58 +01:00
Make the silly ':hi Bell display:none;' hack function again.
This commit is contained in:
@@ -1583,19 +1583,11 @@ const CommandLine = Module("commandline", {
|
||||
if (!arg)
|
||||
return "";
|
||||
|
||||
try {
|
||||
arg = dactyl.userEval(arg);
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.echoerr(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (typeof arg === "object")
|
||||
if (isObject(arg))
|
||||
arg = util.objectToString(arg, useColor);
|
||||
else
|
||||
arg = String(arg);
|
||||
|
||||
return arg;
|
||||
}
|
||||
}, {
|
||||
@@ -1620,9 +1612,7 @@ const CommandLine = Module("commandline", {
|
||||
commands.add([command.name],
|
||||
command.description,
|
||||
function (args) {
|
||||
let str = CommandLine.echoArgumentToString(args[0] || "", true);
|
||||
if (str != null)
|
||||
command.action(str);
|
||||
command.action(CommandLine.echoArgumentToString(args[0] || "", true));
|
||||
}, {
|
||||
completer: function (context) completion.javascript(context),
|
||||
literal: 0
|
||||
|
||||
@@ -147,7 +147,7 @@ const Command = Class("Command", {
|
||||
if (args.bang && !this.bang)
|
||||
throw FailedAssertion("E477: No ! allowed");
|
||||
|
||||
dactyl.trapErrors(function exec(command) {
|
||||
return !dactyl.trapErrors(function exec(command) {
|
||||
if (this.always)
|
||||
this.always(args, modifiers);
|
||||
if (!io.sourcing || !io.sourcing.noExecute)
|
||||
|
||||
@@ -143,10 +143,10 @@ const Dactyl = Module("dactyl", {
|
||||
let strut = document.getElementById("dactyl-bell-strut");
|
||||
if (!bell) {
|
||||
bell = document.documentElement.insertBefore(
|
||||
util.xmlToDom(<hbox xmlns={XUL} style="display: none" id="dactyl-bell" highlight="Bell"/>, document),
|
||||
util.xmlToDom(<hbox xmlns={XUL} style="display: none" highlight="Bell" id="dactyl-bell"/>, document),
|
||||
document.documentElement.firstChild);
|
||||
strut = document.documentElement.appendChild(
|
||||
util.xmlToDom(<hbox xmlns={XUL} style="display: none" id="dactyl-bell-strut"/>, document));
|
||||
util.xmlToDom(<hbox xmlns={XUL} style="display: none" highlight="Bell" id="dactyl-bell-strut"/>, document));
|
||||
}
|
||||
|
||||
bell.style.height = window.innerHeight + "px";
|
||||
@@ -335,12 +335,14 @@ const Dactyl = Module("dactyl", {
|
||||
|
||||
if (!silent)
|
||||
commandline.command = str.replace(/^\s*:\s*/, "");
|
||||
let res = true;
|
||||
for (let [command, args] in commands.parseCommands(str.replace(/^'(.*)'$/, "$1"))) {
|
||||
if (command === null)
|
||||
throw FailedAssertion("E492: Not a " + config.appName + " command: " + args.commandString);
|
||||
|
||||
command.execute(args, modifiers);
|
||||
res = res && command.execute(args, modifiers);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1006,7 +1008,7 @@ const Dactyl = Module("dactyl", {
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.reportError(e, true);
|
||||
return undefined;
|
||||
return e;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1711,18 +1713,11 @@ const Dactyl = Module("dactyl", {
|
||||
commands.add(["javas[cript]", "js"],
|
||||
"Evaluate a JavaScript string",
|
||||
function (args) {
|
||||
if (args.bang) { // open JavaScript console
|
||||
if (args.bang) // open JavaScript console
|
||||
dactyl.open("chrome://global/content/console.xul",
|
||||
{ from: "javascript" });
|
||||
}
|
||||
else {
|
||||
try {
|
||||
else
|
||||
dactyl.userEval(args[0]);
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.echoerr(e);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
bang: true,
|
||||
completer: function (context) completion.javascript(context),
|
||||
|
||||
@@ -569,7 +569,6 @@ const Tabs = Module("tabs", {
|
||||
subCommand: 0
|
||||
});
|
||||
|
||||
// TODO: this should open in a new tab positioned directly after the current one, not at the end
|
||||
commands.add(["tab"],
|
||||
"Execute a command and tell it to output in a new tab",
|
||||
function (args) {
|
||||
@@ -589,7 +588,8 @@ const Tabs = Module("tabs", {
|
||||
function (args) {
|
||||
for (let i = 0; i < tabs.count; i++) {
|
||||
tabs.select(i);
|
||||
dactyl.execute(args[0] || "", null, true);
|
||||
if (!dactyl.execute(args[0] || "", null, true))
|
||||
break;
|
||||
}
|
||||
}, {
|
||||
argCount: "1",
|
||||
|
||||
Reference in New Issue
Block a user