2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Merging the updated Limesurvey 1.92+ branch of queXS to trunk

This commit is contained in:
azammitdcarf
2012-11-21 04:04:39 +00:00
parent 153fc8ca0d
commit c569559964
856 changed files with 254260 additions and 819988 deletions

View File

@@ -1,491 +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; i++ )
{
if( as[i].className )
as[i].className = as[i].className.replace(/ focus/g, '');
}
this.selectIndex++;
this.selectIndex = ( this.selectIndex >= 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; i++ )
{
if( as[i].className )
as[i].className = as[ i ].className.replace(/ focus/g, '');
}
this.selectIndex--;
this.selectIndex = ( this.selectIndex >= 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<limit ; i++ )
{
if( line_string.substring( limit - i - 1, limit ) == content.substring( 0, i + 1 ) )
nbMatch = i + 1;
}
// if characters match, we should include them in the selection that will be replaced
if( nbMatch > 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<datas["KEYWORDS"][prefix].length; j++ )
{
tmp["keywords"][prefix]['datas'][j]= {
is_typing: datas["KEYWORDS"][prefix][j][0],
// if replace with is empty, replace with the is_typing value
replace_with: datas["KEYWORDS"][prefix][j][1] ? datas["KEYWORDS"][prefix][j][1].replace('§', datas["KEYWORDS"][prefix][j][0] ) : '',
comment: datas["KEYWORDS"][prefix][j][2] ? datas["KEYWORDS"][prefix][j][2] : ''
};
// the replace with shouldn't be empty
if( tmp["keywords"][prefix]['datas'][j]['replace_with'].length == 0 )
tmp["keywords"][prefix]['datas'][j]['replace_with'] = tmp["keywords"][prefix]['datas'][j]['is_typing'];
// if the comment is empty, display the replace_with value
if( tmp["keywords"][prefix]['datas'][j]['comment'].length == 0 )
tmp["keywords"][prefix]['datas'][j]['comment'] = tmp["keywords"][prefix]['datas'][j]['replace_with'].replace(/{@}/g, '' );
}
}
tmp["max_text_length"]= datas["MAX_TEXT_LENGTH"];
parent.editAreaLoader.syntax[lang]['autocompletion'][i] = tmp;
}
}
}
}
}
,_checkLetter: function(){
// check that syntax hasn't changed
if( this.curr_syntax_str != editArea.settings['syntax'] )
{
if( !parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'] )
this._parseSyntaxAutoCompletionDatas();
this.curr_syntax= parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'];
this.curr_syntax_str = editArea.settings['syntax'];
//console.log( this.curr_syntax );
}
if( editArea.is_editable )
{
time=new Date;
t1= time.getTime();
editArea.getIESelection();
this.selectIndex = -1;
start=editArea.textarea.selectionStart;
var str = editArea.textarea.value;
var results= [];
for(var i in this.curr_syntax)
{
var last_chars = str.substring(Math.max(0, start-this.curr_syntax[i]["max_text_length"]), start);
var matchNextletter = str.substring(start, start+1).match( this.curr_syntax[i]["match_next_letter"]);
// if not writting in the middle of a word or if forcing display
if( matchNextletter || this.forceDisplay )
{
// check if the last chars match a separator
var match_prefix_separator = last_chars.match(this.curr_syntax[i]["match_prefix_separator"]);
// check if it match a possible word
var match_word= last_chars.match(this.curr_syntax[i]["match_word"]);
//console.log( match_word );
if( match_word )
{
var begin_word= match_word[1];
var match_curr_word= new RegExp("^"+ parent.editAreaLoader.get_escaped_regexp( begin_word ), this.curr_syntax[i]["modifiers"]);
//console.log( match_curr_word );
for(var prefix in this.curr_syntax[i]["keywords"])
{
// parent.console.log( this.curr_syntax[i]["keywords"][prefix] );
for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
{
// parent.console.log( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'] );
// the key word match or force display
if( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'].match(match_curr_word) )
{
// parent.console.log('match');
hasMatch = false;
var before = last_chars.substr( 0, last_chars.length - begin_word.length );
// no prefix to match => 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<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
{
hasMatch = false;
// no prefix to match => 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.length; i++)
{
var line= "<li><a href=\"#\" class=\"entry\" onmousedown=\"EditArea_autocompletion._select('"+ results[i][1]['replace_with'].replace(new RegExp('"', "g"), "&quot;") +"');return false;\">"+ results[i][1]['comment'];
if(results[i][0]['prefix_name'].length>0)
line+='<span class="prefix">'+ results[i][0]['prefix_name'] +'</span>';
line+='</a></li>';
lines[lines.length]=line;
}
// sort results
this.container.innerHTML = '<ul>'+ lines.sort().join('') +'</ul>';
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';
/**
* 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; i++ )
{
if( as[i].className )
as[i].className = as[i].className.replace(/ focus/g, '');
}
this.selectIndex++;
this.selectIndex = ( this.selectIndex >= 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; i++ )
{
if( as[i].className )
as[i].className = as[ i ].className.replace(/ focus/g, '');
}
this.selectIndex--;
this.selectIndex = ( this.selectIndex >= 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<limit ; i++ )
{
if( line_string.substring( limit - i - 1, limit ) == content.substring( 0, i + 1 ) )
nbMatch = i + 1;
}
// if characters match, we should include them in the selection that will be replaced
if( nbMatch > 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<datas["KEYWORDS"][prefix].length; j++ )
{
tmp["keywords"][prefix]['datas'][j]= {
is_typing: datas["KEYWORDS"][prefix][j][0],
// if replace with is empty, replace with the is_typing value
replace_with: datas["KEYWORDS"][prefix][j][1] ? datas["KEYWORDS"][prefix][j][1].replace('§', datas["KEYWORDS"][prefix][j][0] ) : '',
comment: datas["KEYWORDS"][prefix][j][2] ? datas["KEYWORDS"][prefix][j][2] : ''
};
// the replace with shouldn't be empty
if( tmp["keywords"][prefix]['datas'][j]['replace_with'].length == 0 )
tmp["keywords"][prefix]['datas'][j]['replace_with'] = tmp["keywords"][prefix]['datas'][j]['is_typing'];
// if the comment is empty, display the replace_with value
if( tmp["keywords"][prefix]['datas'][j]['comment'].length == 0 )
tmp["keywords"][prefix]['datas'][j]['comment'] = tmp["keywords"][prefix]['datas'][j]['replace_with'].replace(/{@}/g, '' );
}
}
tmp["max_text_length"]= datas["MAX_TEXT_LENGTH"];
parent.editAreaLoader.syntax[lang]['autocompletion'][i] = tmp;
}
}
}
}
}
,_checkLetter: function(){
// check that syntax hasn't changed
if( this.curr_syntax_str != editArea.settings['syntax'] )
{
if( !parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'] )
this._parseSyntaxAutoCompletionDatas();
this.curr_syntax= parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'];
this.curr_syntax_str = editArea.settings['syntax'];
//console.log( this.curr_syntax );
}
if( editArea.is_editable )
{
time=new Date;
t1= time.getTime();
editArea.getIESelection();
this.selectIndex = -1;
start=editArea.textarea.selectionStart;
var str = editArea.textarea.value;
var results= [];
for(var i in this.curr_syntax)
{
var last_chars = str.substring(Math.max(0, start-this.curr_syntax[i]["max_text_length"]), start);
var matchNextletter = str.substring(start, start+1).match( this.curr_syntax[i]["match_next_letter"]);
// if not writting in the middle of a word or if forcing display
if( matchNextletter || this.forceDisplay )
{
// check if the last chars match a separator
var match_prefix_separator = last_chars.match(this.curr_syntax[i]["match_prefix_separator"]);
// check if it match a possible word
var match_word= last_chars.match(this.curr_syntax[i]["match_word"]);
//console.log( match_word );
if( match_word )
{
var begin_word= match_word[1];
var match_curr_word= new RegExp("^"+ parent.editAreaLoader.get_escaped_regexp( begin_word ), this.curr_syntax[i]["modifiers"]);
//console.log( match_curr_word );
for(var prefix in this.curr_syntax[i]["keywords"])
{
// parent.console.log( this.curr_syntax[i]["keywords"][prefix] );
for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
{
// parent.console.log( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'] );
// the key word match or force display
if( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'].match(match_curr_word) )
{
// parent.console.log('match');
hasMatch = false;
var before = last_chars.substr( 0, last_chars.length - begin_word.length );
// no prefix to match => 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<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
{
hasMatch = false;
// no prefix to match => 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.length; i++)
{
var line= "<li><a href=\"#\" class=\"entry\" onmousedown=\"EditArea_autocompletion._select('"+ results[i][1]['replace_with'].replace(new RegExp('"', "g"), "&quot;") +"');return false;\">"+ results[i][1]['comment'];
if(results[i][0]['prefix_name'].length>0)
line+='<span class="prefix">'+ results[i][0]['prefix_name'] +'</span>';
line+='</a></li>';
lines[lines.length]=line;
}
// sort results
this.container.innerHTML = '<ul>'+ lines.sort().join('') +'</ul>';
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);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,428 +1,428 @@
<?php
/******
*
* EditArea PHP compressor
* Developped by Christophe Dolivet
* Released under LGPL, Apache and BSD licenses
* v1.1.3 (2007/01/18)
*
******/
// CONFIG
$param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires
$param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false)
$param['debug'] = false; // Enable this option if you need debuging info
$param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk.
$param['use_gzip']= true; // Enable gzip compression
// END CONFIG
$compressor= new Compressor($param);
class Compressor{
function compressor($param)
{
$this->__construct($param);
}
function __construct($param)
{
$this->start_time= $this->get_microtime();
$this->file_loaded_size=0;
$this->param= $param;
$this->script_list="";
$this->path= dirname(__FILE__)."/";
if(isset($_GET['plugins'])){
$this->load_all_plugins= true;
$this->full_cache_file= $this->path."edit_area_full_with_plugins.js";
$this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz";
}else{
$this->load_all_plugins= false;
$this->full_cache_file= $this->path."edit_area_full.js";
$this->gzip_cache_file= $this->path."edit_area_full.gz";
}
$this->check_gzip_use();
$this->send_headers();
$this->check_cache();
$this->load_files();
$this->send_datas();
}
function send_headers()
{
header("Content-type: text/javascript; charset: UTF-8");
header("Vary: Accept-Encoding"); // Handle proxies
header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) );
if($this->use_gzip)
header("Content-Encoding: ".$this->gzip_enc_header);
}
function check_gzip_use()
{
$encodings = array();
$desactivate_gzip=false;
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
// desactivate gzip for IE version < 7
if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie))
{
if($ie[1]<7)
$desactivate_gzip=true;
}
// Check for gzip header or northon internet securities
if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
$this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
$this->use_gzip=true;
$this->cache_file=$this->gzip_cache_file;
}else{
$this->use_gzip=false;
$this->cache_file=$this->full_cache_file;
}
}
function check_cache()
{
// Only gzip the contents if clients and server support it
if (file_exists($this->cache_file)) {
// check if cache file must be updated
$cache_date=0;
if ($dir = opendir($this->path)) {
while (($file = readdir($dir)) !== false) {
if(is_file($this->path.$file) && $file!="." && $file!="..")
$cache_date= max($cache_date, filemtime($this->path.$file));
}
closedir($dir);
}
if($this->load_all_plugins){
$plug_path= $this->path."plugins/";
if (($dir = @opendir($plug_path)) !== false)
{
while (($file = readdir($dir)) !== false)
{
if ($file !== "." && $file !== "..")
{
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
$cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js"));
}
}
closedir($dir);
}
}
if(filemtime($this->cache_file) >= $cache_date){
// if cache file is up to date
$last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT";
if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0)
{
header("HTTP/1.1 304 Not Modified");
header("Last-modified: ".$last_modified);
header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
header("Pragma:"); // Tells HTTP 1.0 clients to cache
}
else
{
header("Last-modified: ".$last_modified);
header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
header("Pragma:"); // Tells HTTP 1.0 clients to cache
header('Content-Length: '.filesize($this->cache_file));
echo file_get_contents($this->cache_file);
}
die;
}
}
return false;
}
function load_files()
{
$loader= $this->get_content("edit_area_loader.js")."\n";
// get the list of other files to load
$loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e"
, "\$this->replace_scripts('script_list', '\\1', '\\2')"
, $loader);
$loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e"
, "\$this->replace_scripts('sub_script_list', '\\1', '\\2')"
, $loader);
// replace languages names
$reg_path= $this->path."reg_syntax/";
$a_displayName = array();
if (($dir = @opendir($reg_path)) !== false)
{
while (($file = readdir($dir)) !== false)
{
if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false )
{
$jsContent = $this->file_get_contents( $reg_path.$file );
if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) )
{
$a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'";
}
}
}
closedir($dir);
}
$loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $loader );
$this->datas= $loader;
$this->compress_javascript($this->datas);
// load other scripts needed for the loader
preg_match_all('/"([^"]*)"/', $this->script_list, $match);
foreach($match[1] as $key => $value)
{
$content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js");
$this->compress_javascript($content);
$this->datas.= $content."\n";
}
//$this->datas);
//$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas);
// improved compression step 1/2
$this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas);
//$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas);
$this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;";
// load sub scripts
$sub_scripts="";
$sub_scripts_list= array();
preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match);
foreach($match[1] as $value){
$sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js";
}
if($this->load_all_plugins){
// load plugins scripts
$plug_path= $this->path."plugins/";
if (($dir = @opendir($plug_path)) !== false)
{
while (($file = readdir($dir)) !== false)
{
if ($file !== "." && $file !== "..")
{
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
$sub_scripts_list[]= "plugins/".$file."/".$file.".js";
}
}
closedir($dir);
}
}
foreach($sub_scripts_list as $value){
$sub_scripts.= $this->get_javascript_content($value);
}
// improved compression step 2/2
$sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
// $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
$sub_scripts.= "var editArea= eA;EditArea=EA;";
// add the scripts
// $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\";\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= \"<script type='text/javascript'>%s</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= \"<style>%s</style>\";\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);
}
}
?>
<?php
/******
*
* EditArea PHP compressor
* Developped by Christophe Dolivet
* Released under LGPL, Apache and BSD licenses
* v1.1.3 (2007/01/18)
*
******/
// CONFIG
$param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires
$param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false)
$param['debug'] = false; // Enable this option if you need debuging info
$param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk.
$param['use_gzip']= true; // Enable gzip compression
// END CONFIG
$compressor= new Compressor($param);
class Compressor{
function compressor($param)
{
$this->__construct($param);
}
function __construct($param)
{
$this->start_time= $this->get_microtime();
$this->file_loaded_size=0;
$this->param= $param;
$this->script_list="";
$this->path= dirname(__FILE__)."/";
if(isset($_GET['plugins'])){
$this->load_all_plugins= true;
$this->full_cache_file= $this->path."edit_area_full_with_plugins.js";
$this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz";
}else{
$this->load_all_plugins= false;
$this->full_cache_file= $this->path."edit_area_full.js";
$this->gzip_cache_file= $this->path."edit_area_full.gz";
}
$this->check_gzip_use();
$this->send_headers();
$this->check_cache();
$this->load_files();
$this->send_datas();
}
function send_headers()
{
header("Content-type: text/javascript; charset: UTF-8");
header("Vary: Accept-Encoding"); // Handle proxies
header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) );
if($this->use_gzip)
header("Content-Encoding: ".$this->gzip_enc_header);
}
function check_gzip_use()
{
$encodings = array();
$desactivate_gzip=false;
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
// desactivate gzip for IE version < 7
if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie))
{
if($ie[1]<7)
$desactivate_gzip=true;
}
// Check for gzip header or northon internet securities
if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
$this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
$this->use_gzip=true;
$this->cache_file=$this->gzip_cache_file;
}else{
$this->use_gzip=false;
$this->cache_file=$this->full_cache_file;
}
}
function check_cache()
{
// Only gzip the contents if clients and server support it
if (file_exists($this->cache_file)) {
// check if cache file must be updated
$cache_date=0;
if ($dir = opendir($this->path)) {
while (($file = readdir($dir)) !== false) {
if(is_file($this->path.$file) && $file!="." && $file!="..")
$cache_date= max($cache_date, filemtime($this->path.$file));
}
closedir($dir);
}
if($this->load_all_plugins){
$plug_path= $this->path."plugins/";
if (($dir = @opendir($plug_path)) !== false)
{
while (($file = readdir($dir)) !== false)
{
if ($file !== "." && $file !== "..")
{
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
$cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js"));
}
}
closedir($dir);
}
}
if(filemtime($this->cache_file) >= $cache_date){
// if cache file is up to date
$last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT";
if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0)
{
header("HTTP/1.1 304 Not Modified");
header("Last-modified: ".$last_modified);
header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
header("Pragma:"); // Tells HTTP 1.0 clients to cache
}
else
{
header("Last-modified: ".$last_modified);
header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
header("Pragma:"); // Tells HTTP 1.0 clients to cache
header('Content-Length: '.filesize($this->cache_file));
echo file_get_contents($this->cache_file);
}
die;
}
}
return false;
}
function load_files()
{
$loader= $this->get_content("edit_area_loader.js")."\n";
// get the list of other files to load
$loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e"
, "\$this->replace_scripts('script_list', '\\1', '\\2')"
, $loader);
$loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e"
, "\$this->replace_scripts('sub_script_list', '\\1', '\\2')"
, $loader);
// replace languages names
$reg_path= $this->path."reg_syntax/";
$a_displayName = array();
if (($dir = @opendir($reg_path)) !== false)
{
while (($file = readdir($dir)) !== false)
{
if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false )
{
$jsContent = $this->file_get_contents( $reg_path.$file );
if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) )
{
$a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'";
}
}
}
closedir($dir);
}
$loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $loader );
$this->datas= $loader;
$this->compress_javascript($this->datas);
// load other scripts needed for the loader
preg_match_all('/"([^"]*)"/', $this->script_list, $match);
foreach($match[1] as $key => $value)
{
$content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js");
$this->compress_javascript($content);
$this->datas.= $content."\n";
}
//$this->datas);
//$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas);
// improved compression step 1/2
$this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas);
//$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas);
$this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;";
// load sub scripts
$sub_scripts="";
$sub_scripts_list= array();
preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match);
foreach($match[1] as $value){
$sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js";
}
if($this->load_all_plugins){
// load plugins scripts
$plug_path= $this->path."plugins/";
if (($dir = @opendir($plug_path)) !== false)
{
while (($file = readdir($dir)) !== false)
{
if ($file !== "." && $file !== "..")
{
if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
$sub_scripts_list[]= "plugins/".$file."/".$file.".js";
}
}
closedir($dir);
}
}
foreach($sub_scripts_list as $value){
$sub_scripts.= $this->get_javascript_content($value);
}
// improved compression step 2/2
$sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
// $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
$sub_scripts.= "var editArea= eA;EditArea=EA;";
// add the scripts
// $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\";\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= \"<script type='text/javascript'>%s</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= \"<style>%s</style>\";\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);
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@@ -1,336 +1,336 @@
/****
* This page contains some general usefull functions for javascript
*
****/
// need to redefine this functiondue to IE problem
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;
};
// need to redefine this function due to IE problem
function setAttribute( elm, attr, val ) {
if(attr=="class"){
elm.setAttribute("className", val);
elm.setAttribute("class", val);
}else{
elm.setAttribute(attr, val);
}
};
/* return a child element
elem: element we are searching in
elem_type: type of the eleemnt we are searching (DIV, A, etc...)
elem_attribute: attribute of the searched element that must match
elem_attribute_match: value that elem_attribute must match
option: "all" if must return an array of all children, otherwise return the first match element
depth: depth of search (-1 or no set => unlimited)
*/
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;x<children.length;x++) {
strTagName = new String(children[x].tagName);
children_class="?";
if(strTagName!= "undefined"){
child_attribute= getAttribute(children[x],elem_attribute);
if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){
if(option=="all"){
results.push(children[x]);
}else{
return children[x];
}
}
if(depth!=0){
result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);
if(option=="all"){
if(result.length>0){
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;
};
/** return the computed style
* @param: elem: the reference to the element
* @param: prop: the name of the css property
*/
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;
}
/****
* Moving an element
***/
var _mCE; // currently moving element
/* allow to move an element in a window
e: the event
id: the id of the element
frame: the frame of the element
ex of use:
in html: <img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["this_frame_id"]);' .../>
or
in javascript: document.getElementById("my_div").onmousedown= start_move_element
*/
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;
/*_mCE.onmousemove= move_element;
_mCE.onmouseup= end_move_element;*/
//alert(_mCE.frame.document.body.offsetHeight);
mouse_x= getMouseX(e);
mouse_y= getMouseY(e);
//window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
_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;
};
/***
* Managing a textarea (this part need the navigator infos from editAreaLoader
***/
var nav= editAreaLoader.nav;
// allow to get infos on the selection: array(start, end)
function getSelectionRange(textarea){
return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
};
// allow to set the selection
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 ){ // Opera bug when moving selection start and selection end
t.selectionEnd = 1;
t.selectionStart = 0;
t.selectionEnd = 1;
t.selectionStart = 0;
}
t.selectionStart = start;
t.selectionEnd = end;
//textarea.setSelectionRange(start, end);
if(nav.isIE)
set_IE_selection(t);
};
// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
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)
{ // calculate the lineHeight
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);
}
//t.focus();
range = d.selection.createRange();
try
{
stored_range = range.duplicate();
stored_range.moveToElementText( t );
stored_range.setEndPoint( 'EndToEnd', range );
if(stored_range.parentElement() == t){
// the range don't take care of empty lines in the end of the selection
elem = t;
scrollTop = 0;
while(elem.parentNode){
scrollTop+= elem.scrollTop;
elem = elem.parentNode;
}
// var scrollTop= t.scrollTop + document.body.scrollTop;
// var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
// alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
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; // add missing empty lines to the selection
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;
}
// select the text for IE (take into account the \r difference)
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){}
}
};
editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";
/****
* This page contains some general usefull functions for javascript
*
****/
// need to redefine this functiondue to IE problem
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;
};
// need to redefine this function due to IE problem
function setAttribute( elm, attr, val ) {
if(attr=="class"){
elm.setAttribute("className", val);
elm.setAttribute("class", val);
}else{
elm.setAttribute(attr, val);
}
};
/* return a child element
elem: element we are searching in
elem_type: type of the eleemnt we are searching (DIV, A, etc...)
elem_attribute: attribute of the searched element that must match
elem_attribute_match: value that elem_attribute must match
option: "all" if must return an array of all children, otherwise return the first match element
depth: depth of search (-1 or no set => unlimited)
*/
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;x<children.length;x++) {
strTagName = new String(children[x].tagName);
children_class="?";
if(strTagName!= "undefined"){
child_attribute= getAttribute(children[x],elem_attribute);
if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){
if(option=="all"){
results.push(children[x]);
}else{
return children[x];
}
}
if(depth!=0){
result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);
if(option=="all"){
if(result.length>0){
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;
};
/** return the computed style
* @param: elem: the reference to the element
* @param: prop: the name of the css property
*/
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;
}
/****
* Moving an element
***/
var _mCE; // currently moving element
/* allow to move an element in a window
e: the event
id: the id of the element
frame: the frame of the element
ex of use:
in html: <img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["this_frame_id"]);' .../>
or
in javascript: document.getElementById("my_div").onmousedown= start_move_element
*/
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;
/*_mCE.onmousemove= move_element;
_mCE.onmouseup= end_move_element;*/
//alert(_mCE.frame.document.body.offsetHeight);
mouse_x= getMouseX(e);
mouse_y= getMouseY(e);
//window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
_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;
};
/***
* Managing a textarea (this part need the navigator infos from editAreaLoader
***/
var nav= editAreaLoader.nav;
// allow to get infos on the selection: array(start, end)
function getSelectionRange(textarea){
return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
};
// allow to set the selection
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 ){ // Opera bug when moving selection start and selection end
t.selectionEnd = 1;
t.selectionStart = 0;
t.selectionEnd = 1;
t.selectionStart = 0;
}
t.selectionStart = start;
t.selectionEnd = end;
//textarea.setSelectionRange(start, end);
if(nav.isIE)
set_IE_selection(t);
};
// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
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)
{ // calculate the lineHeight
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);
}
//t.focus();
range = d.selection.createRange();
try
{
stored_range = range.duplicate();
stored_range.moveToElementText( t );
stored_range.setEndPoint( 'EndToEnd', range );
if(stored_range.parentElement() == t){
// the range don't take care of empty lines in the end of the selection
elem = t;
scrollTop = 0;
while(elem.parentNode){
scrollTop+= elem.scrollTop;
elem = elem.parentNode;
}
// var scrollTop= t.scrollTop + document.body.scrollTop;
// var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
// alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
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; // add missing empty lines to the selection
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;
}
// select the text for IE (take into account the \r difference)
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){}
}
};
editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";

