mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 14:27:59 +01:00
Move 'encoding' option to vimperator, since PlacesUtils is supported on firefox anyway
This commit is contained in:
@@ -149,47 +149,6 @@ function Buffer() //{{{
|
|||||||
////////////////////// OPTIONS /////////////////////////////////////////////////
|
////////////////////// OPTIONS /////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
function getWebNav()
|
|
||||||
{
|
|
||||||
function call(val, fn)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return fn(val);
|
|
||||||
}
|
|
||||||
catch (e)
|
|
||||||
{
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
function () getBrowser().webNavigation,
|
|
||||||
function (webNav) webNav.sessionHistory.QueryInterface(Ci.nsIWebNavigation)
|
|
||||||
].reduce(call, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
getWebNav().reload(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
|
|
||||||
}
|
|
||||||
catch (e) { liberator.reportError(e); }
|
|
||||||
},
|
|
||||||
completer: function (context) completion.charset(context),
|
|
||||||
validator: Option.validateCompleter
|
|
||||||
});
|
|
||||||
|
|
||||||
// FIXME: Most certainly belongs elsewhere.
|
// FIXME: Most certainly belongs elsewhere.
|
||||||
options.add(["fullscreen", "fs"],
|
options.add(["fullscreen", "fs"],
|
||||||
"Show the current window fullscreen",
|
"Show the current window fullscreen",
|
||||||
|
|||||||
@@ -448,6 +448,27 @@ const config = { //{{{
|
|||||||
////////////////////// OPTIONS /////////////////////////////////////////////////
|
////////////////////// 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"],
|
options.add(["online"],
|
||||||
"Set the 'work offline' option",
|
"Set the 'work offline' option",
|
||||||
"boolean", true,
|
"boolean", true,
|
||||||
|
|||||||
Reference in New Issue
Block a user