1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 19:24:14 +01:00

Move 'encoding' option to vimperator, since PlacesUtils is supported on firefox anyway

This commit is contained in:
Martin Stubenschrott
2009-06-01 13:36:54 +02:00
parent 0c5fde8ebf
commit 7e9fcf8d05
2 changed files with 21 additions and 41 deletions

View File

@@ -448,6 +448,27 @@ const config = { //{{{
////////////////////// OPTIONS /////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
options.add(["encoding", "enc"],
"Sets the current buffer's character encoding",
"string", "UTF-8",
{
scope: options.OPTION_SCOPE_LOCAL,
getter: function () getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset,
setter: function (val)
{
// Stolen from browser.jar/content/browser/browser.js, more or less.
try
{
var docCharset = getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset = val
PlacesUtils.history.setCharsetForURI(getWebNavigation().currentURI, val);
getWebNavigation().reload(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
}
catch (e) { liberator.reportError(e); }
},
completer: function (context) completion.charset(context),
validator: Option.validateCompleter
});
options.add(["online"],
"Set the 'work offline' option",
"boolean", true,