View File

@@ -1,407 +1,407 @@
// change_to: "on" or "off"
EditArea.prototype.change_highlight= function(change_to){
if(this.settings["syntax"].length==0 && change_to==false){
this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
return false;
}
if(this.do_highlight==change_to)
return false;
this.getIESelection();
var pos_start= this.textarea.selectionStart;
var pos_end= this.textarea.selectionEnd;
if(this.do_highlight===true || change_to==false)
this.disable_highlight();
else
this.enable_highlight();
this.textarea.focus();
this.textarea.selectionStart = pos_start;
this.textarea.selectionEnd = pos_end;
this.setIESelection();
};
EditArea.prototype.disable_highlight= function(displayOnly){
var t= this, a=t.textarea, new_Obj, old_class, new_class;
t.selection_field.innerHTML="";
t.selection_field_text.innerHTML="";
t.content_highlight.style.visibility="hidden";
// replacing the node is far more faster than deleting it's content in firefox
new_Obj= t.content_highlight.cloneNode(false);
new_Obj.innerHTML= "";
t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
t.content_highlight.parentNode.removeChild(t.content_highlight);
t.content_highlight= new_Obj;
old_class= parent.getAttribute( a,"class" );
if(old_class){
new_class= old_class.replace( "hidden","" );
parent.setAttribute( a, "class", new_class );
}
a.style.backgroundColor="transparent"; // needed in order to see the bracket finders
//var icon= document.getElementById("highlight");
//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
//t.restoreClass(icon);
//t.switchClass(icon,'editAreaButtonNormal');
t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
t.do_highlight=false;
t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
t.change_smooth_selection_mode(false);
}
// this.textarea.style.backgroundColor="#FFFFFF";
};
EditArea.prototype.enable_highlight= function(){
var t=this, a=t.textarea, new_class;
t.show_waiting_screen();
t.content_highlight.style.visibility="visible";
new_class =parent.getAttribute(a,"class")+" hidden";
parent.setAttribute( a, "class", new_class );
// IE can't manage mouse click outside text range without this
if( t.isIE )
a.style.backgroundColor="#FFFFFF";
t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
t.smooth_selection_before_highlight=t.smooth_selection;
if(!t.smooth_selection)
t.change_smooth_selection_mode(true);
t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
t.do_highlight=true;
t.resync_highlight();
t.hide_waiting_screen();
};
/**
* Ask to update highlighted text
* @param Array infos - Array of datas returned by EditArea.get_selection_infos()
*/
EditArea.prototype.maj_highlight= function(infos){
// for speed mesure
var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
var t=this, hightlighted_text, updated_highlight;
var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
return;
// OPTIMISATION: will search to update only changed lines
if(t.reload_highlight===true){
t.reload_highlight=false;
}else if(textToHighlight.length==0){
textToHighlight="\n ";
}else{
// get text change datas
changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
// check if it can only reparse the changed text
trace_new = t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
trace_last = t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
doSyntaxOpti = ( trace_new == trace_last );
// check if the difference comes only from a new line created
// => we have to remember that the editor can automaticaly add tabulation or space after the new line)
if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
{
doSyntaxOpti = true;
}
// we do the syntax optimisation
if( doSyntaxOpti ){
tps_middle_opti=new Date().getTime();
stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
if(changes.lineStart>0)
stay_begin+= "\n";
stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
if(stay_end.length>0)
stay_end= "\n"+stay_end;
// Final check to see that we're not in the middle of span tags
if( stay_begin.split('<span').length != stay_begin.split('</span').length
|| stay_end.split('<span').length != stay_end.split('</span').length )
{
doSyntaxOpti = false;
stay_end = '';
stay_begin = '';
}
else
{
if(stay_begin.length==0 && changes.posLastEnd==-1)
changes.newTextLine+="\n";
textToHighlight=changes.newTextLine;
}
}
if(t.settings["debug"]){
var ch =changes;
debug_opti= ( doSyntaxOpti?"Optimisation": "No optimisation" )
+" start: "+ch.posStart +"("+ch.lineStart+")"
+" end_new: "+ ch.posNewEnd+"("+ch.lineNewEnd+")"
+" end_last: "+ ch.posLastEnd+"("+ch.lineLastEnd+")"
+"\nchanged_text: "+ch.newText+" => trace: "+trace_new
+"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
//debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
+ "\nchanged_line: "+ch.newTextLine
+ "\nlast_changed_line: "+ch.lastTextLine
+"\nstay_begin: "+ stay_begin.slice(-100)
+"\nstay_end: "+ stay_end.substr( 0, 100 );
//debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
//debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
//debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
+"\n";
}
// END OPTIMISATION
}
tps_end_opti = new Date().getTime();
// apply highlight
updated_highlight = t.colorize_text(textToHighlight);
tpsAfterReg = new Date().getTime();
/***
* see if we can optimize for updating only the required part of the HTML code
*
* The goal here will be to find the text node concerned by the modification and to update it
*/
//-------------------------------------------
// disable latest optimization tricks (introduced in 0.8.1 and removed in 0.8.2), TODO: check for another try later
doSyntaxOpti = doHtmlOpti = false;
if( doSyntaxOpti )
{
try
{
var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
replacedBloc = t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
lengthOld = replacedBloc.length;
lengthNew = updated_highlight.length;
// find the identical caracters at the beginning
for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
{
}
nbStart = i;
// find the identical caracters at the end
for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
{
}
nbEnd = i;
//console.log( nbStart, nbEnd, replacedBloc, updated_highlight );
// get the changes
lastHtml = replacedBloc.substring( nbStart, lengthOld - nbEnd );
newHtml = updated_highlight.substring( nbStart, lengthNew - nbEnd );
// We can do the optimisation only if we havn't touch to span elements
if( newHtml.indexOf('<span') == -1 && newHtml.indexOf('</span') == -1
&& lastHtml.indexOf('<span') == -1 && lastHtml.indexOf('</span') == -1 )
{
var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
doHtmlOpti = true;
beginStr = t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
// fix special chars
newHtml = newHtml.replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&');
nbOpendedSpan = beginStr.split('<span').length - 1;
nbClosedSpan = beginStr.split('</span').length - 1;
// retrieve the previously opened span (Add 1 for the first level span?)
span = t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];
//--------[
// get the textNode to update
// if we're inside a span, we'll take the one that is opened (can be a parent of the current span)
parentSpan = span;
maxStartOffset = maxEndOffset = 0;
// it will be in the child of the root node
if( nbOpendedSpan == nbClosedSpan )
{
while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' )
{
parentSpan = parentSpan.parentNode;
}
}
// get the last opened span
else
{
maxStartOffset = maxEndOffset = beginStr.length + 1;
// move to parent node for each closed span found after the lastest open span
nbClosed = beginStr.substr( Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ).split('</span').length - 1;
while( nbClosed > 0 )
{
nbClosed--;
parentSpan = parentSpan.parentNode;
}
// find the position of the last opended tag
while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' && ( tmpMaxStartOffset = Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ) < ( tmpMaxEndOffset = Math.max( 0, beginStr.lastIndexOf( '</span', maxEndOffset - 1 ) ) ) )
{
maxStartOffset = tmpMaxStartOffset;
maxEndOffset = tmpMaxEndOffset;
}
}
// Note: maxEndOffset is no more used but maxStartOffset will be used
if( parentSpan.parentNode == t.content_highlight || parentSpan.parentNode.tagName == 'PRE' )
{
maxStartOffset = Math.max( 0, beginStr.indexOf( '<span' ) );
}
// find the matching text node (this will be one that will be at the end of the beginStr
if( maxStartOffset == beginStr.length )
{
nbSubSpanBefore = 0;
}
else
{
lastEndPos = Math.max( 0, beginStr.lastIndexOf( '>', maxStartOffset ) );
// count the number of sub spans
nbSubSpanBefore = beginStr.substr( lastEndPos ).split('<span').length-1;
}
// there is no sub-span before
if( nbSubSpanBefore == 0 )
{
textNode = parentSpan.firstChild;
}
// we need to find where is the text node modified
else
{
// take the last direct child (no sub-child)
lastSubSpan = parentSpan.getElementsByTagName('span')[ nbSubSpanBefore - 1 ];
while( lastSubSpan.parentNode != parentSpan )
{
lastSubSpan = lastSubSpan.parentNode;
}
// associate to next text node following the last sub span
if( lastSubSpan.nextSibling == null || lastSubSpan.nextSibling.nodeType != 3 )
{
textNode = document.createTextNode('');
lastSubSpan.parentNode.insertBefore( textNode, lastSubSpan.nextSibling );
}
else
{
textNode = lastSubSpan.nextSibling;
}
}
//--------]
//--------[
// update the textNode content
// number of caracters after the last opened of closed span
//nbUnchangedChars = ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 ? beginStr.length : beginStr.length - ( lastIndex + 1 );
//nbUnchangedChars = ? beginStr.length : beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
if( ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 )
{
nbUnchangedChars = beginStr.length;
}
else
{
nbUnchangedChars = beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
//nbUnchangedChars += beginStr.substr( ).replace( /&/g, '&amp;').replace( /</g, '&lt;').replace( />/g, '&gt;').length - beginStr.length;
}
//alert( nbUnchangedChars );
// console.log( span, textNode, nbOpendedSpan,nbClosedSpan, span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
// alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length );
// console.log( nbUnchangedChars, lastIndex, beginStr.length, beginStr.replace(/&/g, '&amp;'), lastHtml.length, '|', newHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/g, 'r'), lastHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/, 'r') );
// console.log( textNode.data.replace(/&/g, '&amp;') );
// IE only manage \r for cariage return in textNode and not \n or \r\n
if( t.isIE )
{
nbUnchangedChars -= ( beginStr.substr( beginStr.length - nbUnchangedChars ).split("\n").length - 1 );
//alert( textNode.data.replace(/\r/g, '_r').replace(/\n/g, '_n'));
textNode.replaceData( nbUnchangedChars, lastHtml.replace(/\n/g, '').length, newHtml.replace(/\n/g, '') );
}
else
{
textNode.replaceData( nbUnchangedChars, lastHtml.length, newHtml );
}
//--------]
}
}
// an exception shouldn't occured but if replaceData failed at least it won't break everything
catch( e )
{
// throw e;
// console.log( e );
doHtmlOpti = false;
}
}
/*** END HTML update's optimisation ***/
// end test
// console.log( (TPS6-TPS5), (TPS5-TPS4), (TPS4-TPS3), (TPS3-TPS2), (TPS2-TPS1), _CPT );
// get the new highlight content
tpsAfterOpti2 = new Date().getTime();
hightlighted_text = stay_begin + updated_highlight + stay_end;
if( !doHtmlOpti )
{
// update the content of the highlight div by first updating a clone node (as there is no display in the same time for t node it's quite faster (5*))
var new_Obj= t.content_highlight.cloneNode(false);
if( ( t.isIE && t.isIE < 8 ) || ( t.isOpera && t.isOpera < 9.6 ) )
new_Obj.innerHTML= "<pre><span class='"+ t.settings["syntax"] +"'>" + hightlighted_text + "</span></pre>";
else
new_Obj.innerHTML= "<span class='"+ t.settings["syntax"] +"'>"+ hightlighted_text +"</span>";
t.content_highlight.parentNode.replaceChild(new_Obj, t.content_highlight);
t.content_highlight= new_Obj;
}
t.last_text_to_highlight= infos["full_text"];
t.last_hightlighted_text= hightlighted_text;
tps3=new Date().getTime();
if(t.settings["debug"]){
//lineNumber=tab_text.length;
//t.debug.value+=" \nNB char: "+_$("src").value.length+" Nb line: "+ lineNumber;
t.debug.value= "Tps optimisation "+(tps_end_opti-tps_start)
+" | tps reg exp: "+ (tpsAfterReg-tps_end_opti)
+" | tps opti HTML : "+ (tpsAfterOpti2-tpsAfterReg) + ' '+ ( doHtmlOpti ? 'yes' : 'no' )
+" | tps update highlight content: "+ (tps3-tpsAfterOpti2)
+" | tpsTotal: "+ (tps3-tps_start)
+ "("+tps3+")\n"+ debug_opti;
// t.debug.value+= "highlight\n"+hightlighted_text;*/
}
};
EditArea.prototype.resync_highlight= function(reload_now){
this.reload_highlight=true;
this.last_text_to_highlight="";
this.focus();
if(reload_now)
this.check_line_selection(false);
};
// change_to: "on" or "off"
EditArea.prototype.change_highlight= function(change_to){
if(this.settings["syntax"].length==0 && change_to==false){
this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
return false;
}
if(this.do_highlight==change_to)
return false;
this.getIESelection();
var pos_start= this.textarea.selectionStart;
var pos_end= this.textarea.selectionEnd;
if(this.do_highlight===true || change_to==false)
this.disable_highlight();
else
this.enable_highlight();
this.textarea.focus();
this.textarea.selectionStart = pos_start;
this.textarea.selectionEnd = pos_end;
this.setIESelection();
};
EditArea.prototype.disable_highlight= function(displayOnly){
var t= this, a=t.textarea, new_Obj, old_class, new_class;
t.selection_field.innerHTML="";
t.selection_field_text.innerHTML="";
t.content_highlight.style.visibility="hidden";
// replacing the node is far more faster than deleting it's content in firefox
new_Obj= t.content_highlight.cloneNode(false);
new_Obj.innerHTML= "";
t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
t.content_highlight.parentNode.removeChild(t.content_highlight);
t.content_highlight= new_Obj;
old_class= parent.getAttribute( a,"class" );
if(old_class){
new_class= old_class.replace( "hidden","" );
parent.setAttribute( a, "class", new_class );
}
a.style.backgroundColor="transparent"; // needed in order to see the bracket finders
//var icon= document.getElementById("highlight");
//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
//t.restoreClass(icon);
//t.switchClass(icon,'editAreaButtonNormal');
t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
t.do_highlight=false;
t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
t.change_smooth_selection_mode(false);
}
// this.textarea.style.backgroundColor="#FFFFFF";
};
EditArea.prototype.enable_highlight= function(){
var t=this, a=t.textarea, new_class;
t.show_waiting_screen();
t.content_highlight.style.visibility="visible";
new_class =parent.getAttribute(a,"class")+" hidden";
parent.setAttribute( a, "class", new_class );
// IE can't manage mouse click outside text range without this
if( t.isIE )
a.style.backgroundColor="#FFFFFF";
t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
t.smooth_selection_before_highlight=t.smooth_selection;
if(!t.smooth_selection)
t.change_smooth_selection_mode(true);
t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
t.do_highlight=true;
t.resync_highlight();
t.hide_waiting_screen();
};
/**
* Ask to update highlighted text
* @param Array infos - Array of datas returned by EditArea.get_selection_infos()
*/
EditArea.prototype.maj_highlight= function(infos){
// for speed mesure
var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
var t=this, hightlighted_text, updated_highlight;
var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
return;
// OPTIMISATION: will search to update only changed lines
if(t.reload_highlight===true){
t.reload_highlight=false;
}else if(textToHighlight.length==0){
textToHighlight="\n ";
}else{
// get text change datas
changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
// check if it can only reparse the changed text
trace_new = t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
trace_last = t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
doSyntaxOpti = ( trace_new == trace_last );
// check if the difference comes only from a new line created
// => we have to remember that the editor can automaticaly add tabulation or space after the new line)
if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
{
doSyntaxOpti = true;
}
// we do the syntax optimisation
if( doSyntaxOpti ){
tps_middle_opti=new Date().getTime();
stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
if(changes.lineStart>0)
stay_begin+= "\n";
stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
if(stay_end.length>0)
stay_end= "\n"+stay_end;
// Final check to see that we're not in the middle of span tags
if( stay_begin.split('<span').length != stay_begin.split('</span').length
|| stay_end.split('<span').length != stay_end.split('</span').length )
{
doSyntaxOpti = false;
stay_end = '';
stay_begin = '';
}
else
{
if(stay_begin.length==0 && changes.posLastEnd==-1)
changes.newTextLine+="\n";
textToHighlight=changes.newTextLine;
}
}
if(t.settings["debug"]){
var ch =changes;
debug_opti= ( doSyntaxOpti?"Optimisation": "No optimisation" )
+" start: "+ch.posStart +"("+ch.lineStart+")"
+" end_new: "+ ch.posNewEnd+"("+ch.lineNewEnd+")"
+" end_last: "+ ch.posLastEnd+"("+ch.lineLastEnd+")"
+"\nchanged_text: "+ch.newText+" => trace: "+trace_new
+"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
//debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
+ "\nchanged_line: "+ch.newTextLine
+ "\nlast_changed_line: "+ch.lastTextLine
+"\nstay_begin: "+ stay_begin.slice(-100)
+"\nstay_end: "+ stay_end.substr( 0, 100 );
//debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
//debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
//debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
+"\n";
}
// END OPTIMISATION
}
tps_end_opti = new Date().getTime();
// apply highlight
updated_highlight = t.colorize_text(textToHighlight);
tpsAfterReg = new Date().getTime();
/***
* see if we can optimize for updating only the required part of the HTML code
*
* The goal here will be to find the text node concerned by the modification and to update it
*/
//-------------------------------------------
// disable latest optimization tricks (introduced in 0.8.1 and removed in 0.8.2), TODO: check for another try later
doSyntaxOpti = doHtmlOpti = false;
if( doSyntaxOpti )
{
try
{
var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
replacedBloc = t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
lengthOld = replacedBloc.length;
lengthNew = updated_highlight.length;
// find the identical caracters at the beginning
for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
{
}
nbStart = i;
// find the identical caracters at the end
for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
{
}
nbEnd = i;
//console.log( nbStart, nbEnd, replacedBloc, updated_highlight );
// get the changes
lastHtml = replacedBloc.substring( nbStart, lengthOld - nbEnd );
newHtml = updated_highlight.substring( nbStart, lengthNew - nbEnd );
// We can do the optimisation only if we havn't touch to span elements
if( newHtml.indexOf('<span') == -1 && newHtml.indexOf('</span') == -1
&& lastHtml.indexOf('<span') == -1 && lastHtml.indexOf('</span') == -1 )
{
var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
doHtmlOpti = true;
beginStr = t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
// fix special chars
newHtml = newHtml.replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&');
nbOpendedSpan = beginStr.split('<span').length - 1;
nbClosedSpan = beginStr.split('</span').length - 1;
// retrieve the previously opened span (Add 1 for the first level span?)
span = t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];
//--------[
// get the textNode to update
// if we're inside a span, we'll take the one that is opened (can be a parent of the current span)
parentSpan = span;
maxStartOffset = maxEndOffset = 0;
// it will be in the child of the root node
if( nbOpendedSpan == nbClosedSpan )
{
while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' )
{
parentSpan = parentSpan.parentNode;
}
}
// get the last opened span
else
{
maxStartOffset = maxEndOffset = beginStr.length + 1;
// move to parent node for each closed span found after the lastest open span
nbClosed = beginStr.substr( Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ).split('</span').length - 1;
while( nbClosed > 0 )
{
nbClosed--;
parentSpan = parentSpan.parentNode;
}
// find the position of the last opended tag
while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' && ( tmpMaxStartOffset = Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ) < ( tmpMaxEndOffset = Math.max( 0, beginStr.lastIndexOf( '</span', maxEndOffset - 1 ) ) ) )
{
maxStartOffset = tmpMaxStartOffset;
maxEndOffset = tmpMaxEndOffset;
}
}
// Note: maxEndOffset is no more used but maxStartOffset will be used
if( parentSpan.parentNode == t.content_highlight || parentSpan.parentNode.tagName == 'PRE' )
{
maxStartOffset = Math.max( 0, beginStr.indexOf( '<span' ) );
}
// find the matching text node (this will be one that will be at the end of the beginStr
if( maxStartOffset == beginStr.length )
{
nbSubSpanBefore = 0;
}
else
{
lastEndPos = Math.max( 0, beginStr.lastIndexOf( '>', maxStartOffset ) );
// count the number of sub spans
nbSubSpanBefore = beginStr.substr( lastEndPos ).split('<span').length-1;
}
// there is no sub-span before
if( nbSubSpanBefore == 0 )
{
textNode = parentSpan.firstChild;
}
// we need to find where is the text node modified
else
{
// take the last direct child (no sub-child)
lastSubSpan = parentSpan.getElementsByTagName('span')[ nbSubSpanBefore - 1 ];
while( lastSubSpan.parentNode != parentSpan )
{
lastSubSpan = lastSubSpan.parentNode;
}
// associate to next text node following the last sub span
if( lastSubSpan.nextSibling == null || lastSubSpan.nextSibling.nodeType != 3 )
{
textNode = document.createTextNode('');
lastSubSpan.parentNode.insertBefore( textNode, lastSubSpan.nextSibling );
}
else
{
textNode = lastSubSpan.nextSibling;
}
}
//--------]
//--------[
// update the textNode content
// number of caracters after the last opened of closed span
//nbUnchangedChars = ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 ? beginStr.length : beginStr.length - ( lastIndex + 1 );
//nbUnchangedChars = ? beginStr.length : beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
if( ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 )
{
nbUnchangedChars = beginStr.length;
}
else
{
nbUnchangedChars = beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
//nbUnchangedChars += beginStr.substr( ).replace( /&/g, '&amp;').replace( /</g, '&lt;').replace( />/g, '&gt;').length - beginStr.length;
}
//alert( nbUnchangedChars );
// console.log( span, textNode, nbOpendedSpan,nbClosedSpan, span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
// alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length );
// console.log( nbUnchangedChars, lastIndex, beginStr.length, beginStr.replace(/&/g, '&amp;'), lastHtml.length, '|', newHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/g, 'r'), lastHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/, 'r') );
// console.log( textNode.data.replace(/&/g, '&amp;') );
// IE only manage \r for cariage return in textNode and not \n or \r\n
if( t.isIE )
{
nbUnchangedChars -= ( beginStr.substr( beginStr.length - nbUnchangedChars ).split("\n").length - 1 );
//alert( textNode.data.replace(/\r/g, '_r').replace(/\n/g, '_n'));
textNode.replaceData( nbUnchangedChars, lastHtml.replace(/\n/g, '').length, newHtml.replace(/\n/g, '') );
}
else
{
textNode.replaceData( nbUnchangedChars, lastHtml.length, newHtml );
}
//--------]
}
}
// an exception shouldn't occured but if replaceData failed at least it won't break everything
catch( e )
{
// throw e;
// console.log( e );
doHtmlOpti = false;
}
}
/*** END HTML update's optimisation ***/
// end test
// console.log( (TPS6-TPS5), (TPS5-TPS4), (TPS4-TPS3), (TPS3-TPS2), (TPS2-TPS1), _CPT );
// get the new highlight content
tpsAfterOpti2 = new Date().getTime();
hightlighted_text = stay_begin + updated_highlight + stay_end;
if( !doHtmlOpti )
{
// update the content of the highlight div by first updating a clone node (as there is no display in the same time for t node it's quite faster (5*))
var new_Obj= t.content_highlight.cloneNode(false);
if( ( t.isIE && t.isIE < 8 ) || ( t.isOpera && t.isOpera < 9.6 ) )
new_Obj.innerHTML= "<pre><span class='"+ t.settings["syntax"] +"'>" + hightlighted_text + "</span></pre>";
else
new_Obj.innerHTML= "<span class='"+ t.settings["syntax"] +"'>"+ hightlighted_text +"</span>";
t.content_highlight.parentNode.replaceChild(new_Obj, t.content_highlight);
t.content_highlight= new_Obj;
}
t.last_text_to_highlight= infos["full_text"];
t.last_hightlighted_text= hightlighted_text;
tps3=new Date().getTime();
if(t.settings["debug"]){
//lineNumber=tab_text.length;
//t.debug.value+=" \nNB char: "+_$("src").value.length+" Nb line: "+ lineNumber;
t.debug.value= "Tps optimisation "+(tps_end_opti-tps_start)
+" | tps reg exp: "+ (tpsAfterReg-tps_end_opti)
+" | tps opti HTML : "+ (tpsAfterOpti2-tpsAfterReg) + ' '+ ( doHtmlOpti ? 'yes' : 'no' )
+" | tps update highlight content: "+ (tps3-tpsAfterOpti2)
+" | tpsTotal: "+ (tps3-tps_start)
+ "("+tps3+")\n"+ debug_opti;
// t.debug.value+= "highlight\n"+hightlighted_text;*/
}
};
EditArea.prototype.resync_highlight= function(reload_now){
this.reload_highlight=true;
this.last_text_to_highlight="";
this.focus();
if(reload_now)
this.check_line_selection(false);
};

