move CSS in Composer stuff from nsEditorShell to nsHTMLEditor; b=121081, r=brade, sr=kin
This commit is contained in:
Родитель
31d7bfc1f0
Коммит
7d7fdeaafe
|
@ -4982,14 +4982,3 @@ nsEditorShell::DoControllerCommand(const nsAReadableString& aCommand)
|
|||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEditorShell::CSSPrefChangedCallback(PRBool aIsCSSPrefChecked)
|
||||
{
|
||||
nsresult err = NS_NOINTERFACE;
|
||||
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
|
||||
if (htmlEditor)
|
||||
{
|
||||
err = htmlEditor->SetCSSEnabled(aIsCSSPrefChecked);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -514,7 +514,6 @@ interface nsIEditorShell : nsISupports
|
|||
wstring GetAlignment(out boolean mixed);
|
||||
|
||||
void ApplyStyleSheet(in wstring url);
|
||||
void CSSPrefChangedCallback(in boolean isCSSPrefChecked);
|
||||
|
||||
/** Set the display mode for editing
|
||||
* displayMode
|
||||
|
|
|
@ -96,7 +96,6 @@ nsButtonPrefListener.prototype =
|
|||
domain: "editor.use_css",
|
||||
observe: function(subject, topic, prefName)
|
||||
{
|
||||
dump("FOOOOO\n");
|
||||
// verify that we're changing a button pref
|
||||
if (topic != "nsPref:changed") return;
|
||||
if (prefName.substr(0, this.domain.length) != this.domain) return;
|
||||
|
@ -106,16 +105,19 @@ nsButtonPrefListener.prototype =
|
|||
if (button) {
|
||||
var prefs = GetPrefs();
|
||||
var useCSS = prefs.getBoolPref(prefName);
|
||||
if (useCSS) {
|
||||
var htmlEditor = editorShell.editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
|
||||
if (useCSS && htmlEditor) {
|
||||
button.removeAttribute("disabled");
|
||||
var state = editorShell.editor.QueryInterface(Components.interfaces.nsIHTMLEditor).GetHighlightColor(mixedObj);
|
||||
var state = htmlEditor.GetHighlightColor(mixedObj);
|
||||
button.setAttribute("state", state);
|
||||
}
|
||||
else {
|
||||
button.setAttribute("disabled", "true");
|
||||
button.setAttribute("state", "transparent");
|
||||
}
|
||||
editorShell.CSSPrefChangedCallback(useCSS);
|
||||
if (htmlEditor) {
|
||||
htmlEditor.SetCSSEnabled(useCSS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче