Make format submenu use 'Original' for original MathML source, and set the value each time the menu is opened, so mixed pages work properly

git-svn-id: https://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk@539 b8fd5906-0fad-46e2-a0d3-10d94ff285d1
This commit is contained in:
Davide Cervone 2010-07-30 13:49:04 +00:00
parent 1c71c55aa2
commit 512e9cb291
6 changed files with 20 additions and 14 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@
var CONFIG = HUB.Insert({
delay: 150, // the delay for submenus
helpURL: "http://www.mathjax.org/help/user/", // the URL for the "MathJax Help" menu
helpURL: "http://www.mathjax.org/Help-User/", // the URL for the "MathJax Help" menu
showRenderer: true, // show the "Math Renderer" menu?
showFontMenu: false, // show the "Font Preference" menu?
@ -672,7 +672,7 @@
*/
CONFIG.settings = HUB.config.menuSettings;
if (!CONFIG.settings.format)
{CONFIG.settings.format = (MathJax.InputJax.TeX ? "TeX" : "MathML")}
{CONFIG.settings.format = (MathJax.InputJax.TeX ? "Original" : "MathML")}
if (typeof(CONFIG.settings.showRenderer) !== "undefined") {CONFIG.showRenderer = CONFIG.settings.showRenderer}
if (typeof(CONFIG.settings.showFontMenu) !== "undefined") {CONFIG.showFontMenu = CONFIG.settings.showFontMenu}
if (typeof(CONFIG.settings.showContext) !== "undefined") {CONFIG.showContext = CONFIG.settings.showContext}
@ -684,8 +684,8 @@
MENU.menu = MENU(
ITEM.COMMAND("Show Source",MENU.ShowSource),
ITEM.SUBMENU("Format",
ITEM.RADIO("MathML", "format"),
ITEM.RADIO("TeX", "format", {disabled: !MathJax.InputJax.TeX})
ITEM.RADIO("MathML", "format"),
ITEM.RADIO("Original", "format", {value: "Original"})
),
ITEM.RULE(),
ITEM.SUBMENU("Settings",

View File

@ -386,10 +386,13 @@
ContextMenu: function (event,force) {
if (HTMLCSS.config.showMathMenu && (HTMLCSS.settings.context === "MathJax" || force)) {
if (HTMLCSS.safariContextMenuBug) {setTimeout('window.getSelection().empty()',0)}
if (MathJax.Menu) {
var MENU = MathJax.Menu;
if (MENU) {
var math = (this.parentNode.className === "MathJax_Display" ? this.parentNode : this)
MathJax.Menu.jax = HUB.getJaxFor(math.nextSibling);
return MathJax.Menu.menu.Post(event);
MENU.jax = HUB.getJaxFor(math.nextSibling);
MENU.menu.items[1].menu.items[1].name =
(MENU.jax.inputJax.name === "MathML" ? "Original" : MENU.jax.inputJax.name);
return MENU.menu.Post(event);
} else {
if (!AJAX.loadingMathMenu) {
AJAX.loadingMathMenu = true;

View File

@ -149,12 +149,15 @@
ContextMenu: function (event,force) {
if (nMML.config.showMathMenu && (nMML.settings.context === "MathJax" || force)) {
if (nMML.safariContextMenuBug) {setTimeout('window.getSelection().empty()',0)}
if (MathJax.Menu) {
var MENU = MathJax.Menu;
if (MENU) {
if (document.selection) {setTimeout("document.selection.empty()",0)}
var script = (isMSIE ? this.parentNode.parentNode.nextSibling : this.parentNode.nextSibling);
MathJax.Menu.jax = HUB.getJaxFor(script);
MENU.jax = HUB.getJaxFor(script);
MENU.menu.items[1].menu.items[1].name =
(MENU.jax.inputJax.name === "MathML" ? "Original" : MENU.jax.inputJax.name);
delete nMML.trapClick; delete nMML.trapUp;
return MathJax.Menu.menu.Post(event);
return MENU.menu.Post(event);
} else {
if (!AJAX.loadingMathMenu) {
AJAX.loadingMathMenu = true;