From a740ef91e6689f86011b70c7bbe2589abf78ae6b Mon Sep 17 00:00:00 2001 From: patdenice Date: Tue, 12 Apr 2011 11:12:51 +0000 Subject: feature:2262 Replace editarea by Codemirror: http://codemirror.net git-svn-id: http://piwigo.org/svn/trunk@10307 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/LocalFilesEditor/admin.php | 23 +- plugins/LocalFilesEditor/admin.tpl | 50 +- .../LocalFilesEditor/codemirror/lib/codemirror.css | 53 + .../LocalFilesEditor/codemirror/lib/codemirror.js | 1915 ++++++++++++++++++++ plugins/LocalFilesEditor/codemirror/lib/overlay.js | 51 + .../codemirror/mode/clike/clike.css | 6 + .../codemirror/mode/clike/clike.js | 181 ++ .../codemirror/mode/clike/index.html | 101 ++ .../LocalFilesEditor/codemirror/mode/css/css.css | 9 + .../LocalFilesEditor/codemirror/mode/css/css.js | 124 ++ .../codemirror/mode/css/index.html | 56 + .../LocalFilesEditor/codemirror/mode/diff/diff.css | 3 + .../LocalFilesEditor/codemirror/mode/diff/diff.js | 13 + .../codemirror/mode/diff/index.html | 99 + .../codemirror/mode/haskell/haskell.css | 25 + .../codemirror/mode/haskell/haskell.js | 242 +++ .../codemirror/mode/haskell/index.html | 59 + .../codemirror/mode/htmlmixed/htmlmixed.js | 66 + .../codemirror/mode/htmlmixed/index.html | 54 + .../codemirror/mode/javascript/index.html | 78 + .../codemirror/mode/javascript/javascript.css | 6 + .../codemirror/mode/javascript/javascript.js | 348 ++++ .../codemirror/mode/php/index.html | 52 + .../LocalFilesEditor/codemirror/mode/php/php.js | 83 + .../codemirror/mode/stex/index.html | 96 + .../LocalFilesEditor/codemirror/mode/stex/stex.css | 20 + .../LocalFilesEditor/codemirror/mode/stex/stex.js | 167 ++ .../codemirror/mode/xml/index.html | 42 + .../LocalFilesEditor/codemirror/mode/xml/xml.css | 7 + .../LocalFilesEditor/codemirror/mode/xml/xml.js | 206 +++ .../LocalFilesEditor/editarea/autocompletion.js | 491 ----- plugins/LocalFilesEditor/editarea/edit_area.css | 530 ------ plugins/LocalFilesEditor/editarea/edit_area.js | 527 ------ .../editarea/edit_area_compressor.php | 428 ----- .../LocalFilesEditor/editarea/edit_area_full.gz | Bin 29377 -> 0 bytes .../LocalFilesEditor/editarea/edit_area_full.js | 38 - .../editarea/edit_area_functions.js | 1202 ------------ .../LocalFilesEditor/editarea/edit_area_loader.js | 1081 ----------- .../editarea/elements_functions.js | 336 ---- plugins/LocalFilesEditor/editarea/highlight.js | 407 ----- .../editarea/images/autocompletion.gif | Bin 359 -> 0 bytes plugins/LocalFilesEditor/editarea/images/close.gif | Bin 102 -> 0 bytes .../editarea/images/fullscreen.gif | Bin 198 -> 0 bytes .../editarea/images/go_to_line.gif | Bin 1053 -> 0 bytes plugins/LocalFilesEditor/editarea/images/help.gif | Bin 295 -> 0 bytes .../LocalFilesEditor/editarea/images/highlight.gif | Bin 256 -> 0 bytes plugins/LocalFilesEditor/editarea/images/index.php | 30 - plugins/LocalFilesEditor/editarea/images/load.gif | Bin 1041 -> 0 bytes plugins/LocalFilesEditor/editarea/images/move.gif | Bin 257 -> 0 bytes .../editarea/images/newdocument.gif | Bin 170 -> 0 bytes .../LocalFilesEditor/editarea/images/opacity.png | Bin 147 -> 0 bytes .../editarea/images/processing.gif | Bin 825 -> 0 bytes plugins/LocalFilesEditor/editarea/images/redo.gif | Bin 169 -> 0 bytes .../editarea/images/reset_highlight.gif | Bin 168 -> 0 bytes plugins/LocalFilesEditor/editarea/images/save.gif | Bin 285 -> 0 bytes .../LocalFilesEditor/editarea/images/search.gif | Bin 191 -> 0 bytes .../editarea/images/smooth_selection.gif | Bin 174 -> 0 bytes .../LocalFilesEditor/editarea/images/spacer.gif | Bin 43 -> 0 bytes .../editarea/images/statusbar_resize.gif | Bin 79 -> 0 bytes plugins/LocalFilesEditor/editarea/images/undo.gif | Bin 175 -> 0 bytes .../LocalFilesEditor/editarea/images/word_wrap.gif | Bin 951 -> 0 bytes plugins/LocalFilesEditor/editarea/index.php | 30 - plugins/LocalFilesEditor/editarea/keyboard.js | 145 -- plugins/LocalFilesEditor/editarea/langs/bg.js | 54 - plugins/LocalFilesEditor/editarea/langs/cs.js | 48 - plugins/LocalFilesEditor/editarea/langs/de.js | 48 - plugins/LocalFilesEditor/editarea/langs/dk.js | 48 - plugins/LocalFilesEditor/editarea/langs/en.js | 48 - plugins/LocalFilesEditor/editarea/langs/eo.js | 48 - plugins/LocalFilesEditor/editarea/langs/es.js | 48 - plugins/LocalFilesEditor/editarea/langs/fi.js | 48 - plugins/LocalFilesEditor/editarea/langs/fr.js | 48 - plugins/LocalFilesEditor/editarea/langs/hr.js | 48 - plugins/LocalFilesEditor/editarea/langs/index.php | 30 - plugins/LocalFilesEditor/editarea/langs/it.js | 48 - plugins/LocalFilesEditor/editarea/langs/ja.js | 48 - plugins/LocalFilesEditor/editarea/langs/mk.js | 48 - plugins/LocalFilesEditor/editarea/langs/nl.js | 48 - plugins/LocalFilesEditor/editarea/langs/pl.js | 48 - plugins/LocalFilesEditor/editarea/langs/pt.js | 48 - plugins/LocalFilesEditor/editarea/langs/ru.js | 48 - plugins/LocalFilesEditor/editarea/langs/sk.js | 48 - plugins/LocalFilesEditor/editarea/langs/zh.js | 48 - .../LocalFilesEditor/editarea/license_apache.txt | 7 - plugins/LocalFilesEditor/editarea/license_bsd.txt | 10 - plugins/LocalFilesEditor/editarea/license_lgpl.txt | 458 ----- plugins/LocalFilesEditor/editarea/manage_area.js | 623 ------- .../editarea/plugins/charmap/charmap.js | 90 - .../editarea/plugins/charmap/css/charmap.css | 64 - .../editarea/plugins/charmap/images/charmap.gif | Bin 245 -> 0 bytes .../editarea/plugins/charmap/jscripts/map.js | 373 ---- .../editarea/plugins/charmap/langs/bg.js | 12 - .../editarea/plugins/charmap/langs/cs.js | 6 - .../editarea/plugins/charmap/langs/de.js | 6 - .../editarea/plugins/charmap/langs/dk.js | 6 - .../editarea/plugins/charmap/langs/en.js | 6 - .../editarea/plugins/charmap/langs/eo.js | 6 - .../editarea/plugins/charmap/langs/es.js | 6 - .../editarea/plugins/charmap/langs/fr.js | 6 - .../editarea/plugins/charmap/langs/hr.js | 6 - .../editarea/plugins/charmap/langs/it.js | 6 - .../editarea/plugins/charmap/langs/ja.js | 6 - .../editarea/plugins/charmap/langs/mk.js | 6 - .../editarea/plugins/charmap/langs/nl.js | 6 - .../editarea/plugins/charmap/langs/pl.js | 6 - .../editarea/plugins/charmap/langs/pt.js | 6 - .../editarea/plugins/charmap/langs/ru.js | 6 - .../editarea/plugins/charmap/langs/sk.js | 6 - .../editarea/plugins/charmap/langs/zh.js | 6 - .../editarea/plugins/charmap/popup.html | 24 - .../editarea/plugins/test/css/test.css | 3 - .../editarea/plugins/test/images/test.gif | Bin 87 -> 0 bytes .../editarea/plugins/test/langs/bg.js | 10 - .../editarea/plugins/test/langs/cs.js | 4 - .../editarea/plugins/test/langs/de.js | 4 - .../editarea/plugins/test/langs/dk.js | 4 - .../editarea/plugins/test/langs/en.js | 4 - .../editarea/plugins/test/langs/eo.js | 4 - .../editarea/plugins/test/langs/es.js | 4 - .../editarea/plugins/test/langs/fr.js | 4 - .../editarea/plugins/test/langs/hr.js | 4 - .../editarea/plugins/test/langs/it.js | 4 - .../editarea/plugins/test/langs/ja.js | 4 - .../editarea/plugins/test/langs/mk.js | 4 - .../editarea/plugins/test/langs/nl.js | 4 - .../editarea/plugins/test/langs/pl.js | 4 - .../editarea/plugins/test/langs/pt.js | 4 - .../editarea/plugins/test/langs/ru.js | 4 - .../editarea/plugins/test/langs/sk.js | 4 - .../editarea/plugins/test/langs/zh.js | 4 - .../LocalFilesEditor/editarea/plugins/test/test.js | 110 -- .../editarea/plugins/test/test2.js | 1 - plugins/LocalFilesEditor/editarea/reg_syntax.js | 166 -- .../LocalFilesEditor/editarea/reg_syntax/basic.js | 70 - .../editarea/reg_syntax/brainfuck.js | 45 - plugins/LocalFilesEditor/editarea/reg_syntax/c.js | 63 - .../editarea/reg_syntax/coldfusion.js | 120 -- .../LocalFilesEditor/editarea/reg_syntax/cpp.js | 66 - .../LocalFilesEditor/editarea/reg_syntax/css.js | 85 - .../LocalFilesEditor/editarea/reg_syntax/html.js | 51 - .../LocalFilesEditor/editarea/reg_syntax/index.php | 30 - .../LocalFilesEditor/editarea/reg_syntax/java.js | 57 - plugins/LocalFilesEditor/editarea/reg_syntax/js.js | 94 - .../LocalFilesEditor/editarea/reg_syntax/pas.js | 83 - .../LocalFilesEditor/editarea/reg_syntax/perl.js | 88 - .../LocalFilesEditor/editarea/reg_syntax/php.js | 157 -- .../LocalFilesEditor/editarea/reg_syntax/python.js | 145 -- .../editarea/reg_syntax/robotstxt.js | 25 - .../LocalFilesEditor/editarea/reg_syntax/ruby.js | 68 - .../LocalFilesEditor/editarea/reg_syntax/sql.js | 56 - .../LocalFilesEditor/editarea/reg_syntax/tsql.js | 88 - plugins/LocalFilesEditor/editarea/reg_syntax/vb.js | 53 - .../LocalFilesEditor/editarea/reg_syntax/xml.js | 57 - plugins/LocalFilesEditor/editarea/regexp.js | 139 -- plugins/LocalFilesEditor/editarea/resize_area.js | 73 - .../LocalFilesEditor/editarea/search_replace.js | 174 -- plugins/LocalFilesEditor/editarea/template.html | 100 - .../language/ar_SA/plugin.lang.php | 4 +- .../language/cs_CZ/plugin.lang.php | 4 +- .../language/de_DE/plugin.lang.php | 4 +- .../language/en_UK/plugin.lang.php | 4 +- .../language/es_ES/plugin.lang.php | 4 +- .../language/fr_FR/plugin.lang.php | 4 +- .../language/he_IL/plugin.lang.php | 4 +- .../language/hr_HR/plugin.lang.php | 9 +- .../language/hu_HU/plugin.lang.php | 4 +- .../language/it_IT/plugin.lang.php | 4 +- .../language/ja_JP/plugin.lang.php | 4 +- .../language/ka_GE/plugin.lang.php | 4 +- .../language/lv_LV/plugin.lang.php | 4 +- .../language/nl_NL/plugin.lang.php | 4 +- .../language/no_NO/plugin.lang.php | 9 +- .../language/pl_PL/plugin.lang.php | 4 +- .../language/pt_PT/plugin.lang.php | 4 +- .../language/ru_RU/plugin.lang.php | 4 +- .../language/sk_SK/plugin.lang.php | 4 +- .../language/sr_RS/plugin.lang.php | 4 +- .../language/sv_SE/plugin.lang.php | 4 +- .../language/tr_TR/plugin.lang.php | 4 +- .../language/vi_VN/plugin.lang.php | 4 +- .../language/zh_CN/plugin.lang.php | 4 +- plugins/LocalFilesEditor/locfiledit.css | 14 +- plugins/LocalFilesEditor/show_default.php | 14 +- plugins/LocalFilesEditor/show_default.tpl | 59 +- 184 files changed, 4304 insertions(+), 10425 deletions(-) create mode 100644 plugins/LocalFilesEditor/codemirror/lib/codemirror.css create mode 100644 plugins/LocalFilesEditor/codemirror/lib/codemirror.js create mode 100644 plugins/LocalFilesEditor/codemirror/lib/overlay.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/clike/clike.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/clike/clike.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/clike/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/css/css.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/css/css.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/css/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/diff/diff.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/diff/diff.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/diff/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/haskell/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/htmlmixed/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/javascript/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/php/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/php/php.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/stex/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/stex/stex.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/stex/stex.js create mode 100644 plugins/LocalFilesEditor/codemirror/mode/xml/index.html create mode 100644 plugins/LocalFilesEditor/codemirror/mode/xml/xml.css create mode 100644 plugins/LocalFilesEditor/codemirror/mode/xml/xml.js delete mode 100644 plugins/LocalFilesEditor/editarea/autocompletion.js delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area.css delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area.js delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area_compressor.php delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area_full.gz delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area_full.js delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area_functions.js delete mode 100644 plugins/LocalFilesEditor/editarea/edit_area_loader.js delete mode 100644 plugins/LocalFilesEditor/editarea/elements_functions.js delete mode 100644 plugins/LocalFilesEditor/editarea/highlight.js delete mode 100644 plugins/LocalFilesEditor/editarea/images/autocompletion.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/close.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/fullscreen.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/go_to_line.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/help.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/highlight.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/index.php delete mode 100644 plugins/LocalFilesEditor/editarea/images/load.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/move.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/newdocument.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/opacity.png delete mode 100644 plugins/LocalFilesEditor/editarea/images/processing.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/redo.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/reset_highlight.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/save.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/search.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/smooth_selection.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/spacer.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/statusbar_resize.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/undo.gif delete mode 100644 plugins/LocalFilesEditor/editarea/images/word_wrap.gif delete mode 100644 plugins/LocalFilesEditor/editarea/index.php delete mode 100644 plugins/LocalFilesEditor/editarea/keyboard.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/bg.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/cs.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/de.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/dk.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/en.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/eo.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/es.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/fi.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/fr.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/hr.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/index.php delete mode 100644 plugins/LocalFilesEditor/editarea/langs/it.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/ja.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/mk.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/nl.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/pl.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/pt.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/ru.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/sk.js delete mode 100644 plugins/LocalFilesEditor/editarea/langs/zh.js delete mode 100644 plugins/LocalFilesEditor/editarea/license_apache.txt delete mode 100644 plugins/LocalFilesEditor/editarea/license_bsd.txt delete mode 100644 plugins/LocalFilesEditor/editarea/license_lgpl.txt delete mode 100644 plugins/LocalFilesEditor/editarea/manage_area.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/charmap.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/css/charmap.css delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/images/charmap.gif delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/jscripts/map.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/bg.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/cs.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/de.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/dk.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/en.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/eo.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/es.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/fr.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/hr.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/it.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ja.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/mk.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/nl.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pl.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pt.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ru.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/sk.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/langs/zh.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/charmap/popup.html delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/css/test.css delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/images/test.gif delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/bg.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/cs.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/de.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/dk.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/en.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/eo.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/es.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/fr.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/hr.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/it.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/ja.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/mk.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/nl.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/pl.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/pt.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/ru.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/sk.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/langs/zh.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/test.js delete mode 100644 plugins/LocalFilesEditor/editarea/plugins/test/test2.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/basic.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/brainfuck.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/c.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/coldfusion.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/cpp.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/css.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/html.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/index.php delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/java.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/js.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/pas.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/perl.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/php.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/python.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/robotstxt.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/ruby.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/sql.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/tsql.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/vb.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/xml.js delete mode 100644 plugins/LocalFilesEditor/editarea/regexp.js delete mode 100644 plugins/LocalFilesEditor/editarea/resize_area.js delete mode 100644 plugins/LocalFilesEditor/editarea/search_replace.js delete mode 100644 plugins/LocalFilesEditor/editarea/template.html diff --git a/plugins/LocalFilesEditor/admin.php b/plugins/LocalFilesEditor/admin.php index 8295e19a8..a9205cfac 100644 --- a/plugins/LocalFilesEditor/admin.php +++ b/plugins/LocalFilesEditor/admin.php @@ -74,13 +74,6 @@ Author URI: */\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 @@ switch ($page['tab']) 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 @@ switch ($page['tab']) $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 @@ switch ($page['tab']) '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 @@ switch ($page['tab']) $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 @@ if (!empty($edited_file)) $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'); diff --git a/plugins/LocalFilesEditor/admin.tpl b/plugins/LocalFilesEditor/admin.tpl index 72880dd05..bffd2ef44 100644 --- a/plugins/LocalFilesEditor/admin.tpl +++ b/plugins/LocalFilesEditor/admin.tpl @@ -1,28 +1,37 @@ -{html_head}{/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} +
{* top bar buttons *} {if !empty($show_default)} {foreach from=$show_default item=file name=default_loop} -{'locfiledit_show_default'|@translate} "{$file.FILE}" +{'locfiledit_show_default'|@translate} "{$file.FILE}" {if !($smarty.foreach.default_loop.last)}
{/if} {/foreach} @@ -78,10 +88,12 @@ if (document.getElementById("text") != null) loadEditarea(); {if isset ($zone_edit)} {$zone_edit.FILE_NAME} +
{* top bar buttons *} +
-[{'locfiledit_enable_editarea'|@translate}] -[{'locfiledit_disable_editarea'|@translate}] +[{'locfiledit_enable_codemirror'|@translate}] +[{'locfiledit_disable_codemirror'|@translate}]

diff --git a/plugins/LocalFilesEditor/codemirror/lib/codemirror.css b/plugins/LocalFilesEditor/codemirror/lib/codemirror.css new file mode 100644 index 000000000..578af41ae --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/lib/codemirror.css @@ -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;} diff --git a/plugins/LocalFilesEditor/codemirror/lib/codemirror.js b/plugins/LocalFilesEditor/codemirror/lib/codemirror.js new file mode 100644 index 000000000..390e68c1f --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/lib/codemirror.js @@ -0,0 +1,1915 @@ +// All functions that need access to the editor's state live inside +// the CodeMirror function. Below that, at the bottom of the file, +// some utilities are defined. + +// CodeMirror is the only global var we claim +var CodeMirror = (function() { + // This is the function that produces an editor instance. It's + // closure is used to store the editor state. + function CodeMirror(place, givenOptions) { + // Determine effective options based on given values and defaults. + var options = {}, defaults = CodeMirror.defaults; + for (var opt in defaults) + if (defaults.hasOwnProperty(opt)) + options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt]; + + // The element in which the editor lives. Takes care of scrolling + // (if enabled). + var wrapper = document.createElement("div"); + wrapper.className = "CodeMirror"; + // This mess creates the base DOM structure for the editor. + wrapper.innerHTML = + '
' + // Set to the height of the text, causes scrolling + '
' + // To measure line/char size
+           'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' + + '
' + // Moved around its parent to cover visible view + '
' + + '
' + // Wraps and hides input textarea + '
' + + // Provides positioning relative to (visible) text origin + '
' + + '
 
