Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function runEditorHighlighter(el) {
- fullscreen.switchmode('html');
- // <edit>
- var visualEditorEnabled;
- if (document.getElementById("content-tmce") != null)
- visualEditorEnabled = true;
- else visualEditorEnabled = false;
- if (visualEditorEnabled)
- switchEditors.switchto(document.getElementById("content-html"));
- // </edit>
- var editor = CodeMirror.fromTextArea(document.getElementById(el), {
- mode: "text/html",
- tabMode: "indent",
- lineNumbers: true,
- matchBrackets: true,
- indentUnit: 4,
- indentWithTabs: true,
- enterMode: "keep",
- lineWrapping: true,
- onCursorActivity: function() {
- editor.setLineClass(hlLine, null, null);
- hlLine = editor.setLineClass(editor.getCursor().line, null, "activeline");
- },
- onChange: function(){
- editor.save();
- }
- });
- var hlLine = editor.setLineClass(0, "activeline");
- // <edit>
- if (visualEditorEnabled) {
- document.getElementById("content-tmce").onclick = function(e){
- editor.toTextArea();
- switchEditors.switchto(document.getElementById("content-tmce"));
- document.getElementById("content-html").onclick = function(e){
- runEditorHighlighter("content");
- }
- }
- }
- // </edit>
- document.getElementById("qt_content_fullscreen").onclick = function(e){
- editor.toTextArea();
- fullscreen.switchmode('html');
- setTimeout('runEditorHighlighter("wp_mce_fullscreen")', 2000);
- document.getElementById("wp-fullscreen-close").onclick = function(e){
- fullscreen.off();
- runEditorHighlighter("content");
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement