blocks
4 years ago
tinymce
4 years ago
script-insert.js
4 years ago
script-settings.js
4 years ago
script-tools.js
4 years ago
script.js
4 years ago
script-settings.js
31 lines
| 1 | (function($){ |
| 2 | $(document).ready(function(){ |
| 3 | |
| 4 | var init = function(){ |
| 5 | |
| 6 | load_codemirror(); |
| 7 | |
| 8 | } |
| 9 | |
| 10 | var load_codemirror = function(){ |
| 11 | |
| 12 | try{ |
| 13 | var editor = wp.codeEditor.initialize(document.getElementById('sc_default_content')); |
| 14 | |
| 15 | editor.codemirror.setSize( null, null ); |
| 16 | editor.codemirror.on('change', function(){ |
| 17 | editor.codemirror.save(); |
| 18 | }); |
| 19 | |
| 20 | window.sc_cm = editor.codemirror; |
| 21 | }catch(error){ |
| 22 | console.error('Shortcoder: Unable to load code editor.', error); |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |
| 28 | init(); |
| 29 | |
| 30 | }); |
| 31 | })( jQuery ); |