' + // Absolutely positioned blinky cursor + '
'; // This DIV contains the actual code + if (place.appendChild) place.appendChild(wrapper); else place(wrapper); + // I've never seen more elegant code in my life. + var code = wrapper.firstChild, measure = code.firstChild, mover = measure.nextSibling, + gutter = mover.firstChild, gutterText = gutter.firstChild, + inputDiv = gutter.nextSibling, input = inputDiv.firstChild, + lineSpace = inputDiv.nextSibling.firstChild, cursor = lineSpace.firstChild, lineDiv = cursor.nextSibling; + if (options.tabindex != null) input.tabindex = options.tabindex; + if (!options.gutter && !options.lineNumbers) gutter.style.display = "none"; + + // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval. + var poll = new Delayed(), highlight = new Delayed(), blinker; + + // mode holds a mode API object. lines an array of Line objects + // (see Line constructor), work an array of lines that should be + // parsed, and history the undo history (instance of History + // constructor). + var mode, lines = [new Line("")], work, history = new History(), focused; + loadMode(); + // The selection. These are always maintained to point at valid + // positions. Inverted is used to remember that the user is + // selecting bottom-to-top. + var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false}; + // Selection-related flags. shiftSelecting obviously tracks + // whether the user is holding shift. reducedSelection is a hack + // to get around the fact that we can't create inverted + // selections. See below. + var shiftSelecting, reducedSelection; + // Variables used by startOperation/endOperation to track what + // happened during the operation. + var updateInput, changes, textChanged, selectionChanged, leaveInputAlone; + // Current visible range (may be bigger than the view window). + var showingFrom = 0, showingTo = 0, lastHeight = 0, curKeyId = null; + // editing will hold an object describing the things we put in the + // textarea, to help figure out whether something changed. + // bracketHighlighted is used to remember that a backet has been + // marked. + var editing, bracketHighlighted; + + // Initialize the content. Somewhat hacky (delayed prepareInput) + // to work around browser issues. + operation(function(){setValue(options.value || ""); updateInput = false;})(); + setTimeout(prepareInput, 20); + + // Register our event handlers. + connect(wrapper, "mousedown", operation(onMouseDown)); + // Gecko browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for Gecko. + if (!gecko) connect(wrapper, "contextmenu", operation(onContextMenu)); + connect(code, "dblclick", operation(onDblClick)); + connect(wrapper, "scroll", function() {updateDisplay([]); if (options.onScroll) options.onScroll(instance);}); + connect(window, "resize", function() {updateDisplay(true);}); + connect(input, "keyup", operation(onKeyUp)); + connect(input, "keydown", operation(onKeyDown)); + connect(input, "keypress", operation(onKeyPress)); + connect(input, "focus", onFocus); + connect(input, "blur", onBlur); + + connect(wrapper, "dragenter", function(e){e.stop();}); + connect(wrapper, "dragover", function(e){e.stop();}); + connect(wrapper, "drop", operation(onDrop)); + connect(wrapper, "paste", function(){input.focus(); fastPoll();}); + connect(input, "paste", function(){fastPoll();}); + connect(input, "cut", function(){fastPoll();}); + + if (document.activeElement == input) onFocus(); + else onBlur(); + + function isLine(l) {return l >= 0 && l < lines.length;} + // The instance object that we'll return. Mostly calls out to + // local functions in the CodeMirror function. Some do some extra + // range checking and/or clipping. operation is used to wrap the + // call so that changes it makes are tracked, and the display is + // updated afterwards. + var instance = { + getValue: getValue, + setValue: operation(setValue), + getSelection: getSelection, + replaceSelection: operation(replaceSelection), + focus: function(){input.focus(); onFocus(); fastPoll();}, + setOption: function(option, value) { + options[option] = value; + if (option == "lineNumbers" || option == "gutter") gutterChanged(); + else if (option == "mode" || option == "indentUnit") loadMode(); + }, + getOption: function(option) {return options[option];}, + undo: operation(undo), + redo: operation(redo), + indentLine: operation(function(n) {if (isLine(n)) indentLine(n, "smart");}), + historySize: function() {return {undo: history.done.length, redo: history.undone.length};}, + matchBrackets: operation(function(){matchBrackets(true);}), + getTokenAt: function(pos) { + pos = clipPos(pos); + return lines[pos.line].getTokenAt(mode, getStateBefore(pos.line), pos.ch); + }, + cursorCoords: function(start){ + if (start == null) start = sel.inverted; + return pageCoords(start ? sel.from : sel.to); + }, + charCoords: function(pos){return pageCoords(clipPos(pos));}, + coordsChar: function(coords) { + var off = eltOffset(lineSpace); + var line = Math.min(showingTo - 1, showingFrom + Math.floor(coords.y / lineHeight())); + return clipPos({line: line, ch: charFromX(clipLine(line), coords.x)}); + }, + getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);}, + markText: operation(function(a, b, c){return operation(markText(a, b, c));}), + setMarker: addGutterMarker, + clearMarker: removeGutterMarker, + setLineClass: operation(setLineClass), + lineInfo: lineInfo, + addWidget: function(pos, node, scroll) { + var pos = localCoords(clipPos(pos), true); + node.style.top = (showingFrom * lineHeight() + pos.yBot + paddingTop()) + "px"; + node.style.left = (pos.x + paddingLeft()) + "px"; + code.appendChild(node); + if (scroll) + scrollIntoView(pos.x, pos.yBot, pos.x + node.offsetWidth, pos.yBot + node.offsetHeight); + }, + + lineCount: function() {return lines.length;}, + getCursor: function(start) { + if (start == null) start = sel.inverted; + return copyPos(start ? sel.from : sel.to); + }, + somethingSelected: function() {return !posEq(sel.from, sel.to);}, + setCursor: operation(function(line, ch) { + if (ch == null && typeof line.line == "number") setCursor(line.line, line.ch); + else setCursor(line, ch); + }), + setSelection: operation(function(from, to) {setSelection(clipPos(from), clipPos(to || from));}), + getLine: function(line) {if (isLine(line)) return lines[line].text;}, + setLine: operation(function(line, text) { + if (isLine(line)) replaceRange(text, {line: line, ch: 0}, {line: line, ch: lines[line].text.length}); + }), + removeLine: operation(function(line) { + if (isLine(line)) replaceRange("", {line: line, ch: 0}, clipPos({line: line+1, ch: 0})); + }), + replaceRange: operation(replaceRange), + getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));}, + + operation: function(f){return operation(f)();}, + refresh: function(){updateDisplay(true);}, + getInputField: function(){return input;}, + getWrapperElement: function(){return wrapper;} + }; + + function setValue(code) { + history = null; + var top = {line: 0, ch: 0}; + updateLines(top, {line: lines.length - 1, ch: lines[lines.length-1].text.length}, + splitLines(code), top, top); + history = new History(); + } + function getValue(code) { + var text = []; + for (var i = 0, l = lines.length; i < l; ++i) + text.push(lines[i].text); + return text.join("\n"); + } + + function onMouseDown(e) { + // First, see if this is a click in the gutter + for (var n = e.target(); n != wrapper; n = n.parentNode) + if (n.parentNode == gutterText) { + if (options.onGutterClick) + options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom); + return e.stop(); + } + + if (gecko && e.button() == 3) onContextMenu(e); + if (e.button() != 1) return; + // For button 1, if it was clicked inside the editor + // (posFromMouse returning non-null), we have to adjust the + // selection. + var start = posFromMouse(e), last = start, going; + if (!start) {if (e.target() == wrapper) e.stop(); return;} + setCursor(start.line, start.ch, false); + + if (!focused) onFocus(); + e.stop(); + // And then we have to see if it's a drag event, in which case + // the dragged-over text must be selected. + function end() { + input.focus(); + updateInput = true; + move(); up(); + } + function extend(e) { + var cur = posFromMouse(e, true); + if (cur && !posEq(cur, last)) { + if (!focused) onFocus(); + last = cur; + setSelection(start, cur); + updateInput = false; + var visible = visibleLines(); + if (cur.line >= visible.to || cur.line < visible.from) + going = setTimeout(operation(function(){extend(e);}), 150); + } + } + + var move = connect(document, "mousemove", operation(function(e) { + clearTimeout(going); + e.stop(); + extend(e); + }), true); + var up = connect(document, "mouseup", operation(function(e) { + clearTimeout(going); + var cur = posFromMouse(e); + if (cur) setSelection(start, cur); + e.stop(); + end(); + }), true); + } + function onDblClick(e) { + var pos = posFromMouse(e); + if (!pos) return; + selectWordAt(pos); + e.stop(); + } + function onDrop(e) { + var pos = posFromMouse(e, true), files = e.e.dataTransfer.files; + if (!pos || options.readOnly) return; + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + function loadFile(file, i) { + var reader = new FileReader; + reader.onload = function() { + text[i] = reader.result; + if (++read == n) replaceRange(text.join(""), clipPos(pos), clipPos(pos)); + }; + reader.readAsText(file); + } + } + else { + try { + var text = e.e.dataTransfer.getData("Text"); + if (text) replaceRange(text, pos, pos); + } + catch(e){} + } + } + function onKeyDown(e) { + if (!focused) onFocus(); + + var code = e.e.keyCode; + // Tries to detect ctrl on non-mac, cmd on mac. + var mod = (mac ? e.e.metaKey : e.e.ctrlKey) && !e.e.altKey, anyMod = e.e.ctrlKey || e.e.altKey || e.e.metaKey; + if (code == 16 || e.e.shiftKey) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from); + else shiftSelecting = null; + // First give onKeyEvent option a chance to handle this. + if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return; + + if (code == 33 || code == 34) {scrollPage(code == 34); return e.stop();} // page up/down + if (mod && (code == 36 || code == 35)) {scrollEnd(code == 36); return e.stop();} // ctrl-home/end + if (mod && code == 65) {selectAll(); return e.stop();} // ctrl-a + if (!options.readOnly) { + if (!anyMod && code == 13) {return;} // enter + if (!anyMod && code == 9 && handleTab(e.e.shiftKey)) return e.stop(); // tab + if (mod && code == 90) {undo(); return e.stop();} // ctrl-z + if (mod && ((e.e.shiftKey && code == 90) || code == 89)) {redo(); return e.stop();} // ctrl-shift-z, ctrl-y + } + + // Key id to use in the movementKeys map. We also pass it to + // fastPoll in order to 'self learn'. We need this because + // reducedSelection, the hack where we collapse the selection to + // its start when it is inverted and a movement key is pressed + // (and later restore it again), shouldn't be used for + // non-movement keys. + curKeyId = (mod ? "c" : "") + code; + if (sel.inverted && movementKeys.hasOwnProperty(curKeyId)) { + var range = selRange(input); + if (range) { + reducedSelection = {anchor: range.start}; + setSelRange(input, range.start, range.start); + } + } + fastPoll(curKeyId); + } + function onKeyUp(e) { + if (reducedSelection) { + reducedSelection = null; + updateInput = true; + } + if (e.e.keyCode == 16) shiftSelecting = null; + } + function onKeyPress(e) { + if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return; + if (options.electricChars && mode.electricChars) { + var ch = String.fromCharCode(e.e.charCode == null ? e.e.keyCode : e.e.charCode); + if (mode.electricChars.indexOf(ch) > -1) + setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 50); + } + var code = e.e.keyCode; + // Re-stop tab and enter. Necessary on some browsers. + if (code == 13) {handleEnter(); e.stop();} + else if (code == 9 && options.tabMode != "default") e.stop(); + else fastPoll(curKeyId); + } + + function onFocus() { + if (!focused && options.onFocus) options.onFocus(instance); + focused = true; + slowPoll(); + if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1) + wrapper.className += " CodeMirror-focused"; + restartBlink(); + } + function onBlur() { + if (focused && options.onBlur) options.onBlur(instance); + clearInterval(blinker); + shiftSelecting = null; + focused = false; + wrapper.className = wrapper.className.replace(" CodeMirror-focused", ""); + } + + // Replace the range from from to to by the strings in newText. + // Afterwards, set the selection to selFrom, selTo. + function updateLines(from, to, newText, selFrom, selTo) { + if (history) { + var old = []; + for (var i = from.line, e = to.line + 1; i < e; ++i) old.push(lines[i].text); + history.addChange(from.line, newText.length, old); + while (history.done.length > options.undoDepth) history.done.shift(); + } + updateLinesNoUndo(from, to, newText, selFrom, selTo); + } + function unredoHelper(from, to) { + var change = from.pop(); + if (change) { + var replaced = [], end = change.start + change.added; + for (var i = change.start; i < end; ++i) replaced.push(lines[i].text); + to.push({start: change.start, added: change.old.length, old: replaced}); + var pos = clipPos({line: change.start + change.old.length - 1, + ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])}); + updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: lines[end-1].text.length}, change.old, pos, pos); + } + } + function undo() {unredoHelper(history.done, history.undone);} + function redo() {unredoHelper(history.undone, history.done);} + + function updateLinesNoUndo(from, to, newText, selFrom, selTo) { + var nlines = to.line - from.line, firstLine = lines[from.line], lastLine = lines[to.line]; + // First adjust the line structure, taking some care to leave highlighting intact. + if (firstLine == lastLine) { + if (newText.length == 1) + firstLine.replace(from.ch, to.ch, newText[0]); + else { + lastLine = firstLine.split(to.ch, newText[newText.length-1]); + var spliceargs = [from.line + 1, nlines]; + firstLine.replace(from.ch, firstLine.text.length, newText[0]); + for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i])); + spliceargs.push(lastLine); + lines.splice.apply(lines, spliceargs); + } + } + else if (newText.length == 1) { + firstLine.replace(from.ch, firstLine.text.length, newText[0] + lastLine.text.slice(to.ch)); + lines.splice(from.line + 1, nlines); + } + else { + var spliceargs = [from.line + 1, nlines - 1]; + firstLine.replace(from.ch, firstLine.text.length, newText[0]); + lastLine.replace(0, to.ch, newText[newText.length-1]); + for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i])); + lines.splice.apply(lines, spliceargs); + } + + // Add these lines to the work array, so that they will be + // highlighted. Adjust work lines if lines were added/removed. + var newWork = [], lendiff = newText.length - nlines - 1; + for (var i = 0, l = work.length; i < l; ++i) { + var task = work[i]; + if (task < from.line) newWork.push(task); + else if (task > to.line) newWork.push(task + lendiff); + } + if (newText.length) newWork.push(from.line); + work = newWork; + startWorker(100); + // Remember that these lines changed, for updating the display + changes.push({from: from.line, to: to.line + 1, diff: lendiff}); + textChanged = true; + + // Update the selection + function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;} + setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line)); + + // Make sure the scroll-size div has the correct height. + code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px"; + } + + function replaceRange(code, from, to) { + from = clipPos(from); + if (!to) to = from; else to = clipPos(to); + code = splitLines(code); + function adjustPos(pos) { + if (posLess(pos, from)) return pos; + if (!posLess(to, pos)) return end; + var line = pos.line + code.length - (to.line - from.line) - 1; + var ch = pos.ch; + if (pos.line == to.line) + ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0)); + return {line: line, ch: ch}; + } + var end; + replaceRange1(code, from, to, function(end1) { + end = end1; + return {from: adjustPos(sel.from), to: adjustPos(sel.to)}; + }); + return end; + } + function replaceSelection(code, collapse) { + replaceRange1(splitLines(code), sel.from, sel.to, function(end) { + if (collapse == "end") return {from: end, to: end}; + else if (collapse == "start") return {from: sel.from, to: sel.from}; + else return {from: sel.from, to: end}; + }); + } + function replaceRange1(code, from, to, computeSel) { + var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length; + var newSel = computeSel({line: from.line + code.length - 1, ch: endch}); + updateLines(from, to, code, newSel.from, newSel.to); + } + + function getRange(from, to) { + var l1 = from.line, l2 = to.line; + if (l1 == l2) return lines[l1].text.slice(from.ch, to.ch); + var code = [lines[l1].text.slice(from.ch)]; + for (var i = l1 + 1; i < l2; ++i) code.push(lines[i].text); + code.push(lines[l2].text.slice(0, to.ch)); + return code.join("\n"); + } + function getSelection() { + return getRange(sel.from, sel.to); + } + + var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll + function slowPoll() { + if (pollingFast) return; + poll.set(2000, function() { + startOperation(); + readInput(); + if (focused) slowPoll(); + endOperation(); + }); + } + function fastPoll(keyId) { + var missed = false; + pollingFast = true; + function p() { + startOperation(); + var changed = readInput(); + if (changed == "moved" && keyId) movementKeys[keyId] = true; + if (!changed && !missed) {missed = true; poll.set(80, p);} + else {pollingFast = false; slowPoll();} + endOperation(); + } + poll.set(20, p); + } + + // Inspects the textarea, compares its state (content, selection) + // to the data in the editing variable, and updates the editor + // content or cursor if something changed. + function readInput() { + var changed = false, text = input.value, sr = selRange(input); + if (!sr) return false; + var changed = editing.text != text, rs = reducedSelection; + var moved = changed || sr.start != editing.start || sr.end != (rs ? editing.start : editing.end); + if (reducedSelection && !moved && sel.from.line == 0 && sel.from.ch == 0) + reducedSelection = null; + else if (!moved) return false; + if (changed) { + shiftSelecting = reducedSelection = null; + if (options.readOnly) {updateInput = true; return "changed";} + } + + // Compute selection start and end based on start/end offsets in textarea + function computeOffset(n, startLine) { + var pos = 0; + for (;;) { + var found = text.indexOf("\n", pos); + if (found == -1 || (text.charAt(found-1) == "\r" ? found - 1 : found) >= n) + return {line: startLine, ch: n - pos}; + ++startLine; + pos = found + 1; + } + } + var from = computeOffset(sr.start, editing.from), + to = computeOffset(sr.end, editing.from); + // Here we have to take the reducedSelection hack into account, + // so that you can, for example, press shift-up at the start of + // your selection and have the right thing happen. + if (rs) { + from = sr.start == rs.anchor ? to : from; + to = shiftSelecting ? sel.to : sr.start == rs.anchor ? from : to; + if (!posLess(from, to)) { + reducedSelection = null; + sel.inverted = false; + var tmp = from; from = to; to = tmp; + } + } + + // In some cases (cursor on same line as before), we don't have + // to update the textarea content at all. + if (from.line == to.line && from.line == sel.from.line && from.line == sel.to.line && !shiftSelecting) + updateInput = false; + + // Magic mess to extract precise edited range from the changed + // string. + if (changed) { + var start = 0, end = text.length, len = Math.min(end, editing.text.length); + var c, line = editing.from, nl = -1; + while (start < len && (c = text.charAt(start)) == editing.text.charAt(start)) { + ++start; + if (c == "\n") {line++; nl = start;} + } + var ch = nl > -1 ? start - nl : start, endline = editing.to - 1, edend = editing.text.length; + for (;;) { + c = editing.text.charAt(edend); + if (c == "\n") endline--; + if (text.charAt(end) != c) {++end; ++edend; break;} + if (edend <= start || end <= start) break; + --end; --edend; + } + var nl = editing.text.lastIndexOf("\n", edend - 1), endch = nl == -1 ? edend : edend - nl - 1; + updateLines({line: line, ch: ch}, {line: endline, ch: endch}, splitLines(text.slice(start, end)), from, to); + if (line != endline || from.line != line) updateInput = true; + } + else setSelection(from, to); + + editing.text = text; editing.start = sr.start; editing.end = sr.end; + return changed ? "changed" : moved ? "moved" : false; + } + + // Set the textarea content and selection range to match the + // editor state. + function prepareInput() { + var text = []; + var from = Math.max(0, sel.from.line - 1), to = Math.min(lines.length, sel.to.line + 2); + for (var i = from; i < to; ++i) text.push(lines[i].text); + text = input.value = text.join(lineSep); + var startch = sel.from.ch, endch = sel.to.ch; + for (var i = from; i < sel.from.line; ++i) + startch += lineSep.length + lines[i].text.length; + for (var i = from; i < sel.to.line; ++i) + endch += lineSep.length + lines[i].text.length; + editing = {text: text, from: from, to: to, start: startch, end: endch}; + setSelRange(input, startch, reducedSelection ? startch : endch); + } + + function scrollCursorIntoView() { + var cursor = localCoords(sel.inverted ? sel.from : sel.to); + return scrollIntoView(cursor.x, cursor.y, cursor.x, cursor.yBot); + } + function scrollIntoView(x1, y1, x2, y2) { + var pl = paddingLeft(), pt = paddingTop(); + y1 += pt; y2 += pt; x1 += pl; x2 += pl; + var screen = wrapper.clientHeight, screentop = wrapper.scrollTop, scrolled = false, result = true; + if (y1 < screentop) {wrapper.scrollTop = Math.max(0, y1 - 10); scrolled = true;} + else if (y2 > screentop + screen) {wrapper.scrollTop = y2 + 10 - screen; scrolled = true;} + + var screenw = wrapper.clientWidth, screenleft = wrapper.scrollLeft; + if (x1 < screenleft) {wrapper.scrollLeft = Math.max(0, x1 - 10); scrolled = true;} + else if (x2 > screenw + screenleft) { + wrapper.scrollLeft = x2 + 10 - screenw; + scrolled = true; + if (x2 > code.clientWidth) result = false; + } + if (scrolled && options.onScroll) options.onScroll(instance); + return result; + } + + function visibleLines() { + var lh = lineHeight(), top = wrapper.scrollTop - paddingTop(); + return {from: Math.min(lines.length, Math.max(0, Math.floor(top / lh))), + to: Math.min(lines.length, Math.ceil((top + wrapper.clientHeight) / lh))}; + } + // Uses a set of changes plus the current scroll position to + // determine which DOM updates have to be made, and makes the + // updates. + function updateDisplay(changes) { + if (!wrapper.clientWidth) { + showingFrom = showingTo = 0; + return; + } + // First create a range of theoretically intact lines, and punch + // holes in that using the change info. + var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}]; + for (var i = 0, l = changes.length || 0; i < l; ++i) { + var change = changes[i], intact2 = [], diff = change.diff || 0; + for (var j = 0, l2 = intact.length; j < l2; ++j) { + var range = intact[j]; + if (change.to <= range.from) + intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart}); + else if (range.to <= change.from) + intact2.push(range); + else { + if (change.from > range.from) + intact2.push({from: range.from, to: change.from, domStart: range.domStart}) + if (change.to < range.to) + intact2.push({from: change.to + diff, to: range.to + diff, + domStart: range.domStart + (change.to - range.from)}); + } + } + intact = intact2; + } + + // Then, determine which lines we'd want to see, and which + // updates have to be made to get there. + var visible = visibleLines(); + var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)), + to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)), + updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0; + + for (var i = 0, l = intact.length; i < l; ++i) { + var range = intact[i]; + if (range.to <= from) continue; + if (range.from >= to) break; + if (range.domStart > domPos || range.from > pos) { + updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos}); + changedLines += range.from - pos; + } + pos = range.to; + domPos = range.domStart + (range.to - range.from); + } + if (domPos != domEnd || pos != to) { + changedLines += Math.abs(to - pos); + updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos}); + } + + if (!updates.length) return; + lineDiv.style.display = "none"; + // If more than 30% of the screen needs update, just do a full + // redraw (which is quicker than patching) + if (changedLines > (visible.to - visible.from) * .3) + refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length)); + // Otherwise, only update the stuff that needs updating. + else + patchDisplay(updates); + lineDiv.style.display = ""; + + // Position the mover div to align with the lines it's supposed + // to be showing (which will cover the visible display) + var different = from != showingFrom || to != showingTo || lastHeight != wrapper.clientHeight; + showingFrom = from; showingTo = to; + mover.style.top = (from * lineHeight()) + "px"; + if (different) { + lastHeight = wrapper.clientHeight; + code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px"; + updateGutter(); + } + + // Since this is all rather error prone, it is honoured with the + // only assertion in the whole file. + if (lineDiv.childNodes.length != showingTo - showingFrom) + throw new Error("BAD PATCH! " + JSON.stringify(updates) + " size=" + (showingTo - showingFrom) + + " nodes=" + lineDiv.childNodes.length); + updateCursor(); + } + + function refreshDisplay(from, to) { + var html = [], start = {line: from, ch: 0}, inSel = posLess(sel.from, start) && !posLess(sel.to, start); + for (var i = from; i < to; ++i) { + var ch1 = null, ch2 = null; + if (inSel) { + ch1 = 0; + if (sel.to.line == i) {inSel = false; ch2 = sel.to.ch;} + } + else if (sel.from.line == i) { + if (sel.to.line == i) {ch1 = sel.from.ch; ch2 = sel.to.ch;} + else {inSel = true; ch1 = sel.from.ch;} + } + html.push(lines[i].getHTML(ch1, ch2, true)); + } + lineDiv.innerHTML = html.join(""); + } + function patchDisplay(updates) { + // Slightly different algorithm for IE (badInnerHTML), since + // there .innerHTML on PRE nodes is dumb, and discards + // whitespace. + var sfrom = sel.from.line, sto = sel.to.line, off = 0, + scratch = badInnerHTML && document.createElement("div"); + for (var i = 0, e = updates.length; i < e; ++i) { + var rec = updates[i]; + var extra = (rec.to - rec.from) - rec.domSize; + var nodeAfter = lineDiv.childNodes[rec.domStart + rec.domSize + off] || null; + if (badInnerHTML) + for (var j = Math.max(-extra, rec.domSize); j > 0; --j) + lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild); + else if (extra) { + for (var j = Math.max(0, extra); j > 0; --j) + lineDiv.insertBefore(document.createElement("pre"), nodeAfter); + for (var j = Math.max(0, -extra); j > 0; --j) + lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild); + } + var node = lineDiv.childNodes[rec.domStart + off], inSel = sfrom < rec.from && sto >= rec.from; + for (var j = rec.from; j < rec.to; ++j) { + var ch1 = null, ch2 = null; + if (inSel) { + ch1 = 0; + if (sto == j) {inSel = false; ch2 = sel.to.ch;} + } + else if (sfrom == j) { + if (sto == j) {ch1 = sel.from.ch; ch2 = sel.to.ch;} + else {inSel = true; ch1 = sel.from.ch;} + } + if (badInnerHTML) { + scratch.innerHTML = lines[j].getHTML(ch1, ch2, true); + lineDiv.insertBefore(scratch.firstChild, nodeAfter); + } + else { + node.innerHTML = lines[j].getHTML(ch1, ch2, false); + node.className = lines[j].className || ""; + node = node.nextSibling; + } + } + off += extra; + } + } + + function updateGutter() { + if (!options.gutter && !options.lineNumbers) return; + var hText = mover.offsetHeight, hEditor = wrapper.clientHeight; + gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px"; + var html = []; + for (var i = showingFrom; i < showingTo; ++i) { + var marker = lines[i].gutterMarker; + var text = options.lineNumbers ? i + options.firstLineNumber : null; + if (marker && marker.text) + text = marker.text.replace("%N%", text != null ? text : ""); + else if (text == null) + text = "\u00a0"; + html.push((marker && marker.style ? '
' : "
"), text, "
"); + } + gutter.style.display = "none"; + gutterText.innerHTML = html.join(""); + var minwidth = String(lines.length).length, firstNode = gutterText.firstChild, val = eltText(firstNode), pad = ""; + while (val.length + pad.length < minwidth) pad += "\u00a0"; + if (pad) firstNode.insertBefore(document.createTextNode(pad), firstNode.firstChild); + gutter.style.display = ""; + lineSpace.style.marginLeft = gutter.offsetWidth + "px"; + } + function updateCursor() { + var head = sel.inverted ? sel.from : sel.to; + var x = charX(head.line, head.ch) + "px", y = (head.line - showingFrom) * lineHeight() + "px"; + inputDiv.style.top = y; inputDiv.style.left = x; + if (posEq(sel.from, sel.to)) { + cursor.style.top = y; cursor.style.left = x; + cursor.style.display = ""; + } + else cursor.style.display = "none"; + } + + // Update the selection. Last two args are only used by + // updateLines, since they have to be expressed in the line + // numbers before the update. + function setSelection(from, to, oldFrom, oldTo) { + if (posEq(sel.from, from) && posEq(sel.to, to)) return; + var sh = shiftSelecting && clipPos(shiftSelecting); + if (posLess(to, from)) {var tmp = to; to = from; from = tmp;} + if (sh) { + if (posLess(sh, from)) from = sh; + else if (posLess(to, sh)) to = sh; + } + + var startEq = posEq(sel.to, to), endEq = posEq(sel.from, from); + if (posEq(from, to)) sel.inverted = false; + else if (startEq && !endEq) sel.inverted = true; + else if (endEq && !startEq) sel.inverted = false; + + // Some ugly logic used to only mark the lines that actually did + // see a change in selection as changed, rather than the whole + // selected range. + if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;} + if (posEq(from, to)) { + if (!posEq(sel.from, sel.to)) + changes.push({from: oldFrom, to: oldTo + 1}); + } + else if (posEq(sel.from, sel.to)) { + changes.push({from: from.line, to: to.line + 1}); + } + else { + if (!posEq(from, sel.from)) { + if (from.line < oldFrom) + changes.push({from: from.line, to: Math.min(to.line, oldFrom) + 1}); + else + changes.push({from: oldFrom, to: Math.min(oldTo, from.line) + 1}); + } + if (!posEq(to, sel.to)) { + if (to.line < oldTo) + changes.push({from: Math.max(oldFrom, from.line), to: oldTo + 1}); + else + changes.push({from: Math.max(from.line, oldTo), to: to.line + 1}); + } + } + sel.from = from; sel.to = to; + selectionChanged = true; + } + function setCursor(line, ch) { + var pos = clipPos({line: line, ch: ch || 0}); + setSelection(pos, pos); + } + + function clipLine(n) {return Math.max(0, Math.min(n, lines.length-1));} + function clipPos(pos) { + if (pos.line < 0) return {line: 0, ch: 0}; + if (pos.line >= lines.length) return {line: lines.length-1, ch: lines[lines.length-1].text.length}; + var ch = pos.ch, linelen = lines[pos.line].text.length; + if (ch == null || ch > linelen) return {line: pos.line, ch: linelen}; + else if (ch < 0) return {line: pos.line, ch: 0}; + else return pos; + } + + function scrollPage(down) { + var linesPerPage = Math.floor(wrapper.clientHeight / lineHeight()), head = sel.inverted ? sel.from : sel.to; + setCursor(head.line + (Math.max(linesPerPage - 1, 1) * (down ? 1 : -1)), head.ch); + } + function scrollEnd(top) { + setCursor(top ? 0 : lines.length - 1); + } + function selectAll() { + var endLine = lines.length - 1; + setSelection({line: 0, ch: 0}, {line: endLine, ch: lines[endLine].text.length}); + } + function selectWordAt(pos) { + var line = lines[pos.line].text; + var start = pos.ch, end = pos.ch; + while (start > 0 && /\w/.test(line.charAt(start - 1))) --start; + while (end < line.length - 1 && /\w/.test(line.charAt(end))) ++end; + setSelection({line: pos.line, ch: start}, {line: pos.line, ch: end}); + } + function handleEnter() { + replaceSelection("\n", "end"); + if (options.enterMode != "flat") + indentLine(sel.from.line, options.enterMode == "keep" ? "prev" : "smart"); + } + function handleTab(shift) { + shiftSelecting = null; + switch (options.tabMode) { + case "default": + return false; + case "indent": + for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, "smart"); + break; + case "classic": + if (posEq(sel.from, sel.to)) { + if (shift) indentLine(sel.from.line, "smart"); + else replaceSelection("\t", "end"); + break; + } + case "shift": + for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, shift ? "subtract" : "add"); + break; + } + return true; + } + + function indentLine(n, how) { + if (how == "smart") { + if (!mode.indent) how = "prev"; + else var state = getStateBefore(n); + } + + var line = lines[n], curSpace = line.indentation(), curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (how == "prev") { + if (n) indentation = lines[n-1].indentation(); + else indentation = 0; + } + else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length)); + else if (how == "add") indentation = curSpace + options.indentUnit; + else if (how == "subtract") indentation = curSpace - options.indentUnit; + indentation = Math.max(0, indentation); + var diff = indentation - curSpace; + + if (!diff) { + if (sel.from.line != n && sel.to.line != n) return; + var indentString = curSpaceString; + } + else { + var indentString = "", pos = 0; + if (options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + while (pos < indentation) {++pos; indentString += " ";} + } + + replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}); + } + + function loadMode() { + mode = CodeMirror.getMode(options, options.mode); + for (var i = 0, l = lines.length; i < l; ++i) + lines[i].stateAfter = null; + work = [0]; + } + function gutterChanged() { + var visible = options.gutter || options.lineNumbers; + gutter.style.display = visible ? "" : "none"; + if (visible) updateGutter(); + else lineDiv.parentNode.style.marginLeft = 0; + } + + function markText(from, to, className) { + from = clipPos(from); to = clipPos(to); + var accum = []; + function add(line, from, to, className) { + var line = lines[line], mark = line.addMark(from, to, className); + mark.line = line; + accum.push(mark); + } + if (from.line == to.line) add(from.line, from.ch, to.ch, className); + else { + add(from.line, from.ch, null, className); + for (var i = from.line + 1, e = to.line; i < e; ++i) + add(i, 0, null, className); + add(to.line, 0, to.ch, className); + } + changes.push({from: from.line, to: to.line + 1}); + return function() { + var start, end; + for (var i = 0; i < accum.length; ++i) { + var mark = accum[i], found = indexOf(lines, mark.line); + mark.line.removeMark(mark); + if (found > -1) { + if (start == null) start = found; + end = found; + } + } + if (start != null) changes.push({from: start, to: end + 1}); + }; + } + + function addGutterMarker(line, text, className) { + if (typeof line == "number") line = lines[clipLine(line)]; + line.gutterMarker = {text: text, style: className}; + updateGutter(); + return line; + } + function removeGutterMarker(line) { + if (typeof line == "number") line = lines[clipLine(line)]; + line.gutterMarker = null; + updateGutter(); + } + function setLineClass(line, className) { + if (typeof line == "number") { + var no = line; + line = lines[clipLine(line)]; + } + else { + var no = indexOf(lines, line); + if (no == -1) return null; + } + line.className = className; + changes.push({from: no, to: no + 1}); + return line; + } + + function lineInfo(line) { + if (typeof line == "number") { + var n = line; + line = lines[line]; + if (!line) return null; + } + else { + var n = indexOf(lines, line); + if (n == -1) return null; + } + var marker = line.gutterMarker; + return {line: n, text: line.text, markerText: marker && marker.text, markerClass: marker && marker.style}; + } + + // These are used to go from pixel positions to character + // positions, taking tabs into account. + function charX(line, pos) { + var text = lines[line].text, span = measure.firstChild; + if (text.lastIndexOf("\t", pos) == -1) return pos * charWidth(); + var old = span.firstChild.nodeValue; + try { + span.firstChild.nodeValue = text.slice(0, pos); + return span.offsetWidth; + } finally {span.firstChild.nodeValue = old;} + } + function charFromX(line, x) { + var text = lines[line].text, cw = charWidth(); + if (x <= 0) return 0; + if (text.indexOf("\t") == -1) return Math.min(text.length, Math.round(x / cw)); + var mspan = measure.firstChild, mtext = mspan.firstChild, old = mtext.nodeValue; + try { + mtext.nodeValue = text; + var from = 0, fromX = 0, to = text.length, toX = mspan.offsetWidth; + if (x > toX) return to; + for (;;) { + if (to - from <= 1) return (toX - x > x - fromX) ? from : to; + var middle = Math.ceil((from + to) / 2); + mtext.nodeValue = text.slice(0, middle); + var curX = mspan.offsetWidth; + if (curX > x) {to = middle; toX = curX;} + else {from = middle; fromX = curX;} + } + } finally {mtext.nodeValue = old;} + } + + function localCoords(pos, inLineWrap) { + var lh = lineHeight(), line = pos.line - (inLineWrap ? showingFrom : 0); + return {x: charX(pos.line, pos.ch), y: line * lh, yBot: (line + 1) * lh}; + } + function pageCoords(pos) { + var local = localCoords(pos, true), off = eltOffset(lineSpace); + return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot}; + } + + function lineHeight() { + var nlines = lineDiv.childNodes.length; + if (nlines) return lineDiv.offsetHeight / nlines; + else return measure.firstChild.offsetHeight || 1; + } + function charWidth() {return (measure.firstChild.offsetWidth || 320) / 40;} + function paddingTop() {return lineSpace.offsetTop;} + function paddingLeft() {return lineSpace.offsetLeft;} + + function posFromMouse(e, liberal) { + var off = eltOffset(lineSpace), + x = e.pageX() - off.left, + y = e.pageY() - off.top; + if (!liberal && e.target() != lineSpace.parentNode && !(e.target() == wrapper && y > (lines.length * lineHeight()))) + for (var n = e.target(); n != lineDiv && n != cursor; n = n.parentNode) + if (!n || n == wrapper) return null; + var line = showingFrom + Math.floor(y / lineHeight()); + return clipPos({line: line, ch: charFromX(clipLine(line), x)}); + } + function onContextMenu(e) { + var pos = posFromMouse(e); + if (!pos || window.opera) return; // Opera is difficult. + if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) + setCursor(pos.line, pos.ch); + + var oldCSS = input.style.cssText; + input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.pageY() - 1) + + "px; left: " + (e.pageX() - 1) + "px; z-index: 1000; background: white; " + + "border-width: 0; outline: none; overflow: hidden;"; + var val = input.value = getSelection(); + input.focus(); + setSelRange(input, 0, val.length); + if (gecko) e.stop(); + leaveInputAlone = true; + setTimeout(function() { + if (input.value != val) operation(replaceSelection)(input.value, "end"); + input.style.cssText = oldCSS; + leaveInputAlone = false; + prepareInput(); + slowPoll(); + }, 50); + } + + // Cursor-blinking + function restartBlink() { + clearInterval(blinker); + var on = true; + cursor.style.visibility = ""; + blinker = setInterval(function() { + cursor.style.visibility = (on = !on) ? "" : "hidden"; + }, 650); + } + + var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; + function matchBrackets(autoclear) { + var head = sel.inverted ? sel.from : sel.to, line = lines[head.line], pos = head.ch - 1; + var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; + if (!match) return; + var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles; + for (var off = pos + 1, i = 0, e = st.length; i < e; i+=2) + if ((off -= st[i].length) <= 0) {var style = st[i+1]; break;} + + var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; + function scan(line, from, to) { + if (!line.text) return; + var st = line.styles, pos = forward ? 0 : line.text.length - 1, cur; + for (var i = forward ? 0 : st.length - 2, e = forward ? st.length : -2; i != e; i += 2*d) { + var text = st[i]; + if (st[i+1] != null && st[i+1] != style) {pos += d * text.length; continue;} + for (var j = forward ? 0 : text.length - 1, te = forward ? text.length : -1; j != te; j += d, pos+=d) { + if (pos >= from && pos < to && re.test(cur = text.charAt(j))) { + var match = matching[cur]; + if (match.charAt(1) == ">" == forward) stack.push(cur); + else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; + else if (!stack.length) return {pos: pos, match: true}; + } + } + } + } + for (var i = head.line, e = forward ? Math.min(i + 50, lines.length) : Math.max(0, i - 50); i != e; i+=d) { + var line = lines[i], first = i == head.line; + var found = scan(line, first && forward ? pos + 1 : 0, first && !forward ? pos : line.text.length); + if (found) { + var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style), + two = markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style); + var clear = operation(function(){one(); two();}); + if (autoclear) setTimeout(clear, 800); + else bracketHighlighted = clear; + break; + } + } + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(n) { + var minindent, minline; + for (var search = n, lim = n - 40; search > lim; --search) { + if (search == 0) return 0; + var line = lines[search-1]; + if (line.stateAfter) return search; + var indented = line.indentation(); + if (minline == null || minindent > indented) { + minline = search; + minindent = indented; + } + } + return minline; + } + function getStateBefore(n) { + var start = findStartLine(n), state = start && lines[start-1].stateAfter; + if (!state) state = startState(mode); + else state = copyState(mode, state); + for (var i = start; i < n; ++i) { + var line = lines[i]; + line.highlight(mode, state); + line.stateAfter = copyState(mode, state); + } + if (!lines[n].stateAfter) work.push(n); + return state; + } + function highlightWorker() { + var end = +new Date + options.workTime; + while (work.length) { + if (!lines[showingFrom].stateAfter) var task = showingFrom; + else var task = work.pop(); + if (task >= lines.length) continue; + var start = findStartLine(task), state = start && lines[start-1].stateAfter; + if (state) state = copyState(mode, state); + else state = startState(mode); + + for (var i = start, l = lines.length; i < l; ++i) { + var line = lines[i], hadState = line.stateAfter; + if (+new Date > end) { + work.push(i); + startWorker(options.workDelay); + changes.push({from: task, to: i}); + return; + } + var changed = line.highlight(mode, state); + line.stateAfter = copyState(mode, state); + if (hadState && !changed && line.text) break; + } + changes.push({from: task, to: i}); + } + } + function startWorker(time) { + if (!work.length) return; + highlight.set(time, operation(highlightWorker)); + } + + // Operations are used to wrap changes in such a way that each + // change won't have to update the cursor and display (which would + // be awkward, slow, and error-prone), but instead updates are + // batched and then all combined and executed at once. + function startOperation() { + updateInput = null; changes = []; textChanged = selectionChanged = false; + } + function endOperation() { + var reScroll = false; + if (selectionChanged) reScroll = !scrollCursorIntoView(); + if (changes.length) updateDisplay(changes); + else if (selectionChanged) updateCursor(); + if (reScroll) scrollCursorIntoView(); + if (selectionChanged) restartBlink(); + + // updateInput can be set to a boolean value to force/prevent an + // update. + if (!leaveInputAlone && (updateInput === true || (updateInput !== false && selectionChanged))) + prepareInput(); + + if (selectionChanged && options.onCursorActivity) + options.onCursorActivity(instance); + if (textChanged && options.onChange) + options.onChange(instance); + if (selectionChanged && options.matchBrackets) + setTimeout(operation(function() { + if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;} + matchBrackets(false); + }), 20); + } + var nestedOperation = 0; + function operation(f) { + return function() { + if (!nestedOperation++) startOperation(); + try {var result = f.apply(this, arguments);} + finally {if (!--nestedOperation) endOperation();} + return result; + }; + } + + function SearchCursor(query, pos, caseFold) { + this.atOccurrence = false; + if (caseFold == null) caseFold = typeof query == "string" && query == query.toLowerCase(); + + if (pos && typeof pos == "object") pos = clipPos(pos); + else pos = {line: 0, ch: 0}; + this.pos = {from: pos, to: pos}; + + // The matches method is filled in based on the type of query. + // It takes a position and a direction, and returns an object + // describing the next occurrence of the query, or null if no + // more matches were found. + if (typeof query != "string") // Regexp match + this.matches = function(reverse, pos) { + if (reverse) { + var line = lines[pos.line].text.slice(0, pos.ch), match = line.match(query), start = 0; + while (match) { + var ind = line.indexOf(match[0]); + start += ind; + line = line.slice(ind + 1); + var newmatch = line.match(query); + if (newmatch) match = newmatch; + else break; + } + } + else { + var line = lines[pos.line].text.slice(pos.ch), match = line.match(query), + start = match && pos.ch + line.indexOf(match[0]); + } + if (match) + return {from: {line: pos.line, ch: start}, + to: {line: pos.line, ch: start + match[0].length}, + match: match}; + }; + else { // String query + if (caseFold) query = query.toLowerCase(); + var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; + var target = query.split("\n"); + // Different methods for single-line and multi-line queries + if (target.length == 1) + this.matches = function(reverse, pos) { + var line = fold(lines[pos.line].text), len = query.length, match; + if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1) + : (match = line.indexOf(query, pos.ch)) != -1) + return {from: {line: pos.line, ch: match}, + to: {line: pos.line, ch: match + len}}; + }; + else + this.matches = function(reverse, pos) { + var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(lines[ln].text); + var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); + if (reverse ? offsetA >= pos.ch || offsetA != match.length + : offsetA <= pos.ch || offsetA != line.length - match.length) + return; + for (;;) { + if (reverse ? !ln : ln == lines.length - 1) return; + line = fold(lines[ln += reverse ? -1 : 1].text); + match = target[reverse ? --idx : ++idx]; + if (idx > 0 && idx < target.length - 1) { + if (line != match) return; + else continue; + } + var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); + if (reverse ? offsetB != line.length - match.length : offsetB != match.length) + return; + var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB}; + return {from: reverse ? end : start, to: reverse ? start : end}; + } + }; + } + } + + SearchCursor.prototype = { + findNext: function() {return this.find(false);}, + findPrevious: function() {return this.find(true);}, + + find: function(reverse) { + var self = this, pos = clipPos(reverse ? this.pos.from : this.pos.to); + function savePosAndFail(line) { + var pos = {line: line, ch: 0}; + self.pos = {from: pos, to: pos}; + self.atOccurrence = false; + return false; + } + + for (;;) { + if (this.pos = this.matches(reverse, pos)) { + this.atOccurrence = true; + return this.pos.match || true; + } + if (reverse) { + if (!pos.line) return savePosAndFail(0); + pos = {line: pos.line-1, ch: lines[pos.line-1].text.length}; + } + else { + if (pos.line == lines.length - 1) return savePosAndFail(lines.length); + pos = {line: pos.line+1, ch: 0}; + } + } + }, + + from: function() {if (this.atOccurrence) return copyPos(this.pos.from);}, + to: function() {if (this.atOccurrence) return copyPos(this.pos.to);} + }; + + return instance; + } // (end of function CodeMirror) + + // The default configuration options. + CodeMirror.defaults = { + value: "", + mode: null, + indentUnit: 2, + indentWithTabs: false, + tabMode: "classic", + enterMode: "indent", + electricChars: true, + onKeyEvent: null, + lineNumbers: false, + gutter: false, + firstLineNumber: 1, + readOnly: false, + onChange: null, + onCursorActivity: null, + onGutterClick: null, + onFocus: null, onBlur: null, onScroll: null, + matchBrackets: false, + workTime: 100, + workDelay: 200, + undoDepth: 40, + tabindex: null + }; + + // Known modes, by name and by MIME + var modes = {}, mimeModes = {}; + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + modes[name] = mode; + }; + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + CodeMirror.getMode = function(options, spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) + spec = mimeModes[spec]; + if (typeof spec == "string") + var mname = spec, config = {}; + else + var mname = spec.name, config = spec; + var mfactory = modes[mname]; + if (!mfactory) { + if (window.console) console.warn("No mode " + mname + " found, falling back to plain text."); + return CodeMirror.getMode(options, "text/plain"); + } + return mfactory(options, config); + } + CodeMirror.listModes = function() { + var list = []; + for (var m in modes) + if (modes.propertyIsEnumerable(m)) list.push(m); + return list; + }; + CodeMirror.listMIMEs = function() { + var list = []; + for (var m in mimeModes) + if (mimeModes.propertyIsEnumerable(m)) list.push(m); + return list; + }; + + CodeMirror.fromTextArea = function(textarea, options) { + if (!options) options = {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabindex) + options.tabindex = textarea.tabindex; + + function save() {textarea.value = instance.getValue();} + if (textarea.form) { + // Deplorable hack to make the submit method do the right thing. + var rmSubmit = connect(textarea.form, "submit", save, true); + if (typeof textarea.form.submit == "function") { + var realSubmit = textarea.form.submit; + function wrappedSubmit() { + save(); + textarea.form.submit = realSubmit; + textarea.form.submit(); + textarea.form.submit = wrappedSubmit; + } + textarea.form.submit = wrappedSubmit; + } + } + + textarea.style.display = "none"; + var instance = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + instance.save = save; + instance.toTextArea = function() { + save(); + textarea.parentNode.removeChild(instance.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + rmSubmit(); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + return instance; + }; + + // Utility functions for working with state. Exported because modes + // sometimes need to do this. + function copyState(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + } + CodeMirror.startState = startState; + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + } + CodeMirror.copyState = copyState; + + // The character stream used by a mode's parser. + function StringStream(string) { + this.pos = this.start = 0; + this.string = string; + } + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == 0;}, + peek: function() {return this.string.charAt(this.pos);}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.start; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() {return countColumn(this.string, this.start);}, + indentation: function() {return countColumn(this.string);}, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} + if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } + else { + var match = this.string.slice(this.pos).match(pattern); + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);} + }; + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + function Line(text, styles) { + this.styles = styles || [text, null]; + this.stateAfter = null; + this.text = text; + this.marked = this.gutterMarker = this.className = null; + } + Line.prototype = { + // Replace a piece of a line, keeping the styles around it intact. + replace: function(from, to, text) { + var st = [], mk = this.marked; + copyStyles(0, from, this.styles, st); + if (text) st.push(text, null); + copyStyles(to, this.text.length, this.styles, st); + this.styles = st; + this.text = this.text.slice(0, from) + text + this.text.slice(to); + this.stateAfter = null; + if (mk) { + var diff = text.length - (to - from), end = this.text.length; + function fix(n) {return n <= Math.min(to, to + diff) ? n : n + diff;} + for (var i = 0; i < mk.length; ++i) { + var mark = mk[i], del = false; + if (mark.from >= end) del = true; + else {mark.from = fix(mark.from); if (mark.to != null) mark.to = fix(mark.to);} + if (del || mark.from >= mark.to) {mk.splice(i, 1); i--;} + } + } + }, + // Split a line in two, again keeping styles intact. + split: function(pos, textBefore) { + var st = [textBefore, null]; + copyStyles(pos, this.text.length, this.styles, st); + return new Line(textBefore + this.text.slice(pos), st); + }, + addMark: function(from, to, style) { + var mk = this.marked, mark = {from: from, to: to, style: style}; + if (this.marked == null) this.marked = []; + this.marked.push(mark); + this.marked.sort(function(a, b){return a.from - b.from;}); + return mark; + }, + removeMark: function(mark) { + var mk = this.marked; + if (!mk) return; + for (var i = 0; i < mk.length; ++i) + if (mk[i] == mark) {mk.splice(i, 1); break;} + }, + // Run the given mode's parser over a line, update the styles + // array, which contains alternating fragments of text and CSS + // classes. + highlight: function(mode, state) { + var stream = new StringStream(this.text), st = this.styles, pos = 0, changed = false; + while (!stream.eol()) { + var style = mode.token(stream, state); + var substr = this.text.slice(stream.start, stream.pos); + stream.start = stream.pos; + if (pos && st[pos-1] == style) + st[pos-2] += substr; + else if (substr) { + if (!changed && st[pos] != substr || st[pos+1] != style) changed = true; + st[pos++] = substr; st[pos++] = style; + } + // Give up when line is ridiculously long + if (stream.pos > 5000) { + st[pos++] = this.text.slice(stream.pos); st[pos++] = null; + break; + } + } + if (st.length != pos) {st.length = pos; changed = true;} + return changed; + }, + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(mode, state, ch) { + var txt = this.text, stream = new StringStream(txt); + while (stream.pos < ch && !stream.eol()) { + stream.start = stream.pos; + var style = mode.token(stream, state); + } + return {start: stream.start, + end: stream.pos, + string: stream.current(), + className: style || null, + state: state}; + }, + indentation: function() {return countColumn(this.text);}, + // Produces an HTML fragment for the line, taking selection, + // marking, and highlighting into account. + getHTML: function(sfrom, sto, includePre) { + var html = []; + if (includePre) + html.push(this.className ? '
': "
");
+      function span(text, style) {
+        if (!text) return;
+        if (style) html.push('', htmlEscape(text), "");
+        else html.push(htmlEscape(text));
+      }
+      var st = this.styles, allText = this.text, marked = this.marked;
+      if (sfrom == sto) sfrom = null;
+
+      if (!allText)
+        span(" ", sfrom != null && sto == null ? "CodeMirror-selected" : null);
+      else if (!marked && sfrom == null)
+        for (var i = 0, e = st.length; i < e; i+=2) span(st[i], st[i+1]);
+      else {
+        var pos = 0, i = 0, text = "", style, sg = 0;
+        var markpos = -1, mark = null;
+        function nextMark() {
+          if (marked) {
+            markpos += 1;
+            mark = (markpos < marked.length) ? marked[markpos] : null;
+          }
+        }
+        nextMark();        
+        while (pos < allText.length) {
+          var upto = allText.length;
+          var extraStyle = "";
+          if (sfrom != null) {
+            if (sfrom > pos) upto = sfrom;
+            else if (sto == null || sto > pos) {
+              extraStyle = " CodeMirror-selected";
+              if (sto != null) upto = Math.min(upto, sto);
+            }
+          }
+          while (mark && mark.to != null && mark.to <= pos) nextMark();
+          if (mark) {
+            if (mark.from > pos) upto = Math.min(upto, mark.from);
+            else {
+              extraStyle += " " + mark.style;
+              if (mark.to != null) upto = Math.min(upto, mark.to);
+            }
+          }
+          for (;;) {
+            var end = pos + text.length;
+            var apliedStyle = style;
+            if (extraStyle) apliedStyle = style ? style + extraStyle : extraStyle;
+            span(end > upto ? text.slice(0, upto - pos) : text, apliedStyle);
+            if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
+            pos = end;
+            text = st[i++]; style = st[i++];
+          }
+        }
+        if (sfrom != null && sto == null) span(" ", "CodeMirror-selected");
+      }
+      if (includePre) html.push("
"); + return html.join(""); + } + }; + // Utility used by replace and split above + function copyStyles(from, to, source, dest) { + for (var i = 0, pos = 0, state = 0; pos < to; i+=2) { + var part = source[i], end = pos + part.length; + if (state == 0) { + if (end > from) dest.push(part.slice(from - pos, Math.min(part.length, to - pos)), source[i+1]); + if (end >= from) state = 1; + } + else if (state == 1) { + if (end > to) dest.push(part.slice(0, to - pos), source[i+1]); + else dest.push(part, source[i+1]); + } + pos = end; + } + } + + // The history object 'chunks' changes that are made close together + // and at almost the same time into bigger undoable units. + function History() { + this.time = 0; + this.done = []; this.undone = []; + } + History.prototype = { + addChange: function(start, added, old) { + this.undone.length = 0; + var time = +new Date, last = this.done[this.done.length - 1]; + if (time - this.time > 400 || !last || + last.start > start + added || last.start + last.added < start - last.added + last.old.length) + this.done.push({start: start, added: added, old: old}); + else { + var oldoff = 0; + if (start < last.start) { + for (var i = last.start - start - 1; i >= 0; --i) + last.old.unshift(old[i]); + last.added += last.start - start; + last.start = start; + } + else if (last.start < start) { + oldoff = start - last.start; + added += oldoff; + } + for (var i = last.added - oldoff, e = old.length; i < e; ++i) + last.old.push(old[i]); + if (last.added < added) last.added = added; + } + this.time = time; + } + }; + + // Event stopping compatibility wrapper. + function stopEvent() { + if (this.preventDefault) {this.preventDefault(); this.stopPropagation();} + else {this.returnValue = false; this.cancelBubble = true;} + } + // Ensure an event has a stop method. + function addStop(event) { + if (!event.stop) event.stop = stopEvent; + return event; + } + + // Event wrapper, exposing the few operations we need. + function Event(orig) {this.e = orig;} + Event.prototype = { + stop: function() {stopEvent.call(this.e);}, + target: function() {return this.e.target || this.e.srcElement;}, + button: function() { + if (this.e.which) return this.e.which; + else if (this.e.button & 1) return 1; + else if (this.e.button & 2) return 3; + else if (this.e.button & 4) return 2; + }, + pageX: function() { + if (this.e.pageX != null) return this.e.pageX; + else return this.e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; + }, + pageY: function() { + if (this.e.pageY != null) return this.e.pageY; + else return this.e.clientY + document.body.scrollTop + document.documentElement.scrollTop; + } + }; + + // Event handler registration. If disconnect is true, it'll return a + // function that unregisters the handler. + function connect(node, type, handler, disconnect) { + function wrapHandler(event) {handler(new Event(event || window.event));} + if (typeof node.addEventListener == "function") { + node.addEventListener(type, wrapHandler, false); + if (disconnect) return function() {node.removeEventListener(type, wrapHandler, false);}; + } + else { + node.attachEvent("on" + type, wrapHandler); + if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);}; + } + } + + function Delayed() {this.id = null;} + Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; + + // Some IE versions don't preserve whitespace when setting the + // innerHTML of a PRE tag. + var badInnerHTML = (function() { + var pre = document.createElement("pre"); + pre.innerHTML = " "; return !pre.innerHTML; + })(); + + var gecko = /gecko\/\d{7}/i.test(navigator.userAgent); + + var lineSep = "\n"; + // Feature-detect whether newlines in textareas are converted to \r\n + (function () { + var te = document.createElement("textarea"); + te.value = "foo\nbar"; + if (te.value.indexOf("\r") > -1) lineSep = "\r\n"; + }()); + + var tabSize = 8; + var mac = /Mac/.test(navigator.platform); + var movementKeys = {}; + for (var i = 35; i <= 40; ++i) + movementKeys[i] = movementKeys["c" + i] = true; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = 0, n = 0; i < end; ++i) { + if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); + else ++n; + } + return n; + } + + // Find the position of an element by following the offsetParent chain. + function eltOffset(node) { + var x = 0, y = 0, n2 = node; + for (var n = node; n; n = n.offsetParent) {x += n.offsetLeft; y += n.offsetTop;} + for (var n = node; n != document.body; n = n.parentNode) {x -= n.scrollLeft; y -= n.scrollTop;} + return {left: x, top: y}; + } + // Get a node's text content. + function eltText(node) { + return node.textContent || node.innerText || node.nodeValue || ""; + } + + // Operations on {line, ch} objects. + function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} + function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} + function copyPos(x) {return {line: x.line, ch: x.ch};} + + function htmlEscape(str) { + return str.replace(/[<&]/g, function(str) {return str == "&" ? "&" : "<";}); + } + + // Used to position the cursor after an undo/redo by finding the + // last edited character. + function editEnd(from, to) { + if (!to) return from ? from.length : 0; + if (!from) return to.length; + for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j) + if (from.charAt(i) != to.charAt(j)) break; + return j + 1; + } + + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + if ("\n\nb".split(/\n/).length != 3) + var splitLines = function(string) { + var pos = 0, nl, result = []; + while ((nl = string.indexOf("\n", pos)) > -1) { + result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl)); + pos = nl + 1; + } + result.push(string.slice(pos)); + return result; + }; + else + var splitLines = function(string){return string.split(/\r?\n/);}; + + // Sane model of finding and setting the selection in a textarea + if (window.getSelection) { + var selRange = function(te) { + try {return {start: te.selectionStart, end: te.selectionEnd};} + catch(e) {return null;} + }; + var setSelRange = function(te, start, end) { + try {te.setSelectionRange(start, end);} + catch(e) {} // Fails on Firefox when textarea isn't part of the document + }; + } + // IE model. Don't ask. + else { + var selRange = function(te) { + try {var range = document.selection.createRange();} + catch(e) {return null;} + if (!range || range.parentElement() != te) return null; + var val = te.value, len = val.length, localRange = te.createTextRange(); + localRange.moveToBookmark(range.getBookmark()); + var endRange = te.createTextRange(); + endRange.collapse(false); + + if (localRange.compareEndPoints("StartToEnd", endRange) > -1) + return {start: len, end: len}; + + var start = -localRange.moveStart("character", -len); + for (var i = val.indexOf("\r"); i > -1 && i < start; i = val.indexOf("\r", i+1), start++) {} + + if (localRange.compareEndPoints("EndToEnd", endRange) > -1) + return {start: start, end: len}; + + var end = -localRange.moveEnd("character", -len); + for (var i = val.indexOf("\r"); i > -1 && i < end; i = val.indexOf("\r", i+1), end++) {} + return {start: start, end: end}; + }; + var setSelRange = function(te, start, end) { + var range = te.createTextRange(); + range.collapse(true); + var endrange = range.duplicate(); + var newlines = 0, txt = te.value; + for (var pos = txt.indexOf("\n"); pos > -1 && pos < start; pos = txt.indexOf("\n", pos + 1)) + ++newlines; + range.move("character", start - newlines); + for (; pos > -1 && pos < end; pos = txt.indexOf("\n", pos + 1)) + ++newlines; + endrange.move("character", end - newlines); + range.setEndPoint("EndToEnd", endrange); + range.select(); + }; + } + + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + return CodeMirror; +})(); diff --git a/plugins/LocalFilesEditor/codemirror/lib/overlay.js b/plugins/LocalFilesEditor/codemirror/lib/overlay.js new file mode 100644 index 000000000..c4cdf9fc8 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/lib/overlay.js @@ -0,0 +1,51 @@ +// Utility function that allows modes to be combined. The mode given +// as the base argument takes care of most of the normal mode +// functionality, but a second (typically simple) mode is used, which +// can override the style of text. Both modes get to parse all of the +// text, but when both assign a non-null style to a piece of code, the +// overlay wins, unless the combine argument was true, in which case +// the styles are combined. + +CodeMirror.overlayParser = function(base, overlay, combine) { + return { + startState: function() { + return { + base: CodeMirror.startState(base), + overlay: CodeMirror.startState(overlay), + basePos: 0, baseCur: null, + overlayPos: 0, overlayCur: null + }; + }, + copyState: function(state) { + return { + base: CodeMirror.copyState(base, state.base), + overlay: CodeMirror.copyState(overlay, state.overlay), + basePos: state.basePos, baseCur: null, + overlayPos: state.overlayPos, overlayCur: null + }; + }, + + token: function(stream, state) { + if (stream.start == state.basePos) { + state.baseCur = base.token(stream, state.base); + state.basePos = stream.pos; + } + if (stream.start == state.overlayPos) { + stream.pos = stream.start; + state.overlayCur = overlay.token(stream, state.overlay); + state.overlayPos = stream.pos; + } + stream.pos = Math.min(state.basePos, state.overlayPos); + if (stream.eol()) state.basePos = state.overlayPos = 0; + + if (state.overlayCur == null) return state.baseCur; + if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; + else return state.overlayCur; + }, + + indent: function(state, textAfter) { + return base.indent(state.base, textAfter); + }, + electricChars: base.electricChars + }; +}; diff --git a/plugins/LocalFilesEditor/codemirror/mode/clike/clike.css b/plugins/LocalFilesEditor/codemirror/mode/clike/clike.css new file mode 100644 index 000000000..21016d7b1 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/clike/clike.css @@ -0,0 +1,6 @@ +span.c-like-keyword {color: #90b;} +span.c-like-number {color: #291;} +span.c-like-comment {color: #a70;} +span.c-like-string {color: #a22;} +span.c-like-preprocessor {color: #049;} +span.c-like-var {color: #22b;} diff --git a/plugins/LocalFilesEditor/codemirror/mode/clike/clike.js b/plugins/LocalFilesEditor/codemirror/mode/clike/clike.js new file mode 100644 index 000000000..25bd79144 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/clike/clike.js @@ -0,0 +1,181 @@ +CodeMirror.defineMode("clike", function(config, parserConfig) { + var indentUnit = config.indentUnit, keywords = parserConfig.keywords, + cpp = parserConfig.useCPP, multiLineStrings = parserConfig.multiLineStrings, $vars = parserConfig.$vars; + var isOperatorChar = /[+\-*&%=<>!?|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + var type; + function ret(tp, style) { + type = tp; + return style; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch)); + else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + return ret(ch); + else if (ch == "#" && cpp && state.startOfLine) { + stream.skipToEnd(); + return ret("directive", "c-like-preprocessor"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/) + return ret("number", "c-like-number"); + } + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "c-like-comment"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator"); + } + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator"); + } + else if ($vars && ch == "$") { + stream.eatWhile(/[\w\$_]/); + return ret("word", "c-like-var"); + } + else { + stream.eatWhile(/[\w\$_]/); + if (keywords && keywords.propertyIsEnumerable(stream.current())) return ret("keyword", "c-like-keyword"); + return ret("word", "c-like-word"); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return ret("string", "c-like-string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "c-like-comment"); + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((type == ";" || type == ":") && ctx.type == "statement") popContext(state); + else if (type == "{") pushContext(state, stream.column(), "}"); + else if (type == "[") pushContext(state, stream.column(), "]"); + else if (type == "(") pushContext(state, stream.column(), ")"); + else if (type == "}") { + if (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + if (ctx.type == "statement") ctx = popContext(state); + } + else if (type == ctx.type) popContext(state); + else if (ctx.type == "}") pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var cKeywords = "auto if break int case long char register continue return default short do sizeof " + + "double static else struct entry switch extern typedef float union for unsigned " + + "goto while enum void const signed volatile"; + + CodeMirror.defineMIME("text/x-csrc", { + name: "clike", + useCPP: true, + keywords: keywords(cKeywords) + }); + CodeMirror.defineMIME("text/x-c++src", { + name: "clike", + useCPP: true, + keywords: keywords(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + + "static_cast typeid catch false operator template typename class friend private " + + "this using const_cast inline public throw virtual delete mutable protected true " + + "wchar_t") + }); + CodeMirror.defineMIME("text/x-java", { + name: "clike", + keywords: keywords("abstract assert boolean break byte case catch char class const continue default " + + "do double else enum extends false final finally float for goto if implements import " + + "instanceof int interface long native new null package private protected public " + + "return short static strictfp super switch synchronized this throw throws transient " + + "true try void volatile while") + }); +}()); diff --git a/plugins/LocalFilesEditor/codemirror/mode/clike/index.html b/plugins/LocalFilesEditor/codemirror/mode/clike/index.html new file mode 100644 index 000000000..0836535d2 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/clike/index.html @@ -0,0 +1,101 @@ + + + + CodeMirror 2: C-like mode + + + + + + + + +

CodeMirror 2: C-like mode

+ +
+ + + +

Simple mode that tries to handle C-like languages as well as it + can. Takes two configuration parameters: keywords, an + object whose property names are the keywords in the language, + and useCPP, which determines whether C preprocessor + directives are recognized.

+ +

MIME types defined: text/x-csrc + (C code), text/x-c++src (C++ + code), text/x-java (Java code).

+ + diff --git a/plugins/LocalFilesEditor/codemirror/mode/css/css.css b/plugins/LocalFilesEditor/codemirror/mode/css/css.css new file mode 100644 index 000000000..02d40ecb2 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/css/css.css @@ -0,0 +1,9 @@ +span.css-at {color: #708;} +span.css-unit {color: #281;} +span.css-value {color: #708;} +span.css-identifier {color: black;} +span.css-selector {color: #11B;} +span.css-important {color: #00F;} +span.css-colorcode {color: #299;} +span.css-comment {color: #A70;} +span.css-string {color: #A22;} diff --git a/plugins/LocalFilesEditor/codemirror/mode/css/css.js b/plugins/LocalFilesEditor/codemirror/mode/css/css.js new file mode 100644 index 000000000..5faad7b2f --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/css/css.js @@ -0,0 +1,124 @@ +CodeMirror.defineMode("css", function(config) { + var indentUnit = config.indentUnit, type; + function ret(style, tp) {type = tp; return style;} + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == "@") {stream.eatWhile(/\w/); return ret("css-at", stream.current());} + else if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + else if (ch == "<" && stream.eat("!")) { + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + } + else if (ch == "=") ret(null, "compare"); + else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + else if (ch == "#") { + stream.eatWhile(/\w/); + return ret("css-selector", "hash"); + } + else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("css-important", "important"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return ret("css-unit", "unit"); + } + else if (/[,.+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } + else if (/[;{}:\[\]]/.test(ch)) { + return ret(null, ch); + } + else { + stream.eatWhile(/[\w\\\-_]/); + return ret("css-identifier", "identifier"); + } + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("css-comment", "comment"); + } + + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = tokenBase; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ret("css-comment", "comment"); + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("css-string", "string"); + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + var context = state.stack[state.stack.length-1]; + if (type == "hash" && context == "rule") style = "css-colorcode"; + else if (style == "css-identifier") { + if (context == "rule") style = "css-value"; + else if (!context || context == "@media{") style = "css-selector"; + } + + if (context == "rule" && /^[\{\};]$/.test(type)) + state.stack.pop(); + if (type == "{") { + if (context == "@media") state.stack[state.stack.length-1] = "@media{"; + else state.stack.push("{"); + } + else if (type == "}") state.stack.pop(); + else if (type == "@media") state.stack.push("@media"); + else if (context != "rule" && context != "@media" && type != "comment") state.stack.push("rule"); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + if (/^\}/.test(textAfter)) + n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; + return state.baseIndent + n * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("text/css", "css"); diff --git a/plugins/LocalFilesEditor/codemirror/mode/css/index.html b/plugins/LocalFilesEditor/codemirror/mode/css/index.html new file mode 100644 index 000000000..ad895610f --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/css/index.html @@ -0,0 +1,56 @@ + + + + CodeMirror 2: CSS mode + + + + + + + + +

CodeMirror 2: CSS mode

+
+ + +

MIME types defined: text/css.

+ + + diff --git a/plugins/LocalFilesEditor/codemirror/mode/diff/diff.css b/plugins/LocalFilesEditor/codemirror/mode/diff/diff.css new file mode 100644 index 000000000..60c1379ed --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/diff/diff.css @@ -0,0 +1,3 @@ +span.diff-rangeinfo {color: #a0b;} +span.diff-minus {color: #a22;} +span.diff-plus {color: #2b2;} diff --git a/plugins/LocalFilesEditor/codemirror/mode/diff/diff.js b/plugins/LocalFilesEditor/codemirror/mode/diff/diff.js new file mode 100644 index 000000000..619d74e2a --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/diff/diff.js @@ -0,0 +1,13 @@ +CodeMirror.defineMode("diff", function() { + return { + token: function(stream) { + var ch = stream.next(); + stream.skipToEnd(); + if (ch == "+") return "diff-plus"; + if (ch == "-") return "diff-minus"; + if (ch == "@") return "diff-rangeinfo"; + } + }; +}); + +CodeMirror.defineMIME("text/x-diff", "diff"); diff --git a/plugins/LocalFilesEditor/codemirror/mode/diff/index.html b/plugins/LocalFilesEditor/codemirror/mode/diff/index.html new file mode 100644 index 000000000..2748f2fa8 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/diff/index.html @@ -0,0 +1,99 @@ + + + + CodeMirror 2: Diff mode + + + + + + + + +

CodeMirror 2: Diff mode

+
+ + +

MIME types defined: text/x-diff.

+ + + diff --git a/plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.css b/plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.css new file mode 100644 index 000000000..41f915556 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.css @@ -0,0 +1,25 @@ +span.hs-char, +span.hs-float, +span.hs-integer, +span.hs-string {color: #762;} + +span.hs-comment {color: #262;font-style: italic;} +span.hs-pragma {color: #555;font-style: italic;} + +span.hs-special, +span.hs-varid, +span.hs-varsym {color: #000;} + +span.hs-conid, +span.hs-consym {color: #b11;} + +span.hs-qualifier {color: #555;} + +span.hs-reservedid, +span.hs-reservedop {color: #730;} + +span.hs-prelude-varid, +span.hs-prelude-varsym {color: #30a;} +span.hs-prelude-conid {color: #b11;} + +span.hs-error {background-color: #fdd;} diff --git a/plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.js b/plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.js new file mode 100644 index 000000000..107885c20 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/haskell/haskell.js @@ -0,0 +1,242 @@ +CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) { + + function switchState(source, setState, f) { + setState(f); + return f(source, setState); + } + + // These should all be Unicode extended, as per the Haskell 2010 report + var smallRE = /[a-z_]/; + var largeRE = /[A-Z]/; + var digitRE = /[0-9]/; + var hexitRE = /[0-9A-Fa-f]/; + var octitRE = /[0-7]/; + var idRE = /[a-z_A-Z0-9']/; + var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; + var specialRE = /[(),;[\]`{}]/; + var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer + + function normal(source, setState) { + if (source.eatWhile(whiteCharRE)) { + return null; + } + + var ch = source.next(); + if (specialRE.test(ch)) { + if (ch == '{' && source.eat('-')) { + var t = "hs-comment"; + if (source.eat('#')) { + t = "hs-pragma"; + } + return switchState(source, setState, ncomment(t, 1)); + } + return "hs-special"; + } + + if (ch == '\'') { + if (source.eat('\\')) { + source.next(); // should handle other escapes here + } + else { + source.next(); + } + if (source.eat('\'')) { + return "hs-char"; + } + return "hs-error"; + } + + if (ch == '"') { + return switchState(source, setState, stringLiteral); + } + + if (largeRE.test(ch)) { + source.eatWhile(idRE); + if (source.eat('.')) { + return "hs-qualifier"; + } + return "hs-conid"; + } + + if (smallRE.test(ch)) { + source.eatWhile(idRE); + return "hs-varid"; + } + + if (digitRE.test(ch)) { + if (ch == '0') { + if (source.eat(/[xX]/)) { + source.eatWhile(hexitRE); // should require at least 1 + return "hs-integer"; + } + if (source.eat(/[oO]/)) { + source.eatWhile(octitRE); // should require at least 1 + return "hs-integer"; + } + } + source.eatWhile(digitRE); + var t = "hs-integer"; + if (source.eat('.')) { + t = "hs-float"; + source.eatWhile(digitRE); // should require at least 1 + } + if (source.eat(/[eE]/)) { + t = "hs-float"; + source.eat(/[-+]/); + source.eatWhile(digitRE); // should require at least 1 + } + return t; + } + + if (symbolRE.test(ch)) { + if (ch == '-' && source.eat(/-/)) { + source.eatWhile(/-/); + if (!source.eat(symbolRE)) { + source.skipToEnd(); + return "hs-comment"; + } + } + var t = "hs-varsym"; + if (ch == ':') { + t = "hs-consym"; + } + source.eatWhile(symbolRE); + return t; + } + + return "hs-error"; + } + + function ncomment(type, nest) { + if (nest == 0) { + return normal; + } + return function(source, setState) { + var currNest = nest; + while (!source.eol()) { + ch = source.next(); + if (ch == '{' && source.eat('-')) { + ++currNest; + } + else if (ch == '-' && source.eat('}')) { + --currNest; + if (currNest == 0) { + setState(normal); + return type; + } + } + } + setState(ncomment(type, currNest)); + return type; + } + } + + function stringLiteral(source, setState) { + while (!source.eol()) { + var ch = source.next(); + if (ch == '"') { + setState(normal); + return "hs-string"; + } + if (ch == '\\') { + if (source.eol() || source.eat(whiteCharRE)) { + setState(stringGap); + return "hs-string"; + } + if (source.eat('&')) { + } + else { + source.next(); // should handle other escapes here + } + } + } + setState(normal); + return "hs-error"; + } + + function stringGap(source, setState) { + if (source.eat('\\')) { + return switchState(source, setState, stringLiteral); + } + source.next(); + setState(normal); + return "hs-error"; + } + + + var wellKnownWords = (function() { + var wkw = {}; + function setType(t) { + return function () { + for (var i = 0; i < arguments.length; i++) + wkw[arguments[i]] = t; + } + } + + setType("hs-reservedid")( + "case", "class", "data", "default", "deriving", "do", "else", "foreign", + "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", + "module", "newtype", "of", "then", "type", "where", "_"); + + setType("hs-reservedop")( + "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); + + setType("hs-prelude-varsym")( + "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", + "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); + + setType("hs-prelude-conid")( + "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", + "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", + "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", + "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", + "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", + "String", "True"); + + setType("hs-prelude-varid")( + "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", + "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", + "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", + "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", + "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", + "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", + "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", + "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", + "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", + "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", + "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", + "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", + "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", + "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", + "otherwise", "pi", "pred", "print", "product", "properFraction", + "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", + "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", + "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", + "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", + "sequence", "sequence_", "show", "showChar", "showList", "showParen", + "showString", "shows", "showsPrec", "significand", "signum", "sin", + "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", + "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", + "toRational", "truncate", "uncurry", "undefined", "unlines", "until", + "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", + "zip3", "zipWith", "zipWith3"); + + return wkw; + })(); + + + + return { + startState: function () { return { f: normal }; }, + copyState: function (s) { return { f: s.f }; }, + + token: function(stream, state) { + var t = state.f(stream, function(s) { state.f = s; }); + var w = stream.current(); + return (w in wellKnownWords) ? wellKnownWords[w] : t; + } + }; + +}); + +CodeMirror.defineMIME("text/x-haskell", "haskell"); diff --git a/plugins/LocalFilesEditor/codemirror/mode/haskell/index.html b/plugins/LocalFilesEditor/codemirror/mode/haskell/index.html new file mode 100644 index 000000000..0bf34d570 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/haskell/index.html @@ -0,0 +1,59 @@ + + + + CodeMirror 2: Haskell mode + + + + + + + + +

CodeMirror 2: Haskell mode

+ +
+ + + +

MIME types defined: text/x-haskell.

+ + diff --git a/plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js b/plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js new file mode 100644 index 000000000..8d7165201 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js @@ -0,0 +1,66 @@ +CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); + var jsMode = CodeMirror.getMode(config, "javascript"); + var cssMode = CodeMirror.getMode(config, "css"); + + function html(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (style == "xml-tag" && stream.current() == ">" && state.htmlState.context) { + if (/^script$/i.test(state.htmlState.context.tagName)) { + state.token = javascript; + state.localState = jsMode.startState(htmlMode.indent(state.htmlState, "")); + } + else if (/^style$/i.test(state.htmlState.context.tagName)) { + state.token = css; + state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); + } + } + return style; + } + function javascript(stream, state) { + if (stream.match(/^<\/\s*script\s*>/i, false)) { + state.token = html; + state.curState = null; + return html(stream, state); + } + return jsMode.token(stream, state.localState); + } + function css(stream, state) { + if (stream.match(/^<\/\s*style\s*>/i, false)) { + state.token = html; + state.localState = null; + return html(stream, state); + } + return cssMode.token(stream, state.localState); + } + + return { + startState: function() { + var state = htmlMode.startState(); + return {token: html, localState: null, htmlState: state}; + }, + + copyState: function(state) { + if (state.localState) + var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState); + return {token: state.token, localState: local, htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (state.token == html || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.token == javascript) + return jsMode.indent(state.localState, textAfter); + else + return cssMode.indent(state.localState, textAfter); + }, + + electricChars: "/{}:" + } +}); + +CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/plugins/LocalFilesEditor/codemirror/mode/htmlmixed/index.html b/plugins/LocalFilesEditor/codemirror/mode/htmlmixed/index.html new file mode 100644 index 000000000..c661c98d5 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/htmlmixed/index.html @@ -0,0 +1,54 @@ + + + + CodeMirror 2: HTML mixed mode + + + + + + + + + + + + + +