View File

@@ -1,145 +1,145 @@
var EA_keys = {8:"Retour arriere",9:"Tabulation",12:"Milieu (pave numerique)",13:"Entrer",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Verr Maj",27:"Esc",32:"Space",33:"Page up",34:"Page down",35:"End",36:"Begin",37:"Left",38:"Up",39:"Right",40:"Down",44:"Impr ecran",45:"Inser",46:"Suppr",91:"Menu Demarrer Windows / touche pomme Mac",92:"Menu Demarrer Windows",93:"Menu contextuel Windows",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Verr Num",145:"Arret defil"};
function keyDown(e){
if(!e){ // if IE
e=event;
}
// send the event to the plugins
for(var i in editArea.plugins){
if(typeof(editArea.plugins[i].onkeydown)=="function"){
if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging
if(editArea.isIE)
e.keyCode=0;
return false;
}
}
}
var target_id=(e.target || e.srcElement).id;
var use=false;
if (EA_keys[e.keyCode])
letter=EA_keys[e.keyCode];
else
letter=String.fromCharCode(e.keyCode);
var low_letter= letter.toLowerCase();
if(letter=="Page up" && !AltPressed(e) && !editArea.isOpera){
editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
use=true;
}else if(letter=="Page down" && !AltPressed(e) && !editArea.isOpera){
editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
use=true;
}else if(editArea.is_editable==false){
// do nothing but also do nothing else (allow to navigate with page up and page down)
return true;
}else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){
if(ShiftPressed(e))
editArea.execCommand("invert_tab_selection");
else
editArea.execCommand("tab_selection");
use=true;
if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) ) // opera && firefox mac can't cancel tabulation events...
setTimeout("editArea.execCommand('focus');", 1);
}else if(letter=="Entrer" && target_id=="textarea"){
if(editArea.press_enter())
use=true;
}else if(letter=="Entrer" && target_id=="area_search"){
editArea.execCommand("area_search");
use=true;
}else if(letter=="Esc"){
editArea.execCommand("close_all_inline_popup", e);
use=true;
}else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
switch(low_letter){
case "f":
editArea.execCommand("area_search");
use=true;
break;
case "r":
editArea.execCommand("area_replace");
use=true;
break;
case "q":
editArea.execCommand("close_all_inline_popup", e);
use=true;
break;
case "h":
editArea.execCommand("change_highlight");
use=true;
break;
case "g":
setTimeout("editArea.execCommand('go_to_line');", 5); // the prompt stop the return false otherwise
use=true;
break;
case "e":
editArea.execCommand("show_help");
use=true;
break;
case "z":
use=true;
editArea.execCommand("undo");
break;
case "y":
use=true;
editArea.execCommand("redo");
break;
default:
break;
}
}
// check to disable the redo possibility if the textarea content change
if(editArea.next.length > 0){
setTimeout("editArea.check_redo();", 10);
}
setTimeout("editArea.check_file_changes();", 10);
if(use){
// in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action
if(editArea.isIE)
e.keyCode=0;
return false;
}
//alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
return true;
};
// return true if Alt key is pressed
function AltPressed(e) {
if (window.event) {
return (window.event.altKey);
} else {
if(e.modifiers)
return (e.altKey || (e.modifiers % 2));
else
return e.altKey;
}
};
// return true if Ctrl key is pressed
function CtrlPressed(e) {
if (window.event) {
return (window.event.ctrlKey);
} else {
return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
}
};
// return true if Shift key is pressed
function ShiftPressed(e) {
if (window.event) {
return (window.event.shiftKey);
} else {
return (e.shiftKey || (e.modifiers>3));
}
};
var EA_keys = {8:"Retour arriere",9:"Tabulation",12:"Milieu (pave numerique)",13:"Entrer",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Verr Maj",27:"Esc",32:"Space",33:"Page up",34:"Page down",35:"End",36:"Begin",37:"Left",38:"Up",39:"Right",40:"Down",44:"Impr ecran",45:"Inser",46:"Suppr",91:"Menu Demarrer Windows / touche pomme Mac",92:"Menu Demarrer Windows",93:"Menu contextuel Windows",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Verr Num",145:"Arret defil"};
function keyDown(e){
if(!e){ // if IE
e=event;
}
// send the event to the plugins
for(var i in editArea.plugins){
if(typeof(editArea.plugins[i].onkeydown)=="function"){
if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging
if(editArea.isIE)
e.keyCode=0;
return false;
}
}
}
var target_id=(e.target || e.srcElement).id;
var use=false;
if (EA_keys[e.keyCode])
letter=EA_keys[e.keyCode];
else
letter=String.fromCharCode(e.keyCode);
var low_letter= letter.toLowerCase();
if(letter=="Page up" && !AltPressed(e) && !editArea.isOpera){
editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
use=true;
}else if(letter=="Page down" && !AltPressed(e) && !editArea.isOpera){
editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
use=true;
}else if(editArea.is_editable==false){
// do nothing but also do nothing else (allow to navigate with page up and page down)
return true;
}else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){
if(ShiftPressed(e))
editArea.execCommand("invert_tab_selection");
else
editArea.execCommand("tab_selection");
use=true;
if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) ) // opera && firefox mac can't cancel tabulation events...
setTimeout("editArea.execCommand('focus');", 1);
}else if(letter=="Entrer" && target_id=="textarea"){
if(editArea.press_enter())
use=true;
}else if(letter=="Entrer" && target_id=="area_search"){
editArea.execCommand("area_search");
use=true;
}else if(letter=="Esc"){
editArea.execCommand("close_all_inline_popup", e);
use=true;
}else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
switch(low_letter){
case "f":
editArea.execCommand("area_search");
use=true;
break;
case "r":
editArea.execCommand("area_replace");
use=true;
break;
case "q":
editArea.execCommand("close_all_inline_popup", e);
use=true;
break;
case "h":
editArea.execCommand("change_highlight");
use=true;
break;
case "g":
setTimeout("editArea.execCommand('go_to_line');", 5); // the prompt stop the return false otherwise
use=true;
break;
case "e":
editArea.execCommand("show_help");
use=true;
break;
case "z":
use=true;
editArea.execCommand("undo");
break;
case "y":
use=true;
editArea.execCommand("redo");
break;
default:
break;
}
}
// check to disable the redo possibility if the textarea content change
if(editArea.next.length > 0){
setTimeout("editArea.check_redo();", 10);
}
setTimeout("editArea.check_file_changes();", 10);
if(use){
// in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action
if(editArea.isIE)
e.keyCode=0;
return false;
}
//alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
return true;
};
// return true if Alt key is pressed
function AltPressed(e) {
if (window.event) {
return (window.event.altKey);
} else {
if(e.modifiers)
return (e.altKey || (e.modifiers % 2));
else
return e.altKey;
}
};
// return true if Ctrl key is pressed
function CtrlPressed(e) {
if (window.event) {
return (window.event.ctrlKey);
} else {
return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
}
};
// return true if Shift key is pressed
function ShiftPressed(e) {
if (window.event) {
return (window.event.shiftKey);
} else {
return (e.shiftKey || (e.modifiers>3));
}
};

View File

