Add HelpDialog to the list of domains for the three languages, and make sure that the domain file is loaded (even if the language is changed after the help dialog has been viewed in another language).

This commit is contained in:
Davide P. Cervone 2013-04-22 13:27:39 -04:00
parent 3901529db9
commit 7214be5ff1
4 changed files with 11 additions and 5 deletions

View File

@ -24,7 +24,7 @@
* limitations under the License. * limitations under the License.
*/ */
(function (HUB,HTML,AJAX,OUTPUT) { (function (HUB,HTML,AJAX,OUTPUT,LOCALE) {
var HELP = MathJax.Extension.Help = { var HELP = MathJax.Extension.Help = {
version: "2.1" version: "2.1"
@ -69,10 +69,14 @@
* Handle the Help Dialog box * Handle the Help Dialog box
*/ */
HELP.Dialog = function () { HELP.Dialog = function () {
LOCALE.loadDomain("HelpDialog",["Post",HELP]);
};
HELP.Post = function () {
this.div = MENU.Background(this); this.div = MENU.Background(this);
var help = HTML.addElement(this.div,"div",{ var help = HTML.addElement(this.div,"div",{
id: "MathJax_Help" id: "MathJax_Help"
},MathJax.Localization._("HelpDialog",[ },LOCALE._("HelpDialog",[
["b",{style:{fontSize:"120%"}},[["Help","MathJax Help"]]], ["b",{style:{fontSize:"120%"}},[["Help","MathJax Help"]]],
["div",{id: "MathJax_HelpContent"},[ ["div",{id: "MathJax_HelpContent"},[
["p",{},[["MathJax", ["p",{},[["MathJax",
@ -124,7 +128,7 @@
onclick: HELP.Remove onclick: HELP.Remove
}] }]
])); ]));
MathJax.Localization.setCSS(help); LOCALE.setCSS(help);
var doc = (document.documentElement||{}); var doc = (document.documentElement||{});
var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0; var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0;
if (MENU.prototype.msieAboutBug) { if (MENU.prototype.msieAboutBug) {
@ -143,9 +147,8 @@
MathJax.Callback.Queue( MathJax.Callback.Queue(
HUB.Register.StartupHook("End Config",{}), // wait until config is complete HUB.Register.StartupHook("End Config",{}), // wait until config is complete
["Styles",AJAX,CONFIG.styles], ["Styles",AJAX,CONFIG.styles],
["loadDomain",MathJax.Localization,"HelpDialog"],
["Post",HUB.Startup.signal,"HelpDialig Ready"], ["Post",HUB.Startup.signal,"HelpDialig Ready"],
["loadComplete",AJAX,"[MathJax]/extensions/HelpDialog.js"] ["loadComplete",AJAX,"[MathJax]/extensions/HelpDialog.js"]
); );
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax); })(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax,MathJax.Localization);

View File

@ -59,6 +59,7 @@ MathJax.Localization.addTranslation("de",null,{
MathMenu: {}, MathMenu: {},
FontWarnings: {}, FontWarnings: {},
HelpDialog: {},
"v1.0-warning": {}, "v1.0-warning": {},
TeX: {}, TeX: {},
MathML: {}, MathML: {},

View File

@ -38,6 +38,7 @@ MathJax.Localization.addTranslation("en",null,{
}, },
MathMenu: {}, MathMenu: {},
FontWarnings: {}, FontWarnings: {},
HelpDialog: {},
"v1.0-warning": {}, "v1.0-warning": {},
TeX: {}, TeX: {},
MathML: {}, MathML: {},

View File

@ -38,6 +38,7 @@ MathJax.Localization.addTranslation("fr",null,{
}, },
MathMenu: {}, MathMenu: {},
FontWarnings: {}, FontWarnings: {},
HelpDialog: {},
"v1.0-warning": {}, "v1.0-warning": {},
TeX: {}, TeX: {},
MathML: {}, MathML: {},