diff --git a/version.php b/version.php index 2b2cd82..1750173 100644 --- a/version.php +++ b/version.php @@ -25,10 +25,10 @@ defined('MOODLE_INTERNAL') || die(); // The current plugin version (Date: YYYYMMDDXX). -$plugin->version = 2014071200; +$plugin->version = 2014081000; // Required Moodle version. $plugin->requires = 2012050100; // Full name of the plugin (used for diagnostics). $plugin->component = 'tinymce_mathslate'; -$plugin->maturity = MATURITY_RC; -$plugin->release = '1.0RC1'; +$plugin->maturity = MATURITY_STABLE; +$plugin->release = '1.0'; diff --git a/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-debug.js b/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-debug.js index 622ae16..9864405 100644 --- a/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-debug.js +++ b/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-debug.js @@ -154,8 +154,8 @@ NS.MathJaxEditor=function(id){ // return; //} e.stopPropagation(); - //se.insertSnippet(selectedNode.getAttribute('id'), se.removeSnippet(node.getAttribute('id'))); se.insertSnippet(node.getAttribute('id'), se.removeSnippet(selectedNode.getAttribute('id'))); + se.select(); render(); }; node.on('click',function(e) { diff --git a/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-min.js b/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-min.js index 5c4e4af..9d5ce75 100644 --- a/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-min.js +++ b/yui/build/moodle-tinymce_mathslate-mathjaxeditor/moodle-tinymce_mathslate-mathjaxeditor-min.js @@ -1 +1 @@ -YUI.add("moodle-tinymce_mathslate-mathjaxeditor",function(e,t){M.tinymce_mathslate=M.tinymce_mathslate||{},NS=M&&M.tinymce_mathslate||{};var n={SELECTED:"mathslate-selected",WORKSPACE:"mathslate-workspace",PREVIEW:"mathslate-preview",HIGHLIGHT:"mathslate-highlight",DRAGNODE:"mathslate-workspace-drag",DRAGGEDNODE:"mathslate-workspace-dragged",HELPBOX:"mathslate-help-box",PANEL:"mathslate-bottom-panel"},r={SELECTED:"."+n.SELECTED,HIGHLIGHT:"."+n.HIGHLIGHT};NS.MathJaxEditor=function(t){function p(){u.setHTML('
'+s.preview("tex")+"
"),s.getSelected()&&u.one("#"+s.getSelected())&&(a.get("node").one("#"+s.getSelected()).addClass(n.SELECTED),u.one("#"+s.getSelected()).addClass(n.SELECTED)),s.forEach(function(t){var i=a.get("node").one("#"+t[1].id);if(!i)return;i.setAttribute("title",u.one("#"+t[1].id).getHTML().replace(/
]*>|<\/div>|
/g,"")),i.handleClick=function(e){var t=a.get("node").one(r.SELECTED);if(!t){e.stopPropagation(),s.select(this.getAttribute("id")),d();return}if(t===i){i.removeClass(n.SELECTED),u.one("#"+i.getAttribute("id")).removeClass(n.SELECTED),s.select();return}if(t.one("#"+this.getAttribute("id")))return;e.stopPropagation(),s.insertSnippet(i.getAttribute("id"),s.removeSnippet(t.getAttribute("id"))),d()},i.on("click",function(e){this.handleClick(e)}),i.on("dblclick",function(e){e.stopPropagation(),s.removeSnippet(i.getAttribute("id")),d()});var o=a.get("node").one(r.SELECTED);if((!t[1]||!t[1]["class"]||t[1]["class"]!=="blank")&&(!o||!o.one("#"+i.getAttribute("id")))){var f=(new e.DD.Drag({node:i})).plug(e.Plugin.DDProxy,{resizeFrame:!1,moveOnEnd:!1});f.on("drag:start",function(){a.get("node").one(r.SELECTED)&&(s.select(),a.get("node").one(r.SELECTED).removeClass(n.SELECTED)),this.get("node").addClass(n.DRAGGEDNODE);var i=e.guid();this.get("dragNode").set("innerHTML",""),this.get("dragNode").addClass(n.DRAGNODE),MathJax.Hub.Queue(["addElement",MathJax.HTML,this.get("dragNode").getDOMNode(),"span",{id:i},[["math",{display:"block"},[e.JSON.parse(s.getItemByID(t[1].id))]]]]),MathJax.Hub.Queue(["Typeset",MathJax.Hub,i])}),f.on("drag:end",function(){this.get("node").removeClass(n.DRAGGEDNODE)})}var l=new e.DD.Drop({node:i});l.on("drop:hit",function(e){var n=e.drag.get("node").get("id");e.drag.get("data")?s.insertSnippet(t[1].id,s.createItem(e.drag.get("data"))):n!==t[1].id&&s.isItem(n)&&!a.get("node").one("#"+n).one("#"+t[1].id)&&s.insertSnippet(e.drop.get("node").get("id"),s.removeSnippet(n)),d()}),l.on("drop:enter",function(e){e.stopPropagation(),a.get("node").all(r.HIGHLIGHT).each(function(e){e.removeClass(n.HIGHLIGHT)}),this.get("node").addClass(n.HIGHLIGHT)}),l.on("drop:exit",function(e){e.stopPropagation(),this.get("node").removeClass(n.HIGHLIGHT)})})}function d(){s.rekey(),a.get("node").setHTML(""),MathJax.Hub.Queue(["addElement",MathJax.HTML,a.get("node").getDOMNode(),"math",{display:"block"},i]),MathJax.Hub.Queue(["Typeset",MathJax.Hub,"canvas"]),MathJax.Hub.Queue(p)}var i=[],s=new NS.mSlots;s.slots.push(i),this.workspace=e.one(t).append('
');var o=e.one(t).appendChild(e.Node.create("
")),u=e.one(t).appendChild(e.Node.create('
'));u.delegate("click",function(e){a.get("node").one("#"+this.getAttribute("id")).handleClick(e)},"div");var a=new e.DD.Drop({node:this.workspace.one("#canvas")});this.canvas=a,this.canvas.get("node").on("click",function(){s.select(),d()});var f=e.Node.create('"),l=e.Node.create('"),c=e.Node.create('"),h=e.Node.create('");o.appendChild(c),o.appendChild(f),o.appendChild(l),o.appendChild(h),l.on("click",function(){s=s.redo(),i=s.slots[0],d()}),f.on("click",function(){s=s.undo(),i=s.slots[0],d()}),c.on("click",function(){e.one(r.SELECTED)?s.removeSnippet(e.one(r.SELECTED).getAttribute("id")):(i=[],s.next=new NS.mSlots,s.next.previous=s,s=s.next,s.slots.push(i)),d()}),h.on("click",function(){u.setHTML('