Bug 160924 View Selection Source should check to see if syntax highlighting is enabled r=doron sr=bz

This commit is contained in:
neil%parkwaycc.co.uk 2003-01-08 13:45:40 +00:00
Родитель 28ac1b3138
Коммит 0f9c8fb79d
3 изменённых файлов: 11 добавлений и 7 удалений

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

@ -66,6 +66,12 @@ function onLoadViewPartialSource()
gWrapLongLines = true;
}
} catch (e) { }
try {
document.getElementById("menu_highlightSyntax").setAttribute("checked", gPrefs.getBoolPref("view_source.syntax_highlight"));
} catch (e) {
}
} else {
document.getElementById("menu_highlightSyntax").setAttribute("hidden", "true");
}
// disable menu items that don't work since the selection is munged and

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

@ -66,7 +66,6 @@
<commandset id="selectEditMenuItems"/>
<commandset id="clipboardEditMenuItems"/>
<commandset id="viewSourceMenuItems">
<command id="cmd_highlightSyntax" oncommand="highlightSyntax();"/>
<command id="cmd_wrapLongLines" oncommand="wrapLongLines()"/>
<command id="cmd_close" oncommand="ViewSourceClose()"/>
<command id="cmd_savePage" oncommand="ViewSourceSavePage();"/>
@ -175,7 +174,7 @@
<menu id="charsetMenu"/>
<menuitem id="menu_wrapLongLines" type="checkbox" command="cmd_wrapLongLines"
label="&menu_wrapLongLines.title;" accesskey="&menu_wrapLongLines.accesskey;"/>
<menuitem type="checkbox" command="cmd_highlightSyntax"
<menuitem type="checkbox" id="menu_highlightSyntax" oncommand="highlightSyntax();"
label="&menu_highlightSyntax.label;" accesskey="&menu_highlightSyntax.accesskey;"/>
</menupopup>
</menu>

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

@ -136,11 +136,11 @@ function viewSource(url)
} catch (ex) {
}
try {
document.getElementById("cmd_highlightSyntax").setAttribute("checked", gPrefs.getBoolPref("view_source.syntax_highlight"));
document.getElementById("menu_highlightSyntax").setAttribute("checked", gPrefs.getBoolPref("view_source.syntax_highlight"));
} catch (ex) {
}
} else {
document.getElementById("cmd_highlightSyntax").setAttribute("hidden", "true");
document.getElementById("menu_highlightSyntax").setAttribute("hidden", "true");
}
window._content.focus();
@ -200,9 +200,8 @@ function wrapLongLines()
//pref to persist the last state
function highlightSyntax()
{
var highlightSyntaxCmd = document.getElementById("cmd_highlightSyntax");
var highlightSyntax = highlightSyntaxCmd.getAttribute("checked") != "true";
highlightSyntaxCmd.setAttribute("checked", highlightSyntax);
var highlightSyntaxMenu = document.getElementById("menu_highlightSyntax");
var highlightSyntax = (highlightSyntaxMenu.getAttribute("checked") == "true");
gPrefs.setBoolPref("view_source.syntax_highlight", highlightSyntax);
var PageLoader = getBrowser().webNavigation.QueryInterface(pageLoaderIface);