Skip to content

Commit

Permalink
EditArea 0.8.1 stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
cdolivet committed Apr 19, 2009
1 parent 16a373e commit c5e27f7
Show file tree
Hide file tree
Showing 37 changed files with 630 additions and 328 deletions.
11 changes: 6 additions & 5 deletions _devel/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
editAreaLoader.init({
id: "src" // id of the textarea to transform
//,smooth_selection: false
,font_size: "10"
//,font_family: "verdana,monospace"
// ,font_size: "10"
,font_family: "verdana,monospace"
,start_highlight: true // if start with highlight
,cursor_position: "begin"
// ,autocompletion: true
Expand Down Expand Up @@ -77,7 +77,7 @@
// ,is_multi_files: true
,browsers: "known" // "known"
// ,display: "later" // set to "later" for a later transform or "onload" for a direct transform to EditArea
,debug: true
,debug: false
,plugins: "charmap"
,charmap_default: "arrows"
// ,syntax_selection_allow: "css,html,js,php,python,vb,xml,c,cpp,basic,pas,brainfuck"
Expand Down Expand Up @@ -392,6 +392,7 @@ function test(){
if(count($_POST)>0)
printf("<pre style='height: 100px; overflow: auto; border: solid black 1px;'>%s</pre>", print_r($_POST, true));
?>

<h2>Edit area example</h2>
Test with php syntax.<br />
<!--<div style='position: absolute; top: 40px; left: 50px; border: solid red 1px; z-index: 100 '>
Expand Down Expand Up @@ -442,7 +443,7 @@ function test(){
';


for($i=0; $i<1; $i++)
for($i=0; $i<50; $i++)
echo $val;
?>
</textarea>
Expand Down Expand Up @@ -477,7 +478,7 @@ function test(){
<input type='button' onclick='decreaseWidth()' value='w--' />
<input type='button' onclick='console.log(window.frames["frame_src"].editArea)' value='firbug Log editArea' />
<br />
<textarea id='src2' style="height: 250px; width: 650px" name="titi" onafterpaste='alert("paste")' oninput='alert("input")' >
<textarea id='src2' style="height: 250px; width: 650px" name="titi" _onafterpaste='alert("paste")' _oninput='alert("input")' >
bouh
</textarea>
</form>
Expand Down
13 changes: 5 additions & 8 deletions _devel/test_code_portions.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// a good regexp for HTML tags:
// <([a-z][a-z0-9]*)((?:\s*)([^>="']+)(((=)[^>="'\s]+)|((=)((")(?:[^"\\]*(?:\\\\)*(?:\\"?)?)*(?:"|$)))|((=)('(?:[^'\\]*(?:\\\\)*(?:\\'?)?)*(?:'|$))))?)*(\s*)/?>

// extract tag content (<(?:[a-z][a-z0-9]*))((?:(?:\s*)(?:[^>="']+)(?:(?:=[^>="'\s]+)|(?:=(?:(?:")(?:[^"\\]*(?:\\\\)*(?:\\"?)?)*(?:"|$)))|(?:=(?:'(?:[^'\\]*(?:\\\\)*(?:\\'?)?)*(?:'|$))))?)*(?:\s*))(/?>)

if( this.settings['wrap_text'] ){
var t = this.textarea.cloneNode(true);
t.wrap= 'hard';
t.setAttribute('wrap', 'hard');
t.value = infos["full_text"];
t.width = '200px';
}

/*** THIS IS JUST TESTS IN HIGHLIGHT.JS ***/
var a_spans = this.content_highlight.getElementsByTagName('span');
Expand Down Expand Up @@ -58,7 +55,7 @@ if( this.settings['wrap_text'] ){
// .replace(/^(\s)/, '&nbsp;$1' ).replace(/(\s)$/, '$1&nbsp;' )
console.log( lastStartNode );
while( tmpNode.childNodes.length > 0 ){
( lastStartNode.parentNode | rootSpan ).insertBfore( tmpNode.firstChild, lastStartNode.nextSibling );
( lastStartNode.parentNode | rootSpan ).insertBefore( tmpNode.firstChild, lastStartNode.nextSibling );
lastStartNode = lastStartNode.nextSibling;
}
}
15 changes: 14 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
**** 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
Expand All @@ -6,9 +18,10 @@
- Add Chrome 2 support
- Better support of Opera 9.6
- Add Simplified Chinese translation "zh" (thanks to Abentian)
- Add Bulgariane translation "bg" (thanks to Valentin Hristov)
- 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
Expand Down
6 changes: 4 additions & 2 deletions docs/credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ <h2>Contributors</h2>
<ul>
<li>Global help
<ul>
<li>Gildas Noël</li>
<li>Gildas Noël</li>
<li>Spellcoder</li>
</ul>
</li>
<li>Languages translation
Expand Down Expand Up @@ -55,7 +56,8 @@ <h2>Contributors</h2>
<li>Pavle Ggardijan (Robots.txt)</li>
<li>Miladin Joksic (T-SQL)</li>
<li>Christoph Pinkel (Perl)</li>
<li>Max Leynov (Coldfusion)</li>
<li>Max Leynov (Coldfusion)</li>
<li>Dawson Goodel (Java)</li>
</ul>
</li>
<li>Donation
Expand Down
4 changes: 4 additions & 0 deletions edit_area/edit_area.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ body, html, table, form, textarea{

}

#selection_field strong{
font-weight:normal;
}

#selection_field.show_colors *, #selection_field_text * {
visibility: hidden;
}
Expand Down
22 changes: 11 additions & 11 deletions edit_area/edit_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
}

// init datas
a.value = 'a';//editAreas[t.id]["textarea"].value;
//a.value = 'a';//editAreas[t.id]["textarea"].value;

if(s["debug"])
{
Expand Down Expand Up @@ -225,16 +225,16 @@
}*/

if( t.isSafari ){
t.editor_area.style.position= "absolute";
a.style.marginLeft="-3px";
if( t.isSafari < 4 )
a.style.marginTop="1px";
t.editor_area.style.position = "absolute";
a.style.marginLeft ="-3px";
if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
a.style.marginTop ="1px";
}

if( t.isChrome ){
t.editor_area.style.position= "absolute";
a.style.marginLeft="0px";
a.style.marginTop="0px";
t.editor_area.style.position = "absolute";
a.style.marginLeft ="0px";
a.style.marginTop ="0px";
}

// si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
Expand Down Expand Up @@ -312,7 +312,7 @@
}

editArea.manage_size( true );
editArea.fixLinesHeight(0,-1);
editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
}
};

Expand Down Expand Up @@ -352,7 +352,7 @@
if( this.isFirefox || this.isIE )
newW-=2;
if( this.isSafari )
newW-=3;
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";
}

Expand Down Expand Up @@ -384,7 +384,7 @@
}
destDiv.innerHTML= destDiv.innerHTML + newLines;

this.fixLinesHeight( start, -1 );
this.fixLinesHeight( this.textarea.value, start, -1 );
}

//4) be sure the text is well displayed
Expand Down
Binary file modified edit_area/edit_area_full.gz
Binary file not shown.
Loading

0 comments on commit c5e27f7

Please sign in to comment.