CodeMirror 2: HTML mixed mode

+
+ + +

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

+ +

MIME types defined: text/html + (redefined, only takes effect if you load this parser after the + XML parser).

+ + + diff --git a/plugins/LocalFilesEditor/codemirror/mode/javascript/index.html b/plugins/LocalFilesEditor/codemirror/mode/javascript/index.html new file mode 100644 index 000000000..7b528e041 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/javascript/index.html @@ -0,0 +1,78 @@ + + + + CodeMirror 2: JavaScript mode + + + + + + + + +

CodeMirror 2: JavaScript mode

+ +
+ + + +

JavaScript mode supports a single configuration + option, json, which will set the mode to expect JSON + data rather than a JavaScript program.

+ +

MIME types defined: text/javascript, application/json.

+ + diff --git a/plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css b/plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css new file mode 100644 index 000000000..84fb1dfd4 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css @@ -0,0 +1,6 @@ +span.js-keyword {color: #90b;} +span.js-atom {color: #291;} +span.js-variabledef {color: #00f;} +span.js-localvariable {color: #049;} +span.js-comment {color: #a70;} +span.js-string {color: #a22;} diff --git a/plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js b/plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js new file mode 100644 index 000000000..065216591 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js @@ -0,0 +1,348 @@ +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var jsonMode = parserConfig.json; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "js-keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "js-atom"}; + return { + "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, + "var": kw("var"), "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom + }; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) + return false; + escaped = !escaped && next == "\\"; + } + return escaped; + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function jsTokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") + return chain(stream, state, jsTokenString(ch)); + else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + return ret(ch); + else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "js-atom"); + } + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/); + return ret("number", "js-atom"); + } + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, jsTokenComment); + } + else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "js-comment"); + } + else if (state.reAllowed) { + nextUntilUnescaped(stream, "/"); + stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla + return ret("regexp", "js-string"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + else { + stream.eatWhile(/[\w\$_]/); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return known ? ret(known.type, known.style, word) : + ret("variable", "js-variable", word); + } + } + + function jsTokenString(quote) { + return function(stream, state) { + if (!nextUntilUnescaped(stream, quote)) + state.tokenize = jsTokenBase; + return ret("string", "js-string"); + }; + } + + function jsTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "js-comment"); + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "js-localvariable"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + var state = cx.state; + if (state.context) { + cx.marked = "js-variabledef"; + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return; + state.localVars = {name: varname, next: state.localVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + if (!cx.state.context) cx.state.localVars = defaultVars; + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info) + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + return function expecting(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(arguments.callee); + }; + } + + function statement(type) { + if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), + poplex, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); + if (type == "function") return cont(functiondef); + if (type == "keyword c") return cont(expression); + if (type == "(") return cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator); + if (type == "operator") return cont(expression); + if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); + if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); + return cont(); + } + function maybeoperator(type, value) { + if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); + if (type == "operator") return cont(expression); + if (type == ";") return; + if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); + if (type == ".") return cont(property, maybeoperator); + if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperator, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "js-property"; return cont();} + } + function objprop(type) { + if (type == "variable") cx.marked = "js-property"; + if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") return cont(what, proceed); + if (type == end) return cont(); + return cont(expect(end)); + } + return function commaSeparated(type) { + if (type == end) return cont(); + else return pass(what, proceed); + }; + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function vardef1(type, value) { + if (type == "variable"){register(value); return cont(vardef2);} + return cont(); + } + function vardef2(type, value) { + if (value == "=") return cont(expression, vardef2); + if (type == ",") return cont(vardef1); + } + function forspec1(type) { + if (type == "var") return cont(vardef1, forspec2); + if (type == ";") return pass(forspec2); + if (type == "variable") return cont(formaybein); + return pass(forspec2); + } + function formaybein(type, value) { + if (value == "in") return cont(expression); + return cont(maybeoperator, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in") return cont(expression); + return cont(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); + } + function funarg(type, value) { + if (type == "variable") {register(value); return cont();} + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: jsTokenBase, + reAllowed: true, + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: null, + context: null, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.reAllowed = type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/); + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize != jsTokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, + type = lexical.type, closing = firstChar == type; + if (type == "vardef") return lexical.indented + 4; + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "stat" || type == "form") return lexical.indented + indentUnit; + else if (lexical.info == "switch" && !closing) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricChars: ":{}" + }; +}); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); diff --git a/plugins/LocalFilesEditor/codemirror/mode/php/index.html b/plugins/LocalFilesEditor/codemirror/mode/php/index.html new file mode 100644 index 000000000..020e24898 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/php/index.html @@ -0,0 +1,52 @@ + + + + CodeMirror 2: PHP mode + + + + + + + + + + + + + + + +

CodeMirror 2: PHP mode

+ +
+ + + +

Simple HTML/PHP mode based on + the C-like mode. Depends on XML, + JavaScript, CSS, and C-like modes.

+ +

MIME types defined: application/x-httpd-php.

+ + diff --git a/plugins/LocalFilesEditor/codemirror/mode/php/php.js b/plugins/LocalFilesEditor/codemirror/mode/php/php.js new file mode 100644 index 000000000..a23538f6b --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/php/php.js @@ -0,0 +1,83 @@ +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var phpKeywords = + keywords("abstract and array as break case catch cfunction class clone const continue declare " + + "default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends " + + "final for foreach function global goto if implements interface instanceof namespace " + + "new or private protected public static switch throw try use var while xor"); + + CodeMirror.defineMode("php", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, "text/html"); + var jsMode = CodeMirror.getMode(config, "text/javascript"); + var cssMode = CodeMirror.getMode(config, "text/css"); + var phpMode = CodeMirror.getMode(config, {name: "clike", keywords: phpKeywords, multiLineStrings: true, $vars: true}); + + function dispatch(stream, state) { // TODO open PHP inside text/css + if (state.curMode == htmlMode) { + var style = htmlMode.token(stream, state.curState); + if (style == "xml-processing" && /^<\?/.test(stream.current())) { + state.curMode = phpMode; + state.curState = state.php; + state.curClose = /^\?>/; + } + else if (style == "xml-tag" && stream.current() == ">" && state.curState.context) { + if (/^script$/i.test(state.curState.context.tagName)) { + state.curMode = jsMode; + state.curState = jsMode.startState(htmlMode.indent(state.curState, "")); + state.curClose = /^<\/\s*script\s*>/i; + } + else if (/^style$/i.test(state.curState.context.tagName)) { + state.curMode = cssMode; + state.curState = cssMode.startState(htmlMode.indent(state.curState, "")); + state.curClose = /^<\/\s*style\s*>/i; + } + } + return style; + } + else if (stream.match(state.curClose, false)) { + state.curMode = htmlMode; + state.curState = state.html; + state.curClose = null; + return dispatch(stream, state); + } + else return state.curMode.token(stream, state.curState); + } + + return { + startState: function() { + var html = htmlMode.startState(); + return {html: html, + php: phpMode.startState(), + curMode: htmlMode, + curState: html, + curClose: null} + }, + + copyState: function(state) { + var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), + php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; + if (state.curState == html) cur = htmlNew; + else if (state.curState == php) cur = phpNew; + else cur = CodeMirror.copyState(state.curMode, state.curState); + return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, curClose: state.curClose}; + }, + + token: dispatch, + + indent: function(state, textAfter) { + if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || + (state.curMode == phpMode && /^\?>/.test(textAfter))) + return htmlMode.indent(state.html, textAfter); + return state.curMode.indent(state.curState, textAfter); + }, + + electricChars: "/{}:" + } + }); +})(); + +CodeMirror.defineMIME("application/x-httpd-php", "php"); diff --git a/plugins/LocalFilesEditor/codemirror/mode/stex/index.html b/plugins/LocalFilesEditor/codemirror/mode/stex/index.html new file mode 100644 index 000000000..73b07ac13 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/stex/index.html @@ -0,0 +1,96 @@ + + + + CodeMirror 2: sTeX mode + + + + + + + + +

CodeMirror 2: sTeX mode

+
+ + +

MIME types defined: text/stex.

+ + + diff --git a/plugins/LocalFilesEditor/codemirror/mode/stex/stex.css b/plugins/LocalFilesEditor/codemirror/mode/stex/stex.css new file mode 100644 index 000000000..64b975e98 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/stex/stex.css @@ -0,0 +1,20 @@ +span.css-at {color: #708;} +span.css-unit {color: #281;} +span.css-value {color: #708;} +span.css-identifier {color: black;} +span.css-selector {color: #11B;} +span.css-important {color: #00F;} +span.css-colorcode {color: #299;} +span.css-comment {color: #A70;} +span.css-string {color: #A22;} + +span.stex-unit { color: #281; } +span.stex-identifier { color: black; } +span.stex-slash { color: #FAA; } +span.stex-command { color: #00F; } +span.stex-comment { color: #A70; } +span.stex-import { color: #00F; } +span.stex-filepath { color: #852626; } +span.stex-module { color: #852626; } +span.stex-error { text-decoration: underline; color: red; } +span.stex-string { color: #A22; } diff --git a/plugins/LocalFilesEditor/codemirror/mode/stex/stex.js b/plugins/LocalFilesEditor/codemirror/mode/stex/stex.js new file mode 100644 index 000000000..10e0d6cad --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/stex/stex.js @@ -0,0 +1,167 @@ +/* + * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) + * Licence: MIT + */ + +CodeMirror.defineMode("stex", function(cmCfg, modeCfg) +{ + function pushCommand(state, command) { + state.cmdState.push(command); + } + + function peekCommand(state) { + if (state.cmdState.length>0) + return state.cmdState[state.cmdState.length-1]; + else + return null; + } + + function popCommand(state) { + if (state.cmdState.length>0) { + var plug = state.cmdState.pop(); + plug.closeBracket(); + } + } + + function applyMostPowerful(state) { + context = state.cmdState; + for (var i = context.length - 1; i >= 0; i--) { + var plug = context[i]; + if (plug.name=="DEFAULT") + continue; + return plug.styleIdentifier(); + } + return "stex-identifier"; + } + + function addPluginPattern(pluginName, cmdStyle, brackets, styles) { + return function () { + this.name=pluginName; + this.bracketNo = 0; + this.style=cmdStyle; + this.styles = styles; + this.brackets = brackets; + + this.styleIdentifier = function(content) { + if (this.bracketNo<=this.styles.length) + return this.styles[this.bracketNo-1]; + else + return null; + }; + this.openBracket = function(content) { + this.bracketNo++; + return "stex-bracket"; + }; + this.closeBracket = function(content) { + }; + } + } + + var plugins = new Array(); + + plugins["importmodule"] = addPluginPattern("importmodule", "stex-command", "{[", ["stex-filepath", "stex-module"]); + plugins["documentclass"] = addPluginPattern("documentclass", "stex-command", "{[", ["", "stex-unit"]); + plugins["usepackage"] = addPluginPattern("documentclass", "stex-command", "[", ["stex-unit"]); + plugins["begin"] = addPluginPattern("documentclass", "stex-command", "[", ["stex-unit"]); + plugins["end"] = addPluginPattern("documentclass", "stex-command", "[", ["stex-unit"]); + + plugins["DEFAULT"] = function () { + this.name="DEFAULT"; + this.style="stex-command"; + + this.styleIdentifier = function(content) { + }; + this.openBracket = function(content) { + }; + this.closeBracket = function(content) { + }; + }; + + function setState(state, f) { + state.f = f; + } + + function normal(source, state) { + if (source.match(/^\\[a-z]+/)) { + cmdName = source.current(); + cmdName = cmdName.substr(1, cmdName.length-1); + var plug = plugins[cmdName]; + if (typeof(plug) == 'undefined') { + plug = plugins["DEFAULT"]; + } + plug = new plug(); + pushCommand(state, plug); + setState(state, beginParams); + return plug.style; + } + + var ch = source.next(); + if (ch == "%") { + setState(state, inCComment); + return "stex-comment"; + } + else if (ch=='}' || ch==']') { + plug = peekCommand(state); + if (plug) { + plug.closeBracket(ch); + setState(state, beginParams); + } else + return "stex-error"; + return "stex-bracket"; + } else if (ch=='{' || ch=='[') { + plug = plugins["DEFAULT"]; + plug = new plug(); + pushCommand(state, plug); + return "stex-bracket"; + } + else if (/\d/.test(ch)) { + source.eatWhile(/[\w.%]/); + return "stex-unit"; + } + else { + source.eatWhile(/[\w-_]/); + return applyMostPowerful(state); + } + } + + function inCComment(source, state) { + source.skipToEnd(); + setState(state, normal); + return "css-comment"; + } + + function beginParams(source, state) { + var ch = source.peek(); + if (ch == '{' || ch == '[') { + lastPlug = peekCommand(state); + style = lastPlug.openBracket(ch); + source.eat(ch); + setState(state, normal); + return "stex-bracket"; + } + if (/[ \t\r]/.test(ch)) { + source.eat(ch); + return null; + } + setState(state, normal); + lastPlug = peekCommand(state); + if (lastPlug) { + popCommand(state); + } + return normal(source, state); + } + + return { + startState: function() { return { f:normal, cmdState:[] }; }, + copyState: function(s) { return { f: s.f, cmdState: s.cmdState.slice(0, s.cmdState.length) }; }, + + token: function(stream, state) { + var t = state.f(stream, state); + var w = stream.current(); + return t; + } + }; +}); + + +CodeMirror.defineMIME("text/x-stex", "stex"); diff --git a/plugins/LocalFilesEditor/codemirror/mode/xml/index.html b/plugins/LocalFilesEditor/codemirror/mode/xml/index.html new file mode 100644 index 000000000..5ad7c63fe --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/xml/index.html @@ -0,0 +1,42 @@ + + + + CodeMirror 2: XML mode + + + + + + + + +

CodeMirror 2: XML mode

+
+ +

The XML mode supports two configuration parameters:

+
+
htmlMode (boolean)
+
This switches the mode to parse HTML instead of XML. This + means attributes do not have to be quoted, and some elements + (such as br) do not require a closing tag.
+
alignCDATA (boolean)
+
Setting this to true will force the opening tag of CDATA + blocks to not be indented.
+
+ +

MIME types defined: application/xml, text/html.

+ + diff --git a/plugins/LocalFilesEditor/codemirror/mode/xml/xml.css b/plugins/LocalFilesEditor/codemirror/mode/xml/xml.css new file mode 100644 index 000000000..86845faa6 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/xml/xml.css @@ -0,0 +1,7 @@ +span.xml-tag {color: #a0b;} +span.xml-attribute {color: #281;} +span.xml-attname {color: #00f;} +span.xml-comment {color: #a70;} +span.xml-cdata {color: #48a;} +span.xml-processing {color: #999;} +span.xml-entity {color: #a22;} diff --git a/plugins/LocalFilesEditor/codemirror/mode/xml/xml.js b/plugins/LocalFilesEditor/codemirror/mode/xml/xml.js new file mode 100644 index 000000000..21da47b22 --- /dev/null +++ b/plugins/LocalFilesEditor/codemirror/mode/xml/xml.js @@ -0,0 +1,206 @@ +CodeMirror.defineMode("xml", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var Kludges = parserConfig.htmlMode ? { + autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true, + "meta": true, "col": true, "frame": true, "base": true, "area": true}, + doNotIndent: {"pre": true, "!cdata": true}, + allowUnquoted: true + } : {autoSelfClosers: {}, doNotIndent: {"!cdata": true}, allowUnquoted: false}; + var alignCDATA = parserConfig.alignCDATA; + + // Return variables for tokenizers + var tagName, type; + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var ch = stream.next(); + if (ch == "<") { + if (stream.eat("!")) { + if (stream.eat("[")) { + if (stream.match("[CDATA[")) return chain(inBlock("xml-cdata", "]]>")); + else return null; + } + else if (stream.match("--")) return chain(inBlock("xml-comment", "-->")); + else if (stream.match("DOCTYPE")) { + stream.eatWhile(/[\w\._\-]/); + return chain(inBlock("xml-doctype", ">")); + } + else return null; + } + else if (stream.eat("?")) { + stream.eatWhile(/[\w\._\-]/); + state.tokenize = inBlock("xml-processing", "?>"); + return "xml-processing"; + } + else { + type = stream.eat("/") ? "closeTag" : "openTag"; + stream.eatSpace(); + tagName = ""; + var c; + while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; + state.tokenize = inTag; + return "xml-tag"; + } + } + else if (ch == "&") { + stream.eatWhile(/[^;]/); + stream.eat(";"); + return "xml-entity"; + } + else { + stream.eatWhile(/[^&<]/); + return null; + } + } + + function inTag(stream, state) { + var ch = stream.next(); + if (ch == ">" || (ch == "/" && stream.eat(">"))) { + state.tokenize = inText; + type = ch == ">" ? "endTag" : "selfcloseTag"; + return "xml-tag"; + } + else if (ch == "=") { + type = "equals"; + return null; + } + else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + return state.tokenize(stream, state); + } + else { + stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/); + return "xml-word"; + } + } + + function inAttribute(quote) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inTag; + break; + } + } + return "xml-attribute"; + }; + } + + function inBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + return style; + }; + } + + var curState, setStyle; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + + function pushContext(tagName, startOfLine) { + var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); + curState.context = { + prev: curState.context, + tagName: tagName, + indent: curState.indented, + startOfLine: startOfLine, + noIndent: noIndent + }; + } + function popContext() { + if (curState.context) curState.context = curState.context.prev; + } + + function element(type) { + if (type == "openTag") {curState.tagName = tagName; return cont(attributes, endtag(curState.startOfLine));} + else if (type == "closeTag") {popContext(); return cont(endclosetag);} + else if (type == "xml-cdata") { + if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); + if (curState.tokenize == inText) popContext(); + return cont(); + } + else return cont(); + } + function endtag(startOfLine) { + return function(type) { + if (type == "selfcloseTag" || + (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) + return cont(); + if (type == "endTag") {pushContext(curState.tagName, startOfLine); return cont();} + return cont(); + }; + } + function endclosetag(type) { + if (type == "endTag") return cont(); + return pass(); + } + + function attributes(type) { + if (type == "xml-word") {setStyle = "xml-attname"; return cont(attributes);} + if (type == "equals") return cont(attvalue, attributes); + return pass(); + } + function attvalue(type) { + if (type == "xml-word" && Kludges.allowUnquoted) {setStyle = "xml-attribute"; return cont();} + if (type == "xml-attribute") return cont(); + return pass(); + } + + return { + startState: function() { + return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null}; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.startOfLine = true; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + + setStyle = type = tagName = null; + var style = state.tokenize(stream, state); + if ((style || type) && style != "xml-comment") { + curState = state; + while (true) { + var comb = state.cc.pop() || element; + if (comb(type || style)) break; + } + } + state.startOfLine = false; + return setStyle || style; + }, + + indent: function(state, textAfter) { + var context = state.context; + if (context && context.noIndent) return 0; + if (alignCDATA && /= 0 && this.selectIndex < as.length ) - { - as[ this.selectIndex ].onmousedown(); - return false - } - // simply add an enter in the code - else - { - this._hide(); - return true; - } - } - else if( letter=="Tab" || letter=="Down") - { - this._selectNext(); - return false; - } - else if( letter=="Up") - { - this._selectBefore(); - return false; - } - } - // hidden - else - { - - } - - // show current suggestion list and do autoSelect if possible (no matter it's shown or hidden) - if( letter=="Space" && CtrlPressed(e) ) - { - //parent.console.log('SHOW SUGGEST'); - this.forceDisplay = true; - this.autoSelectIfOneResult = true; - this._checkLetter(); - return false; - } - - // wait a short period for check that the cursor isn't moving - setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 ); - this.checkDelayTimer = false; - return true; - } - /** - * Executes a specific command, this function handles plugin commands. - * - * @param {string} cmd: the name of the command being executed - * @param {unknown} param: the parameter of the command - * @return true - pass to next handler in chain, false - stop chain execution - * @type boolean - */ - ,execCommand: function(cmd, param){ - switch( cmd ){ - case 'toggle_autocompletion': - var icon= document.getElementById("autocompletion"); - if(!this.enabled) - { - if(icon != null){ - editArea.restoreClass(icon); - editArea.switchClassSticky(icon, 'editAreaButtonSelected', true); - } - this.enabled= true; - } - else - { - this.enabled= false; - if(icon != null) - editArea.switchClassSticky(icon, 'editAreaButtonNormal', false); - } - return true; - } - return true; - } - ,_checkDelayAndCursorBeforeDisplay: function() - { - this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();", this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 ); - } - // hide the suggested box - ,_hide: function(){ - this.container.style.display="none"; - this.selectIndex = -1; - this.shown = false; - this.forceDisplay = false; - this.autoSelectIfOneResult = false; - } - // display the suggested box - ,_show: function(){ - if( !this._isShown() ) - { - this.container.style.display="block"; - this.selectIndex = -1; - this.shown = true; - } - } - // is the suggested box displayed? - ,_isShown: function(){ - return this.shown; - } - // setter and getter - ,_isInMiddleWord: function( new_value ){ - if( typeof( new_value ) == "undefined" ) - return this.isInMiddleWord; - else - this.isInMiddleWord = new_value; - } - // select the next element in the suggested box - ,_selectNext: function() - { - var as = this.container.getElementsByTagName('A'); - - // clean existing elements - for( var i=0; i= as.length || this.selectIndex < 0 ) ? 0 : this.selectIndex; - as[ this.selectIndex ].className += " focus"; - } - // select the previous element in the suggested box - ,_selectBefore: function() - { - var as = this.container.getElementsByTagName('A'); - - // clean existing elements - for( var i=0; i= as.length || this.selectIndex < 0 ) ? as.length-1 : this.selectIndex; - as[ this.selectIndex ].className += " focus"; - } - ,_select: function( content ) - { - cursor_forced_position = content.indexOf( '{@}' ); - content = content.replace(/{@}/g, '' ); - editArea.getIESelection(); - - // retrive the number of matching characters - var start_index = Math.max( 0, editArea.textarea.selectionEnd - content.length ); - - line_string = editArea.textarea.value.substring( start_index, editArea.textarea.selectionEnd + 1); - limit = line_string.length -1; - nbMatch = 0; - for( i =0; i 0 ) - parent.editAreaLoader.setSelectionRange(editArea.id, editArea.textarea.selectionStart - nbMatch , editArea.textarea.selectionEnd); - - parent.editAreaLoader.setSelectedText(editArea.id, content ); - range= parent.editAreaLoader.getSelectionRange(editArea.id); - - if( cursor_forced_position != -1 ) - new_pos = range["end"] - ( content.length-cursor_forced_position ); - else - new_pos = range["end"]; - parent.editAreaLoader.setSelectionRange(editArea.id, new_pos, new_pos); - this._hide(); - } - - - /** - * Parse the AUTO_COMPLETION part of syntax definition files - */ - ,_parseSyntaxAutoCompletionDatas: function(){ - //foreach syntax loaded - for(var lang in parent.editAreaLoader.load_syntax) - { - if(!parent.editAreaLoader.syntax[lang]['autocompletion']) // init the regexp if not already initialized - { - parent.editAreaLoader.syntax[lang]['autocompletion']= {}; - // the file has auto completion datas - if(parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION']) - { - // parse them - for(var i in parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION']) - { - datas = parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'][i]; - tmp = {}; - if(datas["CASE_SENSITIVE"]!="undefined" && datas["CASE_SENSITIVE"]==false) - tmp["modifiers"]="i"; - else - tmp["modifiers"]=""; - tmp["prefix_separator"]= datas["REGEXP"]["prefix_separator"]; - tmp["match_prefix_separator"]= new RegExp( datas["REGEXP"]["prefix_separator"] +"$", tmp["modifiers"]); - tmp["match_word"]= new RegExp("(?:"+ datas["REGEXP"]["before_word"] +")("+ datas["REGEXP"]["possible_words_letters"] +")$", tmp["modifiers"]); - tmp["match_next_letter"]= new RegExp("^("+ datas["REGEXP"]["letter_after_word_must_match"] +")$", tmp["modifiers"]); - tmp["keywords"]= {}; - //console.log( datas["KEYWORDS"] ); - for( var prefix in datas["KEYWORDS"] ) - { - tmp["keywords"][prefix]= { - prefix: prefix, - prefix_name: prefix, - prefix_reg: new RegExp("(?:"+ parent.editAreaLoader.get_escaped_regexp( prefix ) +")(?:"+ tmp["prefix_separator"] +")$", tmp["modifiers"] ), - datas: [] - }; - for( var j=0; j it's valid - if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 ) - { - if( ! before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) ) - hasMatch = true; - } - // we still need to check the prefix if there is one - else if( this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 ) - { - if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) ) - hasMatch = true; - } - - if( hasMatch ) - results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ]; - } - } - } - } - // it doesn't match any possible word but we want to display something - // we'll display to list of all available words - else if( this.forceDisplay || match_prefix_separator ) - { - for(var prefix in this.curr_syntax[i]["keywords"]) - { - for(var j=0; j it's valid - if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 ) - { - hasMatch = true; - } - // we still need to check the prefix if there is one - else if( match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 ) - { - var before = last_chars; //.substr( 0, last_chars.length ); - if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) ) - hasMatch = true; - } - - if( hasMatch ) - results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ]; - } - } - } - } - } - - // there is only one result, and we can select it automatically - if( results.length == 1 && this.autoSelectIfOneResult ) - { - // console.log( results ); - this._select( results[0][1]['replace_with'] ); - } - else if( results.length == 0 ) - { - this._hide(); - } - else - { - // build the suggestion box content - var lines=[]; - for(var i=0; i"+ results[i][1]['comment']; - if(results[i][0]['prefix_name'].length>0) - line+=''+ results[i][0]['prefix_name'] +''; - line+=''; - lines[lines.length]=line; - } - // sort results - this.container.innerHTML = '
    '+ lines.sort().join('') +'
'; - - var cursor = _$("cursor_pos"); - this.container.style.top = ( cursor.cursor_top + editArea.lineHeight ) +"px"; - this.container.style.left = ( cursor.cursor_left + 8 ) +"px"; - this._show(); - } - - this.autoSelectIfOneResult = false; - time=new Date; - t2= time.getTime(); - - //parent.console.log( begin_word +"\n"+ (t2-t1) +"\n"+ html ); - } - } -}; - -// Load as a plugin -editArea.settings['plugins'][ editArea.settings['plugins'].length ] = 'autocompletion'; -editArea.add_plugin('autocompletion', EditArea_autocompletion); \ No newline at end of file diff --git a/plugins/LocalFilesEditor/editarea/edit_area.css b/plugins/LocalFilesEditor/editarea/edit_area.css deleted file mode 100644 index 172b366f2..000000000 --- a/plugins/LocalFilesEditor/editarea/edit_area.css +++ /dev/null @@ -1,530 +0,0 @@ -body, html{ - margin: 0; - padding: 0; - height: 100%; - border: none; - overflow: hidden; - background-color: #FFF; -} - -body, html, table, form, textarea{ - font: 12px monospace, sans-serif; -} - -#editor{ - border: solid #888 1px; - overflow: hidden; -} - -#result{ - z-index: 4; - overflow-x: auto; - overflow-y: scroll; - border-top: solid #888 1px; - border-bottom: solid #888 1px; - position: relative; - clear: both; -} - -#result.empty{ - overflow: hidden; -} - -#container{ - overflow: hidden; - border: solid blue 0; - position: relative; - z-index: 10; - padding: 0 5px 0 45px; - /*padding-right: 5px;*/ -} - -#textarea{ - position: relative; - top: 0; - left: 0; - margin: 0; - padding: 0; - width: 100%; - height: 100%; - overflow: hidden; - z-index: 7; - border-width: 0; - background-color: transparent; - resize: none; -} - -#textarea, #textarea:hover{ - outline: none; /* safari outline fix */ -} - -#content_highlight{ - white-space: pre; - margin: 0; - padding: 0; - position : absolute; - z-index: 4; - overflow: visible; -} - - -#selection_field, #selection_field_text{ - margin: 0; - background-color: #E1F2F9; -/* height: 1px; */ - position: absolute; - z-index: 5; - top: -100px; - padding: 0; - white-space: pre; - overflow: hidden; -} - -#selection_field.show_colors { - z-index: 3; - background-color:#EDF9FC; - -} - -#selection_field strong{ - font-weight:normal; -} - -#selection_field.show_colors *, #selection_field_text * { - visibility: hidden; -} - -#selection_field_text{ - background-color:transparent; -} - -#selection_field_text strong{ - font-weight:normal; - background-color:#3399FE; - color: #FFF; - visibility:visible; -} - -#container.word_wrap #content_highlight, -#container.word_wrap #selection_field, -#container.word_wrap #selection_field_text, -#container.word_wrap #test_font_size{ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ - width: 99%; -} - -#line_number{ - position: absolute; - overflow: hidden; - border-right: solid black 1px; - z-index:8; - width: 38px; - padding: 0 5px 0 0; - margin: 0 0 0 -45px; - text-align: right; - color: #AAAAAA; -} - -#test_font_size{ - padding: 0; - margin: 0; - visibility: hidden; - position: absolute; - white-space: pre; -} - -pre{ - margin: 0; - padding: 0; -} - -.hidden{ - opacity: 0.2; - filter:alpha(opacity=20); -} - -#result .edit_area_cursor{ - position: absolute; - z-index:6; - background-color: #FF6633; - top: -100px; - margin: 0; -} - -#result .edit_area_selection_field .overline{ - background-color: #996600; -} - - -/* area popup */ -.editarea_popup{ - border: solid 1px #888888; - background-color: #ECE9D8; - width: 250px; - padding: 4px; - position: absolute; - visibility: hidden; - z-index: 15; - top: -500px; -} - -.editarea_popup, .editarea_popup table{ - font-family: sans-serif; - font-size: 10pt; -} - -.editarea_popup img{ - border: 0; -} - -.editarea_popup .close_popup{ - float: right; - line-height: 16px; - border: 0; - padding: 0; -} - -.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{ - margin: 0; - padding: 0; -} - -.editarea_popup .copyright{ - text-align: right; -} - -/* Area_search */ -div#area_search_replace{ - /*width: 250px;*/ -} - -div#area_search_replace img{ - border: 0; -} - -div#area_search_replace div.button{ - text-align: center; - line-height: 1.7em; -} - -div#area_search_replace .button a{ - cursor: pointer; - border: solid 1px #888888; - background-color: #DEDEDE; - text-decoration: none; - padding: 0 2px; - color: #000000; - white-space: nowrap; -} - -div#area_search_replace a:hover{ - /*border: solid 1px #888888;*/ - background-color: #EDEDED; -} - -div#area_search_replace #move_area_search_replace{ - cursor: move; - border: solid 1px #888; -} - -div#area_search_replace #close_area_search_replace{ - text-align: right; - vertical-align: top; - white-space: nowrap; -} - -div#area_search_replace #area_search_msg{ - height: 18px; - overflow: hidden; - border-top: solid 1px #888; - margin-top: 3px; -} - -/* area help */ -#edit_area_help{ - width: 350px; -} - -#edit_area_help div.close_popup{ - float: right; -} - -/* area_toolbar */ -.area_toolbar{ - /*font: 11px sans-serif;*/ - width: 100%; - /*height: 21px; */ - margin: 0; - padding: 0; - background-color: #ECE9D8; - text-align: center; -} - -.area_toolbar, .area_toolbar table{ - font: 11px sans-serif; -} - -.area_toolbar img{ - border: 0; - vertical-align: middle; -} - -.area_toolbar input{ - margin: 0; - padding: 0; -} - -.area_toolbar select{ - font-family: 'MS Sans Serif',sans-serif,Verdana,Arial; - font-size: 7pt; - font-weight: normal; - margin: 2px 0 0 0 ; - padding: 0; - vertical-align: top; - background-color: #F0F0EE; -} - -table.statusbar{ - width: 100%; -} - -.area_toolbar td.infos{ - text-align: center; - width: 130px; - border-right: solid 1px #888; - border-width: 0 1px 0 0; - padding: 0; -} - -.area_toolbar td.total{ - text-align: right; - width: 50px; - padding: 0; -} - -.area_toolbar td.resize{ - text-align: right; -} -/* -.area_toolbar span{ - line-height: 1px; - padding: 0; - margin: 0; -}*/ - -.area_toolbar span#resize_area{ - cursor: nw-resize; - visibility: hidden; -} - -/* toolbar buttons */ -.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected { - border: 0; margin: 0; padding: 0; background: transparent; - margin-top: 0; - margin-left: 1px; - padding: 0; -} - -.editAreaButtonNormal { - border: 1px solid #ECE9D8 !important; - cursor: pointer; -} - -.editAreaButtonOver { - border: 1px solid #0A246A !important; - cursor: pointer; - background-color: #B6BDD2; -} - -.editAreaButtonDown { - cursor: pointer; - border: 1px solid #0A246A !important; - background-color: #8592B5; -} - -.editAreaButtonSelected { - border: 1px solid #C0C0BB !important; - cursor: pointer; - background-color: #F4F2E8; -} - -.editAreaButtonDisabled { - filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); - -moz-opacity:0.3; - opacity: 0.3; - border: 1px solid #F0F0EE !important; - cursor: pointer; -} - -.editAreaSeparatorLine { - margin: 1px 2px; - background-color: #C0C0BB; - width: 2px; - height: 18px; -} - -/* waiting screen */ -#processing{ - display: none; - background-color:#ECE9D8; - border: solid #888 1px; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 100; - text-align: center; -} - -#processing_text{ - position:absolute; - left: 50%; - top: 50%; - width: 200px; - height: 20px; - margin-left: -100px; - margin-top: -10px; - text-align: center; -} -/* end */ - - -/**** tab browsing area ****/ -#tab_browsing_area{ - display: none; - background-color: #CCC9A8; - border-top: 1px solid #888; - text-align: left; - margin: 0; -} - -#tab_browsing_list { - padding: 0; - margin: 0; - list-style-type: none; - white-space: nowrap; -} -#tab_browsing_list li { - float: left; - margin: -1px; -} -#tab_browsing_list a { - position: relative; - display: block; - text-decoration: none; - float: left; - cursor: pointer; - line-height:14px; -} - -#tab_browsing_list a span { - display: block; - color: #000; - background: #ECE9D8; - border: 1px solid #888; - border-width: 1px 1px 0; - text-align: center; - padding: 2px 2px 1px 4px; - position: relative; /*IE 6 hack */ -} - -#tab_browsing_list a b { - display: block; - border-bottom: 2px solid #617994; -} - -#tab_browsing_list a .edited { - display: none; -} - -#tab_browsing_list a.edited .edited { - display: inline; -} - -#tab_browsing_list a img{ - margin-left: 7px; -} - -#tab_browsing_list a.edited img{ - margin-left: 3px; -} - -#tab_browsing_list a:hover span { - background: #F4F2E8; - border-color: #0A246A; -} - -#tab_browsing_list .selected a span{ - background: #046380; - color: #FFF; -} - - -#no_file_selected{ - height: 100%; - width: 150%; /* Opera need more than 100% */ - background: #CCC; - display: none; - z-index: 20; - position: absolute; -} - - -/*** Non-editable mode ***/ -.non_editable #editor -{ - border-width: 0 1px; -} - -.non_editable .area_toolbar -{ - display: none; -} - -/*** Auto completion ***/ -#auto_completion_area -{ - background: #FFF; - border: solid 1px #888; - position: absolute; - z-index: 15; - width: 280px; - height: 180px; - overflow: auto; - display:none; -} - -#auto_completion_area a, #auto_completion_area a:visited -{ - display: block; - padding: 0 2px 1px; - color: #000; - text-decoration:none; -} - -#auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus -{ - background: #D6E1FE; - text-decoration:none; -} - -#auto_completion_area ul -{ - margin: 0; - padding: 0; - list-style: none inside; -} -#auto_completion_area li -{ - padding: 0; -} -#auto_completion_area .prefix -{ - font-style: italic; - padding: 0 3px; -} \ No newline at end of file diff --git a/plugins/LocalFilesEditor/editarea/edit_area.js b/plugins/LocalFilesEditor/editarea/edit_area.js deleted file mode 100644 index 32d2a98a8..000000000 --- a/plugins/LocalFilesEditor/editarea/edit_area.js +++ /dev/null @@ -1,527 +0,0 @@ -/****** - * - * EditArea - * Developped by Christophe Dolivet - * Released under LGPL, Apache and BSD licenses (use the one you want) - * -******/ - - function EditArea(){ - var t=this; - t.error= false; // to know if load is interrrupt - - t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"}, - {popup_id: "edit_area_help", icon_id: "help"}]; - t.plugins= {}; - - t.line_number=0; - - parent.editAreaLoader.set_browser_infos(t); // navigator identification - // fix IE8 detection as we run in IE7 emulate mode through X-UA tag - if( t.isIE >= 8 ) - t.isIE = 7; - - t.last_selection={}; - t.last_text_to_highlight=""; - t.last_hightlighted_text= ""; - t.syntax_list= []; - t.allready_used_syntax= {}; - t.check_line_selection_timer= 50; // the timer delay for modification and/or selection change detection - - t.textareaFocused= false; - t.highlight_selection_line= null; - t.previous= []; - t.next= []; - t.last_undo=""; - t.files= {}; - t.filesIdAssoc= {}; - t.curr_file= ''; - //t.loaded= false; - t.assocBracket={}; - t.revertAssocBracket= {}; - // bracket selection init - t.assocBracket["("]=")"; - t.assocBracket["{"]="}"; - t.assocBracket["["]="]"; - for(var index in t.assocBracket){ - t.revertAssocBracket[t.assocBracket[index]]=index; - } - t.is_editable= true; - - - /*t.textarea=""; - - t.state="declare"; - t.code = []; // store highlight syntax for languagues*/ - // font datas - t.lineHeight= 16; - /*t.default_font_family= "monospace"; - t.default_font_size= 10;*/ - t.tab_nb_char= 8; //nb of white spaces corresponding to a tabulation - if(t.isOpera) - t.tab_nb_char= 6; - - t.is_tabbing= false; - - t.fullscreen= {'isFull': false}; - - t.isResizing=false; // resize var - - // init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation - t.id= area_id; - t.settings= editAreas[t.id]["settings"]; - - if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/)) - { - t.tab_nb_char= t.settings['replace_tab_by_spaces']; - t.tabulation=""; - for(var i=0; i0) - t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(","); - - if(t.settings['syntax']) - t.allready_used_syntax[t.settings['syntax']]=true; - - - }; - EditArea.prototype.init= function(){ - var t=this, a, s=t.settings; - t.textarea = _$("textarea"); - t.container = _$("container"); - t.result = _$("result"); - t.content_highlight = _$("content_highlight"); - t.selection_field = _$("selection_field"); - t.selection_field_text= _$("selection_field_text"); - t.processing_screen = _$("processing"); - t.editor_area = _$("editor"); - t.tab_browsing_area = _$("tab_browsing_area"); - t.test_font_size = _$("test_font_size"); - a = t.textarea; - - if(!s['is_editable']) - t.set_editable(false); - - t.set_show_line_colors( s['show_line_colors'] ); - - if(syntax_selec= _$("syntax_selection")) - { - // set up syntax selection lsit in the toolbar - for(var i=0; i= '3' ) { - t.content_highlight.style.paddingLeft= "1px"; - t.selection_field.style.paddingLeft= "1px"; - t.selection_field_text.style.paddingLeft= "1px"; - } - - if(t.isIE && t.isIE < 8 ){ - a.style.marginTop= "-1px"; - } - /* - if(t.isOpera){ - t.editor_area.style.position= "absolute"; - }*/ - - if( t.isSafari ){ - t.editor_area.style.position = "absolute"; - a.style.marginLeft ="-3px"; - if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?) - a.style.marginTop ="1px"; - } - - // si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea - parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);} }); - - if(s['is_multi_files']!=false) - t.open_file({'id': t.curr_file, 'text': ''}); - - t.set_word_wrap( s['word_wrap'] ); - - setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10); - //start checkup routine - t.check_undo(); - t.check_line_selection(true); - t.scroll_to_view(); - - for(var i in t.plugins){ - if(typeof(t.plugins[i].onload)=="function") - t.plugins[i].onload(); - } - if(s['fullscreen']==true) - t.toggle_full_screen(true); - - parent.editAreaLoader.add_event(window, "resize", editArea.update_size); - parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size); - parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size); - parent.editAreaLoader.add_event(window, "unload", function(){ - // in case where editAreaLoader have been already cleaned - if( parent.editAreaLoader ) - { - parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size); - parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size); - } - if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){ - editArea.execCommand("EA_unload"); - } - }); - - - /*date= new Date(); - alert(date.getTime()- parent.editAreaLoader.start_time);*/ - }; - - - - //called by the toggle_on - EditArea.prototype.update_size= function(){ - var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop; - - if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){ - if(editArea.fullscreen['isFull']){ - pd.getElementById("frame_"+editArea.id).style.width = pd.getElementsByTagName("html")[0].clientWidth + "px"; - pd.getElementById("frame_"+editArea.id).style.height = pd.getElementsByTagName("html")[0].clientHeight + "px"; - } - - if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) ) - { - editArea.tab_browsing_area.style.height = "0px"; - editArea.tab_browsing_area.style.height = (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px"; - } - - height = d.body.offsetHeight - editArea.get_all_toolbar_height() - 4; - editArea.result.style.height = height +"px"; - - width = d.body.offsetWidth -2; - editArea.result.style.width = width+"px"; - //alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight); - - // check that the popups don't get out of the screen - for( i=0; i < editArea.inlinePopup.length; i++ ) - { - popup = _$(editArea.inlinePopup[i]["popup_id"]); - maxLeft = d.body.offsetWidth - popup.offsetWidth; - maxTop = d.body.offsetHeight - popup.offsetHeight; - if( popup.offsetTop > maxTop ) - popup.style.top = maxTop+"px"; - if( popup.offsetLeft > maxLeft ) - popup.style.left = maxLeft+"px"; - } - - editArea.manage_size( true ); - editArea.fixLinesHeight( editArea.textarea.value, 0,-1); - } - }; - - - EditArea.prototype.manage_size= function(onlyOneTime){ - if(!editAreas[this.id]) - return false; - - if(editAreas[this.id]["displayed"]==true && this.textareaFocused) - { - var area_height,resized= false; - - //1) Manage display width - //1.1) Calc the new width to use for display - if( !this.settings['word_wrap'] ) - { - var area_width= this.textarea.scrollWidth; - area_height= this.textarea.scrollHeight; - // bug on old opera versions - if(this.isOpera && this.isOpera < 9.6 ){ - area_width=10000; - } - //1.2) the width is not the same, we must resize elements - if(this.textarea.previous_scrollWidth!=area_width) - { - this.container.style.width= area_width+"px"; - this.textarea.style.width= area_width+"px"; - this.content_highlight.style.width= area_width+"px"; - this.textarea.previous_scrollWidth=area_width; - resized=true; - } - } - // manage wrap width - if( this.settings['word_wrap'] ) - { - newW=this.textarea.offsetWidth; - if( this.isFirefox || this.isIE ) - newW-=2; - if( this.isSafari ) - newW-=6; - this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px"; - } - - //2) Manage display height - //2.1) Calc the new height to use for display - if( this.isOpera || this.isFirefox || this.isSafari ) { - area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 ); - } else { - area_height = this.textarea.scrollHeight; - } - //2.2) the width is not the same, we must resize elements - if(this.textarea.previous_scrollHeight!=area_height) - { - this.container.style.height= (area_height+2)+"px"; - this.textarea.style.height= area_height+"px"; - this.content_highlight.style.height= area_height+"px"; - this.textarea.previous_scrollHeight= area_height; - resized=true; - } - - //3) if there is new lines, we add new line numbers in the line numeration area - if(this.last_selection["nb_line"] >= this.line_number) - { - var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100; - for( i = start+1; i < end; i++ ) - { - newLines+='
'+i+"
"; - this.line_number++; - } - destDiv.innerHTML= destDiv.innerHTML + newLines; - if(this.settings['word_wrap']){ - this.fixLinesHeight( this.textarea.value, start, -1 ); - } - } - - //4) be sure the text is well displayed - this.textarea.scrollTop="0px"; - this.textarea.scrollLeft="0px"; - if(resized==true){ - this.scroll_to_view(); - } - } - - if(!onlyOneTime) - setTimeout("editArea.manage_size();", 100); - }; - - EditArea.prototype.execCommand= function(cmd, param){ - - for(var i in this.plugins){ - if(typeof(this.plugins[i].execCommand)=="function"){ - if(!this.plugins[i].execCommand(cmd, param)) - return; - } - } - switch(cmd){ - case "save": - if(this.settings["save_callback"].length>0) - eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);"); - break; - case "load": - if(this.settings["load_callback"].length>0) - eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');"); - break; - case "onchange": - if(this.settings["change_callback"].length>0) - eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');"); - break; - case "EA_load": - if(this.settings["EA_load_callback"].length>0) - eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');"); - break; - case "EA_unload": - if(this.settings["EA_unload_callback"].length>0) - eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');"); - break; - case "toggle_on": - if(this.settings["EA_toggle_on_callback"].length>0) - eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');"); - break; - case "toggle_off": - if(this.settings["EA_toggle_off_callback"].length>0) - eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');"); - break; - case "re_sync": - if(!this.do_highlight) - break; - case "file_switch_on": - if(this.settings["EA_file_switch_on_callback"].length>0) - eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);"); - break; - case "file_switch_off": - if(this.settings["EA_file_switch_off_callback"].length>0) - eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);"); - break; - case "file_close": - if(this.settings["EA_file_close_callback"].length>0) - return eval("parent."+this.settings["EA_file_close_callback"]+"(param);"); - break; - - default: - if(typeof(eval("editArea."+cmd))=="function") - { - if(this.settings["debug"]) - eval("editArea."+ cmd +"(param);"); - else - try{eval("editArea."+ cmd +"(param);");}catch(e){}; - } - } - }; - - EditArea.prototype.get_translation= function(word, mode){ - if(mode=="template") - return parent.editAreaLoader.translate(word, this.settings["language"], mode); - else - return parent.editAreaLoader.get_word_translation(word, this.settings["language"]); - }; - - EditArea.prototype.add_plugin= function(plug_name, plug_obj){ - for(var i=0; i"); - } - }; - - EditArea.prototype.load_script= function(url){ - try{ - script = document.createElement("script"); - script.type = "text/javascript"; - script.src = url; - script.charset= "UTF-8"; - head = document.getElementsByTagName("head"); - head[0].appendChild(script); - }catch(e){ - document.write("\";\n", $sub_scripts); - - - // add the script and use a last compression - if( $this->param['compress'] ) - { - $last_comp = array( 'Á' => 'this', - 'Â' => 'textarea', - 'Ã' => 'function', - 'Ä' => 'prototype', - 'Å' => 'settings', - 'Æ' => 'length', - 'Ç' => 'style', - 'È' => 'parent', - 'É' => 'last_selection', - 'Ê' => 'value', - 'Ë' => 'true', - 'Ì' => 'false' - /*, - 'Î' => '"', - 'Ï' => "\n", - 'À' => "\r"*/); - } - else - { - $last_comp = array(); - } - - $js_replace= ''; - foreach( $last_comp as $key => $val ) - $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; - - $this->datas.= sprintf("editAreaLoader.iframe_script= \"\"%s;\n", - str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ), - $js_replace); - - if($this->load_all_plugins) - $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; - - - // load the template - $this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html")); - // load the css - $this->datas.= sprintf("editAreaLoader.iframe_css= \"\";\n", $this->get_css_content("edit_area.css")); - - // $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();"; - - } - - function send_datas() - { - if($this->param['debug']){ - $header=sprintf("/* USE PHP COMPRESSION\n"); - $header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas)); - if($this->use_gzip){ - $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); - $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); - $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0); - }else{ - $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0); - } - $header.=sprintf(", reduced by %s%%\n", $ratio); - $header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time); - $header.=sprintf("%s\n", implode("\n", $this->infos)); - $header.=sprintf("*/\n"); - $this->datas= $header.$this->datas; - } - $mtime= time(); // ensure that the 2 disk files will have the same update time - // generate gzip file and cahce it if using disk cache - if($this->use_gzip){ - $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); - if($this->param['use_disk_cache']) - $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); - } - - // generate full js file and cache it if using disk cache - if($this->param['use_disk_cache']) - $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); - - // generate output - if($this->use_gzip) - echo $this->gzip_datas; - else - echo $this->datas; - -// die; - } - - - function get_content($end_uri) - { - $end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security) - $file= $this->path.$end_uri; - if(file_exists($file)){ - $this->infos[]=sprintf("'%s' loaded", $end_uri); - /*$fd = fopen($file, 'rb'); - $content = fread($fd, filesize($file)); - fclose($fd); - return $content;*/ - return $this->file_get_contents($file); - }else{ - $this->infos[]=sprintf("'%s' not loaded", $end_uri); - return ""; - } - } - - function get_javascript_content($end_uri) - { - $val=$this->get_content($end_uri); - - $this->compress_javascript($val); - $this->prepare_string_for_quotes($val); - return $val; - } - - function compress_javascript(&$code) - { - if($this->param['compress']) - { - // remove all comments - // (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$)) - $code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); - // remove line return, empty line and tabulation - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); - // add line break before "else" otherwise navigators can't manage to parse the file - $code= preg_replace('/(\b(else)\b)/', "\n$1", $code); - // remove unnecessary spaces - $code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code); - } - } - - function get_css_content($end_uri){ - $code=$this->get_content($end_uri); - // remove comments - $code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code); - // remove spaces - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code); - // remove spaces - $code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code); - - $this->prepare_string_for_quotes($code); - return $code; - } - - function get_html_content($end_uri){ - $code=$this->get_content($end_uri); - //$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); - $this->prepare_string_for_quotes($code); - return $code; - } - - function prepare_string_for_quotes(&$str){ - // prepare the code to be putted into quotes - /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/ - $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); - if($this->param['compress']) - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); - else - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); - $str= preg_replace($pattern, $replace, $str); - } - - function replace_scripts($var, $param1, $param2) - { - $this->$var=stripslashes($param2); - return $param1."[];"; - } - - /* for php version that have not thoses functions */ - function file_get_contents($file) - { - $fd = fopen($file, 'rb'); - $content = fread($fd, filesize($file)); - fclose($fd); - $this->file_loaded_size+= strlen($content); - return $content; - } - - function file_put_contents($file, &$content, $mtime=-1) - { - if($mtime==-1) - $mtime=time(); - $fp = @fopen($file, "wb"); - if ($fp) { - fwrite($fp, $content); - fclose($fp); - touch($file, $mtime); - return true; - } - return false; - } - - function get_microtime() - { - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); - } - } -?> diff --git a/plugins/LocalFilesEditor/editarea/edit_area_full.gz b/plugins/LocalFilesEditor/editarea/edit_area_full.gz deleted file mode 100644 index 29bcc50eb..000000000 Binary files a/plugins/LocalFilesEditor/editarea/edit_area_full.gz and /dev/null differ diff --git a/plugins/LocalFilesEditor/editarea/edit_area_full.js b/plugins/LocalFilesEditor/editarea/edit_area_full.js deleted file mode 100644 index 267574c36..000000000 --- a/plugins/LocalFilesEditor/editarea/edit_area_full.js +++ /dev/null @@ -1,38 +0,0 @@ - function EAL(){var t=this;t.version="0.8.2";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.syntax_display_name={'basic':'Basic','brainfuck':'Brainfuck','c':'C','coldfusion':'Coldfusion','cpp':'CPP','css':'CSS','html':'HTML','java':'Java','js':'Javascript','pas':'Pascal','perl':'Perl','php':'Php','python':'Python','robotstxt':'Robots txt','ruby':'Ruby','sql':'SQL','tsql':'T-SQL','vb':'Visual Basic','xml':'XML'};t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"begin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true; -else t.isValidBrowser=false;t.set_base_url();for(var i=0;i0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="loaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+="
";html+="";html+="
";}if(eAs[id]["settings"]["debug"])html+="
";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span); -else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}var area=eAs[id];for(i=0;i';}for(i=0;i';t.iframe_script+='';}if(!t.iframe_css){t.iframe_css="";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content); -else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);} -else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);} -else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;} -else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");} -else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i';html+='';return html;},get_control_html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i";case "|":case "separator":return '';case "select_font":html="";return html;case "syntax_selection":html="";return html;}return "["+button_name+"]";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest(); -else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP"); -else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText; -else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang); -else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write('');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);} -else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler); -else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]); -else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;} -else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;} -else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;case "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);'); -else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);} -else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x0){results=results.concat(result);}} -else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;} -else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;} -else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);} -else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];} -else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_top);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(nav.isOpera&&nav.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(nav.isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.body.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}if(t&&t.id){setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);}};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded"; - EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4);if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded"; - EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}} -else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded"; -var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "".replace(/Á/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Å/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/Ì/g,'false'); -editAreaLoader.template= " EditArea [__CSSRULES__] [__JSCODE__]
[__TOOLBAR__]
 
 
{$position}: {$line_abbr} 0, {$char_abbr} 0 {$total}: {$line_abbr} 0, {$char_abbr} 0 resize
{$processing}
{$search} {$close_popup}
{$replace} {$move_popup}

