diff --git a/code-snippets.php b/code-snippets.php
index b195bc74..7e5c89cb 100644
--- a/code-snippets.php
+++ b/code-snippets.php
@@ -2,11 +2,11 @@
/*
Plugin Name: Code Snippets
- Plugin URI: http://wordpress.org/extend/plugins/code-snippets
+ Plugin URI: http://bungeshea.wordpress.com/plugins/code-snippets/
Description: Provides an easy-to-manage GUI interface for adding code snippets to your blog.
Author: Shea Bunge
- Version: 1.1
- Author URI: http://bungeshea.wordpress.com/plugins/code-snippets/
+ Version: 1.2
+ Author URI: http://bungeshea.wordpress.com/
License: GPLv3 or later
Code Snippets - WordPress Plugin
@@ -29,60 +29,50 @@
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
-if( !class_exists('code_snippets') ) :
+if( !class_exists('Code_Snippets') ) :
-class code_snippets {
+class Code_Snippets {
- public $table_name = '';
- public $version = '0.1';
- public $current_version = '';
- public $plugin_url = '';
- public $plugin_dir = '';
- public $dirname = '';
-
- public $manage_snippets_url = '';
- public $edit_snippets_url = '';
- public $uninstall_plugin_url = '';
+ public $table = 'snippets';
+ public $version = '1.2';
+
+ public $file;
+ public $plugin_dir;
+ public $plugin_url;
+ public $basename;
- public $manage_snippets_page;
- public $edit_snippets_page;
- public $uninstall_plugin_page;
+ var $admin_manage_url = 'snippets';
+ var $admin_edit_url = 'snippet';
- public function code_snippets(){
- $this->__construct();
- }
-
- function __construct() {
- $this->setup_vars(); // initialise the varables
- $this->setup_actions(); // run the actions and filters
- $this->run_snippets(); // execute the snippets
+ public function Code_Snippets() {
+ $this->setup(); // initialise the varables and run the hooks
+ $this->create_table(); // create the snippet tables if they do not exist
+ $this->upgrade(); // check if we need to change some stuff
+ $this->run_snippets(); // execute the snippets
}
- function setup_vars(){
+ function setup() {
global $wpdb;
- $this->table_name = $wpdb->prefix . 'snippets';
- $this->current_version = get_option( 'cs_db_version' );
- $this->file = __FILE__;
- $this->basename = plugin_basename( $this->file );
- $this->plugin_dir = plugin_dir_path( $this->file );
- $this->plugin_url = plugin_dir_url ( $this->file );
- $this->dirname = dirname( $this->file );
- $this->manage_snippets_url = admin_url( 'admin.php?page=snippets' );
- $this->edit_snippets_url = admin_url( 'admin.php?page=snippet-new' );
- $this->uninstall_plugin_url = admin_url( 'admin.php?page=uninstall-cs' );
- }
+ $this->file = __FILE__;
+ $this->table = $wpdb->prefix . $this->table;
+ $this->current_version = get_option( 'cs_db_version' );
+
+ $this->basename = plugin_basename( $this->file );
+ $this->plugin_dir = plugin_dir_path( $this->file );
+ $this->plugin_url = plugin_dir_url ( $this->file );
- private function setup_actions(){
- add_action( 'activate_' . $this->basename, array( &$this, 'install' ) );
- add_action( 'deactivate_' . $this->basename, array( &$this, 'uninstall' ) );
- add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
- add_filter( 'plugin_action_links', array( $this, 'settings_link' ), 10, 2 );
+ $this->admin_manage_url = admin_url( 'admin.php?page=' . $this->admin_manage_url );
+ $this->admin_edit_url = admin_url( 'admin.php?page=' . $this->admin_edit_url );
+
+ add_action( 'admin_menu', array( $this, 'add_admin_menus' ) );
+ add_filter( 'plugin_action_links_' . $this->basename, array( $this, 'settings_link' ) );
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), 10, 2 );
}
- function install() {
+ function create_table() {
global $wpdb;
- if($wpdb->get_var("SHOW TABLES LIKE '$this->table_name'") != $this->table_name) {
- $sql = 'CREATE TABLE ' . $this->table_name . ' (
+ if( $wpdb->get_var( "SHOW TABLES LIKE '$this->table'" ) != $this->table ) {
+ $sql = 'CREATE TABLE ' . $this->table . ' (
id mediumint(9) NOT NULL AUTO_INCREMENT,
name varchar(36) NOT NULL,
description text NOT NULL,
@@ -96,42 +86,36 @@ function install() {
}
}
- function uninstall() {
- if( get_option( 'cs_complete_uninstall', 0 ) == 1 ) {
- global $wpdb;
- if( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name ) {
- $sql = 'DROP TABLE ' . $table_name;
- $wpdb->query( $sql );
- delete_option( 'cs_db_version' );
- delete_option( 'cs_complete_uninstall' );
- }
+ function upgrade() {
+ if( $this->current_version < $this->version ) {
+ delete_option( 'cs_complete_uninstall' );
+ update_option( 'cs_db_version', $this->version );
}
}
function add_admin_menus() {
- $this->manage_snippets_page = add_menu_page( 'Snippets', 'Snippets', 'install_plugins', 'snippets', array( &$this, 'manage_snippets' ), $this->plugin_url . 'img/icon16.png', 67 );
- add_submenu_page('snippets', 'Snippets', 'Manage Snippets' , 'install_plugins', 'snippets', array( &$this, 'manage_snippets') );
- $this->edit_snippets_page = add_submenu_page( 'snippets', 'Add New Snippet', 'Add New', 'install_plugins', 'snippet-new', array( &$this, 'edit_snippets' ) );
- $this->uninstall_plugin_page = add_submenu_page( 'snippets', 'Uninstall Code Snippets', 'Uninstall', 'install_plugins', 'uninstall-cs', array( &$this, 'uninstall_plugin' ) );
+ $this->admin_manage_page = add_menu_page( __('Snippets'), __('Snippets'), 'install_plugins', 'snippets', array( $this, 'admin_manage_loader' ), $this->plugin_url . 'images/icon16.png', 67 );
+ add_submenu_page('snippets', __('Snippets'), __('Manage Snippets') , 'install_plugins', 'snippets', array( $this, 'admin_manage_loader') );
+ $this->admin_edit_page = add_submenu_page( 'snippets', __('Add New Snippet'), __('Add New'), 'install_plugins', 'snippet', array( $this, 'admin_edit_loader' ) );
- add_action( 'admin_print_styles-' . $this->manage_snippets_page, array( $this, 'load_stylesheet' ), 5 );
- add_action( 'admin_print_styles-' . $this->edit_snippets_page, array( $this, 'load_stylesheet' ), 5 );
- add_action( 'admin_print_styles-' . $this->uninstall_plugin_page, array( $this, 'load_stylesheet' ), 5 );
- add_action( 'admin_print_scripts-' . $this->edit_snippets_page, array( $this, 'load_tabby' ), 5 );
- add_action( 'load-' . $this->manage_snippets_page, array( $this, 'manage_snippets_help' ), 5 );
- add_action( 'load-' . $this->edit_snippets_page, array( $this, 'edit_snippets_help' ), 5 );
- add_action( 'load-' . $this->uninstall_plugin_page, array( $this, 'uninstall_plugin_help' ), 5 );
+ add_action( "admin_print_styles-$this->admin_manage_page", array( $this, 'load_stylesheet' ), 5 );
+ add_action( "admin_print_styles-$this->admin_edit_page", array( $this, 'load_stylesheet' ), 5 );
+ add_action( "admin_print_scripts-$this->admin_edit_page", array( $this, 'load_editarea' ), 5 );
+ add_action( "load-$this->admin_manage_page", array( $this, 'admin_manage_help' ), 5 );
+ add_action( "load-$this->admin_edit_page", array( $this, 'admin_edit_help' ), 5 );
}
-
+
function load_stylesheet() {
wp_enqueue_style('code-snippets-admin-style', plugins_url( 'css/style.css', $this->file), false, $this->version );
}
-
- function load_tabby() {
- wp_enqueue_script( 'tabby', plugins_url( 'js/jquery.textarea.js', $this->file), array( 'jquery' ), 0.12 );
+
+ function load_editarea() {
+ wp_register_script( 'editarea', plugins_url( 'includes/edit_area/edit_area_full.js', $this->file ), array( 'jquery' ), '0.8.2' );
+ wp_enqueue_script( 'editarea' );
}
- function manage_snippets_help() {
+ function admin_manage_help() {
+
$screen = get_current_screen();
$screen->add_help_tab( array(
'id' => 'overview',
@@ -144,21 +128,33 @@ function manage_snippets_help() {
'title' => 'Troubleshooting',
'content' =>
"
Be sure to check your snippets for errors before you activate them as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.
" .
- "If something goes wrong with a snippet and you can’t use WordPress, you can use a database manager like phpMyAdmin to access the $this->table_name
table in your WordPress database. Locate the offending snippet (if you know which one is the trouble) and change the 1 in the 'active' column into a 0. If this doesn't work try doing this for all snippets.
"
+ "If something goes wrong with a snippet and you can’t use WordPress, you can use a database manager like phpMyAdmin to access the $this->table
table in your WordPress database. Locate the offending snippet (if you know which one is the trouble) and change the 1 in the 'active' column into a 0. If this doesn't work try doing this for all snippets. You can also delete or rename the $this->table
table and the table will automaticly be reconstructed so you can re-add snippets one at a time.
"
+ ) );
+
+ $screen->add_help_tab( array(
+ 'id' => 'uninstall',
+ 'title' => 'Uninstall',
+ 'content' =>
+ "When you delete Code Snippets through the Plugins menu in WordPress it will clear up the $this->table
table and a few other bits of data stored in the database. If you want to keep this data (ie you are only temporally uninstalling Code Snippets) then remove the ".dirname(__FILE__)."
folder using FTP." .
+ "
Even if you're sure that you don't want to use Code Snippets ever again on this WordPress installaion, you may want to use phpMyAdmin to back up the $this->table
table in the database. You can later use phpMyAdmin to import it back.
"
) );
$screen->set_help_sidebar(
"For more information:
" .
"WordPress Extend
" .
"Support Forums
" .
- "SheaPress
"
+ "SheaPress
"
);
}
- function edit_snippets_help() {
+ function admin_edit_title( $title ) {
+ return str_ireplace( 'Add New Snippet', 'Edit Snippet', $title );
+ }
+
+ function admin_edit_help() {
if( isset( $_GET['action'] ) && @$_GET['action'] == 'edit' )
- add_filter('admin_title', array( &$this, 'edit_snippets_title' ), 10, 2);
+ add_filter( 'admin_title', array( $this, 'admin_edit_title' ) );
$screen = get_current_screen();
$screen->add_help_tab( array(
@@ -173,12 +169,23 @@ function edit_snippets_help() {
'content' =>
"Here are some links to websites which host a large number of snippets that you can add to your site.
- Snippets can be installed through the Add New Snippet page or by addng them to the $this->table_name
table in the database (Warning: for advanced users only). Once a snippet has been installed, you can activate it here."
+ And below is a selection of snippets to get you started:
+
+ Snippets can be installed through the Add New Snippet page or by addng them to the $this->table
table in the database (Warning: for advanced users only). Once a snippet has been installed, you can activate it here."
) );
$screen->add_help_tab( array(
'id' => 'adding',
@@ -193,112 +200,69 @@ function edit_snippets_help() {
"For more information:
" .
"WordPress Extend
" .
"Support Forums
" .
- "SheaPress
"
- );
- }
-
- function uninstall_plugin_help() {
- $screen = get_current_screen();
- $screen->add_help_tab( array(
- 'id' => 'overview',
- 'title' => 'Overview',
- 'content' =>
- "If you are absolutly sure that you will never, ever want to use the Code Snippets plugin ever again in your entire life on this WordPress installation, you can use this page to tell Code Snippets to clear all of its data when deactivated. Simply check the box below and click on the submit button. If you realise what a cool plugin Code Snippets actually is before you get around to deactivating the plugin you can come back here and uncheck the box. If the box is selected when Code Snippets is deactivated it will clear up the $this->table_name
table and a few other bits of data stored in the database.
" .
- "Even if you're sure that you don't want to use Code Snippets on this WordPress installaion, you may want to use phpMyAdmin to back up the $this->table_name
table in the database. You can later use phpMyAdmin to import it back.
"
- ) );
-
- $screen->set_help_sidebar(
- "For more information:
" .
- "WordPress Extend
" .
- "Support Forums
" .
- "SheaPress
"
+ "SheaPress
"
);
}
- function manage_snippets() {
+ function bulk_action( $action, $ids ) {
+ if( !isset( $action ) && !isset( $ids ) && !is_array( $ids ) )
+ return false;
global $wpdb;
- $msg = '';
- if( isset( $_POST['action'] ) && isset( $_POST['snippets'] ) && is_array( $_POST['snippets'] ) ) {
- $count = 0;
- switch( $_POST['action'] ) {
+ $count = 0;
+ switch( $action ) {
- case 'activate':
- foreach($_POST['snippets'] as $bd) {
- $wpdb->query('update ' . $this->table_name . ' set active=1 where id=' . intval( $bd ) . ' limit 1' );
- $count++;
- }
- $msg = "Activated $count snippets.";
- break;
+ case 'activate':
+ foreach( $ids as $id ) {
+ $wpdb->query('update ' . $this->table . ' set active=1 where id=' . intval( $id ) . ' limit 1' );
+ $count++;
+ }
+ $msg = "Activated $count snippets.";
+ break;
- case 'deactivate':
- foreach($_POST['snippets'] as $bd) {
- $wpdb->query('update ' . $this->table_name . ' set active=0 where id=' . intval( $bd ) . ' limit 1' );
- $count++;
- }
- $msg = "Deactivated $count snippets.";
- break;
+ case 'deactivate':
+ foreach( $ids as $id ) {
+ $wpdb->query( 'update ' . $this->table . ' set active=0 where id=' . intval( $id ) . ' limit 1' );
+ $count++;
+ }
+ $msg = "Deactivated $count snippets.";
+ break;
- case 'delete':
- foreach( $_POST['snippets'] as $bd) {
- $wpdb->query("delete from ".$wpdb->prefix."snippets where id=".intval($bd)." limit 1");
- $count++;
- }
- $msg = "Deleted $count snippets.";
- break;
- }
+ case 'delete':
+ foreach( $ids as $id ) {
+ $wpdb->query( 'delete from ' . $this->table . ' where id=' . intval( $id ) . ' limit 1' );
+ $count++;
+ }
+ $msg = "Deleted $count snippets.";
+ break;
}
+ }
+
+ function admin_manage_loader() {
+ global $wpdb;
- if( isset( $_POST['action2'] ) && isset( $_POST['snippets'] ) && is_array( $_POST['snippets'] ) ) {
- $count = 0;
- switch( $_POST['action2'] ) {
-
- case 'activate':
- foreach($_POST['snippets'] as $bd) {
- $wpdb->query('update ' . $this->table_name . ' set active=1 where id=' . intval( $bd ) . ' limit 1' );
- $count++;
- }
- $msg = "Activated $count snippets.";
- break;
-
- case 'deactivate':
- foreach($_POST['snippets'] as $bd) {
- $wpdb->query('update ' . $this->table_name . ' set active=0 where id=' . intval( $bd ) . ' limit 1' );
- $count++;
- }
- $msg = "Deactivated $count snippets.";
- break;
-
- case 'delete':
- foreach( $_POST['snippets'] as $bd) {
- $wpdb->query("delete from ".$wpdb->prefix."snippets where id=".intval($bd)." limit 1");
- $count++;
- }
- $msg = "Deleted $count snippets.";
- break;
- }
- }
+ $this->bulk_action( @$_POST['action'], @$_POST['ids'] );
+ $this->bulk_action( @$_POST['action2'], @$_POST['ids'] );
if( isset( $_GET['action'] ) && isset( $_GET['id'] ) ) {
if( $_GET['action'] == 'delete') {
- $wpdb->query( 'delete from ' . $this->table_name . ' where id=' . intval( $_GET['id'] ) . ' limit 1' );
+ $wpdb->query( 'delete from ' . $this->table . ' where id=' . intval( $_GET['id'] ) . ' limit 1' );
$msg = 'Snippet deleted.';
}
elseif( $_GET['action'] == 'activate' ) {
- $wpdb->query('update ' . $this->table_name . ' set active=1 where id=' . intval( $_GET['id'] ) . ' limit 1' );
+ $wpdb->query('update ' . $this->table . ' set active=1 where id=' . intval( $_GET['id'] ) . ' limit 1' );
$msg = 'Snippet activated.';
}
elseif( $_GET['action'] == 'deactivate' ) {
- $wpdb->query('update ' . $this->table_name . ' set active=0 where id=' . intval( $_GET['id'] ) . ' limit 1' );
+ $wpdb->query('update ' . $this->table . ' set active=0 where id=' . intval( $_GET['id'] ) . ' limit 1' );
$msg = 'Snippet deactivated.';
}
}
-
- require_once( $this->dirname . '/inc/manage-snippets.php');
+
+ require_once $this->plugin_dir . 'includes/admin-manage.php';
}
- function edit_snippets() {
+ function admin_edit_loader() {
global $wpdb;
- $msg = '';
if( isset( $_POST['save_snippet'] ) ) {
$name = mysql_real_escape_string( htmlspecialchars( $_POST['snippet_name' ] ) );
$description = mysql_real_escape_string( htmlspecialchars( $_POST['snippet_description'] ) );
@@ -306,14 +270,14 @@ function edit_snippets() {
if( strlen( $name ) && strlen( $code ) ) {
if( isset($_POST['edit_id'] ) ) {
- $wpdb-> query( "update $this->table_name set name='".$name."',
+ $wpdb-> query( "update $this->table set name='".$name."',
description='".$description."',
code='".$code."'
where id=" . intval($_POST["edit_id"]." limit 1"));
$msg = 'Snippet updated.';
}
else {
- $wpdb->query( "insert into $this->table_name(name,description,code,active) VALUES ('$name','$description','$code',0)" );
+ $wpdb->query( "insert into $this->table(name,description,code,active) VALUES ('$name','$description','$code',0)" );
$msg = 'Snippet added.';
}
}
@@ -321,62 +285,31 @@ function edit_snippets() {
$msg = 'Please provide a name for the snippet and the code.';
}
}
- require_once( $this->dirname . '/inc/edit-snippets.php');
+ require_once $this->plugin_dir . 'includes/admin-edit.php';
}
-
- function edit_snippets_title( $admin_title, $title ) {
-
- $title = 'Edit Snippet';
-
- if ( is_network_admin() )
- $admin_title = __( 'Network Admin' );
- elseif ( is_user_admin() )
- $admin_title = __( 'Global Dashboard' );
- else
- $admin_title = get_bloginfo( 'name' );
-
- if ( $admin_title == $title )
- $admin_title = sprintf( __( '%1$s — WordPress' ), $title );
- else
- $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title );
-
- return $admin_title;
+
+ function settings_link( $links ) {
+ array_unshift( $links, '' . __('Manage') . ' ' );
+ return $links;
}
- function uninstall_plugin(){
- $msg = '';
- if( isset( $_POST['uninstall'] ) ) {
- if(isset( $_POST['ch_unin']) ) {
- update_option('cs_complete_uninstall' , 1);
- $msg = 'Option updated. Please deactivate the Code Snippets plugin to clear all data.';
- }
- else {
- update_option('cs_complete_uninstall', 0);
- $msg = 'Option updated. Code Snippets will retain its data when deactivated';
- }
- }
- require_once( $this->dirname . '/inc/uninstall-plugin.php');
- }
-
- function settings_link( $links, $file ){
- static $this_plugin;
- if ( ! $this_plugin ) {
- $this_plugin = plugin_basename( __FILE__ );
- }
- if ( $file == $this_plugin ) {
- $settings_link = 'Settings ';
- array_unshift( $links, $settings_link );
+ function plugin_meta( $links, $file ) {
+ if ( $file == $this->basename ) {
+ return array_merge( $links, array(
+ '' . __( 'About' ) . ' ',
+ '' . __( 'Support' ) . ' '
+ ) );
}
return $links;
}
-
+
function run_snippets() {
global $wpdb;
// grab the active snippets from the database
- $active_snippets = $wpdb->get_results( 'select * FROM `' . $this->table_name . '` WHERE `active` = 1;' );
+ $active_snippets = $wpdb->get_results( 'select * FROM `' . $this->table . '` WHERE `active` = 1;' );
if( count( $active_snippets ) ) {
foreach( $active_snippets as $snippet ) {
- // execute the php code
+ // execute the php code
$result = @eval( htmlspecialchars_decode( stripslashes( $snippet->code ) ) );
}
}
@@ -386,6 +319,12 @@ function run_snippets() {
endif; // class exists check
global $cs;
-$cs = new code_snippets;
+$cs = new Code_Snippets;
+
+register_uninstall_hook( __FILE__, 'cs_uninstall' );
-?>
\ No newline at end of file
+function cs_uninstall() {
+ global $wpdb, $cs;
+ $wpdb->query( "DROP TABLE IF EXISTS `$cs->table`" );
+ delete_option( 'cs_db_version' );
+}
\ No newline at end of file
diff --git a/css/style.css b/css/style.css
index 5d828b97..39c20b50 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1,10 +1,10 @@
-#icon-snippets.icon32{
- background: url('../img/icon32.png') no-repeat scroll transparent;
+#icon-snippets.icon32 {
+ background: url('../images/icon32.png') no-repeat scroll transparent;
}
/* Snippets > Manage Snippets */
-.inactive a:hover{
+.inactive a:hover {
color: #d54e21;
}
@@ -13,17 +13,17 @@ a.delete:hover {
border-bottom-color: #f00;
}
-a.delete{
+a.delete {
color: #21759b;
}
-tr{
+tr {
background-color: #fcfcfc;
}
.inactive,
.inactive th,
-.inactive td{
+.inactive td {
background-color: #f4f4f4;
}
diff --git a/img/icon16.png b/images/icon16.png
similarity index 100%
rename from img/icon16.png
rename to images/icon16.png
diff --git a/img/icon32.png b/images/icon32.png
similarity index 100%
rename from img/icon32.png
rename to images/icon32.png
diff --git a/img/icon-big.png b/img/icon-big.png
deleted file mode 100644
index 3889159d..00000000
Binary files a/img/icon-big.png and /dev/null differ
diff --git a/img/icon-horiz.png b/img/icon-horiz.png
deleted file mode 100644
index 2f383c66..00000000
Binary files a/img/icon-horiz.png and /dev/null differ
diff --git a/img/icon-med.png b/img/icon-med.png
deleted file mode 100644
index 7f13caaf..00000000
Binary files a/img/icon-med.png and /dev/null differ
diff --git a/img/icon-small.png b/img/icon-small.png
deleted file mode 100644
index 196cd0d8..00000000
Binary files a/img/icon-small.png and /dev/null differ
diff --git a/img/icon.odg b/img/icon.odg
deleted file mode 100644
index 23d41ef6..00000000
Binary files a/img/icon.odg and /dev/null differ
diff --git a/img/icon.svg b/img/icon.svg
deleted file mode 100644
index 37572988..00000000
--- a/img/icon.svg
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
- Clipart by Nicu Buculei - book_01
-
-
-
- hash
-
- education
-
-
-
-
- Nicu Buculei
-
-
-
-
- Nicu Buculei
-
-
-
-
- Nicu Buculei
-
-
-
- image/svg+xml
-
-
- en
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/inc/uninstall-plugin.php b/inc/uninstall-plugin.php
deleted file mode 100644
index 2a146ed9..00000000
--- a/inc/uninstall-plugin.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
Uninstall Code Snippets
-
-
-
-
Checking this box will remove all snippets and the table from the database when the plugin is deactivated.
-
Only use if permanently uninstalling the Code Snippets plugin.
-
You can come back here before deactivating the plugin and change your choice.
-
-
-
\ No newline at end of file
diff --git a/inc/edit-snippets.php b/includes/admin-edit.php
similarity index 68%
rename from inc/edit-snippets.php
rename to includes/admin-edit.php
index 9c80ffc7..12b0a38c 100644
--- a/inc/edit-snippets.php
+++ b/includes/admin-edit.php
@@ -1,23 +1,25 @@
Edit Snippet
Add New Add New Snippet
-
+
\ No newline at end of file
diff --git a/inc/manage-snippets.php b/includes/admin-manage.php
similarity index 56%
rename from inc/manage-snippets.php
rename to includes/admin-manage.php
index 0381f296..e86feb2e 100644
--- a/inc/manage-snippets.php
+++ b/includes/admin-manage.php
@@ -1,10 +1,13 @@
-
+
-
-
+
+
- get_results( 'select * from ' . $this->table_name ); ?>
+ get_results( 'select * from ' . $this->table ); ?>
@@ -21,7 +24,7 @@
- Name
+ Name
Description
@@ -33,16 +36,16 @@
else
echo 'active';
?>'>
-
-
name);?>
+
+
name );?>
description ) ); ?>
@@ -51,16 +54,23 @@
- You do not appear to have any snippets available at this time.
+ You do not appear to have any snippets available at this time. Add New→
+
+
+
+ Name
+ Description
+
+
Bulk Actions
Activate
- Deactivate
+ Dectivate
Delete
diff --git a/includes/edit_area/autocompletion.js b/includes/edit_area/autocompletion.js
new file mode 100644
index 00000000..3f174b2f
--- /dev/null
+++ b/includes/edit_area/autocompletion.js
@@ -0,0 +1,491 @@
+/**
+ * Autocompletion class
+ *
+ * An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut
+ *
+ * Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory)
+ * But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language)
+ * and add a too important feature that many people would miss if included as a plugin
+ *
+ * - init param: autocompletion_start
+ * - Button name: "autocompletion"
+ */
+
+var EditArea_autocompletion= {
+
+ /**
+ * Get called once this file is loaded (editArea still not initialized)
+ *
+ * @return nothing
+ */
+ init: function(){
+ // alert("test init: "+ this._someInternalFunction(2, 3));
+
+ if(editArea.settings["autocompletion"])
+ this.enabled= true;
+ else
+ this.enabled= false;
+ this.current_word = false;
+ this.shown = false;
+ this.selectIndex = -1;
+ this.forceDisplay = false;
+ this.isInMiddleWord = false;
+ this.autoSelectIfOneResult = false;
+ this.delayBeforeDisplay = 100;
+ this.checkDelayTimer = false;
+ this.curr_syntax_str = '';
+
+ this.file_syntax_datas = {};
+ }
+ /**
+ * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
+ * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
+ * Language variables such as {$lang_somekey} will also be replaced with contents from
+ * the language packs.
+ *
+ * @param {string} ctrl_name: the name of the control to add
+ * @return HTML code for a specific control or false.
+ * @type string or boolean
+ */
+ /*,get_control_html: function(ctrl_name){
+ switch( ctrl_name ){
+ case 'autocompletion':
+ // Control id, button img, command
+ return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL);
+ break;
+ }
+ return false;
+ }*/
+ /**
+ * Get called once EditArea is fully loaded and initialised
+ *
+ * @return nothing
+ */
+ ,onload: function(){
+ if(this.enabled)
+ {
+ var icon= document.getElementById("autocompletion");
+ if(icon)
+ editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
+ }
+
+ this.container = document.createElement('div');
+ this.container.id = "auto_completion_area";
+ editArea.container.insertBefore( this.container, editArea.container.firstChild );
+
+ // add event detection for hiding suggestion box
+ parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} );
+ parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} );
+
+ }
+
+ /**
+ * Is called each time the user touch a keyboard key.
+ *
+ * @param (event) e: the keydown event
+ * @return true - pass to next handler in chain, false - stop chain execution
+ * @type boolean
+ */
+ ,onkeydown: function(e){
+ if(!this.enabled)
+ return true;
+
+ if (EA_keys[e.keyCode])
+ letter=EA_keys[e.keyCode];
+ else
+ letter=String.fromCharCode(e.keyCode);
+ // shown
+ if( this._isShown() )
+ {
+ // if escape, hide the box
+ if(letter=="Esc")
+ {
+ this._hide();
+ return false;
+ }
+ // Enter
+ else if( letter=="Entrer")
+ {
+ var as = this.container.getElementsByTagName('A');
+ // select a suggested entry
+ if( this.selectIndex >= 0 && this.selectIndex < as.length )
+ {
+ as[ this.selectIndex ].onmousedown();
+ return false
+ }
+ // simply add an enter in the code
+ else
+ {
+ this._hide();
+ return true;
+ }
+ }
+ else if( letter=="Tab" || letter=="Down")
+ {
+ this._selectNext();
+ return false;
+ }
+ else if( letter=="Up")
+ {
+ this._selectBefore();
+ return false;
+ }
+ }
+ // hidden
+ else
+ {
+
+ }
+
+ // show current suggestion list and do autoSelect if possible (no matter it's shown or hidden)
+ if( letter=="Space" && CtrlPressed(e) )
+ {
+ //parent.console.log('SHOW SUGGEST');
+ this.forceDisplay = true;
+ this.autoSelectIfOneResult = true;
+ this._checkLetter();
+ return false;
+ }
+
+ // wait a short period for check that the cursor isn't moving
+ setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 );
+ this.checkDelayTimer = false;
+ return true;
+ }
+ /**
+ * Executes a specific command, this function handles plugin commands.
+ *
+ * @param {string} cmd: the name of the command being executed
+ * @param {unknown} param: the parameter of the command
+ * @return true - pass to next handler in chain, false - stop chain execution
+ * @type boolean
+ */
+ ,execCommand: function(cmd, param){
+ switch( cmd ){
+ case 'toggle_autocompletion':
+ var icon= document.getElementById("autocompletion");
+ if(!this.enabled)
+ {
+ if(icon != null){
+ editArea.restoreClass(icon);
+ editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
+ }
+ this.enabled= true;
+ }
+ else
+ {
+ this.enabled= false;
+ if(icon != null)
+ editArea.switchClassSticky(icon, 'editAreaButtonNormal', false);
+ }
+ return true;
+ }
+ return true;
+ }
+ ,_checkDelayAndCursorBeforeDisplay: function()
+ {
+ this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();", this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 );
+ }
+ // hide the suggested box
+ ,_hide: function(){
+ this.container.style.display="none";
+ this.selectIndex = -1;
+ this.shown = false;
+ this.forceDisplay = false;
+ this.autoSelectIfOneResult = false;
+ }
+ // display the suggested box
+ ,_show: function(){
+ if( !this._isShown() )
+ {
+ this.container.style.display="block";
+ this.selectIndex = -1;
+ this.shown = true;
+ }
+ }
+ // is the suggested box displayed?
+ ,_isShown: function(){
+ return this.shown;
+ }
+ // setter and getter
+ ,_isInMiddleWord: function( new_value ){
+ if( typeof( new_value ) == "undefined" )
+ return this.isInMiddleWord;
+ else
+ this.isInMiddleWord = new_value;
+ }
+ // select the next element in the suggested box
+ ,_selectNext: function()
+ {
+ var as = this.container.getElementsByTagName('A');
+
+ // clean existing elements
+ for( var i=0; i
= as.length || this.selectIndex < 0 ) ? 0 : this.selectIndex;
+ as[ this.selectIndex ].className += " focus";
+ }
+ // select the previous element in the suggested box
+ ,_selectBefore: function()
+ {
+ var as = this.container.getElementsByTagName('A');
+
+ // clean existing elements
+ for( var i=0; i= as.length || this.selectIndex < 0 ) ? as.length-1 : this.selectIndex;
+ as[ this.selectIndex ].className += " focus";
+ }
+ ,_select: function( content )
+ {
+ cursor_forced_position = content.indexOf( '{@}' );
+ content = content.replace(/{@}/g, '' );
+ editArea.getIESelection();
+
+ // retrive the number of matching characters
+ var start_index = Math.max( 0, editArea.textarea.selectionEnd - content.length );
+
+ line_string = editArea.textarea.value.substring( start_index, editArea.textarea.selectionEnd + 1);
+ limit = line_string.length -1;
+ nbMatch = 0;
+ for( i =0; i 0 )
+ parent.editAreaLoader.setSelectionRange(editArea.id, editArea.textarea.selectionStart - nbMatch , editArea.textarea.selectionEnd);
+
+ parent.editAreaLoader.setSelectedText(editArea.id, content );
+ range= parent.editAreaLoader.getSelectionRange(editArea.id);
+
+ if( cursor_forced_position != -1 )
+ new_pos = range["end"] - ( content.length-cursor_forced_position );
+ else
+ new_pos = range["end"];
+ parent.editAreaLoader.setSelectionRange(editArea.id, new_pos, new_pos);
+ this._hide();
+ }
+
+
+ /**
+ * Parse the AUTO_COMPLETION part of syntax definition files
+ */
+ ,_parseSyntaxAutoCompletionDatas: function(){
+ //foreach syntax loaded
+ for(var lang in parent.editAreaLoader.load_syntax)
+ {
+ if(!parent.editAreaLoader.syntax[lang]['autocompletion']) // init the regexp if not already initialized
+ {
+ parent.editAreaLoader.syntax[lang]['autocompletion']= {};
+ // the file has auto completion datas
+ if(parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
+ {
+ // parse them
+ for(var i in parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
+ {
+ datas = parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'][i];
+ tmp = {};
+ if(datas["CASE_SENSITIVE"]!="undefined" && datas["CASE_SENSITIVE"]==false)
+ tmp["modifiers"]="i";
+ else
+ tmp["modifiers"]="";
+ tmp["prefix_separator"]= datas["REGEXP"]["prefix_separator"];
+ tmp["match_prefix_separator"]= new RegExp( datas["REGEXP"]["prefix_separator"] +"$", tmp["modifiers"]);
+ tmp["match_word"]= new RegExp("(?:"+ datas["REGEXP"]["before_word"] +")("+ datas["REGEXP"]["possible_words_letters"] +")$", tmp["modifiers"]);
+ tmp["match_next_letter"]= new RegExp("^("+ datas["REGEXP"]["letter_after_word_must_match"] +")$", tmp["modifiers"]);
+ tmp["keywords"]= {};
+ //console.log( datas["KEYWORDS"] );
+ for( var prefix in datas["KEYWORDS"] )
+ {
+ tmp["keywords"][prefix]= {
+ prefix: prefix,
+ prefix_name: prefix,
+ prefix_reg: new RegExp("(?:"+ parent.editAreaLoader.get_escaped_regexp( prefix ) +")(?:"+ tmp["prefix_separator"] +")$", tmp["modifiers"] ),
+ datas: []
+ };
+ for( var j=0; j it's valid
+ if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
+ {
+ if( ! before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
+ hasMatch = true;
+ }
+ // we still need to check the prefix if there is one
+ else if( this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
+ {
+ if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
+ hasMatch = true;
+ }
+
+ if( hasMatch )
+ results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
+ }
+ }
+ }
+ }
+ // it doesn't match any possible word but we want to display something
+ // we'll display to list of all available words
+ else if( this.forceDisplay || match_prefix_separator )
+ {
+ for(var prefix in this.curr_syntax[i]["keywords"])
+ {
+ for(var j=0; j it's valid
+ if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
+ {
+ hasMatch = true;
+ }
+ // we still need to check the prefix if there is one
+ else if( match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
+ {
+ var before = last_chars; //.substr( 0, last_chars.length );
+ if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
+ hasMatch = true;
+ }
+
+ if( hasMatch )
+ results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
+ }
+ }
+ }
+ }
+ }
+
+ // there is only one result, and we can select it automatically
+ if( results.length == 1 && this.autoSelectIfOneResult )
+ {
+ // console.log( results );
+ this._select( results[0][1]['replace_with'] );
+ }
+ else if( results.length == 0 )
+ {
+ this._hide();
+ }
+ else
+ {
+ // build the suggestion box content
+ var lines=[];
+ for(var i=0; i"+ results[i][1]['comment'];
+ if(results[i][0]['prefix_name'].length>0)
+ line+=''+ results[i][0]['prefix_name'] +' ';
+ line+='';
+ lines[lines.length]=line;
+ }
+ // sort results
+ this.container.innerHTML = ''+ lines.sort().join('') +' ';
+
+ var cursor = _$("cursor_pos");
+ this.container.style.top = ( cursor.cursor_top + editArea.lineHeight ) +"px";
+ this.container.style.left = ( cursor.cursor_left + 8 ) +"px";
+ this._show();
+ }
+
+ this.autoSelectIfOneResult = false;
+ time=new Date;
+ t2= time.getTime();
+
+ //parent.console.log( begin_word +"\n"+ (t2-t1) +"\n"+ html );
+ }
+ }
+};
+
+// Load as a plugin
+editArea.settings['plugins'][ editArea.settings['plugins'].length ] = 'autocompletion';
+editArea.add_plugin('autocompletion', EditArea_autocompletion);
\ No newline at end of file
diff --git a/includes/edit_area/edit_area.css b/includes/edit_area/edit_area.css
new file mode 100644
index 00000000..5022371b
--- /dev/null
+++ b/includes/edit_area/edit_area.css
@@ -0,0 +1,530 @@
+body, html{
+ margin: 0;
+ padding: 0;
+ height: 100%;
+ border: none;
+ overflow: hidden;
+ background-color: #FFF;
+}
+
+body, html, table, form, textarea{
+ font: 12px monospace, sans-serif;
+}
+
+#editor{
+ border: solid #888 1px;
+ overflow: hidden;
+}
+
+#result{
+ z-index: 4;
+ overflow-x: auto;
+ overflow-y: scroll;
+ border-top: solid #888 1px;
+ border-bottom: solid #888 1px;
+ position: relative;
+ clear: both;
+}
+
+#result.empty{
+ overflow: hidden;
+}
+
+#container{
+ overflow: hidden;
+ border: solid blue 0;
+ position: relative;
+ z-index: 10;
+ padding: 0 5px 0 45px;
+ /*padding-right: 5px;*/
+}
+
+#textarea{
+ position: relative;
+ top: 0;
+ left: 0;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ z-index: 7;
+ border-width: 0;
+ background-color: transparent;
+ resize: none;
+}
+
+#textarea, #textarea:hover{
+ outline: none; /* safari outline fix */
+}
+
+#content_highlight{
+ white-space: pre;
+ margin: 0;
+ padding: 0;
+ position : absolute;
+ z-index: 4;
+ overflow: visible;
+}
+
+
+#selection_field, #selection_field_text{
+ margin: 0;
+ background-color: #E1F2F9;
+/* height: 1px; */
+ position: absolute;
+ z-index: 5;
+ top: -100px;
+ padding: 0;
+ white-space: pre;
+ overflow: hidden;
+}
+
+#selection_field.show_colors {
+ z-index: 3;
+ background-color:#EDF9FC;
+
+}
+
+#selection_field strong{
+ font-weight:normal;
+}
+
+#selection_field.show_colors *, #selection_field_text * {
+ visibility: hidden;
+}
+
+#selection_field_text{
+ background-color:transparent;
+}
+
+#selection_field_text strong{
+ font-weight:normal;
+ background-color:#3399FE;
+ color: #FFF;
+ visibility:visible;
+}
+
+#container.word_wrap #content_highlight,
+#container.word_wrap #selection_field,
+#container.word_wrap #selection_field_text,
+#container.word_wrap #test_font_size{
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+ width: 99%;
+}
+
+#line_number{
+ position: absolute;
+ overflow: hidden;
+ border-right: solid black 1px;
+ z-index:8;
+ width: 38px;
+ padding: 0 5px 0 0;
+ margin: 0 0 0 -45px;
+ text-align: right;
+ color: #AAAAAA;
+}
+
+#test_font_size{
+ padding: 0;
+ margin: 0;
+ visibility: hidden;
+ position: absolute;
+ white-space: pre;
+}
+
+pre{
+ margin: 0;
+ padding: 0;
+}
+
+.hidden{
+ opacity: 0.2;
+ filter:alpha(opacity=20);
+}
+
+#result .edit_area_cursor{
+ position: absolute;
+ z-index:6;
+ background-color: #FF6633;
+ top: -100px;
+ margin: 0;
+}
+
+#result .edit_area_selection_field .overline{
+ background-color: #996600;
+}
+
+
+/* area popup */
+.editarea_popup{
+ border: solid 1px #888888;
+ background-color: #ECE9D8;
+ width: 250px;
+ padding: 4px;
+ position: absolute;
+ visibility: hidden;
+ z-index: 15;
+ top: -500px;
+}
+
+.editarea_popup, .editarea_popup table{
+ font-family: sans-serif;
+ font-size: 10pt;
+}
+
+.editarea_popup img{
+ border: 0;
+}
+
+.editarea_popup .close_popup{
+ float: right;
+ line-height: 16px;
+ border: 0;
+ padding: 0;
+}
+
+.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
+ margin: 0;
+ padding: 0;
+}
+
+.editarea_popup .copyright{
+ text-align: right;
+}
+
+/* Area_search */
+div#area_search_replace{
+ /*width: 250px;*/
+}
+
+div#area_search_replace img{
+ border: 0;
+}
+
+div#area_search_replace div.button{
+ text-align: center;
+ line-height: 1.7em;
+}
+
+div#area_search_replace .button a{
+ cursor: pointer;
+ border: solid 1px #888888;
+ background-color: #DEDEDE;
+ text-decoration: none;
+ padding: 0 2px;
+ color: #000000;
+ white-space: nowrap;
+}
+
+div#area_search_replace a:hover{
+ /*border: solid 1px #888888;*/
+ background-color: #EDEDED;
+}
+
+div#area_search_replace #move_area_search_replace{
+ cursor: move;
+ border: solid 1px #888;
+}
+
+div#area_search_replace #close_area_search_replace{
+ text-align: right;
+ vertical-align: top;
+ white-space: nowrap;
+}
+
+div#area_search_replace #area_search_msg{
+ height: 18px;
+ overflow: hidden;
+ border-top: solid 1px #888;
+ margin-top: 3px;
+}
+
+/* area help */
+#edit_area_help{
+ width: 350px;
+}
+
+#edit_area_help div.close_popup{
+ float: right;
+}
+
+/* area_toolbar */
+.area_toolbar{
+ /*font: 11px sans-serif;*/
+ width: 100%;
+ /*height: 21px; */
+ margin: 0;
+ padding: 0;
+ background-color: #ECE9D8;
+ text-align: center;
+}
+
+.area_toolbar, .area_toolbar table{
+ font: 11px sans-serif;
+}
+
+.area_toolbar img{
+ border: 0;
+ vertical-align: middle;
+}
+
+.area_toolbar input{
+ margin: 0;
+ padding: 0;
+}
+
+.area_toolbar select{
+ font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
+ font-size: 7pt;
+ font-weight: normal;
+ margin: 2px 0 0 0 ;
+ padding: 0;
+ vertical-align: top;
+ background-color: #F0F0EE;
+}
+
+table.statusbar{
+ width: 100%;
+}
+
+.area_toolbar td.infos{
+ text-align: center;
+ width: 130px;
+ border-right: solid 1px #888;
+ border-width: 0 1px 0 0;
+ padding: 0;
+}
+
+.area_toolbar td.total{
+ text-align: right;
+ width: 50px;
+ padding: 0;
+}
+
+.area_toolbar td.resize{
+ text-align: right;
+}
+/*
+.area_toolbar span{
+ line-height: 1px;
+ padding: 0;
+ margin: 0;
+}*/
+
+.area_toolbar span#resize_area{
+ cursor: nw-resize;
+ visibility: hidden;
+}
+
+/* toolbar buttons */
+.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
+ border: 0; margin: 0; padding: 0; background: transparent;
+ margin-top: 0;
+ margin-left: 1px;
+ padding: 0;
+}
+
+.editAreaButtonNormal {
+ border: 1px solid #ECE9D8 !important;
+ cursor: pointer;
+}
+
+.editAreaButtonOver {
+ border: 1px solid #0A246A !important;
+ cursor: pointer;
+ background-color: #B6BDD2;
+}
+
+.editAreaButtonDown {
+ cursor: pointer;
+ border: 1px solid #0A246A !important;
+ background-color: #8592B5;
+}
+
+.editAreaButtonSelected {
+ border: 1px solid #C0C0BB !important;
+ cursor: pointer;
+ background-color: #F4F2E8;
+}
+
+.editAreaButtonDisabled {
+ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+ -moz-opacity:0.3;
+ opacity: 0.3;
+ border: 1px solid #F0F0EE !important;
+ cursor: pointer;
+}
+
+.editAreaSeparatorLine {
+ margin: 1px 2px;
+ background-color: #C0C0BB;
+ width: 2px;
+ height: 18px;
+}
+
+/* waiting screen */
+#processing{
+ display: none;
+ background-color:#ECE9D8;
+ border: solid #888 1px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 100;
+ text-align: center;
+}
+
+#processing_text{
+ position:absolute;
+ left: 50%;
+ top: 50%;
+ width: 200px;
+ height: 20px;
+ margin-left: -100px;
+ margin-top: -10px;
+ text-align: center;
+}
+/* end */
+
+
+/**** tab browsing area ****/
+#tab_browsing_area{
+ display: none;
+ background-color: #CCC9A8;
+ border-top: 1px solid #888;
+ text-align: left;
+ margin: 0;
+}
+
+#tab_browsing_list {
+ padding: 0;
+ margin: 0;
+ list-style-type: none;
+ white-space: nowrap;
+}
+#tab_browsing_list li {
+ float: left;
+ margin: -1px;
+}
+#tab_browsing_list a {
+ position: relative;
+ display: block;
+ text-decoration: none;
+ float: left;
+ cursor: pointer;
+ line-height:14px;
+}
+
+#tab_browsing_list a span {
+ display: block;
+ color: #000;
+ background: #ECE9D8;
+ border: 1px solid #888;
+ border-width: 1px 1px 0;
+ text-align: center;
+ padding: 2px 2px 1px 4px;
+ position: relative; /*IE 6 hack */
+}
+
+#tab_browsing_list a b {
+ display: block;
+ border-bottom: 2px solid #617994;
+}
+
+#tab_browsing_list a .edited {
+ display: none;
+}
+
+#tab_browsing_list a.edited .edited {
+ display: inline;
+}
+
+#tab_browsing_list a img{
+ margin-left: 7px;
+}
+
+#tab_browsing_list a.edited img{
+ margin-left: 3px;
+}
+
+#tab_browsing_list a:hover span {
+ background: #F4F2E8;
+ border-color: #0A246A;
+}
+
+#tab_browsing_list .selected a span{
+ background: #046380;
+ color: #FFF;
+}
+
+
+#no_file_selected{
+ height: 100%;
+ width: 150%; /* Opera need more than 100% */
+ background: #CCC;
+ display: none;
+ z-index: 20;
+ position: absolute;
+}
+
+
+/*** Non-editable mode ***/
+.non_editable #editor
+{
+ border-width: 0 1px;
+}
+
+.non_editable .area_toolbar
+{
+ display: none;
+}
+
+/*** Auto completion ***/
+#auto_completion_area
+{
+ background: #FFF;
+ border: solid 1px #888;
+ position: absolute;
+ z-index: 15;
+ width: 280px;
+ height: 180px;
+ overflow: auto;
+ display:none;
+}
+
+#auto_completion_area a, #auto_completion_area a:visited
+{
+ display: block;
+ padding: 0 2px 1px;
+ color: #000;
+ text-decoration:none;
+}
+
+#auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
+{
+ background: #D6E1FE;
+ text-decoration:none;
+}
+
+#auto_completion_area ul
+{
+ margin: 0;
+ padding: 0;
+ list-style: none inside;
+}
+#auto_completion_area li
+{
+ padding: 0;
+}
+#auto_completion_area .prefix
+{
+ font-style: italic;
+ padding: 0 3px;
+}
\ No newline at end of file
diff --git a/includes/edit_area/edit_area.js b/includes/edit_area/edit_area.js
new file mode 100644
index 00000000..f288a702
--- /dev/null
+++ b/includes/edit_area/edit_area.js
@@ -0,0 +1,527 @@
+/******
+ *
+ * EditArea
+ * Developped by Christophe Dolivet
+ * Released under LGPL, Apache and BSD licenses (use the one you want)
+ *
+******/
+
+ function EditArea(){
+ var t=this;
+ t.error= false; // to know if load is interrrupt
+
+ t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"},
+ {popup_id: "edit_area_help", icon_id: "help"}];
+ t.plugins= {};
+
+ t.line_number=0;
+
+ parent.editAreaLoader.set_browser_infos(t); // navigator identification
+ // fix IE8 detection as we run in IE7 emulate mode through X-UA tag
+ if( t.isIE >= 8 )
+ t.isIE = 7;
+
+ t.last_selection={};
+ t.last_text_to_highlight="";
+ t.last_hightlighted_text= "";
+ t.syntax_list= [];
+ t.allready_used_syntax= {};
+ t.check_line_selection_timer= 50; // the timer delay for modification and/or selection change detection
+
+ t.textareaFocused= false;
+ t.highlight_selection_line= null;
+ t.previous= [];
+ t.next= [];
+ t.last_undo="";
+ t.files= {};
+ t.filesIdAssoc= {};
+ t.curr_file= '';
+ //t.loaded= false;
+ t.assocBracket={};
+ t.revertAssocBracket= {};
+ // bracket selection init
+ t.assocBracket["("]=")";
+ t.assocBracket["{"]="}";
+ t.assocBracket["["]="]";
+ for(var index in t.assocBracket){
+ t.revertAssocBracket[t.assocBracket[index]]=index;
+ }
+ t.is_editable= true;
+
+
+ /*t.textarea="";
+
+ t.state="declare";
+ t.code = []; // store highlight syntax for languagues*/
+ // font datas
+ t.lineHeight= 16;
+ /*t.default_font_family= "monospace";
+ t.default_font_size= 10;*/
+ t.tab_nb_char= 8; //nb of white spaces corresponding to a tabulation
+ if(t.isOpera)
+ t.tab_nb_char= 6;
+
+ t.is_tabbing= false;
+
+ t.fullscreen= {'isFull': false};
+
+ t.isResizing=false; // resize var
+
+ // init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation
+ t.id= area_id;
+ t.settings= editAreas[t.id]["settings"];
+
+ if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/))
+ {
+ t.tab_nb_char= t.settings['replace_tab_by_spaces'];
+ t.tabulation="";
+ for(var i=0; i0)
+ t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(",");
+
+ if(t.settings['syntax'])
+ t.allready_used_syntax[t.settings['syntax']]=true;
+
+
+ };
+ EditArea.prototype.init= function(){
+ var t=this, a, s=t.settings;
+ t.textarea = _$("textarea");
+ t.container = _$("container");
+ t.result = _$("result");
+ t.content_highlight = _$("content_highlight");
+ t.selection_field = _$("selection_field");
+ t.selection_field_text= _$("selection_field_text");
+ t.processing_screen = _$("processing");
+ t.editor_area = _$("editor");
+ t.tab_browsing_area = _$("tab_browsing_area");
+ t.test_font_size = _$("test_font_size");
+ a = t.textarea;
+
+ if(!s['is_editable'])
+ t.set_editable(false);
+
+ t.set_show_line_colors( s['show_line_colors'] );
+
+ if(syntax_selec= _$("syntax_selection"))
+ {
+ // set up syntax selection lsit in the toolbar
+ for(var i=0; i= '3' ) {
+ t.content_highlight.style.paddingLeft= "1px";
+ t.selection_field.style.paddingLeft= "1px";
+ t.selection_field_text.style.paddingLeft= "1px";
+ }
+
+ if(t.isIE && t.isIE < 8 ){
+ a.style.marginTop= "-1px";
+ }
+ /*
+ if(t.isOpera){
+ t.editor_area.style.position= "absolute";
+ }*/
+
+ if( t.isSafari ){
+ t.editor_area.style.position = "absolute";
+ a.style.marginLeft ="-3px";
+ if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
+ a.style.marginTop ="1px";
+ }
+
+ // si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
+ parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);} });
+
+ if(s['is_multi_files']!=false)
+ t.open_file({'id': t.curr_file, 'text': ''});
+
+ t.set_word_wrap( s['word_wrap'] );
+
+ setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10);
+ //start checkup routine
+ t.check_undo();
+ t.check_line_selection(true);
+ t.scroll_to_view();
+
+ for(var i in t.plugins){
+ if(typeof(t.plugins[i].onload)=="function")
+ t.plugins[i].onload();
+ }
+ if(s['fullscreen']==true)
+ t.toggle_full_screen(true);
+
+ parent.editAreaLoader.add_event(window, "resize", editArea.update_size);
+ parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size);
+ parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size);
+ parent.editAreaLoader.add_event(window, "unload", function(){
+ // in case where editAreaLoader have been already cleaned
+ if( parent.editAreaLoader )
+ {
+ parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size);
+ parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size);
+ }
+ if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){
+ editArea.execCommand("EA_unload");
+ }
+ });
+
+
+ /*date= new Date();
+ alert(date.getTime()- parent.editAreaLoader.start_time);*/
+ };
+
+
+
+ //called by the toggle_on
+ EditArea.prototype.update_size= function(){
+ var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop;
+
+ if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){
+ if(editArea.fullscreen['isFull']){
+ pd.getElementById("frame_"+editArea.id).style.width = pd.getElementsByTagName("html")[0].clientWidth + "px";
+ pd.getElementById("frame_"+editArea.id).style.height = pd.getElementsByTagName("html")[0].clientHeight + "px";
+ }
+
+ if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) )
+ {
+ editArea.tab_browsing_area.style.height = "0px";
+ editArea.tab_browsing_area.style.height = (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px";
+ }
+
+ height = d.body.offsetHeight - editArea.get_all_toolbar_height() - 4;
+ editArea.result.style.height = height +"px";
+
+ width = d.body.offsetWidth -2;
+ editArea.result.style.width = width+"px";
+ //alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight);
+
+ // check that the popups don't get out of the screen
+ for( i=0; i < editArea.inlinePopup.length; i++ )
+ {
+ popup = _$(editArea.inlinePopup[i]["popup_id"]);
+ maxLeft = d.body.offsetWidth - popup.offsetWidth;
+ maxTop = d.body.offsetHeight - popup.offsetHeight;
+ if( popup.offsetTop > maxTop )
+ popup.style.top = maxTop+"px";
+ if( popup.offsetLeft > maxLeft )
+ popup.style.left = maxLeft+"px";
+ }
+
+ editArea.manage_size( true );
+ editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
+ }
+ };
+
+
+ EditArea.prototype.manage_size= function(onlyOneTime){
+ if(!editAreas[this.id])
+ return false;
+
+ if(editAreas[this.id]["displayed"]==true && this.textareaFocused)
+ {
+ var area_height,resized= false;
+
+ //1) Manage display width
+ //1.1) Calc the new width to use for display
+ if( !this.settings['word_wrap'] )
+ {
+ var area_width= this.textarea.scrollWidth;
+ area_height= this.textarea.scrollHeight;
+ // bug on old opera versions
+ if(this.isOpera && this.isOpera < 9.6 ){
+ area_width=10000;
+ }
+ //1.2) the width is not the same, we must resize elements
+ if(this.textarea.previous_scrollWidth!=area_width)
+ {
+ this.container.style.width= area_width+"px";
+ this.textarea.style.width= area_width+"px";
+ this.content_highlight.style.width= area_width+"px";
+ this.textarea.previous_scrollWidth=area_width;
+ resized=true;
+ }
+ }
+ // manage wrap width
+ if( this.settings['word_wrap'] )
+ {
+ newW=this.textarea.offsetWidth;
+ if( this.isFirefox || this.isIE )
+ newW-=2;
+ if( this.isSafari )
+ newW-=6;
+ this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px";
+ }
+
+ //2) Manage display height
+ //2.1) Calc the new height to use for display
+ if( this.isOpera || this.isFirefox || this.isSafari ) {
+ area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 );
+ } else {
+ area_height = this.textarea.scrollHeight;
+ }
+ //2.2) the width is not the same, we must resize elements
+ if(this.textarea.previous_scrollHeight!=area_height)
+ {
+ this.container.style.height= (area_height+2)+"px";
+ this.textarea.style.height= area_height+"px";
+ this.content_highlight.style.height= area_height+"px";
+ this.textarea.previous_scrollHeight= area_height;
+ resized=true;
+ }
+
+ //3) if there is new lines, we add new line numbers in the line numeration area
+ if(this.last_selection["nb_line"] >= this.line_number)
+ {
+ var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100;
+ for( i = start+1; i < end; i++ )
+ {
+ newLines+=''+i+"
";
+ this.line_number++;
+ }
+ destDiv.innerHTML= destDiv.innerHTML + newLines;
+ if(this.settings['word_wrap']){
+ this.fixLinesHeight( this.textarea.value, start, -1 );
+ }
+ }
+
+ //4) be sure the text is well displayed
+ this.textarea.scrollTop="0px";
+ this.textarea.scrollLeft="0px";
+ if(resized==true){
+ this.scroll_to_view();
+ }
+ }
+
+ if(!onlyOneTime)
+ setTimeout("editArea.manage_size();", 100);
+ };
+
+ EditArea.prototype.execCommand= function(cmd, param){
+
+ for(var i in this.plugins){
+ if(typeof(this.plugins[i].execCommand)=="function"){
+ if(!this.plugins[i].execCommand(cmd, param))
+ return;
+ }
+ }
+ switch(cmd){
+ case "save":
+ if(this.settings["save_callback"].length>0)
+ eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);");
+ break;
+ case "load":
+ if(this.settings["load_callback"].length>0)
+ eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');");
+ break;
+ case "onchange":
+ if(this.settings["change_callback"].length>0)
+ eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');");
+ break;
+ case "EA_load":
+ if(this.settings["EA_load_callback"].length>0)
+ eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');");
+ break;
+ case "EA_unload":
+ if(this.settings["EA_unload_callback"].length>0)
+ eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');");
+ break;
+ case "toggle_on":
+ if(this.settings["EA_toggle_on_callback"].length>0)
+ eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');");
+ break;
+ case "toggle_off":
+ if(this.settings["EA_toggle_off_callback"].length>0)
+ eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');");
+ break;
+ case "re_sync":
+ if(!this.do_highlight)
+ break;
+ case "file_switch_on":
+ if(this.settings["EA_file_switch_on_callback"].length>0)
+ eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);");
+ break;
+ case "file_switch_off":
+ if(this.settings["EA_file_switch_off_callback"].length>0)
+ eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);");
+ break;
+ case "file_close":
+ if(this.settings["EA_file_close_callback"].length>0)
+ return eval("parent."+this.settings["EA_file_close_callback"]+"(param);");
+ break;
+
+ default:
+ if(typeof(eval("editArea."+cmd))=="function")
+ {
+ if(this.settings["debug"])
+ eval("editArea."+ cmd +"(param);");
+ else
+ try{eval("editArea."+ cmd +"(param);");}catch(e){};
+ }
+ }
+ };
+
+ EditArea.prototype.get_translation= function(word, mode){
+ if(mode=="template")
+ return parent.editAreaLoader.translate(word, this.settings["language"], mode);
+ else
+ return parent.editAreaLoader.get_word_translation(word, this.settings["language"]);
+ };
+
+ EditArea.prototype.add_plugin= function(plug_name, plug_obj){
+ for(var i=0; i ");
+ }
+ };
+
+ EditArea.prototype.load_script= function(url){
+ try{
+ script = document.createElement("script");
+ script.type = "text/javascript";
+ script.src = url;
+ script.charset= "UTF-8";
+ head = document.getElementsByTagName("head");
+ head[0].appendChild(script);
+ }catch(e){
+ document.write("\";\n", $sub_scripts);
+
+
+ // add the script and use a last compression
+ if( $this->param['compress'] )
+ {
+ $last_comp = array( 'ร' => 'this',
+ 'ร' => 'textarea',
+ 'ร' => 'function',
+ 'ร' => 'prototype',
+ 'ร
' => 'settings',
+ 'ร' => 'length',
+ 'ร' => 'style',
+ 'ร' => 'parent',
+ 'ร' => 'last_selection',
+ 'ร' => 'value',
+ 'ร' => 'true',
+ 'ร' => 'false'
+ /*,
+ 'ร' => '"',
+ 'ร' => "\n",
+ 'ร' => "\r"*/);
+ }
+ else
+ {
+ $last_comp = array();
+ }
+
+ $js_replace= '';
+ foreach( $last_comp as $key => $val )
+ $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')";
+
+ $this->datas.= sprintf("editAreaLoader.iframe_script= \"\"%s;\n",
+ str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ),
+ $js_replace);
+
+ if($this->load_all_plugins)
+ $this->datas.="editAreaLoader.all_plugins_loaded=true;\n";
+
+
+ // load the template
+ $this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html"));
+ // load the css
+ $this->datas.= sprintf("editAreaLoader.iframe_css= \"\";\n", $this->get_css_content("edit_area.css"));
+
+ // $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();";
+
+ }
+
+ function send_datas()
+ {
+ if($this->param['debug']){
+ $header=sprintf("/* USE PHP COMPRESSION\n");
+ $header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas));
+ if($this->use_gzip){
+ $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP);
+ $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas));
+ $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0);
+ }else{
+ $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0);
+ }
+ $header.=sprintf(", reduced by %s%%\n", $ratio);
+ $header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time);
+ $header.=sprintf("%s\n", implode("\n", $this->infos));
+ $header.=sprintf("*/\n");
+ $this->datas= $header.$this->datas;
+ }
+ $mtime= time(); // ensure that the 2 disk files will have the same update time
+ // generate gzip file and cahce it if using disk cache
+ if($this->use_gzip){
+ $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP);
+ if($this->param['use_disk_cache'])
+ $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime);
+ }
+
+ // generate full js file and cache it if using disk cache
+ if($this->param['use_disk_cache'])
+ $this->file_put_contents($this->full_cache_file, $this->datas, $mtime);
+
+ // generate output
+ if($this->use_gzip)
+ echo $this->gzip_datas;
+ else
+ echo $this->datas;
+
+// die;
+ }
+
+
+ function get_content($end_uri)
+ {
+ $end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security)
+ $file= $this->path.$end_uri;
+ if(file_exists($file)){
+ $this->infos[]=sprintf("'%s' loaded", $end_uri);
+ /*$fd = fopen($file, 'rb');
+ $content = fread($fd, filesize($file));
+ fclose($fd);
+ return $content;*/
+ return $this->file_get_contents($file);
+ }else{
+ $this->infos[]=sprintf("'%s' not loaded", $end_uri);
+ return "";
+ }
+ }
+
+ function get_javascript_content($end_uri)
+ {
+ $val=$this->get_content($end_uri);
+
+ $this->compress_javascript($val);
+ $this->prepare_string_for_quotes($val);
+ return $val;
+ }
+
+ function compress_javascript(&$code)
+ {
+ if($this->param['compress'])
+ {
+ // remove all comments
+ // (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))
+ $code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code);
+ // remove line return, empty line and tabulation
+ $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code);
+ // add line break before "else" otherwise navigators can't manage to parse the file
+ $code= preg_replace('/(\b(else)\b)/', "\n$1", $code);
+ // remove unnecessary spaces
+ $code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code);
+ }
+ }
+
+ function get_css_content($end_uri){
+ $code=$this->get_content($end_uri);
+ // remove comments
+ $code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code);
+ // remove spaces
+ $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code);
+ // remove spaces
+ $code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code);
+
+ $this->prepare_string_for_quotes($code);
+ return $code;
+ }
+
+ function get_html_content($end_uri){
+ $code=$this->get_content($end_uri);
+ //$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code);
+ $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code);
+ $this->prepare_string_for_quotes($code);
+ return $code;
+ }
+
+ function prepare_string_for_quotes(&$str){
+ // prepare the code to be putted into quotes
+ /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/");
+ $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/
+ $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/");
+ if($this->param['compress'])
+ $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n');
+ else
+ $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\"");
+ $str= preg_replace($pattern, $replace, $str);
+ }
+
+ function replace_scripts($var, $param1, $param2)
+ {
+ $this->$var=stripslashes($param2);
+ return $param1."[];";
+ }
+
+ /* for php version that have not thoses functions */
+ function file_get_contents($file)
+ {
+ $fd = fopen($file, 'rb');
+ $content = fread($fd, filesize($file));
+ fclose($fd);
+ $this->file_loaded_size+= strlen($content);
+ return $content;
+ }
+
+ function file_put_contents($file, &$content, $mtime=-1)
+ {
+ if($mtime==-1)
+ $mtime=time();
+ $fp = @fopen($file, "wb");
+ if ($fp) {
+ fwrite($fp, $content);
+ fclose($fp);
+ touch($file, $mtime);
+ return true;
+ }
+ return false;
+ }
+
+ function get_microtime()
+ {
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+ }
+ }
+?>
diff --git a/includes/edit_area/edit_area_full.gz b/includes/edit_area/edit_area_full.gz
new file mode 100644
index 00000000..29bcc50e
Binary files /dev/null and b/includes/edit_area/edit_area_full.gz differ
diff --git a/includes/edit_area/edit_area_full.js b/includes/edit_area/edit_area_full.js
new file mode 100644
index 00000000..267574c3
--- /dev/null
+++ b/includes/edit_area/edit_area_full.js
@@ -0,0 +1,38 @@
+ function EAL(){var t=this;t.version="0.8.2";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.syntax_display_name={'basic':'Basic','brainfuck':'Brainfuck','c':'C','coldfusion':'Coldfusion','cpp':'CPP','css':'CSS','html':'HTML','java':'Java','js':'Javascript','pas':'Pascal','perl':'Perl','php':'Php','python':'Python','robotstxt':'Robots txt','ruby':'Ruby','sql':'SQL','tsql':'T-SQL','vb':'Visual Basic','xml':'XML'};t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"begin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true;
+else t.isValidBrowser=false;t.set_base_url();for(var i=0;i0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="loaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+=" ";html+=" ";html+="{$toggle}
";}if(eAs[id]["settings"]["debug"])html+=" ";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
+else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}var area=eAs[id];for(i=0;i ';}for(i=0;i ';t.iframe_script+='';}if(!t.iframe_css){t.iframe_css=" ";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content);
+else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);}
+else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);}
+else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;}
+else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");}
+else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i';html+=' ';return html;},get_control_html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i ";case "|":case "separator":return ' ';case "select_font":html="";html+="{$font_size} ";si=[8,9,10,11,12,14];for(i=0;i"+si[i]+" pt";}html+=" ";return html;case "syntax_selection":html="";html+="{$syntax_selection} ";html+=" ";return html;}return "["+button_name+"] ";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest();
+else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
+else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText;
+else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang);
+else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write(' ');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);}
+else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler);
+else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]);
+else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
+else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;}
+else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;case "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);');
+else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);}
+else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x0){results=results.concat(result);}}
+else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;}
+else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;}
+else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);}
+else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];}
+else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_top);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(nav.isOpera&&nav.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(nav.isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.body.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}if(t&&t.id){setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);}};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded";
+ EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4);if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded";
+ EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}}
+else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded";
+var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "".replace(/ร/g,'this').replace(/ร/g,'textarea').replace(/ร/g,'function').replace(/ร/g,'prototype').replace(/ร
/g,'settings').replace(/ร/g,'length').replace(/ร/g,'style').replace(/ร/g,'parent').replace(/ร/g,'last_selection').replace(/ร/g,'value').replace(/ร/g,'true').replace(/ร/g,'false');
+editAreaLoader.template= " EditArea [__CSSRULES__] [__JSCODE__] ";
+editAreaLoader.iframe_css= "";
diff --git a/includes/edit_area/edit_area_functions.js b/includes/edit_area/edit_area_functions.js
new file mode 100644
index 00000000..cccbe243
--- /dev/null
+++ b/includes/edit_area/edit_area_functions.js
@@ -0,0 +1,1202 @@
+ //replace tabulation by the good number of white spaces
+ EditArea.prototype.replace_tab= function(text){
+ return text.replace(/((\n?)([^\t\n]*)\t)/gi, editArea.smartTab); // slower than simple replace...
+ };
+
+ // call by the replace_tab function
+ EditArea.prototype.smartTab= function(){
+ val=" ";
+ return EditArea.prototype.smartTab.arguments[2] + EditArea.prototype.smartTab.arguments[3] + val.substr(0, editArea.tab_nb_char - (EditArea.prototype.smartTab.arguments[3].length)%editArea.tab_nb_char);
+ };
+
+ EditArea.prototype.show_waiting_screen= function(){
+ width = this.editor_area.offsetWidth;
+ height = this.editor_area.offsetHeight;
+ if( !(this.isIE && this.isIE<6) )
+ {
+ width -= 2;
+ height -= 2;
+ }
+ this.processing_screen.style.display= "block";
+ this.processing_screen.style.width = width+"px";
+ this.processing_screen.style.height = height+"px";
+ this.waiting_screen_displayed = true;
+ };
+
+ EditArea.prototype.hide_waiting_screen= function(){
+ this.processing_screen.style.display="none";
+ this.waiting_screen_displayed= false;
+ };
+
+ EditArea.prototype.add_style= function(styles){
+ if(styles.length>0){
+ newcss = document.createElement("style");
+ newcss.type="text/css";
+ newcss.media="all";
+ if(newcss.styleSheet){ // IE
+ newcss.styleSheet.cssText = styles;
+ } else { // W3C
+ newcss.appendChild(document.createTextNode(styles));
+ }
+ document.getElementsByTagName("head")[0].appendChild(newcss);
+ }
+ };
+
+ EditArea.prototype.set_font= function(family, size){
+ var t=this, a=this.textarea, s=this.settings, elem_font, i, elem;
+ // list all elements concerned by font changes
+ var elems= ["textarea", "content_highlight", "cursor_pos", "end_bracket", "selection_field", "selection_field_text", "line_number"];
+
+ if(family && family!="")
+ s["font_family"]= family;
+ if(size && size>0)
+ s["font_size"] = size;
+ if( t.isOpera && t.isOpera < 9.6 ) // opera<9.6 can't manage non monospace font
+ s['font_family']="monospace";
+
+ // update the select tag
+ if( elem_font = _$("area_font_size") )
+ {
+ for( i = 0; i < elem_font.length; i++ )
+ {
+ if( elem_font.options[i].value && elem_font.options[i].value == s["font_size"] )
+ elem_font.options[i].selected=true;
+ }
+ }
+
+ /*
+ * somethimes firefox has rendering mistake with non-monospace font for text width in textarea vs in div for changing font size (eg: verdana change between 11pt to 12pt)
+ * => looks like a browser internal random bug as text width can change while content_highlight is updated
+ * we'll check if the font-size produce the same text width inside textarea and div and if not, we'll increment the font-size
+ *
+ * This is an ugly fix
+ */
+ if( t.isFirefox )
+ {
+ var nbTry = 3;
+ do {
+ var div1 = document.createElement( 'div' ), text1 = document.createElement( 'textarea' );
+ var styles = {
+ width: '40px',
+ overflow: 'scroll',
+ zIndex: 50,
+ visibility: 'hidden',
+ fontFamily: s["font_family"],
+ fontSize: s["font_size"]+"pt",
+ lineHeight: t.lineHeight+"px",
+ padding: '0',
+ margin: '0',
+ border: 'none',
+ whiteSpace: 'nowrap'
+ };
+ var diff, changed = false;
+ for( i in styles )
+ {
+ div1.style[ i ] = styles[i];
+ text1.style[ i ] = styles[i];
+ }
+ // no wrap for this text
+ text1.wrap = 'off';
+ text1.setAttribute('wrap', 'off');
+ t.container.appendChild( div1 );
+ t.container.appendChild( text1 );
+ // try to make FF to bug
+ div1.innerHTML = text1.value = 'azertyuiopqsdfghjklm';
+ div1.innerHTML = text1.value = text1.value+'wxcvbn^p*รน$!:;,,';
+ diff = text1.scrollWidth - div1.scrollWidth;
+
+ // firefox return here a diff of 1 px between equals scrollWidth (can't explain)
+ if( Math.abs( diff ) >= 2 )
+ {
+ s["font_size"]++;
+ changed = true;
+ }
+ t.container.removeChild( div1 );
+ t.container.removeChild( text1 );
+ nbTry--;
+ }while( changed && nbTry > 0 );
+ }
+
+
+ // calc line height
+ elem = t.test_font_size;
+ elem.style.fontFamily = ""+s["font_family"];
+ elem.style.fontSize = s["font_size"]+"pt";
+ elem.innerHTML = "0";
+ t.lineHeight = elem.offsetHeight;
+
+ // update font for all concerned elements
+ for( i=0; i tags
+ t.add_style("pre{font-family:"+s["font_family"]+"}");
+
+ // old opera and IE>=8 doesn't update font changes to the textarea
+ if( ( t.isOpera && t.isOpera < 9.6 ) || t.isIE >= 8 )
+ {
+ var parNod = a.parentNode, nxtSib = a.nextSibling, start= a.selectionStart, end= a.selectionEnd;
+ parNod.removeChild(a);
+ parNod.insertBefore(a, nxtSib);
+ t.area_select(start, end-start);
+ }
+
+ // force update of selection field
+ this.focus();
+ this.update_size();
+ this.check_line_selection();
+ };
+
+ EditArea.prototype.change_font_size= function(){
+ var size=_$("area_font_size").value;
+ if(size>0)
+ this.set_font("", size);
+ };
+
+
+ EditArea.prototype.open_inline_popup= function(popup_id){
+ this.close_all_inline_popup();
+ var popup= _$(popup_id);
+ var editor= _$("editor");
+
+ // search matching icon
+ for(var i=0; i lines.length)
+ start= this.textarea.value.length;
+ else{
+ for(var i=0; i0){
+ //alert(miss_top);
+ zone.scrollTop= zone.scrollTop + miss_top;
+ }else if( zone.scrollTop > cursor_pos_top){
+ // when erase all the content -> does'nt scroll back to the top
+ //alert("else: "+cursor_pos_top);
+ zone.scrollTop= cursor_pos_top;
+ }
+
+ // manage left scroll
+ //var cursor_pos_left= parseInt(_$("cursor_pos").style.left.replace("px",""));
+ var cursor_pos_left= _$("cursor_pos").cursor_left;
+ var max_width_visible= zone.clientWidth + zone.scrollLeft;
+ var miss_left= cursor_pos_left + 10 - max_width_visible;
+ if(miss_left>0){
+ zone.scrollLeft= zone.scrollLeft + miss_left + 50;
+ }else if( zone.scrollLeft > cursor_pos_left){
+ zone.scrollLeft= cursor_pos_left ;
+ }else if( zone.scrollLeft == 45){
+ // show the line numbers if textarea align to it's left
+ zone.scrollLeft=0;
+ }
+ };
+
+ EditArea.prototype.check_undo= function(only_once){
+ if(!editAreas[this.id])
+ return false;
+ if(this.textareaFocused && editAreas[this.id]["displayed"]==true){
+ var text=this.textarea.value;
+ if(this.previous.length<=1)
+ this.switchClassSticky(_$("undo"), 'editAreaButtonDisabled', true);
+
+ if(!this.previous[this.previous.length-1] || this.previous[this.previous.length-1]["text"] != text){
+ this.previous.push({"text": text, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd});
+ if(this.previous.length > this.settings["max_undo"]+1)
+ this.previous.shift();
+
+ }
+ if(this.previous.length >= 2)
+ this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);
+ }
+
+ if(!only_once)
+ setTimeout("editArea.check_undo()", 3000);
+ };
+
+ EditArea.prototype.undo= function(){
+ //alert("undo"+this.previous.length);
+ if(this.previous.length > 0)
+ {
+ this.getIESelection();
+ // var pos_cursor=this.textarea.selectionStart;
+ this.next.push( { "text": this.textarea.value, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd } );
+ var prev= this.previous.pop();
+ if( prev["text"] == this.textarea.value && this.previous.length > 0 )
+ prev =this.previous.pop();
+ this.textarea.value = prev["text"];
+ this.last_undo = prev["text"];
+ this.area_select(prev["selStart"], prev["selEnd"]-prev["selStart"]);
+ this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
+ this.resync_highlight(true);
+ //alert("undo"+this.previous.length);
+ this.check_file_changes();
+ }
+ };
+
+ EditArea.prototype.redo= function(){
+ if(this.next.length > 0)
+ {
+ /*this.getIESelection();*/
+ //var pos_cursor=this.textarea.selectionStart;
+ var next= this.next.pop();
+ this.previous.push(next);
+ this.textarea.value= next["text"];
+ this.last_undo= next["text"];
+ this.area_select(next["selStart"], next["selEnd"]-next["selStart"]);
+ this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);
+ this.resync_highlight(true);
+ this.check_file_changes();
+ }
+ if( this.next.length == 0)
+ this.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
+ };
+
+ EditArea.prototype.check_redo= function(){
+ if(editArea.next.length == 0 || editArea.textarea.value!=editArea.last_undo){
+ editArea.next= []; // undo the ability to use "redo" button
+ editArea.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
+ }
+ else
+ {
+ this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
+ }
+ };
+
+
+ // functions that manage icons roll over, disabled, etc...
+ EditArea.prototype.switchClass = function(element, class_name, lock_state) {
+ var lockChanged = false;
+
+ if (typeof(lock_state) != "undefined" && element != null) {
+ element.classLock = lock_state;
+ lockChanged = true;
+ }
+
+ if (element != null && (lockChanged || !element.classLock)) {
+ element.oldClassName = element.className;
+ element.className = class_name;
+ }
+ };
+
+ EditArea.prototype.restoreAndSwitchClass = function(element, class_name) {
+ if (element != null && !element.classLock) {
+ this.restoreClass(element);
+ this.switchClass(element, class_name);
+ }
+ };
+
+ EditArea.prototype.restoreClass = function(element) {
+ if (element != null && element.oldClassName && !element.classLock) {
+ element.className = element.oldClassName;
+ element.oldClassName = null;
+ }
+ };
+
+ EditArea.prototype.setClassLock = function(element, lock_state) {
+ if (element != null)
+ element.classLock = lock_state;
+ };
+
+ EditArea.prototype.switchClassSticky = function(element, class_name, lock_state) {
+ var lockChanged = false;
+ if (typeof(lock_state) != "undefined" && element != null) {
+ element.classLock = lock_state;
+ lockChanged = true;
+ }
+
+ if (element != null && (lockChanged || !element.classLock)) {
+ element.className = class_name;
+ element.oldClassName = class_name;
+ }
+ };
+
+ //make the "page up" and "page down" buttons works correctly
+ EditArea.prototype.scroll_page= function(params){
+ var dir= params["dir"], shift_pressed= params["shift"];
+ var lines= this.textarea.value.split("\n");
+ var new_pos=0, length=0, char_left=0, line_nb=0, curLine=0;
+ var toScrollAmount = _$("result").clientHeight -30;
+ var nbLineToScroll = 0, diff= 0;
+
+ if(dir=="up"){
+ nbLineToScroll = Math.ceil( toScrollAmount / this.lineHeight );
+
+ // fix number of line to scroll
+ for( i = this.last_selection["line_start"]; i - diff > this.last_selection["line_start"] - nbLineToScroll ; i-- )
+ {
+ if( elem = _$('line_'+ i) )
+ {
+ diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
+ }
+ }
+ nbLineToScroll -= diff;
+
+ if(this.last_selection["selec_direction"]=="up"){
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]-nbLineToScroll, lines.length); line_nb++){
+ new_pos+= lines[line_nb].length + 1;
+ }
+ char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
+ if(shift_pressed)
+ length=this.last_selection["selectionEnd"]-new_pos-char_left;
+ this.area_select(new_pos+char_left, length);
+ view="top";
+ }else{
+ view="bottom";
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-1-nbLineToScroll, lines.length); line_nb++){
+ new_pos+= lines[line_nb].length + 1;
+ }
+ char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
+ if(shift_pressed){
+ //length=this.last_selection["selectionEnd"]-new_pos-char_left;
+ start= Math.min(this.last_selection["selectionStart"], new_pos+char_left);
+ length= Math.max(new_pos+char_left, this.last_selection["selectionStart"] )- start ;
+ if(new_pos+char_left < this.last_selection["selectionStart"])
+ view="top";
+ }else
+ start=new_pos+char_left;
+ this.area_select(start, length);
+
+ }
+ }
+ else
+ {
+ var nbLineToScroll= Math.floor( toScrollAmount / this.lineHeight );
+ // fix number of line to scroll
+ for( i = this.last_selection["line_start"]; i + diff < this.last_selection["line_start"] + nbLineToScroll ; i++ )
+ {
+ if( elem = _$('line_'+ i) )
+ {
+ diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
+ }
+ }
+ nbLineToScroll -= diff;
+
+ if(this.last_selection["selec_direction"]=="down"){
+ view="bottom";
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-2+nbLineToScroll, lines.length); line_nb++){
+ if(line_nb==this.last_selection["line_start"]-1)
+ char_left= this.last_selection["selectionStart"] -new_pos;
+ new_pos+= lines[line_nb].length + 1;
+
+ }
+ if(shift_pressed){
+ length=Math.abs(this.last_selection["selectionStart"]-new_pos);
+ length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]);
+ //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
+ this.area_select(Math.min(this.last_selection["selectionStart"], new_pos), length);
+ }else{
+ this.area_select(new_pos+char_left, 0);
+ }
+
+ }else{
+ view="top";
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+nbLineToScroll-1, lines.length, lines.length); line_nb++){
+ if(line_nb==this.last_selection["line_start"]-1)
+ char_left= this.last_selection["selectionStart"] -new_pos;
+ new_pos+= lines[line_nb].length + 1;
+ }
+ if(shift_pressed){
+ length=Math.abs(this.last_selection["selectionEnd"]-new_pos-char_left);
+ length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"])- char_left-1;
+ //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
+ this.area_select(Math.min(this.last_selection["selectionEnd"], new_pos+char_left), length);
+ if(new_pos+char_left > this.last_selection["selectionEnd"])
+ view="bottom";
+ }else{
+ this.area_select(new_pos+char_left, 0);
+ }
+
+ }
+ }
+ //console.log( new_pos, char_left, length, nbLineToScroll, toScrollAmount, _$("result").clientHeigh );
+ this.check_line_selection();
+ this.scroll_to_view(view);
+ };
+
+ EditArea.prototype.start_resize= function(e){
+ parent.editAreaLoader.resize["id"] = editArea.id;
+ parent.editAreaLoader.resize["start_x"] = (e)? e.pageX : event.x + document.body.scrollLeft;
+ parent.editAreaLoader.resize["start_y"] = (e)? e.pageY : event.y + document.body.scrollTop;
+ if(editArea.isIE)
+ {
+ editArea.textarea.focus();
+ editArea.getIESelection();
+ }
+ parent.editAreaLoader.resize["selectionStart"] = editArea.textarea.selectionStart;
+ parent.editAreaLoader.resize["selectionEnd"] = editArea.textarea.selectionEnd;
+ parent.editAreaLoader.start_resize_area();
+ };
+
+ EditArea.prototype.toggle_full_screen= function(to){
+ var t=this, p=parent, a=t.textarea, html, frame, selStart, selEnd, old, icon;
+ if(typeof(to)=="undefined")
+ to= !t.fullscreen['isFull'];
+ old = t.fullscreen['isFull'];
+ t.fullscreen['isFull']= to;
+ icon = _$("fullscreen");
+ selStart = t.textarea.selectionStart;
+ selEnd = t.textarea.selectionEnd;
+ html = p.document.getElementsByTagName("html")[0];
+ frame = p.document.getElementById("frame_"+t.id);
+
+ if(to && to!=old)
+ { // toogle on fullscreen
+
+ t.fullscreen['old_overflow'] = p.get_css_property(html, "overflow");
+ t.fullscreen['old_height'] = p.get_css_property(html, "height");
+ t.fullscreen['old_width'] = p.get_css_property(html, "width");
+ t.fullscreen['old_scrollTop'] = html.scrollTop;
+ t.fullscreen['old_scrollLeft'] = html.scrollLeft;
+ t.fullscreen['old_zIndex'] = p.get_css_property(frame, "z-index");
+ if(t.isOpera){
+ html.style.height = "100%";
+ html.style.width = "100%";
+ }
+ html.style.overflow = "hidden";
+ html.scrollTop = 0;
+ html.scrollLeft = 0;
+
+ frame.style.position = "absolute";
+ frame.style.width = html.clientWidth+"px";
+ frame.style.height = html.clientHeight+"px";
+ frame.style.display = "block";
+ frame.style.zIndex = "999999";
+ frame.style.top = "0px";
+ frame.style.left = "0px";
+
+ // if the iframe was in a div with position absolute, the top and left are the one of the div,
+ // so I fix it by seeing at witch position the iframe start and correcting it
+ frame.style.top = "-"+p.calculeOffsetTop(frame)+"px";
+ frame.style.left = "-"+p.calculeOffsetLeft(frame)+"px";
+
+ // parent.editAreaLoader.execCommand(t.id, "update_size();");
+ // var body=parent.document.getElementsByTagName("body")[0];
+ // body.appendChild(frame);
+
+ t.switchClassSticky(icon, 'editAreaButtonSelected', false);
+ t.fullscreen['allow_resize']= t.resize_allowed;
+ t.allow_resize(false);
+
+ //t.area_select(selStart, selEnd-selStart);
+
+
+ // opera can't manage to do a direct size update
+ if(t.isFirefox){
+ p.editAreaLoader.execCommand(t.id, "update_size();");
+ t.area_select(selStart, selEnd-selStart);
+ t.scroll_to_view();
+ t.focus();
+ }else{
+ setTimeout("parent.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10);
+ }
+
+
+ }
+ else if(to!=old)
+ { // toogle off fullscreen
+ frame.style.position="static";
+ frame.style.zIndex= t.fullscreen['old_zIndex'];
+
+ if(t.isOpera)
+ {
+ html.style.height = "auto";
+ html.style.width = "auto";
+ html.style.overflow = "auto";
+ }
+ else if(t.isIE && p!=top)
+ { // IE doesn't manage html overflow in frames like in normal page...
+ html.style.overflow = "auto";
+ }
+ else
+ {
+ html.style.overflow = t.fullscreen['old_overflow'];
+ }
+ html.scrollTop = t.fullscreen['old_scrollTop'];
+ html.scrollLeft = t.fullscreen['old_scrollLeft'];
+
+ p.editAreaLoader.hide(t.id);
+ p.editAreaLoader.show(t.id);
+
+ t.switchClassSticky(icon, 'editAreaButtonNormal', false);
+ if(t.fullscreen['allow_resize'])
+ t.allow_resize(t.fullscreen['allow_resize']);
+ if(t.isFirefox){
+ t.area_select(selStart, selEnd-selStart);
+ setTimeout("editArea.scroll_to_view();", 10);
+ }
+
+ //p.editAreaLoader.remove_event(p.window, "resize", editArea.update_size);
+ }
+
+ };
+
+ EditArea.prototype.allow_resize= function(allow){
+ var resize= _$("resize_area");
+ if(allow){
+
+ resize.style.visibility="visible";
+ parent.editAreaLoader.add_event(resize, "mouseup", editArea.start_resize);
+ }else{
+ resize.style.visibility="hidden";
+ parent.editAreaLoader.remove_event(resize, "mouseup", editArea.start_resize);
+ }
+ this.resize_allowed= allow;
+ };
+
+
+ EditArea.prototype.change_syntax= function(new_syntax, is_waiting){
+ // alert("cahnge to "+new_syntax);
+ // the syntax is the same
+ if(new_syntax==this.settings['syntax'])
+ return true;
+
+ // check that the syntax is one allowed
+ var founded= false;
+ for(var i=0; i ";
+ elem.innerHTML= "* "+ this.files[id]['title'] + close +" ";
+ _$('tab_browsing_list').appendChild(elem);
+ var elem= document.createElement('text');
+ this.update_size();
+ }
+
+ // open file callback (for plugin)
+ if(id!="")
+ this.execCommand('file_open', this.files[id]);
+
+ this.switch_to_file(id, true);
+ return true;
+ }
+ else
+ return false;
+ };
+
+ // close the given file
+ EditArea.prototype.close_file= function(id){
+ if(this.files[id])
+ {
+ this.save_file(id);
+
+ // close file callback
+ if(this.execCommand('file_close', this.files[id])!==false)
+ {
+ // remove the tab in the toolbar
+ var li= _$(this.files[id]['html_id']);
+ li.parentNode.removeChild(li);
+ // select a new file
+ if(id== this.curr_file)
+ {
+ var next_file= "";
+ var is_next= false;
+ for(var i in this.files)
+ {
+ if( is_next )
+ {
+ next_file = i;
+ break;
+ }
+ else if( i == id )
+ is_next = true;
+ else
+ next_file = i;
+ }
+ // display the next file
+ this.switch_to_file(next_file);
+ }
+ // clear datas
+ delete (this.files[id]);
+ this.update_size();
+ }
+ }
+ };
+
+ // backup current file datas
+ EditArea.prototype.save_file= function(id){
+ var t= this, save, a_links, a_selects, save_butt, img, i;
+ if(t.files[id])
+ {
+ var save= t.files[id];
+ save['last_selection'] = t.last_selection;
+ save['last_text_to_highlight'] = t.last_text_to_highlight;
+ save['last_hightlighted_text'] = t.last_hightlighted_text;
+ save['previous'] = t.previous;
+ save['next'] = t.next;
+ save['last_undo'] = t.last_undo;
+ save['smooth_selection'] = t.smooth_selection;
+ save['do_highlight'] = t.do_highlight;
+ save['syntax'] = t.settings['syntax'];
+ save['text'] = t.textarea.value;
+ save['scroll_top'] = t.result.scrollTop;
+ save['scroll_left'] = t.result.scrollLeft;
+ save['selection_start'] = t.last_selection["selectionStart"];
+ save['selection_end'] = t.last_selection["selectionEnd"];
+ save['font_size'] = t.settings["font_size"];
+ save['font_family'] = t.settings["font_family"];
+ save['word_wrap'] = t.settings["word_wrap"];
+ save['toolbar'] = {'links':{}, 'selects': {}};
+
+ // save toolbar buttons state for fileSpecific buttons
+ a_links= _$("toolbar_1").getElementsByTagName("a");
+ for( i=0; i heavy CPU use)
+ ,min_width: 400
+ ,min_height: 125
+ ,replace_tab_by_spaces: false
+ ,allow_toggle: true // true or false
+ ,language: "en"
+ ,syntax: ""
+ ,syntax_selection_allow: "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
+ ,display: "onload" // onload or later
+ ,max_undo: 30
+ ,browsers: "known" // all or known
+ ,plugins: "" // comma separated plugin list
+ ,gecko_spellcheck: false // enable/disable by default the gecko_spellcheck
+ ,fullscreen: false
+ ,is_editable: true
+ ,cursor_position: "begin"
+ ,word_wrap: false // define if the text is wrapped of not in the textarea
+ ,autocompletion: false // NOT IMPLEMENTED
+ ,load_callback: "" // click on load button (function name)
+ ,save_callback: "" // click on save button (function name)
+ ,change_callback: "" // textarea onchange trigger (function name)
+ ,submit_callback: "" // form submited (function name)
+ ,EA_init_callback: "" // EditArea initiliazed (function name)
+ ,EA_delete_callback: "" // EditArea deleted (function name)
+ ,EA_load_callback: "" // EditArea fully loaded and displayed (function name)
+ ,EA_unload_callback: "" // EditArea delete while being displayed (function name)
+ ,EA_toggle_on_callback: "" // EditArea toggled on (function name)
+ ,EA_toggle_off_callback: "" // EditArea toggled off (function name)
+ ,EA_file_switch_on_callback: "" // a new tab is selected (called for the newly selected file)
+ ,EA_file_switch_off_callback: "" // a new tab is selected (called for the previously selected file)
+ ,EA_file_close_callback: "" // close a tab
+ };
+
+ t.advanced_buttons = [
+ // id, button img, command (it will try to find the translation of "id"), is_file_specific
+ ['new_document', 'newdocument.gif', 'new_document', false],
+ ['search', 'search.gif', 'show_search', false],
+ ['go_to_line', 'go_to_line.gif', 'go_to_line', false],
+ ['undo', 'undo.gif', 'undo', true],
+ ['redo', 'redo.gif', 'redo', true],
+ ['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode', true],
+ ['reset_highlight', 'reset_highlight.gif', 'resync_highlight', true],
+ ['highlight', 'highlight.gif','change_highlight', true],
+ ['help', 'help.gif', 'show_help', false],
+ ['save', 'save.gif', 'save', false],
+ ['load', 'load.gif', 'load', false],
+ ['fullscreen', 'fullscreen.gif', 'toggle_full_screen', false],
+ ['word_wrap', 'word_wrap.gif', 'toggle_word_wrap', true],
+ ['autocompletion', 'autocompletion.gif', 'toggle_autocompletion', true]
+ ];
+
+ // navigator identification
+ t.set_browser_infos(t);
+
+ if(t.isIE>=6 || t.isGecko || ( t.isWebKit && !t.isSafari<3 ) || t.isOpera>=9 || t.isCamino )
+ t.isValidBrowser=true;
+ else
+ t.isValidBrowser=false;
+
+ t.set_base_url();
+
+ for(var i=0; i delete the previous one
+ if(editAreas[s["id"]])
+ t.delete_instance(s["id"]);
+
+ // init settings
+ for(i in t.default_settings){
+ if(typeof(s[i])=="undefined")
+ s[i]=t.default_settings[i];
+ }
+
+ if(s["browsers"]=="known" && t.isValidBrowser==false){
+ return;
+ }
+
+ if(s["begin_toolbar"].length>0)
+ s["toolbar"]= s["begin_toolbar"] +","+ s["toolbar"];
+ if(s["end_toolbar"].length>0)
+ s["toolbar"]= s["toolbar"] +","+ s["end_toolbar"];
+ s["tab_toolbar"]= s["toolbar"].replace(/ /g,"").split(",");
+
+ s["plugins"]= s["plugins"].replace(/ /g,"").split(",");
+ for(i=0; i0){
+ s["syntax"]=s["syntax"].toLowerCase();
+ t.load_script(t.baseURL + "reg_syntax/"+ s["syntax"] + ".js");
+ }
+ //alert(this.template);
+
+ editAreas[s["id"]]= {"settings": s};
+ editAreas[s["id"]]["displayed"]=false;
+ editAreas[s["id"]]["hidden"]=false;
+
+ //if(settings["display"]=="onload")
+ t.start(s["id"]);
+ },
+
+ // delete an instance of an EditArea
+ delete_instance : function(id){
+ var d=document,fs=window.frames,span,iframe;
+ editAreaLoader.execCommand(id, "EA_delete");
+ if(fs["frame_"+id] && fs["frame_"+id].editArea)
+ {
+ if(editAreas[id]["displayed"])
+ editAreaLoader.toggle(id, "off");
+ fs["frame_"+id].editArea.execCommand("EA_unload");
+ }
+
+ // remove toggle infos and debug textarea
+ span= d.getElementById("EditAreaArroundInfos_"+id);
+ if(span)
+ span.parentNode.removeChild(span);
+
+ // remove the iframe
+ iframe= d.getElementById("frame_"+id);
+ if(iframe){
+ iframe.parentNode.removeChild(iframe);
+ //delete iframe;
+ try {
+ delete fs["frame_"+id];
+ } catch (e) {// Do nothing
+ }
+ }
+
+ delete editAreas[id];
+ },
+
+
+ start : function(id){
+ var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;
+
+ // check that the window is loaded
+ if(t.win!="loaded"){
+ setTimeout("editAreaLoader.start('"+id+"');", 50);
+ return;
+ }
+
+ // check that all needed scripts are loaded
+ for( i in t.waiting_loading){
+ if(t.waiting_loading[i]!="loaded" && typeof(t.waiting_loading[i])!="function"){
+ setTimeout("editAreaLoader.start('"+id+"');", 50);
+ return;
+ }
+ }
+
+ // wait until language and syntax files are loaded
+ if(!t.lang[editAreas[id]["settings"]["language"]] || (editAreas[id]["settings"]["syntax"].length>0 && !t.load_syntax[editAreas[id]["settings"]["syntax"]]) ){
+ setTimeout("editAreaLoader.start('"+id+"');", 50);
+ return;
+ }
+ // init the regexp for syntax highlight
+ if(editAreas[id]["settings"]["syntax"].length>0)
+ t.init_syntax_regexp();
+
+
+ // display toggle option and debug area
+ if(!d.getElementById("EditAreaArroundInfos_"+id) && (editAreas[id]["settings"]["debug"] || editAreas[id]["settings"]["allow_toggle"]))
+ {
+ span= d.createElement("span");
+ span.id= "EditAreaArroundInfos_"+id;
+ if(editAreas[id]["settings"]["allow_toggle"]){
+ checked=(editAreas[id]["settings"]["display"]=="onload")?"checked='checked'":"";
+ html+=" ";
+ html+=" ";
+ html+="{$toggle}
";
+ }
+ if(editAreas[id]["settings"]["debug"])
+ html+=" ";
+ html= t.translate(html, editAreas[id]["settings"]["language"]);
+ span.innerHTML= html;
+ father= d.getElementById(id).parentNode;
+ next= d.getElementById(id).nextSibling;
+ if(next==null)
+ father.appendChild(span);
+ else
+ father.insertBefore(span, next);
+ }
+
+ if(!editAreas[id]["initialized"])
+ {
+ t.execCommand(id, "EA_init"); // ini callback
+ if(editAreas[id]["settings"]["display"]=="later"){
+ editAreas[id]["initialized"]= true;
+ return;
+ }
+ }
+
+ if(t.isIE){ // launch IE selection checkup
+ t.init_ie_textarea(id);
+ }
+
+ // get toolbar content
+ var area=editAreas[id];
+
+ for(i=0; i ';
+ }
+
+ // add plugins scripts if not already loaded by the compressor (but need to load language in all the case)
+ for(i=0; i ';
+ t.iframe_script+='';
+ }
+
+
+ // create css link for the iframe if the whole css text has not been already loaded by the compressor
+ if(!t.iframe_css){
+ t.iframe_css=" ";
+ }
+
+
+ // create template
+ template= t.template.replace(/\[__BASEURL__\]/g, t.baseURL);
+ template= template.replace("[__TOOLBAR__]",html_toolbar_content);
+
+
+ // fill template with good language sentences
+ template= t.translate(template, area["settings"]["language"], "template");
+
+ // add css_code
+ template= template.replace("[__CSSRULES__]", t.iframe_css);
+ // add js_code
+ template= template.replace("[__JSCODE__]", t.iframe_script);
+
+ // add version_code
+ template= template.replace("[__EA_VERSION__]", t.version);
+ //template=template.replace(/\{\$([^\}]+)\}/gm, this.traduc_template);
+
+ //editAreas[area["settings"]["id"]]["template"]= template;
+
+ area.textarea=d.getElementById(area["settings"]["id"]);
+ editAreas[area["settings"]["id"]]["textarea"]=area.textarea;
+
+ // if removing previous instances from DOM before (fix from Marcin)
+ if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')
+ delete window.frames["frame_"+area["settings"]["id"]];
+
+ // insert template in the document after the textarea
+ father= area.textarea.parentNode;
+ /* var container= document.createElement("div");
+ container.id= "EditArea_frame_container_"+area["settings"]["id"];
+ */
+ content= d.createElement("iframe");
+ content.name= "frame_"+area["settings"]["id"];
+ content.id= "frame_"+area["settings"]["id"];
+ content.style.borderWidth= "0px";
+ setAttribute(content, "frameBorder", "0"); // IE
+ content.style.overflow="hidden";
+ content.style.display="none";
+
+
+ next= area.textarea.nextSibling;
+ if(next==null)
+ father.appendChild(content);
+ else
+ father.insertBefore(content, next) ;
+ f=window.frames["frame_"+area["settings"]["id"]];
+ f.document.open();
+ f.editAreas=editAreas;
+ f.area_id= area["settings"]["id"];
+ f.document.area_id= area["settings"]["id"];
+ f.document.write(template);
+ f.document.close();
+
+ // frame.editAreaLoader=this;
+ //editAreas[area["settings"]["id"]]["displayed"]=true;
+
+ },
+
+ toggle : function(id, toggle_to){
+
+ /* if((editAreas[id]["displayed"]==true && toggle_to!="on") || toggle_to=="off"){
+ this.toggle_off(id);
+ }else if((editAreas[id]["displayed"]==false && toggle_to!="off") || toggle_to=="on"){
+ this.toggle_on(id);
+ }*/
+ if(!toggle_to)
+ toggle_to= (editAreas[id]["displayed"]==true)?"off":"on";
+ if(editAreas[id]["displayed"]==true && toggle_to=="off"){
+ this.toggle_off(id);
+ }else if(editAreas[id]["displayed"]==false && toggle_to=="on"){
+ this.toggle_on(id);
+ }
+
+ return false;
+ },
+
+ // static function
+ toggle_off : function(id){
+ var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;
+ if(fs["frame_"+id])
+ {
+ f = fs["frame_"+id];
+ t = editAreas[id]["textarea"];
+ if(f.editArea.fullscreen['isFull'])
+ f.editArea.toggle_full_screen(false);
+ editAreas[id]["displayed"]=false;
+
+ // set wrap to off to keep same display mode (some browser get problem with this, so it need more complex operation
+ t.wrap = "off"; // for IE
+ setAttribute(t, "wrap", "off"); // for Firefox
+ parNod = t.parentNode;
+ nxtSib = t.nextSibling;
+ parNod.removeChild(t);
+ parNod.insertBefore(t, nxtSib);
+
+ // restore values
+ t.value= f.editArea.textarea.value;
+ selStart = f.editArea.last_selection["selectionStart"];
+ selEnd = f.editArea.last_selection["selectionEnd"];
+ scrollTop = f.document.getElementById("result").scrollTop;
+ scrollLeft = f.document.getElementById("result").scrollLeft;
+
+
+ document.getElementById("frame_"+id).style.display='none';
+
+ t.style.display="inline";
+
+ try{ // IE will give an error when trying to focus an invisible or disabled textarea
+ t.focus();
+ } catch(e){};
+ if(this.isIE){
+ t.selectionStart= selStart;
+ t.selectionEnd = selEnd;
+ t.focused = true;
+ set_IE_selection(t);
+ }else{
+ if(this.isOpera && this.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
+ t.setSelectionRange(0, 0);
+ }
+ try{
+ t.setSelectionRange(selStart, selEnd);
+ } catch(e) {};
+ }
+ t.scrollTop= scrollTop;
+ t.scrollLeft= scrollLeft;
+ f.editArea.execCommand("toggle_off");
+
+ }
+ },
+
+ // static function
+ toggle_on : function(id){
+ var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;
+
+ if(fs["frame_"+id])
+ {
+ f = fs["frame_"+id];
+ t = editAreas[id]["textarea"];
+ area= f.editArea;
+ area.textarea.value= t.value;
+
+ // store display values;
+ curPos = editAreas[id]["settings"]["cursor_position"];
+
+ if(t.use_last==true)
+ {
+ selStart = t.last_selectionStart;
+ selEnd = t.last_selectionEnd;
+ scrollTop = t.last_scrollTop;
+ scrollLeft = t.last_scrollLeft;
+ t.use_last=false;
+ }
+ else if( curPos == "auto" )
+ {
+ try{
+ selStart = t.selectionStart;
+ selEnd = t.selectionEnd;
+ scrollTop = t.scrollTop;
+ scrollLeft = t.scrollLeft;
+ //alert(scrollTop);
+ }catch(ex){}
+ }
+
+ // set to good size
+ this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));
+ t.style.display="none";
+ document.getElementById("frame_"+id).style.display="inline";
+ area.execCommand("focus"); // without this focus opera doesn't manage well the iframe body height
+
+
+ // restore display values
+ editAreas[id]["displayed"]=true;
+ area.execCommand("update_size");
+
+ f.document.getElementById("result").scrollTop= scrollTop;
+ f.document.getElementById("result").scrollLeft= scrollLeft;
+ area.area_select(selStart, selEnd-selStart);
+ area.execCommand("toggle_on");
+
+
+ }
+ else
+ {
+ /* if(this.isIE)
+ get_IE_selection(document.getElementById(id)); */
+ elem= document.getElementById(id);
+ elem.last_selectionStart= elem.selectionStart;
+ elem.last_selectionEnd= elem.selectionEnd;
+ elem.last_scrollTop= elem.scrollTop;
+ elem.last_scrollLeft= elem.scrollLeft;
+ elem.use_last=true;
+ editAreaLoader.start(id);
+ }
+ },
+
+ set_editarea_size_from_textarea : function(id, frame){
+ var elem,width,height;
+ elem = document.getElementById(id);
+
+ width = Math.max(editAreas[id]["settings"]["min_width"], elem.offsetWidth)+"px";
+ height = Math.max(editAreas[id]["settings"]["min_height"], elem.offsetHeight)+"px";
+ if(elem.style.width.indexOf("%")!=-1)
+ width = elem.style.width;
+ if(elem.style.height.indexOf("%")!=-1)
+ height = elem.style.height;
+ //alert("h: "+height+" w: "+width);
+
+ frame.style.width= width;
+ frame.style.height= height;
+ },
+
+ set_base_url : function(){
+ var t=this,elems,i,docBasePath;
+
+ if( !this.baseURL ){
+ elems = document.getElementsByTagName('script');
+
+ for( i=0; i';
+ html += ' ';
+ return html;
+ },
+
+ get_control_html : function(button_name, lang) {
+ var t=this,i,but,html,si;
+ for (i=0; i ";
+ case "|":
+ case "separator":
+ return ' ';
+ case "select_font":
+ html= "";
+ html+="{$font_size} ";
+ si=[8,9,10,11,12,14];
+ for( i=0;i"+si[i]+" pt";
+ }
+ html+=" ";
+ return html;
+ case "syntax_selection":
+ html= "";
+ html+="{$syntax_selection} ";
+ html+=" ";
+ return html;
+ }
+
+ return "["+button_name+"] ";
+ },
+
+
+ get_template : function(){
+ if(this.template=="")
+ {
+ var xhr_object = null;
+ if(window.XMLHttpRequest) // Firefox
+ xhr_object = new XMLHttpRequest();
+ else if(window.ActiveXObject) // Internet Explorer
+ xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+ else { // XMLHttpRequest not supported
+ alert("XMLHTTPRequest not supported. EditArea not loaded");
+ return;
+ }
+
+ xhr_object.open("GET", this.baseURL+"template.html", false);
+ xhr_object.send(null);
+ if(xhr_object.readyState == 4)
+ this.template=xhr_object.responseText;
+ else
+ this.has_error();
+ }
+ },
+
+ // translate text
+ translate : function(text, lang, mode){
+ if(mode=="word")
+ text=editAreaLoader.get_word_translation(text, lang);
+ else if(mode="template"){
+ editAreaLoader.current_language= lang;
+ text=text.replace(/\{\$([^\}]+)\}/gm, editAreaLoader.translate_template);
+ }
+ return text;
+ },
+
+ translate_template : function(){
+ return editAreaLoader.get_word_translation(EditAreaLoader.prototype.translate_template.arguments[1], editAreaLoader.current_language);
+ },
+
+ get_word_translation : function(val, lang){
+ var i;
+
+ for( i in editAreaLoader.lang[lang]){
+ if(i == val)
+ return editAreaLoader.lang[lang][i];
+ }
+ return "_"+val;
+ },
+
+ load_script : function(url){
+ var t=this,d=document,script,head;
+
+ if( t.loadedFiles[url] )
+ return;
+ //alert("load: "+url);
+ try{
+ script= d.createElement("script");
+ script.type= "text/javascript";
+ script.src= url;
+ script.charset= "UTF-8";
+ d.getElementsByTagName("head")[0].appendChild(script);
+ }catch(e){
+ d.write(' ');
+ }
+
+ t.loadedFiles[url] = true;
+ },
+
+ add_event : function(obj, name, handler) {
+ try{
+ if (obj.attachEvent) {
+ obj.attachEvent("on" + name, handler);
+ } else{
+ obj.addEventListener(name, handler, false);
+ }
+ }catch(e){}
+ },
+
+ remove_event : function(obj, name, handler){
+ try{
+ if (obj.detachEvent)
+ obj.detachEvent("on" + name, handler);
+ else
+ obj.removeEventListener(name, handler, false);
+ }catch(e){}
+ },
+
+
+ // reset all the editareas in the form that have been reseted
+ reset : function(e){
+ var formObj,is_child,i,x;
+
+ formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
+ if(formObj.tagName!='FORM')
+ formObj= formObj.form;
+
+ for( i in editAreas ){
+ is_child= false;
+ for( x=0;x old_sel["start"]) // if text was selected, cursor at the end
+ this.setSelectionRange(id, new_sel["end"], new_sel["end"]);
+ else // cursor in the middle
+ this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);
+ },
+
+ // hide both EditArea and normal textarea
+ hide : function(id){
+ var fs= window.frames,d=document,t=this,scrollTop,scrollLeft,span;
+ if(d.getElementById(id) && !t.hidden[id])
+ {
+ t.hidden[id]= {};
+ t.hidden[id]["selectionRange"]= t.getSelectionRange(id);
+ if(d.getElementById(id).style.display!="none")
+ {
+ t.hidden[id]["scrollTop"]= d.getElementById(id).scrollTop;
+ t.hidden[id]["scrollLeft"]= d.getElementById(id).scrollLeft;
+ }
+
+ if(fs["frame_"+id])
+ {
+ t.hidden[id]["toggle"]= editAreas[id]["displayed"];
+
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+ scrollTop = fs["frame_"+ id].document.getElementById("result").scrollTop;
+ scrollLeft = fs["frame_"+ id].document.getElementById("result").scrollLeft;
+ }else{
+ scrollTop = d.getElementById(id).scrollTop;
+ scrollLeft = d.getElementById(id).scrollLeft;
+ }
+ t.hidden[id]["scrollTop"]= scrollTop;
+ t.hidden[id]["scrollLeft"]= scrollLeft;
+
+ if(editAreas[id]["displayed"]==true)
+ editAreaLoader.toggle_off(id);
+ }
+
+ // hide toggle button and debug box
+ span= d.getElementById("EditAreaArroundInfos_"+id);
+ if(span){
+ span.style.display='none';
+ }
+
+ // hide textarea
+ d.getElementById(id).style.display= "none";
+ }
+ },
+
+ // restore hidden EditArea and normal textarea
+ show : function(id){
+ var fs= window.frames,d=document,t=this,span;
+ if((elem=d.getElementById(id)) && t.hidden[id])
+ {
+ elem.style.display= "inline";
+ elem.scrollTop= t.hidden[id]["scrollTop"];
+ elem.scrollLeft= t.hidden[id]["scrollLeft"];
+ span= d.getElementById("EditAreaArroundInfos_"+id);
+ if(span){
+ span.style.display='inline';
+ }
+
+ if(fs["frame_"+id])
+ {
+
+ // restore toggle button and debug box
+
+
+ // restore textarea
+ elem.style.display= "inline";
+
+ // restore EditArea
+ if(t.hidden[id]["toggle"]==true)
+ editAreaLoader.toggle_on(id);
+
+ scrollTop = t.hidden[id]["scrollTop"];
+ scrollLeft = t.hidden[id]["scrollLeft"];
+
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+ fs["frame_"+ id].document.getElementById("result").scrollTop = scrollTop;
+ fs["frame_"+ id].document.getElementById("result").scrollLeft = scrollLeft;
+ }else{
+ elem.scrollTop = scrollTop;
+ elem.scrollLeft = scrollLeft;
+ }
+
+ }
+ // restore selection
+ sel = t.hidden[id]["selectionRange"];
+ t.setSelectionRange(id, sel["start"], sel["end"]);
+ delete t.hidden[id];
+ }
+ },
+
+ // get the current file datas (for multi file editing mode)
+ getCurrentFile : function(id){
+ return this.execCommand(id, 'get_file', this.execCommand(id, 'curr_file'));
+ },
+
+ // get the given file datas (for multi file editing mode)
+ getFile : function(id, file_id){
+ return this.execCommand(id, 'get_file', file_id);
+ },
+
+ // get all the openned files datas (for multi file editing mode)
+ getAllFiles : function(id){
+ return this.execCommand(id, 'get_all_files()');
+ },
+
+ // open a file (for multi file editing mode)
+ openFile : function(id, file_infos){
+ return this.execCommand(id, 'open_file', file_infos);
+ },
+
+ // close the given file (for multi file editing mode)
+ closeFile : function(id, file_id){
+ return this.execCommand(id, 'close_file', file_id);
+ },
+
+ // close the given file (for multi file editing mode)
+ setFileEditedMode : function(id, file_id, to){
+ var reg1,reg2;
+ reg1 = new RegExp('\\\\', 'g');
+ reg2 = new RegExp('"', 'g');
+ return this.execCommand(id, 'set_file_edited_mode("'+ file_id.replace(reg1, '\\\\').replace(reg2, '\\"') +'", '+ to +')');
+ },
+
+
+ // allow to access to editarea functions and datas (for advanced users only)
+ execCommand : function(id, cmd, fct_param){
+ switch(cmd){
+ case "EA_init":
+ if(editAreas[id]['settings']["EA_init_callback"].length>0)
+ eval(editAreas[id]['settings']["EA_init_callback"]+"('"+ id +"');");
+ break;
+ case "EA_delete":
+ if(editAreas[id]['settings']["EA_delete_callback"].length>0)
+ eval(editAreas[id]['settings']["EA_delete_callback"]+"('"+ id +"');");
+ break;
+ case "EA_submit":
+ if(editAreas[id]['settings']["submit_callback"].length>0)
+ eval(editAreas[id]['settings']["submit_callback"]+"('"+ id +"');");
+ break;
+ }
+ if(window.frames["frame_"+id] && window.frames["frame_"+ id].editArea){
+ if(fct_param!=undefined)
+ return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +'(fct_param);');
+ else
+ return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');
+ }
+ return false;
+ }
+};
+
+ var editAreaLoader= new EditAreaLoader();
+ var editAreas= {};
+
diff --git a/includes/edit_area/elements_functions.js b/includes/edit_area/elements_functions.js
new file mode 100644
index 00000000..67f53661
--- /dev/null
+++ b/includes/edit_area/elements_functions.js
@@ -0,0 +1,336 @@
+/****
+ * This page contains some general usefull functions for javascript
+ *
+ ****/
+
+
+ // need to redefine this functiondue to IE problem
+ function getAttribute( elm, aName ) {
+ var aValue,taName,i;
+ try{
+ aValue = elm.getAttribute( aName );
+ }catch(exept){}
+
+ if( ! aValue ){
+ for( i = 0; i < elm.attributes.length; i ++ ) {
+ taName = elm.attributes[i] .name.toLowerCase();
+ if( taName == aName ) {
+ aValue = elm.attributes[i] .value;
+ return aValue;
+ }
+ }
+ }
+ return aValue;
+ };
+
+ // need to redefine this function due to IE problem
+ function setAttribute( elm, attr, val ) {
+ if(attr=="class"){
+ elm.setAttribute("className", val);
+ elm.setAttribute("class", val);
+ }else{
+ elm.setAttribute(attr, val);
+ }
+ };
+
+ /* return a child element
+ elem: element we are searching in
+ elem_type: type of the eleemnt we are searching (DIV, A, etc...)
+ elem_attribute: attribute of the searched element that must match
+ elem_attribute_match: value that elem_attribute must match
+ option: "all" if must return an array of all children, otherwise return the first match element
+ depth: depth of search (-1 or no set => unlimited)
+ */
+ function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth)
+ {
+ if(!option)
+ var option="single";
+ if(!depth)
+ var depth=-1;
+ if(elem){
+ var children= elem.childNodes;
+ var result=null;
+ var results= [];
+ for (var x=0;x0){
+ results= results.concat(result);
+ }
+ }else if(result!=null){
+ return result;
+ }
+ }
+ }
+ }
+ if(option=="all")
+ return results;
+ }
+ return null;
+ };
+
+ function isChildOf(elem, parent){
+ if(elem){
+ if(elem==parent)
+ return true;
+ while(elem.parentNode != 'undefined'){
+ return isChildOf(elem.parentNode, parent);
+ }
+ }
+ return false;
+ };
+
+ function getMouseX(e){
+
+ if(e!=null && typeof(e.pageX)!="undefined"){
+ return e.pageX;
+ }else{
+ return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;
+ }
+ };
+
+ function getMouseY(e){
+ if(e!=null && typeof(e.pageY)!="undefined"){
+ return e.pageY;
+ }else{
+ return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;
+ }
+ };
+
+ function calculeOffsetLeft(r){
+ return calculeOffset(r,"offsetLeft")
+ };
+
+ function calculeOffsetTop(r){
+ return calculeOffset(r,"offsetTop")
+ };
+
+ function calculeOffset(element,attr){
+ var offset=0;
+ while(element){
+ offset+=element[attr];
+ element=element.offsetParent
+ }
+ return offset;
+ };
+
+ /** 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:
+ or
+ in javascript: document.getElementById("my_div").onmousedown= start_move_element
+ */
+ function start_move_element(e, id, frame){
+ var elem_id=(e.target || e.srcElement).id;
+ if(id)
+ elem_id=id;
+ if(!frame)
+ frame=window;
+ if(frame.event)
+ e=frame.event;
+
+ _mCE= frame.document.getElementById(elem_id);
+ _mCE.frame=frame;
+ frame.document.onmousemove= move_element;
+ frame.document.onmouseup= end_move_element;
+ /*_mCE.onmousemove= move_element;
+ _mCE.onmouseup= end_move_element;*/
+
+ //alert(_mCE.frame.document.body.offsetHeight);
+
+ mouse_x= getMouseX(e);
+ mouse_y= getMouseY(e);
+ //window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
+ _mCE.start_pos_x = mouse_x - (_mCE.style.left.replace("px","") || calculeOffsetLeft(_mCE));
+ _mCE.start_pos_y = mouse_y - (_mCE.style.top.replace("px","") || calculeOffsetTop(_mCE));
+ return false;
+ };
+
+ function end_move_element(e){
+ _mCE.frame.document.onmousemove= "";
+ _mCE.frame.document.onmouseup= "";
+ _mCE=null;
+ };
+
+ function move_element(e){
+ var newTop,newLeft,maxLeft;
+
+ if( _mCE.frame && _mCE.frame.event )
+ e=_mCE.frame.event;
+ newTop = getMouseY(e) - _mCE.start_pos_y;
+ newLeft = getMouseX(e) - _mCE.start_pos_x;
+
+ maxLeft = _mCE.frame.document.body.offsetWidth- _mCE.offsetWidth;
+ max_top = _mCE.frame.document.body.offsetHeight- _mCE.offsetHeight;
+ newTop = Math.min(Math.max(0, newTop), max_top);
+ newLeft = Math.min(Math.max(0, newLeft), maxLeft);
+
+ _mCE.style.top = newTop+"px";
+ _mCE.style.left = newLeft+"px";
+ return false;
+ };
+
+/***
+ * Managing a textarea (this part need the navigator infos from editAreaLoader
+ ***/
+
+ var nav= editAreaLoader.nav;
+
+ // allow to get infos on the selection: array(start, end)
+ function getSelectionRange(textarea){
+ return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
+ };
+
+ // allow to set the selection
+ function setSelectionRange(t, start, end){
+ t.focus();
+
+ start = Math.max(0, Math.min(t.value.length, start));
+ end = Math.max(start, Math.min(t.value.length, end));
+
+ if( nav.isOpera && nav.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
+ t.selectionEnd = 1;
+ t.selectionStart = 0;
+ t.selectionEnd = 1;
+ t.selectionStart = 0;
+ }
+ t.selectionStart = start;
+ t.selectionEnd = end;
+ //textarea.setSelectionRange(start, end);
+
+ if(nav.isIE)
+ set_IE_selection(t);
+ };
+
+
+ // set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
+ function get_IE_selection(t){
+ var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;
+ if(t && t.focused)
+ {
+ if(!t.ea_line_height)
+ { // calculate the lineHeight
+ div= d.createElement("div");
+ div.style.fontFamily= get_css_property(t, "font-family");
+ div.style.fontSize= get_css_property(t, "font-size");
+ div.style.visibility= "hidden";
+ div.innerHTML="0";
+ d.body.appendChild(div);
+ t.ea_line_height= div.offsetHeight;
+ d.body.removeChild(div);
+ }
+ //t.focus();
+ range = d.selection.createRange();
+ try
+ {
+ stored_range = range.duplicate();
+ stored_range.moveToElementText( t );
+ stored_range.setEndPoint( 'EndToEnd', range );
+ if(stored_range.parentElement() == t){
+ // the range don't take care of empty lines in the end of the selection
+ elem = t;
+ scrollTop = 0;
+ while(elem.parentNode){
+ scrollTop+= elem.scrollTop;
+ elem = elem.parentNode;
+ }
+
+ // var scrollTop= t.scrollTop + document.body.scrollTop;
+
+ // var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
+ relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
+ // alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
+ line_start = Math.round((relative_top / t.ea_line_height) +1);
+
+ line_nb = Math.round(range.boundingHeight / t.ea_line_height);
+
+ range_start = stored_range.text.length - range.text.length;
+ tab = t.value.substr(0, range_start).split("\n");
+ range_start += (line_start - tab.length)*2; // add missing empty lines to the selection
+ t.selectionStart = range_start;
+
+ range_end = t.selectionStart + range.text.length;
+ tab = t.value.substr(0, range_start + range.text.length).split("\n");
+ range_end += (line_start + line_nb - 1 - tab.length)*2;
+ t.selectionEnd = range_end;
+ }
+ }
+ catch(e){}
+ }
+ if( t && t.id )
+ {
+ setTimeout("get_IE_selection(document.getElementById('"+ t.id +"'));", 50);
+ }
+ };
+
+ function IE_textarea_focus(){
+ event.srcElement.focused= true;
+ }
+
+ function IE_textarea_blur(){
+ event.srcElement.focused= false;
+ }
+
+ // select the text for IE (take into account the \r difference)
+ function set_IE_selection( t ){
+ var nbLineStart,nbLineStart,nbLineEnd,range;
+ if(!window.closed){
+ nbLineStart=t.value.substr(0, t.selectionStart).split("\n").length - 1;
+ nbLineEnd=t.value.substr(0, t.selectionEnd).split("\n").length - 1;
+ try
+ {
+ range = document.selection.createRange();
+ range.moveToElementText( t );
+ range.setEndPoint( 'EndToStart', range );
+ range.moveStart('character', t.selectionStart - nbLineStart);
+ range.moveEnd('character', t.selectionEnd - nbLineEnd - (t.selectionStart - nbLineStart) );
+ range.select();
+ }
+ catch(e){}
+ }
+ };
+
+
+ editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";
diff --git a/includes/edit_area/highlight.js b/includes/edit_area/highlight.js
new file mode 100644
index 00000000..e957259a
--- /dev/null
+++ b/includes/edit_area/highlight.js
@@ -0,0 +1,407 @@
+ // change_to: "on" or "off"
+ EditArea.prototype.change_highlight= function(change_to){
+ if(this.settings["syntax"].length==0 && change_to==false){
+ this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
+ this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
+ return false;
+ }
+
+ if(this.do_highlight==change_to)
+ return false;
+
+
+ this.getIESelection();
+ var pos_start= this.textarea.selectionStart;
+ var pos_end= this.textarea.selectionEnd;
+
+ if(this.do_highlight===true || change_to==false)
+ this.disable_highlight();
+ else
+ this.enable_highlight();
+ this.textarea.focus();
+ this.textarea.selectionStart = pos_start;
+ this.textarea.selectionEnd = pos_end;
+ this.setIESelection();
+
+ };
+
+ EditArea.prototype.disable_highlight= function(displayOnly){
+ var t= this, a=t.textarea, new_Obj, old_class, new_class;
+
+ t.selection_field.innerHTML="";
+ t.selection_field_text.innerHTML="";
+ t.content_highlight.style.visibility="hidden";
+ // replacing the node is far more faster than deleting it's content in firefox
+ new_Obj= t.content_highlight.cloneNode(false);
+ new_Obj.innerHTML= "";
+ t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
+ t.content_highlight.parentNode.removeChild(t.content_highlight);
+ t.content_highlight= new_Obj;
+ old_class= parent.getAttribute( a,"class" );
+ if(old_class){
+ new_class= old_class.replace( "hidden","" );
+ parent.setAttribute( a, "class", new_class );
+ }
+
+ a.style.backgroundColor="transparent"; // needed in order to see the bracket finders
+
+ //var icon= document.getElementById("highlight");
+ //setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
+ //t.restoreClass(icon);
+ //t.switchClass(icon,'editAreaButtonNormal');
+ t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
+ t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
+
+ t.do_highlight=false;
+
+ t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
+ if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
+ t.change_smooth_selection_mode(false);
+ }
+
+ // this.textarea.style.backgroundColor="#FFFFFF";
+ };
+
+ EditArea.prototype.enable_highlight= function(){
+ var t=this, a=t.textarea, new_class;
+ t.show_waiting_screen();
+
+ t.content_highlight.style.visibility="visible";
+ new_class =parent.getAttribute(a,"class")+" hidden";
+ parent.setAttribute( a, "class", new_class );
+
+ // IE can't manage mouse click outside text range without this
+ if( t.isIE )
+ a.style.backgroundColor="#FFFFFF";
+
+ t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
+ t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
+
+ t.smooth_selection_before_highlight=t.smooth_selection;
+ if(!t.smooth_selection)
+ t.change_smooth_selection_mode(true);
+ t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
+
+
+ t.do_highlight=true;
+ t.resync_highlight();
+
+ t.hide_waiting_screen();
+ };
+
+ /**
+ * Ask to update highlighted text
+ * @param Array infos - Array of datas returned by EditArea.get_selection_infos()
+ */
+ EditArea.prototype.maj_highlight= function(infos){
+ // for speed mesure
+ var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
+ var t=this, hightlighted_text, updated_highlight;
+ var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
+
+ if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
+ return;
+
+ // OPTIMISATION: will search to update only changed lines
+ if(t.reload_highlight===true){
+ t.reload_highlight=false;
+ }else if(textToHighlight.length==0){
+ textToHighlight="\n ";
+ }else{
+ // get text change datas
+ changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
+
+ // check if it can only reparse the changed text
+ trace_new = t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
+ trace_last = t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
+ doSyntaxOpti = ( trace_new == trace_last );
+
+ // check if the difference comes only from a new line created
+ // => we have to remember that the editor can automaticaly add tabulation or space after the new line)
+ if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
+ {
+ doSyntaxOpti = true;
+ }
+
+ // we do the syntax optimisation
+ if( doSyntaxOpti ){
+
+ tps_middle_opti=new Date().getTime();
+
+ stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
+ if(changes.lineStart>0)
+ stay_begin+= "\n";
+ stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
+ if(stay_end.length>0)
+ stay_end= "\n"+stay_end;
+
+ // Final check to see that we're not in the middle of span tags
+ if( stay_begin.split(' trace: "+trace_new
+ +"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
+ //debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
+ + "\nchanged_line: "+ch.newTextLine
+ + "\nlast_changed_line: "+ch.lastTextLine
+ +"\nstay_begin: "+ stay_begin.slice(-100)
+ +"\nstay_end: "+ stay_end.substr( 0, 100 );
+ //debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
+ //debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
+
+ //debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
+ +"\n";
+ }
+
+
+ // END OPTIMISATION
+ }
+
+ tps_end_opti = new Date().getTime();
+
+ // apply highlight
+ updated_highlight = t.colorize_text(textToHighlight);
+ tpsAfterReg = new Date().getTime();
+
+ /***
+ * see if we can optimize for updating only the required part of the HTML code
+ *
+ * The goal here will be to find the text node concerned by the modification and to update it
+ */
+ //-------------------------------------------
+
+ // disable latest optimization tricks (introduced in 0.8.1 and removed in 0.8.2), TODO: check for another try later
+ doSyntaxOpti = doHtmlOpti = false;
+ if( doSyntaxOpti )
+ {
+ try
+ {
+ var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
+ replacedBloc = t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
+
+ lengthOld = replacedBloc.length;
+ lengthNew = updated_highlight.length;
+
+ // find the identical caracters at the beginning
+ for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
+ {
+ }
+ nbStart = i;
+ // find the identical caracters at the end
+ for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
+ {
+ }
+ nbEnd = i;
+ //console.log( nbStart, nbEnd, replacedBloc, updated_highlight );
+ // get the changes
+ lastHtml = replacedBloc.substring( nbStart, lengthOld - nbEnd );
+ newHtml = updated_highlight.substring( nbStart, lengthNew - nbEnd );
+
+ // We can do the optimisation only if we havn't touch to span elements
+ if( newHtml.indexOf('').replace( /&/g, '&');
+
+ nbOpendedSpan = beginStr.split(' 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( '', maxStartOffset ) );
+
+ // count the number of sub spans
+ nbSubSpanBefore = beginStr.substr( lastEndPos ).split('' ) ) == -1 ? beginStr.length : beginStr.length - ( lastIndex + 1 );
+ //nbUnchangedChars = ? beginStr.length : beginStr.substr( lastIndex + 1 ).replace( /</g, '<').replace( />/g, '>').replace( /&/g, '&').length;
+
+ if( ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 )
+ {
+ nbUnchangedChars = beginStr.length;
+ }
+ else
+ {
+ nbUnchangedChars = beginStr.substr( lastIndex + 1 ).replace( /</g, '<').replace( />/g, '>').replace( /&/g, '&').length;
+ //nbUnchangedChars += beginStr.substr( ).replace( /&/g, '&').replace( //g, '>').length - beginStr.length;
+ }
+ //alert( nbUnchangedChars );
+ // console.log( span, textNode, nbOpendedSpan,nbClosedSpan, span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
+ // alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length );
+ // console.log( nbUnchangedChars, lastIndex, beginStr.length, beginStr.replace(/&/g, '&'), lastHtml.length, '|', newHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/g, 'r'), lastHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/, 'r') );
+ // console.log( textNode.data.replace(/&/g, '&') );
+ // 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= "" + hightlighted_text + " ";
+ else
+ new_Obj.innerHTML= ""+ hightlighted_text +" ";
+
+ 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);
+ };
diff --git a/includes/edit_area/images/autocompletion.gif b/includes/edit_area/images/autocompletion.gif
new file mode 100644
index 00000000..f3dfc2e3
Binary files /dev/null and b/includes/edit_area/images/autocompletion.gif differ
diff --git a/includes/edit_area/images/close.gif b/includes/edit_area/images/close.gif
new file mode 100644
index 00000000..679ca2aa
Binary files /dev/null and b/includes/edit_area/images/close.gif differ
diff --git a/includes/edit_area/images/fullscreen.gif b/includes/edit_area/images/fullscreen.gif
new file mode 100644
index 00000000..66fa6d92
Binary files /dev/null and b/includes/edit_area/images/fullscreen.gif differ
diff --git a/includes/edit_area/images/go_to_line.gif b/includes/edit_area/images/go_to_line.gif
new file mode 100644
index 00000000..06042ec9
Binary files /dev/null and b/includes/edit_area/images/go_to_line.gif differ
diff --git a/includes/edit_area/images/help.gif b/includes/edit_area/images/help.gif
new file mode 100644
index 00000000..51a1ee42
Binary files /dev/null and b/includes/edit_area/images/help.gif differ
diff --git a/includes/edit_area/images/highlight.gif b/includes/edit_area/images/highlight.gif
new file mode 100644
index 00000000..16491f6c
Binary files /dev/null and b/includes/edit_area/images/highlight.gif differ
diff --git a/includes/edit_area/images/load.gif b/includes/edit_area/images/load.gif
new file mode 100644
index 00000000..461698f5
Binary files /dev/null and b/includes/edit_area/images/load.gif differ
diff --git a/includes/edit_area/images/move.gif b/includes/edit_area/images/move.gif
new file mode 100644
index 00000000..d15f9f54
Binary files /dev/null and b/includes/edit_area/images/move.gif differ
diff --git a/includes/edit_area/images/newdocument.gif b/includes/edit_area/images/newdocument.gif
new file mode 100644
index 00000000..a9d29384
Binary files /dev/null and b/includes/edit_area/images/newdocument.gif differ
diff --git a/includes/edit_area/images/opacity.png b/includes/edit_area/images/opacity.png
new file mode 100644
index 00000000..dc378234
Binary files /dev/null and b/includes/edit_area/images/opacity.png differ
diff --git a/includes/edit_area/images/processing.gif b/includes/edit_area/images/processing.gif
new file mode 100644
index 00000000..cce32f20
Binary files /dev/null and b/includes/edit_area/images/processing.gif differ
diff --git a/includes/edit_area/images/redo.gif b/includes/edit_area/images/redo.gif
new file mode 100644
index 00000000..3af90697
Binary files /dev/null and b/includes/edit_area/images/redo.gif differ
diff --git a/includes/edit_area/images/reset_highlight.gif b/includes/edit_area/images/reset_highlight.gif
new file mode 100644
index 00000000..0fa3cb79
Binary files /dev/null and b/includes/edit_area/images/reset_highlight.gif differ
diff --git a/includes/edit_area/images/save.gif b/includes/edit_area/images/save.gif
new file mode 100644
index 00000000..2777bebf
Binary files /dev/null and b/includes/edit_area/images/save.gif differ
diff --git a/includes/edit_area/images/search.gif b/includes/edit_area/images/search.gif
new file mode 100644
index 00000000..cfe76b5d
Binary files /dev/null and b/includes/edit_area/images/search.gif differ
diff --git a/includes/edit_area/images/smooth_selection.gif b/includes/edit_area/images/smooth_selection.gif
new file mode 100644
index 00000000..8a532e5e
Binary files /dev/null and b/includes/edit_area/images/smooth_selection.gif differ
diff --git a/includes/edit_area/images/spacer.gif b/includes/edit_area/images/spacer.gif
new file mode 100644
index 00000000..38848651
Binary files /dev/null and b/includes/edit_area/images/spacer.gif differ
diff --git a/includes/edit_area/images/statusbar_resize.gif b/includes/edit_area/images/statusbar_resize.gif
new file mode 100644
index 00000000..af89d803
Binary files /dev/null and b/includes/edit_area/images/statusbar_resize.gif differ
diff --git a/includes/edit_area/images/undo.gif b/includes/edit_area/images/undo.gif
new file mode 100644
index 00000000..520796d6
Binary files /dev/null and b/includes/edit_area/images/undo.gif differ
diff --git a/includes/edit_area/images/word_wrap.gif b/includes/edit_area/images/word_wrap.gif
new file mode 100644
index 00000000..8f256ccb
Binary files /dev/null and b/includes/edit_area/images/word_wrap.gif differ
diff --git a/includes/edit_area/keyboard.js b/includes/edit_area/keyboard.js
new file mode 100644
index 00000000..38f334b1
--- /dev/null
+++ b/includes/edit_area/keyboard.js
@@ -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" && !AltPressed(e) && !editArea.isOpera){
+ editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
+ use=true;
+ }else if(letter=="Page down" && !AltPressed(e) && !editArea.isOpera){
+ editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
+ use=true;
+ }else if(editArea.is_editable==false){
+ // do nothing but also do nothing else (allow to navigate with page up and page down)
+ return true;
+ }else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){
+ if(ShiftPressed(e))
+ editArea.execCommand("invert_tab_selection");
+ else
+ editArea.execCommand("tab_selection");
+
+ use=true;
+ if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) ) // opera && firefox mac can't cancel tabulation events...
+ setTimeout("editArea.execCommand('focus');", 1);
+ }else if(letter=="Entrer" && target_id=="textarea"){
+ if(editArea.press_enter())
+ use=true;
+ }else if(letter=="Entrer" && target_id=="area_search"){
+ editArea.execCommand("area_search");
+ use=true;
+ }else if(letter=="Esc"){
+ editArea.execCommand("close_all_inline_popup", e);
+ use=true;
+ }else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
+ switch(low_letter){
+ case "f":
+ editArea.execCommand("area_search");
+ use=true;
+ break;
+ case "r":
+ editArea.execCommand("area_replace");
+ use=true;
+ break;
+ case "q":
+ editArea.execCommand("close_all_inline_popup", e);
+ use=true;
+ break;
+ case "h":
+ editArea.execCommand("change_highlight");
+ use=true;
+ break;
+ case "g":
+ setTimeout("editArea.execCommand('go_to_line');", 5); // the prompt stop the return false otherwise
+ use=true;
+ break;
+ case "e":
+ editArea.execCommand("show_help");
+ use=true;
+ break;
+ case "z":
+ use=true;
+ editArea.execCommand("undo");
+ break;
+ case "y":
+ use=true;
+ editArea.execCommand("redo");
+ break;
+ default:
+ break;
+ }
+ }
+
+ // check to disable the redo possibility if the textarea content change
+ if(editArea.next.length > 0){
+ setTimeout("editArea.check_redo();", 10);
+ }
+
+ setTimeout("editArea.check_file_changes();", 10);
+
+
+ if(use){
+ // in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action
+ if(editArea.isIE)
+ e.keyCode=0;
+ return false;
+ }
+ //alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
+
+ return true;
+
+};
+
+
+// return true if Alt key is pressed
+function AltPressed(e) {
+ if (window.event) {
+ return (window.event.altKey);
+ } else {
+ if(e.modifiers)
+ return (e.altKey || (e.modifiers % 2));
+ else
+ return e.altKey;
+ }
+};
+
+// return true if Ctrl key is pressed
+function CtrlPressed(e) {
+ if (window.event) {
+ return (window.event.ctrlKey);
+ } else {
+ return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
+ }
+};
+
+// return true if Shift key is pressed
+function ShiftPressed(e) {
+ if (window.event) {
+ return (window.event.shiftKey);
+ } else {
+ return (e.shiftKey || (e.modifiers>3));
+ }
+};
diff --git a/includes/edit_area/langs/bg.js b/includes/edit_area/langs/bg.js
new file mode 100644
index 00000000..9fdcec43
--- /dev/null
+++ b/includes/edit_area/langs/bg.js
@@ -0,0 +1,54 @@
+/*
+ * Bulgarian translation
+ * Author: Valentin Hristov
+ * Company: SOFTKIT Bulgarian
+ * Site: http://www.softkit-bg.com
+ */
+editAreaLoader.lang["bg"]={
+new_document: "ะฝะพะฒ ะดะพะบัะผะตะฝั",
+search_button: "ััััะตะฝะต ะธ ะทะฐะผัะฝะฐ",
+search_command: "ััััะธ ัะปะตะดะฒะฐัะธั / ะพัะฒะพัะธ ะฟัะพะทะพัะตั ั ััััะฐัะบะฐ",
+search: "ััััะตะฝะต",
+replace: "ะทะฐะผัะฝะฐ",
+replace_command: "ะทะฐะผัะฝะฐ / ะพัะฒะพัะธ ะฟัะพะทะพัะตั ั ััััะฐัะบะฐ",
+find_next: "ะฝะฐะผะตัะธ ัะปะตะดะฒะฐัะธั",
+replace_all: "ะทะฐะผะตะฝะธ ะฒัะธัะบะธ",
+reg_exp: "ัะตะณะพะปััะฝะธ ะธะทัะฐะทะธ",
+match_case: "ััััะฒะธัะตะปะตะฝ ะบัะผ ัะตะณะธััััะฐ",
+not_found: "ะฝัะผะฐ ัะตะทัะปัะฐั.",
+occurrence_replaced: "ะทะฐะผัะฝะฐัะฐ ะต ะพัััะตััะฒะตะฝะฐ.",
+search_field_empty: "ะะพะปะตัะพ ะทะฐ ััััะตะฝะต ะต ะฟัะฐะทะฝะพ",
+restart_search_at_begin: "ะะพ ะบัะฐั ะฝะฐ ะดะพะบัะผะตะฝัะฐ. ะะพัะฝะธ ั ะฝะฐัะฐะปะพัะพ.",
+move_popup: "ะฟัะตะผะตััะธ ะฟัะพะทะพัะตัะฐ ั ััััะฐัะบะฐัะฐ",
+font_size: "--ะ ะฐะทะผะตั ะฝะฐ ััะธััะฐ--",
+go_to_line: "ะฟัะตะผะตะฝะธ ะบัะผ ัะตะดะฐ",
+go_to_line_prompt: "ะฟัะตะผะตะฝะธ ะบัะผ ะฝะพะผะตัะฐ ะฝะฐ ัะตะดะฐ:",
+undo: "ะพัะผะตะฝะธ",
+redo: "ะฒััะฝะธ",
+change_smooth_selection: "ะฒะบะปััะธ/ะธะทะบะปััะธ ะฝัะบะพะน ะพั ััะฝะบัะธะธัะต ะทะฐ ะฟัะตะณะปะตะด (ะฟะพ ะบัะฐัะธะฒะพ, ะฝะพ ะฟะพะฒะตัะต ะฝะฐัะพะฒะฐัะฒะฐ)",
+highlight: "ะฟัะตะฒะบะปััะฒะฐะฝะต ะฝะฐ ะพัะฒะตััะฒะฐะฝะต ะฝะฐ ัะธะฝัะฐะบัะธัะฐ ะฒะบะปััะตะฝะฐ/ะธะทะบะปััะตะฝะฐ",
+reset_highlight: "ะฒัััะฐะฝะพะฒะธ ะพัะฒะตััะฒะฐะฝะต ะฝะฐ ัะธะฝัะฐะบัะธัะฐ (ะฐะบะพ ะฝะต ะต ัะธะฝั
ัะพะฝะธะทะธัะฐะฝ ั ัะตะบััะฐ)",
+word_wrap: "ัะตะถะธะผ ะฝะฐ ะฟัะตะฝะฐััะฝะต ะฝะฐ ะดัะปะณะธ ัะตะดะพะฒะต",
+help: "ะทะฐ ะฟัะพะณัะฐะผะฐัะฐ",
+save: "ััั
ัะฐะฝะธ",
+load: "ะทะฐัะตะดะธ",
+line_abbr: "ะกัั",
+char_abbr: "ะกัะปะฑ",
+position: "ะะพะทะธัะธั",
+total: "ะัะธัะบะพ",
+close_popup: "ะทะฐัะฒะพัะธ ะฟัะพะทะพัะตัะฐ",
+shortcuts: "ะััะทะธ ะบะปะฐะฒะธัะธ",
+add_tab: "ะดะพะฑะฐะฒะธ ัะฐะฑัะปะฐัะธั ะฒ ัะตะบััะฐ",
+remove_tab: "ะฟัะตะผะฐั
ะฝะธ ัะฐะฑัะปะฐัะธััะฐ ะฒ ัะตะบััะฐ",
+about_notice: "ะะฝะธะผะฐะฝะธะต: ะธะทะฟะพะปะทะฒะฐะนัะต ััะฝะบัะธััะฐ ะพัะฒะตััะฒะฐะฝะต ะฝะฐ ัะธะฝัะฐะบัะธัะฐ ัะฐะผะพ ะทะฐ ะผะฐะปะบะธ ัะตะบััะพะฒะต",
+toggle: "ะัะตะฒะบะปััะธ ัะตะดะฐะบัะพั",
+accesskey: "ะััะท ะบะปะฐะฒะธั",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "ะะฐัะตะถะดะฐะฝะต...",
+fullscreen: "ะฝะฐ ััะป ะตะบัะฐะฝ",
+syntax_selection: "--ะกะธะฝัะฐะบัะธั--",
+close_tab: "ะะฐัะฒะพัะธ ัะฐะนะปะฐ"
+};
diff --git a/includes/edit_area/langs/cs.js b/includes/edit_area/langs/cs.js
new file mode 100644
index 00000000..b09a2771
--- /dev/null
+++ b/includes/edit_area/langs/cs.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["cs"]={
+new_document: "Novรฝ dokument",
+search_button: "Najdi a nahraฤ",
+search_command: "Hledej dalลกรญ / otevลi vyhledรกvacรญ pole",
+search: "Hledej",
+replace: "Nahraฤ",
+replace_command: "Nahraฤ / otevลi vyhledรกvacรญ pole",
+find_next: "Najdi dalลกรญ",
+replace_all: "Nahraฤ vลกe",
+reg_exp: "platnรฉ vรฝrazy",
+match_case: "vyhodnocenรฉ vรฝrazy",
+not_found: "nenalezenรฉ.",
+occurrence_replaced: "vรฝskyty nahrazenรฉ.",
+search_field_empty: "Pole vyhledรกvรกnรญ je prรกzdnรฉ",
+restart_search_at_begin: "Dosaลพen konec souboru, zaฤรญnรกm od zaฤรกtku.",
+move_popup: "Pลesuล vyhledรกvacรญ okno",
+font_size: "--Velikost textu--",
+go_to_line: "Pลejdi na ลรกdek",
+go_to_line_prompt: "Pลejdi na ลรกdek:",
+undo: "krok zpฤt",
+redo: "znovu",
+change_smooth_selection: "Povolit nebo zakรกzat nฤkterรฉ ze zobrazenรฝch funkcรญ (รบฤelnฤjลกรญ zobrazenรญ poลพaduje vฤtลกรญ zatรญลพenรญ procesoru)",
+highlight: "Zvรฝrazลovรกnรญ syntaxe zap./vyp.",
+reset_highlight: "Obnovit zvรฝraznฤnรญ (v pลรญpadฤ nesrovnalostรญ)",
+word_wrap: "toggle word wrapping mode",
+help: "O programu",
+save: "Uloลพit",
+load: "Otevลรญt",
+line_abbr: "ล.",
+char_abbr: "S.",
+position: "Pozice",
+total: "Celkem",
+close_popup: "Zavลรญt okno",
+shortcuts: "Zkratky",
+add_tab: "Pลidat tabulovรกnรญ textu",
+remove_tab: "Odtsranit tabulovรกnรญ textu",
+about_notice: "Upozornฤnรญ! Funkce zvรฝrazลovรกnรญ textu je k dispozici pouze pro malรฝ text",
+toggle: "Pลepnout editor",
+accesskey: "Pลรญstupovรก klรกvesa",
+tab: "Zรกloลพka",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Zpracovรกvรกm ...",
+fullscreen: "Celรก obrazovka",
+syntax_selection: "--vyber zvรฝrazลovaฤ--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/de.js b/includes/edit_area/langs/de.js
new file mode 100644
index 00000000..f23ea7b4
--- /dev/null
+++ b/includes/edit_area/langs/de.js
@@ -0,0 +1,48 @@
+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 ",
+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--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/dk.js b/includes/edit_area/langs/dk.js
new file mode 100644
index 00000000..1381de2d
--- /dev/null
+++ b/includes/edit_area/langs/dk.js
@@ -0,0 +1,48 @@
+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 ",
+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--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/en.js b/includes/edit_area/langs/en.js
new file mode 100644
index 00000000..9209f894
--- /dev/null
+++ b/includes/edit_area/langs/en.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["en"]={
+new_document: "new empty document",
+search_button: "search and replace",
+search_command: "search next / open search area",
+search: "search",
+replace: "replace",
+replace_command: "replace / open search area",
+find_next: "find next",
+replace_all: "replace all",
+reg_exp: "regular expressions",
+match_case: "match case",
+not_found: "not found.",
+occurrence_replaced: "occurences replaced.",
+search_field_empty: "Search field empty",
+restart_search_at_begin: "End of area reached. Restart at begin.",
+move_popup: "move search popup",
+font_size: "--Font size--",
+go_to_line: "go to line",
+go_to_line_prompt: "go to line number:",
+undo: "undo",
+redo: "redo",
+change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
+highlight: "toggle syntax highlight on/off",
+reset_highlight: "reset highlight (if desyncronized from text)",
+word_wrap: "toggle word wrapping mode",
+help: "about",
+save: "save",
+load: "load",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Position",
+total: "Total",
+close_popup: "close popup",
+shortcuts: "Shortcuts",
+add_tab: "add tabulation to text",
+remove_tab: "remove tabulation to text",
+about_notice: "Notice: syntax highlight function is only for small text",
+toggle: "Toggle editor",
+accesskey: "Accesskey",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Processing...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/eo.js b/includes/edit_area/langs/eo.js
new file mode 100644
index 00000000..6583609c
--- /dev/null
+++ b/includes/edit_area/langs/eo.js
@@ -0,0 +1,48 @@
+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--",
+close_tab: "Fermi la dosieron"
+};
\ No newline at end of file
diff --git a/includes/edit_area/langs/es.js b/includes/edit_area/langs/es.js
new file mode 100644
index 00000000..3892c1cd
--- /dev/null
+++ b/includes/edit_area/langs/es.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["es"]={
+new_document: "nuevo documento vacรญo",
+search_button: "buscar y reemplazar",
+search_command: "buscar siguiente / abrir รกrea de bรบsqueda",
+search: "buscar",
+replace: "reemplazar",
+replace_command: "reemplazar / abrir รกrea de bรบsqueda",
+find_next: "encontrar siguiente",
+replace_all: "reemplazar todos",
+reg_exp: "expresiones regulares",
+match_case: "coincidir capitalizaciรณn",
+not_found: "no encontrado.",
+occurrence_replaced: "ocurrencias reemplazadas.",
+search_field_empty: "Campo de bรบsqueda vacรญo",
+restart_search_at_begin: "Se ha llegado al final del รกrea. Se va a seguir desde el principio.",
+move_popup: "mover la ventana de bรบsqueda",
+font_size: "--Tamaรฑo de la fuente--",
+go_to_line: "ir a la lรญnea",
+go_to_line_prompt: "ir a la lรญnea nรบmero:",
+undo: "deshacer",
+redo: "rehacer",
+change_smooth_selection: "activar/desactivar algunas caracterรญsticas de visualizaciรณn (visualizaciรณn mรกs inteligente pero mรกs carga de CPU)",
+highlight: "intercambiar resaltado de sintaxis",
+reset_highlight: "reinicializar resaltado (si no esta sincronizado con el texto)",
+word_wrap: "toggle word wrapping mode",
+help: "acerca",
+save: "guardar",
+load: "cargar",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Posiciรณn",
+total: "Total",
+close_popup: "recuadro de cierre",
+shortcuts: "Atajos",
+add_tab: "aรฑadir tabulado al texto",
+remove_tab: "borrar tabulado del texto",
+about_notice: "Aviso: el resaltado de sintaxis sรณlo funciona para texto pequeรฑo",
+toggle: "Cambiar editor",
+accesskey: "Tecla de acceso",
+tab: "Tab",
+shift: "Mayรบsc",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Procesando...",
+fullscreen: "pantalla completa",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/fi.js b/includes/edit_area/langs/fi.js
new file mode 100644
index 00000000..1837883e
--- /dev/null
+++ b/includes/edit_area/langs/fi.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["fi"]={
+new_document: "uusi tyhjรค dokumentti",
+search_button: "etsi ja korvaa",
+search_command: "etsi seuraava / avaa etsintรคvalikko",
+search: "etsi",
+replace: "korvaa",
+replace_command: "korvaa / avaa etsintรคvalikko",
+find_next: "etsi seuraava",
+replace_all: "korvaa kaikki",
+reg_exp: "sรครคnnรถlliset lausekkeet",
+match_case: "tรคsmรครค kirjainkokoon",
+not_found: "ei lรถytynyt.",
+occurrence_replaced: "esiintymรครค korvattu.",
+search_field_empty: "Haettava merkkijono on tyhjรค",
+restart_search_at_begin: "Alueen loppu saavutettiin. Aloitetaan alusta.",
+move_popup: "siirrรค etsintรคvalikkoa",
+font_size: "--Fontin koko--",
+go_to_line: "siirry riville",
+go_to_line_prompt: "mene riville:",
+undo: "peruuta",
+redo: "tee uudelleen",
+change_smooth_selection: "kytke/sammuta joitakin nรคyttรถtoimintoja (รlykkรครคmpi toiminta, mutta suurempi CPU kuormitus)",
+highlight: "kytke syntaksikorostus pรครคlle/pois",
+reset_highlight: "resetoi syntaksikorostus (jos teksti ei ole synkassa korostuksen kanssa)",
+word_wrap: "toggle word wrapping mode",
+help: "tietoja",
+save: "tallenna",
+load: "lataa",
+line_abbr: "Rv",
+char_abbr: "Pos",
+position: "Paikka",
+total: "Yhteensรค",
+close_popup: "sulje valikko",
+shortcuts: "Pikatoiminnot",
+add_tab: "lisรครค sisennys tekstiin",
+remove_tab: "poista sisennys tekstistรค",
+about_notice: "Huomautus: syntaksinkorostus toimii vain pienelle tekstille",
+toggle: "Kytke editori",
+accesskey: "Pikanรคppรคin",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Odota...",
+fullscreen: "koko ruutu",
+syntax_selection: "--Syntaksi--",
+close_tab: "Sulje tiedosto"
+};
\ No newline at end of file
diff --git a/includes/edit_area/langs/fr.js b/includes/edit_area/langs/fr.js
new file mode 100644
index 00000000..f7741633
--- /dev/null
+++ b/includes/edit_area/langs/fr.js
@@ -0,0 +1,48 @@
+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--",
+close_tab: "Fermer le fichier"
+};
diff --git a/includes/edit_area/langs/hr.js b/includes/edit_area/langs/hr.js
new file mode 100644
index 00000000..0429d3af
--- /dev/null
+++ b/includes/edit_area/langs/hr.js
@@ -0,0 +1,48 @@
+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--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/it.js b/includes/edit_area/langs/it.js
new file mode 100644
index 00000000..e614367d
--- /dev/null
+++ b/includes/edit_area/langs/it.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["it"]={
+new_document: "nuovo documento vuoto",
+search_button: "cerca e sostituisci",
+search_command: "trova successivo / apri finestra di ricerca",
+search: "cerca",
+replace: "sostituisci",
+replace_command: "sostituisci / apri finestra di ricerca",
+find_next: "trova successivo",
+replace_all: "sostituisci tutti",
+reg_exp: "espressioni regolari",
+match_case: "confronta maiuscole/minuscole ",
+not_found: "non trovato.",
+occurrence_replaced: "occorrenze sostituite.",
+search_field_empty: "Campo ricerca vuoto",
+restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
+move_popup: "sposta popup di ricerca",
+font_size: "-- Dimensione --",
+go_to_line: "vai alla linea",
+go_to_line_prompt: "vai alla linea numero:",
+undo: "annulla",
+redo: "ripeti",
+change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
+highlight: "abilita/disabilita colorazione della sintassi",
+reset_highlight: "aggiorna colorazione (se non sincronizzata)",
+word_wrap: "toggle word wrapping mode",
+help: "informazioni su...",
+save: "salva",
+load: "carica",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Posizione",
+total: "Totale",
+close_popup: "chiudi popup",
+shortcuts: "Scorciatoie",
+add_tab: "aggiungi tabulazione",
+remove_tab: "rimuovi tabulazione",
+about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
+toggle: "Abilita/disabilita editor",
+accesskey: "Accesskey",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "In corso...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/ja.js b/includes/edit_area/langs/ja.js
new file mode 100644
index 00000000..91b49093
--- /dev/null
+++ b/includes/edit_area/langs/ja.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["ja"]={
+new_document: "ๆฐ่ฆไฝๆ",
+search_button: "ๆค็ดขใป็ฝฎๆ",
+search_command: "ๆฌกใๆค็ดข / ๆค็ดข็ชใ่กจ็คบ",
+search: "ๆค็ดข",
+replace: "็ฝฎๆ",
+replace_command: "็ฝฎๆ / ็ฝฎๆ็ชใ่กจ็คบ",
+find_next: "ๆฌกใๆค็ดข",
+replace_all: "ๅ
จ็ฝฎๆ",
+reg_exp: "ๆญฃ่ฆ่กจ็พ",
+match_case: "ๅคงๆๅญๅฐๆๅญใฎๅบๅฅ",
+not_found: "่ฆใคใใใพใใใ",
+occurrence_replaced: "็ฝฎๆใใพใใใ",
+search_field_empty: "ๆค็ดขๅฏพ่ฑกๆๅญๅใ็ฉบใงใใ",
+restart_search_at_begin: "็ต็ซฏใซ้ใใพใใใๅงใใซๆปใใพใ",
+move_popup: "ๆค็ดข็ชใ็งปๅ",
+font_size: "--ใใฉใณใใตใคใบ--",
+go_to_line: "ๆๅฎ่กใธ็งปๅ",
+go_to_line_prompt: "ๆๅฎ่กใธ็งปๅใใพใ:",
+undo: "ๅ
ใซๆปใ",
+redo: "ใใ็ดใ",
+change_smooth_selection: "ในใ ใผใน่กจ็คบใฎๅใๆฟใ๏ผCPUใไฝฟใใพใ๏ผ",
+highlight: "ๆงๆๅผท่ชฟ่กจ็คบใฎๅใๆฟใ",
+reset_highlight: "ๆงๆๅผท่ชฟ่กจ็คบใฎใชใปใใ",
+word_wrap: "toggle word wrapping mode",
+help: "ใใซใใ่กจ็คบ",
+save: "ไฟๅญ",
+load: "่ชญใฟ่พผใฟ",
+line_abbr: "่ก",
+char_abbr: "ๆๅญ",
+position: "ไฝ็ฝฎ",
+total: "ๅ่จ",
+close_popup: "ใใใใขใใใ้ใใ",
+shortcuts: "ใทใงใผใใซใใ",
+add_tab: "ใฟใใๆฟๅ
ฅใใ",
+remove_tab: "ใฟใใๅ้คใใ",
+about_notice: "ๆณจๆ๏ผๆงๆๅผท่ชฟ่กจ็คบใฏ็ญใใใญในใใงใใๆๅนใซๆฉ่ฝใใพใใใ",
+toggle: "ใใญในใใจใชใขใจeditAreaใฎๅใๆฟใ",
+accesskey: "ใขใฏใปในใญใผ",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "ๅฆ็ไธญใงใ...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/mk.js b/includes/edit_area/langs/mk.js
new file mode 100644
index 00000000..4e14d128
--- /dev/null
+++ b/includes/edit_area/langs/mk.js
@@ -0,0 +1,48 @@
+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: "--ะกะธะฝัะฐะบัะฐ--",
+close_tab: "ะะทะฑะตัะธ ะดะฐัะพัะตะบะฐ"
+};
diff --git a/includes/edit_area/langs/nl.js b/includes/edit_area/langs/nl.js
new file mode 100644
index 00000000..84aa1771
--- /dev/null
+++ b/includes/edit_area/langs/nl.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["nl"]={
+new_document: "nieuw leeg document",
+search_button: "zoek en vervang",
+search_command: "zoek volgende / zoekscherm openen",
+search: "zoek",
+replace: "vervang",
+replace_command: "vervang / zoekscherm openen",
+find_next: "volgende vinden",
+replace_all: "alles vervangen",
+reg_exp: "reguliere expressies",
+match_case: "hoofdletter gevoelig",
+not_found: "niet gevonden.",
+occurrence_replaced: "object vervangen.",
+search_field_empty: "Zoek veld leeg",
+restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
+move_popup: "versleep zoek scherm",
+font_size: "--Letter grootte--",
+go_to_line: "Ga naar regel",
+go_to_line_prompt: "Ga naar regel nummer:",
+undo: "Ongedaan maken",
+redo: "Opnieuw doen",
+change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
+highlight: "zet syntax highlight aan/uit",
+reset_highlight: "reset highlight (indien gedesynchronizeerd)",
+word_wrap: "toggle word wrapping mode",
+help: "informatie",
+save: "opslaan",
+load: "laden",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Positie",
+total: "Totaal",
+close_popup: "Popup sluiten",
+shortcuts: "Snelkoppelingen",
+add_tab: "voeg tabs toe in tekst",
+remove_tab: "verwijder tabs uit tekst",
+about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
+toggle: "geavanceerde bewerkingsopties",
+accesskey: "Accessknop",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Verwerken...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/pl.js b/includes/edit_area/langs/pl.js
new file mode 100644
index 00000000..ae03d604
--- /dev/null
+++ b/includes/edit_area/langs/pl.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["pl"]={
+new_document: "nowy dokument",
+search_button: "znajdลบ i zamieล",
+search_command: "znajdลบ nastฤpny",
+search: "znajdลบ",
+replace: "zamieล",
+replace_command: "zamieล",
+find_next: "nastฤpny",
+replace_all: "zamieล wszystko",
+reg_exp: "wyraลผenie regularne",
+match_case: "uwzglฤdnij wielkoลฤ liter ",
+not_found: "nie znaleziono.",
+occurrence_replaced: "wystฤ
pieล zamieniono.",
+search_field_empty: "Nie wprowadzono tekstu",
+restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od poczฤ
tku.",
+move_popup: "przesuล okienko wyszukiwania",
+font_size: "Rozmiar",
+go_to_line: "idลบ do linii",
+go_to_line_prompt: "numer linii:",
+undo: "cofnij",
+redo: "przywrรณฤ",
+change_smooth_selection: "wลฤ
cz/wyลฤ
cz niektรณre opcje wyglฤ
du (zaawansowane opcje wyglฤ
du obciฤ
ลผajฤ
procesor)",
+highlight: "wลฤ
cz/wyลฤ
cz podลwietlanie skลadni",
+reset_highlight: "odลwieลผ podลwietlanie skลadni (jeลli rozsynchronizowaลo siฤ z tekstem)",
+word_wrap: "toggle word wrapping mode",
+help: "o programie",
+save: "zapisz",
+load: "otwรณrz",
+line_abbr: "Ln",
+char_abbr: "Zn",
+position: "Pozycja",
+total: "W sumie",
+close_popup: "zamknij okienko",
+shortcuts: "Skrรณty klawiaturowe",
+add_tab: "dodaj wciฤcie do zaznaczonego tekstu",
+remove_tab: "usuล wciฤcie",
+about_notice: "Uwaga: podลwietlanie skลadni nie jest zalecane dla dลugich tekstรณw",
+toggle: "Wลฤ
cz/wyลฤ
cz edytor",
+accesskey: "Alt+",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Przetwarzanie...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/pt.js b/includes/edit_area/langs/pt.js
new file mode 100644
index 00000000..d785ec12
--- /dev/null
+++ b/includes/edit_area/langs/pt.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["pt"]={
+new_document: "Novo documento",
+search_button: "Localizar e substituir",
+search_command: "Localizar prรณximo",
+search: "Localizar",
+replace: "Substituir",
+replace_command: "Substituir",
+find_next: "Localizar",
+replace_all: "Subst. tudo",
+reg_exp: "Expressรตes regulares",
+match_case: "Diferenciar maiรบsculas e minรบsculas",
+not_found: "Nรฃo encontrado.",
+occurrence_replaced: "Ocorrรชncias substituidas",
+search_field_empty: "Campo localizar vazio.",
+restart_search_at_begin: "Fim das ocorrรชncias. Recomeรงar do inicio.",
+move_popup: "Mover janela",
+font_size: "--Tamanho da fonte--",
+go_to_line: "Ir para linha",
+go_to_line_prompt: "Ir para a linha:",
+undo: "Desfazer",
+redo: "Refazer",
+change_smooth_selection: "Opรงรตes visuais",
+highlight: "Cores de sintaxe",
+reset_highlight: "Resetar cores (se nรฃo sincronizado)",
+word_wrap: "toggle word wrapping mode",
+help: "Sobre",
+save: "Salvar",
+load: "Carregar",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Posiรงรฃo",
+total: "Total",
+close_popup: "Fechar",
+shortcuts: "Shortcuts",
+add_tab: "Adicionar tabulaรงรฃo",
+remove_tab: "Remover tabulaรงรฃo",
+about_notice: "Atenรงรฃo: Cores de sintaxe sรฃo indicados somente para textos pequenos",
+toggle: "Exibir editor",
+accesskey: "Accesskey",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Processando...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/ru.js b/includes/edit_area/langs/ru.js
new file mode 100644
index 00000000..081e6b08
--- /dev/null
+++ b/includes/edit_area/langs/ru.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["ru"]={
+new_document: "ะฝะพะฒัะน ะฟัััะพะน ะดะพะบัะผะตะฝั",
+search_button: "ะฟะพะธัะบ ะธ ะทะฐะผะตะฝะฐ",
+search_command: "ะธัะบะฐัั ัะปะตะดัััะธะน / ะพัะบัััั ะฟะฐะฝะตะปั ะฟะพะธัะบะฐ",
+search: "ะฟะพะธัะบ",
+replace: "ะทะฐะผะตะฝะฐ",
+replace_command: "ะทะฐะผะตะฝะธัั / ะพัะบัััั ะฟะฐะฝะตะปั ะฟะพะธัะบะฐ",
+find_next: "ะฝะฐะนัะธ ัะปะตะดัััะตะต",
+replace_all: "ะทะฐะผะตะฝะธัั ะฒัะต",
+reg_exp: "ัะตะณัะปััะฝะพะต ะฒััะฐะถะตะฝะธะต",
+match_case: "ััะธััะฒะฐัั ัะตะณะธััั",
+not_found: "ะฝะต ะฝะฐะนะดะตะฝะพ.",
+occurrence_replaced: "ะฒั
ะพะถะดะตะฝะธะต ะทะฐะผะตะฝะตะฝะพ.",
+search_field_empty: "ะะพะปะต ะฟะพะธัะบะฐ ะฟัััะพะต",
+restart_search_at_begin: "ะะพััะธะณะฝัั ะบะพะฝะตั ะดะพะบัะผะตะฝัะฐ. ะะฐัะธะฝะฐั ั ะฝะฐัะฐะปะฐ.",
+move_popup: "ะฟะตัะตะผะตััะธัั ะพะบะฝะพ ะฟะพะธัะบะฐ",
+font_size: "--ะ ะฐะทะผะตั ััะธััะฐ--",
+go_to_line: "ะฟะตัะตะนัะธ ะบ ัััะพะบะต",
+go_to_line_prompt: "ะฟะตัะตะนัะธ ะบ ัััะพะบะต ะฝะพะผะตั:",
+undo: "ะพัะผะตะฝะธัั",
+redo: "ะฒะตัะฝััั",
+change_smooth_selection: "ะฒะบะปััะธัั/ะพัะบะปััะธัั ะฝะตะบะพัะพััะต ััะฝะบัะธะธ ะฟัะพัะผะพััะฐ (ะฑะพะปะตะต ะบัะฐัะธะฒะพ, ะฝะพ ะฑะพะปััะต ะธัะฟะพะปัะทัะตั ะฟัะพัะตััะพั)",
+highlight: "ะฟะตัะตะบะปััะธัั ะฟะพะดัะฒะตัะบั ัะธะฝัะฐะบัะธัะฐ ะฒะบะปััะตะฝะฐ/ะฒัะบะปััะตะฝะฐ",
+reset_highlight: "ะฒะพัััะฐะฝะพะฒะธัั ะฟะพะดัะฒะตัะบั (ะตัะปะธ ัะฐะทัะธะฝั
ัะพะฝะธะทะธัะพะฒะฐะฝะฐ ะพั ัะตะบััะฐ)",
+word_wrap: "toggle word wrapping mode",
+help: "ะพ ะฟัะพะณัะฐะผะผะต",
+save: "ัะพั
ัะฐะฝะธัั",
+load: "ะทะฐะณััะทะธัั",
+line_abbr: "ะกัั",
+char_abbr: "ะกัะปะฑ",
+position: "ะะพะทะธัะธั",
+total: "ะัะตะณะพ",
+close_popup: "ะทะฐะบัััั ะฒัะฟะปัะฒะฐััะตะต ะพะบะฝะพ",
+shortcuts: "ะะพัััะธะต ะบะปะฐะฒะธัะธ",
+add_tab: "ะดะพะฑะฐะฒะธัั ัะฐะฑัะปััะธั ะฒ ัะตะบัั",
+remove_tab: "ัะฑัะฐัั ัะฐะฑัะปััะธั ะธะท ัะตะบััะฐ",
+about_notice: "ะะฝะธะผะฐะฝะธะต: ััะฝะบัะธั ะฟะพะดัะฒะตัะบะธ ัะธะฝัะฐะบัะธัะฐ ัะพะปัะบะพ ะดะปั ะฝะตะฑะพะปััะธั
ัะตะบััะพะฒ",
+toggle: "ะะตัะตะบะปััะธัั ัะตะดะฐะบัะพั",
+accesskey: "ะะพัััะฐั ะบะปะฐะฒะธัะฐ",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "ะะฑัะฐะฑะพัะบะฐ...",
+fullscreen: "ะฟะพะปะฝัะน ัะบัะฐะฝ",
+syntax_selection: "--ะกะธะฝัะฐะบั--",
+close_tab: "ะะฐะบัััั ัะฐะนะป"
+};
diff --git a/includes/edit_area/langs/sk.js b/includes/edit_area/langs/sk.js
new file mode 100644
index 00000000..c0b95c30
--- /dev/null
+++ b/includes/edit_area/langs/sk.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["sk"]={
+new_document: "novรฝ prรกzdy dokument",
+search_button: "vyhฤพadaj a nahraฤ",
+search_command: "hฤพadaj ฤalsลกie / otvor vyhฤพadรกvacie pole",
+search: "hฤพadaj",
+replace: "nahraฤ",
+replace_command: "nahraฤ / otvor vyhฤพadรกvacie pole",
+find_next: "nรกjdi ฤalลกie",
+replace_all: "nahraฤ vลกetko",
+reg_exp: "platnรฉ vรฝrazy",
+match_case: "zhodujรบce sa vรฝrazy",
+not_found: "nenรกjdenรฉ.",
+occurrence_replaced: "vรฝskyty nahradenรฉ.",
+search_field_empty: "Pole vyhฤพadรกvanie je prรกdzne",
+restart_search_at_begin: "End of area reached. Restart at begin.",
+move_popup: "presuล vyhฤพadรกvacie okno",
+font_size: "--Veฤพkosลฅ textu--",
+go_to_line: "prejdi na riadok",
+go_to_line_prompt: "prejdi na riadok:",
+undo: "krok spรคลฅ",
+redo: "prepracovaลฅ",
+change_smooth_selection: "povoliลฅ/zamietnรบลฅ niektorรฉ zo zobrazenรฝch funkciรญ (รบฤelnejลกie zobrazenie vyลพaduje vรคฤลกie zaลฅaลพenie procesora CPU)",
+highlight: "prepnรบลฅ zvรฝrazลovanie syntaxe zap/vyp",
+reset_highlight: "zruลกiลฅ zvรฝrazลovanie (ak je nesynchronizovanรฉ s textom)",
+word_wrap: "toggle word wrapping mode",
+help: "o programe",
+save: "uloลพiลฅ",
+load: "naฤรญtaลฅ",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Pozรญcia",
+total: "Spolu",
+close_popup: "zavrieลฅ okno",
+shortcuts: "Skratky",
+add_tab: "pridaลฅ tabulovanie textu",
+remove_tab: "odstrรกniลฅ tabulovanie textu",
+about_notice: "Upozornenie: funkcia zvรฝrazลovania syntaxe je dostupnรก iba pre malรฝ text",
+toggle: "Prepnรบลฅ editor",
+accesskey: "Accesskey",
+tab: "Zรกloลพka",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Spracรบvam...",
+fullscreen: "cel=a obrazovka",
+syntax_selection: "--Vyber Syntax--",
+close_tab: "Close file"
+};
diff --git a/includes/edit_area/langs/zh.js b/includes/edit_area/langs/zh.js
new file mode 100644
index 00000000..e51c5320
--- /dev/null
+++ b/includes/edit_area/langs/zh.js
@@ -0,0 +1,48 @@
+editAreaLoader.lang["zh"]={
+new_document: "ๆฐๅปบ็ฉบ็ฝๆๆกฃ",
+search_button: "ๆฅๆพไธๆฟๆข",
+search_command: "ๆฅๆพไธไธไธช / ๆๅผๆฅๆพๆก",
+search: "ๆฅๆพ",
+replace: "ๆฟๆข",
+replace_command: "ๆฟๆข / ๆๅผๆฅๆพๆก",
+find_next: "ๆฅๆพไธไธไธช",
+replace_all: "ๅ
จ้จๆฟๆข",
+reg_exp: "ๆญฃๅ่กจ่พพๅผ",
+match_case: "ๅน้
ๅคงๅฐๅ",
+not_found: "ๆชๆพๅฐ.",
+occurrence_replaced: "ๅค่ขซๆฟๆข.",
+search_field_empty: "ๆฅๆพๆกๆฒกๆๅ
ๅฎน",
+restart_search_at_begin: "ๅทฒๅฐๅฐๆๆกฃๆซๅฐพ. ไปๅคด้ๆฐๆฅๆพ.",
+move_popup: "็งปๅจๆฅๆพๅฏน่ฏๆก",
+font_size: "--ๅญไฝๅคงๅฐ--",
+go_to_line: "่ฝฌๅฐ่ก",
+go_to_line_prompt: "่ฝฌๅฐ่ก:",
+undo: "ๆขๅค",
+redo: "้ๅ",
+change_smooth_selection: "ๅฏ็จ/็ฆๆญขไธไบๆพ็คบ็นๆง(ๆดๅฅฝ็ไฝๆด่่ดน่ตๆบ)",
+highlight: "ๅฏ็จ/็ฆๆญข่ฏญๆณ้ซไบฎ",
+reset_highlight: "้็ฝฎ่ฏญๆณ้ซไบฎ(ๅฝๆๆฌๆพ็คบไธๅๆญฅๆถ)",
+word_wrap: "toggle word wrapping mode",
+help: "ๅ
ณไบ",
+save: "ไฟๅญ",
+load: "ๅ ่ฝฝ",
+line_abbr: "่ก",
+char_abbr: "ๅญ็ฌฆ",
+position: "ไฝ็ฝฎ",
+total: "ๆป่ฎก",
+close_popup: "ๅ
ณ้ญๅฏน่ฏๆก",
+shortcuts: "ๅฟซๆท้ฎ",
+add_tab: "ๆทปๅ ๅถ่กจ็ฌฆ(Tab)",
+remove_tab: "็งป้คๅถ่กจ็ฌฆ(Tab)",
+about_notice: "ๆณจๆ๏ผ่ฏญๆณ้ซไบฎๅ่ฝไป
็จไบ่พๅฐๅ
ๅฎน็ๆๆฌ(ๆไปถๅ
ๅฎนๅคชๅคงไผๅฏผ่ดๆต่งๅจๅๅบๆ
ข)",
+toggle: "ๅๆข็ผ่พๅจ",
+accesskey: "ๅฟซๆท้ฎ",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "ๆญฃๅจๅค็ไธญ...",
+fullscreen: "ๅ
จๅฑ็ผ่พ",
+syntax_selection: "--่ฏญๆณ--",
+close_tab: "ๅ
ณ้ญๆไปถ"
+};
diff --git a/includes/edit_area/license_apache.txt b/includes/edit_area/license_apache.txt
new file mode 100644
index 00000000..38311718
--- /dev/null
+++ b/includes/edit_area/license_apache.txt
@@ -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.
\ No newline at end of file
diff --git a/includes/edit_area/license_bsd.txt b/includes/edit_area/license_bsd.txt
new file mode 100644
index 00000000..d97ebee4
--- /dev/null
+++ b/includes/edit_area/license_bsd.txt
@@ -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.
\ No newline at end of file
diff --git a/includes/edit_area/license_lgpl.txt b/includes/edit_area/license_lgpl.txt
new file mode 100644
index 00000000..8c177f8b
--- /dev/null
+++ b/includes/edit_area/license_lgpl.txt
@@ -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
diff --git a/includes/edit_area/manage_area.js b/includes/edit_area/manage_area.js
new file mode 100644
index 00000000..8538598e
--- /dev/null
+++ b/includes/edit_area/manage_area.js
@@ -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 = ''+ content.replace(/&/g,"&").replace(//g,">").replace("\r\r", ' ').replace("\r\r", ' ') +' ';
+
+ if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
+ this.selection_field.innerHTML= "" + content.replace(/^\r?\n/, " ") + " ";
+ } 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=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=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 = ""+lineContent.substr(0, cur_pos).replace(/&/g,"&").replace(/"+lineContent.substr(cur_pos).replace(/&/g,"&").replace(/";
+ if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
+ elem.innerHTML= "" + content.replace(/^\r?\n/, " ") + " ";
+ } 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(/" + content.replace(/^\r?\n/, " ") + "";
+ } 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;
+ };
\ No newline at end of file
diff --git a/includes/edit_area/plugins/charmap/charmap.js b/includes/edit_area/plugins/charmap/charmap.js
new file mode 100644
index 00000000..631e92ed
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/charmap.js
@@ -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);
diff --git a/includes/edit_area/plugins/charmap/css/charmap.css b/includes/edit_area/plugins/charmap/css/charmap.css
new file mode 100644
index 00000000..c4475091
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/css/charmap.css
@@ -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;
+}
diff --git a/includes/edit_area/plugins/charmap/images/charmap.gif b/includes/edit_area/plugins/charmap/images/charmap.gif
new file mode 100644
index 00000000..3cdc4ac9
Binary files /dev/null and b/includes/edit_area/plugins/charmap/images/charmap.gif differ
diff --git a/includes/edit_area/plugins/charmap/jscripts/map.js b/includes/edit_area/plugins/charmap/jscripts/map.js
new file mode 100644
index 00000000..e6008473
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/jscripts/map.js
@@ -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"+ String.fromCharCode(i) +"";
+ }
+ 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();
+}
diff --git a/includes/edit_area/plugins/charmap/langs/bg.js b/includes/edit_area/plugins/charmap/langs/bg.js
new file mode 100644
index 00000000..1755beb0
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/bg.js
@@ -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:"ะฟะพััะฐะฒะธ ัะพะทะธ ัะธะผะฒะพะป"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/cs.js b/includes/edit_area/plugins/charmap/langs/cs.js
new file mode 100644
index 00000000..ff1a566d
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/cs.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/de.js b/includes/edit_area/plugins/charmap/langs/de.js
new file mode 100644
index 00000000..8c420d1d
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/de.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/dk.js b/includes/edit_area/plugins/charmap/langs/dk.js
new file mode 100644
index 00000000..c25fd987
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/dk.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/en.js b/includes/edit_area/plugins/charmap/langs/en.js
new file mode 100644
index 00000000..b9defcef
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/en.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/eo.js b/includes/edit_area/plugins/charmap/langs/eo.js
new file mode 100644
index 00000000..d7a5d266
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/eo.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/es.js b/includes/edit_area/plugins/charmap/langs/es.js
new file mode 100644
index 00000000..42fd0bd9
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/es.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/fr.js b/includes/edit_area/plugins/charmap/langs/fr.js
new file mode 100644
index 00000000..f8f1100f
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/fr.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/hr.js b/includes/edit_area/plugins/charmap/langs/hr.js
new file mode 100644
index 00000000..ff73127e
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/hr.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/it.js b/includes/edit_area/plugins/charmap/langs/it.js
new file mode 100644
index 00000000..b55d777e
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/it.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/ja.js b/includes/edit_area/plugins/charmap/langs/ja.js
new file mode 100644
index 00000000..9d7dd173
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/ja.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/mk.js b/includes/edit_area/plugins/charmap/langs/mk.js
new file mode 100644
index 00000000..2896b0bd
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/mk.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/nl.js b/includes/edit_area/plugins/charmap/langs/nl.js
new file mode 100644
index 00000000..fb2ed44a
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/nl.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/pl.js b/includes/edit_area/plugins/charmap/langs/pl.js
new file mode 100644
index 00000000..a4237b4f
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/pl.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/pt.js b/includes/edit_area/plugins/charmap/langs/pt.js
new file mode 100644
index 00000000..8e04d5e8
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/pt.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/ru.js b/includes/edit_area/plugins/charmap/langs/ru.js
new file mode 100644
index 00000000..8da6bbb6
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/ru.js
@@ -0,0 +1,6 @@
+editArea.add_lang("ru",{
+charmap_but: "ะะธะทัะฐะปัะฝะฐั ะบะปะฐะฒะธะฐัััะฐ",
+charmap_title: "ะะธะทัะฐะปัะฝะฐั ะบะปะฐะฒะธะฐัััะฐ",
+charmap_choose_block: "ะฒัะฑัะฐัั ัะทัะบะพะฒะพะน ะฑะปะพะบ",
+charmap_insert:"ะฒััะฐะฒะธัั ััะพั ัะธะผะฒะพะป"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/sk.js b/includes/edit_area/plugins/charmap/langs/sk.js
new file mode 100644
index 00000000..5ead1326
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/sk.js
@@ -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"
+});
diff --git a/includes/edit_area/plugins/charmap/langs/zh.js b/includes/edit_area/plugins/charmap/langs/zh.js
new file mode 100644
index 00000000..8f593518
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/langs/zh.js
@@ -0,0 +1,6 @@
+editArea.add_lang("zh",{
+charmap_but: "่ฝฏ้ฎ็",
+charmap_title: "่ฝฏ้ฎ็",
+charmap_choose_block: "้ๆฉไธไธช่ฏญ่จๅ",
+charmap_insert:"ๆๅ
ฅๆญคๅญ็ฌฆ"
+});
diff --git a/includes/edit_area/plugins/charmap/popup.html b/includes/edit_area/plugins/charmap/popup.html
new file mode 100644
index 00000000..a8f5963d
--- /dev/null
+++ b/includes/edit_area/plugins/charmap/popup.html
@@ -0,0 +1,24 @@
+
+
+
+
+{$charmap_title}
+
+
+
+
+
+
+
+{$charmap_title}:
+
+
+
+
+
+
+
+
+
+
diff --git a/includes/edit_area/plugins/test/css/test.css b/includes/edit_area/plugins/test/css/test.css
new file mode 100644
index 00000000..1c206591
--- /dev/null
+++ b/includes/edit_area/plugins/test/css/test.css
@@ -0,0 +1,3 @@
+select#test_select{
+ background-color: #FF0000;
+}
diff --git a/includes/edit_area/plugins/test/images/test.gif b/includes/edit_area/plugins/test/images/test.gif
new file mode 100644
index 00000000..1ab5da44
Binary files /dev/null and b/includes/edit_area/plugins/test/images/test.gif differ
diff --git a/includes/edit_area/plugins/test/langs/bg.js b/includes/edit_area/plugins/test/langs/bg.js
new file mode 100644
index 00000000..dde4f5e7
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/bg.js
@@ -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: "ัะตััะฒะฐะน ะบะพะฟะธะตัะพ"
+});
diff --git a/includes/edit_area/plugins/test/langs/cs.js b/includes/edit_area/plugins/test/langs/cs.js
new file mode 100644
index 00000000..49713c96
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/cs.js
@@ -0,0 +1,4 @@
+editArea.add_lang("cs",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/de.js b/includes/edit_area/plugins/test/langs/de.js
new file mode 100644
index 00000000..9a758729
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/de.js
@@ -0,0 +1,4 @@
+editArea.add_lang("de",{
+test_select: "Tag auswählen",
+test_but: "Test Button"
+});
diff --git a/includes/edit_area/plugins/test/langs/dk.js b/includes/edit_area/plugins/test/langs/dk.js
new file mode 100644
index 00000000..c5e5748a
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/dk.js
@@ -0,0 +1,4 @@
+editArea.add_lang("dk",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/en.js b/includes/edit_area/plugins/test/langs/en.js
new file mode 100644
index 00000000..30d7a2ca
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/en.js
@@ -0,0 +1,4 @@
+editArea.add_lang("en",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/eo.js b/includes/edit_area/plugins/test/langs/eo.js
new file mode 100644
index 00000000..267c7340
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/eo.js
@@ -0,0 +1,4 @@
+editArea.add_lang("eo",{
+test_select:"elekto de marko",
+test_but: "provo-butono"
+});
diff --git a/includes/edit_area/plugins/test/langs/es.js b/includes/edit_area/plugins/test/langs/es.js
new file mode 100644
index 00000000..d89b14e8
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/es.js
@@ -0,0 +1,4 @@
+editArea.add_lang("es",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/fr.js b/includes/edit_area/plugins/test/langs/fr.js
new file mode 100644
index 00000000..12a8fed7
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/fr.js
@@ -0,0 +1,4 @@
+editArea.add_lang("fr",{
+test_select:"choix balise",
+test_but: "bouton de test"
+});
diff --git a/includes/edit_area/plugins/test/langs/hr.js b/includes/edit_area/plugins/test/langs/hr.js
new file mode 100644
index 00000000..a23dddeb
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/hr.js
@@ -0,0 +1,4 @@
+editArea.add_lang("hr",{
+test_select: "Odaberi tag",
+test_but: "Probna tipka"
+});
diff --git a/includes/edit_area/plugins/test/langs/it.js b/includes/edit_area/plugins/test/langs/it.js
new file mode 100644
index 00000000..7a40d4bb
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/it.js
@@ -0,0 +1,4 @@
+editArea.add_lang("it",{
+test_select: "seleziona tag",
+test_but: "pulsante di test"
+});
diff --git a/includes/edit_area/plugins/test/langs/ja.js b/includes/edit_area/plugins/test/langs/ja.js
new file mode 100644
index 00000000..53dc51cf
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/ja.js
@@ -0,0 +1,4 @@
+editArea.add_lang("ja",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/mk.js b/includes/edit_area/plugins/test/langs/mk.js
new file mode 100644
index 00000000..7db252d3
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/mk.js
@@ -0,0 +1,4 @@
+editArea.add_lang("mk",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/nl.js b/includes/edit_area/plugins/test/langs/nl.js
new file mode 100644
index 00000000..3ce9c268
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/nl.js
@@ -0,0 +1,4 @@
+editArea.add_lang("nl",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/pl.js b/includes/edit_area/plugins/test/langs/pl.js
new file mode 100644
index 00000000..161b87cd
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/pl.js
@@ -0,0 +1,4 @@
+editArea.add_lang("pl",{
+test_select: "wybierz tag",
+test_but: "test"
+});
diff --git a/includes/edit_area/plugins/test/langs/pt.js b/includes/edit_area/plugins/test/langs/pt.js
new file mode 100644
index 00000000..f96606cd
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/pt.js
@@ -0,0 +1,4 @@
+editArea.add_lang("pt",{
+test_select: "select tag",
+test_but: "test button"
+});
diff --git a/includes/edit_area/plugins/test/langs/ru.js b/includes/edit_area/plugins/test/langs/ru.js
new file mode 100644
index 00000000..621c0d4e
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/ru.js
@@ -0,0 +1,4 @@
+editArea.add_lang("ru",{
+test_select: "ะฒัะฑัะฐัั ััะณ",
+test_but: "ัะตััะธัะพะฒะฐัั ะบะฝะพะฟะบั"
+});
diff --git a/includes/edit_area/plugins/test/langs/sk.js b/includes/edit_area/plugins/test/langs/sk.js
new file mode 100644
index 00000000..e47acbf2
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/sk.js
@@ -0,0 +1,4 @@
+editArea.add_lang("sk",{
+test_select: "vyber tag",
+test_but: "testovacie tlaฤidlo"
+});
diff --git a/includes/edit_area/plugins/test/langs/zh.js b/includes/edit_area/plugins/test/langs/zh.js
new file mode 100644
index 00000000..0f462a98
--- /dev/null
+++ b/includes/edit_area/plugins/test/langs/zh.js
@@ -0,0 +1,4 @@
+editArea.add_lang("zh",{
+test_select: "้ๆฉๆ ็ญพ",
+test_but: "ๆต่ฏๆ้ฎ"
+});
diff --git a/includes/edit_area/plugins/test/test.js b/includes/edit_area/plugins/test/test.js
new file mode 100644
index 00000000..43626e4a
--- /dev/null
+++ b/includes/edit_area/plugins/test/test.js
@@ -0,0 +1,110 @@
+/**
+ * Plugin designed for test prupose. It add a button (that manage an alert) and a select (that allow to insert tags) in the toolbar.
+ * This plugin also disable the "f" key in the editarea, and load a CSS and a JS file
+ */
+var EditArea_test= {
+ /**
+ * Get called once this file is loaded (editArea still not initialized)
+ *
+ * @return nothing
+ */
+ init: function(){
+ // alert("test init: "+ this._someInternalFunction(2, 3));
+ editArea.load_css(this.baseURL+"css/test.css");
+ editArea.load_script(this.baseURL+"test2.js");
+ }
+ /**
+ * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
+ * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
+ * Language variables such as {$lang_somekey} will also be replaced with contents from
+ * the language packs.
+ *
+ * @param {string} ctrl_name: the name of the control to add
+ * @return HTML code for a specific control or false.
+ * @type string or boolean
+ */
+ ,get_control_html: function(ctrl_name){
+ switch(ctrl_name){
+ case "test_but":
+ // Control id, button img, command
+ return parent.editAreaLoader.get_button_html('test_but', 'test.gif', 'test_cmd', false, this.baseURL);
+ case "test_select":
+ html= ""
+ +" {$test_select} "
+ +" h1 "
+ +" h2 "
+ +" h3 "
+ +" h4 "
+ +" h5 "
+ +" h6 "
+ +" ";
+ return html;
+ }
+ return false;
+ }
+ /**
+ * Get called once EditArea is fully loaded and initialised
+ *
+ * @return nothing
+ */
+ ,onload: function(){
+ alert("test load");
+ }
+
+ /**
+ * Is called each time the user touch a keyboard key.
+ *
+ * @param (event) e: the keydown event
+ * @return true - pass to next handler in chain, false - stop chain execution
+ * @type boolean
+ */
+ ,onkeydown: function(e){
+ var str= String.fromCharCode(e.keyCode);
+ // desactivate the "f" character
+ if(str.toLowerCase()=="f"){
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Executes a specific command, this function handles plugin commands.
+ *
+ * @param {string} cmd: the name of the command being executed
+ * @param {unknown} param: the parameter of the command
+ * @return true - pass to next handler in chain, false - stop chain execution
+ * @type boolean
+ */
+ ,execCommand: function(cmd, param){
+ // Handle commands
+ switch(cmd){
+ case "test_select_change":
+ var val= document.getElementById("test_select").value;
+ if(val!=-1)
+ parent.editAreaLoader.insertTags(editArea.id, "<"+val+">", ""+val+">");
+ document.getElementById("test_select").options[0].selected=true;
+ return false;
+ case "test_cmd":
+ alert("user clicked on test_cmd");
+ return false;
+ }
+ // Pass to next handler in chain
+ return true;
+ }
+
+ /**
+ * This is just an internal plugin method, prefix all internal methods with a _ character.
+ * The prefix is needed so they doesn't collide with future EditArea callback functions.
+ *
+ * @param {string} a Some arg1.
+ * @param {string} b Some arg2.
+ * @return Some return.
+ * @type unknown
+ */
+ ,_someInternalFunction : function(a, b) {
+ return a+b;
+ }
+};
+
+// Adds the plugin class to the list of available EditArea plugins
+editArea.add_plugin("test", EditArea_test);
diff --git a/includes/edit_area/plugins/test/test2.js b/includes/edit_area/plugins/test/test2.js
new file mode 100644
index 00000000..44a01b61
--- /dev/null
+++ b/includes/edit_area/plugins/test/test2.js
@@ -0,0 +1 @@
+alert("test2.js is loaded from test plugin");
diff --git a/includes/edit_area/reg_syntax.js b/includes/edit_area/reg_syntax.js
new file mode 100644
index 00000000..572aff30
--- /dev/null
+++ b/includes/edit_area/reg_syntax.js
@@ -0,0 +1,166 @@
+ EditAreaLoader.prototype.get_regexp= function(text_array){
+ //res="( |=|\\n|\\r|\\[|\\(|ยต|)(";
+ res="(\\b)(";
+ for(i=0; i0)
+ res+="|";
+ //res+="("+ tab_text[i] +")";
+ //res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
+ res+=this.get_escaped_regexp(text_array[i]);
+ }
+ //res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
+ res+=")(\\b)";
+ reg= new RegExp(res);
+
+ return res;
+ };
+
+
+ EditAreaLoader.prototype.get_escaped_regexp= function(str){
+ return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
+ };
+
+ EditAreaLoader.prototype.init_syntax_regexp= function(){
+ var lang_style= {};
+ for(var lang in this.load_syntax){
+ if(!this.syntax[lang]) // init the regexp if not already initialized
+ {
+ this.syntax[lang]= {};
+ this.syntax[lang]["keywords_reg_exp"]= {};
+ this.keywords_reg_exp_nb=0;
+
+ if(this.load_syntax[lang]['KEYWORDS']){
+ param="g";
+ if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
+ param+="i";
+ for(var i in this.load_syntax[lang]['KEYWORDS']){
+ if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
+ this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
+ this.keywords_reg_exp_nb++;
+ }
+ }
+
+ if(this.load_syntax[lang]['OPERATORS']){
+ var str="";
+ var nb=0;
+ for(var i in this.load_syntax[lang]['OPERATORS']){
+ if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
+ if(nb>0)
+ str+="|";
+ str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
+ nb++;
+ }
+ if(str.length>0)
+ this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
+ }
+
+ if(this.load_syntax[lang]['DELIMITERS']){
+ var str="";
+ var nb=0;
+ for(var i in this.load_syntax[lang]['DELIMITERS']){
+ if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
+ if(nb>0)
+ str+="|";
+ str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
+ nb++;
+ }
+ if(str.length>0)
+ this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
+ }
+
+
+ // /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|())/gi
+ var syntax_trace=[];
+
+ // /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
+
+ this.syntax[lang]["quotes"]={};
+ var quote_tab= [];
+ if(this.load_syntax[lang]['QUOTEMARKS']){
+ for(var i in this.load_syntax[lang]['QUOTEMARKS']){
+ if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;
+ var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
+ this.syntax[lang]["quotes"][x]=x;
+ //quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
+ //previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
+ quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
+
+ syntax_trace.push(x);
+ }
+ }
+
+ this.syntax[lang]["comments"]={};
+ if(this.load_syntax[lang]['COMMENT_SINGLE']){
+ for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){
+ if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;
+ var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
+ quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
+ syntax_trace.push(x);
+ this.syntax[lang]["comments"][x]="\n";
+ }
+ }
+ // (/\*(.|[\r\n])*?\*/)
+ if(this.load_syntax[lang]['COMMENT_MULTI']){
+ for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
+ if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;
+ var start=this.get_escaped_regexp(i);
+ var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
+ quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
+ syntax_trace.push(start);
+ syntax_trace.push(end);
+ this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
+ }
+ }
+ if(quote_tab.length>0)
+ this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
+
+ if(syntax_trace.length>0) // /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
+ this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
+
+ if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
+ this.syntax[lang]["script_delimiters"]= {};
+ for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
+ if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;
+ this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
+ }
+ }
+
+ this.syntax[lang]["custom_regexp"]= {};
+ if(this.load_syntax[lang]['REGEXPS']){
+ for(var i in this.load_syntax[lang]['REGEXPS']){
+ if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
+ var val= this.load_syntax[lang]['REGEXPS'][i];
+ if(!this.syntax[lang]["custom_regexp"][val['execute']])
+ this.syntax[lang]["custom_regexp"][val['execute']]= {};
+ this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
+ , 'class' : val['class']};
+ }
+ }
+
+ if(this.load_syntax[lang]['STYLES']){
+ lang_style[lang]= {};
+ for(var i in this.load_syntax[lang]['STYLES']){
+ if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
+ if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
+ for(var j in this.load_syntax[lang]['STYLES'][i]){
+ lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
+ }
+ }else{
+ lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
+ }
+ }
+ }
+ // build style string
+ var style="";
+ for(var i in lang_style[lang]){
+ if(lang_style[lang][i].length>0){
+ style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
+ style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";
+ }
+ }
+ this.syntax[lang]["styles"]=style;
+ }
+ }
+ };
+
+ editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";
diff --git a/includes/edit_area/reg_syntax/basic.js b/includes/edit_area/reg_syntax/basic.js
new file mode 100644
index 00000000..96ccc5b8
--- /dev/null
+++ b/includes/edit_area/reg_syntax/basic.js
@@ -0,0 +1,70 @@
+editAreaLoader.load_syntax["basic"] = {
+ 'DISPLAY_NAME' : 'Basic'
+ ,'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
+ ,'COMMENT_MULTI' : { }
+ ,'QUOTEMARKS' : {1: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements' : [
+ 'if','then','for','wend','while',
+ 'else','elseif','select','case','end select',
+ 'until','next','step','to','end if', 'call'
+ ]
+ ,'keywords' : [
+ 'sub', 'end sub', 'function', 'end function', 'exit',
+ 'exit function', 'dim', 'redim', 'shared', 'const',
+ 'is', 'absolute', 'access', 'any', 'append', 'as',
+ 'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
+ 'chdir', 'circle', 'clear', 'close', 'cls', 'color',
+ 'com', 'common', 'data', 'date', 'declare', 'def',
+ 'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
+ 'double', 'draw', 'environ', 'erase', 'error', 'field',
+ 'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
+ 'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
+ 'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
+ 'option', 'out', 'output', 'paint', 'palette', 'pcopy',
+ 'poke', 'preset', 'print', 'pset', 'put', 'random',
+ 'randomize', 'read', 'reset', 'restore', 'resume',
+ 'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
+ 'shell', 'single', 'sleep', 'sound', 'static', 'stop',
+ 'strig', 'string', 'swap', 'system', 'time', 'timer',
+ 'troff', 'tron', 'type', 'unlock', 'using', 'view',
+ 'wait', 'width', 'window', 'write'
+ ]
+ ,'functions' : [
+ 'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
+ 'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
+ 'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
+ 'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
+ 'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
+ 'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
+ 'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
+ 'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
+ 'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
+ 'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
+ 'ubound', 'ucase', 'val', 'varptr', 'varseg'
+ ]
+ ,'operators' : [
+ 'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '!', '&'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #99CC00;'
+ ,'QUOTESMARKS': 'color: #333399;'
+ ,'KEYWORDS' : {
+ 'keywords' : 'color: #3366FF;'
+ ,'functions' : 'color: #0000FF;'
+ ,'statements' : 'color: #3366FF;'
+ ,'operators' : 'color: #FF0000;'
+ }
+ ,'OPERATORS' : 'color: #FF0000;'
+ ,'DELIMITERS' : 'color: #0000FF;'
+
+ }
+};
diff --git a/includes/edit_area/reg_syntax/brainfuck.js b/includes/edit_area/reg_syntax/brainfuck.js
new file mode 100644
index 00000000..e6306b0c
--- /dev/null
+++ b/includes/edit_area/reg_syntax/brainfuck.js
@@ -0,0 +1,45 @@
+editAreaLoader.load_syntax["brainfuck"] = {
+ 'DISPLAY_NAME' : 'Brainfuck'
+ ,'COMMENT_SINGLE' : {}
+ ,'COMMENT_MULTI' : {}
+ ,'QUOTEMARKS' : {}
+ ,'KEYWORD_CASE_SENSITIVE' : true
+ ,'OPERATORS' :[
+ '+', '-'
+ ]
+ ,'DELIMITERS' :[
+ '[', ']'
+ ]
+ ,'REGEXPS' : {
+ 'bfispis' : {
+ 'search' : '()(\\.)()'
+ ,'class' : 'bfispis'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ ,'bfupis' : {
+ 'search' : '()(\\,)()'
+ ,'class' : 'bfupis'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ ,'bfmemory' : {
+ 'search' : '()([<>])()'
+ ,'class' : 'bfmemory'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'OPERATORS' : 'color: #88AA00;'
+ ,'DELIMITERS' : 'color: #00C138;'
+ ,'REGEXPS' : {
+ 'bfispis' : 'color: #EE0000;'
+ ,'bfupis' : 'color: #4455ee;'
+ ,'bfmemory' : 'color: #DD00DD;'
+ }
+ }
+};
+
diff --git a/includes/edit_area/reg_syntax/c.js b/includes/edit_area/reg_syntax/c.js
new file mode 100644
index 00000000..05d978c7
--- /dev/null
+++ b/includes/edit_area/reg_syntax/c.js
@@ -0,0 +1,63 @@
+editAreaLoader.load_syntax["c"] = {
+ 'DISPLAY_NAME' : 'C'
+ ,'COMMENT_SINGLE' : {1 : '//'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : true
+ ,'KEYWORDS' : {
+ 'constants' : [
+ 'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
+ ]
+ ,'types' : [
+ 'FILE', 'auto', 'char', 'const', 'double',
+ 'extern', 'float', 'inline', 'int', 'long', 'register',
+ 'short', 'signed', 'size_t', 'static', 'struct',
+ 'time_t', 'typedef', 'union', 'unsigned', 'void',
+ 'volatile'
+ ]
+ ,'statements' : [
+ 'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
+ 'switch', 'while'
+ ]
+ ,'keywords' : [
+ 'break', 'case', 'continue', 'default', 'delete',
+ 'return'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ 'precompiler' : {
+ 'search' : '()(#[^\r\n]*)()'
+ ,'class' : 'precompiler'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+/* ,'precompilerstring' : {
+ 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
+ ,'class' : 'precompilerstring'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }*/
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ 'constants' : 'color: #EE0000;'
+ ,'types' : 'color: #0000EE;'
+ ,'statements' : 'color: #60CA00;'
+ ,'keywords' : 'color: #48BDDF;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #0038E1;'
+ ,'REGEXPS' : {
+ 'precompiler' : 'color: #009900;'
+ ,'precompilerstring' : 'color: #994400;'
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/coldfusion.js b/includes/edit_area/reg_syntax/coldfusion.js
new file mode 100644
index 00000000..d70657f6
--- /dev/null
+++ b/includes/edit_area/reg_syntax/coldfusion.js
@@ -0,0 +1,120 @@
+editAreaLoader.load_syntax["coldfusion"] = {
+ 'DISPLAY_NAME' : 'Coldfusion'
+ ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
+ ,'COMMENT_MULTI' : {''}
+ ,'COMMENT_MULTI2' : {''}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements' : [
+ 'include', 'require', 'include_once', 'require_once',
+ 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
+ 'endif', 'switch', 'case', 'endswitch',
+ 'return', 'break', 'continue'
+ ]
+ ,'reserved' : [
+ 'AND', 'break', 'case', 'CONTAIN', 'CONTAINS', 'continue', 'default', 'do',
+ 'DOES', 'else', 'EQ', 'EQUAL', 'EQUALTO', 'EQV', 'FALSE', 'for', 'GE',
+ 'GREATER', 'GT', 'GTE', 'if', 'IMP', 'in', 'IS', 'LE', 'LESS', 'LT', 'LTE',
+ 'MOD', 'NEQ', 'NOT', 'OR', 'return', 'switch', 'THAN', 'TO', 'TRUE', 'var',
+ 'while', 'XOR'
+ ]
+ ,'functions' : [
+ 'Abs', 'ACos', 'ArrayAppend', 'ArrayAvg', 'ArrayClear', 'ArrayDeleteAt', 'ArrayInsertAt',
+ 'ArrayIsEmpty', 'ArrayLen', 'ArrayMax', 'ArrayMin', 'ArrayNew', 'ArrayPrepend', 'ArrayResize',
+ 'ArraySet', 'ArraySort', 'ArraySum', 'ArraySwap', 'ArrayToList', 'Asc', 'ASin', 'Atn', 'AuthenticatedContext',
+ 'AuthenticatedUser', 'BitAnd', 'BitMaskClear', 'BitMaskRead', 'BitMaskSet', 'BitNot', 'BitOr',
+ 'BitSHLN', 'BitSHRN', 'BitXor', 'Ceiling', 'Chr', 'CJustify', 'Compare', 'CompareNoCase', 'Cos',
+ 'CreateDate', 'CreateDateTime', 'CreateODBCDate', 'CreateODBCDateTime', 'CreateODBCTime',
+ 'CreateTime', 'CreateTimeSpan', 'DateAdd', 'DateCompare', 'DateConvert', 'DateDiff',
+ 'DateFormat', 'DatePart', 'Day', 'DayOfWeek', 'DayOfWeekAsString', 'DayOfYear', 'DaysInMonth',
+ 'DaysInYear', 'DE', 'DecimalFormat', 'DecrementValue', 'Decrypt', 'DeleteClientVariable',
+ 'DirectoryExists', 'DollarFormat', 'Duplicate', 'Encrypt', 'Evaluate', 'Exp', 'ExpandPath',
+ 'FileExists', 'Find', 'FindNoCase', 'FindOneOf', 'FirstDayOfMonth', 'Fix', 'FormatBaseN',
+ 'GetBaseTagData', 'GetBaseTagList', 'GetBaseTemplatePath', 'GetClientVariablesList',
+ 'GetCurrentTemplatePath', 'GetDirectoryFromPath', 'GetException', 'GetFileFromPath',
+ 'GetFunctionList', 'GetHttpTimeString', 'GetHttpRequestData', 'GetLocale', 'GetMetricData',
+ 'GetProfileString', 'GetTempDirectory', 'GetTempFile', 'GetTemplatePath', 'GetTickCount',
+ 'GetTimeZoneInfo', 'GetToken', 'Hash', 'Hour', 'HTMLCodeFormat', 'HTMLEditFormat', 'IIf',
+ 'IncrementValue', 'InputBaseN', 'Insert', 'Int', 'IsArray', 'IsAuthenticated', 'IsAuthorized',
+ 'IsBoolean', 'IsBinary', 'IsCustomFunction', 'IsDate', 'IsDebugMode', 'IsDefined', 'IsLeapYear',
+ 'IsNumeric', 'IsNumericDate', 'IsProtected', 'IsQuery', 'IsSimpleValue', 'IsStruct', 'IsWDDX',
+ 'JavaCast', 'JSStringFormat', 'LCase', 'Left', 'Len', 'ListAppend', 'ListChangeDelims',
+ 'ListContains', 'ListContainsNoCase', 'ListDeleteAt', 'ListFind', 'ListFindNoCase', 'ListFirst',
+ 'ListGetAt', 'ListInsertAt', 'ListLast', 'ListLen', 'ListPrepend', 'ListQualify', 'ListRest',
+ 'ListSetAt', 'ListSort', 'ListToArray', 'ListValueCount', 'ListValueCountNoCase', 'LJustify',
+ 'Log', 'Log10', 'LSCurrencyFormat', 'LSDateFormat', 'LSEuroCurrencyFormat', 'LSIsCurrency',
+ 'LSIsDate', 'LSIsNumeric', 'LSNumberFormat', 'LSParseCurrency', 'LSParseDateTime', 'LSParseNumber',
+ 'LSTimeFormat', 'LTrim', 'Max', 'Mid', 'Min', 'Minute', 'Month', 'MonthAsString', 'Now', 'NumberFormat',
+ 'ParagraphFormat', 'ParameterExists', 'ParseDateTime', 'Pi', 'PreserveSingleQuotes', 'Quarter',
+ 'QueryAddRow', 'QueryNew', 'QuerySetCell', 'QuotedValueList', 'Rand', 'Randomize', 'RandRange',
+ 'REFind', 'REFindNoCase', 'RemoveChars', 'RepeatString', 'Replace', 'ReplaceList', 'ReplaceNoCase',
+ 'REReplace', 'REReplaceNoCase', 'Reverse', 'Right', 'RJustify', 'Round', 'RTrim', 'Second', 'SetLocale',
+ 'SetProfileString', 'SetVariable', 'Sgn', 'Sin', 'SpanExcluding', 'SpanIncluding', 'Sqr', 'StripCR',
+ 'StructAppend', 'StructClear', 'StructCopy', 'StructCount', 'StructDelete', 'StructFind', 'StructFindKey',
+ 'StructFindValue', 'StructGet', 'StructInsert', 'StructIsEmpty', 'StructKeyArray', 'StructKeyExists',
+ 'StructKeyList', 'StructNew', 'StructSort', 'StructUpdate', 'Tan', 'TimeFormat', 'ToBase64', 'ToBinary',
+ 'ToString', 'Trim', 'UCase', 'URLDecode', 'URLEncodedFormat', 'Val', 'ValueList', 'Week', 'WriteOutput',
+ 'XMLFormat', 'Year', 'YesNoFormat'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '%', '!', '&&', '||'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ 'doctype' : {
+ 'search' : '()(]*>)()'
+ ,'class' : 'doctype'
+ ,'modifiers' : ''
+ ,'execute' : 'before' // before or after
+ }
+ ,'cftags' : {
+ 'search' : '(<)(/cf[a-z][^ \r\n\t>]*)([^>]*>)'
+ ,'class' : 'cftags'
+ ,'modifiers' : 'gi'
+ ,'execute' : 'before' // before or after
+ }
+ ,'cftags2' : {
+ 'search' : '(<)(cf[a-z][^ \r\n\t>]*)([^>]*>)'
+ ,'class' : 'cftags2'
+ ,'modifiers' : 'gi'
+ ,'execute' : 'before' // before or after
+ }
+ ,'tags' : {
+ 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+ ,'class' : 'tags'
+ ,'modifiers' : 'gi'
+ ,'execute' : 'before' // before or after
+ }
+ ,'attributes' : {
+ 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+ ,'class' : 'attributes'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ 'reserved' : 'color: #48BDDF;'
+ ,'functions' : 'color: #0000FF;'
+ ,'statements' : 'color: #60CA00;'
+ }
+ ,'OPERATORS' : 'color: #E775F0;'
+ ,'DELIMITERS' : ''
+ ,'REGEXPS' : {
+ 'attributes': 'color: #990033;'
+ ,'cftags': 'color: #990033;'
+ ,'cftags2': 'color: #990033;'
+ ,'tags': 'color: #000099;'
+ ,'doctype': 'color: #8DCFB5;'
+ ,'test': 'color: #00FF00;'
+ }
+ }
+};
+
+
diff --git a/includes/edit_area/reg_syntax/cpp.js b/includes/edit_area/reg_syntax/cpp.js
new file mode 100644
index 00000000..98e64934
--- /dev/null
+++ b/includes/edit_area/reg_syntax/cpp.js
@@ -0,0 +1,66 @@
+editAreaLoader.load_syntax["cpp"] = {
+ 'DISPLAY_NAME' : 'CPP'
+ ,'COMMENT_SINGLE' : {1 : '//'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : true
+ ,'KEYWORDS' : {
+ 'constants' : [
+ 'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
+ 'true'
+ ]
+ ,'types' : [
+ 'FILE', 'auto', 'char', 'class', 'const', 'double',
+ 'extern', 'float', 'friend', 'inline', 'int',
+ 'iterator', 'long', 'map', 'operator', 'queue',
+ 'register', 'short', 'signed', 'size_t', 'stack',
+ 'static', 'string', 'struct', 'time_t', 'typedef',
+ 'union', 'unsigned', 'vector', 'void', 'volatile'
+ ]
+ ,'statements' : [
+ 'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
+ 'sizeof', 'switch', 'this', 'throw', 'try', 'while'
+ ]
+ ,'keywords' : [
+ 'break', 'case', 'continue', 'default', 'delete',
+ 'namespace', 'new', 'private', 'protected', 'public',
+ 'return', 'using'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ 'precompiler' : {
+ 'search' : '()(#[^\r\n]*)()'
+ ,'class' : 'precompiler'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+/* ,'precompilerstring' : {
+ 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
+ ,'class' : 'precompilerstring'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }*/
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ 'constants' : 'color: #EE0000;'
+ ,'types' : 'color: #0000EE;'
+ ,'statements' : 'color: #60CA00;'
+ ,'keywords' : 'color: #48BDDF;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #0038E1;'
+ ,'REGEXPS' : {
+ 'precompiler' : 'color: #009900;'
+ ,'precompilerstring' : 'color: #994400;'
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/css.js b/includes/edit_area/reg_syntax/css.js
new file mode 100644
index 00000000..cff605aa
--- /dev/null
+++ b/includes/edit_area/reg_syntax/css.js
@@ -0,0 +1,85 @@
+editAreaLoader.load_syntax["css"] = {
+ 'DISPLAY_NAME' : 'CSS'
+ ,'COMMENT_SINGLE' : {1 : '@'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : ['"', "'"]
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'attributes' : [
+ 'aqua', 'azimuth', 'background-attachment', 'background-color',
+ 'background-image', 'background-position', 'background-repeat',
+ 'background', 'border-bottom-color', 'border-bottom-style',
+ 'border-bottom-width', 'border-left-color', 'border-left-style',
+ 'border-left-width', 'border-right', 'border-right-color',
+ 'border-right-style', 'border-right-width', 'border-top-color',
+ 'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
+ 'border-left', 'border-width', 'border-color', 'border-spacing',
+ 'border-style', 'border-top', 'border', 'caption-side',
+ 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
+ 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
+ 'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
+ 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
+ 'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
+ 'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
+ 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
+ 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
+ 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
+ 'outline-width', 'overflow', 'padding-bottom', 'padding-left',
+ 'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
+ 'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
+ 'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
+ 'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
+ 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
+ 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
+ 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
+ 'width', 'word-spacing', 'z-index', 'bottom', 'left'
+ ]
+ ,'values' : [
+ 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
+ 'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
+ 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
+ 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
+ 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
+ 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
+ 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
+ 'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
+ 'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
+ 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
+ 'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
+ 'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
+ 'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
+ 'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
+ 'pointer', 'portrait', 'purple', 'px',
+ 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
+ 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
+ 'static', 'status-bar', 'super', 'sw-resize',
+ 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
+ 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
+ 'visible',
+ 'w-resize', 'wait', 'white', 'wider',
+ 'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
+ 'yellow', 'yes'
+ ]
+ ,'specials' : [
+ 'important'
+ ]
+ }
+ ,'OPERATORS' :[
+ ':', ';', '!', '.', '#'
+ ]
+ ,'DELIMITERS' :[
+ '{', '}'
+ ]
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ 'attributes' : 'color: #48BDDF;'
+ ,'values' : 'color: #2B60FF;'
+ ,'specials' : 'color: #FF0000;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #60CA00;'
+
+ }
+};
diff --git a/includes/edit_area/reg_syntax/html.js b/includes/edit_area/reg_syntax/html.js
new file mode 100644
index 00000000..66490b17
--- /dev/null
+++ b/includes/edit_area/reg_syntax/html.js
@@ -0,0 +1,51 @@
+/*
+* last update: 2006-08-24
+*/
+
+editAreaLoader.load_syntax["html"] = {
+ 'DISPLAY_NAME' : 'HTML'
+ ,'COMMENT_SINGLE' : {}
+ ,'COMMENT_MULTI' : {''}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ }
+ ,'OPERATORS' :[
+ ]
+ ,'DELIMITERS' :[
+ ]
+ ,'REGEXPS' : {
+ 'doctype' : {
+ 'search' : '()(]*>)()'
+ ,'class' : 'doctype'
+ ,'modifiers' : ''
+ ,'execute' : 'before' // before or after
+ }
+ ,'tags' : {
+ 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+ ,'class' : 'tags'
+ ,'modifiers' : 'gi'
+ ,'execute' : 'before' // before or after
+ }
+ ,'attributes' : {
+ 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+ ,'class' : 'attributes'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ }
+ ,'OPERATORS' : 'color: #E775F0;'
+ ,'DELIMITERS' : ''
+ ,'REGEXPS' : {
+ 'attributes': 'color: #B1AC41;'
+ ,'tags': 'color: #E62253;'
+ ,'doctype': 'color: #8DCFB5;'
+ ,'test': 'color: #00FF00;'
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/java.js b/includes/edit_area/reg_syntax/java.js
new file mode 100644
index 00000000..e14009bf
--- /dev/null
+++ b/includes/edit_area/reg_syntax/java.js
@@ -0,0 +1,57 @@
+editAreaLoader.load_syntax["java"] = {
+ 'DISPLAY_NAME' : 'Java'
+ ,'COMMENT_SINGLE': { 1: '//', 2: '@' }
+ , 'COMMENT_MULTI': { '/*': '*/' }
+ , 'QUOTEMARKS': { 1: "'", 2: '"' }
+ , 'KEYWORD_CASE_SENSITIVE': true
+ , 'KEYWORDS': {
+ 'constants': [
+ 'null', 'false', 'true'
+ ]
+ , 'types': [
+ 'String', 'int', 'short', 'long', 'char', 'double', 'byte',
+ 'float', 'static', 'void', 'private', 'boolean', 'protected',
+ 'public', 'const', 'class', 'final', 'abstract', 'volatile',
+ 'enum', 'transient', 'interface'
+ ]
+ , 'statements': [
+ 'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
+ 'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
+ 'break', 'case', 'default', 'goto'
+ ]
+ , 'keywords': [
+ 'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
+ 'instanceof', 'strictfp'
+ ]
+ }
+ , 'OPERATORS': [
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
+ ]
+ , 'DELIMITERS': [
+ '(', ')', '[', ']', '{', '}'
+ ]
+ , 'REGEXPS': {
+ 'precompiler': {
+ 'search': '()(#[^\r\n]*)()'
+ , 'class': 'precompiler'
+ , 'modifiers': 'g'
+ , 'execute': 'before'
+ }
+ }
+ , 'STYLES': {
+ 'COMMENTS': 'color: #AAAAAA;'
+ , 'QUOTESMARKS': 'color: #6381F8;'
+ , 'KEYWORDS': {
+ 'constants': 'color: #EE0000;'
+ , 'types': 'color: #0000EE;'
+ , 'statements': 'color: #60CA00;'
+ , 'keywords': 'color: #48BDDF;'
+ }
+ , 'OPERATORS': 'color: #FF00FF;'
+ , 'DELIMITERS': 'color: #0038E1;'
+ , 'REGEXPS': {
+ 'precompiler': 'color: #009900;'
+ , 'precompilerstring': 'color: #994400;'
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/js.js b/includes/edit_area/reg_syntax/js.js
new file mode 100644
index 00000000..556566bd
--- /dev/null
+++ b/includes/edit_area/reg_syntax/js.js
@@ -0,0 +1,94 @@
+editAreaLoader.load_syntax["js"] = {
+ 'DISPLAY_NAME' : 'Javascript'
+ ,'COMMENT_SINGLE' : {1 : '//'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements' : [
+ 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
+ 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
+ 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
+ 'while', 'write', 'with'
+ ]
+ ,'keywords' : [
+ 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
+ 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
+ 'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
+ // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
+ 'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
+ 'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
+ 'arguments', 'locationbar', 'pageXoffset', 'Form',
+ 'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
+ 'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
+ 'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
+ 'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
+ 'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
+ 'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
+ 'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
+ 'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
+ 'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
+ 'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
+ 'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
+ 'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
+ ]
+ ,'functions' : [
+ // common functions for Window object
+ 'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
+ 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
+ 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
+ 'stop'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '%', '!'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ 'statements' : 'color: #60CA00;'
+ ,'keywords' : 'color: #48BDDF;'
+ ,'functions' : 'color: #2B60FF;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #0038E1;'
+
+ }
+ ,'AUTO_COMPLETION' : {
+ "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
+ ,"possible_words_letters": "[a-zA-Z0-9_]+"
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+ ,"prefix_separator": "\\."
+ }
+ ,"CASE_SENSITIVE": true
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
+ ,"KEYWORDS": {
+ '': [ // the prefix of thoses items
+ /**
+ * 0 : the keyword the user is typing
+ * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "ยง" beeing the equivalent to the value the typed string indicated if the previous )
+ * If empty the keyword will be displayed
+ * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
+ */
+ ['Array', 'ยง()', '']
+ ,['alert', 'ยง({@})', 'alert(String message)']
+ ,['document']
+ ,['window']
+ ]
+ ,'window' : [
+ ['location']
+ ,['document']
+ ,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
+ ]
+ ,'location' : [
+ ['href']
+ ]
+ }
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/pas.js b/includes/edit_area/reg_syntax/pas.js
new file mode 100644
index 00000000..26fb7483
--- /dev/null
+++ b/includes/edit_area/reg_syntax/pas.js
@@ -0,0 +1,83 @@
+editAreaLoader.load_syntax["pas"] = {
+ 'DISPLAY_NAME' : 'Pascal'
+ ,'COMMENT_SINGLE' : {}
+ ,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
+ ,'QUOTEMARKS' : {1: '"', 2: "'"}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'constants' : [
+ 'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
+ 'Magenta', 'Brown', 'LightGray', 'DarkGray',
+ 'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
+ 'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
+ 'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
+ 'erroraddr', 'errorcode', 'LineEnding'
+ ]
+ ,'keywords' : [
+ 'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
+ 'pow', 'is', 'not','Absolute', 'And_then', 'Array',
+ 'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
+ 'Else', 'End', 'Export', 'File', 'For', 'Function',
+ 'Goto', 'If', 'Import', 'Implementation', 'Inherited',
+ 'Inline', 'Interface', 'Label', 'Module', 'Nil',
+ 'Object', 'Of', 'Only', 'Operator', 'Or_else',
+ 'Otherwise', 'Packed', 'Procedure', 'Program',
+ 'Protected', 'Qualified', 'Record', 'Repeat',
+ 'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
+ 'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
+ 'With'
+ ]
+ ,'functions' : [
+ 'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
+ 'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
+ 'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
+ 'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
+ 'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
+ 'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
+ 'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
+ 'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
+ 'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
+ 'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
+ 'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
+ 'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
+ 'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
+ 'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
+ 'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
+ 'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
+ 'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
+ 'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
+ 'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
+ 'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
+ 'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
+ 'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
+ 'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
+ 'Write', 'WriteLn'
+ ]
+ ,'types' : [
+ 'Integer', 'Shortint', 'SmallInt', 'Longint',
+ 'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
+ 'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
+ 'Real', 'Single', 'Double', 'Extended', 'Comp',
+ 'String', 'ShortString', 'AnsiString', 'PChar'
+ ]
+ }
+ ,'OPERATORS' :[
+ '@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']'
+ ]
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ 'specials' : 'color: #EE0000;'
+ ,'constants' : 'color: #654321;'
+ ,'keywords' : 'color: #48BDDF;'
+ ,'functions' : 'color: #449922;'
+ ,'types' : 'color: #2B60FF;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #60CA00;'
+ }
+};
diff --git a/includes/edit_area/reg_syntax/perl.js b/includes/edit_area/reg_syntax/perl.js
new file mode 100644
index 00000000..0313c0c6
--- /dev/null
+++ b/includes/edit_area/reg_syntax/perl.js
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
+ *
+ * You may choose any license of the current release or any future release
+ * of editarea to use, modify and/or redistribute this file.
+ *
+ * This language specification file supports for syntax checking on
+ * a large subset of Perl 5.x.
+ * The basic common syntax of Perl is fully supported, but as for
+ * the highlighting of built-in operations, it's mainly designed
+ * to support for hightlighting Perl code in a Safe environment (compartment)
+ * as used by CoMaNet for evaluation of administrative scripts. This Safe
+ * compartment basically allows for all of Opcode's :default operations,
+ * but little others. See http://perldoc.perl.org/Opcode.html to learn
+ * more.
+ ***************************************************************************/
+
+editAreaLoader.load_syntax["perl"] = {
+ 'DISPLAY_NAME' : 'Perl',
+ 'COMMENT_SINGLE' : {1 : '#'},
+ 'QUOTEMARKS' : {1: "'", 2: '"'},
+ 'KEYWORD_CASE_SENSITIVE' : true,
+ 'KEYWORDS' :
+ {
+ 'core' :
+ [ "if", "else", "elsif", "while", "for", "each", "foreach",
+ "next", "last", "goto", "exists", "delete", "undef",
+ "my", "our", "local", "use", "require", "package", "keys", "values",
+ "sub", "bless", "ref", "return" ],
+ 'functions' :
+ [
+ //from :base_core
+ "int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
+ "length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
+ "uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
+ "push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
+ "xor", "warn", "die", "prototype",
+ //from :base_mem
+ "concat", "repeat", "join", "range",
+ //none from :base_loop, as we'll see them as basic statements...
+ //from :base_orig
+ "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
+ //others
+ "print", "open", "close"
+ ]
+ },
+ 'OPERATORS' :
+ [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
+ ' eq ', ' ne ', '=~' ],
+ 'DELIMITERS' :
+ [ '(', ')', '[', ']', '{', '}' ],
+ 'REGEXPS' :
+ {
+ 'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
+ 'class' : 'scopingnames',
+ 'modifiers' : 'g', 'execute' : 'before' },
+ 'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
+ 'class' : 'scopingnames',
+ 'modifiers' : 'g', 'execute' : 'before' },
+ 'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
+ 'class' : 'vars',
+ 'modifiers' : 'g', 'execute' : 'after' },
+ 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
+ 'class' : 'vars',
+ 'modifiers' : 'g', 'execute' : 'after' },
+ 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
+ 'class' : 'vars',
+ 'modifiers' : 'g', 'execute' : 'after' },
+ },
+
+ 'STYLES' :
+ {
+ 'COMMENTS': 'color: #AAAAAA;',
+ 'QUOTESMARKS': 'color: #DC0000;',
+ 'KEYWORDS' :
+ {
+ 'core' : 'color: #8aca00;',
+ 'functions' : 'color: #2B60FF;'
+ },
+ 'OPERATORS' : 'color: #8aca00;',
+ 'DELIMITERS' : 'color: #0038E1;',
+ 'REGEXPS':
+ {
+ 'scopingnames' : 'color: #ff0000;',
+ 'vars' : 'color: #00aaaa;',
+ }
+ } //'STYLES'
+};
diff --git a/includes/edit_area/reg_syntax/php.js b/includes/edit_area/reg_syntax/php.js
new file mode 100644
index 00000000..f53dc889
--- /dev/null
+++ b/includes/edit_area/reg_syntax/php.js
@@ -0,0 +1,157 @@
+editAreaLoader.load_syntax["php"] = {
+ 'DISPLAY_NAME' : 'Php'
+ ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements' : [
+ 'include', 'require', 'include_once', 'require_once',
+ 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
+ 'endif', 'switch', 'case', 'endswitch',
+ 'return', 'break', 'continue'
+ ]
+ ,'reserved' : [
+ '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
+ 'null', '__LINE__', '__FILE__',
+ 'false', '<?php', '?>', '<?',
+ '<script language', '</script>',
+ 'true', 'var', 'default',
+ 'function', 'class', 'new', '&new', 'this',
+ '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
+ 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
+ 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
+ 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
+ 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
+ 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
+ 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
+
+ ]
+ ,'functions' : [
+ 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
+ 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
+ 'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
+ 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
+ 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
+ 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
+ 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
+ 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
+ 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
+ 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
+ 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
+ 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
+ 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
+
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ // highlight all variables ($...)
+ 'variables' : {
+ 'search' : '()(\\$\\w+)()'
+ ,'class' : 'variables'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #879EFA;'
+ ,'KEYWORDS' : {
+ 'reserved' : 'color: #48BDDF;'
+ ,'functions' : 'color: #0040FD;'
+ ,'statements' : 'color: #60CA00;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #2B60FF;'
+ ,'REGEXPS' : {
+ 'variables' : 'color: #E0BD54;'
+ }
+ }
+ ,'AUTO_COMPLETION' : {
+ "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+ ,"prefix_separator": "\\-\\>|\\:\\:"
+ }
+ ,"CASE_SENSITIVE": true
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
+ ,"KEYWORDS": {
+ '': [ // the prefix of thoses items
+ /**
+ * 0 : the keyword the user is typing
+ * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "ยง" beeing the equivalent to the value the typed string indicated if the previous )
+ * If empty the keyword will be displayed
+ * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
+ */
+ ['$_POST']
+ ,['$_GET']
+ ,['$_SESSION']
+ ,['$_SERVER']
+ ,['$_FILES']
+ ,['$_ENV']
+ ,['$_COOKIE']
+ ,['$_REQUEST']
+ // magic methods
+ ,['__construct', 'ยง( {@} )']
+ ,['__destruct', 'ยง( {@} )']
+ ,['__sleep', 'ยง( {@} )']
+ ,['__wakeup', 'ยง( {@} )']
+ ,['__toString', 'ยง( {@} )']
+ // include
+ ,['include', 'ยง "{@}";']
+ ,['include_once', 'ยง "{@}";']
+ ,['require', 'ยง "{@}";']
+ ,['require_once', 'ยง "{@}";']
+ // statements
+ ,['for', 'ยง( {@} )']
+ ,['foreach', 'ยง( {@} )']
+ ,['if', 'ยง( {@} )']
+ ,['elseif', 'ยง( {@} )']
+ ,['while', 'ยง( {@} )']
+ ,['switch', 'ยง( {@} )']
+ ,['break']
+ ,['case']
+ ,['continue']
+ ,['do']
+ ,['else']
+ ,['endif']
+ ,['endswitch']
+ ,['endwhile']
+ ,['return']
+ // function
+ ,['unset', 'ยง( {@} )']
+ ]
+ }
+ }
+ ,"live": {
+
+ // class NAME: /class\W+([a-z]+)\W+/gi
+ // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
+ // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
+ // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi
+ // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi
+ // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi
+
+
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+ ,"prefix_separator": "\\-\\>"
+ }
+ ,"CASE_SENSITIVE": true
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
+ ,"KEYWORDS": {
+ '$this': [ // the prefix of thoses items
+ ['test']
+ ]
+ }
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/python.js b/includes/edit_area/reg_syntax/python.js
new file mode 100644
index 00000000..e9f4314e
--- /dev/null
+++ b/includes/edit_area/reg_syntax/python.js
@@ -0,0 +1,145 @@
+/**
+ * Python syntax v 1.1
+ *
+ * v1.1 by Andre Roberge (2006/12/27)
+ *
+**/
+editAreaLoader.load_syntax["python"] = {
+ 'DISPLAY_NAME' : 'Python'
+ ,'COMMENT_SINGLE' : {1 : '#'}
+ ,'COMMENT_MULTI' : {}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : true
+ ,'KEYWORDS' : {
+ /*
+ ** Set 1: reserved words
+ ** http://python.org/doc/current/ref/keywords.html
+ ** Note: 'as' and 'with' have been added starting with Python 2.5
+ */
+ 'reserved' : [
+ 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
+ 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if',
+ 'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
+ 'return', 'try', 'while', 'with', 'yield'
+ //the following are *almost* reserved; we'll treat them as such
+ , 'False', 'True', 'None'
+ ]
+ /*
+ ** Set 2: builtins
+ ** http://python.org/doc/current/lib/built-in-funcs.html
+ */
+ ,'builtins' : [
+ '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
+ 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
+ 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
+ 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
+ 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
+ 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
+ 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
+ 'vars', 'xrange', 'zip',
+ // Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
+ //'False', 'True', 'None' have been included in 'reserved'
+ 'NotImplemented', 'Ellipsis',
+ // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
+ 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
+ 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
+ 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
+ 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
+ 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
+ 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
+ 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
+ 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
+ 'RuntimeWarning', 'FutureWarning',
+ // we will include the string methods as well
+ // http://python.org/doc/current/lib/string-methods.html
+ 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
+ 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
+ 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
+ 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
+ 'translate', 'upper', 'zfill'
+ ]
+ /*
+ ** Set 3: standard library
+ ** http://python.org/doc/current/lib/modindex.html
+ */
+ ,'stdlib' : [
+ '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
+ 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
+ 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
+ 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
+ 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
+ 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
+ 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
+ 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
+ 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
+ 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
+ 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
+ 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
+ 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
+ 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
+ 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
+ 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
+ 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
+ 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
+ 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
+ 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
+ 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
+ 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
+ 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
+ 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
+ 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
+ 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
+ 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
+ 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
+ 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
+ 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
+
+ ]
+ /*
+ ** Set 4: special methods
+ ** http://python.org/doc/current/ref/specialnames.html
+ */
+ ,'special' : [
+ // Basic customization: http://python.org/doc/current/ref/customization.html
+ '__new__', '__init__', '__del__', '__repr__', '__str__',
+ '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
+ '__hash__', '__nonzero__', '__unicode__', '__dict__',
+ // Attribute access: http://python.org/doc/current/ref/attribute-access.html
+ '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
+ '__delete__', '__slots__',
+ // Class creation, callable objects
+ '__metaclass__', '__call__',
+ // Container types: http://python.org/doc/current/ref/sequence-types.html
+ '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
+ '__getslice__', '__setslice__', '__delslice__',
+ // Numeric types: http://python.org/doc/current/ref/numeric-types.html
+ '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
+ '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
+ '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
+ '__long__','__lshift__',
+ '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
+ '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
+ '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
+ '__sub__','__xor__'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #660066;'
+ ,'KEYWORDS' : {
+ 'reserved' : 'color: #0000FF;'
+ ,'builtins' : 'color: #009900;'
+ ,'stdlib' : 'color: #009900;'
+ ,'special': 'color: #006666;'
+ }
+ ,'OPERATORS' : 'color: #993300;'
+ ,'DELIMITERS' : 'color: #993300;'
+
+ }
+};
diff --git a/includes/edit_area/reg_syntax/robotstxt.js b/includes/edit_area/reg_syntax/robotstxt.js
new file mode 100644
index 00000000..5bca8fe6
--- /dev/null
+++ b/includes/edit_area/reg_syntax/robotstxt.js
@@ -0,0 +1,25 @@
+editAreaLoader.load_syntax["robotstxt"] = {
+ 'DISPLAY_NAME' : 'Robots txt',
+ 'COMMENT_SINGLE' : {1 : '#'},
+ 'COMMENT_MULTI' : {},
+ 'QUOTEMARKS' : [],
+ 'KEYWORD_CASE_SENSITIVE' : false,
+ 'KEYWORDS' : {
+ 'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'],
+ 'values' : ['*'],
+ 'specials' : ['*']
+ },
+ 'OPERATORS' :[':'],
+ 'DELIMITERS' :[],
+ 'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;',
+ 'QUOTESMARKS': 'color: #6381F8;',
+ 'KEYWORDS' : {
+ 'attributes' : 'color: #48BDDF;',
+ 'values' : 'color: #2B60FF;',
+ 'specials' : 'color: #FF0000;'
+ },
+ 'OPERATORS' : 'color: #FF00FF;',
+ 'DELIMITERS' : 'color: #60CA00;'
+ }
+};
diff --git a/includes/edit_area/reg_syntax/ruby.js b/includes/edit_area/reg_syntax/ruby.js
new file mode 100644
index 00000000..2049cf50
--- /dev/null
+++ b/includes/edit_area/reg_syntax/ruby.js
@@ -0,0 +1,68 @@
+/**
+ * Ruby syntax v 1.0
+ *
+ * v1.0 by Patrice De Saint Steban (2007/01/03)
+ *
+**/
+editAreaLoader.load_syntax["ruby"] = {
+ 'DISPLAY_NAME' : 'Ruby'
+ ,'COMMENT_SINGLE' : {1 : '#'}
+ ,'COMMENT_MULTI' : {}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : true
+ ,'KEYWORDS' : {
+ 'reserved' : [
+ 'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',
+ 'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if',
+ 'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',
+ 'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ 'constants' : {
+ 'search' : '()([A-Z]\\w*)()'
+ ,'class' : 'constants'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ ,'variables' : {
+ 'search' : '()([\$\@\%]+\\w+)()'
+ ,'class' : 'variables'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ ,'numbers' : {
+ 'search' : '()(-?[0-9]+)()'
+ ,'class' : 'numbers'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ ,'symbols' : {
+ 'search' : '()(:\\w+)()'
+ ,'class' : 'symbols'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before'
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #660066;'
+ ,'KEYWORDS' : {
+ 'reserved' : 'font-weight: bold; color: #0000FF;'
+ }
+ ,'OPERATORS' : 'color: #993300;'
+ ,'DELIMITERS' : 'color: #993300;'
+ ,'REGEXPS' : {
+ 'variables' : 'color: #E0BD54;'
+ ,'numbers' : 'color: green;'
+ ,'constants' : 'color: #00AA00;'
+ ,'symbols' : 'color: #879EFA;'
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/sql.js b/includes/edit_area/reg_syntax/sql.js
new file mode 100644
index 00000000..2f6dbda7
--- /dev/null
+++ b/includes/edit_area/reg_syntax/sql.js
@@ -0,0 +1,56 @@
+editAreaLoader.load_syntax["sql"] = {
+ 'DISPLAY_NAME' : 'SQL'
+ ,'COMMENT_SINGLE' : {1 : '--'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements' : [
+ 'select', 'SELECT', 'where', 'order', 'by',
+ 'insert', 'from', 'update', 'grant', 'left join', 'right join',
+ 'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'
+ ]
+ ,'reserved' : [
+ 'null', 'enum', 'int', 'boolean', 'add', 'varchar'
+
+ ]
+ ,'functions' : [
+ 'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR',
+'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH',
+'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA',
+'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND',
+'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND',
+'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF',
+'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK'
+ ]
+ }
+ ,'OPERATORS' :[
+ 'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ // highlight all variables (@...)
+ 'variables' : {
+ 'search' : '()(\\@\\w+)()'
+ ,'class' : 'variables'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #879EFA;'
+ ,'KEYWORDS' : {
+ 'reserved' : 'color: #48BDDF;'
+ ,'functions' : 'color: #0040FD;'
+ ,'statements' : 'color: #60CA00;'
+ }
+ ,'OPERATORS' : 'color: #FF00FF;'
+ ,'DELIMITERS' : 'color: #2B60FF;'
+ ,'REGEXPS' : {
+ 'variables' : 'color: #E0BD54;'
+ }
+ }
+};
diff --git a/includes/edit_area/reg_syntax/tsql.js b/includes/edit_area/reg_syntax/tsql.js
new file mode 100644
index 00000000..2da6464d
--- /dev/null
+++ b/includes/edit_area/reg_syntax/tsql.js
@@ -0,0 +1,88 @@
+editAreaLoader.load_syntax["tsql"] = {
+ 'DISPLAY_NAME' : 'T-SQL'
+ ,'COMMENT_SINGLE' : {1 : '--'}
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
+ ,'QUOTEMARKS' : {1: "'" }
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements': [
+ 'ADD', 'EXCEPT', 'PERCENT', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION',
+ 'PRIMARY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC',
+ 'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC', 'BACKUP', 'FOR', 'RAISERROR',
+ 'BEGIN', 'FOREIGN', 'READ', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
+ 'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY',
+ 'FUNCTION', 'RESTORE', 'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN',
+ 'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE', 'HOLDLOCK', 'ROLLBACK',
+ 'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE',
+ 'IDENTITYCOL', 'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'SCHEMA', 'COMPUTE', 'INDEX',
+ 'SELECT', 'CONSTRAINT', 'CONTAINS', 'INSERT', 'SET',
+ 'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'SOME',
+ 'CREATE', 'STATISTICS', 'KEY', 'CURRENT', 'KILL', 'TABLE',
+ 'CURRENT_DATE', 'TEXTSIZE', 'CURRENT_TIME', 'THEN', 'LINENO',
+ 'TO', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN', 'DATABASE', 'NOCHECK',
+ 'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'TRUNCATE',
+ 'DECLARE', 'TSEQUAL', 'DEFAULT', 'UNION', 'DELETE', 'OF', 'UNIQUE',
+ 'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT', 'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN',
+ 'DISTRIBUTED', 'OPENDATASOURCE', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING', 'DROP',
+ 'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'WHERE',
+ 'END', 'ORDER', 'WHILE', 'ERRLVL', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT'
+ ],
+ 'functions': [
+ 'COALESCE', 'SESSION_USER', 'CONVERT', 'SYSTEM_USER', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'NULLIF', 'USER',
+ 'AVG', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG', 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP', 'MAX',
+ '@@DATEFIRST', '@@OPTIONS', '@@DBTS', '@@REMSERVER', '@@LANGID', '@@SERVERNAME', '@@LANGUAGE', '@@SERVICENAME', '@@LOCK_TIMEOUT',
+ '@@SPID', '@@MAX_CONNECTIONS', '@@TEXTSIZE', '@@MAX_PRECISION', '@@VERSION', '@@NESTLEVEL',
+ '@@CURSOR_ROWS', 'CURSOR_STATUS', '@@FETCH_STATUS',
+ 'DATEADD', 'DATEDIFF', 'DATENAME', 'DATEPART', 'DAY', 'GETDATE', 'GETUTCDATE', 'MONTH', 'YEAR',
+ 'ABS', 'DEGREES', 'RAND', 'ACOS', 'EXP', 'ROUND', 'ASIN', 'FLOOR', 'SIGN', 'ATAN', 'LOG', 'SIN', 'ATN2', 'LOG10', 'SQRT',
+ 'CEILING', 'PI ', 'SQUARE', 'COS', 'POWER', 'TAN', 'COT', 'RADIANS',
+ '@@PROCID', 'COL_LENGTH', 'FULLTEXTCATALOGPROPERTY', 'COL_NAME', 'FULLTEXTSERVICEPROPERTY', 'COLUMNPROPERTY', 'INDEX_COL',
+ 'DATABASEPROPERTY', 'INDEXKEY_PROPERTY', 'DATABASEPROPERTYEX', 'INDEXPROPERTY', 'DB_ID', 'OBJECT_ID', 'DB_NAME', 'OBJECT_NAME',
+ 'FILE_ID', 'OBJECTPROPERTY', 'OBJECTPROPERTYEX', 'FILE_NAME', 'SQL_VARIANT_PROPERTY', 'FILEGROUP_ID', 'FILEGROUP_NAME',
+ 'FILEGROUPPROPERTY', 'TYPEPROPERTY', 'FILEPROPERTY',
+ 'CURRENT_USER', 'SUSER_ID', 'SUSER_SID', 'IS_MEMBER', 'SUSER_SNAME', 'IS_SRVROLEMEMBER', 'PERMISSIONS', 'SYSTEM_USER',
+ 'SUSER_NAME', 'USER_ID', 'SESSION_USER', 'USER_NAME', 'ASCII', 'SOUNDEX', 'PATINDEX', 'SPACE', 'CHARINDEX', 'QUOTENAME',
+ 'STR', 'DIFFERENCE', 'REPLACE', 'STUFF', 'REPLICATE', 'SUBSTRING', 'LEN', 'REVERSE', 'UNICODE', 'LOWER',
+ 'UPPER', 'LTRIM', 'RTRIM', 'APP_NAME', 'CAST', 'CONVERT', 'COALESCE', 'COLLATIONPROPERTY', 'COLUMNS_UPDATED', 'CURRENT_TIMESTAMP',
+ 'CURRENT_USER', 'DATALENGTH', '@@ERROR', 'FORMATMESSAGE', 'GETANSINULL', 'HOST_ID', 'HOST_NAME', 'IDENT_CURRENT', 'IDENT_INCR',
+ 'IDENT_SEED', '@@IDENTITY', 'ISDATE', 'ISNULL', 'ISNUMERIC', 'NEWID', 'NULLIF', 'PARSENAME', '@@ROWCOUNT',
+ 'SCOPE_IDENTITY', 'SERVERPROPERTY', 'SESSIONPROPERTY', 'SESSION_USER', 'STATS_DATE', 'SYSTEM_USER', '@@TRANCOUNT', 'USER_NAME',
+ '@@CONNECTIONS', '@@PACK_RECEIVED', '@@CPU_BUSY', '@@PACK_SENT', '@@TIMETICKS', '@@IDLE', '@@TOTAL_ERRORS', '@@IO_BUSY', '@@TOTAL_READ',
+ '@@PACKET_ERRORS', '@@TOTAL_WRITE', 'PATINDEX', 'TEXTVALID', 'TEXTPTR'
+ ],
+ 'reserved': [
+ 'RIGHT', 'INNER', 'IS', 'JOIN', 'CROSS', 'LEFT', 'NULL', 'OUTER'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '*', '/', '%', '=', '&' ,'|', '^', '>', '<', '>=', '<=', '<>', '!=', '!<', '!>', 'ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', '~'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'REGEXPS' : {
+ // highlight all variables (@...)
+ 'variables' : {
+ 'search' : '()(\\@\\w+)()'
+ ,'class' : 'variables'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #008000;'
+ ,'QUOTESMARKS': 'color: #FF0000;'
+ ,'KEYWORDS' : {
+ 'reserved' : 'color: #808080;'
+ ,'functions' : 'color: #FF00FF;'
+ ,'statements' : 'color: #0000FF;'
+ }
+ ,'OPERATORS' : 'color: #808080;'
+ ,'DELIMITERS' : 'color: #FF8000;'
+ ,'REGEXPS' : {
+ 'variables' : 'color: #E0BD54;'
+ }
+ }
+};
+
+
diff --git a/includes/edit_area/reg_syntax/vb.js b/includes/edit_area/reg_syntax/vb.js
new file mode 100644
index 00000000..6af501f0
--- /dev/null
+++ b/includes/edit_area/reg_syntax/vb.js
@@ -0,0 +1,53 @@
+editAreaLoader.load_syntax["vb"] = {
+ 'DISPLAY_NAME' : 'Visual Basic'
+ ,'COMMENT_SINGLE' : {1 : "'"}
+ ,'COMMENT_MULTI' : { }
+ ,'QUOTEMARKS' : {1: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ 'statements' : [
+ 'if','then','for','each','while','do','loop',
+ 'else','elseif','select','case','end select',
+ 'until','next','step','to','in','end if'
+ ]
+ ,'keywords' : [
+ 'empty','isempty','nothing','null','isnull','true','false',
+ 'set','call',
+ 'sub','end sub','function','end function','exit','exit function',
+ 'dim','Mod','In','private','public','shared','const'
+ ]
+
+ ,'functions' : [
+ 'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
+ 'Hour','IsDate','Minute','Month',
+ 'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
+ 'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
+ 'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
+ 'Rnd','Sgn','Sin','Sqr','Tan',
+ 'Array','Filter','IsArray','Join','LBound','Split','UBound',
+ 'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
+ 'String','StrReverse','UCase',
+ 'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
+ 'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
+ 'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
+ ]
+ }
+ ,'OPERATORS' :[
+ '+', '-', '/', '*', '=', '<', '>', '!', '&'
+ ]
+ ,'DELIMITERS' :[
+ '(', ')', '[', ']', '{', '}'
+ ]
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #99CC00;'
+ ,'QUOTESMARKS': 'color: #333399;'
+ ,'KEYWORDS' : {
+ 'keywords' : 'color: #3366FF;'
+ ,'functions' : 'color: #0000FF;'
+ ,'statements' : 'color: #3366FF;'
+ }
+ ,'OPERATORS' : 'color: #FF0000;'
+ ,'DELIMITERS' : 'color: #0000FF;'
+
+ }
+};
diff --git a/includes/edit_area/reg_syntax/xml.js b/includes/edit_area/reg_syntax/xml.js
new file mode 100644
index 00000000..074d8885
--- /dev/null
+++ b/includes/edit_area/reg_syntax/xml.js
@@ -0,0 +1,57 @@
+/*
+* last update: 2006-08-24
+*/
+
+editAreaLoader.load_syntax["xml"] = {
+ 'DISPLAY_NAME' : 'XML'
+ ,'COMMENT_SINGLE' : {}
+ ,'COMMENT_MULTI' : {''}
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
+ ,'KEYWORD_CASE_SENSITIVE' : false
+ ,'KEYWORDS' : {
+ }
+ ,'OPERATORS' :[
+ ]
+ ,'DELIMITERS' :[
+ ]
+ ,'REGEXPS' : {
+ 'xml' : {
+ 'search' : '()(<\\?[^>]*?\\?>)()'
+ ,'class' : 'xml'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ ,'cdatas' : {
+ 'search' : '()()()'
+ ,'class' : 'cdata'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ ,'tags' : {
+ 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+ ,'class' : 'tags'
+ ,'modifiers' : 'gi'
+ ,'execute' : 'before' // before or after
+ }
+ ,'attributes' : {
+ 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+ ,'class' : 'attributes'
+ ,'modifiers' : 'g'
+ ,'execute' : 'before' // before or after
+ }
+ }
+ ,'STYLES' : {
+ 'COMMENTS': 'color: #AAAAAA;'
+ ,'QUOTESMARKS': 'color: #6381F8;'
+ ,'KEYWORDS' : {
+ }
+ ,'OPERATORS' : 'color: #E775F0;'
+ ,'DELIMITERS' : ''
+ ,'REGEXPS' : {
+ 'attributes': 'color: #B1AC41;'
+ ,'tags': 'color: #E62253;'
+ ,'xml': 'color: #8DCFB5;'
+ ,'cdata': 'color: #50B020;'
+ }
+ }
+};
diff --git a/includes/edit_area/regexp.js b/includes/edit_area/regexp.js
new file mode 100644
index 00000000..90ec3b1c
--- /dev/null
+++ b/includes/edit_area/regexp.js
@@ -0,0 +1,139 @@
+ /*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
+ new_class="quotes";
+ if(v6 && v6 != undefined && v6!="")
+ new_class="comments";
+ return "ยต__"+ new_class +"__ยต"+v0+"ยต_END_ยต";
+
+ };*/
+
+/* EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
+ res=""+v2;
+ alert("v2: "+v2+" v3: "+v3);
+ tab=v3.split("=");
+ attributes="";
+ if(tab.length>1){
+ attributes=""+tab[0]+" =";
+ for(i=1; i"+tab[i].substr(0,cut)+" ";
+ attributes+=""+tab[i].substr(cut)+" =";
+ }
+ attributes+=""+tab[tab.length-1]+" ";
+ }
+ res+=attributes+v5+" ";
+ return res;
+ };*/
+
+ // determine if the selected text if a comment or a quoted text
+ EditArea.prototype.comment_or_quote= function(){
+ var new_class="", close_tag="", sy, arg, i;
+ sy = parent.editAreaLoader.syntax[editArea.current_code_lang];
+ arg = EditArea.prototype.comment_or_quote.arguments[0];
+
+ for( i in sy["quotes"] ){
+ if(arg.indexOf(i)==0){
+ new_class="quotesmarks";
+ close_tag=sy["quotes"][i];
+ }
+ }
+ if(new_class.length==0)
+ {
+ for(var i in sy["comments"]){
+ if( arg.indexOf(i)==0 ){
+ new_class="comments";
+ close_tag=sy["comments"][i];
+ }
+ }
+ }
+ // for single line comment the \n must not be included in the span tags
+ if(close_tag=="\n"){
+ return "ยต__"+ new_class +"__ยต"+ arg.replace(/(\r?\n)?$/m, "ยต_END_ยต$1");
+ }else{
+ // the closing tag must be set only if the comment or quotes is closed
+ reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
+ if( arg.search(reg)!=-1 )
+ return "ยต__"+ new_class +"__ยต"+ arg +"ยต_END_ยต";
+ else
+ return "ยต__"+ new_class +"__ยต"+ arg;
+ }
+ };
+
+/*
+ // apply special tags arround text to highlight
+ EditArea.prototype.custom_highlight= function(){
+ res= EditArea.prototype.custom_highlight.arguments[1]+"ยต__"+ editArea.reg_exp_span_tag +"__ยต" + EditArea.prototype.custom_highlight.arguments[2]+"ยต_END_ยต";
+ if(EditArea.prototype.custom_highlight.arguments.length>5)
+ res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
+ return res;
+ };
+ */
+
+ // return identication that allow to know if revalidating only the text line won't make the syntax go mad
+ EditArea.prototype.get_syntax_trace= function(text){
+ if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
+ return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
+ };
+
+
+ EditArea.prototype.colorize_text= function(text){
+ //text=" ";
+ /*
+ if(this.isOpera){
+ // opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre
+ text= this.replace_tab(text);
+ }*/
+
+ text= " "+text; // for easier regExp
+
+ /*if(this.do_html_tags)
+ text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
+ if(this.settings["syntax"].length>0)
+ text= this.apply_syntax(text, this.settings["syntax"]);
+
+ // remove the first space added
+ return text.substr(1).replace(/&/g,"&").replace(//g,">").replace(/ยต_END_ยต/g,"").replace(/ยต__([a-zA-Z0-9]+)__ยต/g,"
");
+ };
+
+ EditArea.prototype.apply_syntax= function(text, lang){
+ var sy;
+ this.current_code_lang=lang;
+
+ if(!parent.editAreaLoader.syntax[lang])
+ return text;
+
+ sy = parent.editAreaLoader.syntax[lang];
+ if(sy["custom_regexp"]['before']){
+ for( var i in sy["custom_regexp"]['before']){
+ var convert="$1ยต__"+ sy["custom_regexp"]['before'][i]['class'] +"__ยต$2ยต_END_ยต$3";
+ text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
+ }
+ }
+
+ if(sy["comment_or_quote_reg_exp"]){
+ //setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
+ text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
+ }
+
+ if(sy["keywords_reg_exp"]){
+ for(var i in sy["keywords_reg_exp"]){
+ text= text.replace(sy["keywords_reg_exp"][i], 'ยต__'+i+'__ยต$2ยต_END_ยต');
+ }
+ }
+
+ if(sy["delimiters_reg_exp"]){
+ text= text.replace(sy["delimiters_reg_exp"], 'ยต__delimiters__ยต$1ยต_END_ยต');
+ }
+
+ if(sy["operators_reg_exp"]){
+ text= text.replace(sy["operators_reg_exp"], 'ยต__operators__ยต$1ยต_END_ยต');
+ }
+
+ if(sy["custom_regexp"]['after']){
+ for( var i in sy["custom_regexp"]['after']){
+ var convert="$1ยต__"+ sy["custom_regexp"]['after'][i]['class'] +"__ยต$2ยต_END_ยต$3";
+ text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);
+ }
+ }
+
+ return text;
+ };
diff --git a/includes/edit_area/resize_area.js b/includes/edit_area/resize_area.js
new file mode 100644
index 00000000..dfaad19c
--- /dev/null
+++ b/includes/edit_area/resize_area.js
@@ -0,0 +1,73 @@
+
+ EditAreaLoader.prototype.start_resize_area= function(){
+ var d=document,a,div,width,height,father;
+
+ d.onmouseup= editAreaLoader.end_resize_area;
+ d.onmousemove= editAreaLoader.resize_area;
+ editAreaLoader.toggle(editAreaLoader.resize["id"]);
+
+ a = editAreas[editAreaLoader.resize["id"]]["textarea"];
+ div = d.getElementById("edit_area_resize");
+ if(!div){
+ div= d.createElement("div");
+ div.id="edit_area_resize";
+ div.style.border="dashed #888888 1px";
+ }
+ width = a.offsetWidth -2;
+ height = a.offsetHeight -2;
+
+ div.style.display = "block";
+ div.style.width = width+"px";
+ div.style.height = height+"px";
+ father= a.parentNode;
+ father.insertBefore(div, a);
+
+ a.style.display="none";
+
+ editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
+ editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
+ };
+
+ EditAreaLoader.prototype.end_resize_area= function(e){
+ var d=document,div,a,width,height;
+
+ d.onmouseup="";
+ d.onmousemove="";
+
+ div = d.getElementById("edit_area_resize");
+ a= editAreas[editAreaLoader.resize["id"]]["textarea"];
+ width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
+ height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
+ if(editAreaLoader.isIE==6){
+ width-=2;
+ height-=2;
+ }
+ a.style.width = width+"px";
+ a.style.height = height+"px";
+ div.style.display = "none";
+ a.style.display = "inline";
+ a.selectionStart = editAreaLoader.resize["selectionStart"];
+ a.selectionEnd = editAreaLoader.resize["selectionEnd"];
+ editAreaLoader.toggle(editAreaLoader.resize["id"]);
+
+ return false;
+ };
+
+ EditAreaLoader.prototype.resize_area= function(e){
+ var allow,newHeight,newWidth;
+ allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
+ if(allow=="both" || allow=="y")
+ {
+ newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
+ document.getElementById("edit_area_resize").style.height= newHeight+"px";
+ }
+ if(allow=="both" || allow=="x")
+ {
+ newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
+ document.getElementById("edit_area_resize").style.width= newWidth+"px";
+ }
+
+ return false;
+ };
+
+ editAreaLoader.waiting_loading["resize_area.js"]= "loaded";
diff --git a/includes/edit_area/search_replace.js b/includes/edit_area/search_replace.js
new file mode 100644
index 00000000..b22c541b
--- /dev/null
+++ b/includes/edit_area/search_replace.js
@@ -0,0 +1,174 @@
+ EditArea.prototype.show_search = function(){
+ if(_$("area_search_replace").style.visibility=="visible"){
+ this.hidden_search();
+ }else{
+ this.open_inline_popup("area_search_replace");
+ var text= this.area_get_selection();
+ var search= text.split("\n")[0];
+ _$("area_search").value= search;
+ _$("area_search").focus();
+ }
+ };
+
+ EditArea.prototype.hidden_search= function(){
+ /*_$("area_search_replace").style.visibility="hidden";
+ this.textarea.focus();
+ var icon= _$("search");
+ setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
+ this.close_inline_popup("area_search_replace");
+ };
+
+ EditArea.prototype.area_search= function(mode){
+
+ if(!mode)
+ mode="search";
+ _$("area_search_msg").innerHTML="";
+ var search=_$("area_search").value;
+
+ this.textarea.focus();
+ this.textarea.textareaFocused=true;
+
+ var infos= this.get_selection_infos();
+ var start= infos["selectionStart"];
+ var pos=-1;
+ var pos_begin=-1;
+ var length=search.length;
+
+ if(_$("area_search_replace").style.visibility!="visible"){
+ this.show_search();
+ return;
+ }
+ if(search.length==0){
+ _$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
+ return;
+ }
+ // advance to the next occurence if no text selected
+ if(mode!="replace" ){
+ if(_$("area_search_reg_exp").checked)
+ start++;
+ else
+ start+= search.length;
+ }
+
+ //search
+ if(_$("area_search_reg_exp").checked){
+ // regexp search
+ var opt="m";
+ if(!_$("area_search_match_case").checked)
+ opt+="i";
+ var reg= new RegExp(search, opt);
+ pos= infos["full_text"].substr(start).search(reg);
+ pos_begin= infos["full_text"].search(reg);
+ if(pos!=-1){
+ pos+=start;
+ length=infos["full_text"].substr(start).match(reg)[0].length;
+ }else if(pos_begin!=-1){
+ length=infos["full_text"].match(reg)[0].length;
+ }
+ }else{
+ if(_$("area_search_match_case").checked){
+ pos= infos["full_text"].indexOf(search, start);
+ pos_begin= infos["full_text"].indexOf(search);
+ }else{
+ pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start);
+ pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase());
+ }
+ }
+
+ // interpret result
+ if(pos==-1 && pos_begin==-1){
+ _$("area_search_msg").innerHTML=""+search+" "+this.get_translation("not_found");
+ return;
+ }else if(pos==-1 && pos_begin != -1){
+ begin= pos_begin;
+ _$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
+ }else
+ begin= pos;
+
+ //_$("area_search_msg").innerHTML+=""+search+" found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
+ if(mode=="replace" && pos==infos["indexOfCursor"]){
+ var replace= _$("area_replace").value;
+ var new_text="";
+ if(_$("area_search_reg_exp").checked){
+ var opt="m";
+ if(!_$("area_search_match_case").checked)
+ opt+="i";
+ var reg= new RegExp(search, opt);
+ new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
+ }else{
+ new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
+ }
+ this.textarea.value=new_text;
+ this.area_select(begin, length);
+ this.area_search();
+ }else
+ this.area_select(begin, length);
+ };
+
+
+
+
+ EditArea.prototype.area_replace= function(){
+ this.area_search("replace");
+ };
+
+ EditArea.prototype.area_replace_all= function(){
+ /* this.area_select(0, 0);
+ _$("area_search_msg").innerHTML="";
+ while(_$("area_search_msg").innerHTML==""){
+ this.area_replace();
+ }*/
+
+ var base_text= this.textarea.value;
+ var search= _$("area_search").value;
+ var replace= _$("area_replace").value;
+ if(search.length==0){
+ _$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
+ return ;
+ }
+
+ var new_text="";
+ var nb_change=0;
+ if(_$("area_search_reg_exp").checked){
+ // regExp
+ var opt="mg";
+ if(!_$("area_search_match_case").checked)
+ opt+="i";
+ var reg= new RegExp(search, opt);
+ nb_change= infos["full_text"].match(reg).length;
+ new_text= infos["full_text"].replace(reg, replace);
+
+ }else{
+
+ if(_$("area_search_match_case").checked){
+ var tmp_tab=base_text.split(search);
+ nb_change= tmp_tab.length -1 ;
+ new_text= tmp_tab.join(replace);
+ }else{
+ // case insensitive
+ var lower_value=base_text.toLowerCase();
+ var lower_search=search.toLowerCase();
+
+ var start=0;
+ var pos= lower_value.indexOf(lower_search);
+ while(pos!=-1){
+ nb_change++;
+ new_text+= this.textarea.value.substring(start , pos)+replace;
+ start=pos+ search.length;
+ pos= lower_value.indexOf(lower_search, pos+1);
+ }
+ new_text+= this.textarea.value.substring(start);
+ }
+ }
+ if(new_text==base_text){
+ _$("area_search_msg").innerHTML=""+search+" "+this.get_translation("not_found");
+ }else{
+ this.textarea.value= new_text;
+ _$("area_search_msg").innerHTML=""+nb_change+" "+this.get_translation("occurrence_replaced");
+ // firefox and opera doesn't manage with the focus if it's done directly
+ //editArea.textarea.focus();editArea.textarea.textareaFocused=true;
+ setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
+ }
+
+
+ };
diff --git a/includes/edit_area/template.html b/includes/edit_area/template.html
new file mode 100644
index 00000000..25699186
--- /dev/null
+++ b/includes/edit_area/template.html
@@ -0,0 +1,100 @@
+
+
+
+
+ EditArea
+
+
+ [__CSSRULES__]
+ [__JSCODE__]
+
+
+
+
+
+
+
+
+
diff --git a/js/jquery.textarea.js b/js/jquery.textarea.js
deleted file mode 100644
index ec0b8b82..00000000
--- a/js/jquery.textarea.js
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Tabby jQuery plugin version 0.12
- *
- * Ted Devito - http://teddevito.com/demos/textarea.html
- *
- * Copyright (c) 2009 Ted Devito
- *
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
- * conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- *
- */
-
-// create closure
-
-(function($) {
-
- // plugin definition
-
- $.fn.tabby = function(options) {
- //debug(this);
- // build main options before element iteration
- var opts = $.extend({}, $.fn.tabby.defaults, options);
- var pressed = $.fn.tabby.pressed;
-
- // iterate and reformat each matched element
- return this.each(function() {
- $this = $(this);
-
- // build element specific options
- var options = $.meta ? $.extend({}, opts, $this.data()) : opts;
-
- $this.bind('keydown',function (e) {
- var kc = $.fn.tabby.catch_kc(e);
- if (16 == kc) pressed.shft = true;
- /*
- because both CTRL+TAB and ALT+TAB default to an event (changing tab/window) that
- will prevent js from capturing the keyup event, we'll set a timer on releasing them.
- */
- if (17 == kc) {pressed.ctrl = true; setTimeout("$.fn.tabby.pressed.ctrl = false;",1000);}
- if (18 == kc) {pressed.alt = true; setTimeout("$.fn.tabby.pressed.alt = false;",1000);}
-
- if (9 == kc && !pressed.ctrl && !pressed.alt) {
- e.preventDefault; // does not work in O9.63 ??
- pressed.last = kc; setTimeout("$.fn.tabby.pressed.last = null;",0);
- process_keypress ($(e.target).get(0), pressed.shft, options);
- return false;
- }
-
- }).bind('keyup',function (e) {
- if (16 == $.fn.tabby.catch_kc(e)) pressed.shft = false;
- }).bind('blur',function (e) { // workaround for Opera -- http://www.webdeveloper.com/forum/showthread.php?p=806588
- if (9 == pressed.last) $(e.target).one('focus',function (e) {pressed.last = null;}).get(0).focus();
- });
-
- });
- };
-
- // define and expose any extra methods
- $.fn.tabby.catch_kc = function(e) { return e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which; };
- $.fn.tabby.pressed = {shft : false, ctrl : false, alt : false, last: null};
-
- // private function for debugging
- function debug($obj) {
- if (window.console && window.console.log)
- window.console.log('textarea count: ' + $obj.size());
- };
-
- function process_keypress (o,shft,options) {
- var scrollTo = o.scrollTop;
- //var tabString = String.fromCharCode(9);
-
- // gecko; o.setSelectionRange is only available when the text box has focus
- if (o.setSelectionRange) gecko_tab (o, shft, options);
-
- // ie; document.selection is always available
- else if (document.selection) ie_tab (o, shft, options);
-
- o.scrollTop = scrollTo;
- }
-
- // plugin defaults
- $.fn.tabby.defaults = {tabString : String.fromCharCode(9)};
-
- function gecko_tab (o, shft, options) {
- var ss = o.selectionStart;
- var es = o.selectionEnd;
-
- // when there's no selection and we're just working with the caret, we'll add/remove the tabs at the caret, providing more control
- if(ss == es) {
- // SHIFT+TAB
- if (shft) {
- // check to the left of the caret first
- if ("\t" == o.value.substring(ss-options.tabString.length, ss)) {
- o.value = o.value.substring(0, ss-options.tabString.length) + o.value.substring(ss); // put it back together omitting one character to the left
- o.focus();
- o.setSelectionRange(ss - options.tabString.length, ss - options.tabString.length);
- }
- // then check to the right of the caret
- else if ("\t" == o.value.substring(ss, ss + options.tabString.length)) {
- o.value = o.value.substring(0, ss) + o.value.substring(ss + options.tabString.length); // put it back together omitting one character to the right
- o.focus();
- o.setSelectionRange(ss,ss);
- }
- }
- // TAB
- else {
- o.value = o.value.substring(0, ss) + options.tabString + o.value.substring(ss);
- o.focus();
- o.setSelectionRange(ss + options.tabString.length, ss + options.tabString.length);
- }
- }
- // selections will always add/remove tabs from the start of the line
- else {
- // split the textarea up into lines and figure out which lines are included in the selection
- var lines = o.value.split("\n");
- var indices = new Array();
- var sl = 0; // start of the line
- var el = 0; // end of the line
- var sel = false;
- for (var i in lines) {
- el = sl + lines[i].length;
- indices.push({start: sl, end: el, selected: (sl <= ss && el > ss) || (el >= es && sl < es) || (sl > ss && el < es)});
- sl = el + 1;// for "\n"
- }
-
- // walk through the array of lines (indices) and add tabs where appropriate
- var modifier = 0;
- for (var i in indices) {
- if (indices[i].selected) {
- var pos = indices[i].start + modifier; // adjust for tabs already inserted/removed
- // SHIFT+TAB
- if (shft && options.tabString == o.value.substring(pos,pos+options.tabString.length)) { // only SHIFT+TAB if there's a tab at the start of the line
- o.value = o.value.substring(0,pos) + o.value.substring(pos + options.tabString.length); // omit the tabstring to the right
- modifier -= options.tabString.length;
- }
- // TAB
- else if (!shft) {
- o.value = o.value.substring(0,pos) + options.tabString + o.value.substring(pos); // insert the tabstring
- modifier += options.tabString.length;
- }
- }
- }
- o.focus();
- var ns = ss + ((modifier > 0) ? options.tabString.length : (modifier < 0) ? -options.tabString.length : 0);
- var ne = es + modifier;
- o.setSelectionRange(ns,ne);
- }
- }
-
- function ie_tab (o, shft, options) {
- var range = document.selection.createRange();
-
- if (o == range.parentElement()) {
- // when there's no selection and we're just working with the caret, we'll add/remove the tabs at the caret, providing more control
- if ('' == range.text) {
- // SHIFT+TAB
- if (shft) {
- var bookmark = range.getBookmark();
- //first try to the left by moving opening up our empty range to the left
- range.moveStart('character', -options.tabString.length);
- if (options.tabString == range.text) {
- range.text = '';
- } else {
- // if that didn't work then reset the range and try opening it to the right
- range.moveToBookmark(bookmark);
- range.moveEnd('character', options.tabString.length);
- if (options.tabString == range.text)
- range.text = '';
- }
- // move the pointer to the start of them empty range and select it
- range.collapse(true);
- range.select();
- }
-
- else {
- // very simple here. just insert the tab into the range and put the pointer at the end
- range.text = options.tabString;
- range.collapse(false);
- range.select();
- }
- }
- // selections will always add/remove tabs from the start of the line
- else {
-
- var selection_text = range.text;
- var selection_len = selection_text.length;
- var selection_arr = selection_text.split("\r\n");
-
- var before_range = document.body.createTextRange();
- before_range.moveToElementText(o);
- before_range.setEndPoint("EndToStart", range);
- var before_text = before_range.text;
- var before_arr = before_text.split("\r\n");
- var before_len = before_text.length; // - before_arr.length + 1;
-
- var after_range = document.body.createTextRange();
- after_range.moveToElementText(o);
- after_range.setEndPoint("StartToEnd", range);
- var after_text = after_range.text; // we can accurately calculate distance to the end because we're not worried about MSIE trimming a \r\n
-
- var end_range = document.body.createTextRange();
- end_range.moveToElementText(o);
- end_range.setEndPoint("StartToEnd", before_range);
- var end_text = end_range.text; // we can accurately calculate distance to the end because we're not worried about MSIE trimming a \r\n
-
- var check_html = $(o).html();
- $("#r3").text(before_len + " + " + selection_len + " + " + after_text.length + " = " + check_html.length);
- if((before_len + end_text.length) < check_html.length) {
- before_arr.push("");
- before_len += 2; // for the \r\n that was trimmed
- if (shft && options.tabString == selection_arr[0].substring(0,options.tabString.length))
- selection_arr[0] = selection_arr[0].substring(options.tabString.length);
- else if (!shft) selection_arr[0] = options.tabString + selection_arr[0];
- } else {
- if (shft && options.tabString == before_arr[before_arr.length-1].substring(0,options.tabString.length))
- before_arr[before_arr.length-1] = before_arr[before_arr.length-1].substring(options.tabString.length);
- else if (!shft) before_arr[before_arr.length-1] = options.tabString + before_arr[before_arr.length-1];
- }
-
- for (var i = 1; i < selection_arr.length; i++) {
- if (shft && options.tabString == selection_arr[i].substring(0,options.tabString.length))
- selection_arr[i] = selection_arr[i].substring(options.tabString.length);
- else if (!shft) selection_arr[i] = options.tabString + selection_arr[i];
- }
-
- if (1 == before_arr.length && 0 == before_len) {
- if (shft && options.tabString == selection_arr[0].substring(0,options.tabString.length))
- selection_arr[0] = selection_arr[0].substring(options.tabString.length);
- else if (!shft) selection_arr[0] = options.tabString + selection_arr[0];
- }
-
- if ((before_len + selection_len + after_text.length) < check_html.length) {
- selection_arr.push("");
- selection_len += 2; // for the \r\n that was trimmed
- }
-
- before_range.text = before_arr.join("\r\n");
- range.text = selection_arr.join("\r\n");
-
- var new_range = document.body.createTextRange();
- new_range.moveToElementText(o);
-
- if (0 < before_len) new_range.setEndPoint("StartToEnd", before_range);
- else new_range.setEndPoint("StartToStart", before_range);
- new_range.setEndPoint("EndToEnd", range);
-
- new_range.select();
-
- }
- }
- }
-
-// end of closure
-})(jQuery);
diff --git a/readme.txt b/readme.txt
index 7525ddf8..110b9ee6 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,8 +3,8 @@ Contributors: bungeshea
Donate link: http://bungeshea.wordpress.com/donate/
Tags: snippets, code, php
Requires at least: 3.3
-Tested up to: 3.4
-Stable tag: 1.1
+Tested up to: 3.4.1
+Stable tag: 1.2
License: GPLv3 or later
License URI: http://www.gnu.org/copyleft/gpl.html
@@ -14,24 +14,26 @@ Allows you to easily add code snippets through a GUI interface.
**Code Snippets** is a easy, clean and simple way to add code snippets to your site.
-Use the top level menu to manage your snippets. You can activate, deactivate, edit and delete snippets using a page similar to the Plugins menu. You can add a name for your snippet through the visual editor and the code through a tab-enabled text-area.
+Use the top level menu to manage your snippets. You can activate, deactivate, edit and delete snippets using a page similar to the Plugins menu. You can add a name for your snippet, a description using the visual editor and the code using a textarea with syntax highlighting and other features.
Snippets are stored in the `wp_snippets` table in the WordPress database (the table name may differ depending on what your table prefix is set to).
-Code Snippets includes an option to clean up its data when deactivated. Each screen includes a help tab just in case you get stuck.
+Code Snippets will automaticly clean ut its data when deleted through the WordPress dashboard. Each screen includes a help tab just in case you get stuck.
-Further information and screenshots are available on the [plugin homepage]( http://bungeshea.wordpress.com/plugins/code-snippets).
+Further information and screenshots are available on the [plugin homepage](http://bungeshea.wordpress.com/plugins/code-snippets).
-Code Snippets was featured on WPMU.org - [WordPress Code Snippets: Keep them Organized with this Plugin!](http://wpmu.org/wordpress-code-snippets/)
+Code Snippets was featured on WPMU: [WordPress Code Snippets: Keep them Organized with this Plugin!](http://wpmu.org/wordpress-code-snippets)
-If you have any feedback, issues or suggestions for improvements please start a topic in the [Support Forum](http://wordpress.org/support/plugin/code-snippets) and if you like the plugin please give it a rating at [WordPress.org](http://wordpress.org/extend/plugins/code-snippets) :-)
+If you have any feedback, issues or suggestions for improvements please start a topic in the [Support Forum](http://wordpress.org/support/plugin/code-snippets) and if you like the plugin please give it a perfect rating at [WordPress.org](http://wordpress.org/extend/plugins/code-snippets) :-)
+
+You can also contribute to the code at [GitHub](https://github.com/bungeshea/code-snippets).
== Installation ==
1. Download the `code-snippets.zip` file to your local machine.
-2. Either use the automatic plugin installer *(Plugins > Add New)* or Unzip the file and upload the **code-snippets** folder to your `/wp-content/plugins/` directory.
+2. Either use the automatic plugin installer *(Plugins - Add New)* or Unzip the file and upload the **code-snippets** folder to your `/wp-content/plugins/` directory.
3. Activate the plugin through the Plugins menu
-4. Visit the Add New Snippet menu page *(Snippets > Add New)* to add or edit Snippets.
+4. Visit the **Add New Snippet** menu page *(Snippets > Add New)* to add or edit Snippets.
5. Activate your snippets through the Manage Snippets page *(Snippets > Manage Snippets)*
== Frequently Asked Questions ==
@@ -42,28 +44,35 @@ No, just copy all the content inside those tags.
= Is there a way to add a snippet but not run it right away? =
Yes. Just add it but do not activate it yet.
-= Can I use the TAB key inside the code text-area to indent my code? =
-Yes! Thanks to Ted Devito's [Tabby jQuery plugin](http://teddevito.com/demos/textarea.html), the TAB key will add an indent instead of switching to the next object.
+= What do I use to write my snippets? =
+The [EditArea](http://www.cdolivet.com/editarea/) source-code editor will add line numbers, syntax highlighting, search and replace, tablature and other cool features to the code editor.
= Will I lose my snippets if I change the theme or upgrade WordPress? =
No, the snippets are added to the WordPress database so are independent of the theme and unaffected by WordPress upgrades.
= Can the plugin be completely uninstalled? =
-Yes, there is an option to delete the database table and if you want to completely remove the plugin.
+Yes, when you delete Code Snippets using the 'Plugins' menu in WordPress it will clean up the database table and a few other bits of data. Be careful not to remove Code Snippets using the Plugins menu unless you want this to happen.
= Can I copy any snippets I've created to another WordPress site? =
The import/export feature is currently in development. You can however, use the export feature of phpMyAdmin to copy the `wp_snippets` table to another WordPress database.
+= Can I run network-wide snippets on a multisite installation? =
+No, this feature is currently not avalible and will be coming in a future release. In the mean time activate Code Snippets individualy on the desired sites.
+
== Screenshots ==
1. The Manage Snippets page
2. The Add New Snippet page
3. Editing a snippet
-4. The Uninstall Plugin page
-5. Each screen includes a help tab just in case you get stuck.
+4. Each screen includes a help tab just in case you get stuck.
== Changelog ==
+= 1.2 =
+* Minor improvements
+* Added code highlighting
+* Removed 'Uninstall Plugin' page. Data will now be cleaned up when plugin is deleted through WordPress admin.
+
= 1.1 =
* Fixed a permissions bug with `DISALLOW_FILE_EDIT` being set to true
* Fixed a bug with the page title reading 'Add New Snippet' on the 'Edit Snippets' page
@@ -73,5 +82,10 @@ The import/export feature is currently in development. You can however, use the
== Upgrade Notice ==
+= 1.2 =
+* Minor improvments
+* Added code highlighting
+* Plugin data will now be cleaned up when you delete the plugin.
+
= 1.1 =
-* Minor bug fixes and improvments on the the 'Edit Snippet' page
\ No newline at end of file
+* Minor bug fixes and improvements on the the 'Edit Snippet' page
\ No newline at end of file
diff --git a/screenshot-1.jpg b/screenshot-1.jpg
index 845bd945..d921b1ae 100644
Binary files a/screenshot-1.jpg and b/screenshot-1.jpg differ
diff --git a/screenshot-2.jpg b/screenshot-2.jpg
index a766128f..a55b2de7 100644
Binary files a/screenshot-2.jpg and b/screenshot-2.jpg differ
diff --git a/screenshot-3.jpg b/screenshot-3.jpg
index be6c06a7..1727c8d8 100644
Binary files a/screenshot-3.jpg and b/screenshot-3.jpg differ
diff --git a/screenshot-4.jpg b/screenshot-4.jpg
index 983fffcb..f805b1cb 100644
Binary files a/screenshot-4.jpg and b/screenshot-4.jpg differ
diff --git a/screenshot-5.jpg b/screenshot-5.jpg
deleted file mode 100644
index 37c60a00..00000000
Binary files a/screenshot-5.jpg and /dev/null differ