ace editor, markdown editor
This commit is contained in:
@ -39,14 +39,14 @@ tinymce.PluginManager.add('codemirror', function(editor, url) {
|
||||
};
|
||||
|
||||
// Add a button to the button bar
|
||||
editor.addButton('code', {
|
||||
editor.addButton('code_source', {
|
||||
title: 'Source code',
|
||||
image: url + '/img/file-html.png',
|
||||
onclick: showSourceEditor
|
||||
});
|
||||
|
||||
// Add a menu item to the tools menu
|
||||
editor.addMenuItem('code', {
|
||||
editor.addMenuItem('code_source', {
|
||||
icon: 'code',
|
||||
text: 'Source code',
|
||||
context: 'tools',
|
||||
|
@ -1 +1 @@
|
||||
tinymce.PluginManager.requireLangPack("codemirror"),tinymce.PluginManager.add("codemirror",function(e,o){function c(){e.focus(),e.selection.collapse(!0),e.selection.setContent('<span class="CmCaReT" style="display:none">�</span>');var c=$(document).height(),n=e.windowManager.open({title:"HTML source code",url:o+"/source.html",width:800,height:c-150,resizable:!0,maximizable:!0,buttons:[{text:"Ok",subtype:"primary",onclick:function(){var e=document.querySelectorAll(".mce-container-body>iframe")[0];e.contentWindow.submit(),n.close()}},{text:"Cancel",onclick:"close"}]})}e.addButton("code",{title:"Source code",image:o+"/img/file-html.png",onclick:c}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:c})});
|
||||
tinymce.PluginManager.requireLangPack("codemirror"),tinymce.PluginManager.add("codemirror",function(e,o){function c(){e.focus(),e.selection.collapse(!0),e.selection.setContent('<span class="CmCaReT" style="display:none">�</span>');var c=$(document).height(),n=e.windowManager.open({title:"HTML source code",url:o+"/source.html",width:800,height:c-150,resizable:!0,maximizable:!0,buttons:[{text:"Ok",subtype:"primary",onclick:function(){var e=document.querySelectorAll(".mce-container-body>iframe")[0];e.contentWindow.submit(),n.close()}},{text:"Cancel",onclick:"close"}]})}e.addButton("code_source",{title:"Source code",image:o+"/img/file-html.png",onclick:c}),e.addMenuItem("code_source",{icon:"code",text:"Source code",context:"tools",onclick:c})});
|
@ -119,6 +119,7 @@ function start()
|
||||
|
||||
// Set CodeMirror cursor to same position as cursor was in TinyMCE:
|
||||
var html = editor.getContent({source_view: true});
|
||||
// var html = editor.getBody().innerHTML; // life
|
||||
html = html.replace(/<span\s+class="CmCaReT"([^>]*)>([^<]*)<\/span>/gm, String.fromCharCode(chr));
|
||||
editor.dom.remove(editor.dom.select('.CmCaReT'));
|
||||
|
||||
|
Reference in New Issue
Block a user