summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-11-19 16:30:38 -0500
committerKris Maglione <maglione.k@gmail.com>2010-11-19 16:30:38 -0500
commit2df24c410d67dfc8661d99797870b5d51ccfb67c (patch)
treecd4109e6ed957846fdd951eea589106e4a0514d9
parent8b1a5132b7a728ed7e3e3db7e69e79fb402a2111 (diff)
downloadpentadactyl-2df24c410d67dfc8661d99797870b5d51ccfb67c.tar.gz
Open the firstrun page in a new tab.
-rw-r--r--common/content/dactyl.js9
-rw-r--r--common/content/tabs.js12
-rw-r--r--common/modules/highlight.jsm18
-rw-r--r--common/modules/styles.jsm7
-rw-r--r--pentadactyl/content/config.js7
5 files changed, 25 insertions, 28 deletions
diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index e1961c62..ed6fd896 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -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);
}
diff --git a/common/content/tabs.js b/common/content/tabs.js
index 7a622c0a..97d7ee9a 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -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),
diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm
index fc116045..44ac3a04 100644
--- a/common/modules/highlight.jsm
+++ b/common/modules/highlight.jsm
@@ -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 ::= "!"
diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm
index d079fef0..9c6c499f 100644
--- a/common/modules/styles.jsm
+++ b/common/modules/styles.jsm
@@ -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))];
},
}, {
diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js
index a05af89c..c5502374 100644
--- a/pentadactyl/content/config.js
+++ b/pentadactyl/content/config.js
@@ -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: "+",