inline editing and code editor added
@ -17,12 +17,25 @@ class ComicPressAddonCore extends ComicPressAddon {
|
||||
add_action('template_redirect', array(&$this, 'go_to_random_comic'));
|
||||
}
|
||||
|
||||
$this->comicpress = $comicpress;
|
||||
|
||||
if (current_user_can('edit_posts') && isset($comicpress->comicpress_options['helpers']['show_inline_comic_ordering'])) {
|
||||
add_filter('comicpress_attached_image', array(&$this, 'comicpress_attached_image'), 10, 3);
|
||||
add_filter('comicpress_display_attached_images', array(&$this, 'comicpress_display_attached_images'), 10, 2);
|
||||
}
|
||||
|
||||
$this->comicpress = $comicpress;
|
||||
if (isset($this->comicpress->comicpress_options['helpers']['show_partials_info'])) {
|
||||
wp_enqueue_script('prototype');
|
||||
add_filter('comicpress_partial', array(&$this, 'show_inline_comicpress_partial_editor'), 20, 2);
|
||||
add_action('wp_head', array(&$this, 'add_inline_comicpress_partial_edit_hooks'));
|
||||
add_action('wp_footer', array(&$this, 'add_inline_comicpress_partial_holders'));
|
||||
}
|
||||
|
||||
if (is_admin()) {
|
||||
add_action('admin_head', array(&$this, 'add_edit_area'));
|
||||
} else {
|
||||
add_action('wp_head', array(&$this, 'add_edit_area'));
|
||||
}
|
||||
|
||||
$this->comic_image_types = array(
|
||||
'none' => __('Not a comic', 'comicpress'),
|
||||
@ -32,6 +45,81 @@ class ComicPressAddonCore extends ComicPressAddon {
|
||||
);
|
||||
}
|
||||
|
||||
function add_edit_area() { ?>
|
||||
<script type="text/javascript" src="<?php echo get_template_directory_uri() . str_replace(realpath(get_template_directory()), '', realpath(dirname(__FILE__) . '/edit_area/edit_area_full.js')) ?>"></script>
|
||||
<?php }
|
||||
|
||||
function show_inline_comicpress_partial_editor($content, $target) {
|
||||
$target = str_replace(get_template_directory() . DIRECTORY_SEPARATOR, '', $target);
|
||||
$content = preg_replace('#(<div class="partial-helper">)([^\<]+)(</div>)#', '\1\2 | <a href="#" rel="edit-' . md5($target) . '">Edit</a>\3', $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
function add_inline_comicpress_partial_edit_hooks() { ?>
|
||||
<style type="text/css">
|
||||
.inline-partial-editor {
|
||||
display: none;
|
||||
background: white;
|
||||
border: solid #333 1px;
|
||||
padding: 5px;
|
||||
z-index: 200
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
Event.observe(window, 'load', function() {
|
||||
$$('.partial-helper a').each(function(a) {
|
||||
Event.observe(a, 'click', function(e) {
|
||||
Event.stop(e);
|
||||
var edit_form = $(a.rel);
|
||||
if (edit_form) {
|
||||
if (!edit_form.visible()) {
|
||||
var holder = $(a.parentNode);
|
||||
var holder_dim = holder.getDimensions();
|
||||
edit_form.style.display = "block";
|
||||
edit_form.style.position = "absolute";
|
||||
edit_form.clonePosition(holder, { setWidth: false, setHeight: false, offsetTop: holder_dim['height'] });
|
||||
|
||||
editAreaLoader.init({
|
||||
id: "text-" + a.rel,
|
||||
syntax: "php",
|
||||
start_highlight: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php }
|
||||
|
||||
function add_inline_comicpress_partial_holders() {
|
||||
$nonce = wp_create_nonce('comicpress');
|
||||
|
||||
$valid_partials = array();
|
||||
foreach (glob(get_template_directory() . DIRECTORY_SEPARATOR . 'partials' . DIRECTORY_SEPARATOR . '*.inc') as $partial) {
|
||||
if (preg_match('#(partials.*)\.inc$#', $partial, $matches) > 0) {
|
||||
$valid_partials[] = $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($valid_partials as $key) {
|
||||
if (isset($this->comicpress->comicpress_options['override_partials'][$key])) {
|
||||
$partial_code = htmlentities($this->comicpress->comicpress_options['override_partials'][$key]);
|
||||
} else {
|
||||
$partial_code = htmlentities(file_get_contents(get_template_directory() . DIRECTORY_SEPARATOR . $key . '.inc'));
|
||||
}
|
||||
|
||||
$hash = md5($key); ?>
|
||||
<form id="edit-<?php echo $hash ?>" method="post" class="inline-partial-editor" style="display: none">
|
||||
<input type="hidden" name="cp[_nonce]" value="<?php echo $nonce ?>" />
|
||||
<textarea id="text-edit-<?php echo $hash ?>" name="cp[code]" cols="80" rows="15" wrap="off"><?php echo $partial_code ?></textarea>
|
||||
<input type="hidden" name="cp[partial]" value="<?php echo $key ?>" /><br />
|
||||
<input type="submit" class="button" name="cp[action]" value="<?php _e('Update partial', 'comicpress') ?>" />
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function comicpress_attached_image($content, $attachment_id, $index) {
|
||||
$content .= '<label class="comic-image-ordering">'
|
||||
. __('Image index:', 'comicpress')
|
||||
|
491
addons/Core/edit_area/autocompletion.js
Normal file
@ -0,0 +1,491 @@
|
||||
/**
|
||||
* Autocompletion class
|
||||
*
|
||||
* An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut
|
||||
*
|
||||
* Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory)
|
||||
* But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language)
|
||||
* and add a too important feature that many people would miss if included as a plugin
|
||||
*
|
||||
* - init param: autocompletion_start
|
||||
* - Button name: "autocompletion"
|
||||
*/
|
||||
|
||||
var EditArea_autocompletion= {
|
||||
|
||||
/**
|
||||
* Get called once this file is loaded (editArea still not initialized)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
init: function(){
|
||||
// alert("test init: "+ this._someInternalFunction(2, 3));
|
||||
|
||||
if(editArea.settings["autocompletion"])
|
||||
this.enabled= true;
|
||||
else
|
||||
this.enabled= false;
|
||||
this.current_word = false;
|
||||
this.shown = false;
|
||||
this.selectIndex = -1;
|
||||
this.forceDisplay = false;
|
||||
this.isInMiddleWord = false;
|
||||
this.autoSelectIfOneResult = false;
|
||||
this.delayBeforeDisplay = 100;
|
||||
this.checkDelayTimer = false;
|
||||
this.curr_syntax_str = '';
|
||||
|
||||
this.file_syntax_datas = {};
|
||||
}
|
||||
/**
|
||||
* Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
|
||||
* A control can be a button, select list or any other HTML item to present in the EditArea user interface.
|
||||
* Language variables such as {$lang_somekey} will also be replaced with contents from
|
||||
* the language packs.
|
||||
*
|
||||
* @param {string} ctrl_name: the name of the control to add
|
||||
* @return HTML code for a specific control or false.
|
||||
* @type string or boolean
|
||||
*/
|
||||
/*,get_control_html: function(ctrl_name){
|
||||
switch( ctrl_name ){
|
||||
case 'autocompletion':
|
||||
// Control id, button img, command
|
||||
return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
/**
|
||||
* Get called once EditArea is fully loaded and initialised
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
,onload: function(){
|
||||
if(this.enabled)
|
||||
{
|
||||
var icon= document.getElementById("autocompletion");
|
||||
if(icon)
|
||||
editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
|
||||
}
|
||||
|
||||
this.container = document.createElement('div');
|
||||
this.container.id = "auto_completion_area";
|
||||
editArea.container.insertBefore( this.container, editArea.container.firstChild );
|
||||
|
||||
// add event detection for hiding suggestion box
|
||||
parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} );
|
||||
parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Is called each time the user touch a keyboard key.
|
||||
*
|
||||
* @param (event) e: the keydown event
|
||||
* @return true - pass to next handler in chain, false - stop chain execution
|
||||
* @type boolean
|
||||
*/
|
||||
,onkeydown: function(e){
|
||||
if(!this.enabled)
|
||||
return true;
|
||||
|
||||
if (EA_keys[e.keyCode])
|
||||
letter=EA_keys[e.keyCode];
|
||||
else
|
||||
letter=String.fromCharCode(e.keyCode);
|
||||
// shown
|
||||
if( this._isShown() )
|
||||
{
|
||||
// if escape, hide the box
|
||||
if(letter=="Esc")
|
||||
{
|
||||
this._hide();
|
||||
return false;
|
||||
}
|
||||
// Enter
|
||||
else if( letter=="Entrer")
|
||||
{
|
||||
var as = this.container.getElementsByTagName('A');
|
||||
// select a suggested entry
|
||||
if( this.selectIndex >= 0 && this.selectIndex < as.length )
|
||||
{
|
||||
as[ this.selectIndex ].onmousedown();
|
||||
return false
|
||||
}
|
||||
// simply add an enter in the code
|
||||
else
|
||||
{
|
||||
this._hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if( letter=="Tab" || letter=="Down")
|
||||
{
|
||||
this._selectNext();
|
||||
return false;
|
||||
}
|
||||
else if( letter=="Up")
|
||||
{
|
||||
this._selectBefore();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// hidden
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// show current suggestion list and do autoSelect if possible (no matter it's shown or hidden)
|
||||
if( letter=="Space" && CtrlPressed(e) )
|
||||
{
|
||||
//parent.console.log('SHOW SUGGEST');
|
||||
this.forceDisplay = true;
|
||||
this.autoSelectIfOneResult = true;
|
||||
this._checkLetter();
|
||||
return false;
|
||||
}
|
||||
|
||||
// wait a short period for check that the cursor isn't moving
|
||||
setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 );
|
||||
this.checkDelayTimer = false;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Executes a specific command, this function handles plugin commands.
|
||||
*
|
||||
* @param {string} cmd: the name of the command being executed
|
||||
* @param {unknown} param: the parameter of the command
|
||||
* @return true - pass to next handler in chain, false - stop chain execution
|
||||
* @type boolean
|
||||
*/
|
||||
,execCommand: function(cmd, param){
|
||||
switch( cmd ){
|
||||
case 'toggle_autocompletion':
|
||||
var icon= document.getElementById("autocompletion");
|
||||
if(!this.enabled)
|
||||
{
|
||||
if(icon != null){
|
||||
editArea.restoreClass(icon);
|
||||
editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
|
||||
}
|
||||
this.enabled= true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.enabled= false;
|
||||
if(icon != null)
|
||||
editArea.switchClassSticky(icon, 'editAreaButtonNormal', false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
,_checkDelayAndCursorBeforeDisplay: function()
|
||||
{
|
||||
this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();", this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 );
|
||||
}
|
||||
// hide the suggested box
|
||||
,_hide: function(){
|
||||
this.container.style.display="none";
|
||||
this.selectIndex = -1;
|
||||
this.shown = false;
|
||||
this.forceDisplay = false;
|
||||
this.autoSelectIfOneResult = false;
|
||||
}
|
||||
// display the suggested box
|
||||
,_show: function(){
|
||||
if( !this._isShown() )
|
||||
{
|
||||
this.container.style.display="block";
|
||||
this.selectIndex = -1;
|
||||
this.shown = true;
|
||||
}
|
||||
}
|
||||
// is the suggested box displayed?
|
||||
,_isShown: function(){
|
||||
return this.shown;
|
||||
}
|
||||
// setter and getter
|
||||
,_isInMiddleWord: function( new_value ){
|
||||
if( typeof( new_value ) == "undefined" )
|
||||
return this.isInMiddleWord;
|
||||
else
|
||||
this.isInMiddleWord = new_value;
|
||||
}
|
||||
// select the next element in the suggested box
|
||||
,_selectNext: function()
|
||||
{
|
||||
var as = this.container.getElementsByTagName('A');
|
||||
|
||||
// clean existing elements
|
||||
for( var i=0; i<as.length; 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"), """) +"');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);
|
530
addons/Core/edit_area/edit_area.css
Normal file
@ -0,0 +1,530 @@
|
||||
body, html{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
body, html, table, form, textarea{
|
||||
font: 12px monospace, sans-serif;
|
||||
}
|
||||
|
||||
#editor{
|
||||
border: solid #888 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#result{
|
||||
z-index: 4;
|
||||
overflow-x: auto;
|
||||
overflow-y: scroll;
|
||||
border-top: solid #888 1px;
|
||||
border-bottom: solid #888 1px;
|
||||
position: relative;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#result.empty{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#container{
|
||||
overflow: hidden;
|
||||
border: solid blue 0;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
padding: 0 5px 0 45px;
|
||||
/*padding-right: 5px;*/
|
||||
}
|
||||
|
||||
#textarea{
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 7;
|
||||
border-width: 0;
|
||||
background-color: transparent;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
#textarea, #textarea:hover{
|
||||
outline: none; /* safari outline fix */
|
||||
}
|
||||
|
||||
#content_highlight{
|
||||
white-space: pre;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position : absolute;
|
||||
z-index: 4;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
|
||||
#selection_field, #selection_field_text{
|
||||
margin: 0;
|
||||
background-color: #E1F2F9;
|
||||
/* height: 1px; */
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
top: -100px;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#selection_field.show_colors {
|
||||
z-index: 3;
|
||||
background-color:#EDF9FC;
|
||||
|
||||
}
|
||||
|
||||
#selection_field strong{
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
#selection_field.show_colors *, #selection_field_text * {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#selection_field_text{
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
#selection_field_text strong{
|
||||
font-weight:normal;
|
||||
background-color:#3399FE;
|
||||
color: #FFF;
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
#container.word_wrap #content_highlight,
|
||||
#container.word_wrap #selection_field,
|
||||
#container.word_wrap #selection_field_text,
|
||||
#container.word_wrap #test_font_size{
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#line_number{
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
border-right: solid black 1px;
|
||||
z-index:8;
|
||||
width: 38px;
|
||||
padding: 0 5px 0 0;
|
||||
margin: 0 0 0 -45px;
|
||||
text-align: right;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
#test_font_size{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
pre{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.hidden{
|
||||
opacity: 0.2;
|
||||
filter:alpha(opacity=20);
|
||||
}
|
||||
|
||||
#result .edit_area_cursor{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
background-color: #FF6633;
|
||||
top: -100px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#result .edit_area_selection_field .overline{
|
||||
background-color: #996600;
|
||||
}
|
||||
|
||||
|
||||
/* area popup */
|
||||
.editarea_popup{
|
||||
border: solid 1px #888888;
|
||||
background-color: #ECE9D8;
|
||||
width: 250px;
|
||||
padding: 4px;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
z-index: 15;
|
||||
top: -500px;
|
||||
}
|
||||
|
||||
.editarea_popup, .editarea_popup table{
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
.editarea_popup img{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.editarea_popup .close_popup{
|
||||
float: right;
|
||||
line-height: 16px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editarea_popup .copyright{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Area_search */
|
||||
div#area_search_replace{
|
||||
/*width: 250px;*/
|
||||
}
|
||||
|
||||
div#area_search_replace img{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
div#area_search_replace div.button{
|
||||
text-align: center;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
div#area_search_replace .button a{
|
||||
cursor: pointer;
|
||||
border: solid 1px #888888;
|
||||
background-color: #DEDEDE;
|
||||
text-decoration: none;
|
||||
padding: 0 2px;
|
||||
color: #000000;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div#area_search_replace a:hover{
|
||||
/*border: solid 1px #888888;*/
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
div#area_search_replace #move_area_search_replace{
|
||||
cursor: move;
|
||||
border: solid 1px #888;
|
||||
}
|
||||
|
||||
div#area_search_replace #close_area_search_replace{
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div#area_search_replace #area_search_msg{
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
border-top: solid 1px #888;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* area help */
|
||||
#edit_area_help{
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
#edit_area_help div.close_popup{
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* area_toolbar */
|
||||
.area_toolbar{
|
||||
/*font: 11px sans-serif;*/
|
||||
width: 100%;
|
||||
/*height: 21px; */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #ECE9D8;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.area_toolbar, .area_toolbar table{
|
||||
font: 11px sans-serif;
|
||||
}
|
||||
|
||||
.area_toolbar img{
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.area_toolbar input{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar select{
|
||||
font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
|
||||
font-size: 7pt;
|
||||
font-weight: normal;
|
||||
margin: 2px 0 0 0 ;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
background-color: #F0F0EE;
|
||||
}
|
||||
|
||||
table.statusbar{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area_toolbar td.infos{
|
||||
text-align: center;
|
||||
width: 130px;
|
||||
border-right: solid 1px #888;
|
||||
border-width: 0 1px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar td.total{
|
||||
text-align: right;
|
||||
width: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar td.resize{
|
||||
text-align: right;
|
||||
}
|
||||
/*
|
||||
.area_toolbar span{
|
||||
line-height: 1px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}*/
|
||||
|
||||
.area_toolbar span#resize_area{
|
||||
cursor: nw-resize;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* toolbar buttons */
|
||||
.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
|
||||
border: 0; margin: 0; padding: 0; background: transparent;
|
||||
margin-top: 0;
|
||||
margin-left: 1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editAreaButtonNormal {
|
||||
border: 1px solid #ECE9D8 !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editAreaButtonOver {
|
||||
border: 1px solid #0A246A !important;
|
||||
cursor: pointer;
|
||||
background-color: #B6BDD2;
|
||||
}
|
||||
|
||||
.editAreaButtonDown {
|
||||
cursor: pointer;
|
||||
border: 1px solid #0A246A !important;
|
||||
background-color: #8592B5;
|
||||
}
|
||||
|
||||
.editAreaButtonSelected {
|
||||
border: 1px solid #C0C0BB !important;
|
||||
cursor: pointer;
|
||||
background-color: #F4F2E8;
|
||||
}
|
||||
|
||||
.editAreaButtonDisabled {
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
|
||||
-moz-opacity:0.3;
|
||||
opacity: 0.3;
|
||||
border: 1px solid #F0F0EE !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editAreaSeparatorLine {
|
||||
margin: 1px 2px;
|
||||
background-color: #C0C0BB;
|
||||
width: 2px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
/* waiting screen */
|
||||
#processing{
|
||||
display: none;
|
||||
background-color:#ECE9D8;
|
||||
border: solid #888 1px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#processing_text{
|
||||
position:absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
margin-left: -100px;
|
||||
margin-top: -10px;
|
||||
text-align: center;
|
||||
}
|
||||
/* end */
|
||||
|
||||
|
||||
/**** tab browsing area ****/
|
||||
#tab_browsing_area{
|
||||
display: none;
|
||||
background-color: #CCC9A8;
|
||||
border-top: 1px solid #888;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#tab_browsing_list {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#tab_browsing_list li {
|
||||
float: left;
|
||||
margin: -1px;
|
||||
}
|
||||
#tab_browsing_list a {
|
||||
position: relative;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
line-height:14px;
|
||||
}
|
||||
|
||||
#tab_browsing_list a span {
|
||||
display: block;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
border: 1px solid #888;
|
||||
border-width: 1px 1px 0;
|
||||
text-align: center;
|
||||
padding: 2px 2px 1px 4px;
|
||||
position: relative; /*IE 6 hack */
|
||||
}
|
||||
|
||||
#tab_browsing_list a b {
|
||||
display: block;
|
||||
border-bottom: 2px solid #617994;
|
||||
}
|
||||
|
||||
#tab_browsing_list a .edited {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab_browsing_list a.edited .edited {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#tab_browsing_list a img{
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
#tab_browsing_list a.edited img{
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
#tab_browsing_list a:hover span {
|
||||
background: #F4F2E8;
|
||||
border-color: #0A246A;
|
||||
}
|
||||
|
||||
#tab_browsing_list .selected a span{
|
||||
background: #046380;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
|
||||
#no_file_selected{
|
||||
height: 100%;
|
||||
width: 150%; /* Opera need more than 100% */
|
||||
background: #CCC;
|
||||
display: none;
|
||||
z-index: 20;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
/*** Non-editable mode ***/
|
||||
.non_editable #editor
|
||||
{
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.non_editable .area_toolbar
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*** Auto completion ***/
|
||||
#auto_completion_area
|
||||
{
|
||||
background: #FFF;
|
||||
border: solid 1px #888;
|
||||
position: absolute;
|
||||
z-index: 15;
|
||||
width: 280px;
|
||||
height: 180px;
|
||||
overflow: auto;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#auto_completion_area a, #auto_completion_area a:visited
|
||||
{
|
||||
display: block;
|
||||
padding: 0 2px 1px;
|
||||
color: #000;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
|
||||
{
|
||||
background: #D6E1FE;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#auto_completion_area ul
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none inside;
|
||||
}
|
||||
#auto_completion_area li
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
#auto_completion_area .prefix
|
||||
{
|
||||
font-style: italic;
|
||||
padding: 0 3px;
|
||||
}
|
525
addons/Core/edit_area/edit_area.js
Normal file
@ -0,0 +1,525 @@
|
||||
/******
|
||||
*
|
||||
* EditArea
|
||||
* Developped by Christophe Dolivet
|
||||
* Released under LGPL, Apache and BSD licenses (use the one you want)
|
||||
*
|
||||
******/
|
||||
|
||||
function EditArea(){
|
||||
var t=this;
|
||||
t.error= false; // to know if load is interrrupt
|
||||
|
||||
t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"},
|
||||
{popup_id: "edit_area_help", icon_id: "help"}];
|
||||
t.plugins= {};
|
||||
|
||||
t.line_number=0;
|
||||
|
||||
parent.editAreaLoader.set_browser_infos(t); // navigator identification
|
||||
// fix IE8 detection as we run in IE7 emulate mode through X-UA <meta> tag
|
||||
if( t.isIE >= 8 )
|
||||
t.isIE = 7;
|
||||
|
||||
t.last_selection={};
|
||||
t.last_text_to_highlight="";
|
||||
t.last_hightlighted_text= "";
|
||||
t.syntax_list= [];
|
||||
t.allready_used_syntax= {};
|
||||
t.check_line_selection_timer= 50; // the timer delay for modification and/or selection change detection
|
||||
|
||||
t.textareaFocused= false;
|
||||
t.highlight_selection_line= null;
|
||||
t.previous= [];
|
||||
t.next= [];
|
||||
t.last_undo="";
|
||||
t.files= {};
|
||||
t.filesIdAssoc= {};
|
||||
t.curr_file= '';
|
||||
//t.loaded= false;
|
||||
t.assocBracket={};
|
||||
t.revertAssocBracket= {};
|
||||
// bracket selection init
|
||||
t.assocBracket["("]=")";
|
||||
t.assocBracket["{"]="}";
|
||||
t.assocBracket["["]="]";
|
||||
for(var index in t.assocBracket){
|
||||
t.revertAssocBracket[t.assocBracket[index]]=index;
|
||||
}
|
||||
t.is_editable= true;
|
||||
|
||||
|
||||
/*t.textarea="";
|
||||
|
||||
t.state="declare";
|
||||
t.code = []; // store highlight syntax for languagues*/
|
||||
// font datas
|
||||
t.lineHeight= 16;
|
||||
/*t.default_font_family= "monospace";
|
||||
t.default_font_size= 10;*/
|
||||
t.tab_nb_char= 8; //nb of white spaces corresponding to a tabulation
|
||||
if(t.isOpera)
|
||||
t.tab_nb_char= 6;
|
||||
|
||||
t.is_tabbing= false;
|
||||
|
||||
t.fullscreen= {'isFull': false};
|
||||
|
||||
t.isResizing=false; // resize var
|
||||
|
||||
// init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation
|
||||
t.id= area_id;
|
||||
t.settings= editAreas[t.id]["settings"];
|
||||
|
||||
if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/))
|
||||
{
|
||||
t.tab_nb_char= t.settings['replace_tab_by_spaces'];
|
||||
t.tabulation="";
|
||||
for(var i=0; i<t.tab_nb_char; i++)
|
||||
t.tabulation+=" ";
|
||||
}else{
|
||||
t.tabulation="\t";
|
||||
}
|
||||
|
||||
// retrieve the init parameter for syntax
|
||||
if(t.settings["syntax_selection_allow"] && t.settings["syntax_selection_allow"].length>0)
|
||||
t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(",");
|
||||
|
||||
if(t.settings['syntax'])
|
||||
t.allready_used_syntax[t.settings['syntax']]=true;
|
||||
|
||||
|
||||
};
|
||||
EditArea.prototype.init= function(){
|
||||
var t=this, a, s=t.settings;
|
||||
t.textarea = _$("textarea");
|
||||
t.container = _$("container");
|
||||
t.result = _$("result");
|
||||
t.content_highlight = _$("content_highlight");
|
||||
t.selection_field = _$("selection_field");
|
||||
t.selection_field_text= _$("selection_field_text");
|
||||
t.processing_screen = _$("processing");
|
||||
t.editor_area = _$("editor");
|
||||
t.tab_browsing_area = _$("tab_browsing_area");
|
||||
t.test_font_size = _$("test_font_size");
|
||||
a = t.textarea;
|
||||
|
||||
if(!s['is_editable'])
|
||||
t.set_editable(false);
|
||||
|
||||
t.set_show_line_colors( s['show_line_colors'] );
|
||||
|
||||
if(syntax_selec= _$("syntax_selection"))
|
||||
{
|
||||
// set up syntax selection lsit in the toolbar
|
||||
for(var i=0; i<t.syntax_list.length; i++) {
|
||||
var syntax= t.syntax_list[i];
|
||||
var option= document.createElement("option");
|
||||
option.value= syntax;
|
||||
if(syntax==s['syntax'])
|
||||
option.selected= "selected";
|
||||
option.innerHTML= t.get_translation("syntax_" + syntax, "word");
|
||||
syntax_selec.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
// add plugins buttons in the toolbar
|
||||
spans= parent.getChildren(_$("toolbar_1"), "span", "", "", "all", -1);
|
||||
|
||||
for(var i=0; i<spans.length; i++){
|
||||
|
||||
id=spans[i].id.replace(/tmp_tool_(.*)/, "$1");
|
||||
if(id!= spans[i].id){
|
||||
for(var j in t.plugins){
|
||||
if(typeof(t.plugins[j].get_control_html)=="function" ){
|
||||
html=t.plugins[j].get_control_html(id);
|
||||
if(html!=false){
|
||||
html= t.get_translation(html, "template");
|
||||
var new_span= document.createElement("span");
|
||||
new_span.innerHTML= html;
|
||||
var father= spans[i].parentNode;
|
||||
spans[i].parentNode.replaceChild(new_span, spans[i]);
|
||||
break; // exit the for loop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// init datas
|
||||
//a.value = 'a';//editAreas[t.id]["textarea"].value;
|
||||
|
||||
if(s["debug"])
|
||||
{
|
||||
t.debug=parent.document.getElementById("edit_area_debug_"+t.id);
|
||||
}
|
||||
// init size
|
||||
//this.update_size();
|
||||
|
||||
if(_$("redo") != null)
|
||||
t.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
|
||||
|
||||
// insert css rules for highlight mode
|
||||
if(typeof(parent.editAreaLoader.syntax[s["syntax"]])!="undefined"){
|
||||
for(var i in parent.editAreaLoader.syntax){
|
||||
if (typeof(parent.editAreaLoader.syntax[i]["styles"]) != "undefined"){
|
||||
t.add_style(parent.editAreaLoader.syntax[i]["styles"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// init key events
|
||||
if(t.isOpera)
|
||||
_$("editor").onkeypress = keyDown;
|
||||
else
|
||||
_$("editor").onkeydown = keyDown;
|
||||
|
||||
for(var i=0; i<t.inlinePopup.length; i++){
|
||||
if(t.isOpera)
|
||||
_$(t.inlinePopup[i]["popup_id"]).onkeypress = keyDown;
|
||||
else
|
||||
_$(t.inlinePopup[i]["popup_id"]).onkeydown = keyDown;
|
||||
}
|
||||
|
||||
if(s["allow_resize"]=="both" || s["allow_resize"]=="x" || s["allow_resize"]=="y")
|
||||
t.allow_resize(true);
|
||||
|
||||
parent.editAreaLoader.toggle(t.id, "on");
|
||||
//a.focus();
|
||||
// line selection init
|
||||
t.change_smooth_selection_mode(editArea.smooth_selection);
|
||||
// highlight
|
||||
t.execCommand("change_highlight", s["start_highlight"]);
|
||||
|
||||
// get font size datas
|
||||
t.set_font(editArea.settings["font_family"], editArea.settings["font_size"]);
|
||||
|
||||
// set unselectable text
|
||||
children= parent.getChildren(document.body, "", "selec", "none", "all", -1);
|
||||
for(var i=0; i<children.length; i++){
|
||||
if(t.isIE)
|
||||
children[i].unselectable = true; // IE
|
||||
else
|
||||
children[i].onmousedown= function(){return false};
|
||||
/* children[i].style.MozUserSelect = "none"; // Moz
|
||||
children[i].style.KhtmlUserSelect = "none"; // Konqueror/Safari*/
|
||||
}
|
||||
|
||||
a.spellcheck= s["gecko_spellcheck"];
|
||||
|
||||
/** Browser specific style fixes **/
|
||||
|
||||
// fix rendering bug for highlighted lines beginning with no tabs
|
||||
if( t.isFirefox >= '3' ) {
|
||||
t.content_highlight.style.paddingLeft= "1px";
|
||||
t.selection_field.style.paddingLeft= "1px";
|
||||
t.selection_field_text.style.paddingLeft= "1px";
|
||||
}
|
||||
|
||||
if(t.isIE && t.isIE < 8 ){
|
||||
a.style.marginTop= "-1px";
|
||||
}
|
||||
/*
|
||||
if(t.isOpera){
|
||||
t.editor_area.style.position= "absolute";
|
||||
}*/
|
||||
|
||||
if( t.isSafari ){
|
||||
t.editor_area.style.position = "absolute";
|
||||
a.style.marginLeft ="-3px";
|
||||
if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
|
||||
a.style.marginTop ="1px";
|
||||
}
|
||||
|
||||
// si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
|
||||
parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);} });
|
||||
|
||||
if(s['is_multi_files']!=false)
|
||||
t.open_file({'id': t.curr_file, 'text': ''});
|
||||
|
||||
t.set_word_wrap( s['word_wrap'] );
|
||||
|
||||
setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10);
|
||||
//start checkup routine
|
||||
t.check_undo();
|
||||
t.check_line_selection(true);
|
||||
t.scroll_to_view();
|
||||
|
||||
for(var i in t.plugins){
|
||||
if(typeof(t.plugins[i].onload)=="function")
|
||||
t.plugins[i].onload();
|
||||
}
|
||||
if(s['fullscreen']==true)
|
||||
t.toggle_full_screen(true);
|
||||
|
||||
parent.editAreaLoader.add_event(window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.add_event(window, "unload", function(){
|
||||
// in case where editAreaLoader have been already cleaned
|
||||
if( parent.editAreaLoader )
|
||||
{
|
||||
parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size);
|
||||
parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size);
|
||||
}
|
||||
if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){
|
||||
editArea.execCommand("EA_unload");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*date= new Date();
|
||||
alert(date.getTime()- parent.editAreaLoader.start_time);*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
//called by the toggle_on
|
||||
EditArea.prototype.update_size= function(){
|
||||
var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop;
|
||||
|
||||
if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){
|
||||
if(editArea.fullscreen['isFull']){
|
||||
pd.getElementById("frame_"+editArea.id).style.width = pd.getElementsByTagName("html")[0].clientWidth + "px";
|
||||
pd.getElementById("frame_"+editArea.id).style.height = pd.getElementsByTagName("html")[0].clientHeight + "px";
|
||||
}
|
||||
|
||||
if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) )
|
||||
{
|
||||
editArea.tab_browsing_area.style.height = "0px";
|
||||
editArea.tab_browsing_area.style.height = (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px";
|
||||
}
|
||||
|
||||
height = d.body.offsetHeight - editArea.get_all_toolbar_height() - 4;
|
||||
editArea.result.style.height = height +"px";
|
||||
|
||||
width = d.body.offsetWidth -2;
|
||||
editArea.result.style.width = width+"px";
|
||||
//alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight);
|
||||
|
||||
// check that the popups don't get out of the screen
|
||||
for( i=0; i < editArea.inlinePopup.length; i++ )
|
||||
{
|
||||
popup = _$(editArea.inlinePopup[i]["popup_id"]);
|
||||
maxLeft = d.body.offsetWidth - popup.offsetWidth;
|
||||
maxTop = d.body.offsetHeight - popup.offsetHeight;
|
||||
if( popup.offsetTop > maxTop )
|
||||
popup.style.top = maxTop+"px";
|
||||
if( popup.offsetLeft > maxLeft )
|
||||
popup.style.left = maxLeft+"px";
|
||||
}
|
||||
|
||||
editArea.manage_size( true );
|
||||
editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.manage_size= function(onlyOneTime){
|
||||
if(!editAreas[this.id])
|
||||
return false;
|
||||
|
||||
if(editAreas[this.id]["displayed"]==true && this.textareaFocused)
|
||||
{
|
||||
var area_height,resized= false;
|
||||
|
||||
//1) Manage display width
|
||||
//1.1) Calc the new width to use for display
|
||||
if( !this.settings['word_wrap'] )
|
||||
{
|
||||
var area_width= this.textarea.scrollWidth;
|
||||
area_height= this.textarea.scrollHeight;
|
||||
// bug on old opera versions
|
||||
if(this.isOpera && this.isOpera < 9.6 ){
|
||||
area_width=10000;
|
||||
}
|
||||
//1.2) the width is not the same, we must resize elements
|
||||
if(this.textarea.previous_scrollWidth!=area_width)
|
||||
{
|
||||
this.container.style.width= area_width+"px";
|
||||
this.textarea.style.width= area_width+"px";
|
||||
this.content_highlight.style.width= area_width+"px";
|
||||
this.textarea.previous_scrollWidth=area_width;
|
||||
resized=true;
|
||||
}
|
||||
}
|
||||
// manage wrap width
|
||||
if( this.settings['word_wrap'] )
|
||||
{
|
||||
newW=this.textarea.offsetWidth;
|
||||
if( this.isFirefox || this.isIE )
|
||||
newW-=2;
|
||||
if( this.isSafari )
|
||||
newW-=6;
|
||||
this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px";
|
||||
}
|
||||
|
||||
//2) Manage display height
|
||||
//2.1) Calc the new height to use for display
|
||||
if( this.isOpera || this.isFirefox || this.isSafari ) {
|
||||
area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 );
|
||||
} else {
|
||||
area_height = this.textarea.scrollHeight;
|
||||
}
|
||||
//2.2) the width is not the same, we must resize elements
|
||||
if(this.textarea.previous_scrollHeight!=area_height)
|
||||
{
|
||||
this.container.style.height= (area_height+2)+"px";
|
||||
this.textarea.style.height= area_height+"px";
|
||||
this.content_highlight.style.height= area_height+"px";
|
||||
this.textarea.previous_scrollHeight= area_height;
|
||||
resized=true;
|
||||
}
|
||||
|
||||
//3) if there is new lines, we add new line numbers in the line numeration area
|
||||
if(this.last_selection["nb_line"] >= this.line_number)
|
||||
{
|
||||
var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100;
|
||||
for( i = start+1; i < end; i++ )
|
||||
{
|
||||
newLines+='<div id="line_'+ i +'">'+i+"</div>";
|
||||
this.line_number++;
|
||||
}
|
||||
destDiv.innerHTML= destDiv.innerHTML + newLines;
|
||||
|
||||
this.fixLinesHeight( this.textarea.value, start, -1 );
|
||||
}
|
||||
|
||||
//4) be sure the text is well displayed
|
||||
this.textarea.scrollTop="0px";
|
||||
this.textarea.scrollLeft="0px";
|
||||
if(resized==true){
|
||||
this.scroll_to_view();
|
||||
}
|
||||
}
|
||||
|
||||
if(!onlyOneTime)
|
||||
setTimeout("editArea.manage_size();", 100);
|
||||
};
|
||||
|
||||
EditArea.prototype.execCommand= function(cmd, param){
|
||||
|
||||
for(var i in this.plugins){
|
||||
if(typeof(this.plugins[i].execCommand)=="function"){
|
||||
if(!this.plugins[i].execCommand(cmd, param))
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(cmd){
|
||||
case "save":
|
||||
if(this.settings["save_callback"].length>0)
|
||||
eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);");
|
||||
break;
|
||||
case "load":
|
||||
if(this.settings["load_callback"].length>0)
|
||||
eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "onchange":
|
||||
if(this.settings["change_callback"].length>0)
|
||||
eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "EA_load":
|
||||
if(this.settings["EA_load_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "EA_unload":
|
||||
if(this.settings["EA_unload_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "toggle_on":
|
||||
if(this.settings["EA_toggle_on_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "toggle_off":
|
||||
if(this.settings["EA_toggle_off_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');");
|
||||
break;
|
||||
case "re_sync":
|
||||
if(!this.do_highlight)
|
||||
break;
|
||||
case "file_switch_on":
|
||||
if(this.settings["EA_file_switch_on_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);");
|
||||
break;
|
||||
case "file_switch_off":
|
||||
if(this.settings["EA_file_switch_off_callback"].length>0)
|
||||
eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);");
|
||||
break;
|
||||
case "file_close":
|
||||
if(this.settings["EA_file_close_callback"].length>0)
|
||||
return eval("parent."+this.settings["EA_file_close_callback"]+"(param);");
|
||||
break;
|
||||
|
||||
default:
|
||||
if(typeof(eval("editArea."+cmd))=="function")
|
||||
{
|
||||
if(this.settings["debug"])
|
||||
eval("editArea."+ cmd +"(param);");
|
||||
else
|
||||
try{eval("editArea."+ cmd +"(param);");}catch(e){};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.get_translation= function(word, mode){
|
||||
if(mode=="template")
|
||||
return parent.editAreaLoader.translate(word, this.settings["language"], mode);
|
||||
else
|
||||
return parent.editAreaLoader.get_word_translation(word, this.settings["language"]);
|
||||
};
|
||||
|
||||
EditArea.prototype.add_plugin= function(plug_name, plug_obj){
|
||||
for(var i=0; i<this.settings["plugins"].length; i++){
|
||||
if(this.settings["plugins"][i]==plug_name){
|
||||
this.plugins[plug_name]=plug_obj;
|
||||
plug_obj.baseURL=parent.editAreaLoader.baseURL + "plugins/" + plug_name + "/";
|
||||
if( typeof(plug_obj.init)=="function" )
|
||||
plug_obj.init();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.load_css= function(url){
|
||||
try{
|
||||
link = document.createElement("link");
|
||||
link.type = "text/css";
|
||||
link.rel= "stylesheet";
|
||||
link.media="all";
|
||||
link.href = url;
|
||||
head = document.getElementsByTagName("head");
|
||||
head[0].appendChild(link);
|
||||
}catch(e){
|
||||
document.write("<link href='"+ url +"' rel='stylesheet' type='text/css' />");
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.load_script= function(url){
|
||||
try{
|
||||
script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.src = url;
|
||||
script.charset= "UTF-8";
|
||||
head = document.getElementsByTagName("head");
|
||||
head[0].appendChild(script);
|
||||
}catch(e){
|
||||
document.write("<script type='text/javascript' src='" + url + "' charset=\"UTF-8\"><"+"/script>");
|
||||
}
|
||||
};
|
||||
|
||||
// add plugin translation to language translation array
|
||||
EditArea.prototype.add_lang= function(language, values){
|
||||
if(!parent.editAreaLoader.lang[language])
|
||||
parent.editAreaLoader.lang[language]={};
|
||||
for(var i in values)
|
||||
parent.editAreaLoader.lang[language][i]= values[i];
|
||||
};
|
||||
|
||||
// short cut for document.getElementById()
|
||||
function _$(id){return document.getElementById( id );};
|
||||
|
||||
var editArea = new EditArea();
|
||||
parent.editAreaLoader.add_event(window, "load", init);
|
||||
|
||||
function init(){
|
||||
setTimeout("editArea.init(); ", 10);
|
||||
};
|
408
addons/Core/edit_area/edit_area_compressor.php
Normal file
@ -0,0 +1,408 @@
|
||||
<?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);
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
?>
|
BIN
addons/Core/edit_area/edit_area_full.gz
Normal file
38
addons/Core/edit_area/edit_area_full.js
Normal file
BIN
addons/Core/edit_area/edit_area_full_with_plugins.gz
Normal file
39
addons/Core/edit_area/edit_area_full_with_plugins.js
Normal file
1203
addons/Core/edit_area/edit_area_functions.js
Normal file
1080
addons/Core/edit_area/edit_area_loader.js
Normal file
333
addons/Core/edit_area/elements_functions.js
Normal file
@ -0,0 +1,333 @@
|
||||
/****
|
||||
* 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( this.isOpera && this.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(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){}
|
||||
}
|
||||
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";
|
391
addons/Core/edit_area/highlight.js
Normal file
@ -0,0 +1,391 @@
|
||||
// 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
|
||||
*/
|
||||
//-------------------------------------------
|
||||
//
|
||||
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;
|
||||
|
||||
// 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 );
|
||||
|
||||
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 = beginStr.length - Math.max( 0, beginStr.lastIndexOf( '>' ) + 1 );
|
||||
|
||||
// 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 );
|
||||
|
||||
// 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);
|
||||
};
|
BIN
addons/Core/edit_area/images/autocompletion.gif
Normal file
After Width: | Height: | Size: 359 B |
BIN
addons/Core/edit_area/images/close.gif
Normal file
After Width: | Height: | Size: 102 B |
BIN
addons/Core/edit_area/images/fullscreen.gif
Normal file
After Width: | Height: | Size: 198 B |
BIN
addons/Core/edit_area/images/go_to_line.gif
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
addons/Core/edit_area/images/help.gif
Normal file
After Width: | Height: | Size: 295 B |
BIN
addons/Core/edit_area/images/highlight.gif
Normal file
After Width: | Height: | Size: 256 B |
BIN
addons/Core/edit_area/images/load.gif
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
addons/Core/edit_area/images/move.gif
Normal file
After Width: | Height: | Size: 257 B |
BIN
addons/Core/edit_area/images/newdocument.gif
Normal file
After Width: | Height: | Size: 170 B |
BIN
addons/Core/edit_area/images/opacity.png
Normal file
After Width: | Height: | Size: 147 B |
BIN
addons/Core/edit_area/images/processing.gif
Normal file
After Width: | Height: | Size: 825 B |
BIN
addons/Core/edit_area/images/redo.gif
Normal file
After Width: | Height: | Size: 169 B |
BIN
addons/Core/edit_area/images/reset_highlight.gif
Normal file
After Width: | Height: | Size: 168 B |
BIN
addons/Core/edit_area/images/save.gif
Normal file
After Width: | Height: | Size: 285 B |
BIN
addons/Core/edit_area/images/search.gif
Normal file
After Width: | Height: | Size: 191 B |
BIN
addons/Core/edit_area/images/smooth_selection.gif
Normal file
After Width: | Height: | Size: 174 B |
BIN
addons/Core/edit_area/images/spacer.gif
Normal file
After Width: | Height: | Size: 43 B |
BIN
addons/Core/edit_area/images/statusbar_resize.gif
Normal file
After Width: | Height: | Size: 79 B |
BIN
addons/Core/edit_area/images/undo.gif
Normal file
After Width: | Height: | Size: 175 B |
BIN
addons/Core/edit_area/images/word_wrap.gif
Normal file
After Width: | Height: | Size: 951 B |
145
addons/Core/edit_area/keyboard.js
Normal file
@ -0,0 +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" && !editArea.isOpera){
|
||||
editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
|
||||
use=true;
|
||||
}else if(letter=="Page down" && !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));
|
||||
}
|
||||
};
|
73
addons/Core/edit_area/langs/bg.js
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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: "--Синтаксис--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "PHP",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "XML",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "C++",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Затвори файла"
|
||||
};
|
67
addons/Core/edit_area/langs/cs.js
Normal file
@ -0,0 +1,67 @@
|
||||
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č--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/de.js
Normal file
@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["de"]={
|
||||
new_document: "Neues Dokument",
|
||||
search_button: "Suchen und Ersetzen",
|
||||
search_command: "Weitersuchen / öffne Suchfeld",
|
||||
search: "Suchen",
|
||||
replace: "Ersetzen",
|
||||
replace_command: "Ersetzen / öffne Suchfeld",
|
||||
find_next: "Weitersuchen",
|
||||
replace_all: "Ersetze alle Treffer",
|
||||
reg_exp: "reguläre Ausdrü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öße--",
|
||||
go_to_line: "Gehe zu Zeile",
|
||||
go_to_line_prompt: "Gehe zu Zeilennummmer:",
|
||||
undo: "Rückgä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ücksetzen (falls mit Text nicht konform)",
|
||||
word_wrap: "Toggle word wrapping mode",
|
||||
help: "Info",
|
||||
save: "Speichern",
|
||||
load: "Öffnen",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Gesamt",
|
||||
close_popup: "Popup schließen",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "Tab zum Text hinzufügen",
|
||||
remove_tab: "Tab aus Text entfernen",
|
||||
about_notice: "Bemerkung: Syntax Highlighting ist nur fü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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/dk.js
Normal file
@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["dk"]={
|
||||
new_document: "nyt tomt dokument",
|
||||
search_button: "søg og erstat",
|
||||
search_command: "find næste / åben søgefelt",
|
||||
search: "søg",
|
||||
replace: "erstat",
|
||||
replace_command: "erstat / åben søgefelt",
|
||||
find_next: "find næste",
|
||||
replace_all: "erstat alle",
|
||||
reg_exp: "regular expressions",
|
||||
match_case: "forskel på store/små 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å til linie",
|
||||
go_to_line_prompt: "gå til linienummer:",
|
||||
undo: "fortryd",
|
||||
redo: "gentag",
|
||||
change_smooth_selection: "slå display funktioner til/fra (smartere display men mere CPU krævende)",
|
||||
highlight: "slå 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øj tabulation til tekst",
|
||||
remove_tab: "fjern tabulation fra tekst",
|
||||
about_notice: "Husk: syntax highlight funktionen bør kun bruge til små tekster",
|
||||
toggle: "Slå editor til / fra",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Skift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processing...",
|
||||
fullscreen: "fullscreen",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/en.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/eo.js
Normal file
@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["eo"]={
|
||||
new_document: "nova dokumento (vakigas la enhavon)",
|
||||
search_button: "serĉi / anstataŭigi",
|
||||
search_command: "pluserĉi / malfermi la serĉo-fenestron",
|
||||
search: "serĉi",
|
||||
replace: "anstataŭigi",
|
||||
replace_command: "anstataŭigi / malfermi la serĉo-fenestron",
|
||||
find_next: "serĉi",
|
||||
replace_all: "anstataŭigi ĉion",
|
||||
reg_exp: "regula esprimo",
|
||||
match_case: "respekti la usklecon",
|
||||
not_found: "ne trovita.",
|
||||
occurrence_replaced: "anstataŭigoj plenumitaj.",
|
||||
search_field_empty: "La kampo estas malplena.",
|
||||
restart_search_at_begin: "Fino de teksto ĝisrirata, ĉu daŭrigi el la komenco?",
|
||||
move_popup: "movi la serĉ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 ŝarĝo de la ĉ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: "ŝarĝi",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Sg",
|
||||
position: "Pozicio",
|
||||
total: "Sumo",
|
||||
close_popup: "fermi la ŝ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: "ŝargante...",
|
||||
fullscreen: "plenekrane",
|
||||
syntax_selection: "--Sintakso--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Pitono",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Fermi la dosieron"
|
||||
};
|
64
addons/Core/edit_area/langs/es.js
Normal file
@ -0,0 +1,64 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/fi.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Sulje tiedosto"
|
||||
};
|
67
addons/Core/edit_area/langs/fr.js
Normal file
@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["fr"]={
|
||||
new_document: "nouveau document (efface le contenu)",
|
||||
search_button: "rechercher / remplacer",
|
||||
search_command: "rechercher suivant / ouvrir la fenêtre de recherche",
|
||||
search: "rechercher",
|
||||
replace: "remplacer",
|
||||
replace_command: "remplacer / ouvrir la fenêtre de recherche",
|
||||
find_next: "rechercher",
|
||||
replace_all: "tout remplacer",
|
||||
reg_exp: "expr. régulière",
|
||||
match_case: "respecter la casse",
|
||||
not_found: "pas trouvé.",
|
||||
occurrence_replaced: "remplacements éffectués.",
|
||||
search_field_empty: "Le champ de recherche est vide.",
|
||||
restart_search_at_begin: "Fin du texte atteint, poursuite au début.",
|
||||
move_popup: "déplacer la fenêtre de recherche",
|
||||
font_size: "--Taille police--",
|
||||
go_to_line: "aller à la ligne",
|
||||
go_to_line_prompt: "aller a la ligne numero:",
|
||||
undo: "annuler",
|
||||
redo: "refaire",
|
||||
change_smooth_selection: "activer/désactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
|
||||
highlight: "activer/désactiver la coloration syntaxique",
|
||||
reset_highlight: "réinitialiser la coloration syntaxique (si désyncronisée du texte)",
|
||||
word_wrap: "activer/désactiver les retours à la ligne automatiques",
|
||||
help: "à 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évue que pour de courts textes.",
|
||||
toggle: "basculer l'éditeur",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Maj",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "chargement...",
|
||||
fullscreen: "plein écran",
|
||||
syntax_selection: "--Syntaxe--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Fermer le fichier"
|
||||
};
|
67
addons/Core/edit_area/langs/hr.js
Normal file
@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["hr"]={
|
||||
new_document: "Novi dokument",
|
||||
search_button: "Traži i izmijeni",
|
||||
search_command: "Traži dalje / Otvori prozor za traženje",
|
||||
search: "Traži",
|
||||
replace: "Izmijeni",
|
||||
replace_command: "Izmijeni / Otvori prozor za traženje",
|
||||
find_next: "Traži dalje",
|
||||
replace_all: "Izmjeni sve",
|
||||
reg_exp: "Regularni izrazi",
|
||||
match_case: "Bitna vel. slova",
|
||||
not_found: "nije naðeno.",
|
||||
occurrence_replaced: "izmjenjenih.",
|
||||
search_field_empty: "Prazno polje za traženje!",
|
||||
restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.",
|
||||
move_popup: "Pomakni prozor",
|
||||
font_size: "--Velièina teksta--",
|
||||
go_to_line: "Odi na redak",
|
||||
go_to_line_prompt: "Odi na redak:",
|
||||
undo: "Vrati natrag",
|
||||
redo: "Napravi ponovo",
|
||||
change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)",
|
||||
highlight: "Ukljuèi/iskljuèi bojanje sintakse",
|
||||
reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)",
|
||||
word_wrap: "toggle word wrapping mode",
|
||||
help: "O edit_area",
|
||||
save: "Spremi",
|
||||
load: "Uèitaj",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Zn",
|
||||
position: "Pozicija",
|
||||
total: "Ukupno",
|
||||
close_popup: "Zatvori prozor",
|
||||
shortcuts: "Kratice",
|
||||
add_tab: "Dodaj tabulaciju",
|
||||
remove_tab: "Makni tabulaciju",
|
||||
about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove",
|
||||
toggle: "Prebaci naèin ureðivanja",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Procesiram...",
|
||||
fullscreen: "Cijeli prozor",
|
||||
syntax_selection: "--Syntax--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/it.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/ja.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/mk.js
Normal file
@ -0,0 +1,67 @@
|
||||
editAreaLoader.lang["mk"]={
|
||||
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: "Ресетирај го осветлувањето на синтакса (доколку е десинхронизиранo со текстот)",
|
||||
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: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Обработувам...",
|
||||
fullscreen: "Цел прозорец",
|
||||
syntax_selection: "--Синтакса--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Избери датотека"
|
||||
};
|
67
addons/Core/edit_area/langs/nl.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/pl.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/pt.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/ru.js
Normal file
@ -0,0 +1,67 @@
|
||||
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: "--Синтакс--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Закрыть файл"
|
||||
};
|
67
addons/Core/edit_area/langs/sk.js
Normal file
@ -0,0 +1,67 @@
|
||||
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--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "Close file"
|
||||
};
|
67
addons/Core/edit_area/langs/zh.js
Normal file
@ -0,0 +1,67 @@
|
||||
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: "--语法--",
|
||||
syntax_css: "CSS",
|
||||
syntax_html: "HTML",
|
||||
syntax_js: "Javascript",
|
||||
syntax_php: "Php",
|
||||
syntax_python: "Python",
|
||||
syntax_vb: "Visual Basic",
|
||||
syntax_xml: "Xml",
|
||||
syntax_c: "C",
|
||||
syntax_cpp: "CPP",
|
||||
syntax_basic: "Basic",
|
||||
syntax_pas: "Pascal",
|
||||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
syntax_java: "Java",
|
||||
close_tab: "关闭文件"
|
||||
};
|
7
addons/Core/edit_area/license_apache.txt
Normal file
@ -0,0 +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
|
||||
|
||||
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.
|
10
addons/Core/edit_area/license_bsd.txt
Normal file
@ -0,0 +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.
|
||||
|
||||
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.
|
458
addons/Core/edit_area/license_lgpl.txt
Normal file
@ -0,0 +1,458 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
623
addons/Core/edit_area/manage_area.js
Normal file
@ -0,0 +1,623 @@
|
||||
EditArea.prototype.focus = function() {
|
||||
this.textarea.focus();
|
||||
this.textareaFocused=true;
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.check_line_selection= function(timer_checkup){
|
||||
var changes, infos, new_top, new_width,i;
|
||||
|
||||
var t1=t2=t2_1=t3=tLines=tend= new Date().getTime();
|
||||
// l'editeur n'existe plus => on quitte
|
||||
if(!editAreas[this.id])
|
||||
return false;
|
||||
|
||||
if(!this.smooth_selection && !this.do_highlight)
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
else if(this.textareaFocused && editAreas[this.id]["displayed"]==true && this.isResizing==false)
|
||||
{
|
||||
infos = this.get_selection_infos();
|
||||
changes = this.checkTextEvolution( typeof( this.last_selection['full_text'] ) == 'undefined' ? '' : this.last_selection['full_text'], infos['full_text'] );
|
||||
|
||||
t2= new Date().getTime();
|
||||
|
||||
// if selection change
|
||||
if(this.last_selection["line_start"] != infos["line_start"] || this.last_selection["line_nb"] != infos["line_nb"] || infos["full_text"] != this.last_selection["full_text"] || this.reload_highlight || this.last_selection["selectionStart"] != infos["selectionStart"] || this.last_selection["selectionEnd"] != infos["selectionEnd"] || !timer_checkup )
|
||||
{
|
||||
// move and adjust text selection elements
|
||||
new_top = this.getLinePosTop( infos["line_start"] );
|
||||
new_width = Math.max(this.textarea.scrollWidth, this.container.clientWidth -50);
|
||||
this.selection_field.style.top=this.selection_field_text.style.top=new_top+"px";
|
||||
if(!this.settings['word_wrap']){
|
||||
this.selection_field.style.width=this.selection_field_text.style.width=this.test_font_size.style.width=new_width+"px";
|
||||
}
|
||||
|
||||
// usefull? => _$("cursor_pos").style.top=new_top+"px";
|
||||
|
||||
if(this.do_highlight==true)
|
||||
{
|
||||
// fill selection elements
|
||||
var curr_text = infos["full_text"].split("\n");
|
||||
var content = "";
|
||||
//alert("length: "+curr_text.length+ " i: "+ Math.max(0,infos["line_start"]-1)+ " end: "+Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1)+ " line: "+infos["line_start"]+" [0]: "+curr_text[0]+" [1]: "+curr_text[1]);
|
||||
var start = Math.max(0,infos["line_start"]-1);
|
||||
var end = Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1);
|
||||
|
||||
//curr_text[start]= curr_text[start].substr(0,infos["curr_pos"]-1) +"¤_overline_¤"+ curr_text[start].substr(infos["curr_pos"]-1);
|
||||
for(i=start; i< end; i++){
|
||||
content+= curr_text[i]+"\n";
|
||||
}
|
||||
|
||||
// add special chars arround selected characters
|
||||
selLength = infos['selectionEnd'] - infos['selectionStart'];
|
||||
content = content.substr( 0, infos["curr_pos"] - 1 ) + "\r\r" + content.substr( infos["curr_pos"] - 1, selLength ) + "\r\r" + content.substr( infos["curr_pos"] - 1 + selLength );
|
||||
content = '<span>'+ content.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace("\r\r", '</span><strong>').replace("\r\r", '</strong><span>') +'</span>';
|
||||
|
||||
if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
|
||||
this.selection_field.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
|
||||
} else {
|
||||
this.selection_field.innerHTML= content;
|
||||
}
|
||||
this.selection_field_text.innerHTML = this.selection_field.innerHTML;
|
||||
t2_1 = new Date().getTime();
|
||||
// check if we need to update the highlighted background
|
||||
if(this.reload_highlight || (infos["full_text"] != this.last_text_to_highlight && (this.last_selection["line_start"]!=infos["line_start"] || this.show_line_colors || this.settings['word_wrap'] || this.last_selection["line_nb"]!=infos["line_nb"] || this.last_selection["nb_line"]!=infos["nb_line"]) ) )
|
||||
{
|
||||
this.maj_highlight(infos);
|
||||
}
|
||||
}
|
||||
}
|
||||
t3= new Date().getTime();
|
||||
|
||||
// manage line heights
|
||||
if( this.settings['word_wrap'] && infos["full_text"] != this.last_selection["full_text"])
|
||||
{
|
||||
// refresh only 1 line if text change concern only one line and that the total line number has not changed
|
||||
if( changes.newText.split("\n").length == 1 && this.last_selection['nb_line'] && infos['nb_line'] == this.last_selection['nb_line'] )
|
||||
{
|
||||
this.fixLinesHeight( infos['full_text'], changes.lineStart, changes.lineStart );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fixLinesHeight( infos['full_text'], changes.lineStart, -1 );
|
||||
}
|
||||
}
|
||||
|
||||
tLines= new Date().getTime();
|
||||
// manage bracket finding
|
||||
if( infos["line_start"] != this.last_selection["line_start"] || infos["curr_pos"] != this.last_selection["curr_pos"] || infos["full_text"].length!=this.last_selection["full_text"].length || this.reload_highlight || !timer_checkup )
|
||||
{
|
||||
// move _cursor_pos
|
||||
var selec_char= infos["curr_line"].charAt(infos["curr_pos"]-1);
|
||||
var no_real_move=true;
|
||||
if(infos["line_nb"]==1 && (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]) ){
|
||||
|
||||
no_real_move=false;
|
||||
//findEndBracket(infos["line_start"], infos["curr_pos"], selec_char);
|
||||
if(this.findEndBracket(infos, selec_char) === true){
|
||||
_$("end_bracket").style.visibility ="visible";
|
||||
_$("cursor_pos").style.visibility ="visible";
|
||||
_$("cursor_pos").innerHTML = selec_char;
|
||||
_$("end_bracket").innerHTML = (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]);
|
||||
}else{
|
||||
_$("end_bracket").style.visibility ="hidden";
|
||||
_$("cursor_pos").style.visibility ="hidden";
|
||||
}
|
||||
}else{
|
||||
_$("cursor_pos").style.visibility ="hidden";
|
||||
_$("end_bracket").style.visibility ="hidden";
|
||||
}
|
||||
//alert("move cursor");
|
||||
this.displayToCursorPosition("cursor_pos", infos["line_start"], infos["curr_pos"]-1, infos["curr_line"], no_real_move);
|
||||
if(infos["line_nb"]==1 && infos["line_start"]!=this.last_selection["line_start"])
|
||||
this.scroll_to_view();
|
||||
}
|
||||
this.last_selection=infos;
|
||||
}
|
||||
|
||||
tend= new Date().getTime();
|
||||
//if( (tend-t1) > 7 )
|
||||
// console.log( "tps total: "+ (tend-t1) + " tps get_infos: "+ (t2-t1)+ " tps selec: "+ (t2_1-t2)+ " tps highlight: "+ (t3-t2_1) +" tps lines: "+ (tLines-t3) +" tps cursor+lines: "+ (tend-tLines)+" \n" );
|
||||
|
||||
|
||||
if(timer_checkup){
|
||||
setTimeout("editArea.check_line_selection(true)", this.check_line_selection_timer);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.get_selection_infos= function(){
|
||||
var sel={}, start, end, len, str;
|
||||
|
||||
this.getIESelection();
|
||||
start = this.textarea.selectionStart;
|
||||
end = this.textarea.selectionEnd;
|
||||
|
||||
if( this.last_selection["selectionStart"] == start && this.last_selection["selectionEnd"] == end && this.last_selection["full_text"] == this.textarea.value )
|
||||
{
|
||||
return this.last_selection;
|
||||
}
|
||||
|
||||
if(this.tabulation!="\t" && this.textarea.value.indexOf("\t")!=-1)
|
||||
{ // can append only after copy/paste
|
||||
len = this.textarea.value.length;
|
||||
this.textarea.value = this.replace_tab(this.textarea.value);
|
||||
start = end = start+(this.textarea.value.length-len);
|
||||
this.area_select( start, 0 );
|
||||
}
|
||||
|
||||
sel["selectionStart"] = start;
|
||||
sel["selectionEnd"] = end;
|
||||
sel["full_text"] = this.textarea.value;
|
||||
sel["line_start"] = 1;
|
||||
sel["line_nb"] = 1;
|
||||
sel["curr_pos"] = 0;
|
||||
sel["curr_line"] = "";
|
||||
sel["indexOfCursor"] = 0;
|
||||
sel["selec_direction"] = this.last_selection["selec_direction"];
|
||||
|
||||
//return sel;
|
||||
var splitTab= sel["full_text"].split("\n");
|
||||
var nbLine = Math.max(0, splitTab.length);
|
||||
var nbChar = Math.max(0, sel["full_text"].length - (nbLine - 1)); // (remove \n caracters from the count)
|
||||
if( sel["full_text"].indexOf("\r") != -1 )
|
||||
nbChar = nbChar - ( nbLine - 1 ); // (remove \r caracters from the count)
|
||||
sel["nb_line"] = nbLine;
|
||||
sel["nb_char"] = nbChar;
|
||||
|
||||
if(start>0){
|
||||
str = sel["full_text"].substr(0,start);
|
||||
sel["curr_pos"] = start - str.lastIndexOf("\n");
|
||||
sel["line_start"] = Math.max(1, str.split("\n").length);
|
||||
}else{
|
||||
sel["curr_pos"]=1;
|
||||
}
|
||||
if(end>start){
|
||||
sel["line_nb"]=sel["full_text"].substring(start,end).split("\n").length;
|
||||
}
|
||||
sel["indexOfCursor"]=start;
|
||||
sel["curr_line"]=splitTab[Math.max(0,sel["line_start"]-1)];
|
||||
|
||||
// determine in which direction the selection grow
|
||||
if(sel["selectionStart"] == this.last_selection["selectionStart"]){
|
||||
if(sel["selectionEnd"]>this.last_selection["selectionEnd"])
|
||||
sel["selec_direction"]= "down";
|
||||
else if(sel["selectionEnd"] == this.last_selection["selectionStart"])
|
||||
sel["selec_direction"]= this.last_selection["selec_direction"];
|
||||
}else if(sel["selectionStart"] == this.last_selection["selectionEnd"] && sel["selectionEnd"]>this.last_selection["selectionEnd"]){
|
||||
sel["selec_direction"]= "down";
|
||||
}else{
|
||||
sel["selec_direction"]= "up";
|
||||
}
|
||||
|
||||
_$("nbLine").innerHTML = nbLine;
|
||||
_$("nbChar").innerHTML = nbChar;
|
||||
_$("linePos").innerHTML = sel["line_start"];
|
||||
_$("currPos").innerHTML = sel["curr_pos"];
|
||||
|
||||
return sel;
|
||||
};
|
||||
|
||||
// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd)
|
||||
EditArea.prototype.getIESelection= function(){
|
||||
var selectionStart, selectionEnd, range, stored_range;
|
||||
|
||||
if( !this.isIE )
|
||||
return false;
|
||||
|
||||
// make it work as nowrap mode (easier for range manipulation with lineHeight)
|
||||
if( this.settings['word_wrap'] )
|
||||
this.textarea.wrap='off';
|
||||
|
||||
try{
|
||||
range = document.selection.createRange();
|
||||
stored_range = range.duplicate();
|
||||
stored_range.moveToElementText( this.textarea );
|
||||
stored_range.setEndPoint( 'EndToEnd', range );
|
||||
if( stored_range.parentElement() != this.textarea )
|
||||
throw "invalid focus";
|
||||
|
||||
// the range don't take care of empty lines in the end of the selection
|
||||
var scrollTop = this.result.scrollTop + document.body.scrollTop;
|
||||
var relative_top= range.offsetTop - parent.calculeOffsetTop(this.textarea) + scrollTop;
|
||||
var line_start = Math.round((relative_top / this.lineHeight) +1);
|
||||
var line_nb = Math.round( range.boundingHeight / this.lineHeight );
|
||||
|
||||
selectionStart = stored_range.text.length - range.text.length;
|
||||
selectionStart += ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length)*2; // count missing empty \r to the selection
|
||||
selectionStart -= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length ) * 2;
|
||||
|
||||
selectionEnd = selectionStart + range.text.length;
|
||||
selectionEnd += (line_start + line_nb - 1 - this.textarea.value.substr(0, selectionEnd ).split("\n").length)*2;
|
||||
|
||||
this.textarea.selectionStart = selectionStart;
|
||||
this.textarea.selectionEnd = selectionEnd;
|
||||
}
|
||||
catch(e){}
|
||||
|
||||
// restore wrap mode
|
||||
if( this.settings['word_wrap'] )
|
||||
this.textarea.wrap='soft';
|
||||
};
|
||||
|
||||
// select the text for IE (and take care of \r caracters)
|
||||
EditArea.prototype.setIESelection= function(){
|
||||
var a = this.textarea, nbLineStart, nbLineEnd, range;
|
||||
|
||||
if( !this.isIE )
|
||||
return false;
|
||||
|
||||
nbLineStart = a.value.substr(0, a.selectionStart).split("\n").length - 1;
|
||||
nbLineEnd = a.value.substr(0, a.selectionEnd).split("\n").length - 1;
|
||||
range = document.selection.createRange();
|
||||
range.moveToElementText( a );
|
||||
range.setEndPoint( 'EndToStart', range );
|
||||
|
||||
range.moveStart('character', a.selectionStart - nbLineStart);
|
||||
range.moveEnd('character', a.selectionEnd - nbLineEnd - (a.selectionStart - nbLineStart) );
|
||||
range.select();
|
||||
};
|
||||
|
||||
|
||||
|
||||
EditArea.prototype.checkTextEvolution=function(lastText,newText){
|
||||
// ch will contain changes datas
|
||||
var ch={},baseStep=200, cpt=0, end, step,tStart=new Date().getTime();
|
||||
|
||||
end = Math.min(newText.length, lastText.length);
|
||||
step = baseStep;
|
||||
// find how many chars are similar at the begin of the text
|
||||
while( cpt<end && step>=1 ){
|
||||
if(lastText.substr(cpt, step) == newText.substr(cpt, step)){
|
||||
cpt+= step;
|
||||
}else{
|
||||
step= Math.floor(step/2);
|
||||
}
|
||||
}
|
||||
|
||||
ch.posStart = cpt;
|
||||
ch.lineStart= newText.substr(0, ch.posStart).split("\n").length -1;
|
||||
|
||||
cpt_last = lastText.length;
|
||||
cpt = newText.length;
|
||||
step = baseStep;
|
||||
// find how many chars are similar at the end of the text
|
||||
while( cpt>=0 && cpt_last>=0 && step>=1 ){
|
||||
if(lastText.substr(cpt_last-step, step) == newText.substr(cpt-step, step)){
|
||||
cpt-= step;
|
||||
cpt_last-= step;
|
||||
}else{
|
||||
step= Math.floor(step/2);
|
||||
}
|
||||
}
|
||||
|
||||
ch.posNewEnd = cpt;
|
||||
ch.posLastEnd = cpt_last;
|
||||
if(ch.posNewEnd<=ch.posStart){
|
||||
if(lastText.length < newText.length){
|
||||
ch.posNewEnd= ch.posStart + newText.length - lastText.length;
|
||||
ch.posLastEnd= ch.posStart;
|
||||
}else{
|
||||
ch.posLastEnd= ch.posStart + lastText.length - newText.length;
|
||||
ch.posNewEnd= ch.posStart;
|
||||
}
|
||||
}
|
||||
ch.newText = newText.substring(ch.posStart, ch.posNewEnd);
|
||||
ch.lastText = lastText.substring(ch.posStart, ch.posLastEnd);
|
||||
|
||||
ch.lineNewEnd = newText.substr(0, ch.posNewEnd).split("\n").length -1;
|
||||
ch.lineLastEnd = lastText.substr(0, ch.posLastEnd).split("\n").length -1;
|
||||
|
||||
ch.newTextLine = newText.split("\n").slice(ch.lineStart, ch.lineNewEnd+1).join("\n");
|
||||
ch.lastTextLine = lastText.split("\n").slice(ch.lineStart, ch.lineLastEnd+1).join("\n");
|
||||
//console.log( ch );
|
||||
return ch;
|
||||
};
|
||||
|
||||
EditArea.prototype.tab_selection= function(){
|
||||
if(this.is_tabbing)
|
||||
return;
|
||||
this.is_tabbing=true;
|
||||
//infos=getSelectionInfos();
|
||||
//if( document.selection ){
|
||||
this.getIESelection();
|
||||
/* Insertion du code de formatage */
|
||||
var start = this.textarea.selectionStart;
|
||||
var end = this.textarea.selectionEnd;
|
||||
var insText = this.textarea.value.substring(start, end);
|
||||
|
||||
/* Insert tabulation and ajust cursor position */
|
||||
var pos_start=start;
|
||||
var pos_end=end;
|
||||
if (insText.length == 0) {
|
||||
// if only one line selected
|
||||
this.textarea.value = this.textarea.value.substr(0, start) + this.tabulation + this.textarea.value.substr(end);
|
||||
pos_start = start + this.tabulation.length;
|
||||
pos_end=pos_start;
|
||||
} else {
|
||||
start= Math.max(0, this.textarea.value.substr(0, start).lastIndexOf("\n")+1);
|
||||
endText=this.textarea.value.substr(end);
|
||||
startText=this.textarea.value.substr(0, start);
|
||||
tmp= this.textarea.value.substring(start, end).split("\n");
|
||||
insText= this.tabulation+tmp.join("\n"+this.tabulation);
|
||||
this.textarea.value = startText + insText + endText;
|
||||
pos_start = start;
|
||||
pos_end= this.textarea.value.indexOf("\n", startText.length + insText.length);
|
||||
if(pos_end==-1)
|
||||
pos_end=this.textarea.value.length;
|
||||
//pos = start + repdeb.length + insText.length + ;
|
||||
}
|
||||
this.textarea.selectionStart = pos_start;
|
||||
this.textarea.selectionEnd = pos_end;
|
||||
|
||||
//if( document.selection ){
|
||||
if(this.isIE)
|
||||
{
|
||||
this.setIESelection();
|
||||
setTimeout("editArea.is_tabbing=false;", 100); // IE can't accept to make 2 tabulation without a little break between both
|
||||
}
|
||||
else
|
||||
{
|
||||
this.is_tabbing=false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EditArea.prototype.invert_tab_selection= function(){
|
||||
var t=this, a=this.textarea;
|
||||
if(t.is_tabbing)
|
||||
return;
|
||||
t.is_tabbing=true;
|
||||
//infos=getSelectionInfos();
|
||||
//if( document.selection ){
|
||||
t.getIESelection();
|
||||
|
||||
var start = a.selectionStart;
|
||||
var end = a.selectionEnd;
|
||||
var insText = a.value.substring(start, end);
|
||||
|
||||
/* Tab remove and cursor seleciton adjust */
|
||||
var pos_start=start;
|
||||
var pos_end=end;
|
||||
if (insText.length == 0) {
|
||||
if(a.value.substring(start-t.tabulation.length, start)==t.tabulation)
|
||||
{
|
||||
a.value = a.value.substr(0, start-t.tabulation.length) + a.value.substr(end);
|
||||
pos_start = Math.max(0, start-t.tabulation.length);
|
||||
pos_end = pos_start;
|
||||
}
|
||||
/*
|
||||
a.value = a.value.substr(0, start) + t.tabulation + insText + a.value.substr(end);
|
||||
pos_start = start + t.tabulation.length;
|
||||
pos_end=pos_start;*/
|
||||
} else {
|
||||
start = a.value.substr(0, start).lastIndexOf("\n")+1;
|
||||
endText = a.value.substr(end);
|
||||
startText = a.value.substr(0, start);
|
||||
tmp = a.value.substring(start, end).split("\n");
|
||||
insText = "";
|
||||
for(i=0; i<tmp.length; i++){
|
||||
for(j=0; j<t.tab_nb_char; j++){
|
||||
if(tmp[i].charAt(0)=="\t"){
|
||||
tmp[i]=tmp[i].substr(1);
|
||||
j=t.tab_nb_char;
|
||||
}else if(tmp[i].charAt(0)==" ")
|
||||
tmp[i]=tmp[i].substr(1);
|
||||
}
|
||||
insText+=tmp[i];
|
||||
if(i<tmp.length-1)
|
||||
insText+="\n";
|
||||
}
|
||||
//insText+="_";
|
||||
a.value = startText + insText + endText;
|
||||
pos_start = start;
|
||||
pos_end = a.value.indexOf("\n", startText.length + insText.length);
|
||||
if(pos_end==-1)
|
||||
pos_end=a.value.length;
|
||||
//pos = start + repdeb.length + insText.length + ;
|
||||
}
|
||||
a.selectionStart = pos_start;
|
||||
a.selectionEnd = pos_end;
|
||||
|
||||
//if( document.selection ){
|
||||
if(t.isIE){
|
||||
// select the text for IE
|
||||
t.setIESelection();
|
||||
setTimeout("editArea.is_tabbing=false;", 100); // IE can accept to make 2 tabulation without a little break between both
|
||||
}else
|
||||
t.is_tabbing=false;
|
||||
};
|
||||
|
||||
EditArea.prototype.press_enter= function(){
|
||||
if(!this.smooth_selection)
|
||||
return false;
|
||||
this.getIESelection();
|
||||
var scrollTop= this.result.scrollTop;
|
||||
var scrollLeft= this.result.scrollLeft;
|
||||
var start=this.textarea.selectionStart;
|
||||
var end= this.textarea.selectionEnd;
|
||||
var start_last_line= Math.max(0 , this.textarea.value.substring(0, start).lastIndexOf("\n") + 1 );
|
||||
var begin_line= this.textarea.value.substring(start_last_line, start).replace(/^([ \t]*).*/gm, "$1");
|
||||
var lineStart = this.textarea.value.substring(0, start).split("\n").length;
|
||||
if(begin_line=="\n" || begin_line=="\r" || begin_line.length==0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ){
|
||||
begin_line="\r\n"+ begin_line;
|
||||
}else{
|
||||
begin_line="\n"+ begin_line;
|
||||
}
|
||||
//alert(start_last_line+" strat: "+start +"\n"+this.textarea.value.substring(start_last_line, start)+"\n_"+begin_line+"_")
|
||||
this.textarea.value= this.textarea.value.substring(0, start) + begin_line + this.textarea.value.substring(end);
|
||||
|
||||
this.area_select(start+ begin_line.length ,0);
|
||||
// during this process IE scroll back to the top of the textarea
|
||||
if(this.isIE){
|
||||
this.result.scrollTop = scrollTop;
|
||||
this.result.scrollLeft = scrollLeft;
|
||||
}
|
||||
return true;
|
||||
|
||||
};
|
||||
|
||||
EditArea.prototype.findEndBracket= function(infos, bracket){
|
||||
|
||||
var start=infos["indexOfCursor"];
|
||||
var normal_order=true;
|
||||
//curr_text=infos["full_text"].split("\n");
|
||||
if(this.assocBracket[bracket])
|
||||
endBracket=this.assocBracket[bracket];
|
||||
else if(this.revertAssocBracket[bracket]){
|
||||
endBracket=this.revertAssocBracket[bracket];
|
||||
normal_order=false;
|
||||
}
|
||||
var end=-1;
|
||||
var nbBracketOpen=0;
|
||||
|
||||
for(var i=start; i<infos["full_text"].length && i>=0; ){
|
||||
if(infos["full_text"].charAt(i)==endBracket){
|
||||
nbBracketOpen--;
|
||||
if(nbBracketOpen<=0){
|
||||
//i=infos["full_text"].length;
|
||||
end=i;
|
||||
break;
|
||||
}
|
||||
}else if(infos["full_text"].charAt(i)==bracket)
|
||||
nbBracketOpen++;
|
||||
if(normal_order)
|
||||
i++;
|
||||
else
|
||||
i--;
|
||||
}
|
||||
|
||||
//end=infos["full_text"].indexOf("}", start);
|
||||
if(end==-1)
|
||||
return false;
|
||||
var endLastLine=infos["full_text"].substr(0, end).lastIndexOf("\n");
|
||||
if(endLastLine==-1)
|
||||
line=1;
|
||||
else
|
||||
line= infos["full_text"].substr(0, endLastLine).split("\n").length + 1;
|
||||
|
||||
var curPos= end - endLastLine - 1;
|
||||
var endLineLength = infos["full_text"].substring(end).split("\n")[0].length;
|
||||
this.displayToCursorPosition("end_bracket", line, curPos, infos["full_text"].substring(endLastLine +1, end + endLineLength));
|
||||
return true;
|
||||
};
|
||||
|
||||
EditArea.prototype.displayToCursorPosition= function(id, start_line, cur_pos, lineContent, no_real_move){
|
||||
var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;
|
||||
|
||||
elem = this.test_font_size;
|
||||
dest = _$(id);
|
||||
content = "<span id='test_font_size_inner'>"+lineContent.substr(0, cur_pos).replace(/&/g,"&").replace(/</g,"<")+"</span><span id='endTestFont'>"+lineContent.substr(cur_pos).replace(/&/g,"&").replace(/</g,"<")+"</span>";
|
||||
if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
|
||||
elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
|
||||
} else {
|
||||
elem.innerHTML= content;
|
||||
}
|
||||
|
||||
|
||||
endElem = _$('endTestFont');
|
||||
topOffset = endElem.offsetTop;
|
||||
fixPadding = parseInt( this.content_highlight.style.paddingLeft.replace("px", "") );
|
||||
posLeft = 45 + endElem.offsetLeft + ( !isNaN( fixPadding ) && topOffset > 0 ? fixPadding : 0 );
|
||||
posTop = this.getLinePosTop( start_line ) + topOffset;// + Math.floor( ( endElem.offsetHeight - 1 ) / this.lineHeight ) * this.lineHeight;
|
||||
|
||||
// detect the case where the span start on a line but has no display on it
|
||||
if( this.isIE && cur_pos > 0 && endElem.offsetLeft == 0 )
|
||||
{
|
||||
posTop += this.lineHeight;
|
||||
}
|
||||
if(no_real_move!=true){ // when the cursor is hidden no need to move him
|
||||
dest.style.top=posTop+"px";
|
||||
dest.style.left=posLeft+"px";
|
||||
}
|
||||
// usefull for smarter scroll
|
||||
dest.cursor_top=posTop;
|
||||
dest.cursor_left=posLeft;
|
||||
// _$(id).style.marginLeft=posLeft+"px";
|
||||
};
|
||||
|
||||
EditArea.prototype.getLinePosTop= function(start_line){
|
||||
var elem= _$('line_'+ start_line), posTop=0;
|
||||
if( elem )
|
||||
posTop = elem.offsetTop;
|
||||
else
|
||||
posTop = this.lineHeight * (start_line-1);
|
||||
return posTop;
|
||||
};
|
||||
|
||||
|
||||
// return the dislpayed height of a text (take word-wrap into account)
|
||||
EditArea.prototype.getTextHeight= function(text){
|
||||
var t=this,elem,height;
|
||||
elem = t.test_font_size;
|
||||
content = text.replace(/&/g,"&").replace(/</g,"<");
|
||||
if( t.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
|
||||
elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
|
||||
} else {
|
||||
elem.innerHTML= content;
|
||||
}
|
||||
height = elem.offsetHeight;
|
||||
height = Math.max( 1, Math.floor( elem.offsetHeight / this.lineHeight ) ) * this.lineHeight;
|
||||
return height;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fix line height for the given lines
|
||||
* @param Integer linestart
|
||||
* @param Integer lineEnd End line or -1 to cover all lines
|
||||
*/
|
||||
EditArea.prototype.fixLinesHeight= function( textValue, lineStart,lineEnd ){
|
||||
var aText = textValue.split("\n");
|
||||
if( lineEnd == -1 )
|
||||
lineEnd = aText.length-1;
|
||||
for( var i = Math.max(0, lineStart); i <= lineEnd; i++ )
|
||||
{
|
||||
if( elem = _$('line_'+ ( i+1 ) ) )
|
||||
{
|
||||
elem.style.height= typeof( aText[i] ) != "undefined" ? this.getTextHeight( aText[i] )+"px" : this.lineHeight;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EditArea.prototype.area_select= function(start, length){
|
||||
this.textarea.focus();
|
||||
|
||||
start = Math.max(0, Math.min(this.textarea.value.length, start));
|
||||
end = Math.max(start, Math.min(this.textarea.value.length, start+length));
|
||||
|
||||
if(this.isIE)
|
||||
{
|
||||
this.textarea.selectionStart = start;
|
||||
this.textarea.selectionEnd = end;
|
||||
this.setIESelection();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Opera bug when moving selection start and selection end
|
||||
if(this.isOpera && this.isOpera < 9.6 )
|
||||
{
|
||||
this.textarea.setSelectionRange(0, 0);
|
||||
}
|
||||
this.textarea.setSelectionRange(start, end);
|
||||
}
|
||||
this.check_line_selection();
|
||||
};
|
||||
|
||||
|
||||
EditArea.prototype.area_get_selection= function(){
|
||||
var text="";
|
||||
if( document.selection ){
|
||||
var range = document.selection.createRange();
|
||||
text=range.text;
|
||||
}else{
|
||||
text= this.textarea.value.substring(this.textarea.selectionStart, this.textarea.selectionEnd);
|
||||
}
|
||||
return text;
|
||||
};
|
90
addons/Core/edit_area/plugins/charmap/charmap.js
Normal file
@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Charmap plugin
|
||||
* by Christophe Dolivet
|
||||
* v0.1 (2006/09/22)
|
||||
*
|
||||
*
|
||||
* This plugin allow to use a visual keyboard allowing to insert any UTF-8 characters in the text.
|
||||
*
|
||||
* - plugin name to add to the plugin list: "charmap"
|
||||
* - plugin name to add to the toolbar list: "charmap"
|
||||
* - possible parameters to add to EditAreaLoader.init():
|
||||
* "charmap_default": (String) define the name of the default character range displayed on popup display
|
||||
* (default: "arrows")
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
var EditArea_charmap= {
|
||||
/**
|
||||
* Get called once this file is loaded (editArea still not initialized)
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
init: function(){
|
||||
this.default_language="Arrows";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
|
||||
* A control can be a button, select list or any other HTML item to present in the EditArea user interface.
|
||||
* Language variables such as {$lang_somekey} will also be replaced with contents from
|
||||
* the language packs.
|
||||
*
|
||||
* @param {string} ctrl_name: the name of the control to add
|
||||
* @return HTML code for a specific control or false.
|
||||
* @type string or boolean
|
||||
*/
|
||||
,get_control_html: function(ctrl_name){
|
||||
switch(ctrl_name){
|
||||
case "charmap":
|
||||
// Control id, button img, command
|
||||
return parent.editAreaLoader.get_button_html('charmap_but', 'charmap.gif', 'charmap_press', false, this.baseURL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Get called once EditArea is fully loaded and initialised
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
,onload: function(){
|
||||
if(editArea.settings["charmap_default"] && editArea.settings["charmap_default"].length>0)
|
||||
this.default_language= editArea.settings["charmap_default"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Is called each time the user touch a keyboard key.
|
||||
*
|
||||
* @param (event) e: the keydown event
|
||||
* @return true - pass to next handler in chain, false - stop chain execution
|
||||
* @type boolean
|
||||
*/
|
||||
,onkeydown: function(e){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a specific command, this function handles plugin commands.
|
||||
*
|
||||
* @param {string} cmd: the name of the command being executed
|
||||
* @param {unknown} param: the parameter of the command
|
||||
* @return true - pass to next handler in chain, false - stop chain execution
|
||||
* @type boolean
|
||||
*/
|
||||
,execCommand: function(cmd, param){
|
||||
// Handle commands
|
||||
switch(cmd){
|
||||
case "charmap_press":
|
||||
win= window.open(this.baseURL+"popup.html", "charmap", "width=500,height=270,scrollbars=yes,resizable=yes");
|
||||
win.focus();
|
||||
return false;
|
||||
}
|
||||
// Pass to next handler in chain
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Adds the plugin class to the list of available EditArea plugins
|
||||
editArea.add_plugin("charmap", EditArea_charmap);
|
64
addons/Core/edit_area/plugins/charmap/css/charmap.css
Normal file
@ -0,0 +1,64 @@
|
||||
body{
|
||||
background-color: #F0F0EE;
|
||||
font: 12px monospace, sans-serif;
|
||||
}
|
||||
|
||||
select{
|
||||
background-color: #F9F9F9;
|
||||
border: solid 1px #888888;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #2B6FB6;
|
||||
}
|
||||
|
||||
h1{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
div#char_list{
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
border: 1px solid #0A246A;
|
||||
background-color: #F9F9F9;
|
||||
clear: both;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
a.char{
|
||||
display: block;
|
||||
float: left;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin: 1px;
|
||||
border: solid 1px #888888;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.char:hover{
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
|
||||
.preview{
|
||||
border: solid 1px #888888;
|
||||
width: 50px;
|
||||
padding: 2px 5px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
text-align:center;
|
||||
background-color: #CCCCCC;
|
||||
font-size: 2em;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin: 0 0 5px 5px;
|
||||
}
|
||||
|
||||
#preview_code{
|
||||
font-size: 1.1em;
|
||||
width: 70px;
|
||||
}
|
BIN
addons/Core/edit_area/plugins/charmap/images/charmap.gif
Normal file
After Width: | Height: | Size: 245 B |
373
addons/Core/edit_area/plugins/charmap/jscripts/map.js
Normal file
@ -0,0 +1,373 @@
|
||||
var editArea;
|
||||
|
||||
|
||||
/**
|
||||
* UTF-8 list taken from http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
var char_range_list={
|
||||
"Basic Latin":"0021,007F",
|
||||
"Latin-1 Supplement":"0080,00FF",
|
||||
"Latin Extended-A":"0100,017F",
|
||||
"Latin Extended-B":"0180,024F",
|
||||
"IPA Extensions":"0250,02AF",
|
||||
"Spacing Modifier Letters":"02B0,02FF",
|
||||
|
||||
"Combining Diacritical Marks":"0300,036F",
|
||||
"Greek and Coptic":"0370,03FF",
|
||||
"Cyrillic":"0400,04FF",
|
||||
"Cyrillic Supplement":"0500,052F",
|
||||
"Armenian":"0530,058F",
|
||||
"Hebrew":"0590,05FF",
|
||||
"Arabic":"0600,06FF",
|
||||
"Syriac":"0700,074F",
|
||||
"Arabic Supplement":"0750,077F",
|
||||
|
||||
"Thaana":"0780,07BF",
|
||||
"Devanagari":"0900,097F",
|
||||
"Bengali":"0980,09FF",
|
||||
"Gurmukhi":"0A00,0A7F",
|
||||
"Gujarati":"0A80,0AFF",
|
||||
"Oriya":"0B00,0B7F",
|
||||
"Tamil":"0B80,0BFF",
|
||||
"Telugu":"0C00,0C7F",
|
||||
"Kannada":"0C80,0CFF",
|
||||
|
||||
"Malayalam":"0D00,0D7F",
|
||||
"Sinhala":"0D80,0DFF",
|
||||
"Thai":"0E00,0E7F",
|
||||
"Lao":"0E80,0EFF",
|
||||
"Tibetan":"0F00,0FFF",
|
||||
"Myanmar":"1000,109F",
|
||||
"Georgian":"10A0,10FF",
|
||||
"Hangul Jamo":"1100,11FF",
|
||||
"Ethiopic":"1200,137F",
|
||||
|
||||
"Ethiopic Supplement":"1380,139F",
|
||||
"Cherokee":"13A0,13FF",
|
||||
"Unified Canadian Aboriginal Syllabics":"1400,167F",
|
||||
"Ogham":"1680,169F",
|
||||
"Runic":"16A0,16FF",
|
||||
"Tagalog":"1700,171F",
|
||||
"Hanunoo":"1720,173F",
|
||||
"Buhid":"1740,175F",
|
||||
"Tagbanwa":"1760,177F",
|
||||
|
||||
"Khmer":"1780,17FF",
|
||||
"Mongolian":"1800,18AF",
|
||||
"Limbu":"1900,194F",
|
||||
"Tai Le":"1950,197F",
|
||||
"New Tai Lue":"1980,19DF",
|
||||
"Khmer Symbols":"19E0,19FF",
|
||||
"Buginese":"1A00,1A1F",
|
||||
"Phonetic Extensions":"1D00,1D7F",
|
||||
"Phonetic Extensions Supplement":"1D80,1DBF",
|
||||
|
||||
"Combining Diacritical Marks Supplement":"1DC0,1DFF",
|
||||
"Latin Extended Additional":"1E00,1EFF",
|
||||
"Greek Extended":"1F00,1FFF",
|
||||
"General Punctuation":"2000,206F",
|
||||
"Superscripts and Subscripts":"2070,209F",
|
||||
"Currency Symbols":"20A0,20CF",
|
||||
"Combining Diacritical Marks for Symbols":"20D0,20FF",
|
||||
"Letterlike Symbols":"2100,214F",
|
||||
"Number Forms":"2150,218F",
|
||||
|
||||
"Arrows":"2190,21FF",
|
||||
"Mathematical Operators":"2200,22FF",
|
||||
"Miscellaneous Technical":"2300,23FF",
|
||||
"Control Pictures":"2400,243F",
|
||||
"Optical Character Recognition":"2440,245F",
|
||||
"Enclosed Alphanumerics":"2460,24FF",
|
||||
"Box Drawing":"2500,257F",
|
||||
"Block Elements":"2580,259F",
|
||||
"Geometric Shapes":"25A0,25FF",
|
||||
|
||||
"Miscellaneous Symbols":"2600,26FF",
|
||||
"Dingbats":"2700,27BF",
|
||||
"Miscellaneous Mathematical Symbols-A":"27C0,27EF",
|
||||
"Supplemental Arrows-A":"27F0,27FF",
|
||||
"Braille Patterns":"2800,28FF",
|
||||
"Supplemental Arrows-B":"2900,297F",
|
||||
"Miscellaneous Mathematical Symbols-B":"2980,29FF",
|
||||
"Supplemental Mathematical Operators":"2A00,2AFF",
|
||||
"Miscellaneous Symbols and Arrows":"2B00,2BFF",
|
||||
|
||||
"Glagolitic":"2C00,2C5F",
|
||||
"Coptic":"2C80,2CFF",
|
||||
"Georgian Supplement":"2D00,2D2F",
|
||||
"Tifinagh":"2D30,2D7F",
|
||||
"Ethiopic Extended":"2D80,2DDF",
|
||||
"Supplemental Punctuation":"2E00,2E7F",
|
||||
"CJK Radicals Supplement":"2E80,2EFF",
|
||||
"Kangxi Radicals":"2F00,2FDF",
|
||||
"Ideographic Description Characters":"2FF0,2FFF",
|
||||
|
||||
"CJK Symbols and Punctuation":"3000,303F",
|
||||
"Hiragana":"3040,309F",
|
||||
"Katakana":"30A0,30FF",
|
||||
"Bopomofo":"3100,312F",
|
||||
"Hangul Compatibility Jamo":"3130,318F",
|
||||
"Kanbun":"3190,319F",
|
||||
"Bopomofo Extended":"31A0,31BF",
|
||||
"CJK Strokes":"31C0,31EF",
|
||||
"Katakana Phonetic Extensions":"31F0,31FF",
|
||||
|
||||
"Enclosed CJK Letters and Months":"3200,32FF",
|
||||
"CJK Compatibility":"3300,33FF",
|
||||
"CJK Unified Ideographs Extension A":"3400,4DBF",
|
||||
"Yijing Hexagram Symbols":"4DC0,4DFF",
|
||||
"CJK Unified Ideographs":"4E00,9FFF",
|
||||
"Yi Syllables":"A000,A48F",
|
||||
"Yi Radicals":"A490,A4CF",
|
||||
"Modifier Tone Letters":"A700,A71F",
|
||||
"Syloti Nagri":"A800,A82F",
|
||||
|
||||
"Hangul Syllables":"AC00,D7AF",
|
||||
"High Surrogates":"D800,DB7F",
|
||||
"High Private Use Surrogates":"DB80,DBFF",
|
||||
"Low Surrogates":"DC00,DFFF",
|
||||
"Private Use Area":"E000,F8FF",
|
||||
"CJK Compatibility Ideographs":"F900,FAFF",
|
||||
"Alphabetic Presentation Forms":"FB00,FB4F",
|
||||
"Arabic Presentation Forms-A":"FB50,FDFF",
|
||||
"Variation Selectors":"FE00,FE0F",
|
||||
|
||||
"Vertical Forms":"FE10,FE1F",
|
||||
"Combining Half Marks":"FE20,FE2F",
|
||||
"CJK Compatibility Forms":"FE30,FE4F",
|
||||
"Small Form Variants":"FE50,FE6F",
|
||||
"Arabic Presentation Forms-B":"FE70,FEFF",
|
||||
"Halfwidth and Fullwidth Forms":"FF00,FFEF",
|
||||
"Specials":"FFF0,FFFF",
|
||||
"Linear B Syllabary":"10000,1007F",
|
||||
"Linear B Ideograms":"10080,100FF",
|
||||
|
||||
"Aegean Numbers":"10100,1013F",
|
||||
"Ancient Greek Numbers":"10140,1018F",
|
||||
"Old Italic":"10300,1032F",
|
||||
"Gothic":"10330,1034F",
|
||||
"Ugaritic":"10380,1039F",
|
||||
"Old Persian":"103A0,103DF",
|
||||
"Deseret":"10400,1044F",
|
||||
"Shavian":"10450,1047F",
|
||||
"Osmanya":"10480,104AF",
|
||||
|
||||
"Cypriot Syllabary":"10800,1083F",
|
||||
"Kharoshthi":"10A00,10A5F",
|
||||
"Byzantine Musical Symbols":"1D000,1D0FF",
|
||||
"Musical Symbols":"1D100,1D1FF",
|
||||
"Ancient Greek Musical Notation":"1D200,1D24F",
|
||||
"Tai Xuan Jing Symbols":"1D300,1D35F",
|
||||
"Mathematical Alphanumeric Symbols":"1D400,1D7FF",
|
||||
"CJK Unified Ideographs Extension B":"20000,2A6DF",
|
||||
"CJK Compatibility Ideographs Supplement":"2F800,2FA1F",
|
||||
"Tags":"E0000,E007F",
|
||||
"Variation Selectors Supplement":"E0100,E01EF"
|
||||
};
|
||||
*/
|
||||
var char_range_list={
|
||||
"Aegean Numbers":"10100,1013F",
|
||||
"Alphabetic Presentation Forms":"FB00,FB4F",
|
||||
"Ancient Greek Musical Notation":"1D200,1D24F",
|
||||
"Ancient Greek Numbers":"10140,1018F",
|
||||
"Arabic":"0600,06FF",
|
||||
"Arabic Presentation Forms-A":"FB50,FDFF",
|
||||
"Arabic Presentation Forms-B":"FE70,FEFF",
|
||||
"Arabic Supplement":"0750,077F",
|
||||
"Armenian":"0530,058F",
|
||||
"Arrows":"2190,21FF",
|
||||
"Basic Latin":"0020,007F",
|
||||
"Bengali":"0980,09FF",
|
||||
"Block Elements":"2580,259F",
|
||||
"Bopomofo Extended":"31A0,31BF",
|
||||
"Bopomofo":"3100,312F",
|
||||
"Box Drawing":"2500,257F",
|
||||
"Braille Patterns":"2800,28FF",
|
||||
"Buginese":"1A00,1A1F",
|
||||
"Buhid":"1740,175F",
|
||||
"Byzantine Musical Symbols":"1D000,1D0FF",
|
||||
"CJK Compatibility Forms":"FE30,FE4F",
|
||||
"CJK Compatibility Ideographs Supplement":"2F800,2FA1F",
|
||||
"CJK Compatibility Ideographs":"F900,FAFF",
|
||||
"CJK Compatibility":"3300,33FF",
|
||||
"CJK Radicals Supplement":"2E80,2EFF",
|
||||
"CJK Strokes":"31C0,31EF",
|
||||
"CJK Symbols and Punctuation":"3000,303F",
|
||||
"CJK Unified Ideographs Extension A":"3400,4DBF",
|
||||
"CJK Unified Ideographs Extension B":"20000,2A6DF",
|
||||
"CJK Unified Ideographs":"4E00,9FFF",
|
||||
"Cherokee":"13A0,13FF",
|
||||
"Combining Diacritical Marks Supplement":"1DC0,1DFF",
|
||||
"Combining Diacritical Marks for Symbols":"20D0,20FF",
|
||||
"Combining Diacritical Marks":"0300,036F",
|
||||
"Combining Half Marks":"FE20,FE2F",
|
||||
"Control Pictures":"2400,243F",
|
||||
"Coptic":"2C80,2CFF",
|
||||
"Currency Symbols":"20A0,20CF",
|
||||
"Cypriot Syllabary":"10800,1083F",
|
||||
"Cyrillic Supplement":"0500,052F",
|
||||
"Cyrillic":"0400,04FF",
|
||||
"Deseret":"10400,1044F",
|
||||
"Devanagari":"0900,097F",
|
||||
"Dingbats":"2700,27BF",
|
||||
"Enclosed Alphanumerics":"2460,24FF",
|
||||
"Enclosed CJK Letters and Months":"3200,32FF",
|
||||
"Ethiopic Extended":"2D80,2DDF",
|
||||
"Ethiopic Supplement":"1380,139F",
|
||||
"Ethiopic":"1200,137F",
|
||||
"General Punctuation":"2000,206F",
|
||||
"Geometric Shapes":"25A0,25FF",
|
||||
"Georgian Supplement":"2D00,2D2F",
|
||||
"Georgian":"10A0,10FF",
|
||||
"Glagolitic":"2C00,2C5F",
|
||||
"Gothic":"10330,1034F",
|
||||
"Greek Extended":"1F00,1FFF",
|
||||
"Greek and Coptic":"0370,03FF",
|
||||
"Gujarati":"0A80,0AFF",
|
||||
"Gurmukhi":"0A00,0A7F",
|
||||
"Halfwidth and Fullwidth Forms":"FF00,FFEF",
|
||||
"Hangul Compatibility Jamo":"3130,318F",
|
||||
"Hangul Jamo":"1100,11FF",
|
||||
"Hangul Syllables":"AC00,D7AF",
|
||||
"Hanunoo":"1720,173F",
|
||||
"Hebrew":"0590,05FF",
|
||||
"High Private Use Surrogates":"DB80,DBFF",
|
||||
"High Surrogates":"D800,DB7F",
|
||||
"Hiragana":"3040,309F",
|
||||
"IPA Extensions":"0250,02AF",
|
||||
"Ideographic Description Characters":"2FF0,2FFF",
|
||||
"Kanbun":"3190,319F",
|
||||
"Kangxi Radicals":"2F00,2FDF",
|
||||
"Kannada":"0C80,0CFF",
|
||||
"Katakana Phonetic Extensions":"31F0,31FF",
|
||||
"Katakana":"30A0,30FF",
|
||||
"Kharoshthi":"10A00,10A5F",
|
||||
"Khmer Symbols":"19E0,19FF",
|
||||
"Khmer":"1780,17FF",
|
||||
"Lao":"0E80,0EFF",
|
||||
"Latin Extended Additional":"1E00,1EFF",
|
||||
"Latin Extended-A":"0100,017F",
|
||||
"Latin Extended-B":"0180,024F",
|
||||
"Latin-1 Supplement":"0080,00FF",
|
||||
"Letterlike Symbols":"2100,214F",
|
||||
"Limbu":"1900,194F",
|
||||
"Linear B Ideograms":"10080,100FF",
|
||||
"Linear B Syllabary":"10000,1007F",
|
||||
"Low Surrogates":"DC00,DFFF",
|
||||
"Malayalam":"0D00,0D7F",
|
||||
"Mathematical Alphanumeric Symbols":"1D400,1D7FF",
|
||||
"Mathematical Operators":"2200,22FF",
|
||||
"Miscellaneous Mathematical Symbols-A":"27C0,27EF",
|
||||
"Miscellaneous Mathematical Symbols-B":"2980,29FF",
|
||||
"Miscellaneous Symbols and Arrows":"2B00,2BFF",
|
||||
"Miscellaneous Symbols":"2600,26FF",
|
||||
"Miscellaneous Technical":"2300,23FF",
|
||||
"Modifier Tone Letters":"A700,A71F",
|
||||
"Mongolian":"1800,18AF",
|
||||
"Musical Symbols":"1D100,1D1FF",
|
||||
"Myanmar":"1000,109F",
|
||||
"New Tai Lue":"1980,19DF",
|
||||
"Number Forms":"2150,218F",
|
||||
"Ogham":"1680,169F",
|
||||
"Old Italic":"10300,1032F",
|
||||
"Old Persian":"103A0,103DF",
|
||||
"Optical Character Recognition":"2440,245F",
|
||||
"Oriya":"0B00,0B7F",
|
||||
"Osmanya":"10480,104AF",
|
||||
"Phonetic Extensions Supplement":"1D80,1DBF",
|
||||
"Phonetic Extensions":"1D00,1D7F",
|
||||
"Private Use Area":"E000,F8FF",
|
||||
"Runic":"16A0,16FF",
|
||||
"Shavian":"10450,1047F",
|
||||
"Sinhala":"0D80,0DFF",
|
||||
"Small Form Variants":"FE50,FE6F",
|
||||
"Spacing Modifier Letters":"02B0,02FF",
|
||||
"Specials":"FFF0,FFFF",
|
||||
"Superscripts and Subscripts":"2070,209F",
|
||||
"Supplemental Arrows-A":"27F0,27FF",
|
||||
"Supplemental Arrows-B":"2900,297F",
|
||||
"Supplemental Mathematical Operators":"2A00,2AFF",
|
||||
"Supplemental Punctuation":"2E00,2E7F",
|
||||
"Syloti Nagri":"A800,A82F",
|
||||
"Syriac":"0700,074F",
|
||||
"Tagalog":"1700,171F",
|
||||
"Tagbanwa":"1760,177F",
|
||||
"Tags":"E0000,E007F",
|
||||
"Tai Le":"1950,197F",
|
||||
"Tai Xuan Jing Symbols":"1D300,1D35F",
|
||||
"Tamil":"0B80,0BFF",
|
||||
"Telugu":"0C00,0C7F",
|
||||
"Thaana":"0780,07BF",
|
||||
"Thai":"0E00,0E7F",
|
||||
"Tibetan":"0F00,0FFF",
|
||||
"Tifinagh":"2D30,2D7F",
|
||||
"Ugaritic":"10380,1039F",
|
||||
"Unified Canadian Aboriginal Syllabics":"1400,167F",
|
||||
"Variation Selectors Supplement":"E0100,E01EF",
|
||||
"Variation Selectors":"FE00,FE0F",
|
||||
"Vertical Forms":"FE10,FE1F",
|
||||
"Yi Radicals":"A490,A4CF",
|
||||
"Yi Syllables":"A000,A48F",
|
||||
"Yijing Hexagram Symbols":"4DC0,4DFF"
|
||||
};
|
||||
|
||||
var insert="charmap_insert";
|
||||
|
||||
function map_load(){
|
||||
editArea=opener.editArea;
|
||||
// translate the document
|
||||
insert= editArea.get_translation(insert, "word");
|
||||
//alert(document.title);
|
||||
document.title= editArea.get_translation(document.title, "template");
|
||||
document.body.innerHTML= editArea.get_translation(document.body.innerHTML, "template");
|
||||
//document.title= editArea.get_translation(document.getElementBytitle, "template");
|
||||
|
||||
var selected_lang=opener.EditArea_charmap.default_language.toLowerCase();
|
||||
var selected=0;
|
||||
|
||||
var select= document.getElementById("select_range")
|
||||
for(var i in char_range_list){
|
||||
if(i.toLowerCase()==selected_lang)
|
||||
selected=select.options.length;
|
||||
select.options[select.options.length]=new Option(i, char_range_list[i]);
|
||||
}
|
||||
select.options[selected].selected=true;
|
||||
/* start=0;
|
||||
end=127;
|
||||
content="";
|
||||
for(var i=start; i<end; i++){
|
||||
content+="&#"+i+"; ";
|
||||
}
|
||||
document.getElementById("char_list").innerHTML=content;*/
|
||||
renderCharMapHTML();
|
||||
}
|
||||
|
||||
|
||||
function renderCharMapHTML() {
|
||||
range= document.getElementById("select_range").value.split(",");
|
||||
|
||||
start= parseInt(range[0],16);
|
||||
end= parseInt(range[1],16);
|
||||
var charsPerRow = 20, tdWidth=20, tdHeight=20;
|
||||
html="";
|
||||
for (var i=start; i<end; i++) {
|
||||
html+="<a class='char' onmouseover='previewChar(\""+ i + "\");' onclick='insertChar(\""+ i + "\");' title='"+ insert +"'>"+ String.fromCharCode(i) +"</a>";
|
||||
}
|
||||
document.getElementById("char_list").innerHTML= html;
|
||||
document.getElementById("preview_char").innerHTML="";
|
||||
}
|
||||
|
||||
function previewChar(i){
|
||||
document.getElementById("preview_char").innerHTML= String.fromCharCode(i);
|
||||
document.getElementById("preview_code").innerHTML= "&#"+ i +";";
|
||||
}
|
||||
|
||||
function insertChar(i){
|
||||
opener.parent.editAreaLoader.setSelectedText(editArea.id, String.fromCharCode( i));
|
||||
range= opener.parent.editAreaLoader.getSelectionRange(editArea.id);
|
||||
opener.parent.editAreaLoader.setSelectionRange(editArea.id, range["end"], range["end"]);
|
||||
window.focus();
|
||||
}
|
12
addons/Core/edit_area/plugins/charmap/langs/bg.js
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Bulgarian translation
|
||||
* Author: Valentin Hristov
|
||||
* Company: SOFTKIT Bulgarian
|
||||
* Site: http://www.softkit-bg.com
|
||||
*/
|
||||
editArea.add_lang("bg",{
|
||||
charmap_but: "Виртуална клавиатура",
|
||||
charmap_title: "Виртуална клавиатура",
|
||||
charmap_choose_block: "избери езиков блок",
|
||||
charmap_insert:"постави този символ"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/cs.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("cs",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/de.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("de",{
|
||||
charmap_but: "Sonderzeichen",
|
||||
charmap_title: "Sonderzeichen",
|
||||
charmap_choose_block: "Bereich auswählen",
|
||||
charmap_insert: "dieses Zeichen einfügen"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/dk.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("dk",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/en.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("en",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/eo.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("eo",{
|
||||
charmap_but: "Ekranklavaro",
|
||||
charmap_title: "Ekranklavaro",
|
||||
charmap_choose_block: "Elekto de lingvo",
|
||||
charmap_insert:"enmeti tiun signaron"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/es.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("es",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/fr.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("fr",{
|
||||
charmap_but: "Clavier visuel",
|
||||
charmap_title: "Clavier visuel",
|
||||
charmap_choose_block: "choix du language",
|
||||
charmap_insert:"insérer ce caractère"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/hr.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("hr",{
|
||||
charmap_but: "Virtualna tipkovnica",
|
||||
charmap_title: "Virtualna tipkovnica",
|
||||
charmap_choose_block: "Odaberi blok s jezikom",
|
||||
charmap_insert:"Ubaci taj znak"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/it.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("it",{
|
||||
charmap_but: "Tastiera visuale",
|
||||
charmap_title: "Tastiera visuale",
|
||||
charmap_choose_block: "seleziona blocco",
|
||||
charmap_insert:"inserisci questo carattere"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/ja.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("ja",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/mk.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("mkn",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/nl.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("nl",{
|
||||
charmap_but: "Visueel toetsenbord",
|
||||
charmap_title: "Visueel toetsenbord",
|
||||
charmap_choose_block: "Kies een taal blok",
|
||||
charmap_insert:"Voeg dit symbool in"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/pl.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("pl",{
|
||||
charmap_but: "Klawiatura ekranowa",
|
||||
charmap_title: "Klawiatura ekranowa",
|
||||
charmap_choose_block: "wybierz grupę znaków",
|
||||
charmap_insert:"wstaw ten znak"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/pt.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("pt",{
|
||||
charmap_but: "Visual keyboard",
|
||||
charmap_title: "Visual keyboard",
|
||||
charmap_choose_block: "select language block",
|
||||
charmap_insert:"insert this character"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/ru.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("ru",{
|
||||
charmap_but: "Визуальная клавиатура",
|
||||
charmap_title: "Визуальная клавиатура",
|
||||
charmap_choose_block: "выбрать языковой блок",
|
||||
charmap_insert:"вставить этот символ"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/sk.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("sk",{
|
||||
charmap_but: "Vizuálna klávesnica",
|
||||
charmap_title: "Vizuálna klávesnica",
|
||||
charmap_choose_block: "vyber jazykový blok",
|
||||
charmap_insert: "vlož tento znak"
|
||||
});
|
6
addons/Core/edit_area/plugins/charmap/langs/zh.js
Normal file
@ -0,0 +1,6 @@
|
||||
editArea.add_lang("zh",{
|
||||
charmap_but: "软键盘",
|
||||
charmap_title: "软键盘",
|
||||
charmap_choose_block: "选择一个语言块",
|
||||
charmap_insert:"插入此字符"
|
||||
});
|
24
addons/Core/edit_area/plugins/charmap/popup.html
Normal file
@ -0,0 +1,24 @@
|
||||
<?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>{$charmap_title}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="css/charmap.css" />
|
||||
<script language="Javascript" type="text/javascript" src="jscripts/map.js">
|
||||
</script>
|
||||
</head>
|
||||
<body onload='map_load()'>
|
||||
<div id='preview_code' class='preview'></div>
|
||||
<div id='preview_char' class='preview'></div>
|
||||
<h1>{$charmap_title}:</h1>
|
||||
<select id='select_range' onchange='renderCharMapHTML()' title='{$charmap_choose_block}'>
|
||||
</select>
|
||||
<div id='char_list'>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
3
addons/Core/edit_area/plugins/test/css/test.css
Normal file
@ -0,0 +1,3 @@
|
||||
select#test_select{
|
||||
background-color: #FF0000;
|
||||
}
|
BIN
addons/Core/edit_area/plugins/test/images/Thumbs.db
Normal file
BIN
addons/Core/edit_area/plugins/test/images/test.gif
Normal file
After Width: | Height: | Size: 87 B |
10
addons/Core/edit_area/plugins/test/langs/bg.js
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Bulgarian translation
|
||||
* Author: Valentin Hristov
|
||||
* Company: SOFTKIT Bulgarian
|
||||
* Site: http://www.softkit-bg.com
|
||||
*/
|
||||
editArea.add_lang("bg",{
|
||||
test_select: "избери таг",
|
||||
test_but: "тествай копието"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/cs.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("cs",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/de.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("de",{
|
||||
test_select: "Tag auswählen",
|
||||
test_but: "Test Button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/dk.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("dk",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/en.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("en",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/eo.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("eo",{
|
||||
test_select:"elekto de marko",
|
||||
test_but: "provo-butono"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/es.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("es",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/fr.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("fr",{
|
||||
test_select:"choix balise",
|
||||
test_but: "bouton de test"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/hr.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("hr",{
|
||||
test_select: "Odaberi tag",
|
||||
test_but: "Probna tipka"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/it.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("it",{
|
||||
test_select: "seleziona tag",
|
||||
test_but: "pulsante di test"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/ja.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("ja",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/mk.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("mk",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/nl.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("nl",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/pl.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("pl",{
|
||||
test_select: "wybierz tag",
|
||||
test_but: "test"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/pt.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("pt",{
|
||||
test_select: "select tag",
|
||||
test_but: "test button"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/ru.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("ru",{
|
||||
test_select: "выбрать тэг",
|
||||
test_but: "тестировать кнопку"
|
||||
});
|
4
addons/Core/edit_area/plugins/test/langs/sk.js
Normal file
@ -0,0 +1,4 @@
|
||||
editArea.add_lang("sk",{
|
||||
test_select: "vyber tag",
|
||||
test_but: "testovacie tlačidlo"
|
||||
});
|