From c2589de4b871c40dab8d78881a1066a99c13a4dc Mon Sep 17 00:00:00 2001 From: luigser Date: Fri, 16 Oct 2015 14:03:29 +0200 Subject: [PATCH] added demo page --- demo.html | 489 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/change_log.txt | 293 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/about.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/compatibility.html | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/configuration.html | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/credits.html | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/customization_language.html | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/customization_plugin.html | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/customization_syntax.html | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/doc_style.css | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/include.html | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/index.html | 41 +++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/installation.html | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/docs/javascript_functions.html | 1 + docs/js/editarea_0_8_2/docs/license.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/autocompletion.js | 491 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/edit_area.css | 530 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/edit_area.js | 527 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/edit_area_compressor.php | 428 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/edit_area_full.gz | Bin 0 -> 29377 bytes docs/js/editarea_0_8_2/edit_area/edit_area_full.js | 38 ++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/edit_area_functions.js | 1202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/edit_area_loader.js | 1081 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/elements_functions.js | 336 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/highlight.js | 407 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/images/autocompletion.gif | Bin 0 -> 359 bytes docs/js/editarea_0_8_2/edit_area/images/close.gif | Bin 0 -> 102 bytes docs/js/editarea_0_8_2/edit_area/images/fullscreen.gif | Bin 0 -> 198 bytes docs/js/editarea_0_8_2/edit_area/images/go_to_line.gif | Bin 0 -> 1053 bytes docs/js/editarea_0_8_2/edit_area/images/help.gif | Bin 0 -> 295 bytes docs/js/editarea_0_8_2/edit_area/images/highlight.gif | Bin 0 -> 256 bytes docs/js/editarea_0_8_2/edit_area/images/load.gif | Bin 0 -> 1041 bytes docs/js/editarea_0_8_2/edit_area/images/move.gif | Bin 0 -> 257 bytes docs/js/editarea_0_8_2/edit_area/images/newdocument.gif | Bin 0 -> 170 bytes docs/js/editarea_0_8_2/edit_area/images/opacity.png | Bin 0 -> 147 bytes docs/js/editarea_0_8_2/edit_area/images/processing.gif | Bin 0 -> 825 bytes docs/js/editarea_0_8_2/edit_area/images/redo.gif | Bin 0 -> 169 bytes docs/js/editarea_0_8_2/edit_area/images/reset_highlight.gif | Bin 0 -> 168 bytes docs/js/editarea_0_8_2/edit_area/images/save.gif | Bin 0 -> 285 bytes docs/js/editarea_0_8_2/edit_area/images/search.gif | Bin 0 -> 191 bytes docs/js/editarea_0_8_2/edit_area/images/smooth_selection.gif | Bin 0 -> 174 bytes docs/js/editarea_0_8_2/edit_area/images/spacer.gif | Bin 0 -> 43 bytes docs/js/editarea_0_8_2/edit_area/images/statusbar_resize.gif | Bin 0 -> 79 bytes docs/js/editarea_0_8_2/edit_area/images/undo.gif | Bin 0 -> 175 bytes docs/js/editarea_0_8_2/edit_area/images/word_wrap.gif | Bin 0 -> 951 bytes docs/js/editarea_0_8_2/edit_area/keyboard.js | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/bg.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/cs.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/de.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/dk.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/en.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/eo.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/es.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/fi.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/fr.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/hr.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/it.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/ja.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/mk.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/nl.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/pl.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/pt.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/ru.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/sk.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/langs/zh.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/license_apache.txt | 7 +++++++ docs/js/editarea_0_8_2/edit_area/license_bsd.txt | 10 ++++++++++ docs/js/editarea_0_8_2/edit_area/license_lgpl.txt | 458 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/manage_area.js | 623 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/charmap.js | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/css/charmap.css | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/images/charmap.gif | Bin 0 -> 245 bytes docs/js/editarea_0_8_2/edit_area/plugins/charmap/jscripts/map.js | 373 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/bg.js | 12 ++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/cs.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/de.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/dk.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/en.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/eo.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/es.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/fr.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/hr.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/it.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/ja.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/mk.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/nl.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/pl.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/pt.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/ru.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/sk.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/zh.js | 6 ++++++ docs/js/editarea_0_8_2/edit_area/plugins/charmap/popup.html | 24 ++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/test/css/test.css | 3 +++ docs/js/editarea_0_8_2/edit_area/plugins/test/images/Thumbs.db | Bin 0 -> 3584 bytes docs/js/editarea_0_8_2/edit_area/plugins/test/images/test.gif | Bin 0 -> 87 bytes docs/js/editarea_0_8_2/edit_area/plugins/test/langs/bg.js | 10 ++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/cs.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/de.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/dk.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/en.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/eo.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/es.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/fr.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/hr.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/it.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/ja.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/mk.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/nl.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/pl.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/pt.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/ru.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/sk.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/langs/zh.js | 4 ++++ docs/js/editarea_0_8_2/edit_area/plugins/test/test.js | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/plugins/test/test2.js | 1 + docs/js/editarea_0_8_2/edit_area/reg_syntax.js | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/basic.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/brainfuck.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/c.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/coldfusion.js | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/cpp.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/css.js | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/html.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/java.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/js.js | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/pas.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/perl.js | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/php.js | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/python.js | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/robotstxt.js | 25 +++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/ruby.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/sql.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/tsql.js | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/vb.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/reg_syntax/xml.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/regexp.js | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/resize_area.js | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/search_replace.js | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/edit_area/template.html | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/exemples/exemple_full.html | 276 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/license_apache.txt | 7 +++++++ docs/js/editarea_0_8_2/license_bsd.txt | 10 ++++++++++ docs/js/editarea_0_8_2/license_lgpl.txt | 458 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/js/editarea_0_8_2/todo.txt | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 144 files changed, 13081 insertions(+), 0 deletions(-) create mode 100644 demo.html create mode 100644 docs/js/editarea_0_8_2/change_log.txt create mode 100644 docs/js/editarea_0_8_2/docs/about.html create mode 100644 docs/js/editarea_0_8_2/docs/compatibility.html create mode 100644 docs/js/editarea_0_8_2/docs/configuration.html create mode 100644 docs/js/editarea_0_8_2/docs/credits.html create mode 100644 docs/js/editarea_0_8_2/docs/customization_language.html create mode 100644 docs/js/editarea_0_8_2/docs/customization_plugin.html create mode 100644 docs/js/editarea_0_8_2/docs/customization_syntax.html create mode 100644 docs/js/editarea_0_8_2/docs/doc_style.css create mode 100644 docs/js/editarea_0_8_2/docs/include.html create mode 100644 docs/js/editarea_0_8_2/docs/index.html create mode 100644 docs/js/editarea_0_8_2/docs/installation.html create mode 100644 docs/js/editarea_0_8_2/docs/javascript_functions.html create mode 100644 docs/js/editarea_0_8_2/docs/license.html create mode 100644 docs/js/editarea_0_8_2/edit_area/autocompletion.js create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area.css create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area.js create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area_compressor.php create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area_full.gz create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area_full.js create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area_functions.js create mode 100644 docs/js/editarea_0_8_2/edit_area/edit_area_loader.js create mode 100644 docs/js/editarea_0_8_2/edit_area/elements_functions.js create mode 100644 docs/js/editarea_0_8_2/edit_area/highlight.js create mode 100644 docs/js/editarea_0_8_2/edit_area/images/autocompletion.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/close.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/fullscreen.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/go_to_line.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/help.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/highlight.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/load.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/move.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/newdocument.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/opacity.png create mode 100644 docs/js/editarea_0_8_2/edit_area/images/processing.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/redo.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/reset_highlight.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/save.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/search.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/smooth_selection.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/spacer.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/statusbar_resize.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/undo.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/images/word_wrap.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/keyboard.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/bg.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/cs.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/de.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/dk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/en.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/eo.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/es.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/fi.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/fr.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/hr.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/it.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/ja.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/mk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/nl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/pl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/pt.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/ru.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/sk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/langs/zh.js create mode 100644 docs/js/editarea_0_8_2/edit_area/license_apache.txt create mode 100644 docs/js/editarea_0_8_2/edit_area/license_bsd.txt create mode 100644 docs/js/editarea_0_8_2/edit_area/license_lgpl.txt create mode 100644 docs/js/editarea_0_8_2/edit_area/manage_area.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/charmap.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/css/charmap.css create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/images/charmap.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/jscripts/map.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/bg.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/cs.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/de.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/dk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/en.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/eo.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/es.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/fr.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/hr.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/it.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/ja.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/mk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/nl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/pl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/pt.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/ru.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/sk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/langs/zh.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/charmap/popup.html create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/css/test.css create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/images/Thumbs.db create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/images/test.gif create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/bg.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/cs.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/de.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/dk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/en.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/eo.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/es.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/fr.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/hr.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/it.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/ja.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/mk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/nl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/pl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/pt.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/ru.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/sk.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/langs/zh.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/test.js create mode 100644 docs/js/editarea_0_8_2/edit_area/plugins/test/test2.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/basic.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/brainfuck.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/c.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/coldfusion.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/cpp.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/css.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/html.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/java.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/js.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/pas.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/perl.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/php.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/python.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/robotstxt.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/ruby.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/sql.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/tsql.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/vb.js create mode 100644 docs/js/editarea_0_8_2/edit_area/reg_syntax/xml.js create mode 100644 docs/js/editarea_0_8_2/edit_area/regexp.js create mode 100644 docs/js/editarea_0_8_2/edit_area/resize_area.js create mode 100644 docs/js/editarea_0_8_2/edit_area/search_replace.js create mode 100644 docs/js/editarea_0_8_2/edit_area/template.html create mode 100644 docs/js/editarea_0_8_2/exemples/exemple_full.html create mode 100644 docs/js/editarea_0_8_2/license_apache.txt create mode 100644 docs/js/editarea_0_8_2/license_bsd.txt create mode 100644 docs/js/editarea_0_8_2/license_lgpl.txt create mode 100644 docs/js/editarea_0_8_2/todo.txt diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..cfc950b --- /dev/null +++ b/demo.html @@ -0,0 +1,489 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/js/editarea_0_8_2/change_log.txt b/docs/js/editarea_0_8_2/change_log.txt new file mode 100644 index 0000000..382fa4a --- /dev/null +++ b/docs/js/editarea_0_8_2/change_log.txt @@ -0,0 +1,293 @@ +**** v 0.8.2 **** +- Change back to remove the speed optimization for highlight process introduced in 0.8.1 that has too much bugs +- Syntax name are no more stored in language files but in syntax files. Thoses display names will be used only if the compressor tools is used, otherwise syntax code is displayed +- Activate word-wrap feature for opera > 9.6 +- Bug fix: Selection wasn't corretcly remembered between file tabs +- Bug fix: [2886499] Page up and page Down action are no more executed if Alt touch is pressed +- Bug fix: [2887118] UTF-8 encoded URLs return wrong base URL +- Bug fix: [2851936] Unresolved reference to isIE in elements_functions.js +- Bug fix: [2886836] get_IE_selection bug when closed... +- bug fix: JavaScript error when switching to fullscreen (https://sourceforge.net/projects/editarea/forums/forum/556921/topic/3388824) +- Bug fix (but not applicable due to change back) : [2854519, 2854642, 2792217, 2834579 ] Desynchronisation occcured with <, > and & characters + +**** v 0.8.1.1 **** +- Fix bug of frequent syntax desynchronisation when the first character of the textarea was highlighted +- In unload now check that parent.editareaLoader still exists before calling it +- Now consider that gecko and webkit based browser are valid browsers (but I won't test them all) + +**** v 0.8.1 **** +- Improved speed of text highlighting process for huge file. Now we try to only insert or delete the changed caracters inside DOM text node instead of refreshing the whole area. (3 time faster in firefox) +- Greatly improved speed of line-height management in word-wrap context +- Add java syntax (thanks to Dawson Goodell) +- Use faster regexp for matching quoted strings +- Bug fix: if a highlighted quote or comment string contains cariage return, editing text on one of the lines was causin a highlight desynchronisation +- Bug fix: text war blur on Safari 3.2 (thanks to spellcoder) +- Bug fix: there had several mistake with non-monospace font (thanks to spellcoder) +- Bug fix: if show_line_colors was disabled and word wrap enable, highlighted text wasn't refreshed if a new line appears +- Bug fix: in multi file edition, closing the last tab was throwing an error in Firefox and let the content of the textarea displayed +- Browser bug detection: when using non-monospace font Firefox will sometime have strange behavior on text-width (the highlighted text-width in the background may change fron textarea one and simply can change after beeing updated); look likes a browser rendering bug + +**** v 0.8 **** +- Word-wrap is now supported (except for opera...). The new init() option is 'word_wrap' to set to 'true' (default is false). A new button appears in the default toolbar (button_code: 'word_wrap' ) +- We can now clearly see the selected text +- Add Internet explorer 8 support (but sadly I must use IE7 emulate mode in iframe due to a bug with tabulation width not beeing resized in IE's textarea) +- Add Safari 4 support +- Add Chrome 2 support +- Better support of Opera 9.6 +- Add Simplified Chinese translation "zh" (thanks to Abentian) +- Add Bulgarian translation "bg" (thanks to Valentin Hristov) +- Rename internal function $() by _$() +- Delete EditArea.add_event() method (duplicate af editAreaLoader.add_event() method) +- Do some code cleanup-up +- Bug fix: highlight optimisation process was not working under IE (don't known how long it remain broken but must be since a long time) +- Bug fix: EditArea.update_size sometimes uses undefined variable (fix this possibility and cleanup events) +- Bug fix: Template.html was not valid XHTML +- Bug fix: The checked attribute of the toogle button was not defined in xhtml syntax +- Bug fix: If the editArea was loaded on a page related to a domain which was itself an iframe comming from another domain a JS error was thrown on load +- Bug fix: When EditArea is used to replace a textarea which has style="visibility:hidden;", switching off EditArea would throw an error under IE + +**** v 0.7.3 **** +- Add Finnish transaltion (thanks to Janne Mäntyharju) +- Add 'cursor_position' init() option for defining where the cursor should be when the editor is show on the first time ('auto' or 'begin'). This was like 'auto' before now this is like 'begin' by default +- better add_style method (faster than old one) thanks to Spellcoder +- Bug fix: fix bug with mootools 1.2 +- Bug fix: if page had no stylesheets when editarea load, it would generate an error + +**** v 0.7.2.3 **** +- it's now released under both LGPL, Apache, BSD license (you can use the one you prefer) +- add support for bonEcho browser + +**** v 0.7.2.2 **** +- Fix bug regression introduced in 0.7.2 that make IE7 not working +- add Esperento translation (thanks to Olivier) +- add Coldfusion syntax (thanks to Max Leynov) + +**** v 0.7.2.1 **** +- fix bug for firefox rendering of highlighted lines that doesn't begin with a tab +- support for browser with grandParadisio agent instead of firefox + +**** v 0.7.2 **** +- add Chrome support +- add show_line_colors init() option for enabling syntax color display and update on the currently edited line (disable the blue bar) (default to false) +- Add Perl syntax definition file (thanks to Christoph Pinkel) +- Bug fix: there allways was an horizontal scrollbar even if the content fit in the area. + +**** v 0.7.1.3 **** +- Fix a bug introduced in Firefox 3.0.1 => the browser is no more able to render properly "pre" element with left padding... +- Add Robots.txt (thanks to Pavle Ggardijan) and T-SQL syntax definition files (thanks to Miladin Joksic) + +**** v 0.7.1.2 **** +- Fix a bug on the full screen mode (regression added on 0.7.1.1) + +**** v 0.7.1.1 **** +- Firefox 3 RC1 compatibility +- Code size reduction: 120Ko => 107Ko for edit_area_full.js + +**** v 0.7.1 **** +- released under both LGPL and Apache license (you can use the one you prefer) +- it's now possible to get a readonly mode: + * new EditAreaLoader.init()'s option: "is_editable": true/false + * Possibility to switch edition mode by using the execCommand function: editAreaLoader.execCommand('editor_id', 'set_editable', !editAreaLoader.execCommand('editor_id', 'is_editable')); +- Added Ruby syntax (thanks to Patrice De Saint Steban) +- Fix a bug where the textarea lose the focus under firefox for Mac +- Minor other bug fixes + +**** v 0.7.0.2 **** +- Fixed a bug with translation files containing non-latin caracters. Translations files must be in UTF-8. +- Added Czech, Macedionian and Russian translations + + +**** v 0.7.0.1 **** +- in multiple file mode, it's now possible to cancel the 'EA_file_close_callback' function. if the callback return false, the edited file won't be closed +- bug fix: if no syntax was defined in the main init() function in multifile mode, the first time the text was not highlighted + + +**** v 0.7 **** +- it's now possible to edit multiple files into one instance of EditArea. This (sponsored by Jupiter) feature comes with: + * new EditAreaLoader.init()'s option: "is_multi_files": true + * new editAreaLoader's functions: editAreaLoader.getCurrentFile(editArea_id), editAreaLoader.getFile(editArea_id, file_id), editAreaLoader.getAllFiles(editArea_id), editAreaLoader.openFile(editArea_id, file_infos), editAreaLoader.closeFile(editArea_id, file_id), editAreaLoader.setFileEditedMode(editArea_id, file_id, edited_mode) + * new callabacks: EA_file_switch_on_callback, EA_file_switch_off_callback, EA_file_close_callback +- look likes Safari 3 is working with EditArea +- add spanish translation (thanks Garito) +- add slovak translation (thanks Gabriel Schwardy) +- add SQL syntax definition file (thanks to Philippe Lewicki) +- the syntax selection plugin has been integrated to editarea core and load only needed files (the plugins was loading all the possible syntax files...). Toolbar button name: "syntax_selection", comma separated available syntax list: "syntax_selection_allow" +- add a 'compression' option in edit_area_compressor.php that allow to set where the code should be compressed or just packed (simple packed mode usefull for debugging) +- the yellow area that indicate the current edited line is now blue +- bug fix: parenthesis matching was not working correctly if there where an "<" between parenthesis + +**** v 0.6.7 **** +- add a new plugin that allow the user to change the syntax definition in use. It adds a select in the toolbar. - plugin name to add to the plugin list: "syntax_selection". - plugin name to add to the toolbar list: "syntax_selection". - possible parameter to add to EditAreaLoader.init(): +"syntax_selection_allow": (String) define a list separated by "," of possible language syntax to use (eg: "php,js,python,html") +- add Croatian translation (HR) (thanks to Ivan Vucica and Davor Cihlar) +- add BASIC, Brainf*ck, C, C++ and Pascal syntax definition files (thanks to Ivan Vucica and Davor Cihlar) +- add Iceweasel as a known working navigator (its a clone of Firefox) +- improved the php syntax by highlighting the variables ($...) +- reactivate gzip compression for IE7 (was desactivate for IE as it sometimes failed). (Let me know if you see that the load fails under IE7) +- pressing "enter" while being in the search box now perform a search. +- add Camino as a supported browser +- bug fix: when clicking between the bottom toolbar and the textarea (when there is only few lines of text), the textarea didn't get the focus +- bug fix: under IE the delete_instance() method was throwing an error +- bug fix: if the textarea to convert in an EditArea was in a frame (or iframe) getting back from fullscreen to normal display was not restoring the correct settings to the frame containing the textarea. +- bug fix (at least I hope): in IE if the textarea to convert in an EditArea was in a frame, resizing the frame was not correctly resizing the editor if it was in fullscreen. +- bug fix: in Opera the selectionned line was not rendered correctly if containing \t caracters (bug introduced in one of the latest version...) +- bug fix: "altgr+f" was openning the searchbox and avoid to write "[" and "]" in croatian keyboards. +- bug fix: in Firefox "ctrl+tab" was inserting a tabulation while switching active tab (window) + +Note: v 0.6.5 and v 0.6.6 have been private release (change log is regrouped in v 0.6.7) + +**** v 0.6.4 **** +- add replace_tab_by_spaces init() option which allow to replace all tabulation caracters typped in the text by a given number of spaces +- add min_width and min_height init() option for the minimum size in pixel for the editor +- add dutch translation files (NL) (thanks to Bart Bosma) +- pressing Shift+Tab when no text is selected now delete the tabulation before the cursor (if a tabulation is present directly behing the cursor) +- improve Python syntax (thanks to Andre Roberge) +- bug fix: the fullpage plugin was not working correctly when the Editor was placed inside several divs that have positioning of there own +- bug fix: one regexp used in edit_area_compressor.php was not compatible with latest PCRE version + +- fix the my_load and my_save functions of the 'exemple_full.html' page + +**** v 0.6.3.1 **** +- regression: restore monospace as default font +- add little improvements to the PHP compressor: allow to win 7 Ko on edit_area_full.js +- add the version number in the about popup +- bug fix: fix a regexp that was not compliant with newer version of PCRE +- bug fix: fix some bug with the fullscreen mode (still not perfect in Opera) +- bug fix: the close button of the help popup was not correctly translated +- bug fix: when deleting an instance of editArea toggle_off was called even if the editArea was not displayed + + +**** v 0.6.3 **** +- allow to use non monospace font using the font_family init option. Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... new default font-familly: 'verdana,monospace' +- add fullscreen option in the toolbar and as an init() option. +- if the based textarea has a width (or height) in '%', EditArea will get the same '%' width (or height), allowing EditArea to be resized in the same time than the window. +- add many callback possibility: submit_callback, EA_load_callback, EA_unload_callback, EA_init_callback, EA_toggle_on_callback, EA_toggle_off_callback, EA_delete_callback (see documentation for more information) +- bug fix: when toggling from textarea to editarea, IE was almost of the time not keeping the selection +- bug fix: the brackets where still highlighted in red when being deleted +- bug fix: brackets where not placed correctly when the line contains html entitites (& " etc....) + + +**** v 0.6.2 **** +WARNING => POSSIBLE BREAK COMPATIBILITY: +- the load_callback now receive the 'id' of the textarea and no more a reference to the textarea. Developpers should use editAreaLoder methods rather than modfying directly the textarea. +- the save_callback now receive the 'id' of the textarea as first argument, and it's content in the second argument. + +- EditArea is now compatible with javascript libraries like "prototype" (1.5) and "mootools" (release 83) +- add two function to EditAreaLoader: hide(id) and show(id), that will allow to completly hide/restore both EditArea and normal textarea (usefull when EditArea is included in tabs). +- it's no more possible to move the search window out of the frame. +- gecko_spellcheck option is now set to false by default. +- add a onchange_callback option (cf doc) +- bug fix: in IE when syntax highlight was on, clicking on the textarea outside the range of the text, the click wasn't taking into account. +- bug fix: references to the orginal textarea could be lost while using EditArea. +- bug fix: using insertTags, getSelectionRange when editArea was not focused, IE failed +- bug fix: main script could fail to load additionnal files in certain specific cases + +**** v 0.6.1 **** +- compatiblity with Firefox 2 checked (was already compatible before). +- compatiblity with IE7 checked (was already compatible before). +- added possibility to call the editAreaLoader.init() function at any moment (no more limited to window load). Allow to replace an EditArea instance by a new one with other options. +- added new gecko_spellcheck option, this enables you to disable/enable the FF 2.0 spellchecker. +- added editAreaLoader.delete_instance(id) to allow to delete an EditArea instance +- Fix a bug where "Ctrl+G" wasn't openning anymore the go to line prompt box. + + +**** v 0.6.0.1 **** +- add italian translation (thanks to Luciano Vernaschi) +- add polish translation (thanks to Piotr Furman) +- improve deutsh translation (thanks to Felix Riesterer) +- add a little style improvement for buttons in search popup. they can't be splited in two line anymore +- change color for tags in html and xml syntax due to visibility problems + + +**** v 0.6 **** +- add plugins possibilies +- add editAreaLoader.insertTags function to allow easy tags insertion. +- improve undo & redo functionnality +- improve php compression: "edit_area_full.js" is 9 Ko smaller +- improve syntax highlight regexp for quotted string. \\" or \\' (or \\\\", etc...) will now effectively close quotted string +- add scrollbars to the popups when the popup's height is smaller than the editor's height +- add japanese translation file (thanks to ISHITOYA Kentaro) +- add possibility to add line-break in toolbar ("*") +- disable gzip compression for IE (see: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496) +- bug fix: when submitting form while editarea toggled off, the post value was equals to the old content of editarea and not the visible textarea +- bug fix: under IE the editor was scrolling when pressing enter +- bug fix: when insterting text on first line there was an highlight desynchronization + + + +**** v 0.5.3 **** +WARNING => POSSIBLE BREAK COMPATIBILITY: +- correct a spelling error: "toogle" become "toggle" in the whole code. This can perturb the initialization with the "allow_toggle" init parameters + +- add a case sensitive option in syntax definition files +- improve html syntax definition file +- add xml syntax definition file +- add vb syntax definition file (thanks to Martin Gottlieb) +- add some function that will allow dynamic EditArea content management, taking into account if the editor is displayed or toggled off (editAreaLodaer.getValue(), editAreaLoader.setValue(), editAreaLoader.getSelectedText(), editAreaLoader.setSelectedText(), editAreaLoader.getSelectionRange and editAreaLoader.setSelectionRange()). See "javascript functions" documentation for more informations +- add a generic function (editaAreaLoader.execCommand) to allow to access EditArea's functions and datas +- add portuguese translation file (thanks to Leonardo Sapucaia) +- add compatibility to IE7 RC1 + + +**** v 0.5.2 **** +- Opera improvement: text indentation is now working, and "go to line" is now working as in other browsers +- Bug fix: It was still possible to select text in search popup +- Bug fix: the "go to line" popup wasn't displaying anymore +- There was still some hard codded word in the search field => added them to translation files +- Bug fix: when multiple languages were used in the same page, there could have translation exchange between the different editors + + +**** v 0.5.1 **** +- Bug fix: the highlighted bracket was displayed on line 1 when it should be in line 2 +- Bug fix: the highlighted bracket were bad displayed in IE +- Bug fix: their was some error in the optimisation process of the highlight mode +- Bug fix: their was a bug when moving the search popup on IE + +**** v 0.5 **** +- Now released under LGPL +- Rewrite nearly from scratch +- Added Danish translation file (thanks to Peter Klein) +- Add python syntax + + +WARNING => BREAK COMPATIBILITY: +- the whole loading process (javascript include and init function call) is changed (but it's similar to the old version) +- the languages translation files are not stored in the same variable + + +IMPROVEMENTS: +- The whole code is more stable +- Allow several instance on the same page +- Faster to load +- The highlight process is more stable and there is nearly no more to use the "re sync" button +- Add support of Opera 9 (even if its still not perfect) +- Add the possibility to load a new compressed script of only 20Ko for the whole core script even if PHP is not installed +- The textarea can be toggled to an EditArea on window load or later +- The EditArea is loaded in a iframe => there is no more interaction with user css +- Support the reset action of a form +- Add support for "page up" & "page down" button +- There is now a waiting screen when toggling on the highlight syntax (but it can't be an animated one, even gif are not animated due to CPU load) +- All supported browsers can now change font-size + +BUG FIXES: +- Sometimes while using the "toggle editor" button to turn of the editor, the standard textarea was expanded to the full size of the textarea content. +- When resizing the area the selection was lost +- Allow translation for some forgotten hard-coded word (the "move" button for search popup, and "font size", and keys word in help panel). +- It was possible to "drag" the buttons from the Search/Replace popup into the content of the textarea. +- On first display (when the files are not in cache) or with xhtml doctype there is a display bug (the content of the textarea exceed of 4px) +- when the cursor was at the beginning of the 1st line of the textarea, the caracter position was set to 0 instead of 1 + + + +***v 0.4**** +- Increases syntax highlight proccess speed by 5 => allow a better live editing mode with syntax highlight. +- Now syntax highlight has a real language syntax. Text is parsing with rules depending of the language definition file. (limitation: there is only one language on the same time > doesn't allow to parse html and php on the same page). +- Syntax highlight can be easily extended with new code languages (there is currently: php, css, js, html). +- Add german language file (thanks to Olaf Brambrink). +- Fix some little bugs. + + + + +***v0.33*** +- First release. diff --git a/docs/js/editarea_0_8_2/docs/about.html b/docs/js/editarea_0_8_2/docs/about.html new file mode 100644 index 0000000..816c364 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/about.html @@ -0,0 +1,49 @@ + + + + + EditArea documentation + + + + +
+

About

+
+
+

General information

+

EditArea is a free javascript editor for source code. It allow to write + well formated source code. That's no way a WYSIWYG editor. +

+

+ EditArea is developed by Christophe Dolivet + and is currently released + under the "LGPL", "Apache" and "BSD" licenses (use the one you want), read the licenses agreement for details. +

+

Features

+ + +
+ + + diff --git a/docs/js/editarea_0_8_2/docs/compatibility.html b/docs/js/editarea_0_8_2/docs/compatibility.html new file mode 100644 index 0000000..5b8e1cc --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/compatibility.html @@ -0,0 +1,90 @@ + + + + + EditArea documentation + + + + +
+

Compatiblity Chart

+
+
+

Browser support

+

EditArea uses advanced JavaScript and tries to be as smart as possible when it comes to + different browsers. But as every browser (and every version of thoses browser) manage + css and javascript implementation with some little change, it will probably be bad + displayed on other browser. + The table was reset to only show the browsers I take care of. +

+ +

Since I have no mac and currently have no computer under linux, I can't testing multi-plateform browsers. + Let me know if you constat that such browsers are working. +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Windows XPLinuxMacOS X
MSIE 6 & 7 & 8OK  
Firefox 1.5 & 2 & 3 & 3.5OKOKOK
Safari 3.0 & 3.1 & 4OK OK
Chrome 1 & 2 & 3OK??????
Opera 9 & 9.6 & 10.1OKOKOK
Camino 1.2  OK
+

+

+ (1) - Partialy working
+ (2) - Buggy browser version +

+
+ Notices: + +
+ + + diff --git a/docs/js/editarea_0_8_2/docs/configuration.html b/docs/js/editarea_0_8_2/docs/configuration.html new file mode 100644 index 0000000..fd61617 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/configuration.html @@ -0,0 +1,224 @@ + + + + + EditArea documentation + + + + +
+

Configuration reference

+
+
+

This document is the index/reference page for all available core configuration + options in EditArea.

+
+ +

Configuration options

+

All configuration options below is to be placed within the init JavaScript call.
+

+
+ +

Initialization of EditArea

+

In order to initialize EditArea the following code must be placed within HEAD element + of a document. The following example is configurated to convert the TEXTAREA element + which has "textarea_1" as id into editor when the page loads. The "id" + option is the only obligatory option. +

+<html>
+<head>
+<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_full.js"></script>
+<script language="javascript" type="text/javascript">
+editAreaLoader.init({
+	id : "textarea_1"		// textarea id
+	,syntax: "css"			// syntax to be uses for highgliting
+	,start_highlight: true		// to display with highlight mode on start-up
+});
+</script>
+</head>
+
+

+

See the include document to learn more about the way to use the best script include. +

+

If you want to convert several textarea on your webpage, just call several time the init function with a different id parameter.

+ +
+ + + diff --git a/docs/js/editarea_0_8_2/docs/credits.html b/docs/js/editarea_0_8_2/docs/credits.html new file mode 100644 index 0000000..a95c4b4 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/credits.html @@ -0,0 +1,76 @@ + + + + + EditArea documentation + + + + +
+

Credits

+
+
+

Special thanks

+

+ I would like to make a special thanks to TinyMCE + developpers. I have taken some of their WYSIWYG editor functions + (managing the toolbar buttons), + and it give me inspiration for some point (gzip compression, translation, documentation) + of my project. +

+

Contributors

+

These are the people that have contributed in some way to the EditArea project. + If you feel we are missing someone please inform me right away and I will correct this + in future versions of EditArea. +

+ +
+ + + diff --git a/docs/js/editarea_0_8_2/docs/customization_language.html b/docs/js/editarea_0_8_2/docs/customization_language.html new file mode 100644 index 0000000..62aa9c5 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/customization_language.html @@ -0,0 +1,65 @@ + + + + + EditArea documentation + + + + +
+

Customization - Creating a language translation

+
+
+

Making language file

+ +

Language packs are simply JavaScript name/value arrays placed in the ".js" + files in the "lang" directory. Notice there are two kinds of language packs.

+ +

+ Remember, the last translation line should not have a , character at the end. +

+ +

Files to edit

+ +

+ When translating EditArea, these are the files that currently needs to be translated: +

+

+ edit_area/langs/en.js
+ edit_area/plugins/<plugin_name>/langs/en.js
+

+ +

Contributing your language pack

+

+ Go to the sourceforge patch page + and upload a zip containing all the language files in the correct directory structure.

+ + Please translate all the plugins, even if you aren't using them.
+

+
+ + + diff --git a/docs/js/editarea_0_8_2/docs/customization_plugin.html b/docs/js/editarea_0_8_2/docs/customization_plugin.html new file mode 100644 index 0000000..0fceede --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/customization_plugin.html @@ -0,0 +1,175 @@ + + + + + EditArea documentation + + + + +
+

Customization - Creating a plugin

+
+
+

Creating your own plugins

+

+ Creating you own plugins for EditArea is fairly easy if you know the basics of HTML, CSS and Javascript. + The most easy way is to copy the "test" directory and work from there. The "test" + directory is a tutorial plugin that shows how to create a plugin. After you copy the template you need to + change the red sections marked below to the name of your plugin this is needed so that plugins don't + overlap in other words it gives the plugin a unique name. Notice that when you write a new plugin, + you have to end each javascript instructions by ";", even if it's optionnal in javascript. +

+ +

If you want you may add plugin specific options/settings but remember to namespace them in the + following format "<your plugin>_<option>" for example "yourplugin_someoption".

+ +

Specific callback functions that you don't need or doesn't do anything can be removed.

+ +

If you want you can try the test plugin by adding the following parameters to the EditAreaLoader.init command.

+
end_toolbar: "*,test_but, |,test_select",
+plugins: "test",
+ +
+

Plugin directory structure

+

+ + + + + + + + + +
File/Directory + Description +
cssPlugin specific CSS files
imagesPlugin specific images
langsPlugin specific language files
<your_plugin>.jsMain plugin file
+

+
+

Plugin example source

+

+ The example below shows a simple empty plugin and all possible callbacks. +

+

+ +

+
/**
+ * 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, isFileSpecific, command
+				return parent.editAreaLoader.get_button_html('test_but', 'test.gif', 'test_cmd', false, this.baseURL);
+			case "test_select":
+				html= "<select id='test_select' onchange='javascript:editArea.execCommand(\"test_select_change\")'>"
+					+"			<option value='-1'>{$test_select}</option>"
+					+"			<option value='h1'>h1</option>"
+					+"			<option value='h2'>h2</option>"
+					+"			<option value='h3'>h3</option>"
+					+"			<option value='h4'>h4</option>"
+					+"			<option value='h5'>h5</option>"
+					+"			<option value='h6'>h6</option>"
+					+"		</select>";
+				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+">", "</"+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/docs/js/editarea_0_8_2/docs/customization_syntax.html b/docs/js/editarea_0_8_2/docs/customization_syntax.html new file mode 100644 index 0000000..cb47236 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/customization_syntax.html @@ -0,0 +1,140 @@ + + + + + EditArea documentation + + + + +
+

Customization - Creating a syntax definition file

+
+
+

Creating your own syntax definition file

+

Creating you own syntax definition file for EditArea is fairly easy. You just have to know the language syntax, + it's kewords, and then fill a javascript array with thoses values.

+

If your want to create a new syntax file for a given language, choose a language abbreviation for it + (<language_abbr>) in lowercase. Then create the file "edit_area/reg_syntax/<language_abbr>.js".

+

Here is a "css" example:

+
editAreaLoader.load_syntax["css"] = {		// here <language_abbr> is "css" so the file is "css.js"
+	'DISPLAY_NAME' : 'Css'		// String:  used to define a better syntax name to display. Used only when using script using compressed version of the script
+	,'COMMENT_SINGLE' : ['@']		// Array:  possible single line comments
+	,'COMMENT_MULTI' : {'/*' : '*/'}	// associated Array: possible multiple line comments 
+						// ("open_mark1" : "close mark1", "open_mark2" : "close_mark2"}
+	,'QUOTEMARKS' : ['"', "'"]		// Array: the different possible quotemarks that delimitate strings
+	,'KEYWORD_CASE_SENSITIVE' : false	// Boolean: define if the language is case-sensitive
+	,'KEYWORDS' : {				// Array: an array of array containing the different keywords class 
+		'attributes' : [		// the name 'attribute' can be changed with no problem. I
+						// it's only used to define the matching style class 
+			'aqua', 'azimuth', 'background-attachment', 'background-color'	// etc...
+		]
+		,'values' : [
+			'absolute', 'block', 'bold', 'bolder', 'both' 	// etc...
+		]
+		,'specials' : [
+			'important'
+		]
+	}
+	,'OPERATORS' :[		// Array: the operators to highlight (eg, can also contain: +, -, * or / in other languages).
+		':', ';', '!', '.', '#'
+	]
+	,'DELIMITERS' :[	// Array: the block code delimiters to highlight
+		'{', '}'
+	]
+	,'STYLES' : {	// Array: an array of array, containing all style to apply for categories defined before.
+			// Better to define color style only. 
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {			// contain the associated style foreach keywords categories
+			'attributes' : 'color: #48BDDF;'
+			,'values' : 'color: #2B60FF;'
+			,'specials' : 'color: #FF0000;'
+			}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #60CA00;'
+				
+	}
+};
+

