Permalink
Browse files

feature:2262

Replace editarea by Codemirror:
http://codemirror.net

git-svn-id: http://piwigo.org/svn/trunk@10307 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information...
patdenice
patdenice committed Apr 12, 2011
1 parent bb7c28f commit a740ef91e6689f86011b70c7bbe2589abf78ae6b
Showing with 4,304 additions and 10,425 deletions.
  1. +9 −14 plugins/LocalFilesEditor/admin.php
  2. +31 −19 plugins/LocalFilesEditor/admin.tpl
  3. +53 −0 plugins/LocalFilesEditor/codemirror/lib/codemirror.css
  4. +1,915 −0 plugins/LocalFilesEditor/codemirror/lib/codemirror.js
  5. +51 −0 plugins/LocalFilesEditor/codemirror/lib/overlay.js
  6. +6 −0 plugins/LocalFilesEditor/codemirror/mode/clike/clike.css
  7. +181 −0 plugins/LocalFilesEditor/codemirror/mode/clike/clike.js
  8. +101 −0 plugins/LocalFilesEditor/codemirror/mode/clike/index.html
  9. +9 −0 plugins/LocalFilesEditor/codemirror/mode/css/css.css
  10. +124 −0 plugins/LocalFilesEditor/codemirror/mode/css/css.js
  11. +56 −0 plugins/LocalFilesEditor/codemirror/mode/css/index.html
  12. +3 −0 plugins/LocalFilesEditor/codemirror/mode/diff/diff.css
  13. +13 −0 plugins/LocalFilesEditor/codemirror/mode/diff/diff.js
  14. +99 −0 plugins/LocalFilesEditor/codemirror/mode/diff/index.html
  15. +25 −0 plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.css
  16. +242 −0 plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.js
  17. +59 −0 plugins/LocalFilesEditor/codemirror/mode/haskell/index.html
  18. +66 −0 plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js
  19. +54 −0 plugins/LocalFilesEditor/codemirror/mode/htmlmixed/index.html
  20. +78 −0 plugins/LocalFilesEditor/codemirror/mode/javascript/index.html
  21. +6 −0 plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css
  22. +348 −0 plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js
  23. +52 −0 plugins/LocalFilesEditor/codemirror/mode/php/index.html
  24. +83 −0 plugins/LocalFilesEditor/codemirror/mode/php/php.js
  25. +96 −0 plugins/LocalFilesEditor/codemirror/mode/stex/index.html
  26. +20 −0 plugins/LocalFilesEditor/codemirror/mode/stex/stex.css
  27. +167 −0 plugins/LocalFilesEditor/codemirror/mode/stex/stex.js
  28. +42 −0 plugins/LocalFilesEditor/codemirror/mode/xml/index.html
  29. +7 −0 plugins/LocalFilesEditor/codemirror/mode/xml/xml.css
  30. +206 −0 plugins/LocalFilesEditor/codemirror/mode/xml/xml.js
  31. +0 −491 plugins/LocalFilesEditor/editarea/autocompletion.js
  32. +0 −530 plugins/LocalFilesEditor/editarea/edit_area.css
  33. +0 −527 plugins/LocalFilesEditor/editarea/edit_area.js
  34. +0 −428 plugins/LocalFilesEditor/editarea/edit_area_compressor.php
  35. BIN plugins/LocalFilesEditor/editarea/edit_area_full.gz
  36. +0 −38 plugins/LocalFilesEditor/editarea/edit_area_full.js
  37. +0 −1,202 plugins/LocalFilesEditor/editarea/edit_area_functions.js
  38. +0 −1,081 plugins/LocalFilesEditor/editarea/edit_area_loader.js
  39. +0 −336 plugins/LocalFilesEditor/editarea/elements_functions.js
  40. +0 −407 plugins/LocalFilesEditor/editarea/highlight.js
  41. BIN plugins/LocalFilesEditor/editarea/images/autocompletion.gif
  42. BIN plugins/LocalFilesEditor/editarea/images/close.gif
  43. BIN plugins/LocalFilesEditor/editarea/images/fullscreen.gif
  44. BIN plugins/LocalFilesEditor/editarea/images/go_to_line.gif
  45. BIN plugins/LocalFilesEditor/editarea/images/help.gif
  46. BIN plugins/LocalFilesEditor/editarea/images/highlight.gif
  47. +0 −30 plugins/LocalFilesEditor/editarea/images/index.php
  48. BIN plugins/LocalFilesEditor/editarea/images/load.gif
  49. BIN plugins/LocalFilesEditor/editarea/images/move.gif
  50. BIN plugins/LocalFilesEditor/editarea/images/newdocument.gif
  51. BIN plugins/LocalFilesEditor/editarea/images/opacity.png
  52. BIN plugins/LocalFilesEditor/editarea/images/processing.gif
  53. BIN plugins/LocalFilesEditor/editarea/images/redo.gif
  54. BIN plugins/LocalFilesEditor/editarea/images/reset_highlight.gif
  55. BIN plugins/LocalFilesEditor/editarea/images/save.gif
  56. BIN plugins/LocalFilesEditor/editarea/images/search.gif
  57. BIN plugins/LocalFilesEditor/editarea/images/smooth_selection.gif
  58. BIN plugins/LocalFilesEditor/editarea/images/spacer.gif
  59. BIN plugins/LocalFilesEditor/editarea/images/statusbar_resize.gif
  60. BIN plugins/LocalFilesEditor/editarea/images/undo.gif
  61. BIN plugins/LocalFilesEditor/editarea/images/word_wrap.gif
  62. +0 −30 plugins/LocalFilesEditor/editarea/index.php
  63. +0 −145 plugins/LocalFilesEditor/editarea/keyboard.js
  64. +0 −54 plugins/LocalFilesEditor/editarea/langs/bg.js
  65. +0 −48 plugins/LocalFilesEditor/editarea/langs/cs.js
  66. +0 −48 plugins/LocalFilesEditor/editarea/langs/de.js
  67. +0 −48 plugins/LocalFilesEditor/editarea/langs/dk.js
  68. +0 −48 plugins/LocalFilesEditor/editarea/langs/en.js
  69. +0 −48 plugins/LocalFilesEditor/editarea/langs/eo.js
  70. +0 −48 plugins/LocalFilesEditor/editarea/langs/es.js
  71. +0 −48 plugins/LocalFilesEditor/editarea/langs/fi.js
  72. +0 −48 plugins/LocalFilesEditor/editarea/langs/fr.js
  73. +0 −48 plugins/LocalFilesEditor/editarea/langs/hr.js
  74. +0 −30 plugins/LocalFilesEditor/editarea/langs/index.php
  75. +0 −48 plugins/LocalFilesEditor/editarea/langs/it.js
  76. +0 −48 plugins/LocalFilesEditor/editarea/langs/ja.js
  77. +0 −48 plugins/LocalFilesEditor/editarea/langs/mk.js
  78. +0 −48 plugins/LocalFilesEditor/editarea/langs/nl.js
  79. +0 −48 plugins/LocalFilesEditor/editarea/langs/pl.js
  80. +0 −48 plugins/LocalFilesEditor/editarea/langs/pt.js
  81. +0 −48 plugins/LocalFilesEditor/editarea/langs/ru.js
  82. +0 −48 plugins/LocalFilesEditor/editarea/langs/sk.js
  83. +0 −48 plugins/LocalFilesEditor/editarea/langs/zh.js
  84. +0 −7 plugins/LocalFilesEditor/editarea/license_apache.txt
  85. +0 −10 plugins/LocalFilesEditor/editarea/license_bsd.txt
  86. +0 −458 plugins/LocalFilesEditor/editarea/license_lgpl.txt
  87. +0 −623 plugins/LocalFilesEditor/editarea/manage_area.js
  88. +0 −90 plugins/LocalFilesEditor/editarea/plugins/charmap/charmap.js
  89. +0 −64 plugins/LocalFilesEditor/editarea/plugins/charmap/css/charmap.css
  90. BIN plugins/LocalFilesEditor/editarea/plugins/charmap/images/charmap.gif
  91. +0 −373 plugins/LocalFilesEditor/editarea/plugins/charmap/jscripts/map.js
  92. +0 −12 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/bg.js
  93. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/cs.js
  94. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/de.js
  95. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/dk.js
  96. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/en.js
  97. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/eo.js
  98. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/es.js
  99. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/fr.js
  100. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/hr.js
  101. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/it.js
  102. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ja.js
  103. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/mk.js
  104. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/nl.js
  105. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pl.js
  106. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pt.js
  107. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ru.js
  108. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/sk.js
  109. +0 −6 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/zh.js
  110. +0 −24 plugins/LocalFilesEditor/editarea/plugins/charmap/popup.html
  111. +0 −3 plugins/LocalFilesEditor/editarea/plugins/test/css/test.css
  112. BIN plugins/LocalFilesEditor/editarea/plugins/test/images/test.gif
  113. +0 −10 plugins/LocalFilesEditor/editarea/plugins/test/langs/bg.js
  114. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/cs.js
  115. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/de.js
  116. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/dk.js
  117. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/en.js
  118. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/eo.js
  119. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/es.js
  120. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/fr.js
  121. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/hr.js
  122. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/it.js
  123. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/ja.js
  124. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/mk.js
  125. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/nl.js
  126. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/pl.js
  127. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/pt.js
  128. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/ru.js
  129. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/sk.js
  130. +0 −4 plugins/LocalFilesEditor/editarea/plugins/test/langs/zh.js
  131. +0 −110 plugins/LocalFilesEditor/editarea/plugins/test/test.js
  132. +0 −1 plugins/LocalFilesEditor/editarea/plugins/test/test2.js
  133. +0 −166 plugins/LocalFilesEditor/editarea/reg_syntax.js
  134. +0 −70 plugins/LocalFilesEditor/editarea/reg_syntax/basic.js
  135. +0 −45 plugins/LocalFilesEditor/editarea/reg_syntax/brainfuck.js
  136. +0 −63 plugins/LocalFilesEditor/editarea/reg_syntax/c.js
  137. +0 −120 plugins/LocalFilesEditor/editarea/reg_syntax/coldfusion.js
  138. +0 −66 plugins/LocalFilesEditor/editarea/reg_syntax/cpp.js
  139. +0 −85 plugins/LocalFilesEditor/editarea/reg_syntax/css.js
  140. +0 −51 plugins/LocalFilesEditor/editarea/reg_syntax/html.js
  141. +0 −30 plugins/LocalFilesEditor/editarea/reg_syntax/index.php
  142. +0 −57 plugins/LocalFilesEditor/editarea/reg_syntax/java.js
  143. +0 −94 plugins/LocalFilesEditor/editarea/reg_syntax/js.js
  144. +0 −83 plugins/LocalFilesEditor/editarea/reg_syntax/pas.js
  145. +0 −88 plugins/LocalFilesEditor/editarea/reg_syntax/perl.js
  146. +0 −157 plugins/LocalFilesEditor/editarea/reg_syntax/php.js
  147. +0 −145 plugins/LocalFilesEditor/editarea/reg_syntax/python.js
  148. +0 −25 plugins/LocalFilesEditor/editarea/reg_syntax/robotstxt.js
  149. +0 −68 plugins/LocalFilesEditor/editarea/reg_syntax/ruby.js
  150. +0 −56 plugins/LocalFilesEditor/editarea/reg_syntax/sql.js
  151. +0 −88 plugins/LocalFilesEditor/editarea/reg_syntax/tsql.js
  152. +0 −53 plugins/LocalFilesEditor/editarea/reg_syntax/vb.js
  153. +0 −57 plugins/LocalFilesEditor/editarea/reg_syntax/xml.js
  154. +0 −139 plugins/LocalFilesEditor/editarea/regexp.js
  155. +0 −73 plugins/LocalFilesEditor/editarea/resize_area.js
  156. +0 −174 plugins/LocalFilesEditor/editarea/search_replace.js
  157. +0 −100 plugins/LocalFilesEditor/editarea/template.html
  158. +2 −2 plugins/LocalFilesEditor/language/ar_SA/plugin.lang.php
  159. +2 −2 plugins/LocalFilesEditor/language/cs_CZ/plugin.lang.php
  160. +2 −2 plugins/LocalFilesEditor/language/de_DE/plugin.lang.php
  161. +2 −2 plugins/LocalFilesEditor/language/en_UK/plugin.lang.php
  162. +2 −2 plugins/LocalFilesEditor/language/es_ES/plugin.lang.php
  163. +2 −2 plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php
  164. +2 −2 plugins/LocalFilesEditor/language/he_IL/plugin.lang.php
  165. +3 −6 plugins/LocalFilesEditor/language/hr_HR/plugin.lang.php
  166. +2 −2 plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php
  167. +2 −2 plugins/LocalFilesEditor/language/it_IT/plugin.lang.php
  168. +2 −2 plugins/LocalFilesEditor/language/ja_JP/plugin.lang.php
  169. +2 −2 plugins/LocalFilesEditor/language/ka_GE/plugin.lang.php
  170. +2 −2 plugins/LocalFilesEditor/language/lv_LV/plugin.lang.php
  171. +2 −2 plugins/LocalFilesEditor/language/nl_NL/plugin.lang.php
  172. +3 −6 plugins/LocalFilesEditor/language/no_NO/plugin.lang.php
  173. +2 −2 plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php
  174. +2 −2 plugins/LocalFilesEditor/language/pt_PT/plugin.lang.php
  175. +2 −2 plugins/LocalFilesEditor/language/ru_RU/plugin.lang.php
  176. +2 −2 plugins/LocalFilesEditor/language/sk_SK/plugin.lang.php
  177. +2 −2 plugins/LocalFilesEditor/language/sr_RS/plugin.lang.php
  178. +2 −2 plugins/LocalFilesEditor/language/sv_SE/plugin.lang.php
  179. +2 −2 plugins/LocalFilesEditor/language/tr_TR/plugin.lang.php
  180. +2 −2 plugins/LocalFilesEditor/language/vi_VN/plugin.lang.php
  181. +2 −2 plugins/LocalFilesEditor/language/zh_CN/plugin.lang.php
  182. +12 −2 plugins/LocalFilesEditor/locfiledit.css
  183. +4 −10 plugins/LocalFilesEditor/show_default.php
  184. +36 −23 plugins/LocalFilesEditor/show_default.tpl
