YUI.add("moodle-tinymce_mathslate-dialogue",function(e,t){M.tinymce_mathslate=M.tinymce_mathslate||{};var n={EDITOR:"mathslate-tinymce"},r=M.tinymce_mathslate;r.dialogue=null,r.selection=null,r.config=null,r.init=function(t){M.tinymce_mathslate=M.tinymce_mathslate||{},M.tinymce_mathslate.config=t.config||M.tinymce_mathslate.config,M.tinymce_mathslate.help=t.help||M.tinymce_mathslate.help;var r=e.one("#"+t.elementid),i=r.one(".mathslate-container").generateID();e.one("#"+i).addClass(n.EDITOR);var s=new M.tinymce_mathslate.Editor("#"+i,M.tinymce_mathslate.config),o=e.one("#"+i).appendChild(e.Node.create('<button title="'+M.util.get_string("cancel_desc","tinymce_mathslate")+'">'+M.util.get_string("cancel","tinymce_mathslate")+"</button>"));o.on("click",function(){window.tinyMCEPopup.close()});if(typeof MathJax=="undefined")return;var u=e.one("#"+i).appendChild(e.Node.create('<button title="'+M.util.get_string("display_desc","tinymce_mathslate")+'">'+M.util.get_string("display","tinymce_mathslate")+"</button>")),a=e.one("#"+i).appendChild(e.Node.create('<button title="'+M.util.get_string("inline_desc","tinymce_mathslate")+'">'+M.util.get_string("inline","tinymce_mathslate")+"</button>"));u.on("click",function(){window.tinyMCEPopup.editor.execCommand("mceInsertContent",!1,"\\["+s.output("tex")+"\\]"),window.tinyMCEPopup.close()}),a.on("click",function(){window.tinyMCEPopup.editor.execCommand("mceInsertContent",!1,"\\("+s.output("tex")+"\\)"),window.tinyMCEPopup.close()}),window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,s.node.generateID()]),M.tinymce_mathslate.dialogue=r}},"@VERSION@",{requires:["escape","moodle-local_mathslate-editor","moodle-tinymce_mathslate-editor"]});