After reading this example you should be able to create your own syntax file.

+
+

Advanced syntax definition

+ +
editAreaLoader.load_syntax["xml"] = {
+	'COMMENT_SINGLE' : {}
+	,'COMMENT_MULTI' : {'<!--' : '-->'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+	}
+	,'OPERATORS' :[
+	]
+	,'DELIMITERS' :[
+	]
+	,'REGEXPS' : {			// advance syntax highlight through regexp
+		'xml' : {		// the name 'doctype' can be changed with no problem.
+			'search' : '()(<\\?[^>]*?\\?>)()'	// the regexp
+			,'class' : 'xml'			// the css class
+			,'modifiers' : 'g'			// the modifier ("g" and/or "i")
+			,'execute' : 'before'			// "before" or "after". Determine if the regexp must 
+								// be done before or after the main highlight process
+		}
+		,'cdatas' : {
+			'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
+			,'class' : 'cdata'
+			,'modifiers' : 'g'
+			,'execute' : 'before' 
+		}
+		,'tags' : {
+			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+			,'class' : 'tags'
+			,'modifiers' : 'gi'
+			,'execute' : 'before' 
+		}
+		,'attributes' : {
+			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+			,'class' : 'attributes'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			}
+		,'OPERATORS' : 'color: #E775F0;'
+		,'DELIMITERS' : ''
+		,'REGEXPS' : {
+			'attributes': 'color: #B1AC41;'
+			,'tags': 'color: #800080;'
+			,'xml': 'color: #8DCFB5;'
+			,'cdata': 'color: #50B020;'
+		}	
+	}		
+};
+

