Fix for bug 96759. Add composercharsetLoadListener function to listen to the page and SetForcedEditorCharset function to solve

the menu selection problem. r=nhotta,sr=alecf.
This commit is contained in:
rchen%netscape.com 2002-01-10 21:55:26 +00:00
Родитель be77cfcf2d
Коммит 0641fa44bd
1 изменённых файлов: 29 добавлений и 1 удалений

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

@ -51,7 +51,7 @@ function ComposerMultiplexHandler(event)
} else if (name == 'charsetCustomize') {
//do nothing - please remove this else statement, once the charset prefs moves to the pref window
} else {
EditorSetDocumentCharacterSet(node.getAttribute('id'));
SetForcedEditorCharset(node.getAttribute('id'));
}
}
@ -215,6 +215,26 @@ function charsetLoadListener (event)
}
}
function composercharsetLoadListener (event)
{
var charset = window._content.document.characterSet;
if (charset.length > 0 ) {
gCharsetMenu.SetCurrentComposerCharset(charset);
}
}
function SetForcedEditorCharset(charset)
{
if (charset.length > 0 ) {
gCharsetMenu.SetCurrentComposerCharset(charset);
}
EditorSetDocumentCharacterSet(charset);
}
var gLastMailCharset = null;
function mailCharsetLoadListener (event)
@ -245,4 +265,12 @@ else
if (messageContent)
messageContent.addEventListener("load", mailCharsetLoadListener, true);
}
else
if (window && arrayOfStrings[0] == "composer")
{
var contentArea = window.document.getElementById("appcontent");
if (contentArea)
contentArea.addEventListener("load", composercharsetLoadListener, true);
}
}