Changeset 3256:e7ff4a1b3bc3
- Timestamp:
- 06/17/16 15:57:23 (9 years ago)
- Branch:
- default
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r3253 r3256 939 939 } 940 940 941 public static function js CodeMirror($theme = '',$multi = true,$modes = array('css','htmlmixed','javascript','php','xml'))941 public static function jsLoadCodeMirror($theme = '',$multi = true,$modes = array('css','htmlmixed','javascript','php','xml')) 942 942 { 943 943 $ret = … … 958 958 $ret .= self::cssLoad('js/codemirror/theme/'.$theme.'.css'); 959 959 } 960 return $ret; 961 } 962 963 public static function jsRunCodeMirror($name,$id,$mode,$theme = '') 964 { 965 $ret = 966 '<script type="text/javascript">'. 967 '//<![CDATA['."\n". 968 'var '.$name.' = CodeMirror.fromTextArea('.$id.',{'."\n". 969 ' mode: "'.$mode.'",'."\n". 970 ' tabMode: "indent",'."\n". 971 ' lineWrapping: "true",'."\n". 972 ' lineNumbers: "true",'."\n". 973 ' matchBrackets: "true",'."\n". 974 ' autoCloseBrackets: "true",'."\n". 975 ' extraKeys: {"F11": function(cm) {cm.setOption("fullScreen",!cm.getOption("fullScreen"));}}'; 976 if ($theme) { 977 $ret .= 978 ','."\n". 979 ' theme: "'.$theme.'"'; 980 } 981 $ret .= 982 "\n".'});'."\n". 983 '//]]>'. 984 '</script>'; 960 985 return $ret; 961 986 } -
plugins/themeEditor/index.php
r3253 r3256 83 83 <script type="text/javascript" src="<?php echo dcPage::getPF('themeEditor/script.js'); ?>"></script> 84 84 <?php if ($user_ui_colorsyntax) { ?> 85 <?php echo dcPage::js CodeMirror($user_ui_colorsyntax_theme); ?>85 <?php echo dcPage::jsLoadCodeMirror($user_ui_colorsyntax_theme); ?> 86 86 <?php } ?> 87 87 <?php echo dcPage::cssLoad(dcPage::getPF('themeEditor/style.css'));?> … … 144 144 (!empty($_REQUEST['po']) ? "text/plain" : "text/html"))); 145 145 echo 146 '<script> 146 '<script type="text/javascript"> 147 //<![CDATA[ 147 148 window.CodeMirror.defineMode("dotclear", function(config) { 148 149 return CodeMirror.multiplexingMode( … … 159 160 ); 160 161 }); 161 var editor = CodeMirror.fromTextArea(document.getElementById("file_content"), { 162 mode: "dotclear", 163 tabMode: "indent", 164 lineWrapping: "true", 165 lineNumbers: "true", 166 matchBrackets: "true", 167 autoCloseBrackets: "true", 168 extraKeys: { 169 "F11": function(cm) {cm.setOption("fullScreen",!cm.getOption("fullScreen"));} 170 }'. 171 ($user_ui_colorsyntax_theme != '' ? ',theme: "'.$user_ui_colorsyntax_theme.'"' : '').' 172 }); 162 //]]> 173 163 </script>'; 164 echo dcPage::jsRunCodeMirror('editor','file_content','dotclear',$user_ui_colorsyntax_theme); 174 165 } 175 166 }
Note: See TracChangeset
for help on using the changeset viewer.