Well, as you can see in this example, the syntax highlight for xml is not based on keywords but on regexp. + The text that will be highlighted, is the one between the second parentheses. The search parameter should always + be like this: +

+
(<before_highlight>)(<code_to_highlight>)(<after_highlight>)
+

For the pattern modifier, "g" signify that all occurences will be highlighted, "i" signify + that the regexp will be case-insensitive.

+ +
+ +

Contributing your syntax definition file

+

+ Go to the sourceforge patch page + and upload the syntax file. +

+ + +
+ + + diff --git a/docs/js/editarea_0_8_2/docs/doc_style.css b/docs/js/editarea_0_8_2/docs/doc_style.css new file mode 100644 index 0000000..08024ed --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/doc_style.css @@ -0,0 +1,120 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; +} + +h1{ + font-size: 18px; + font-weight: bold; + padding: 0; + margin: 4px; +} + +h2 { + font-size: 14px; + font-weight: bold; + padding: 0; + margin: 0; + margin-top: 4px; + margin-bottom: 4px; +} + +h3 { + font-size: 11px; + font-weight: bold; + padding: 0; + margin: 0; + margin-bottom: 3px; +} + +h4, h5, h6{ + margin: 0; + padding: 0; +} + +pre, code{ + margin: 0; + padding: 0 5px; + background-color: #E6EBF1; +} + + +a:hover{ + color: #666666; + text-decoration: underline; +} + +a{ + color: #666666; + text-decoration: underline; +} + +ul, ol{ + padding: 0px; + margin: 3px 0 3px 10px; +} + +li{ + padding: 0; + margin: 3px 0 3px 10px; +} + +li li{ + padding: 0; + margin-left: 30px; +} + +table{ + border-collapse: collapse; +} + +td, th{ + padding: 4px; + border: 2px groove #000000; +} + +thead { + background-color: #E6EBF1; +} + +.header{ + border: #E0E0E0 solid 1px; +} + +.footer{ + border: #E0E0E0 solid 1px; + height: 1.3em; + padding: 2px; +} + +.content{ + padding: 10px 0 10px 10px; +} + +.indexlink{ + float: right; +} + +.separator { + border-bottom: 1px solid #E6EBF1; + margin-top: 10px; + margin-bottom: 10px; +} + + +.optionlist li li{ + text-indent: -15px; + padding-left: 15px; + line-height: 1.3em; +} + +.optionlist .underline{ + background-color: #E6EBF1; + border-bottom: dashed #000000 1px; +} + +.marked{ + color: #FF0000; + font-weight: bold; +} diff --git a/docs/js/editarea_0_8_2/docs/include.html b/docs/js/editarea_0_8_2/docs/include.html new file mode 100644 index 0000000..8523305 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/include.html @@ -0,0 +1,159 @@ + + + + + EditArea documentation + + + + +
+

Main script include

+
+
+

As you have seen it before in installation and + configuration, in order to make EditArea work on a + webpage, you must include one external javascript file and call an init + function for each textarea you want to convert. + In thoses examples the file "edit_area_full.js" whas the file included, + but in fact there are 5 possible files to include EditArea scripts + into your webpage. All thoses files are in the same directory, + and they all have advantage and inconvenient. +

+ +

edit_area_full.js

+
+

This is the easier file to use for script integration. The file is nearly 100Kb length. +

<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_full.js"></script>
+
+

Advantage:

+
    +
  • The simplest choice.
  • +
  • Load the core script in one call to server.
  • +
+

Inconvient:

+
    +
  • Not designed to allow core script modification.
  • +
  • Need to make additional server calls for plugins.
  • +
+
+

+
+ +
+ +

edit_area_compressor.php

+
+

This php file send in a gzipped file the whole core script to the brower (if the browser + has not already an updated version in cache). +
+ If the source core script files have changed, it take thoses files and merge them into one file. + Then it remove all comments, white-spaces, etc... and save it in + "edit_area_full.js". It also save a gzip version in + "edit_area_full.gz". Then it send the gzip content to the browser (except for IE for which it is not gzipped due to IE bug with compression). +

<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_compressor.php"></script>
+
+

Advantage:

+
    +
  • The script is very small if gzip is supported (~25Ko).
  • +
  • Designed to allow core script modification.
  • +
  • Load the core script in one call to server.
  • +
+

Inconvient:

+
    +
  • Need PHP to be installed on the server (and allowed to write in editarea directory for disk caching).
  • +
  • Need to make additional server calls for plugins.
  • +
+
+

+

If you plan to use "edit_area_compressor.php" be sure that PHP scripts are allowed + to write in editarea directory (at the same level than the file "edit_area_compressor.php") + for disk caching. +

+
+ +
+ +

edit_area_compressor.php?plugins

+
recommanded version
+
+

This include is very similar to "edit_area_compressor.php". The difference is that + with "plugins" parameter, the compressor also include the main script of all the plugins + in the merged file and also compress them. This will avoid later server calls for plugin main script. +
+ In this case, the saved files are "edit_area_full_with_plugins.js" and "edit_area_full_with_plugins.gz". +

<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_compressor.php?plugins"></script>
+
+

Advantage:

+
    +
  • The script is very small if gzip is supported.
  • +
  • Designed to allow core script modification.
  • +
  • Load the core script in one call to server.
  • +
  • Load plugins script in the same call.
  • +
+

Inconvient:

+
    +
  • Need PHP to be installed on the server (and allowed to write in editarea directory for disk caching).
  • +
+
+

+

If you plan to use "edit_area_compressor.php" be sure that PHP scripts are allowed + to write in editarea directory (at the same level than the file "edit_area_compressor.php") + for disk caching. +

+
+ +
+ +

edit_area_full.gz

+
+

This is the smaller file to use for script integration. The file is gzipped and is only 20Kb + length. +

<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_full.gz"></script>
+
+

Advantage:

+
    +
  • The script is only 20Kb length.
  • +
  • Load the core script in one call to server.
  • +
+

Inconvient:

+
    +
  • Is server dependant: It will work only on servers that will return a + "Content-Encoding: gzip" for *.gz files (can work with Apache). + So you must test if it work on your server.
  • +
  • Not designed to allow core script modification.
  • +
  • Need to make additional server calls for plugins.
  • +
+
+

+
+ +
+ +

edit_area_loader.js

+
+

This is the original loading script of EditArea. Use this one only if you can't use + any of the 3 other loading files. There is no code epuration nor gzip compression. +

<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_loader.js"></script>
+
+

Advantage:

+
    +
  • Designed to allow core script modification.
  • +
+

Inconvient:

+
    +
  • Load the core scripts in 12 call to the server.
  • +
  • Need to make additional server calls for plugins.
  • +
+
+

+
+ +
+ + + diff --git a/docs/js/editarea_0_8_2/docs/index.html b/docs/js/editarea_0_8_2/docs/index.html new file mode 100644 index 0000000..f422efc --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/index.html @@ -0,0 +1,41 @@ + + + + + EditArea documentation + + + + +
+

EditArea documentation

+
+ + + + diff --git a/docs/js/editarea_0_8_2/docs/installation.html b/docs/js/editarea_0_8_2/docs/installation.html new file mode 100644 index 0000000..b591cda --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/installation.html @@ -0,0 +1,108 @@ + + + + + EditArea documentation + + + + +
+

Installation instructions

+
+
+

Installing EditArea is very simple, follow the instructions here. Also look at the + options for configuration and the different + javascript load possibility. +

+
+ +

Requirements

+

EditArea has no direct requirements except for browser + compatibility and of course JavaScript needs to be turned on. + For developpers there is also a PHP compressor that is included in the release. +

+
+ +

Downloading

+

For downloading check the + sourceforge web site. +

+
+ +

Extracting the archives

+

On windows you could use WinZip or something similar. + And on other operating systems such as Linux you simply extract the archive with + the tar command. +

+

+ You should extract EditArea somewhere in your website. Notice that EditArea loads additionnal files + while being used (language translation, syntax definition and images), so don't delete any of the + file in the archive, and be sure that any files can be accessed. +

+

+ If you plan to use "edit_area_compressor.php" be sure that PHP scripts are allowed + to write in editarea repertory (at the same level than the file "edit_area_compressor.php") + in order to allow disk caching. +

+
+ +

Making changes on your web site

+

Once you have extracted the archive you will need to edit the pages + to include the configuration and javascript for EditArea. + Please note that you should probably only include the EditArea javascript on the pages + that need it, not all the pages of the web site. Remember to change the URL to + the .js below to match your installation path.

+

+

The most basic page integration (converts one textarea into editor):

+

+

+<html>
+<head>
+<title>EditArea Test</title>
+<script language="javascript" type="text/javascript" src="/editarea/edit_area/edit_area_full.js"></script>
+<script language="javascript" type="text/javascript">
+editAreaLoader.init({
+	id : "textarea_1"		// textarea id
+	,syntax: "css"			// syntax to be uses for highgliting
+	,start_highlight: true		// to display with highlight mode on start-up
+});
+</script>
+</head>
+<body>
+<form method="post">
+	<textarea id="textarea_1" name="content" cols="80" rows="15">
+/*This is some css that will be editable with EditArea.*/
+body, html{
+	margin: 0; 
+	padding: 0;
+	height: 100%;
+	border: none;
+	overflow: hidden;
+}</textarea>
+
+</form>
+</body>
+</html>
+
+

+

+ See the configuration help to learn about + initialization options, + and the include help to learn more about the way + to use the best script include (there is 4 possible files for EditArea loading). +

+

+ Here is an example of EditArea possibilities: Full exemple. +

+

+ Just be sure you've read the documentation before... +

+
+ + + diff --git a/docs/js/editarea_0_8_2/docs/javascript_functions.html b/docs/js/editarea_0_8_2/docs/javascript_functions.html new file mode 100644 index 0000000..3433ef6 --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/javascript_functions.html @@ -0,0 +1 @@ + EditArea documentation

Javascript Functions

This is for advanced users. The object editAreaLoader has some public functions that can be called from the page in order to manage the EditArea editors.

editAreaLoader.getValue(editor_id)

This method return the content text of the editor. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea

Returns: the content text of the editor. String

editAreaLoader.setValue(editor_id, new_text)

This method allow to update the content text of an editor. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea
new_text The new text that will replace the Editor content.

Returns: Nothing.

editAreaLoader.insertTags(editor_id, open_tag, close_tag)

This method allow to insert tags at the current position. If no text was selected, the cursor is then displayed between the open and the close tags. Otherwise, the cursor is positionned after the close tag. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea
open_tag The open tag string.
close_tag The close tag string.

Returns: Nothing.

editAreaLoader.getSelectedText(editor_id)

This method return the text contained in the the selection range. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea

Returns: The text contained in the the selection range. String

editAreaLoader.setSelectedText(editor_id, new_text)

This method allow to replace the text contained in the selection range with a given string. The selection range will then contain the new string. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea
new_text The string that will replace the current selected text.

Returns: Nothing.

editAreaLoader.getSelectionRange(editor_id)

This method return the position start and position end of the selection range in the editor. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea

Returns: An array containing the index of the selection start and end. Array("start", "end")

editAreaLoader.setSelectionRange(editor_id, new_start, new_end)

This method allow to set the selection range with the given start and end positions. Works on normal textarea if the EditArea is toggled off.

Parameters
editor_id The id of the converted textarea
new_start The character position determining the start of the selection range.
new_end The character position determining the end of the selection range.

Returns: Nothing.

editAreaLoader.execCommand(editor_id, command, command_param)

Allow to access to EditArea functions and datas (for advanced users only).

Parameters
editor_id The id of the converted textarea on which the command should be executed.
command The function or the parameter of the EditArea object that will be returned.
command_param (optionnal) If command is a function, the you can pass one parameter to the function with command_param

Returns: the value of the executed command or data. unknown

Examples
Change edit mode

Allow to toggle EditArea etit mode from normal edition to readonly with no toolbars.

editAreaLoader.execCommand('editor_id', 'set_editable', !editAreaLoader.execCommand('editor_id', 'is_editable'));
Insert tags

Insert tags arround selected text or at current cursor position if not text is selected

editAreaLoader.insertTags('editor_id', "[OPEN]", "[CLOSE]");

editAreaLoader.delete_instance(editor_id)

Delete an instance of EditArea and restore simple textarea.

Parameters
editor_id The id of the converted textarea on which the command should be executed.

Returns: Nothing.

editAreaLoader.hide(editor_id)

Hide a textarea and it's related EditArea.

Parameters
editor_id The id of the converted textarea on which the command should be executed.

Returns: Nothing.

editAreaLoader.show(editor_id)

Restore a textarea and it's related EditArea hidden with the hide() function.

Parameters
editor_id The id of the converted textarea on which the command should be executed.

Returns: Nothing.

editAreaLoader.openFile(editor_id, file_infos)

Parameters
editor_id The id of the converted textarea on which the command should be executed.
file_infos An object containing datas of the file that will be openned. Here are the main fields (for the other possible fields see the returned Object of the getFile function):
  • id : (required) A string that will identify the file. it's the only required field.
    Type: String
  • title : (optionnal) The title that will be displayed in the tab area.
    Type: String
    Default: set with the id field value
  • text : (optionnal) The text content of the file.
    Type: String
    Default: ""
  • syntax : (optionnal) The syntax to use for this file.
    Type: String
    Default: ""
  • do_highlight : (optionnal) Set if the file should start highlighted or not
    Type: String
    Default: ""

Returns: Nothing.

editAreaLoader.getCurrentFile(editor_id)

Return datas of the currently selected file (for multi file editing mode).

Parameters
editor_id The id of the converted textarea on which the command should be executed.

Returns: An object containing datas related to the file.Object

editAreaLoader.getFile(editor_id, file_id)

Return datas of the file identified by file_id (for multi file editing mode).

Parameters
editor_id The id of the converted textarea on which the command should be executed.
file_id The id of the file to close.

Returns: An object containing datas related to the file.Object

editAreaLoader.getAllFiles(editor_id)

Return datas of all the currently openned files (for multi file editing mode).

Parameters
editor_id The id of the converted textarea on which the command should be executed.

Returns: An object containing datas of each files.Object

editAreaLoader.closeFile(editor_id, file_id)

Close the file identified by file_id (for multi file editing mode).

Parameters
editor_id The id of the converted textarea on which the command should be executed.
file_id The id of the file to close.

Returns: Nothing.

editAreaLoader.setFileEditedMode(editor_id, file_id, edited_mode)

Define is the file should appears as edited or not.

Parameters
editor_id The id of the converted textarea on which the command should be executed.
file_id The id of the file to close.
edited_mode A boolean that indicate if the file should be set edited or not edited.

Returns: Nothing.

\ No newline at end of file diff --git a/docs/js/editarea_0_8_2/docs/license.html b/docs/js/editarea_0_8_2/docs/license.html new file mode 100644 index 0000000..32b328d --- /dev/null +++ b/docs/js/editarea_0_8_2/docs/license.html @@ -0,0 +1,48 @@ + + + + + EditArea documentation + + + + +
+

EditArea licenses

+
+
+

+ EditArea is released under "LGPL", "Apache" and "BSD" licenses, which mean that you can use EditArea if you follow at least one of thoses licenses. +

+
+
+

LGPL

+
+
+

+ Visit http://www.gnu.org/copyleft/lesser.html for more information about LGPL license. +

+
+
+

BSD

+
+
+

+ Visit http://www.opensource.org/licenses/bsd-license.php for more information about BSD license. +

+
+
+

APACHE

+
+
+

+ Visit http://www.apache.org/licenses/LICENSE-2.0 for more information about Apache license. +

+
+ + + diff --git a/docs/js/editarea_0_8_2/edit_area/autocompletion.js b/docs/js/editarea_0_8_2/edit_area/autocompletion.js new file mode 100644 index 0000000..c5d646a --- /dev/null +++ b/docs/js/editarea_0_8_2/edit_area/autocompletion.js @@ -0,0 +1,491 @@ +/** + * Autocompletion class + * + * An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut + * + * Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory) + * But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language) + * and add a too important feature that many people would miss if included as a plugin + * + * - init param: autocompletion_start + * - Button name: "autocompletion" + */ + +var EditArea_autocompletion= { + + /** + * Get called once this file is loaded (editArea still not initialized) + * + * @return nothing + */ + init: function(){ + // alert("test init: "+ this._someInternalFunction(2, 3)); + + if(editArea.settings["autocompletion"]) + this.enabled= true; + else + this.enabled= false; + this.current_word = false; + this.shown = false; + this.selectIndex = -1; + this.forceDisplay = false; + this.isInMiddleWord = false; + this.autoSelectIfOneResult = false; + this.delayBeforeDisplay = 100; + this.checkDelayTimer = false; + this.curr_syntax_str = ''; + + this.file_syntax_datas = {}; + } + /** + * 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 'autocompletion': + // Control id, button img, command + return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL); + break; + } + return false; + }*/ + /** + * Get called once EditArea is fully loaded and initialised + * + * @return nothing + */ + ,onload: function(){ + if(this.enabled) + { + var icon= document.getElementById("autocompletion"); + if(icon) + editArea.switchClassSticky(icon, 'editAreaButtonSelected', true); + } + + this.container = document.createElement('div'); + this.container.id = "auto_completion_area"; + editArea.container.insertBefore( this.container, editArea.container.firstChild ); + + // add event detection for hiding suggestion box + parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} ); + parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} ); + + } + + /** + * 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){ + if(!this.enabled) + return true; + + if (EA_keys[e.keyCode]) + letter=EA_keys[e.keyCode]; + else + letter=String.fromCharCode(e.keyCode); + // shown + if( this._isShown() ) + { + // if escape, hide the box + if(letter=="Esc") + { + this._hide(); + return false; + } + // Enter + else if( letter=="Entrer") + { + var as = this.container.getElementsByTagName('A'); + // select a suggested entry + if( this.selectIndex >= 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/docs/js/editarea_0_8_2/edit_area/edit_area.css b/docs/js/editarea_0_8_2/edit_area/edit_area.css new file mode 100644 index 0000000..172b366 --- /dev/null +++ b/docs/js/editarea_0_8_2/edit_area/edit_area.css @@ -0,0 +1,530 @@ +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/docs/js/editarea_0_8_2/edit_area/edit_area.js b/docs/js/editarea_0_8_2/edit_area/edit_area.js new file mode 100644 index 0000000..32d2a98 --- /dev/null +++ b/docs/js/editarea_0_8_2/edit_area/edit_area.js @@ -0,0 +1,527 @@ +/****** + * + * 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/docs/js/editarea_0_8_2/edit_area/edit_area_full.gz b/docs/js/editarea_0_8_2/edit_area/edit_area_full.gz new file mode 100644 index 0000000..29bcc50 Binary files /dev/null and b/docs/js/editarea_0_8_2/edit_area/edit_area_full.gz differ diff --git a/docs/js/editarea_0_8_2/edit_area/edit_area_full.js b/docs/js/editarea_0_8_2/edit_area/edit_area_full.js new file mode 100644 index 0000000..267574c --- /dev/null +++ b/docs/js/editarea_0_8_2/edit_area/edit_area_full.js @@ -0,0 +1,38 @@ + 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/docs/js/editarea_0_8_2/edit_area/edit_area_functions.js b/docs/js/editarea_0_8_2/edit_area/edit_area_functions.js new file mode 100644 index 0000000..4067b03 --- /dev/null +++ b/docs/js/editarea_0_8_2/edit_area/edit_area_functions.js @@ -0,0 +1,1202 @@ + //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