mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 20:27:58 +01:00
Add 'encoding'
This commit is contained in:
@@ -139,6 +139,55 @@ 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) {
|
||||||
|
context.anchored = false;
|
||||||
|
context.generate = function() {
|
||||||
|
let names = util.Array.uniq(
|
||||||
|
util.Array.flatten(
|
||||||
|
'more1 more2 more3 more4 more5 unicode'.split(' ').map(function(key)
|
||||||
|
options.getPref('intl.charsetmenu.browser.' + key).split(', '))));
|
||||||
|
let bundle = document.getElementById('liberator-charset-bundle');
|
||||||
|
return names.map(function(name) [name, bundle.getString(name.toLowerCase() + '.title')])
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// FIXME: Most certainly belongs elsewhere.
|
||||||
options.add(["fullscreen", "fs"],
|
options.add(["fullscreen", "fs"],
|
||||||
"Show the current window fullscreen",
|
"Show the current window fullscreen",
|
||||||
"boolean", false,
|
"boolean", false,
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
|||||||
<script type="application/x-javascript;version=1.8" src="&liberator.content;liberator-overlay.js"/>
|
<script type="application/x-javascript;version=1.8" src="&liberator.content;liberator-overlay.js"/>
|
||||||
|
|
||||||
<window id="&liberator.mainWindow;">
|
<window id="&liberator.mainWindow;">
|
||||||
|
<stringbundleset id="liberator-stringbundles">
|
||||||
|
<stringbundle id="liberator-charset-bundle"
|
||||||
|
src="chrome://global/locale/charsetTitles.properties"/>
|
||||||
|
</stringbundleset>
|
||||||
|
|
||||||
<keyset id="mainKeyset">
|
<keyset id="mainKeyset">
|
||||||
<key id="key_open_vimbar" key=":" oncommand="liberator.modules.commandline.open(':', '', liberator.modules.modes.EX);" modifiers=""/>
|
<key id="key_open_vimbar" key=":" oncommand="liberator.modules.commandline.open(':', '', liberator.modules.modes.EX);" modifiers=""/>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
2009-XX-XX:
|
2009-XX-XX:
|
||||||
* version 2.1 (probably)
|
* version 2.1 (probably)
|
||||||
|
* add 'encoding'
|
||||||
* add 'hintinputs'
|
* add 'hintinputs'
|
||||||
* add :silent
|
* add :silent
|
||||||
* add $MY_VIMPERATORRC
|
* add $MY_VIMPERATORRC
|
||||||
|
|||||||
@@ -307,6 +307,13 @@ A list of autocommand event names which should be ignored. If the list contains
|
|||||||
the value "all" then all events are ignored.
|
the value "all" then all events are ignored.
|
||||||
____
|
____
|
||||||
|
|
||||||
|
|\'enc'| |\'encoding'|
|
||||||
|
||'encoding'|| string (default: "UTF-8")
|
||||||
|
____
|
||||||
|
Changes the character encodign of the current buffer. Valid only for the
|
||||||
|
current page.
|
||||||
|
____
|
||||||
|
|
||||||
|
|
||||||
|\'nofc'| |\'nofocuscontent'| |\'fc'| |\'focuscontent'|
|
|\'nofc'| |\'nofocuscontent'| |\'fc'| |\'focuscontent'|
|
||||||
||'focuscontent' 'fc'|| boolean (default: off)
|
||'focuscontent' 'fc'|| boolean (default: off)
|
||||||
|
|||||||
Reference in New Issue
Block a user