@@ -1,54 +1,54 @@
/*
* Bulgarian translation
* Author: Valentin Hristov
* Company: SOFTKIT Bulgarian
* Site: http://www.softkit-bg.com
*/
editAreaLoader.lang["bg"]={
new_document: "нов документ",
search_button: "търсене и замяна",
search_command: "търси следващия / отвори прозорец с търсачка",
search: "търсене",
replace: "замяна",
replace_command: "замяна / отвори прозорец с търсачка",
find_next: "намери следващия",
replace_all: "замени всички",
reg_exp: "реголярни изрази",
match_case: "чуствителен към регистъра",
not_found: "няма резултат.",
occurrence_replaced: "замяната е осъществена.",
search_field_empty: "Полето за търсене е празно",
restart_search_at_begin: "До края на документа. Почни с началото.",
move_popup: "премести прозореца с търсачката",
font_size: "--Размер на шрифта--",
go_to_line: "премени към реда",
go_to_line_prompt: "премени към номера на реда:",
undo: "отмени",
redo: "върни",
change_smooth_selection: "включи/изключи някой от функциите за преглед (по красиво, но повече натоварва)",
highlight: "превключване на оцветяване на синтаксиса включена/изключена",
reset_highlight: "въстанови оцветяване на синтаксиса (ако не е синхронизиран с текста)",
word_wrap: "режим на пренасяне на дълги редове",
help: "за програмата",
save: "съхрани",
load: "зареди",
line_abbr: "Стр",
char_abbr: "Стлб",
position: "Позиция",
total: "Всичко",
close_popup: "затвори прозореца",
shortcuts: "Бързи клавиши",
add_tab: "добави табулация в текста",
remove_tab: "премахни табулацията в текста",
about_notice: "Внимание: използвайте функцията оцветяване на синтаксиса само за малки текстове",
toggle: "Превключи редактор",
accesskey: "Бърз клавиш",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Зареждане...",
fullscreen: "на цял екран",
syntax_selection: "--Синтаксис--",
close_tab: "Затвори файла"
};
/*
* Bulgarian translation
* Author: Valentin Hristov
* Company: SOFTKIT Bulgarian
* Site: http://www.softkit-bg.com
*/
editAreaLoader.lang["bg"]={
new_document: "нов документ",
search_button: "търсене и замяна",
search_command: "търси следващия / отвори прозорец с търсачка",
search: "търсене",
replace: "замяна",
replace_command: "замяна / отвори прозорец с търсачка",
find_next: "намери следващия",
replace_all: "замени всички",
reg_exp: "реголярни изрази",
match_case: "чуствителен към регистъра",
not_found: "няма резултат.",
occurrence_replaced: "замяната е осъществена.",
search_field_empty: "Полето за търсене е празно",
restart_search_at_begin: "До края на документа. Почни с началото.",
move_popup: "премести прозореца с търсачката",
font_size: "--Размер на шрифта--",
go_to_line: "премени към реда",
go_to_line_prompt: "премени към номера на реда:",
undo: "отмени",
redo: "върни",
change_smooth_selection: "включи/изключи някой от функциите за преглед (по красиво, но повече натоварва)",
highlight: "превключване на оцветяване на синтаксиса включена/изключена",
reset_highlight: "въстанови оцветяване на синтаксиса (ако не е синхронизиран с текста)",
word_wrap: "режим на пренасяне на дълги редове",
help: "за програмата",
save: "съхрани",
load: "зареди",
line_abbr: "Стр",
char_abbr: "Стлб",
position: "Позиция",
total: "Всичко",
close_popup: "затвори прозореца",
shortcuts: "Бързи клавиши",
add_tab: "добави табулация в текста",
remove_tab: "премахни табулацията в текста",
about_notice: "Внимание: използвайте функцията оцветяване на синтаксиса само за малки текстове",
toggle: "Превключи редактор",
accesskey: "Бърз клавиш",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Зареждане...",
fullscreen: "на цял екран",
syntax_selection: "--Синтаксис--",
close_tab: "Затвори файла"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["cs"]={
new_document: "Nový dokument",
search_button: "Najdi a nahraď",
search_command: "Hledej další / otevři vyhledávací pole",
search: "Hledej",
replace: "Nahraď",
replace_command: "Nahraď / otevři vyhledávací pole",
find_next: "Najdi další",
replace_all: "Nahraď vše",
reg_exp: "platné výrazy",
match_case: "vyhodnocené výrazy",
not_found: "nenalezené.",
occurrence_replaced: "výskyty nahrazené.",
search_field_empty: "Pole vyhledávání je prázdné",
restart_search_at_begin: "Dosažen konec souboru, začínám od začátku.",
move_popup: "Přesuň vyhledávací okno",
font_size: "--Velikost textu--",
go_to_line: "Přejdi na řádek",
go_to_line_prompt: "Přejdi na řádek:",
undo: "krok zpět",
redo: "znovu",
change_smooth_selection: "Povolit nebo zakázat některé ze zobrazených funkcí (účelnější zobrazení požaduje větší zatížení procesoru)",
highlight: "Zvýrazňování syntaxe zap./vyp.",
reset_highlight: "Obnovit zvýraznění (v případě nesrovnalostí)",
word_wrap: "toggle word wrapping mode",
help: "O programu",
save: "Uložit",
load: "Otevřít",
line_abbr: "Ř.",
char_abbr: "S.",
position: "Pozice",
total: "Celkem",
close_popup: "Zavřít okno",
shortcuts: "Zkratky",
add_tab: "Přidat tabulování textu",
remove_tab: "Odtsranit tabulování textu",
about_notice: "Upozornění! Funkce zvýrazňování textu je k dispozici pouze pro malý text",
toggle: "Přepnout editor",
accesskey: "Přístupová klávesa",
tab: "Záložka",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Zpracovávám ...",
fullscreen: "Celá obrazovka",
syntax_selection: "--vyber zvýrazňovač--",
close_tab: "Close file"
};
editAreaLoader.lang["cs"]={
new_document: "Nový dokument",
search_button: "Najdi a nahraď",
search_command: "Hledej další / otevři vyhledávací pole",
search: "Hledej",
replace: "Nahraď",
replace_command: "Nahraď / otevři vyhledávací pole",
find_next: "Najdi další",
replace_all: "Nahraď vše",
reg_exp: "platné výrazy",
match_case: "vyhodnocené výrazy",
not_found: "nenalezené.",
occurrence_replaced: "výskyty nahrazené.",
search_field_empty: "Pole vyhledávání je prázdné",
restart_search_at_begin: "Dosažen konec souboru, začínám od začátku.",
move_popup: "Přesuň vyhledávací okno",
font_size: "--Velikost textu--",
go_to_line: "Přejdi na řádek",
go_to_line_prompt: "Přejdi na řádek:",
undo: "krok zpět",
redo: "znovu",
change_smooth_selection: "Povolit nebo zakázat některé ze zobrazených funkcí (účelnější zobrazení požaduje větší zatížení procesoru)",
highlight: "Zvýrazňování syntaxe zap./vyp.",
reset_highlight: "Obnovit zvýraznění (v případě nesrovnalostí)",
word_wrap: "toggle word wrapping mode",
help: "O programu",
save: "Uložit",
load: "Otevřít",
line_abbr: "Ř.",
char_abbr: "S.",
position: "Pozice",
total: "Celkem",
close_popup: "Zavřít okno",
shortcuts: "Zkratky",
add_tab: "Přidat tabulování textu",
remove_tab: "Odtsranit tabulování textu",
about_notice: "Upozornění! Funkce zvýrazňování textu je k dispozici pouze pro malý text",
toggle: "Přepnout editor",
accesskey: "Přístupová klávesa",
tab: "Záložka",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Zpracovávám ...",
fullscreen: "Celá obrazovka",
syntax_selection: "--vyber zvýrazňovač--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["de"]={
new_document: "Neues Dokument",
search_button: "Suchen und Ersetzen",
search_command: "Weitersuchen / &ouml;ffne Suchfeld",
search: "Suchen",
replace: "Ersetzen",
replace_command: "Ersetzen / &ouml;ffne Suchfeld",
find_next: "Weitersuchen",
replace_all: "Ersetze alle Treffer",
reg_exp: "regul&auml;re Ausdr&uuml;cke",
match_case: "passt auf den Begriff<br />",
not_found: "Nicht gefunden.",
occurrence_replaced: "Die Vorkommen wurden ersetzt.",
search_field_empty: "Leeres Suchfeld",
restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
move_popup: "Suchfenster bewegen",
font_size: "--Schriftgr&ouml;&szlig;e--",
go_to_line: "Gehe zu Zeile",
go_to_line_prompt: "Gehe zu Zeilennummmer:",
undo: "R&uuml;ckg&auml;ngig",
redo: "Wiederherstellen",
change_smooth_selection: "Aktiviere/Deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
highlight: "Syntax Highlighting an- und ausschalten",
reset_highlight: "Highlighting zur&uuml;cksetzen (falls mit Text nicht konform)",
word_wrap: "Toggle word wrapping mode",
help: "Info",
save: "Speichern",
load: "&Ouml;ffnen",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Gesamt",
close_popup: "Popup schlie&szlig;en",
shortcuts: "Shortcuts",
add_tab: "Tab zum Text hinzuf&uuml;gen",
remove_tab: "Tab aus Text entfernen",
about_notice: "Bemerkung: Syntax Highlighting ist nur f&uuml;r kurze Texte",
toggle: "Editor an- und ausschalten",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In Bearbeitung...",
fullscreen: "Full-Screen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["de"]={
new_document: "Neues Dokument",
search_button: "Suchen und Ersetzen",
search_command: "Weitersuchen / &ouml;ffne Suchfeld",
search: "Suchen",
replace: "Ersetzen",
replace_command: "Ersetzen / &ouml;ffne Suchfeld",
find_next: "Weitersuchen",
replace_all: "Ersetze alle Treffer",
reg_exp: "regul&auml;re Ausdr&uuml;cke",
match_case: "passt auf den Begriff<br />",
not_found: "Nicht gefunden.",
occurrence_replaced: "Die Vorkommen wurden ersetzt.",
search_field_empty: "Leeres Suchfeld",
restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
move_popup: "Suchfenster bewegen",
font_size: "--Schriftgr&ouml;&szlig;e--",
go_to_line: "Gehe zu Zeile",
go_to_line_prompt: "Gehe zu Zeilennummmer:",
undo: "R&uuml;ckg&auml;ngig",
redo: "Wiederherstellen",
change_smooth_selection: "Aktiviere/Deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
highlight: "Syntax Highlighting an- und ausschalten",
reset_highlight: "Highlighting zur&uuml;cksetzen (falls mit Text nicht konform)",
word_wrap: "Toggle word wrapping mode",
help: "Info",
save: "Speichern",
load: "&Ouml;ffnen",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Gesamt",
close_popup: "Popup schlie&szlig;en",
shortcuts: "Shortcuts",
add_tab: "Tab zum Text hinzuf&uuml;gen",
remove_tab: "Tab aus Text entfernen",
about_notice: "Bemerkung: Syntax Highlighting ist nur f&uuml;r kurze Texte",
toggle: "Editor an- und ausschalten",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In Bearbeitung...",
fullscreen: "Full-Screen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["dk"]={
new_document: "nyt tomt dokument",
search_button: "s&oslash;g og erstat",
search_command: "find n&aelig;ste / &aring;ben s&oslash;gefelt",
search: "s&oslash;g",
replace: "erstat",
replace_command: "erstat / &aring;ben s&oslash;gefelt",
find_next: "find n&aelig;ste",
replace_all: "erstat alle",
reg_exp: "regular expressions",
match_case: "forskel på store/sm&aring; bogstaver<br />",
not_found: "not found.",
occurrence_replaced: "occurences replaced.",
search_field_empty: "Search field empty",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "flyt søgepopup",
font_size: "--Skriftstørrelse--",
go_to_line: "g&aring; til linie",
go_to_line_prompt: "gå til linienummer:",
undo: "fortryd",
redo: "gentag",
change_smooth_selection: "sl&aring; display funktioner til/fra (smartere display men mere CPU kr&aelig;vende)",
highlight: "sl&aring; syntax highlight til/fra",
reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
word_wrap: "toggle word wrapping mode",
help: "om",
save: "gem",
load: "hent",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "luk popup",
shortcuts: "Genveje",
add_tab: "tilf&oslash;j tabulation til tekst",
remove_tab: "fjern tabulation fra tekst",
about_notice: "Husk: syntax highlight funktionen b&oslash;r kun bruge til sm&aring; tekster",
toggle: "Sl&aring; editor til / fra",
accesskey: "Accesskey",
tab: "Tab",
shift: "Skift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processing...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["dk"]={
new_document: "nyt tomt dokument",
search_button: "s&oslash;g og erstat",
search_command: "find n&aelig;ste / &aring;ben s&oslash;gefelt",
search: "s&oslash;g",
replace: "erstat",
replace_command: "erstat / &aring;ben s&oslash;gefelt",
find_next: "find n&aelig;ste",
replace_all: "erstat alle",
reg_exp: "regular expressions",
match_case: "forskel på store/sm&aring; bogstaver<br />",
not_found: "not found.",
occurrence_replaced: "occurences replaced.",
search_field_empty: "Search field empty",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "flyt søgepopup",
font_size: "--Skriftstørrelse--",
go_to_line: "g&aring; til linie",
go_to_line_prompt: "gå til linienummer:",
undo: "fortryd",
redo: "gentag",
change_smooth_selection: "sl&aring; display funktioner til/fra (smartere display men mere CPU kr&aelig;vende)",
highlight: "sl&aring; syntax highlight til/fra",
reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
word_wrap: "toggle word wrapping mode",
help: "om",
save: "gem",
load: "hent",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "luk popup",
shortcuts: "Genveje",
add_tab: "tilf&oslash;j tabulation til tekst",
remove_tab: "fjern tabulation fra tekst",
about_notice: "Husk: syntax highlight funktionen b&oslash;r kun bruge til sm&aring; tekster",
toggle: "Sl&aring; editor til / fra",
accesskey: "Accesskey",
tab: "Tab",
shift: "Skift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processing...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["en"]={
new_document: "new empty document",
search_button: "search and replace",
search_command: "search next / open search area",
search: "search",
replace: "replace",
replace_command: "replace / open search area",
find_next: "find next",
replace_all: "replace all",
reg_exp: "regular expressions",
match_case: "match case",
not_found: "not found.",
occurrence_replaced: "occurences replaced.",
search_field_empty: "Search field empty",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "move search popup",
font_size: "--Font size--",
go_to_line: "go to line",
go_to_line_prompt: "go to line number:",
undo: "undo",
redo: "redo",
change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
highlight: "toggle syntax highlight on/off",
reset_highlight: "reset highlight (if desyncronized from text)",
word_wrap: "toggle word wrapping mode",
help: "about",
save: "save",
load: "load",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "close popup",
shortcuts: "Shortcuts",
add_tab: "add tabulation to text",
remove_tab: "remove tabulation to text",
about_notice: "Notice: syntax highlight function is only for small text",
toggle: "Toggle editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processing...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["en"]={
new_document: "new empty document",
search_button: "search and replace",
search_command: "search next / open search area",
search: "search",
replace: "replace",
replace_command: "replace / open search area",
find_next: "find next",
replace_all: "replace all",
reg_exp: "regular expressions",
match_case: "match case",
not_found: "not found.",
occurrence_replaced: "occurences replaced.",
search_field_empty: "Search field empty",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "move search popup",
font_size: "--Font size--",
go_to_line: "go to line",
go_to_line_prompt: "go to line number:",
undo: "undo",
redo: "redo",
change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
highlight: "toggle syntax highlight on/off",
reset_highlight: "reset highlight (if desyncronized from text)",
word_wrap: "toggle word wrapping mode",
help: "about",
save: "save",
load: "load",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "close popup",
shortcuts: "Shortcuts",
add_tab: "add tabulation to text",
remove_tab: "remove tabulation to text",
about_notice: "Notice: syntax highlight function is only for small text",
toggle: "Toggle editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processing...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["eo"]={
new_document: "nova dokumento (vakigas la enhavon)",
search_button: "ser&#265;i / anstata&#365;igi",
search_command: "pluser&#265;i / malfermi la ser&#265;o-fenestron",
search: "ser&#265;i",
replace: "anstata&#365;igi",
replace_command: "anstata&#365;igi / malfermi la ser&#265;o-fenestron",
find_next: "ser&#265;i",
replace_all: "anstata&#365;igi &#265;ion",
reg_exp: "regula esprimo",
match_case: "respekti la usklecon",
not_found: "ne trovita.",
occurrence_replaced: "anstata&#365;igoj plenumitaj.",
search_field_empty: "La kampo estas malplena.",
restart_search_at_begin: "Fino de teksto &#285;isrirata, &#265;u da&#365;rigi el la komenco?",
move_popup: "movi la ser&#265;o-fenestron",
font_size: "--Tipara grando--",
go_to_line: "iri al la linio",
go_to_line_prompt: "iri al la linio numero:",
undo: "rezigni",
redo: "refari",
change_smooth_selection: "ebligi/malebligi la funkcioj de vidigo (pli bona vidigo, sed pli da &#349;ar&#285;o de la &#265;eforgano)",
highlight: "ebligi/malebligi la sintaksan kolorigon",
reset_highlight: "repravalorizi la sintaksan kolorigon (se malsinkronigon de la teksto)",
word_wrap: "toggle word wrapping mode",
help: "pri",
save: "registri",
load: "&#349;ar&#285;i",
line_abbr: "Ln",
char_abbr: "Sg",
position: "Pozicio",
total: "Sumo",
close_popup: "fermi la &#349;prucfenestron",
shortcuts: "Fulmoklavo",
add_tab: "aldoni tabon en la tekston",
remove_tab: "forigi tablon el la teksto",
about_notice: "Noto: la sintaksa kolorigo estas nur prikalkulita por mallongaj tekstoj.",
toggle: "baskuligi la redaktilon",
accesskey: "Fulmoklavo",
tab: "Tab",
shift: "Maj",
ctrl: "Ktrl",
esc: "Esk",
processing: "&#349;argante...",
fullscreen: "plenekrane",
syntax_selection: "--Sintakso--",
close_tab: "Fermi la dosieron"
editAreaLoader.lang["eo"]={
new_document: "nova dokumento (vakigas la enhavon)",
search_button: "ser&#265;i / anstata&#365;igi",
search_command: "pluser&#265;i / malfermi la ser&#265;o-fenestron",
search: "ser&#265;i",
replace: "anstata&#365;igi",
replace_command: "anstata&#365;igi / malfermi la ser&#265;o-fenestron",
find_next: "ser&#265;i",
replace_all: "anstata&#365;igi &#265;ion",
reg_exp: "regula esprimo",
match_case: "respekti la usklecon",
not_found: "ne trovita.",
occurrence_replaced: "anstata&#365;igoj plenumitaj.",
search_field_empty: "La kampo estas malplena.",
restart_search_at_begin: "Fino de teksto &#285;isrirata, &#265;u da&#365;rigi el la komenco?",
move_popup: "movi la ser&#265;o-fenestron",
font_size: "--Tipara grando--",
go_to_line: "iri al la linio",
go_to_line_prompt: "iri al la linio numero:",
undo: "rezigni",
redo: "refari",
change_smooth_selection: "ebligi/malebligi la funkcioj de vidigo (pli bona vidigo, sed pli da &#349;ar&#285;o de la &#265;eforgano)",
highlight: "ebligi/malebligi la sintaksan kolorigon",
reset_highlight: "repravalorizi la sintaksan kolorigon (se malsinkronigon de la teksto)",
word_wrap: "toggle word wrapping mode",
help: "pri",
save: "registri",
load: "&#349;ar&#285;i",
line_abbr: "Ln",
char_abbr: "Sg",
position: "Pozicio",
total: "Sumo",
close_popup: "fermi la &#349;prucfenestron",
shortcuts: "Fulmoklavo",
add_tab: "aldoni tabon en la tekston",
remove_tab: "forigi tablon el la teksto",
about_notice: "Noto: la sintaksa kolorigo estas nur prikalkulita por mallongaj tekstoj.",
toggle: "baskuligi la redaktilon",
accesskey: "Fulmoklavo",
tab: "Tab",
shift: "Maj",
ctrl: "Ktrl",
esc: "Esk",
processing: "&#349;argante...",
fullscreen: "plenekrane",
syntax_selection: "--Sintakso--",
close_tab: "Fermi la dosieron"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["es"]={
new_document: "nuevo documento vacío",
search_button: "buscar y reemplazar",
search_command: "buscar siguiente / abrir área de búsqueda",
search: "buscar",
replace: "reemplazar",
replace_command: "reemplazar / abrir área de búsqueda",
find_next: "encontrar siguiente",
replace_all: "reemplazar todos",
reg_exp: "expresiones regulares",
match_case: "coincidir capitalización",
not_found: "no encontrado.",
occurrence_replaced: "ocurrencias reemplazadas.",
search_field_empty: "Campo de búsqueda vacío",
restart_search_at_begin: "Se ha llegado al final del área. Se va a seguir desde el principio.",
move_popup: "mover la ventana de búsqueda",
font_size: "--Tamaño de la fuente--",
go_to_line: "ir a la línea",
go_to_line_prompt: "ir a la línea número:",
undo: "deshacer",
redo: "rehacer",
change_smooth_selection: "activar/desactivar algunas características de visualización (visualización más inteligente pero más carga de CPU)",
highlight: "intercambiar resaltado de sintaxis",
reset_highlight: "reinicializar resaltado (si no esta sincronizado con el texto)",
word_wrap: "toggle word wrapping mode",
help: "acerca",
save: "guardar",
load: "cargar",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posición",
total: "Total",
close_popup: "recuadro de cierre",
shortcuts: "Atajos",
add_tab: "añadir tabulado al texto",
remove_tab: "borrar tabulado del texto",
about_notice: "Aviso: el resaltado de sintaxis sólo funciona para texto pequeño",
toggle: "Cambiar editor",
accesskey: "Tecla de acceso",
tab: "Tab",
shift: "Mayúsc",
ctrl: "Ctrl",
esc: "Esc",
processing: "Procesando...",
fullscreen: "pantalla completa",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["es"]={
new_document: "nuevo documento vacío",
search_button: "buscar y reemplazar",
search_command: "buscar siguiente / abrir área de búsqueda",
search: "buscar",
replace: "reemplazar",
replace_command: "reemplazar / abrir área de búsqueda",
find_next: "encontrar siguiente",
replace_all: "reemplazar todos",
reg_exp: "expresiones regulares",
match_case: "coincidir capitalización",
not_found: "no encontrado.",
occurrence_replaced: "ocurrencias reemplazadas.",
search_field_empty: "Campo de búsqueda vacío",
restart_search_at_begin: "Se ha llegado al final del área. Se va a seguir desde el principio.",
move_popup: "mover la ventana de búsqueda",
font_size: "--Tamaño de la fuente--",
go_to_line: "ir a la línea",
go_to_line_prompt: "ir a la línea número:",
undo: "deshacer",
redo: "rehacer",
change_smooth_selection: "activar/desactivar algunas características de visualización (visualización más inteligente pero más carga de CPU)",
highlight: "intercambiar resaltado de sintaxis",
reset_highlight: "reinicializar resaltado (si no esta sincronizado con el texto)",
word_wrap: "toggle word wrapping mode",
help: "acerca",
save: "guardar",
load: "cargar",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posición",
total: "Total",
close_popup: "recuadro de cierre",
shortcuts: "Atajos",
add_tab: "añadir tabulado al texto",
remove_tab: "borrar tabulado del texto",
about_notice: "Aviso: el resaltado de sintaxis sólo funciona para texto pequeño",
toggle: "Cambiar editor",
accesskey: "Tecla de acceso",
tab: "Tab",
shift: "Mayúsc",
ctrl: "Ctrl",
esc: "Esc",
processing: "Procesando...",
fullscreen: "pantalla completa",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["fi"]={
new_document: "uusi tyhjä dokumentti",
search_button: "etsi ja korvaa",
search_command: "etsi seuraava / avaa etsintävalikko",
search: "etsi",
replace: "korvaa",
replace_command: "korvaa / avaa etsintävalikko",
find_next: "etsi seuraava",
replace_all: "korvaa kaikki",
reg_exp: "säännölliset lausekkeet",
match_case: "täsmää kirjainkokoon",
not_found: "ei löytynyt.",
occurrence_replaced: "esiintymää korvattu.",
search_field_empty: "Haettava merkkijono on tyhjä",
restart_search_at_begin: "Alueen loppu saavutettiin. Aloitetaan alusta.",
move_popup: "siirrä etsintävalikkoa",
font_size: "--Fontin koko--",
go_to_line: "siirry riville",
go_to_line_prompt: "mene riville:",
undo: "peruuta",
redo: "tee uudelleen",
change_smooth_selection: "kytke/sammuta joitakin näyttötoimintoja (Älykkäämpi toiminta, mutta suurempi CPU kuormitus)",
highlight: "kytke syntaksikorostus päälle/pois",
reset_highlight: "resetoi syntaksikorostus (jos teksti ei ole synkassa korostuksen kanssa)",
word_wrap: "toggle word wrapping mode",
help: "tietoja",
save: "tallenna",
load: "lataa",
line_abbr: "Rv",
char_abbr: "Pos",
position: "Paikka",
total: "Yhteensä",
close_popup: "sulje valikko",
shortcuts: "Pikatoiminnot",
add_tab: "lisää sisennys tekstiin",
remove_tab: "poista sisennys tekstistä",
about_notice: "Huomautus: syntaksinkorostus toimii vain pienelle tekstille",
toggle: "Kytke editori",
accesskey: "Pikanäppäin",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Odota...",
fullscreen: "koko ruutu",
syntax_selection: "--Syntaksi--",
close_tab: "Sulje tiedosto"
editAreaLoader.lang["fi"]={
new_document: "uusi tyhjä dokumentti",
search_button: "etsi ja korvaa",
search_command: "etsi seuraava / avaa etsintävalikko",
search: "etsi",
replace: "korvaa",
replace_command: "korvaa / avaa etsintävalikko",
find_next: "etsi seuraava",
replace_all: "korvaa kaikki",
reg_exp: "säännölliset lausekkeet",
match_case: "täsmää kirjainkokoon",
not_found: "ei löytynyt.",
occurrence_replaced: "esiintymää korvattu.",
search_field_empty: "Haettava merkkijono on tyhjä",
restart_search_at_begin: "Alueen loppu saavutettiin. Aloitetaan alusta.",
move_popup: "siirrä etsintävalikkoa",
font_size: "--Fontin koko--",
go_to_line: "siirry riville",
go_to_line_prompt: "mene riville:",
undo: "peruuta",
redo: "tee uudelleen",
change_smooth_selection: "kytke/sammuta joitakin näyttötoimintoja (Älykkäämpi toiminta, mutta suurempi CPU kuormitus)",
highlight: "kytke syntaksikorostus päälle/pois",
reset_highlight: "resetoi syntaksikorostus (jos teksti ei ole synkassa korostuksen kanssa)",
word_wrap: "toggle word wrapping mode",
help: "tietoja",
save: "tallenna",
load: "lataa",
line_abbr: "Rv",
char_abbr: "Pos",
position: "Paikka",
total: "Yhteensä",
close_popup: "sulje valikko",
shortcuts: "Pikatoiminnot",
add_tab: "lisää sisennys tekstiin",
remove_tab: "poista sisennys tekstistä",
about_notice: "Huomautus: syntaksinkorostus toimii vain pienelle tekstille",
toggle: "Kytke editori",
accesskey: "Pikanäppäin",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Odota...",
fullscreen: "koko ruutu",
syntax_selection: "--Syntaksi--",
close_tab: "Sulje tiedosto"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["fr"]={
new_document: "nouveau document (efface le contenu)",
search_button: "rechercher / remplacer",
search_command: "rechercher suivant / ouvrir la fen&ecirc;tre de recherche",
search: "rechercher",
replace: "remplacer",
replace_command: "remplacer / ouvrir la fen&ecirc;tre de recherche",
find_next: "rechercher",
replace_all: "tout remplacer",
reg_exp: "expr. r&eacute;guli&egrave;re",
match_case: "respecter la casse",
not_found: "pas trouv&eacute;.",
occurrence_replaced: "remplacements &eacute;ffectu&eacute;s.",
search_field_empty: "Le champ de recherche est vide.",
restart_search_at_begin: "Fin du texte atteint, poursuite au d&eacute;but.",
move_popup: "d&eacute;placer la fen&ecirc;tre de recherche",
font_size: "--Taille police--",
go_to_line: "aller &agrave; la ligne",
go_to_line_prompt: "aller a la ligne numero:",
undo: "annuler",
redo: "refaire",
change_smooth_selection: "activer/d&eacute;sactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
highlight: "activer/d&eacute;sactiver la coloration syntaxique",
reset_highlight: "r&eacute;initialiser la coloration syntaxique (si d&eacute;syncronis&eacute;e du texte)",
word_wrap: "activer/d&eacute;sactiver les retours &agrave; la ligne automatiques",
help: "&agrave; propos",
save: "sauvegarder",
load: "charger",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "fermer le popup",
shortcuts: "Racourcis clavier",
add_tab: "ajouter une tabulation dans le texte",
remove_tab: "retirer une tabulation dans le texte",
about_notice: "Note: la coloration syntaxique n'est pr&eacute;vue que pour de courts textes.",
toggle: "basculer l'&eacute;diteur",
accesskey: "Accesskey",
tab: "Tab",
shift: "Maj",
ctrl: "Ctrl",
esc: "Esc",
processing: "chargement...",
fullscreen: "plein &eacute;cran",
syntax_selection: "--Syntaxe--",
close_tab: "Fermer le fichier"
};
editAreaLoader.lang["fr"]={
new_document: "nouveau document (efface le contenu)",
search_button: "rechercher / remplacer",
search_command: "rechercher suivant / ouvrir la fen&ecirc;tre de recherche",
search: "rechercher",
replace: "remplacer",
replace_command: "remplacer / ouvrir la fen&ecirc;tre de recherche",
find_next: "rechercher",
replace_all: "tout remplacer",
reg_exp: "expr. r&eacute;guli&egrave;re",
match_case: "respecter la casse",
not_found: "pas trouv&eacute;.",
occurrence_replaced: "remplacements &eacute;ffectu&eacute;s.",
search_field_empty: "Le champ de recherche est vide.",
restart_search_at_begin: "Fin du texte atteint, poursuite au d&eacute;but.",
move_popup: "d&eacute;placer la fen&ecirc;tre de recherche",
font_size: "--Taille police--",
go_to_line: "aller &agrave; la ligne",
go_to_line_prompt: "aller a la ligne numero:",
undo: "annuler",
redo: "refaire",
change_smooth_selection: "activer/d&eacute;sactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
highlight: "activer/d&eacute;sactiver la coloration syntaxique",
reset_highlight: "r&eacute;initialiser la coloration syntaxique (si d&eacute;syncronis&eacute;e du texte)",
word_wrap: "activer/d&eacute;sactiver les retours &agrave; la ligne automatiques",
help: "&agrave; propos",
save: "sauvegarder",
load: "charger",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "fermer le popup",
shortcuts: "Racourcis clavier",
add_tab: "ajouter une tabulation dans le texte",
remove_tab: "retirer une tabulation dans le texte",
about_notice: "Note: la coloration syntaxique n'est pr&eacute;vue que pour de courts textes.",
toggle: "basculer l'&eacute;diteur",
accesskey: "Accesskey",
tab: "Tab",
shift: "Maj",
ctrl: "Ctrl",
esc: "Esc",
processing: "chargement...",
fullscreen: "plein &eacute;cran",
syntax_selection: "--Syntaxe--",
close_tab: "Fermer le fichier"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["it"]={
new_document: "nuovo documento vuoto",
search_button: "cerca e sostituisci",
search_command: "trova successivo / apri finestra di ricerca",
search: "cerca",
replace: "sostituisci",
replace_command: "sostituisci / apri finestra di ricerca",
find_next: "trova successivo",
replace_all: "sostituisci tutti",
reg_exp: "espressioni regolari",
match_case: "confronta maiuscole/minuscole<br />",
not_found: "non trovato.",
occurrence_replaced: "occorrenze sostituite.",
search_field_empty: "Campo ricerca vuoto",
restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
move_popup: "sposta popup di ricerca",
font_size: "-- Dimensione --",
go_to_line: "vai alla linea",
go_to_line_prompt: "vai alla linea numero:",
undo: "annulla",
redo: "ripeti",
change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
highlight: "abilita/disabilita colorazione della sintassi",
reset_highlight: "aggiorna colorazione (se non sincronizzata)",
word_wrap: "toggle word wrapping mode",
help: "informazioni su...",
save: "salva",
load: "carica",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posizione",
total: "Totale",
close_popup: "chiudi popup",
shortcuts: "Scorciatoie",
add_tab: "aggiungi tabulazione",
remove_tab: "rimuovi tabulazione",
about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
toggle: "Abilita/disabilita editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In corso...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["it"]={
new_document: "nuovo documento vuoto",
search_button: "cerca e sostituisci",
search_command: "trova successivo / apri finestra di ricerca",
search: "cerca",
replace: "sostituisci",
replace_command: "sostituisci / apri finestra di ricerca",
find_next: "trova successivo",
replace_all: "sostituisci tutti",
reg_exp: "espressioni regolari",
match_case: "confronta maiuscole/minuscole<br />",
not_found: "non trovato.",
occurrence_replaced: "occorrenze sostituite.",
search_field_empty: "Campo ricerca vuoto",
restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
move_popup: "sposta popup di ricerca",
font_size: "-- Dimensione --",
go_to_line: "vai alla linea",
go_to_line_prompt: "vai alla linea numero:",
undo: "annulla",
redo: "ripeti",
change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
highlight: "abilita/disabilita colorazione della sintassi",
reset_highlight: "aggiorna colorazione (se non sincronizzata)",
word_wrap: "toggle word wrapping mode",
help: "informazioni su...",
save: "salva",
load: "carica",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posizione",
total: "Totale",
close_popup: "chiudi popup",
shortcuts: "Scorciatoie",
add_tab: "aggiungi tabulazione",
remove_tab: "rimuovi tabulazione",
about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
toggle: "Abilita/disabilita editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In corso...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["ja"]={
new_document: "新規作成",
search_button: "検索・置換",
search_command: "次を検索 / 検索窓を表示",
search: "検索",
replace: "置換",
replace_command: "置換 / 置換窓を表示",
find_next: "次を検索",
replace_all: "全置換",
reg_exp: "正規表現",
match_case: "大文字小文字の区別",
not_found: "見つかりません。",
occurrence_replaced: "置換しました。",
search_field_empty: "検索対象文字列が空です。",
restart_search_at_begin: "終端に達しました、始めに戻ります",
move_popup: "検索窓を移動",
font_size: "--フォントサイズ--",
go_to_line: "指定行へ移動",
go_to_line_prompt: "指定行へ移動します:",
undo: "元に戻す",
redo: "やり直し",
change_smooth_selection: "スムース表示の切り替えCPUを使います",
highlight: "構文強調表示の切り替え",
reset_highlight: "構文強調表示のリセット",
word_wrap: "toggle word wrapping mode",
help: "ヘルプを表示",
save: "保存",
load: "読み込み",
line_abbr: "行",
char_abbr: "文字",
position: "位置",
total: "合計",
close_popup: "ポップアップを閉じる",
shortcuts: "ショートカット",
add_tab: "タブを挿入する",
remove_tab: "タブを削除する",
about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
toggle: "テキストエリアとeditAreaの切り替え",
accesskey: "アクセスキー",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "処理中です...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["ja"]={
new_document: "新規作成",
search_button: "検索・置換",
search_command: "次を検索 / 検索窓を表示",
search: "検索",
replace: "置換",
replace_command: "置換 / 置換窓を表示",
find_next: "次を検索",
replace_all: "全置換",
reg_exp: "正規表現",
match_case: "大文字小文字の区別",
not_found: "見つかりません。",
occurrence_replaced: "置換しました。",
search_field_empty: "検索対象文字列が空です。",
restart_search_at_begin: "終端に達しました、始めに戻ります",
move_popup: "検索窓を移動",
font_size: "--フォントサイズ--",
go_to_line: "指定行へ移動",
go_to_line_prompt: "指定行へ移動します:",
undo: "元に戻す",
redo: "やり直し",
change_smooth_selection: "スムース表示の切り替えCPUを使います",
highlight: "構文強調表示の切り替え",
reset_highlight: "構文強調表示のリセット",
word_wrap: "toggle word wrapping mode",
help: "ヘルプを表示",
save: "保存",
load: "読み込み",
line_abbr: "行",
char_abbr: "文字",
position: "位置",
total: "合計",
close_popup: "ポップアップを閉じる",
shortcuts: "ショートカット",
add_tab: "タブを挿入する",
remove_tab: "タブを削除する",
about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
toggle: "テキストエリアとeditAreaの切り替え",
accesskey: "アクセスキー",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "処理中です...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["nl"]={
new_document: "nieuw leeg document",
search_button: "zoek en vervang",
search_command: "zoek volgende / zoekscherm openen",
search: "zoek",
replace: "vervang",
replace_command: "vervang / zoekscherm openen",
find_next: "volgende vinden",
replace_all: "alles vervangen",
reg_exp: "reguliere expressies",
match_case: "hoofdletter gevoelig",
not_found: "niet gevonden.",
occurrence_replaced: "object vervangen.",
search_field_empty: "Zoek veld leeg",
restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
move_popup: "versleep zoek scherm",
font_size: "--Letter grootte--",
go_to_line: "Ga naar regel",
go_to_line_prompt: "Ga naar regel nummer:",
undo: "Ongedaan maken",
redo: "Opnieuw doen",
change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
highlight: "zet syntax highlight aan/uit",
reset_highlight: "reset highlight (indien gedesynchronizeerd)",
word_wrap: "toggle word wrapping mode",
help: "informatie",
save: "opslaan",
load: "laden",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Positie",
total: "Totaal",
close_popup: "Popup sluiten",
shortcuts: "Snelkoppelingen",
add_tab: "voeg tabs toe in tekst",
remove_tab: "verwijder tabs uit tekst",
about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
toggle: "geavanceerde bewerkingsopties",
accesskey: "Accessknop",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Verwerken...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["nl"]={
new_document: "nieuw leeg document",
search_button: "zoek en vervang",
search_command: "zoek volgende / zoekscherm openen",
search: "zoek",
replace: "vervang",
replace_command: "vervang / zoekscherm openen",
find_next: "volgende vinden",
replace_all: "alles vervangen",
reg_exp: "reguliere expressies",
match_case: "hoofdletter gevoelig",
not_found: "niet gevonden.",
occurrence_replaced: "object vervangen.",
search_field_empty: "Zoek veld leeg",
restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
move_popup: "versleep zoek scherm",
font_size: "--Letter grootte--",
go_to_line: "Ga naar regel",
go_to_line_prompt: "Ga naar regel nummer:",
undo: "Ongedaan maken",
redo: "Opnieuw doen",
change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
highlight: "zet syntax highlight aan/uit",
reset_highlight: "reset highlight (indien gedesynchronizeerd)",
word_wrap: "toggle word wrapping mode",
help: "informatie",
save: "opslaan",
load: "laden",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Positie",
total: "Totaal",
close_popup: "Popup sluiten",
shortcuts: "Snelkoppelingen",
add_tab: "voeg tabs toe in tekst",
remove_tab: "verwijder tabs uit tekst",
about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
toggle: "geavanceerde bewerkingsopties",
accesskey: "Accessknop",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Verwerken...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["pl"]={
new_document: "nowy dokument",
search_button: "znajdź i zamień",
search_command: "znajdź następny",
search: "znajdź",
replace: "zamień",
replace_command: "zamień",
find_next: "następny",
replace_all: "zamień wszystko",
reg_exp: "wyrażenie regularne",
match_case: "uwzględnij wielkość liter<br />",
not_found: "nie znaleziono.",
occurrence_replaced: "wystąpień zamieniono.",
search_field_empty: "Nie wprowadzono tekstu",
restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
move_popup: "przesuń okienko wyszukiwania",
font_size: "Rozmiar",
go_to_line: "idź do linii",
go_to_line_prompt: "numer linii:",
undo: "cofnij",
redo: "przywróć",
change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
highlight: "włącz/wyłącz podświetlanie składni",
reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
word_wrap: "toggle word wrapping mode",
help: "o programie",
save: "zapisz",
load: "otwórz",
line_abbr: "Ln",
char_abbr: "Zn",
position: "Pozycja",
total: "W sumie",
close_popup: "zamknij okienko",
shortcuts: "Skróty klawiaturowe",
add_tab: "dodaj wcięcie do zaznaczonego tekstu",
remove_tab: "usuń wcięcie",
about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
toggle: "Włącz/wyłącz edytor",
accesskey: "Alt+",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Przetwarzanie...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["pl"]={
new_document: "nowy dokument",
search_button: "znajdź i zamień",
search_command: "znajdź następny",
search: "znajdź",
replace: "zamień",
replace_command: "zamień",
find_next: "następny",
replace_all: "zamień wszystko",
reg_exp: "wyrażenie regularne",
match_case: "uwzględnij wielkość liter<br />",
not_found: "nie znaleziono.",
occurrence_replaced: "wystąpień zamieniono.",
search_field_empty: "Nie wprowadzono tekstu",
restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
move_popup: "przesuń okienko wyszukiwania",
font_size: "Rozmiar",
go_to_line: "idź do linii",
go_to_line_prompt: "numer linii:",
undo: "cofnij",
redo: "przywróć",
change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
highlight: "włącz/wyłącz podświetlanie składni",
reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
word_wrap: "toggle word wrapping mode",
help: "o programie",
save: "zapisz",
load: "otwórz",
line_abbr: "Ln",
char_abbr: "Zn",
position: "Pozycja",
total: "W sumie",
close_popup: "zamknij okienko",
shortcuts: "Skróty klawiaturowe",
add_tab: "dodaj wcięcie do zaznaczonego tekstu",
remove_tab: "usuń wcięcie",
about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
toggle: "Włącz/wyłącz edytor",
accesskey: "Alt+",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Przetwarzanie...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["pt"]={
new_document: "Novo documento",
search_button: "Localizar e substituir",
search_command: "Localizar próximo",
search: "Localizar",
replace: "Substituir",
replace_command: "Substituir",
find_next: "Localizar",
replace_all: "Subst. tudo",
reg_exp: "Expressões regulares",
match_case: "Diferenciar maiúsculas e minúsculas",
not_found: "Não encontrado.",
occurrence_replaced: "Ocorrências substituidas",
search_field_empty: "Campo localizar vazio.",
restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
move_popup: "Mover janela",
font_size: "--Tamanho da fonte--",
go_to_line: "Ir para linha",
go_to_line_prompt: "Ir para a linha:",
undo: "Desfazer",
redo: "Refazer",
change_smooth_selection: "Opções visuais",
highlight: "Cores de sintaxe",
reset_highlight: "Resetar cores (se não sincronizado)",
word_wrap: "toggle word wrapping mode",
help: "Sobre",
save: "Salvar",
load: "Carregar",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posição",
total: "Total",
close_popup: "Fechar",
shortcuts: "Shortcuts",
add_tab: "Adicionar tabulação",
remove_tab: "Remover tabulação",
about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
toggle: "Exibir editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processando...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["pt"]={
new_document: "Novo documento",
search_button: "Localizar e substituir",
search_command: "Localizar próximo",
search: "Localizar",
replace: "Substituir",
replace_command: "Substituir",
find_next: "Localizar",
replace_all: "Subst. tudo",
reg_exp: "Expressões regulares",
match_case: "Diferenciar maiúsculas e minúsculas",
not_found: "Não encontrado.",
occurrence_replaced: "Ocorrências substituidas",
search_field_empty: "Campo localizar vazio.",
restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
move_popup: "Mover janela",
font_size: "--Tamanho da fonte--",
go_to_line: "Ir para linha",
go_to_line_prompt: "Ir para a linha:",
undo: "Desfazer",
redo: "Refazer",
change_smooth_selection: "Opções visuais",
highlight: "Cores de sintaxe",
reset_highlight: "Resetar cores (se não sincronizado)",
word_wrap: "toggle word wrapping mode",
help: "Sobre",
save: "Salvar",
load: "Carregar",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posição",
total: "Total",
close_popup: "Fechar",
shortcuts: "Shortcuts",
add_tab: "Adicionar tabulação",
remove_tab: "Remover tabulação",
about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
toggle: "Exibir editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processando...",
fullscreen: "fullscreen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["ru"]={
new_document: "новый пустой документ",
search_button: "поиск и замена",
search_command: "искать следующий / открыть панель поиска",
search: "поиск",
replace: "замена",
replace_command: "заменить / открыть панель поиска",
find_next: "найти следующее",
replace_all: "заменить все",
reg_exp: "регулярное выражение",
match_case: "учитывать регистр",
not_found: "не найдено.",
occurrence_replaced: "вхождение заменено.",
search_field_empty: "Поле поиска пустое",
restart_search_at_begin: "Достигнут конец документа. Начинаю с начала.",
move_popup: "переместить окно поиска",
font_size: "--Размер шрифта--",
go_to_line: "перейти к строке",
go_to_line_prompt: "перейти к строке номер:",
undo: "отменить",
redo: "вернуть",
change_smooth_selection: "включить/отключить некоторые функции просмотра (более красиво, но больше использует процессор)",
highlight: "переключить подсветку синтаксиса включена/выключена",
reset_highlight: "восстановить подсветку (если разсинхронизирована от текста)",
word_wrap: "toggle word wrapping mode",
help: "о программе",
save: "сохранить",
load: "загрузить",
line_abbr: "Стр",
char_abbr: "Стлб",
position: "Позиция",
total: "Всего",
close_popup: "закрыть всплывающее окно",
shortcuts: "Горячие клавиши",
add_tab: "добавить табуляцию в текст",
remove_tab: "убрать табуляцию из текста",
about_notice: "Внимание: функция подсветки синтаксиса только для небольших текстов",
toggle: "Переключить редактор",
accesskey: "Горячая клавиша",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Обработка...",
fullscreen: "полный экран",
syntax_selection: "--Синтакс--",
close_tab: "Закрыть файл"
};
editAreaLoader.lang["ru"]={
new_document: "новый пустой документ",
search_button: "поиск и замена",
search_command: "искать следующий / открыть панель поиска",
search: "поиск",
replace: "замена",
replace_command: "заменить / открыть панель поиска",
find_next: "найти следующее",
replace_all: "заменить все",
reg_exp: "регулярное выражение",
match_case: "учитывать регистр",
not_found: "не найдено.",
occurrence_replaced: "вхождение заменено.",
search_field_empty: "Поле поиска пустое",
restart_search_at_begin: "Достигнут конец документа. Начинаю с начала.",
move_popup: "переместить окно поиска",
font_size: "--Размер шрифта--",
go_to_line: "перейти к строке",
go_to_line_prompt: "перейти к строке номер:",
undo: "отменить",
redo: "вернуть",
change_smooth_selection: "включить/отключить некоторые функции просмотра (более красиво, но больше использует процессор)",
highlight: "переключить подсветку синтаксиса включена/выключена",
reset_highlight: "восстановить подсветку (если разсинхронизирована от текста)",
word_wrap: "toggle word wrapping mode",
help: "о программе",
save: "сохранить",
load: "загрузить",
line_abbr: "Стр",
char_abbr: "Стлб",
position: "Позиция",
total: "Всего",
close_popup: "закрыть всплывающее окно",
shortcuts: "Горячие клавиши",
add_tab: "добавить табуляцию в текст",
remove_tab: "убрать табуляцию из текста",
about_notice: "Внимание: функция подсветки синтаксиса только для небольших текстов",
toggle: "Переключить редактор",
accesskey: "Горячая клавиша",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Обработка...",
fullscreen: "полный экран",
syntax_selection: "--Синтакс--",
close_tab: "Закрыть файл"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["sk"]={
new_document: "nový prázdy dokument",
search_button: "vyhľadaj a nahraď",
search_command: "hľadaj ďalsšie / otvor vyhľadávacie pole",
search: "hľadaj",
replace: "nahraď",
replace_command: "nahraď / otvor vyhľadávacie pole",
find_next: "nájdi ďalšie",
replace_all: "nahraď všetko",
reg_exp: "platné výrazy",
match_case: "zhodujúce sa výrazy",
not_found: "nenájdené.",
occurrence_replaced: "výskyty nahradené.",
search_field_empty: "Pole vyhľadávanie je prádzne",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "presuň vyhľadávacie okno",
font_size: "--Veľkosť textu--",
go_to_line: "prejdi na riadok",
go_to_line_prompt: "prejdi na riadok:",
undo: "krok späť",
redo: "prepracovať",
change_smooth_selection: "povoliť/zamietnúť niektoré zo zobrazených funkcií (účelnejšie zobrazenie vyžaduje väčšie zaťaženie procesora CPU)",
highlight: "prepnúť zvýrazňovanie syntaxe zap/vyp",
reset_highlight: "zrušiť zvýrazňovanie (ak je nesynchronizované s textom)",
word_wrap: "toggle word wrapping mode",
help: "o programe",
save: "uložiť",
load: "načítať",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Pozícia",
total: "Spolu",
close_popup: "zavrieť okno",
shortcuts: "Skratky",
add_tab: "pridať tabulovanie textu",
remove_tab: "odstrániť tabulovanie textu",
about_notice: "Upozornenie: funkcia zvýrazňovania syntaxe je dostupná iba pre malý text",
toggle: "Prepnúť editor",
accesskey: "Accesskey",
tab: "Záložka",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Spracúvam...",
fullscreen: "cel=a obrazovka",
syntax_selection: "--Vyber Syntax--",
close_tab: "Close file"
};
editAreaLoader.lang["sk"]={
new_document: "nový prázdy dokument",
search_button: "vyhľadaj a nahraď",
search_command: "hľadaj ďalsšie / otvor vyhľadávacie pole",
search: "hľadaj",
replace: "nahraď",
replace_command: "nahraď / otvor vyhľadávacie pole",
find_next: "nájdi ďalšie",
replace_all: "nahraď všetko",
reg_exp: "platné výrazy",
match_case: "zhodujúce sa výrazy",
not_found: "nenájdené.",
occurrence_replaced: "výskyty nahradené.",
search_field_empty: "Pole vyhľadávanie je prádzne",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "presuň vyhľadávacie okno",
font_size: "--Veľkosť textu--",
go_to_line: "prejdi na riadok",
go_to_line_prompt: "prejdi na riadok:",
undo: "krok späť",
redo: "prepracovať",
change_smooth_selection: "povoliť/zamietnúť niektoré zo zobrazených funkcií (účelnejšie zobrazenie vyžaduje väčšie zaťaženie procesora CPU)",
highlight: "prepnúť zvýrazňovanie syntaxe zap/vyp",
reset_highlight: "zrušiť zvýrazňovanie (ak je nesynchronizované s textom)",
word_wrap: "toggle word wrapping mode",
help: "o programe",
save: "uložiť",
load: "načítať",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Pozícia",
total: "Spolu",
close_popup: "zavrieť okno",
shortcuts: "Skratky",
add_tab: "pridať tabulovanie textu",
remove_tab: "odstrániť tabulovanie textu",
about_notice: "Upozornenie: funkcia zvýrazňovania syntaxe je dostupná iba pre malý text",
toggle: "Prepnúť editor",
accesskey: "Accesskey",
tab: "Záložka",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Spracúvam...",
fullscreen: "cel=a obrazovka",
syntax_selection: "--Vyber Syntax--",
close_tab: "Close file"
};

View File

@@ -1,48 +1,48 @@
editAreaLoader.lang["zh"]={
new_document: "新建空白文档",
search_button: "查找与替换",
search_command: "查找下一个 / 打开查找框",
search: "查找",
replace: "替换",
replace_command: "替换 / 打开查找框",
find_next: "查找下一个",
replace_all: "全部替换",
reg_exp: "正则表达式",
match_case: "匹配大小写",
not_found: "未找到.",
occurrence_replaced: "处被替换.",
search_field_empty: "查找框没有内容",
restart_search_at_begin: "已到到文档末尾. 从头重新查找.",
move_popup: "移动查找对话框",
font_size: "--字体大小--",
go_to_line: "转到行",
go_to_line_prompt: "转到行:",
undo: "恢复",
redo: "重做",
change_smooth_selection: "启用/禁止一些显示特性(更好看但更耗费资源)",
highlight: "启用/禁止语法高亮",
reset_highlight: "重置语法高亮(当文本显示不同步时)",
word_wrap: "toggle word wrapping mode",
help: "关于",
save: "保存",
load: "加载",
line_abbr: "行",
char_abbr: "字符",
position: "位置",
total: "总计",
close_popup: "关闭对话框",
shortcuts: "快捷键",
add_tab: "添加制表符(Tab)",
remove_tab: "移除制表符(Tab)",
about_notice: "注意:语法高亮功能仅用于较少内容的文本(文件内容太大会导致浏览器反应慢)",
toggle: "切换编辑器",
accesskey: "快捷键",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "正在处理中...",
fullscreen: "全屏编辑",
syntax_selection: "--语法--",
close_tab: "关闭文件"
};
editAreaLoader.lang["zh"]={
new_document: "新建空白文档",
search_button: "查找与替换",
search_command: "查找下一个 / 打开查找框",
search: "查找",
replace: "替换",
replace_command: "替换 / 打开查找框",
find_next: "查找下一个",
replace_all: "全部替换",
reg_exp: "正则表达式",
match_case: "匹配大小写",
not_found: "未找到.",
occurrence_replaced: "处被替换.",
search_field_empty: "查找框没有内容",
restart_search_at_begin: "已到到文档末尾. 从头重新查找.",
move_popup: "移动查找对话框",
font_size: "--字体大小--",
go_to_line: "转到行",
go_to_line_prompt: "转到行:",
undo: "恢复",
redo: "重做",
change_smooth_selection: "启用/禁止一些显示特性(更好看但更耗费资源)",
highlight: "启用/禁止语法高亮",
reset_highlight: "重置语法高亮(当文本显示不同步时)",
word_wrap: "toggle word wrapping mode",
help: "关于",
save: "保存",
load: "加载",
line_abbr: "行",
char_abbr: "字符",
position: "位置",
total: "总计",
close_popup: "关闭对话框",
shortcuts: "快捷键",
add_tab: "添加制表符(Tab)",
remove_tab: "移除制表符(Tab)",
about_notice: "注意:语法高亮功能仅用于较少内容的文本(文件内容太大会导致浏览器反应慢)",
toggle: "切换编辑器",
accesskey: "快捷键",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "正在处理中...",
fullscreen: "全屏编辑",
syntax_selection: "--语法--",
close_tab: "关闭文件"
};

View File

@@ -1,7 +1,7 @@
Copyright 2008 Christophe Dolivet
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Copyright 2008 Christophe Dolivet
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

View File

@@ -1,10 +1,10 @@
Copyright (c) 2008, Christophe Dolivet
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Copyright (c) 2008, Christophe Dolivet
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File diff suppressed because it is too large Load Diff

View File

@@ -1,166 +1,166 @@
EditAreaLoader.prototype.get_regexp= function(text_array){
//res="( |=|\\n|\\r|\\[|\\(|µ|)(";
res="(\\b)(";
for(i=0; i<text_array.length; i++){
if(i>0)
res+="|";
//res+="("+ tab_text[i] +")";
//res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
res+=this.get_escaped_regexp(text_array[i]);
}
//res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
res+=")(\\b)";
reg= new RegExp(res);
return res;
};
EditAreaLoader.prototype.get_escaped_regexp= function(str){
return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
};
EditAreaLoader.prototype.init_syntax_regexp= function(){
var lang_style= {};
for(var lang in this.load_syntax){
if(!this.syntax[lang]) // init the regexp if not already initialized
{
this.syntax[lang]= {};
this.syntax[lang]["keywords_reg_exp"]= {};
this.keywords_reg_exp_nb=0;
if(this.load_syntax[lang]['KEYWORDS']){
param="g";
if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
param+="i";
for(var i in this.load_syntax[lang]['KEYWORDS']){
if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
this.keywords_reg_exp_nb++;
}
}
if(this.load_syntax[lang]['OPERATORS']){
var str="";
var nb=0;
for(var i in this.load_syntax[lang]['OPERATORS']){
if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
if(nb>0)
str+="|";
str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
nb++;
}
if(str.length>0)
this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
}
if(this.load_syntax[lang]['DELIMITERS']){
var str="";
var nb=0;
for(var i in this.load_syntax[lang]['DELIMITERS']){
if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
if(nb>0)
str+="|";
str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
nb++;
}
if(str.length>0)
this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
}
// /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
var syntax_trace=[];
// /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
this.syntax[lang]["quotes"]={};
var quote_tab= [];
if(this.load_syntax[lang]['QUOTEMARKS']){
for(var i in this.load_syntax[lang]['QUOTEMARKS']){
if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;
var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
this.syntax[lang]["quotes"][x]=x;
//quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
//previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
syntax_trace.push(x);
}
}
this.syntax[lang]["comments"]={};
if(this.load_syntax[lang]['COMMENT_SINGLE']){
for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){
if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;
var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
syntax_trace.push(x);
this.syntax[lang]["comments"][x]="\n";
}
}
// (/\*(.|[\r\n])*?\*/)
if(this.load_syntax[lang]['COMMENT_MULTI']){
for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;
var start=this.get_escaped_regexp(i);
var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
syntax_trace.push(start);
syntax_trace.push(end);
this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
}
}
if(quote_tab.length>0)
this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
if(syntax_trace.length>0) // /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
this.syntax[lang]["script_delimiters"]= {};
for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;
this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
}
}
this.syntax[lang]["custom_regexp"]= {};
if(this.load_syntax[lang]['REGEXPS']){
for(var i in this.load_syntax[lang]['REGEXPS']){
if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
var val= this.load_syntax[lang]['REGEXPS'][i];
if(!this.syntax[lang]["custom_regexp"][val['execute']])
this.syntax[lang]["custom_regexp"][val['execute']]= {};
this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
, 'class' : val['class']};
}
}
if(this.load_syntax[lang]['STYLES']){
lang_style[lang]= {};
for(var i in this.load_syntax[lang]['STYLES']){
if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
for(var j in this.load_syntax[lang]['STYLES'][i]){
lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
}
}else{
lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
}
}
}
// build style string
var style="";
for(var i in lang_style[lang]){
if(lang_style[lang][i].length>0){
style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";
}
}
this.syntax[lang]["styles"]=style;
}
}
};
editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";
EditAreaLoader.prototype.get_regexp= function(text_array){
//res="( |=|\\n|\\r|\\[|\\(|µ|)(";
res="(\\b)(";
for(i=0; i<text_array.length; i++){
if(i>0)
res+="|";
//res+="("+ tab_text[i] +")";
//res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
res+=this.get_escaped_regexp(text_array[i]);
}
//res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
res+=")(\\b)";
reg= new RegExp(res);
return res;
};
EditAreaLoader.prototype.get_escaped_regexp= function(str){
return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
};
EditAreaLoader.prototype.init_syntax_regexp= function(){
var lang_style= {};
for(var lang in this.load_syntax){
if(!this.syntax[lang]) // init the regexp if not already initialized
{
this.syntax[lang]= {};
this.syntax[lang]["keywords_reg_exp"]= {};
this.keywords_reg_exp_nb=0;
if(this.load_syntax[lang]['KEYWORDS']){
param="g";
if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
param+="i";
for(var i in this.load_syntax[lang]['KEYWORDS']){
if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
this.keywords_reg_exp_nb++;
}
}
if(this.load_syntax[lang]['OPERATORS']){
var str="";
var nb=0;
for(var i in this.load_syntax[lang]['OPERATORS']){
if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
if(nb>0)
str+="|";
str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
nb++;
}
if(str.length>0)
this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
}
if(this.load_syntax[lang]['DELIMITERS']){
var str="";
var nb=0;
for(var i in this.load_syntax[lang]['DELIMITERS']){
if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
if(nb>0)
str+="|";
str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
nb++;
}
if(str.length>0)
this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
}
// /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
var syntax_trace=[];
// /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
this.syntax[lang]["quotes"]={};
var quote_tab= [];
if(this.load_syntax[lang]['QUOTEMARKS']){
for(var i in this.load_syntax[lang]['QUOTEMARKS']){
if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;
var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
this.syntax[lang]["quotes"][x]=x;
//quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
//previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
syntax_trace.push(x);
}
}
this.syntax[lang]["comments"]={};
if(this.load_syntax[lang]['COMMENT_SINGLE']){
for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){
if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;
var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
syntax_trace.push(x);
this.syntax[lang]["comments"][x]="\n";
}
}
// (/\*(.|[\r\n])*?\*/)
if(this.load_syntax[lang]['COMMENT_MULTI']){
for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;
var start=this.get_escaped_regexp(i);
var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
syntax_trace.push(start);
syntax_trace.push(end);
this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
}
}
if(quote_tab.length>0)
this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
if(syntax_trace.length>0) // /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
this.syntax[lang]["script_delimiters"]= {};
for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;
this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
}
}
this.syntax[lang]["custom_regexp"]= {};
if(this.load_syntax[lang]['REGEXPS']){
for(var i in this.load_syntax[lang]['REGEXPS']){
if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
var val= this.load_syntax[lang]['REGEXPS'][i];
if(!this.syntax[lang]["custom_regexp"][val['execute']])
this.syntax[lang]["custom_regexp"][val['execute']]= {};
this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
, 'class' : val['class']};
}
}
if(this.load_syntax[lang]['STYLES']){
lang_style[lang]= {};
for(var i in this.load_syntax[lang]['STYLES']){
if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
for(var j in this.load_syntax[lang]['STYLES'][i]){
lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
}
}else{
lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
}
}
}
// build style string
var style="";
for(var i in lang_style[lang]){
if(lang_style[lang][i].length>0){
style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";
}
}
this.syntax[lang]["styles"]=style;
}
}
};
editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";

View File

@@ -1,85 +1,85 @@
editAreaLoader.load_syntax["css"] = {
'DISPLAY_NAME' : 'CSS'
,'COMMENT_SINGLE' : {1 : '@'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : ['"', "'"]
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'attributes' : [
'aqua', 'azimuth', 'background-attachment', 'background-color',
'background-image', 'background-position', 'background-repeat',
'background', 'border-bottom-color', 'border-bottom-style',
'border-bottom-width', 'border-left-color', 'border-left-style',
'border-left-width', 'border-right', 'border-right-color',
'border-right-style', 'border-right-width', 'border-top-color',
'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
'border-left', 'border-width', 'border-color', 'border-spacing',
'border-style', 'border-top', 'border', 'caption-side',
'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
'outline-width', 'overflow', 'padding-bottom', 'padding-left',
'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
'width', 'word-spacing', 'z-index', 'bottom', 'left'
]
,'values' : [
'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
'pointer', 'portrait', 'purple', 'px',
'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
'static', 'status-bar', 'super', 'sw-resize',
'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
'visible',
'w-resize', 'wait', 'white', 'wider',
'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
'yellow', 'yes'
]
,'specials' : [
'important'
]
}
,'OPERATORS' :[
':', ';', '!', '.', '#'
]
,'DELIMITERS' :[
'{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'attributes' : 'color: #48BDDF;'
,'values' : 'color: #2B60FF;'
,'specials' : 'color: #FF0000;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #60CA00;'
}
};
editAreaLoader.load_syntax["css"] = {
'DISPLAY_NAME' : 'CSS'
,'COMMENT_SINGLE' : {1 : '@'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : ['"', "'"]
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'attributes' : [
'aqua', 'azimuth', 'background-attachment', 'background-color',
'background-image', 'background-position', 'background-repeat',
'background', 'border-bottom-color', 'border-bottom-style',
'border-bottom-width', 'border-left-color', 'border-left-style',
'border-left-width', 'border-right', 'border-right-color',
'border-right-style', 'border-right-width', 'border-top-color',
'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
'border-left', 'border-width', 'border-color', 'border-spacing',
'border-style', 'border-top', 'border', 'caption-side',
'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
'outline-width', 'overflow', 'padding-bottom', 'padding-left',
'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
'width', 'word-spacing', 'z-index', 'bottom', 'left'
]
,'values' : [
'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
'pointer', 'portrait', 'purple', 'px',
'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
'static', 'status-bar', 'super', 'sw-resize',
'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
'visible',
'w-resize', 'wait', 'white', 'wider',
'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
'yellow', 'yes'
]
,'specials' : [
'important'
]
}
,'OPERATORS' :[
':', ';', '!', '.', '#'
]
,'DELIMITERS' :[
'{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'attributes' : 'color: #48BDDF;'
,'values' : 'color: #2B60FF;'
,'specials' : 'color: #FF0000;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #60CA00;'
}
};

View File

@@ -1,51 +1,51 @@
/*
* last update: 2006-08-24
*/
editAreaLoader.load_syntax["html"] = {
'DISPLAY_NAME' : 'HTML'
,'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {'<!--' : '-->'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
}
,'OPERATORS' :[
]
,'DELIMITERS' :[
]
,'REGEXPS' : {
'doctype' : {
'search' : '()(<!DOCTYPE[^>]*>)()'
,'class' : 'doctype'
,'modifiers' : ''
,'execute' : 'before' // before or after
}
,'tags' : {
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
,'class' : 'tags'
,'modifiers' : 'gi'
,'execute' : 'before' // before or after
}
,'attributes' : {
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
,'class' : 'attributes'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
}
,'OPERATORS' : 'color: #E775F0;'
,'DELIMITERS' : ''
,'REGEXPS' : {
'attributes': 'color: #B1AC41;'
,'tags': 'color: #E62253;'
,'doctype': 'color: #8DCFB5;'
,'test': 'color: #00FF00;'
}
}
};
/*
* last update: 2006-08-24
*/
editAreaLoader.load_syntax["html"] = {
'DISPLAY_NAME' : 'HTML'
,'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {'<!--' : '-->'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
}
,'OPERATORS' :[
]
,'DELIMITERS' :[
]
,'REGEXPS' : {
'doctype' : {
'search' : '()(<!DOCTYPE[^>]*>)()'
,'class' : 'doctype'
,'modifiers' : ''
,'execute' : 'before' // before or after
}
,'tags' : {
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
,'class' : 'tags'
,'modifiers' : 'gi'
,'execute' : 'before' // before or after
}
,'attributes' : {
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
,'class' : 'attributes'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
}
,'OPERATORS' : 'color: #E775F0;'
,'DELIMITERS' : ''
,'REGEXPS' : {
'attributes': 'color: #B1AC41;'
,'tags': 'color: #E62253;'
,'doctype': 'color: #8DCFB5;'
,'test': 'color: #00FF00;'
}
}
};

