diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-content/plugins/portfolio/bws_menu/js/general_script.js --- a/wp/wp-content/plugins/portfolio/bws_menu/js/general_script.js Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-content/plugins/portfolio/bws_menu/js/general_script.js Tue Dec 15 13:49:49 2020 +0100 @@ -21,9 +21,11 @@ }); /* custom code */ - if ( typeof CodeMirror == 'function' ) { + + if ( 'function' == typeof wp.CodeMirror || 'function' == typeof CodeMirror ) { + var CodeMirrorFunc = ( typeof wp.CodeMirror != 'undefined' ) ? wp.CodeMirror : CodeMirror; if ( $( '#bws_newcontent_css' ).length > 0 ) { - var editor = CodeMirror.fromTextArea( document.getElementById( 'bws_newcontent_css' ), { + var editor = CodeMirrorFunc.fromTextArea( document.getElementById( 'bws_newcontent_css' ), { mode: "css", theme: "default", styleActiveLine: true, @@ -34,7 +36,7 @@ } if ( $( '#bws_newcontent_php' ).length > 0 ) { - var editor = CodeMirror.fromTextArea( document.getElementById( "bws_newcontent_php" ), { + var editor = CodeMirrorFunc.fromTextArea( document.getElementById( "bws_newcontent_php" ), { mode: 'text/x-php', styleActiveLine: true, matchBrackets: true, @@ -45,7 +47,7 @@ } if ( $( '#bws_newcontent_js' ).length > 0 ) { - var editor = CodeMirror.fromTextArea( document.getElementById( "bws_newcontent_js" ), { + var editor = CodeMirrorFunc.fromTextArea( document.getElementById( "bws_newcontent_js" ), { mode: 'javascript', styleActiveLine: true, matchBrackets: true,