Move MP menu warning messages to a confiogurable array, and hide the menu unless the current renderer is NativeMML with MathPlayer

This commit is contained in:
Davide P. Cervone 2012-01-26 16:14:20 -05:00
parent bb3b451b06
commit 3bd6c1d203
18 changed files with 46 additions and 37 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

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

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

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

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

File diff suppressed because one or more lines are too long

View File

@ -150,6 +150,8 @@
var source = MENU.menu.Find("Show Math As").menu;
source.items[1].name = (INPUT[jax.inputJax].sourceMenuTitle||"Original Form");
source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages
var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer");
MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer);
return MENU.menu.Post(event);
} else {
if (!AJAX.loadingMathMenu) {

View File

@ -828,12 +828,10 @@
* Handle setting MathPlayer events
*/
MENU.MPEvents = function (item) {
var discoverable = CONFIG.settings.discoverable;
var discoverable = CONFIG.settings.discoverable,
MESSAGE = MENU.MPEvents.Messages;
if (!isIE9) {
if (CONFIG.settings.mpMouse && !confirm(
"This will disable the MathJax menu and zoom features, " +
"but you can Alt-Click on an expression to obtain the MathJax " +
"menu instead.\n\nReally change the MathPlayer settings?")) {
if (CONFIG.settings.mpMouse && !confirm(MESSAGE.IE8warning)) {
delete MENU.cookie.mpContext; delete CONFIG.settings.mpContext;
delete MENU.cookie.mpMouse; delete CONFIG.settings.mpMouse;
MENU.saveCookie();
@ -844,10 +842,19 @@
MENU.saveCookie();
MathJax.Hub.Queue(["Rerender",MathJax.Hub])
} else if (!discoverable && item.name === "Menu Events" && CONFIG.settings.mpContext) {
alert("The MathJax contextual menu will be disabled, but you can " +
"Alt-Click on an expression to obtain the MathJax menu instead.");
alert(MESSAGE.IE9warning);
}
};
MENU.MPEvents.Messages = {
IE8warning:
"This will disable the MathJax menu and zoom features, " +
"but you can Alt-Click on an expression to obtain the MathJax " +
"menu instead.\n\nReally change the MathPlayer settings?",
IE9warning:
"The MathJax contextual menu will be disabled, but you can " +
"Alt-Click on an expression to obtain the MathJax menu instead."
};
/*************************************************************/
/*************************************************************/