View File

@@ -1,94 +1,94 @@
editAreaLoader.load_syntax["js"] = {
'DISPLAY_NAME' : 'Javascript'
,'COMMENT_SINGLE' : {1 : '//'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'statements' : [
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
'while', 'write', 'with'
]
,'keywords' : [
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
'arguments', 'locationbar', 'pageXoffset', 'Form',
'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
]
,'functions' : [
// common functions for Window object
'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
'stop'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'statements' : 'color: #60CA00;'
,'keywords' : 'color: #48BDDF;'
,'functions' : 'color: #2B60FF;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #0038E1;'
}
,'AUTO_COMPLETION' : {
"default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
,"possible_words_letters": "[a-zA-Z0-9_]+"
,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
,"prefix_separator": "\\."
}
,"CASE_SENSITIVE": true
,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
,"KEYWORDS": {
'': [ // the prefix of thoses items
/**
* 0 : the keyword the user is typing
* 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
* If empty the keyword will be displayed
* 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
*/
['Array', '§()', '']
,['alert', '§({@})', 'alert(String message)']
,['document']
,['window']
]
,'window' : [
['location']
,['document']
,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
]
,'location' : [
['href']
]
}
}
}
};
editAreaLoader.load_syntax["js"] = {
'DISPLAY_NAME' : 'Javascript'
,'COMMENT_SINGLE' : {1 : '//'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'statements' : [
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
'while', 'write', 'with'
]
,'keywords' : [
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
'arguments', 'locationbar', 'pageXoffset', 'Form',
'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
]
,'functions' : [
// common functions for Window object
'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
'stop'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'statements' : 'color: #60CA00;'
,'keywords' : 'color: #48BDDF;'
,'functions' : 'color: #2B60FF;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #0038E1;'
}
,'AUTO_COMPLETION' : {
"default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
,"possible_words_letters": "[a-zA-Z0-9_]+"
,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
,"prefix_separator": "\\."
}
,"CASE_SENSITIVE": true
,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
,"KEYWORDS": {
'': [ // the prefix of thoses items
/**
* 0 : the keyword the user is typing
* 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
* If empty the keyword will be displayed
* 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
*/
['Array', '§()', '']
,['alert', '§({@})', 'alert(String message)']
,['document']
,['window']
]
,'window' : [
['location']
,['document']
,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
]
,'location' : [
['href']
]
}
}
}
};

