From a262db825d6d029fa55f57f620f15f72bd6fc4e2 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 19 Jun 2009 14:35:46 +0000 Subject: [PATCH] MDL-19516 dragmath embedding improvements by Mauno Korpelainen --- .../tinymce/plugins/dragmath/dragmath.php | 2 +- .../tinymce/plugins/dragmath/js/dragmath.js | 37 ++++++------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/lib/editor/tinymce/plugins/dragmath/dragmath.php b/lib/editor/tinymce/plugins/dragmath/dragmath.php index 9a1b2cf27e..017f7d17c1 100644 --- a/lib/editor/tinymce/plugins/dragmath/dragmath.php +++ b/lib/editor/tinymce/plugins/dragmath/dragmath.php @@ -46,7 +46,7 @@ if (!file_exists("$CFG->dirroot/lib/dragmath/applet/lang/$lang.xml")) { width="540" height="300" > - + Java.com')?> diff --git a/lib/editor/tinymce/plugins/dragmath/js/dragmath.js b/lib/editor/tinymce/plugins/dragmath/js/dragmath.js index c9c24f601c..53760b826f 100644 --- a/lib/editor/tinymce/plugins/dragmath/js/dragmath.js +++ b/lib/editor/tinymce/plugins/dragmath/js/dragmath.js @@ -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); -- 2.39.5