@@ -74,13 +74,6 @@
*/\n\n\n\n\n?>";
$newfile_page = isset($_GET['newfile']) ? true : false;
-// Editarea options
-$editarea_options = array(
- 'language' => substr($user['language'], 0, 2),
- 'start_highlight' => true,
- 'allow_toggle' => false,
- 'toolbar' => 'search,fullscreen, |,select_font, |, undo, redo, change_smooth_selection, highlight, reset_highlight, |, help');
-
// Edit selected file for CSS, template and language
if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
{
@@ -138,7 +131,7 @@
array('SHOW_DEFAULT' => LOCALEDIT_PATH
. 'show_default.php?file=include/config_default.inc.php',
'FILE' => 'config_default.inc.php')));
- $editarea_options['syntax'] = 'php';
+ $codemirror_mode = 'application/x-httpd-php';
break;
case 'css':
@@ -159,7 +152,7 @@
$template->assign('css_lang_tpl', array(
'OPTIONS' => $options,
'SELECTED' => $selected));
- $editarea_options['syntax'] = 'css';
+ $codemirror_mode = 'text/css';
break;
case 'tpl':
@@ -238,7 +231,7 @@
'NEW_FILE_URL' => $my_base_url.'-tpl&newfile',
'NEW_FILE_CLASS' => empty($edited_file) ? '' : 'top_right'));
- $editarea_options['syntax'] = 'html';
+ $codemirror_mode = 'text/html';
break;
case 'lang':
@@ -266,14 +259,14 @@
$template->assign('css_lang_tpl', array(
'OPTIONS' => $options,
'SELECTED' => $selected));
- $editarea_options['syntax'] = 'php';
+ $codemirror_mode = 'application/x-httpd-php';
break;
case 'plug':
$edited_file = PHPWG_PLUGINS_PATH . "PersonalPlugin/main.inc.php";
$content_file = file_exists($edited_file) ?
file_get_contents($edited_file) : $new_file['plug'];
- $editarea_options['syntax'] = 'php';
+ $codemirror_mode = 'application/x-httpd-php';
break;
}
@@ -367,8 +360,10 @@
$template->assign(array(
'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin-LocalFilesEditor-'.$page['tab'],
'LOCALEDIT_PATH' => LOCALEDIT_PATH,
- 'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
- 'EDITAREA_OPTIONS' => $editarea_options));
+ 'LOAD_CODEMIRROR' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
+ 'CODEMIRROR_MODE' => @$codemirror_mode
+ )
+);
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
@@ -1,28 +1,37 @@
-{html_head}<script type="text/javascript" src="{$ROOT_URL}plugins/LocalFilesEditor/editarea/edit_area_full.js"></script>{/html_head}
+{combine_script id="codemirror" path="plugins/LocalFilesEditor/codemirror/lib/codemirror.js"}
+{combine_script id="codemirror.xml" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.js"}
+{combine_script id="codemirror.javascript" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js"}
+{combine_script id="codemirror.css" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/css/css.js"}
+{combine_script id="codemirror.clike" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.js"}
+{combine_script id="codemirror.htmlmixed" require="codemirror.xml,codemirror.javascript,codemirror.css" path="plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js"}
+{combine_script id="codemirror.php" require="codemirror.xml,codemirror.javascript,codemirror.css,codemirror.clike" path="plugins/LocalFilesEditor/codemirror/mode/php/php.js"}
+
+{combine_css path="plugins/LocalFilesEditor/codemirror/lib/codemirror.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/css/css.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.css"}
{combine_css path="plugins/LocalFilesEditor/locfiledit.css"}
+
{footer_script}
-function loadEditarea() {ldelim}
- editAreaLoader.init({ldelim}
- id: "text"
- {foreach from=$EDITAREA_OPTIONS key=option item=value}
- , {$option}: {$value|editarea_quote}
- {/foreach}
+function loadCodemirror() {ldelim}
+ editor = CodeMirror.fromTextArea(document.getElementById("text"), {ldelim}
+ matchBrackets: true,
+ mode: "{$CODEMIRROR_MODE}",
+ tabMode: "shift"
});
- jQuery("#showedit").hide();
- jQuery("#hideedit").show();
+ jQuery("#showedit, #hideedit").toggle();
jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "on"});
}
-function unloadEditarea() {ldelim}
- editAreaLoader.delete_instance("text");
- jQuery("#hideedit").hide();
- jQuery("#showedit").show();
+function unloadCodemirror() {ldelim}
+ editor.toTextArea();
+ jQuery("#showedit, #hideedit").toggle();
jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "off"});
}
-jQuery("#editarea_buttons").show();
-{if $LOAD_EDITAREA == 'on'}
-if (document.getElementById("text") != null) loadEditarea();
+{if $LOAD_CODEMIRROR == 'on'}
+if (document.getElementById("text") != null) loadCodemirror();
{/if}
{/footer_script}
@@ -66,10 +75,11 @@ if (document.getElementById("text") != null) loadEditarea();
{/if}
{/if}
+<div style="overflow:auto;"> {* top bar buttons *}
{if !empty($show_default)}
{foreach from=$show_default item=file name=default_loop}
<span class="top_right">
-<a href="{$file.SHOW_DEFAULT}" onclick="window.open( this.href, 'local_file', 'location=no,toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=800,height=600' ); return false;">{'locfiledit_show_default'|@translate} "{$file.FILE}"</a>
+<a href="{$file.SHOW_DEFAULT}" onclick="window.open( this.href, 'local_file', 'location=no,toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=800,height=700' ); return false;">{'locfiledit_show_default'|@translate} "{$file.FILE}"</a>
</span>
{if !($smarty.foreach.default_loop.last)}<br>{/if}
{/foreach}
@@ -78,10 +88,12 @@ if (document.getElementById("text") != null) loadEditarea();
{if isset ($zone_edit)}
<b>{$zone_edit.FILE_NAME}</b>
+</div> {* top bar buttons *}
+
<textarea rows="30" cols="90" name="text" id="text">{$zone_edit.CONTENT_FILE}</textarea>
<div id="editarea_buttons">
-<a href="javascript:loadEditarea();" id="showedit">[{'locfiledit_enable_editarea'|@translate}]</a>
-<a href="javascript:unloadEditarea();" id="hideedit">[{'locfiledit_disable_editarea'|@translate}]</a>
+<a href="javascript:loadCodemirror();" id="showedit">[{'locfiledit_enable_codemirror'|@translate}]</a>
+<a href="javascript:unloadCodemirror();" id="hideedit">[{'locfiledit_disable_codemirror'|@translate}]</a>
</div>
<br>
@@ -0,0 +1,53 @@
+.CodeMirror {
+ overflow: auto;
+ height: 300px;
+ line-height: 1em;
+ font-family: monospace;
+ _position: relative; /* IE6 hack */
+}
+
+.CodeMirror-gutter {
+ position: absolute; left: 0; top: 0;
+ background-color: #f7f7f7;
+ border-right: 1px solid #eee;
+ min-width: 2em;
+ height: 100%;
+}
+.CodeMirror-gutter-text {
+ color: #aaa;
+ text-align: right;
+ padding: .4em .2em .4em .4em;
+}
+.CodeMirror-lines {
+ padding: .4em;
+}
+
+.CodeMirror pre {
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ -o-border-radius: 0;
+ border-radius: 0;
+ border-width: 0; margin: 0; padding: 0; background: transparent;
+ font-family: inherit;
+}
+
+.CodeMirror-cursor {
+ z-index: 10;
+ position: absolute;
+ visibility: hidden;
+ border-left: 1px solid black !important;
+}
+.CodeMirror-focused .CodeMirror-cursor {
+ visibility: visible;
+}
+
+span.CodeMirror-selected {
+ background: #ccc !important;
+ color: HighlightText !important;
+}
+.CodeMirror-focused span.CodeMirror-selected {
+ background: Highlight !important;
+}
+
+.CodeMirror-matchingbracket {color: #0f0 !important;}
+.CodeMirror-nonmatchingbracket {color: #f22 !important;}
Oops, something went wrong.

0 comments on commit a740ef9

Please sign in to comment.