#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:
shanjian%netscape.com 2000-06-21 22:59:59 +00:00
Родитель 6c45a7674d
Коммит 3a0f563a71
1 изменённых файлов: 23 добавлений и 1 удалений

Просмотреть файл

@ -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();