mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:17:59 +01:00
don't store options as preferences anymore
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,6 +1,7 @@
|
|||||||
<pre>
|
<pre>
|
||||||
2007-XX-XX:
|
2007-XX-XX:
|
||||||
* version 0.5.3
|
* version 0.5.3
|
||||||
|
* options are no longer stored in preferences - use the RC file instead
|
||||||
* added new :mkvimperatorc command
|
* added new :mkvimperatorc command
|
||||||
* remove :redraw and Ctrl-L commands as they rely on FF3 features
|
* remove :redraw and Ctrl-L commands as they rely on FF3 features
|
||||||
* :ls, :history and :bmarks output is now hyperlinked
|
* :ls, :history and :bmarks output is now hyperlinked
|
||||||
|
|||||||
@@ -31,14 +31,13 @@ function Option(names, type, extra_info) //{{{
|
|||||||
if (!names || !type)
|
if (!names || !type)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
var value = null;
|
||||||
|
|
||||||
this.name = names[0];
|
this.name = names[0];
|
||||||
this.names = names;
|
this.names = names;
|
||||||
this.usage = this.names;
|
this.usage = this.names;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
||||||
this.setter = function(value) { Options.setPref(this.name, value); };
|
|
||||||
this.getter = function() { return Options.getPref(this.name); };
|
|
||||||
|
|
||||||
if (extra_info)
|
if (extra_info)
|
||||||
{
|
{
|
||||||
if (extra_info.usage)
|
if (extra_info.usage)
|
||||||
@@ -53,6 +52,8 @@ function Option(names, type, extra_info) //{{{
|
|||||||
else
|
else
|
||||||
this.default_value = null;
|
this.default_value = null;
|
||||||
|
|
||||||
|
value = this.default_value;
|
||||||
|
|
||||||
if (extra_info.setter)
|
if (extra_info.setter)
|
||||||
this.setter = extra_info.setter;
|
this.setter = extra_info.setter;
|
||||||
if (extra_info.getter)
|
if (extra_info.getter)
|
||||||
@@ -75,8 +76,22 @@ function Option(names, type, extra_info) //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: forced defaults need to use Options.getPref
|
// NOTE: forced defaults need to use Options.getPref
|
||||||
Option.prototype.__defineGetter__("value", function() { return this.getter.call(this); });
|
this.__defineGetter__("value",
|
||||||
Option.prototype.__defineSetter__("value", function(value) { this.setter.call(this, value); });
|
function()
|
||||||
|
{
|
||||||
|
if (this.getter)
|
||||||
|
this.getter.call(this);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.__defineSetter__("value",
|
||||||
|
function(new_value)
|
||||||
|
{
|
||||||
|
value = new_value;
|
||||||
|
if (this.setter)
|
||||||
|
this.setter.call(this, value);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// TODO: add is[Type]() queries for use in set()?
|
// TODO: add is[Type]() queries for use in set()?
|
||||||
// : add isValid() or just throw an exception?
|
// : add isValid() or just throw an exception?
|
||||||
@@ -445,7 +460,7 @@ function Options() //{{{
|
|||||||
"<li><b>T</b>: toolbar</li>" +
|
"<li><b>T</b>: toolbar</li>" +
|
||||||
"<li><b>b</b>: bookmark bar</li>" +
|
"<li><b>b</b>: bookmark bar</li>" +
|
||||||
"</ul>",
|
"</ul>",
|
||||||
setter: function(value) { Options.setPref("guioptions", value); setGuiOptions(value); },
|
setter: function(value) { setGuiOptions(value); },
|
||||||
default_value: "",
|
default_value: "",
|
||||||
validator: function (value) { if (/[^mTb]/.test(value)) return false; else return true; }
|
validator: function (value) { if (/[^mTb]/.test(value)) return false; else return true; }
|
||||||
}
|
}
|
||||||
@@ -472,7 +487,7 @@ function Options() //{{{
|
|||||||
addOption(new Option(["hlsearch", "hls"], "boolean",
|
addOption(new Option(["hlsearch", "hls"], "boolean",
|
||||||
{
|
{
|
||||||
short_help: "Highlight previous search pattern matches",
|
short_help: "Highlight previous search pattern matches",
|
||||||
setter: function(value) { Options.setPref("hlsearch", value); if (value) vimperator.search.highlight(); else vimperator.search.clear(); },
|
setter: function(value) { if (value) vimperator.search.highlight(); else vimperator.search.clear(); },
|
||||||
default_value: false
|
default_value: false
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -507,7 +522,7 @@ function Options() //{{{
|
|||||||
"</ul>" +
|
"</ul>" +
|
||||||
"NOTE: laststatus=1 not implemented yet.",
|
"NOTE: laststatus=1 not implemented yet.",
|
||||||
default_value: 2,
|
default_value: 2,
|
||||||
setter: function(value) { Options.setPref("laststatus", value); setStatusLine(value); },
|
setter: function(value) { setStatusLine(value); },
|
||||||
validator: function (value) { if (value >= 0 && value <= 2) return true; else return false; }
|
validator: function (value) { if (value >= 0 && value <= 2) return true; else return false; }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -545,7 +560,7 @@ function Options() //{{{
|
|||||||
"</ul>" +
|
"</ul>" +
|
||||||
"NOTE: This option does not change the popup blocker of Firefox in any way.",
|
"NOTE: This option does not change the popup blocker of Firefox in any way.",
|
||||||
default_value: 1,
|
default_value: 1,
|
||||||
setter: function(value) { Options.setPref("popups", value); setPopups(value); },
|
setter: function(value) { setPopups(value); },
|
||||||
validator: function (value) { if (value >= 0 && value <= 3) return true; else return false; }
|
validator: function (value) { if (value >= 0 && value <= 3) return true; else return false; }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -606,7 +621,7 @@ function Options() //{{{
|
|||||||
"<li><b>1</b>: Show tab bar only if more than one tab is open</li>" +
|
"<li><b>1</b>: Show tab bar only if more than one tab is open</li>" +
|
||||||
"<li><b>2</b>: Always show tab bar</li>" +
|
"<li><b>2</b>: Always show tab bar</li>" +
|
||||||
"</ul>",
|
"</ul>",
|
||||||
setter: function(value) { Options.setPref("showtabline", value); setShowTabline(value); },
|
setter: function(value) { setShowTabline(value); },
|
||||||
default_value: 2,
|
default_value: 2,
|
||||||
validator: function (value) { if (value >= 0 && value <= 2) return true; else return false; }
|
validator: function (value) { if (value >= 0 && value <= 2) return true; else return false; }
|
||||||
}
|
}
|
||||||
@@ -624,7 +639,7 @@ function Options() //{{{
|
|||||||
help: "Vimperator changes the browser title from \"Title of web page - Mozilla Firefox\" to " +
|
help: "Vimperator changes the browser title from \"Title of web page - Mozilla Firefox\" to " +
|
||||||
"\"Title of web page - Vimperator\".<br/>If you don't like that, you can restore it with: " +
|
"\"Title of web page - Vimperator\".<br/>If you don't like that, you can restore it with: " +
|
||||||
"<code class=\"command\">:set titlestring=Mozilla Firefox</code>.",
|
"<code class=\"command\">:set titlestring=Mozilla Firefox</code>.",
|
||||||
setter: function(value) { Options.setPref("titlestring", value); setTitleString(value); },
|
setter: function(value) { setTitleString(value); },
|
||||||
default_value: "Vimperator"
|
default_value: "Vimperator"
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -649,7 +664,7 @@ function Options() //{{{
|
|||||||
addOption(new Option(["visualbell", "vb"], "boolean",
|
addOption(new Option(["visualbell", "vb"], "boolean",
|
||||||
{
|
{
|
||||||
short_help: "Use visual bell instead of beeping on errors",
|
short_help: "Use visual bell instead of beeping on errors",
|
||||||
setter: function(value) { Options.setPref("visualbell", value); Options.setFirefoxPref("accessibility.typeaheadfind.enablesound", !value); },
|
setter: function(value) { Options.setFirefoxPref("accessibility.typeaheadfind.enablesound", !value); },
|
||||||
default_value: false
|
default_value: false
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user