mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 11:18:00 +01:00
Open the firstrun page in a new tab.
This commit is contained in:
@@ -2015,9 +2015,12 @@ const Dactyl = Module("dactyl", {
|
||||
// first time intro message
|
||||
const firstTime = "extensions." + config.name + ".firsttime";
|
||||
if (prefs.get(firstTime, true)) {
|
||||
util.timeout(function () {
|
||||
dactyl.help();
|
||||
prefs.set(firstTime, false);
|
||||
dactyl.timeout(function () {
|
||||
this.withSavedValues(["forceNewTab"], function () {
|
||||
this.forceNewTab = true;
|
||||
this.help();
|
||||
prefs.set(firstTime, false);
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
@@ -573,14 +573,10 @@ const Tabs = Module("tabs", {
|
||||
commands.add(["tab"],
|
||||
"Execute a command and tell it to output in a new tab",
|
||||
function (args) {
|
||||
try {
|
||||
var force = dactyl.forceNewTab;
|
||||
dactyl.forceNewTab = true;
|
||||
dactyl.execute(args[0] || "", null, true);
|
||||
}
|
||||
finally {
|
||||
dactyl.forceNewTab = force;
|
||||
}
|
||||
dactyl.withSavedValues(["forceNewTab"], function () {
|
||||
this.forceNewTab = true;
|
||||
this.execute(args[0] || "", null, true);
|
||||
});
|
||||
}, {
|
||||
argCount: "+",
|
||||
completer: function (context) completion.ex(context),
|
||||
|
||||
@@ -48,8 +48,7 @@ Highlight.prototype.toString = function ()
|
||||
.join("\n\t");
|
||||
|
||||
/**
|
||||
* A class to manage highlighting rules. The parameters are the
|
||||
* standard parameters for any {@link Storage} object.
|
||||
* A class to manage highlighting rules.
|
||||
*
|
||||
* @author Kris Maglione <maglione.k@gmail.com>
|
||||
*/
|
||||
@@ -147,13 +146,12 @@ const Highlights = Module("Highlight", {
|
||||
*
|
||||
* @param {string} class
|
||||
*/
|
||||
selector: function (class_) {
|
||||
const self = this;
|
||||
return class_.replace(/(^|\s)([A-Z]\w+)\b/g,
|
||||
function (m, n1, hl) n1 +
|
||||
(self.highlight[hl] && self.highlight[hl].class != class_
|
||||
? self.highlight[hl].selector : "[dactyl|highlight~=" + hl + "]"));
|
||||
},
|
||||
selector: function (class_)
|
||||
let (self = this)
|
||||
class_.replace(/(^|\s)([A-Z]\w+)\b/g,
|
||||
function (m, n1, hl) n1 +
|
||||
(self.highlight[hl] && self.highlight[hl].class != class_
|
||||
? self.highlight[hl].selector : "[dactyl|highlight~=" + hl + "]")),
|
||||
|
||||
/**
|
||||
* Clears all highlighting rules. Rules with default values are
|
||||
@@ -185,7 +183,7 @@ const Highlights = Module("Highlight", {
|
||||
* Bulk loads new CSS rules, in the format of,
|
||||
*
|
||||
* Rules ::= Rule | Rule "\n" Rule
|
||||
* Rule ::= Bang? Star? MatchSpec Space Space* Css
|
||||
* Rule ::= Bang? Star? MatchSpec Space Space+ Css
|
||||
* | Comment
|
||||
* Comment ::= Space* "//" *
|
||||
* Bang ::= "!"
|
||||
|
||||
@@ -65,8 +65,7 @@ Sheet.prototype.__defineGetter__("fullCSS", function wrapCSS() {
|
||||
|
||||
/**
|
||||
* Manages named and unnamed user style sheets, which apply to both
|
||||
* chrome and content pages. The parameters are the standard
|
||||
* parameters for any {@link Storage} object.
|
||||
* chrome and content pages.
|
||||
*
|
||||
* @author Kris Maglione <maglione.k@gmail.com>
|
||||
*/
|
||||
@@ -387,9 +386,9 @@ const Styles = Module("Styles", {
|
||||
names: ["-index", "-i"],
|
||||
type: modules.CommandOption.INT,
|
||||
completer: function (context) {
|
||||
context.compare = CompletionContext.Sort.number;
|
||||
context.compare = modules.CompletionContext.Sort.number;
|
||||
return [[i, <>{sheet.sites.join(",")}: {sheet.css.replace("\n", "\\n")}</>]
|
||||
for ([i, sheet] in styles.userSheets)
|
||||
for ([i, sheet] in styles.userSheets)
|
||||
if (!cmd.filter || cmd.filter(sheet))];
|
||||
},
|
||||
}, {
|
||||
|
||||
@@ -212,9 +212,10 @@ const Config = Module("config", ConfigBase, {
|
||||
commands.add(["wind[ow]"],
|
||||
"Execute a command and tell it to output in a new window",
|
||||
function (args) {
|
||||
dactyl.forceNewWindow = true;
|
||||
dactyl.execute(args[0], null, true);
|
||||
dactyl.forceNewWindow = false;
|
||||
dactyl.withSavedValues(["forceNewWindow"], function () {
|
||||
this.forceNewWindow = true;
|
||||
this.execute(args[0], null, true);
|
||||
});
|
||||
},
|
||||
{
|
||||
argCount: "+",
|
||||
|
||||
Reference in New Issue
Block a user