Better handling of MathPlayer settings. In particular, allow Alt-Click in IE8 and lower when math menu is disabled.
This commit is contained in:
parent
92f00c7f5b
commit
344f832e1e
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
|
@ -175,7 +175,8 @@
|
||||||
var JAX = OUTPUT[math.jaxID];
|
var JAX = OUTPUT[math.jaxID];
|
||||||
var show = (JAX.config.showMathMenu != null ? JAX : HUB).config.showMathMenu;
|
var show = (JAX.config.showMathMenu != null ? JAX : HUB).config.showMathMenu;
|
||||||
if (show) {
|
if (show) {
|
||||||
if (SETTINGS.context === "MathJax" && !SETTINGS.mpContext) {
|
show = (JAX.config.showMathMenuMSIE != null ? JAX : HUB).config.showMathMenuMSIE;
|
||||||
|
if (SETTINGS.context === "MathJax" && !SETTINGS.mpContext && show) {
|
||||||
if (!ME.noContextMenuBug || event.button !== EVENT.RIGHTBUTTON) return;
|
if (!ME.noContextMenuBug || event.button !== EVENT.RIGHTBUTTON) return;
|
||||||
} else {
|
} else {
|
||||||
if (!event[EVENT.MENUKEY] || event.button !== EVENT.LEFTBUTTON) return;
|
if (!event[EVENT.MENUKEY] || event.button !== EVENT.LEFTBUTTON) return;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
signal: SIGNAL
|
signal: SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
var isPC = HUB.Browser.isPC, isMSIE = HUB.Browser.isMSIE;
|
var isPC = HUB.Browser.isPC, isMSIE = HUB.Browser.isMSIE, isIE9 = ((document.documentMode||0) > 8);
|
||||||
var ROUND = (isPC ? null : "5px");
|
var ROUND = (isPC ? null : "5px");
|
||||||
|
|
||||||
var CONFIG = HUB.CombineConfig("MathMenu",{
|
var CONFIG = HUB.CombineConfig("MathMenu",{
|
||||||
|
@ -681,7 +681,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (MENU.jax.originalText == null) {alert("No TeX form available"); return}
|
if (MENU.jax.originalText == null) {alert("No original form available"); return}
|
||||||
MENU.ShowSource.Text(MENU.jax.originalText,event);
|
MENU.ShowSource.Text(MENU.jax.originalText,event);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -779,23 +779,23 @@
|
||||||
*/
|
*/
|
||||||
MENU.MPEvents = function (item) {
|
MENU.MPEvents = function (item) {
|
||||||
var discoverable = CONFIG.settings.discoverable;
|
var discoverable = CONFIG.settings.discoverable;
|
||||||
if ((document.documentMode||0) < 9) {
|
if (!isIE9) {
|
||||||
if (!confirm("This will disable the MathJax menu and MathJax Zoom features, " +
|
if (CONFIG.settings.mpMouse && !confirm(
|
||||||
"and you will have to delete the cookies for this site to " +
|
"This will disable the MathJax menu and zoom features, " +
|
||||||
"reactivate them.\n\n" +
|
"but you can Alt-Click on an expression to obtain the MathJax " +
|
||||||
"Really change the MathPlayer settings?")) {
|
"menu instead.\n\nReally change the MathPlayer settings?")) {
|
||||||
delete MENU.cookie.mpContext; delete CONFIG.settings.mpContext;
|
delete MENU.cookie.mpContext; delete CONFIG.settings.mpContext;
|
||||||
delete MENU.cookie.mpMouse; delete CONFIG.settings.mpMouse;
|
delete MENU.cookie.mpMouse; delete CONFIG.settings.mpMouse;
|
||||||
MENU.saveCookie();
|
MENU.saveCookie();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CONFIG.settings.mpContext = CONFIG.settings.mpMouse = true;
|
CONFIG.settings.mpContext = CONFIG.settings.mpMouse;
|
||||||
MENU.cookie.mpContext = MENU.cookie.mpMouse = true;
|
MENU.cookie.mpContext = MENU.cookie.mpMouse = CONFIG.settings.mpMouse;
|
||||||
MENU.saveCookie();
|
MENU.saveCookie();
|
||||||
MathJax.Hub.Queue(["Rerender",MathJax.Hub])
|
MathJax.Hub.Queue(["Rerender",MathJax.Hub])
|
||||||
} else if (!discoverable && item.name === "Menu Events" && CONFIG.settings.mpContext) {
|
} else if (!discoverable && item.name === "Menu Events" && CONFIG.settings.mpContext) {
|
||||||
alert("The MathJax contextual menu will be disabled; instead " +
|
alert("The MathJax contextual menu will be disabled, but you can " +
|
||||||
"Alt-Click on an expression to obtain the MathJax menu.");
|
"Alt-Click on an expression to obtain the MathJax menu instead.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@
|
||||||
msieFixedPositionBug: (quirks || !isIE8),
|
msieFixedPositionBug: (quirks || !isIE8),
|
||||||
msieAboutBug: quirks
|
msieAboutBug: quirks
|
||||||
});
|
});
|
||||||
if (document.documentMode >= 9) {
|
if (isIE9) {
|
||||||
delete CONFIG.styles["#MathJax_About"].filter;
|
delete CONFIG.styles["#MathJax_About"].filter;
|
||||||
delete CONFIG.styles[".MathJax_Menu"].filter;
|
delete CONFIG.styles[".MathJax_Menu"].filter;
|
||||||
}
|
}
|
||||||
|
@ -882,8 +882,9 @@
|
||||||
!CONFIG.showMathPlayer,
|
!CONFIG.showMathPlayer,
|
||||||
disabled:!HUB.Browser.hasMathPlayer},
|
disabled:!HUB.Browser.hasMathPlayer},
|
||||||
ITEM.LABEL("Let MathPlayer Handle:"),
|
ITEM.LABEL("Let MathPlayer Handle:"),
|
||||||
ITEM.CHECKBOX("Menu Events", "mpContext", {action: MENU.MPEvents}),
|
ITEM.CHECKBOX("Menu Events", "mpContext", {action: MENU.MPEvents, hidden:!isIE9}),
|
||||||
ITEM.CHECKBOX("Mouse Events", "mpMouse", {action: MENU.MPEvents})
|
ITEM.CHECKBOX("Mouse Events", "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}),
|
||||||
|
ITEM.CHECKBOX("Mouse and Menu Events", "mpMouse", {action: MENU.MPEvents, hidden:isIE9})
|
||||||
),
|
),
|
||||||
ITEM.SUBMENU("Font Preference", {hidden:!CONFIG.showFontMenu},
|
ITEM.SUBMENU("Font Preference", {hidden:!CONFIG.showFontMenu},
|
||||||
ITEM.LABEL("For HTML-CSS:"),
|
ITEM.LABEL("For HTML-CSS:"),
|
||||||
|
|
|
@ -222,7 +222,8 @@
|
||||||
} else {
|
} else {
|
||||||
var config = (this.config.showMathMenuMSIE != null ? this : HUB).config;
|
var config = (this.config.showMathMenuMSIE != null ? this : HUB).config;
|
||||||
if (config.showMathMenuMSIE && !this.settings.mpContext && !this.settings.mpMouse)
|
if (config.showMathMenuMSIE && !this.settings.mpContext && !this.settings.mpMouse)
|
||||||
{this.MSIEoverlay(container)} else {container.style.position = ""}
|
{this.MSIEoverlay(container)} else
|
||||||
|
{container.style.position = ""; mspan.firstChild.onmousedown = this.MSIEaltMenu}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
container.oncontextmenu = EVENT.Menu;
|
container.oncontextmenu = EVENT.Menu;
|
||||||
|
@ -296,10 +297,16 @@
|
||||||
if (event.srcElement.className === "MathJax_MathPlayer_Overlay" && this.msieMath.fireEvent) {
|
if (event.srcElement.className === "MathJax_MathPlayer_Overlay" && this.msieMath.fireEvent) {
|
||||||
// for now, ignore all other events. This will disable MathPlayer's zoom
|
// for now, ignore all other events. This will disable MathPlayer's zoom
|
||||||
// feature, but also its <maction> support.
|
// feature, but also its <maction> support.
|
||||||
if (type === "ContextMenu") {this.msieMath.fireEvent("on"+event.type,event)}
|
if (type === "ContextMenu" || type === "Mouseover" || type === "Mouseout")
|
||||||
|
{this.msieMath.fireEvent("on"+event.type,event)}
|
||||||
}
|
}
|
||||||
return EVENT.False(event);
|
return EVENT.False(event);
|
||||||
},
|
},
|
||||||
|
MSIEaltMenu: function () {
|
||||||
|
var container = this.parentNode.parentNode;
|
||||||
|
while (!container.jaxID) {container = container.parentNode}
|
||||||
|
EVENT.AltContextMenu(window.event,container);
|
||||||
|
},
|
||||||
|
|
||||||
MSIE9events: {
|
MSIE9events: {
|
||||||
contextmenu:"Menu", click:"Click", dblclick: "DblClick",
|
contextmenu:"Menu", click:"Click", dblclick: "DblClick",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user