-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplugin.min.js
36 lines (33 loc) · 981 Bytes
/
plugin.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var editor_width = 500;
if($(window).width() < 500){
editor_width = $(window).width()-100
}
tinymce.PluginManager.add('math_editor', function(editor, url) {
editor = editor
editor.addButton('math_editor',
{
title : 'MathQuill Based Editor',
image : url + '/img/math.png',
onclick : function() {
editor.windowManager.open({
title: "Math Editor",
url: url+'/index.html',
width: editor_width,
height: 400
});
}
});
editor.on('DblClick', function(ed, e) {
element = $(ed.target);
if(!element.hasClass('matheditor-formula')){ return; }
latex_n = element.data('latex')
editor.selection.collapse();
editor.windowManager.open({
title: "Math Editor",
url: url+'/index.html',
width: editor_width,
height: 400
});
editor.windowManager.setParams({prefill_latex: latex_n});
});
});