зеркало из https://github.com/mozilla/gecko-dev.git
#40463 Cannot type anything in Composer at selecting Auto-Detect menus
After a new charset dectector is selected, url should be reloaded. r=sfraser
This commit is contained in:
Родитель
6c45a7674d
Коммит
3a0f563a71
|
@ -46,7 +46,7 @@ function ComposerMultiplexHandler(event)
|
|||
var charset;
|
||||
|
||||
if (name == 'detectorGroup') {
|
||||
SelectDetector(event, true);
|
||||
ComposerSelectDetector(event, true);
|
||||
} else if (name == 'charsetGroup') {
|
||||
charset = node.getAttribute('id');
|
||||
charset = charset.substring('charset.'.length, charset.length)
|
||||
|
@ -86,6 +86,28 @@ function SelectDetector(event, doReload)
|
|||
}
|
||||
}
|
||||
|
||||
function ComposerSelectDetector(event)
|
||||
{
|
||||
//dump("Charset Detector menu item pressed: " + event.target.getAttribute('id') + "\n");
|
||||
|
||||
var uri = event.target.getAttribute("id");
|
||||
var prefvalue = uri.substring('chardet.'.length, uri.length);
|
||||
if("off" == prefvalue) { // "off" is special value to turn off the detectors
|
||||
prefvalue = "";
|
||||
}
|
||||
|
||||
var pref = Components.classes['component://netscape/preferences'];
|
||||
if (pref) {
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPref);
|
||||
}
|
||||
|
||||
if (pref) {
|
||||
pref.SetCharPref("intl.charset.detector", prefvalue);
|
||||
editorShell.LoadUrl(editorShell.editorDocument.location);
|
||||
}
|
||||
}
|
||||
|
||||
function SetForcedDetector()
|
||||
{
|
||||
BrowserSetForcedDetector();
|
||||
|
|
Загрузка…
Ссылка в новой задаче