{$find_next} {$replace} {$replace_all}
{$close_popup}

Editarea [__EA_VERSION__]


{$shortcuts}:

{$tab}: {$add_tab}
{$shift}+{$tab}: {$remove_tab}
{$ctrl}+f: {$search_command}
{$ctrl}+r: {$replace_command}
{$ctrl}+h: {$highlight}
{$ctrl}+g: {$go_to_line}
{$ctrl}+z: {$undo}
{$ctrl}+y: {$redo}
{$ctrl}+e: {$help}
{$ctrl}+q, {$esc}: {$close_popup}
{$accesskey} E: {$toggle}

{$about_notice}
"; -editAreaLoader.iframe_css= ""; diff --git a/plugins/LocalFilesEditor/editarea/edit_area_functions.js b/plugins/LocalFilesEditor/editarea/edit_area_functions.js deleted file mode 100644 index 4067b03a0..000000000 --- a/plugins/LocalFilesEditor/editarea/edit_area_functions.js +++ /dev/null @@ -1,1202 +0,0 @@ - //replace tabulation by the good number of white spaces - EditArea.prototype.replace_tab= function(text){ - return text.replace(/((\n?)([^\t\n]*)\t)/gi, editArea.smartTab); // slower than simple replace... - }; - - // call by the replace_tab function - EditArea.prototype.smartTab= function(){ - val=" "; - return EditArea.prototype.smartTab.arguments[2] + EditArea.prototype.smartTab.arguments[3] + val.substr(0, editArea.tab_nb_char - (EditArea.prototype.smartTab.arguments[3].length)%editArea.tab_nb_char); - }; - - EditArea.prototype.show_waiting_screen= function(){ - width = this.editor_area.offsetWidth; - height = this.editor_area.offsetHeight; - if( !(this.isIE && this.isIE<6) ) - { - width -= 2; - height -= 2; - } - this.processing_screen.style.display= "block"; - this.processing_screen.style.width = width+"px"; - this.processing_screen.style.height = height+"px"; - this.waiting_screen_displayed = true; - }; - - EditArea.prototype.hide_waiting_screen= function(){ - this.processing_screen.style.display="none"; - this.waiting_screen_displayed= false; - }; - - EditArea.prototype.add_style= function(styles){ - if(styles.length>0){ - newcss = document.createElement("style"); - newcss.type="text/css"; - newcss.media="all"; - if(newcss.styleSheet){ // IE - newcss.styleSheet.cssText = styles; - } else { // W3C - newcss.appendChild(document.createTextNode(styles)); - } - document.getElementsByTagName("head")[0].appendChild(newcss); - } - }; - - EditArea.prototype.set_font= function(family, size){ - var t=this, a=this.textarea, s=this.settings, elem_font, i, elem; - // list all elements concerned by font changes - var elems= ["textarea", "content_highlight", "cursor_pos", "end_bracket", "selection_field", "selection_field_text", "line_number"]; - - if(family && family!="") - s["font_family"]= family; - if(size && size>0) - s["font_size"] = size; - if( t.isOpera && t.isOpera < 9.6 ) // opera<9.6 can't manage non monospace font - s['font_family']="monospace"; - - // update the select tag - if( elem_font = _$("area_font_size") ) - { - for( i = 0; i < elem_font.length; i++ ) - { - if( elem_font.options[i].value && elem_font.options[i].value == s["font_size"] ) - elem_font.options[i].selected=true; - } - } - - /* - * somethimes firefox has rendering mistake with non-monospace font for text width in textarea vs in div for changing font size (eg: verdana change between 11pt to 12pt) - * => looks like a browser internal random bug as text width can change while content_highlight is updated - * we'll check if the font-size produce the same text width inside textarea and div and if not, we'll increment the font-size - * - * This is an ugly fix - */ - if( t.isFirefox ) - { - var nbTry = 3; - do { - var div1 = document.createElement( 'div' ), text1 = document.createElement( 'textarea' ); - var styles = { - width: '40px', - overflow: 'scroll', - zIndex: 50, - visibility: 'hidden', - fontFamily: s["font_family"], - fontSize: s["font_size"]+"pt", - lineHeight: t.lineHeight+"px", - padding: '0', - margin: '0', - border: 'none', - whiteSpace: 'nowrap' - }; - var diff, changed = false; - for( i in styles ) - { - div1.style[ i ] = styles[i]; - text1.style[ i ] = styles[i]; - } - // no wrap for this text - text1.wrap = 'off'; - text1.setAttribute('wrap', 'off'); - t.container.appendChild( div1 ); - t.container.appendChild( text1 ); - // try to make FF to bug - div1.innerHTML = text1.value = 'azertyuiopqsdfghjklm'; - div1.innerHTML = text1.value = text1.value+'wxcvbn^p*ù$!:;,,'; - diff = text1.scrollWidth - div1.scrollWidth; - - // firefox return here a diff of 1 px between equals scrollWidth (can't explain) - if( Math.abs( diff ) >= 2 ) - { - s["font_size"]++; - changed = true; - } - t.container.removeChild( div1 ); - t.container.removeChild( text1 ); - nbTry--; - }while( changed && nbTry > 0 ); - } - - - // calc line height - elem = t.test_font_size; - elem.style.fontFamily = ""+s["font_family"]; - elem.style.fontSize = s["font_size"]+"pt"; - elem.innerHTML = "0"; - t.lineHeight = elem.offsetHeight; - - // update font for all concerned elements - for( i=0; i tags - t.add_style("pre{font-family:"+s["font_family"]+"}"); - - // old opera and IE>=8 doesn't update font changes to the textarea - if( ( t.isOpera && t.isOpera < 9.6 ) || t.isIE >= 8 ) - { - var parNod = a.parentNode, nxtSib = a.nextSibling, start= a.selectionStart, end= a.selectionEnd; - parNod.removeChild(a); - parNod.insertBefore(a, nxtSib); - t.area_select(start, end-start); - } - - // force update of selection field - this.focus(); - this.update_size(); - this.check_line_selection(); - }; - - EditArea.prototype.change_font_size= function(){ - var size=_$("area_font_size").value; - if(size>0) - this.set_font("", size); - }; - - - EditArea.prototype.open_inline_popup= function(popup_id){ - this.close_all_inline_popup(); - var popup= _$(popup_id); - var editor= _$("editor"); - - // search matching icon - for(var i=0; i lines.length) - start= this.textarea.value.length; - else{ - for(var i=0; i0){ - //alert(miss_top); - zone.scrollTop= zone.scrollTop + miss_top; - }else if( zone.scrollTop > cursor_pos_top){ - // when erase all the content -> does'nt scroll back to the top - //alert("else: "+cursor_pos_top); - zone.scrollTop= cursor_pos_top; - } - - // manage left scroll - //var cursor_pos_left= parseInt(_$("cursor_pos").style.left.replace("px","")); - var cursor_pos_left= _$("cursor_pos").cursor_left; - var max_width_visible= zone.clientWidth + zone.scrollLeft; - var miss_left= cursor_pos_left + 10 - max_width_visible; - if(miss_left>0){ - zone.scrollLeft= zone.scrollLeft + miss_left + 50; - }else if( zone.scrollLeft > cursor_pos_left){ - zone.scrollLeft= cursor_pos_left ; - }else if( zone.scrollLeft == 45){ - // show the line numbers if textarea align to it's left - zone.scrollLeft=0; - } - }; - - EditArea.prototype.check_undo= function(only_once){ - if(!editAreas[this.id]) - return false; - if(this.textareaFocused && editAreas[this.id]["displayed"]==true){ - var text=this.textarea.value; - if(this.previous.length<=1) - this.switchClassSticky(_$("undo"), 'editAreaButtonDisabled', true); - - if(!this.previous[this.previous.length-1] || this.previous[this.previous.length-1]["text"] != text){ - this.previous.push({"text": text, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd}); - if(this.previous.length > this.settings["max_undo"]+1) - this.previous.shift(); - - } - if(this.previous.length >= 2) - this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false); - } - - if(!only_once) - setTimeout("editArea.check_undo()", 3000); - }; - - EditArea.prototype.undo= function(){ - //alert("undo"+this.previous.length); - if(this.previous.length > 0) - { - this.getIESelection(); - // var pos_cursor=this.textarea.selectionStart; - this.next.push( { "text": this.textarea.value, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd } ); - var prev= this.previous.pop(); - if( prev["text"] == this.textarea.value && this.previous.length > 0 ) - prev =this.previous.pop(); - this.textarea.value = prev["text"]; - this.last_undo = prev["text"]; - this.area_select(prev["selStart"], prev["selEnd"]-prev["selStart"]); - this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false); - this.resync_highlight(true); - //alert("undo"+this.previous.length); - this.check_file_changes(); - } - }; - - EditArea.prototype.redo= function(){ - if(this.next.length > 0) - { - /*this.getIESelection();*/ - //var pos_cursor=this.textarea.selectionStart; - var next= this.next.pop(); - this.previous.push(next); - this.textarea.value= next["text"]; - this.last_undo= next["text"]; - this.area_select(next["selStart"], next["selEnd"]-next["selStart"]); - this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false); - this.resync_highlight(true); - this.check_file_changes(); - } - if( this.next.length == 0) - this.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true); - }; - - EditArea.prototype.check_redo= function(){ - if(editArea.next.length == 0 || editArea.textarea.value!=editArea.last_undo){ - editArea.next= []; // undo the ability to use "redo" button - editArea.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true); - } - else - { - this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false); - } - }; - - - // functions that manage icons roll over, disabled, etc... - EditArea.prototype.switchClass = function(element, class_name, lock_state) { - var lockChanged = false; - - if (typeof(lock_state) != "undefined" && element != null) { - element.classLock = lock_state; - lockChanged = true; - } - - if (element != null && (lockChanged || !element.classLock)) { - element.oldClassName = element.className; - element.className = class_name; - } - }; - - EditArea.prototype.restoreAndSwitchClass = function(element, class_name) { - if (element != null && !element.classLock) { - this.restoreClass(element); - this.switchClass(element, class_name); - } - }; - - EditArea.prototype.restoreClass = function(element) { - if (element != null && element.oldClassName && !element.classLock) { - element.className = element.oldClassName; - element.oldClassName = null; - } - }; - - EditArea.prototype.setClassLock = function(element, lock_state) { - if (element != null) - element.classLock = lock_state; - }; - - EditArea.prototype.switchClassSticky = function(element, class_name, lock_state) { - var lockChanged = false; - if (typeof(lock_state) != "undefined" && element != null) { - element.classLock = lock_state; - lockChanged = true; - } - - if (element != null && (lockChanged || !element.classLock)) { - element.className = class_name; - element.oldClassName = class_name; - } - }; - - //make the "page up" and "page down" buttons works correctly - EditArea.prototype.scroll_page= function(params){ - var dir= params["dir"], shift_pressed= params["shift"]; - var lines= this.textarea.value.split("\n"); - var new_pos=0, length=0, char_left=0, line_nb=0, curLine=0; - var toScrollAmount = _$("result").clientHeight -30; - var nbLineToScroll = 0, diff= 0; - - if(dir=="up"){ - nbLineToScroll = Math.ceil( toScrollAmount / this.lineHeight ); - - // fix number of line to scroll - for( i = this.last_selection["line_start"]; i - diff > this.last_selection["line_start"] - nbLineToScroll ; i-- ) - { - if( elem = _$('line_'+ i) ) - { - diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight ); - } - } - nbLineToScroll -= diff; - - if(this.last_selection["selec_direction"]=="up"){ - for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]-nbLineToScroll, lines.length); line_nb++){ - new_pos+= lines[line_nb].length + 1; - } - char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1); - if(shift_pressed) - length=this.last_selection["selectionEnd"]-new_pos-char_left; - this.area_select(new_pos+char_left, length); - view="top"; - }else{ - view="bottom"; - for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-1-nbLineToScroll, lines.length); line_nb++){ - new_pos+= lines[line_nb].length + 1; - } - char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1); - if(shift_pressed){ - //length=this.last_selection["selectionEnd"]-new_pos-char_left; - start= Math.min(this.last_selection["selectionStart"], new_pos+char_left); - length= Math.max(new_pos+char_left, this.last_selection["selectionStart"] )- start ; - if(new_pos+char_left < this.last_selection["selectionStart"]) - view="top"; - }else - start=new_pos+char_left; - this.area_select(start, length); - - } - } - else - { - var nbLineToScroll= Math.floor( toScrollAmount / this.lineHeight ); - // fix number of line to scroll - for( i = this.last_selection["line_start"]; i + diff < this.last_selection["line_start"] + nbLineToScroll ; i++ ) - { - if( elem = _$('line_'+ i) ) - { - diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight ); - } - } - nbLineToScroll -= diff; - - if(this.last_selection["selec_direction"]=="down"){ - view="bottom"; - for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-2+nbLineToScroll, lines.length); line_nb++){ - if(line_nb==this.last_selection["line_start"]-1) - char_left= this.last_selection["selectionStart"] -new_pos; - new_pos+= lines[line_nb].length + 1; - - } - if(shift_pressed){ - length=Math.abs(this.last_selection["selectionStart"]-new_pos); - length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]); - //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left); - this.area_select(Math.min(this.last_selection["selectionStart"], new_pos), length); - }else{ - this.area_select(new_pos+char_left, 0); - } - - }else{ - view="top"; - for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+nbLineToScroll-1, lines.length, lines.length); line_nb++){ - if(line_nb==this.last_selection["line_start"]-1) - char_left= this.last_selection["selectionStart"] -new_pos; - new_pos+= lines[line_nb].length + 1; - } - if(shift_pressed){ - length=Math.abs(this.last_selection["selectionEnd"]-new_pos-char_left); - length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"])- char_left-1; - //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left); - this.area_select(Math.min(this.last_selection["selectionEnd"], new_pos+char_left), length); - if(new_pos+char_left > this.last_selection["selectionEnd"]) - view="bottom"; - }else{ - this.area_select(new_pos+char_left, 0); - } - - } - } - //console.log( new_pos, char_left, length, nbLineToScroll, toScrollAmount, _$("result").clientHeigh ); - this.check_line_selection(); - this.scroll_to_view(view); - }; - - EditArea.prototype.start_resize= function(e){ - parent.editAreaLoader.resize["id"] = editArea.id; - parent.editAreaLoader.resize["start_x"] = (e)? e.pageX : event.x + document.body.scrollLeft; - parent.editAreaLoader.resize["start_y"] = (e)? e.pageY : event.y + document.body.scrollTop; - if(editArea.isIE) - { - editArea.textarea.focus(); - editArea.getIESelection(); - } - parent.editAreaLoader.resize["selectionStart"] = editArea.textarea.selectionStart; - parent.editAreaLoader.resize["selectionEnd"] = editArea.textarea.selectionEnd; - parent.editAreaLoader.start_resize_area(); - }; - - EditArea.prototype.toggle_full_screen= function(to){ - var t=this, p=parent, a=t.textarea, html, frame, selStart, selEnd, old, icon; - if(typeof(to)=="undefined") - to= !t.fullscreen['isFull']; - old = t.fullscreen['isFull']; - t.fullscreen['isFull']= to; - icon = _$("fullscreen"); - selStart = t.textarea.selectionStart; - selEnd = t.textarea.selectionEnd; - html = p.document.getElementsByTagName("html")[0]; - frame = p.document.getElementById("frame_"+t.id); - - if(to && to!=old) - { // toogle on fullscreen - - t.fullscreen['old_overflow'] = p.get_css_property(html, "overflow"); - t.fullscreen['old_height'] = p.get_css_property(html, "height"); - t.fullscreen['old_width'] = p.get_css_property(html, "width"); - t.fullscreen['old_scrollTop'] = html.scrollTop; - t.fullscreen['old_scrollLeft'] = html.scrollLeft; - t.fullscreen['old_zIndex'] = p.get_css_property(frame, "z-index"); - if(t.isOpera){ - html.style.height = "100%"; - html.style.width = "100%"; - } - html.style.overflow = "hidden"; - html.scrollTop = 0; - html.scrollLeft = 0; - - frame.style.position = "absolute"; - frame.style.width = html.clientWidth+"px"; - frame.style.height = html.clientHeight+"px"; - frame.style.display = "block"; - frame.style.zIndex = "999999"; - frame.style.top = "0px"; - frame.style.left = "0px"; - - // if the iframe was in a div with position absolute, the top and left are the one of the div, - // so I fix it by seeing at witch position the iframe start and correcting it - frame.style.top = "-"+p.calculeOffsetTop(frame)+"px"; - frame.style.left = "-"+p.calculeOffsetLeft(frame)+"px"; - - // parent.editAreaLoader.execCommand(t.id, "update_size();"); - // var body=parent.document.getElementsByTagName("body")[0]; - // body.appendChild(frame); - - t.switchClassSticky(icon, 'editAreaButtonSelected', false); - t.fullscreen['allow_resize']= t.resize_allowed; - t.allow_resize(false); - - //t.area_select(selStart, selEnd-selStart); - - - // opera can't manage to do a direct size update - if(t.isFirefox){ - p.editAreaLoader.execCommand(t.id, "update_size();"); - t.area_select(selStart, selEnd-selStart); - t.scroll_to_view(); - t.focus(); - }else{ - setTimeout("parent.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10); - } - - - } - else if(to!=old) - { // toogle off fullscreen - frame.style.position="static"; - frame.style.zIndex= t.fullscreen['old_zIndex']; - - if(t.isOpera) - { - html.style.height = "auto"; - html.style.width = "auto"; - html.style.overflow = "auto"; - } - else if(t.isIE && p!=top) - { // IE doesn't manage html overflow in frames like in normal page... - html.style.overflow = "auto"; - } - else - { - html.style.overflow = t.fullscreen['old_overflow']; - } - html.scrollTop = t.fullscreen['old_scrollTop']; - html.scrollLeft = t.fullscreen['old_scrollLeft']; - - p.editAreaLoader.hide(t.id); - p.editAreaLoader.show(t.id); - - t.switchClassSticky(icon, 'editAreaButtonNormal', false); - if(t.fullscreen['allow_resize']) - t.allow_resize(t.fullscreen['allow_resize']); - if(t.isFirefox){ - t.area_select(selStart, selEnd-selStart); - setTimeout("editArea.scroll_to_view();", 10); - } - - //p.editAreaLoader.remove_event(p.window, "resize", editArea.update_size); - } - - }; - - EditArea.prototype.allow_resize= function(allow){ - var resize= _$("resize_area"); - if(allow){ - - resize.style.visibility="visible"; - parent.editAreaLoader.add_event(resize, "mouseup", editArea.start_resize); - }else{ - resize.style.visibility="hidden"; - parent.editAreaLoader.remove_event(resize, "mouseup", editArea.start_resize); - } - this.resize_allowed= allow; - }; - - - EditArea.prototype.change_syntax= function(new_syntax, is_waiting){ - // alert("cahnge to "+new_syntax); - // the syntax is the same - if(new_syntax==this.settings['syntax']) - return true; - - // check that the syntax is one allowed - var founded= false; - for(var i=0; i"; - elem.innerHTML= "*"+ this.files[id]['title'] + close +""; - _$('tab_browsing_list').appendChild(elem); - var elem= document.createElement('text'); - this.update_size(); - } - - // open file callback (for plugin) - if(id!="") - this.execCommand('file_open', this.files[id]); - - this.switch_to_file(id, true); - return true; - } - else - return false; - }; - - // close the given file - EditArea.prototype.close_file= function(id){ - if(this.files[id]) - { - this.save_file(id); - - // close file callback - if(this.execCommand('file_close', this.files[id])!==false) - { - // remove the tab in the toolbar - var li= _$(this.files[id]['html_id']); - li.parentNode.removeChild(li); - // select a new file - if(id== this.curr_file) - { - var next_file= ""; - var is_next= false; - for(var i in this.files) - { - if( is_next ) - { - next_file = i; - break; - } - else if( i == id ) - is_next = true; - else - next_file = i; - } - // display the next file - this.switch_to_file(next_file); - } - // clear datas - delete (this.files[id]); - this.update_size(); - } - } - }; - - // backup current file datas - EditArea.prototype.save_file= function(id){ - var t= this, save, a_links, a_selects, save_butt, img, i; - if(t.files[id]) - { - var save= t.files[id]; - save['last_selection'] = t.last_selection; - save['last_text_to_highlight'] = t.last_text_to_highlight; - save['last_hightlighted_text'] = t.last_hightlighted_text; - save['previous'] = t.previous; - save['next'] = t.next; - save['last_undo'] = t.last_undo; - save['smooth_selection'] = t.smooth_selection; - save['do_highlight'] = t.do_highlight; - save['syntax'] = t.settings['syntax']; - save['text'] = t.textarea.value; - save['scroll_top'] = t.result.scrollTop; - save['scroll_left'] = t.result.scrollLeft; - save['selection_start'] = t.last_selection["selectionStart"]; - save['selection_end'] = t.last_selection["selectionEnd"]; - save['font_size'] = t.settings["font_size"]; - save['font_family'] = t.settings["font_family"]; - save['word_wrap'] = t.settings["word_wrap"]; - save['toolbar'] = {'links':{}, 'selects': {}}; - - // save toolbar buttons state for fileSpecific buttons - a_links= _$("toolbar_1").getElementsByTagName("a"); - for( i=0; i
"; - } else { - elem.innerHTML= content; - } - height = elem.offsetHeight; - height = Math.max( 1, Math.floor( elem.offsetHeight / this.lineHeight ) ) * this.lineHeight; - return height; - }; - - /** - * Fix line height for the given lines - * @param Integer linestart - * @param Integer lineEnd End line or -1 to cover all lines - */ - EditArea.prototype.fixLinesHeight= function( textValue, lineStart,lineEnd ){ - var aText = textValue.split("\n"); - if( lineEnd == -1 ) - lineEnd = aText.length-1; - for( var i = Math.max(0, lineStart); i <= lineEnd; i++ ) - { - if( elem = _$('line_'+ ( i+1 ) ) ) - { - elem.style.height= typeof( aText[i] ) != "undefined" ? this.getTextHeight( aText[i] )+"px" : this.lineHeight; - } - } - }; - - EditArea.prototype.area_select= function(start, length){ - this.textarea.focus(); - - start = Math.max(0, Math.min(this.textarea.value.length, start)); - end = Math.max(start, Math.min(this.textarea.value.length, start+length)); - - if(this.isIE) - { - this.textarea.selectionStart = start; - this.textarea.selectionEnd = end; - this.setIESelection(); - } - else - { - // Opera bug when moving selection start and selection end - if(this.isOpera && this.isOpera < 9.6 ) - { - this.textarea.setSelectionRange(0, 0); - } - this.textarea.setSelectionRange(start, end); - } - this.check_line_selection(); - }; - - - EditArea.prototype.area_get_selection= function(){ - var text=""; - if( document.selection ){ - var range = document.selection.createRange(); - text=range.text; - }else{ - text= this.textarea.value.substring(this.textarea.selectionStart, this.textarea.selectionEnd); - } - return text; - }; \ No newline at end of file diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/charmap.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/charmap.js deleted file mode 100644 index df4282216..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/charmap.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Charmap plugin - * by Christophe Dolivet - * v0.1 (2006/09/22) - * - * - * This plugin allow to use a visual keyboard allowing to insert any UTF-8 characters in the text. - * - * - plugin name to add to the plugin list: "charmap" - * - plugin name to add to the toolbar list: "charmap" - * - possible parameters to add to EditAreaLoader.init(): - * "charmap_default": (String) define the name of the default character range displayed on popup display - * (default: "arrows") - * - * - */ - -var EditArea_charmap= { - /** - * Get called once this file is loaded (editArea still not initialized) - * - * @return nothing - */ - init: function(){ - this.default_language="Arrows"; - } - - /** - * Returns the HTML code for a specific control string or false if this plugin doesn't have that control. - * A control can be a button, select list or any other HTML item to present in the EditArea user interface. - * Language variables such as {$lang_somekey} will also be replaced with contents from - * the language packs. - * - * @param {string} ctrl_name: the name of the control to add - * @return HTML code for a specific control or false. - * @type string or boolean - */ - ,get_control_html: function(ctrl_name){ - switch(ctrl_name){ - case "charmap": - // Control id, button img, command - return parent.editAreaLoader.get_button_html('charmap_but', 'charmap.gif', 'charmap_press', false, this.baseURL); - } - return false; - } - /** - * Get called once EditArea is fully loaded and initialised - * - * @return nothing - */ - ,onload: function(){ - if(editArea.settings["charmap_default"] && editArea.settings["charmap_default"].length>0) - this.default_language= editArea.settings["charmap_default"]; - } - - /** - * Is called each time the user touch a keyboard key. - * - * @param (event) e: the keydown event - * @return true - pass to next handler in chain, false - stop chain execution - * @type boolean - */ - ,onkeydown: function(e){ - - } - - /** - * Executes a specific command, this function handles plugin commands. - * - * @param {string} cmd: the name of the command being executed - * @param {unknown} param: the parameter of the command - * @return true - pass to next handler in chain, false - stop chain execution - * @type boolean - */ - ,execCommand: function(cmd, param){ - // Handle commands - switch(cmd){ - case "charmap_press": - win= window.open(this.baseURL+"popup.html", "charmap", "width=500,height=270,scrollbars=yes,resizable=yes"); - win.focus(); - return false; - } - // Pass to next handler in chain - return true; - } - -}; - -// Adds the plugin class to the list of available EditArea plugins -editArea.add_plugin("charmap", EditArea_charmap); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/css/charmap.css b/plugins/LocalFilesEditor/editarea/plugins/charmap/css/charmap.css deleted file mode 100644 index fc8d66603..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/css/charmap.css +++ /dev/null @@ -1,64 +0,0 @@ -body{ - background-color: #F0F0EE; - font: 12px monospace, sans-serif; -} - -select{ - background-color: #F9F9F9; - border: solid 1px #888888; -} - -h1, h2, h3, h4, h5, h6{ - margin: 0; - padding: 0; - color: #2B6FB6; -} - -h1{ - font-size: 1.5em; -} - -div#char_list{ - height: 200px; - overflow: auto; - padding: 1px; - border: 1px solid #0A246A; - background-color: #F9F9F9; - clear: both; - margin-top: 5px; -} - -a.char{ - display: block; - float: left; - width: 20px; - height: 20px; - line-height: 20px; - margin: 1px; - border: solid 1px #888888; - text-align: center; - cursor: pointer; -} - -a.char:hover{ - background-color: #CCCCCC; -} - -.preview{ - border: solid 1px #888888; - width: 50px; - padding: 2px 5px; - height: 35px; - line-height: 35px; - text-align:center; - background-color: #CCCCCC; - font-size: 2em; - float: right; - font-weight: bold; - margin: 0 0 5px 5px; -} - -#preview_code{ - font-size: 1.1em; - width: 70px; -} diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/images/charmap.gif b/plugins/LocalFilesEditor/editarea/plugins/charmap/images/charmap.gif deleted file mode 100644 index 3cdc4ac91..000000000 Binary files a/plugins/LocalFilesEditor/editarea/plugins/charmap/images/charmap.gif and /dev/null differ diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/jscripts/map.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/jscripts/map.js deleted file mode 100644 index 6c194a405..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/jscripts/map.js +++ /dev/null @@ -1,373 +0,0 @@ -var editArea; - - -/** - * UTF-8 list taken from http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec - */ - - -/* -var char_range_list={ -"Basic Latin":"0021,007F", -"Latin-1 Supplement":"0080,00FF", -"Latin Extended-A":"0100,017F", -"Latin Extended-B":"0180,024F", -"IPA Extensions":"0250,02AF", -"Spacing Modifier Letters":"02B0,02FF", - -"Combining Diacritical Marks":"0300,036F", -"Greek and Coptic":"0370,03FF", -"Cyrillic":"0400,04FF", -"Cyrillic Supplement":"0500,052F", -"Armenian":"0530,058F", -"Hebrew":"0590,05FF", -"Arabic":"0600,06FF", -"Syriac":"0700,074F", -"Arabic Supplement":"0750,077F", - -"Thaana":"0780,07BF", -"Devanagari":"0900,097F", -"Bengali":"0980,09FF", -"Gurmukhi":"0A00,0A7F", -"Gujarati":"0A80,0AFF", -"Oriya":"0B00,0B7F", -"Tamil":"0B80,0BFF", -"Telugu":"0C00,0C7F", -"Kannada":"0C80,0CFF", - -"Malayalam":"0D00,0D7F", -"Sinhala":"0D80,0DFF", -"Thai":"0E00,0E7F", -"Lao":"0E80,0EFF", -"Tibetan":"0F00,0FFF", -"Myanmar":"1000,109F", -"Georgian":"10A0,10FF", -"Hangul Jamo":"1100,11FF", -"Ethiopic":"1200,137F", - -"Ethiopic Supplement":"1380,139F", -"Cherokee":"13A0,13FF", -"Unified Canadian Aboriginal Syllabics":"1400,167F", -"Ogham":"1680,169F", -"Runic":"16A0,16FF", -"Tagalog":"1700,171F", -"Hanunoo":"1720,173F", -"Buhid":"1740,175F", -"Tagbanwa":"1760,177F", - -"Khmer":"1780,17FF", -"Mongolian":"1800,18AF", -"Limbu":"1900,194F", -"Tai Le":"1950,197F", -"New Tai Lue":"1980,19DF", -"Khmer Symbols":"19E0,19FF", -"Buginese":"1A00,1A1F", -"Phonetic Extensions":"1D00,1D7F", -"Phonetic Extensions Supplement":"1D80,1DBF", - -"Combining Diacritical Marks Supplement":"1DC0,1DFF", -"Latin Extended Additional":"1E00,1EFF", -"Greek Extended":"1F00,1FFF", -"General Punctuation":"2000,206F", -"Superscripts and Subscripts":"2070,209F", -"Currency Symbols":"20A0,20CF", -"Combining Diacritical Marks for Symbols":"20D0,20FF", -"Letterlike Symbols":"2100,214F", -"Number Forms":"2150,218F", - -"Arrows":"2190,21FF", -"Mathematical Operators":"2200,22FF", -"Miscellaneous Technical":"2300,23FF", -"Control Pictures":"2400,243F", -"Optical Character Recognition":"2440,245F", -"Enclosed Alphanumerics":"2460,24FF", -"Box Drawing":"2500,257F", -"Block Elements":"2580,259F", -"Geometric Shapes":"25A0,25FF", - -"Miscellaneous Symbols":"2600,26FF", -"Dingbats":"2700,27BF", -"Miscellaneous Mathematical Symbols-A":"27C0,27EF", -"Supplemental Arrows-A":"27F0,27FF", -"Braille Patterns":"2800,28FF", -"Supplemental Arrows-B":"2900,297F", -"Miscellaneous Mathematical Symbols-B":"2980,29FF", -"Supplemental Mathematical Operators":"2A00,2AFF", -"Miscellaneous Symbols and Arrows":"2B00,2BFF", - -"Glagolitic":"2C00,2C5F", -"Coptic":"2C80,2CFF", -"Georgian Supplement":"2D00,2D2F", -"Tifinagh":"2D30,2D7F", -"Ethiopic Extended":"2D80,2DDF", -"Supplemental Punctuation":"2E00,2E7F", -"CJK Radicals Supplement":"2E80,2EFF", -"Kangxi Radicals":"2F00,2FDF", -"Ideographic Description Characters":"2FF0,2FFF", - -"CJK Symbols and Punctuation":"3000,303F", -"Hiragana":"3040,309F", -"Katakana":"30A0,30FF", -"Bopomofo":"3100,312F", -"Hangul Compatibility Jamo":"3130,318F", -"Kanbun":"3190,319F", -"Bopomofo Extended":"31A0,31BF", -"CJK Strokes":"31C0,31EF", -"Katakana Phonetic Extensions":"31F0,31FF", - -"Enclosed CJK Letters and Months":"3200,32FF", -"CJK Compatibility":"3300,33FF", -"CJK Unified Ideographs Extension A":"3400,4DBF", -"Yijing Hexagram Symbols":"4DC0,4DFF", -"CJK Unified Ideographs":"4E00,9FFF", -"Yi Syllables":"A000,A48F", -"Yi Radicals":"A490,A4CF", -"Modifier Tone Letters":"A700,A71F", -"Syloti Nagri":"A800,A82F", - -"Hangul Syllables":"AC00,D7AF", -"High Surrogates":"D800,DB7F", -"High Private Use Surrogates":"DB80,DBFF", -"Low Surrogates":"DC00,DFFF", -"Private Use Area":"E000,F8FF", -"CJK Compatibility Ideographs":"F900,FAFF", -"Alphabetic Presentation Forms":"FB00,FB4F", -"Arabic Presentation Forms-A":"FB50,FDFF", -"Variation Selectors":"FE00,FE0F", - -"Vertical Forms":"FE10,FE1F", -"Combining Half Marks":"FE20,FE2F", -"CJK Compatibility Forms":"FE30,FE4F", -"Small Form Variants":"FE50,FE6F", -"Arabic Presentation Forms-B":"FE70,FEFF", -"Halfwidth and Fullwidth Forms":"FF00,FFEF", -"Specials":"FFF0,FFFF", -"Linear B Syllabary":"10000,1007F", -"Linear B Ideograms":"10080,100FF", - -"Aegean Numbers":"10100,1013F", -"Ancient Greek Numbers":"10140,1018F", -"Old Italic":"10300,1032F", -"Gothic":"10330,1034F", -"Ugaritic":"10380,1039F", -"Old Persian":"103A0,103DF", -"Deseret":"10400,1044F", -"Shavian":"10450,1047F", -"Osmanya":"10480,104AF", - -"Cypriot Syllabary":"10800,1083F", -"Kharoshthi":"10A00,10A5F", -"Byzantine Musical Symbols":"1D000,1D0FF", -"Musical Symbols":"1D100,1D1FF", -"Ancient Greek Musical Notation":"1D200,1D24F", -"Tai Xuan Jing Symbols":"1D300,1D35F", -"Mathematical Alphanumeric Symbols":"1D400,1D7FF", -"CJK Unified Ideographs Extension B":"20000,2A6DF", -"CJK Compatibility Ideographs Supplement":"2F800,2FA1F", -"Tags":"E0000,E007F", -"Variation Selectors Supplement":"E0100,E01EF" -}; -*/ -var char_range_list={ -"Aegean Numbers":"10100,1013F", -"Alphabetic Presentation Forms":"FB00,FB4F", -"Ancient Greek Musical Notation":"1D200,1D24F", -"Ancient Greek Numbers":"10140,1018F", -"Arabic":"0600,06FF", -"Arabic Presentation Forms-A":"FB50,FDFF", -"Arabic Presentation Forms-B":"FE70,FEFF", -"Arabic Supplement":"0750,077F", -"Armenian":"0530,058F", -"Arrows":"2190,21FF", -"Basic Latin":"0020,007F", -"Bengali":"0980,09FF", -"Block Elements":"2580,259F", -"Bopomofo Extended":"31A0,31BF", -"Bopomofo":"3100,312F", -"Box Drawing":"2500,257F", -"Braille Patterns":"2800,28FF", -"Buginese":"1A00,1A1F", -"Buhid":"1740,175F", -"Byzantine Musical Symbols":"1D000,1D0FF", -"CJK Compatibility Forms":"FE30,FE4F", -"CJK Compatibility Ideographs Supplement":"2F800,2FA1F", -"CJK Compatibility Ideographs":"F900,FAFF", -"CJK Compatibility":"3300,33FF", -"CJK Radicals Supplement":"2E80,2EFF", -"CJK Strokes":"31C0,31EF", -"CJK Symbols and Punctuation":"3000,303F", -"CJK Unified Ideographs Extension A":"3400,4DBF", -"CJK Unified Ideographs Extension B":"20000,2A6DF", -"CJK Unified Ideographs":"4E00,9FFF", -"Cherokee":"13A0,13FF", -"Combining Diacritical Marks Supplement":"1DC0,1DFF", -"Combining Diacritical Marks for Symbols":"20D0,20FF", -"Combining Diacritical Marks":"0300,036F", -"Combining Half Marks":"FE20,FE2F", -"Control Pictures":"2400,243F", -"Coptic":"2C80,2CFF", -"Currency Symbols":"20A0,20CF", -"Cypriot Syllabary":"10800,1083F", -"Cyrillic Supplement":"0500,052F", -"Cyrillic":"0400,04FF", -"Deseret":"10400,1044F", -"Devanagari":"0900,097F", -"Dingbats":"2700,27BF", -"Enclosed Alphanumerics":"2460,24FF", -"Enclosed CJK Letters and Months":"3200,32FF", -"Ethiopic Extended":"2D80,2DDF", -"Ethiopic Supplement":"1380,139F", -"Ethiopic":"1200,137F", -"General Punctuation":"2000,206F", -"Geometric Shapes":"25A0,25FF", -"Georgian Supplement":"2D00,2D2F", -"Georgian":"10A0,10FF", -"Glagolitic":"2C00,2C5F", -"Gothic":"10330,1034F", -"Greek Extended":"1F00,1FFF", -"Greek and Coptic":"0370,03FF", -"Gujarati":"0A80,0AFF", -"Gurmukhi":"0A00,0A7F", -"Halfwidth and Fullwidth Forms":"FF00,FFEF", -"Hangul Compatibility Jamo":"3130,318F", -"Hangul Jamo":"1100,11FF", -"Hangul Syllables":"AC00,D7AF", -"Hanunoo":"1720,173F", -"Hebrew":"0590,05FF", -"High Private Use Surrogates":"DB80,DBFF", -"High Surrogates":"D800,DB7F", -"Hiragana":"3040,309F", -"IPA Extensions":"0250,02AF", -"Ideographic Description Characters":"2FF0,2FFF", -"Kanbun":"3190,319F", -"Kangxi Radicals":"2F00,2FDF", -"Kannada":"0C80,0CFF", -"Katakana Phonetic Extensions":"31F0,31FF", -"Katakana":"30A0,30FF", -"Kharoshthi":"10A00,10A5F", -"Khmer Symbols":"19E0,19FF", -"Khmer":"1780,17FF", -"Lao":"0E80,0EFF", -"Latin Extended Additional":"1E00,1EFF", -"Latin Extended-A":"0100,017F", -"Latin Extended-B":"0180,024F", -"Latin-1 Supplement":"0080,00FF", -"Letterlike Symbols":"2100,214F", -"Limbu":"1900,194F", -"Linear B Ideograms":"10080,100FF", -"Linear B Syllabary":"10000,1007F", -"Low Surrogates":"DC00,DFFF", -"Malayalam":"0D00,0D7F", -"Mathematical Alphanumeric Symbols":"1D400,1D7FF", -"Mathematical Operators":"2200,22FF", -"Miscellaneous Mathematical Symbols-A":"27C0,27EF", -"Miscellaneous Mathematical Symbols-B":"2980,29FF", -"Miscellaneous Symbols and Arrows":"2B00,2BFF", -"Miscellaneous Symbols":"2600,26FF", -"Miscellaneous Technical":"2300,23FF", -"Modifier Tone Letters":"A700,A71F", -"Mongolian":"1800,18AF", -"Musical Symbols":"1D100,1D1FF", -"Myanmar":"1000,109F", -"New Tai Lue":"1980,19DF", -"Number Forms":"2150,218F", -"Ogham":"1680,169F", -"Old Italic":"10300,1032F", -"Old Persian":"103A0,103DF", -"Optical Character Recognition":"2440,245F", -"Oriya":"0B00,0B7F", -"Osmanya":"10480,104AF", -"Phonetic Extensions Supplement":"1D80,1DBF", -"Phonetic Extensions":"1D00,1D7F", -"Private Use Area":"E000,F8FF", -"Runic":"16A0,16FF", -"Shavian":"10450,1047F", -"Sinhala":"0D80,0DFF", -"Small Form Variants":"FE50,FE6F", -"Spacing Modifier Letters":"02B0,02FF", -"Specials":"FFF0,FFFF", -"Superscripts and Subscripts":"2070,209F", -"Supplemental Arrows-A":"27F0,27FF", -"Supplemental Arrows-B":"2900,297F", -"Supplemental Mathematical Operators":"2A00,2AFF", -"Supplemental Punctuation":"2E00,2E7F", -"Syloti Nagri":"A800,A82F", -"Syriac":"0700,074F", -"Tagalog":"1700,171F", -"Tagbanwa":"1760,177F", -"Tags":"E0000,E007F", -"Tai Le":"1950,197F", -"Tai Xuan Jing Symbols":"1D300,1D35F", -"Tamil":"0B80,0BFF", -"Telugu":"0C00,0C7F", -"Thaana":"0780,07BF", -"Thai":"0E00,0E7F", -"Tibetan":"0F00,0FFF", -"Tifinagh":"2D30,2D7F", -"Ugaritic":"10380,1039F", -"Unified Canadian Aboriginal Syllabics":"1400,167F", -"Variation Selectors Supplement":"E0100,E01EF", -"Variation Selectors":"FE00,FE0F", -"Vertical Forms":"FE10,FE1F", -"Yi Radicals":"A490,A4CF", -"Yi Syllables":"A000,A48F", -"Yijing Hexagram Symbols":"4DC0,4DFF" -}; - -var insert="charmap_insert"; - -function map_load(){ - editArea=opener.editArea; - // translate the document - insert= editArea.get_translation(insert, "word"); - //alert(document.title); - document.title= editArea.get_translation(document.title, "template"); - document.body.innerHTML= editArea.get_translation(document.body.innerHTML, "template"); - //document.title= editArea.get_translation(document.getElementBytitle, "template"); - - var selected_lang=opener.EditArea_charmap.default_language.toLowerCase(); - var selected=0; - - var select= document.getElementById("select_range") - for(var i in char_range_list){ - if(i.toLowerCase()==selected_lang) - selected=select.options.length; - select.options[select.options.length]=new Option(i, char_range_list[i]); - } - select.options[selected].selected=true; -/* start=0; - end=127; - content=""; - for(var i=start; i"+ String.fromCharCode(i) +""; - } - document.getElementById("char_list").innerHTML= html; - document.getElementById("preview_char").innerHTML=""; -} - -function previewChar(i){ - document.getElementById("preview_char").innerHTML= String.fromCharCode(i); - document.getElementById("preview_code").innerHTML= "&#"+ i +";"; -} - -function insertChar(i){ - opener.parent.editAreaLoader.setSelectedText(editArea.id, String.fromCharCode( i)); - range= opener.parent.editAreaLoader.getSelectionRange(editArea.id); - opener.parent.editAreaLoader.setSelectionRange(editArea.id, range["end"], range["end"]); - window.focus(); -} diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/bg.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/bg.js deleted file mode 100644 index eaba0f9df..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/bg.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Bulgarian translation - * Author: Valentin Hristov - * Company: SOFTKIT Bulgarian - * Site: http://www.softkit-bg.com - */ -editArea.add_lang("bg",{ -charmap_but: "Виртуална клавиатура", -charmap_title: "Виртуална клавиатура", -charmap_choose_block: "избери езиков блок", -charmap_insert:"постави този символ" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/cs.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/cs.js deleted file mode 100644 index 6b1c9072e..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/cs.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("cs",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/de.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/de.js deleted file mode 100644 index 6dfe69c0e..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/de.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("de",{ -charmap_but: "Sonderzeichen", -charmap_title: "Sonderzeichen", -charmap_choose_block: "Bereich auswählen", -charmap_insert: "dieses Zeichen einfügen" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/dk.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/dk.js deleted file mode 100644 index ebcde25ea..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/dk.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("dk",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/en.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/en.js deleted file mode 100644 index 335ec28fe..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/en.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("en",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/eo.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/eo.js deleted file mode 100644 index 9a308411f..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/eo.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("eo",{ -charmap_but: "Ekranklavaro", -charmap_title: "Ekranklavaro", -charmap_choose_block: "Elekto de lingvo", -charmap_insert:"enmeti tiun signaron" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/es.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/es.js deleted file mode 100644 index be04b4b5e..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/es.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("es",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/fr.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/fr.js deleted file mode 100644 index 8131e300b..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/fr.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("fr",{ -charmap_but: "Clavier visuel", -charmap_title: "Clavier visuel", -charmap_choose_block: "choix du language", -charmap_insert:"insérer ce caractère" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/hr.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/hr.js deleted file mode 100644 index 4d743540a..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/hr.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("hr",{ -charmap_but: "Virtualna tipkovnica", -charmap_title: "Virtualna tipkovnica", -charmap_choose_block: "Odaberi blok s jezikom", -charmap_insert:"Ubaci taj znak" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/it.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/it.js deleted file mode 100644 index b05abb932..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/it.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("it",{ -charmap_but: "Tastiera visuale", -charmap_title: "Tastiera visuale", -charmap_choose_block: "seleziona blocco", -charmap_insert:"inserisci questo carattere" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ja.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ja.js deleted file mode 100644 index efe060e1c..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ja.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("ja",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/mk.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/mk.js deleted file mode 100644 index f5331167e..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/mk.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("mkn",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/nl.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/nl.js deleted file mode 100644 index 70d796820..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/nl.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("nl",{ -charmap_but: "Visueel toetsenbord", -charmap_title: "Visueel toetsenbord", -charmap_choose_block: "Kies een taal blok", -charmap_insert:"Voeg dit symbool in" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pl.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pl.js deleted file mode 100644 index 9feabbb27..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pl.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("pl",{ -charmap_but: "Klawiatura ekranowa", -charmap_title: "Klawiatura ekranowa", -charmap_choose_block: "wybierz grupę znaków", -charmap_insert:"wstaw ten znak" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pt.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pt.js deleted file mode 100644 index 5d3eaa3a8..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/pt.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("pt",{ -charmap_but: "Visual keyboard", -charmap_title: "Visual keyboard", -charmap_choose_block: "select language block", -charmap_insert:"insert this character" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ru.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ru.js deleted file mode 100644 index 3163f365a..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/ru.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("ru",{ -charmap_but: "Визуальная клавиатура", -charmap_title: "Визуальная клавиатура", -charmap_choose_block: "выбрать языковой блок", -charmap_insert:"вставить этот символ" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/sk.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/sk.js deleted file mode 100644 index 851364110..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/sk.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("sk",{ -charmap_but: "Vizuálna klávesnica", -charmap_title: "Vizuálna klávesnica", -charmap_choose_block: "vyber jazykový blok", -charmap_insert: "vlož tento znak" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/zh.js b/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/zh.js deleted file mode 100644 index 2a2023353..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/langs/zh.js +++ /dev/null @@ -1,6 +0,0 @@ -editArea.add_lang("zh",{ -charmap_but: "软键盘", -charmap_title: "软键盘", -charmap_choose_block: "选择一个语言块", -charmap_insert:"插入此字符" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/charmap/popup.html b/plugins/LocalFilesEditor/editarea/plugins/charmap/popup.html deleted file mode 100644 index 4b549db8b..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/charmap/popup.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - -{$charmap_title} - - - - - -
-
-

