first commit
This commit is contained in:
27
wp-content/plugins/wp-smart-editor/js/theme_editor.js
Normal file
27
wp-content/plugins/wp-smart-editor/js/theme_editor.js
Normal file
@@ -0,0 +1,27 @@
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
if (edt.modes === 'js') {
|
||||
edt.modes = 'javascript';
|
||||
}
|
||||
if (edt.modes === 'html') {
|
||||
edt.modes = 'xml';
|
||||
}
|
||||
var themeArea = document.getElementById('newcontent');
|
||||
height = themeArea.offsetHeight;
|
||||
template = document.getElementById('template');
|
||||
wrapper = document.createElement('div');
|
||||
|
||||
themeEditor = CodeMirror.fromTextArea(themeArea, {
|
||||
mode: edt.modes,
|
||||
lineNumbers: true,
|
||||
extraKeys: {"Ctrl-Space": "autocomplete"}
|
||||
});
|
||||
|
||||
wrapper.className = 'wpse-theme-editor';
|
||||
wrapper.appendChild(themeEditor.getWrapperElement());
|
||||
template.parentNode.insertBefore(wrapper, template);
|
||||
|
||||
themeEditor.setSize(null, height);
|
||||
themeEditor.refresh();
|
||||
});
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user