Changeset 3251:9ed815f75542
- Timestamp:
- 06/15/16 17:36:30 (9 years ago)
- Branch:
- default
- Files:
-
- 56 added
- 9 deleted
- 5 edited
-
admin/js/codemirror/LICENSE (added)
-
admin/js/codemirror/addon/edit/closebrackets.js (added)
-
admin/js/codemirror/addon/edit/matchbrackets.js (added)
-
admin/js/codemirror/addon/mode/multiplex.js (added)
-
admin/js/codemirror/lib/codemirror.css (added)
-
admin/js/codemirror/lib/codemirror.js (added)
-
admin/js/codemirror/mode/css/css.js (added)
-
admin/js/codemirror/mode/htmlmixed/htmlmixed.js (added)
-
admin/js/codemirror/mode/javascript/javascript.js (added)
-
admin/js/codemirror/mode/php/php.js (added)
-
admin/js/codemirror/mode/xml/xml.js (added)
-
admin/js/codemirror/theme/3024-day.css (added)
-
admin/js/codemirror/theme/3024-night.css (added)
-
admin/js/codemirror/theme/abcdef.css (added)
-
admin/js/codemirror/theme/ambiance-mobile.css (added)
-
admin/js/codemirror/theme/ambiance.css (added)
-
admin/js/codemirror/theme/base16-dark.css (added)
-
admin/js/codemirror/theme/base16-light.css (added)
-
admin/js/codemirror/theme/bespin.css (added)
-
admin/js/codemirror/theme/blackboard.css (added)
-
admin/js/codemirror/theme/cobalt.css (added)
-
admin/js/codemirror/theme/colorforth.css (added)
-
admin/js/codemirror/theme/dracula.css (added)
-
admin/js/codemirror/theme/eclipse.css (added)
-
admin/js/codemirror/theme/elegant.css (added)
-
admin/js/codemirror/theme/erlang-dark.css (added)
-
admin/js/codemirror/theme/hopscotch.css (added)
-
admin/js/codemirror/theme/icecoder.css (added)
-
admin/js/codemirror/theme/isotope.css (added)
-
admin/js/codemirror/theme/lesser-dark.css (added)
-
admin/js/codemirror/theme/liquibyte.css (added)
-
admin/js/codemirror/theme/material.css (added)
-
admin/js/codemirror/theme/mbo.css (added)
-
admin/js/codemirror/theme/mdn-like.css (added)
-
admin/js/codemirror/theme/midnight.css (added)
-
admin/js/codemirror/theme/monokai.css (added)
-
admin/js/codemirror/theme/neat.css (added)
-
admin/js/codemirror/theme/neo.css (added)
-
admin/js/codemirror/theme/night.css (added)
-
admin/js/codemirror/theme/paraiso-dark.css (added)
-
admin/js/codemirror/theme/paraiso-light.css (added)
-
admin/js/codemirror/theme/pastel-on-dark.css (added)
-
admin/js/codemirror/theme/railscasts.css (added)
-
admin/js/codemirror/theme/rubyblue.css (added)
-
admin/js/codemirror/theme/seti.css (added)
-
admin/js/codemirror/theme/solarized.css (added)
-
admin/js/codemirror/theme/the-matrix.css (added)
-
admin/js/codemirror/theme/tomorrow-night-bright.css (added)
-
admin/js/codemirror/theme/tomorrow-night-eighties.css (added)
-
admin/js/codemirror/theme/ttcn.css (added)
-
admin/js/codemirror/theme/twilight.css (added)
-
admin/js/codemirror/theme/vibrant-ink.css (added)
-
admin/js/codemirror/theme/xq-dark.css (added)
-
admin/js/codemirror/theme/xq-light.css (added)
-
admin/js/codemirror/theme/yeti.css (added)
-
admin/js/codemirror/theme/zenburn.css (added)
-
inc/admin/lib.dc.page.php (modified) (1 diff)
-
locales/fr/plugins.po (modified) (1 diff)
-
plugins/themeEditor/_admin.php (modified) (2 diffs)
-
plugins/themeEditor/_define.php (modified) (1 diff)
-
plugins/themeEditor/codemirror/LICENSE (deleted)
-
plugins/themeEditor/codemirror/codemirror.css (deleted)
-
plugins/themeEditor/codemirror/codemirror.js (deleted)
-
plugins/themeEditor/codemirror/css.js (deleted)
-
plugins/themeEditor/codemirror/htmlmixed.js (deleted)
-
plugins/themeEditor/codemirror/javascript.js (deleted)
-
plugins/themeEditor/codemirror/multiplex.js (deleted)
-
plugins/themeEditor/codemirror/php.js (deleted)
-
plugins/themeEditor/codemirror/xml.js (deleted)
-
plugins/themeEditor/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r3224 r3251 939 939 } 940 940 941 public static function jsCodeMirror($theme = '',$multi = true,$modes = array('css','htmlmixed','javascript','php','xml')) 942 { 943 $ret = 944 self::cssLoad('js/codemirror/lib/codemirror.css'). 945 self::jsLoad('js/codemirror/lib/codemirror.js'); 946 if ($multi) { 947 $ret .= self::jsLoad('js/codemirror/addon/mode/multiplex.js'); 948 } 949 foreach ($modes as $mode) { 950 $ret .= self::jsLoad('js/codemirror/mode/'.$mode.'/'.$mode.'.js'); 951 } 952 $ret .= 953 self::jsLoad('js/codemirror/addon/edit/closebrackets.js'). 954 self::jsLoad('js/codemirror/addon/edit/matchbrackets.js'); 955 if ($theme != '') { 956 $ret .= self::cssLoad('js/codemirror/theme/'.$theme.'.css'); 957 } 958 return $ret; 959 } 960 961 public static function getCodeMirrorThemes() 962 { 963 $themes = array(); 964 $themes_root = dirname(__FILE__).'/../../admin'.'/js/codemirror/theme/'; 965 if (is_dir($themes_root) && is_readable($themes_root)) { 966 if (($d = @dir($themes_root)) !== false) { 967 while (($entry = $d->read()) !== false) { 968 if ($entry != '.' && $entry != '..' && substr($entry, 0, 1) != '.' && is_readable($themes_root.'/'.$entry)) { 969 $themes[] = substr($entry,0,-4); // remove .css extension 970 } 971 } 972 } 973 } 974 return $themes; 975 } 976 941 977 public static function getPF($file) 942 978 { -
locales/fr/plugins.po
r3240 r3251 2016 2016 msgstr "Modifier les fichiers du thème" 2017 2017 2018 msgid "Syntax highlighting" 2019 msgstr "Coloration syntaxique" 2020 2018 2021 msgid "Syntax highlighting in theme editor" 2019 2022 msgstr "Coloration syntaxique de l'éditeur de thème" -
plugins/themeEditor/_admin.php
r2820 r3251 38 38 try { 39 39 $core->auth->user_prefs->interface->put('colorsyntax',!empty($_POST['colorsyntax']),'boolean'); 40 $core->auth->user_prefs->interface->put('colorsyntax_theme', 41 (!empty($_POST['colorsyntax_theme']) ? $_POST['colorsyntax_theme'] : '')); 40 42 } 41 43 catch (Exception $e) … … 50 52 $core->auth->user_prefs->addWorkspace('interface'); 51 53 54 $themes_list = dcPage::getCodeMirrorThemes(); 55 $themes_combo = array(__('Default') => ''); 56 foreach ($themes_list as $theme) { 57 $themes_combo[$theme] = $theme; 58 } 59 52 60 echo 53 '<p><label for="colorsyntax" class="classic">'. 54 form::checkbox('colorsyntax',1,$core->auth->user_prefs->interface->colorsyntax).'</label>'. 55 __('Syntax highlighting in theme editor'). 56 '</p>'; 61 '<div class="fieldset two-cols clearfix">'. 62 '<h5>'.__('Syntax highlighting').'</h5>'; 63 echo 64 '<div class="col">'. 65 '<p><label for="colorsyntax" class="classic">'. 66 form::checkbox('colorsyntax',1,$core->auth->user_prefs->interface->colorsyntax).'</label>'. 67 __('Syntax highlighting in theme editor'). 68 '</p>'; 69 if (count($themes_combo) > 1) { 70 echo 71 '<p><label for="colorsyntax_theme" class="classic">'.__('Theme:').'</label> '. 72 form::combo('colorsyntax_theme',$themes_combo,$core->auth->user_prefs->interface->colorsyntax_theme, 73 '','',false,'onchange="selectTheme()"'). 74 '</p>'; 75 } else { 76 echo form::hidden('colorsyntax_theme',''); 77 } 78 echo '</div>'; 79 echo '<div class="col">'; 80 echo dcPage::jsCodeMirror('',false,array('javascript')); 81 foreach ($themes_list as $theme) { 82 echo dcPage::cssLoad('js/codemirror/theme/'.$theme.'.css'); 83 } 84 echo ' 85 <textarea id="codemirror" name="codemirror"> 86 function findSequence(goal) { 87 function find(start, history) { 88 if (start == goal) 89 return history; 90 else if (start > goal) 91 return null; 92 else 93 return find(start + 5, "(" + history + " + 5)") || 94 find(start * 3, "(" + history + " * 3)"); 95 } 96 return find(1, "1"); 97 }</textarea>'; 98 echo 99 '<script> 100 var input = document.getElementById("colorsyntax_theme"); 101 var theme = input.options[input.selectedIndex].textContent; 102 var editor = CodeMirror.fromTextArea(document.getElementById("codemirror"), { 103 mode: "javascript", 104 tabMode: "indent", 105 lineWrapping: "true", 106 lineNumbers: "true", 107 matchBrackets: "true", 108 autoCloseBrackets: "true", 109 theme: "'.($core->auth->user_prefs->interface->colorsyntax_theme != '' ? $core->auth->user_prefs->interface->colorsyntax_theme : 'default').'" 110 }); 111 function selectTheme() { 112 var input = document.getElementById("colorsyntax_theme"); 113 var theme = input.options[input.selectedIndex].value; 114 if (theme == "") theme = "default"; 115 editor.setOption("theme", theme); 116 editor.refresh(); 117 } 118 </script>'; 119 echo '</div>'; 120 echo '</div>'; 57 121 } 58 122 } -
plugins/themeEditor/_define.php
r2890 r3251 16 16 /* Description*/ "Theme Editor", 17 17 /* Author */ "Olivier Meunier", 18 /* Version */ '1. 2',18 /* Version */ '1.3', 19 19 array( 20 20 'type' => 'plugin' -
plugins/themeEditor/index.php
r3021 r3251 19 19 $core->auth->user_prefs->addWorkspace('interface'); 20 20 $user_ui_colorsyntax = $core->auth->user_prefs->interface->colorsyntax; 21 $user_ui_colorsyntax_theme = $core->auth->user_prefs->interface->colorsyntax_theme; 21 22 22 23 # Loading themes … … 83 84 <script type="text/javascript" src="<?php echo dcPage::getPF('themeEditor/script.js'); ?>"></script> 84 85 <?php if ($user_ui_colorsyntax) { ?> 85 <?php echo dcPage::cssLoad(dcPage::getPF('themeEditor/codemirror/codemirror.css'));?> 86 <?php echo dcPage::cssLoad(dcPage::getPF('themeEditor/codemirror.css'));?> 87 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/codemirror.js'));?> 88 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/multiplex.js'));?> 89 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/xml.js'));?> 90 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/javascript.js'));?> 91 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/css.js'));?> 92 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/php.js'));?> 93 <?php echo dcPage::jsLoad(dcPage::getPF('themeEditor/codemirror/htmlmixed.js'));?> 86 <?php echo dcPage::jsCodeMirror($user_ui_colorsyntax_theme); ?> 94 87 <?php } ?> 95 88 </head> … … 171 164 lineWrapping: "true", 172 165 lineNumbers: "true", 173 matchBrackets: "true" 166 matchBrackets: "true", 167 autoCloseBrackets: "true"'. 168 ($user_ui_colorsyntax_theme != '' ? ',theme: "'.$user_ui_colorsyntax_theme.'"' : '').' 174 169 }); 175 170 </script>';
Note: See TracChangeset
for help on using the changeset viewer.