{$charmap_title}:

- -
- -
- - - - - diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/css/test.css b/plugins/LocalFilesEditor/editarea/plugins/test/css/test.css deleted file mode 100644 index 01245eb4e..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/css/test.css +++ /dev/null @@ -1,3 +0,0 @@ -select#test_select{ - background-color: #FF0000; -} diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/images/test.gif b/plugins/LocalFilesEditor/editarea/plugins/test/images/test.gif deleted file mode 100644 index 1ab5da446..000000000 Binary files a/plugins/LocalFilesEditor/editarea/plugins/test/images/test.gif and /dev/null differ diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/bg.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/bg.js deleted file mode 100644 index 56e049e05..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/bg.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Bulgarian translation - * Author: Valentin Hristov - * Company: SOFTKIT Bulgarian - * Site: http://www.softkit-bg.com - */ -editArea.add_lang("bg",{ -test_select: "избери таг", -test_but: "тествай копието" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/cs.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/cs.js deleted file mode 100644 index 026ef04cb..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/cs.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("cs",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/de.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/de.js deleted file mode 100644 index bd0857ce5..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/de.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("de",{ -test_select: "Tag auswählen", -test_but: "Test Button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/dk.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/dk.js deleted file mode 100644 index e765cf931..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/dk.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("dk",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/en.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/en.js deleted file mode 100644 index 7d5d157ca..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/en.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("en",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/eo.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/eo.js deleted file mode 100644 index 8b4914fda..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/eo.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("eo",{ -test_select:"elekto de marko", -test_but: "provo-butono" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/es.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/es.js deleted file mode 100644 index 73e30f1dd..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/es.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("es",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/fr.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/fr.js deleted file mode 100644 index ea08a93e6..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/fr.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("fr",{ -test_select:"choix balise", -test_but: "bouton de test" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/hr.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/hr.js deleted file mode 100644 index fbffd9859..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/hr.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("hr",{ -test_select: "Odaberi tag", -test_but: "Probna tipka" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/it.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/it.js deleted file mode 100644 index 90926feb1..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/it.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("it",{ -test_select: "seleziona tag", -test_but: "pulsante di test" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/ja.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/ja.js deleted file mode 100644 index 2eb856cdb..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/ja.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("ja",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/mk.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/mk.js deleted file mode 100644 index 058ad4b8d..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/mk.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("mk",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/nl.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/nl.js deleted file mode 100644 index 3217c352d..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/nl.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("nl",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/pl.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/pl.js deleted file mode 100644 index 5c737329f..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/pl.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("pl",{ -test_select: "wybierz tag", -test_but: "test" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/pt.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/pt.js deleted file mode 100644 index 7f8517211..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/pt.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("pt",{ -test_select: "select tag", -test_but: "test button" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/ru.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/ru.js deleted file mode 100644 index 0aaf542af..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/ru.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("ru",{ -test_select: "выбрать тэг", -test_but: "тестировать кнопку" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/sk.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/sk.js deleted file mode 100644 index fe0a72708..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/sk.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("sk",{ -test_select: "vyber tag", -test_but: "testovacie tlačidlo" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/langs/zh.js b/plugins/LocalFilesEditor/editarea/plugins/test/langs/zh.js deleted file mode 100644 index 798d1752c..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/langs/zh.js +++ /dev/null @@ -1,4 +0,0 @@ -editArea.add_lang("zh",{ -test_select: "选择标签", -test_but: "测试按钮" -}); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/test.js b/plugins/LocalFilesEditor/editarea/plugins/test/test.js deleted file mode 100644 index 46e71efa0..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/test.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Plugin designed for test prupose. It add a button (that manage an alert) and a select (that allow to insert tags) in the toolbar. - * This plugin also disable the "f" key in the editarea, and load a CSS and a JS file - */ -var EditArea_test= { - /** - * Get called once this file is loaded (editArea still not initialized) - * - * @return nothing - */ - init: function(){ - // alert("test init: "+ this._someInternalFunction(2, 3)); - editArea.load_css(this.baseURL+"css/test.css"); - editArea.load_script(this.baseURL+"test2.js"); - } - /** - * Returns the HTML code for a specific control string or false if this plugin doesn't have that control. - * A control can be a button, select list or any other HTML item to present in the EditArea user interface. - * Language variables such as {$lang_somekey} will also be replaced with contents from - * the language packs. - * - * @param {string} ctrl_name: the name of the control to add - * @return HTML code for a specific control or false. - * @type string or boolean - */ - ,get_control_html: function(ctrl_name){ - switch(ctrl_name){ - case "test_but": - // Control id, button img, command - return parent.editAreaLoader.get_button_html('test_but', 'test.gif', 'test_cmd', false, this.baseURL); - case "test_select": - html= ""; - return html; - } - return false; - } - /** - * Get called once EditArea is fully loaded and initialised - * - * @return nothing - */ - ,onload: function(){ - alert("test load"); - } - - /** - * Is called each time the user touch a keyboard key. - * - * @param (event) e: the keydown event - * @return true - pass to next handler in chain, false - stop chain execution - * @type boolean - */ - ,onkeydown: function(e){ - var str= String.fromCharCode(e.keyCode); - // desactivate the "f" character - if(str.toLowerCase()=="f"){ - return true; - } - return false; - } - - /** - * Executes a specific command, this function handles plugin commands. - * - * @param {string} cmd: the name of the command being executed - * @param {unknown} param: the parameter of the command - * @return true - pass to next handler in chain, false - stop chain execution - * @type boolean - */ - ,execCommand: function(cmd, param){ - // Handle commands - switch(cmd){ - case "test_select_change": - var val= document.getElementById("test_select").value; - if(val!=-1) - parent.editAreaLoader.insertTags(editArea.id, "<"+val+">", ""); - document.getElementById("test_select").options[0].selected=true; - return false; - case "test_cmd": - alert("user clicked on test_cmd"); - return false; - } - // Pass to next handler in chain - return true; - } - - /** - * This is just an internal plugin method, prefix all internal methods with a _ character. - * The prefix is needed so they doesn't collide with future EditArea callback functions. - * - * @param {string} a Some arg1. - * @param {string} b Some arg2. - * @return Some return. - * @type unknown - */ - ,_someInternalFunction : function(a, b) { - return a+b; - } -}; - -// Adds the plugin class to the list of available EditArea plugins -editArea.add_plugin("test", EditArea_test); diff --git a/plugins/LocalFilesEditor/editarea/plugins/test/test2.js b/plugins/LocalFilesEditor/editarea/plugins/test/test2.js deleted file mode 100644 index 9a1ce5127..000000000 --- a/plugins/LocalFilesEditor/editarea/plugins/test/test2.js +++ /dev/null @@ -1 +0,0 @@ -alert("test2.js is loaded from test plugin"); diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax.js b/plugins/LocalFilesEditor/editarea/reg_syntax.js deleted file mode 100644 index 11518cc13..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax.js +++ /dev/null @@ -1,166 +0,0 @@ - EditAreaLoader.prototype.get_regexp= function(text_array){ - //res="( |=|\\n|\\r|\\[|\\(|µ|)("; - res="(\\b)("; - for(i=0; i0) - res+="|"; - //res+="("+ tab_text[i] +")"; - //res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1"); - res+=this.get_escaped_regexp(text_array[i]); - } - //res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)"; - res+=")(\\b)"; - reg= new RegExp(res); - - return res; - }; - - - EditAreaLoader.prototype.get_escaped_regexp= function(str){ - return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1"); - }; - - EditAreaLoader.prototype.init_syntax_regexp= function(){ - var lang_style= {}; - for(var lang in this.load_syntax){ - if(!this.syntax[lang]) // init the regexp if not already initialized - { - this.syntax[lang]= {}; - this.syntax[lang]["keywords_reg_exp"]= {}; - this.keywords_reg_exp_nb=0; - - if(this.load_syntax[lang]['KEYWORDS']){ - param="g"; - if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false) - param+="i"; - for(var i in this.load_syntax[lang]['KEYWORDS']){ - if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue; - this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param); - this.keywords_reg_exp_nb++; - } - } - - if(this.load_syntax[lang]['OPERATORS']){ - var str=""; - var nb=0; - for(var i in this.load_syntax[lang]['OPERATORS']){ - if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue; - if(nb>0) - str+="|"; - str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]); - nb++; - } - if(str.length>0) - this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g"); - } - - if(this.load_syntax[lang]['DELIMITERS']){ - var str=""; - var nb=0; - for(var i in this.load_syntax[lang]['DELIMITERS']){ - if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue; - if(nb>0) - str+="|"; - str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]); - nb++; - } - if(str.length>0) - this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g"); - } - - - // /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|())/gi - var syntax_trace=[]; - - // /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g - - this.syntax[lang]["quotes"]={}; - var quote_tab= []; - if(this.load_syntax[lang]['QUOTEMARKS']){ - for(var i in this.load_syntax[lang]['QUOTEMARKS']){ - if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue; - var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]); - this.syntax[lang]["quotes"][x]=x; - //quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))"; - //previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))"; - quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))"; - - syntax_trace.push(x); - } - } - - this.syntax[lang]["comments"]={}; - if(this.load_syntax[lang]['COMMENT_SINGLE']){ - for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){ - if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue; - var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]); - quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))"; - syntax_trace.push(x); - this.syntax[lang]["comments"][x]="\n"; - } - } - // (/\*(.|[\r\n])*?\*/) - if(this.load_syntax[lang]['COMMENT_MULTI']){ - for(var i in this.load_syntax[lang]['COMMENT_MULTI']){ - if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue; - var start=this.get_escaped_regexp(i); - var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]); - quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))"; - syntax_trace.push(start); - syntax_trace.push(end); - this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i]; - } - } - if(quote_tab.length>0) - this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi"); - - if(syntax_trace.length>0) // /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g - this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi"); - - if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){ - this.syntax[lang]["script_delimiters"]= {}; - for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){ - if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue; - this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS']; - } - } - - this.syntax[lang]["custom_regexp"]= {}; - if(this.load_syntax[lang]['REGEXPS']){ - for(var i in this.load_syntax[lang]['REGEXPS']){ - if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue; - var val= this.load_syntax[lang]['REGEXPS'][i]; - if(!this.syntax[lang]["custom_regexp"][val['execute']]) - this.syntax[lang]["custom_regexp"][val['execute']]= {}; - this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers']) - , 'class' : val['class']}; - } - } - - if(this.load_syntax[lang]['STYLES']){ - lang_style[lang]= {}; - for(var i in this.load_syntax[lang]['STYLES']){ - if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue; - if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){ - for(var j in this.load_syntax[lang]['STYLES'][i]){ - lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j]; - } - }else{ - lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i]; - } - } - } - // build style string - var style=""; - for(var i in lang_style[lang]){ - if(lang_style[lang][i].length>0){ - style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n"; - style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n"; - } - } - this.syntax[lang]["styles"]=style; - } - } - }; - - editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded"; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/basic.js b/plugins/LocalFilesEditor/editarea/reg_syntax/basic.js deleted file mode 100644 index d8082f75a..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/basic.js +++ /dev/null @@ -1,70 +0,0 @@ -editAreaLoader.load_syntax["basic"] = { - 'DISPLAY_NAME' : 'Basic' - ,'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'} - ,'COMMENT_MULTI' : { } - ,'QUOTEMARKS' : {1: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'if','then','for','wend','while', - 'else','elseif','select','case','end select', - 'until','next','step','to','end if', 'call' - ] - ,'keywords' : [ - 'sub', 'end sub', 'function', 'end function', 'exit', - 'exit function', 'dim', 'redim', 'shared', 'const', - 'is', 'absolute', 'access', 'any', 'append', 'as', - 'base', 'beep', 'binary', 'bload', 'bsave', 'chain', - 'chdir', 'circle', 'clear', 'close', 'cls', 'color', - 'com', 'common', 'data', 'date', 'declare', 'def', - 'defdbl', 'defint', 'deflng', 'defsng', 'defstr', - 'double', 'draw', 'environ', 'erase', 'error', 'field', - 'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key', - 'kill', 'let', 'line', 'list', 'locate', 'lock', 'long', - 'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open', - 'option', 'out', 'output', 'paint', 'palette', 'pcopy', - 'poke', 'preset', 'print', 'pset', 'put', 'random', - 'randomize', 'read', 'reset', 'restore', 'resume', - 'return', 'rmdir', 'rset', 'run', 'screen', 'seg', - 'shell', 'single', 'sleep', 'sound', 'static', 'stop', - 'strig', 'string', 'swap', 'system', 'time', 'timer', - 'troff', 'tron', 'type', 'unlock', 'using', 'view', - 'wait', 'width', 'window', 'write' - ] - ,'functions' : [ - 'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng', - 'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl', - 'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp', - 'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey', - 'inp', 'input', 'instr', 'int', 'ioctl', 'lbound', - 'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos', - 'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks', - 'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point', - 'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin', - 'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan', - 'ubound', 'ucase', 'val', 'varptr', 'varseg' - ] - ,'operators' : [ - 'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '!', '&' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #99CC00;' - ,'QUOTESMARKS': 'color: #333399;' - ,'KEYWORDS' : { - 'keywords' : 'color: #3366FF;' - ,'functions' : 'color: #0000FF;' - ,'statements' : 'color: #3366FF;' - ,'operators' : 'color: #FF0000;' - } - ,'OPERATORS' : 'color: #FF0000;' - ,'DELIMITERS' : 'color: #0000FF;' - - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/brainfuck.js b/plugins/LocalFilesEditor/editarea/reg_syntax/brainfuck.js deleted file mode 100644 index 6f8f06345..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/brainfuck.js +++ /dev/null @@ -1,45 +0,0 @@ -editAreaLoader.load_syntax["brainfuck"] = { - 'DISPLAY_NAME' : 'Brainfuck' - ,'COMMENT_SINGLE' : {} - ,'COMMENT_MULTI' : {} - ,'QUOTEMARKS' : {} - ,'KEYWORD_CASE_SENSITIVE' : true - ,'OPERATORS' :[ - '+', '-' - ] - ,'DELIMITERS' :[ - '[', ']' - ] - ,'REGEXPS' : { - 'bfispis' : { - 'search' : '()(\\.)()' - ,'class' : 'bfispis' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - ,'bfupis' : { - 'search' : '()(\\,)()' - ,'class' : 'bfupis' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - ,'bfmemory' : { - 'search' : '()([<>])()' - ,'class' : 'bfmemory' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'OPERATORS' : 'color: #88AA00;' - ,'DELIMITERS' : 'color: #00C138;' - ,'REGEXPS' : { - 'bfispis' : 'color: #EE0000;' - ,'bfupis' : 'color: #4455ee;' - ,'bfmemory' : 'color: #DD00DD;' - } - } -}; - diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/c.js b/plugins/LocalFilesEditor/editarea/reg_syntax/c.js deleted file mode 100644 index 0e0f843fd..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/c.js +++ /dev/null @@ -1,63 +0,0 @@ -editAreaLoader.load_syntax["c"] = { - 'DISPLAY_NAME' : 'C' - ,'COMMENT_SINGLE' : {1 : '//'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : true - ,'KEYWORDS' : { - 'constants' : [ - 'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true' - ] - ,'types' : [ - 'FILE', 'auto', 'char', 'const', 'double', - 'extern', 'float', 'inline', 'int', 'long', 'register', - 'short', 'signed', 'size_t', 'static', 'struct', - 'time_t', 'typedef', 'union', 'unsigned', 'void', - 'volatile' - ] - ,'statements' : [ - 'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof', - 'switch', 'while' - ] - ,'keywords' : [ - 'break', 'case', 'continue', 'default', 'delete', - 'return' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - 'precompiler' : { - 'search' : '()(#[^\r\n]*)()' - ,'class' : 'precompiler' - ,'modifiers' : 'g' - ,'execute' : 'before' - } -/* ,'precompilerstring' : { - 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])' - ,'class' : 'precompilerstring' - ,'modifiers' : 'g' - ,'execute' : 'before' - }*/ - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'constants' : 'color: #EE0000;' - ,'types' : 'color: #0000EE;' - ,'statements' : 'color: #60CA00;' - ,'keywords' : 'color: #48BDDF;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #0038E1;' - ,'REGEXPS' : { - 'precompiler' : 'color: #009900;' - ,'precompilerstring' : 'color: #994400;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/coldfusion.js b/plugins/LocalFilesEditor/editarea/reg_syntax/coldfusion.js deleted file mode 100644 index 792f10b77..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/coldfusion.js +++ /dev/null @@ -1,120 +0,0 @@ -editAreaLoader.load_syntax["coldfusion"] = { - 'DISPLAY_NAME' : 'Coldfusion' - ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'} - ,'COMMENT_MULTI' : {''} - ,'COMMENT_MULTI2' : {''} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'include', 'require', 'include_once', 'require_once', - 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', - 'endif', 'switch', 'case', 'endswitch', - 'return', 'break', 'continue' - ] - ,'reserved' : [ - 'AND', 'break', 'case', 'CONTAIN', 'CONTAINS', 'continue', 'default', 'do', - 'DOES', 'else', 'EQ', 'EQUAL', 'EQUALTO', 'EQV', 'FALSE', 'for', 'GE', - 'GREATER', 'GT', 'GTE', 'if', 'IMP', 'in', 'IS', 'LE', 'LESS', 'LT', 'LTE', - 'MOD', 'NEQ', 'NOT', 'OR', 'return', 'switch', 'THAN', 'TO', 'TRUE', 'var', - 'while', 'XOR' - ] - ,'functions' : [ - 'Abs', 'ACos', 'ArrayAppend', 'ArrayAvg', 'ArrayClear', 'ArrayDeleteAt', 'ArrayInsertAt', - 'ArrayIsEmpty', 'ArrayLen', 'ArrayMax', 'ArrayMin', 'ArrayNew', 'ArrayPrepend', 'ArrayResize', - 'ArraySet', 'ArraySort', 'ArraySum', 'ArraySwap', 'ArrayToList', 'Asc', 'ASin', 'Atn', 'AuthenticatedContext', - 'AuthenticatedUser', 'BitAnd', 'BitMaskClear', 'BitMaskRead', 'BitMaskSet', 'BitNot', 'BitOr', - 'BitSHLN', 'BitSHRN', 'BitXor', 'Ceiling', 'Chr', 'CJustify', 'Compare', 'CompareNoCase', 'Cos', - 'CreateDate', 'CreateDateTime', 'CreateODBCDate', 'CreateODBCDateTime', 'CreateODBCTime', - 'CreateTime', 'CreateTimeSpan', 'DateAdd', 'DateCompare', 'DateConvert', 'DateDiff', - 'DateFormat', 'DatePart', 'Day', 'DayOfWeek', 'DayOfWeekAsString', 'DayOfYear', 'DaysInMonth', - 'DaysInYear', 'DE', 'DecimalFormat', 'DecrementValue', 'Decrypt', 'DeleteClientVariable', - 'DirectoryExists', 'DollarFormat', 'Duplicate', 'Encrypt', 'Evaluate', 'Exp', 'ExpandPath', - 'FileExists', 'Find', 'FindNoCase', 'FindOneOf', 'FirstDayOfMonth', 'Fix', 'FormatBaseN', - 'GetBaseTagData', 'GetBaseTagList', 'GetBaseTemplatePath', 'GetClientVariablesList', - 'GetCurrentTemplatePath', 'GetDirectoryFromPath', 'GetException', 'GetFileFromPath', - 'GetFunctionList', 'GetHttpTimeString', 'GetHttpRequestData', 'GetLocale', 'GetMetricData', - 'GetProfileString', 'GetTempDirectory', 'GetTempFile', 'GetTemplatePath', 'GetTickCount', - 'GetTimeZoneInfo', 'GetToken', 'Hash', 'Hour', 'HTMLCodeFormat', 'HTMLEditFormat', 'IIf', - 'IncrementValue', 'InputBaseN', 'Insert', 'Int', 'IsArray', 'IsAuthenticated', 'IsAuthorized', - 'IsBoolean', 'IsBinary', 'IsCustomFunction', 'IsDate', 'IsDebugMode', 'IsDefined', 'IsLeapYear', - 'IsNumeric', 'IsNumericDate', 'IsProtected', 'IsQuery', 'IsSimpleValue', 'IsStruct', 'IsWDDX', - 'JavaCast', 'JSStringFormat', 'LCase', 'Left', 'Len', 'ListAppend', 'ListChangeDelims', - 'ListContains', 'ListContainsNoCase', 'ListDeleteAt', 'ListFind', 'ListFindNoCase', 'ListFirst', - 'ListGetAt', 'ListInsertAt', 'ListLast', 'ListLen', 'ListPrepend', 'ListQualify', 'ListRest', - 'ListSetAt', 'ListSort', 'ListToArray', 'ListValueCount', 'ListValueCountNoCase', 'LJustify', - 'Log', 'Log10', 'LSCurrencyFormat', 'LSDateFormat', 'LSEuroCurrencyFormat', 'LSIsCurrency', - 'LSIsDate', 'LSIsNumeric', 'LSNumberFormat', 'LSParseCurrency', 'LSParseDateTime', 'LSParseNumber', - 'LSTimeFormat', 'LTrim', 'Max', 'Mid', 'Min', 'Minute', 'Month', 'MonthAsString', 'Now', 'NumberFormat', - 'ParagraphFormat', 'ParameterExists', 'ParseDateTime', 'Pi', 'PreserveSingleQuotes', 'Quarter', - 'QueryAddRow', 'QueryNew', 'QuerySetCell', 'QuotedValueList', 'Rand', 'Randomize', 'RandRange', - 'REFind', 'REFindNoCase', 'RemoveChars', 'RepeatString', 'Replace', 'ReplaceList', 'ReplaceNoCase', - 'REReplace', 'REReplaceNoCase', 'Reverse', 'Right', 'RJustify', 'Round', 'RTrim', 'Second', 'SetLocale', - 'SetProfileString', 'SetVariable', 'Sgn', 'Sin', 'SpanExcluding', 'SpanIncluding', 'Sqr', 'StripCR', - 'StructAppend', 'StructClear', 'StructCopy', 'StructCount', 'StructDelete', 'StructFind', 'StructFindKey', - 'StructFindValue', 'StructGet', 'StructInsert', 'StructIsEmpty', 'StructKeyArray', 'StructKeyExists', - 'StructKeyList', 'StructNew', 'StructSort', 'StructUpdate', 'Tan', 'TimeFormat', 'ToBase64', 'ToBinary', - 'ToString', 'Trim', 'UCase', 'URLDecode', 'URLEncodedFormat', 'Val', 'ValueList', 'Week', 'WriteOutput', - 'XMLFormat', 'Year', 'YesNoFormat' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '%', '!', '&&', '||' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - 'doctype' : { - 'search' : '()(]*>)()' - ,'class' : 'doctype' - ,'modifiers' : '' - ,'execute' : 'before' // before or after - } - ,'cftags' : { - 'search' : '(<)(/cf[a-z][^ \r\n\t>]*)([^>]*>)' - ,'class' : 'cftags' - ,'modifiers' : 'gi' - ,'execute' : 'before' // before or after - } - ,'cftags2' : { - 'search' : '(<)(cf[a-z][^ \r\n\t>]*)([^>]*>)' - ,'class' : 'cftags2' - ,'modifiers' : 'gi' - ,'execute' : 'before' // before or after - } - ,'tags' : { - 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)' - ,'class' : 'tags' - ,'modifiers' : 'gi' - ,'execute' : 'before' // before or after - } - ,'attributes' : { - 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)' - ,'class' : 'attributes' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'reserved' : 'color: #48BDDF;' - ,'functions' : 'color: #0000FF;' - ,'statements' : 'color: #60CA00;' - } - ,'OPERATORS' : 'color: #E775F0;' - ,'DELIMITERS' : '' - ,'REGEXPS' : { - 'attributes': 'color: #990033;' - ,'cftags': 'color: #990033;' - ,'cftags2': 'color: #990033;' - ,'tags': 'color: #000099;' - ,'doctype': 'color: #8DCFB5;' - ,'test': 'color: #00FF00;' - } - } -}; - - diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/cpp.js b/plugins/LocalFilesEditor/editarea/reg_syntax/cpp.js deleted file mode 100644 index 6b176e8df..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/cpp.js +++ /dev/null @@ -1,66 +0,0 @@ -editAreaLoader.load_syntax["cpp"] = { - 'DISPLAY_NAME' : 'CPP' - ,'COMMENT_SINGLE' : {1 : '//'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : true - ,'KEYWORDS' : { - 'constants' : [ - 'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr', - 'true' - ] - ,'types' : [ - 'FILE', 'auto', 'char', 'class', 'const', 'double', - 'extern', 'float', 'friend', 'inline', 'int', - 'iterator', 'long', 'map', 'operator', 'queue', - 'register', 'short', 'signed', 'size_t', 'stack', - 'static', 'string', 'struct', 'time_t', 'typedef', - 'union', 'unsigned', 'vector', 'void', 'volatile' - ] - ,'statements' : [ - 'catch', 'do', 'else', 'enum', 'for', 'goto', 'if', - 'sizeof', 'switch', 'this', 'throw', 'try', 'while' - ] - ,'keywords' : [ - 'break', 'case', 'continue', 'default', 'delete', - 'namespace', 'new', 'private', 'protected', 'public', - 'return', 'using' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - 'precompiler' : { - 'search' : '()(#[^\r\n]*)()' - ,'class' : 'precompiler' - ,'modifiers' : 'g' - ,'execute' : 'before' - } -/* ,'precompilerstring' : { - 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])' - ,'class' : 'precompilerstring' - ,'modifiers' : 'g' - ,'execute' : 'before' - }*/ - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'constants' : 'color: #EE0000;' - ,'types' : 'color: #0000EE;' - ,'statements' : 'color: #60CA00;' - ,'keywords' : 'color: #48BDDF;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #0038E1;' - ,'REGEXPS' : { - 'precompiler' : 'color: #009900;' - ,'precompilerstring' : 'color: #994400;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/css.js b/plugins/LocalFilesEditor/editarea/reg_syntax/css.js deleted file mode 100644 index cff605aad..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/css.js +++ /dev/null @@ -1,85 +0,0 @@ -editAreaLoader.load_syntax["css"] = { - 'DISPLAY_NAME' : 'CSS' - ,'COMMENT_SINGLE' : {1 : '@'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : ['"', "'"] - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'attributes' : [ - 'aqua', 'azimuth', 'background-attachment', 'background-color', - 'background-image', 'background-position', 'background-repeat', - 'background', 'border-bottom-color', 'border-bottom-style', - 'border-bottom-width', 'border-left-color', 'border-left-style', - 'border-left-width', 'border-right', 'border-right-color', - 'border-right-style', 'border-right-width', 'border-top-color', - 'border-top-style', 'border-top-width','border-bottom', 'border-collapse', - 'border-left', 'border-width', 'border-color', 'border-spacing', - 'border-style', 'border-top', 'border', 'caption-side', - 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', - 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display', - 'elevation', 'empty-cells', 'float', 'font-family', 'font-size', - 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', - 'font-weight', 'font', 'height', 'letter-spacing', 'line-height', - 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', - 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin', - 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height', - 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style', - 'outline-width', 'overflow', 'padding-bottom', 'padding-left', - 'padding-right', 'padding-top', 'padding', 'page', 'page-break-after', - 'page-break-before', 'page-break-inside', 'pause-after', 'pause-before', - 'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', - 'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation', - 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration', - 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi', - 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', - 'width', 'word-spacing', 'z-index', 'bottom', 'left' - ] - ,'values' : [ - 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid', - 'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both', - 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', - 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive', - 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', - 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded', - 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia', - 'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher', - 'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline', - 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana', - 'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', - 'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace', - 'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', - 'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline', - 'pointer', 'portrait', 'purple', 'px', - 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards', - 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square', - 'static', 'status-bar', 'super', 'sw-resize', - 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent', - 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url', - 'visible', - 'w-resize', 'wait', 'white', 'wider', - 'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', - 'yellow', 'yes' - ] - ,'specials' : [ - 'important' - ] - } - ,'OPERATORS' :[ - ':', ';', '!', '.', '#' - ] - ,'DELIMITERS' :[ - '{', '}' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'attributes' : 'color: #48BDDF;' - ,'values' : 'color: #2B60FF;' - ,'specials' : 'color: #FF0000;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #60CA00;' - - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/html.js b/plugins/LocalFilesEditor/editarea/reg_syntax/html.js deleted file mode 100644 index 66490b171..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/html.js +++ /dev/null @@ -1,51 +0,0 @@ -/* -* last update: 2006-08-24 -*/ - -editAreaLoader.load_syntax["html"] = { - 'DISPLAY_NAME' : 'HTML' - ,'COMMENT_SINGLE' : {} - ,'COMMENT_MULTI' : {''} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - } - ,'OPERATORS' :[ - ] - ,'DELIMITERS' :[ - ] - ,'REGEXPS' : { - 'doctype' : { - 'search' : '()(]*>)()' - ,'class' : 'doctype' - ,'modifiers' : '' - ,'execute' : 'before' // before or after - } - ,'tags' : { - 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)' - ,'class' : 'tags' - ,'modifiers' : 'gi' - ,'execute' : 'before' // before or after - } - ,'attributes' : { - 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)' - ,'class' : 'attributes' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - } - ,'OPERATORS' : 'color: #E775F0;' - ,'DELIMITERS' : '' - ,'REGEXPS' : { - 'attributes': 'color: #B1AC41;' - ,'tags': 'color: #E62253;' - ,'doctype': 'color: #8DCFB5;' - ,'test': 'color: #00FF00;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/index.php b/plugins/LocalFilesEditor/editarea/reg_syntax/index.php deleted file mode 100644 index f26982d0e..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/index.php +++ /dev/null @@ -1,30 +0,0 @@ - diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/java.js b/plugins/LocalFilesEditor/editarea/reg_syntax/java.js deleted file mode 100644 index 2c01928eb..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/java.js +++ /dev/null @@ -1,57 +0,0 @@ -editAreaLoader.load_syntax["java"] = { - 'DISPLAY_NAME' : 'Java' - ,'COMMENT_SINGLE': { 1: '//', 2: '@' } - , 'COMMENT_MULTI': { '/*': '*/' } - , 'QUOTEMARKS': { 1: "'", 2: '"' } - , 'KEYWORD_CASE_SENSITIVE': true - , 'KEYWORDS': { - 'constants': [ - 'null', 'false', 'true' - ] - , 'types': [ - 'String', 'int', 'short', 'long', 'char', 'double', 'byte', - 'float', 'static', 'void', 'private', 'boolean', 'protected', - 'public', 'const', 'class', 'final', 'abstract', 'volatile', - 'enum', 'transient', 'interface' - ] - , 'statements': [ - 'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally', - 'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements', - 'break', 'case', 'default', 'goto' - ] - , 'keywords': [ - 'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized', - 'instanceof', 'strictfp' - ] - } - , 'OPERATORS': [ - '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&' - ] - , 'DELIMITERS': [ - '(', ')', '[', ']', '{', '}' - ] - , 'REGEXPS': { - 'precompiler': { - 'search': '()(#[^\r\n]*)()' - , 'class': 'precompiler' - , 'modifiers': 'g' - , 'execute': 'before' - } - } - , 'STYLES': { - 'COMMENTS': 'color: #AAAAAA;' - , 'QUOTESMARKS': 'color: #6381F8;' - , 'KEYWORDS': { - 'constants': 'color: #EE0000;' - , 'types': 'color: #0000EE;' - , 'statements': 'color: #60CA00;' - , 'keywords': 'color: #48BDDF;' - } - , 'OPERATORS': 'color: #FF00FF;' - , 'DELIMITERS': 'color: #0038E1;' - , 'REGEXPS': { - 'precompiler': 'color: #009900;' - , 'precompilerstring': 'color: #994400;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/js.js b/plugins/LocalFilesEditor/editarea/reg_syntax/js.js deleted file mode 100644 index cf7533a1b..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/js.js +++ /dev/null @@ -1,94 +0,0 @@ -editAreaLoader.load_syntax["js"] = { - 'DISPLAY_NAME' : 'Javascript' - ,'COMMENT_SINGLE' : {1 : '//'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', - 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', - 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', - 'while', 'write', 'with' - ] - ,'keywords' : [ - 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', - 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', - 'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document', - // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice - 'Link ', 'outerHeight ', 'Anchor', 'FileUpload', - 'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self', - 'arguments', 'locationbar', 'pageXoffset', 'Form', - 'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status', - 'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy', - 'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden', - 'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents', - 'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text', - 'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity', - 'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed', - 'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents', - 'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus', - 'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document', - 'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window', - 'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy' - ] - ,'functions' : [ - // common functions for Window object - 'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home', - 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', - 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status', - 'stop' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'statements' : 'color: #60CA00;' - ,'keywords' : 'color: #48BDDF;' - ,'functions' : 'color: #2B60FF;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #0038E1;' - - } - ,'AUTO_COMPLETION' : { - "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file - "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.| - ,"possible_words_letters": "[a-zA-Z0-9_]+" - ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$" - ,"prefix_separator": "\\." - } - ,"CASE_SENSITIVE": true - ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position - ,"KEYWORDS": { - '': [ // the prefix of thoses items - /** - * 0 : the keyword the user is typing - * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous ) - * If empty the keyword will be displayed - * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed) - */ - ['Array', '§()', ''] - ,['alert', '§({@})', 'alert(String message)'] - ,['document'] - ,['window'] - ] - ,'window' : [ - ['location'] - ,['document'] - ,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)'] - ] - ,'location' : [ - ['href'] - ] - } - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/pas.js b/plugins/LocalFilesEditor/editarea/reg_syntax/pas.js deleted file mode 100644 index 0efaed929..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/pas.js +++ /dev/null @@ -1,83 +0,0 @@ -editAreaLoader.load_syntax["pas"] = { - 'DISPLAY_NAME' : 'Pascal' - ,'COMMENT_SINGLE' : {} - ,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'} - ,'QUOTEMARKS' : {1: '"', 2: "'"} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'constants' : [ - 'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red', - 'Magenta', 'Brown', 'LightGray', 'DarkGray', - 'LightBlue', 'LightGreen', 'LightCyan', 'LightRed', - 'LightMagenta', 'Yellow', 'White', 'MaxSIntValue', - 'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint', - 'erroraddr', 'errorcode', 'LineEnding' - ] - ,'keywords' : [ - 'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor', - 'pow', 'is', 'not','Absolute', 'And_then', 'Array', - 'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto', - 'Else', 'End', 'Export', 'File', 'For', 'Function', - 'Goto', 'If', 'Import', 'Implementation', 'Inherited', - 'Inline', 'Interface', 'Label', 'Module', 'Nil', - 'Object', 'Of', 'Only', 'Operator', 'Or_else', - 'Otherwise', 'Packed', 'Procedure', 'Program', - 'Protected', 'Qualified', 'Record', 'Repeat', - 'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit', - 'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While', - 'With' - ] - ,'functions' : [ - 'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign', - 'Assigned', 'BinStr', 'Blockread', 'Blockwrite', - 'Break', 'Chdir', 'Chr', 'Close', 'CompareByte', - 'CompareChar', 'CompareDWord', 'CompareWord', 'Concat', - 'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete', - 'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude', - 'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte', - 'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac', - 'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager', - 'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include', - 'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord', - 'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult', - 'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase', - 'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move', - 'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord', - 'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred', - 'Ptr', 'Random', 'Randomize', 'Read', 'Readln', - 'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite', - 'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof', - 'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp', - 'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf', - 'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar', - 'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val', - 'Write', 'WriteLn' - ] - ,'types' : [ - 'Integer', 'Shortint', 'SmallInt', 'Longint', - 'Longword', 'Int64', 'Byte', 'Word', 'Cardinal', - 'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char', - 'Real', 'Single', 'Double', 'Extended', 'Comp', - 'String', 'ShortString', 'AnsiString', 'PChar' - ] - } - ,'OPERATORS' :[ - '@', '*', '+', '-', '/', '^', ':=', '<', '=', '>' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'specials' : 'color: #EE0000;' - ,'constants' : 'color: #654321;' - ,'keywords' : 'color: #48BDDF;' - ,'functions' : 'color: #449922;' - ,'types' : 'color: #2B60FF;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #60CA00;' - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/perl.js b/plugins/LocalFilesEditor/editarea/reg_syntax/perl.js deleted file mode 100644 index d9cc0b621..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/perl.js +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG. - * - * You may choose any license of the current release or any future release - * of editarea to use, modify and/or redistribute this file. - * - * This language specification file supports for syntax checking on - * a large subset of Perl 5.x. - * The basic common syntax of Perl is fully supported, but as for - * the highlighting of built-in operations, it's mainly designed - * to support for hightlighting Perl code in a Safe environment (compartment) - * as used by CoMaNet for evaluation of administrative scripts. This Safe - * compartment basically allows for all of Opcode's :default operations, - * but little others. See http://perldoc.perl.org/Opcode.html to learn - * more. - ***************************************************************************/ - -editAreaLoader.load_syntax["perl"] = { - 'DISPLAY_NAME' : 'Perl', - 'COMMENT_SINGLE' : {1 : '#'}, - 'QUOTEMARKS' : {1: "'", 2: '"'}, - 'KEYWORD_CASE_SENSITIVE' : true, - 'KEYWORDS' : - { - 'core' : - [ "if", "else", "elsif", "while", "for", "each", "foreach", - "next", "last", "goto", "exists", "delete", "undef", - "my", "our", "local", "use", "require", "package", "keys", "values", - "sub", "bless", "ref", "return" ], - 'functions' : - [ - //from :base_core - "int", "hex", "oct", "abs", "substr", "vec", "study", "pos", - "length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst", - "uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice", - "push", "pop", "shift", "unshift", "reverse", "and", "or", "dor", - "xor", "warn", "die", "prototype", - //from :base_mem - "concat", "repeat", "join", "range", - //none from :base_loop, as we'll see them as basic statements... - //from :base_orig - "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime", - //others - "print", "open", "close" - ] - }, - 'OPERATORS' : - [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&', - ' eq ', ' ne ', '=~' ], - 'DELIMITERS' : - [ '(', ')', '[', ']', '{', '}' ], - 'REGEXPS' : - { - 'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()', - 'class' : 'scopingnames', - 'modifiers' : 'g', 'execute' : 'before' }, - 'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()', - 'class' : 'scopingnames', - 'modifiers' : 'g', 'execute' : 'before' }, - 'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()', - 'class' : 'vars', - 'modifiers' : 'g', 'execute' : 'after' }, - 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()', - 'class' : 'vars', - 'modifiers' : 'g', 'execute' : 'after' }, - 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()', - 'class' : 'vars', - 'modifiers' : 'g', 'execute' : 'after' }, - }, - - 'STYLES' : - { - 'COMMENTS': 'color: #AAAAAA;', - 'QUOTESMARKS': 'color: #DC0000;', - 'KEYWORDS' : - { - 'core' : 'color: #8aca00;', - 'functions' : 'color: #2B60FF;' - }, - 'OPERATORS' : 'color: #8aca00;', - 'DELIMITERS' : 'color: #0038E1;', - 'REGEXPS': - { - 'scopingnames' : 'color: #ff0000;', - 'vars' : 'color: #00aaaa;', - } - } //'STYLES' -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/php.js b/plugins/LocalFilesEditor/editarea/reg_syntax/php.js deleted file mode 100644 index f53dc8895..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/php.js +++ /dev/null @@ -1,157 +0,0 @@ -editAreaLoader.load_syntax["php"] = { - 'DISPLAY_NAME' : 'Php' - ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'include', 'require', 'include_once', 'require_once', - 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', - 'endif', 'switch', 'case', 'endswitch', - 'return', 'break', 'continue' - ] - ,'reserved' : [ - '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST', - 'null', '__LINE__', '__FILE__', - 'false', '<?php', '?>', '<?', - '<script language', '</script>', - 'true', 'var', 'default', - 'function', 'class', 'new', '&new', 'this', - '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION', - 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR', - 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR', - 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT', - 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE', - 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR', - 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL' - - ] - ,'functions' : [ - 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined', - 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions', - 'extension_loaded', 'get_extension_funcs', 'debug_backtrace', - 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv', - 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime', - 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar', - 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown', - 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate', - 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode', - 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat', - 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from', - 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport', - 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die' - - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - // highlight all variables ($...) - 'variables' : { - 'search' : '()(\\$\\w+)()' - ,'class' : 'variables' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #879EFA;' - ,'KEYWORDS' : { - 'reserved' : 'color: #48BDDF;' - ,'functions' : 'color: #0040FD;' - ,'statements' : 'color: #60CA00;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #2B60FF;' - ,'REGEXPS' : { - 'variables' : 'color: #E0BD54;' - } - } - ,'AUTO_COMPLETION' : { - "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file - "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.| - ,"possible_words_letters": "[a-zA-Z0-9_\$]+" - ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$" - ,"prefix_separator": "\\-\\>|\\:\\:" - } - ,"CASE_SENSITIVE": true - ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position - ,"KEYWORDS": { - '': [ // the prefix of thoses items - /** - * 0 : the keyword the user is typing - * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous ) - * If empty the keyword will be displayed - * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed) - */ - ['$_POST'] - ,['$_GET'] - ,['$_SESSION'] - ,['$_SERVER'] - ,['$_FILES'] - ,['$_ENV'] - ,['$_COOKIE'] - ,['$_REQUEST'] - // magic methods - ,['__construct', '§( {@} )'] - ,['__destruct', '§( {@} )'] - ,['__sleep', '§( {@} )'] - ,['__wakeup', '§( {@} )'] - ,['__toString', '§( {@} )'] - // include - ,['include', '§ "{@}";'] - ,['include_once', '§ "{@}";'] - ,['require', '§ "{@}";'] - ,['require_once', '§ "{@}";'] - // statements - ,['for', '§( {@} )'] - ,['foreach', '§( {@} )'] - ,['if', '§( {@} )'] - ,['elseif', '§( {@} )'] - ,['while', '§( {@} )'] - ,['switch', '§( {@} )'] - ,['break'] - ,['case'] - ,['continue'] - ,['do'] - ,['else'] - ,['endif'] - ,['endswitch'] - ,['endwhile'] - ,['return'] - // function - ,['unset', '§( {@} )'] - ] - } - } - ,"live": { - - // class NAME: /class\W+([a-z]+)\W+/gi - // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi - // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi - // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi - // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi - // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi - - - "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.| - ,"possible_words_letters": "[a-zA-Z0-9_\$]+" - ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$" - ,"prefix_separator": "\\-\\>" - } - ,"CASE_SENSITIVE": true - ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position - ,"KEYWORDS": { - '$this': [ // the prefix of thoses items - ['test'] - ] - } - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/python.js b/plugins/LocalFilesEditor/editarea/reg_syntax/python.js deleted file mode 100644 index 1a5e7fbf1..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/python.js +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Python syntax v 1.1 - * - * v1.1 by Andre Roberge (2006/12/27) - * -**/ -editAreaLoader.load_syntax["python"] = { - 'DISPLAY_NAME' : 'Python' - ,'COMMENT_SINGLE' : {1 : '#'} - ,'COMMENT_MULTI' : {} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : true - ,'KEYWORDS' : { - /* - ** Set 1: reserved words - ** http://python.org/doc/current/ref/keywords.html - ** Note: 'as' and 'with' have been added starting with Python 2.5 - */ - 'reserved' : [ - 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', - 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', - 'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise', - 'return', 'try', 'while', 'with', 'yield' - //the following are *almost* reserved; we'll treat them as such - , 'False', 'True', 'None' - ] - /* - ** Set 2: builtins - ** http://python.org/doc/current/lib/built-in-funcs.html - */ - ,'builtins' : [ - '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp', - 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', - 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', - 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', - 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', - 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', - 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', - 'vars', 'xrange', 'zip', - // Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html - //'False', 'True', 'None' have been included in 'reserved' - 'NotImplemented', 'Ellipsis', - // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html - 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError', - 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError', - 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError', - 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError', - 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError', - 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError', - 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning', - 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning', - 'RuntimeWarning', 'FutureWarning', - // we will include the string methods as well - // http://python.org/doc/current/lib/string-methods.html - 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', - 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle', - 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', - 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', - 'translate', 'upper', 'zfill' - ] - /* - ** Set 3: standard library - ** http://python.org/doc/current/lib/modindex.html - */ - ,'stdlib' : [ - '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm', - 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer', - 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi', - 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', - 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler', - 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt', - 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE', - 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm', - 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl', - 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl', - 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob', - 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib', - 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect', - 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap', - 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify', - 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator', - 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes', - 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile', - 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random', - 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter', - 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve', - 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd', - 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string', - 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev', - 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', - 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token', - 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2', - 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings', - 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml', - 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib' - - ] - /* - ** Set 4: special methods - ** http://python.org/doc/current/ref/specialnames.html - */ - ,'special' : [ - // Basic customization: http://python.org/doc/current/ref/customization.html - '__new__', '__init__', '__del__', '__repr__', '__str__', - '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__', - '__hash__', '__nonzero__', '__unicode__', '__dict__', - // Attribute access: http://python.org/doc/current/ref/attribute-access.html - '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__', - '__delete__', '__slots__', - // Class creation, callable objects - '__metaclass__', '__call__', - // Container types: http://python.org/doc/current/ref/sequence-types.html - '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__', - '__getslice__', '__setslice__', '__delslice__', - // Numeric types: http://python.org/doc/current/ref/numeric-types.html - '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__', - '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__', - '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__', - '__long__','__lshift__', - '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__', - '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__', - '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__', - '__sub__','__xor__' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ',' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #660066;' - ,'KEYWORDS' : { - 'reserved' : 'color: #0000FF;' - ,'builtins' : 'color: #009900;' - ,'stdlib' : 'color: #009900;' - ,'special': 'color: #006666;' - } - ,'OPERATORS' : 'color: #993300;' - ,'DELIMITERS' : 'color: #993300;' - - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/robotstxt.js b/plugins/LocalFilesEditor/editarea/reg_syntax/robotstxt.js deleted file mode 100644 index 9b141f0a2..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/robotstxt.js +++ /dev/null @@ -1,25 +0,0 @@ -editAreaLoader.load_syntax["robotstxt"] = { - 'DISPLAY_NAME' : 'Robots txt', - 'COMMENT_SINGLE' : {1 : '#'}, - 'COMMENT_MULTI' : {}, - 'QUOTEMARKS' : [], - 'KEYWORD_CASE_SENSITIVE' : false, - 'KEYWORDS' : { - 'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'], - 'values' : ['*'], - 'specials' : ['*'] - }, - 'OPERATORS' :[':'], - 'DELIMITERS' :[], - 'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;', - 'QUOTESMARKS': 'color: #6381F8;', - 'KEYWORDS' : { - 'attributes' : 'color: #48BDDF;', - 'values' : 'color: #2B60FF;', - 'specials' : 'color: #FF0000;' - }, - 'OPERATORS' : 'color: #FF00FF;', - 'DELIMITERS' : 'color: #60CA00;' - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/ruby.js b/plugins/LocalFilesEditor/editarea/reg_syntax/ruby.js deleted file mode 100644 index bca014077..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/ruby.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Ruby syntax v 1.0 - * - * v1.0 by Patrice De Saint Steban (2007/01/03) - * -**/ -editAreaLoader.load_syntax["ruby"] = { - 'DISPLAY_NAME' : 'Ruby' - ,'COMMENT_SINGLE' : {1 : '#'} - ,'COMMENT_MULTI' : {} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : true - ,'KEYWORDS' : { - 'reserved' : [ - 'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else', - 'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if', - 'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry', - 'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ',' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - 'constants' : { - 'search' : '()([A-Z]\\w*)()' - ,'class' : 'constants' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - ,'variables' : { - 'search' : '()([\$\@\%]+\\w+)()' - ,'class' : 'variables' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - ,'numbers' : { - 'search' : '()(-?[0-9]+)()' - ,'class' : 'numbers' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - ,'symbols' : { - 'search' : '()(:\\w+)()' - ,'class' : 'symbols' - ,'modifiers' : 'g' - ,'execute' : 'before' - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #660066;' - ,'KEYWORDS' : { - 'reserved' : 'font-weight: bold; color: #0000FF;' - } - ,'OPERATORS' : 'color: #993300;' - ,'DELIMITERS' : 'color: #993300;' - ,'REGEXPS' : { - 'variables' : 'color: #E0BD54;' - ,'numbers' : 'color: green;' - ,'constants' : 'color: #00AA00;' - ,'symbols' : 'color: #879EFA;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/sql.js b/plugins/LocalFilesEditor/editarea/reg_syntax/sql.js deleted file mode 100644 index 118ad5b45..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/sql.js +++ /dev/null @@ -1,56 +0,0 @@ -editAreaLoader.load_syntax["sql"] = { - 'DISPLAY_NAME' : 'SQL' - ,'COMMENT_SINGLE' : {1 : '--'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'select', 'SELECT', 'where', 'order', 'by', - 'insert', 'from', 'update', 'grant', 'left join', 'right join', - 'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE' - ] - ,'reserved' : [ - 'null', 'enum', 'int', 'boolean', 'add', 'varchar' - - ] - ,'functions' : [ - 'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR', -'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH', -'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA', -'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND', -'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND', -'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF', -'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK' - ] - } - ,'OPERATORS' :[ - 'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - // highlight all variables (@...) - 'variables' : { - 'search' : '()(\\@\\w+)()' - ,'class' : 'variables' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #879EFA;' - ,'KEYWORDS' : { - 'reserved' : 'color: #48BDDF;' - ,'functions' : 'color: #0040FD;' - ,'statements' : 'color: #60CA00;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #2B60FF;' - ,'REGEXPS' : { - 'variables' : 'color: #E0BD54;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/tsql.js b/plugins/LocalFilesEditor/editarea/reg_syntax/tsql.js deleted file mode 100644 index 868567db9..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/tsql.js +++ /dev/null @@ -1,88 +0,0 @@ -editAreaLoader.load_syntax["tsql"] = { - 'DISPLAY_NAME' : 'T-SQL' - ,'COMMENT_SINGLE' : {1 : '--'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'" } - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements': [ - 'ADD', 'EXCEPT', 'PERCENT', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION', - 'PRIMARY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC', - 'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC', 'BACKUP', 'FOR', 'RAISERROR', - 'BEGIN', 'FOREIGN', 'READ', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE', - 'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY', - 'FUNCTION', 'RESTORE', 'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN', - 'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE', 'HOLDLOCK', 'ROLLBACK', - 'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE', - 'IDENTITYCOL', 'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'SCHEMA', 'COMPUTE', 'INDEX', - 'SELECT', 'CONSTRAINT', 'CONTAINS', 'INSERT', 'SET', - 'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'SOME', - 'CREATE', 'STATISTICS', 'KEY', 'CURRENT', 'KILL', 'TABLE', - 'CURRENT_DATE', 'TEXTSIZE', 'CURRENT_TIME', 'THEN', 'LINENO', - 'TO', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN', 'DATABASE', 'NOCHECK', - 'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'TRUNCATE', - 'DECLARE', 'TSEQUAL', 'DEFAULT', 'UNION', 'DELETE', 'OF', 'UNIQUE', - 'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT', 'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN', - 'DISTRIBUTED', 'OPENDATASOURCE', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING', 'DROP', - 'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'WHERE', - 'END', 'ORDER', 'WHILE', 'ERRLVL', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT' - ], - 'functions': [ - 'COALESCE', 'SESSION_USER', 'CONVERT', 'SYSTEM_USER', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'NULLIF', 'USER', - 'AVG', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG', 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP', 'MAX', - '@@DATEFIRST', '@@OPTIONS', '@@DBTS', '@@REMSERVER', '@@LANGID', '@@SERVERNAME', '@@LANGUAGE', '@@SERVICENAME', '@@LOCK_TIMEOUT', - '@@SPID', '@@MAX_CONNECTIONS', '@@TEXTSIZE', '@@MAX_PRECISION', '@@VERSION', '@@NESTLEVEL', - '@@CURSOR_ROWS', 'CURSOR_STATUS', '@@FETCH_STATUS', - 'DATEADD', 'DATEDIFF', 'DATENAME', 'DATEPART', 'DAY', 'GETDATE', 'GETUTCDATE', 'MONTH', 'YEAR', - 'ABS', 'DEGREES', 'RAND', 'ACOS', 'EXP', 'ROUND', 'ASIN', 'FLOOR', 'SIGN', 'ATAN', 'LOG', 'SIN', 'ATN2', 'LOG10', 'SQRT', - 'CEILING', 'PI ', 'SQUARE', 'COS', 'POWER', 'TAN', 'COT', 'RADIANS', - '@@PROCID', 'COL_LENGTH', 'FULLTEXTCATALOGPROPERTY', 'COL_NAME', 'FULLTEXTSERVICEPROPERTY', 'COLUMNPROPERTY', 'INDEX_COL', - 'DATABASEPROPERTY', 'INDEXKEY_PROPERTY', 'DATABASEPROPERTYEX', 'INDEXPROPERTY', 'DB_ID', 'OBJECT_ID', 'DB_NAME', 'OBJECT_NAME', - 'FILE_ID', 'OBJECTPROPERTY', 'OBJECTPROPERTYEX', 'FILE_NAME', 'SQL_VARIANT_PROPERTY', 'FILEGROUP_ID', 'FILEGROUP_NAME', - 'FILEGROUPPROPERTY', 'TYPEPROPERTY', 'FILEPROPERTY', - 'CURRENT_USER', 'SUSER_ID', 'SUSER_SID', 'IS_MEMBER', 'SUSER_SNAME', 'IS_SRVROLEMEMBER', 'PERMISSIONS', 'SYSTEM_USER', - 'SUSER_NAME', 'USER_ID', 'SESSION_USER', 'USER_NAME', 'ASCII', 'SOUNDEX', 'PATINDEX', 'SPACE', 'CHARINDEX', 'QUOTENAME', - 'STR', 'DIFFERENCE', 'REPLACE', 'STUFF', 'REPLICATE', 'SUBSTRING', 'LEN', 'REVERSE', 'UNICODE', 'LOWER', - 'UPPER', 'LTRIM', 'RTRIM', 'APP_NAME', 'CAST', 'CONVERT', 'COALESCE', 'COLLATIONPROPERTY', 'COLUMNS_UPDATED', 'CURRENT_TIMESTAMP', - 'CURRENT_USER', 'DATALENGTH', '@@ERROR', 'FORMATMESSAGE', 'GETANSINULL', 'HOST_ID', 'HOST_NAME', 'IDENT_CURRENT', 'IDENT_INCR', - 'IDENT_SEED', '@@IDENTITY', 'ISDATE', 'ISNULL', 'ISNUMERIC', 'NEWID', 'NULLIF', 'PARSENAME', '@@ROWCOUNT', - 'SCOPE_IDENTITY', 'SERVERPROPERTY', 'SESSIONPROPERTY', 'SESSION_USER', 'STATS_DATE', 'SYSTEM_USER', '@@TRANCOUNT', 'USER_NAME', - '@@CONNECTIONS', '@@PACK_RECEIVED', '@@CPU_BUSY', '@@PACK_SENT', '@@TIMETICKS', '@@IDLE', '@@TOTAL_ERRORS', '@@IO_BUSY', '@@TOTAL_READ', - '@@PACKET_ERRORS', '@@TOTAL_WRITE', 'PATINDEX', 'TEXTVALID', 'TEXTPTR' - ], - 'reserved': [ - 'RIGHT', 'INNER', 'IS', 'JOIN', 'CROSS', 'LEFT', 'NULL', 'OUTER' - ] - } - ,'OPERATORS' :[ - '+', '-', '*', '/', '%', '=', '&' ,'|', '^', '>', '<', '>=', '<=', '<>', '!=', '!<', '!>', 'ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', '~' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - // highlight all variables (@...) - 'variables' : { - 'search' : '()(\\@\\w+)()' - ,'class' : 'variables' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #008000;' - ,'QUOTESMARKS': 'color: #FF0000;' - ,'KEYWORDS' : { - 'reserved' : 'color: #808080;' - ,'functions' : 'color: #FF00FF;' - ,'statements' : 'color: #0000FF;' - } - ,'OPERATORS' : 'color: #808080;' - ,'DELIMITERS' : 'color: #FF8000;' - ,'REGEXPS' : { - 'variables' : 'color: #E0BD54;' - } - } -}; - - diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/vb.js b/plugins/LocalFilesEditor/editarea/reg_syntax/vb.js deleted file mode 100644 index c83130005..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/vb.js +++ /dev/null @@ -1,53 +0,0 @@ -editAreaLoader.load_syntax["vb"] = { - 'DISPLAY_NAME' : 'Visual Basic' - ,'COMMENT_SINGLE' : {1 : "'"} - ,'COMMENT_MULTI' : { } - ,'QUOTEMARKS' : {1: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'if','then','for','each','while','do','loop', - 'else','elseif','select','case','end select', - 'until','next','step','to','in','end if' - ] - ,'keywords' : [ - 'empty','isempty','nothing','null','isnull','true','false', - 'set','call', - 'sub','end sub','function','end function','exit','exit function', - 'dim','Mod','In','private','public','shared','const' - ] - - ,'functions' : [ - 'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime', - 'Hour','IsDate','Minute','Month', - 'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year', - 'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency', - 'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct', - 'Rnd','Sgn','Sin','Sqr','Tan', - 'Array','Filter','IsArray','Join','LBound','Split','UBound', - 'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp', - 'String','StrReverse','UCase', - 'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric', - 'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion', - 'ScriptEngineMinorVersion','SetLocale','TypeName','VarType' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '!', '&' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #99CC00;' - ,'QUOTESMARKS': 'color: #333399;' - ,'KEYWORDS' : { - 'keywords' : 'color: #3366FF;' - ,'functions' : 'color: #0000FF;' - ,'statements' : 'color: #3366FF;' - } - ,'OPERATORS' : 'color: #FF0000;' - ,'DELIMITERS' : 'color: #0000FF;' - - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/xml.js b/plugins/LocalFilesEditor/editarea/reg_syntax/xml.js deleted file mode 100644 index 03f6076c7..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/xml.js +++ /dev/null @@ -1,57 +0,0 @@ -/* -* last update: 2006-08-24 -*/ - -editAreaLoader.load_syntax["xml"] = { - 'DISPLAY_NAME' : 'XML' - ,'COMMENT_SINGLE' : {} - ,'COMMENT_MULTI' : {''} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - } - ,'OPERATORS' :[ - ] - ,'DELIMITERS' :[ - ] - ,'REGEXPS' : { - 'xml' : { - 'search' : '()(<\\?[^>]*?\\?>)()' - ,'class' : 'xml' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - ,'cdatas' : { - 'search' : '()()()' - ,'class' : 'cdata' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - ,'tags' : { - 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)' - ,'class' : 'tags' - ,'modifiers' : 'gi' - ,'execute' : 'before' // before or after - } - ,'attributes' : { - 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)' - ,'class' : 'attributes' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - } - ,'OPERATORS' : 'color: #E775F0;' - ,'DELIMITERS' : '' - ,'REGEXPS' : { - 'attributes': 'color: #B1AC41;' - ,'tags': 'color: #E62253;' - ,'xml': 'color: #8DCFB5;' - ,'cdata': 'color: #50B020;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/regexp.js b/plugins/LocalFilesEditor/editarea/regexp.js deleted file mode 100644 index 907063a6f..000000000 --- a/plugins/LocalFilesEditor/editarea/regexp.js +++ /dev/null @@ -1,139 +0,0 @@ - /*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){ - new_class="quotes"; - if(v6 && v6 != undefined && v6!="") - new_class="comments"; - return "µ__"+ new_class +"__µ"+v0+"µ_END_µ"; - - };*/ - -/* EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){ - res=""+v2; - alert("v2: "+v2+" v3: "+v3); - tab=v3.split("="); - attributes=""; - if(tab.length>1){ - attributes=""+tab[0]+"="; - for(i=1; i"; - attributes+=""+tab[i].substr(cut)+"="; - } - attributes+=""+tab[tab.length-1]+""; - } - res+=attributes+v5+""; - return res; - };*/ - - // determine if the selected text if a comment or a quoted text - EditArea.prototype.comment_or_quote= function(){ - var new_class="", close_tag="", sy, arg, i; - sy = parent.editAreaLoader.syntax[editArea.current_code_lang]; - arg = EditArea.prototype.comment_or_quote.arguments[0]; - - for( i in sy["quotes"] ){ - if(arg.indexOf(i)==0){ - new_class="quotesmarks"; - close_tag=sy["quotes"][i]; - } - } - if(new_class.length==0) - { - for(var i in sy["comments"]){ - if( arg.indexOf(i)==0 ){ - new_class="comments"; - close_tag=sy["comments"][i]; - } - } - } - // for single line comment the \n must not be included in the span tags - if(close_tag=="\n"){ - return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1"); - }else{ - // the closing tag must be set only if the comment or quotes is closed - reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m"); - if( arg.search(reg)!=-1 ) - return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ"; - else - return "µ__"+ new_class +"__µ"+ arg; - } - }; - -/* - // apply special tags arround text to highlight - EditArea.prototype.custom_highlight= function(){ - res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ"; - if(EditArea.prototype.custom_highlight.arguments.length>5) - res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ]; - return res; - }; - */ - - // return identication that allow to know if revalidating only the text line won't make the syntax go mad - EditArea.prototype.get_syntax_trace= function(text){ - if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"]) - return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3"); - }; - - - EditArea.prototype.colorize_text= function(text){ - //text="
"; - /* - if(this.isOpera){ - // opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre - text= this.replace_tab(text); - }*/ - - text= " "+text; // for easier regExp - - /*if(this.do_html_tags) - text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/ - if(this.settings["syntax"].length>0) - text= this.apply_syntax(text, this.settings["syntax"]); - - // remove the first space added - return text.substr(1).replace(/&/g,"&").replace(//g,">").replace(/µ_END_µ/g,"").replace(/µ__([a-zA-Z0-9]+)__µ/g,""); - }; - - EditArea.prototype.apply_syntax= function(text, lang){ - var sy; - this.current_code_lang=lang; - - if(!parent.editAreaLoader.syntax[lang]) - return text; - - sy = parent.editAreaLoader.syntax[lang]; - if(sy["custom_regexp"]['before']){ - for( var i in sy["custom_regexp"]['before']){ - var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3"; - text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert); - } - } - - if(sy["comment_or_quote_reg_exp"]){ - //setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500); - text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote); - } - - if(sy["keywords_reg_exp"]){ - for(var i in sy["keywords_reg_exp"]){ - text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ'); - } - } - - if(sy["delimiters_reg_exp"]){ - text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ'); - } - - if(sy["operators_reg_exp"]){ - text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ'); - } - - if(sy["custom_regexp"]['after']){ - for( var i in sy["custom_regexp"]['after']){ - var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3"; - text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert); - } - } - - return text; - }; diff --git a/plugins/LocalFilesEditor/editarea/resize_area.js b/plugins/LocalFilesEditor/editarea/resize_area.js deleted file mode 100644 index 191e8cec1..000000000 --- a/plugins/LocalFilesEditor/editarea/resize_area.js +++ /dev/null @@ -1,73 +0,0 @@ - - EditAreaLoader.prototype.start_resize_area= function(){ - var d=document,a,div,width,height,father; - - d.onmouseup= editAreaLoader.end_resize_area; - d.onmousemove= editAreaLoader.resize_area; - editAreaLoader.toggle(editAreaLoader.resize["id"]); - - a = editAreas[editAreaLoader.resize["id"]]["textarea"]; - div = d.getElementById("edit_area_resize"); - if(!div){ - div= d.createElement("div"); - div.id="edit_area_resize"; - div.style.border="dashed #888888 1px"; - } - width = a.offsetWidth -2; - height = a.offsetHeight -2; - - div.style.display = "block"; - div.style.width = width+"px"; - div.style.height = height+"px"; - father= a.parentNode; - father.insertBefore(div, a); - - a.style.display="none"; - - editAreaLoader.resize["start_top"]= calculeOffsetTop(div); - editAreaLoader.resize["start_left"]= calculeOffsetLeft(div); - }; - - EditAreaLoader.prototype.end_resize_area= function(e){ - var d=document,div,a,width,height; - - d.onmouseup=""; - d.onmousemove=""; - - div = d.getElementById("edit_area_resize"); - a= editAreas[editAreaLoader.resize["id"]]["textarea"]; - width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4); - height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4); - if(editAreaLoader.isIE==6){ - width-=2; - height-=2; - } - a.style.width = width+"px"; - a.style.height = height+"px"; - div.style.display = "none"; - a.style.display = "inline"; - a.selectionStart = editAreaLoader.resize["selectionStart"]; - a.selectionEnd = editAreaLoader.resize["selectionEnd"]; - editAreaLoader.toggle(editAreaLoader.resize["id"]); - - return false; - }; - - EditAreaLoader.prototype.resize_area= function(e){ - var allow,newHeight,newWidth; - allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"]; - if(allow=="both" || allow=="y") - { - newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]); - document.getElementById("edit_area_resize").style.height= newHeight+"px"; - } - if(allow=="both" || allow=="x") - { - newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]); - document.getElementById("edit_area_resize").style.width= newWidth+"px"; - } - - return false; - }; - - editAreaLoader.waiting_loading["resize_area.js"]= "loaded"; diff --git a/plugins/LocalFilesEditor/editarea/search_replace.js b/plugins/LocalFilesEditor/editarea/search_replace.js deleted file mode 100644 index bd266b35a..000000000 --- a/plugins/LocalFilesEditor/editarea/search_replace.js +++ /dev/null @@ -1,174 +0,0 @@ - EditArea.prototype.show_search = function(){ - if(_$("area_search_replace").style.visibility=="visible"){ - this.hidden_search(); - }else{ - this.open_inline_popup("area_search_replace"); - var text= this.area_get_selection(); - var search= text.split("\n")[0]; - _$("area_search").value= search; - _$("area_search").focus(); - } - }; - - EditArea.prototype.hidden_search= function(){ - /*_$("area_search_replace").style.visibility="hidden"; - this.textarea.focus(); - var icon= _$("search"); - setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/ - this.close_inline_popup("area_search_replace"); - }; - - EditArea.prototype.area_search= function(mode){ - - if(!mode) - mode="search"; - _$("area_search_msg").innerHTML=""; - var search=_$("area_search").value; - - this.textarea.focus(); - this.textarea.textareaFocused=true; - - var infos= this.get_selection_infos(); - var start= infos["selectionStart"]; - var pos=-1; - var pos_begin=-1; - var length=search.length; - - if(_$("area_search_replace").style.visibility!="visible"){ - this.show_search(); - return; - } - if(search.length==0){ - _$("area_search_msg").innerHTML=this.get_translation("search_field_empty"); - return; - } - // advance to the next occurence if no text selected - if(mode!="replace" ){ - if(_$("area_search_reg_exp").checked) - start++; - else - start+= search.length; - } - - //search - if(_$("area_search_reg_exp").checked){ - // regexp search - var opt="m"; - if(!_$("area_search_match_case").checked) - opt+="i"; - var reg= new RegExp(search, opt); - pos= infos["full_text"].substr(start).search(reg); - pos_begin= infos["full_text"].search(reg); - if(pos!=-1){ - pos+=start; - length=infos["full_text"].substr(start).match(reg)[0].length; - }else if(pos_begin!=-1){ - length=infos["full_text"].match(reg)[0].length; - } - }else{ - if(_$("area_search_match_case").checked){ - pos= infos["full_text"].indexOf(search, start); - pos_begin= infos["full_text"].indexOf(search); - }else{ - pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start); - pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase()); - } - } - - // interpret result - if(pos==-1 && pos_begin==-1){ - _$("area_search_msg").innerHTML=""+search+" "+this.get_translation("not_found"); - return; - }else if(pos==-1 && pos_begin != -1){ - begin= pos_begin; - _$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin"); - }else - begin= pos; - - //_$("area_search_msg").innerHTML+=""+search+" found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+"."; - if(mode=="replace" && pos==infos["indexOfCursor"]){ - var replace= _$("area_replace").value; - var new_text=""; - if(_$("area_search_reg_exp").checked){ - var opt="m"; - if(!_$("area_search_match_case").checked) - opt+="i"; - var reg= new RegExp(search, opt); - new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace); - }else{ - new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length); - } - this.textarea.value=new_text; - this.area_select(begin, length); - this.area_search(); - }else - this.area_select(begin, length); - }; - - - - - EditArea.prototype.area_replace= function(){ - this.area_search("replace"); - }; - - EditArea.prototype.area_replace_all= function(){ - /* this.area_select(0, 0); - _$("area_search_msg").innerHTML=""; - while(_$("area_search_msg").innerHTML==""){ - this.area_replace(); - }*/ - - var base_text= this.textarea.value; - var search= _$("area_search").value; - var replace= _$("area_replace").value; - if(search.length==0){ - _$("area_search_msg").innerHTML=this.get_translation("search_field_empty"); - return ; - } - - var new_text=""; - var nb_change=0; - if(_$("area_search_reg_exp").checked){ - // regExp - var opt="mg"; - if(!_$("area_search_match_case").checked) - opt+="i"; - var reg= new RegExp(search, opt); - nb_change= infos["full_text"].match(reg).length; - new_text= infos["full_text"].replace(reg, replace); - - }else{ - - if(_$("area_search_match_case").checked){ - var tmp_tab=base_text.split(search); - nb_change= tmp_tab.length -1 ; - new_text= tmp_tab.join(replace); - }else{ - // case insensitive - var lower_value=base_text.toLowerCase(); - var lower_search=search.toLowerCase(); - - var start=0; - var pos= lower_value.indexOf(lower_search); - while(pos!=-1){ - nb_change++; - new_text+= this.textarea.value.substring(start , pos)+replace; - start=pos+ search.length; - pos= lower_value.indexOf(lower_search, pos+1); - } - new_text+= this.textarea.value.substring(start); - } - } - if(new_text==base_text){ - _$("area_search_msg").innerHTML=""+search+" "+this.get_translation("not_found"); - }else{ - this.textarea.value= new_text; - _$("area_search_msg").innerHTML=""+nb_change+" "+this.get_translation("occurrence_replaced"); - // firefox and opera doesn't manage with the focus if it's done directly - //editArea.textarea.focus();editArea.textarea.textareaFocused=true; - setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100); - } - - - }; diff --git a/plugins/LocalFilesEditor/editarea/template.html b/plugins/LocalFilesEditor/editarea/template.html deleted file mode 100644 index 573dfaa3e..000000000 --- a/plugins/LocalFilesEditor/editarea/template.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - EditArea - - - [__CSSRULES__] - [__JSCODE__] - - -
-
[__TOOLBAR__]
-
-
-
-
-
 
-
 
-
-
-
-
-
- - -
-
-
- - - - - - - - -
{$position}: - {$line_abbr} 0, {$char_abbr} 0 - {$total}: - {$line_abbr} 0, {$char_abbr} 0 - - resize -
-
-
-
-
- {$processing} -
-
- -
- - - - - - - - - -
{$search} - {$close_popup}
-
{$replace}{$move_popup}
-
- - -
- {$find_next} - {$replace} - {$replace_all}
-
-
-
-
-
- {$close_popup} -
-

Editarea [__EA_VERSION__]


-

{$shortcuts}:

- {$tab}: {$add_tab}
- {$shift}+{$tab}: {$remove_tab}
- {$ctrl}+f: {$search_command}
- {$ctrl}+r: {$replace_command}
- {$ctrl}+h: {$highlight}
- {$ctrl}+g: {$go_to_line}
- {$ctrl}+z: {$undo}
- {$ctrl}+y: {$redo}
- {$ctrl}+e: {$help}
- {$ctrl}+q, {$esc}: {$close_popup}
- {$accesskey} E: {$toggle}
-
- {$about_notice} -
-
-
- - diff --git a/plugins/LocalFilesEditor/language/ar_SA/plugin.lang.php b/plugins/LocalFilesEditor/language/ar_SA/plugin.lang.php index cc0055e6d..317432abc 100644 --- a/plugins/LocalFilesEditor/language/ar_SA/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/ar_SA/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = 'نجرو التأكيد؟استعادة $lang['locfiledit_bak_loaded1'] = 'تم تحميل التخسة الاحتياطية'; $lang['locfiledit_bak_loaded2'] = 'يجب حفظه ليتم استعادته '; $lang['locfiledit_syntax_error'] = 'خطأ في تركيب الجمل ، لا / يمكن حفظ المف'; -$lang['locfiledit_enable_editarea'] = 'تمكين المحرر'; -$lang['locfiledit_disable_editarea'] = 'تعطيل المحرر'; $lang['locfiledit_new_tpl'] = 'أنشأ ملف جديد'; $lang['locfiledit_new_filename'] = 'أسم الملف'; $lang['locfiledit_model'] = 'نموذج'; @@ -53,4 +51,6 @@ $lang['locfiledit_model_error'] = 'يجب أختيار نموذج'; $lang['locfiledit_empty_filename'] = 'يجب كتابة أسم الملف'; $lang['locfiledit_webmaster_only'] = 'فقط مدير الموقع يمكن استخدام محرر الملفات المحلي'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/cs_CZ/plugin.lang.php b/plugins/LocalFilesEditor/language/cs_CZ/plugin.lang.php index 7e7db36a2..907dad823 100644 --- a/plugins/LocalFilesEditor/language/cs_CZ/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/cs_CZ/plugin.lang.php @@ -41,8 +41,6 @@ $lang['locfiledit_restore_confirm'] = 'Prosím potvrďte?Obnova nebude mít efek $lang['locfiledit_bak_loaded1'] = 'Záložní soubor nahrán.'; $lang['locfiledit_bak_loaded2'] = 'Musíte nejprve soubor uložit aby mohl být obnoven.'; $lang['locfiledit_syntax_error'] = 'Syntax error! Soubor nemůže být uložen.'; -$lang['locfiledit_enable_editarea'] = 'Povol editaci'; -$lang['locfiledit_disable_editarea'] = 'Zakázat editaci'; $lang['locfiledit_new_tpl'] = 'Vytvořit nový soubor'; $lang['locfiledit_new_filename'] = 'Název souboru'; $lang['locfiledit_model'] = 'Model'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Musíte zvolit model.'; $lang['locfiledit_empty_filename'] = 'Musíte vyplnit název souboru.'; $lang['locfiledit_webmaster_only'] = 'Pouze webmaster může vytvářet nebo měnit lokální soubory.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/de_DE/plugin.lang.php b/plugins/LocalFilesEditor/language/de_DE/plugin.lang.php index 3f2780cde..2d9becbaf 100644 --- a/plugins/LocalFilesEditor/language/de_DE/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/de_DE/plugin.lang.php @@ -41,8 +41,6 @@ Wiederherstellung wird nicht wirksam sein bis zum nächsten speichern.'; $lang['locfiledit_bak_loaded1'] = 'Backup-Datei geladen.'; $lang['locfiledit_bak_loaded2'] = 'Sie müssen die Datei speichern um sie wiederherstellen zu können.'; $lang['locfiledit_syntax_error'] = 'Syntax-Fehler! Datei kann nicht gespeichert werden.'; -$lang['locfiledit_enable_editarea'] = 'Aktiviere den Bearbeitungsbereich'; -$lang['locfiledit_disable_editarea'] = 'Deaktiviere den Bearbeitungsbereich'; $lang['locfiledit_new_tpl'] = 'Erstelle eine neue Datei'; $lang['locfiledit_new_filename'] = 'Dateiname'; $lang['locfiledit_model'] = 'Modell'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Sie müssen ein Modell wählen.'; $lang['locfiledit_empty_filename'] = 'Sie müssen einen Dateiname eingeben.'; /* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/en_UK/plugin.lang.php b/plugins/LocalFilesEditor/language/en_UK/plugin.lang.php index db3fa9674..668018962 100644 --- a/plugins/LocalFilesEditor/language/en_UK/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/en_UK/plugin.lang.php @@ -41,8 +41,6 @@ Restore won\'t be effective till next save.'; $lang['locfiledit_bak_loaded1'] = 'Backup file loaded.'; $lang['locfiledit_bak_loaded2'] = 'You must save file to restore it.'; $lang['locfiledit_syntax_error'] = 'Syntax error! File can\'t be saved.'; -$lang['locfiledit_enable_editarea'] = 'Enable Editarea'; -$lang['locfiledit_disable_editarea'] = 'Disable Editarea'; $lang['locfiledit_new_tpl'] = 'Create new file'; $lang['locfiledit_new_filename'] = 'File name'; $lang['locfiledit_model'] = 'Model'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'You must choose a model.'; $lang['locfiledit_empty_filename'] = 'You must fill file name.'; $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.'; +$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/es_ES/plugin.lang.php b/plugins/LocalFilesEditor/language/es_ES/plugin.lang.php index b8a4d8e2b..e69262708 100644 --- a/plugins/LocalFilesEditor/language/es_ES/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/es_ES/plugin.lang.php @@ -41,8 +41,6 @@ Posteriormente deberá hacer clic en Guardar para restaurarla.'; $lang['locfiledit_bak_loaded1'] = 'Se ha cargado la copia de seguridad'; $lang['locfiledit_bak_loaded2'] = 'Para conservar la la copia de seguridad debe guardar el archivo.'; $lang['locfiledit_syntax_error'] = 'Error de sintaxis. No es posible guardar el archivo.'; -$lang['locfiledit_enable_editarea'] = 'Activar el texto editado'; -$lang['locfiledit_disable_editarea'] = 'Desactivar el área de edición'; $lang['locfiledit_new_tpl'] = 'Crear un nuevo archivo '; $lang['locfiledit_new_filename'] = 'Nombre del archivo '; $lang['locfiledit_model'] = 'Modelo '; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Por favor, seleccione un modelo.'; $lang['locfiledit_empty_filename'] = 'Por favor, indique un nombre de archivo.'; $lang['locfiledit_webmaster_only'] = 'Sólo los administradores pueden crear o modificar fichero locales.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php b/plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php index 72ff4a9a0..24cd9adea 100644 --- a/plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php @@ -41,8 +41,6 @@ Vous devrez ensuite cliquer sur Enregistrer pour le restaurer.'; $lang['locfiledit_bak_loaded1'] = 'Fichier de sauvegarde chargé'; $lang['locfiledit_bak_loaded2'] = 'Vous devez l\'enregistrer pour le sauvegarder.'; $lang['locfiledit_syntax_error'] = 'Erreur de syntaxe! Impossible d\'enregistrer le fichier.'; -$lang['locfiledit_enable_editarea'] = 'Activer Editarea'; -$lang['locfiledit_disable_editarea'] = 'Désactiver Editarea'; $lang['locfiledit_new_tpl'] = 'Créer un nouveau fichier'; $lang['locfiledit_new_filename'] = 'Nom du fichier'; $lang['locfiledit_model'] = 'Modèle'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Veuillez sélectionner un modèle.'; $lang['locfiledit_empty_filename'] = 'Veuillez indiquer un nom de fichier.'; $lang['locfiledit_webmaster_only'] = 'Seuls les webmasters sont autorisés à créer ou modifier les fichiers locaux.'; +$lang['locfiledit_enable_codemirror'] = 'Activer Codemirror'; +$lang['locfiledit_disable_codemirror'] = 'Désactiver Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/he_IL/plugin.lang.php b/plugins/LocalFilesEditor/language/he_IL/plugin.lang.php index 5ee86fc41..e86ebf657 100644 --- a/plugins/LocalFilesEditor/language/he_IL/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/he_IL/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = 'אשר בבקשה? שיחזור קובץ $lang['locfiledit_bak_loaded1'] = 'קובץ גיבוי נטען.'; $lang['locfiledit_bak_loaded2'] = 'אתה חייב לשמור את הקובץ בכדי לשחזר.'; $lang['locfiledit_syntax_error'] = 'שגיאה תחבירית! לא ניתן לשמור את הקובץ.'; -$lang['locfiledit_enable_editarea'] = 'אפשר עריכה'; -$lang['locfiledit_disable_editarea'] = 'בטל עריכה'; $lang['locfiledit_new_tpl'] = 'צור קובץ חדש'; $lang['locfiledit_new_filename'] = 'שם הקובץ'; $lang['locfiledit_model'] = 'דגם'; @@ -54,4 +52,6 @@ $lang['locfiledit_empty_filename'] = 'אתה חייב למלא את שם הקו $lang['locfiledit_webmaster_only'] = 'רק מנהל האתר יכול ליצור או לשנות קבצים מקומיים.'; $lang['locfiledit_filename_error'] = 'אסור להשתמש בתווים מסויימים בשם הקובץ.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/hr_HR/plugin.lang.php b/plugins/LocalFilesEditor/language/hr_HR/plugin.lang.php index 688bb1bf5..ba3ccbdb0 100644 --- a/plugins/LocalFilesEditor/language/hr_HR/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/hr_HR/plugin.lang.php @@ -19,10 +19,7 @@ // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | -// +-----------------------------------------------------------------------+ - - -$lang['locfiledit_onglet_localconf'] = 'Lokalno podešavanje'; +// +-----------------------------------------------------------------------+$lang['locfiledit_onglet_localconf'] = 'Lokalno podešavanje'; $lang['locfiledit_onglet_css'] = 'CSS'; $lang['locfiledit_onglet_tpl'] = 'Predlošci'; $lang['locfiledit_onglet_lang'] = 'Jezici'; @@ -42,8 +39,6 @@ Vracanje kopije nece biti prihvaceno do sljedeceg spremanja.'; $lang['locfiledit_bak_loaded1'] = 'Sigurnosna kopija datoteke ucitana.'; $lang['locfiledit_bak_loaded2'] = 'Morate snimiti datoteku kako bi je vratili u prijašnje stanje.'; $lang['locfiledit_syntax_error'] = 'Greška u sintaksi! Datoteka ne može biti spremljena.'; -$lang['locfiledit_enable_editarea'] = 'Aktiviraj prostor za uredivanje'; -$lang['locfiledit_disable_editarea'] = 'Deaktiviraj prostor za uredivanje'; $lang['locfiledit_new_tpl'] = 'Kreiraj novu datoteku'; $lang['locfiledit_new_filename'] = 'Naziv datoteke'; $lang['locfiledit_model'] = 'Model'; @@ -55,4 +50,6 @@ $lang['locfiledit_model_error'] = 'Morate odabrati model.'; $lang['locfiledit_empty_filename'] = 'Morate popuniti naziv datoteke.'; $lang['locfiledit_webmaster_only'] = 'Samo webmasteri mogu kreirati ili mijenjati lokalne datoteke.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php b/plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php index f6a21643a..8c095501b 100644 --- a/plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php @@ -41,8 +41,6 @@ A változtatás nem vonható vissza.'; $lang['locfiledit_bak_loaded1'] = 'Biztonsági másolat betöltve.'; $lang['locfiledit_bak_loaded2'] = 'Mentett fájl visszaállítása.'; $lang['locfiledit_syntax_error'] = 'Syntax error! A fájl mentése meghiúsult.'; -$lang['locfiledit_enable_editarea'] = 'Szerkesztő megnyitása'; -$lang['locfiledit_disable_editarea'] = 'Szerkesztő bezárása'; $lang['locfiledit_new_tpl'] = 'Új fájl létrehozása'; $lang['locfiledit_new_filename'] = 'Fájl neve'; $lang['locfiledit_model'] = 'Típus'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'A típust ki kell választani.'; $lang['locfiledit_empty_filename'] = 'A fájlnevet ki kell tölteni.'; /* TODO */ $lang['locfiledit_webmaster_only'] = 'Csak a webmesterek hozhatnak létre, vagy módosíthatnak helyi fájlokat.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> diff --git a/plugins/LocalFilesEditor/language/it_IT/plugin.lang.php b/plugins/LocalFilesEditor/language/it_IT/plugin.lang.php index 70cf37c87..fa9eeaa51 100644 --- a/plugins/LocalFilesEditor/language/it_IT/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/it_IT/plugin.lang.php @@ -41,8 +41,6 @@ Dovrete in seguito cliccare sù Salvare per restaurarlo.'; $lang['locfiledit_bak_loaded1'] = 'Copia di backup caricata'; $lang['locfiledit_bak_loaded2'] = 'Dovete registrarlo per salvarlo.'; $lang['locfiledit_syntax_error'] = 'Errore di sintassi! Impossible salvare il file.'; -$lang['locfiledit_enable_editarea'] = 'Attivare Editarea'; -$lang['locfiledit_disable_editarea'] = 'Disattivare Editarea'; $lang['locfiledit_new_tpl'] = 'Creare un nuovo file'; $lang['locfiledit_new_filename'] = 'Nom file'; $lang['locfiledit_model'] = 'Modello'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Selezionare un modello.'; $lang['locfiledit_empty_filename'] = 'Indicate un nome di file.'; $lang['locfiledit_webmaster_only'] = 'Solo i webmasters sono autorizzati a creare o modificare i file locali.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/ja_JP/plugin.lang.php b/plugins/LocalFilesEditor/language/ja_JP/plugin.lang.php index f85cc4002..004c0f5ae 100644 --- a/plugins/LocalFilesEditor/language/ja_JP/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/ja_JP/plugin.lang.php @@ -41,8 +41,6 @@ $lang['locfiledit_restore_confirm'] = '確認して下さい? $lang['locfiledit_bak_loaded1'] = 'バックアップファイルは起動しました。'; $lang['locfiledit_bak_loaded2'] = '復元するために、ファイルを保存する必要があります。'; $lang['locfiledit_syntax_error'] = 'エラー! ファイルは保存できません。'; -$lang['locfiledit_enable_editarea'] = 'Enable Editarea'; -$lang['locfiledit_disable_editarea'] = 'Disable Editarea'; $lang['locfiledit_new_tpl'] = '新しいファイルを作成する'; $lang['locfiledit_new_filename'] = 'ファイル名'; $lang['locfiledit_model'] = 'モデル'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'モデルを選択する必要があります $lang['locfiledit_empty_filename'] = 'ファイル名を記入する必要があります。'; $lang['locfiledit_webmaster_only'] = 'ローカルファイルはウェブマスターのみ作成するか、変更できます。'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/ka_GE/plugin.lang.php b/plugins/LocalFilesEditor/language/ka_GE/plugin.lang.php index 60b3fbb9e..4e4085f72 100644 --- a/plugins/LocalFilesEditor/language/ka_GE/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/ka_GE/plugin.lang.php @@ -41,8 +41,6 @@ $lang['locfiledit_restore_confirm'] = 'გთხოვთ დაადასტ $lang['locfiledit_bak_loaded1'] = 'სარეზერვო ფაილის ჩატვირთვა.'; $lang['locfiledit_bak_loaded2'] = 'თქვენ უნდა შეინახოთ ფაილი, რომ აღდგინოთ.'; $lang['locfiledit_syntax_error'] = 'სინტაქსური შეცდომა! ფაილი ვერ შეინახება.'; -$lang['locfiledit_enable_editarea'] = 'ჩავრთოთ გასასწორებელი ველი'; -$lang['locfiledit_disable_editarea'] = 'გამოვრთოთ გასასწორებელი ველი'; $lang['locfiledit_new_tpl'] = 'შევქმნათ ახალი ფაილი'; $lang['locfiledit_new_filename'] = 'ფაილის სახელი'; $lang['locfiledit_model'] = 'მოდელი'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'თქვენ უნდა აირჩი $lang['locfiledit_empty_filename'] = 'თქვენ უნდა შეავსოთ ფაილის სახელი.'; $lang['locfiledit_webmaster_only'] = 'მხოლოდ ვებოსტატებს შეუძლიათ შექმნან ან გადააკეთონ ლოკალური ფაილები.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/lv_LV/plugin.lang.php b/plugins/LocalFilesEditor/language/lv_LV/plugin.lang.php index fa5ca909e..561be9865 100644 --- a/plugins/LocalFilesEditor/language/lv_LV/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/lv_LV/plugin.lang.php @@ -41,8 +41,6 @@ Atjaunošana nebus iespejama lidz nakamai saglabašanai.'; $lang['locfiledit_bak_loaded1'] = 'Rezerves kopija ieladeta.'; $lang['locfiledit_bak_loaded2'] = 'Jums jasaglaba fails lai to atjaunotu.'; $lang['locfiledit_syntax_error'] = 'Sintakses kluda! Failu nav iespejams saglabat.'; -$lang['locfiledit_enable_editarea'] = 'Iespejot Redigešanas apgabalu'; -$lang['locfiledit_disable_editarea'] = 'Atspejot Redigešanas apgabalu'; $lang['locfiledit_new_tpl'] = 'Izveidot jaunu failu'; $lang['locfiledit_new_filename'] = 'Faila nosaukums'; $lang['locfiledit_model'] = 'Modelis'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Jums jaizvelas modelis.'; $lang['locfiledit_empty_filename'] = 'Jums jaieraksta faila nosaukums.'; $lang['locfiledit_webmaster_only'] = 'Tikai webmasters var izveidot un modificet lokalos failus.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/nl_NL/plugin.lang.php b/plugins/LocalFilesEditor/language/nl_NL/plugin.lang.php index 658355f9c..e0c226202 100644 --- a/plugins/LocalFilesEditor/language/nl_NL/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/nl_NL/plugin.lang.php @@ -41,8 +41,6 @@ Restore wordt pas effectief bij de volgende keer opslaan.'; $lang['locfiledit_bak_loaded1'] = 'Backup-bestand geladen.'; $lang['locfiledit_bak_loaded2'] = 'U moet het bestand opslaan om te kunnen restoren.'; $lang['locfiledit_syntax_error'] = 'Syntax-fout! Bestand kan niet opgeslagen worden.'; -$lang['locfiledit_enable_editarea'] = 'Maak Edit-gebied atief'; -$lang['locfiledit_disable_editarea'] = 'Deactiveer Edit-gebied'; $lang['locfiledit_new_tpl'] = 'Maak nieuw bestand aan'; $lang['locfiledit_new_filename'] = 'Bestandsnaam'; $lang['locfiledit_model'] = 'Model'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'U moet een model kiezen.'; $lang['locfiledit_empty_filename'] = 'U moet een bestandsnaam opgeven.'; $lang['locfiledit_webmaster_only'] = 'Alleen webbeheerders kunnen lokale bestanden aanmaken of wijzigen.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/no_NO/plugin.lang.php b/plugins/LocalFilesEditor/language/no_NO/plugin.lang.php index a5f36a7c5..0705b40ea 100644 --- a/plugins/LocalFilesEditor/language/no_NO/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/no_NO/plugin.lang.php @@ -19,10 +19,7 @@ // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | -// +-----------------------------------------------------------------------+ - - -$lang['locfiledit_onglet_localconf'] = 'Lokal konfigurasjon'; +// +-----------------------------------------------------------------------+$lang['locfiledit_onglet_localconf'] = 'Lokal konfigurasjon'; $lang['locfiledit_onglet_css'] = 'CSS'; $lang['locfiledit_onglet_tpl'] = 'Maler (templates)'; $lang['locfiledit_onglet_lang'] = 'Språk'; @@ -41,8 +38,6 @@ $lang['locfiledit_restore_confirm'] = 'Vennligst bekreft? Gjennoppretting vil ik $lang['locfiledit_bak_loaded1'] = 'Sikkerhetskopi lastet.'; $lang['locfiledit_bak_loaded2'] = 'Du må lagre filen for å gjennopprette den.'; $lang['locfiledit_syntax_error'] = 'Syntax feil! Filen kan ikke bli lagret.'; -$lang['locfiledit_enable_editarea'] = 'Aktiver redigeringsområde '; -$lang['locfiledit_disable_editarea'] = 'Deaktiver redigeringsområde'; $lang['locfiledit_new_tpl'] = 'Lag ny fil'; $lang['locfiledit_new_filename'] = 'Fil navn'; $lang['locfiledit_model'] = 'Modusl'; @@ -54,4 +49,6 @@ $lang['locfiledit_model_error'] = 'Du må velge en modell.'; $lang['locfiledit_empty_filename'] = 'Du må fylle inn fil navnet.'; $lang['locfiledit_webmaster_only'] = 'Kun webmaster kan lage eller endre lokale filer.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php b/plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php index fa114c1dd..0e861349a 100644 --- a/plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php @@ -41,8 +41,6 @@ Przywrócenie nie przyniesie efektu do następnego zapisu.'; $lang['locfiledit_bak_loaded1'] = 'Plik kopii zapasowej wczytany.'; $lang['locfiledit_bak_loaded2'] = 'Musisz zapisać plik aby go przywrócić.'; $lang['locfiledit_syntax_error'] = 'Błąd skłądni! Plik nie może zostać zapisany.'; -$lang['locfiledit_enable_editarea'] = 'Włącz Pole Edycyjne'; -$lang['locfiledit_disable_editarea'] = 'Wyłącz Pole Edycyjne'; $lang['locfiledit_new_tpl'] = 'Stwórz nowy plik'; $lang['locfiledit_new_filename'] = 'Nazwa pliku'; $lang['locfiledit_model'] = 'Model'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Musisz wybrać model.'; $lang['locfiledit_empty_filename'] = 'Musisz wpisać nazwę pliku.'; /* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/pt_PT/plugin.lang.php b/plugins/LocalFilesEditor/language/pt_PT/plugin.lang.php index 05bba83ad..c1a2e86b5 100644 --- a/plugins/LocalFilesEditor/language/pt_PT/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/pt_PT/plugin.lang.php @@ -41,8 +41,6 @@ O Restauro não será efectuado até Salvar a próxima vez.'; $lang['locfiledit_bak_loaded1'] = 'Ficheiro de cópia de segurança carregado.'; $lang['locfiledit_bak_loaded2'] = 'Deverá salvar o ficheiro para o restaurar.'; $lang['locfiledit_syntax_error'] = 'Erro de sintaxe! Impossível salvar ficheiro.'; -$lang['locfiledit_enable_editarea'] = 'Activar Área de Edição'; -$lang['locfiledit_disable_editarea'] = 'Desactivar Área de Edição'; $lang['locfiledit_new_tpl'] = 'Criar novo ficheiro'; $lang['locfiledit_new_filename'] = 'Nome do ficheiro'; $lang['locfiledit_model'] = 'Modelo'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Tem que escolher um Modelo.'; $lang['locfiledit_empty_filename'] = 'Tem que preencher o Nome do ficheiro.'; $lang['locfiledit_webmaster_only'] = 'Apenas webmasters podem criar ou modificar ficheiros locais.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/ru_RU/plugin.lang.php b/plugins/LocalFilesEditor/language/ru_RU/plugin.lang.php index 46edd72c9..b18db5b2d 100644 --- a/plugins/LocalFilesEditor/language/ru_RU/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/ru_RU/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = 'Пожалуйста, подтверди $lang['locfiledit_bak_loaded1'] = 'Резервный файл загружен.'; $lang['locfiledit_bak_loaded2'] = 'Вы должны сохранить файл, чтобы восстановить его.'; $lang['locfiledit_syntax_error'] = 'Синтаксическая ошибка! Невозможно сохранить файл.'; -$lang['locfiledit_enable_editarea'] = 'Активировать разметку области редактирования'; -$lang['locfiledit_disable_editarea'] = 'Дезактивировать разметку области редактирования'; $lang['locfiledit_new_tpl'] = 'Создать новый файл'; $lang['locfiledit_new_filename'] = 'Имя файла'; $lang['locfiledit_model'] = 'Модель'; @@ -53,4 +51,6 @@ $lang['locfiledit_model_error'] = 'Выберите модель.'; $lang['locfiledit_empty_filename'] = 'Заполните поле "Имя файла".'; $lang['locfiledit_webmaster_only'] = 'Только вэбмастеры могут создавать или редактировать локальные файлы.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/sk_SK/plugin.lang.php b/plugins/LocalFilesEditor/language/sk_SK/plugin.lang.php index af8a33387..5a65b3289 100644 --- a/plugins/LocalFilesEditor/language/sk_SK/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/sk_SK/plugin.lang.php @@ -41,8 +41,6 @@ Obnova nebude účinná pokiaľ neuložíte.'; $lang['locfiledit_bak_loaded1'] = 'Záložný súbor nahraný.'; $lang['locfiledit_bak_loaded2'] = 'Musíte uložiť súbor na jeho obnovenie.'; $lang['locfiledit_syntax_error'] = 'Syntaktický chyba! Súbor nemôže byť uložený.'; -$lang['locfiledit_enable_editarea'] = 'Povoliť editáciu'; -$lang['locfiledit_disable_editarea'] = 'Zakázať editáciu'; $lang['locfiledit_new_tpl'] = 'Vytvorenie nového súboru'; $lang['locfiledit_new_filename'] = 'Meno súboru'; $lang['locfiledit_model'] = 'Model'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Musíte vybrať model.'; $lang['locfiledit_empty_filename'] = 'Musíte zadať meno súboru.'; $lang['locfiledit_webmaster_only'] = 'Len webmasteri môžu vytvoriť alebo modifikovať lokálne súbory.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/sr_RS/plugin.lang.php b/plugins/LocalFilesEditor/language/sr_RS/plugin.lang.php index c6a5980a5..7639b0ded 100644 --- a/plugins/LocalFilesEditor/language/sr_RS/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/sr_RS/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = 'Молимо Вас да потврд $lang['locfiledit_bak_loaded1'] = 'Резервна копија је учитана.'; $lang['locfiledit_bak_loaded2'] = 'Морате да запамтите датотеку пре обнављања.'; $lang['locfiledit_syntax_error'] = 'Синтаксна грешка! Датотека не може бити снимљена.'; -$lang['locfiledit_enable_editarea'] = 'Омогући област промене'; -$lang['locfiledit_disable_editarea'] = 'Онемогући област промене'; $lang['locfiledit_new_tpl'] = 'Направи нову датотеку'; $lang['locfiledit_new_filename'] = 'Име датотеке'; $lang['locfiledit_model'] = 'Модел'; @@ -53,4 +51,6 @@ $lang['locfiledit_model_error'] = 'Морате изабрати мод $lang['locfiledit_empty_filename'] = 'Морате уписати име датотеке.'; $lang['locfiledit_webmaster_only'] = 'Само уредник интернет страница може да направи или уреди локалне датотеке.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/sv_SE/plugin.lang.php b/plugins/LocalFilesEditor/language/sv_SE/plugin.lang.php index dbe9a2919..f02934639 100644 --- a/plugins/LocalFilesEditor/language/sv_SE/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/sv_SE/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = 'Vänligen bekräfta? Återställning komm $lang['locfiledit_bak_loaded1'] = 'Säkerhetskopia laddad.'; $lang['locfiledit_bak_loaded2'] = 'Du måste spara filen för att återställa den.'; $lang['locfiledit_syntax_error'] = 'Syntax fel! Filen kan inte sparas.'; -$lang['locfiledit_enable_editarea'] = 'Aktivera Skrivfält'; -$lang['locfiledit_disable_editarea'] = 'Avaktivera Skrivfält'; $lang['locfiledit_new_tpl'] = 'Skapa ny fil'; $lang['locfiledit_new_filename'] = 'Fil namn'; $lang['locfiledit_model'] = 'Modell'; @@ -53,4 +51,6 @@ $lang['locfiledit_model_error'] = 'Du måste välja en modell.'; $lang['locfiledit_empty_filename'] = 'Du måste välja ett filnamn.'; $lang['locfiledit_webmaster_only'] = 'Endast webmasters kan skapa eller ändra lokala filer.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/tr_TR/plugin.lang.php b/plugins/LocalFilesEditor/language/tr_TR/plugin.lang.php index 8860d101a..5b5345d4c 100644 --- a/plugins/LocalFilesEditor/language/tr_TR/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/tr_TR/plugin.lang.php @@ -41,8 +41,6 @@ bir sonraki kaydetmeye kadar geri yükleme yapilamayacak.'; $lang['locfiledit_bak_loaded1'] = 'yedekleme dosyasi yüklendi.'; $lang['locfiledit_bak_loaded2'] = 'Geri yükledikten sonra save etmeyi unutmayiniz.'; $lang['locfiledit_syntax_error'] = 'Syntax error! Dosya kayit edilemiyor.'; -$lang['locfiledit_enable_editarea'] = 'Editleme açik'; -$lang['locfiledit_disable_editarea'] = 'Editleme kapali'; $lang['locfiledit_new_tpl'] = 'Yeni Dosya Yarat'; $lang['locfiledit_new_filename'] = 'Dosya Adi'; $lang['locfiledit_model'] = 'Model'; @@ -54,4 +52,6 @@ $lang['locfiledit_model_error'] = 'Model seçmek zorundasin.'; $lang['locfiledit_empty_filename'] = 'Adi doldurmak zorundasin.'; $lang['locfiledit_webmaster_only'] = 'Sadece yöneticiler dosyalari degistirebilir .'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/vi_VN/plugin.lang.php b/plugins/LocalFilesEditor/language/vi_VN/plugin.lang.php index 52e2dba2c..391e42ec6 100644 --- a/plugins/LocalFilesEditor/language/vi_VN/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/vi_VN/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = 'Vui lòng xác nhận? Việc phục hồ $lang['locfiledit_bak_loaded1'] = 'Tệp tin backup đã được nạp.'; $lang['locfiledit_bak_loaded2'] = 'Bạn phải lưu lại tệp tin để phục hồi nó.'; $lang['locfiledit_syntax_error'] = 'Lỗi cú pháp! Tệp tin không thể được lưu.'; -$lang['locfiledit_enable_editarea'] = 'Kích hoạt vùng nhập dữ liệu'; -$lang['locfiledit_disable_editarea'] = 'Tắt vùng nhập dữ liệu'; $lang['locfiledit_new_tpl'] = 'Tạo tệp tin mới'; $lang['locfiledit_new_filename'] = 'Tên tệp tin'; $lang['locfiledit_model'] = 'Mô hình'; @@ -53,4 +51,6 @@ $lang['locfiledit_model_error'] = 'Bạn phải chọn một mô hình.'; $lang['locfiledit_empty_filename'] = 'Bạn phải điền đủ tên tệp tin.'; $lang['locfiledit_webmaster_only'] = 'Chỉ có webmasters mới có thể tạo hoặc biên tập tệp tin trên máy.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/language/zh_CN/plugin.lang.php b/plugins/LocalFilesEditor/language/zh_CN/plugin.lang.php index 9153acb64..da4c54357 100644 --- a/plugins/LocalFilesEditor/language/zh_CN/plugin.lang.php +++ b/plugins/LocalFilesEditor/language/zh_CN/plugin.lang.php @@ -40,8 +40,6 @@ $lang['locfiledit_restore_confirm'] = '请确认? 恢复在下一次保存前将 $lang['locfiledit_bak_loaded1'] = '备份文件已加载.'; $lang['locfiledit_bak_loaded2'] = '您必须保存文件以便将其恢复.'; $lang['locfiledit_syntax_error'] = '语法错误! 文件不能被保存.'; -$lang['locfiledit_enable_editarea'] = '启用编辑区域'; -$lang['locfiledit_disable_editarea'] = '禁用编辑区域'; $lang['locfiledit_new_tpl'] = '创建新文件'; $lang['locfiledit_new_filename'] = '文件名'; $lang['locfiledit_model'] = '模块'; @@ -53,4 +51,6 @@ $lang['locfiledit_model_error'] = '您必须选择一个模块.'; $lang['locfiledit_empty_filename'] = '您必须填写文件名.'; $lang['locfiledit_webmaster_only'] = '只有网站管理员才能创建或者修改本地文件.'; +/*TODO*/$lang['locfiledit_enable_codemirror'] = 'Enable Codemirror'; +/*TODO*/$lang['locfiledit_disable_codemirror'] = 'Disable Codemirror'; ?> \ No newline at end of file diff --git a/plugins/LocalFilesEditor/locfiledit.css b/plugins/LocalFilesEditor/locfiledit.css index 9236a3137..f0981f524 100644 --- a/plugins/LocalFilesEditor/locfiledit.css +++ b/plugins/LocalFilesEditor/locfiledit.css @@ -14,7 +14,8 @@ #LocalFilesEditor TEXTAREA { margin: 0.5em 0; - width: 99.5%; + width: 99%; + height: 500px; float: left; } @@ -22,7 +23,6 @@ width: 100%; float: left; text-align: left; - display: none; } #LocalFilesEditor #hideedit { @@ -32,3 +32,13 @@ #LocalFilesEditor TD { padding: 0.5em; } + +.CodeMirror { + background-color: #DDDDDD; + font-size: 1.3em; + border: 1px solid #999999; + margin: 0.5em 0; + width: 99%; + min-height: 500px; + height: auto; +} diff --git a/plugins/LocalFilesEditor/show_default.php b/plugins/LocalFilesEditor/show_default.php index 4a8e68289..9dc325643 100644 --- a/plugins/LocalFilesEditor/show_default.php +++ b/plugins/LocalFilesEditor/show_default.php @@ -38,14 +38,6 @@ if (isset($_GET['file'])) $template->set_filename('show_default', dirname(__FILE__) . '/show_default.tpl'); - // Editarea - $editarea_options = array( - 'syntax' => 'php', - 'start_highlight' => true, - 'allow_toggle' => false, - 'is_editable' => false, - 'language' => substr($user['language'], 0, 2)); - $file = file_get_contents(PHPWG_ROOT_PATH . $path); $title = str_replace('/', ' / ', $path); @@ -53,8 +45,10 @@ if (isset($_GET['file'])) 'TITLE' => $title, 'DEFAULT_CONTENT' => $file, 'LOCALEDIT_PATH' => LOCALEDIT_PATH, - 'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'on', - 'EDITAREA_OPTIONS' => $editarea_options)); + 'LOAD_CODEMIRROR' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'on', + 'CODEMIRROR_MODE' => 'application/x-httpd-php' + ) + ); $page['body_id'] = 'thePopuphelpPage'; diff --git a/plugins/LocalFilesEditor/show_default.tpl b/plugins/LocalFilesEditor/show_default.tpl index d5acfe438..bf35586d4 100644 --- a/plugins/LocalFilesEditor/show_default.tpl +++ b/plugins/LocalFilesEditor/show_default.tpl @@ -1,43 +1,56 @@ {html_head} - {/html_head} -{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} -{known_script id="editarea" src=$LOCALEDIT_PATH|@cat:"editarea/edit_area_full.js"} - + +{if $LOAD_CODEMIRROR == 'on'} +if (document.getElementById("text") != null) loadCodemirror(); +{/if} +{/footer_script} - - -- cgit v1.2.3