From 3320465ca4452f8440085e5f61cd03888ab79a38 Mon Sep 17 00:00:00 2001
From: Doug Bell
Date: Fri, 1 May 2009 18:29:41 +0000
Subject: [PATCH] fixed: #9897. Fixed problem with highlighting in codearea.
Updated EditArea to version 0.8.1.1
---
lib/WebGUI/Form/Codearea.pm | 1 +
www/extras/editarea/change_log.txt | 47 ++
www/extras/editarea/docs/about.html | 97 +--
www/extras/editarea/docs/compatibility.html | 14 +-
www/extras/editarea/docs/configuration.html | 14 +-
www/extras/editarea/docs/credits.html | 31 +-
.../editarea/docs/customization_language.html | 2 +-
.../editarea/docs/customization_plugin.html | 2 +-
.../editarea/docs/customization_syntax.html | 2 +-
www/extras/editarea/docs/include.html | 2 +-
www/extras/editarea/docs/index.html | 4 +-
www/extras/editarea/docs/installation.html | 4 +-
.../editarea/docs/javascript_functions.html | 2 +-
www/extras/editarea/docs/license.html | 492 +----------
.../editarea/edit_area/autocompletion.js | 24 +-
www/extras/editarea/edit_area/edit_area.css | 37 +-
www/extras/editarea/edit_area/edit_area.js | 455 +++++-----
.../edit_area/edit_area_compressor.php | 10 +-
.../editarea/edit_area/edit_area_full.gz | Bin 26364 -> 29125 bytes
.../editarea/edit_area/edit_area_full.js | 62 +-
.../edit_area/edit_area_full_with_plugins.gz | Bin 26947 -> 29707 bytes
.../edit_area/edit_area_full_with_plugins.js | 62 +-
.../editarea/edit_area/edit_area_functions.js | 787 +++++++++--------
.../editarea/edit_area/edit_area_loader.js | 789 +++++++++---------
.../editarea/edit_area/elements_functions.js | 242 +++---
www/extras/editarea/edit_area/highlight.js | 510 ++++++-----
.../editarea/edit_area/images/word_wrap.gif | Bin 0 -> 951 bytes
www/extras/editarea/edit_area/keyboard.js | 10 +-
www/extras/editarea/edit_area/langs/bg.js | 73 ++
www/extras/editarea/edit_area/langs/cs.js | 2 +
www/extras/editarea/edit_area/langs/de.js | 2 +
www/extras/editarea/edit_area/langs/dk.js | 2 +
www/extras/editarea/edit_area/langs/en.js | 2 +
www/extras/editarea/edit_area/langs/eo.js | 2 +
www/extras/editarea/edit_area/langs/es.js | 2 +
www/extras/editarea/edit_area/langs/fi.js | 67 ++
www/extras/editarea/edit_area/langs/fr.js | 2 +
www/extras/editarea/edit_area/langs/hr.js | 2 +
www/extras/editarea/edit_area/langs/it.js | 2 +
www/extras/editarea/edit_area/langs/ja.js | 2 +
www/extras/editarea/edit_area/langs/mk.js | 2 +
www/extras/editarea/edit_area/langs/nl.js | 2 +
www/extras/editarea/edit_area/langs/pl.js | 2 +
www/extras/editarea/edit_area/langs/pt.js | 2 +
www/extras/editarea/edit_area/langs/ru.js | 2 +
www/extras/editarea/edit_area/langs/sk.js | 2 +
www/extras/editarea/edit_area/langs/zh.js | 67 ++
.../editarea/edit_area/license_apache.txt | 7 +
www/extras/editarea/edit_area/license_bsd.txt | 10 +
.../editarea/edit_area/license_lgpl.txt | 458 ++++++++++
www/extras/editarea/edit_area/manage_area.js | 563 ++++++++-----
.../edit_area/plugins/charmap/langs/bg.js | 12 +
.../edit_area/plugins/charmap/langs/zh.js | 6 +
.../edit_area/plugins/test/langs/bg.js | 10 +
.../edit_area/plugins/test/langs/zh.js | 4 +
www/extras/editarea/edit_area/reg_syntax.js | 28 +-
.../edit_area/reg_syntax/brainfuck.js | 2 +-
.../editarea/edit_area/reg_syntax/java.js | 56 ++
www/extras/editarea/edit_area/regexp.js | 68 +-
www/extras/editarea/edit_area/resize_area.js | 85 +-
.../editarea/edit_area/search_replace.js | 58 +-
www/extras/editarea/edit_area/template.html | 5 +-
.../editarea/exemples/exemple_full.html | 22 +-
www/extras/editarea/license_bsd.txt | 10 +
.../editarea/patches/less-offended.patch | 10 +
www/extras/editarea/todo.txt | 42 +-
66 files changed, 3122 insertions(+), 2275 deletions(-)
create mode 100755 www/extras/editarea/edit_area/images/word_wrap.gif
create mode 100755 www/extras/editarea/edit_area/langs/bg.js
create mode 100755 www/extras/editarea/edit_area/langs/fi.js
create mode 100755 www/extras/editarea/edit_area/langs/zh.js
create mode 100755 www/extras/editarea/edit_area/license_apache.txt
create mode 100755 www/extras/editarea/edit_area/license_bsd.txt
create mode 100755 www/extras/editarea/edit_area/license_lgpl.txt
create mode 100755 www/extras/editarea/edit_area/plugins/charmap/langs/bg.js
create mode 100755 www/extras/editarea/edit_area/plugins/charmap/langs/zh.js
create mode 100755 www/extras/editarea/edit_area/plugins/test/langs/bg.js
create mode 100755 www/extras/editarea/edit_area/plugins/test/langs/zh.js
create mode 100755 www/extras/editarea/edit_area/reg_syntax/java.js
create mode 100755 www/extras/editarea/license_bsd.txt
create mode 100644 www/extras/editarea/patches/less-offended.patch
diff --git a/lib/WebGUI/Form/Codearea.pm b/lib/WebGUI/Form/Codearea.pm
index 88a33b661..653dd0bd0 100644
--- a/lib/WebGUI/Form/Codearea.pm
+++ b/lib/WebGUI/Form/Codearea.pm
@@ -157,6 +157,7 @@ sub toHtml {
id : "$id",
syntax : "$syntax",
start_highlight : true,
+ show_line_colors: true,
toolbar : "search, go_to_line, |, undo, redo, |, syntax_selection, highlight, reset_highlight, |, help"
});
diff --git a/www/extras/editarea/change_log.txt b/www/extras/editarea/change_log.txt
index e2699d5d5..3d1425a07 100644
--- a/www/extras/editarea/change_log.txt
+++ b/www/extras/editarea/change_log.txt
@@ -1,3 +1,50 @@
+**** 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)
diff --git a/www/extras/editarea/docs/about.html b/www/extras/editarea/docs/about.html
index 5df27abec..c854b5e9f 100644
--- a/www/extras/editarea/docs/about.html
+++ b/www/extras/editarea/docs/about.html
@@ -1,48 +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
- (contact)
- and is currently released
- under the "LGPL" license, read the license agreement for details.
-
-
Features
-
-
Easy to integrate, takes only a couple lines of code.
Possibility to use a gzip compressed version of the script (only 20Kb).
-
-
-
-
-
-
+
+
+
+
+ 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
+
+
Easy to integrate, only one script include and one function call
+
Tabulation support (allow to write well formated source code)
Possible PHP gzip compression (compress the core files to one file of ~25Ko)
+
Allow multiple instances
+
Full screen mode
+
Possible plugin integration
+
Possible save and load callback functions
+
Possible dynamic content management
+
Can work in the same environment than "prototype" and "mootools"'s like libraries.
+
+
+
+
+
+
diff --git a/www/extras/editarea/docs/compatibility.html b/www/extras/editarea/docs/compatibility.html
index c34c24981..996acee91 100644
--- a/www/extras/editarea/docs/compatibility.html
+++ b/www/extras/editarea/docs/compatibility.html
@@ -19,7 +19,7 @@
The table was reset to only show the browsers I take care of.
-
Since I have no mac, I can't make test for safari, neither testing multi-plateform browsers.
+
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.
@@ -31,31 +31,31 @@
MacOS X
-
MSIE 7 & 6
+
MSIE 6 & 7 & 8
OK
-
Firefox 3 & 2 & 1.5
+
Firefox 1.5 & 2 & 3
OK
OK
OK
-
Safari 3.0 & 3.1
+
Safari 3.0 & 3.1 & 4
OK
OK
-
Chrome
+
Chrome 1 & 2
OK
???
???
-
Opera 9 & 9.5
+
Opera 9 & 9.6
OK
OK
OK
@@ -83,7 +83,7 @@
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.
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
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")
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.
toolbar: define the toolbar that will be displayed, each element being separated by a ",".
- Type: String (combinaison of: "|", "*", "search", "go_to_line", "undo", "redo", "change_smooth_selection", "reset_highlight", "highlight", "help", "save", "load", "new_document", "syntax_selection")
+ Type: String (combinaison of: "|", "*", "search", "go_to_line", "undo", "redo", "change_smooth_selection", "reset_highlight", "highlight", "word_wrap", "help", "save", "load", "new_document", "syntax_selection")
"|" or "separator" make appears a separator in the toolbar.
"*" or "return" make appears a line-break in the toolbar
- Default: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, |, help"
+ Default: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
begin_toolbar: toolbar button list to add before the toolbar defined by the "toolbar" option.
Type: String (cf. "toolbar" option)
@@ -94,6 +94,9 @@
Type: String
Default: "monospace"
+
cursor_position: define if the cursor should be placed where it was in the textarea before replacement (auto) or at the beginning of the file (begin).
+ Type: String ("begin" or "auto")
+ Default: "begin"
gecko_spellcheck: allow to disable/enable the Firefox 2 spellchecker
Type: Boolean
@@ -112,6 +115,11 @@
Type: Boolean
Default: true
+
word_wrap: determine if the text will be automatically wrapped to the next line when it reach the end of a line. This is linked ot the word_wrap icon available in the toolbar.
+
+ Type: Boolean
+ Default: false
+
replace_tab_by_spaces: define the number of spaces that will replace tabulations (\t) in text. If tabulation should stay tabulation, set this option to false.
Type: Integer (or false)
Default: false
@@ -209,7 +217,7 @@ editAreaLoader.init({
diff --git a/www/extras/editarea/docs/credits.html b/www/extras/editarea/docs/credits.html
index d71b136c3..9a293bec7 100644
--- a/www/extras/editarea/docs/credits.html
+++ b/www/extras/editarea/docs/credits.html
@@ -27,21 +27,25 @@
Global help
-
Gildas Noël
+
Gildas Noël
+
Spellcoder
Languages translation
-
Olaf Brambrink & Felix Riesterer & Christoph Pinkel (deutsh)
-
Peter Klein (danish)
-
Leonardo Sapucaia (portuguese)
-
Ishitoya Kentaro (japanese)
-
Piotr Furman (polish)
-
Luciano Vernaschi (italian)
-
Ivan Vucica and Davor Cihlar (croatian)
-
Garito (spanish)
-
Gabriel Schwardy (slovak)
-
Olivier (esperento)
+
Olaf Brambrink & Felix Riesterer & Christoph Pinkel (Deutsh)
diff --git a/www/extras/editarea/docs/installation.html b/www/extras/editarea/docs/installation.html
index 803551614..cfbb9a7ec 100644
--- a/www/extras/editarea/docs/installation.html
+++ b/www/extras/editarea/docs/installation.html
@@ -96,14 +96,12 @@ body, html{
Here is an example of EditArea possibilities: Full exemple.
- If you have any problems, you could contact me on
- my website.
Just be sure you've read the documentation before...