MDL-19516 dragmath embedding improvements by Mauno Korpelainen
This commit is contained in:
@@ -46,7 +46,7 @@ if (!file_exists("$CFG->dirroot/lib/dragmath/applet/lang/$lang.xml")) {
|
||||
width="540" height="300"
|
||||
>
|
||||
<param name="language" value="<?php echo $lang; ?>" />
|
||||
<param name="outputFormat" value="Latex" />
|
||||
<param name="outputFormat" value="MoodleTex" />
|
||||
<param name="showOutputToolBar" value="false" />
|
||||
<?php print_string('dragmath:dragmath_javaneeded', 'editor_tinymce', '<a href="http://www.java.com">Java.com</a>')?>
|
||||
</applet>
|
||||
|
||||
@@ -1,34 +1,21 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var DragMathDialog = {
|
||||
init : function(ed) {
|
||||
|
||||
},
|
||||
|
||||
|
||||
init : function(ed) {
|
||||
},
|
||||
|
||||
insert : function(file, title) {
|
||||
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var mathExpression = document.dragmath.getMathExpression();
|
||||
//
|
||||
// TBD any massaging needed here?
|
||||
//
|
||||
var text = mathExpression;
|
||||
// convert < and > to entities
|
||||
text = text.replace('<', '<');
|
||||
text = text.replace('>', '>');
|
||||
//
|
||||
// Escape the expression
|
||||
//
|
||||
text = '$$' + text + '$$';
|
||||
ed.execCommand('mceInsertContent', false, text);
|
||||
insert : function(file, title) {
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var tex = document.dragmath.getMathExpression();
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
// convert < and > to entities
|
||||
tex = tex.replace('<', '<');
|
||||
tex = tex.replace('>', '>');
|
||||
|
||||
|
||||
|
||||
ed.execCommand('mceInsertContent', false, tex);
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.onInit.add(DragMathDialog.init, DragMathDialog);
|
||||
|
||||
Reference in New Issue
Block a user