View File

@@ -1,139 +1,139 @@
/*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
new_class="quotes";
if(v6 && v6 != undefined && v6!="")
new_class="comments";
return "µ__"+ new_class +"__µ"+v0+"µ_END_µ";
};*/
/* EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
res="<span class=htmlTag>"+v2;
alert("v2: "+v2+" v3: "+v3);
tab=v3.split("=");
attributes="";
if(tab.length>1){
attributes="<span class=attribute>"+tab[0]+"</span>=";
for(i=1; i<tab.length-1; i++){
cut=tab[i].lastIndexOf("&nbsp;");
attributes+="<span class=attributeVal>"+tab[i].substr(0,cut)+"</span>";
attributes+="<span class=attribute>"+tab[i].substr(cut)+"</span>=";
}
attributes+="<span class=attributeVal>"+tab[tab.length-1]+"</span>";
}
res+=attributes+v5+"</span>";
return res;
};*/
// determine if the selected text if a comment or a quoted text
EditArea.prototype.comment_or_quote= function(){
var new_class="", close_tag="", sy, arg, i;
sy = parent.editAreaLoader.syntax[editArea.current_code_lang];
arg = EditArea.prototype.comment_or_quote.arguments[0];
for( i in sy["quotes"] ){
if(arg.indexOf(i)==0){
new_class="quotesmarks";
close_tag=sy["quotes"][i];
}
}
if(new_class.length==0)
{
for(var i in sy["comments"]){
if( arg.indexOf(i)==0 ){
new_class="comments";
close_tag=sy["comments"][i];
}
}
}
// for single line comment the \n must not be included in the span tags
if(close_tag=="\n"){
return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
}else{
// the closing tag must be set only if the comment or quotes is closed
reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
if( arg.search(reg)!=-1 )
return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
else
return "µ__"+ new_class +"__µ"+ arg;
}
};
/*
// apply special tags arround text to highlight
EditArea.prototype.custom_highlight= function(){
res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ";
if(EditArea.prototype.custom_highlight.arguments.length>5)
res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
return res;
};
*/
// return identication that allow to know if revalidating only the text line won't make the syntax go mad
EditArea.prototype.get_syntax_trace= function(text){
if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
};
EditArea.prototype.colorize_text= function(text){
//text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
/*
if(this.isOpera){
// opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre
text= this.replace_tab(text);
}*/
text= " "+text; // for easier regExp
/*if(this.do_html_tags)
text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
if(this.settings["syntax"].length>0)
text= this.apply_syntax(text, this.settings["syntax"]);
// remove the first space added
return text.substr(1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/µ_END_µ/g,"</span>").replace(/µ__([a-zA-Z0-9]+)__µ/g,"<span class='$1'>");
};
EditArea.prototype.apply_syntax= function(text, lang){
var sy;
this.current_code_lang=lang;
if(!parent.editAreaLoader.syntax[lang])
return text;
sy = parent.editAreaLoader.syntax[lang];
if(sy["custom_regexp"]['before']){
for( var i in sy["custom_regexp"]['before']){
var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3";
text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
}
}
if(sy["comment_or_quote_reg_exp"]){
//setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
}
if(sy["keywords_reg_exp"]){
for(var i in sy["keywords_reg_exp"]){
text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ');
}
}
if(sy["delimiters_reg_exp"]){
text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
}
if(sy["operators_reg_exp"]){
text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
}
if(sy["custom_regexp"]['after']){
for( var i in sy["custom_regexp"]['after']){
var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3";
text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);
}
}
return text;
};
/*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
new_class="quotes";
if(v6 && v6 != undefined && v6!="")
new_class="comments";
return "µ__"+ new_class +"__µ"+v0+"µ_END_µ";
};*/
/* EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
res="<span class=htmlTag>"+v2;
alert("v2: "+v2+" v3: "+v3);
tab=v3.split("=");
attributes="";
if(tab.length>1){
attributes="<span class=attribute>"+tab[0]+"</span>=";
for(i=1; i<tab.length-1; i++){
cut=tab[i].lastIndexOf("&nbsp;");
attributes+="<span class=attributeVal>"+tab[i].substr(0,cut)+"</span>";
attributes+="<span class=attribute>"+tab[i].substr(cut)+"</span>=";
}
attributes+="<span class=attributeVal>"+tab[tab.length-1]+"</span>";
}
res+=attributes+v5+"</span>";
return res;
};*/
// determine if the selected text if a comment or a quoted text
EditArea.prototype.comment_or_quote= function(){
var new_class="", close_tag="", sy, arg, i;
sy = parent.editAreaLoader.syntax[editArea.current_code_lang];
arg = EditArea.prototype.comment_or_quote.arguments[0];
for( i in sy["quotes"] ){
if(arg.indexOf(i)==0){
new_class="quotesmarks";
close_tag=sy["quotes"][i];
}
}
if(new_class.length==0)
{
for(var i in sy["comments"]){
if( arg.indexOf(i)==0 ){
new_class="comments";
close_tag=sy["comments"][i];
}
}
}
// for single line comment the \n must not be included in the span tags
if(close_tag=="\n"){
return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
}else{
// the closing tag must be set only if the comment or quotes is closed
reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
if( arg.search(reg)!=-1 )
return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
else
return "µ__"+ new_class +"__µ"+ arg;
}
};
/*
// apply special tags arround text to highlight
EditArea.prototype.custom_highlight= function(){
res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ";
if(EditArea.prototype.custom_highlight.arguments.length>5)
res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
return res;
};
*/
// return identication that allow to know if revalidating only the text line won't make the syntax go mad
EditArea.prototype.get_syntax_trace= function(text){
if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
};
EditArea.prototype.colorize_text= function(text){
//text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
/*
if(this.isOpera){
// opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre
text= this.replace_tab(text);
}*/
text= " "+text; // for easier regExp
/*if(this.do_html_tags)
text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
if(this.settings["syntax"].length>0)
text= this.apply_syntax(text, this.settings["syntax"]);
// remove the first space added
return text.substr(1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/µ_END_µ/g,"</span>").replace(/µ__([a-zA-Z0-9]+)__µ/g,"<span class='$1'>");
};
EditArea.prototype.apply_syntax= function(text, lang){
var sy;
this.current_code_lang=lang;
if(!parent.editAreaLoader.syntax[lang])
return text;
sy = parent.editAreaLoader.syntax[lang];
if(sy["custom_regexp"]['before']){
for( var i in sy["custom_regexp"]['before']){
var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3";
text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
}
}
if(sy["comment_or_quote_reg_exp"]){
//setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
}
if(sy["keywords_reg_exp"]){
for(var i in sy["keywords_reg_exp"]){
text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ');
}
}
if(sy["delimiters_reg_exp"]){
text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
}
if(sy["operators_reg_exp"]){
text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
}
if(sy["custom_regexp"]['after']){
for( var i in sy["custom_regexp"]['after']){
var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3";
text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);
}
}
return text;
};

View File

@@ -1,73 +1,73 @@
EditAreaLoader.prototype.start_resize_area= function(){
var d=document,a,div,width,height,father;
d.onmouseup= editAreaLoader.end_resize_area;
d.onmousemove= editAreaLoader.resize_area;
editAreaLoader.toggle(editAreaLoader.resize["id"]);
a = editAreas[editAreaLoader.resize["id"]]["textarea"];
div = d.getElementById("edit_area_resize");
if(!div){
div= d.createElement("div");
div.id="edit_area_resize";
div.style.border="dashed #888888 1px";
}
width = a.offsetWidth -2;
height = a.offsetHeight -2;
div.style.display = "block";
div.style.width = width+"px";
div.style.height = height+"px";
father= a.parentNode;
father.insertBefore(div, a);
a.style.display="none";
editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
};
EditAreaLoader.prototype.end_resize_area= function(e){
var d=document,div,a,width,height;
d.onmouseup="";
d.onmousemove="";
div = d.getElementById("edit_area_resize");
a= editAreas[editAreaLoader.resize["id"]]["textarea"];
width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
if(editAreaLoader.isIE==6){
width-=2;
height-=2;
}
a.style.width = width+"px";
a.style.height = height+"px";
div.style.display = "none";
a.style.display = "inline";
a.selectionStart = editAreaLoader.resize["selectionStart"];
a.selectionEnd = editAreaLoader.resize["selectionEnd"];
editAreaLoader.toggle(editAreaLoader.resize["id"]);
return false;
};
EditAreaLoader.prototype.resize_area= function(e){
var allow,newHeight,newWidth;
allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
if(allow=="both" || allow=="y")
{
newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
document.getElementById("edit_area_resize").style.height= newHeight+"px";
}
if(allow=="both" || allow=="x")
{
newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
document.getElementById("edit_area_resize").style.width= newWidth+"px";
}
return false;
};
editAreaLoader.waiting_loading["resize_area.js"]= "loaded";
EditAreaLoader.prototype.start_resize_area= function(){
var d=document,a,div,width,height,father;
d.onmouseup= editAreaLoader.end_resize_area;
d.onmousemove= editAreaLoader.resize_area;
editAreaLoader.toggle(editAreaLoader.resize["id"]);
a = editAreas[editAreaLoader.resize["id"]]["textarea"];
div = d.getElementById("edit_area_resize");
if(!div){
div= d.createElement("div");
div.id="edit_area_resize";
div.style.border="dashed #888888 1px";
}
width = a.offsetWidth -2;
height = a.offsetHeight -2;
div.style.display = "block";
div.style.width = width+"px";
div.style.height = height+"px";
father= a.parentNode;
father.insertBefore(div, a);
a.style.display="none";
editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
};
EditAreaLoader.prototype.end_resize_area= function(e){
var d=document,div,a,width,height;
d.onmouseup="";
d.onmousemove="";
div = d.getElementById("edit_area_resize");
a= editAreas[editAreaLoader.resize["id"]]["textarea"];
width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
if(editAreaLoader.isIE==6){
width-=2;
height-=2;
}
a.style.width = width+"px";
a.style.height = height+"px";
div.style.display = "none";
a.style.display = "inline";
a.selectionStart = editAreaLoader.resize["selectionStart"];
a.selectionEnd = editAreaLoader.resize["selectionEnd"];
editAreaLoader.toggle(editAreaLoader.resize["id"]);
return false;
};
EditAreaLoader.prototype.resize_area= function(e){
var allow,newHeight,newWidth;
allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
if(allow=="both" || allow=="y")
{
newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
document.getElementById("edit_area_resize").style.height= newHeight+"px";
}
if(allow=="both" || allow=="x")
{
newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
document.getElementById("edit_area_resize").style.width= newWidth+"px";
}
return false;
};
editAreaLoader.waiting_loading["resize_area.js"]= "loaded";

View File

@@ -1,174 +1,174 @@
EditArea.prototype.show_search = function(){
if(_$("area_search_replace").style.visibility=="visible"){
this.hidden_search();
}else{
this.open_inline_popup("area_search_replace");
var text= this.area_get_selection();
var search= text.split("\n")[0];
_$("area_search").value= search;
_$("area_search").focus();
}
};
EditArea.prototype.hidden_search= function(){
/*_$("area_search_replace").style.visibility="hidden";
this.textarea.focus();
var icon= _$("search");
setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
this.close_inline_popup("area_search_replace");
};
EditArea.prototype.area_search= function(mode){
if(!mode)
mode="search";
_$("area_search_msg").innerHTML="";
var search=_$("area_search").value;
this.textarea.focus();
this.textarea.textareaFocused=true;
var infos= this.get_selection_infos();
var start= infos["selectionStart"];
var pos=-1;
var pos_begin=-1;
var length=search.length;
if(_$("area_search_replace").style.visibility!="visible"){
this.show_search();
return;
}
if(search.length==0){
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
return;
}
// advance to the next occurence if no text selected
if(mode!="replace" ){
if(_$("area_search_reg_exp").checked)
start++;
else
start+= search.length;
}
//search
if(_$("area_search_reg_exp").checked){
// regexp search
var opt="m";
if(!_$("area_search_match_case").checked)
opt+="i";
var reg= new RegExp(search, opt);
pos= infos["full_text"].substr(start).search(reg);
pos_begin= infos["full_text"].search(reg);
if(pos!=-1){
pos+=start;
length=infos["full_text"].substr(start).match(reg)[0].length;
}else if(pos_begin!=-1){
length=infos["full_text"].match(reg)[0].length;
}
}else{
if(_$("area_search_match_case").checked){
pos= infos["full_text"].indexOf(search, start);
pos_begin= infos["full_text"].indexOf(search);
}else{
pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start);
pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase());
}
}
// interpret result
if(pos==-1 && pos_begin==-1){
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
return;
}else if(pos==-1 && pos_begin != -1){
begin= pos_begin;
_$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
}else
begin= pos;
//_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
if(mode=="replace" && pos==infos["indexOfCursor"]){
var replace= _$("area_replace").value;
var new_text="";
if(_$("area_search_reg_exp").checked){
var opt="m";
if(!_$("area_search_match_case").checked)
opt+="i";
var reg= new RegExp(search, opt);
new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
}else{
new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
}
this.textarea.value=new_text;
this.area_select(begin, length);
this.area_search();
}else
this.area_select(begin, length);
};
EditArea.prototype.area_replace= function(){
this.area_search("replace");
};
EditArea.prototype.area_replace_all= function(){
/* this.area_select(0, 0);
_$("area_search_msg").innerHTML="";
while(_$("area_search_msg").innerHTML==""){
this.area_replace();
}*/
var base_text= this.textarea.value;
var search= _$("area_search").value;
var replace= _$("area_replace").value;
if(search.length==0){
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
return ;
}
var new_text="";
var nb_change=0;
if(_$("area_search_reg_exp").checked){
// regExp
var opt="mg";
if(!_$("area_search_match_case").checked)
opt+="i";
var reg= new RegExp(search, opt);
nb_change= infos["full_text"].match(reg).length;
new_text= infos["full_text"].replace(reg, replace);
}else{
if(_$("area_search_match_case").checked){
var tmp_tab=base_text.split(search);
nb_change= tmp_tab.length -1 ;
new_text= tmp_tab.join(replace);
}else{
// case insensitive
var lower_value=base_text.toLowerCase();
var lower_search=search.toLowerCase();
var start=0;
var pos= lower_value.indexOf(lower_search);
while(pos!=-1){
nb_change++;
new_text+= this.textarea.value.substring(start , pos)+replace;
start=pos+ search.length;
pos= lower_value.indexOf(lower_search, pos+1);
}
new_text+= this.textarea.value.substring(start);
}
}
if(new_text==base_text){
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
}else{
this.textarea.value= new_text;
_$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
// firefox and opera doesn't manage with the focus if it's done directly
//editArea.textarea.focus();editArea.textarea.textareaFocused=true;
setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
}
};
EditArea.prototype.show_search = function(){
if(_$("area_search_replace").style.visibility=="visible"){
this.hidden_search();
}else{
this.open_inline_popup("area_search_replace");
var text= this.area_get_selection();
var search= text.split("\n")[0];
_$("area_search").value= search;
_$("area_search").focus();
}
};
EditArea.prototype.hidden_search= function(){
/*_$("area_search_replace").style.visibility="hidden";
this.textarea.focus();
var icon= _$("search");
setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
this.close_inline_popup("area_search_replace");
};
EditArea.prototype.area_search= function(mode){
if(!mode)
mode="search";
_$("area_search_msg").innerHTML="";
var search=_$("area_search").value;
this.textarea.focus();
this.textarea.textareaFocused=true;
var infos= this.get_selection_infos();
var start= infos["selectionStart"];
var pos=-1;
var pos_begin=-1;
var length=search.length;
if(_$("area_search_replace").style.visibility!="visible"){
this.show_search();
return;
}
if(search.length==0){
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
return;
}
// advance to the next occurence if no text selected
if(mode!="replace" ){
if(_$("area_search_reg_exp").checked)
start++;
else
start+= search.length;
}
//search
if(_$("area_search_reg_exp").checked){
// regexp search
var opt="m";
if(!_$("area_search_match_case").checked)
opt+="i";
var reg= new RegExp(search, opt);
pos= infos["full_text"].substr(start).search(reg);
pos_begin= infos["full_text"].search(reg);
if(pos!=-1){
pos+=start;
length=infos["full_text"].substr(start).match(reg)[0].length;
}else if(pos_begin!=-1){
length=infos["full_text"].match(reg)[0].length;
}
}else{
if(_$("area_search_match_case").checked){
pos= infos["full_text"].indexOf(search, start);
pos_begin= infos["full_text"].indexOf(search);
}else{
pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start);
pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase());
}
}
// interpret result
if(pos==-1 && pos_begin==-1){
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
return;
}else if(pos==-1 && pos_begin != -1){
begin= pos_begin;
_$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
}else
begin= pos;
//_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
if(mode=="replace" && pos==infos["indexOfCursor"]){
var replace= _$("area_replace").value;
var new_text="";
if(_$("area_search_reg_exp").checked){
var opt="m";
if(!_$("area_search_match_case").checked)
opt+="i";
var reg= new RegExp(search, opt);
new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
}else{
new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
}
this.textarea.value=new_text;
this.area_select(begin, length);
this.area_search();
}else
this.area_select(begin, length);
};
EditArea.prototype.area_replace= function(){
this.area_search("replace");
};
EditArea.prototype.area_replace_all= function(){
/* this.area_select(0, 0);
_$("area_search_msg").innerHTML="";
while(_$("area_search_msg").innerHTML==""){
this.area_replace();
}*/
var base_text= this.textarea.value;
var search= _$("area_search").value;
var replace= _$("area_replace").value;
if(search.length==0){
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
return ;
}
var new_text="";
var nb_change=0;
if(_$("area_search_reg_exp").checked){
// regExp
var opt="mg";
if(!_$("area_search_match_case").checked)
opt+="i";
var reg= new RegExp(search, opt);
nb_change= infos["full_text"].match(reg).length;
new_text= infos["full_text"].replace(reg, replace);
}else{
if(_$("area_search_match_case").checked){
var tmp_tab=base_text.split(search);
nb_change= tmp_tab.length -1 ;
new_text= tmp_tab.join(replace);
}else{
// case insensitive
var lower_value=base_text.toLowerCase();
var lower_search=search.toLowerCase();
var start=0;
var pos= lower_value.indexOf(lower_search);
while(pos!=-1){
nb_change++;
new_text+= this.textarea.value.substring(start , pos)+replace;
start=pos+ search.length;
pos= lower_value.indexOf(lower_search, pos+1);
}
new_text+= this.textarea.value.substring(start);
}
}
if(new_text==base_text){
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
}else{
this.textarea.value= new_text;
_$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
// firefox and opera doesn't manage with the focus if it's done directly
//editArea.textarea.focus();editArea.textarea.textareaFocused=true;
setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
}
};

View File

@@ -1,100 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>EditArea</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
[__CSSRULES__]
[__JSCODE__]
</head>
<body>
<div id='editor'>
<div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div>
<div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div>
<div id='result'>
<div id='no_file_selected'></div>
<div id='container'>
<div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div>
<div id='end_bracket' class='edit_area_cursor'>&nbsp;</div>
<div id='selection_field'></div>
<div id='line_number' selec='none'></div>
<div id='content_highlight'></div>
<div id='test_font_size'></div>
<div id='selection_field_text'></div>
<textarea id='textarea' wrap='off' onchange='editArea.execCommand("onchange");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'>
</textarea>
</div>
</div>
<div class='area_toolbar' id='toolbar_2'>
<table class='statusbar' cellspacing='0' cellpadding='0'>
<tr>
<td class='total' selec='none'>{$position}:</td>
<td class='infos' selec='none'>
{$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span>
</td>
<td class='total' selec='none'>{$total}:</td>
<td class='infos' selec='none'>
{$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span>
</td>
<td class='resize'>
<span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span>
</td>
</tr>
</table>
</div>
</div>
<div id='processing'>
<div id='processing_text'>
{$processing}
</div>
</div>
<div id='area_search_replace' class='editarea_popup'>
<table cellspacing='2' cellpadding='0' style='width: 100%'>
<tr>
<td selec='none'>{$search}</td>
<td><input type='text' id='area_search' /></td>
<td id='close_area_search_replace'>
<a onclick='Javascript:editArea.execCommand("hidden_search")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br />
</tr><tr>
<td selec='none'>{$replace}</td>
<td><input type='text' id='area_replace' /></td>
<td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["frame_"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td>
</tr>
</table>
<div class='button'>
<input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label>
<input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label>
<br />
<a onclick='Javascript:editArea.execCommand("area_search")' selec='none'>{$find_next}</a>
<a onclick='Javascript:editArea.execCommand("area_replace")' selec='none'>{$replace}</a>
<a onclick='Javascript:editArea.execCommand("area_replace_all")' selec='none'>{$replace_all}</a><br />
</div>
<div id='area_search_msg' selec='none'></div>
</div>
<div id='edit_area_help' class='editarea_popup'>
<div class='close_popup'>
<a onclick='Javascript:editArea.execCommand("close_all_inline_popup")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a>
</div>
<div><h2>Editarea [__EA_VERSION__]</h2><br />
<h3>{$shortcuts}:</h3>
{$tab}: {$add_tab}<br />
{$shift}+{$tab}: {$remove_tab}<br />
{$ctrl}+f: {$search_command}<br />
{$ctrl}+r: {$replace_command}<br />
{$ctrl}+h: {$highlight}<br />
{$ctrl}+g: {$go_to_line}<br />
{$ctrl}+z: {$undo}<br />
{$ctrl}+y: {$redo}<br />
{$ctrl}+e: {$help}<br />
{$ctrl}+q, {$esc}: {$close_popup}<br />
{$accesskey} E: {$toggle}<br />
<br />
<em>{$about_notice}</em>
<br /><div class='copyright'>&copy; Christophe Dolivet 2007-2010</div>
</div>
</div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>EditArea</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
[__CSSRULES__]
[__JSCODE__]
</head>
<body>
<div id='editor'>
<div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div>
<div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div>
<div id='result'>
<div id='no_file_selected'></div>
<div id='container'>
<div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div>
<div id='end_bracket' class='edit_area_cursor'>&nbsp;</div>
<div id='selection_field'></div>
<div id='line_number' selec='none'></div>
<div id='content_highlight'></div>
<div id='test_font_size'></div>
<div id='selection_field_text'></div>
<textarea id='textarea' wrap='off' onchange='editArea.execCommand("onchange");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'>
</textarea>
</div>
</div>
<div class='area_toolbar' id='toolbar_2'>
<table class='statusbar' cellspacing='0' cellpadding='0'>
<tr>
<td class='total' selec='none'>{$position}:</td>
<td class='infos' selec='none'>
{$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span>
</td>
<td class='total' selec='none'>{$total}:</td>
<td class='infos' selec='none'>
{$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span>
</td>
<td class='resize'>
<span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span>
</td>
</tr>
</table>
</div>
</div>
<div id='processing'>
<div id='processing_text'>
{$processing}
</div>
</div>
<div id='area_search_replace' class='editarea_popup'>
<table cellspacing='2' cellpadding='0' style='width: 100%'>
<tr>
<td selec='none'>{$search}</td>
<td><input type='text' id='area_search' /></td>
<td id='close_area_search_replace'>
<a onclick='Javascript:editArea.execCommand("hidden_search")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br />
</tr><tr>
<td selec='none'>{$replace}</td>
<td><input type='text' id='area_replace' /></td>
<td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["frame_"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td>
</tr>
</table>
<div class='button'>
<input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label>
<input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label>
<br />
<a onclick='Javascript:editArea.execCommand("area_search")' selec='none'>{$find_next}</a>
<a onclick='Javascript:editArea.execCommand("area_replace")' selec='none'>{$replace}</a>
<a onclick='Javascript:editArea.execCommand("area_replace_all")' selec='none'>{$replace_all}</a><br />
</div>
<div id='area_search_msg' selec='none'></div>
</div>
<div id='edit_area_help' class='editarea_popup'>
<div class='close_popup'>
<a onclick='Javascript:editArea.execCommand("close_all_inline_popup")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a>
</div>
<div><h2>Editarea [__EA_VERSION__]</h2><br />
<h3>{$shortcuts}:</h3>
{$tab}: {$add_tab}<br />
{$shift}+{$tab}: {$remove_tab}<br />
{$ctrl}+f: {$search_command}<br />
{$ctrl}+r: {$replace_command}<br />
{$ctrl}+h: {$highlight}<br />
{$ctrl}+g: {$go_to_line}<br />
{$ctrl}+z: {$undo}<br />
{$ctrl}+y: {$redo}<br />
{$ctrl}+e: {$help}<br />
{$ctrl}+q, {$esc}: {$close_popup}<br />
{$accesskey} E: {$toggle}<br />
<br />
<em>{$about_notice}</em>
<br /><div class='copyright'>&copy; Christophe Dolivet 2007-2010</div>
</div>
</div>
</body>
</html>