Magpleasure_Filesystem - Version 1.0.0

Version Notes

Ready to stable use

Download this release

Release Info

Developer Magento Core Team
Extension Magpleasure_Filesystem
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (175) hide show
  1. app/code/community/Magpleasure/Filesystem/Block/Adminhtml/Ide.php +27 -0
  2. app/code/community/Magpleasure/Filesystem/Block/Adminhtml/Ide/Editor.php +31 -0
  3. app/code/community/Magpleasure/Filesystem/Block/Adminhtml/Ide/Tree.php +43 -0
  4. app/code/community/Magpleasure/Filesystem/Helper/Data.php +20 -0
  5. app/code/community/Magpleasure/Filesystem/Model/Tree.php +102 -0
  6. app/code/community/Magpleasure/Filesystem/controllers/Adminhtml/FilesystemController.php +310 -0
  7. app/code/community/Magpleasure/Filesystem/etc/adminhtml.xml +70 -0
  8. app/code/community/Magpleasure/Filesystem/etc/config.xml +137 -0
  9. app/code/community/Magpleasure/Filesystem/etc/system.xml +42 -0
  10. app/code/community/Magpleasure/Filesystem/sql/filesystem_setup/mysql4-install-1.0.php +20 -0
  11. app/design/adminhtml/default/default/layout/filesystem.xml +19 -0
  12. app/design/adminhtml/default/default/template/filesystem/ide.phtml +28 -0
  13. app/design/adminhtml/default/default/template/filesystem/ide/editor.phtml +46 -0
  14. app/design/adminhtml/default/default/template/filesystem/ide/tree.phtml +35 -0
  15. app/design/adminhtml/default/default/template/filesystem/wrapper.phtml +17 -0
  16. app/etc/modules/Magpleasure_Filesystem.xml +9 -0
  17. js/editarea/autocompletion.js +491 -0
  18. js/editarea/edit_area.css +530 -0
  19. js/editarea/edit_area.js +527 -0
  20. js/editarea/edit_area_compressor.php +428 -0
  21. js/editarea/edit_area_full.gz +0 -0
  22. js/editarea/edit_area_full.js +38 -0
  23. js/editarea/edit_area_functions.js +1202 -0
  24. js/editarea/edit_area_loader.js +1081 -0
  25. js/editarea/elements_functions.js +336 -0
  26. js/editarea/highlight.js +407 -0
  27. js/editarea/images/autocompletion.gif +0 -0
  28. js/editarea/images/close.gif +0 -0
  29. js/editarea/images/fullscreen.gif +0 -0
  30. js/editarea/images/go_to_line.gif +0 -0
  31. js/editarea/images/help.gif +0 -0
  32. js/editarea/images/highlight.gif +0 -0
  33. js/editarea/images/load.gif +0 -0
  34. js/editarea/images/move.gif +0 -0
  35. js/editarea/images/newdocument.gif +0 -0
  36. js/editarea/images/opacity.png +0 -0
  37. js/editarea/images/processing.gif +0 -0
  38. js/editarea/images/redo.gif +0 -0
  39. js/editarea/images/reset_highlight.gif +0 -0
  40. js/editarea/images/save.gif +0 -0
  41. js/editarea/images/search.gif +0 -0
  42. js/editarea/images/smooth_selection.gif +0 -0
  43. js/editarea/images/spacer.gif +0 -0
  44. js/editarea/images/statusbar_resize.gif +0 -0
  45. js/editarea/images/undo.gif +0 -0
  46. js/editarea/images/word_wrap.gif +0 -0
  47. js/editarea/keyboard.js +145 -0
  48. js/editarea/langs/bg.js +54 -0
  49. js/editarea/langs/cs.js +48 -0
  50. js/editarea/langs/de.js +48 -0
  51. js/editarea/langs/dk.js +48 -0
  52. js/editarea/langs/en.js +48 -0
  53. js/editarea/langs/eo.js +48 -0
  54. js/editarea/langs/es.js +48 -0
  55. js/editarea/langs/fi.js +48 -0
  56. js/editarea/langs/fr.js +48 -0
  57. js/editarea/langs/hr.js +48 -0
  58. js/editarea/langs/it.js +48 -0
  59. js/editarea/langs/ja.js +48 -0
  60. js/editarea/langs/mk.js +48 -0
  61. js/editarea/langs/nl.js +48 -0
  62. js/editarea/langs/pl.js +48 -0
  63. js/editarea/langs/pt.js +48 -0
  64. js/editarea/langs/ru.js +48 -0
  65. js/editarea/langs/sk.js +48 -0
  66. js/editarea/langs/zh.js +48 -0
  67. js/editarea/license_apache.txt +7 -0
  68. js/editarea/license_bsd.txt +10 -0
  69. js/editarea/license_lgpl.txt +458 -0
  70. js/editarea/manage_area.js +623 -0
  71. js/editarea/plugins/charmap/charmap.js +90 -0
  72. js/editarea/plugins/charmap/css/charmap.css +64 -0
  73. js/editarea/plugins/charmap/images/charmap.gif +0 -0
  74. js/editarea/plugins/charmap/jscripts/map.js +373 -0
  75. js/editarea/plugins/charmap/langs/bg.js +12 -0
  76. js/editarea/plugins/charmap/langs/cs.js +6 -0
  77. js/editarea/plugins/charmap/langs/de.js +6 -0
  78. js/editarea/plugins/charmap/langs/dk.js +6 -0
  79. js/editarea/plugins/charmap/langs/en.js +6 -0
  80. js/editarea/plugins/charmap/langs/eo.js +6 -0
  81. js/editarea/plugins/charmap/langs/es.js +6 -0
  82. js/editarea/plugins/charmap/langs/fr.js +6 -0
  83. js/editarea/plugins/charmap/langs/hr.js +6 -0
  84. js/editarea/plugins/charmap/langs/it.js +6 -0
  85. js/editarea/plugins/charmap/langs/ja.js +6 -0
  86. js/editarea/plugins/charmap/langs/mk.js +6 -0
  87. js/editarea/plugins/charmap/langs/nl.js +6 -0
  88. js/editarea/plugins/charmap/langs/pl.js +6 -0
  89. js/editarea/plugins/charmap/langs/pt.js +6 -0
  90. js/editarea/plugins/charmap/langs/ru.js +6 -0
  91. js/editarea/plugins/charmap/langs/sk.js +6 -0
  92. js/editarea/plugins/charmap/langs/zh.js +6 -0
  93. js/editarea/plugins/charmap/popup.html +24 -0
  94. js/editarea/plugins/test/css/test.css +3 -0
  95. js/editarea/plugins/test/images/Thumbs.db +0 -0
  96. js/editarea/plugins/test/images/test.gif +0 -0
  97. js/editarea/plugins/test/langs/bg.js +10 -0
  98. js/editarea/plugins/test/langs/cs.js +4 -0
  99. js/editarea/plugins/test/langs/de.js +4 -0
  100. js/editarea/plugins/test/langs/dk.js +4 -0
  101. js/editarea/plugins/test/langs/en.js +4 -0
  102. js/editarea/plugins/test/langs/eo.js +4 -0
  103. js/editarea/plugins/test/langs/es.js +4 -0
  104. js/editarea/plugins/test/langs/fr.js +4 -0
  105. js/editarea/plugins/test/langs/hr.js +4 -0
  106. js/editarea/plugins/test/langs/it.js +4 -0
  107. js/editarea/plugins/test/langs/ja.js +4 -0
  108. js/editarea/plugins/test/langs/mk.js +4 -0
  109. js/editarea/plugins/test/langs/nl.js +4 -0
  110. js/editarea/plugins/test/langs/pl.js +4 -0
  111. js/editarea/plugins/test/langs/pt.js +4 -0
  112. js/editarea/plugins/test/langs/ru.js +4 -0
  113. js/editarea/plugins/test/langs/sk.js +4 -0
  114. js/editarea/plugins/test/langs/zh.js +4 -0
  115. js/editarea/plugins/test/test.js +110 -0
  116. js/editarea/plugins/test/test2.js +1 -0
  117. js/editarea/reg_syntax.js +166 -0
  118. js/editarea/reg_syntax/basic.js +70 -0
  119. js/editarea/reg_syntax/brainfuck.js +45 -0
  120. js/editarea/reg_syntax/c.js +63 -0
  121. js/editarea/reg_syntax/coldfusion.js +120 -0
  122. js/editarea/reg_syntax/cpp.js +66 -0
  123. js/editarea/reg_syntax/css.js +85 -0
  124. js/editarea/reg_syntax/html.js +51 -0
  125. js/editarea/reg_syntax/java.js +57 -0
  126. js/editarea/reg_syntax/js.js +94 -0
  127. js/editarea/reg_syntax/pas.js +83 -0
  128. js/editarea/reg_syntax/perl.js +88 -0
  129. js/editarea/reg_syntax/php.js +157 -0
  130. js/editarea/reg_syntax/phtml.js +157 -0
  131. js/editarea/reg_syntax/python.js +145 -0
  132. js/editarea/reg_syntax/robotstxt.js +25 -0
  133. js/editarea/reg_syntax/ruby.js +68 -0
  134. js/editarea/reg_syntax/sql.js +56 -0
  135. js/editarea/reg_syntax/tsql.js +88 -0
  136. js/editarea/reg_syntax/vb.js +53 -0
  137. js/editarea/reg_syntax/xml.js +57 -0
  138. js/editarea/regexp.js +139 -0
  139. js/editarea/resize_area.js +73 -0
  140. js/editarea/search_replace.js +174 -0
  141. js/editarea/template.html +100 -0
  142. js/filesystem/base64.js +153 -0
  143. js/filesystem/jquery-1.4.2.min.js +157 -0
  144. js/filesystem/jqueryfiletree.js +95 -0
  145. js/filesystem/script.coffee +149 -0
  146. js/filesystem/script.js +146 -0
  147. package.xml +20 -0
  148. skin/adminhtml/default/default/filesystem/css/jqueryfiletree.css +92 -0
  149. skin/adminhtml/default/default/filesystem/css/styles.css +52 -0
  150. skin/adminhtml/default/default/filesystem/images/application.png +0 -0
  151. skin/adminhtml/default/default/filesystem/images/code.png +0 -0
  152. skin/adminhtml/default/default/filesystem/images/css.png +0 -0
  153. skin/adminhtml/default/default/filesystem/images/db.png +0 -0
  154. skin/adminhtml/default/default/filesystem/images/directory.png +0 -0
  155. skin/adminhtml/default/default/filesystem/images/doc.png +0 -0
  156. skin/adminhtml/default/default/filesystem/images/file.png +0 -0
  157. skin/adminhtml/default/default/filesystem/images/film.png +0 -0
  158. skin/adminhtml/default/default/filesystem/images/flash.png +0 -0
  159. skin/adminhtml/default/default/filesystem/images/folder_open.png +0 -0
  160. skin/adminhtml/default/default/filesystem/images/html.png +0 -0
  161. skin/adminhtml/default/default/filesystem/images/java.png +0 -0
  162. skin/adminhtml/default/default/filesystem/images/linux.png +0 -0
  163. skin/adminhtml/default/default/filesystem/images/music.png +0 -0
  164. skin/adminhtml/default/default/filesystem/images/pdf.png +0 -0
  165. skin/adminhtml/default/default/filesystem/images/php.png +0 -0
  166. skin/adminhtml/default/default/filesystem/images/phtml.png +0 -0
  167. skin/adminhtml/default/default/filesystem/images/picture.png +0 -0
  168. skin/adminhtml/default/default/filesystem/images/ppt.png +0 -0
  169. skin/adminhtml/default/default/filesystem/images/psd.png +0 -0
  170. skin/adminhtml/default/default/filesystem/images/ruby.png +0 -0
  171. skin/adminhtml/default/default/filesystem/images/script.png +0 -0
  172. skin/adminhtml/default/default/filesystem/images/spinner.gif +0 -0
  173. skin/adminhtml/default/default/filesystem/images/txt.png +0 -0
  174. skin/adminhtml/default/default/filesystem/images/xls.png +0 -0
  175. skin/adminhtml/default/default/filesystem/images/zip.png +0 -0
app/code/community/Magpleasure/Filesystem/Block/Adminhtml/Ide.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+
18
+
19
+ class Magpleasure_Filesystem_Block_Adminhtml_Ide extends Mage_Adminhtml_Block_Abstract
20
+ {
21
+ public function __construct()
22
+ {
23
+ parent::__construct();
24
+
25
+
26
+ }
27
+ }
app/code/community/Magpleasure/Filesystem/Block/Adminhtml/Ide/Editor.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+
18
+
19
+ class Magpleasure_Filesystem_Block_Adminhtml_Ide_Editor extends Mage_Adminhtml_Block_Abstract
20
+ {
21
+ /**
22
+ * Template path
23
+ */
24
+ const TEMPLATE_PATH = 'filesystem/ide/editor.phtml';
25
+
26
+ protected function _construct()
27
+ {
28
+ parent::_construct();
29
+ $this->setTemplate(self::TEMPLATE_PATH);
30
+ }
31
+ }
app/code/community/Magpleasure/Filesystem/Block/Adminhtml/Ide/Tree.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+
18
+
19
+ class Magpleasure_Filesystem_Block_Adminhtml_Ide_Tree extends Mage_Adminhtml_Block_Abstract
20
+ {
21
+ /**
22
+ * Template path
23
+ */
24
+ const TEMPLATE_PATH = 'filesystem/ide/tree.phtml';
25
+
26
+ protected function _construct()
27
+ {
28
+ parent::_construct();
29
+ $this->setTemplate(self::TEMPLATE_PATH);
30
+ }
31
+
32
+ public function getTreeHtml()
33
+ {
34
+ $url = $this->getUrl("filesystem/adminhtml_filesystem/load", array('fn'=>"{{filename}}"));
35
+ return Mage::getModel('filesystem/tree')->php_file_tree(Mage::getBaseDir(), "javascript:openFile('{$url}','[link]');");
36
+ }
37
+
38
+ public function getFormKey()
39
+ {
40
+ return Mage::getSingleton('core/session')->getFormKey();
41
+ }
42
+
43
+ }
app/code/community/Magpleasure/Filesystem/Helper/Data.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ class Magpleasure_Filesystem_Helper_Data extends Mage_Core_Helper_Abstract
18
+ {
19
+
20
+ }
app/code/community/Magpleasure/Filesystem/Model/Tree.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ class Magpleasure_Filesystem_Model_Tree extends Mage_Core_Model_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->_init('filesystem/tree');
23
+ }
24
+
25
+ public function php_file_tree($directory, $return_link, $extensions = array()) {
26
+ // Generates a valid XHTML list of all directories, sub-directories, and files in $directory
27
+ // Remove trailing slash
28
+ $code = "";
29
+ if( substr($directory, -1) == "/" ) $directory = substr($directory, 0, strlen($directory) - 1);
30
+ $code .= $this->php_file_tree_dir($directory, $return_link, $extensions);
31
+ return $code;
32
+ }
33
+
34
+ public function php_file_tree_dir($directory, $return_link, $extensions = array(), $first_call = true) {
35
+ // Recursive function called by php_file_tree() to list directories/files
36
+ $php_file_tree = '';
37
+
38
+ ///@TODO temporary placeholder
39
+ /// missing media and var directories
40
+ $nonGratte = array(Mage::getBaseDir().DS."media",Mage::getBaseDir().DS."var");
41
+ if (in_array($directory, $nonGratte)){
42
+ return '';
43
+ }
44
+ /// End temparary part
45
+
46
+ // Get and sort directories/files
47
+ if( function_exists("scandir") ) $file = scandir($directory); else $file = $this->php4_scandir($directory);
48
+ natcasesort($file);
49
+ // Make directories first
50
+ $files = $dirs = array();
51
+ foreach($file as $this_file) {
52
+ if( is_dir("$directory/$this_file" ) ) $dirs[] = $this_file; else $files[] = $this_file;
53
+ }
54
+ $file = array_merge($dirs, $files);
55
+
56
+ // Filter unwanted extensions
57
+ if( !empty($extensions) ) {
58
+ foreach( array_keys($file) as $key ) {
59
+ if( !is_dir("$directory/$file[$key]") ) {
60
+ $ext = substr($file[$key], strrpos($file[$key], ".") + 1);
61
+ if( !in_array($ext, $extensions) ) unset($file[$key]);
62
+ }
63
+ }
64
+ }
65
+
66
+ if( count($file) > 2 ) { // Use 2 instead of 0 to account for . and .. "directories"
67
+ $php_file_tree = "<ul";
68
+ if( $first_call ) { $php_file_tree .= " class=\"php-file-tree\""; $first_call = false; }
69
+ $php_file_tree .= ">";
70
+ foreach( $file as $this_file ) {
71
+ if( $this_file != "." && $this_file != ".." ) {
72
+ if( is_dir("$directory/$this_file") ) {
73
+ // Directory
74
+ $php_file_tree .= "<li class=\"pft-directory\"><a href=\"#\">" . htmlspecialchars($this_file) . "</a>";
75
+ $php_file_tree .= $this->php_file_tree_dir("$directory/$this_file", $return_link ,$extensions, false);
76
+ $php_file_tree .= "</li>";
77
+ } else {
78
+ // File
79
+ // Get extension (prepend 'ext-' to prevent invalid classes from extensions that begin with numbers)
80
+ $ext = "ext-" . substr($this_file, strrpos($this_file, ".") + 1);
81
+ $link = str_replace("[link]", "$directory/" . urlencode($this_file), $return_link);
82
+ $php_file_tree .= "<li class=\"pft-file " . strtolower($ext) . "\"><a href=\"$link\">" . htmlspecialchars($this_file) . "</a></li>";
83
+ }
84
+ }
85
+ }
86
+ $php_file_tree .= "</ul>";
87
+ }
88
+ return $php_file_tree;
89
+ }
90
+
91
+ // For PHP4 compatibility
92
+ public function php4_scandir($dir) {
93
+ $dh = opendir($dir);
94
+ while( false !== ($filename = readdir($dh)) ) {
95
+ $files[] = $filename;
96
+ }
97
+ sort($files);
98
+ return($files);
99
+ }
100
+
101
+
102
+ }
app/code/community/Magpleasure/Filesystem/controllers/Adminhtml/FilesystemController.php ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+
18
+ class Magpleasure_Filesystem_Adminhtml_FilesystemController extends Mage_Adminhtml_Controller_action
19
+ {
20
+
21
+ protected function _isAllowed()
22
+ {
23
+ return Mage::getSingleton('admin/session')->isAllowed('system/filesystem/edit');
24
+ }
25
+
26
+ protected function _initAction()
27
+ {
28
+ $this->loadLayout()
29
+ ->_setActiveMenu('filesystem/items')
30
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('File Syslem'), Mage::helper('adminhtml')->__('IDE'));
31
+ return $this;
32
+ }
33
+
34
+ /**
35
+ * Response for Ajax Request
36
+ * @param array $result
37
+ */
38
+ protected function _ajaxResponse($result = array())
39
+ {
40
+ $this->getResponse()->setBody(Zend_Json::encode($result));
41
+ }
42
+
43
+ public function indexAction()
44
+ {
45
+ $this->_initAction()
46
+ ->renderLayout();
47
+ }
48
+
49
+ /**
50
+ * Helper
51
+ * @return Magpleasure_Filesystem_Helper_Data
52
+ */
53
+ protected function _helper()
54
+ {
55
+ return Mage::helper('filesystem');
56
+ }
57
+
58
+
59
+ /**
60
+ * Session
61
+ * @return Mage_Adminhtml_Model_Session
62
+ */
63
+ protected function _getSession()
64
+ {
65
+ return Mage::getModel('adminhtml/session');
66
+ }
67
+
68
+ /**
69
+ * File ids
70
+ * @return array
71
+ */
72
+ protected function _getFiles()
73
+ {
74
+ $files = array();
75
+
76
+ if ($this->_getSession()->getFileInfo()){
77
+ $files = $this->_getSession()->getFileInfo();
78
+ } else {
79
+ $this->_getSession()->setFileInfo($files);
80
+ }
81
+ return $files;
82
+ }
83
+
84
+ /**
85
+ * Save store files
86
+ * @param array $files
87
+ * @return Magpleasure_Filesystem_Adminhtml_FilesystemController
88
+ */
89
+ protected function _setFiles($files)
90
+ {
91
+ $this->_getSession()->setFileInfo($files);
92
+ return $this;
93
+ }
94
+
95
+ /**
96
+ * Is file opened
97
+ *
98
+ * @param string $path
99
+ * @return boolean
100
+ */
101
+ protected function _isFileOpened($path)
102
+ {
103
+ if (is_numeric($path)){
104
+ return !!$this->_getPath($path);
105
+ } else {
106
+ return !!$this->_getFile($path);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Open file, save identifier
112
+ *
113
+ * @param string $path
114
+ * @return int
115
+ */
116
+ protected function _openFile($path)
117
+ {
118
+ $id = 0;
119
+ if (!$this->_isFileOpened($path)){
120
+ $files = $this->_getFiles();
121
+ $id = rand();
122
+ $files[$id] = $path;
123
+ $this->_setFiles($files);
124
+ }
125
+ return $id;
126
+ }
127
+
128
+ /**
129
+ * Close file
130
+ * @param type $id
131
+ * @return Magpleasure_Filesystem_Adminhtml_FilesystemController
132
+ */
133
+ protected function _closeFile($id)
134
+ {
135
+ if ($this->_isFileOpened($id)){
136
+ $files = $this->_getFiles();
137
+ if (isset($files[$id])){
138
+ unset($files[$id]);
139
+ }
140
+ $this->_setFiles($files);
141
+ }
142
+ return $this;
143
+ }
144
+
145
+ /**
146
+ * Get file path
147
+ * @param $file
148
+ * @return string|boolean
149
+ */
150
+ protected function _getPath($file)
151
+ {
152
+ $files = $this->_getFiles();
153
+ if (isset($files[$file]) && $files[$file]){
154
+ return $files[$file];
155
+ }
156
+ return false;
157
+ }
158
+
159
+ /**
160
+ * Get file id
161
+ * @param $file
162
+ * @return int|boolean
163
+ */
164
+ protected function _getFile($path)
165
+ {
166
+ $files = $this->_getFiles();
167
+ foreach ($files as $_file=>$_path){
168
+ if ($path == $_path){
169
+ return $_file;
170
+ }
171
+ }
172
+ return false;
173
+ }
174
+
175
+ public function treeAction()
176
+ {
177
+ $dir = $this->getRequest()->getPost('dir');
178
+ $root = '';
179
+
180
+
181
+ $dir = urldecode($dir);
182
+ $response = "";
183
+
184
+ if( file_exists($root . $dir) ) {
185
+ $files = scandir($root . $dir);
186
+ natcasesort($files);
187
+ if( count($files) > 2 ) { /* The 2 accounts for . and .. */
188
+ $response .= "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
189
+ // All dirs
190
+ foreach( $files as $file ) {
191
+ if( file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file) ) {
192
+ $response .= "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($dir . $file) . "/\">" . htmlentities($file) . "</a></li>";
193
+ }
194
+ }
195
+ // All files
196
+ foreach( $files as $file ) {
197
+ if( file_exists($root . $dir . $file) && $file != '.' && $file != '..' && !is_dir($root . $dir . $file) ) {
198
+ $ext = preg_replace('/^.*\./', '', $file);
199
+ $response .= "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($dir . $file) . "\">" . htmlentities($file) . "</a></li>";
200
+ }
201
+ }
202
+ $response .= "</ul>";
203
+ }
204
+ }
205
+
206
+ $this->getResponse()->setBody($response);
207
+ }
208
+
209
+ protected function _preparePathToShow($path)
210
+ {
211
+ return (str_replace(Mage::getBaseDir()."/", "", $path));
212
+ }
213
+
214
+ public function loadAction()
215
+ {
216
+ $result = array();
217
+ if ($filename = $this->getRequest()->getParam('fn')){
218
+ $filename = base64_decode($filename);
219
+ try {
220
+ if (file_exists($filename)){
221
+
222
+ if (!$this->_isFileOpened($filename)){
223
+ $path_parts = pathinfo($filename);
224
+
225
+ $content['id'] = $this->_openFile($filename);
226
+ $content['syntax'] = ($path_parts['extension'] == 'phtml') ? 'php' : $path_parts['extension'];
227
+ $content['text'] = file_get_contents($filename);
228
+ $content['title'] = $path_parts['basename'];
229
+
230
+ $result['path'] = $this->_preparePathToShow($filename);
231
+ $result['success'] = true;
232
+ $result['content'] = Zend_Json_Encoder::encode($content);
233
+ } else {
234
+ $result['error'] = $this->_helper()->__('This file is opened already');
235
+ }
236
+
237
+ }
238
+ } catch (Exception $e) {
239
+ $result['error'] = $e->getMessage();
240
+ }
241
+ }
242
+ $this->_ajaxResponse($result);
243
+ }
244
+
245
+ public function saveAction()
246
+ {
247
+ $result = array();
248
+ $content = $this->getRequest()->getPost('content');
249
+ $file = $this->getRequest()->getParam('file');
250
+ if ($file && $this->_isFileOpened($file) && !is_null($content)){
251
+ try {
252
+ file_put_contents($this->_getPath($file), $content);
253
+ $result['success'] = true;
254
+ } catch (Exception $e) {
255
+ $result['error'] = $e->getMessage();
256
+ }
257
+ } else {
258
+ $result['error'] = $this->_helper()->__('Wrong file id');
259
+ }
260
+ $this->_ajaxResponse($result);
261
+ }
262
+
263
+ public function closeAction()
264
+ {
265
+ $result = array();
266
+ $file = $this->getRequest()->getParam('file');
267
+ if ($file && $this->_isFileOpened($file)){
268
+ $this->_closeFile($file);
269
+ $result['success'] = true;
270
+ } else {
271
+ $result['error'] = $this->_helper()->__('Wrong file id');
272
+ }
273
+ $this->_ajaxResponse($result);
274
+ }
275
+
276
+ public function filesAction()
277
+ {
278
+ $result = array();
279
+ $files = $this->_getFiles();
280
+
281
+ $_files = array();
282
+
283
+ try {
284
+ foreach ($files as $_file=>$_path){
285
+ if (file_exists($_path)){
286
+ $path_parts = pathinfo($_path);
287
+
288
+ $content = array();
289
+ $content['id'] = $_file;
290
+ $content['syntax'] = ($path_parts['extension'] == 'phtml') ? 'php' : $path_parts['extension'];
291
+ $content['text'] = file_get_contents($_path);
292
+ $content['title'] = $path_parts['basename'];
293
+ $content['path'] = $this->_preparePathToShow($_path);
294
+
295
+ $_files[] = Zend_Json_Encoder::encode($content);
296
+
297
+ } else {
298
+ $this->_closeFile($_file);
299
+ }
300
+ }
301
+ $result['files'] = $_files;
302
+ $result['success'] = true;
303
+ } catch (Exception $e) {
304
+ $result['error'] = $e->getMessage();
305
+ }
306
+
307
+ $this->_ajaxResponse($result);
308
+ }
309
+
310
+ }
app/code/community/Magpleasure/Filesystem/etc/adminhtml.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <menu>
4
+ <system>
5
+ <children>
6
+ <filesystem module="filesystem">
7
+ <title>Filesystem</title>
8
+ <sort_order>70</sort_order>
9
+ <children>
10
+ <edit module="filesystem">
11
+ <title>IDE</title>
12
+ <sort_order>10</sort_order>
13
+ <action>filesystem/adminhtml_filesystem</action>
14
+ </edit>
15
+ <!-- <config module="filesystem">
16
+ <title>Configuration</title>
17
+ <sort_order>20</sort_order>
18
+ <action>adminhtml/system_config/edit/section/filesystem</action>
19
+ </config>-->
20
+ </children>
21
+ </filesystem>
22
+ </children>
23
+ </system>
24
+
25
+ </menu>
26
+ <acl>
27
+ <resources>
28
+ <all>
29
+ <title>Allow Everything</title>
30
+ </all>
31
+ <admin>
32
+ <children>
33
+ <system>
34
+ <children>
35
+ <filesystem>
36
+ <title>File System</title>
37
+ <sort_order>10</sort_order>
38
+ <children>
39
+ <edit>
40
+ <title>IDE</title>
41
+ <sort_order>10</sort_order>
42
+ </edit>
43
+ <!-- <config>
44
+ <title>Configuration</title>
45
+ <sort_order>20</sort_order>
46
+ </config>-->
47
+ </children>
48
+ </filesystem>
49
+ <config>
50
+ <children>
51
+ <filesystem>
52
+ <title>MagPleasure - File System Configuration</title>
53
+ </filesystem>
54
+ </children>
55
+ </config>
56
+ </children>
57
+ </system>
58
+
59
+ </children>
60
+ </admin>
61
+ </resources>
62
+ </acl>
63
+ <layout>
64
+ <updates>
65
+ <filesystem>
66
+ <file>filesystem.xml</file>
67
+ </filesystem>
68
+ </updates>
69
+ </layout>
70
+ </config>
app/code/community/Magpleasure/Filesystem/etc/config.xml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magpleasure_Filesystem>
5
+ <version>1.0</version>
6
+ </Magpleasure_Filesystem>
7
+ </modules>
8
+ <frontend>
9
+
10
+ </frontend>
11
+ <admin>
12
+ <routers>
13
+ <filesystem>
14
+ <use>admin</use>
15
+ <args>
16
+ <module>Magpleasure_Filesystem</module>
17
+ <frontName>filesystem</frontName>
18
+ </args>
19
+ </filesystem>
20
+ </routers>
21
+ </admin>
22
+ <adminhtml>
23
+ <menu>
24
+ <system>
25
+ <children>
26
+ <filesystem module="filesystem">
27
+ <title>Filesystem</title>
28
+ <sort_order>70</sort_order>
29
+ <children>
30
+ <edit module="filesystem">
31
+ <title>IDE</title>
32
+ <sort_order>10</sort_order>
33
+ <action>filesystem/adminhtml_filesystem</action>
34
+ </edit>
35
+ <!-- <config module="filesystem">
36
+ <title>Configuration</title>
37
+ <sort_order>20</sort_order>
38
+ <action>adminhtml/system_config/edit/section/filesystem</action>
39
+ </config>-->
40
+ </children>
41
+ </filesystem>
42
+ </children>
43
+ </system>
44
+
45
+ </menu>
46
+ <acl>
47
+ <resources>
48
+ <all>
49
+ <title>Allow Everything</title>
50
+ </all>
51
+ <admin>
52
+ <children>
53
+ <system>
54
+ <children>
55
+ <filesystem>
56
+ <title>File System</title>
57
+ <sort_order>10</sort_order>
58
+ <children>
59
+ <edit>
60
+ <title>IDE</title>
61
+ <sort_order>10</sort_order>
62
+ </edit>
63
+ <!-- <config>
64
+ <title>Configuration</title>
65
+ <sort_order>20</sort_order>
66
+ </config>-->
67
+ </children>
68
+ </filesystem>
69
+ <config>
70
+ <children>
71
+ <filesystem>
72
+ <title>MagPleasure - File System Configuration</title>
73
+ </filesystem>
74
+ </children>
75
+ </config>
76
+ </children>
77
+ </system>
78
+
79
+ </children>
80
+ </admin>
81
+ </resources>
82
+ </acl>
83
+ <layout>
84
+ <updates>
85
+ <filesystem>
86
+ <file>filesystem.xml</file>
87
+ </filesystem>
88
+ </updates>
89
+ </layout>
90
+ </adminhtml>
91
+ <global>
92
+ <models>
93
+ <filesystem>
94
+ <class>Magpleasure_Filesystem_Model</class>
95
+ <resourceModel>filesystem_mysql4</resourceModel>
96
+ </filesystem>
97
+ <filesystem_mysql4>
98
+ <class>Magpleasure_Filesystem_Model_Mysql4</class>
99
+ <entities>
100
+ <filesystem>
101
+ <table>filesystem</table>
102
+ </filesystem>
103
+ </entities>
104
+ </filesystem_mysql4>
105
+ </models>
106
+ <resources>
107
+ <filesystem_setup>
108
+ <setup>
109
+ <module>Magpleasure_Filesystem</module>
110
+ </setup>
111
+ <connection>
112
+ <use>core_setup</use>
113
+ </connection>
114
+ </filesystem_setup>
115
+ <filesystem_write>
116
+ <connection>
117
+ <use>core_write</use>
118
+ </connection>
119
+ </filesystem_write>
120
+ <filesystem_read>
121
+ <connection>
122
+ <use>core_read</use>
123
+ </connection>
124
+ </filesystem_read>
125
+ </resources>
126
+ <blocks>
127
+ <filesystem>
128
+ <class>Magpleasure_Filesystem_Block</class>
129
+ </filesystem>
130
+ </blocks>
131
+ <helpers>
132
+ <filesystem>
133
+ <class>Magpleasure_Filesystem_Helper</class>
134
+ </filesystem>
135
+ </helpers>
136
+ </global>
137
+ </config>
app/code/community/Magpleasure/Filesystem/etc/system.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <magpleasure translate="label" module="filesystem">
5
+ <label>MagPleasure Extensions</label>
6
+ <sort_order>300</sort_order>
7
+ </magpleasure>
8
+ </tabs>
9
+ <sections>
10
+ <filesystem translate="label" module="filesystem">
11
+ <label>File System</label>
12
+ <tab>magpleasure</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>150</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general>
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <!-- <show translate="label">
28
+ <label>Show block</label>
29
+ <comment></comment>
30
+ <frontend_type>select</frontend_type>
31
+ <sort_order>10</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <source_model>adminhtml/system_config_source_yesno</source_model>
36
+ </show> -->
37
+ </fields>
38
+ </general>
39
+ </groups>
40
+ </filesystem>
41
+ </sections>
42
+ </config>
app/code/community/Magpleasure/Filesystem/sql/filesystem_setup/mysql4-install-1.0.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ $installer = $this;
18
+
19
+ $installer->startSetup();
20
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/filesystem.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <filesystem_adminhtml_filesystem_index>
4
+ <reference name="head">
5
+ <action method="addJs"><script>filesystem/jquery-1.4.2.min.js</script></action>
6
+ <action method="addJs"><script>filesystem/base64.js</script></action>
7
+ <action method="addJs"><script>filesystem/script.js</script></action>
8
+ <action method="addJs"><script>filesystem/jqueryfiletree.js</script></action>
9
+ <action method="addCss"><script>filesystem/css/styles.css</script></action>
10
+ <action method="addCss"><script>filesystem/css/jqueryfiletree.css</script></action>
11
+ </reference>
12
+ <reference name="content">
13
+ <block type="filesystem/adminhtml_ide" name="filesystem" template="filesystem/ide.phtml" >
14
+ <block type="filesystem/adminhtml_ide_tree" name="filesystem.tree" as="filesystem.tree" />
15
+ <block type="filesystem/adminhtml_ide_editor" name="filesystem.editor" as="filesystem.editor" />
16
+ </block>
17
+ </reference>
18
+ </filesystem_adminhtml_filesystem_index>
19
+ </layout>
app/design/adminhtml/default/default/template/filesystem/ide.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ ?>
18
+
19
+ <div class="ide">
20
+ <div class="tree">
21
+ <h2><?php echo $this->__('File System') ?></h2>
22
+ <?php echo $this->getChildHtml('filesystem.tree'); ?>
23
+ </div>
24
+ <div class="editor">
25
+ <?php echo $this->getChildHtml('filesystem.editor'); ?>
26
+ </div>
27
+ </div>
28
+
app/design/adminhtml/default/default/template/filesystem/ide/editor.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ ?>
18
+ <div class="path" id="path">
19
+ <?php echo $this->getPath(); ?>
20
+ </div>
21
+ <textarea id="edit_area"></textarea>
22
+
23
+ <script type="text/javascript" src="<?php echo Mage::getBaseUrl('web').'js/editarea/edit_area_full.js'; ?>"></script>
24
+
25
+ <script language="javascript" type="text/javascript">
26
+
27
+ _closeUrl = '<?php echo $this->getUrl('filesystem/adminhtml_filesystem/close', array('file'=>'{{file}}')) ?>';
28
+ _saveUrl = '<?php echo $this->getUrl('filesystem/adminhtml_filesystem/save', array('file'=>'{{file}}')) ?>';
29
+ _filesUrl = '<?php echo $this->getUrl('filesystem/adminhtml_filesystem/files', array('file'=>'{{file}}')) ?>';
30
+
31
+ editAreaLoader.init({
32
+ id : "edit_area",
33
+ syntax: "css",
34
+ syntax_selection_allow: "css,html,js,php,python,xml,sql",
35
+ start_highlight: true,
36
+ toolbar: "save, |, search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help",
37
+ save_callback: "saveFile",
38
+ EA_file_switch_on_callback: "switchOn",
39
+ EA_file_close_callback: "closeFile",
40
+ replace_tab_by_spaces: 4,
41
+ allow_resize: true,
42
+ EA_load_callback: "getFiles"
43
+ });
44
+
45
+ </script>
46
+
app/design/adminhtml/default/default/template/filesystem/ide/tree.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ ?>
18
+
19
+ <div class="file-tree-wrapper">
20
+ <div class="file-tree" id="file_tree"></div>
21
+ </div>
22
+
23
+ <script type="text/javascript">
24
+ jQuery(document).ready( function() {
25
+ jQuery('#file_tree').fileTree({
26
+ root: '<?php echo Mage::getBaseDir(); ?>/',
27
+ script: '<?php echo $this->getUrl('filesystem/adminhtml_filesystem/tree', array('isAjax'=> true, 'form_key'=>$this->getFormKey())) ?>',
28
+ expandSpeed: 200,
29
+ collapseSpeed: 200
30
+ }, function(file) {
31
+ var url = '<?php echo $this->getUrl("filesystem/adminhtml_filesystem/load", array("fn"=>"{{filename}}")) ?>';
32
+ openFile(url, file);
33
+ });
34
+ });
35
+ </script>
app/design/adminhtml/default/default/template/filesystem/wrapper.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagPleasure Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magpleasure.com/LICENSE.txt
11
+ *
12
+ * @category Magpleasure
13
+ * @package Magpleasure_Filesystem
14
+ * @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
15
+ * @license http://www.magpleasure.com/LICENSE.txt
16
+ */
17
+ ?>
app/etc/modules/Magpleasure_Filesystem.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magpleasure_Filesystem>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Magpleasure_Filesystem>
8
+ </modules>
9
+ </config>
js/editarea/autocompletion.js ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Autocompletion class
3
+ *
4
+ * An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut
5
+ *
6
+ * Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory)
7
+ * But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language)
8
+ * and add a too important feature that many people would miss if included as a plugin
9
+ *
10
+ * - init param: autocompletion_start
11
+ * - Button name: "autocompletion"
12
+ */
13
+
14
+ var EditArea_autocompletion= {
15
+
16
+ /**
17
+ * Get called once this file is loaded (editArea still not initialized)
18
+ *
19
+ * @return nothing
20
+ */
21
+ init: function(){
22
+ // alert("test init: "+ this._someInternalFunction(2, 3));
23
+
24
+ if(editArea.settings["autocompletion"])
25
+ this.enabled= true;
26
+ else
27
+ this.enabled= false;
28
+ this.current_word = false;
29
+ this.shown = false;
30
+ this.selectIndex = -1;
31
+ this.forceDisplay = false;
32
+ this.isInMiddleWord = false;
33
+ this.autoSelectIfOneResult = false;
34
+ this.delayBeforeDisplay = 100;
35
+ this.checkDelayTimer = false;
36
+ this.curr_syntax_str = '';
37
+
38
+ this.file_syntax_datas = {};
39
+ }
40
+ /**
41
+ * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
42
+ * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
43
+ * Language variables such as {$lang_somekey} will also be replaced with contents from
44
+ * the language packs.
45
+ *
46
+ * @param {string} ctrl_name: the name of the control to add
47
+ * @return HTML code for a specific control or false.
48
+ * @type string or boolean
49
+ */
50
+ /*,get_control_html: function(ctrl_name){
51
+ switch( ctrl_name ){
52
+ case 'autocompletion':
53
+ // Control id, button img, command
54
+ return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL);
55
+ break;
56
+ }
57
+ return false;
58
+ }*/
59
+ /**
60
+ * Get called once EditArea is fully loaded and initialised
61
+ *
62
+ * @return nothing
63
+ */
64
+ ,onload: function(){
65
+ if(this.enabled)
66
+ {
67
+ var icon= document.getElementById("autocompletion");
68
+ if(icon)
69
+ editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
70
+ }
71
+
72
+ this.container = document.createElement('div');
73
+ this.container.id = "auto_completion_area";
74
+ editArea.container.insertBefore( this.container, editArea.container.firstChild );
75
+
76
+ // add event detection for hiding suggestion box
77
+ parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} );
78
+ parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} );
79
+
80
+ }
81
+
82
+ /**
83
+ * Is called each time the user touch a keyboard key.
84
+ *
85
+ * @param (event) e: the keydown event
86
+ * @return true - pass to next handler in chain, false - stop chain execution
87
+ * @type boolean
88
+ */
89
+ ,onkeydown: function(e){
90
+ if(!this.enabled)
91
+ return true;
92
+
93
+ if (EA_keys[e.keyCode])
94
+ letter=EA_keys[e.keyCode];
95
+ else
96
+ letter=String.fromCharCode(e.keyCode);
97
+ // shown
98
+ if( this._isShown() )
99
+ {
100
+ // if escape, hide the box
101
+ if(letter=="Esc")
102
+ {
103
+ this._hide();
104
+ return false;
105
+ }
106
+ // Enter
107
+ else if( letter=="Entrer")
108
+ {
109
+ var as = this.container.getElementsByTagName('A');
110
+ // select a suggested entry
111
+ if( this.selectIndex >= 0 && this.selectIndex < as.length )
112
+ {
113
+ as[ this.selectIndex ].onmousedown();
114
+ return false
115
+ }
116
+ // simply add an enter in the code
117
+ else
118
+ {
119
+ this._hide();
120
+ return true;
121
+ }
122
+ }
123
+ else if( letter=="Tab" || letter=="Down")
124
+ {
125
+ this._selectNext();
126
+ return false;
127
+ }
128
+ else if( letter=="Up")
129
+ {
130
+ this._selectBefore();
131
+ return false;
132
+ }
133
+ }
134
+ // hidden
135
+ else
136
+ {
137
+
138
+ }
139
+
140
+ // show current suggestion list and do autoSelect if possible (no matter it's shown or hidden)
141
+ if( letter=="Space" && CtrlPressed(e) )
142
+ {
143
+ //parent.console.log('SHOW SUGGEST');
144
+ this.forceDisplay = true;
145
+ this.autoSelectIfOneResult = true;
146
+ this._checkLetter();
147
+ return false;
148
+ }
149
+
150
+ // wait a short period for check that the cursor isn't moving
151
+ setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 );
152
+ this.checkDelayTimer = false;
153
+ return true;
154
+ }
155
+ /**
156
+ * Executes a specific command, this function handles plugin commands.
157
+ *
158
+ * @param {string} cmd: the name of the command being executed
159
+ * @param {unknown} param: the parameter of the command
160
+ * @return true - pass to next handler in chain, false - stop chain execution
161
+ * @type boolean
162
+ */
163
+ ,execCommand: function(cmd, param){
164
+ switch( cmd ){
165
+ case 'toggle_autocompletion':
166
+ var icon= document.getElementById("autocompletion");
167
+ if(!this.enabled)
168
+ {
169
+ if(icon != null){
170
+ editArea.restoreClass(icon);
171
+ editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
172
+ }
173
+ this.enabled= true;
174
+ }
175
+ else
176
+ {
177
+ this.enabled= false;
178
+ if(icon != null)
179
+ editArea.switchClassSticky(icon, 'editAreaButtonNormal', false);
180
+ }
181
+ return true;
182
+ }
183
+ return true;
184
+ }
185
+ ,_checkDelayAndCursorBeforeDisplay: function()
186
+ {
187
+ this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();", this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 );
188
+ }
189
+ // hide the suggested box
190
+ ,_hide: function(){
191
+ this.container.style.display="none";
192
+ this.selectIndex = -1;
193
+ this.shown = false;
194
+ this.forceDisplay = false;
195
+ this.autoSelectIfOneResult = false;
196
+ }
197
+ // display the suggested box
198
+ ,_show: function(){
199
+ if( !this._isShown() )
200
+ {
201
+ this.container.style.display="block";
202
+ this.selectIndex = -1;
203
+ this.shown = true;
204
+ }
205
+ }
206
+ // is the suggested box displayed?
207
+ ,_isShown: function(){
208
+ return this.shown;
209
+ }
210
+ // setter and getter
211
+ ,_isInMiddleWord: function( new_value ){
212
+ if( typeof( new_value ) == "undefined" )
213
+ return this.isInMiddleWord;
214
+ else
215
+ this.isInMiddleWord = new_value;
216
+ }
217
+ // select the next element in the suggested box
218
+ ,_selectNext: function()
219
+ {
220
+ var as = this.container.getElementsByTagName('A');
221
+
222
+ // clean existing elements
223
+ for( var i=0; i<as.length; i++ )
224
+ {
225
+ if( as[i].className )
226
+ as[i].className = as[i].className.replace(/ focus/g, '');
227
+ }
228
+
229
+ this.selectIndex++;
230
+ this.selectIndex = ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? 0 : this.selectIndex;
231
+ as[ this.selectIndex ].className += " focus";
232
+ }
233
+ // select the previous element in the suggested box
234
+ ,_selectBefore: function()
235
+ {
236
+ var as = this.container.getElementsByTagName('A');
237
+
238
+ // clean existing elements
239
+ for( var i=0; i<as.length; i++ )
240
+ {
241
+ if( as[i].className )
242
+ as[i].className = as[ i ].className.replace(/ focus/g, '');
243
+ }
244
+
245
+ this.selectIndex--;
246
+
247
+ this.selectIndex = ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? as.length-1 : this.selectIndex;
248
+ as[ this.selectIndex ].className += " focus";
249
+ }
250
+ ,_select: function( content )
251
+ {
252
+ cursor_forced_position = content.indexOf( '{@}' );
253
+ content = content.replace(/{@}/g, '' );
254
+ editArea.getIESelection();
255
+
256
+ // retrive the number of matching characters
257
+ var start_index = Math.max( 0, editArea.textarea.selectionEnd - content.length );
258
+
259
+ line_string = editArea.textarea.value.substring( start_index, editArea.textarea.selectionEnd + 1);
260
+ limit = line_string.length -1;
261
+ nbMatch = 0;
262
+ for( i =0; i<limit ; i++ )
263
+ {
264
+ if( line_string.substring( limit - i - 1, limit ) == content.substring( 0, i + 1 ) )
265
+ nbMatch = i + 1;
266
+ }
267
+ // if characters match, we should include them in the selection that will be replaced
268
+ if( nbMatch > 0 )
269
+ parent.editAreaLoader.setSelectionRange(editArea.id, editArea.textarea.selectionStart - nbMatch , editArea.textarea.selectionEnd);
270
+
271
+ parent.editAreaLoader.setSelectedText(editArea.id, content );
272
+ range= parent.editAreaLoader.getSelectionRange(editArea.id);
273
+
274
+ if( cursor_forced_position != -1 )
275
+ new_pos = range["end"] - ( content.length-cursor_forced_position );
276
+ else
277
+ new_pos = range["end"];
278
+ parent.editAreaLoader.setSelectionRange(editArea.id, new_pos, new_pos);
279
+ this._hide();
280
+ }
281
+
282
+
283
+ /**
284
+ * Parse the AUTO_COMPLETION part of syntax definition files
285
+ */
286
+ ,_parseSyntaxAutoCompletionDatas: function(){
287
+ //foreach syntax loaded
288
+ for(var lang in parent.editAreaLoader.load_syntax)
289
+ {
290
+ if(!parent.editAreaLoader.syntax[lang]['autocompletion']) // init the regexp if not already initialized
291
+ {
292
+ parent.editAreaLoader.syntax[lang]['autocompletion']= {};
293
+ // the file has auto completion datas
294
+ if(parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
295
+ {
296
+ // parse them
297
+ for(var i in parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
298
+ {
299
+ datas = parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'][i];
300
+ tmp = {};
301
+ if(datas["CASE_SENSITIVE"]!="undefined" && datas["CASE_SENSITIVE"]==false)
302
+ tmp["modifiers"]="i";
303
+ else
304
+ tmp["modifiers"]="";
305
+ tmp["prefix_separator"]= datas["REGEXP"]["prefix_separator"];
306
+ tmp["match_prefix_separator"]= new RegExp( datas["REGEXP"]["prefix_separator"] +"$", tmp["modifiers"]);
307
+ tmp["match_word"]= new RegExp("(?:"+ datas["REGEXP"]["before_word"] +")("+ datas["REGEXP"]["possible_words_letters"] +")$", tmp["modifiers"]);
308
+ tmp["match_next_letter"]= new RegExp("^("+ datas["REGEXP"]["letter_after_word_must_match"] +")$", tmp["modifiers"]);
309
+ tmp["keywords"]= {};
310
+ //console.log( datas["KEYWORDS"] );
311
+ for( var prefix in datas["KEYWORDS"] )
312
+ {
313
+ tmp["keywords"][prefix]= {
314
+ prefix: prefix,
315
+ prefix_name: prefix,
316
+ prefix_reg: new RegExp("(?:"+ parent.editAreaLoader.get_escaped_regexp( prefix ) +")(?:"+ tmp["prefix_separator"] +")$", tmp["modifiers"] ),
317
+ datas: []
318
+ };
319
+ for( var j=0; j<datas["KEYWORDS"][prefix].length; j++ )
320
+ {
321
+ tmp["keywords"][prefix]['datas'][j]= {
322
+ is_typing: datas["KEYWORDS"][prefix][j][0],
323
+ // if replace with is empty, replace with the is_typing value
324
+ replace_with: datas["KEYWORDS"][prefix][j][1] ? datas["KEYWORDS"][prefix][j][1].replace('�', datas["KEYWORDS"][prefix][j][0] ) : '',
325
+ comment: datas["KEYWORDS"][prefix][j][2] ? datas["KEYWORDS"][prefix][j][2] : ''
326
+ };
327
+
328
+ // the replace with shouldn't be empty
329
+ if( tmp["keywords"][prefix]['datas'][j]['replace_with'].length == 0 )
330
+ tmp["keywords"][prefix]['datas'][j]['replace_with'] = tmp["keywords"][prefix]['datas'][j]['is_typing'];
331
+
332
+ // if the comment is empty, display the replace_with value
333
+ if( tmp["keywords"][prefix]['datas'][j]['comment'].length == 0 )
334
+ tmp["keywords"][prefix]['datas'][j]['comment'] = tmp["keywords"][prefix]['datas'][j]['replace_with'].replace(/{@}/g, '' );
335
+ }
336
+
337
+ }
338
+ tmp["max_text_length"]= datas["MAX_TEXT_LENGTH"];
339
+ parent.editAreaLoader.syntax[lang]['autocompletion'][i] = tmp;
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
345
+
346
+ ,_checkLetter: function(){
347
+ // check that syntax hasn't changed
348
+ if( this.curr_syntax_str != editArea.settings['syntax'] )
349
+ {
350
+ if( !parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'] )
351
+ this._parseSyntaxAutoCompletionDatas();
352
+ this.curr_syntax= parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'];
353
+ this.curr_syntax_str = editArea.settings['syntax'];
354
+ //console.log( this.curr_syntax );
355
+ }
356
+
357
+ if( editArea.is_editable )
358
+ {
359
+ time=new Date;
360
+ t1= time.getTime();
361
+ editArea.getIESelection();
362
+ this.selectIndex = -1;
363
+ start=editArea.textarea.selectionStart;
364
+ var str = editArea.textarea.value;
365
+ var results= [];
366
+
367
+
368
+ for(var i in this.curr_syntax)
369
+ {
370
+ var last_chars = str.substring(Math.max(0, start-this.curr_syntax[i]["max_text_length"]), start);
371
+ var matchNextletter = str.substring(start, start+1).match( this.curr_syntax[i]["match_next_letter"]);
372
+ // if not writting in the middle of a word or if forcing display
373
+ if( matchNextletter || this.forceDisplay )
374
+ {
375
+ // check if the last chars match a separator
376
+ var match_prefix_separator = last_chars.match(this.curr_syntax[i]["match_prefix_separator"]);
377
+
378
+ // check if it match a possible word
379
+ var match_word= last_chars.match(this.curr_syntax[i]["match_word"]);
380
+
381
+ //console.log( match_word );
382
+ if( match_word )
383
+ {
384
+ var begin_word= match_word[1];
385
+ var match_curr_word= new RegExp("^"+ parent.editAreaLoader.get_escaped_regexp( begin_word ), this.curr_syntax[i]["modifiers"]);
386
+ //console.log( match_curr_word );
387
+ for(var prefix in this.curr_syntax[i]["keywords"])
388
+ {
389
+ // parent.console.log( this.curr_syntax[i]["keywords"][prefix] );
390
+ for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
391
+ {
392
+ // parent.console.log( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'] );
393
+ // the key word match or force display
394
+ if( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'].match(match_curr_word) )
395
+ {
396
+ // parent.console.log('match');
397
+ hasMatch = false;
398
+ var before = last_chars.substr( 0, last_chars.length - begin_word.length );
399
+
400
+ // no prefix to match => it's valid
401
+ if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
402
+ {
403
+ if( ! before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
404
+ hasMatch = true;
405
+ }
406
+ // we still need to check the prefix if there is one
407
+ else if( this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
408
+ {
409
+ if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
410
+ hasMatch = true;
411
+ }
412
+
413
+ if( hasMatch )
414
+ results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
415
+ }
416
+ }
417
+ }
418
+ }
419
+ // it doesn't match any possible word but we want to display something
420
+ // we'll display to list of all available words
421
+ else if( this.forceDisplay || match_prefix_separator )
422
+ {
423
+ for(var prefix in this.curr_syntax[i]["keywords"])
424
+ {
425
+ for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
426
+ {
427
+ hasMatch = false;
428
+ // no prefix to match => it's valid
429
+ if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
430
+ {
431
+ hasMatch = true;
432
+ }
433
+ // we still need to check the prefix if there is one
434
+ else if( match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
435
+ {
436
+ var before = last_chars; //.substr( 0, last_chars.length );
437
+ if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
438
+ hasMatch = true;
439
+ }
440
+
441
+ if( hasMatch )
442
+ results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
443
+ }
444
+ }
445
+ }
446
+ }
447
+ }
448
+
449
+ // there is only one result, and we can select it automatically
450
+ if( results.length == 1 && this.autoSelectIfOneResult )
451
+ {
452
+ // console.log( results );
453
+ this._select( results[0][1]['replace_with'] );
454
+ }
455
+ else if( results.length == 0 )
456
+ {
457
+ this._hide();
458
+ }
459
+ else
460
+ {
461
+ // build the suggestion box content
462
+ var lines=[];
463
+ for(var i=0; i<results.length; i++)
464
+ {
465
+ var line= "<li><a href=\"#\" class=\"entry\" onmousedown=\"EditArea_autocompletion._select('"+ results[i][1]['replace_with'].replace(new RegExp('"', "g"), "&quot;") +"');return false;\">"+ results[i][1]['comment'];
466
+ if(results[i][0]['prefix_name'].length>0)
467
+ line+='<span class="prefix">'+ results[i][0]['prefix_name'] +'</span>';
468
+ line+='</a></li>';
469
+ lines[lines.length]=line;
470
+ }
471
+ // sort results
472
+ this.container.innerHTML = '<ul>'+ lines.sort().join('') +'</ul>';
473
+
474
+ var cursor = _$("cursor_pos");
475
+ this.container.style.top = ( cursor.cursor_top + editArea.lineHeight ) +"px";
476
+ this.container.style.left = ( cursor.cursor_left + 8 ) +"px";
477
+ this._show();
478
+ }
479
+
480
+ this.autoSelectIfOneResult = false;
481
+ time=new Date;
482
+ t2= time.getTime();
483
+
484
+ //parent.console.log( begin_word +"\n"+ (t2-t1) +"\n"+ html );
485
+ }
486
+ }
487
+ };
488
+
489
+ // Load as a plugin
490
+ editArea.settings['plugins'][ editArea.settings['plugins'].length ] = 'autocompletion';
491
+ editArea.add_plugin('autocompletion', EditArea_autocompletion);
js/editarea/edit_area.css ADDED
@@ -0,0 +1,530 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body, html{
2
+ margin: 0;
3
+ padding: 0;
4
+ height: 100%;
5
+ border: none;
6
+ overflow: hidden;
7
+ background-color: #FFF;
8
+ }
9
+
10
+ body, html, table, form, textarea{
11
+ font: 12px monospace, sans-serif;
12
+ }
13
+
14
+ #editor{
15
+ border: solid #888 1px;
16
+ overflow: hidden;
17
+ }
18
+
19
+ #result{
20
+ z-index: 4;
21
+ overflow-x: auto;
22
+ overflow-y: scroll;
23
+ border-top: solid #888 1px;
24
+ border-bottom: solid #888 1px;
25
+ position: relative;
26
+ clear: both;
27
+ }
28
+
29
+ #result.empty{
30
+ overflow: hidden;
31
+ }
32
+
33
+ #container{
34
+ overflow: hidden;
35
+ border: solid blue 0;
36
+ position: relative;
37
+ z-index: 10;
38
+ padding: 0 5px 0 45px;
39
+ /*padding-right: 5px;*/
40
+ }
41
+
42
+ #textarea{
43
+ position: relative;
44
+ top: 0;
45
+ left: 0;
46
+ margin: 0;
47
+ padding: 0;
48
+ width: 100%;
49
+ height: 100%;
50
+ overflow: hidden;
51
+ z-index: 7;
52
+ border-width: 0;
53
+ background-color: transparent;
54
+ resize: none;
55
+ }
56
+
57
+ #textarea, #textarea:hover{
58
+ outline: none; /* safari outline fix */
59
+ }
60
+
61
+ #content_highlight{
62
+ white-space: pre;
63
+ margin: 0;
64
+ padding: 0;
65
+ position : absolute;
66
+ z-index: 4;
67
+ overflow: visible;
68
+ }
69
+
70
+
71
+ #selection_field, #selection_field_text{
72
+ margin: 0;
73
+ background-color: #E1F2F9;
74
+ /* height: 1px; */
75
+ position: absolute;
76
+ z-index: 5;
77
+ top: -100px;
78
+ padding: 0;
79
+ white-space: pre;
80
+ overflow: hidden;
81
+ }
82
+
83
+ #selection_field.show_colors {
84
+ z-index: 3;
85
+ background-color:#EDF9FC;
86
+
87
+ }
88
+
89
+ #selection_field strong{
90
+ font-weight:normal;
91
+ }
92
+
93
+ #selection_field.show_colors *, #selection_field_text * {
94
+ visibility: hidden;
95
+ }
96
+
97
+ #selection_field_text{
98
+ background-color:transparent;
99
+ }
100
+
101
+ #selection_field_text strong{
102
+ font-weight:normal;
103
+ background-color:#3399FE;
104
+ color: #FFF;
105
+ visibility:visible;
106
+ }
107
+
108
+ #container.word_wrap #content_highlight,
109
+ #container.word_wrap #selection_field,
110
+ #container.word_wrap #selection_field_text,
111
+ #container.word_wrap #test_font_size{
112
+ white-space: pre-wrap; /* css-3 */
113
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
114
+ white-space: -pre-wrap; /* Opera 4-6 */
115
+ white-space: -o-pre-wrap; /* Opera 7 */
116
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
117
+ width: 99%;
118
+ }
119
+
120
+ #line_number{
121
+ position: absolute;
122
+ overflow: hidden;
123
+ border-right: solid black 1px;
124
+ z-index:8;
125
+ width: 38px;
126
+ padding: 0 5px 0 0;
127
+ margin: 0 0 0 -45px;
128
+ text-align: right;
129
+ color: #AAAAAA;
130
+ }
131
+
132
+ #test_font_size{
133
+ padding: 0;
134
+ margin: 0;
135
+ visibility: hidden;
136
+ position: absolute;
137
+ white-space: pre;
138
+ }
139
+
140
+ pre{
141
+ margin: 0;
142
+ padding: 0;
143
+ }
144
+
145
+ .hidden{
146
+ opacity: 0.2;
147
+ filter:alpha(opacity=20);
148
+ }
149
+
150
+ #result .edit_area_cursor{
151
+ position: absolute;
152
+ z-index:6;
153
+ background-color: #FF6633;
154
+ top: -100px;
155
+ margin: 0;
156
+ }
157
+
158
+ #result .edit_area_selection_field .overline{
159
+ background-color: #996600;
160
+ }
161
+
162
+
163
+ /* area popup */
164
+ .editarea_popup{
165
+ border: solid 1px #888888;
166
+ background-color: #ECE9D8;
167
+ width: 250px;
168
+ padding: 4px;
169
+ position: absolute;
170
+ visibility: hidden;
171
+ z-index: 15;
172
+ top: -500px;
173
+ }
174
+
175
+ .editarea_popup, .editarea_popup table{
176
+ font-family: sans-serif;
177
+ font-size: 10pt;
178
+ }
179
+
180
+ .editarea_popup img{
181
+ border: 0;
182
+ }
183
+
184
+ .editarea_popup .close_popup{
185
+ float: right;
186
+ line-height: 16px;
187
+ border: 0;
188
+ padding: 0;
189
+ }
190
+
191
+ .editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
192
+ margin: 0;
193
+ padding: 0;
194
+ }
195
+
196
+ .editarea_popup .copyright{
197
+ text-align: right;
198
+ }
199
+
200
+ /* Area_search */
201
+ div#area_search_replace{
202
+ /*width: 250px;*/
203
+ }
204
+
205
+ div#area_search_replace img{
206
+ border: 0;
207
+ }
208
+
209
+ div#area_search_replace div.button{
210
+ text-align: center;
211
+ line-height: 1.7em;
212
+ }
213
+
214
+ div#area_search_replace .button a{
215
+ cursor: pointer;
216
+ border: solid 1px #888888;
217
+ background-color: #DEDEDE;
218
+ text-decoration: none;
219
+ padding: 0 2px;
220
+ color: #000000;
221
+ white-space: nowrap;
222
+ }
223
+
224
+ div#area_search_replace a:hover{
225
+ /*border: solid 1px #888888;*/
226
+ background-color: #EDEDED;
227
+ }
228
+
229
+ div#area_search_replace #move_area_search_replace{
230
+ cursor: move;
231
+ border: solid 1px #888;
232
+ }
233
+
234
+ div#area_search_replace #close_area_search_replace{
235
+ text-align: right;
236
+ vertical-align: top;
237
+ white-space: nowrap;
238
+ }
239
+
240
+ div#area_search_replace #area_search_msg{
241
+ height: 18px;
242
+ overflow: hidden;
243
+ border-top: solid 1px #888;
244
+ margin-top: 3px;
245
+ }
246
+
247
+ /* area help */
248
+ #edit_area_help{
249
+ width: 350px;
250
+ }
251
+
252
+ #edit_area_help div.close_popup{
253
+ float: right;
254
+ }
255
+
256
+ /* area_toolbar */
257
+ .area_toolbar{
258
+ /*font: 11px sans-serif;*/
259
+ width: 100%;
260
+ /*height: 21px; */
261
+ margin: 0;
262
+ padding: 0;
263
+ background-color: #ECE9D8;
264
+ text-align: center;
265
+ }
266
+
267
+ .area_toolbar, .area_toolbar table{
268
+ font: 11px sans-serif;
269
+ }
270
+
271
+ .area_toolbar img{
272
+ border: 0;
273
+ vertical-align: middle;
274
+ }
275
+
276
+ .area_toolbar input{
277
+ margin: 0;
278
+ padding: 0;
279
+ }
280
+
281
+ .area_toolbar select{
282
+ font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
283
+ font-size: 7pt;
284
+ font-weight: normal;
285
+ margin: 2px 0 0 0 ;
286
+ padding: 0;
287
+ vertical-align: top;
288
+ background-color: #F0F0EE;
289
+ }
290
+
291
+ table.statusbar{
292
+ width: 100%;
293
+ }
294
+
295
+ .area_toolbar td.infos{
296
+ text-align: center;
297
+ width: 130px;
298
+ border-right: solid 1px #888;
299
+ border-width: 0 1px 0 0;
300
+ padding: 0;
301
+ }
302
+
303
+ .area_toolbar td.total{
304
+ text-align: right;
305
+ width: 50px;
306
+ padding: 0;
307
+ }
308
+
309
+ .area_toolbar td.resize{
310
+ text-align: right;
311
+ }
312
+ /*
313
+ .area_toolbar span{
314
+ line-height: 1px;
315
+ padding: 0;
316
+ margin: 0;
317
+ }*/
318
+
319
+ .area_toolbar span#resize_area{
320
+ cursor: nw-resize;
321
+ visibility: hidden;
322
+ }
323
+
324
+ /* toolbar buttons */
325
+ .editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
326
+ border: 0; margin: 0; padding: 0; background: transparent;
327
+ margin-top: 0;
328
+ margin-left: 1px;
329
+ padding: 0;
330
+ }
331
+
332
+ .editAreaButtonNormal {
333
+ border: 1px solid #ECE9D8 !important;
334
+ cursor: pointer;
335
+ }
336
+
337
+ .editAreaButtonOver {
338
+ border: 1px solid #0A246A !important;
339
+ cursor: pointer;
340
+ background-color: #B6BDD2;
341
+ }
342
+
343
+ .editAreaButtonDown {
344
+ cursor: pointer;
345
+ border: 1px solid #0A246A !important;
346
+ background-color: #8592B5;
347
+ }
348
+
349
+ .editAreaButtonSelected {
350
+ border: 1px solid #C0C0BB !important;
351
+ cursor: pointer;
352
+ background-color: #F4F2E8;
353
+ }
354
+
355
+ .editAreaButtonDisabled {
356
+ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
357
+ -moz-opacity:0.3;
358
+ opacity: 0.3;
359
+ border: 1px solid #F0F0EE !important;
360
+ cursor: pointer;
361
+ }
362
+
363
+ .editAreaSeparatorLine {
364
+ margin: 1px 2px;
365
+ background-color: #C0C0BB;
366
+ width: 2px;
367
+ height: 18px;
368
+ }
369
+
370
+ /* waiting screen */
371
+ #processing{
372
+ display: none;
373
+ background-color:#ECE9D8;
374
+ border: solid #888 1px;
375
+ position: absolute;
376
+ top: 0;
377
+ left: 0;
378
+ width: 100%;
379
+ height: 100%;
380
+ z-index: 100;
381
+ text-align: center;
382
+ }
383
+
384
+ #processing_text{
385
+ position:absolute;
386
+ left: 50%;
387
+ top: 50%;
388
+ width: 200px;
389
+ height: 20px;
390
+ margin-left: -100px;
391
+ margin-top: -10px;
392
+ text-align: center;
393
+ }
394
+ /* end */
395
+
396
+
397
+ /**** tab browsing area ****/
398
+ #tab_browsing_area{
399
+ display: none;
400
+ background-color: #CCC9A8;
401
+ border-top: 1px solid #888;
402
+ text-align: left;
403
+ margin: 0;
404
+ }
405
+
406
+ #tab_browsing_list {
407
+ padding: 0;
408
+ margin: 0;
409
+ list-style-type: none;
410
+ white-space: nowrap;
411
+ }
412
+ #tab_browsing_list li {
413
+ float: left;
414
+ margin: -1px;
415
+ }
416
+ #tab_browsing_list a {
417
+ position: relative;
418
+ display: block;
419
+ text-decoration: none;
420
+ float: left;
421
+ cursor: pointer;
422
+ line-height:14px;
423
+ }
424
+
425
+ #tab_browsing_list a span {
426
+ display: block;
427
+ color: #000;
428
+ background: #ECE9D8;
429
+ border: 1px solid #888;
430
+ border-width: 1px 1px 0;
431
+ text-align: center;
432
+ padding: 2px 2px 1px 4px;
433
+ position: relative; /*IE 6 hack */
434
+ }
435
+
436
+ #tab_browsing_list a b {
437
+ display: block;
438
+ border-bottom: 2px solid #617994;
439
+ }
440
+
441
+ #tab_browsing_list a .edited {
442
+ display: none;
443
+ }
444
+
445
+ #tab_browsing_list a.edited .edited {
446
+ display: inline;
447
+ }
448
+
449
+ #tab_browsing_list a img{
450
+ margin-left: 7px;
451
+ }
452
+
453
+ #tab_browsing_list a.edited img{
454
+ margin-left: 3px;
455
+ }
456
+
457
+ #tab_browsing_list a:hover span {
458
+ background: #F4F2E8;
459
+ border-color: #0A246A;
460
+ }
461
+
462
+ #tab_browsing_list .selected a span{
463
+ background: #046380;
464
+ color: #FFF;
465
+ }
466
+
467
+
468
+ #no_file_selected{
469
+ height: 100%;
470
+ width: 150%; /* Opera need more than 100% */
471
+ background: #CCC;
472
+ display: none;
473
+ z-index: 20;
474
+ position: absolute;
475
+ }
476
+
477
+
478
+ /*** Non-editable mode ***/
479
+ .non_editable #editor
480
+ {
481
+ border-width: 0 1px;
482
+ }
483
+
484
+ .non_editable .area_toolbar
485
+ {
486
+ display: none;
487
+ }
488
+
489
+ /*** Auto completion ***/
490
+ #auto_completion_area
491
+ {
492
+ background: #FFF;
493
+ border: solid 1px #888;
494
+ position: absolute;
495
+ z-index: 15;
496
+ width: 280px;
497
+ height: 180px;
498
+ overflow: auto;
499
+ display:none;
500
+ }
501
+
502
+ #auto_completion_area a, #auto_completion_area a:visited
503
+ {
504
+ display: block;
505
+ padding: 0 2px 1px;
506
+ color: #000;
507
+ text-decoration:none;
508
+ }
509
+
510
+ #auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
511
+ {
512
+ background: #D6E1FE;
513
+ text-decoration:none;
514
+ }
515
+
516
+ #auto_completion_area ul
517
+ {
518
+ margin: 0;
519
+ padding: 0;
520
+ list-style: none inside;
521
+ }
522
+ #auto_completion_area li
523
+ {
524
+ padding: 0;
525
+ }
526
+ #auto_completion_area .prefix
527
+ {
528
+ font-style: italic;
529
+ padding: 0 3px;
530
+ }
js/editarea/edit_area.js ADDED
@@ -0,0 +1,527 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******
2
+ *
3
+ * EditArea
4
+ * Developped by Christophe Dolivet
5
+ * Released under LGPL, Apache and BSD licenses (use the one you want)
6
+ *
7
+ ******/
8
+
9
+ function EditArea(){
10
+ var t=this;
11
+ t.error= false; // to know if load is interrrupt
12
+
13
+ t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"},
14
+ {popup_id: "edit_area_help", icon_id: "help"}];
15
+ t.plugins= {};
16
+
17
+ t.line_number=0;
18
+
19
+ parent.editAreaLoader.set_browser_infos(t); // navigator identification
20
+ // fix IE8 detection as we run in IE7 emulate mode through X-UA <meta> tag
21
+ if( t.isIE >= 8 )
22
+ t.isIE = 7;
23
+
24
+ t.last_selection={};
25
+ t.last_text_to_highlight="";
26
+ t.last_hightlighted_text= "";
27
+ t.syntax_list= [];
28
+ t.allready_used_syntax= {};
29
+ t.check_line_selection_timer= 50; // the timer delay for modification and/or selection change detection
30
+
31
+ t.textareaFocused= false;
32
+ t.highlight_selection_line= null;
33
+ t.previous= [];
34
+ t.next= [];
35
+ t.last_undo="";
36
+ t.files= {};
37
+ t.filesIdAssoc= {};
38
+ t.curr_file= '';
39
+ //t.loaded= false;
40
+ t.assocBracket={};
41
+ t.revertAssocBracket= {};
42
+ // bracket selection init
43
+ t.assocBracket["("]=")";
44
+ t.assocBracket["{"]="}";
45
+ t.assocBracket["["]="]";
46
+ for(var index in t.assocBracket){
47
+ t.revertAssocBracket[t.assocBracket[index]]=index;
48
+ }
49
+ t.is_editable= true;
50
+
51
+
52
+ /*t.textarea="";
53
+
54
+ t.state="declare";
55
+ t.code = []; // store highlight syntax for languagues*/
56
+ // font datas
57
+ t.lineHeight= 16;
58
+ /*t.default_font_family= "monospace";
59
+ t.default_font_size= 10;*/
60
+ t.tab_nb_char= 8; //nb of white spaces corresponding to a tabulation
61
+ if(t.isOpera)
62
+ t.tab_nb_char= 6;
63
+
64
+ t.is_tabbing= false;
65
+
66
+ t.fullscreen= {'isFull': false};
67
+
68
+ t.isResizing=false; // resize var
69
+
70
+ // init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation
71
+ t.id= area_id;
72
+ t.settings= editAreas[t.id]["settings"];
73
+
74
+ if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/))
75
+ {
76
+ t.tab_nb_char= t.settings['replace_tab_by_spaces'];
77
+ t.tabulation="";
78
+ for(var i=0; i<t.tab_nb_char; i++)
79
+ t.tabulation+=" ";
80
+ }else{
81
+ t.tabulation="\t";
82
+ }
83
+
84
+ // retrieve the init parameter for syntax
85
+ if(t.settings["syntax_selection_allow"] && t.settings["syntax_selection_allow"].length>0)
86
+ t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(",");
87
+
88
+ if(t.settings['syntax'])
89
+ t.allready_used_syntax[t.settings['syntax']]=true;
90
+
91
+
92
+ };
93
+ EditArea.prototype.init= function(){
94
+ var t=this, a, s=t.settings;
95
+ t.textarea = _$("textarea");
96
+ t.container = _$("container");
97
+ t.result = _$("result");
98
+ t.content_highlight = _$("content_highlight");
99
+ t.selection_field = _$("selection_field");
100
+ t.selection_field_text= _$("selection_field_text");
101
+ t.processing_screen = _$("processing");
102
+ t.editor_area = _$("editor");
103
+ t.tab_browsing_area = _$("tab_browsing_area");
104
+ t.test_font_size = _$("test_font_size");
105
+ a = t.textarea;
106
+
107
+ if(!s['is_editable'])
108
+ t.set_editable(false);
109
+
110
+ t.set_show_line_colors( s['show_line_colors'] );
111
+
112
+ if(syntax_selec= _$("syntax_selection"))
113
+ {
114
+ // set up syntax selection lsit in the toolbar
115
+ for(var i=0; i<t.syntax_list.length; i++) {
116
+ var syntax= t.syntax_list[i];
117
+ var option= document.createElement("option");
118
+ option.value= syntax;
119
+ if(syntax==s['syntax'])
120
+ option.selected= "selected";
121
+ dispSyntax = parent.editAreaLoader.syntax_display_name[ syntax ];
122
+ option.innerHTML= typeof( dispSyntax ) == 'undefined' ? syntax.substring( 0, 1 ).toUpperCase() + syntax.substring( 1 ) : dispSyntax;//t.get_translation("syntax_" + syntax, "word");
123
+ syntax_selec.appendChild(option);
124
+ }
125
+ }
126
+
127
+ // add plugins buttons in the toolbar
128
+ spans= parent.getChildren(_$("toolbar_1"), "span", "", "", "all", -1);
129
+
130
+ for(var i=0; i<spans.length; i++){
131
+
132
+ id=spans[i].id.replace(/tmp_tool_(.*)/, "$1");
133
+ if(id!= spans[i].id){
134
+ for(var j in t.plugins){
135
+ if(typeof(t.plugins[j].get_control_html)=="function" ){
136
+ html=t.plugins[j].get_control_html(id);
137
+ if(html!=false){
138
+ html= t.get_translation(html, "template");
139
+ var new_span= document.createElement("span");
140
+ new_span.innerHTML= html;
141
+ var father= spans[i].parentNode;
142
+ spans[i].parentNode.replaceChild(new_span, spans[i]);
143
+ break; // exit the for loop
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ // init datas
151
+ //a.value = 'a';//editAreas[t.id]["textarea"].value;
152
+
153
+ if(s["debug"])
154
+ {
155
+ t.debug=parent.document.getElementById("edit_area_debug_"+t.id);
156
+ }
157
+ // init size
158
+ //this.update_size();
159
+
160
+ if(_$("redo") != null)
161
+ t.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
162
+
163
+ // insert css rules for highlight mode
164
+ if(typeof(parent.editAreaLoader.syntax[s["syntax"]])!="undefined"){
165
+ for(var i in parent.editAreaLoader.syntax){
166
+ if (typeof(parent.editAreaLoader.syntax[i]["styles"]) != "undefined"){
167
+ t.add_style(parent.editAreaLoader.syntax[i]["styles"]);
168
+ }
169
+ }
170
+ }
171
+
172
+ // init key events
173
+ if(t.isOpera)
174
+ _$("editor").onkeypress = keyDown;
175
+ else
176
+ _$("editor").onkeydown = keyDown;
177
+
178
+ for(var i=0; i<t.inlinePopup.length; i++){
179
+ if(t.isOpera)
180
+ _$(t.inlinePopup[i]["popup_id"]).onkeypress = keyDown;
181
+ else
182
+ _$(t.inlinePopup[i]["popup_id"]).onkeydown = keyDown;
183
+ }
184
+
185
+ if(s["allow_resize"]=="both" || s["allow_resize"]=="x" || s["allow_resize"]=="y")
186
+ t.allow_resize(true);
187
+
188
+ parent.editAreaLoader.toggle(t.id, "on");
189
+ //a.focus();
190
+ // line selection init
191
+ t.change_smooth_selection_mode(editArea.smooth_selection);
192
+ // highlight
193
+ t.execCommand("change_highlight", s["start_highlight"]);
194
+
195
+ // get font size datas
196
+ t.set_font(editArea.settings["font_family"], editArea.settings["font_size"]);
197
+
198
+ // set unselectable text
199
+ children= parent.getChildren(document.body, "", "selec", "none", "all", -1);
200
+ for(var i=0; i<children.length; i++){
201
+ if(t.isIE)
202
+ children[i].unselectable = true; // IE
203
+ else
204
+ children[i].onmousedown= function(){return false};
205
+ /* children[i].style.MozUserSelect = "none"; // Moz
206
+ children[i].style.KhtmlUserSelect = "none"; // Konqueror/Safari*/
207
+ }
208
+
209
+ a.spellcheck= s["gecko_spellcheck"];
210
+
211
+ /** Browser specific style fixes **/
212
+
213
+ // fix rendering bug for highlighted lines beginning with no tabs
214
+ if( t.isFirefox >= '3' ) {
215
+ t.content_highlight.style.paddingLeft= "1px";
216
+ t.selection_field.style.paddingLeft= "1px";
217
+ t.selection_field_text.style.paddingLeft= "1px";
218
+ }
219
+
220
+ if(t.isIE && t.isIE < 8 ){
221
+ a.style.marginTop= "-1px";
222
+ }
223
+ /*
224
+ if(t.isOpera){
225
+ t.editor_area.style.position= "absolute";
226
+ }*/
227
+
228
+ if( t.isSafari ){
229
+ t.editor_area.style.position = "absolute";
230
+ a.style.marginLeft ="-3px";
231
+ if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
232
+ a.style.marginTop ="1px";
233
+ }
234
+
235
+ // si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
236
+ parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);} });
237
+
238
+ if(s['is_multi_files']!=false)
239
+ t.open_file({'id': t.curr_file, 'text': ''});
240
+
241
+ t.set_word_wrap( s['word_wrap'] );
242
+
243
+ setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10);
244
+ //start checkup routine
245
+ t.check_undo();
246
+ t.check_line_selection(true);
247
+ t.scroll_to_view();
248
+
249
+ for(var i in t.plugins){
250
+ if(typeof(t.plugins[i].onload)=="function")
251
+ t.plugins[i].onload();
252
+ }
253
+ if(s['fullscreen']==true)
254
+ t.toggle_full_screen(true);
255
+
256
+ parent.editAreaLoader.add_event(window, "resize", editArea.update_size);
257
+ parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size);
258
+ parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size);
259
+ parent.editAreaLoader.add_event(window, "unload", function(){
260
+ // in case where editAreaLoader have been already cleaned
261
+ if( parent.editAreaLoader )
262
+ {
263
+ parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size);
264
+ parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size);
265
+ }
266
+ if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){
267
+ editArea.execCommand("EA_unload");
268
+ }
269
+ });
270
+
271
+
272
+ /*date= new Date();
273
+ alert(date.getTime()- parent.editAreaLoader.start_time);*/
274
+ };
275
+
276
+
277
+
278
+ //called by the toggle_on
279
+ EditArea.prototype.update_size= function(){
280
+ var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop;
281
+
282
+ if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){
283
+ if(editArea.fullscreen['isFull']){
284
+ pd.getElementById("frame_"+editArea.id).style.width = pd.getElementsByTagName("html")[0].clientWidth + "px";
285
+ pd.getElementById("frame_"+editArea.id).style.height = pd.getElementsByTagName("html")[0].clientHeight + "px";
286
+ }
287
+
288
+ if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) )
289
+ {
290
+ editArea.tab_browsing_area.style.height = "0px";
291
+ editArea.tab_browsing_area.style.height = (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px";
292
+ }
293
+
294
+ height = d.body.offsetHeight - editArea.get_all_toolbar_height() - 4;
295
+ editArea.result.style.height = height +"px";
296
+
297
+ width = d.body.offsetWidth -2;
298
+ editArea.result.style.width = width+"px";
299
+ //alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight);
300
+
301
+ // check that the popups don't get out of the screen
302
+ for( i=0; i < editArea.inlinePopup.length; i++ )
303
+ {
304
+ popup = _$(editArea.inlinePopup[i]["popup_id"]);
305
+ maxLeft = d.body.offsetWidth - popup.offsetWidth;
306
+ maxTop = d.body.offsetHeight - popup.offsetHeight;
307
+ if( popup.offsetTop > maxTop )
308
+ popup.style.top = maxTop+"px";
309
+ if( popup.offsetLeft > maxLeft )
310
+ popup.style.left = maxLeft+"px";
311
+ }
312
+
313
+ editArea.manage_size( true );
314
+ editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
315
+ }
316
+ };
317
+
318
+
319
+ EditArea.prototype.manage_size= function(onlyOneTime){
320
+ if(!editAreas[this.id])
321
+ return false;
322
+
323
+ if(editAreas[this.id]["displayed"]==true && this.textareaFocused)
324
+ {
325
+ var area_height,resized= false;
326
+
327
+ //1) Manage display width
328
+ //1.1) Calc the new width to use for display
329
+ if( !this.settings['word_wrap'] )
330
+ {
331
+ var area_width= this.textarea.scrollWidth;
332
+ area_height= this.textarea.scrollHeight;
333
+ // bug on old opera versions
334
+ if(this.isOpera && this.isOpera < 9.6 ){
335
+ area_width=10000;
336
+ }
337
+ //1.2) the width is not the same, we must resize elements
338
+ if(this.textarea.previous_scrollWidth!=area_width)
339
+ {
340
+ this.container.style.width= area_width+"px";
341
+ this.textarea.style.width= area_width+"px";
342
+ this.content_highlight.style.width= area_width+"px";
343
+ this.textarea.previous_scrollWidth=area_width;
344
+ resized=true;
345
+ }
346
+ }
347
+ // manage wrap width
348
+ if( this.settings['word_wrap'] )
349
+ {
350
+ newW=this.textarea.offsetWidth;
351
+ if( this.isFirefox || this.isIE )
352
+ newW-=2;
353
+ if( this.isSafari )
354
+ newW-=6;
355
+ this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px";
356
+ }
357
+
358
+ //2) Manage display height
359
+ //2.1) Calc the new height to use for display
360
+ if( this.isOpera || this.isFirefox || this.isSafari ) {
361
+ area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 );
362
+ } else {
363
+ area_height = this.textarea.scrollHeight;
364
+ }
365
+ //2.2) the width is not the same, we must resize elements
366
+ if(this.textarea.previous_scrollHeight!=area_height)
367
+ {
368
+ this.container.style.height= (area_height+2)+"px";
369
+ this.textarea.style.height= area_height+"px";
370
+ this.content_highlight.style.height= area_height+"px";
371
+ this.textarea.previous_scrollHeight= area_height;
372
+ resized=true;
373
+ }
374
+
375
+ //3) if there is new lines, we add new line numbers in the line numeration area
376
+ if(this.last_selection["nb_line"] >= this.line_number)
377
+ {
378
+ var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100;
379
+ for( i = start+1; i < end; i++ )
380
+ {
381
+ newLines+='<div id="line_'+ i +'">'+i+"</div>";
382
+ this.line_number++;
383
+ }
384
+ destDiv.innerHTML= destDiv.innerHTML + newLines;
385
+ if(this.settings['word_wrap']){
386
+ this.fixLinesHeight( this.textarea.value, start, -1 );
387
+ }
388
+ }
389
+
390
+ //4) be sure the text is well displayed
391
+ this.textarea.scrollTop="0px";
392
+ this.textarea.scrollLeft="0px";
393
+ if(resized==true){
394
+ this.scroll_to_view();
395
+ }
396
+ }
397
+
398
+ if(!onlyOneTime)
399
+ setTimeout("editArea.manage_size();", 100);
400
+ };
401
+
402
+ EditArea.prototype.execCommand= function(cmd, param){
403
+
404
+ for(var i in this.plugins){
405
+ if(typeof(this.plugins[i].execCommand)=="function"){
406
+ if(!this.plugins[i].execCommand(cmd, param))
407
+ return;
408
+ }
409
+ }
410
+ switch(cmd){
411
+ case "save":
412
+ if(this.settings["save_callback"].length>0)
413
+ eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);");
414
+ break;
415
+ case "load":
416
+ if(this.settings["load_callback"].length>0)
417
+ eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');");
418
+ break;
419
+ case "onchange":
420
+ if(this.settings["change_callback"].length>0)
421
+ eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');");
422
+ break;
423
+ case "EA_load":
424
+ if(this.settings["EA_load_callback"].length>0)
425
+ eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');");
426
+ break;
427
+ case "EA_unload":
428
+ if(this.settings["EA_unload_callback"].length>0)
429
+ eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');");
430
+ break;
431
+ case "toggle_on":
432
+ if(this.settings["EA_toggle_on_callback"].length>0)
433
+ eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');");
434
+ break;
435
+ case "toggle_off":
436
+ if(this.settings["EA_toggle_off_callback"].length>0)
437
+ eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');");
438
+ break;
439
+ case "re_sync":
440
+ if(!this.do_highlight)
441
+ break;
442
+ case "file_switch_on":
443
+ if(this.settings["EA_file_switch_on_callback"].length>0)
444
+ eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);");
445
+ break;
446
+ case "file_switch_off":
447
+ if(this.settings["EA_file_switch_off_callback"].length>0)
448
+ eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);");
449
+ break;
450
+ case "file_close":
451
+ if(this.settings["EA_file_close_callback"].length>0)
452
+ return eval("parent."+this.settings["EA_file_close_callback"]+"(param);");
453
+ break;
454
+
455
+ default:
456
+ if(typeof(eval("editArea."+cmd))=="function")
457
+ {
458
+ if(this.settings["debug"])
459
+ eval("editArea."+ cmd +"(param);");
460
+ else
461
+ try{eval("editArea."+ cmd +"(param);");}catch(e){};
462
+ }
463
+ }
464
+ };
465
+
466
+ EditArea.prototype.get_translation= function(word, mode){
467
+ if(mode=="template")
468
+ return parent.editAreaLoader.translate(word, this.settings["language"], mode);
469
+ else
470
+ return parent.editAreaLoader.get_word_translation(word, this.settings["language"]);
471
+ };
472
+
473
+ EditArea.prototype.add_plugin= function(plug_name, plug_obj){
474
+ for(var i=0; i<this.settings["plugins"].length; i++){
475
+ if(this.settings["plugins"][i]==plug_name){
476
+ this.plugins[plug_name]=plug_obj;
477
+ plug_obj.baseURL=parent.editAreaLoader.baseURL + "plugins/" + plug_name + "/";
478
+ if( typeof(plug_obj.init)=="function" )
479
+ plug_obj.init();
480
+ }
481
+ }
482
+ };
483
+
484
+ EditArea.prototype.load_css= function(url){
485
+ try{
486
+ link = document.createElement("link");
487
+ link.type = "text/css";
488
+ link.rel= "stylesheet";
489
+ link.media="all";
490
+ link.href = url;
491
+ head = document.getElementsByTagName("head");
492
+ head[0].appendChild(link);
493
+ }catch(e){
494
+ document.write("<link href='"+ url +"' rel='stylesheet' type='text/css' />");
495
+ }
496
+ };
497
+
498
+ EditArea.prototype.load_script= function(url){
499
+ try{
500
+ script = document.createElement("script");
501
+ script.type = "text/javascript";
502
+ script.src = url;
503
+ script.charset= "UTF-8";
504
+ head = document.getElementsByTagName("head");
505
+ head[0].appendChild(script);
506
+ }catch(e){
507
+ document.write("<script type='text/javascript' src='" + url + "' charset=\"UTF-8\"><"+"/script>");
508
+ }
509
+ };
510
+
511
+ // add plugin translation to language translation array
512
+ EditArea.prototype.add_lang= function(language, values){
513
+ if(!parent.editAreaLoader.lang[language])
514
+ parent.editAreaLoader.lang[language]={};
515
+ for(var i in values)
516
+ parent.editAreaLoader.lang[language][i]= values[i];
517
+ };
518
+
519
+ // short cut for document.getElementById()
520
+ function _$(id){return document.getElementById( id );};
521
+
522
+ var editArea = new EditArea();
523
+ parent.editAreaLoader.add_event(window, "load", init);
524
+
525
+ function init(){
526
+ setTimeout("editArea.init(); ", 10);
527
+ };
js/editarea/edit_area_compressor.php ADDED
@@ -0,0 +1,428 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /******
3
+ *
4
+ * EditArea PHP compressor
5
+ * Developped by Christophe Dolivet
6
+ * Released under LGPL, Apache and BSD licenses
7
+ * v1.1.3 (2007/01/18)
8
+ *
9
+ ******/
10
+
11
+ // CONFIG
12
+ $param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires
13
+ $param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false)
14
+ $param['debug'] = false; // Enable this option if you need debuging info
15
+ $param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk.
16
+ $param['use_gzip']= true; // Enable gzip compression
17
+ // END CONFIG
18
+
19
+ $compressor= new Compressor($param);
20
+
21
+ class Compressor{
22
+
23
+
24
+ function compressor($param)
25
+ {
26
+ $this->__construct($param);
27
+ }
28
+
29
+ function __construct($param)
30
+ {
31
+ $this->start_time= $this->get_microtime();
32
+ $this->file_loaded_size=0;
33
+ $this->param= $param;
34
+ $this->script_list="";
35
+ $this->path= dirname(__FILE__)."/";
36
+ if(isset($_GET['plugins'])){
37
+ $this->load_all_plugins= true;
38
+ $this->full_cache_file= $this->path."edit_area_full_with_plugins.js";
39
+ $this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz";
40
+ }else{
41
+ $this->load_all_plugins= false;
42
+ $this->full_cache_file= $this->path."edit_area_full.js";
43
+ $this->gzip_cache_file= $this->path."edit_area_full.gz";
44
+ }
45
+
46
+ $this->check_gzip_use();
47
+ $this->send_headers();
48
+ $this->check_cache();
49
+ $this->load_files();
50
+ $this->send_datas();
51
+ }
52
+
53
+ function send_headers()
54
+ {
55
+ header("Content-type: text/javascript; charset: UTF-8");
56
+ header("Vary: Accept-Encoding"); // Handle proxies
57
+ header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) );
58
+ if($this->use_gzip)
59
+ header("Content-Encoding: ".$this->gzip_enc_header);
60
+ }
61
+
62
+ function check_gzip_use()
63
+ {
64
+ $encodings = array();
65
+ $desactivate_gzip=false;
66
+
67
+ if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
68
+ $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
69
+
70
+ // desactivate gzip for IE version < 7
71
+ if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie))
72
+ {
73
+ if($ie[1]<7)
74
+ $desactivate_gzip=true;
75
+ }
76
+
77
+ // Check for gzip header or northon internet securities
78
+ if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
79
+ $this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
80
+ $this->use_gzip=true;
81
+ $this->cache_file=$this->gzip_cache_file;
82
+ }else{
83
+ $this->use_gzip=false;
84
+ $this->cache_file=$this->full_cache_file;
85
+ }
86
+ }
87
+
88
+ function check_cache()
89
+ {
90
+ // Only gzip the contents if clients and server support it
91
+ if (file_exists($this->cache_file)) {
92
+ // check if cache file must be updated
93
+ $cache_date=0;
94
+ if ($dir = opendir($this->path)) {
95
+ while (($file = readdir($dir)) !== false) {
96
+ if(is_file($this->path.$file) && $file!="." && $file!="..")
97
+ $cache_date= max($cache_date, filemtime($this->path.$file));
98
+ }
99
+ closedir($dir);
100
+ }
101
+ if($this->load_all_plugins){
102
+ $plug_path= $this->path."plugins/";
103
+ if (($dir = @opendir($plug_path)) !== false)
104
+ {
105
+ while (($file = readdir($dir)) !== false)
106
+ {
107
+ if ($file !== "." && $file !== "..")
108
+ {
109
+ if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
110
+ $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js"));
111
+ }
112
+ }
113
+ closedir($dir);
114
+ }
115
+ }
116
+
117
+ if(filemtime($this->cache_file) >= $cache_date){
118
+ // if cache file is up to date
119
+ $last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT";
120
+ if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0)
121
+ {
122
+ header("HTTP/1.1 304 Not Modified");
123
+ header("Last-modified: ".$last_modified);
124
+ header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
125
+ header("Pragma:"); // Tells HTTP 1.0 clients to cache
126
+ }
127
+ else
128
+ {
129
+ header("Last-modified: ".$last_modified);
130
+ header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache
131
+ header("Pragma:"); // Tells HTTP 1.0 clients to cache
132
+ header('Content-Length: '.filesize($this->cache_file));
133
+ echo file_get_contents($this->cache_file);
134
+ }
135
+ die;
136
+ }
137
+ }
138
+ return false;
139
+ }
140
+
141
+ function load_files()
142
+ {
143
+ $loader= $this->get_content("edit_area_loader.js")."\n";
144
+
145
+ // get the list of other files to load
146
+ $loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e"
147
+ , "\$this->replace_scripts('script_list', '\\1', '\\2')"
148
+ , $loader);
149
+
150
+ $loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e"
151
+ , "\$this->replace_scripts('sub_script_list', '\\1', '\\2')"
152
+ , $loader);
153
+
154
+ // replace languages names
155
+ $reg_path= $this->path."reg_syntax/";
156
+ $a_displayName = array();
157
+ if (($dir = @opendir($reg_path)) !== false)
158
+ {
159
+ while (($file = readdir($dir)) !== false)
160
+ {
161
+ if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false )
162
+ {
163
+ $jsContent = $this->file_get_contents( $reg_path.$file );
164
+ if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) )
165
+ {
166
+ $a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'";
167
+ }
168
+ }
169
+ }
170
+ closedir($dir);
171
+ }
172
+ $loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $loader );
173
+
174
+ $this->datas= $loader;
175
+ $this->compress_javascript($this->datas);
176
+
177
+ // load other scripts needed for the loader
178
+ preg_match_all('/"([^"]*)"/', $this->script_list, $match);
179
+ foreach($match[1] as $key => $value)
180
+ {
181
+ $content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js");
182
+ $this->compress_javascript($content);
183
+ $this->datas.= $content."\n";
184
+ }
185
+ //$this->datas);
186
+ //$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas);
187
+
188
+ // improved compression step 1/2
189
+ $this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas);
190
+ //$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas);
191
+ $this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;";
192
+
193
+ // load sub scripts
194
+ $sub_scripts="";
195
+ $sub_scripts_list= array();
196
+ preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match);
197
+ foreach($match[1] as $value){
198
+ $sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js";
199
+ }
200
+
201
+ if($this->load_all_plugins){
202
+ // load plugins scripts
203
+ $plug_path= $this->path."plugins/";
204
+ if (($dir = @opendir($plug_path)) !== false)
205
+ {
206
+ while (($file = readdir($dir)) !== false)
207
+ {
208
+ if ($file !== "." && $file !== "..")
209
+ {
210
+ if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js"))
211
+ $sub_scripts_list[]= "plugins/".$file."/".$file.".js";
212
+ }
213
+ }
214
+ closedir($dir);
215
+ }
216
+ }
217
+
218
+ foreach($sub_scripts_list as $value){
219
+ $sub_scripts.= $this->get_javascript_content($value);
220
+ }
221
+ // improved compression step 2/2
222
+ $sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
223
+ // $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts);
224
+ $sub_scripts.= "var editArea= eA;EditArea=EA;";
225
+
226
+
227
+ // add the scripts
228
+ // $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\";\n", $sub_scripts);
229
+
230
+
231
+ // add the script and use a last compression
232
+ if( $this->param['compress'] )
233
+ {
234
+ $last_comp = array( 'Á' => 'this',
235
+ 'Â' => 'textarea',
236
+ 'Ã' => 'function',
237
+ 'Ä' => 'prototype',
238
+ 'Å' => 'settings',
239
+ 'Æ' => 'length',
240
+ 'Ç' => 'style',
241
+ 'È' => 'parent',
242
+ 'É' => 'last_selection',
243
+ 'Ê' => 'value',
244
+ 'Ë' => 'true',
245
+ 'Ì' => 'false'
246
+ /*,
247
+ 'Î' => '"',
248
+ 'Ï' => "\n",
249
+ 'À' => "\r"*/);
250
+ }
251
+ else
252
+ {
253
+ $last_comp = array();
254
+ }
255
+
256
+ $js_replace= '';
257
+ foreach( $last_comp as $key => $val )
258
+ $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')";
259
+
260
+ $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n",
261
+ str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ),
262
+ $js_replace);
263
+
264
+ if($this->load_all_plugins)
265
+ $this->datas.="editAreaLoader.all_plugins_loaded=true;\n";
266
+
267
+
268
+ // load the template
269
+ $this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html"));
270
+ // load the css
271
+ $this->datas.= sprintf("editAreaLoader.iframe_css= \"<style>%s</style>\";\n", $this->get_css_content("edit_area.css"));
272
+
273
+ // $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();";
274
+
275
+ }
276
+
277
+ function send_datas()
278
+ {
279
+ if($this->param['debug']){
280
+ $header=sprintf("/* USE PHP COMPRESSION\n");
281
+ $header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas));
282
+ if($this->use_gzip){
283
+ $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP);
284
+ $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas));
285
+ $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0);
286
+ }else{
287
+ $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0);
288
+ }
289
+ $header.=sprintf(", reduced by %s%%\n", $ratio);
290
+ $header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time);
291
+ $header.=sprintf("%s\n", implode("\n", $this->infos));
292
+ $header.=sprintf("*/\n");
293
+ $this->datas= $header.$this->datas;
294
+ }
295
+ $mtime= time(); // ensure that the 2 disk files will have the same update time
296
+ // generate gzip file and cahce it if using disk cache
297
+ if($this->use_gzip){
298
+ $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP);
299
+ if($this->param['use_disk_cache'])
300
+ $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime);
301
+ }
302
+
303
+ // generate full js file and cache it if using disk cache
304
+ if($this->param['use_disk_cache'])
305
+ $this->file_put_contents($this->full_cache_file, $this->datas, $mtime);
306
+
307
+ // generate output
308
+ if($this->use_gzip)
309
+ echo $this->gzip_datas;
310
+ else
311
+ echo $this->datas;
312
+
313
+ // die;
314
+ }
315
+
316
+
317
+ function get_content($end_uri)
318
+ {
319
+ $end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security)
320
+ $file= $this->path.$end_uri;
321
+ if(file_exists($file)){
322
+ $this->infos[]=sprintf("'%s' loaded", $end_uri);
323
+ /*$fd = fopen($file, 'rb');
324
+ $content = fread($fd, filesize($file));
325
+ fclose($fd);
326
+ return $content;*/
327
+ return $this->file_get_contents($file);
328
+ }else{
329
+ $this->infos[]=sprintf("'%s' not loaded", $end_uri);
330
+ return "";
331
+ }
332
+ }
333
+
334
+ function get_javascript_content($end_uri)
335
+ {
336
+ $val=$this->get_content($end_uri);
337
+
338
+ $this->compress_javascript($val);
339
+ $this->prepare_string_for_quotes($val);
340
+ return $val;
341
+ }
342
+
343
+ function compress_javascript(&$code)
344
+ {
345
+ if($this->param['compress'])
346
+ {
347
+ // remove all comments
348
+ // (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))
349
+ $code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code);
350
+ // remove line return, empty line and tabulation
351
+ $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code);
352
+ // add line break before "else" otherwise navigators can't manage to parse the file
353
+ $code= preg_replace('/(\b(else)\b)/', "\n$1", $code);
354
+ // remove unnecessary spaces
355
+ $code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code);
356
+ }
357
+ }
358
+
359
+ function get_css_content($end_uri){
360
+ $code=$this->get_content($end_uri);
361
+ // remove comments
362
+ $code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code);
363
+ // remove spaces
364
+ $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code);
365
+ // remove spaces
366
+ $code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code);
367
+
368
+ $this->prepare_string_for_quotes($code);
369
+ return $code;
370
+ }
371
+
372
+ function get_html_content($end_uri){
373
+ $code=$this->get_content($end_uri);
374
+ //$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code);
375
+ $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code);
376
+ $this->prepare_string_for_quotes($code);
377
+ return $code;
378
+ }
379
+
380
+ function prepare_string_for_quotes(&$str){
381
+ // prepare the code to be putted into quotes
382
+ /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/");
383
+ $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/
384
+ $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/");
385
+ if($this->param['compress'])
386
+ $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n');
387
+ else
388
+ $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\"");
389
+ $str= preg_replace($pattern, $replace, $str);
390
+ }
391
+
392
+ function replace_scripts($var, $param1, $param2)
393
+ {
394
+ $this->$var=stripslashes($param2);
395
+ return $param1."[];";
396
+ }
397
+
398
+ /* for php version that have not thoses functions */
399
+ function file_get_contents($file)
400
+ {
401
+ $fd = fopen($file, 'rb');
402
+ $content = fread($fd, filesize($file));
403
+ fclose($fd);
404
+ $this->file_loaded_size+= strlen($content);
405
+ return $content;
406
+ }
407
+
408
+ function file_put_contents($file, &$content, $mtime=-1)
409
+ {
410
+ if($mtime==-1)
411
+ $mtime=time();
412
+ $fp = @fopen($file, "wb");
413
+ if ($fp) {
414
+ fwrite($fp, $content);
415
+ fclose($fp);
416
+ touch($file, $mtime);
417
+ return true;
418
+ }
419
+ return false;
420
+ }
421
+
422
+ function get_microtime()
423
+ {
424
+ list($usec, $sec) = explode(" ", microtime());
425
+ return ((float)$usec + (float)$sec);
426
+ }
427
+ }
428
+ ?>
js/editarea/edit_area_full.gz ADDED
Binary file
js/editarea/edit_area_full.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 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;
2
+ else t.isValidBrowser=false;t.set_base_url();for(var i=0;i<t.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+t.baseURL+t.scripts_to_load[i]+".js');",1);t.waiting_loading[t.scripts_to_load[i]+".js"]=false;}t.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},set_browser_infos:function(o){ua=navigator.userAgent;o.isWebKit=/WebKit/.test(ua);o.isGecko=!o.isWebKit&&/Gecko/.test(ua);o.isMac=/Mac/.test(ua);o.isIE=(navigator.appName=="Microsoft Internet Explorer");if(o.isIE){o.isIE=ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/,"$1");if(o.isIE<6)o.has_error();}if(o.isOpera=(ua.indexOf('Opera')!=-1)){o.isOpera=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(o.isOpera<9)o.has_error();o.isIE=false;}if(o.isFirefox=(ua.indexOf('Firefox')!=-1))o.isFirefox=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('Iceweasel')!=-1)o.isFirefox=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('GranParadiso')!=-1)o.isFirefox=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('BonEcho')!=-1)o.isFirefox=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('SeaMonkey')!=-1)o.isFirefox=(ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i,"$1"))+1;if(o.isCamino=(ua.indexOf('Camino')!=-1))o.isCamino=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(o.isSafari=(ua.indexOf('Safari')!=-1))o.isSafari=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(o.isChrome=(ua.indexOf('Chrome')!=-1)){o.isChrome=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");o.isSafari=false;}},window_loaded:function(){eAL.win="loaded";if(document.forms){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch(e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var a=document.getElementById(id);try{if(a&&typeof(a.focused)=="undefined"){a.focus();a.focused=true;a.selectionStart=a.selectionEnd=0;get_IE_selection(a);eAL.add_event(a,"focus",IE_textarea_focus);eAL.add_event(a,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){var t=this,s=settings,i;if(!s["id"])t.has_error();if(t.error)return;if(eAs[s["id"]])t.delete_instance(s["id"]);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;i<s["plugins"].length;i++){if(s["plugins"][i].length==0)s["plugins"].splice(i,1);}t.get_template();t.load_script(t.baseURL+"langs/"+s["language"]+".js");if(s["syntax"].length>0){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+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id+"' class='toggle_"+id+"' type='checkbox' onclick='eAL.toggle(\""+id+"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id+"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id+"' spellcheck='off' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";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);
3
+ 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<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=t.get_control_html(area["settings"]["tab_toolbar"][i],area["settings"]["language"]);}html_toolbar_content=t.translate(html_toolbar_content,area["settings"]["language"],"template");if(!t.iframe_script){t.iframe_script="";for(i=0;i<t.sub_scripts_to_load.length;i++)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+t.sub_scripts_to_load[i]+'.js"></script>';}for(i=0;i<area["settings"]["plugins"].length;i++){if(!t.all_plugins_loaded)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/'+area["settings"]["plugins"][i]+'.js"></script>';t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/langs/'+area["settings"]["language"]+'.js"></script>';}if(!t.iframe_css){t.iframe_css="<link href='"+t.baseURL+"edit_area.css' rel='stylesheet' type='text/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);
4
+ 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);}
5
+ 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);}
6
+ 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;}
7
+ 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");}
8
+ 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<elems.length;i++){if(elems[i].src&&elems[i].src.match(/edit_area_[^\\\/]*$/i)){var src=unescape(elems[i].src);src=src.substring(0,src.lastIndexOf('/'));this.baseURL=src;this.file_name=elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);break;}}}docBasePath=document.location.href;if(docBasePath.indexOf('?')!=-1)docBasePath=docBasePath.substring(0,docBasePath.indexOf('?'));docBasePath=docBasePath.substring(0,docBasePath.lastIndexOf('/'));if(t.baseURL.indexOf('://')==-1&&t.baseURL.charAt(0)!='/'){t.baseURL=docBasePath+"/"+t.baseURL;}t.baseURL+="/";},get_button_html:function(id,img,exec,isFileSpecific,baseURL){var cmd,html;if(!baseURL)baseURL=this.baseURL;cmd='editArea.execCommand(\''+exec+'\')';html='<a id="a_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+';return false;" onmousedown="return false;" target="_self" fileSpecific="'+(isFileSpecific?'yes':'no')+'">';html+='<img id="'+id+'" src="'+baseURL+'images/'+img+'" title="{$'+id+'}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';return html;},get_control_html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i<t.advanced_buttons.length;i++){but=t.advanced_buttons[i];if(but[0]==button_name){return t.get_button_html(but[0],but[1],but[2],but[3]);}}switch(button_name){case "*":case "return":return "<br />";case "|":case "separator":return '<img src="'+t.baseURL+'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';case "select_font":html="<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";html+="<option value='-1'>{$font_size}</option>";si=[8,9,10,11,12,14];for(i=0;i<si.length;i++){html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";}html+="</select>";return html;case "syntax_selection":html="<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\",this.value)' fileSpecific='yes'>";html+="<option value='-1'>{$syntax_selection}</option>";html+="</select>";return html;}return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest();
9
+ else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
10
+ 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;
11
+ else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang);
12
+ 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('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'" charset="UTF-8"></sc'+'ript>');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);}
13
+ else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler);
14
+ 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<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_child=true;}if(window.frames["frame_"+i]&&is_child&&eAs[i]["displayed"]==true){var exec='window.frames["frame_'+i+'"].editArea.textarea.value=document.getElementById("'+i+'").value;';exec+='window.frames["frame_'+i+'"].editArea.execCommand("focus");';exec+='window.frames["frame_'+i+'"].editArea.check_line_selection();';exec+='window.frames["frame_'+i+'"].editArea.execCommand("reset");';window.setTimeout(exec,10);}}return;},submit:function(e){var formObj,is_child,fs=window.frames,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<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_child=true;}if(is_child){if(fs["frame_"+i]&&eAs[i]["displayed"]==true)document.getElementById(i).value=fs["frame_"+i].editArea.textarea.value;eAL.execCommand(i,"EA_submit");}}if(typeof(formObj.edit_area_replaced_submit)=="function"){res=formObj.edit_area_replaced_submit();if(res==false){if(eAL.isIE)return false;
15
+ else e.preventDefault();}}return;},getValue:function(id){if(window.frames["frame_"+id]&&eAs[id]["displayed"]==true){return window.frames["frame_"+id].editArea.textarea.value;}
16
+ else if(elem=document.getElementById(id)){return elem.value;}return false;},setValue:function(id,new_val){var fs=window.frames;if((f=fs["frame_"+id])&&eAs[id]["displayed"]==true){f.editArea.textarea.value=new_val;f.editArea.execCommand("focus");f.editArea.check_line_selection(false);f.editArea.execCommand("onchange");}
17
+ else if(elem=document.getElementById(id)){elem.value=new_val;}},getSelectionRange:function(id){var sel,eA,fs=window.frames;sel={"start":0,"end":0};if(fs["frame_"+id]&&eAs[id]["displayed"]==true){eA=fs["frame_"+id].editArea;sel["start"]=eA.textarea.selectionStart;sel["end"]=eA.textarea.selectionEnd;}
18
+ else if(elem=document.getElementById(id)){sel=getSelectionRange(elem);}return sel;},setSelectionRange:function(id,new_start,new_end){var fs=window.frames;if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].editArea.area_select(new_start,new_end-new_start);if(!this.isIE){fs["frame_"+id].editArea.check_line_selection(false);fs["frame_"+id].editArea.scroll_to_view();}}
19
+ else if(elem=document.getElementById(id)){setSelectionRange(elem,new_start,new_end);}},getSelectedText:function(id){var sel=this.getSelectionRange(id);return this.getValue(id).substring(sel["start"],sel["end"]);},setSelectedText:function(id,new_val){var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;new_val=new_val.replace(/\r/g,"");sel=this.getSelectionRange(id);text=this.getValue(id);if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
20
+ else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}text=text.substring(0,sel["start"])+new_val+text.substring(sel["end"]);this.setValue(id,text);new_sel_end=sel["start"]+new_val.length;this.setSelectionRange(id,sel["start"],new_sel_end);if(new_val !=this.getSelectedText(id).replace(/\r/g,"")){this.setSelectionRange(id,sel["start"],new_sel_end+new_val.split("\n").length-1);}if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;fs["frame_"+id].editArea.execCommand("onchange");}
21
+ else{d.getElementById(id).scrollTop=scrollTop;d.getElementById(id).scrollLeft=scrollLeft;}},insertTags:function(id,open_tag,close_tag){var old_sel,new_sel;old_sel=this.getSelectionRange(id);text=open_tag+this.getSelectedText(id)+close_tag;eAL.setSelectedText(id,text);new_sel=this.getSelectionRange(id);if(old_sel["end"] > old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]);
22
+ 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;}
23
+ 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;}
24
+ 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);');
25
+ 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);}
26
+ 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;x<children.length;x++){strTagName=new String(children[x].tagName);children_class="?";if(strTagName!="undefined"){child_attribute=getAttribute(children[x],elem_attribute);if((strTagName.toLowerCase()==elem_type.toLowerCase()||elem_type=="")&&(elem_attribute==""||child_attribute==elem_attribute_match)){if(option=="all"){results.push(children[x]);}
27
+ else{return children[x];}}if(depth!=0){result=getChildren(children[x],elem_type,elem_attribute,elem_attribute_match,option,depth-1);if(option=="all"){if(result.length>0){results=results.concat(result);}}
28
+ 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;}
29
+ else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;}
30
+ 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);}
31
+ else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];}
32
+ 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";
33
+ 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";
34
+ EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i<text_array.length;i++){if(i>0)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];}}
35
+ 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";
36
+ var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "<script type='text/javascript'> Ã EA(){var t=Á;t.error=Ì;t.inlinePopup=[{popup_id:\"area_search_replace\",icon_id:\"search\"},{popup_id:\"edit_area_help\",icon_id:\"help\"}];t.plugins={};t.line_number=0;È.eAL.set_browser_infos(t);if(t.isIE >=8)t.isIE=7;t.É={};t.last_text_to_highlight=\"\";t.last_hightlighted_text=\"\";t.syntax_list=[];t.allready_used_syntax={};t.check_line_selection_timer=50;t.ÂFocused=Ì;t.highlight_selection_line=null;t.previous=[];t.next=[];t.last_undo=\"\";t.files={};t.filesIdAssoc={};t.curr_file='';t.assocBracket={};t.revertAssocBracket={};t.assocBracket[\"(\"]=\")\";t.assocBracket[\"{\"]=\"}\";t.assocBracket[\"[\"]=\"]\";for(var index in t.assocBracket){t.revertAssocBracket[t.assocBracket[index]]=index;}t.is_editable=Ë;t.lineHeight=16;t.tab_nb_char=8;if(t.isOpera)t.tab_nb_char=6;t.is_tabbing=Ì;t.fullscreen={'isFull':Ì};t.isResizing=Ì;t.id=area_id;t.Å=eAs[t.id][\"Å\"];if((\"\"+t.Å['replace_tab_by_spaces']).match(/^[0-9]+$/)){t.tab_nb_char=t.Å['replace_tab_by_spaces'];t.tabulation=\"\";for(var i=0;i<t.tab_nb_char;i++)t.tabulation+=\" \";}\nelse{t.tabulation=\"\t\";}if(t.Å[\"syntax_selection_allow\"]&&t.Å[\"syntax_selection_allow\"].Æ>0)t.syntax_list=t.Å[\"syntax_selection_allow\"].replace(/ /g,\"\").split(\",\");if(t.Å['syntax'])t.allready_used_syntax[t.Å['syntax']]=Ë;};EA.Ä.init=Ã(){var t=Á,a,s=t.Å;t.Â=_$(\"Â\");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.Â;if(!s['is_editable'])t.set_editable(Ì);t.set_show_line_colors(s['show_line_colors']);if(syntax_selec=_$(\"syntax_selection\")){for(var i=0;i<t.syntax_list.Æ;i++){var syntax=t.syntax_list[i];var option=document.createElement(\"option\");option.Ê=syntax;if(syntax==s['syntax'])option.selected=\"selected\";dispSyntax=È.eAL.syntax_display_name[ syntax ];option.innerHTML=typeof(dispSyntax)=='undefined' ? syntax.substring(0,1).toUpperCase()+syntax.substring(1):dispSyntax;syntax_selec.appendChild(option);}}spans=È.getChildren(_$(\"toolbar_1\"),\"span\",\"\",\"\",\"all\",-1);for(var i=0;i<spans.Æ;i++){id=spans[i].id.replace(/tmp_tool_(.*)/,\"$1\");if(id!=spans[i].id){for(var j in t.plugins){if(typeof(t.plugins[j].get_control_html)==\"Ã\"){html=t.plugins[j].get_control_html(id);if(html!=Ì){html=t.get_translation(html,\"template\");var new_span=document.createElement(\"span\");new_span.innerHTML=html;var father=spans[i].ÈNode;spans[i].ÈNode.replaceChild(new_span,spans[i]);break;}}}}}if(s[\"debug\"]){t.debug=È.document.getElementById(\"edit_area_debug_\"+t.id);}if(_$(\"redo\")!=null)t.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);if(typeof(È.eAL.syntax[s[\"syntax\"]])!=\"undefined\"){for(var i in È.eAL.syntax){if(typeof(È.eAL.syntax[i][\"Çs\"])!=\"undefined\"){t.add_Ç(È.eAL.syntax[i][\"Çs\"]);}}}if(t.isOpera)_$(\"editor\").onkeypress=keyDown;\nelse _$(\"editor\").onkeydown=keyDown;for(var i=0;i<t.inlinePopup.Æ;i++){if(t.isOpera)_$(t.inlinePopup[i][\"popup_id\"]).onkeypress=keyDown;\nelse _$(t.inlinePopup[i][\"popup_id\"]).onkeydown=keyDown;}if(s[\"allow_resize\"]==\"both\"||s[\"allow_resize\"]==\"x\"||s[\"allow_resize\"]==\"y\")t.allow_resize(Ë);È.eAL.toggle(t.id,\"on\");t.change_smooth_selection_mode(eA.smooth_selection);t.execCommand(\"change_highlight\",s[\"start_highlight\"]);t.set_font(eA.Å[\"font_family\"],eA.Å[\"font_size\"]);children=È.getChildren(document.body,\"\",\"selec\",\"none\",\"all\",-1);for(var i=0;i<children.Æ;i++){if(t.isIE)children[i].unselectable=Ë;\nelse children[i].onmousedown=Ã(){return Ì};}a.spellcheck=s[\"gecko_spellcheck\"];if(t.isFirefox >='3'){t.content_highlight.Ç.paddingLeft=\"1px\";t.selection_field.Ç.paddingLeft=\"1px\";t.selection_field_text.Ç.paddingLeft=\"1px\";}if(t.isIE&&t.isIE < 8){a.Ç.marginTop=\"-1px\";}if(t.isSafari){t.editor_area.Ç.position=\"absolute\";a.Ç.marginLeft=\"-3px\";if(t.isSafari < 3.2)a.Ç.marginTop=\"1px\";}È.eAL.add_event(t.result,\"click\",Ã(e){if((e.target||e.srcElement)==eA.result){eA.area_select(eA.Â.Ê.Æ,0);}});if(s['is_multi_files']!=Ì)t.open_file({'id':t.curr_file,'text':''});t.set_word_wrap(s['word_wrap']);setTimeout(\"eA.focus();eA.manage_size();eA.execCommand('EA_load');\",10);t.check_undo();t.check_line_selection(Ë);t.scroll_to_view();for(var i in t.plugins){if(typeof(t.plugins[i].onload)==\"Ã\")t.plugins[i].onload();}if(s['fullscreen']==Ë)t.toggle_full_screen(Ë);È.eAL.add_event(window,\"resize\",eA.update_size);È.eAL.add_event(È.window,\"resize\",eA.update_size);È.eAL.add_event(top.window,\"resize\",eA.update_size);È.eAL.add_event(window,\"unload\",Ã(){if(È.eAL){È.eAL.remove_event(È.window,\"resize\",eA.update_size);È.eAL.remove_event(top.window,\"resize\",eA.update_size);}if(eAs[eA.id]&&eAs[eA.id][\"displayed\"]){eA.execCommand(\"EA_unload\");}});};EA.Ä.update_size=Ã(){var d=document,pd=È.document,height,width,popup,maxLeft,maxTop;if(typeof eAs !='undefined'&&eAs[eA.id]&&eAs[eA.id][\"displayed\"]==Ë){if(eA.fullscreen['isFull']){pd.getElementById(\"frame_\"+eA.id).Ç.width=pd.getElementsByTagName(\"html\")[0].clientWidth+\"px\";pd.getElementById(\"frame_\"+eA.id).Ç.height=pd.getElementsByTagName(\"html\")[0].clientHeight+\"px\";}if(eA.tab_browsing_area.Ç.display=='block'&&(!eA.isIE||eA.isIE >=8)){eA.tab_browsing_area.Ç.height=\"0px\";eA.tab_browsing_area.Ç.height=(eA.result.offsetTop-eA.tab_browsing_area.offsetTop-1)+\"px\";}height=d.body.offsetHeight-eA.get_all_toolbar_height()-4;eA.result.Ç.height=height+\"px\";width=d.body.offsetWidth-2;eA.result.Ç.width=width+\"px\";for(i=0;i < eA.inlinePopup.Æ;i++){popup=_$(eA.inlinePopup[i][\"popup_id\"]);maxLeft=d.body.offsetWidth-popup.offsetWidth;maxTop=d.body.offsetHeight-popup.offsetHeight;if(popup.offsetTop > maxTop)popup.Ç.top=maxTop+\"px\";if(popup.offsetLeft > maxLeft)popup.Ç.left=maxLeft+\"px\";}eA.manage_size(Ë);eA.fixLinesHeight(eA.Â.Ê,0,-1);}};EA.Ä.manage_size=Ã(onlyOneTime){if(!eAs[Á.id])return Ì;if(eAs[Á.id][\"displayed\"]==Ë&&Á.ÂFocused){var area_height,resized=Ì;if(!Á.Å['word_wrap']){var area_width=Á.Â.scrollWidth;area_height=Á.Â.scrollHeight;if(Á.isOpera&&Á.isOpera < 9.6){area_width=10000;}if(Á.Â.previous_scrollWidth!=area_width){Á.container.Ç.width=area_width+\"px\";Á.Â.Ç.width=area_width+\"px\";Á.content_highlight.Ç.width=area_width+\"px\";Á.Â.previous_scrollWidth=area_width;resized=Ë;}}if(Á.Å['word_wrap']){newW=Á.Â.offsetWidth;if(Á.isFirefox||Á.isIE)newW-=2;if(Á.isSafari)newW-=6;Á.content_highlight.Ç.width=Á.selection_field_text.Ç.width=Á.selection_field.Ç.width=Á.test_font_size.Ç.width=newW+\"px\";}if(Á.isOpera||Á.isFirefox||Á.isSafari){area_height=Á.getLinePosTop(Á.É[\"nb_line\"]+1);}\nelse{area_height=Á.Â.scrollHeight;}if(Á.Â.previous_scrollHeight!=area_height){Á.container.Ç.height=(area_height+2)+\"px\";Á.Â.Ç.height=area_height+\"px\";Á.content_highlight.Ç.height=area_height+\"px\";Á.Â.previous_scrollHeight=area_height;resized=Ë;}if(Á.É[\"nb_line\"] >=Á.line_number){var newLines='',destDiv=_$(\"line_number\"),start=Á.line_number,end=Á.É[\"nb_line\"]+100;for(i=start+1;i < end;i++){newLines+='<div id=\"line_'+i+'\">'+i+\"</div>\";Á.line_number++;}destDiv.innerHTML=destDiv.innerHTML+newLines;if(Á.Å['word_wrap']){Á.fixLinesHeight(Á.Â.Ê,start,-1);}}Á.Â.scrollTop=\"0px\";Á.Â.scrollLeft=\"0px\";if(resized==Ë){Á.scroll_to_view();}}if(!onlyOneTime)setTimeout(\"eA.manage_size();\",100);};EA.Ä.execCommand=Ã(cmd,param){for(var i in Á.plugins){if(typeof(Á.plugins[i].execCommand)==\"Ã\"){if(!Á.plugins[i].execCommand(cmd,param))return;}}switch(cmd){case \"save\":if(Á.Å[\"save_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"save_callback\"]+\"('\"+Á.id+\"',eA.Â.Ê);\");break;case \"load\":if(Á.Å[\"load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"load_callback\"]+\"('\"+Á.id+\"');\");break;case \"onchange\":if(Á.Å[\"change_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"change_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_load\":if(Á.Å[\"EA_load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_load_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_unload\":if(Á.Å[\"EA_unload_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_unload_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_on\":if(Á.Å[\"EA_toggle_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_on_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_off\":if(Á.Å[\"EA_toggle_off_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_off_callback\"]+\"('\"+Á.id+\"');\");break;case \"re_sync\":if(!Á.do_highlight)break;case \"file_switch_on\":if(Á.Å[\"EA_file_switch_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_file_switch_on_callback\"]+\"(param);\");break;case \"file_switch_off\":if(Á.Å[\"EA_file_switch_off_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_file_switch_off_callback\"]+\"(param);\");break;case \"file_close\":if(Á.Å[\"EA_file_close_callback\"].Æ>0)return eval(\"È.\"+Á.Å[\"EA_file_close_callback\"]+\"(param);\");break;default:if(typeof(eval(\"eA.\"+cmd))==\"Ã\"){if(Á.Å[\"debug\"])eval(\"eA.\"+cmd+\"(param);\");\nelse try{eval(\"eA.\"+cmd+\"(param);\");}catch(e){};}}};EA.Ä.get_translation=Ã(word,mode){if(mode==\"template\")return È.eAL.translate(word,Á.Å[\"language\"],mode);\nelse return È.eAL.get_word_translation(word,Á.Å[\"language\"]);};EA.Ä.add_plugin=Ã(plug_name,plug_obj){for(var i=0;i<Á.Å[\"plugins\"].Æ;i++){if(Á.Å[\"plugins\"][i]==plug_name){Á.plugins[plug_name]=plug_obj;plug_obj.baseURL=È.eAL.baseURL+\"plugins/\"+plug_name+\"/\";if(typeof(plug_obj.init)==\"Ã\")plug_obj.init();}}};EA.Ä.load_css=Ã(url){try{link=document.createElement(\"link\");link.type=\"text/css\";link.rel=\"Çsheet\";link.media=\"all\";link.href=url;head=document.getElementsByTagName(\"head\");head[0].appendChild(link);}catch(e){document.write(\"<link href='\"+url+\"' rel='Çsheet' type='text/css' />\");}};EA.Ä.load_script=Ã(url){try{script=document.createElement(\"script\");script.type=\"text/javascript\";script.src=url;script.charset=\"UTF-8\";head=document.getElementsByTagName(\"head\");head[0].appendChild(script);}catch(e){document.write(\"<script type='text/javascript' src='\"+url+\"' charset=\\\"UTF-8\\\"><\"+\"/script>\");}};EA.Ä.add_lang=Ã(language,Ês){if(!È.eAL.lang[language])È.eAL.lang[language]={};for(var i in Ês)È.eAL.lang[language][i]=Ês[i];};Ã _$(id){return document.getElementById(id);};var eA=new EA();È.eAL.add_event(window,\"load\",init);Ã init(){setTimeout(\"eA.init();\",10);}; EA.Ä.focus=Ã(){Á.Â.focus();Á.ÂFocused=Ë;};EA.Ä.check_line_selection=Ã(timer_checkup){var changes,infos,new_top,new_width,i;var t1=t2=t2_1=t3=tLines=tend=new Date().getTime();if(!eAs[Á.id])return Ì;if(!Á.smooth_selection&&!Á.do_highlight){}\nelse if(Á.ÂFocused&&eAs[Á.id][\"displayed\"]==Ë&&Á.isResizing==Ì){infos=Á.get_selection_infos();changes=Á.checkTextEvolution(typeof(Á.É['full_text'])=='undefined' ? '':Á.É['full_text'],infos['full_text']);t2=new Date().getTime();if(Á.É[\"line_start\"] !=infos[\"line_start\"]||Á.É[\"line_nb\"] !=infos[\"line_nb\"]||infos[\"full_text\"] !=Á.É[\"full_text\"]||Á.reload_highlight||Á.É[\"selectionStart\"] !=infos[\"selectionStart\"]||Á.É[\"selectionEnd\"] !=infos[\"selectionEnd\"]||!timer_checkup){new_top=Á.getLinePosTop(infos[\"line_start\"]);new_width=Math.max(Á.Â.scrollWidth,Á.container.clientWidth-50);Á.selection_field.Ç.top=Á.selection_field_text.Ç.top=new_top+\"px\";if(!Á.Å['word_wrap']){Á.selection_field.Ç.width=Á.selection_field_text.Ç.width=Á.test_font_size.Ç.width=new_width+\"px\";}if(Á.do_highlight==Ë){var curr_text=infos[\"full_text\"].split(\"\\n\");var content=\"\";var start=Math.max(0,infos[\"line_start\"]-1);var end=Math.min(curr_text.Æ,infos[\"line_start\"]+infos[\"line_nb\"]-1);for(i=start;i< end;i++){content+=curr_text[i]+\"\\n\";}selLength=infos['selectionEnd']-infos['selectionStart'];content=content.substr(0,infos[\"curr_pos\"]-1)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1,selLength)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1+selLength);content='<span>'+content.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(\"\\r\\r\",'</span><strong>').replace(\"\\r\\r\",'</strong><span>')+'</span>';if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){Á.selection_field.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{Á.selection_field.innerHTML=content;}Á.selection_field_text.innerHTML=Á.selection_field.innerHTML;t2_1=new Date().getTime();if(Á.reload_highlight||(infos[\"full_text\"] !=Á.last_text_to_highlight&&(Á.É[\"line_start\"]!=infos[\"line_start\"]||Á.show_line_colors||Á.Å['word_wrap']||Á.É[\"line_nb\"]!=infos[\"line_nb\"]||Á.É[\"nb_line\"]!=infos[\"nb_line\"]))){Á.maj_highlight(infos);}}}t3=new Date().getTime();if(Á.Å['word_wrap']&&infos[\"full_text\"] !=Á.É[\"full_text\"]){if(changes.newText.split(\"\\n\").Æ==1&&Á.É['nb_line']&&infos['nb_line']==Á.É['nb_line']){Á.fixLinesHeight(infos['full_text'],changes.lineStart,changes.lineStart);}\nelse{Á.fixLinesHeight(infos['full_text'],changes.lineStart,-1);}}tLines=new Date().getTime();if(infos[\"line_start\"] !=Á.É[\"line_start\"]||infos[\"curr_pos\"] !=Á.É[\"curr_pos\"]||infos[\"full_text\"].Æ!=Á.É[\"full_text\"].Æ||Á.reload_highlight||!timer_checkup){var selec_char=infos[\"curr_line\"].charAt(infos[\"curr_pos\"]-1);var no_real_move=Ë;if(infos[\"line_nb\"]==1&&(Á.assocBracket[selec_char]||Á.revertAssocBracket[selec_char])){no_real_move=Ì;if(Á.findEndBracket(infos,selec_char)===Ë){_$(\"end_bracket\").Ç.visibility=\"visible\";_$(\"cursor_pos\").Ç.visibility=\"visible\";_$(\"cursor_pos\").innerHTML=selec_char;_$(\"end_bracket\").innerHTML=(Á.assocBracket[selec_char]||Á.revertAssocBracket[selec_char]);}\nelse{_$(\"end_bracket\").Ç.visibility=\"hidden\";_$(\"cursor_pos\").Ç.visibility=\"hidden\";}}\nelse{_$(\"cursor_pos\").Ç.visibility=\"hidden\";_$(\"end_bracket\").Ç.visibility=\"hidden\";}Á.displayToCursorPosition(\"cursor_pos\",infos[\"line_start\"],infos[\"curr_pos\"]-1,infos[\"curr_line\"],no_real_move);if(infos[\"line_nb\"]==1&&infos[\"line_start\"]!=Á.É[\"line_start\"])Á.scroll_to_view();}Á.É=infos;}tend=new Date().getTime();if(timer_checkup){setTimeout(\"eA.check_line_selection(Ë)\",Á.check_line_selection_timer);}};EA.Ä.get_selection_infos=Ã(){var sel={},start,end,len,str;Á.getIESelection();start=Á.Â.selectionStart;end=Á.Â.selectionEnd;if(Á.É[\"selectionStart\"]==start&&Á.É[\"selectionEnd\"]==end&&Á.É[\"full_text\"]==Á.Â.Ê){return Á.É;}if(Á.tabulation!=\"\t\"&&Á.Â.Ê.indexOf(\"\t\")!=-1){len=Á.Â.Ê.Æ;Á.Â.Ê=Á.replace_tab(Á.Â.Ê);start=end=start+(Á.Â.Ê.Æ-len);Á.area_select(start,0);}sel[\"selectionStart\"]=start;sel[\"selectionEnd\"]=end;sel[\"full_text\"]=Á.Â.Ê;sel[\"line_start\"]=1;sel[\"line_nb\"]=1;sel[\"curr_pos\"]=0;sel[\"curr_line\"]=\"\";sel[\"indexOfCursor\"]=0;sel[\"selec_direction\"]=Á.É[\"selec_direction\"];var splitTab=sel[\"full_text\"].split(\"\\n\");var nbLine=Math.max(0,splitTab.Æ);var nbChar=Math.max(0,sel[\"full_text\"].Æ-(nbLine-1));if(sel[\"full_text\"].indexOf(\"\\r\")!=-1)nbChar=nbChar-(nbLine-1);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\").Æ);}\nelse{sel[\"curr_pos\"]=1;}if(end>start){sel[\"line_nb\"]=sel[\"full_text\"].substring(start,end).split(\"\\n\").Æ;}sel[\"indexOfCursor\"]=start;sel[\"curr_line\"]=splitTab[Math.max(0,sel[\"line_start\"]-1)];if(sel[\"selectionStart\"]==Á.É[\"selectionStart\"]){if(sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"])sel[\"selec_direction\"]=\"down\";\nelse if(sel[\"selectionEnd\"]==Á.É[\"selectionStart\"])sel[\"selec_direction\"]=Á.É[\"selec_direction\"];}\nelse if(sel[\"selectionStart\"]==Á.É[\"selectionEnd\"]&&sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"]){sel[\"selec_direction\"]=\"down\";}\nelse{sel[\"selec_direction\"]=\"up\";}_$(\"nbLine\").innerHTML=nbLine;_$(\"nbChar\").innerHTML=nbChar;_$(\"linePos\").innerHTML=sel[\"line_start\"];_$(\"currPos\").innerHTML=sel[\"curr_pos\"];return sel;};EA.Ä.getIESelection=Ã(){var selectionStart,selectionEnd,range,stored_range;if(!Á.isIE)return Ì;if(Á.Å['word_wrap'])Á.Â.wrap='off';try{range=document.selection.createRange();stored_range=range.duplicate();stored_range.moveToElementText(Á.Â);stored_range.setEndPoint('EndToEnd',range);if(stored_range.ÈElement()!=Á.Â)throw \"invalid focus\";var scrollTop=Á.result.scrollTop+document.body.scrollTop;var relative_top=range.offsetTop-È.calculeOffsetTop(Á.Â)+scrollTop;var line_start=Math.round((relative_top / Á.lineHeight)+1);var line_nb=Math.round(range.boundingHeight / Á.lineHeight);selectionStart=stored_range.text.Æ-range.text.Æ;selectionStart+=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)*2;selectionStart-=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)* 2;selectionEnd=selectionStart+range.text.Æ;selectionEnd+=(line_start+line_nb-1-Á.Â.Ê.substr(0,selectionEnd).split(\"\\n\").Æ)*2;Á.Â.selectionStart=selectionStart;Á.Â.selectionEnd=selectionEnd;}catch(e){}if(Á.Å['word_wrap'])Á.Â.wrap='soft';};EA.Ä.setIESelection=Ã(){var a=Á.Â,nbLineStart,nbLineEnd,range;if(!Á.isIE)return Ì;nbLineStart=a.Ê.substr(0,a.selectionStart).split(\"\\n\").Æ-1;nbLineEnd=a.Ê.substr(0,a.selectionEnd).split(\"\\n\").Æ-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();};EA.Ä.checkTextEvolution=Ã(lastText,newText){var ch={},baseStep=200,cpt=0,end,step,tStart=new Date().getTime();end=Math.min(newText.Æ,lastText.Æ);step=baseStep;while(cpt<end&&step>=1){if(lastText.substr(cpt,step)==newText.substr(cpt,step)){cpt+=step;}\nelse{step=Math.floor(step/2);}}ch.posStart=cpt;ch.lineStart=newText.substr(0,ch.posStart).split(\"\\n\").Æ-1;cpt_last=lastText.Æ;cpt=newText.Æ;step=baseStep;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;}\nelse{step=Math.floor(step/2);}}ch.posNewEnd=cpt;ch.posLastEnd=cpt_last;if(ch.posNewEnd<=ch.posStart){if(lastText.Æ < newText.Æ){ch.posNewEnd=ch.posStart+newText.Æ-lastText.Æ;ch.posLastEnd=ch.posStart;}\nelse{ch.posLastEnd=ch.posStart+lastText.Æ-newText.Æ;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\").Æ-1;ch.lineLastEnd=lastText.substr(0,ch.posLastEnd).split(\"\\n\").Æ-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\");return ch;};EA.Ä.tab_selection=Ã(){if(Á.is_tabbing)return;Á.is_tabbing=Ë;Á.getIESelection();var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var insText=Á.Â.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){Á.Â.Ê=Á.Â.Ê.substr(0,start)+Á.tabulation+Á.Â.Ê.substr(end);pos_start=start+Á.tabulation.Æ;pos_end=pos_start;}\nelse{start=Math.max(0,Á.Â.Ê.substr(0,start).lastIndexOf(\"\\n\")+1);endText=Á.Â.Ê.substr(end);startText=Á.Â.Ê.substr(0,start);tmp=Á.Â.Ê.substring(start,end).split(\"\\n\");insText=Á.tabulation+tmp.join(\"\\n\"+Á.tabulation);Á.Â.Ê=startText+insText+endText;pos_start=start;pos_end=Á.Â.Ê.indexOf(\"\\n\",startText.Æ+insText.Æ);if(pos_end==-1)pos_end=Á.Â.Ê.Æ;}Á.Â.selectionStart=pos_start;Á.Â.selectionEnd=pos_end;if(Á.isIE){Á.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse{Á.is_tabbing=Ì;}};EA.Ä.invert_tab_selection=Ã(){var t=Á,a=Á.Â;if(t.is_tabbing)return;t.is_tabbing=Ë;t.getIESelection();var start=a.selectionStart;var end=a.selectionEnd;var insText=a.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){if(a.Ê.substring(start-t.tabulation.Æ,start)==t.tabulation){a.Ê=a.Ê.substr(0,start-t.tabulation.Æ)+a.Ê.substr(end);pos_start=Math.max(0,start-t.tabulation.Æ);pos_end=pos_start;}}\nelse{start=a.Ê.substr(0,start).lastIndexOf(\"\\n\")+1;endText=a.Ê.substr(end);startText=a.Ê.substr(0,start);tmp=a.Ê.substring(start,end).split(\"\\n\");insText=\"\";for(i=0;i<tmp.Æ;i++){for(j=0;j<t.tab_nb_char;j++){if(tmp[i].charAt(0)==\"\t\"){tmp[i]=tmp[i].substr(1);j=t.tab_nb_char;}\nelse if(tmp[i].charAt(0)==\" \")tmp[i]=tmp[i].substr(1);}insText+=tmp[i];if(i<tmp.Æ-1)insText+=\"\\n\";}a.Ê=startText+insText+endText;pos_start=start;pos_end=a.Ê.indexOf(\"\\n\",startText.Æ+insText.Æ);if(pos_end==-1)pos_end=a.Ê.Æ;}a.selectionStart=pos_start;a.selectionEnd=pos_end;if(t.isIE){t.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse t.is_tabbing=Ì;};EA.Ä.press_enter=Ã(){if(!Á.smooth_selection)return Ì;Á.getIESelection();var scrollTop=Á.result.scrollTop;var scrollLeft=Á.result.scrollLeft;var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var start_last_line=Math.max(0,Á.Â.Ê.substring(0,start).lastIndexOf(\"\\n\")+1);var begin_line=Á.Â.Ê.substring(start_last_line,start).replace(/^([ \t]*).*/gm,\"$1\");var lineStart=Á.Â.Ê.substring(0,start).split(\"\\n\").Æ;if(begin_line==\"\\n\"||begin_line==\"\\r\"||begin_line.Æ==0){return Ì;}if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){begin_line=\"\\r\\n\"+begin_line;}\nelse{begin_line=\"\\n\"+begin_line;}Á.Â.Ê=Á.Â.Ê.substring(0,start)+begin_line+Á.Â.Ê.substring(end);Á.area_select(start+begin_line.Æ,0);if(Á.isIE){Á.result.scrollTop=scrollTop;Á.result.scrollLeft=scrollLeft;}return Ë;};EA.Ä.findEndBracket=Ã(infos,bracket){var start=infos[\"indexOfCursor\"];var normal_order=Ë;if(Á.assocBracket[bracket])endBracket=Á.assocBracket[bracket];\nelse if(Á.revertAssocBracket[bracket]){endBracket=Á.revertAssocBracket[bracket];normal_order=Ì;}var end=-1;var nbBracketOpen=0;for(var i=start;i<infos[\"full_text\"].Æ&&i>=0;){if(infos[\"full_text\"].charAt(i)==endBracket){nbBracketOpen--;if(nbBracketOpen<=0){end=i;break;}}\nelse if(infos[\"full_text\"].charAt(i)==bracket)nbBracketOpen++;if(normal_order)i++;\nelse i--;}if(end==-1)return Ì;var endLastLine=infos[\"full_text\"].substr(0,end).lastIndexOf(\"\\n\");if(endLastLine==-1)line=1;\nelse line=infos[\"full_text\"].substr(0,endLastLine).split(\"\\n\").Æ+1;var curPos=end-endLastLine-1;var endLineLength=infos[\"full_text\"].substring(end).split(\"\\n\")[0].Æ;Á.displayToCursorPosition(\"end_bracket\",line,curPos,infos[\"full_text\"].substring(endLastLine+1,end+endLineLength));return Ë;};EA.Ä.displayToCursorPosition=Ã(id,start_line,cur_pos,lineContent,no_real_move){var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;elem=Á.test_font_size;dest=_$(id);content=\"<span id='test_font_size_inner'>\"+lineContent.substr(0,cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span><span id='endTestFont'>\"+lineContent.substr(cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span>\";if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}endElem=_$('endTestFont');topOffset=endElem.offsetTop;fixPadding=parseInt(Á.content_highlight.Ç.paddingLeft.replace(\"px\",\"\"));posLeft=45+endElem.offsetLeft+(!isNaN(fixPadding)&&topOffset > 0 ? fixPadding:0);posTop=Á.getLinePosTop(start_line)+topOffset;if(Á.isIE&&cur_pos > 0&&endElem.offsetLeft==0){posTop+=Á.lineHeight;}if(no_real_move!=Ë){dest.Ç.top=posTop+\"px\";dest.Ç.left=posLeft+\"px\";}dest.cursor_top=posTop;dest.cursor_left=posLeft;};EA.Ä.getLinePosTop=Ã(start_line){var elem=_$('line_'+start_line),posTop=0;if(elem)posTop=elem.offsetTop;\nelse posTop=Á.lineHeight *(start_line-1);return posTop;};EA.Ä.getTextHeight=Ã(text){var t=Á,elem,height;elem=t.test_font_size;content=text.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\");if(t.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}height=elem.offsetHeight;height=Math.max(1,Math.floor(elem.offsetHeight / Á.lineHeight))* Á.lineHeight;return height;};EA.Ä.fixLinesHeight=Ã(textValue,lineStart,lineEnd){var aText=textValue.split(\"\\n\");if(lineEnd==-1)lineEnd=aText.Æ-1;for(var i=Math.max(0,lineStart);i <=lineEnd;i++){if(elem=_$('line_'+(i+1))){elem.Ç.height=typeof(aText[i])!=\"undefined\" ? Á.getTextHeight(aText[i])+\"px\":Á.lineHeight;}}};EA.Ä.area_select=Ã(start,Æ){Á.Â.focus();start=Math.max(0,Math.min(Á.Â.Ê.Æ,start));end=Math.max(start,Math.min(Á.Â.Ê.Æ,start+Æ));if(Á.isIE){Á.Â.selectionStart=start;Á.Â.selectionEnd=end;Á.setIESelection();}\nelse{if(Á.isOpera&&Á.isOpera < 9.6){Á.Â.setSelectionRange(0,0);}Á.Â.setSelectionRange(start,end);}Á.check_line_selection();};EA.Ä.area_get_selection=Ã(){var text=\"\";if(document.selection){var range=document.selection.createRange();text=range.text;}\nelse{text=Á.Â.Ê.substring(Á.Â.selectionStart,Á.Â.selectionEnd);}return text;}; EA.Ä.replace_tab=Ã(text){return text.replace(/((\\n?)([^\t\\n]*)\t)/gi,eA.smartTab);};EA.Ä.smartTab=Ã(){val=\" \";return EA.Ä.smartTab.arguments[2]+EA.Ä.smartTab.arguments[3]+val.substr(0,eA.tab_nb_char-(EA.Ä.smartTab.arguments[3].Æ)%eA.tab_nb_char);};EA.Ä.show_waiting_screen=Ã(){width=Á.editor_area.offsetWidth;height=Á.editor_area.offsetHeight;if(!(Á.isIE&&Á.isIE<6)){width-=2;height-=2;}Á.processing_screen.Ç.display=\"block\";Á.processing_screen.Ç.width=width+\"px\";Á.processing_screen.Ç.height=height+\"px\";Á.waiting_screen_displayed=Ë;};EA.Ä.hide_waiting_screen=Ã(){Á.processing_screen.Ç.display=\"none\";Á.waiting_screen_displayed=Ì;};EA.Ä.add_Ç=Ã(Çs){if(Çs.Æ>0){newcss=document.createElement(\"Ç\");newcss.type=\"text/css\";newcss.media=\"all\";if(newcss.ÇSheet){newcss.ÇSheet.cssText=Çs;}\nelse{newcss.appendChild(document.createTextNode(Çs));}document.getElementsByTagName(\"head\")[0].appendChild(newcss);}};EA.Ä.set_font=Ã(family,size){var t=Á,a=Á.Â,s=Á.Å,elem_font,i,elem;var elems=[\"Â\",\"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)s['font_family']=\"monospace\";if(elem_font=_$(\"area_font_size\")){for(i=0;i < elem_font.Æ;i++){if(elem_font.options[i].Ê&&elem_font.options[i].Ê==s[\"font_size\"])elem_font.options[i].selected=Ë;}}if(t.isFirefox){var nbTry=3;do{var div1=document.createElement('div'),text1=document.createElement('Â');var Çs={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=Ì;for(i in Çs){div1.Ç[ i ]=Çs[i];text1.Ç[ i ]=Çs[i];}text1.wrap='off';text1.setAttribute('wrap','off');t.container.appendChild(div1);t.container.appendChild(text1);div1.innerHTML=text1.Ê='azertyuiopqsdfghjklm';div1.innerHTML=text1.Ê=text1.Ê+'wxcvbn^p*ù$!:;,,';diff=text1.scrollWidth-div1.scrollWidth;if(Math.abs(diff)>=2){s[\"font_size\"]++;changed=Ë;}t.container.removeChild(div1);t.container.removeChild(text1);nbTry--;}while(changed&&nbTry > 0);}elem=t.test_font_size;elem.Ç.fontFamily=\"\"+s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\"]+\"pt\";elem.innerHTML=\"0\";t.lineHeight=elem.offsetHeight;for(i=0;i<elems.Æ;i++){elem=_$(elems[i]);elem.Ç.fontFamily=s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\"]+\"pt\";elem.Ç.lineHeight=t.lineHeight+\"px\";}t.add_Ç(\"pre{font-family:\"+s[\"font_family\"]+\"}\");if((t.isOpera&&t.isOpera < 9.6)||t.isIE >=8){var parNod=a.ÈNode,nxtSib=a.nextSibling,start=a.selectionStart,end=a.selectionEnd;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);t.area_select(start,end-start);}Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.change_font_size=Ã(){var size=_$(\"area_font_size\").Ê;if(size>0)Á.set_font(\"\",size);};EA.Ä.open_inline_popup=Ã(popup_id){Á.close_all_inline_popup();var popup=_$(popup_id);var editor=_$(\"editor\");for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);break;}}}popup.Ç.height=\"auto\";popup.Ç.overflow=\"visible\";if(document.body.offsetHeight< popup.offsetHeight){popup.Ç.height=(document.body.offsetHeight-10)+\"px\";popup.Ç.overflow=\"auto\";}if(!popup.positionned){var new_left=editor.offsetWidth /2-popup.offsetWidth /2;var new_top=editor.offsetHeight /2-popup.offsetHeight /2;popup.Ç.left=new_left+\"px\";popup.Ç.top=new_top+\"px\";popup.positionned=Ë;}popup.Ç.visibility=\"visible\";};EA.Ä.close_inline_popup=Ã(popup_id){var popup=_$(popup_id);for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);break;}}}popup.Ç.visibility=\"hidden\";};EA.Ä.close_all_inline_popup=Ã(e){for(var i=0;i<Á.inlinePopup.Æ;i++){Á.close_inline_popup(Á.inlinePopup[i][\"popup_id\"]);}Á.Â.focus();};EA.Ä.show_help=Ã(){Á.open_inline_popup(\"edit_area_help\");};EA.Ä.new_document=Ã(){Á.Â.Ê=\"\";Á.area_select(0,0);};EA.Ä.get_all_toolbar_height=Ã(){var area=_$(\"editor\");var results=È.getChildren(area,\"div\",\"class\",\"area_toolbar\",\"all\",\"0\");var height=0;for(var i=0;i<results.Æ;i++){height+=results[i].offsetHeight;}return height;};EA.Ä.go_to_line=Ã(line){if(!line){var icon=_$(\"go_to_line\");if(icon !=null){Á.restoreClass(icon);Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);}line=prompt(Á.get_translation(\"go_to_line_prompt\"));if(icon !=null)Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);}if(line&&line!=null&&line.search(/^[0-9]+$/)!=-1){var start=0;var lines=Á.Â.Ê.split(\"\\n\");if(line > lines.Æ)start=Á.Â.Ê.Æ;\nelse{for(var i=0;i<Math.min(line-1,lines.Æ);i++)start+=lines[i].Æ+1;}Á.area_select(start,0);}};EA.Ä.change_smooth_selection_mode=Ã(setTo){if(Á.do_highlight)return;if(setTo !=null){if(setTo===Ì)Á.smooth_selection=Ë;\nelse Á.smooth_selection=Ì;}var icon=_$(\"change_smooth_selection\");Á.Â.focus();if(Á.smooth_selection===Ë){Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);Á.smooth_selection=Ì;Á.selection_field.Ç.display=\"none\";_$(\"cursor_pos\").Ç.display=\"none\";_$(\"end_bracket\").Ç.display=\"none\";}\nelse{Á.switchClassSticky(icon,'editAreaButtonSelected',Ì);Á.smooth_selection=Ë;Á.selection_field.Ç.display=\"block\";_$(\"cursor_pos\").Ç.display=\"block\";_$(\"end_bracket\").Ç.display=\"block\";}};EA.Ä.scroll_to_view=Ã(show){var zone,lineElem;if(!Á.smooth_selection)return;zone=_$(\"result\");var cursor_pos_top=_$(\"cursor_pos\").cursor_top;if(show==\"bottom\"){cursor_pos_top+=Á.getLinePosTop(Á.É['line_start']+Á.É['line_nb']-1);}var max_height_visible=zone.clientHeight+zone.scrollTop;var miss_top=cursor_pos_top+Á.lineHeight-max_height_visible;if(miss_top>0){zone.scrollTop=zone.scrollTop+miss_top;}\nelse if(zone.scrollTop > cursor_pos_top){zone.scrollTop=cursor_pos_top;}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;}\nelse if(zone.scrollLeft > cursor_pos_left){zone.scrollLeft=cursor_pos_left;}\nelse if(zone.scrollLeft==45){zone.scrollLeft=0;}};EA.Ä.check_undo=Ã(only_once){if(!eAs[Á.id])return Ì;if(Á.ÂFocused&&eAs[Á.id][\"displayed\"]==Ë){var text=Á.Â.Ê;if(Á.previous.Æ<=1)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonDisabled',Ë);if(!Á.previous[Á.previous.Æ-1]||Á.previous[Á.previous.Æ-1][\"text\"] !=text){Á.previous.push({\"text\":text,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});if(Á.previous.Æ > Á.Å[\"max_undo\"]+1)Á.previous.shift();}if(Á.previous.Æ >=2)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);}if(!only_once)setTimeout(\"eA.check_undo()\",3000);};EA.Ä.undo=Ã(){if(Á.previous.Æ > 0){Á.getIESelection();Á.next.push({\"text\":Á.Â.Ê,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});var prev=Á.previous.pop();if(prev[\"text\"]==Á.Â.Ê&&Á.previous.Æ > 0)prev=Á.previous.pop();Á.Â.Ê=prev[\"text\"];Á.last_undo=prev[\"text\"];Á.area_select(prev[\"selStart\"],prev[\"selEnd\"]-prev[\"selStart\"]);Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}};EA.Ä.redo=Ã(){if(Á.next.Æ > 0){var next=Á.next.pop();Á.previous.push(next);Á.Â.Ê=next[\"text\"];Á.last_undo=next[\"text\"];Á.area_select(next[\"selStart\"],next[\"selEnd\"]-next[\"selStart\"]);Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}if(Á.next.Æ==0)Á.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);};EA.Ä.check_redo=Ã(){if(eA.next.Æ==0||eA.Â.Ê!=eA.last_undo){eA.next=[];eA.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);}\nelse{Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);}};EA.Ä.switchClass=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&element !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.oldClassName=element.className;element.className=class_name;}};EA.Ä.restoreAndSwitchClass=Ã(element,class_name){if(element !=null&&!element.classLock){Á.restoreClass(element);Á.switchClass(element,class_name);}};EA.Ä.restoreClass=Ã(element){if(element !=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}};EA.Ä.setClassLock=Ã(element,lock_state){if(element !=null)element.classLock=lock_state;};EA.Ä.switchClassSticky=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&element !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.className=class_name;element.oldClassName=class_name;}};EA.Ä.scroll_page=Ã(params){var dir=params[\"dir\"],shift_pressed=params[\"shift\"];var lines=Á.Â.Ê.split(\"\\n\");var new_pos=0,Æ=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 / Á.lineHeight);for(i=Á.É[\"line_start\"];i-diff > Á.É[\"line_start\"]-nbLineToScroll;i--){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"up\"){for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_pressed)Æ=Á.É[\"selectionEnd\"]-new_pos-char_left;Á.area_select(new_pos+char_left,Æ);view=\"top\";}\nelse{view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-1-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_pressed){start=Math.min(Á.É[\"selectionStart\"],new_pos+char_left);Æ=Math.max(new_pos+char_left,Á.É[\"selectionStart\"])-start;if(new_pos+char_left < Á.É[\"selectionStart\"])view=\"top\";}\nelse start=new_pos+char_left;Á.area_select(start,Æ);}}\nelse{var nbLineToScroll=Math.floor(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i+diff < Á.É[\"line_start\"]+nbLineToScroll;i++){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"down\"){view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-2+nbLineToScroll,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionStart\"]-new_pos);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]);Á.area_select(Math.min(Á.É[\"selectionStart\"],new_pos),Æ);}\nelse{Á.area_select(new_pos+char_left,0);}}\nelse{view=\"top\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+nbLineToScroll-1,lines.Æ,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionEnd\"]-new_pos-char_left);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"])-char_left-1;Á.area_select(Math.min(Á.É[\"selectionEnd\"],new_pos+char_left),Æ);if(new_pos+char_left > Á.É[\"selectionEnd\"])view=\"bottom\";}\nelse{Á.area_select(new_pos+char_left,0);}}}Á.check_line_selection();Á.scroll_to_view(view);};EA.Ä.start_resize=Ã(e){È.eAL.resize[\"id\"]=eA.id;È.eAL.resize[\"start_x\"]=(e)? e.pageX:event.x+document.body.scrollLeft;È.eAL.resize[\"start_y\"]=(e)? e.pageY:event.y+document.body.scrollTop;if(eA.isIE){eA.Â.focus();eA.getIESelection();}È.eAL.resize[\"selectionStart\"]=eA.Â.selectionStart;È.eAL.resize[\"selectionEnd\"]=eA.Â.selectionEnd;È.eAL.start_resize_area();};EA.Ä.toggle_full_screen=Ã(to){var t=Á,p=È,a=t.Â,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.Â.selectionStart;selEnd=t.Â.selectionEnd;html=p.document.getElementsByTagName(\"html\")[0];frame=p.document.getElementById(\"frame_\"+t.id);if(to&&to!=old){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.Ç.height=\"100%\";html.Ç.width=\"100%\";}html.Ç.overflow=\"hidden\";html.scrollTop=0;html.scrollLeft=0;frame.Ç.position=\"absolute\";frame.Ç.width=html.clientWidth+\"px\";frame.Ç.height=html.clientHeight+\"px\";frame.Ç.display=\"block\";frame.Ç.zIndex=\"999999\";frame.Ç.top=\"0px\";frame.Ç.left=\"0px\";frame.Ç.top=\"-\"+p.calculeOffsetTop(frame)+\"px\";frame.Ç.left=\"-\"+p.calculeOffsetLeft(frame)+\"px\";t.switchClassSticky(icon,'editAreaButtonSelected',Ì);t.fullscreen['allow_resize']=t.resize_allowed;t.allow_resize(Ì);if(t.isFirefox){p.eAL.execCommand(t.id,\"update_size();\");t.area_select(selStart,selEnd-selStart);t.scroll_to_view();t.focus();}\nelse{setTimeout(\"È.eAL.execCommand('\"+t.id+\"','update_size();');eA.focus();\",10);}}\nelse if(to!=old){frame.Ç.position=\"static\";frame.Ç.zIndex=t.fullscreen['old_zIndex'];if(t.isOpera){html.Ç.height=\"auto\";html.Ç.width=\"auto\";html.Ç.overflow=\"auto\";}\nelse if(t.isIE&&p!=top){html.Ç.overflow=\"auto\";}\nelse{html.Ç.overflow=t.fullscreen['old_overflow'];}html.scrollTop=t.fullscreen['old_scrollTop'];html.scrollLeft=t.fullscreen['old_scrollLeft'];p.eAL.hide(t.id);p.eAL.show(t.id);t.switchClassSticky(icon,'editAreaButtonNormal',Ì);if(t.fullscreen['allow_resize'])t.allow_resize(t.fullscreen['allow_resize']);if(t.isFirefox){t.area_select(selStart,selEnd-selStart);setTimeout(\"eA.scroll_to_view();\",10);}}};EA.Ä.allow_resize=Ã(allow){var resize=_$(\"resize_area\");if(allow){resize.Ç.visibility=\"visible\";È.eAL.add_event(resize,\"mouseup\",eA.start_resize);}\nelse{resize.Ç.visibility=\"hidden\";È.eAL.remove_event(resize,\"mouseup\",eA.start_resize);}Á.resize_allowed=allow;};EA.Ä.change_syntax=Ã(new_syntax,is_waiting){if(new_syntax==Á.Å['syntax'])return Ë;var founded=Ì;for(var i=0;i<Á.syntax_list.Æ;i++){if(Á.syntax_list[i]==new_syntax)founded=Ë;}if(founded==Ë){if(!È.eAL.load_syntax[new_syntax]){if(!is_waiting)È.eAL.load_script(È.eAL.baseURL+\"reg_syntax/\"+new_syntax+\".js\");setTimeout(\"eA.change_syntax('\"+new_syntax+\"',Ë);\",100);Á.show_waiting_screen();}\nelse{if(!Á.allready_used_syntax[new_syntax]){È.eAL.init_syntax_regexp();Á.add_Ç(È.eAL.syntax[new_syntax][\"Çs\"]);Á.allready_used_syntax[new_syntax]=Ë;}var sel=_$(\"syntax_selection\");if(sel&&sel.Ê!=new_syntax){for(var i=0;i<sel.Æ;i++){if(sel.options[i].Ê&&sel.options[i].Ê==new_syntax)sel.options[i].selected=Ë;}}Á.Å['syntax']=new_syntax;Á.resync_highlight(Ë);Á.hide_waiting_screen();return Ë;}}return Ì;};EA.Ä.set_editable=Ã(is_editable){if(is_editable){document.body.className=\"\";Á.Â.readOnly=Ì;Á.is_editable=Ë;}\nelse{document.body.className=\"non_editable\";Á.Â.readOnly=Ë;Á.is_editable=Ì;}if(eAs[Á.id][\"displayed\"]==Ë)Á.update_size();};EA.Ä.toggle_word_wrap=Ã(){Á.set_word_wrap(!Á.Å['word_wrap']);};EA.Ä.set_word_wrap=Ã(to){var t=Á,a=t.Â;if(t.isOpera&&t.isOpera < 9.8){Á.Å['word_wrap']=Ì;t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonDisabled',Ë);return Ì;}if(to){wrap_mode='soft';Á.container.className+=' word_wrap';Á.container.Ç.width=\"\";Á.content_highlight.Ç.width=\"\";a.Ç.width=\"100%\";if(t.isIE&&t.isIE < 7){a.Ç.width=(a.offsetWidth-5)+\"px\";}t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonSelected',Ì);}\nelse{wrap_mode='off';Á.container.className=Á.container.className.replace(/word_wrap/g,'');t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonNormal',Ë);}Á.Â.previous_scrollWidth='';Á.Â.previous_scrollHeight='';a.wrap=wrap_mode;a.setAttribute('wrap',wrap_mode);if(!Á.isIE){var start=a.selectionStart,end=a.selectionEnd;var parNod=a.ÈNode,nxtSib=a.nextSibling;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);Á.area_select(start,end-start);}Á.Å['word_wrap']=to;Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.open_file=Ã(Å){if(Å['id']!=\"undefined\"){var id=Å['id'];var new_file={};new_file['id']=id;new_file['title']=id;new_file['text']=\"\";new_file['É']=\"\";new_file['last_text_to_highlight']=\"\";new_file['last_hightlighted_text']=\"\";new_file['previous']=[];new_file['next']=[];new_file['last_undo']=\"\";new_file['smooth_selection']=Á.Å['smooth_selection'];new_file['do_highlight']=Á.Å['start_highlight'];new_file['syntax']=Á.Å['syntax'];new_file['scroll_top']=0;new_file['scroll_left']=0;new_file['selection_start']=0;new_file['selection_end']=0;new_file['edited']=Ì;new_file['font_size']=Á.Å[\"font_size\"];new_file['font_family']=Á.Å[\"font_family\"];new_file['word_wrap']=Á.Å[\"word_wrap\"];new_file['toolbar']={'links':{},'selects':{}};new_file['compare_edited_text']=new_file['text'];Á.files[id]=new_file;Á.update_file(id,Å);Á.files[id]['compare_edited_text']=Á.files[id]['text'];var html_id='tab_file_'+encodeURIComponent(id);Á.filesIdAssoc[html_id]=id;Á.files[id]['html_id']=html_id;if(!_$(Á.files[id]['html_id'])&&id!=\"\"){Á.tab_browsing_area.Ç.display=\"block\";var elem=document.createElement('li');elem.id=Á.files[id]['html_id'];var close=\"<img src=\\\"\"+È.eAL.baseURL+\"images/close.gif\\\" title=\\\"\"+Á.get_translation('close_tab','word')+\"\\\" onclick=\\\"eA.execCommand('close_file',eA.filesIdAssoc['\"+html_id+\"']);return Ì;\\\" class=\\\"hidden\\\" onmouseover=\\\"Á.className=''\\\" onmouseout=\\\"Á.className='hidden'\\\" />\";elem.innerHTML=\"<a onclick=\\\"javascript:eA.execCommand('switch_to_file',eA.filesIdAssoc['\"+html_id+\"']);\\\" selec=\\\"none\\\"><b><span><strong class=\\\"edited\\\">*</strong>\"+Á.files[id]['title']+close+\"</span></b></a>\";_$('tab_browsing_list').appendChild(elem);var elem=document.createElement('text');Á.update_size();}if(id!=\"\")Á.execCommand('file_open',Á.files[id]);Á.switch_to_file(id,Ë);return Ë;}\nelse return Ì;};EA.Ä.close_file=Ã(id){if(Á.files[id]){Á.save_file(id);if(Á.execCommand('file_close',Á.files[id])!==Ì){var li=_$(Á.files[id]['html_id']);li.ÈNode.removeChild(li);if(id==Á.curr_file){var next_file=\"\";var is_next=Ì;for(var i in Á.files){if(is_next){next_file=i;break;}\nelse if(i==id)is_next=Ë;\nelse next_file=i;}Á.switch_to_file(next_file);}delete(Á.files[id]);Á.update_size();}}};EA.Ä.save_file=Ã(id){var t=Á,save,a_links,a_selects,save_butt,img,i;if(t.files[id]){var save=t.files[id];save['É']=t.É;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.Å['syntax'];save['text']=t.Â.Ê;save['scroll_top']=t.result.scrollTop;save['scroll_left']=t.result.scrollLeft;save['selection_start']=t.É[\"selectionStart\"];save['selection_end']=t.É[\"selectionEnd\"];save['font_size']=t.Å[\"font_size\"];save['font_family']=t.Å[\"font_family\"];save['word_wrap']=t.Å[\"word_wrap\"];save['toolbar']={'links':{},'selects':{}};a_links=_$(\"toolbar_1\").getElementsByTagName(\"a\");for(i=0;i<a_links.Æ;i++){if(a_links[i].getAttribute('fileSpecific')=='yes'){save_butt={};img=a_links[i].getElementsByTagName('img')[0];save_butt['classLock']=img.classLock;save_butt['className']=img.className;save_butt['oldClassName']=img.oldClassName;save['toolbar']['links'][a_links[i].id]=save_butt;}}a_selects=_$(\"toolbar_1\").getElementsByTagName(\"select\");for(i=0;i<a_selects.Æ;i++){if(a_selects[i].getAttribute('fileSpecific')=='yes'){save['toolbar']['selects'][a_selects[i].id]=a_selects[i].Ê;}}t.files[id]=save;return save;}return Ì;};EA.Ä.update_file=Ã(id,new_Ês){for(var i in new_Ês){Á.files[id][i]=new_Ês[i];}};EA.Ä.display_file=Ã(id){var t=Á,a=t.Â,new_file,a_lis,a_selects,a_links,a_options,i,j;if(id==''){a.readOnly=Ë;t.tab_browsing_area.Ç.display=\"none\";_$(\"no_file_selected\").Ç.display=\"block\";t.result.className=\"empty\";if(!t.files['']){t.open_file({id:''});}}\nelse if(typeof(t.files[id])=='undefined'){return Ì;}\nelse{t.result.className=\"\";a.readOnly=!t.is_editable;_$(\"no_file_selected\").Ç.display=\"none\";t.tab_browsing_area.Ç.display=\"block\";}t.check_redo(Ë);t.check_undo(Ë);t.curr_file=id;a_lis=t.tab_browsing_area.getElementsByTagName('li');for(i=0;i<a_lis.Æ;i++){if(a_lis[i].id==t.files[id]['html_id'])a_lis[i].className='selected';\nelse a_lis[i].className='';}new_file=t.files[id];a.Ê=new_file['text'];t.set_font(new_file['font_family'],new_file['font_size']);t.area_select(new_file['selection_start'],new_file['selection_end']-new_file['selection_start']);t.manage_size(Ë);t.result.scrollTop=new_file['scroll_top'];t.result.scrollLeft=new_file['scroll_left'];t.previous=new_file['previous'];t.next=new_file['next'];t.last_undo=new_file['last_undo'];t.check_redo(Ë);t.check_undo(Ë);t.execCommand(\"change_highlight\",new_file['do_highlight']);t.execCommand(\"change_syntax\",new_file['syntax']);t.execCommand(\"change_smooth_selection_mode\",new_file['smooth_selection']);t.execCommand(\"set_word_wrap\",new_file['word_wrap']);a_links=new_file['toolbar']['links'];for(i in a_links){if(img=_$(i).getElementsByTagName('img')[0]){img.classLock=a_links[i]['classLock'];img.className=a_links[i]['className'];img.oldClassName=a_links[i]['oldClassName'];}}a_selects=new_file['toolbar']['selects'];for(i in a_selects){a_options=_$(i).options;for(j=0;j<a_options.Æ;j++){if(a_options[j].Ê==a_selects[i])_$(i).options[j].selected=Ë;}}};EA.Ä.switch_to_file=Ã(file_to_show,force_refresh){if(file_to_show!=Á.curr_file||force_refresh){Á.save_file(Á.curr_file);if(Á.curr_file!='')Á.execCommand('file_switch_off',Á.files[Á.curr_file]);Á.display_file(file_to_show);if(file_to_show!='')Á.execCommand('file_switch_on',Á.files[file_to_show]);}};EA.Ä.get_file=Ã(id){if(id==Á.curr_file)Á.save_file(id);return Á.files[id];};EA.Ä.get_all_files=Ã(){tmp_files=Á.files;Á.save_file(Á.curr_file);if(tmp_files[''])delete(Á.files['']);return tmp_files;};EA.Ä.check_file_changes=Ã(){var id=Á.curr_file;if(Á.files[id]&&Á.files[id]['compare_edited_text']!=undefined){if(Á.files[id]['compare_edited_text'].Æ==Á.Â.Ê.Æ&&Á.files[id]['compare_edited_text']==Á.Â.Ê){if(Á.files[id]['edited']!=Ì)Á.set_file_edited_mode(id,Ì);}\nelse{if(Á.files[id]['edited']!=Ë)Á.set_file_edited_mode(id,Ë);}}};EA.Ä.set_file_edited_mode=Ã(id,to){if(Á.files[id]&&_$(Á.files[id]['html_id'])){var link=_$(Á.files[id]['html_id']).getElementsByTagName('a')[0];if(to==Ë){link.className='edited';}\nelse{link.className='';if(id==Á.curr_file)text=Á.Â.Ê;\nelse text=Á.files[id]['text'];Á.files[id]['compare_edited_text']=text;}Á.files[id]['edited']=to;}};EA.Ä.set_show_line_colors=Ã(new_Ê){Á.show_line_colors=new_Ê;if(new_Ê)Á.selection_field.className+=' show_colors';\nelse Á.selection_field.className=Á.selection_field.className.replace(/ show_colors/g,'');};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\"};Ã keyDown(e){if(!e){e=event;}for(var i in eA.plugins){if(typeof(eA.plugins[i].onkeydown)==\"Ã\"){if(eA.plugins[i].onkeydown(e)===Ì){if(eA.isIE)e.keyCode=0;return Ì;}}}var target_id=(e.target||e.srcElement).id;var use=Ì;if(EA_keys[e.keyCode])letter=EA_keys[e.keyCode];\nelse letter=String.fromCharCode(e.keyCode);var low_letter=letter.toLowerCase();if(letter==\"Page up\"&&!AltPressed(e)&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"up\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(letter==\"Page down\"&&!AltPressed(e)&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"down\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(eA.is_editable==Ì){return Ë;}\nelse if(letter==\"Tabulation\"&&target_id==\"Â\"&&!CtrlPressed(e)&&!AltPressed(e)){if(ShiftPressed(e))eA.execCommand(\"invert_tab_selection\");\nelse eA.execCommand(\"tab_selection\");use=Ë;if(eA.isOpera||(eA.isFirefox&&eA.isMac))setTimeout(\"eA.execCommand('focus');\",1);}\nelse if(letter==\"Entrer\"&&target_id==\"Â\"){if(eA.press_enter())use=Ë;}\nelse if(letter==\"Entrer\"&&target_id==\"area_search\"){eA.execCommand(\"area_search\");use=Ë;}\nelse if(letter==\"Esc\"){eA.execCommand(\"close_all_inline_popup\",e);use=Ë;}\nelse if(CtrlPressed(e)&&!AltPressed(e)&&!ShiftPressed(e)){switch(low_letter){case \"f\":eA.execCommand(\"area_search\");use=Ë;break;case \"r\":eA.execCommand(\"area_replace\");use=Ë;break;case \"q\":eA.execCommand(\"close_all_inline_popup\",e);use=Ë;break;case \"h\":eA.execCommand(\"change_highlight\");use=Ë;break;case \"g\":setTimeout(\"eA.execCommand('go_to_line');\",5);use=Ë;break;case \"e\":eA.execCommand(\"show_help\");use=Ë;break;case \"z\":use=Ë;eA.execCommand(\"undo\");break;case \"y\":use=Ë;eA.execCommand(\"redo\");break;default:break;}}if(eA.next.Æ > 0){setTimeout(\"eA.check_redo();\",10);}setTimeout(\"eA.check_file_changes();\",10);if(use){if(eA.isIE)e.keyCode=0;return Ì;}return Ë;};Ã AltPressed(e){if(window.event){return(window.event.altKey);}\nelse{if(e.modifiers)return(e.altKey||(e.modifiers % 2));\nelse return e.altKey;}};Ã CtrlPressed(e){if(window.event){return(window.event.ctrlKey);}\nelse{return(e.ctrlKey||(e.modifiers==2)||(e.modifiers==3)||(e.modifiers>5));}};Ã ShiftPressed(e){if(window.event){return(window.event.shiftKey);}\nelse{return(e.shiftKey||(e.modifiers>3));}}; EA.Ä.show_search=Ã(){if(_$(\"area_search_replace\").Ç.visibility==\"visible\"){Á.hidden_search();}\nelse{Á.open_inline_popup(\"area_search_replace\");var text=Á.area_get_selection();var search=text.split(\"\\n\")[0];_$(\"area_search\").Ê=search;_$(\"area_search\").focus();}};EA.Ä.hidden_search=Ã(){Á.close_inline_popup(\"area_search_replace\");};EA.Ä.area_search=Ã(mode){if(!mode)mode=\"search\";_$(\"area_search_msg\").innerHTML=\"\";var search=_$(\"area_search\").Ê;Á.Â.focus();Á.Â.ÂFocused=Ë;var infos=Á.get_selection_infos();var start=infos[\"selectionStart\"];var pos=-1;var pos_begin=-1;var Æ=search.Æ;if(_$(\"area_search_replace\").Ç.visibility!=\"visible\"){Á.show_search();return;}if(search.Æ==0){_$(\"area_search_msg\").innerHTML=Á.get_translation(\"search_field_empty\");return;}if(mode!=\"replace\"){if(_$(\"area_search_reg_exp\").checked)start++;\nelse start+=search.Æ;}if(_$(\"area_search_reg_exp\").checked){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;Æ=infos[\"full_text\"].substr(start).match(reg)[0].Æ;}\nelse if(pos_begin!=-1){Æ=infos[\"full_text\"].match(reg)[0].Æ;}}\nelse{if(_$(\"area_search_match_case\").checked){pos=infos[\"full_text\"].indexOf(search,start);pos_begin=infos[\"full_text\"].indexOf(search);}\nelse{pos=infos[\"full_text\"].toLowerCase().indexOf(search.toLowerCase(),start);pos_begin=infos[\"full_text\"].toLowerCase().indexOf(search.toLowerCase());}}if(pos==-1&&pos_begin==-1){_$(\"area_search_msg\").innerHTML=\"<strong>\"+search+\"</strong> \"+Á.get_translation(\"not_found\");return;}\nelse if(pos==-1&&pos_begin !=-1){begin=pos_begin;_$(\"area_search_msg\").innerHTML=Á.get_translation(\"restart_search_at_begin\");}\nelse begin=pos;if(mode==\"replace\"&&pos==infos[\"indexOfCursor\"]){var replace=_$(\"area_replace\").Ê;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);}\nelse{new_text=infos[\"full_text\"].substr(0,begin)+replace+infos[\"full_text\"].substr(begin+Æ);}Á.Â.Ê=new_text;Á.area_select(begin,Æ);Á.area_search();}\nelse Á.area_select(begin,Æ);};EA.Ä.area_replace=Ã(){Á.area_search(\"replace\");};EA.Ä.area_replace_all=Ã(){var base_text=Á.Â.Ê;var search=_$(\"area_search\").Ê;var replace=_$(\"area_replace\").Ê;if(search.Æ==0){_$(\"area_search_msg\").innerHTML=Á.get_translation(\"search_field_empty\");return;}var new_text=\"\";var nb_change=0;if(_$(\"area_search_reg_exp\").checked){var opt=\"mg\";if(!_$(\"area_search_match_case\").checked)opt+=\"i\";var reg=new RegExp(search,opt);nb_change=infos[\"full_text\"].match(reg).Æ;new_text=infos[\"full_text\"].replace(reg,replace);}\nelse{if(_$(\"area_search_match_case\").checked){var tmp_tab=base_text.split(search);nb_change=tmp_tab.Æ-1;new_text=tmp_tab.join(replace);}\nelse{var lower_Ê=base_text.toLowerCase();var lower_search=search.toLowerCase();var start=0;var pos=lower_Ê.indexOf(lower_search);while(pos!=-1){nb_change++;new_text+=Á.Â.Ê.substring(start,pos)+replace;start=pos+search.Æ;pos=lower_Ê.indexOf(lower_search,pos+1);}new_text+=Á.Â.Ê.substring(start);}}if(new_text==base_text){_$(\"area_search_msg\").innerHTML=\"<strong>\"+search+\"</strong> \"+Á.get_translation(\"not_found\");}\nelse{Á.Â.Ê=new_text;_$(\"area_search_msg\").innerHTML=\"<strong>\"+nb_change+\"</strong> \"+Á.get_translation(\"occurrence_replaced\");setTimeout(\"eA.Â.focus();eA.Â.ÂFocused=Ë;\",100);}}; EA.Ä.change_highlight=Ã(change_to){if(Á.Å[\"syntax\"].Æ==0&&change_to==Ì){Á.switchClassSticky(_$(\"highlight\"),'editAreaButtonDisabled',Ë);Á.switchClassSticky(_$(\"reset_highlight\"),'editAreaButtonDisabled',Ë);return Ì;}if(Á.do_highlight==change_to)return Ì;Á.getIESelection();var pos_start=Á.Â.selectionStart;var pos_end=Á.Â.selectionEnd;if(Á.do_highlight===Ë||change_to==Ì)Á.disable_highlight();\nelse Á.enable_highlight();Á.Â.focus();Á.Â.selectionStart=pos_start;Á.Â.selectionEnd=pos_end;Á.setIESelection();};EA.Ä.disable_highlight=Ã(displayOnly){var t=Á,a=t.Â,new_Obj,old_class,new_class;t.selection_field.innerHTML=\"\";t.selection_field_text.innerHTML=\"\";t.content_highlight.Ç.visibility=\"hidden\";new_Obj=t.content_highlight.cloneNode(Ì);new_Obj.innerHTML=\"\";t.content_highlight.ÈNode.insertBefore(new_Obj,t.content_highlight);t.content_highlight.ÈNode.removeChild(t.content_highlight);t.content_highlight=new_Obj;old_class=È.getAttribute(a,\"class\");if(old_class){new_class=old_class.replace(\"hidden\",\"\");È.setAttribute(a,\"class\",new_class);}a.Ç.backgroundColor=\"transÈ\";t.switchClassSticky(_$(\"highlight\"),'editAreaButtonNormal',Ë);t.switchClassSticky(_$(\"reset_highlight\"),'editAreaButtonDisabled',Ë);t.do_highlight=Ì;t.switchClassSticky(_$(\"change_smooth_selection\"),'editAreaButtonSelected',Ë);if(typeof(t.smooth_selection_before_highlight)!=\"undefined\"&&t.smooth_selection_before_highlight===Ì){t.change_smooth_selection_mode(Ì);}};EA.Ä.enable_highlight=Ã(){var t=Á,a=t.Â,new_class;t.show_waiting_screen();t.content_highlight.Ç.visibility=\"visible\";new_class=È.getAttribute(a,\"class\")+\" hidden\";È.setAttribute(a,\"class\",new_class);if(t.isIE)a.Ç.backgroundColor=\"#FFFFFF\";t.switchClassSticky(_$(\"highlight\"),'editAreaButtonSelected',Ì);t.switchClassSticky(_$(\"reset_highlight\"),'editAreaButtonNormal',Ì);t.smooth_selection_before_highlight=t.smooth_selection;if(!t.smooth_selection)t.change_smooth_selection_mode(Ë);t.switchClassSticky(_$(\"change_smooth_selection\"),'editAreaButtonDisabled',Ë);t.do_highlight=Ë;t.resync_highlight();t.hide_waiting_screen();};EA.Ä.maj_highlight=Ã(infos){var debug_opti=\"\",tps_start=new Date().getTime(),tps_middle_opti=new Date().getTime();var t=Á,hightlighted_text,updated_highlight;var textToHighlight=infos[\"full_text\"],doSyntaxOpti=Ì,doHtmlOpti=Ì,stay_begin=\"\",stay_end=\"\",trace_new,trace_last;if(t.last_text_to_highlight==infos[\"full_text\"]&&t.resync_highlight!==Ë)return;if(t.reload_highlight===Ë){t.reload_highlight=Ì;}\nelse if(textToHighlight.Æ==0){textToHighlight=\"\\n \";}\nelse{changes=t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);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);if(!doSyntaxOpti&&trace_new==\"\\n\"+trace_last&&/^[ \t\s]*\\n[ \t\s]*$/.test(changes.newText.replace(/\\r/g,''))&&changes.lastText==\"\"){doSyntaxOpti=Ë;}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.Æ>0)stay_end=\"\\n\"+stay_end;if(stay_begin.split('<span').Æ !=stay_begin.split('</span').Æ||stay_end.split('<span').Æ !=stay_end.split('</span').Æ){doSyntaxOpti=Ì;stay_end='';stay_begin='';}\nelse{if(stay_begin.Æ==0&&changes.posLastEnd==-1)changes.newTextLine+=\"\\n\";textToHighlight=changes.newTextLine;}}if(t.Å[\"debug\"]){var ch=changes;debug_opti=(doSyntaxOpti?\"Optimisation\":\"No optimisation\")+\" start:\"+ch.posStart+\"(\"+ch.lineStart+\")\"+\" end_new:\"+ch.posNewEnd+\"(\"+ch.lineNewEnd+\")\"+\" end_last:\"+ch.posLastEnd+\"(\"+ch.lineLastEnd+\")\"+\"\\nchanged_text:\"+ch.newText+\"=> trace:\"+trace_new+\"\\nchanged_last_text:\"+ch.lastText+\"=> trace:\"+trace_last+\"\\nchanged_line:\"+ch.newTextLine+\"\\nlast_changed_line:\"+ch.lastTextLine+\"\\nstay_begin:\"+stay_begin.slice(-100)+\"\\nstay_end:\"+stay_end.substr(0,100);+\"\\n\";}}tps_end_opti=new Date().getTime();updated_highlight=t.colorize_text(textToHighlight);tpsAfterReg=new Date().getTime();doSyntaxOpti=doHtmlOpti=Ì;if(doSyntaxOpti){try{var replacedBloc,i,nbStart='',nbEnd='',newHtml,ÆOld,ÆNew;replacedBloc=t.last_hightlighted_text.substring(stay_begin.Æ,t.last_hightlighted_text.Æ-stay_end.Æ);ÆOld=replacedBloc.Æ;ÆNew=updated_highlight.Æ;for(i=0;i < ÆOld&&i < ÆNew&&replacedBloc.charAt(i)==updated_highlight.charAt(i);i++){}nbStart=i;for(i=0;i+nbStart < ÆOld&&i+nbStart < ÆNew&&replacedBloc.charAt(ÆOld-i-1)==updated_highlight.charAt(ÆNew-i-1);i++){}nbEnd=i;lastHtml=replacedBloc.substring(nbStart,ÆOld-nbEnd);newHtml=updated_highlight.substring(nbStart,ÆNew-nbEnd);if(newHtml.indexOf('<span')==-1&&newHtml.indexOf('</span')==-1&&lastHtml.indexOf('<span')==-1&&lastHtml.indexOf('</span')==-1){var beginStr,nbOpendedSpan,nbClosedSpan,nbUnchangedChars,span,textNode;doHtmlOpti=Ë;beginStr=t.last_hightlighted_text.substr(0,stay_begin.Æ+nbStart);newHtml=newHtml.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');nbOpendedSpan=beginStr.split('<span').Æ-1;nbClosedSpan=beginStr.split('</span').Æ-1;span=t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];ÈSpan=span;maxStartOffset=maxEndOffset=0;if(nbOpendedSpan==nbClosedSpan){while(ÈSpan.ÈNode !=t.content_highlight&&ÈSpan.ÈNode.tagName !='PRE'){ÈSpan=ÈSpan.ÈNode;}}\nelse{maxStartOffset=maxEndOffset=beginStr.Æ+1;nbClosed=beginStr.substr(Math.max(0,beginStr.lastIndexOf('<span',maxStartOffset-1))).split('</span').Æ-1;while(nbClosed > 0){nbClosed--;ÈSpan=ÈSpan.ÈNode;}while(ÈSpan.ÈNode !=t.content_highlight&&ÈSpan.ÈNode.tagName !='PRE'&&(tmpMaxStartOffset=Math.max(0,beginStr.lastIndexOf('<span',maxStartOffset-1)))<(tmpMaxEndOffset=Math.max(0,beginStr.lastIndexOf('</span',maxEndOffset-1)))){maxStartOffset=tmpMaxStartOffset;maxEndOffset=tmpMaxEndOffset;}}if(ÈSpan.ÈNode==t.content_highlight||ÈSpan.ÈNode.tagName=='PRE'){maxStartOffset=Math.max(0,beginStr.indexOf('<span'));}if(maxStartOffset==beginStr.Æ){nbSubSpanBefore=0;}\nelse{lastEndPos=Math.max(0,beginStr.lastIndexOf('>',maxStartOffset));nbSubSpanBefore=beginStr.substr(lastEndPos).split('<span').Æ-1;}if(nbSubSpanBefore==0){textNode=ÈSpan.firstChild;}\nelse{lastSubSpan=ÈSpan.getElementsByTagName('span')[ nbSubSpanBefore-1 ];while(lastSubSpan.ÈNode !=ÈSpan){lastSubSpan=lastSubSpan.ÈNode;}if(lastSubSpan.nextSibling==null||lastSubSpan.nextSibling.nodeType !=3){textNode=document.createTextNode('');lastSubSpan.ÈNode.insertBefore(textNode,lastSubSpan.nextSibling);}\nelse{textNode=lastSubSpan.nextSibling;}}if((lastIndex=beginStr.lastIndexOf('>'))==-1){nbUnchangedChars=beginStr.Æ;}\nelse{nbUnchangedChars=beginStr.substr(lastIndex+1).replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&').Æ;}if(t.isIE){nbUnchangedChars-=(beginStr.substr(beginStr.Æ-nbUnchangedChars).split(\"\\n\").Æ-1);textNode.replaceData(nbUnchangedChars,lastHtml.replace(/\\n/g,'').Æ,newHtml.replace(/\\n/g,''));}\nelse{textNode.replaceData(nbUnchangedChars,lastHtml.Æ,newHtml);}}}catch(e){doHtmlOpti=Ì;}}tpsAfterOpti2=new Date().getTime();hightlighted_text=stay_begin+updated_highlight+stay_end;if(!doHtmlOpti){var new_Obj=t.content_highlight.cloneNode(Ì);if((t.isIE&&t.isIE < 8)||(t.isOpera&&t.isOpera < 9.6))new_Obj.innerHTML=\"<pre><span class='\"+t.Å[\"syntax\"]+\"'>\"+hightlighted_text+\"</span></pre>\";\nelse new_Obj.innerHTML=\"<span class='\"+t.Å[\"syntax\"]+\"'>\"+hightlighted_text+\"</span>\";t.content_highlight.ÈNode.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.Å[\"debug\"]){t.debug.Ê=\"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;}};EA.Ä.resync_highlight=Ã(reload_now){Á.reload_highlight=Ë;Á.last_text_to_highlight=\"\";Á.focus();if(reload_now)Á.check_line_selection(Ì);}; EA.Ä.comment_or_quote=Ã(){var new_class=\"\",close_tag=\"\",sy,arg,i;sy=È.eAL.syntax[eA.current_code_lang];arg=EA.Ä.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.Æ==0){for(var i in sy[\"comments\"]){if(arg.indexOf(i)==0){new_class=\"comments\";close_tag=sy[\"comments\"][i];}}}if(close_tag==\"\\n\"){return \"µ__\"+new_class+\"__µ\"+arg.replace(/(\\r?\\n)?$/m,\"µ_END_µ$1\");}\nelse{reg=new RegExp(È.eAL.get_escaped_regexp(close_tag)+\"$\",\"m\");if(arg.search(reg)!=-1)return \"µ__\"+new_class+\"__µ\"+arg+\"µ_END_µ\";\nelse return \"µ__\"+new_class+\"__µ\"+arg;}};EA.Ä.get_syntax_trace=Ã(text){if(Á.Å[\"syntax\"].Æ>0&&È.eAL.syntax[Á.Å[\"syntax\"]][\"syntax_trace_regexp\"])return text.replace(È.eAL.syntax[Á.Å[\"syntax\"]][\"syntax_trace_regexp\"],\"$3\");};EA.Ä.colorize_text=Ã(text){text=\" \"+text;if(Á.Å[\"syntax\"].Æ>0)text=Á.apply_syntax(text,Á.Å[\"syntax\"]);return text.substr(1).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/µ_END_µ/g,\"</span>\").replace(/µ__([a-zA-Z0-9]+)__µ/g,\"<span class='$1'>\");};EA.Ä.apply_syntax=Ã(text,lang){var sy;Á.current_code_lang=lang;if(!È.eAL.syntax[lang])return text;sy=È.eAL.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\"]){text=text.replace(sy[\"comment_or_quote_reg_exp\"],Á.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;};var editArea= eA;EditArea=EA;</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');
37
+ editAreaLoader.template= "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" > <head> <title>EditArea</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/> [__CSSRULES__] [__JSCODE__] </head> <body> <div id='editor'> <div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div> <div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div> <div id='result'> <div id='no_file_selected'></div> <div id='container'> <div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div> <div id='end_bracket' class='edit_area_cursor'>&nbsp;</div> <div id='selection_field'></div> <div id='line_number' selec='none'></div> <div id='content_highlight'></div> <div id='test_font_size'></div> <div id='selection_field_text'></div> <textarea id='textarea' wrap='off' onchange='editArea.execCommand(\"onchange\");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'> </textarea> </div> </div> <div class='area_toolbar' id='toolbar_2'> <table class='statusbar' cellspacing='0' cellpadding='0'> <tr> <td class='total' selec='none'>{$position}:</td> <td class='infos' selec='none'> {$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span> </td> <td class='total' selec='none'>{$total}:</td> <td class='infos' selec='none'> {$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span> </td> <td class='resize'> <span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span> </td> </tr> </table> </div> </div> <div id='processing'> <div id='processing_text'> {$processing} </div> </div> <div id='area_search_replace' class='editarea_popup'> <table cellspacing='2' cellpadding='0' style='width: 100%'> <tr> <td selec='none'>{$search}</td> <td><input type='text' id='area_search' /></td> <td id='close_area_search_replace'> <a onclick='Javascript:editArea.execCommand(\"hidden_search\")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br /> </tr><tr> <td selec='none'>{$replace}</td> <td><input type='text' id='area_replace' /></td> <td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,\"area_search_replace\", parent.frames[\"frame_\"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td> </tr> </table> <div class='button'> <input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label> <input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label> <br /> <a onclick='Javascript:editArea.execCommand(\"area_search\")' selec='none'>{$find_next}</a> <a onclick='Javascript:editArea.execCommand(\"area_replace\")' selec='none'>{$replace}</a> <a onclick='Javascript:editArea.execCommand(\"area_replace_all\")' selec='none'>{$replace_all}</a><br /> </div> <div id='area_search_msg' selec='none'></div> </div> <div id='edit_area_help' class='editarea_popup'> <div class='close_popup'> <a onclick='Javascript:editArea.execCommand(\"close_all_inline_popup\")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a> </div> <div><h2>Editarea [__EA_VERSION__]</h2><br /> <h3>{$shortcuts}:</h3> {$tab}: {$add_tab}<br /> {$shift}+{$tab}: {$remove_tab}<br /> {$ctrl}+f: {$search_command}<br /> {$ctrl}+r: {$replace_command}<br /> {$ctrl}+h: {$highlight}<br /> {$ctrl}+g: {$go_to_line}<br /> {$ctrl}+z: {$undo}<br /> {$ctrl}+y: {$redo}<br /> {$ctrl}+e: {$help}<br /> {$ctrl}+q, {$esc}: {$close_popup}<br /> {$accesskey} E: {$toggle}<br /> <br /> <em>{$about_notice}</em> <br /><div class='copyright'>&copy; Christophe Dolivet 2007-2010</div> </div> </div> </body> </html> ";
38
+ editAreaLoader.iframe_css= "<style>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;}#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;}#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;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;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;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;}.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;}div#area_search_replace{}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{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;}#edit_area_help{width:350px;}#edit_area_help div.close_popup{float:right;}.area_toolbar{width:100%;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#resize_area{cursor:nw-resize;visibility:hidden;}.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;}#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;}#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;}#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%;background:#CCC;display:none;z-index:20;position:absolute;}.non_editable #editor{border-width:0 1px;}.non_editable .area_toolbar{display:none;}#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;}</style>";
js/editarea/edit_area_functions.js ADDED
@@ -0,0 +1,1202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //replace tabulation by the good number of white spaces
2
+ EditArea.prototype.replace_tab= function(text){
3
+ return text.replace(/((\n?)([^\t\n]*)\t)/gi, editArea.smartTab); // slower than simple replace...
4
+ };
5
+
6
+ // call by the replace_tab function
7
+ EditArea.prototype.smartTab= function(){
8
+ val=" ";
9
+ 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);
10
+ };
11
+
12
+ EditArea.prototype.show_waiting_screen= function(){
13
+ width = this.editor_area.offsetWidth;
14
+ height = this.editor_area.offsetHeight;
15
+ if( !(this.isIE && this.isIE<6) )
16
+ {
17
+ width -= 2;
18
+ height -= 2;
19
+ }
20
+ this.processing_screen.style.display= "block";
21
+ this.processing_screen.style.width = width+"px";
22
+ this.processing_screen.style.height = height+"px";
23
+ this.waiting_screen_displayed = true;
24
+ };
25
+
26
+ EditArea.prototype.hide_waiting_screen= function(){
27
+ this.processing_screen.style.display="none";
28
+ this.waiting_screen_displayed= false;
29
+ };
30
+
31
+ EditArea.prototype.add_style= function(styles){
32
+ if(styles.length>0){
33
+ newcss = document.createElement("style");
34
+ newcss.type="text/css";
35
+ newcss.media="all";
36
+ if(newcss.styleSheet){ // IE
37
+ newcss.styleSheet.cssText = styles;
38
+ } else { // W3C
39
+ newcss.appendChild(document.createTextNode(styles));
40
+ }
41
+ document.getElementsByTagName("head")[0].appendChild(newcss);
42
+ }
43
+ };
44
+
45
+ EditArea.prototype.set_font= function(family, size){
46
+ var t=this, a=this.textarea, s=this.settings, elem_font, i, elem;
47
+ // list all elements concerned by font changes
48
+ var elems= ["textarea", "content_highlight", "cursor_pos", "end_bracket", "selection_field", "selection_field_text", "line_number"];
49
+
50
+ if(family && family!="")
51
+ s["font_family"]= family;
52
+ if(size && size>0)
53
+ s["font_size"] = size;
54
+ if( t.isOpera && t.isOpera < 9.6 ) // opera<9.6 can't manage non monospace font
55
+ s['font_family']="monospace";
56
+
57
+ // update the select tag
58
+ if( elem_font = _$("area_font_size") )
59
+ {
60
+ for( i = 0; i < elem_font.length; i++ )
61
+ {
62
+ if( elem_font.options[i].value && elem_font.options[i].value == s["font_size"] )
63
+ elem_font.options[i].selected=true;
64
+ }
65
+ }
66
+
67
+ /*
68
+ * 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)
69
+ * => looks like a browser internal random bug as text width can change while content_highlight is updated
70
+ * 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
71
+ *
72
+ * This is an ugly fix
73
+ */
74
+ if( t.isFirefox )
75
+ {
76
+ var nbTry = 3;
77
+ do {
78
+ var div1 = document.createElement( 'div' ), text1 = document.createElement( 'textarea' );
79
+ var styles = {
80
+ width: '40px',
81
+ overflow: 'scroll',
82
+ zIndex: 50,
83
+ visibility: 'hidden',
84
+ fontFamily: s["font_family"],
85
+ fontSize: s["font_size"]+"pt",
86
+ lineHeight: t.lineHeight+"px",
87
+ padding: '0',
88
+ margin: '0',
89
+ border: 'none',
90
+ whiteSpace: 'nowrap'
91
+ };
92
+ var diff, changed = false;
93
+ for( i in styles )
94
+ {
95
+ div1.style[ i ] = styles[i];
96
+ text1.style[ i ] = styles[i];
97
+ }
98
+ // no wrap for this text
99
+ text1.wrap = 'off';
100
+ text1.setAttribute('wrap', 'off');
101
+ t.container.appendChild( div1 );
102
+ t.container.appendChild( text1 );
103
+ // try to make FF to bug
104
+ div1.innerHTML = text1.value = 'azertyuiopqsdfghjklm';
105
+ div1.innerHTML = text1.value = text1.value+'wxcvbn^p*ù$!:;,,';
106
+ diff = text1.scrollWidth - div1.scrollWidth;
107
+
108
+ // firefox return here a diff of 1 px between equals scrollWidth (can't explain)
109
+ if( Math.abs( diff ) >= 2 )
110
+ {
111
+ s["font_size"]++;
112
+ changed = true;
113
+ }
114
+ t.container.removeChild( div1 );
115
+ t.container.removeChild( text1 );
116
+ nbTry--;
117
+ }while( changed && nbTry > 0 );
118
+ }
119
+
120
+
121
+ // calc line height
122
+ elem = t.test_font_size;
123
+ elem.style.fontFamily = ""+s["font_family"];
124
+ elem.style.fontSize = s["font_size"]+"pt";
125
+ elem.innerHTML = "0";
126
+ t.lineHeight = elem.offsetHeight;
127
+
128
+ // update font for all concerned elements
129
+ for( i=0; i<elems.length; i++)
130
+ {
131
+ elem = _$(elems[i]);
132
+ elem.style.fontFamily = s["font_family"];
133
+ elem.style.fontSize = s["font_size"]+"pt";
134
+ elem.style.lineHeight = t.lineHeight+"px";
135
+ }
136
+ // define a css for <pre> tags
137
+ t.add_style("pre{font-family:"+s["font_family"]+"}");
138
+
139
+ // old opera and IE>=8 doesn't update font changes to the textarea
140
+ if( ( t.isOpera && t.isOpera < 9.6 ) || t.isIE >= 8 )
141
+ {
142
+ var parNod = a.parentNode, nxtSib = a.nextSibling, start= a.selectionStart, end= a.selectionEnd;
143
+ parNod.removeChild(a);
144
+ parNod.insertBefore(a, nxtSib);
145
+ t.area_select(start, end-start);
146
+ }
147
+
148
+ // force update of selection field
149
+ this.focus();
150
+ this.update_size();
151
+ this.check_line_selection();
152
+ };
153
+
154
+ EditArea.prototype.change_font_size= function(){
155
+ var size=_$("area_font_size").value;
156
+ if(size>0)
157
+ this.set_font("", size);
158
+ };
159
+
160
+
161
+ EditArea.prototype.open_inline_popup= function(popup_id){
162
+ this.close_all_inline_popup();
163
+ var popup= _$(popup_id);
164
+ var editor= _$("editor");
165
+
166
+ // search matching icon
167
+ for(var i=0; i<this.inlinePopup.length; i++){
168
+ if(this.inlinePopup[i]["popup_id"]==popup_id){
169
+ var icon= _$(this.inlinePopup[i]["icon_id"]);
170
+ if(icon){
171
+ this.switchClassSticky(icon, 'editAreaButtonSelected', true);
172
+ break;
173
+ }
174
+ }
175
+ }
176
+ // check size
177
+ popup.style.height="auto";
178
+ popup.style.overflow= "visible";
179
+
180
+ if(document.body.offsetHeight< popup.offsetHeight){
181
+ popup.style.height= (document.body.offsetHeight-10)+"px";
182
+ popup.style.overflow= "auto";
183
+ }
184
+
185
+ if(!popup.positionned){
186
+ var new_left= editor.offsetWidth /2 - popup.offsetWidth /2;
187
+ var new_top= editor.offsetHeight /2 - popup.offsetHeight /2;
188
+ //var new_top= area.offsetHeight /2 - popup.offsetHeight /2;
189
+ //var new_left= area.offsetWidth /2 - popup.offsetWidth /2;
190
+ //alert("new_top: ("+new_top+") = calculeOffsetTop(area) ("+calculeOffsetTop(area)+") + area.offsetHeight /2("+ area.offsetHeight /2+") - popup.offsetHeight /2("+popup.offsetHeight /2+") - scrollTop: "+document.body.scrollTop);
191
+ popup.style.left= new_left+"px";
192
+ popup.style.top= new_top+"px";
193
+ popup.positionned=true;
194
+ }
195
+ popup.style.visibility="visible";
196
+
197
+ //popup.style.display="block";
198
+ };
199
+
200
+ EditArea.prototype.close_inline_popup= function(popup_id){
201
+ var popup= _$(popup_id);
202
+ // search matching icon
203
+ for(var i=0; i<this.inlinePopup.length; i++){
204
+ if(this.inlinePopup[i]["popup_id"]==popup_id){
205
+ var icon= _$(this.inlinePopup[i]["icon_id"]);
206
+ if(icon){
207
+ this.switchClassSticky(icon, 'editAreaButtonNormal', false);
208
+ break;
209
+ }
210
+ }
211
+ }
212
+
213
+ popup.style.visibility="hidden";
214
+ };
215
+
216
+ EditArea.prototype.close_all_inline_popup= function(e){
217
+ for(var i=0; i<this.inlinePopup.length; i++){
218
+ this.close_inline_popup(this.inlinePopup[i]["popup_id"]);
219
+ }
220
+ this.textarea.focus();
221
+ };
222
+
223
+ EditArea.prototype.show_help= function(){
224
+
225
+ this.open_inline_popup("edit_area_help");
226
+
227
+ };
228
+
229
+ EditArea.prototype.new_document= function(){
230
+ this.textarea.value="";
231
+ this.area_select(0,0);
232
+ };
233
+
234
+ EditArea.prototype.get_all_toolbar_height= function(){
235
+ var area= _$("editor");
236
+ var results= parent.getChildren(area, "div", "class", "area_toolbar", "all", "0"); // search only direct children
237
+ //results= results.concat(getChildren(area, "table", "class", "area_toolbar", "all", "0"));
238
+ var height=0;
239
+ for(var i=0; i<results.length; i++){
240
+ height+= results[i].offsetHeight;
241
+ }
242
+ //alert("toolbar height: "+height);
243
+ return height;
244
+ };
245
+
246
+ EditArea.prototype.go_to_line= function(line){
247
+ if(!line)
248
+ {
249
+ var icon= _$("go_to_line");
250
+ if(icon != null){
251
+ this.restoreClass(icon);
252
+ this.switchClassSticky(icon, 'editAreaButtonSelected', true);
253
+ }
254
+
255
+ line= prompt(this.get_translation("go_to_line_prompt"));
256
+ if(icon != null)
257
+ this.switchClassSticky(icon, 'editAreaButtonNormal', false);
258
+ }
259
+ if(line && line!=null && line.search(/^[0-9]+$/)!=-1){
260
+ var start=0;
261
+ var lines= this.textarea.value.split("\n");
262
+ if(line > lines.length)
263
+ start= this.textarea.value.length;
264
+ else{
265
+ for(var i=0; i<Math.min(line-1, lines.length); i++)
266
+ start+= lines[i].length + 1;
267
+ }
268
+ this.area_select(start, 0);
269
+ }
270
+
271
+
272
+ };
273
+
274
+
275
+ EditArea.prototype.change_smooth_selection_mode= function(setTo){
276
+ //alert("setTo: "+setTo);
277
+ if(this.do_highlight)
278
+ return;
279
+
280
+ if(setTo != null){
281
+ if(setTo === false)
282
+ this.smooth_selection=true;
283
+ else
284
+ this.smooth_selection=false;
285
+ }
286
+ var icon= _$("change_smooth_selection");
287
+ this.textarea.focus();
288
+ if(this.smooth_selection===true){
289
+ //setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
290
+ /*setAttribute(icon, "oldClassName", "editAreaButtonNormal" );
291
+ setAttribute(icon, "className", "editAreaButtonNormal" );*/
292
+ //this.restoreClass(icon);
293
+ //this.restoreAndSwitchClass(icon,'editAreaButtonNormal');
294
+ this.switchClassSticky(icon, 'editAreaButtonNormal', false);
295
+
296
+ this.smooth_selection=false;
297
+ this.selection_field.style.display= "none";
298
+ _$("cursor_pos").style.display= "none";
299
+ _$("end_bracket").style.display= "none";
300
+ }else{
301
+ //setAttribute(icon, "class", getAttribute(icon, "class") + " selected");
302
+ //this.switchClass(icon,'editAreaButtonSelected');
303
+ this.switchClassSticky(icon, 'editAreaButtonSelected', false);
304
+ this.smooth_selection=true;
305
+ this.selection_field.style.display= "block";
306
+ _$("cursor_pos").style.display= "block";
307
+ _$("end_bracket").style.display= "block";
308
+ }
309
+ };
310
+
311
+ // the auto scroll of the textarea has some lacks when it have to show cursor in the visible area when the textarea size change
312
+ // show specifiy whereas it is the "top" or "bottom" of the selection that is showned
313
+ EditArea.prototype.scroll_to_view= function(show){
314
+ var zone, lineElem;
315
+ if(!this.smooth_selection)
316
+ return;
317
+ zone= _$("result");
318
+
319
+ // manage height scroll
320
+ var cursor_pos_top= _$("cursor_pos").cursor_top;
321
+ if(show=="bottom")
322
+ {
323
+ //cursor_pos_top+= (this.last_selection["line_nb"]-1)* this.lineHeight;
324
+ cursor_pos_top+= this.getLinePosTop( this.last_selection['line_start'] + this.last_selection['line_nb'] - 1 );
325
+ }
326
+
327
+ var max_height_visible= zone.clientHeight + zone.scrollTop;
328
+ var miss_top = cursor_pos_top + this.lineHeight - max_height_visible;
329
+ if(miss_top>0){
330
+ //alert(miss_top);
331
+ zone.scrollTop= zone.scrollTop + miss_top;
332
+ }else if( zone.scrollTop > cursor_pos_top){
333
+ // when erase all the content -> does'nt scroll back to the top
334
+ //alert("else: "+cursor_pos_top);
335
+ zone.scrollTop= cursor_pos_top;
336
+ }
337
+
338
+ // manage left scroll
339
+ //var cursor_pos_left= parseInt(_$("cursor_pos").style.left.replace("px",""));
340
+ var cursor_pos_left= _$("cursor_pos").cursor_left;
341
+ var max_width_visible= zone.clientWidth + zone.scrollLeft;
342
+ var miss_left= cursor_pos_left + 10 - max_width_visible;
343
+ if(miss_left>0){
344
+ zone.scrollLeft= zone.scrollLeft + miss_left + 50;
345
+ }else if( zone.scrollLeft > cursor_pos_left){
346
+ zone.scrollLeft= cursor_pos_left ;
347
+ }else if( zone.scrollLeft == 45){
348
+ // show the line numbers if textarea align to it's left
349
+ zone.scrollLeft=0;
350
+ }
351
+ };
352
+
353
+ EditArea.prototype.check_undo= function(only_once){
354
+ if(!editAreas[this.id])
355
+ return false;
356
+ if(this.textareaFocused && editAreas[this.id]["displayed"]==true){
357
+ var text=this.textarea.value;
358
+ if(this.previous.length<=1)
359
+ this.switchClassSticky(_$("undo"), 'editAreaButtonDisabled', true);
360
+
361
+ if(!this.previous[this.previous.length-1] || this.previous[this.previous.length-1]["text"] != text){
362
+ this.previous.push({"text": text, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd});
363
+ if(this.previous.length > this.settings["max_undo"]+1)
364
+ this.previous.shift();
365
+
366
+ }
367
+ if(this.previous.length >= 2)
368
+ this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);
369
+ }
370
+
371
+ if(!only_once)
372
+ setTimeout("editArea.check_undo()", 3000);
373
+ };
374
+
375
+ EditArea.prototype.undo= function(){
376
+ //alert("undo"+this.previous.length);
377
+ if(this.previous.length > 0)
378
+ {
379
+ this.getIESelection();
380
+ // var pos_cursor=this.textarea.selectionStart;
381
+ this.next.push( { "text": this.textarea.value, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd } );
382
+ var prev= this.previous.pop();
383
+ if( prev["text"] == this.textarea.value && this.previous.length > 0 )
384
+ prev =this.previous.pop();
385
+ this.textarea.value = prev["text"];
386
+ this.last_undo = prev["text"];
387
+ this.area_select(prev["selStart"], prev["selEnd"]-prev["selStart"]);
388
+ this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
389
+ this.resync_highlight(true);
390
+ //alert("undo"+this.previous.length);
391
+ this.check_file_changes();
392
+ }
393
+ };
394
+
395
+ EditArea.prototype.redo= function(){
396
+ if(this.next.length > 0)
397
+ {
398
+ /*this.getIESelection();*/
399
+ //var pos_cursor=this.textarea.selectionStart;
400
+ var next= this.next.pop();
401
+ this.previous.push(next);
402
+ this.textarea.value= next["text"];
403
+ this.last_undo= next["text"];
404
+ this.area_select(next["selStart"], next["selEnd"]-next["selStart"]);
405
+ this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);
406
+ this.resync_highlight(true);
407
+ this.check_file_changes();
408
+ }
409
+ if( this.next.length == 0)
410
+ this.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
411
+ };
412
+
413
+ EditArea.prototype.check_redo= function(){
414
+ if(editArea.next.length == 0 || editArea.textarea.value!=editArea.last_undo){
415
+ editArea.next= []; // undo the ability to use "redo" button
416
+ editArea.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
417
+ }
418
+ else
419
+ {
420
+ this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
421
+ }
422
+ };
423
+
424
+
425
+ // functions that manage icons roll over, disabled, etc...
426
+ EditArea.prototype.switchClass = function(element, class_name, lock_state) {
427
+ var lockChanged = false;
428
+
429
+ if (typeof(lock_state) != "undefined" && element != null) {
430
+ element.classLock = lock_state;
431
+ lockChanged = true;
432
+ }
433
+
434
+ if (element != null && (lockChanged || !element.classLock)) {
435
+ element.oldClassName = element.className;
436
+ element.className = class_name;
437
+ }
438
+ };
439
+
440
+ EditArea.prototype.restoreAndSwitchClass = function(element, class_name) {
441
+ if (element != null && !element.classLock) {
442
+ this.restoreClass(element);
443
+ this.switchClass(element, class_name);
444
+ }
445
+ };
446
+
447
+ EditArea.prototype.restoreClass = function(element) {
448
+ if (element != null && element.oldClassName && !element.classLock) {
449
+ element.className = element.oldClassName;
450
+ element.oldClassName = null;
451
+ }
452
+ };
453
+
454
+ EditArea.prototype.setClassLock = function(element, lock_state) {
455
+ if (element != null)
456
+ element.classLock = lock_state;
457
+ };
458
+
459
+ EditArea.prototype.switchClassSticky = function(element, class_name, lock_state) {
460
+ var lockChanged = false;
461
+ if (typeof(lock_state) != "undefined" && element != null) {
462
+ element.classLock = lock_state;
463
+ lockChanged = true;
464
+ }
465
+
466
+ if (element != null && (lockChanged || !element.classLock)) {
467
+ element.className = class_name;
468
+ element.oldClassName = class_name;
469
+ }
470
+ };
471
+
472
+ //make the "page up" and "page down" buttons works correctly
473
+ EditArea.prototype.scroll_page= function(params){
474
+ var dir= params["dir"], shift_pressed= params["shift"];
475
+ var lines= this.textarea.value.split("\n");
476
+ var new_pos=0, length=0, char_left=0, line_nb=0, curLine=0;
477
+ var toScrollAmount = _$("result").clientHeight -30;
478
+ var nbLineToScroll = 0, diff= 0;
479
+
480
+ if(dir=="up"){
481
+ nbLineToScroll = Math.ceil( toScrollAmount / this.lineHeight );
482
+
483
+ // fix number of line to scroll
484
+ for( i = this.last_selection["line_start"]; i - diff > this.last_selection["line_start"] - nbLineToScroll ; i-- )
485
+ {
486
+ if( elem = _$('line_'+ i) )
487
+ {
488
+ diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
489
+ }
490
+ }
491
+ nbLineToScroll -= diff;
492
+
493
+ if(this.last_selection["selec_direction"]=="up"){
494
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]-nbLineToScroll, lines.length); line_nb++){
495
+ new_pos+= lines[line_nb].length + 1;
496
+ }
497
+ char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
498
+ if(shift_pressed)
499
+ length=this.last_selection["selectionEnd"]-new_pos-char_left;
500
+ this.area_select(new_pos+char_left, length);
501
+ view="top";
502
+ }else{
503
+ view="bottom";
504
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-1-nbLineToScroll, lines.length); line_nb++){
505
+ new_pos+= lines[line_nb].length + 1;
506
+ }
507
+ char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
508
+ if(shift_pressed){
509
+ //length=this.last_selection["selectionEnd"]-new_pos-char_left;
510
+ start= Math.min(this.last_selection["selectionStart"], new_pos+char_left);
511
+ length= Math.max(new_pos+char_left, this.last_selection["selectionStart"] )- start ;
512
+ if(new_pos+char_left < this.last_selection["selectionStart"])
513
+ view="top";
514
+ }else
515
+ start=new_pos+char_left;
516
+ this.area_select(start, length);
517
+
518
+ }
519
+ }
520
+ else
521
+ {
522
+ var nbLineToScroll= Math.floor( toScrollAmount / this.lineHeight );
523
+ // fix number of line to scroll
524
+ for( i = this.last_selection["line_start"]; i + diff < this.last_selection["line_start"] + nbLineToScroll ; i++ )
525
+ {
526
+ if( elem = _$('line_'+ i) )
527
+ {
528
+ diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
529
+ }
530
+ }
531
+ nbLineToScroll -= diff;
532
+
533
+ if(this.last_selection["selec_direction"]=="down"){
534
+ view="bottom";
535
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-2+nbLineToScroll, lines.length); line_nb++){
536
+ if(line_nb==this.last_selection["line_start"]-1)
537
+ char_left= this.last_selection["selectionStart"] -new_pos;
538
+ new_pos+= lines[line_nb].length + 1;
539
+
540
+ }
541
+ if(shift_pressed){
542
+ length=Math.abs(this.last_selection["selectionStart"]-new_pos);
543
+ length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]);
544
+ //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
545
+ this.area_select(Math.min(this.last_selection["selectionStart"], new_pos), length);
546
+ }else{
547
+ this.area_select(new_pos+char_left, 0);
548
+ }
549
+
550
+ }else{
551
+ view="top";
552
+ for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+nbLineToScroll-1, lines.length, lines.length); line_nb++){
553
+ if(line_nb==this.last_selection["line_start"]-1)
554
+ char_left= this.last_selection["selectionStart"] -new_pos;
555
+ new_pos+= lines[line_nb].length + 1;
556
+ }
557
+ if(shift_pressed){
558
+ length=Math.abs(this.last_selection["selectionEnd"]-new_pos-char_left);
559
+ length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"])- char_left-1;
560
+ //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
561
+ this.area_select(Math.min(this.last_selection["selectionEnd"], new_pos+char_left), length);
562
+ if(new_pos+char_left > this.last_selection["selectionEnd"])
563
+ view="bottom";
564
+ }else{
565
+ this.area_select(new_pos+char_left, 0);
566
+ }
567
+
568
+ }
569
+ }
570
+ //console.log( new_pos, char_left, length, nbLineToScroll, toScrollAmount, _$("result").clientHeigh );
571
+ this.check_line_selection();
572
+ this.scroll_to_view(view);
573
+ };
574
+
575
+ EditArea.prototype.start_resize= function(e){
576
+ parent.editAreaLoader.resize["id"] = editArea.id;
577
+ parent.editAreaLoader.resize["start_x"] = (e)? e.pageX : event.x + document.body.scrollLeft;
578
+ parent.editAreaLoader.resize["start_y"] = (e)? e.pageY : event.y + document.body.scrollTop;
579
+ if(editArea.isIE)
580
+ {
581
+ editArea.textarea.focus();
582
+ editArea.getIESelection();
583
+ }
584
+ parent.editAreaLoader.resize["selectionStart"] = editArea.textarea.selectionStart;
585
+ parent.editAreaLoader.resize["selectionEnd"] = editArea.textarea.selectionEnd;
586
+ parent.editAreaLoader.start_resize_area();
587
+ };
588
+
589
+ EditArea.prototype.toggle_full_screen= function(to){
590
+ var t=this, p=parent, a=t.textarea, html, frame, selStart, selEnd, old, icon;
591
+ if(typeof(to)=="undefined")
592
+ to= !t.fullscreen['isFull'];
593
+ old = t.fullscreen['isFull'];
594
+ t.fullscreen['isFull']= to;
595
+ icon = _$("fullscreen");
596
+ selStart = t.textarea.selectionStart;
597
+ selEnd = t.textarea.selectionEnd;
598
+ html = p.document.getElementsByTagName("html")[0];
599
+ frame = p.document.getElementById("frame_"+t.id);
600
+
601
+ if(to && to!=old)
602
+ { // toogle on fullscreen
603
+
604
+ t.fullscreen['old_overflow'] = p.get_css_property(html, "overflow");
605
+ t.fullscreen['old_height'] = p.get_css_property(html, "height");
606
+ t.fullscreen['old_width'] = p.get_css_property(html, "width");
607
+ t.fullscreen['old_scrollTop'] = html.scrollTop;
608
+ t.fullscreen['old_scrollLeft'] = html.scrollLeft;
609
+ t.fullscreen['old_zIndex'] = p.get_css_property(frame, "z-index");
610
+ if(t.isOpera){
611
+ html.style.height = "100%";
612
+ html.style.width = "100%";
613
+ }
614
+ html.style.overflow = "hidden";
615
+ html.scrollTop = 0;
616
+ html.scrollLeft = 0;
617
+
618
+ frame.style.position = "absolute";
619
+ frame.style.width = html.clientWidth+"px";
620
+ frame.style.height = html.clientHeight+"px";
621
+ frame.style.display = "block";
622
+ frame.style.zIndex = "999999";
623
+ frame.style.top = "0px";
624
+ frame.style.left = "0px";
625
+
626
+ // if the iframe was in a div with position absolute, the top and left are the one of the div,
627
+ // so I fix it by seeing at witch position the iframe start and correcting it
628
+ frame.style.top = "-"+p.calculeOffsetTop(frame)+"px";
629
+ frame.style.left = "-"+p.calculeOffsetLeft(frame)+"px";
630
+
631
+ // parent.editAreaLoader.execCommand(t.id, "update_size();");
632
+ // var body=parent.document.getElementsByTagName("body")[0];
633
+ // body.appendChild(frame);
634
+
635
+ t.switchClassSticky(icon, 'editAreaButtonSelected', false);
636
+ t.fullscreen['allow_resize']= t.resize_allowed;
637
+ t.allow_resize(false);
638
+
639
+ //t.area_select(selStart, selEnd-selStart);
640
+
641
+
642
+ // opera can't manage to do a direct size update
643
+ if(t.isFirefox){
644
+ p.editAreaLoader.execCommand(t.id, "update_size();");
645
+ t.area_select(selStart, selEnd-selStart);
646
+ t.scroll_to_view();
647
+ t.focus();
648
+ }else{
649
+ setTimeout("parent.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10);
650
+ }
651
+
652
+
653
+ }
654
+ else if(to!=old)
655
+ { // toogle off fullscreen
656
+ frame.style.position="static";
657
+ frame.style.zIndex= t.fullscreen['old_zIndex'];
658
+
659
+ if(t.isOpera)
660
+ {
661
+ html.style.height = "auto";
662
+ html.style.width = "auto";
663
+ html.style.overflow = "auto";
664
+ }
665
+ else if(t.isIE && p!=top)
666
+ { // IE doesn't manage html overflow in frames like in normal page...
667
+ html.style.overflow = "auto";
668
+ }
669
+ else
670
+ {
671
+ html.style.overflow = t.fullscreen['old_overflow'];
672
+ }
673
+ html.scrollTop = t.fullscreen['old_scrollTop'];
674
+ html.scrollLeft = t.fullscreen['old_scrollLeft'];
675
+
676
+ p.editAreaLoader.hide(t.id);
677
+ p.editAreaLoader.show(t.id);
678
+
679
+ t.switchClassSticky(icon, 'editAreaButtonNormal', false);
680
+ if(t.fullscreen['allow_resize'])
681
+ t.allow_resize(t.fullscreen['allow_resize']);
682
+ if(t.isFirefox){
683
+ t.area_select(selStart, selEnd-selStart);
684
+ setTimeout("editArea.scroll_to_view();", 10);
685
+ }
686
+
687
+ //p.editAreaLoader.remove_event(p.window, "resize", editArea.update_size);
688
+ }
689
+
690
+ };
691
+
692
+ EditArea.prototype.allow_resize= function(allow){
693
+ var resize= _$("resize_area");
694
+ if(allow){
695
+
696
+ resize.style.visibility="visible";
697
+ parent.editAreaLoader.add_event(resize, "mouseup", editArea.start_resize);
698
+ }else{
699
+ resize.style.visibility="hidden";
700
+ parent.editAreaLoader.remove_event(resize, "mouseup", editArea.start_resize);
701
+ }
702
+ this.resize_allowed= allow;
703
+ };
704
+
705
+
706
+ EditArea.prototype.change_syntax= function(new_syntax, is_waiting){
707
+ // alert("cahnge to "+new_syntax);
708
+ // the syntax is the same
709
+ if(new_syntax==this.settings['syntax'])
710
+ return true;
711
+
712
+ // check that the syntax is one allowed
713
+ var founded= false;
714
+ for(var i=0; i<this.syntax_list.length; i++)
715
+ {
716
+ if(this.syntax_list[i]==new_syntax)
717
+ founded= true;
718
+ }
719
+
720
+ if(founded==true)
721
+ {
722
+ // the reg syntax file is not loaded
723
+ if(!parent.editAreaLoader.load_syntax[new_syntax])
724
+ {
725
+ // load the syntax file and wait for file loading
726
+ if(!is_waiting)
727
+ parent.editAreaLoader.load_script(parent.editAreaLoader.baseURL + "reg_syntax/" + new_syntax + ".js");
728
+ setTimeout("editArea.change_syntax('"+ new_syntax +"', true);", 100);
729
+ this.show_waiting_screen();
730
+ }
731
+ else
732
+ {
733
+ if(!this.allready_used_syntax[new_syntax])
734
+ { // the syntax has still not been used
735
+ // rebuild syntax definition for new languages
736
+ parent.editAreaLoader.init_syntax_regexp();
737
+ // add style to the new list
738
+ this.add_style(parent.editAreaLoader.syntax[new_syntax]["styles"]);
739
+ this.allready_used_syntax[new_syntax]=true;
740
+ }
741
+ // be sure that the select option is correctly updated
742
+ var sel= _$("syntax_selection");
743
+ if(sel && sel.value!=new_syntax)
744
+ {
745
+ for(var i=0; i<sel.length; i++){
746
+ if(sel.options[i].value && sel.options[i].value == new_syntax)
747
+ sel.options[i].selected=true;
748
+ }
749
+ }
750
+
751
+ /* if(this.settings['syntax'].length==0)
752
+ {
753
+ this.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', false);
754
+ this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
755
+ this.change_highlight(true);
756
+ }
757
+ */
758
+ this.settings['syntax']= new_syntax;
759
+ this.resync_highlight(true);
760
+ this.hide_waiting_screen();
761
+ return true;
762
+ }
763
+ }
764
+ return false;
765
+ };
766
+
767
+
768
+ // check if the file has changed
769
+ EditArea.prototype.set_editable= function(is_editable){
770
+ if(is_editable)
771
+ {
772
+ document.body.className= "";
773
+ this.textarea.readOnly= false;
774
+ this.is_editable= true;
775
+ }
776
+ else
777
+ {
778
+ document.body.className= "non_editable";
779
+ this.textarea.readOnly= true;
780
+ this.is_editable= false;
781
+ }
782
+
783
+ if(editAreas[this.id]["displayed"]==true)
784
+ this.update_size();
785
+ };
786
+
787
+ /***** Wrap mode *****/
788
+
789
+ // toggling function for set_wrap_mode
790
+ EditArea.prototype.toggle_word_wrap= function(){
791
+ this.set_word_wrap( !this.settings['word_wrap'] );
792
+ };
793
+
794
+
795
+ // open a new tab for the given file
796
+ EditArea.prototype.set_word_wrap= function(to){
797
+ var t=this, a= t.textarea;
798
+ if( t.isOpera && t.isOpera < 9.8 )
799
+ {
800
+ this.settings['word_wrap']= false;
801
+ t.switchClassSticky( _$("word_wrap"), 'editAreaButtonDisabled', true );
802
+ return false;
803
+ }
804
+
805
+ if( to )
806
+ {
807
+ wrap_mode = 'soft';
808
+ this.container.className+= ' word_wrap';
809
+ this.container.style.width="";
810
+ this.content_highlight.style.width="";
811
+ a.style.width="100%";
812
+ if( t.isIE && t.isIE < 7 ) // IE 6 count 50 px too much
813
+ {
814
+ a.style.width = ( a.offsetWidth-5 )+"px";
815
+ }
816
+
817
+ t.switchClassSticky( _$("word_wrap"), 'editAreaButtonSelected', false );
818
+ }
819
+ else
820
+ {
821
+ wrap_mode = 'off';
822
+ this.container.className = this.container.className.replace(/word_wrap/g, '');
823
+ t.switchClassSticky( _$("word_wrap"), 'editAreaButtonNormal', true );
824
+ }
825
+ this.textarea.previous_scrollWidth = '';
826
+ this.textarea.previous_scrollHeight = '';
827
+
828
+ a.wrap= wrap_mode;
829
+ a.setAttribute('wrap', wrap_mode);
830
+ // only IE can change wrap mode on the fly without element reloading
831
+ if(!this.isIE)
832
+ {
833
+ var start=a.selectionStart, end= a.selectionEnd;
834
+ var parNod = a.parentNode, nxtSib = a.nextSibling;
835
+ parNod.removeChild(a);
836
+ parNod.insertBefore(a, nxtSib);
837
+ this.area_select(start, end-start);
838
+ }
839
+ // reset some optimisation
840
+ this.settings['word_wrap'] = to;
841
+ this.focus();
842
+ this.update_size();
843
+ this.check_line_selection();
844
+ };
845
+ /***** tabbed files managing functions *****/
846
+
847
+ // open a new tab for the given file
848
+ EditArea.prototype.open_file= function(settings){
849
+
850
+ if(settings['id']!="undefined")
851
+ {
852
+ var id= settings['id'];
853
+ // create a new file object with defautl values
854
+ var new_file= {};
855
+ new_file['id'] = id;
856
+ new_file['title'] = id;
857
+ new_file['text'] = "";
858
+ new_file['last_selection'] = "";
859
+ new_file['last_text_to_highlight'] = "";
860
+ new_file['last_hightlighted_text'] = "";
861
+ new_file['previous'] = [];
862
+ new_file['next'] = [];
863
+ new_file['last_undo'] = "";
864
+ new_file['smooth_selection'] = this.settings['smooth_selection'];
865
+ new_file['do_highlight']= this.settings['start_highlight'];
866
+ new_file['syntax'] = this.settings['syntax'];
867
+ new_file['scroll_top'] = 0;
868
+ new_file['scroll_left'] = 0;
869
+ new_file['selection_start']= 0;
870
+ new_file['selection_end']= 0;
871
+ new_file['edited'] = false;
872
+ new_file['font_size'] = this.settings["font_size"];
873
+ new_file['font_family'] = this.settings["font_family"];
874
+ new_file['word_wrap'] = this.settings["word_wrap"];
875
+ new_file['toolbar'] = {'links':{}, 'selects': {}};
876
+ new_file['compare_edited_text']= new_file['text'];
877
+
878
+
879
+ this.files[id]= new_file;
880
+ this.update_file(id, settings);
881
+ this.files[id]['compare_edited_text']= this.files[id]['text'];
882
+
883
+
884
+ var html_id= 'tab_file_'+encodeURIComponent(id);
885
+ this.filesIdAssoc[html_id]= id;
886
+ this.files[id]['html_id']= html_id;
887
+
888
+ if(!_$(this.files[id]['html_id']) && id!="")
889
+ {
890
+ // be sure the tab browsing area is displayed
891
+ this.tab_browsing_area.style.display= "block";
892
+ var elem= document.createElement('li');
893
+ elem.id= this.files[id]['html_id'];
894
+ var close= "<img src=\""+ parent.editAreaLoader.baseURL +"images/close.gif\" title=\""+ this.get_translation('close_tab', 'word') +"\" onclick=\"editArea.execCommand('close_file', editArea.filesIdAssoc['"+ html_id +"']);return false;\" class=\"hidden\" onmouseover=\"this.className=''\" onmouseout=\"this.className='hidden'\" />";
895
+ elem.innerHTML= "<a onclick=\"javascript:editArea.execCommand('switch_to_file', editArea.filesIdAssoc['"+ html_id +"']);\" selec=\"none\"><b><span><strong class=\"edited\">*</strong>"+ this.files[id]['title'] + close +"</span></b></a>";
896
+ _$('tab_browsing_list').appendChild(elem);
897
+ var elem= document.createElement('text');
898
+ this.update_size();
899
+ }
900
+
901
+ // open file callback (for plugin)
902
+ if(id!="")
903
+ this.execCommand('file_open', this.files[id]);
904
+
905
+ this.switch_to_file(id, true);
906
+ return true;
907
+ }
908
+ else
909
+ return false;
910
+ };
911
+
912
+ // close the given file
913
+ EditArea.prototype.close_file= function(id){
914
+ if(this.files[id])
915
+ {
916
+ this.save_file(id);
917
+
918
+ // close file callback
919
+ if(this.execCommand('file_close', this.files[id])!==false)
920
+ {
921
+ // remove the tab in the toolbar
922
+ var li= _$(this.files[id]['html_id']);
923
+ li.parentNode.removeChild(li);
924
+ // select a new file
925
+ if(id== this.curr_file)
926
+ {
927
+ var next_file= "";
928
+ var is_next= false;
929
+ for(var i in this.files)
930
+ {
931
+ if( is_next )
932
+ {
933
+ next_file = i;
934
+ break;
935
+ }
936
+ else if( i == id )
937
+ is_next = true;
938
+ else
939
+ next_file = i;
940
+ }
941
+ // display the next file
942
+ this.switch_to_file(next_file);
943
+ }
944
+ // clear datas
945
+ delete (this.files[id]);
946
+ this.update_size();
947
+ }
948
+ }
949
+ };
950
+
951
+ // backup current file datas
952
+ EditArea.prototype.save_file= function(id){
953
+ var t= this, save, a_links, a_selects, save_butt, img, i;
954
+ if(t.files[id])
955
+ {
956
+ var save= t.files[id];
957
+ save['last_selection'] = t.last_selection;
958
+ save['last_text_to_highlight'] = t.last_text_to_highlight;
959
+ save['last_hightlighted_text'] = t.last_hightlighted_text;
960
+ save['previous'] = t.previous;
961
+ save['next'] = t.next;
962
+ save['last_undo'] = t.last_undo;
963
+ save['smooth_selection'] = t.smooth_selection;
964
+ save['do_highlight'] = t.do_highlight;
965
+ save['syntax'] = t.settings['syntax'];
966
+ save['text'] = t.textarea.value;
967
+ save['scroll_top'] = t.result.scrollTop;
968
+ save['scroll_left'] = t.result.scrollLeft;
969
+ save['selection_start'] = t.last_selection["selectionStart"];
970
+ save['selection_end'] = t.last_selection["selectionEnd"];
971
+ save['font_size'] = t.settings["font_size"];
972
+ save['font_family'] = t.settings["font_family"];
973
+ save['word_wrap'] = t.settings["word_wrap"];
974
+ save['toolbar'] = {'links':{}, 'selects': {}};
975
+
976
+ // save toolbar buttons state for fileSpecific buttons
977
+ a_links= _$("toolbar_1").getElementsByTagName("a");
978
+ for( i=0; i<a_links.length; i++ )
979
+ {
980
+ if( a_links[i].getAttribute('fileSpecific') == 'yes' )
981
+ {
982
+ save_butt = {};
983
+ img = a_links[i].getElementsByTagName('img')[0];
984
+ save_butt['classLock'] = img.classLock;
985
+ save_butt['className'] = img.className;
986
+ save_butt['oldClassName'] = img.oldClassName;
987
+
988
+ save['toolbar']['links'][a_links[i].id]= save_butt;
989
+ }
990
+ }
991
+
992
+ // save toolbar select state for fileSpecific buttons
993
+ a_selects= _$("toolbar_1").getElementsByTagName("select");
994
+ for( i=0; i<a_selects.length; i++)
995
+ {
996
+ if(a_selects[i].getAttribute('fileSpecific')=='yes')
997
+ {
998
+ save['toolbar']['selects'][a_selects[i].id]= a_selects[i].value;
999
+ }
1000
+ }
1001
+
1002
+ t.files[id]= save;
1003
+
1004
+ return save;
1005
+ }
1006
+
1007
+ return false;
1008
+ };
1009
+
1010
+ // update file_datas
1011
+ EditArea.prototype.update_file= function(id, new_values){
1012
+ for(var i in new_values)
1013
+ {
1014
+ this.files[id][i]= new_values[i];
1015
+ }
1016
+ };
1017
+
1018
+ // display file datas
1019
+ EditArea.prototype.display_file= function(id){
1020
+ var t = this, a= t.textarea, new_file, a_lis, a_selects, a_links, a_options, i, j;
1021
+
1022
+ // we're showing the empty file
1023
+ if(id=='')
1024
+ {
1025
+ a.readOnly= true;
1026
+ t.tab_browsing_area.style.display= "none";
1027
+ _$("no_file_selected").style.display= "block";
1028
+ t.result.className= "empty";
1029
+ // clear current datas
1030
+ if(!t.files[''])
1031
+ {
1032
+ t.open_file({id: ''});
1033
+ }
1034
+ }
1035
+ // we try to show a non existent file, so we left
1036
+ else if( typeof( t.files[id] ) == 'undefined' )
1037
+ {
1038
+ return false;
1039
+ }
1040
+ // display a normal file
1041
+ else
1042
+ {
1043
+ t.result.className= "";
1044
+ a.readOnly= !t.is_editable;
1045
+ _$("no_file_selected").style.display= "none";
1046
+ t.tab_browsing_area.style.display= "block";
1047
+ }
1048
+
1049
+ // ensure to have last state for undo/redo actions
1050
+ t.check_redo(true);
1051
+ t.check_undo(true);
1052
+ t.curr_file= id;
1053
+
1054
+ // replace selected tab file
1055
+ a_lis= t.tab_browsing_area.getElementsByTagName('li');
1056
+ for( i=0; i<a_lis.length; i++)
1057
+ {
1058
+ if(a_lis[i].id == t.files[id]['html_id'])
1059
+ a_lis[i].className='selected';
1060
+ else
1061
+ a_lis[i].className='';
1062
+ }
1063
+
1064
+ // replace next files datas
1065
+ new_file= t.files[id];
1066
+
1067
+ // restore text content
1068
+ a.value= new_file['text'];
1069
+
1070
+ // restore font-size
1071
+ t.set_font(new_file['font_family'], new_file['font_size']);
1072
+
1073
+ // restore selection and scroll
1074
+ t.area_select(new_file['selection_start'], new_file['selection_end'] - new_file['selection_start']);
1075
+ t.manage_size(true);
1076
+ t.result.scrollTop= new_file['scroll_top'];
1077
+ t.result.scrollLeft= new_file['scroll_left'];
1078
+
1079
+ // restore undo, redo
1080
+ t.previous= new_file['previous'];
1081
+ t.next= new_file['next'];
1082
+ t.last_undo= new_file['last_undo'];
1083
+ t.check_redo(true);
1084
+ t.check_undo(true);
1085
+
1086
+ // restore highlight
1087
+ t.execCommand("change_highlight", new_file['do_highlight']);
1088
+ t.execCommand("change_syntax", new_file['syntax']);
1089
+
1090
+ // smooth mode
1091
+ t.execCommand("change_smooth_selection_mode", new_file['smooth_selection']);
1092
+
1093
+ // word_wrap
1094
+ t.execCommand("set_word_wrap", new_file['word_wrap']);
1095
+
1096
+ // restore links state in toolbar
1097
+ a_links= new_file['toolbar']['links'];
1098
+ for( i in a_links)
1099
+ {
1100
+ if( img = _$(i).getElementsByTagName('img')[0] )
1101
+ {
1102
+ img.classLock = a_links[i]['classLock'];
1103
+ img.className = a_links[i]['className'];
1104
+ img.oldClassName= a_links[i]['oldClassName'];
1105
+ }
1106
+ }
1107
+
1108
+ // restore select state in toolbar
1109
+ a_selects = new_file['toolbar']['selects'];
1110
+ for( i in a_selects)
1111
+ {
1112
+ a_options = _$(i).options;
1113
+ for( j=0; j<a_options.length; j++)
1114
+ {
1115
+ if( a_options[j].value == a_selects[i] )
1116
+ _$(i).options[j].selected=true;
1117
+ }
1118
+ }
1119
+
1120
+ };
1121
+
1122
+ // change tab for displaying a new one
1123
+ EditArea.prototype.switch_to_file= function(file_to_show, force_refresh){
1124
+ if(file_to_show!=this.curr_file || force_refresh)
1125
+ {
1126
+ this.save_file(this.curr_file);
1127
+ if(this.curr_file!='')
1128
+ this.execCommand('file_switch_off', this.files[this.curr_file]);
1129
+ this.display_file(file_to_show);
1130
+ if(file_to_show!='')
1131
+ this.execCommand('file_switch_on', this.files[file_to_show]);
1132
+ }
1133
+ };
1134
+
1135
+ // get all infos for the given file
1136
+ EditArea.prototype.get_file= function(id){
1137
+ if(id==this.curr_file)
1138
+ this.save_file(id);
1139
+ return this.files[id];
1140
+ };
1141
+
1142
+ // get all available files infos
1143
+ EditArea.prototype.get_all_files= function(){
1144
+ tmp_files= this.files;
1145
+ this.save_file(this.curr_file);
1146
+ if(tmp_files[''])
1147
+ delete(this.files['']);
1148
+ return tmp_files;
1149
+ };
1150
+
1151
+
1152
+ // check if the file has changed
1153
+ EditArea.prototype.check_file_changes= function(){
1154
+
1155
+ var id= this.curr_file;
1156
+ if(this.files[id] && this.files[id]['compare_edited_text']!=undefined)
1157
+ {
1158
+ if(this.files[id]['compare_edited_text'].length==this.textarea.value.length && this.files[id]['compare_edited_text']==this.textarea.value)
1159
+ {
1160
+ if(this.files[id]['edited']!= false)
1161
+ this.set_file_edited_mode(id, false);
1162
+ }
1163
+ else
1164
+ {
1165
+ if(this.files[id]['edited']!= true)
1166
+ this.set_file_edited_mode(id, true);
1167
+ }
1168
+ }
1169
+ };
1170
+
1171
+ // set if the file is edited or not
1172
+ EditArea.prototype.set_file_edited_mode= function(id, to){
1173
+ // change CSS for edited tab
1174
+ if(this.files[id] && _$(this.files[id]['html_id']))
1175
+ {
1176
+ var link= _$(this.files[id]['html_id']).getElementsByTagName('a')[0];
1177
+ if(to==true)
1178
+ {
1179
+ link.className= 'edited';
1180
+ }
1181
+ else
1182
+ {
1183
+ link.className= '';
1184
+ if(id==this.curr_file)
1185
+ text= this.textarea.value;
1186
+ else
1187
+ text= this.files[id]['text'];
1188
+ this.files[id]['compare_edited_text']= text;
1189
+ }
1190
+
1191
+ this.files[id]['edited']= to;
1192
+ }
1193
+ };
1194
+
1195
+ EditArea.prototype.set_show_line_colors = function(new_value){
1196
+ this.show_line_colors = new_value;
1197
+
1198
+ if( new_value )
1199
+ this.selection_field.className += ' show_colors';
1200
+ else
1201
+ this.selection_field.className = this.selection_field.className.replace( / show_colors/g, '' );
1202
+ };
js/editarea/edit_area_loader.js ADDED
@@ -0,0 +1,1081 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******
2
+ *
3
+ * EditArea
4
+ * Developped by Christophe Dolivet
5
+ * Released under LGPL, Apache and BSD licenses (use the one you want)
6
+ *
7
+ ******/
8
+
9
+ function EditAreaLoader(){
10
+ var t=this;
11
+ t.version= "0.8.2";
12
+ date= new Date();
13
+ t.start_time=date.getTime();
14
+ t.win= "loading"; // window loading state
15
+ t.error= false; // to know if load is interrrupt
16
+ t.baseURL="";
17
+ //t.suffix="";
18
+ t.template="";
19
+ t.lang= {}; // array of loaded speech language
20
+ t.load_syntax= {}; // array of loaded syntax language for highlight mode
21
+ t.syntax= {}; // array of initilized syntax language for highlight mode
22
+ t.loadedFiles= [];
23
+ t.waiting_loading= {}; // files that must be loaded in order to allow the script to really start
24
+ // scripts that must be loaded in the iframe
25
+ t.scripts_to_load= ["elements_functions", "resize_area", "reg_syntax"];
26
+ t.sub_scripts_to_load= ["edit_area", "manage_area" ,"edit_area_functions", "keyboard", "search_replace", "highlight", "regexp"];
27
+ t.syntax_display_name= { /*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/ };
28
+
29
+ t.resize= []; // contain resizing datas
30
+ t.hidden= {}; // store datas of the hidden textareas
31
+
32
+ t.default_settings= {
33
+ //id: "src" // id of the textarea to transform
34
+ debug: false
35
+ ,smooth_selection: true
36
+ ,font_size: "10" // not for IE
37
+ ,font_family: "monospace" // can be "verdana,monospace". Allow non monospace font but Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account...
38
+ ,start_highlight: false // if start with highlight
39
+ ,toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
40
+ ,begin_toolbar: "" // "new_document, save, load, |"
41
+ ,end_toolbar: "" // or end_toolbar
42
+ ,is_multi_files: false // enable the multi file mode (the textarea content is ignored)
43
+ ,allow_resize: "both" // possible values: "no", "both", "x", "y"
44
+ ,show_line_colors: false // if the highlight is disabled for the line currently beeing edited (if enabled => heavy CPU use)
45
+ ,min_width: 400
46
+ ,min_height: 125
47
+ ,replace_tab_by_spaces: false
48
+ ,allow_toggle: true // true or false
49
+ ,language: "en"
50
+ ,syntax: ""
51
+ ,syntax_selection_allow: "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
52
+ ,display: "onload" // onload or later
53
+ ,max_undo: 30
54
+ ,browsers: "known" // all or known
55
+ ,plugins: "" // comma separated plugin list
56
+ ,gecko_spellcheck: false // enable/disable by default the gecko_spellcheck
57
+ ,fullscreen: false
58
+ ,is_editable: true
59
+ ,cursor_position: "begin"
60
+ ,word_wrap: false // define if the text is wrapped of not in the textarea
61
+ ,autocompletion: false // NOT IMPLEMENTED
62
+ ,load_callback: "" // click on load button (function name)
63
+ ,save_callback: "" // click on save button (function name)
64
+ ,change_callback: "" // textarea onchange trigger (function name)
65
+ ,submit_callback: "" // form submited (function name)
66
+ ,EA_init_callback: "" // EditArea initiliazed (function name)
67
+ ,EA_delete_callback: "" // EditArea deleted (function name)
68
+ ,EA_load_callback: "" // EditArea fully loaded and displayed (function name)
69
+ ,EA_unload_callback: "" // EditArea delete while being displayed (function name)
70
+ ,EA_toggle_on_callback: "" // EditArea toggled on (function name)
71
+ ,EA_toggle_off_callback: "" // EditArea toggled off (function name)
72
+ ,EA_file_switch_on_callback: "" // a new tab is selected (called for the newly selected file)
73
+ ,EA_file_switch_off_callback: "" // a new tab is selected (called for the previously selected file)
74
+ ,EA_file_close_callback: "" // close a tab
75
+ };
76
+
77
+ t.advanced_buttons = [
78
+ // id, button img, command (it will try to find the translation of "id"), is_file_specific
79
+ ['new_document', 'newdocument.gif', 'new_document', false],
80
+ ['search', 'search.gif', 'show_search', false],
81
+ ['go_to_line', 'go_to_line.gif', 'go_to_line', false],
82
+ ['undo', 'undo.gif', 'undo', true],
83
+ ['redo', 'redo.gif', 'redo', true],
84
+ ['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode', true],
85
+ ['reset_highlight', 'reset_highlight.gif', 'resync_highlight', true],
86
+ ['highlight', 'highlight.gif','change_highlight', true],
87
+ ['help', 'help.gif', 'show_help', false],
88
+ ['save', 'save.gif', 'save', false],
89
+ ['load', 'load.gif', 'load', false],
90
+ ['fullscreen', 'fullscreen.gif', 'toggle_full_screen', false],
91
+ ['word_wrap', 'word_wrap.gif', 'toggle_word_wrap', true],
92
+ ['autocompletion', 'autocompletion.gif', 'toggle_autocompletion', true]
93
+ ];
94
+
95
+ // navigator identification
96
+ t.set_browser_infos(t);
97
+
98
+ if(t.isIE>=6 || t.isGecko || ( t.isWebKit && !t.isSafari<3 ) || t.isOpera>=9 || t.isCamino )
99
+ t.isValidBrowser=true;
100
+ else
101
+ t.isValidBrowser=false;
102
+
103
+ t.set_base_url();
104
+
105
+ for(var i=0; i<t.scripts_to_load.length; i++){
106
+ setTimeout("editAreaLoader.load_script('"+t.baseURL + t.scripts_to_load[i]+ ".js');", 1); // let the time to Object editAreaLoader to be created before loading additionnal scripts
107
+ t.waiting_loading[t.scripts_to_load[i]+ ".js"]= false;
108
+ }
109
+ t.add_event(window, "load", EditAreaLoader.prototype.window_loaded);
110
+ };
111
+
112
+ EditAreaLoader.prototype ={
113
+ has_error : function(){
114
+ this.error= true;
115
+ // set to empty all EditAreaLoader functions
116
+ for(var i in EditAreaLoader.prototype){
117
+ EditAreaLoader.prototype[i]=function(){};
118
+ }
119
+ },
120
+
121
+ // add browser informations to the object passed in parameter
122
+ set_browser_infos : function(o){
123
+ ua= navigator.userAgent;
124
+
125
+ // general detection
126
+ o.isWebKit = /WebKit/.test(ua);
127
+ o.isGecko = !o.isWebKit && /Gecko/.test(ua);
128
+ o.isMac = /Mac/.test(ua);
129
+
130
+ o.isIE = (navigator.appName == "Microsoft Internet Explorer");
131
+ if(o.isIE){
132
+ o.isIE = ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/, "$1");
133
+ if(o.isIE<6)
134
+ o.has_error();
135
+ }
136
+
137
+ if(o.isOpera = (ua.indexOf('Opera') != -1)){
138
+ o.isOpera= ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i, "$1");
139
+ if(o.isOpera<9)
140
+ o.has_error();
141
+ o.isIE=false;
142
+ }
143
+
144
+ if(o.isFirefox =(ua.indexOf('Firefox') != -1))
145
+ o.isFirefox = ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i, "$1");
146
+ // Firefox clones
147
+ if( ua.indexOf('Iceweasel') != -1 )
148
+ o.isFirefox = ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i, "$1");
149
+ if( ua.indexOf('GranParadiso') != -1 )
150
+ o.isFirefox = ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i, "$1");
151
+ if( ua.indexOf('BonEcho') != -1 )
152
+ o.isFirefox = ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i, "$1");
153
+ if( ua.indexOf('SeaMonkey') != -1)
154
+ o.isFirefox = (ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i, "$1") ) + 1;
155
+
156
+ if(o.isCamino =(ua.indexOf('Camino') != -1))
157
+ o.isCamino = ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i, "$1");
158
+
159
+ if(o.isSafari =(ua.indexOf('Safari') != -1))
160
+ o.isSafari= ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i, "$1");
161
+
162
+ if(o.isChrome =(ua.indexOf('Chrome') != -1)) {
163
+ o.isChrome = ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i, "$1");
164
+ o.isSafari = false;
165
+ }
166
+
167
+ },
168
+
169
+ window_loaded : function(){
170
+ editAreaLoader.win="loaded";
171
+
172
+ // add events on forms
173
+ if (document.forms) {
174
+ for (var i=0; i<document.forms.length; i++) {
175
+ var form = document.forms[i];
176
+ form.edit_area_replaced_submit=null;
177
+ try {
178
+
179
+ form.edit_area_replaced_submit = form.onsubmit;
180
+ form.onsubmit="";
181
+ } catch (e) {// Do nothing
182
+ }
183
+ editAreaLoader.add_event(form, "submit", EditAreaLoader.prototype.submit);
184
+ editAreaLoader.add_event(form, "reset", EditAreaLoader.prototype.reset);
185
+ }
186
+ }
187
+ editAreaLoader.add_event(window, "unload", function(){for(var i in editAreas){editAreaLoader.delete_instance(i);}}); // ini callback
188
+ },
189
+
190
+ // init the checkup of the selection of the IE textarea
191
+ init_ie_textarea : function(id){
192
+ var a=document.getElementById(id);
193
+ try{
194
+ if(a && typeof(a.focused)=="undefined"){
195
+ a.focus();
196
+ a.focused=true;
197
+ a.selectionStart= a.selectionEnd= 0;
198
+ get_IE_selection(a);
199
+ editAreaLoader.add_event(a, "focus", IE_textarea_focus);
200
+ editAreaLoader.add_event(a, "blur", IE_textarea_blur);
201
+
202
+ }
203
+ }catch(ex){}
204
+ },
205
+
206
+ init : function(settings){
207
+ var t=this,s=settings,i;
208
+
209
+ if(!s["id"])
210
+ t.has_error();
211
+ if(t.error)
212
+ return;
213
+ // if an instance of the editor already exists for this textarea => delete the previous one
214
+ if(editAreas[s["id"]])
215
+ t.delete_instance(s["id"]);
216
+
217
+ // init settings
218
+ for(i in t.default_settings){
219
+ if(typeof(s[i])=="undefined")
220
+ s[i]=t.default_settings[i];
221
+ }
222
+
223
+ if(s["browsers"]=="known" && t.isValidBrowser==false){
224
+ return;
225
+ }
226
+
227
+ if(s["begin_toolbar"].length>0)
228
+ s["toolbar"]= s["begin_toolbar"] +","+ s["toolbar"];
229
+ if(s["end_toolbar"].length>0)
230
+ s["toolbar"]= s["toolbar"] +","+ s["end_toolbar"];
231
+ s["tab_toolbar"]= s["toolbar"].replace(/ /g,"").split(",");
232
+
233
+ s["plugins"]= s["plugins"].replace(/ /g,"").split(",");
234
+ for(i=0; i<s["plugins"].length; i++){
235
+ if(s["plugins"][i].length==0)
236
+ s["plugins"].splice(i,1);
237
+ }
238
+ // alert(settings["plugins"].length+": "+ settings["plugins"].join(","));
239
+ t.get_template();
240
+ t.load_script(t.baseURL + "langs/"+ s["language"] + ".js");
241
+
242
+ if(s["syntax"].length>0){
243
+ s["syntax"]=s["syntax"].toLowerCase();
244
+ t.load_script(t.baseURL + "reg_syntax/"+ s["syntax"] + ".js");
245
+ }
246
+ //alert(this.template);
247
+
248
+ editAreas[s["id"]]= {"settings": s};
249
+ editAreas[s["id"]]["displayed"]=false;
250
+ editAreas[s["id"]]["hidden"]=false;
251
+
252
+ //if(settings["display"]=="onload")
253
+ t.start(s["id"]);
254
+ },
255
+
256
+ // delete an instance of an EditArea
257
+ delete_instance : function(id){
258
+ var d=document,fs=window.frames,span,iframe;
259
+ editAreaLoader.execCommand(id, "EA_delete");
260
+ if(fs["frame_"+id] && fs["frame_"+id].editArea)
261
+ {
262
+ if(editAreas[id]["displayed"])
263
+ editAreaLoader.toggle(id, "off");
264
+ fs["frame_"+id].editArea.execCommand("EA_unload");
265
+ }
266
+
267
+ // remove toggle infos and debug textarea
268
+ span= d.getElementById("EditAreaArroundInfos_"+id);
269
+ if(span)
270
+ span.parentNode.removeChild(span);
271
+
272
+ // remove the iframe
273
+ iframe= d.getElementById("frame_"+id);
274
+ if(iframe){
275
+ iframe.parentNode.removeChild(iframe);
276
+ //delete iframe;
277
+ try {
278
+ delete fs["frame_"+id];
279
+ } catch (e) {// Do nothing
280
+ }
281
+ }
282
+
283
+ delete editAreas[id];
284
+ },
285
+
286
+
287
+ start : function(id){
288
+ var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;
289
+
290
+ // check that the window is loaded
291
+ if(t.win!="loaded"){
292
+ setTimeout("editAreaLoader.start('"+id+"');", 50);
293
+ return;
294
+ }
295
+
296
+ // check that all needed scripts are loaded
297
+ for( i in t.waiting_loading){
298
+ if(t.waiting_loading[i]!="loaded" && typeof(t.waiting_loading[i])!="function"){
299
+ setTimeout("editAreaLoader.start('"+id+"');", 50);
300
+ return;
301
+ }
302
+ }
303
+
304
+ // wait until language and syntax files are loaded
305
+ if(!t.lang[editAreas[id]["settings"]["language"]] || (editAreas[id]["settings"]["syntax"].length>0 && !t.load_syntax[editAreas[id]["settings"]["syntax"]]) ){
306
+ setTimeout("editAreaLoader.start('"+id+"');", 50);
307
+ return;
308
+ }
309
+ // init the regexp for syntax highlight
310
+ if(editAreas[id]["settings"]["syntax"].length>0)
311
+ t.init_syntax_regexp();
312
+
313
+
314
+ // display toggle option and debug area
315
+ if(!d.getElementById("EditAreaArroundInfos_"+id) && (editAreas[id]["settings"]["debug"] || editAreas[id]["settings"]["allow_toggle"]))
316
+ {
317
+ span= d.createElement("span");
318
+ span.id= "EditAreaArroundInfos_"+id;
319
+ if(editAreas[id]["settings"]["allow_toggle"]){
320
+ checked=(editAreas[id]["settings"]["display"]=="onload")?"checked='checked'":"";
321
+ html+="<div id='edit_area_toggle_"+i+"'>";
322
+ html+="<input id='edit_area_toggle_checkbox_"+ id +"' class='toggle_"+ id +"' type='checkbox' onclick='editAreaLoader.toggle(\""+ id +"\");' accesskey='e' "+checked+" />";
323
+ html+="<label for='edit_area_toggle_checkbox_"+ id +"'>{$toggle}</label></div>";
324
+ }
325
+ if(editAreas[id]["settings"]["debug"])
326
+ html+="<textarea id='edit_area_debug_"+ id +"' spellcheck='off' style='z-index: 20; width: 100%; height: 120px;overflow: auto; border: solid black 1px;'></textarea><br />";
327
+ html= t.translate(html, editAreas[id]["settings"]["language"]);
328
+ span.innerHTML= html;
329
+ father= d.getElementById(id).parentNode;
330
+ next= d.getElementById(id).nextSibling;
331
+ if(next==null)
332
+ father.appendChild(span);
333
+ else
334
+ father.insertBefore(span, next);
335
+ }
336
+
337
+ if(!editAreas[id]["initialized"])
338
+ {
339
+ t.execCommand(id, "EA_init"); // ini callback
340
+ if(editAreas[id]["settings"]["display"]=="later"){
341
+ editAreas[id]["initialized"]= true;
342
+ return;
343
+ }
344
+ }
345
+
346
+ if(t.isIE){ // launch IE selection checkup
347
+ t.init_ie_textarea(id);
348
+ }
349
+
350
+ // get toolbar content
351
+ var area=editAreas[id];
352
+
353
+ for(i=0; i<area["settings"]["tab_toolbar"].length; i++){
354
+ // alert(this.tab_toolbar[i]+"\n"+ this.get_control_html(this.tab_toolbar[i]));
355
+ html_toolbar_content+= t.get_control_html(area["settings"]["tab_toolbar"][i], area["settings"]["language"]);
356
+ }
357
+ // translate toolbar text here for chrome 2
358
+ html_toolbar_content = t.translate(html_toolbar_content, area["settings"]["language"], "template");
359
+
360
+
361
+ // create javascript import rules for the iframe if the javascript has not been already loaded by the compressor
362
+ if(!t.iframe_script){
363
+ t.iframe_script="";
364
+ for(i=0; i<t.sub_scripts_to_load.length; i++)
365
+ t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + t.sub_scripts_to_load[i] +'.js"></script>';
366
+ }
367
+
368
+ // add plugins scripts if not already loaded by the compressor (but need to load language in all the case)
369
+ for(i=0; i<area["settings"]["plugins"].length; i++){
370
+ //if(typeof(area["settings"]["plugins"][i])=="function") continue;
371
+ if(!t.all_plugins_loaded)
372
+ t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/' + area["settings"]["plugins"][i] +'.js"></script>';
373
+ t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/langs/' + area["settings"]["language"] +'.js"></script>';
374
+ }
375
+
376
+
377
+ // create css link for the iframe if the whole css text has not been already loaded by the compressor
378
+ if(!t.iframe_css){
379
+ t.iframe_css="<link href='"+ t.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";
380
+ }
381
+
382
+
383
+ // create template
384
+ template= t.template.replace(/\[__BASEURL__\]/g, t.baseURL);
385
+ template= template.replace("[__TOOLBAR__]",html_toolbar_content);
386
+
387
+
388
+ // fill template with good language sentences
389
+ template= t.translate(template, area["settings"]["language"], "template");
390
+
391
+ // add css_code
392
+ template= template.replace("[__CSSRULES__]", t.iframe_css);
393
+ // add js_code
394
+ template= template.replace("[__JSCODE__]", t.iframe_script);
395
+
396
+ // add version_code
397
+ template= template.replace("[__EA_VERSION__]", t.version);
398
+ //template=template.replace(/\{\$([^\}]+)\}/gm, this.traduc_template);
399
+
400
+ //editAreas[area["settings"]["id"]]["template"]= template;
401
+
402
+ area.textarea=d.getElementById(area["settings"]["id"]);
403
+ editAreas[area["settings"]["id"]]["textarea"]=area.textarea;
404
+
405
+ // if removing previous instances from DOM before (fix from Marcin)
406
+ if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')
407
+ delete window.frames["frame_"+area["settings"]["id"]];
408
+
409
+ // insert template in the document after the textarea
410
+ father= area.textarea.parentNode;
411
+ /* var container= document.createElement("div");
412
+ container.id= "EditArea_frame_container_"+area["settings"]["id"];
413
+ */
414
+ content= d.createElement("iframe");
415
+ content.name= "frame_"+area["settings"]["id"];
416
+ content.id= "frame_"+area["settings"]["id"];
417
+ content.style.borderWidth= "0px";
418
+ setAttribute(content, "frameBorder", "0"); // IE
419
+ content.style.overflow="hidden";
420
+ content.style.display="none";
421
+
422
+
423
+ next= area.textarea.nextSibling;
424
+ if(next==null)
425
+ father.appendChild(content);
426
+ else
427
+ father.insertBefore(content, next) ;
428
+ f=window.frames["frame_"+area["settings"]["id"]];
429
+ f.document.open();
430
+ f.editAreas=editAreas;
431
+ f.area_id= area["settings"]["id"];
432
+ f.document.area_id= area["settings"]["id"];
433
+ f.document.write(template);
434
+ f.document.close();
435
+
436
+ // frame.editAreaLoader=this;
437
+ //editAreas[area["settings"]["id"]]["displayed"]=true;
438
+
439
+ },
440
+
441
+ toggle : function(id, toggle_to){
442
+
443
+ /* if((editAreas[id]["displayed"]==true && toggle_to!="on") || toggle_to=="off"){
444
+ this.toggle_off(id);
445
+ }else if((editAreas[id]["displayed"]==false && toggle_to!="off") || toggle_to=="on"){
446
+ this.toggle_on(id);
447
+ }*/
448
+ if(!toggle_to)
449
+ toggle_to= (editAreas[id]["displayed"]==true)?"off":"on";
450
+ if(editAreas[id]["displayed"]==true && toggle_to=="off"){
451
+ this.toggle_off(id);
452
+ }else if(editAreas[id]["displayed"]==false && toggle_to=="on"){
453
+ this.toggle_on(id);
454
+ }
455
+
456
+ return false;
457
+ },
458
+
459
+ // static function
460
+ toggle_off : function(id){
461
+ var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;
462
+ if(fs["frame_"+id])
463
+ {
464
+ f = fs["frame_"+id];
465
+ t = editAreas[id]["textarea"];
466
+ if(f.editArea.fullscreen['isFull'])
467
+ f.editArea.toggle_full_screen(false);
468
+ editAreas[id]["displayed"]=false;
469
+
470
+ // set wrap to off to keep same display mode (some browser get problem with this, so it need more complex operation
471
+ t.wrap = "off"; // for IE
472
+ setAttribute(t, "wrap", "off"); // for Firefox
473
+ parNod = t.parentNode;
474
+ nxtSib = t.nextSibling;
475
+ parNod.removeChild(t);
476
+ parNod.insertBefore(t, nxtSib);
477
+
478
+ // restore values
479
+ t.value= f.editArea.textarea.value;
480
+ selStart = f.editArea.last_selection["selectionStart"];
481
+ selEnd = f.editArea.last_selection["selectionEnd"];
482
+ scrollTop = f.document.getElementById("result").scrollTop;
483
+ scrollLeft = f.document.getElementById("result").scrollLeft;
484
+
485
+
486
+ document.getElementById("frame_"+id).style.display='none';
487
+
488
+ t.style.display="inline";
489
+
490
+ try{ // IE will give an error when trying to focus an invisible or disabled textarea
491
+ t.focus();
492
+ } catch(e){};
493
+ if(this.isIE){
494
+ t.selectionStart= selStart;
495
+ t.selectionEnd = selEnd;
496
+ t.focused = true;
497
+ set_IE_selection(t);
498
+ }else{
499
+ if(this.isOpera && this.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
500
+ t.setSelectionRange(0, 0);
501
+ }
502
+ try{
503
+ t.setSelectionRange(selStart, selEnd);
504
+ } catch(e) {};
505
+ }
506
+ t.scrollTop= scrollTop;
507
+ t.scrollLeft= scrollLeft;
508
+ f.editArea.execCommand("toggle_off");
509
+
510
+ }
511
+ },
512
+
513
+ // static function
514
+ toggle_on : function(id){
515
+ var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;
516
+
517
+ if(fs["frame_"+id])
518
+ {
519
+ f = fs["frame_"+id];
520
+ t = editAreas[id]["textarea"];
521
+ area= f.editArea;
522
+ area.textarea.value= t.value;
523
+
524
+ // store display values;
525
+ curPos = editAreas[id]["settings"]["cursor_position"];
526
+
527
+ if(t.use_last==true)
528
+ {
529
+ selStart = t.last_selectionStart;
530
+ selEnd = t.last_selectionEnd;
531
+ scrollTop = t.last_scrollTop;
532
+ scrollLeft = t.last_scrollLeft;
533
+ t.use_last=false;
534
+ }
535
+ else if( curPos == "auto" )
536
+ {
537
+ try{
538
+ selStart = t.selectionStart;
539
+ selEnd = t.selectionEnd;
540
+ scrollTop = t.scrollTop;
541
+ scrollLeft = t.scrollLeft;
542
+ //alert(scrollTop);
543
+ }catch(ex){}
544
+ }
545
+
546
+ // set to good size
547
+ this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));
548
+ t.style.display="none";
549
+ document.getElementById("frame_"+id).style.display="inline";
550
+ area.execCommand("focus"); // without this focus opera doesn't manage well the iframe body height
551
+
552
+
553
+ // restore display values
554
+ editAreas[id]["displayed"]=true;
555
+ area.execCommand("update_size");
556
+
557
+ f.document.getElementById("result").scrollTop= scrollTop;
558
+ f.document.getElementById("result").scrollLeft= scrollLeft;
559
+ area.area_select(selStart, selEnd-selStart);
560
+ area.execCommand("toggle_on");
561
+
562
+
563
+ }
564
+ else
565
+ {
566
+ /* if(this.isIE)
567
+ get_IE_selection(document.getElementById(id)); */
568
+ elem= document.getElementById(id);
569
+ elem.last_selectionStart= elem.selectionStart;
570
+ elem.last_selectionEnd= elem.selectionEnd;
571
+ elem.last_scrollTop= elem.scrollTop;
572
+ elem.last_scrollLeft= elem.scrollLeft;
573
+ elem.use_last=true;
574
+ editAreaLoader.start(id);
575
+ }
576
+ },
577
+
578
+ set_editarea_size_from_textarea : function(id, frame){
579
+ var elem,width,height;
580
+ elem = document.getElementById(id);
581
+
582
+ width = Math.max(editAreas[id]["settings"]["min_width"], elem.offsetWidth)+"px";
583
+ height = Math.max(editAreas[id]["settings"]["min_height"], elem.offsetHeight)+"px";
584
+ if(elem.style.width.indexOf("%")!=-1)
585
+ width = elem.style.width;
586
+ if(elem.style.height.indexOf("%")!=-1)
587
+ height = elem.style.height;
588
+ //alert("h: "+height+" w: "+width);
589
+
590
+ frame.style.width= width;
591
+ frame.style.height= height;
592
+ },
593
+
594
+ set_base_url : function(){
595
+ var t=this,elems,i,docBasePath;
596
+
597
+ if( !this.baseURL ){
598
+ elems = document.getElementsByTagName('script');
599
+
600
+ for( i=0; i<elems.length; i++ ){
601
+ if (elems[i].src && elems[i].src.match(/edit_area_[^\\\/]*$/i) ) {
602
+ var src = unescape( elems[i].src ); // use unescape for utf-8 encoded urls
603
+ src = src.substring(0, src.lastIndexOf('/'));
604
+ this.baseURL = src;
605
+ this.file_name= elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);
606
+ break;
607
+ }
608
+ }
609
+ }
610
+
611
+ docBasePath = document.location.href;
612
+ if (docBasePath.indexOf('?') != -1)
613
+ docBasePath = docBasePath.substring(0, docBasePath.indexOf('?'));
614
+ docBasePath = docBasePath.substring(0, docBasePath.lastIndexOf('/'));
615
+
616
+ // If not HTTP absolute
617
+ if (t.baseURL.indexOf('://') == -1 && t.baseURL.charAt(0) != '/') {
618
+ // If site absolute
619
+ t.baseURL = docBasePath + "/" + t.baseURL;
620
+ }
621
+ t.baseURL +="/";
622
+ },
623
+
624
+ get_button_html : function(id, img, exec, isFileSpecific, baseURL) {
625
+ var cmd,html;
626
+ if(!baseURL)
627
+ baseURL= this.baseURL;
628
+ cmd = 'editArea.execCommand(\'' + exec + '\')';
629
+ html = '<a id="a_'+ id +'" href="javascript:' + cmd + '" onclick="' + cmd + ';return false;" onmousedown="return false;" target="_self" fileSpecific="'+ (isFileSpecific?'yes':'no') +'">';
630
+ html += '<img id="' + id + '" src="'+ baseURL +'images/' + img + '" title="{$' + id + '}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';
631
+ return html;
632
+ },
633
+
634
+ get_control_html : function(button_name, lang) {
635
+ var t=this,i,but,html,si;
636
+ for (i=0; i<t.advanced_buttons.length; i++)
637
+ {
638
+ but = t.advanced_buttons[i];
639
+ if (but[0] == button_name)
640
+ {
641
+ return t.get_button_html(but[0], but[1], but[2], but[3]);
642
+ }
643
+ }
644
+
645
+ switch (button_name){
646
+ case "*":
647
+ case "return":
648
+ return "<br />";
649
+ case "|":
650
+ case "separator":
651
+ return '<img src="'+ t.baseURL +'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';
652
+ case "select_font":
653
+ html= "<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";
654
+ html+="<option value='-1'>{$font_size}</option>";
655
+ si=[8,9,10,11,12,14];
656
+ for( i=0;i<si.length;i++){
657
+ html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";
658
+ }
659
+ html+="</select>";
660
+ return html;
661
+ case "syntax_selection":
662
+ html= "<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\", this.value)' fileSpecific='yes'>";
663
+ html+="<option value='-1'>{$syntax_selection}</option>";
664
+ html+="</select>";
665
+ return html;
666
+ }
667
+
668
+ return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";
669
+ },
670
+
671
+
672
+ get_template : function(){
673
+ if(this.template=="")
674
+ {
675
+ var xhr_object = null;
676
+ if(window.XMLHttpRequest) // Firefox
677
+ xhr_object = new XMLHttpRequest();
678
+ else if(window.ActiveXObject) // Internet Explorer
679
+ xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
680
+ else { // XMLHttpRequest not supported
681
+ alert("XMLHTTPRequest not supported. EditArea not loaded");
682
+ return;
683
+ }
684
+
685
+ xhr_object.open("GET", this.baseURL+"template.html", false);
686
+ xhr_object.send(null);
687
+ if(xhr_object.readyState == 4)
688
+ this.template=xhr_object.responseText;
689
+ else
690
+ this.has_error();
691
+ }
692
+ },
693
+
694
+ // translate text
695
+ translate : function(text, lang, mode){
696
+ if(mode=="word")
697
+ text=editAreaLoader.get_word_translation(text, lang);
698
+ else if(mode="template"){
699
+ editAreaLoader.current_language= lang;
700
+ text=text.replace(/\{\$([^\}]+)\}/gm, editAreaLoader.translate_template);
701
+ }
702
+ return text;
703
+ },
704
+
705
+ translate_template : function(){
706
+ return editAreaLoader.get_word_translation(EditAreaLoader.prototype.translate_template.arguments[1], editAreaLoader.current_language);
707
+ },
708
+
709
+ get_word_translation : function(val, lang){
710
+ var i;
711
+
712
+ for( i in editAreaLoader.lang[lang]){
713
+ if(i == val)
714
+ return editAreaLoader.lang[lang][i];
715
+ }
716
+ return "_"+val;
717
+ },
718
+
719
+ load_script : function(url){
720
+ var t=this,d=document,script,head;
721
+
722
+ if( t.loadedFiles[url] )
723
+ return;
724
+ //alert("load: "+url);
725
+ try{
726
+ script= d.createElement("script");
727
+ script.type= "text/javascript";
728
+ script.src= url;
729
+ script.charset= "UTF-8";
730
+ d.getElementsByTagName("head")[0].appendChild(script);
731
+ }catch(e){
732
+ d.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '" charset="UTF-8"></sc'+'ript>');
733
+ }
734
+
735
+ t.loadedFiles[url] = true;
736
+ },
737
+
738
+ add_event : function(obj, name, handler) {
739
+ try{
740
+ if (obj.attachEvent) {
741
+ obj.attachEvent("on" + name, handler);
742
+ } else{
743
+ obj.addEventListener(name, handler, false);
744
+ }
745
+ }catch(e){}
746
+ },
747
+
748
+ remove_event : function(obj, name, handler){
749
+ try{
750
+ if (obj.detachEvent)
751
+ obj.detachEvent("on" + name, handler);
752
+ else
753
+ obj.removeEventListener(name, handler, false);
754
+ }catch(e){}
755
+ },
756
+
757
+
758
+ // reset all the editareas in the form that have been reseted
759
+ reset : function(e){
760
+ var formObj,is_child,i,x;
761
+
762
+ formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
763
+ if(formObj.tagName!='FORM')
764
+ formObj= formObj.form;
765
+
766
+ for( i in editAreas ){
767
+ is_child= false;
768
+ for( x=0;x<formObj.elements.length;x++ ) {
769
+ if(formObj.elements[x].id == i)
770
+ is_child=true;
771
+ }
772
+
773
+ if(window.frames["frame_"+i] && is_child && editAreas[i]["displayed"]==true){
774
+
775
+ var exec= 'window.frames["frame_'+ i +'"].editArea.textarea.value= document.getElementById("'+ i +'").value;';
776
+ exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("focus");';
777
+ exec+= 'window.frames["frame_'+ i +'"].editArea.check_line_selection();';
778
+ exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("reset");';
779
+ window.setTimeout(exec, 10);
780
+ }
781
+ }
782
+ return;
783
+ },
784
+
785
+
786
+ // prepare all the textarea replaced by an editarea to be submited
787
+ submit : function(e){
788
+ var formObj,is_child,fs=window.frames,i,x;
789
+ formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
790
+ if(formObj.tagName!='FORM')
791
+ formObj= formObj.form;
792
+
793
+ for( i in editAreas){
794
+ is_child= false;
795
+ for( x=0;x<formObj.elements.length;x++ ) {
796
+ if(formObj.elements[x].id == i)
797
+ is_child=true;
798
+ }
799
+
800
+ if(is_child)
801
+ {
802
+ if(fs["frame_"+i] && editAreas[i]["displayed"]==true)
803
+ document.getElementById(i).value= fs["frame_"+ i].editArea.textarea.value;
804
+ editAreaLoader.execCommand(i,"EA_submit");
805
+ }
806
+ }
807
+ if( typeof(formObj.edit_area_replaced_submit) == "function" ){
808
+ res= formObj.edit_area_replaced_submit();
809
+ if(res==false){
810
+ if(editAreaLoader.isIE)
811
+ return false;
812
+ else
813
+ e.preventDefault();
814
+ }
815
+ }
816
+ return;
817
+ },
818
+
819
+ // allow to get the value of the editarea
820
+ getValue : function(id){
821
+ if(window.frames["frame_"+id] && editAreas[id]["displayed"]==true){
822
+ return window.frames["frame_"+ id].editArea.textarea.value;
823
+ }else if(elem=document.getElementById(id)){
824
+ return elem.value;
825
+ }
826
+ return false;
827
+ },
828
+
829
+ // allow to set the value of the editarea
830
+ setValue : function(id, new_val){
831
+ var fs=window.frames;
832
+
833
+ if( ( f=fs["frame_"+id] ) && editAreas[id]["displayed"]==true){
834
+ f.editArea.textarea.value= new_val;
835
+ f.editArea.execCommand("focus");
836
+ f.editArea.check_line_selection(false);
837
+ f.editArea.execCommand("onchange");
838
+ }else if(elem=document.getElementById(id)){
839
+ elem.value= new_val;
840
+ }
841
+ },
842
+
843
+ // allow to get infos on the selection: array(start, end)
844
+ getSelectionRange : function(id){
845
+ var sel,eA,fs=window.frames;
846
+
847
+ sel= {"start": 0, "end": 0};
848
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
849
+ eA= fs["frame_"+ id].editArea;
850
+
851
+ sel["start"] = eA.textarea.selectionStart;
852
+ sel["end"] = eA.textarea.selectionEnd;
853
+
854
+ }else if( elem=document.getElementById(id) ){
855
+ sel= getSelectionRange(elem);
856
+ }
857
+ return sel;
858
+ },
859
+
860
+ // allow to set the selection with the given start and end positions
861
+ setSelectionRange : function(id, new_start, new_end){
862
+ var fs=window.frames;
863
+
864
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
865
+ fs["frame_"+ id].editArea.area_select(new_start, new_end-new_start);
866
+ // make an auto-scroll to the selection
867
+ if(!this.isIE){
868
+ fs["frame_"+ id].editArea.check_line_selection(false);
869
+ fs["frame_"+ id].editArea.scroll_to_view();
870
+ }
871
+ }else if(elem=document.getElementById(id)){
872
+ setSelectionRange(elem, new_start, new_end);
873
+ }
874
+ },
875
+
876
+ getSelectedText : function(id){
877
+ var sel= this.getSelectionRange(id);
878
+
879
+ return this.getValue(id).substring(sel["start"], sel["end"]);
880
+ },
881
+
882
+ setSelectedText : function(id, new_val){
883
+ var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;
884
+
885
+ new_val = new_val.replace(/\r/g, "");
886
+ sel = this.getSelectionRange(id);
887
+ text = this.getValue(id);
888
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
889
+ scrollTop = fs["frame_"+ id].document.getElementById("result").scrollTop;
890
+ scrollLeft = fs["frame_"+ id].document.getElementById("result").scrollLeft;
891
+ }else{
892
+ scrollTop = d.getElementById(id).scrollTop;
893
+ scrollLeft = d.getElementById(id).scrollLeft;
894
+ }
895
+
896
+ text = text.substring(0, sel["start"])+ new_val +text.substring(sel["end"]);
897
+ this.setValue(id, text);
898
+ new_sel_end = sel["start"]+ new_val.length;
899
+ this.setSelectionRange(id, sel["start"], new_sel_end);
900
+
901
+
902
+ // fix \r problem for selection length count on IE & Opera
903
+ if(new_val != this.getSelectedText(id).replace(/\r/g, "")){
904
+ this.setSelectionRange(id, sel["start"], new_sel_end+ new_val.split("\n").length -1);
905
+ }
906
+ // restore scrolling position
907
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
908
+ fs["frame_"+ id].document.getElementById("result").scrollTop= scrollTop;
909
+ fs["frame_"+ id].document.getElementById("result").scrollLeft= scrollLeft;
910
+ fs["frame_"+ id].editArea.execCommand("onchange");
911
+ }else{
912
+ d.getElementById(id).scrollTop= scrollTop;
913
+ d.getElementById(id).scrollLeft= scrollLeft;
914
+ }
915
+ },
916
+
917
+ insertTags : function(id, open_tag, close_tag){
918
+ var old_sel,new_sel;
919
+
920
+ old_sel = this.getSelectionRange(id);
921
+ text = open_tag + this.getSelectedText(id) + close_tag;
922
+
923
+ editAreaLoader.setSelectedText(id, text);
924
+
925
+ new_sel = this.getSelectionRange(id);
926
+ if(old_sel["end"] > old_sel["start"]) // if text was selected, cursor at the end
927
+ this.setSelectionRange(id, new_sel["end"], new_sel["end"]);
928
+ else // cursor in the middle
929
+ this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);
930
+ },
931
+
932
+ // hide both EditArea and normal textarea
933
+ hide : function(id){
934
+ var fs= window.frames,d=document,t=this,scrollTop,scrollLeft,span;
935
+ if(d.getElementById(id) && !t.hidden[id])
936
+ {
937
+ t.hidden[id]= {};
938
+ t.hidden[id]["selectionRange"]= t.getSelectionRange(id);
939
+ if(d.getElementById(id).style.display!="none")
940
+ {
941
+ t.hidden[id]["scrollTop"]= d.getElementById(id).scrollTop;
942
+ t.hidden[id]["scrollLeft"]= d.getElementById(id).scrollLeft;
943
+ }
944
+
945
+ if(fs["frame_"+id])
946
+ {
947
+ t.hidden[id]["toggle"]= editAreas[id]["displayed"];
948
+
949
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
950
+ scrollTop = fs["frame_"+ id].document.getElementById("result").scrollTop;
951
+ scrollLeft = fs["frame_"+ id].document.getElementById("result").scrollLeft;
952
+ }else{
953
+ scrollTop = d.getElementById(id).scrollTop;
954
+ scrollLeft = d.getElementById(id).scrollLeft;
955
+ }
956
+ t.hidden[id]["scrollTop"]= scrollTop;
957
+ t.hidden[id]["scrollLeft"]= scrollLeft;
958
+
959
+ if(editAreas[id]["displayed"]==true)
960
+ editAreaLoader.toggle_off(id);
961
+ }
962
+
963
+ // hide toggle button and debug box
964
+ span= d.getElementById("EditAreaArroundInfos_"+id);
965
+ if(span){
966
+ span.style.display='none';
967
+ }
968
+
969
+ // hide textarea
970
+ d.getElementById(id).style.display= "none";
971
+ }
972
+ },
973
+
974
+ // restore hidden EditArea and normal textarea
975
+ show : function(id){
976
+ var fs= window.frames,d=document,t=this,span;
977
+ if((elem=d.getElementById(id)) && t.hidden[id])
978
+ {
979
+ elem.style.display= "inline";
980
+ elem.scrollTop= t.hidden[id]["scrollTop"];
981
+ elem.scrollLeft= t.hidden[id]["scrollLeft"];
982
+ span= d.getElementById("EditAreaArroundInfos_"+id);
983
+ if(span){
984
+ span.style.display='inline';
985
+ }
986
+
987
+ if(fs["frame_"+id])
988
+ {
989
+
990
+ // restore toggle button and debug box
991
+
992
+
993
+ // restore textarea
994
+ elem.style.display= "inline";
995
+
996
+ // restore EditArea
997
+ if(t.hidden[id]["toggle"]==true)
998
+ editAreaLoader.toggle_on(id);
999
+
1000
+ scrollTop = t.hidden[id]["scrollTop"];
1001
+ scrollLeft = t.hidden[id]["scrollLeft"];
1002
+
1003
+ if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
1004
+ fs["frame_"+ id].document.getElementById("result").scrollTop = scrollTop;
1005
+ fs["frame_"+ id].document.getElementById("result").scrollLeft = scrollLeft;
1006
+ }else{
1007
+ elem.scrollTop = scrollTop;
1008
+ elem.scrollLeft = scrollLeft;
1009
+ }
1010
+
1011
+ }
1012
+ // restore selection
1013
+ sel = t.hidden[id]["selectionRange"];
1014
+ t.setSelectionRange(id, sel["start"], sel["end"]);
1015
+ delete t.hidden[id];
1016
+ }
1017
+ },
1018
+
1019
+ // get the current file datas (for multi file editing mode)
1020
+ getCurrentFile : function(id){
1021
+ return this.execCommand(id, 'get_file', this.execCommand(id, 'curr_file'));
1022
+ },
1023
+
1024
+ // get the given file datas (for multi file editing mode)
1025
+ getFile : function(id, file_id){
1026
+ return this.execCommand(id, 'get_file', file_id);
1027
+ },
1028
+
1029
+ // get all the openned files datas (for multi file editing mode)
1030
+ getAllFiles : function(id){
1031
+ return this.execCommand(id, 'get_all_files()');
1032
+ },
1033
+
1034
+ // open a file (for multi file editing mode)
1035
+ openFile : function(id, file_infos){
1036
+ return this.execCommand(id, 'open_file', file_infos);
1037
+ },
1038
+
1039
+ // close the given file (for multi file editing mode)
1040
+ closeFile : function(id, file_id){
1041
+ return this.execCommand(id, 'close_file', file_id);
1042
+ },
1043
+
1044
+ // close the given file (for multi file editing mode)
1045
+ setFileEditedMode : function(id, file_id, to){
1046
+ var reg1,reg2;
1047
+ reg1 = new RegExp('\\\\', 'g');
1048
+ reg2 = new RegExp('"', 'g');
1049
+ return this.execCommand(id, 'set_file_edited_mode("'+ file_id.replace(reg1, '\\\\').replace(reg2, '\\"') +'", '+ to +')');
1050
+ },
1051
+
1052
+
1053
+ // allow to access to editarea functions and datas (for advanced users only)
1054
+ execCommand : function(id, cmd, fct_param){
1055
+ switch(cmd){
1056
+ case "EA_init":
1057
+ if(editAreas[id]['settings']["EA_init_callback"].length>0)
1058
+ eval(editAreas[id]['settings']["EA_init_callback"]+"('"+ id +"');");
1059
+ break;
1060
+ case "EA_delete":
1061
+ if(editAreas[id]['settings']["EA_delete_callback"].length>0)
1062
+ eval(editAreas[id]['settings']["EA_delete_callback"]+"('"+ id +"');");
1063
+ break;
1064
+ case "EA_submit":
1065
+ if(editAreas[id]['settings']["submit_callback"].length>0)
1066
+ eval(editAreas[id]['settings']["submit_callback"]+"('"+ id +"');");
1067
+ break;
1068
+ }
1069
+ if(window.frames["frame_"+id] && window.frames["frame_"+ id].editArea){
1070
+ if(fct_param!=undefined)
1071
+ return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +'(fct_param);');
1072
+ else
1073
+ return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');
1074
+ }
1075
+ return false;
1076
+ }
1077
+ };
1078
+
1079
+ var editAreaLoader= new EditAreaLoader();
1080
+ var editAreas= {};
1081
+
js/editarea/elements_functions.js ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****
2
+ * This page contains some general usefull functions for javascript
3
+ *
4
+ ****/
5
+
6
+
7
+ // need to redefine this functiondue to IE problem
8
+ function getAttribute( elm, aName ) {
9
+ var aValue,taName,i;
10
+ try{
11
+ aValue = elm.getAttribute( aName );
12
+ }catch(exept){}
13
+
14
+ if( ! aValue ){
15
+ for( i = 0; i < elm.attributes.length; i ++ ) {
16
+ taName = elm.attributes[i] .name.toLowerCase();
17
+ if( taName == aName ) {
18
+ aValue = elm.attributes[i] .value;
19
+ return aValue;
20
+ }
21
+ }
22
+ }
23
+ return aValue;
24
+ };
25
+
26
+ // need to redefine this function due to IE problem
27
+ function setAttribute( elm, attr, val ) {
28
+ if(attr=="class"){
29
+ elm.setAttribute("className", val);
30
+ elm.setAttribute("class", val);
31
+ }else{
32
+ elm.setAttribute(attr, val);
33
+ }
34
+ };
35
+
36
+ /* return a child element
37
+ elem: element we are searching in
38
+ elem_type: type of the eleemnt we are searching (DIV, A, etc...)
39
+ elem_attribute: attribute of the searched element that must match
40
+ elem_attribute_match: value that elem_attribute must match
41
+ option: "all" if must return an array of all children, otherwise return the first match element
42
+ depth: depth of search (-1 or no set => unlimited)
43
+ */
44
+ function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth)
45
+ {
46
+ if(!option)
47
+ var option="single";
48
+ if(!depth)
49
+ var depth=-1;
50
+ if(elem){
51
+ var children= elem.childNodes;
52
+ var result=null;
53
+ var results= [];
54
+ for (var x=0;x<children.length;x++) {
55
+ strTagName = new String(children[x].tagName);
56
+ children_class="?";
57
+ if(strTagName!= "undefined"){
58
+ child_attribute= getAttribute(children[x],elem_attribute);
59
+ if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){
60
+ if(option=="all"){
61
+ results.push(children[x]);
62
+ }else{
63
+ return children[x];
64
+ }
65
+ }
66
+ if(depth!=0){
67
+ result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);
68
+ if(option=="all"){
69
+ if(result.length>0){
70
+ results= results.concat(result);
71
+ }
72
+ }else if(result!=null){
73
+ return result;
74
+ }
75
+ }
76
+ }
77
+ }
78
+ if(option=="all")
79
+ return results;
80
+ }
81
+ return null;
82
+ };
83
+
84
+ function isChildOf(elem, parent){
85
+ if(elem){
86
+ if(elem==parent)
87
+ return true;
88
+ while(elem.parentNode != 'undefined'){
89
+ return isChildOf(elem.parentNode, parent);
90
+ }
91
+ }
92
+ return false;
93
+ };
94
+
95
+ function getMouseX(e){
96
+
97
+ if(e!=null && typeof(e.pageX)!="undefined"){
98
+ return e.pageX;
99
+ }else{
100
+ return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;
101
+ }
102
+ };
103
+
104
+ function getMouseY(e){
105
+ if(e!=null && typeof(e.pageY)!="undefined"){
106
+ return e.pageY;
107
+ }else{
108
+ return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;
109
+ }
110
+ };
111
+
112
+ function calculeOffsetLeft(r){
113
+ return calculeOffset(r,"offsetLeft")
114
+ };
115
+
116
+ function calculeOffsetTop(r){
117
+ return calculeOffset(r,"offsetTop")
118
+ };
119
+
120
+ function calculeOffset(element,attr){
121
+ var offset=0;
122
+ while(element){
123
+ offset+=element[attr];
124
+ element=element.offsetParent
125
+ }
126
+ return offset;
127
+ };
128
+
129
+ /** return the computed style
130
+ * @param: elem: the reference to the element
131
+ * @param: prop: the name of the css property
132
+ */
133
+ function get_css_property(elem, prop)
134
+ {
135
+ if(document.defaultView)
136
+ {
137
+ return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
138
+ }
139
+ else if(elem.currentStyle)
140
+ {
141
+ var prop = prop.replace(/-\D/gi, function(sMatch)
142
+ {
143
+ return sMatch.charAt(sMatch.length - 1).toUpperCase();
144
+ });
145
+ return elem.currentStyle[prop];
146
+ }
147
+ else return null;
148
+ }
149
+
150
+ /****
151
+ * Moving an element
152
+ ***/
153
+
154
+ var _mCE; // currently moving element
155
+
156
+ /* allow to move an element in a window
157
+ e: the event
158
+ id: the id of the element
159
+ frame: the frame of the element
160
+ ex of use:
161
+ in html: <img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["this_frame_id"]);' .../>
162
+ or
163
+ in javascript: document.getElementById("my_div").onmousedown= start_move_element
164
+ */
165
+ function start_move_element(e, id, frame){
166
+ var elem_id=(e.target || e.srcElement).id;
167
+ if(id)
168
+ elem_id=id;
169
+ if(!frame)
170
+ frame=window;
171
+ if(frame.event)
172
+ e=frame.event;
173
+
174
+ _mCE= frame.document.getElementById(elem_id);
175
+ _mCE.frame=frame;
176
+ frame.document.onmousemove= move_element;
177
+ frame.document.onmouseup= end_move_element;
178
+ /*_mCE.onmousemove= move_element;
179
+ _mCE.onmouseup= end_move_element;*/
180
+
181
+ //alert(_mCE.frame.document.body.offsetHeight);
182
+
183
+ mouse_x= getMouseX(e);
184
+ mouse_y= getMouseY(e);
185
+ //window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
186
+ _mCE.start_pos_x = mouse_x - (_mCE.style.left.replace("px","") || calculeOffsetLeft(_mCE));
187
+ _mCE.start_pos_y = mouse_y - (_mCE.style.top.replace("px","") || calculeOffsetTop(_mCE));
188
+ return false;
189
+ };
190
+
191
+ function end_move_element(e){
192
+ _mCE.frame.document.onmousemove= "";
193
+ _mCE.frame.document.onmouseup= "";
194
+ _mCE=null;
195
+ };
196
+
197
+ function move_element(e){
198
+ var newTop,newLeft,maxLeft;
199
+
200
+ if( _mCE.frame && _mCE.frame.event )
201
+ e=_mCE.frame.event;
202
+ newTop = getMouseY(e) - _mCE.start_pos_y;
203
+ newLeft = getMouseX(e) - _mCE.start_pos_x;
204
+
205
+ maxLeft = _mCE.frame.document.body.offsetWidth- _mCE.offsetWidth;
206
+ max_top = _mCE.frame.document.body.offsetHeight- _mCE.offsetHeight;
207
+ newTop = Math.min(Math.max(0, newTop), max_top);
208
+ newLeft = Math.min(Math.max(0, newLeft), maxLeft);
209
+
210
+ _mCE.style.top = newTop+"px";
211
+ _mCE.style.left = newLeft+"px";
212
+ return false;
213
+ };
214
+
215
+ /***
216
+ * Managing a textarea (this part need the navigator infos from editAreaLoader
217
+ ***/
218
+
219
+ var nav= editAreaLoader.nav;
220
+
221
+ // allow to get infos on the selection: array(start, end)
222
+ function getSelectionRange(textarea){
223
+ return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
224
+ };
225
+
226
+ // allow to set the selection
227
+ function setSelectionRange(t, start, end){
228
+ t.focus();
229
+
230
+ start = Math.max(0, Math.min(t.value.length, start));
231
+ end = Math.max(start, Math.min(t.value.length, end));
232
+
233
+ if( nav.isOpera && nav.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
234
+ t.selectionEnd = 1;
235
+ t.selectionStart = 0;
236
+ t.selectionEnd = 1;
237
+ t.selectionStart = 0;
238
+ }
239
+ t.selectionStart = start;
240
+ t.selectionEnd = end;
241
+ //textarea.setSelectionRange(start, end);
242
+
243
+ if(nav.isIE)
244
+ set_IE_selection(t);
245
+ };
246
+
247
+
248
+ // set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
249
+ function get_IE_selection(t){
250
+ var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;
251
+ if(t && t.focused)
252
+ {
253
+ if(!t.ea_line_height)
254
+ { // calculate the lineHeight
255
+ div= d.createElement("div");
256
+ div.style.fontFamily= get_css_property(t, "font-family");
257
+ div.style.fontSize= get_css_property(t, "font-size");
258
+ div.style.visibility= "hidden";
259
+ div.innerHTML="0";
260
+ d.body.appendChild(div);
261
+ t.ea_line_height= div.offsetHeight;
262
+ d.body.removeChild(div);
263
+ }
264
+ //t.focus();
265
+ range = d.selection.createRange();
266
+ try
267
+ {
268
+ stored_range = range.duplicate();
269
+ stored_range.moveToElementText( t );
270
+ stored_range.setEndPoint( 'EndToEnd', range );
271
+ if(stored_range.parentElement() == t){
272
+ // the range don't take care of empty lines in the end of the selection
273
+ elem = t;
274
+ scrollTop = 0;
275
+ while(elem.parentNode){
276
+ scrollTop+= elem.scrollTop;
277
+ elem = elem.parentNode;
278
+ }
279
+
280
+ // var scrollTop= t.scrollTop + document.body.scrollTop;
281
+
282
+ // var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
283
+ relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
284
+ // alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
285
+ line_start = Math.round((relative_top / t.ea_line_height) +1);
286
+
287
+ line_nb = Math.round(range.boundingHeight / t.ea_line_height);
288
+
289
+ range_start = stored_range.text.length - range.text.length;
290
+ tab = t.value.substr(0, range_start).split("\n");
291
+ range_start += (line_start - tab.length)*2; // add missing empty lines to the selection
292
+ t.selectionStart = range_start;
293
+
294
+ range_end = t.selectionStart + range.text.length;
295
+ tab = t.value.substr(0, range_start + range.text.length).split("\n");
296
+ range_end += (line_start + line_nb - 1 - tab.length)*2;
297
+ t.selectionEnd = range_end;
298
+ }
299
+ }
300
+ catch(e){}
301
+ }
302
+ if( t && t.id )
303
+ {
304
+ setTimeout("get_IE_selection(document.getElementById('"+ t.id +"'));", 50);
305
+ }
306
+ };
307
+
308
+ function IE_textarea_focus(){
309
+ event.srcElement.focused= true;
310
+ }
311
+
312
+ function IE_textarea_blur(){
313
+ event.srcElement.focused= false;
314
+ }
315
+
316
+ // select the text for IE (take into account the \r difference)
317
+ function set_IE_selection( t ){
318
+ var nbLineStart,nbLineStart,nbLineEnd,range;
319
+ if(!window.closed){
320
+ nbLineStart=t.value.substr(0, t.selectionStart).split("\n").length - 1;
321
+ nbLineEnd=t.value.substr(0, t.selectionEnd).split("\n").length - 1;
322
+ try
323
+ {
324
+ range = document.selection.createRange();
325
+ range.moveToElementText( t );
326
+ range.setEndPoint( 'EndToStart', range );
327
+ range.moveStart('character', t.selectionStart - nbLineStart);
328
+ range.moveEnd('character', t.selectionEnd - nbLineEnd - (t.selectionStart - nbLineStart) );
329
+ range.select();
330
+ }
331
+ catch(e){}
332
+ }
333
+ };
334
+
335
+
336
+ editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";
js/editarea/highlight.js ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // change_to: "on" or "off"
2
+ EditArea.prototype.change_highlight= function(change_to){
3
+ if(this.settings["syntax"].length==0 && change_to==false){
4
+ this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
5
+ this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
6
+ return false;
7
+ }
8
+
9
+ if(this.do_highlight==change_to)
10
+ return false;
11
+
12
+
13
+ this.getIESelection();
14
+ var pos_start= this.textarea.selectionStart;
15
+ var pos_end= this.textarea.selectionEnd;
16
+
17
+ if(this.do_highlight===true || change_to==false)
18
+ this.disable_highlight();
19
+ else
20
+ this.enable_highlight();
21
+ this.textarea.focus();
22
+ this.textarea.selectionStart = pos_start;
23
+ this.textarea.selectionEnd = pos_end;
24
+ this.setIESelection();
25
+
26
+ };
27
+
28
+ EditArea.prototype.disable_highlight= function(displayOnly){
29
+ var t= this, a=t.textarea, new_Obj, old_class, new_class;
30
+
31
+ t.selection_field.innerHTML="";
32
+ t.selection_field_text.innerHTML="";
33
+ t.content_highlight.style.visibility="hidden";
34
+ // replacing the node is far more faster than deleting it's content in firefox
35
+ new_Obj= t.content_highlight.cloneNode(false);
36
+ new_Obj.innerHTML= "";
37
+ t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
38
+ t.content_highlight.parentNode.removeChild(t.content_highlight);
39
+ t.content_highlight= new_Obj;
40
+ old_class= parent.getAttribute( a,"class" );
41
+ if(old_class){
42
+ new_class= old_class.replace( "hidden","" );
43
+ parent.setAttribute( a, "class", new_class );
44
+ }
45
+
46
+ a.style.backgroundColor="transparent"; // needed in order to see the bracket finders
47
+
48
+ //var icon= document.getElementById("highlight");
49
+ //setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
50
+ //t.restoreClass(icon);
51
+ //t.switchClass(icon,'editAreaButtonNormal');
52
+ t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
53
+ t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
54
+
55
+ t.do_highlight=false;
56
+
57
+ t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
58
+ if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
59
+ t.change_smooth_selection_mode(false);
60
+ }
61
+
62
+ // this.textarea.style.backgroundColor="#FFFFFF";
63
+ };
64
+
65
+ EditArea.prototype.enable_highlight= function(){
66
+ var t=this, a=t.textarea, new_class;
67
+ t.show_waiting_screen();
68
+
69
+ t.content_highlight.style.visibility="visible";
70
+ new_class =parent.getAttribute(a,"class")+" hidden";
71
+ parent.setAttribute( a, "class", new_class );
72
+
73
+ // IE can't manage mouse click outside text range without this
74
+ if( t.isIE )
75
+ a.style.backgroundColor="#FFFFFF";
76
+
77
+ t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
78
+ t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
79
+
80
+ t.smooth_selection_before_highlight=t.smooth_selection;
81
+ if(!t.smooth_selection)
82
+ t.change_smooth_selection_mode(true);
83
+ t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
84
+
85
+
86
+ t.do_highlight=true;
87
+ t.resync_highlight();
88
+
89
+ t.hide_waiting_screen();
90
+ };
91
+
92
+ /**
93
+ * Ask to update highlighted text
94
+ * @param Array infos - Array of datas returned by EditArea.get_selection_infos()
95
+ */
96
+ EditArea.prototype.maj_highlight= function(infos){
97
+ // for speed mesure
98
+ var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
99
+ var t=this, hightlighted_text, updated_highlight;
100
+ var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
101
+
102
+ if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
103
+ return;
104
+
105
+ // OPTIMISATION: will search to update only changed lines
106
+ if(t.reload_highlight===true){
107
+ t.reload_highlight=false;
108
+ }else if(textToHighlight.length==0){
109
+ textToHighlight="\n ";
110
+ }else{
111
+ // get text change datas
112
+ changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
113
+
114
+ // check if it can only reparse the changed text
115
+ trace_new = t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
116
+ trace_last = t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
117
+ doSyntaxOpti = ( trace_new == trace_last );
118
+
119
+ // check if the difference comes only from a new line created
120
+ // => we have to remember that the editor can automaticaly add tabulation or space after the new line)
121
+ if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
122
+ {
123
+ doSyntaxOpti = true;
124
+ }
125
+
126
+ // we do the syntax optimisation
127
+ if( doSyntaxOpti ){
128
+
129
+ tps_middle_opti=new Date().getTime();
130
+
131
+ stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
132
+ if(changes.lineStart>0)
133
+ stay_begin+= "\n";
134
+ stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
135
+ if(stay_end.length>0)
136
+ stay_end= "\n"+stay_end;
137
+
138
+ // Final check to see that we're not in the middle of span tags
139
+ if( stay_begin.split('<span').length != stay_begin.split('</span').length
140
+ || stay_end.split('<span').length != stay_end.split('</span').length )
141
+ {
142
+ doSyntaxOpti = false;
143
+ stay_end = '';
144
+ stay_begin = '';
145
+ }
146
+ else
147
+ {
148
+ if(stay_begin.length==0 && changes.posLastEnd==-1)
149
+ changes.newTextLine+="\n";
150
+ textToHighlight=changes.newTextLine;
151
+ }
152
+ }
153
+ if(t.settings["debug"]){
154
+ var ch =changes;
155
+ debug_opti= ( doSyntaxOpti?"Optimisation": "No optimisation" )
156
+ +" start: "+ch.posStart +"("+ch.lineStart+")"
157
+ +" end_new: "+ ch.posNewEnd+"("+ch.lineNewEnd+")"
158
+ +" end_last: "+ ch.posLastEnd+"("+ch.lineLastEnd+")"
159
+ +"\nchanged_text: "+ch.newText+" => trace: "+trace_new
160
+ +"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
161
+ //debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
162
+ + "\nchanged_line: "+ch.newTextLine
163
+ + "\nlast_changed_line: "+ch.lastTextLine
164
+ +"\nstay_begin: "+ stay_begin.slice(-100)
165
+ +"\nstay_end: "+ stay_end.substr( 0, 100 );
166
+ //debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
167
+ //debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
168
+
169
+ //debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
170
+ +"\n";
171
+ }
172
+
173
+
174
+ // END OPTIMISATION
175
+ }
176
+
177
+ tps_end_opti = new Date().getTime();
178
+
179
+ // apply highlight
180
+ updated_highlight = t.colorize_text(textToHighlight);
181
+ tpsAfterReg = new Date().getTime();
182
+
183
+ /***
184
+ * see if we can optimize for updating only the required part of the HTML code
185
+ *
186
+ * The goal here will be to find the text node concerned by the modification and to update it
187
+ */
188
+ //-------------------------------------------
189
+
190
+ // disable latest optimization tricks (introduced in 0.8.1 and removed in 0.8.2), TODO: check for another try later
191
+ doSyntaxOpti = doHtmlOpti = false;
192
+ if( doSyntaxOpti )
193
+ {
194
+ try
195
+ {
196
+ var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
197
+ replacedBloc = t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
198
+
199
+ lengthOld = replacedBloc.length;
200
+ lengthNew = updated_highlight.length;
201
+
202
+ // find the identical caracters at the beginning
203
+ for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
204
+ {
205
+ }
206
+ nbStart = i;
207
+ // find the identical caracters at the end
208
+ for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
209
+ {
210
+ }
211
+ nbEnd = i;
212
+ //console.log( nbStart, nbEnd, replacedBloc, updated_highlight );
213
+ // get the changes
214
+ lastHtml = replacedBloc.substring( nbStart, lengthOld - nbEnd );
215
+ newHtml = updated_highlight.substring( nbStart, lengthNew - nbEnd );
216
+
217
+ // We can do the optimisation only if we havn't touch to span elements
218
+ if( newHtml.indexOf('<span') == -1 && newHtml.indexOf('</span') == -1
219
+ && lastHtml.indexOf('<span') == -1 && lastHtml.indexOf('</span') == -1 )
220
+ {
221
+ var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
222
+ doHtmlOpti = true;
223
+ beginStr = t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
224
+ // fix special chars
225
+ newHtml = newHtml.replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&');
226
+
227
+ nbOpendedSpan = beginStr.split('<span').length - 1;
228
+ nbClosedSpan = beginStr.split('</span').length - 1;
229
+ // retrieve the previously opened span (Add 1 for the first level span?)
230
+ span = t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];
231
+
232
+ //--------[
233
+ // get the textNode to update
234
+
235
+ // if we're inside a span, we'll take the one that is opened (can be a parent of the current span)
236
+ parentSpan = span;
237
+ maxStartOffset = maxEndOffset = 0;
238
+
239
+ // it will be in the child of the root node
240
+ if( nbOpendedSpan == nbClosedSpan )
241
+ {
242
+ while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' )
243
+ {
244
+ parentSpan = parentSpan.parentNode;
245
+ }
246
+ }
247
+ // get the last opened span
248
+ else
249
+ {
250
+ maxStartOffset = maxEndOffset = beginStr.length + 1;
251
+ // move to parent node for each closed span found after the lastest open span
252
+ nbClosed = beginStr.substr( Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ).split('</span').length - 1;
253
+ while( nbClosed > 0 )
254
+ {
255
+ nbClosed--;
256
+ parentSpan = parentSpan.parentNode;
257
+ }
258
+
259
+ // find the position of the last opended tag
260
+ while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' && ( tmpMaxStartOffset = Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ) < ( tmpMaxEndOffset = Math.max( 0, beginStr.lastIndexOf( '</span', maxEndOffset - 1 ) ) ) )
261
+ {
262
+ maxStartOffset = tmpMaxStartOffset;
263
+ maxEndOffset = tmpMaxEndOffset;
264
+ }
265
+ }
266
+ // Note: maxEndOffset is no more used but maxStartOffset will be used
267
+
268
+ if( parentSpan.parentNode == t.content_highlight || parentSpan.parentNode.tagName == 'PRE' )
269
+ {
270
+ maxStartOffset = Math.max( 0, beginStr.indexOf( '<span' ) );
271
+ }
272
+
273
+ // find the matching text node (this will be one that will be at the end of the beginStr
274
+ if( maxStartOffset == beginStr.length )
275
+ {
276
+ nbSubSpanBefore = 0;
277
+ }
278
+ else
279
+ {
280
+ lastEndPos = Math.max( 0, beginStr.lastIndexOf( '>', maxStartOffset ) );
281
+
282
+ // count the number of sub spans
283
+ nbSubSpanBefore = beginStr.substr( lastEndPos ).split('<span').length-1;
284
+ }
285
+
286
+ // there is no sub-span before
287
+ if( nbSubSpanBefore == 0 )
288
+ {
289
+ textNode = parentSpan.firstChild;
290
+ }
291
+ // we need to find where is the text node modified
292
+ else
293
+ {
294
+ // take the last direct child (no sub-child)
295
+ lastSubSpan = parentSpan.getElementsByTagName('span')[ nbSubSpanBefore - 1 ];
296
+ while( lastSubSpan.parentNode != parentSpan )
297
+ {
298
+ lastSubSpan = lastSubSpan.parentNode;
299
+ }
300
+
301
+ // associate to next text node following the last sub span
302
+ if( lastSubSpan.nextSibling == null || lastSubSpan.nextSibling.nodeType != 3 )
303
+ {
304
+ textNode = document.createTextNode('');
305
+ lastSubSpan.parentNode.insertBefore( textNode, lastSubSpan.nextSibling );
306
+ }
307
+ else
308
+ {
309
+ textNode = lastSubSpan.nextSibling;
310
+ }
311
+ }
312
+ //--------]
313
+
314
+
315
+ //--------[
316
+ // update the textNode content
317
+
318
+ // number of caracters after the last opened of closed span
319
+ //nbUnchangedChars = ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 ? beginStr.length : beginStr.length - ( lastIndex + 1 );
320
+ //nbUnchangedChars = ? beginStr.length : beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
321
+
322
+ if( ( lastIndex = beginStr.lastIndexOf( '>' ) ) == -1 )
323
+ {
324
+ nbUnchangedChars = beginStr.length;
325
+ }
326
+ else
327
+ {
328
+ nbUnchangedChars = beginStr.substr( lastIndex + 1 ).replace( /&lt;/g, '<').replace( /&gt;/g, '>').replace( /&amp;/g, '&').length;
329
+ //nbUnchangedChars += beginStr.substr( ).replace( /&/g, '&amp;').replace( /</g, '&lt;').replace( />/g, '&gt;').length - beginStr.length;
330
+ }
331
+ //alert( nbUnchangedChars );
332
+ // console.log( span, textNode, nbOpendedSpan,nbClosedSpan, span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
333
+ // alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length );
334
+ // console.log( nbUnchangedChars, lastIndex, beginStr.length, beginStr.replace(/&/g, '&amp;'), lastHtml.length, '|', newHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/g, 'r'), lastHtml.replace( /\t/g, 't').replace( /\n/g, 'n').replace( /\r/, 'r') );
335
+ // console.log( textNode.data.replace(/&/g, '&amp;') );
336
+ // IE only manage \r for cariage return in textNode and not \n or \r\n
337
+ if( t.isIE )
338
+ {
339
+ nbUnchangedChars -= ( beginStr.substr( beginStr.length - nbUnchangedChars ).split("\n").length - 1 );
340
+ //alert( textNode.data.replace(/\r/g, '_r').replace(/\n/g, '_n'));
341
+ textNode.replaceData( nbUnchangedChars, lastHtml.replace(/\n/g, '').length, newHtml.replace(/\n/g, '') );
342
+ }
343
+ else
344
+ {
345
+ textNode.replaceData( nbUnchangedChars, lastHtml.length, newHtml );
346
+ }
347
+ //--------]
348
+ }
349
+ }
350
+ // an exception shouldn't occured but if replaceData failed at least it won't break everything
351
+ catch( e )
352
+ {
353
+ // throw e;
354
+ // console.log( e );
355
+ doHtmlOpti = false;
356
+ }
357
+
358
+ }
359
+
360
+ /*** END HTML update's optimisation ***/
361
+ // end test
362
+
363
+ // console.log( (TPS6-TPS5), (TPS5-TPS4), (TPS4-TPS3), (TPS3-TPS2), (TPS2-TPS1), _CPT );
364
+ // get the new highlight content
365
+ tpsAfterOpti2 = new Date().getTime();
366
+ hightlighted_text = stay_begin + updated_highlight + stay_end;
367
+ if( !doHtmlOpti )
368
+ {
369
+ // 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*))
370
+ var new_Obj= t.content_highlight.cloneNode(false);
371
+ if( ( t.isIE && t.isIE < 8 ) || ( t.isOpera && t.isOpera < 9.6 ) )
372
+ new_Obj.innerHTML= "<pre><span class='"+ t.settings["syntax"] +"'>" + hightlighted_text + "</span></pre>";
373
+ else
374
+ new_Obj.innerHTML= "<span class='"+ t.settings["syntax"] +"'>"+ hightlighted_text +"</span>";
375
+
376
+ t.content_highlight.parentNode.replaceChild(new_Obj, t.content_highlight);
377
+
378
+ t.content_highlight= new_Obj;
379
+ }
380
+
381
+ t.last_text_to_highlight= infos["full_text"];
382
+ t.last_hightlighted_text= hightlighted_text;
383
+
384
+ tps3=new Date().getTime();
385
+
386
+ if(t.settings["debug"]){
387
+ //lineNumber=tab_text.length;
388
+ //t.debug.value+=" \nNB char: "+_$("src").value.length+" Nb line: "+ lineNumber;
389
+
390
+ t.debug.value= "Tps optimisation "+(tps_end_opti-tps_start)
391
+ +" | tps reg exp: "+ (tpsAfterReg-tps_end_opti)
392
+ +" | tps opti HTML : "+ (tpsAfterOpti2-tpsAfterReg) + ' '+ ( doHtmlOpti ? 'yes' : 'no' )
393
+ +" | tps update highlight content: "+ (tps3-tpsAfterOpti2)
394
+ +" | tpsTotal: "+ (tps3-tps_start)
395
+ + "("+tps3+")\n"+ debug_opti;
396
+ // t.debug.value+= "highlight\n"+hightlighted_text;*/
397
+ }
398
+
399
+ };
400
+
401
+ EditArea.prototype.resync_highlight= function(reload_now){
402
+ this.reload_highlight=true;
403
+ this.last_text_to_highlight="";
404
+ this.focus();
405
+ if(reload_now)
406
+ this.check_line_selection(false);
407
+ };
js/editarea/images/autocompletion.gif ADDED
Binary file
js/editarea/images/close.gif ADDED
Binary file
js/editarea/images/fullscreen.gif ADDED
Binary file
js/editarea/images/go_to_line.gif ADDED
Binary file
js/editarea/images/help.gif ADDED
Binary file
js/editarea/images/highlight.gif ADDED
Binary file
js/editarea/images/load.gif ADDED
Binary file
js/editarea/images/move.gif ADDED
Binary file
js/editarea/images/newdocument.gif ADDED
Binary file
js/editarea/images/opacity.png ADDED
Binary file
js/editarea/images/processing.gif ADDED
Binary file
js/editarea/images/redo.gif ADDED
Binary file
js/editarea/images/reset_highlight.gif ADDED
Binary file
js/editarea/images/save.gif ADDED
Binary file
js/editarea/images/search.gif ADDED
Binary file
js/editarea/images/smooth_selection.gif ADDED
Binary file
js/editarea/images/spacer.gif ADDED
Binary file
js/editarea/images/statusbar_resize.gif ADDED
Binary file
js/editarea/images/undo.gif ADDED
Binary file
js/editarea/images/word_wrap.gif ADDED
Binary file
js/editarea/keyboard.js ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 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"};
2
+
3
+
4
+
5
+ function keyDown(e){
6
+ if(!e){ // if IE
7
+ e=event;
8
+ }
9
+
10
+ // send the event to the plugins
11
+ for(var i in editArea.plugins){
12
+ if(typeof(editArea.plugins[i].onkeydown)=="function"){
13
+ if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging
14
+ if(editArea.isIE)
15
+ e.keyCode=0;
16
+ return false;
17
+ }
18
+ }
19
+ }
20
+
21
+ var target_id=(e.target || e.srcElement).id;
22
+ var use=false;
23
+ if (EA_keys[e.keyCode])
24
+ letter=EA_keys[e.keyCode];
25
+ else
26
+ letter=String.fromCharCode(e.keyCode);
27
+
28
+ var low_letter= letter.toLowerCase();
29
+
30
+ if(letter=="Page up" && !AltPressed(e) && !editArea.isOpera){
31
+ editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
32
+ use=true;
33
+ }else if(letter=="Page down" && !AltPressed(e) && !editArea.isOpera){
34
+ editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
35
+ use=true;
36
+ }else if(editArea.is_editable==false){
37
+ // do nothing but also do nothing else (allow to navigate with page up and page down)
38
+ return true;
39
+ }else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){
40
+ if(ShiftPressed(e))
41
+ editArea.execCommand("invert_tab_selection");
42
+ else
43
+ editArea.execCommand("tab_selection");
44
+
45
+ use=true;
46
+ if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) ) // opera && firefox mac can't cancel tabulation events...
47
+ setTimeout("editArea.execCommand('focus');", 1);
48
+ }else if(letter=="Entrer" && target_id=="textarea"){
49
+ if(editArea.press_enter())
50
+ use=true;
51
+ }else if(letter=="Entrer" && target_id=="area_search"){
52
+ editArea.execCommand("area_search");
53
+ use=true;
54
+ }else if(letter=="Esc"){
55
+ editArea.execCommand("close_all_inline_popup", e);
56
+ use=true;
57
+ }else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
58
+ switch(low_letter){
59
+ case "f":
60
+ editArea.execCommand("area_search");
61
+ use=true;
62
+ break;
63
+ case "r":
64
+ editArea.execCommand("area_replace");
65
+ use=true;
66
+ break;
67
+ case "q":
68
+ editArea.execCommand("close_all_inline_popup", e);
69
+ use=true;
70
+ break;
71
+ case "h":
72
+ editArea.execCommand("change_highlight");
73
+ use=true;
74
+ break;
75
+ case "g":
76
+ setTimeout("editArea.execCommand('go_to_line');", 5); // the prompt stop the return false otherwise
77
+ use=true;
78
+ break;
79
+ case "e":
80
+ editArea.execCommand("show_help");
81
+ use=true;
82
+ break;
83
+ case "z":
84
+ use=true;
85
+ editArea.execCommand("undo");
86
+ break;
87
+ case "y":
88
+ use=true;
89
+ editArea.execCommand("redo");
90
+ break;
91
+ default:
92
+ break;
93
+ }
94
+ }
95
+
96
+ // check to disable the redo possibility if the textarea content change
97
+ if(editArea.next.length > 0){
98
+ setTimeout("editArea.check_redo();", 10);
99
+ }
100
+
101
+ setTimeout("editArea.check_file_changes();", 10);
102
+
103
+
104
+ if(use){
105
+ // 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
106
+ if(editArea.isIE)
107
+ e.keyCode=0;
108
+ return false;
109
+ }
110
+ //alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
111
+
112
+ return true;
113
+
114
+ };
115
+
116
+
117
+ // return true if Alt key is pressed
118
+ function AltPressed(e) {
119
+ if (window.event) {
120
+ return (window.event.altKey);
121
+ } else {
122
+ if(e.modifiers)
123
+ return (e.altKey || (e.modifiers % 2));
124
+ else
125
+ return e.altKey;
126
+ }
127
+ };
128
+
129
+ // return true if Ctrl key is pressed
130
+ function CtrlPressed(e) {
131
+ if (window.event) {
132
+ return (window.event.ctrlKey);
133
+ } else {
134
+ return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
135
+ }
136
+ };
137
+
138
+ // return true if Shift key is pressed
139
+ function ShiftPressed(e) {
140
+ if (window.event) {
141
+ return (window.event.shiftKey);
142
+ } else {
143
+ return (e.shiftKey || (e.modifiers>3));
144
+ }
145
+ };
js/editarea/langs/bg.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Bulgarian translation
3
+ * Author: Valentin Hristov
4
+ * Company: SOFTKIT Bulgarian
5
+ * Site: http://www.softkit-bg.com
6
+ */
7
+ editAreaLoader.lang["bg"]={
8
+ new_document: "нов документ",
9
+ search_button: "търсене и замяна",
10
+ search_command: "търси следващия / отвори прозорец с търсачка",
11
+ search: "търсене",
12
+ replace: "замяна",
13
+ replace_command: "замяна / отвори прозорец с търсачка",
14
+ find_next: "намери следващия",
15
+ replace_all: "замени всички",
16
+ reg_exp: "реголярни изрази",
17
+ match_case: "чуствителен към регистъра",
18
+ not_found: "няма резултат.",
19
+ occurrence_replaced: "замяната е осъществена.",
20
+ search_field_empty: "Полето за търсене е празно",
21
+ restart_search_at_begin: "До края на документа. Почни с началото.",
22
+ move_popup: "премести прозореца с търсачката",
23
+ font_size: "--Размер на шрифта--",
24
+ go_to_line: "премени към реда",
25
+ go_to_line_prompt: "премени към номера на реда:",
26
+ undo: "отмени",
27
+ redo: "върни",
28
+ change_smooth_selection: "включи/изключи някой от функциите за преглед (по красиво, но повече натоварва)",
29
+ highlight: "превключване на оцветяване на синтаксиса включена/изключена",
30
+ reset_highlight: "въстанови оцветяване на синтаксиса (ако не е синхронизиран с текста)",
31
+ word_wrap: "режим на пренасяне на дълги редове",
32
+ help: "за програмата",
33
+ save: "съхрани",
34
+ load: "зареди",
35
+ line_abbr: "Стр",
36
+ char_abbr: "Стлб",
37
+ position: "Позиция",
38
+ total: "Всичко",
39
+ close_popup: "затвори прозореца",
40
+ shortcuts: "Бързи клавиши",
41
+ add_tab: "добави табулация в текста",
42
+ remove_tab: "премахни табулацията в текста",
43
+ about_notice: "Внимание: използвайте функцията оцветяване на синтаксиса само за малки текстове",
44
+ toggle: "Превключи редактор",
45
+ accesskey: "Бърз клавиш",
46
+ tab: "Tab",
47
+ shift: "Shift",
48
+ ctrl: "Ctrl",
49
+ esc: "Esc",
50
+ processing: "Зареждане...",
51
+ fullscreen: "на цял екран",
52
+ syntax_selection: "--Синтаксис--",
53
+ close_tab: "Затвори файла"
54
+ };
js/editarea/langs/cs.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["cs"]={
2
+ new_document: "Nový dokument",
3
+ search_button: "Najdi a nahraď",
4
+ search_command: "Hledej další / otevři vyhledávací pole",
5
+ search: "Hledej",
6
+ replace: "Nahraď",
7
+ replace_command: "Nahraď / otevři vyhledávací pole",
8
+ find_next: "Najdi další",
9
+ replace_all: "Nahraď vše",
10
+ reg_exp: "platné výrazy",
11
+ match_case: "vyhodnocené výrazy",
12
+ not_found: "nenalezené.",
13
+ occurrence_replaced: "výskyty nahrazené.",
14
+ search_field_empty: "Pole vyhledávání je prázdné",
15
+ restart_search_at_begin: "Dosažen konec souboru, začínám od začátku.",
16
+ move_popup: "Přesuň vyhledávací okno",
17
+ font_size: "--Velikost textu--",
18
+ go_to_line: "Přejdi na řádek",
19
+ go_to_line_prompt: "Přejdi na řádek:",
20
+ undo: "krok zpět",
21
+ redo: "znovu",
22
+ change_smooth_selection: "Povolit nebo zakázat některé ze zobrazených funkcí (účelnější zobrazení požaduje větší zatížení procesoru)",
23
+ highlight: "Zvýrazňování syntaxe zap./vyp.",
24
+ reset_highlight: "Obnovit zvýraznění (v případě nesrovnalostí)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "O programu",
27
+ save: "Uložit",
28
+ load: "Otevřít",
29
+ line_abbr: "Ř.",
30
+ char_abbr: "S.",
31
+ position: "Pozice",
32
+ total: "Celkem",
33
+ close_popup: "Zavřít okno",
34
+ shortcuts: "Zkratky",
35
+ add_tab: "Přidat tabulování textu",
36
+ remove_tab: "Odtsranit tabulování textu",
37
+ about_notice: "Upozornění! Funkce zvýrazňování textu je k dispozici pouze pro malý text",
38
+ toggle: "Přepnout editor",
39
+ accesskey: "Přístupová klávesa",
40
+ tab: "Záložka",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Zpracovávám ...",
45
+ fullscreen: "Celá obrazovka",
46
+ syntax_selection: "--vyber zvýrazňovač--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/de.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["de"]={
2
+ new_document: "Neues Dokument",
3
+ search_button: "Suchen und Ersetzen",
4
+ search_command: "Weitersuchen / &ouml;ffne Suchfeld",
5
+ search: "Suchen",
6
+ replace: "Ersetzen",
7
+ replace_command: "Ersetzen / &ouml;ffne Suchfeld",
8
+ find_next: "Weitersuchen",
9
+ replace_all: "Ersetze alle Treffer",
10
+ reg_exp: "regul&auml;re Ausdr&uuml;cke",
11
+ match_case: "passt auf den Begriff<br />",
12
+ not_found: "Nicht gefunden.",
13
+ occurrence_replaced: "Die Vorkommen wurden ersetzt.",
14
+ search_field_empty: "Leeres Suchfeld",
15
+ restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
16
+ move_popup: "Suchfenster bewegen",
17
+ font_size: "--Schriftgr&ouml;&szlig;e--",
18
+ go_to_line: "Gehe zu Zeile",
19
+ go_to_line_prompt: "Gehe zu Zeilennummmer:",
20
+ undo: "R&uuml;ckg&auml;ngig",
21
+ redo: "Wiederherstellen",
22
+ change_smooth_selection: "Aktiviere/Deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
23
+ highlight: "Syntax Highlighting an- und ausschalten",
24
+ reset_highlight: "Highlighting zur&uuml;cksetzen (falls mit Text nicht konform)",
25
+ word_wrap: "Toggle word wrapping mode",
26
+ help: "Info",
27
+ save: "Speichern",
28
+ load: "&Ouml;ffnen",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Position",
32
+ total: "Gesamt",
33
+ close_popup: "Popup schlie&szlig;en",
34
+ shortcuts: "Shortcuts",
35
+ add_tab: "Tab zum Text hinzuf&uuml;gen",
36
+ remove_tab: "Tab aus Text entfernen",
37
+ about_notice: "Bemerkung: Syntax Highlighting ist nur f&uuml;r kurze Texte",
38
+ toggle: "Editor an- und ausschalten",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "In Bearbeitung...",
45
+ fullscreen: "Full-Screen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/dk.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["dk"]={
2
+ new_document: "nyt tomt dokument",
3
+ search_button: "s&oslash;g og erstat",
4
+ search_command: "find n&aelig;ste / &aring;ben s&oslash;gefelt",
5
+ search: "s&oslash;g",
6
+ replace: "erstat",
7
+ replace_command: "erstat / &aring;ben s&oslash;gefelt",
8
+ find_next: "find n&aelig;ste",
9
+ replace_all: "erstat alle",
10
+ reg_exp: "regular expressions",
11
+ match_case: "forskel på store/sm&aring; bogstaver<br />",
12
+ not_found: "not found.",
13
+ occurrence_replaced: "occurences replaced.",
14
+ search_field_empty: "Search field empty",
15
+ restart_search_at_begin: "End of area reached. Restart at begin.",
16
+ move_popup: "flyt søgepopup",
17
+ font_size: "--Skriftstørrelse--",
18
+ go_to_line: "g&aring; til linie",
19
+ go_to_line_prompt: "gå til linienummer:",
20
+ undo: "fortryd",
21
+ redo: "gentag",
22
+ change_smooth_selection: "sl&aring; display funktioner til/fra (smartere display men mere CPU kr&aelig;vende)",
23
+ highlight: "sl&aring; syntax highlight til/fra",
24
+ reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "om",
27
+ save: "gem",
28
+ load: "hent",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Position",
32
+ total: "Total",
33
+ close_popup: "luk popup",
34
+ shortcuts: "Genveje",
35
+ add_tab: "tilf&oslash;j tabulation til tekst",
36
+ remove_tab: "fjern tabulation fra tekst",
37
+ about_notice: "Husk: syntax highlight funktionen b&oslash;r kun bruge til sm&aring; tekster",
38
+ toggle: "Sl&aring; editor til / fra",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Skift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Processing...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/en.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["en"]={
2
+ new_document: "new empty document",
3
+ search_button: "search and replace",
4
+ search_command: "search next / open search area",
5
+ search: "search",
6
+ replace: "replace",
7
+ replace_command: "replace / open search area",
8
+ find_next: "find next",
9
+ replace_all: "replace all",
10
+ reg_exp: "regular expressions",
11
+ match_case: "match case",
12
+ not_found: "not found.",
13
+ occurrence_replaced: "occurences replaced.",
14
+ search_field_empty: "Search field empty",
15
+ restart_search_at_begin: "End of area reached. Restart at begin.",
16
+ move_popup: "move search popup",
17
+ font_size: "--Font size--",
18
+ go_to_line: "go to line",
19
+ go_to_line_prompt: "go to line number:",
20
+ undo: "undo",
21
+ redo: "redo",
22
+ change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
23
+ highlight: "toggle syntax highlight on/off",
24
+ reset_highlight: "reset highlight (if desyncronized from text)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "about",
27
+ save: "save",
28
+ load: "load",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Position",
32
+ total: "Total",
33
+ close_popup: "close popup",
34
+ shortcuts: "Shortcuts",
35
+ add_tab: "add tabulation to text",
36
+ remove_tab: "remove tabulation to text",
37
+ about_notice: "Notice: syntax highlight function is only for small text",
38
+ toggle: "Toggle editor",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Processing...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/eo.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["eo"]={
2
+ new_document: "nova dokumento (vakigas la enhavon)",
3
+ search_button: "ser&#265;i / anstata&#365;igi",
4
+ search_command: "pluser&#265;i / malfermi la ser&#265;o-fenestron",
5
+ search: "ser&#265;i",
6
+ replace: "anstata&#365;igi",
7
+ replace_command: "anstata&#365;igi / malfermi la ser&#265;o-fenestron",
8
+ find_next: "ser&#265;i",
9
+ replace_all: "anstata&#365;igi &#265;ion",
10
+ reg_exp: "regula esprimo",
11
+ match_case: "respekti la usklecon",
12
+ not_found: "ne trovita.",
13
+ occurrence_replaced: "anstata&#365;igoj plenumitaj.",
14
+ search_field_empty: "La kampo estas malplena.",
15
+ restart_search_at_begin: "Fino de teksto &#285;isrirata, &#265;u da&#365;rigi el la komenco?",
16
+ move_popup: "movi la ser&#265;o-fenestron",
17
+ font_size: "--Tipara grando--",
18
+ go_to_line: "iri al la linio",
19
+ go_to_line_prompt: "iri al la linio numero:",
20
+ undo: "rezigni",
21
+ redo: "refari",
22
+ change_smooth_selection: "ebligi/malebligi la funkcioj de vidigo (pli bona vidigo, sed pli da &#349;ar&#285;o de la &#265;eforgano)",
23
+ highlight: "ebligi/malebligi la sintaksan kolorigon",
24
+ reset_highlight: "repravalorizi la sintaksan kolorigon (se malsinkronigon de la teksto)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "pri",
27
+ save: "registri",
28
+ load: "&#349;ar&#285;i",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Sg",
31
+ position: "Pozicio",
32
+ total: "Sumo",
33
+ close_popup: "fermi la &#349;prucfenestron",
34
+ shortcuts: "Fulmoklavo",
35
+ add_tab: "aldoni tabon en la tekston",
36
+ remove_tab: "forigi tablon el la teksto",
37
+ about_notice: "Noto: la sintaksa kolorigo estas nur prikalkulita por mallongaj tekstoj.",
38
+ toggle: "baskuligi la redaktilon",
39
+ accesskey: "Fulmoklavo",
40
+ tab: "Tab",
41
+ shift: "Maj",
42
+ ctrl: "Ktrl",
43
+ esc: "Esk",
44
+ processing: "&#349;argante...",
45
+ fullscreen: "plenekrane",
46
+ syntax_selection: "--Sintakso--",
47
+ close_tab: "Fermi la dosieron"
48
+ };
js/editarea/langs/es.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["es"]={
2
+ new_document: "nuevo documento vacío",
3
+ search_button: "buscar y reemplazar",
4
+ search_command: "buscar siguiente / abrir área de búsqueda",
5
+ search: "buscar",
6
+ replace: "reemplazar",
7
+ replace_command: "reemplazar / abrir área de búsqueda",
8
+ find_next: "encontrar siguiente",
9
+ replace_all: "reemplazar todos",
10
+ reg_exp: "expresiones regulares",
11
+ match_case: "coincidir capitalización",
12
+ not_found: "no encontrado.",
13
+ occurrence_replaced: "ocurrencias reemplazadas.",
14
+ search_field_empty: "Campo de búsqueda vacío",
15
+ restart_search_at_begin: "Se ha llegado al final del área. Se va a seguir desde el principio.",
16
+ move_popup: "mover la ventana de búsqueda",
17
+ font_size: "--Tamaño de la fuente--",
18
+ go_to_line: "ir a la línea",
19
+ go_to_line_prompt: "ir a la línea número:",
20
+ undo: "deshacer",
21
+ redo: "rehacer",
22
+ change_smooth_selection: "activar/desactivar algunas características de visualización (visualización más inteligente pero más carga de CPU)",
23
+ highlight: "intercambiar resaltado de sintaxis",
24
+ reset_highlight: "reinicializar resaltado (si no esta sincronizado con el texto)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "acerca",
27
+ save: "guardar",
28
+ load: "cargar",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Posición",
32
+ total: "Total",
33
+ close_popup: "recuadro de cierre",
34
+ shortcuts: "Atajos",
35
+ add_tab: "añadir tabulado al texto",
36
+ remove_tab: "borrar tabulado del texto",
37
+ about_notice: "Aviso: el resaltado de sintaxis sólo funciona para texto pequeño",
38
+ toggle: "Cambiar editor",
39
+ accesskey: "Tecla de acceso",
40
+ tab: "Tab",
41
+ shift: "Mayúsc",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Procesando...",
45
+ fullscreen: "pantalla completa",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/fi.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["fi"]={
2
+ new_document: "uusi tyhjä dokumentti",
3
+ search_button: "etsi ja korvaa",
4
+ search_command: "etsi seuraava / avaa etsintävalikko",
5
+ search: "etsi",
6
+ replace: "korvaa",
7
+ replace_command: "korvaa / avaa etsintävalikko",
8
+ find_next: "etsi seuraava",
9
+ replace_all: "korvaa kaikki",
10
+ reg_exp: "säännölliset lausekkeet",
11
+ match_case: "täsmää kirjainkokoon",
12
+ not_found: "ei löytynyt.",
13
+ occurrence_replaced: "esiintymää korvattu.",
14
+ search_field_empty: "Haettava merkkijono on tyhjä",
15
+ restart_search_at_begin: "Alueen loppu saavutettiin. Aloitetaan alusta.",
16
+ move_popup: "siirrä etsintävalikkoa",
17
+ font_size: "--Fontin koko--",
18
+ go_to_line: "siirry riville",
19
+ go_to_line_prompt: "mene riville:",
20
+ undo: "peruuta",
21
+ redo: "tee uudelleen",
22
+ change_smooth_selection: "kytke/sammuta joitakin näyttötoimintoja (Älykkäämpi toiminta, mutta suurempi CPU kuormitus)",
23
+ highlight: "kytke syntaksikorostus päälle/pois",
24
+ reset_highlight: "resetoi syntaksikorostus (jos teksti ei ole synkassa korostuksen kanssa)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "tietoja",
27
+ save: "tallenna",
28
+ load: "lataa",
29
+ line_abbr: "Rv",
30
+ char_abbr: "Pos",
31
+ position: "Paikka",
32
+ total: "Yhteensä",
33
+ close_popup: "sulje valikko",
34
+ shortcuts: "Pikatoiminnot",
35
+ add_tab: "lisää sisennys tekstiin",
36
+ remove_tab: "poista sisennys tekstistä",
37
+ about_notice: "Huomautus: syntaksinkorostus toimii vain pienelle tekstille",
38
+ toggle: "Kytke editori",
39
+ accesskey: "Pikanäppäin",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Odota...",
45
+ fullscreen: "koko ruutu",
46
+ syntax_selection: "--Syntaksi--",
47
+ close_tab: "Sulje tiedosto"
48
+ };
js/editarea/langs/fr.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["fr"]={
2
+ new_document: "nouveau document (efface le contenu)",
3
+ search_button: "rechercher / remplacer",
4
+ search_command: "rechercher suivant / ouvrir la fen&ecirc;tre de recherche",
5
+ search: "rechercher",
6
+ replace: "remplacer",
7
+ replace_command: "remplacer / ouvrir la fen&ecirc;tre de recherche",
8
+ find_next: "rechercher",
9
+ replace_all: "tout remplacer",
10
+ reg_exp: "expr. r&eacute;guli&egrave;re",
11
+ match_case: "respecter la casse",
12
+ not_found: "pas trouv&eacute;.",
13
+ occurrence_replaced: "remplacements &eacute;ffectu&eacute;s.",
14
+ search_field_empty: "Le champ de recherche est vide.",
15
+ restart_search_at_begin: "Fin du texte atteint, poursuite au d&eacute;but.",
16
+ move_popup: "d&eacute;placer la fen&ecirc;tre de recherche",
17
+ font_size: "--Taille police--",
18
+ go_to_line: "aller &agrave; la ligne",
19
+ go_to_line_prompt: "aller a la ligne numero:",
20
+ undo: "annuler",
21
+ redo: "refaire",
22
+ change_smooth_selection: "activer/d&eacute;sactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
23
+ highlight: "activer/d&eacute;sactiver la coloration syntaxique",
24
+ reset_highlight: "r&eacute;initialiser la coloration syntaxique (si d&eacute;syncronis&eacute;e du texte)",
25
+ word_wrap: "activer/d&eacute;sactiver les retours &agrave; la ligne automatiques",
26
+ help: "&agrave; propos",
27
+ save: "sauvegarder",
28
+ load: "charger",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Position",
32
+ total: "Total",
33
+ close_popup: "fermer le popup",
34
+ shortcuts: "Racourcis clavier",
35
+ add_tab: "ajouter une tabulation dans le texte",
36
+ remove_tab: "retirer une tabulation dans le texte",
37
+ about_notice: "Note: la coloration syntaxique n'est pr&eacute;vue que pour de courts textes.",
38
+ toggle: "basculer l'&eacute;diteur",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Maj",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "chargement...",
45
+ fullscreen: "plein &eacute;cran",
46
+ syntax_selection: "--Syntaxe--",
47
+ close_tab: "Fermer le fichier"
48
+ };
js/editarea/langs/hr.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["hr"]={
2
+ new_document: "Novi dokument",
3
+ search_button: "Traži i izmijeni",
4
+ search_command: "Traži dalje / Otvori prozor za traženje",
5
+ search: "Traži",
6
+ replace: "Izmijeni",
7
+ replace_command: "Izmijeni / Otvori prozor za traženje",
8
+ find_next: "Traži dalje",
9
+ replace_all: "Izmjeni sve",
10
+ reg_exp: "Regularni izrazi",
11
+ match_case: "Bitna vel. slova",
12
+ not_found: "nije naðeno.",
13
+ occurrence_replaced: "izmjenjenih.",
14
+ search_field_empty: "Prazno polje za traženje!",
15
+ restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.",
16
+ move_popup: "Pomakni prozor",
17
+ font_size: "--Velièina teksta--",
18
+ go_to_line: "Odi na redak",
19
+ go_to_line_prompt: "Odi na redak:",
20
+ undo: "Vrati natrag",
21
+ redo: "Napravi ponovo",
22
+ change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)",
23
+ highlight: "Ukljuèi/iskljuèi bojanje sintakse",
24
+ reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "O edit_area",
27
+ save: "Spremi",
28
+ load: "Uèitaj",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Zn",
31
+ position: "Pozicija",
32
+ total: "Ukupno",
33
+ close_popup: "Zatvori prozor",
34
+ shortcuts: "Kratice",
35
+ add_tab: "Dodaj tabulaciju",
36
+ remove_tab: "Makni tabulaciju",
37
+ about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove",
38
+ toggle: "Prebaci naèin ureðivanja",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Procesiram...",
45
+ fullscreen: "Cijeli prozor",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/it.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["it"]={
2
+ new_document: "nuovo documento vuoto",
3
+ search_button: "cerca e sostituisci",
4
+ search_command: "trova successivo / apri finestra di ricerca",
5
+ search: "cerca",
6
+ replace: "sostituisci",
7
+ replace_command: "sostituisci / apri finestra di ricerca",
8
+ find_next: "trova successivo",
9
+ replace_all: "sostituisci tutti",
10
+ reg_exp: "espressioni regolari",
11
+ match_case: "confronta maiuscole/minuscole<br />",
12
+ not_found: "non trovato.",
13
+ occurrence_replaced: "occorrenze sostituite.",
14
+ search_field_empty: "Campo ricerca vuoto",
15
+ restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
16
+ move_popup: "sposta popup di ricerca",
17
+ font_size: "-- Dimensione --",
18
+ go_to_line: "vai alla linea",
19
+ go_to_line_prompt: "vai alla linea numero:",
20
+ undo: "annulla",
21
+ redo: "ripeti",
22
+ change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
23
+ highlight: "abilita/disabilita colorazione della sintassi",
24
+ reset_highlight: "aggiorna colorazione (se non sincronizzata)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "informazioni su...",
27
+ save: "salva",
28
+ load: "carica",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Posizione",
32
+ total: "Totale",
33
+ close_popup: "chiudi popup",
34
+ shortcuts: "Scorciatoie",
35
+ add_tab: "aggiungi tabulazione",
36
+ remove_tab: "rimuovi tabulazione",
37
+ about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
38
+ toggle: "Abilita/disabilita editor",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "In corso...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/ja.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["ja"]={
2
+ new_document: "新規作成",
3
+ search_button: "検索・置換",
4
+ search_command: "次を検索 / 検索窓を表示",
5
+ search: "検索",
6
+ replace: "置換",
7
+ replace_command: "置換 / 置換窓を表示",
8
+ find_next: "次を検索",
9
+ replace_all: "全置換",
10
+ reg_exp: "正規表現",
11
+ match_case: "大文字小文字の区別",
12
+ not_found: "見つかりません。",
13
+ occurrence_replaced: "置換しました。",
14
+ search_field_empty: "検索対象文字列が空です。",
15
+ restart_search_at_begin: "終端に達しました、始めに戻ります",
16
+ move_popup: "検索窓を移動",
17
+ font_size: "--フォントサイズ--",
18
+ go_to_line: "指定行へ移動",
19
+ go_to_line_prompt: "指定行へ移動します:",
20
+ undo: "元に戻す",
21
+ redo: "やり直し",
22
+ change_smooth_selection: "スムース表示の切り替え(CPUを使います)",
23
+ highlight: "構文強調表示の切り替え",
24
+ reset_highlight: "構文強調表示のリセット",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "ヘルプを表示",
27
+ save: "保存",
28
+ load: "読み込み",
29
+ line_abbr: "行",
30
+ char_abbr: "文字",
31
+ position: "位置",
32
+ total: "合計",
33
+ close_popup: "ポップアップを閉じる",
34
+ shortcuts: "ショートカット",
35
+ add_tab: "タブを挿入する",
36
+ remove_tab: "タブを削除する",
37
+ about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
38
+ toggle: "テキストエリアとeditAreaの切り替え",
39
+ accesskey: "アクセスキー",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "処理中です...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/mk.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["mk"]={
2
+ new_document: "Нов документ",
3
+ search_button: "Најди и замени",
4
+ search_command: "Барај следно / Отвори нов прозорец за пребарување",
5
+ search: "Барај",
6
+ replace: "Замени",
7
+ replace_command: "Замени / Отвори прозорец за пребарување",
8
+ find_next: "најди следно",
9
+ replace_all: "Замени ги сите",
10
+ reg_exp: "Регуларни изрази",
11
+ match_case: "Битна е големината на буквите",
12
+ not_found: "не е пронајдено.",
13
+ occurrence_replaced: "замени.",
14
+ search_field_empty: "Полето за пребарување е празно",
15
+ restart_search_at_begin: "Крај на областа. Стартувај од почеток.",
16
+ move_popup: "Помести го прозорецот",
17
+ font_size: "--Големина на текстот--",
18
+ go_to_line: "Оди на линија",
19
+ go_to_line_prompt: "Оди на линија со број:",
20
+ undo: "Врати",
21
+ redo: "Повтори",
22
+ change_smooth_selection: "Вклучи/исклучи некои карактеристики за приказ (попаметен приказ, но поголемо оптеретување за процесорот)",
23
+ highlight: "Вклучи/исклучи осветлување на синтакса",
24
+ reset_highlight: "Ресетирај го осветлувањето на синтакса (доколку е десинхронизиранo со текстот)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "За",
27
+ save: "Зачувај",
28
+ load: "Вчитај",
29
+ line_abbr: "Лн",
30
+ char_abbr: "Зн",
31
+ position: "Позиција",
32
+ total: "Вкупно",
33
+ close_popup: "Затвори го прозорецот",
34
+ shortcuts: "Кратенки",
35
+ add_tab: "Додај табулација на текстот",
36
+ remove_tab: "Отстрани ја табулацијата",
37
+ about_notice: "Напомена: Осветлувањето на синтанса е само за краток текст",
38
+ toggle: "Смени начин на уредување",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Обработувам...",
45
+ fullscreen: "Цел прозорец",
46
+ syntax_selection: "--Синтакса--",
47
+ close_tab: "Избери датотека"
48
+ };
js/editarea/langs/nl.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["nl"]={
2
+ new_document: "nieuw leeg document",
3
+ search_button: "zoek en vervang",
4
+ search_command: "zoek volgende / zoekscherm openen",
5
+ search: "zoek",
6
+ replace: "vervang",
7
+ replace_command: "vervang / zoekscherm openen",
8
+ find_next: "volgende vinden",
9
+ replace_all: "alles vervangen",
10
+ reg_exp: "reguliere expressies",
11
+ match_case: "hoofdletter gevoelig",
12
+ not_found: "niet gevonden.",
13
+ occurrence_replaced: "object vervangen.",
14
+ search_field_empty: "Zoek veld leeg",
15
+ restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
16
+ move_popup: "versleep zoek scherm",
17
+ font_size: "--Letter grootte--",
18
+ go_to_line: "Ga naar regel",
19
+ go_to_line_prompt: "Ga naar regel nummer:",
20
+ undo: "Ongedaan maken",
21
+ redo: "Opnieuw doen",
22
+ change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
23
+ highlight: "zet syntax highlight aan/uit",
24
+ reset_highlight: "reset highlight (indien gedesynchronizeerd)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "informatie",
27
+ save: "opslaan",
28
+ load: "laden",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Positie",
32
+ total: "Totaal",
33
+ close_popup: "Popup sluiten",
34
+ shortcuts: "Snelkoppelingen",
35
+ add_tab: "voeg tabs toe in tekst",
36
+ remove_tab: "verwijder tabs uit tekst",
37
+ about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
38
+ toggle: "geavanceerde bewerkingsopties",
39
+ accesskey: "Accessknop",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Verwerken...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/pl.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["pl"]={
2
+ new_document: "nowy dokument",
3
+ search_button: "znajdź i zamień",
4
+ search_command: "znajdź następny",
5
+ search: "znajdź",
6
+ replace: "zamień",
7
+ replace_command: "zamień",
8
+ find_next: "następny",
9
+ replace_all: "zamień wszystko",
10
+ reg_exp: "wyrażenie regularne",
11
+ match_case: "uwzględnij wielkość liter<br />",
12
+ not_found: "nie znaleziono.",
13
+ occurrence_replaced: "wystąpień zamieniono.",
14
+ search_field_empty: "Nie wprowadzono tekstu",
15
+ restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
16
+ move_popup: "przesuń okienko wyszukiwania",
17
+ font_size: "Rozmiar",
18
+ go_to_line: "idź do linii",
19
+ go_to_line_prompt: "numer linii:",
20
+ undo: "cofnij",
21
+ redo: "przywróć",
22
+ change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
23
+ highlight: "włącz/wyłącz podświetlanie składni",
24
+ reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "o programie",
27
+ save: "zapisz",
28
+ load: "otwórz",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Zn",
31
+ position: "Pozycja",
32
+ total: "W sumie",
33
+ close_popup: "zamknij okienko",
34
+ shortcuts: "Skróty klawiaturowe",
35
+ add_tab: "dodaj wcięcie do zaznaczonego tekstu",
36
+ remove_tab: "usuń wcięcie",
37
+ about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
38
+ toggle: "Włącz/wyłącz edytor",
39
+ accesskey: "Alt+",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Przetwarzanie...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/pt.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["pt"]={
2
+ new_document: "Novo documento",
3
+ search_button: "Localizar e substituir",
4
+ search_command: "Localizar próximo",
5
+ search: "Localizar",
6
+ replace: "Substituir",
7
+ replace_command: "Substituir",
8
+ find_next: "Localizar",
9
+ replace_all: "Subst. tudo",
10
+ reg_exp: "Expressões regulares",
11
+ match_case: "Diferenciar maiúsculas e minúsculas",
12
+ not_found: "Não encontrado.",
13
+ occurrence_replaced: "Ocorrências substituidas",
14
+ search_field_empty: "Campo localizar vazio.",
15
+ restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
16
+ move_popup: "Mover janela",
17
+ font_size: "--Tamanho da fonte--",
18
+ go_to_line: "Ir para linha",
19
+ go_to_line_prompt: "Ir para a linha:",
20
+ undo: "Desfazer",
21
+ redo: "Refazer",
22
+ change_smooth_selection: "Opções visuais",
23
+ highlight: "Cores de sintaxe",
24
+ reset_highlight: "Resetar cores (se não sincronizado)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "Sobre",
27
+ save: "Salvar",
28
+ load: "Carregar",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Posição",
32
+ total: "Total",
33
+ close_popup: "Fechar",
34
+ shortcuts: "Shortcuts",
35
+ add_tab: "Adicionar tabulação",
36
+ remove_tab: "Remover tabulação",
37
+ about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
38
+ toggle: "Exibir editor",
39
+ accesskey: "Accesskey",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Processando...",
45
+ fullscreen: "fullscreen",
46
+ syntax_selection: "--Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/ru.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["ru"]={
2
+ new_document: "новый пустой документ",
3
+ search_button: "поиск и замена",
4
+ search_command: "искать следующий / открыть панель поиска",
5
+ search: "поиск",
6
+ replace: "замена",
7
+ replace_command: "заменить / открыть панель поиска",
8
+ find_next: "найти следующее",
9
+ replace_all: "заменить все",
10
+ reg_exp: "регулярное выражение",
11
+ match_case: "учитывать регистр",
12
+ not_found: "не найдено.",
13
+ occurrence_replaced: "вхождение заменено.",
14
+ search_field_empty: "Поле поиска пустое",
15
+ restart_search_at_begin: "Достигнут конец документа. Начинаю с начала.",
16
+ move_popup: "переместить окно поиска",
17
+ font_size: "--Размер шрифта--",
18
+ go_to_line: "перейти к строке",
19
+ go_to_line_prompt: "перейти к строке номер:",
20
+ undo: "отменить",
21
+ redo: "вернуть",
22
+ change_smooth_selection: "включить/отключить некоторые функции просмотра (более красиво, но больше использует процессор)",
23
+ highlight: "переключить подсветку синтаксиса включена/выключена",
24
+ reset_highlight: "восстановить подсветку (если разсинхронизирована от текста)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "о программе",
27
+ save: "сохранить",
28
+ load: "загрузить",
29
+ line_abbr: "Стр",
30
+ char_abbr: "Стлб",
31
+ position: "Позиция",
32
+ total: "Всего",
33
+ close_popup: "закрыть всплывающее окно",
34
+ shortcuts: "Горячие клавиши",
35
+ add_tab: "добавить табуляцию в текст",
36
+ remove_tab: "убрать табуляцию из текста",
37
+ about_notice: "Внимание: функция подсветки синтаксиса только для небольших текстов",
38
+ toggle: "Переключить редактор",
39
+ accesskey: "Горячая клавиша",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Обработка...",
45
+ fullscreen: "полный экран",
46
+ syntax_selection: "--Синтакс--",
47
+ close_tab: "Закрыть файл"
48
+ };
js/editarea/langs/sk.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["sk"]={
2
+ new_document: "nový prázdy dokument",
3
+ search_button: "vyhľadaj a nahraď",
4
+ search_command: "hľadaj ďalsšie / otvor vyhľadávacie pole",
5
+ search: "hľadaj",
6
+ replace: "nahraď",
7
+ replace_command: "nahraď / otvor vyhľadávacie pole",
8
+ find_next: "nájdi ďalšie",
9
+ replace_all: "nahraď všetko",
10
+ reg_exp: "platné výrazy",
11
+ match_case: "zhodujúce sa výrazy",
12
+ not_found: "nenájdené.",
13
+ occurrence_replaced: "výskyty nahradené.",
14
+ search_field_empty: "Pole vyhľadávanie je prádzne",
15
+ restart_search_at_begin: "End of area reached. Restart at begin.",
16
+ move_popup: "presuň vyhľadávacie okno",
17
+ font_size: "--Veľkosť textu--",
18
+ go_to_line: "prejdi na riadok",
19
+ go_to_line_prompt: "prejdi na riadok:",
20
+ undo: "krok späť",
21
+ redo: "prepracovať",
22
+ change_smooth_selection: "povoliť/zamietnúť niektoré zo zobrazených funkcií (účelnejšie zobrazenie vyžaduje väčšie zaťaženie procesora CPU)",
23
+ highlight: "prepnúť zvýrazňovanie syntaxe zap/vyp",
24
+ reset_highlight: "zrušiť zvýrazňovanie (ak je nesynchronizované s textom)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "o programe",
27
+ save: "uložiť",
28
+ load: "načítať",
29
+ line_abbr: "Ln",
30
+ char_abbr: "Ch",
31
+ position: "Pozícia",
32
+ total: "Spolu",
33
+ close_popup: "zavrieť okno",
34
+ shortcuts: "Skratky",
35
+ add_tab: "pridať tabulovanie textu",
36
+ remove_tab: "odstrániť tabulovanie textu",
37
+ about_notice: "Upozornenie: funkcia zvýrazňovania syntaxe je dostupná iba pre malý text",
38
+ toggle: "Prepnúť editor",
39
+ accesskey: "Accesskey",
40
+ tab: "Záložka",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "Spracúvam...",
45
+ fullscreen: "cel=a obrazovka",
46
+ syntax_selection: "--Vyber Syntax--",
47
+ close_tab: "Close file"
48
+ };
js/editarea/langs/zh.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.lang["zh"]={
2
+ new_document: "新建空白文档",
3
+ search_button: "查找与替换",
4
+ search_command: "查找下一个 / 打开查找框",
5
+ search: "查找",
6
+ replace: "替换",
7
+ replace_command: "替换 / 打开查找框",
8
+ find_next: "查找下一个",
9
+ replace_all: "全部替换",
10
+ reg_exp: "正则表达式",
11
+ match_case: "匹配大小写",
12
+ not_found: "未找到.",
13
+ occurrence_replaced: "处被替换.",
14
+ search_field_empty: "查找框没有内容",
15
+ restart_search_at_begin: "已到到文档末尾. 从头重新查找.",
16
+ move_popup: "移动查找对话框",
17
+ font_size: "--字体大小--",
18
+ go_to_line: "转到行",
19
+ go_to_line_prompt: "转到行:",
20
+ undo: "恢复",
21
+ redo: "重做",
22
+ change_smooth_selection: "启用/禁止一些显示特性(更好看但更耗费资源)",
23
+ highlight: "启用/禁止语法高亮",
24
+ reset_highlight: "重置语法高亮(当文本显示不同步时)",
25
+ word_wrap: "toggle word wrapping mode",
26
+ help: "关于",
27
+ save: "保存",
28
+ load: "加载",
29
+ line_abbr: "行",
30
+ char_abbr: "字符",
31
+ position: "位置",
32
+ total: "总计",
33
+ close_popup: "关闭对话框",
34
+ shortcuts: "快捷键",
35
+ add_tab: "添加制表符(Tab)",
36
+ remove_tab: "移除制表符(Tab)",
37
+ about_notice: "注意:语法高亮功能仅用于较少内容的文本(文件内容太大会导致浏览器反应慢)",
38
+ toggle: "切换编辑器",
39
+ accesskey: "快捷键",
40
+ tab: "Tab",
41
+ shift: "Shift",
42
+ ctrl: "Ctrl",
43
+ esc: "Esc",
44
+ processing: "正在处理中...",
45
+ fullscreen: "全屏编辑",
46
+ syntax_selection: "--语法--",
47
+ close_tab: "关闭文件"
48
+ };
js/editarea/license_apache.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ Copyright 2008 Christophe Dolivet
2
+
3
+ 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
4
+
5
+ http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ 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.
js/editarea/license_bsd.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2008, Christophe Dolivet
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+ * 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.
8
+ * 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.
9
+
10
+ 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.
js/editarea/license_lgpl.txt ADDED
@@ -0,0 +1,458 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 2.1, February 1999
3
+
4
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ [This is the first released version of the Lesser GPL. It also counts
10
+ as the successor of the GNU Library Public License, version 2, hence
11
+ the version number 2.1.]
12
+
13
+ Preamble
14
+
15
+ The licenses for most software are designed to take away your
16
+ freedom to share and change it. By contrast, the GNU General Public
17
+ Licenses are intended to guarantee your freedom to share and change
18
+ free software--to make sure the software is free for all its users.
19
+
20
+ This license, the Lesser General Public License, applies to some
21
+ specially designated software packages--typically libraries--of the
22
+ Free Software Foundation and other authors who decide to use it. You
23
+ can use it too, but we suggest you first think carefully about whether
24
+ this license or the ordinary General Public License is the better
25
+ strategy to use in any particular case, based on the explanations below.
26
+
27
+ When we speak of free software, we are referring to freedom of use,
28
+ not price. Our General Public Licenses are designed to make sure that
29
+ you have the freedom to distribute copies of free software (and charge
30
+ for this service if you wish); that you receive source code or can get
31
+ it if you want it; that you can change the software and use pieces of
32
+ it in new free programs; and that you are informed that you can do
33
+ these things.
34
+
35
+ To protect your rights, we need to make restrictions that forbid
36
+ distributors to deny you these rights or to ask you to surrender these
37
+ rights. These restrictions translate to certain responsibilities for
38
+ you if you distribute copies of the library or if you modify it.
39
+
40
+ For example, if you distribute copies of the library, whether gratis
41
+ or for a fee, you must give the recipients all the rights that we gave
42
+ you. You must make sure that they, too, receive or can get the source
43
+ code. If you link other code with the library, you must provide
44
+ complete object files to the recipients, so that they can relink them
45
+ with the library after making changes to the library and recompiling
46
+ it. And you must show them these terms so they know their rights.
47
+
48
+ We protect your rights with a two-step method: (1) we copyright the
49
+ library, and (2) we offer you this license, which gives you legal
50
+ permission to copy, distribute and/or modify the library.
51
+
52
+ To protect each distributor, we want to make it very clear that
53
+ there is no warranty for the free library. Also, if the library is
54
+ modified by someone else and passed on, the recipients should know
55
+ that what they have is not the original version, so that the original
56
+ author's reputation will not be affected by problems that might be
57
+ introduced by others.
58
+
59
+ Finally, software patents pose a constant threat to the existence of
60
+ any free program. We wish to make sure that a company cannot
61
+ effectively restrict the users of a free program by obtaining a
62
+ restrictive license from a patent holder. Therefore, we insist that
63
+ any patent license obtained for a version of the library must be
64
+ consistent with the full freedom of use specified in this license.
65
+
66
+ Most GNU software, including some libraries, is covered by the
67
+ ordinary GNU General Public License. This license, the GNU Lesser
68
+ General Public License, applies to certain designated libraries, and
69
+ is quite different from the ordinary General Public License. We use
70
+ this license for certain libraries in order to permit linking those
71
+ libraries into non-free programs.
72
+
73
+ When a program is linked with a library, whether statically or using
74
+ a shared library, the combination of the two is legally speaking a
75
+ combined work, a derivative of the original library. The ordinary
76
+ General Public License therefore permits such linking only if the
77
+ entire combination fits its criteria of freedom. The Lesser General
78
+ Public License permits more lax criteria for linking other code with
79
+ the library.
80
+
81
+ We call this license the "Lesser" General Public License because it
82
+ does Less to protect the user's freedom than the ordinary General
83
+ Public License. It also provides other free software developers Less
84
+ of an advantage over competing non-free programs. These disadvantages
85
+ are the reason we use the ordinary General Public License for many
86
+ libraries. However, the Lesser license provides advantages in certain
87
+ special circumstances.
88
+
89
+ For example, on rare occasions, there may be a special need to
90
+ encourage the widest possible use of a certain library, so that it becomes
91
+ a de-facto standard. To achieve this, non-free programs must be
92
+ allowed to use the library. A more frequent case is that a free
93
+ library does the same job as widely used non-free libraries. In this
94
+ case, there is little to gain by limiting the free library to free
95
+ software only, so we use the Lesser General Public License.
96
+
97
+ In other cases, permission to use a particular library in non-free
98
+ programs enables a greater number of people to use a large body of
99
+ free software. For example, permission to use the GNU C Library in
100
+ non-free programs enables many more people to use the whole GNU
101
+ operating system, as well as its variant, the GNU/Linux operating
102
+ system.
103
+
104
+ Although the Lesser General Public License is Less protective of the
105
+ users' freedom, it does ensure that the user of a program that is
106
+ linked with the Library has the freedom and the wherewithal to run
107
+ that program using a modified version of the Library.
108
+
109
+ The precise terms and conditions for copying, distribution and
110
+ modification follow. Pay close attention to the difference between a
111
+ "work based on the library" and a "work that uses the library". The
112
+ former contains code derived from the library, whereas the latter must
113
+ be combined with the library in order to run.
114
+
115
+ GNU LESSER GENERAL PUBLIC LICENSE
116
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
+
118
+ 0. This License Agreement applies to any software library or other
119
+ program which contains a notice placed by the copyright holder or
120
+ other authorized party saying it may be distributed under the terms of
121
+ this Lesser General Public License (also called "this License").
122
+ Each licensee is addressed as "you".
123
+
124
+ A "library" means a collection of software functions and/or data
125
+ prepared so as to be conveniently linked with application programs
126
+ (which use some of those functions and data) to form executables.
127
+
128
+ The "Library", below, refers to any such software library or work
129
+ which has been distributed under these terms. A "work based on the
130
+ Library" means either the Library or any derivative work under
131
+ copyright law: that is to say, a work containing the Library or a
132
+ portion of it, either verbatim or with modifications and/or translated
133
+ straightforwardly into another language. (Hereinafter, translation is
134
+ included without limitation in the term "modification".)
135
+
136
+ "Source code" for a work means the preferred form of the work for
137
+ making modifications to it. For a library, complete source code means
138
+ all the source code for all modules it contains, plus any associated
139
+ interface definition files, plus the scripts used to control compilation
140
+ and installation of the library.
141
+
142
+ Activities other than copying, distribution and modification are not
143
+ covered by this License; they are outside its scope. The act of
144
+ running a program using the Library is not restricted, and output from
145
+ such a program is covered only if its contents constitute a work based
146
+ on the Library (independent of the use of the Library in a tool for
147
+ writing it). Whether that is true depends on what the Library does
148
+ and what the program that uses the Library does.
149
+
150
+ 1. You may copy and distribute verbatim copies of the Library's
151
+ complete source code as you receive it, in any medium, provided that
152
+ you conspicuously and appropriately publish on each copy an
153
+ appropriate copyright notice and disclaimer of warranty; keep intact
154
+ all the notices that refer to this License and to the absence of any
155
+ warranty; and distribute a copy of this License along with the
156
+ Library.
157
+
158
+ You may charge a fee for the physical act of transferring a copy,
159
+ and you may at your option offer warranty protection in exchange for a
160
+ fee.
161
+
162
+ 2. You may modify your copy or copies of the Library or any portion
163
+ of it, thus forming a work based on the Library, and copy and
164
+ distribute such modifications or work under the terms of Section 1
165
+ above, provided that you also meet all of these conditions:
166
+
167
+ a) The modified work must itself be a software library.
168
+
169
+ b) You must cause the files modified to carry prominent notices
170
+ stating that you changed the files and the date of any change.
171
+
172
+ c) You must cause the whole of the work to be licensed at no
173
+ charge to all third parties under the terms of this License.
174
+
175
+ d) If a facility in the modified Library refers to a function or a
176
+ table of data to be supplied by an application program that uses
177
+ the facility, other than as an argument passed when the facility
178
+ is invoked, then you must make a good faith effort to ensure that,
179
+ in the event an application does not supply such function or
180
+ table, the facility still operates, and performs whatever part of
181
+ its purpose remains meaningful.
182
+
183
+ (For example, a function in a library to compute square roots has
184
+ a purpose that is entirely well-defined independent of the
185
+ application. Therefore, Subsection 2d requires that any
186
+ application-supplied function or table used by this function must
187
+ be optional: if the application does not supply it, the square
188
+ root function must still compute square roots.)
189
+
190
+ These requirements apply to the modified work as a whole. If
191
+ identifiable sections of that work are not derived from the Library,
192
+ and can be reasonably considered independent and separate works in
193
+ themselves, then this License, and its terms, do not apply to those
194
+ sections when you distribute them as separate works. But when you
195
+ distribute the same sections as part of a whole which is a work based
196
+ on the Library, the distribution of the whole must be on the terms of
197
+ this License, whose permissions for other licensees extend to the
198
+ entire whole, and thus to each and every part regardless of who wrote
199
+ it.
200
+
201
+ Thus, it is not the intent of this section to claim rights or contest
202
+ your rights to work written entirely by you; rather, the intent is to
203
+ exercise the right to control the distribution of derivative or
204
+ collective works based on the Library.
205
+
206
+ In addition, mere aggregation of another work not based on the Library
207
+ with the Library (or with a work based on the Library) on a volume of
208
+ a storage or distribution medium does not bring the other work under
209
+ the scope of this License.
210
+
211
+ 3. You may opt to apply the terms of the ordinary GNU General Public
212
+ License instead of this License to a given copy of the Library. To do
213
+ this, you must alter all the notices that refer to this License, so
214
+ that they refer to the ordinary GNU General Public License, version 2,
215
+ instead of to this License. (If a newer version than version 2 of the
216
+ ordinary GNU General Public License has appeared, then you can specify
217
+ that version instead if you wish.) Do not make any other change in
218
+ these notices.
219
+
220
+ Once this change is made in a given copy, it is irreversible for
221
+ that copy, so the ordinary GNU General Public License applies to all
222
+ subsequent copies and derivative works made from that copy.
223
+
224
+ This option is useful when you wish to copy part of the code of
225
+ the Library into a program that is not a library.
226
+
227
+ 4. You may copy and distribute the Library (or a portion or
228
+ derivative of it, under Section 2) in object code or executable form
229
+ under the terms of Sections 1 and 2 above provided that you accompany
230
+ it with the complete corresponding machine-readable source code, which
231
+ must be distributed under the terms of Sections 1 and 2 above on a
232
+ medium customarily used for software interchange.
233
+
234
+ If distribution of object code is made by offering access to copy
235
+ from a designated place, then offering equivalent access to copy the
236
+ source code from the same place satisfies the requirement to
237
+ distribute the source code, even though third parties are not
238
+ compelled to copy the source along with the object code.
239
+
240
+ 5. A program that contains no derivative of any portion of the
241
+ Library, but is designed to work with the Library by being compiled or
242
+ linked with it, is called a "work that uses the Library". Such a
243
+ work, in isolation, is not a derivative work of the Library, and
244
+ therefore falls outside the scope of this License.
245
+
246
+ However, linking a "work that uses the Library" with the Library
247
+ creates an executable that is a derivative of the Library (because it
248
+ contains portions of the Library), rather than a "work that uses the
249
+ library". The executable is therefore covered by this License.
250
+ Section 6 states terms for distribution of such executables.
251
+
252
+ When a "work that uses the Library" uses material from a header file
253
+ that is part of the Library, the object code for the work may be a
254
+ derivative work of the Library even though the source code is not.
255
+ Whether this is true is especially significant if the work can be
256
+ linked without the Library, or if the work is itself a library. The
257
+ threshold for this to be true is not precisely defined by law.
258
+
259
+ If such an object file uses only numerical parameters, data
260
+ structure layouts and accessors, and small macros and small inline
261
+ functions (ten lines or less in length), then the use of the object
262
+ file is unrestricted, regardless of whether it is legally a derivative
263
+ work. (Executables containing this object code plus portions of the
264
+ Library will still fall under Section 6.)
265
+
266
+ Otherwise, if the work is a derivative of the Library, you may
267
+ distribute the object code for the work under the terms of Section 6.
268
+ Any executables containing that work also fall under Section 6,
269
+ whether or not they are linked directly with the Library itself.
270
+
271
+ 6. As an exception to the Sections above, you may also combine or
272
+ link a "work that uses the Library" with the Library to produce a
273
+ work containing portions of the Library, and distribute that work
274
+ under terms of your choice, provided that the terms permit
275
+ modification of the work for the customer's own use and reverse
276
+ engineering for debugging such modifications.
277
+
278
+ You must give prominent notice with each copy of the work that the
279
+ Library is used in it and that the Library and its use are covered by
280
+ this License. You must supply a copy of this License. If the work
281
+ during execution displays copyright notices, you must include the
282
+ copyright notice for the Library among them, as well as a reference
283
+ directing the user to the copy of this License. Also, you must do one
284
+ of these things:
285
+
286
+ a) Accompany the work with the complete corresponding
287
+ machine-readable source code for the Library including whatever
288
+ changes were used in the work (which must be distributed under
289
+ Sections 1 and 2 above); and, if the work is an executable linked
290
+ with the Library, with the complete machine-readable "work that
291
+ uses the Library", as object code and/or source code, so that the
292
+ user can modify the Library and then relink to produce a modified
293
+ executable containing the modified Library. (It is understood
294
+ that the user who changes the contents of definitions files in the
295
+ Library will not necessarily be able to recompile the application
296
+ to use the modified definitions.)
297
+
298
+ b) Use a suitable shared library mechanism for linking with the
299
+ Library. A suitable mechanism is one that (1) uses at run time a
300
+ copy of the library already present on the user's computer system,
301
+ rather than copying library functions into the executable, and (2)
302
+ will operate properly with a modified version of the library, if
303
+ the user installs one, as long as the modified version is
304
+ interface-compatible with the version that the work was made with.
305
+
306
+ c) Accompany the work with a written offer, valid for at
307
+ least three years, to give the same user the materials
308
+ specified in Subsection 6a, above, for a charge no more
309
+ than the cost of performing this distribution.
310
+
311
+ d) If distribution of the work is made by offering access to copy
312
+ from a designated place, offer equivalent access to copy the above
313
+ specified materials from the same place.
314
+
315
+ e) Verify that the user has already received a copy of these
316
+ materials or that you have already sent this user a copy.
317
+
318
+ For an executable, the required form of the "work that uses the
319
+ Library" must include any data and utility programs needed for
320
+ reproducing the executable from it. However, as a special exception,
321
+ the materials to be distributed need not include anything that is
322
+ normally distributed (in either source or binary form) with the major
323
+ components (compiler, kernel, and so on) of the operating system on
324
+ which the executable runs, unless that component itself accompanies
325
+ the executable.
326
+
327
+ It may happen that this requirement contradicts the license
328
+ restrictions of other proprietary libraries that do not normally
329
+ accompany the operating system. Such a contradiction means you cannot
330
+ use both them and the Library together in an executable that you
331
+ distribute.
332
+
333
+ 7. You may place library facilities that are a work based on the
334
+ Library side-by-side in a single library together with other library
335
+ facilities not covered by this License, and distribute such a combined
336
+ library, provided that the separate distribution of the work based on
337
+ the Library and of the other library facilities is otherwise
338
+ permitted, and provided that you do these two things:
339
+
340
+ a) Accompany the combined library with a copy of the same work
341
+ based on the Library, uncombined with any other library
342
+ facilities. This must be distributed under the terms of the
343
+ Sections above.
344
+
345
+ b) Give prominent notice with the combined library of the fact
346
+ that part of it is a work based on the Library, and explaining
347
+ where to find the accompanying uncombined form of the same work.
348
+
349
+ 8. You may not copy, modify, sublicense, link with, or distribute
350
+ the Library except as expressly provided under this License. Any
351
+ attempt otherwise to copy, modify, sublicense, link with, or
352
+ distribute the Library is void, and will automatically terminate your
353
+ rights under this License. However, parties who have received copies,
354
+ or rights, from you under this License will not have their licenses
355
+ terminated so long as such parties remain in full compliance.
356
+
357
+ 9. You are not required to accept this License, since you have not
358
+ signed it. However, nothing else grants you permission to modify or
359
+ distribute the Library or its derivative works. These actions are
360
+ prohibited by law if you do not accept this License. Therefore, by
361
+ modifying or distributing the Library (or any work based on the
362
+ Library), you indicate your acceptance of this License to do so, and
363
+ all its terms and conditions for copying, distributing or modifying
364
+ the Library or works based on it.
365
+
366
+ 10. Each time you redistribute the Library (or any work based on the
367
+ Library), the recipient automatically receives a license from the
368
+ original licensor to copy, distribute, link with or modify the Library
369
+ subject to these terms and conditions. You may not impose any further
370
+ restrictions on the recipients' exercise of the rights granted herein.
371
+ You are not responsible for enforcing compliance by third parties with
372
+ this License.
373
+
374
+ 11. If, as a consequence of a court judgment or allegation of patent
375
+ infringement or for any other reason (not limited to patent issues),
376
+ conditions are imposed on you (whether by court order, agreement or
377
+ otherwise) that contradict the conditions of this License, they do not
378
+ excuse you from the conditions of this License. If you cannot
379
+ distribute so as to satisfy simultaneously your obligations under this
380
+ License and any other pertinent obligations, then as a consequence you
381
+ may not distribute the Library at all. For example, if a patent
382
+ license would not permit royalty-free redistribution of the Library by
383
+ all those who receive copies directly or indirectly through you, then
384
+ the only way you could satisfy both it and this License would be to
385
+ refrain entirely from distribution of the Library.
386
+
387
+ If any portion of this section is held invalid or unenforceable under any
388
+ particular circumstance, the balance of the section is intended to apply,
389
+ and the section as a whole is intended to apply in other circumstances.
390
+
391
+ It is not the purpose of this section to induce you to infringe any
392
+ patents or other property right claims or to contest validity of any
393
+ such claims; this section has the sole purpose of protecting the
394
+ integrity of the free software distribution system which is
395
+ implemented by public license practices. Many people have made
396
+ generous contributions to the wide range of software distributed
397
+ through that system in reliance on consistent application of that
398
+ system; it is up to the author/donor to decide if he or she is willing
399
+ to distribute software through any other system and a licensee cannot
400
+ impose that choice.
401
+
402
+ This section is intended to make thoroughly clear what is believed to
403
+ be a consequence of the rest of this License.
404
+
405
+ 12. If the distribution and/or use of the Library is restricted in
406
+ certain countries either by patents or by copyrighted interfaces, the
407
+ original copyright holder who places the Library under this License may add
408
+ an explicit geographical distribution limitation excluding those countries,
409
+ so that distribution is permitted only in or among countries not thus
410
+ excluded. In such case, this License incorporates the limitation as if
411
+ written in the body of this License.
412
+
413
+ 13. The Free Software Foundation may publish revised and/or new
414
+ versions of the Lesser General Public License from time to time.
415
+ Such new versions will be similar in spirit to the present version,
416
+ but may differ in detail to address new problems or concerns.
417
+
418
+ Each version is given a distinguishing version number. If the Library
419
+ specifies a version number of this License which applies to it and
420
+ "any later version", you have the option of following the terms and
421
+ conditions either of that version or of any later version published by
422
+ the Free Software Foundation. If the Library does not specify a
423
+ license version number, you may choose any version ever published by
424
+ the Free Software Foundation.
425
+
426
+ 14. If you wish to incorporate parts of the Library into other free
427
+ programs whose distribution conditions are incompatible with these,
428
+ write to the author to ask for permission. For software which is
429
+ copyrighted by the Free Software Foundation, write to the Free
430
+ Software Foundation; we sometimes make exceptions for this. Our
431
+ decision will be guided by the two goals of preserving the free status
432
+ of all derivatives of our free software and of promoting the sharing
433
+ and reuse of software generally.
434
+
435
+ NO WARRANTY
436
+
437
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
+ WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
+ EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
+ OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
+ LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
+ THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
+
447
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
+ AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
+ LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
+ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
+ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
+ DAMAGES.
457
+
458
+ END OF TERMS AND CONDITIONS
js/editarea/manage_area.js ADDED
@@ -0,0 +1,623 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ EditArea.prototype.focus = function() {
2
+ this.textarea.focus();
3
+ this.textareaFocused=true;
4
+ };
5
+
6
+
7
+ EditArea.prototype.check_line_selection= function(timer_checkup){
8
+ var changes, infos, new_top, new_width,i;
9
+
10
+ var t1=t2=t2_1=t3=tLines=tend= new Date().getTime();
11
+ // l'editeur n'existe plus => on quitte
12
+ if(!editAreas[this.id])
13
+ return false;
14
+
15
+ if(!this.smooth_selection && !this.do_highlight)
16
+ {
17
+ //do nothing
18
+ }
19
+ else if(this.textareaFocused && editAreas[this.id]["displayed"]==true && this.isResizing==false)
20
+ {
21
+ infos = this.get_selection_infos();
22
+ changes = this.checkTextEvolution( typeof( this.last_selection['full_text'] ) == 'undefined' ? '' : this.last_selection['full_text'], infos['full_text'] );
23
+
24
+ t2= new Date().getTime();
25
+
26
+ // if selection change
27
+ 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 )
28
+ {
29
+ // move and adjust text selection elements
30
+ new_top = this.getLinePosTop( infos["line_start"] );
31
+ new_width = Math.max(this.textarea.scrollWidth, this.container.clientWidth -50);
32
+ this.selection_field.style.top=this.selection_field_text.style.top=new_top+"px";
33
+ if(!this.settings['word_wrap']){
34
+ this.selection_field.style.width=this.selection_field_text.style.width=this.test_font_size.style.width=new_width+"px";
35
+ }
36
+
37
+ // usefull? => _$("cursor_pos").style.top=new_top+"px";
38
+
39
+ if(this.do_highlight==true)
40
+ {
41
+ // fill selection elements
42
+ var curr_text = infos["full_text"].split("\n");
43
+ var content = "";
44
+ //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]);
45
+ var start = Math.max(0,infos["line_start"]-1);
46
+ var end = Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1);
47
+
48
+ //curr_text[start]= curr_text[start].substr(0,infos["curr_pos"]-1) +"¤_overline_¤"+ curr_text[start].substr(infos["curr_pos"]-1);
49
+ for(i=start; i< end; i++){
50
+ content+= curr_text[i]+"\n";
51
+ }
52
+
53
+ // add special chars arround selected characters
54
+ selLength = infos['selectionEnd'] - infos['selectionStart'];
55
+ 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 );
56
+ content = '<span>'+ content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace("\r\r", '</span><strong>').replace("\r\r", '</strong><span>') +'</span>';
57
+
58
+ if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
59
+ this.selection_field.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
60
+ } else {
61
+ this.selection_field.innerHTML= content;
62
+ }
63
+ this.selection_field_text.innerHTML = this.selection_field.innerHTML;
64
+ t2_1 = new Date().getTime();
65
+ // check if we need to update the highlighted background
66
+ 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"]) ) )
67
+ {
68
+ this.maj_highlight(infos);
69
+ }
70
+ }
71
+ }
72
+ t3= new Date().getTime();
73
+
74
+ // manage line heights
75
+ if( this.settings['word_wrap'] && infos["full_text"] != this.last_selection["full_text"])
76
+ {
77
+ // refresh only 1 line if text change concern only one line and that the total line number has not changed
78
+ if( changes.newText.split("\n").length == 1 && this.last_selection['nb_line'] && infos['nb_line'] == this.last_selection['nb_line'] )
79
+ {
80
+ this.fixLinesHeight( infos['full_text'], changes.lineStart, changes.lineStart );
81
+ }
82
+ else
83
+ {
84
+ this.fixLinesHeight( infos['full_text'], changes.lineStart, -1 );
85
+ }
86
+ }
87
+
88
+ tLines= new Date().getTime();
89
+ // manage bracket finding
90
+ 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 )
91
+ {
92
+ // move _cursor_pos
93
+ var selec_char= infos["curr_line"].charAt(infos["curr_pos"]-1);
94
+ var no_real_move=true;
95
+ if(infos["line_nb"]==1 && (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]) ){
96
+
97
+ no_real_move=false;
98
+ //findEndBracket(infos["line_start"], infos["curr_pos"], selec_char);
99
+ if(this.findEndBracket(infos, selec_char) === true){
100
+ _$("end_bracket").style.visibility ="visible";
101
+ _$("cursor_pos").style.visibility ="visible";
102
+ _$("cursor_pos").innerHTML = selec_char;
103
+ _$("end_bracket").innerHTML = (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]);
104
+ }else{
105
+ _$("end_bracket").style.visibility ="hidden";
106
+ _$("cursor_pos").style.visibility ="hidden";
107
+ }
108
+ }else{
109
+ _$("cursor_pos").style.visibility ="hidden";
110
+ _$("end_bracket").style.visibility ="hidden";
111
+ }
112
+ //alert("move cursor");
113
+ this.displayToCursorPosition("cursor_pos", infos["line_start"], infos["curr_pos"]-1, infos["curr_line"], no_real_move);
114
+ if(infos["line_nb"]==1 && infos["line_start"]!=this.last_selection["line_start"])
115
+ this.scroll_to_view();
116
+ }
117
+ this.last_selection=infos;
118
+ }
119
+
120
+ tend= new Date().getTime();
121
+ //if( (tend-t1) > 7 )
122
+ // 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" );
123
+
124
+
125
+ if(timer_checkup){
126
+ setTimeout("editArea.check_line_selection(true)", this.check_line_selection_timer);
127
+ }
128
+ };
129
+
130
+
131
+ EditArea.prototype.get_selection_infos= function(){
132
+ var sel={}, start, end, len, str;
133
+
134
+ this.getIESelection();
135
+ start = this.textarea.selectionStart;
136
+ end = this.textarea.selectionEnd;
137
+
138
+ if( this.last_selection["selectionStart"] == start && this.last_selection["selectionEnd"] == end && this.last_selection["full_text"] == this.textarea.value )
139
+ {
140
+ return this.last_selection;
141
+ }
142
+
143
+ if(this.tabulation!="\t" && this.textarea.value.indexOf("\t")!=-1)
144
+ { // can append only after copy/paste
145
+ len = this.textarea.value.length;
146
+ this.textarea.value = this.replace_tab(this.textarea.value);
147
+ start = end = start+(this.textarea.value.length-len);
148
+ this.area_select( start, 0 );
149
+ }
150
+
151
+ sel["selectionStart"] = start;
152
+ sel["selectionEnd"] = end;
153
+ sel["full_text"] = this.textarea.value;
154
+ sel["line_start"] = 1;
155
+ sel["line_nb"] = 1;
156
+ sel["curr_pos"] = 0;
157
+ sel["curr_line"] = "";
158
+ sel["indexOfCursor"] = 0;
159
+ sel["selec_direction"] = this.last_selection["selec_direction"];
160
+
161
+ //return sel;
162
+ var splitTab= sel["full_text"].split("\n");
163
+ var nbLine = Math.max(0, splitTab.length);
164
+ var nbChar = Math.max(0, sel["full_text"].length - (nbLine - 1)); // (remove \n caracters from the count)
165
+ if( sel["full_text"].indexOf("\r") != -1 )
166
+ nbChar = nbChar - ( nbLine - 1 ); // (remove \r caracters from the count)
167
+ sel["nb_line"] = nbLine;
168
+ sel["nb_char"] = nbChar;
169
+
170
+ if(start>0){
171
+ str = sel["full_text"].substr(0,start);
172
+ sel["curr_pos"] = start - str.lastIndexOf("\n");
173
+ sel["line_start"] = Math.max(1, str.split("\n").length);
174
+ }else{
175
+ sel["curr_pos"]=1;
176
+ }
177
+ if(end>start){
178
+ sel["line_nb"]=sel["full_text"].substring(start,end).split("\n").length;
179
+ }
180
+ sel["indexOfCursor"]=start;
181
+ sel["curr_line"]=splitTab[Math.max(0,sel["line_start"]-1)];
182
+
183
+ // determine in which direction the selection grow
184
+ if(sel["selectionStart"] == this.last_selection["selectionStart"]){
185
+ if(sel["selectionEnd"]>this.last_selection["selectionEnd"])
186
+ sel["selec_direction"]= "down";
187
+ else if(sel["selectionEnd"] == this.last_selection["selectionStart"])
188
+ sel["selec_direction"]= this.last_selection["selec_direction"];
189
+ }else if(sel["selectionStart"] == this.last_selection["selectionEnd"] && sel["selectionEnd"]>this.last_selection["selectionEnd"]){
190
+ sel["selec_direction"]= "down";
191
+ }else{
192
+ sel["selec_direction"]= "up";
193
+ }
194
+
195
+ _$("nbLine").innerHTML = nbLine;
196
+ _$("nbChar").innerHTML = nbChar;
197
+ _$("linePos").innerHTML = sel["line_start"];
198
+ _$("currPos").innerHTML = sel["curr_pos"];
199
+
200
+ return sel;
201
+ };
202
+
203
+ // set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd)
204
+ EditArea.prototype.getIESelection= function(){
205
+ var selectionStart, selectionEnd, range, stored_range;
206
+
207
+ if( !this.isIE )
208
+ return false;
209
+
210
+ // make it work as nowrap mode (easier for range manipulation with lineHeight)
211
+ if( this.settings['word_wrap'] )
212
+ this.textarea.wrap='off';
213
+
214
+ try{
215
+ range = document.selection.createRange();
216
+ stored_range = range.duplicate();
217
+ stored_range.moveToElementText( this.textarea );
218
+ stored_range.setEndPoint( 'EndToEnd', range );
219
+ if( stored_range.parentElement() != this.textarea )
220
+ throw "invalid focus";
221
+
222
+ // the range don't take care of empty lines in the end of the selection
223
+ var scrollTop = this.result.scrollTop + document.body.scrollTop;
224
+ var relative_top= range.offsetTop - parent.calculeOffsetTop(this.textarea) + scrollTop;
225
+ var line_start = Math.round((relative_top / this.lineHeight) +1);
226
+ var line_nb = Math.round( range.boundingHeight / this.lineHeight );
227
+
228
+ selectionStart = stored_range.text.length - range.text.length;
229
+ selectionStart += ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length)*2; // count missing empty \r to the selection
230
+ selectionStart -= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length ) * 2;
231
+
232
+ selectionEnd = selectionStart + range.text.length;
233
+ selectionEnd += (line_start + line_nb - 1 - this.textarea.value.substr(0, selectionEnd ).split("\n").length)*2;
234
+
235
+ this.textarea.selectionStart = selectionStart;
236
+ this.textarea.selectionEnd = selectionEnd;
237
+ }
238
+ catch(e){}
239
+
240
+ // restore wrap mode
241
+ if( this.settings['word_wrap'] )
242
+ this.textarea.wrap='soft';
243
+ };
244
+
245
+ // select the text for IE (and take care of \r caracters)
246
+ EditArea.prototype.setIESelection= function(){
247
+ var a = this.textarea, nbLineStart, nbLineEnd, range;
248
+
249
+ if( !this.isIE )
250
+ return false;
251
+
252
+ nbLineStart = a.value.substr(0, a.selectionStart).split("\n").length - 1;
253
+ nbLineEnd = a.value.substr(0, a.selectionEnd).split("\n").length - 1;
254
+ range = document.selection.createRange();
255
+ range.moveToElementText( a );
256
+ range.setEndPoint( 'EndToStart', range );
257
+
258
+ range.moveStart('character', a.selectionStart - nbLineStart);
259
+ range.moveEnd('character', a.selectionEnd - nbLineEnd - (a.selectionStart - nbLineStart) );
260
+ range.select();
261
+ };
262
+
263
+
264
+
265
+ EditArea.prototype.checkTextEvolution=function(lastText,newText){
266
+ // ch will contain changes datas
267
+ var ch={},baseStep=200, cpt=0, end, step,tStart=new Date().getTime();
268
+
269
+ end = Math.min(newText.length, lastText.length);
270
+ step = baseStep;
271
+ // find how many chars are similar at the begin of the text
272
+ while( cpt<end && step>=1 ){
273
+ if(lastText.substr(cpt, step) == newText.substr(cpt, step)){
274
+ cpt+= step;
275
+ }else{
276
+ step= Math.floor(step/2);
277
+ }
278
+ }
279
+
280
+ ch.posStart = cpt;
281
+ ch.lineStart= newText.substr(0, ch.posStart).split("\n").length -1;
282
+
283
+ cpt_last = lastText.length;
284
+ cpt = newText.length;
285
+ step = baseStep;
286
+ // find how many chars are similar at the end of the text
287
+ while( cpt>=0 && cpt_last>=0 && step>=1 ){
288
+ if(lastText.substr(cpt_last-step, step) == newText.substr(cpt-step, step)){
289
+ cpt-= step;
290
+ cpt_last-= step;
291
+ }else{
292
+ step= Math.floor(step/2);
293
+ }
294
+ }
295
+
296
+ ch.posNewEnd = cpt;
297
+ ch.posLastEnd = cpt_last;
298
+ if(ch.posNewEnd<=ch.posStart){
299
+ if(lastText.length < newText.length){
300
+ ch.posNewEnd= ch.posStart + newText.length - lastText.length;
301
+ ch.posLastEnd= ch.posStart;
302
+ }else{
303
+ ch.posLastEnd= ch.posStart + lastText.length - newText.length;
304
+ ch.posNewEnd= ch.posStart;
305
+ }
306
+ }
307
+ ch.newText = newText.substring(ch.posStart, ch.posNewEnd);
308
+ ch.lastText = lastText.substring(ch.posStart, ch.posLastEnd);
309
+
310
+ ch.lineNewEnd = newText.substr(0, ch.posNewEnd).split("\n").length -1;
311
+ ch.lineLastEnd = lastText.substr(0, ch.posLastEnd).split("\n").length -1;
312
+
313
+ ch.newTextLine = newText.split("\n").slice(ch.lineStart, ch.lineNewEnd+1).join("\n");
314
+ ch.lastTextLine = lastText.split("\n").slice(ch.lineStart, ch.lineLastEnd+1).join("\n");
315
+ //console.log( ch );
316
+ return ch;
317
+ };
318
+
319
+ EditArea.prototype.tab_selection= function(){
320
+ if(this.is_tabbing)
321
+ return;
322
+ this.is_tabbing=true;
323
+ //infos=getSelectionInfos();
324
+ //if( document.selection ){
325
+ this.getIESelection();
326
+ /* Insertion du code de formatage */
327
+ var start = this.textarea.selectionStart;
328
+ var end = this.textarea.selectionEnd;
329
+ var insText = this.textarea.value.substring(start, end);
330
+
331
+ /* Insert tabulation and ajust cursor position */
332
+ var pos_start=start;
333
+ var pos_end=end;
334
+ if (insText.length == 0) {
335
+ // if only one line selected
336
+ this.textarea.value = this.textarea.value.substr(0, start) + this.tabulation + this.textarea.value.substr(end);
337
+ pos_start = start + this.tabulation.length;
338
+ pos_end=pos_start;
339
+ } else {
340
+ start= Math.max(0, this.textarea.value.substr(0, start).lastIndexOf("\n")+1);
341
+ endText=this.textarea.value.substr(end);
342
+ startText=this.textarea.value.substr(0, start);
343
+ tmp= this.textarea.value.substring(start, end).split("\n");
344
+ insText= this.tabulation+tmp.join("\n"+this.tabulation);
345
+ this.textarea.value = startText + insText + endText;
346
+ pos_start = start;
347
+ pos_end= this.textarea.value.indexOf("\n", startText.length + insText.length);
348
+ if(pos_end==-1)
349
+ pos_end=this.textarea.value.length;
350
+ //pos = start + repdeb.length + insText.length + ;
351
+ }
352
+ this.textarea.selectionStart = pos_start;
353
+ this.textarea.selectionEnd = pos_end;
354
+
355
+ //if( document.selection ){
356
+ if(this.isIE)
357
+ {
358
+ this.setIESelection();
359
+ setTimeout("editArea.is_tabbing=false;", 100); // IE can't accept to make 2 tabulation without a little break between both
360
+ }
361
+ else
362
+ {
363
+ this.is_tabbing=false;
364
+ }
365
+
366
+ };
367
+
368
+ EditArea.prototype.invert_tab_selection= function(){
369
+ var t=this, a=this.textarea;
370
+ if(t.is_tabbing)
371
+ return;
372
+ t.is_tabbing=true;
373
+ //infos=getSelectionInfos();
374
+ //if( document.selection ){
375
+ t.getIESelection();
376
+
377
+ var start = a.selectionStart;
378
+ var end = a.selectionEnd;
379
+ var insText = a.value.substring(start, end);
380
+
381
+ /* Tab remove and cursor seleciton adjust */
382
+ var pos_start=start;
383
+ var pos_end=end;
384
+ if (insText.length == 0) {
385
+ if(a.value.substring(start-t.tabulation.length, start)==t.tabulation)
386
+ {
387
+ a.value = a.value.substr(0, start-t.tabulation.length) + a.value.substr(end);
388
+ pos_start = Math.max(0, start-t.tabulation.length);
389
+ pos_end = pos_start;
390
+ }
391
+ /*
392
+ a.value = a.value.substr(0, start) + t.tabulation + insText + a.value.substr(end);
393
+ pos_start = start + t.tabulation.length;
394
+ pos_end=pos_start;*/
395
+ } else {
396
+ start = a.value.substr(0, start).lastIndexOf("\n")+1;
397
+ endText = a.value.substr(end);
398
+ startText = a.value.substr(0, start);
399
+ tmp = a.value.substring(start, end).split("\n");
400
+ insText = "";
401
+ for(i=0; i<tmp.length; i++){
402
+ for(j=0; j<t.tab_nb_char; j++){
403
+ if(tmp[i].charAt(0)=="\t"){
404
+ tmp[i]=tmp[i].substr(1);
405
+ j=t.tab_nb_char;
406
+ }else if(tmp[i].charAt(0)==" ")
407
+ tmp[i]=tmp[i].substr(1);
408
+ }
409
+ insText+=tmp[i];
410
+ if(i<tmp.length-1)
411
+ insText+="\n";
412
+ }
413
+ //insText+="_";
414
+ a.value = startText + insText + endText;
415
+ pos_start = start;
416
+ pos_end = a.value.indexOf("\n", startText.length + insText.length);
417
+ if(pos_end==-1)
418
+ pos_end=a.value.length;
419
+ //pos = start + repdeb.length + insText.length + ;
420
+ }
421
+ a.selectionStart = pos_start;
422
+ a.selectionEnd = pos_end;
423
+
424
+ //if( document.selection ){
425
+ if(t.isIE){
426
+ // select the text for IE
427
+ t.setIESelection();
428
+ setTimeout("editArea.is_tabbing=false;", 100); // IE can accept to make 2 tabulation without a little break between both
429
+ }else
430
+ t.is_tabbing=false;
431
+ };
432
+
433
+ EditArea.prototype.press_enter= function(){
434
+ if(!this.smooth_selection)
435
+ return false;
436
+ this.getIESelection();
437
+ var scrollTop= this.result.scrollTop;
438
+ var scrollLeft= this.result.scrollLeft;
439
+ var start=this.textarea.selectionStart;
440
+ var end= this.textarea.selectionEnd;
441
+ var start_last_line= Math.max(0 , this.textarea.value.substring(0, start).lastIndexOf("\n") + 1 );
442
+ var begin_line= this.textarea.value.substring(start_last_line, start).replace(/^([ \t]*).*/gm, "$1");
443
+ var lineStart = this.textarea.value.substring(0, start).split("\n").length;
444
+ if(begin_line=="\n" || begin_line=="\r" || begin_line.length==0)
445
+ {
446
+ return false;
447
+ }
448
+
449
+ if(this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ){
450
+ begin_line="\r\n"+ begin_line;
451
+ }else{
452
+ begin_line="\n"+ begin_line;
453
+ }
454
+ //alert(start_last_line+" strat: "+start +"\n"+this.textarea.value.substring(start_last_line, start)+"\n_"+begin_line+"_")
455
+ this.textarea.value= this.textarea.value.substring(0, start) + begin_line + this.textarea.value.substring(end);
456
+
457
+ this.area_select(start+ begin_line.length ,0);
458
+ // during this process IE scroll back to the top of the textarea
459
+ if(this.isIE){
460
+ this.result.scrollTop = scrollTop;
461
+ this.result.scrollLeft = scrollLeft;
462
+ }
463
+ return true;
464
+
465
+ };
466
+
467
+ EditArea.prototype.findEndBracket= function(infos, bracket){
468
+
469
+ var start=infos["indexOfCursor"];
470
+ var normal_order=true;
471
+ //curr_text=infos["full_text"].split("\n");
472
+ if(this.assocBracket[bracket])
473
+ endBracket=this.assocBracket[bracket];
474
+ else if(this.revertAssocBracket[bracket]){
475
+ endBracket=this.revertAssocBracket[bracket];
476
+ normal_order=false;
477
+ }
478
+ var end=-1;
479
+ var nbBracketOpen=0;
480
+
481
+ for(var i=start; i<infos["full_text"].length && i>=0; ){
482
+ if(infos["full_text"].charAt(i)==endBracket){
483
+ nbBracketOpen--;
484
+ if(nbBracketOpen<=0){
485
+ //i=infos["full_text"].length;
486
+ end=i;
487
+ break;
488
+ }
489
+ }else if(infos["full_text"].charAt(i)==bracket)
490
+ nbBracketOpen++;
491
+ if(normal_order)
492
+ i++;
493
+ else
494
+ i--;
495
+ }
496
+
497
+ //end=infos["full_text"].indexOf("}", start);
498
+ if(end==-1)
499
+ return false;
500
+ var endLastLine=infos["full_text"].substr(0, end).lastIndexOf("\n");
501
+ if(endLastLine==-1)
502
+ line=1;
503
+ else
504
+ line= infos["full_text"].substr(0, endLastLine).split("\n").length + 1;
505
+
506
+ var curPos= end - endLastLine - 1;
507
+ var endLineLength = infos["full_text"].substring(end).split("\n")[0].length;
508
+ this.displayToCursorPosition("end_bracket", line, curPos, infos["full_text"].substring(endLastLine +1, end + endLineLength));
509
+ return true;
510
+ };
511
+
512
+ EditArea.prototype.displayToCursorPosition= function(id, start_line, cur_pos, lineContent, no_real_move){
513
+ var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;
514
+
515
+ elem = this.test_font_size;
516
+ dest = _$(id);
517
+ content = "<span id='test_font_size_inner'>"+lineContent.substr(0, cur_pos).replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</span><span id='endTestFont'>"+lineContent.substr(cur_pos).replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</span>";
518
+ if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
519
+ elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
520
+ } else {
521
+ elem.innerHTML= content;
522
+ }
523
+
524
+
525
+ endElem = _$('endTestFont');
526
+ topOffset = endElem.offsetTop;
527
+ fixPadding = parseInt( this.content_highlight.style.paddingLeft.replace("px", "") );
528
+ posLeft = 45 + endElem.offsetLeft + ( !isNaN( fixPadding ) && topOffset > 0 ? fixPadding : 0 );
529
+ posTop = this.getLinePosTop( start_line ) + topOffset;// + Math.floor( ( endElem.offsetHeight - 1 ) / this.lineHeight ) * this.lineHeight;
530
+
531
+ // detect the case where the span start on a line but has no display on it
532
+ if( this.isIE && cur_pos > 0 && endElem.offsetLeft == 0 )
533
+ {
534
+ posTop += this.lineHeight;
535
+ }
536
+ if(no_real_move!=true){ // when the cursor is hidden no need to move him
537
+ dest.style.top=posTop+"px";
538
+ dest.style.left=posLeft+"px";
539
+ }
540
+ // usefull for smarter scroll
541
+ dest.cursor_top=posTop;
542
+ dest.cursor_left=posLeft;
543
+ // _$(id).style.marginLeft=posLeft+"px";
544
+ };
545
+
546
+ EditArea.prototype.getLinePosTop= function(start_line){
547
+ var elem= _$('line_'+ start_line), posTop=0;
548
+ if( elem )
549
+ posTop = elem.offsetTop;
550
+ else
551
+ posTop = this.lineHeight * (start_line-1);
552
+ return posTop;
553
+ };
554
+
555
+
556
+ // return the dislpayed height of a text (take word-wrap into account)
557
+ EditArea.prototype.getTextHeight= function(text){
558
+ var t=this,elem,height;
559
+ elem = t.test_font_size;
560
+ content = text.replace(/&/g,"&amp;").replace(/</g,"&lt;");
561
+ if( t.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
562
+ elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
563
+ } else {
564
+ elem.innerHTML= content;
565
+ }
566
+ height = elem.offsetHeight;
567
+ height = Math.max( 1, Math.floor( elem.offsetHeight / this.lineHeight ) ) * this.lineHeight;
568
+ return height;
569
+ };
570
+
571
+ /**
572
+ * Fix line height for the given lines
573
+ * @param Integer linestart
574
+ * @param Integer lineEnd End line or -1 to cover all lines
575
+ */
576
+ EditArea.prototype.fixLinesHeight= function( textValue, lineStart,lineEnd ){
577
+ var aText = textValue.split("\n");
578
+ if( lineEnd == -1 )
579
+ lineEnd = aText.length-1;
580
+ for( var i = Math.max(0, lineStart); i <= lineEnd; i++ )
581
+ {
582
+ if( elem = _$('line_'+ ( i+1 ) ) )
583
+ {
584
+ elem.style.height= typeof( aText[i] ) != "undefined" ? this.getTextHeight( aText[i] )+"px" : this.lineHeight;
585
+ }
586
+ }
587
+ };
588
+
589
+ EditArea.prototype.area_select= function(start, length){
590
+ this.textarea.focus();
591
+
592
+ start = Math.max(0, Math.min(this.textarea.value.length, start));
593
+ end = Math.max(start, Math.min(this.textarea.value.length, start+length));
594
+
595
+ if(this.isIE)
596
+ {
597
+ this.textarea.selectionStart = start;
598
+ this.textarea.selectionEnd = end;
599
+ this.setIESelection();
600
+ }
601
+ else
602
+ {
603
+ // Opera bug when moving selection start and selection end
604
+ if(this.isOpera && this.isOpera < 9.6 )
605
+ {
606
+ this.textarea.setSelectionRange(0, 0);
607
+ }
608
+ this.textarea.setSelectionRange(start, end);
609
+ }
610
+ this.check_line_selection();
611
+ };
612
+
613
+
614
+ EditArea.prototype.area_get_selection= function(){
615
+ var text="";
616
+ if( document.selection ){
617
+ var range = document.selection.createRange();
618
+ text=range.text;
619
+ }else{
620
+ text= this.textarea.value.substring(this.textarea.selectionStart, this.textarea.selectionEnd);
621
+ }
622
+ return text;
623
+ };
js/editarea/plugins/charmap/charmap.js ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Charmap plugin
3
+ * by Christophe Dolivet
4
+ * v0.1 (2006/09/22)
5
+ *
6
+ *
7
+ * This plugin allow to use a visual keyboard allowing to insert any UTF-8 characters in the text.
8
+ *
9
+ * - plugin name to add to the plugin list: "charmap"
10
+ * - plugin name to add to the toolbar list: "charmap"
11
+ * - possible parameters to add to EditAreaLoader.init():
12
+ * "charmap_default": (String) define the name of the default character range displayed on popup display
13
+ * (default: "arrows")
14
+ *
15
+ *
16
+ */
17
+
18
+ var EditArea_charmap= {
19
+ /**
20
+ * Get called once this file is loaded (editArea still not initialized)
21
+ *
22
+ * @return nothing
23
+ */
24
+ init: function(){
25
+ this.default_language="Arrows";
26
+ }
27
+
28
+ /**
29
+ * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
30
+ * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
31
+ * Language variables such as {$lang_somekey} will also be replaced with contents from
32
+ * the language packs.
33
+ *
34
+ * @param {string} ctrl_name: the name of the control to add
35
+ * @return HTML code for a specific control or false.
36
+ * @type string or boolean
37
+ */
38
+ ,get_control_html: function(ctrl_name){
39
+ switch(ctrl_name){
40
+ case "charmap":
41
+ // Control id, button img, command
42
+ return parent.editAreaLoader.get_button_html('charmap_but', 'charmap.gif', 'charmap_press', false, this.baseURL);
43
+ }
44
+ return false;
45
+ }
46
+ /**
47
+ * Get called once EditArea is fully loaded and initialised
48
+ *
49
+ * @return nothing
50
+ */
51
+ ,onload: function(){
52
+ if(editArea.settings["charmap_default"] && editArea.settings["charmap_default"].length>0)
53
+ this.default_language= editArea.settings["charmap_default"];
54
+ }
55
+
56
+ /**
57
+ * Is called each time the user touch a keyboard key.
58
+ *
59
+ * @param (event) e: the keydown event
60
+ * @return true - pass to next handler in chain, false - stop chain execution
61
+ * @type boolean
62
+ */
63
+ ,onkeydown: function(e){
64
+
65
+ }
66
+
67
+ /**
68
+ * Executes a specific command, this function handles plugin commands.
69
+ *
70
+ * @param {string} cmd: the name of the command being executed
71
+ * @param {unknown} param: the parameter of the command
72
+ * @return true - pass to next handler in chain, false - stop chain execution
73
+ * @type boolean
74
+ */
75
+ ,execCommand: function(cmd, param){
76
+ // Handle commands
77
+ switch(cmd){
78
+ case "charmap_press":
79
+ win= window.open(this.baseURL+"popup.html", "charmap", "width=500,height=270,scrollbars=yes,resizable=yes");
80
+ win.focus();
81
+ return false;
82
+ }
83
+ // Pass to next handler in chain
84
+ return true;
85
+ }
86
+
87
+ };
88
+
89
+ // Adds the plugin class to the list of available EditArea plugins
90
+ editArea.add_plugin("charmap", EditArea_charmap);
js/editarea/plugins/charmap/css/charmap.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body{
2
+ background-color: #F0F0EE;
3
+ font: 12px monospace, sans-serif;
4
+ }
5
+
6
+ select{
7
+ background-color: #F9F9F9;
8
+ border: solid 1px #888888;
9
+ }
10
+
11
+ h1, h2, h3, h4, h5, h6{
12
+ margin: 0;
13
+ padding: 0;
14
+ color: #2B6FB6;
15
+ }
16
+
17
+ h1{
18
+ font-size: 1.5em;
19
+ }
20
+
21
+ div#char_list{
22
+ height: 200px;
23
+ overflow: auto;
24
+ padding: 1px;
25
+ border: 1px solid #0A246A;
26
+ background-color: #F9F9F9;
27
+ clear: both;
28
+ margin-top: 5px;
29
+ }
30
+
31
+ a.char{
32
+ display: block;
33
+ float: left;
34
+ width: 20px;
35
+ height: 20px;
36
+ line-height: 20px;
37
+ margin: 1px;
38
+ border: solid 1px #888888;
39
+ text-align: center;
40
+ cursor: pointer;
41
+ }
42
+
43
+ a.char:hover{
44
+ background-color: #CCCCCC;
45
+ }
46
+
47
+ .preview{
48
+ border: solid 1px #888888;
49
+ width: 50px;
50
+ padding: 2px 5px;
51
+ height: 35px;
52
+ line-height: 35px;
53
+ text-align:center;
54
+ background-color: #CCCCCC;
55
+ font-size: 2em;
56
+ float: right;
57
+ font-weight: bold;
58
+ margin: 0 0 5px 5px;
59
+ }
60
+
61
+ #preview_code{
62
+ font-size: 1.1em;
63
+ width: 70px;
64
+ }
js/editarea/plugins/charmap/images/charmap.gif ADDED
Binary file
js/editarea/plugins/charmap/jscripts/map.js ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var editArea;
2
+
3
+
4
+ /**
5
+ * UTF-8 list taken from http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec
6
+ */
7
+
8
+
9
+ /*
10
+ var char_range_list={
11
+ "Basic Latin":"0021,007F",
12
+ "Latin-1 Supplement":"0080,00FF",
13
+ "Latin Extended-A":"0100,017F",
14
+ "Latin Extended-B":"0180,024F",
15
+ "IPA Extensions":"0250,02AF",
16
+ "Spacing Modifier Letters":"02B0,02FF",
17
+
18
+ "Combining Diacritical Marks":"0300,036F",
19
+ "Greek and Coptic":"0370,03FF",
20
+ "Cyrillic":"0400,04FF",
21
+ "Cyrillic Supplement":"0500,052F",
22
+ "Armenian":"0530,058F",
23
+ "Hebrew":"0590,05FF",
24
+ "Arabic":"0600,06FF",
25
+ "Syriac":"0700,074F",
26
+ "Arabic Supplement":"0750,077F",
27
+
28
+ "Thaana":"0780,07BF",
29
+ "Devanagari":"0900,097F",
30
+ "Bengali":"0980,09FF",
31
+ "Gurmukhi":"0A00,0A7F",
32
+ "Gujarati":"0A80,0AFF",
33
+ "Oriya":"0B00,0B7F",
34
+ "Tamil":"0B80,0BFF",
35
+ "Telugu":"0C00,0C7F",
36
+ "Kannada":"0C80,0CFF",
37
+
38
+ "Malayalam":"0D00,0D7F",
39
+ "Sinhala":"0D80,0DFF",
40
+ "Thai":"0E00,0E7F",
41
+ "Lao":"0E80,0EFF",
42
+ "Tibetan":"0F00,0FFF",
43
+ "Myanmar":"1000,109F",
44
+ "Georgian":"10A0,10FF",
45
+ "Hangul Jamo":"1100,11FF",
46
+ "Ethiopic":"1200,137F",
47
+
48
+ "Ethiopic Supplement":"1380,139F",
49
+ "Cherokee":"13A0,13FF",
50
+ "Unified Canadian Aboriginal Syllabics":"1400,167F",
51
+ "Ogham":"1680,169F",
52
+ "Runic":"16A0,16FF",
53
+ "Tagalog":"1700,171F",
54
+ "Hanunoo":"1720,173F",
55
+ "Buhid":"1740,175F",
56
+ "Tagbanwa":"1760,177F",
57
+
58
+ "Khmer":"1780,17FF",
59
+ "Mongolian":"1800,18AF",
60
+ "Limbu":"1900,194F",
61
+ "Tai Le":"1950,197F",
62
+ "New Tai Lue":"1980,19DF",
63
+ "Khmer Symbols":"19E0,19FF",
64
+ "Buginese":"1A00,1A1F",
65
+ "Phonetic Extensions":"1D00,1D7F",
66
+ "Phonetic Extensions Supplement":"1D80,1DBF",
67
+
68
+ "Combining Diacritical Marks Supplement":"1DC0,1DFF",
69
+ "Latin Extended Additional":"1E00,1EFF",
70
+ "Greek Extended":"1F00,1FFF",
71
+ "General Punctuation":"2000,206F",
72
+ "Superscripts and Subscripts":"2070,209F",
73
+ "Currency Symbols":"20A0,20CF",
74
+ "Combining Diacritical Marks for Symbols":"20D0,20FF",
75
+ "Letterlike Symbols":"2100,214F",
76
+ "Number Forms":"2150,218F",
77
+
78
+ "Arrows":"2190,21FF",
79
+ "Mathematical Operators":"2200,22FF",
80
+ "Miscellaneous Technical":"2300,23FF",
81
+ "Control Pictures":"2400,243F",
82
+ "Optical Character Recognition":"2440,245F",
83
+ "Enclosed Alphanumerics":"2460,24FF",
84
+ "Box Drawing":"2500,257F",
85
+ "Block Elements":"2580,259F",
86
+ "Geometric Shapes":"25A0,25FF",
87
+
88
+ "Miscellaneous Symbols":"2600,26FF",
89
+ "Dingbats":"2700,27BF",
90
+ "Miscellaneous Mathematical Symbols-A":"27C0,27EF",
91
+ "Supplemental Arrows-A":"27F0,27FF",
92
+ "Braille Patterns":"2800,28FF",
93
+ "Supplemental Arrows-B":"2900,297F",
94
+ "Miscellaneous Mathematical Symbols-B":"2980,29FF",
95
+ "Supplemental Mathematical Operators":"2A00,2AFF",
96
+ "Miscellaneous Symbols and Arrows":"2B00,2BFF",
97
+
98
+ "Glagolitic":"2C00,2C5F",
99
+ "Coptic":"2C80,2CFF",
100
+ "Georgian Supplement":"2D00,2D2F",
101
+ "Tifinagh":"2D30,2D7F",
102
+ "Ethiopic Extended":"2D80,2DDF",
103
+ "Supplemental Punctuation":"2E00,2E7F",
104
+ "CJK Radicals Supplement":"2E80,2EFF",
105
+ "Kangxi Radicals":"2F00,2FDF",
106
+ "Ideographic Description Characters":"2FF0,2FFF",
107
+
108
+ "CJK Symbols and Punctuation":"3000,303F",
109
+ "Hiragana":"3040,309F",
110
+ "Katakana":"30A0,30FF",
111
+ "Bopomofo":"3100,312F",
112
+ "Hangul Compatibility Jamo":"3130,318F",
113
+ "Kanbun":"3190,319F",
114
+ "Bopomofo Extended":"31A0,31BF",
115
+ "CJK Strokes":"31C0,31EF",
116
+ "Katakana Phonetic Extensions":"31F0,31FF",
117
+
118
+ "Enclosed CJK Letters and Months":"3200,32FF",
119
+ "CJK Compatibility":"3300,33FF",
120
+ "CJK Unified Ideographs Extension A":"3400,4DBF",
121
+ "Yijing Hexagram Symbols":"4DC0,4DFF",
122
+ "CJK Unified Ideographs":"4E00,9FFF",
123
+ "Yi Syllables":"A000,A48F",
124
+ "Yi Radicals":"A490,A4CF",
125
+ "Modifier Tone Letters":"A700,A71F",
126
+ "Syloti Nagri":"A800,A82F",
127
+
128
+ "Hangul Syllables":"AC00,D7AF",
129
+ "High Surrogates":"D800,DB7F",
130
+ "High Private Use Surrogates":"DB80,DBFF",
131
+ "Low Surrogates":"DC00,DFFF",
132
+ "Private Use Area":"E000,F8FF",
133
+ "CJK Compatibility Ideographs":"F900,FAFF",
134
+ "Alphabetic Presentation Forms":"FB00,FB4F",
135
+ "Arabic Presentation Forms-A":"FB50,FDFF",
136
+ "Variation Selectors":"FE00,FE0F",
137
+
138
+ "Vertical Forms":"FE10,FE1F",
139
+ "Combining Half Marks":"FE20,FE2F",
140
+ "CJK Compatibility Forms":"FE30,FE4F",
141
+ "Small Form Variants":"FE50,FE6F",
142
+ "Arabic Presentation Forms-B":"FE70,FEFF",
143
+ "Halfwidth and Fullwidth Forms":"FF00,FFEF",
144
+ "Specials":"FFF0,FFFF",
145
+ "Linear B Syllabary":"10000,1007F",
146
+ "Linear B Ideograms":"10080,100FF",
147
+
148
+ "Aegean Numbers":"10100,1013F",
149
+ "Ancient Greek Numbers":"10140,1018F",
150
+ "Old Italic":"10300,1032F",
151
+ "Gothic":"10330,1034F",
152
+ "Ugaritic":"10380,1039F",
153
+ "Old Persian":"103A0,103DF",
154
+ "Deseret":"10400,1044F",
155
+ "Shavian":"10450,1047F",
156
+ "Osmanya":"10480,104AF",
157
+
158
+ "Cypriot Syllabary":"10800,1083F",
159
+ "Kharoshthi":"10A00,10A5F",
160
+ "Byzantine Musical Symbols":"1D000,1D0FF",
161
+ "Musical Symbols":"1D100,1D1FF",
162
+ "Ancient Greek Musical Notation":"1D200,1D24F",
163
+ "Tai Xuan Jing Symbols":"1D300,1D35F",
164
+ "Mathematical Alphanumeric Symbols":"1D400,1D7FF",
165
+ "CJK Unified Ideographs Extension B":"20000,2A6DF",
166
+ "CJK Compatibility Ideographs Supplement":"2F800,2FA1F",
167
+ "Tags":"E0000,E007F",
168
+ "Variation Selectors Supplement":"E0100,E01EF"
169
+ };
170
+ */
171
+ var char_range_list={
172
+ "Aegean Numbers":"10100,1013F",
173
+ "Alphabetic Presentation Forms":"FB00,FB4F",
174
+ "Ancient Greek Musical Notation":"1D200,1D24F",
175
+ "Ancient Greek Numbers":"10140,1018F",
176
+ "Arabic":"0600,06FF",
177
+ "Arabic Presentation Forms-A":"FB50,FDFF",
178
+ "Arabic Presentation Forms-B":"FE70,FEFF",
179
+ "Arabic Supplement":"0750,077F",
180
+ "Armenian":"0530,058F",
181
+ "Arrows":"2190,21FF",
182
+ "Basic Latin":"0020,007F",
183
+ "Bengali":"0980,09FF",
184
+ "Block Elements":"2580,259F",
185
+ "Bopomofo Extended":"31A0,31BF",
186
+ "Bopomofo":"3100,312F",
187
+ "Box Drawing":"2500,257F",
188
+ "Braille Patterns":"2800,28FF",
189
+ "Buginese":"1A00,1A1F",
190
+ "Buhid":"1740,175F",
191
+ "Byzantine Musical Symbols":"1D000,1D0FF",
192
+ "CJK Compatibility Forms":"FE30,FE4F",
193
+ "CJK Compatibility Ideographs Supplement":"2F800,2FA1F",
194
+ "CJK Compatibility Ideographs":"F900,FAFF",
195
+ "CJK Compatibility":"3300,33FF",
196
+ "CJK Radicals Supplement":"2E80,2EFF",
197
+ "CJK Strokes":"31C0,31EF",
198
+ "CJK Symbols and Punctuation":"3000,303F",
199
+ "CJK Unified Ideographs Extension A":"3400,4DBF",
200
+ "CJK Unified Ideographs Extension B":"20000,2A6DF",
201
+ "CJK Unified Ideographs":"4E00,9FFF",
202
+ "Cherokee":"13A0,13FF",
203
+ "Combining Diacritical Marks Supplement":"1DC0,1DFF",
204
+ "Combining Diacritical Marks for Symbols":"20D0,20FF",
205
+ "Combining Diacritical Marks":"0300,036F",
206
+ "Combining Half Marks":"FE20,FE2F",
207
+ "Control Pictures":"2400,243F",
208
+ "Coptic":"2C80,2CFF",
209
+ "Currency Symbols":"20A0,20CF",
210
+ "Cypriot Syllabary":"10800,1083F",
211
+ "Cyrillic Supplement":"0500,052F",
212
+ "Cyrillic":"0400,04FF",
213
+ "Deseret":"10400,1044F",
214
+ "Devanagari":"0900,097F",
215
+ "Dingbats":"2700,27BF",
216
+ "Enclosed Alphanumerics":"2460,24FF",
217
+ "Enclosed CJK Letters and Months":"3200,32FF",
218
+ "Ethiopic Extended":"2D80,2DDF",
219
+ "Ethiopic Supplement":"1380,139F",
220
+ "Ethiopic":"1200,137F",
221
+ "General Punctuation":"2000,206F",
222
+ "Geometric Shapes":"25A0,25FF",
223
+ "Georgian Supplement":"2D00,2D2F",
224
+ "Georgian":"10A0,10FF",
225
+ "Glagolitic":"2C00,2C5F",
226
+ "Gothic":"10330,1034F",
227
+ "Greek Extended":"1F00,1FFF",
228
+ "Greek and Coptic":"0370,03FF",
229
+ "Gujarati":"0A80,0AFF",
230
+ "Gurmukhi":"0A00,0A7F",
231
+ "Halfwidth and Fullwidth Forms":"FF00,FFEF",
232
+ "Hangul Compatibility Jamo":"3130,318F",
233
+ "Hangul Jamo":"1100,11FF",
234
+ "Hangul Syllables":"AC00,D7AF",
235
+ "Hanunoo":"1720,173F",
236
+ "Hebrew":"0590,05FF",
237
+ "High Private Use Surrogates":"DB80,DBFF",
238
+ "High Surrogates":"D800,DB7F",
239
+ "Hiragana":"3040,309F",
240
+ "IPA Extensions":"0250,02AF",
241
+ "Ideographic Description Characters":"2FF0,2FFF",
242
+ "Kanbun":"3190,319F",
243
+ "Kangxi Radicals":"2F00,2FDF",
244
+ "Kannada":"0C80,0CFF",
245
+ "Katakana Phonetic Extensions":"31F0,31FF",
246
+ "Katakana":"30A0,30FF",
247
+ "Kharoshthi":"10A00,10A5F",
248
+ "Khmer Symbols":"19E0,19FF",
249
+ "Khmer":"1780,17FF",
250
+ "Lao":"0E80,0EFF",
251
+ "Latin Extended Additional":"1E00,1EFF",
252
+ "Latin Extended-A":"0100,017F",
253
+ "Latin Extended-B":"0180,024F",
254
+ "Latin-1 Supplement":"0080,00FF",
255
+ "Letterlike Symbols":"2100,214F",
256
+ "Limbu":"1900,194F",
257
+ "Linear B Ideograms":"10080,100FF",
258
+ "Linear B Syllabary":"10000,1007F",
259
+ "Low Surrogates":"DC00,DFFF",
260
+ "Malayalam":"0D00,0D7F",
261
+ "Mathematical Alphanumeric Symbols":"1D400,1D7FF",
262
+ "Mathematical Operators":"2200,22FF",
263
+ "Miscellaneous Mathematical Symbols-A":"27C0,27EF",
264
+ "Miscellaneous Mathematical Symbols-B":"2980,29FF",
265
+ "Miscellaneous Symbols and Arrows":"2B00,2BFF",
266
+ "Miscellaneous Symbols":"2600,26FF",
267
+ "Miscellaneous Technical":"2300,23FF",
268
+ "Modifier Tone Letters":"A700,A71F",
269
+ "Mongolian":"1800,18AF",
270
+ "Musical Symbols":"1D100,1D1FF",
271
+ "Myanmar":"1000,109F",
272
+ "New Tai Lue":"1980,19DF",
273
+ "Number Forms":"2150,218F",
274
+ "Ogham":"1680,169F",
275
+ "Old Italic":"10300,1032F",
276
+ "Old Persian":"103A0,103DF",
277
+ "Optical Character Recognition":"2440,245F",
278
+ "Oriya":"0B00,0B7F",
279
+ "Osmanya":"10480,104AF",
280
+ "Phonetic Extensions Supplement":"1D80,1DBF",
281
+ "Phonetic Extensions":"1D00,1D7F",
282
+ "Private Use Area":"E000,F8FF",
283
+ "Runic":"16A0,16FF",
284
+ "Shavian":"10450,1047F",
285
+ "Sinhala":"0D80,0DFF",
286
+ "Small Form Variants":"FE50,FE6F",
287
+ "Spacing Modifier Letters":"02B0,02FF",
288
+ "Specials":"FFF0,FFFF",
289
+ "Superscripts and Subscripts":"2070,209F",
290
+ "Supplemental Arrows-A":"27F0,27FF",
291
+ "Supplemental Arrows-B":"2900,297F",
292
+ "Supplemental Mathematical Operators":"2A00,2AFF",
293
+ "Supplemental Punctuation":"2E00,2E7F",
294
+ "Syloti Nagri":"A800,A82F",
295
+ "Syriac":"0700,074F",
296
+ "Tagalog":"1700,171F",
297
+ "Tagbanwa":"1760,177F",
298
+ "Tags":"E0000,E007F",
299
+ "Tai Le":"1950,197F",
300
+ "Tai Xuan Jing Symbols":"1D300,1D35F",
301
+ "Tamil":"0B80,0BFF",
302
+ "Telugu":"0C00,0C7F",
303
+ "Thaana":"0780,07BF",
304
+ "Thai":"0E00,0E7F",
305
+ "Tibetan":"0F00,0FFF",
306
+ "Tifinagh":"2D30,2D7F",
307
+ "Ugaritic":"10380,1039F",
308
+ "Unified Canadian Aboriginal Syllabics":"1400,167F",
309
+ "Variation Selectors Supplement":"E0100,E01EF",
310
+ "Variation Selectors":"FE00,FE0F",
311
+ "Vertical Forms":"FE10,FE1F",
312
+ "Yi Radicals":"A490,A4CF",
313
+ "Yi Syllables":"A000,A48F",
314
+ "Yijing Hexagram Symbols":"4DC0,4DFF"
315
+ };
316
+
317
+ var insert="charmap_insert";
318
+
319
+ function map_load(){
320
+ editArea=opener.editArea;
321
+ // translate the document
322
+ insert= editArea.get_translation(insert, "word");
323
+ //alert(document.title);
324
+ document.title= editArea.get_translation(document.title, "template");
325
+ document.body.innerHTML= editArea.get_translation(document.body.innerHTML, "template");
326
+ //document.title= editArea.get_translation(document.getElementBytitle, "template");
327
+
328
+ var selected_lang=opener.EditArea_charmap.default_language.toLowerCase();
329
+ var selected=0;
330
+
331
+ var select= document.getElementById("select_range")
332
+ for(var i in char_range_list){
333
+ if(i.toLowerCase()==selected_lang)
334
+ selected=select.options.length;
335
+ select.options[select.options.length]=new Option(i, char_range_list[i]);
336
+ }
337
+ select.options[selected].selected=true;
338
+ /* start=0;
339
+ end=127;
340
+ content="";
341
+ for(var i=start; i<end; i++){
342
+ content+="&#"+i+"; ";
343
+ }
344
+ document.getElementById("char_list").innerHTML=content;*/
345
+ renderCharMapHTML();
346
+ }
347
+
348
+
349
+ function renderCharMapHTML() {
350
+ range= document.getElementById("select_range").value.split(",");
351
+
352
+ start= parseInt(range[0],16);
353
+ end= parseInt(range[1],16);
354
+ var charsPerRow = 20, tdWidth=20, tdHeight=20;
355
+ html="";
356
+ for (var i=start; i<end; i++) {
357
+ html+="<a class='char' onmouseover='previewChar(\""+ i + "\");' onclick='insertChar(\""+ i + "\");' title='"+ insert +"'>"+ String.fromCharCode(i) +"</a>";
358
+ }
359
+ document.getElementById("char_list").innerHTML= html;
360
+ document.getElementById("preview_char").innerHTML="";
361
+ }
362
+
363
+ function previewChar(i){
364
+ document.getElementById("preview_char").innerHTML= String.fromCharCode(i);
365
+ document.getElementById("preview_code").innerHTML= "&amp;#"+ i +";";
366
+ }
367
+
368
+ function insertChar(i){
369
+ opener.parent.editAreaLoader.setSelectedText(editArea.id, String.fromCharCode( i));
370
+ range= opener.parent.editAreaLoader.getSelectionRange(editArea.id);
371
+ opener.parent.editAreaLoader.setSelectionRange(editArea.id, range["end"], range["end"]);
372
+ window.focus();
373
+ }
js/editarea/plugins/charmap/langs/bg.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Bulgarian translation
3
+ * Author: Valentin Hristov
4
+ * Company: SOFTKIT Bulgarian
5
+ * Site: http://www.softkit-bg.com
6
+ */
7
+ editArea.add_lang("bg",{
8
+ charmap_but: "Виртуална клавиатура",
9
+ charmap_title: "Виртуална клавиатура",
10
+ charmap_choose_block: "избери езиков блок",
11
+ charmap_insert:"постави този символ"
12
+ });
js/editarea/plugins/charmap/langs/cs.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("cs",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/de.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("de",{
2
+ charmap_but: "Sonderzeichen",
3
+ charmap_title: "Sonderzeichen",
4
+ charmap_choose_block: "Bereich ausw&auml;hlen",
5
+ charmap_insert: "dieses Zeichen einf&uuml;gen"
6
+ });
js/editarea/plugins/charmap/langs/dk.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("dk",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/en.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("en",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/eo.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("eo",{
2
+ charmap_but: "Ekranklavaro",
3
+ charmap_title: "Ekranklavaro",
4
+ charmap_choose_block: "Elekto de lingvo",
5
+ charmap_insert:"enmeti tiun signaron"
6
+ });
js/editarea/plugins/charmap/langs/es.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("es",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/fr.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("fr",{
2
+ charmap_but: "Clavier visuel",
3
+ charmap_title: "Clavier visuel",
4
+ charmap_choose_block: "choix du language",
5
+ charmap_insert:"ins&eacute;rer ce caract&egrave;re"
6
+ });
js/editarea/plugins/charmap/langs/hr.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("hr",{
2
+ charmap_but: "Virtualna tipkovnica",
3
+ charmap_title: "Virtualna tipkovnica",
4
+ charmap_choose_block: "Odaberi blok s jezikom",
5
+ charmap_insert:"Ubaci taj znak"
6
+ });
js/editarea/plugins/charmap/langs/it.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("it",{
2
+ charmap_but: "Tastiera visuale",
3
+ charmap_title: "Tastiera visuale",
4
+ charmap_choose_block: "seleziona blocco",
5
+ charmap_insert:"inserisci questo carattere"
6
+ });
js/editarea/plugins/charmap/langs/ja.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("ja",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/mk.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("mkn",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/nl.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("nl",{
2
+ charmap_but: "Visueel toetsenbord",
3
+ charmap_title: "Visueel toetsenbord",
4
+ charmap_choose_block: "Kies een taal blok",
5
+ charmap_insert:"Voeg dit symbool in"
6
+ });
js/editarea/plugins/charmap/langs/pl.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("pl",{
2
+ charmap_but: "Klawiatura ekranowa",
3
+ charmap_title: "Klawiatura ekranowa",
4
+ charmap_choose_block: "wybierz grupę znaków",
5
+ charmap_insert:"wstaw ten znak"
6
+ });
js/editarea/plugins/charmap/langs/pt.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("pt",{
2
+ charmap_but: "Visual keyboard",
3
+ charmap_title: "Visual keyboard",
4
+ charmap_choose_block: "select language block",
5
+ charmap_insert:"insert this character"
6
+ });
js/editarea/plugins/charmap/langs/ru.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("ru",{
2
+ charmap_but: "Визуальная клавиатура",
3
+ charmap_title: "Визуальная клавиатура",
4
+ charmap_choose_block: "выбрать языковой блок",
5
+ charmap_insert:"вставить этот символ"
6
+ });
js/editarea/plugins/charmap/langs/sk.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("sk",{
2
+ charmap_but: "Vizuálna klávesnica",
3
+ charmap_title: "Vizuálna klávesnica",
4
+ charmap_choose_block: "vyber jazykový blok",
5
+ charmap_insert: "vlož tento znak"
6
+ });
js/editarea/plugins/charmap/langs/zh.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ editArea.add_lang("zh",{
2
+ charmap_but: "软键盘",
3
+ charmap_title: "软键盘",
4
+ charmap_choose_block: "选择一个语言块",
5
+ charmap_insert:"插入此字符"
6
+ });
js/editarea/plugins/charmap/popup.html ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
4
+ <head>
5
+ <title>{$charmap_title}</title>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <link rel="stylesheet" type="text/css" href="css/charmap.css" />
8
+ <script language="Javascript" type="text/javascript" src="jscripts/map.js">
9
+ </script>
10
+ </head>
11
+ <body onload='map_load()'>
12
+ <div id='preview_code' class='preview'></div>
13
+ <div id='preview_char' class='preview'></div>
14
+ <h1>{$charmap_title}:</h1>
15
+ <select id='select_range' onchange='renderCharMapHTML()' title='{$charmap_choose_block}'>
16
+ </select>
17
+ <div id='char_list'>
18
+
19
+ </div>
20
+
21
+
22
+
23
+ </body>
24
+ </html>
js/editarea/plugins/test/css/test.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ select#test_select{
2
+ background-color: #FF0000;
3
+ }
js/editarea/plugins/test/images/Thumbs.db ADDED
Binary file
js/editarea/plugins/test/images/test.gif ADDED
Binary file
js/editarea/plugins/test/langs/bg.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Bulgarian translation
3
+ * Author: Valentin Hristov
4
+ * Company: SOFTKIT Bulgarian
5
+ * Site: http://www.softkit-bg.com
6
+ */
7
+ editArea.add_lang("bg",{
8
+ test_select: "избери таг",
9
+ test_but: "тествай копието"
10
+ });
js/editarea/plugins/test/langs/cs.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("cs",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/de.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("de",{
2
+ test_select: "Tag ausw&auml;hlen",
3
+ test_but: "Test Button"
4
+ });
js/editarea/plugins/test/langs/dk.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("dk",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/en.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("en",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/eo.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("eo",{
2
+ test_select:"elekto de marko",
3
+ test_but: "provo-butono"
4
+ });
js/editarea/plugins/test/langs/es.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("es",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/fr.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("fr",{
2
+ test_select:"choix balise",
3
+ test_but: "bouton de test"
4
+ });
js/editarea/plugins/test/langs/hr.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("hr",{
2
+ test_select: "Odaberi tag",
3
+ test_but: "Probna tipka"
4
+ });
js/editarea/plugins/test/langs/it.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("it",{
2
+ test_select: "seleziona tag",
3
+ test_but: "pulsante di test"
4
+ });
js/editarea/plugins/test/langs/ja.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("ja",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/mk.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("mk",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/nl.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("nl",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/pl.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("pl",{
2
+ test_select: "wybierz tag",
3
+ test_but: "test"
4
+ });
js/editarea/plugins/test/langs/pt.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("pt",{
2
+ test_select: "select tag",
3
+ test_but: "test button"
4
+ });
js/editarea/plugins/test/langs/ru.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("ru",{
2
+ test_select: "выбрать тэг",
3
+ test_but: "тестировать кнопку"
4
+ });
js/editarea/plugins/test/langs/sk.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("sk",{
2
+ test_select: "vyber tag",
3
+ test_but: "testovacie tlačidlo"
4
+ });
js/editarea/plugins/test/langs/zh.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ editArea.add_lang("zh",{
2
+ test_select: "选择标签",
3
+ test_but: "测试按钮"
4
+ });
js/editarea/plugins/test/test.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Plugin designed for test prupose. It add a button (that manage an alert) and a select (that allow to insert tags) in the toolbar.
3
+ * This plugin also disable the "f" key in the editarea, and load a CSS and a JS file
4
+ */
5
+ var EditArea_test= {
6
+ /**
7
+ * Get called once this file is loaded (editArea still not initialized)
8
+ *
9
+ * @return nothing
10
+ */
11
+ init: function(){
12
+ // alert("test init: "+ this._someInternalFunction(2, 3));
13
+ editArea.load_css(this.baseURL+"css/test.css");
14
+ editArea.load_script(this.baseURL+"test2.js");
15
+ }
16
+ /**
17
+ * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
18
+ * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
19
+ * Language variables such as {$lang_somekey} will also be replaced with contents from
20
+ * the language packs.
21
+ *
22
+ * @param {string} ctrl_name: the name of the control to add
23
+ * @return HTML code for a specific control or false.
24
+ * @type string or boolean
25
+ */
26
+ ,get_control_html: function(ctrl_name){
27
+ switch(ctrl_name){
28
+ case "test_but":
29
+ // Control id, button img, command
30
+ return parent.editAreaLoader.get_button_html('test_but', 'test.gif', 'test_cmd', false, this.baseURL);
31
+ case "test_select":
32
+ html= "<select id='test_select' onchange='javascript:editArea.execCommand(\"test_select_change\")' fileSpecific='no'>"
33
+ +" <option value='-1'>{$test_select}</option>"
34
+ +" <option value='h1'>h1</option>"
35
+ +" <option value='h2'>h2</option>"
36
+ +" <option value='h3'>h3</option>"
37
+ +" <option value='h4'>h4</option>"
38
+ +" <option value='h5'>h5</option>"
39
+ +" <option value='h6'>h6</option>"
40
+ +" </select>";
41
+ return html;
42
+ }
43
+ return false;
44
+ }
45
+ /**
46
+ * Get called once EditArea is fully loaded and initialised
47
+ *
48
+ * @return nothing
49
+ */
50
+ ,onload: function(){
51
+ alert("test load");
52
+ }
53
+
54
+ /**
55
+ * Is called each time the user touch a keyboard key.
56
+ *
57
+ * @param (event) e: the keydown event
58
+ * @return true - pass to next handler in chain, false - stop chain execution
59
+ * @type boolean
60
+ */
61
+ ,onkeydown: function(e){
62
+ var str= String.fromCharCode(e.keyCode);
63
+ // desactivate the "f" character
64
+ if(str.toLowerCase()=="f"){
65
+ return true;
66
+ }
67
+ return false;
68
+ }
69
+
70
+ /**
71
+ * Executes a specific command, this function handles plugin commands.
72
+ *
73
+ * @param {string} cmd: the name of the command being executed
74
+ * @param {unknown} param: the parameter of the command
75
+ * @return true - pass to next handler in chain, false - stop chain execution
76
+ * @type boolean
77
+ */
78
+ ,execCommand: function(cmd, param){
79
+ // Handle commands
80
+ switch(cmd){
81
+ case "test_select_change":
82
+ var val= document.getElementById("test_select").value;
83
+ if(val!=-1)
84
+ parent.editAreaLoader.insertTags(editArea.id, "<"+val+">", "</"+val+">");
85
+ document.getElementById("test_select").options[0].selected=true;
86
+ return false;
87
+ case "test_cmd":
88
+ alert("user clicked on test_cmd");
89
+ return false;
90
+ }
91
+ // Pass to next handler in chain
92
+ return true;
93
+ }
94
+
95
+ /**
96
+ * This is just an internal plugin method, prefix all internal methods with a _ character.
97
+ * The prefix is needed so they doesn't collide with future EditArea callback functions.
98
+ *
99
+ * @param {string} a Some arg1.
100
+ * @param {string} b Some arg2.
101
+ * @return Some return.
102
+ * @type unknown
103
+ */
104
+ ,_someInternalFunction : function(a, b) {
105
+ return a+b;
106
+ }
107
+ };
108
+
109
+ // Adds the plugin class to the list of available EditArea plugins
110
+ editArea.add_plugin("test", EditArea_test);
js/editarea/plugins/test/test2.js ADDED
@@ -0,0 +1 @@
 
1
+ alert("test2.js is loaded from test plugin");
js/editarea/reg_syntax.js ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ EditAreaLoader.prototype.get_regexp= function(text_array){
2
+ //res="( |=|\\n|\\r|\\[|\\(|µ|)(";
3
+ res="(\\b)(";
4
+ for(i=0; i<text_array.length; i++){
5
+ if(i>0)
6
+ res+="|";
7
+ //res+="("+ tab_text[i] +")";
8
+ //res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
9
+ res+=this.get_escaped_regexp(text_array[i]);
10
+ }
11
+ //res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
12
+ res+=")(\\b)";
13
+ reg= new RegExp(res);
14
+
15
+ return res;
16
+ };
17
+
18
+
19
+ EditAreaLoader.prototype.get_escaped_regexp= function(str){
20
+ return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
21
+ };
22
+
23
+ EditAreaLoader.prototype.init_syntax_regexp= function(){
24
+ var lang_style= {};
25
+ for(var lang in this.load_syntax){
26
+ if(!this.syntax[lang]) // init the regexp if not already initialized
27
+ {
28
+ this.syntax[lang]= {};
29
+ this.syntax[lang]["keywords_reg_exp"]= {};
30
+ this.keywords_reg_exp_nb=0;
31
+
32
+ if(this.load_syntax[lang]['KEYWORDS']){
33
+ param="g";
34
+ if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
35
+ param+="i";
36
+ for(var i in this.load_syntax[lang]['KEYWORDS']){
37
+ if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
38
+ this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
39
+ this.keywords_reg_exp_nb++;
40
+ }
41
+ }
42
+
43
+ if(this.load_syntax[lang]['OPERATORS']){
44
+ var str="";
45
+ var nb=0;
46
+ for(var i in this.load_syntax[lang]['OPERATORS']){
47
+ if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
48
+ if(nb>0)
49
+ str+="|";
50
+ str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
51
+ nb++;
52
+ }
53
+ if(str.length>0)
54
+ this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
55
+ }
56
+
57
+ if(this.load_syntax[lang]['DELIMITERS']){
58
+ var str="";
59
+ var nb=0;
60
+ for(var i in this.load_syntax[lang]['DELIMITERS']){
61
+ if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
62
+ if(nb>0)
63
+ str+="|";
64
+ str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
65
+ nb++;
66
+ }
67
+ if(str.length>0)
68
+ this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
69
+ }
70
+
71
+
72
+ // /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
73
+ var syntax_trace=[];
74
+
75
+ // /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
76
+
77
+ this.syntax[lang]["quotes"]={};
78
+ var quote_tab= [];
79
+ if(this.load_syntax[lang]['QUOTEMARKS']){
80
+ for(var i in this.load_syntax[lang]['QUOTEMARKS']){
81
+ if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;
82
+ var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
83
+ this.syntax[lang]["quotes"][x]=x;
84
+ //quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
85
+ //previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
86
+ quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
87
+
88
+ syntax_trace.push(x);
89
+ }
90
+ }
91
+
92
+ this.syntax[lang]["comments"]={};
93
+ if(this.load_syntax[lang]['COMMENT_SINGLE']){
94
+ for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){
95
+ if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;
96
+ var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
97
+ quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
98
+ syntax_trace.push(x);
99
+ this.syntax[lang]["comments"][x]="\n";
100
+ }
101
+ }
102
+ // (/\*(.|[\r\n])*?\*/)
103
+ if(this.load_syntax[lang]['COMMENT_MULTI']){
104
+ for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
105
+ if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;
106
+ var start=this.get_escaped_regexp(i);
107
+ var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
108
+ quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
109
+ syntax_trace.push(start);
110
+ syntax_trace.push(end);
111
+ this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
112
+ }
113
+ }
114
+ if(quote_tab.length>0)
115
+ this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
116
+
117
+ if(syntax_trace.length>0) // /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
118
+ this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
119
+
120
+ if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
121
+ this.syntax[lang]["script_delimiters"]= {};
122
+ for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
123
+ if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;
124
+ this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
125
+ }
126
+ }
127
+
128
+ this.syntax[lang]["custom_regexp"]= {};
129
+ if(this.load_syntax[lang]['REGEXPS']){
130
+ for(var i in this.load_syntax[lang]['REGEXPS']){
131
+ if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
132
+ var val= this.load_syntax[lang]['REGEXPS'][i];
133
+ if(!this.syntax[lang]["custom_regexp"][val['execute']])
134
+ this.syntax[lang]["custom_regexp"][val['execute']]= {};
135
+ this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
136
+ , 'class' : val['class']};
137
+ }
138
+ }
139
+
140
+ if(this.load_syntax[lang]['STYLES']){
141
+ lang_style[lang]= {};
142
+ for(var i in this.load_syntax[lang]['STYLES']){
143
+ if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
144
+ if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
145
+ for(var j in this.load_syntax[lang]['STYLES'][i]){
146
+ lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
147
+ }
148
+ }else{
149
+ lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
150
+ }
151
+ }
152
+ }
153
+ // build style string
154
+ var style="";
155
+ for(var i in lang_style[lang]){
156
+ if(lang_style[lang][i].length>0){
157
+ style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
158
+ style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";
159
+ }
160
+ }
161
+ this.syntax[lang]["styles"]=style;
162
+ }
163
+ }
164
+ };
165
+
166
+ editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";
js/editarea/reg_syntax/basic.js ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["basic"] = {
2
+ 'DISPLAY_NAME' : 'Basic'
3
+ ,'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
4
+ ,'COMMENT_MULTI' : { }
5
+ ,'QUOTEMARKS' : {1: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements' : [
9
+ 'if','then','for','wend','while',
10
+ 'else','elseif','select','case','end select',
11
+ 'until','next','step','to','end if', 'call'
12
+ ]
13
+ ,'keywords' : [
14
+ 'sub', 'end sub', 'function', 'end function', 'exit',
15
+ 'exit function', 'dim', 'redim', 'shared', 'const',
16
+ 'is', 'absolute', 'access', 'any', 'append', 'as',
17
+ 'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
18
+ 'chdir', 'circle', 'clear', 'close', 'cls', 'color',
19
+ 'com', 'common', 'data', 'date', 'declare', 'def',
20
+ 'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
21
+ 'double', 'draw', 'environ', 'erase', 'error', 'field',
22
+ 'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
23
+ 'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
24
+ 'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
25
+ 'option', 'out', 'output', 'paint', 'palette', 'pcopy',
26
+ 'poke', 'preset', 'print', 'pset', 'put', 'random',
27
+ 'randomize', 'read', 'reset', 'restore', 'resume',
28
+ 'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
29
+ 'shell', 'single', 'sleep', 'sound', 'static', 'stop',
30
+ 'strig', 'string', 'swap', 'system', 'time', 'timer',
31
+ 'troff', 'tron', 'type', 'unlock', 'using', 'view',
32
+ 'wait', 'width', 'window', 'write'
33
+ ]
34
+ ,'functions' : [
35
+ 'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
36
+ 'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
37
+ 'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
38
+ 'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
39
+ 'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
40
+ 'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
41
+ 'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
42
+ 'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
43
+ 'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
44
+ 'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
45
+ 'ubound', 'ucase', 'val', 'varptr', 'varseg'
46
+ ]
47
+ ,'operators' : [
48
+ 'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
49
+ ]
50
+ }
51
+ ,'OPERATORS' :[
52
+ '+', '-', '/', '*', '=', '<', '>', '!', '&'
53
+ ]
54
+ ,'DELIMITERS' :[
55
+ '(', ')', '[', ']', '{', '}'
56
+ ]
57
+ ,'STYLES' : {
58
+ 'COMMENTS': 'color: #99CC00;'
59
+ ,'QUOTESMARKS': 'color: #333399;'
60
+ ,'KEYWORDS' : {
61
+ 'keywords' : 'color: #3366FF;'
62
+ ,'functions' : 'color: #0000FF;'
63
+ ,'statements' : 'color: #3366FF;'
64
+ ,'operators' : 'color: #FF0000;'
65
+ }
66
+ ,'OPERATORS' : 'color: #FF0000;'
67
+ ,'DELIMITERS' : 'color: #0000FF;'
68
+
69
+ }
70
+ };
js/editarea/reg_syntax/brainfuck.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["brainfuck"] = {
2
+ 'DISPLAY_NAME' : 'Brainfuck'
3
+ ,'COMMENT_SINGLE' : {}
4
+ ,'COMMENT_MULTI' : {}
5
+ ,'QUOTEMARKS' : {}
6
+ ,'KEYWORD_CASE_SENSITIVE' : true
7
+ ,'OPERATORS' :[
8
+ '+', '-'
9
+ ]
10
+ ,'DELIMITERS' :[
11
+ '[', ']'
12
+ ]
13
+ ,'REGEXPS' : {
14
+ 'bfispis' : {
15
+ 'search' : '()(\\.)()'
16
+ ,'class' : 'bfispis'
17
+ ,'modifiers' : 'g'
18
+ ,'execute' : 'before'
19
+ }
20
+ ,'bfupis' : {
21
+ 'search' : '()(\\,)()'
22
+ ,'class' : 'bfupis'
23
+ ,'modifiers' : 'g'
24
+ ,'execute' : 'before'
25
+ }
26
+ ,'bfmemory' : {
27
+ 'search' : '()([<>])()'
28
+ ,'class' : 'bfmemory'
29
+ ,'modifiers' : 'g'
30
+ ,'execute' : 'before'
31
+ }
32
+ }
33
+ ,'STYLES' : {
34
+ 'COMMENTS': 'color: #AAAAAA;'
35
+ ,'QUOTESMARKS': 'color: #6381F8;'
36
+ ,'OPERATORS' : 'color: #88AA00;'
37
+ ,'DELIMITERS' : 'color: #00C138;'
38
+ ,'REGEXPS' : {
39
+ 'bfispis' : 'color: #EE0000;'
40
+ ,'bfupis' : 'color: #4455ee;'
41
+ ,'bfmemory' : 'color: #DD00DD;'
42
+ }
43
+ }
44
+ };
45
+
js/editarea/reg_syntax/c.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["c"] = {
2
+ 'DISPLAY_NAME' : 'C'
3
+ ,'COMMENT_SINGLE' : {1 : '//'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : true
7
+ ,'KEYWORDS' : {
8
+ 'constants' : [
9
+ 'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
10
+ ]
11
+ ,'types' : [
12
+ 'FILE', 'auto', 'char', 'const', 'double',
13
+ 'extern', 'float', 'inline', 'int', 'long', 'register',
14
+ 'short', 'signed', 'size_t', 'static', 'struct',
15
+ 'time_t', 'typedef', 'union', 'unsigned', 'void',
16
+ 'volatile'
17
+ ]
18
+ ,'statements' : [
19
+ 'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
20
+ 'switch', 'while'
21
+ ]
22
+ ,'keywords' : [
23
+ 'break', 'case', 'continue', 'default', 'delete',
24
+ 'return'
25
+ ]
26
+ }
27
+ ,'OPERATORS' :[
28
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
29
+ ]
30
+ ,'DELIMITERS' :[
31
+ '(', ')', '[', ']', '{', '}'
32
+ ]
33
+ ,'REGEXPS' : {
34
+ 'precompiler' : {
35
+ 'search' : '()(#[^\r\n]*)()'
36
+ ,'class' : 'precompiler'
37
+ ,'modifiers' : 'g'
38
+ ,'execute' : 'before'
39
+ }
40
+ /* ,'precompilerstring' : {
41
+ 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
42
+ ,'class' : 'precompilerstring'
43
+ ,'modifiers' : 'g'
44
+ ,'execute' : 'before'
45
+ }*/
46
+ }
47
+ ,'STYLES' : {
48
+ 'COMMENTS': 'color: #AAAAAA;'
49
+ ,'QUOTESMARKS': 'color: #6381F8;'
50
+ ,'KEYWORDS' : {
51
+ 'constants' : 'color: #EE0000;'
52
+ ,'types' : 'color: #0000EE;'
53
+ ,'statements' : 'color: #60CA00;'
54
+ ,'keywords' : 'color: #48BDDF;'
55
+ }
56
+ ,'OPERATORS' : 'color: #FF00FF;'
57
+ ,'DELIMITERS' : 'color: #0038E1;'
58
+ ,'REGEXPS' : {
59
+ 'precompiler' : 'color: #009900;'
60
+ ,'precompilerstring' : 'color: #994400;'
61
+ }
62
+ }
63
+ };
js/editarea/reg_syntax/coldfusion.js ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["coldfusion"] = {
2
+ 'DISPLAY_NAME' : 'Coldfusion'
3
+ ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
4
+ ,'COMMENT_MULTI' : {'<!--' : '-->'}
5
+ ,'COMMENT_MULTI2' : {'<!---' : '--->'}
6
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
7
+ ,'KEYWORD_CASE_SENSITIVE' : false
8
+ ,'KEYWORDS' : {
9
+ 'statements' : [
10
+ 'include', 'require', 'include_once', 'require_once',
11
+ 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
12
+ 'endif', 'switch', 'case', 'endswitch',
13
+ 'return', 'break', 'continue'
14
+ ]
15
+ ,'reserved' : [
16
+ 'AND', 'break', 'case', 'CONTAIN', 'CONTAINS', 'continue', 'default', 'do',
17
+ 'DOES', 'else', 'EQ', 'EQUAL', 'EQUALTO', 'EQV', 'FALSE', 'for', 'GE',
18
+ 'GREATER', 'GT', 'GTE', 'if', 'IMP', 'in', 'IS', 'LE', 'LESS', 'LT', 'LTE',
19
+ 'MOD', 'NEQ', 'NOT', 'OR', 'return', 'switch', 'THAN', 'TO', 'TRUE', 'var',
20
+ 'while', 'XOR'
21
+ ]
22
+ ,'functions' : [
23
+ 'Abs', 'ACos', 'ArrayAppend', 'ArrayAvg', 'ArrayClear', 'ArrayDeleteAt', 'ArrayInsertAt',
24
+ 'ArrayIsEmpty', 'ArrayLen', 'ArrayMax', 'ArrayMin', 'ArrayNew', 'ArrayPrepend', 'ArrayResize',
25
+ 'ArraySet', 'ArraySort', 'ArraySum', 'ArraySwap', 'ArrayToList', 'Asc', 'ASin', 'Atn', 'AuthenticatedContext',
26
+ 'AuthenticatedUser', 'BitAnd', 'BitMaskClear', 'BitMaskRead', 'BitMaskSet', 'BitNot', 'BitOr',
27
+ 'BitSHLN', 'BitSHRN', 'BitXor', 'Ceiling', 'Chr', 'CJustify', 'Compare', 'CompareNoCase', 'Cos',
28
+ 'CreateDate', 'CreateDateTime', 'CreateODBCDate', 'CreateODBCDateTime', 'CreateODBCTime',
29
+ 'CreateTime', 'CreateTimeSpan', 'DateAdd', 'DateCompare', 'DateConvert', 'DateDiff',
30
+ 'DateFormat', 'DatePart', 'Day', 'DayOfWeek', 'DayOfWeekAsString', 'DayOfYear', 'DaysInMonth',
31
+ 'DaysInYear', 'DE', 'DecimalFormat', 'DecrementValue', 'Decrypt', 'DeleteClientVariable',
32
+ 'DirectoryExists', 'DollarFormat', 'Duplicate', 'Encrypt', 'Evaluate', 'Exp', 'ExpandPath',
33
+ 'FileExists', 'Find', 'FindNoCase', 'FindOneOf', 'FirstDayOfMonth', 'Fix', 'FormatBaseN',
34
+ 'GetBaseTagData', 'GetBaseTagList', 'GetBaseTemplatePath', 'GetClientVariablesList',
35
+ 'GetCurrentTemplatePath', 'GetDirectoryFromPath', 'GetException', 'GetFileFromPath',
36
+ 'GetFunctionList', 'GetHttpTimeString', 'GetHttpRequestData', 'GetLocale', 'GetMetricData',
37
+ 'GetProfileString', 'GetTempDirectory', 'GetTempFile', 'GetTemplatePath', 'GetTickCount',
38
+ 'GetTimeZoneInfo', 'GetToken', 'Hash', 'Hour', 'HTMLCodeFormat', 'HTMLEditFormat', 'IIf',
39
+ 'IncrementValue', 'InputBaseN', 'Insert', 'Int', 'IsArray', 'IsAuthenticated', 'IsAuthorized',
40
+ 'IsBoolean', 'IsBinary', 'IsCustomFunction', 'IsDate', 'IsDebugMode', 'IsDefined', 'IsLeapYear',
41
+ 'IsNumeric', 'IsNumericDate', 'IsProtected', 'IsQuery', 'IsSimpleValue', 'IsStruct', 'IsWDDX',
42
+ 'JavaCast', 'JSStringFormat', 'LCase', 'Left', 'Len', 'ListAppend', 'ListChangeDelims',
43
+ 'ListContains', 'ListContainsNoCase', 'ListDeleteAt', 'ListFind', 'ListFindNoCase', 'ListFirst',
44
+ 'ListGetAt', 'ListInsertAt', 'ListLast', 'ListLen', 'ListPrepend', 'ListQualify', 'ListRest',
45
+ 'ListSetAt', 'ListSort', 'ListToArray', 'ListValueCount', 'ListValueCountNoCase', 'LJustify',
46
+ 'Log', 'Log10', 'LSCurrencyFormat', 'LSDateFormat', 'LSEuroCurrencyFormat', 'LSIsCurrency',
47
+ 'LSIsDate', 'LSIsNumeric', 'LSNumberFormat', 'LSParseCurrency', 'LSParseDateTime', 'LSParseNumber',
48
+ 'LSTimeFormat', 'LTrim', 'Max', 'Mid', 'Min', 'Minute', 'Month', 'MonthAsString', 'Now', 'NumberFormat',
49
+ 'ParagraphFormat', 'ParameterExists', 'ParseDateTime', 'Pi', 'PreserveSingleQuotes', 'Quarter',
50
+ 'QueryAddRow', 'QueryNew', 'QuerySetCell', 'QuotedValueList', 'Rand', 'Randomize', 'RandRange',
51
+ 'REFind', 'REFindNoCase', 'RemoveChars', 'RepeatString', 'Replace', 'ReplaceList', 'ReplaceNoCase',
52
+ 'REReplace', 'REReplaceNoCase', 'Reverse', 'Right', 'RJustify', 'Round', 'RTrim', 'Second', 'SetLocale',
53
+ 'SetProfileString', 'SetVariable', 'Sgn', 'Sin', 'SpanExcluding', 'SpanIncluding', 'Sqr', 'StripCR',
54
+ 'StructAppend', 'StructClear', 'StructCopy', 'StructCount', 'StructDelete', 'StructFind', 'StructFindKey',
55
+ 'StructFindValue', 'StructGet', 'StructInsert', 'StructIsEmpty', 'StructKeyArray', 'StructKeyExists',
56
+ 'StructKeyList', 'StructNew', 'StructSort', 'StructUpdate', 'Tan', 'TimeFormat', 'ToBase64', 'ToBinary',
57
+ 'ToString', 'Trim', 'UCase', 'URLDecode', 'URLEncodedFormat', 'Val', 'ValueList', 'Week', 'WriteOutput',
58
+ 'XMLFormat', 'Year', 'YesNoFormat'
59
+ ]
60
+ }
61
+ ,'OPERATORS' :[
62
+ '+', '-', '/', '*', '%', '!', '&&', '||'
63
+ ]
64
+ ,'DELIMITERS' :[
65
+ '(', ')', '[', ']', '{', '}'
66
+ ]
67
+ ,'REGEXPS' : {
68
+ 'doctype' : {
69
+ 'search' : '()(<!DOCTYPE[^>]*>)()'
70
+ ,'class' : 'doctype'
71
+ ,'modifiers' : ''
72
+ ,'execute' : 'before' // before or after
73
+ }
74
+ ,'cftags' : {
75
+ 'search' : '(<)(/cf[a-z][^ \r\n\t>]*)([^>]*>)'
76
+ ,'class' : 'cftags'
77
+ ,'modifiers' : 'gi'
78
+ ,'execute' : 'before' // before or after
79
+ }
80
+ ,'cftags2' : {
81
+ 'search' : '(<)(cf[a-z][^ \r\n\t>]*)([^>]*>)'
82
+ ,'class' : 'cftags2'
83
+ ,'modifiers' : 'gi'
84
+ ,'execute' : 'before' // before or after
85
+ }
86
+ ,'tags' : {
87
+ 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
88
+ ,'class' : 'tags'
89
+ ,'modifiers' : 'gi'
90
+ ,'execute' : 'before' // before or after
91
+ }
92
+ ,'attributes' : {
93
+ 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
94
+ ,'class' : 'attributes'
95
+ ,'modifiers' : 'g'
96
+ ,'execute' : 'before' // before or after
97
+ }
98
+ }
99
+ ,'STYLES' : {
100
+ 'COMMENTS': 'color: #AAAAAA;'
101
+ ,'QUOTESMARKS': 'color: #6381F8;'
102
+ ,'KEYWORDS' : {
103
+ 'reserved' : 'color: #48BDDF;'
104
+ ,'functions' : 'color: #0000FF;'
105
+ ,'statements' : 'color: #60CA00;'
106
+ }
107
+ ,'OPERATORS' : 'color: #E775F0;'
108
+ ,'DELIMITERS' : ''
109
+ ,'REGEXPS' : {
110
+ 'attributes': 'color: #990033;'
111
+ ,'cftags': 'color: #990033;'
112
+ ,'cftags2': 'color: #990033;'
113
+ ,'tags': 'color: #000099;'
114
+ ,'doctype': 'color: #8DCFB5;'
115
+ ,'test': 'color: #00FF00;'
116
+ }
117
+ }
118
+ };
119
+
120
+
js/editarea/reg_syntax/cpp.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["cpp"] = {
2
+ 'DISPLAY_NAME' : 'CPP'
3
+ ,'COMMENT_SINGLE' : {1 : '//'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : true
7
+ ,'KEYWORDS' : {
8
+ 'constants' : [
9
+ 'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
10
+ 'true'
11
+ ]
12
+ ,'types' : [
13
+ 'FILE', 'auto', 'char', 'class', 'const', 'double',
14
+ 'extern', 'float', 'friend', 'inline', 'int',
15
+ 'iterator', 'long', 'map', 'operator', 'queue',
16
+ 'register', 'short', 'signed', 'size_t', 'stack',
17
+ 'static', 'string', 'struct', 'time_t', 'typedef',
18
+ 'union', 'unsigned', 'vector', 'void', 'volatile'
19
+ ]
20
+ ,'statements' : [
21
+ 'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
22
+ 'sizeof', 'switch', 'this', 'throw', 'try', 'while'
23
+ ]
24
+ ,'keywords' : [
25
+ 'break', 'case', 'continue', 'default', 'delete',
26
+ 'namespace', 'new', 'private', 'protected', 'public',
27
+ 'return', 'using'
28
+ ]
29
+ }
30
+ ,'OPERATORS' :[
31
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
32
+ ]
33
+ ,'DELIMITERS' :[
34
+ '(', ')', '[', ']', '{', '}'
35
+ ]
36
+ ,'REGEXPS' : {
37
+ 'precompiler' : {
38
+ 'search' : '()(#[^\r\n]*)()'
39
+ ,'class' : 'precompiler'
40
+ ,'modifiers' : 'g'
41
+ ,'execute' : 'before'
42
+ }
43
+ /* ,'precompilerstring' : {
44
+ 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
45
+ ,'class' : 'precompilerstring'
46
+ ,'modifiers' : 'g'
47
+ ,'execute' : 'before'
48
+ }*/
49
+ }
50
+ ,'STYLES' : {
51
+ 'COMMENTS': 'color: #AAAAAA;'
52
+ ,'QUOTESMARKS': 'color: #6381F8;'
53
+ ,'KEYWORDS' : {
54
+ 'constants' : 'color: #EE0000;'
55
+ ,'types' : 'color: #0000EE;'
56
+ ,'statements' : 'color: #60CA00;'
57
+ ,'keywords' : 'color: #48BDDF;'
58
+ }
59
+ ,'OPERATORS' : 'color: #FF00FF;'
60
+ ,'DELIMITERS' : 'color: #0038E1;'
61
+ ,'REGEXPS' : {
62
+ 'precompiler' : 'color: #009900;'
63
+ ,'precompilerstring' : 'color: #994400;'
64
+ }
65
+ }
66
+ };
js/editarea/reg_syntax/css.js ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["css"] = {
2
+ 'DISPLAY_NAME' : 'CSS'
3
+ ,'COMMENT_SINGLE' : {1 : '@'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : ['"', "'"]
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'attributes' : [
9
+ 'aqua', 'azimuth', 'background-attachment', 'background-color',
10
+ 'background-image', 'background-position', 'background-repeat',
11
+ 'background', 'border-bottom-color', 'border-bottom-style',
12
+ 'border-bottom-width', 'border-left-color', 'border-left-style',
13
+ 'border-left-width', 'border-right', 'border-right-color',
14
+ 'border-right-style', 'border-right-width', 'border-top-color',
15
+ 'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
16
+ 'border-left', 'border-width', 'border-color', 'border-spacing',
17
+ 'border-style', 'border-top', 'border', 'caption-side',
18
+ 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
19
+ 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
20
+ 'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
21
+ 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
22
+ 'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
23
+ 'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
24
+ 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
25
+ 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
26
+ 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
27
+ 'outline-width', 'overflow', 'padding-bottom', 'padding-left',
28
+ 'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
29
+ 'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
30
+ 'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
31
+ 'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
32
+ 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
33
+ 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
34
+ 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
35
+ 'width', 'word-spacing', 'z-index', 'bottom', 'left'
36
+ ]
37
+ ,'values' : [
38
+ 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
39
+ 'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
40
+ 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
41
+ 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
42
+ 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
43
+ 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
44
+ 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
45
+ 'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
46
+ 'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
47
+ 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
48
+ 'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
49
+ 'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
50
+ 'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
51
+ 'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
52
+ 'pointer', 'portrait', 'purple', 'px',
53
+ 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
54
+ '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',
55
+ 'static', 'status-bar', 'super', 'sw-resize',
56
+ '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',
57
+ 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
58
+ 'visible',
59
+ 'w-resize', 'wait', 'white', 'wider',
60
+ 'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
61
+ 'yellow', 'yes'
62
+ ]
63
+ ,'specials' : [
64
+ 'important'
65
+ ]
66
+ }
67
+ ,'OPERATORS' :[
68
+ ':', ';', '!', '.', '#'
69
+ ]
70
+ ,'DELIMITERS' :[
71
+ '{', '}'
72
+ ]
73
+ ,'STYLES' : {
74
+ 'COMMENTS': 'color: #AAAAAA;'
75
+ ,'QUOTESMARKS': 'color: #6381F8;'
76
+ ,'KEYWORDS' : {
77
+ 'attributes' : 'color: #48BDDF;'
78
+ ,'values' : 'color: #2B60FF;'
79
+ ,'specials' : 'color: #FF0000;'
80
+ }
81
+ ,'OPERATORS' : 'color: #FF00FF;'
82
+ ,'DELIMITERS' : 'color: #60CA00;'
83
+
84
+ }
85
+ };
js/editarea/reg_syntax/html.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * last update: 2006-08-24
3
+ */
4
+
5
+ editAreaLoader.load_syntax["html"] = {
6
+ 'DISPLAY_NAME' : 'HTML'
7
+ ,'COMMENT_SINGLE' : {}
8
+ ,'COMMENT_MULTI' : {'<!--' : '-->'}
9
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
10
+ ,'KEYWORD_CASE_SENSITIVE' : false
11
+ ,'KEYWORDS' : {
12
+ }
13
+ ,'OPERATORS' :[
14
+ ]
15
+ ,'DELIMITERS' :[
16
+ ]
17
+ ,'REGEXPS' : {
18
+ 'doctype' : {
19
+ 'search' : '()(<!DOCTYPE[^>]*>)()'
20
+ ,'class' : 'doctype'
21
+ ,'modifiers' : ''
22
+ ,'execute' : 'before' // before or after
23
+ }
24
+ ,'tags' : {
25
+ 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
26
+ ,'class' : 'tags'
27
+ ,'modifiers' : 'gi'
28
+ ,'execute' : 'before' // before or after
29
+ }
30
+ ,'attributes' : {
31
+ 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
32
+ ,'class' : 'attributes'
33
+ ,'modifiers' : 'g'
34
+ ,'execute' : 'before' // before or after
35
+ }
36
+ }
37
+ ,'STYLES' : {
38
+ 'COMMENTS': 'color: #AAAAAA;'
39
+ ,'QUOTESMARKS': 'color: #6381F8;'
40
+ ,'KEYWORDS' : {
41
+ }
42
+ ,'OPERATORS' : 'color: #E775F0;'
43
+ ,'DELIMITERS' : ''
44
+ ,'REGEXPS' : {
45
+ 'attributes': 'color: #B1AC41;'
46
+ ,'tags': 'color: #E62253;'
47
+ ,'doctype': 'color: #8DCFB5;'
48
+ ,'test': 'color: #00FF00;'
49
+ }
50
+ }
51
+ };
js/editarea/reg_syntax/java.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["java"] = {
2
+ 'DISPLAY_NAME' : 'Java'
3
+ ,'COMMENT_SINGLE': { 1: '//', 2: '@' }
4
+ , 'COMMENT_MULTI': { '/*': '*/' }
5
+ , 'QUOTEMARKS': { 1: "'", 2: '"' }
6
+ , 'KEYWORD_CASE_SENSITIVE': true
7
+ , 'KEYWORDS': {
8
+ 'constants': [
9
+ 'null', 'false', 'true'
10
+ ]
11
+ , 'types': [
12
+ 'String', 'int', 'short', 'long', 'char', 'double', 'byte',
13
+ 'float', 'static', 'void', 'private', 'boolean', 'protected',
14
+ 'public', 'const', 'class', 'final', 'abstract', 'volatile',
15
+ 'enum', 'transient', 'interface'
16
+ ]
17
+ , 'statements': [
18
+ 'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
19
+ 'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
20
+ 'break', 'case', 'default', 'goto'
21
+ ]
22
+ , 'keywords': [
23
+ 'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
24
+ 'instanceof', 'strictfp'
25
+ ]
26
+ }
27
+ , 'OPERATORS': [
28
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
29
+ ]
30
+ , 'DELIMITERS': [
31
+ '(', ')', '[', ']', '{', '}'
32
+ ]
33
+ , 'REGEXPS': {
34
+ 'precompiler': {
35
+ 'search': '()(#[^\r\n]*)()'
36
+ , 'class': 'precompiler'
37
+ , 'modifiers': 'g'
38
+ , 'execute': 'before'
39
+ }
40
+ }
41
+ , 'STYLES': {
42
+ 'COMMENTS': 'color: #AAAAAA;'
43
+ , 'QUOTESMARKS': 'color: #6381F8;'
44
+ , 'KEYWORDS': {
45
+ 'constants': 'color: #EE0000;'
46
+ , 'types': 'color: #0000EE;'
47
+ , 'statements': 'color: #60CA00;'
48
+ , 'keywords': 'color: #48BDDF;'
49
+ }
50
+ , 'OPERATORS': 'color: #FF00FF;'
51
+ , 'DELIMITERS': 'color: #0038E1;'
52
+ , 'REGEXPS': {
53
+ 'precompiler': 'color: #009900;'
54
+ , 'precompilerstring': 'color: #994400;'
55
+ }
56
+ }
57
+ };
js/editarea/reg_syntax/js.js ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["js"] = {
2
+ 'DISPLAY_NAME' : 'Javascript'
3
+ ,'COMMENT_SINGLE' : {1 : '//'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements' : [
9
+ 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
10
+ 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
11
+ 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
12
+ 'while', 'write', 'with'
13
+ ]
14
+ ,'keywords' : [
15
+ 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
16
+ 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
17
+ 'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
18
+ // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
19
+ 'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
20
+ 'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
21
+ 'arguments', 'locationbar', 'pageXoffset', 'Form',
22
+ 'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
23
+ 'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
24
+ 'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
25
+ 'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
26
+ 'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
27
+ 'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
28
+ 'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
29
+ 'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
30
+ 'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
31
+ 'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
32
+ 'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
33
+ 'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
34
+ ]
35
+ ,'functions' : [
36
+ // common functions for Window object
37
+ 'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
38
+ 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
39
+ 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
40
+ 'stop'
41
+ ]
42
+ }
43
+ ,'OPERATORS' :[
44
+ '+', '-', '/', '*', '=', '<', '>', '%', '!'
45
+ ]
46
+ ,'DELIMITERS' :[
47
+ '(', ')', '[', ']', '{', '}'
48
+ ]
49
+ ,'STYLES' : {
50
+ 'COMMENTS': 'color: #AAAAAA;'
51
+ ,'QUOTESMARKS': 'color: #6381F8;'
52
+ ,'KEYWORDS' : {
53
+ 'statements' : 'color: #60CA00;'
54
+ ,'keywords' : 'color: #48BDDF;'
55
+ ,'functions' : 'color: #2B60FF;'
56
+ }
57
+ ,'OPERATORS' : 'color: #FF00FF;'
58
+ ,'DELIMITERS' : 'color: #0038E1;'
59
+
60
+ }
61
+ ,'AUTO_COMPLETION' : {
62
+ "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
63
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
64
+ ,"possible_words_letters": "[a-zA-Z0-9_]+"
65
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
66
+ ,"prefix_separator": "\\."
67
+ }
68
+ ,"CASE_SENSITIVE": true
69
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
70
+ ,"KEYWORDS": {
71
+ '': [ // the prefix of thoses items
72
+ /**
73
+ * 0 : the keyword the user is typing
74
+ * 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 )
75
+ * If empty the keyword will be displayed
76
+ * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
77
+ */
78
+ ['Array', '§()', '']
79
+ ,['alert', '§({@})', 'alert(String message)']
80
+ ,['document']
81
+ ,['window']
82
+ ]
83
+ ,'window' : [
84
+ ['location']
85
+ ,['document']
86
+ ,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
87
+ ]
88
+ ,'location' : [
89
+ ['href']
90
+ ]
91
+ }
92
+ }
93
+ }
94
+ };
js/editarea/reg_syntax/pas.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["pas"] = {
2
+ 'DISPLAY_NAME' : 'Pascal'
3
+ ,'COMMENT_SINGLE' : {}
4
+ ,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
5
+ ,'QUOTEMARKS' : {1: '"', 2: "'"}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'constants' : [
9
+ 'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
10
+ 'Magenta', 'Brown', 'LightGray', 'DarkGray',
11
+ 'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
12
+ 'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
13
+ 'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
14
+ 'erroraddr', 'errorcode', 'LineEnding'
15
+ ]
16
+ ,'keywords' : [
17
+ 'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
18
+ 'pow', 'is', 'not','Absolute', 'And_then', 'Array',
19
+ 'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
20
+ 'Else', 'End', 'Export', 'File', 'For', 'Function',
21
+ 'Goto', 'If', 'Import', 'Implementation', 'Inherited',
22
+ 'Inline', 'Interface', 'Label', 'Module', 'Nil',
23
+ 'Object', 'Of', 'Only', 'Operator', 'Or_else',
24
+ 'Otherwise', 'Packed', 'Procedure', 'Program',
25
+ 'Protected', 'Qualified', 'Record', 'Repeat',
26
+ 'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
27
+ 'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
28
+ 'With'
29
+ ]
30
+ ,'functions' : [
31
+ 'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
32
+ 'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
33
+ 'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
34
+ 'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
35
+ 'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
36
+ 'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
37
+ 'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
38
+ 'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
39
+ 'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
40
+ 'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
41
+ 'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
42
+ 'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
43
+ 'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
44
+ 'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
45
+ 'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
46
+ 'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
47
+ 'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
48
+ 'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
49
+ 'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
50
+ 'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
51
+ 'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
52
+ 'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
53
+ 'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
54
+ 'Write', 'WriteLn'
55
+ ]
56
+ ,'types' : [
57
+ 'Integer', 'Shortint', 'SmallInt', 'Longint',
58
+ 'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
59
+ 'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
60
+ 'Real', 'Single', 'Double', 'Extended', 'Comp',
61
+ 'String', 'ShortString', 'AnsiString', 'PChar'
62
+ ]
63
+ }
64
+ ,'OPERATORS' :[
65
+ '@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
66
+ ]
67
+ ,'DELIMITERS' :[
68
+ '(', ')', '[', ']'
69
+ ]
70
+ ,'STYLES' : {
71
+ 'COMMENTS': 'color: #AAAAAA;'
72
+ ,'QUOTESMARKS': 'color: #6381F8;'
73
+ ,'KEYWORDS' : {
74
+ 'specials' : 'color: #EE0000;'
75
+ ,'constants' : 'color: #654321;'
76
+ ,'keywords' : 'color: #48BDDF;'
77
+ ,'functions' : 'color: #449922;'
78
+ ,'types' : 'color: #2B60FF;'
79
+ }
80
+ ,'OPERATORS' : 'color: #FF00FF;'
81
+ ,'DELIMITERS' : 'color: #60CA00;'
82
+ }
83
+ };
js/editarea/reg_syntax/perl.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************
2
+ * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
3
+ *
4
+ * You may choose any license of the current release or any future release
5
+ * of editarea to use, modify and/or redistribute this file.
6
+ *
7
+ * This language specification file supports for syntax checking on
8
+ * a large subset of Perl 5.x.
9
+ * The basic common syntax of Perl is fully supported, but as for
10
+ * the highlighting of built-in operations, it's mainly designed
11
+ * to support for hightlighting Perl code in a Safe environment (compartment)
12
+ * as used by CoMaNet for evaluation of administrative scripts. This Safe
13
+ * compartment basically allows for all of Opcode's :default operations,
14
+ * but little others. See http://perldoc.perl.org/Opcode.html to learn
15
+ * more.
16
+ ***************************************************************************/
17
+
18
+ editAreaLoader.load_syntax["perl"] = {
19
+ 'DISPLAY_NAME' : 'Perl',
20
+ 'COMMENT_SINGLE' : {1 : '#'},
21
+ 'QUOTEMARKS' : {1: "'", 2: '"'},
22
+ 'KEYWORD_CASE_SENSITIVE' : true,
23
+ 'KEYWORDS' :
24
+ {
25
+ 'core' :
26
+ [ "if", "else", "elsif", "while", "for", "each", "foreach",
27
+ "next", "last", "goto", "exists", "delete", "undef",
28
+ "my", "our", "local", "use", "require", "package", "keys", "values",
29
+ "sub", "bless", "ref", "return" ],
30
+ 'functions' :
31
+ [
32
+ //from :base_core
33
+ "int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
34
+ "length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
35
+ "uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
36
+ "push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
37
+ "xor", "warn", "die", "prototype",
38
+ //from :base_mem
39
+ "concat", "repeat", "join", "range",
40
+ //none from :base_loop, as we'll see them as basic statements...
41
+ //from :base_orig
42
+ "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
43
+ //others
44
+ "print", "open", "close"
45
+ ]
46
+ },
47
+ 'OPERATORS' :
48
+ [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
49
+ ' eq ', ' ne ', '=~' ],
50
+ 'DELIMITERS' :
51
+ [ '(', ')', '[', ']', '{', '}' ],
52
+ 'REGEXPS' :
53
+ {
54
+ 'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
55
+ 'class' : 'scopingnames',
56
+ 'modifiers' : 'g', 'execute' : 'before' },
57
+ 'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
58
+ 'class' : 'scopingnames',
59
+ 'modifiers' : 'g', 'execute' : 'before' },
60
+ 'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
61
+ 'class' : 'vars',
62
+ 'modifiers' : 'g', 'execute' : 'after' },
63
+ 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
64
+ 'class' : 'vars',
65
+ 'modifiers' : 'g', 'execute' : 'after' },
66
+ 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
67
+ 'class' : 'vars',
68
+ 'modifiers' : 'g', 'execute' : 'after' },
69
+ },
70
+
71
+ 'STYLES' :
72
+ {
73
+ 'COMMENTS': 'color: #AAAAAA;',
74
+ 'QUOTESMARKS': 'color: #DC0000;',
75
+ 'KEYWORDS' :
76
+ {
77
+ 'core' : 'color: #8aca00;',
78
+ 'functions' : 'color: #2B60FF;'
79
+ },
80
+ 'OPERATORS' : 'color: #8aca00;',
81
+ 'DELIMITERS' : 'color: #0038E1;',
82
+ 'REGEXPS':
83
+ {
84
+ 'scopingnames' : 'color: #ff0000;',
85
+ 'vars' : 'color: #00aaaa;',
86
+ }
87
+ } //'STYLES'
88
+ };
js/editarea/reg_syntax/php.js ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["php"] = {
2
+ 'DISPLAY_NAME' : 'Php'
3
+ ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements' : [
9
+ 'include', 'require', 'include_once', 'require_once',
10
+ 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
11
+ 'endif', 'switch', 'case', 'endswitch',
12
+ 'return', 'break', 'continue'
13
+ ]
14
+ ,'reserved' : [
15
+ '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
16
+ 'null', '__LINE__', '__FILE__',
17
+ 'false', '&lt;?php', '?&gt;', '&lt;?',
18
+ '&lt;script language', '&lt;/script&gt;',
19
+ 'true', 'var', 'default',
20
+ 'function', 'class', 'new', '&amp;new', 'this',
21
+ '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
22
+ 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
23
+ 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
24
+ 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
25
+ 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
26
+ 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
27
+ 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
28
+
29
+ ]
30
+ ,'functions' : [
31
+ 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
32
+ 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
33
+ 'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
34
+ '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',
35
+ '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',
36
+ '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',
37
+ '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',
38
+ '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',
39
+ 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
40
+ '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',
41
+ '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',
42
+ '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',
43
+ 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
44
+
45
+ ]
46
+ }
47
+ ,'OPERATORS' :[
48
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
49
+ ]
50
+ ,'DELIMITERS' :[
51
+ '(', ')', '[', ']', '{', '}'
52
+ ]
53
+ ,'REGEXPS' : {
54
+ // highlight all variables ($...)
55
+ 'variables' : {
56
+ 'search' : '()(\\$\\w+)()'
57
+ ,'class' : 'variables'
58
+ ,'modifiers' : 'g'
59
+ ,'execute' : 'before' // before or after
60
+ }
61
+ }
62
+ ,'STYLES' : {
63
+ 'COMMENTS': 'color: #AAAAAA;'
64
+ ,'QUOTESMARKS': 'color: #879EFA;'
65
+ ,'KEYWORDS' : {
66
+ 'reserved' : 'color: #48BDDF;'
67
+ ,'functions' : 'color: #0040FD;'
68
+ ,'statements' : 'color: #60CA00;'
69
+ }
70
+ ,'OPERATORS' : 'color: #FF00FF;'
71
+ ,'DELIMITERS' : 'color: #2B60FF;'
72
+ ,'REGEXPS' : {
73
+ 'variables' : 'color: #E0BD54;'
74
+ }
75
+ }
76
+ ,'AUTO_COMPLETION' : {
77
+ "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
78
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
79
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
80
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
81
+ ,"prefix_separator": "\\-\\>|\\:\\:"
82
+ }
83
+ ,"CASE_SENSITIVE": true
84
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
85
+ ,"KEYWORDS": {
86
+ '': [ // the prefix of thoses items
87
+ /**
88
+ * 0 : the keyword the user is typing
89
+ * 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 )
90
+ * If empty the keyword will be displayed
91
+ * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
92
+ */
93
+ ['$_POST']
94
+ ,['$_GET']
95
+ ,['$_SESSION']
96
+ ,['$_SERVER']
97
+ ,['$_FILES']
98
+ ,['$_ENV']
99
+ ,['$_COOKIE']
100
+ ,['$_REQUEST']
101
+ // magic methods
102
+ ,['__construct', '§( {@} )']
103
+ ,['__destruct', '§( {@} )']
104
+ ,['__sleep', '§( {@} )']
105
+ ,['__wakeup', '§( {@} )']
106
+ ,['__toString', '§( {@} )']
107
+ // include
108
+ ,['include', '§ "{@}";']
109
+ ,['include_once', '§ "{@}";']
110
+ ,['require', '§ "{@}";']
111
+ ,['require_once', '§ "{@}";']
112
+ // statements
113
+ ,['for', '§( {@} )']
114
+ ,['foreach', '§( {@} )']
115
+ ,['if', '§( {@} )']
116
+ ,['elseif', '§( {@} )']
117
+ ,['while', '§( {@} )']
118
+ ,['switch', '§( {@} )']
119
+ ,['break']
120
+ ,['case']
121
+ ,['continue']
122
+ ,['do']
123
+ ,['else']
124
+ ,['endif']
125
+ ,['endswitch']
126
+ ,['endwhile']
127
+ ,['return']
128
+ // function
129
+ ,['unset', '§( {@} )']
130
+ ]
131
+ }
132
+ }
133
+ ,"live": {
134
+
135
+ // class NAME: /class\W+([a-z]+)\W+/gi
136
+ // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
137
+ // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
138
+ // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi
139
+ // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi
140
+ // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi
141
+
142
+
143
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
144
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
145
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
146
+ ,"prefix_separator": "\\-\\>"
147
+ }
148
+ ,"CASE_SENSITIVE": true
149
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
150
+ ,"KEYWORDS": {
151
+ '$this': [ // the prefix of thoses items
152
+ ['test']
153
+ ]
154
+ }
155
+ }
156
+ }
157
+ };
js/editarea/reg_syntax/phtml.js ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["phtml"] = {
2
+ 'DISPLAY_NAME' : 'PHTML'
3
+ ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements' : [
9
+ 'include', 'require', 'include_once', 'require_once',
10
+ 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
11
+ 'endif', 'switch', 'case', 'endswitch',
12
+ 'return', 'break', 'continue'
13
+ ]
14
+ ,'reserved' : [
15
+ '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
16
+ 'null', '__LINE__', '__FILE__',
17
+ 'false', '&lt;?php', '?&gt;', '&lt;?',
18
+ '&lt;script language', '&lt;/script&gt;',
19
+ 'true', 'var', 'default',
20
+ 'function', 'class', 'new', '&amp;new', 'this',
21
+ '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
22
+ 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
23
+ 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
24
+ 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
25
+ 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
26
+ 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
27
+ 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
28
+
29
+ ]
30
+ ,'functions' : [
31
+ 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
32
+ 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
33
+ 'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
34
+ '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',
35
+ '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',
36
+ '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',
37
+ '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',
38
+ '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',
39
+ 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
40
+ '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',
41
+ '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',
42
+ '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',
43
+ 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
44
+
45
+ ]
46
+ }
47
+ ,'OPERATORS' :[
48
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
49
+ ]
50
+ ,'DELIMITERS' :[
51
+ '(', ')', '[', ']', '{', '}'
52
+ ]
53
+ ,'REGEXPS' : {
54
+ // highlight all variables ($...)
55
+ 'variables' : {
56
+ 'search' : '()(\\$\\w+)()'
57
+ ,'class' : 'variables'
58
+ ,'modifiers' : 'g'
59
+ ,'execute' : 'before' // before or after
60
+ }
61
+ }
62
+ ,'STYLES' : {
63
+ 'COMMENTS': 'color: #AAAAAA;'
64
+ ,'QUOTESMARKS': 'color: #879EFA;'
65
+ ,'KEYWORDS' : {
66
+ 'reserved' : 'color: #48BDDF;'
67
+ ,'functions' : 'color: #0040FD;'
68
+ ,'statements' : 'color: #60CA00;'
69
+ }
70
+ ,'OPERATORS' : 'color: #FF00FF;'
71
+ ,'DELIMITERS' : 'color: #2B60FF;'
72
+ ,'REGEXPS' : {
73
+ 'variables' : 'color: #E0BD54;'
74
+ }
75
+ }
76
+ ,'AUTO_COMPLETION' : {
77
+ "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
78
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
79
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
80
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
81
+ ,"prefix_separator": "\\-\\>|\\:\\:"
82
+ }
83
+ ,"CASE_SENSITIVE": true
84
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
85
+ ,"KEYWORDS": {
86
+ '': [ // the prefix of thoses items
87
+ /**
88
+ * 0 : the keyword the user is typing
89
+ * 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 )
90
+ * If empty the keyword will be displayed
91
+ * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
92
+ */
93
+ ['$_POST']
94
+ ,['$_GET']
95
+ ,['$_SESSION']
96
+ ,['$_SERVER']
97
+ ,['$_FILES']
98
+ ,['$_ENV']
99
+ ,['$_COOKIE']
100
+ ,['$_REQUEST']
101
+ // magic methods
102
+ ,['__construct', '§( {@} )']
103
+ ,['__destruct', '§( {@} )']
104
+ ,['__sleep', '§( {@} )']
105
+ ,['__wakeup', '§( {@} )']
106
+ ,['__toString', '§( {@} )']
107
+ // include
108
+ ,['include', '§ "{@}";']
109
+ ,['include_once', '§ "{@}";']
110
+ ,['require', '§ "{@}";']
111
+ ,['require_once', '§ "{@}";']
112
+ // statements
113
+ ,['for', '§( {@} )']
114
+ ,['foreach', '§( {@} )']
115
+ ,['if', '§( {@} )']
116
+ ,['elseif', '§( {@} )']
117
+ ,['while', '§( {@} )']
118
+ ,['switch', '§( {@} )']
119
+ ,['break']
120
+ ,['case']
121
+ ,['continue']
122
+ ,['do']
123
+ ,['else']
124
+ ,['endif']
125
+ ,['endswitch']
126
+ ,['endwhile']
127
+ ,['return']
128
+ // function
129
+ ,['unset', '§( {@} )']
130
+ ]
131
+ }
132
+ }
133
+ ,"live": {
134
+
135
+ // class NAME: /class\W+([a-z]+)\W+/gi
136
+ // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
137
+ // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
138
+ // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi
139
+ // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi
140
+ // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi
141
+
142
+
143
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
144
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
145
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
146
+ ,"prefix_separator": "\\-\\>"
147
+ }
148
+ ,"CASE_SENSITIVE": true
149
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
150
+ ,"KEYWORDS": {
151
+ '$this': [ // the prefix of thoses items
152
+ ['test']
153
+ ]
154
+ }
155
+ }
156
+ }
157
+ };
js/editarea/reg_syntax/python.js ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Python syntax v 1.1
3
+ *
4
+ * v1.1 by Andre Roberge (2006/12/27)
5
+ *
6
+ **/
7
+ editAreaLoader.load_syntax["python"] = {
8
+ 'DISPLAY_NAME' : 'Python'
9
+ ,'COMMENT_SINGLE' : {1 : '#'}
10
+ ,'COMMENT_MULTI' : {}
11
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
12
+ ,'KEYWORD_CASE_SENSITIVE' : true
13
+ ,'KEYWORDS' : {
14
+ /*
15
+ ** Set 1: reserved words
16
+ ** http://python.org/doc/current/ref/keywords.html
17
+ ** Note: 'as' and 'with' have been added starting with Python 2.5
18
+ */
19
+ 'reserved' : [
20
+ 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
21
+ 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if',
22
+ 'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
23
+ 'return', 'try', 'while', 'with', 'yield'
24
+ //the following are *almost* reserved; we'll treat them as such
25
+ , 'False', 'True', 'None'
26
+ ]
27
+ /*
28
+ ** Set 2: builtins
29
+ ** http://python.org/doc/current/lib/built-in-funcs.html
30
+ */
31
+ ,'builtins' : [
32
+ '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
33
+ 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
34
+ 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
35
+ 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
36
+ 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
37
+ 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
38
+ 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
39
+ 'vars', 'xrange', 'zip',
40
+ // Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
41
+ //'False', 'True', 'None' have been included in 'reserved'
42
+ 'NotImplemented', 'Ellipsis',
43
+ // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
44
+ 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
45
+ 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
46
+ 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
47
+ 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
48
+ 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
49
+ 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
50
+ 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
51
+ 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
52
+ 'RuntimeWarning', 'FutureWarning',
53
+ // we will include the string methods as well
54
+ // http://python.org/doc/current/lib/string-methods.html
55
+ 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
56
+ 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
57
+ 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
58
+ 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
59
+ 'translate', 'upper', 'zfill'
60
+ ]
61
+ /*
62
+ ** Set 3: standard library
63
+ ** http://python.org/doc/current/lib/modindex.html
64
+ */
65
+ ,'stdlib' : [
66
+ '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
67
+ 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
68
+ 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
69
+ 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
70
+ 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
71
+ 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
72
+ 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
73
+ 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
74
+ 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
75
+ 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
76
+ 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
77
+ 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
78
+ 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
79
+ 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
80
+ 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
81
+ 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
82
+ 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
83
+ 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
84
+ 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
85
+ 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
86
+ 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
87
+ 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
88
+ 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
89
+ 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
90
+ 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
91
+ 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
92
+ 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
93
+ 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
94
+ 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
95
+ 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
96
+
97
+ ]
98
+ /*
99
+ ** Set 4: special methods
100
+ ** http://python.org/doc/current/ref/specialnames.html
101
+ */
102
+ ,'special' : [
103
+ // Basic customization: http://python.org/doc/current/ref/customization.html
104
+ '__new__', '__init__', '__del__', '__repr__', '__str__',
105
+ '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
106
+ '__hash__', '__nonzero__', '__unicode__', '__dict__',
107
+ // Attribute access: http://python.org/doc/current/ref/attribute-access.html
108
+ '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
109
+ '__delete__', '__slots__',
110
+ // Class creation, callable objects
111
+ '__metaclass__', '__call__',
112
+ // Container types: http://python.org/doc/current/ref/sequence-types.html
113
+ '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
114
+ '__getslice__', '__setslice__', '__delslice__',
115
+ // Numeric types: http://python.org/doc/current/ref/numeric-types.html
116
+ '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
117
+ '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
118
+ '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
119
+ '__long__','__lshift__',
120
+ '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
121
+ '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
122
+ '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
123
+ '__sub__','__xor__'
124
+ ]
125
+ }
126
+ ,'OPERATORS' :[
127
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
128
+ ]
129
+ ,'DELIMITERS' :[
130
+ '(', ')', '[', ']', '{', '}'
131
+ ]
132
+ ,'STYLES' : {
133
+ 'COMMENTS': 'color: #AAAAAA;'
134
+ ,'QUOTESMARKS': 'color: #660066;'
135
+ ,'KEYWORDS' : {
136
+ 'reserved' : 'color: #0000FF;'
137
+ ,'builtins' : 'color: #009900;'
138
+ ,'stdlib' : 'color: #009900;'
139
+ ,'special': 'color: #006666;'
140
+ }
141
+ ,'OPERATORS' : 'color: #993300;'
142
+ ,'DELIMITERS' : 'color: #993300;'
143
+
144
+ }
145
+ };
js/editarea/reg_syntax/robotstxt.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["robotstxt"] = {
2
+ 'DISPLAY_NAME' : 'Robots txt',
3
+ 'COMMENT_SINGLE' : {1 : '#'},
4
+ 'COMMENT_MULTI' : {},
5
+ 'QUOTEMARKS' : [],
6
+ 'KEYWORD_CASE_SENSITIVE' : false,
7
+ 'KEYWORDS' : {
8
+ 'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'],
9
+ 'values' : ['*'],
10
+ 'specials' : ['*']
11
+ },
12
+ 'OPERATORS' :[':'],
13
+ 'DELIMITERS' :[],
14
+ 'STYLES' : {
15
+ 'COMMENTS': 'color: #AAAAAA;',
16
+ 'QUOTESMARKS': 'color: #6381F8;',
17
+ 'KEYWORDS' : {
18
+ 'attributes' : 'color: #48BDDF;',
19
+ 'values' : 'color: #2B60FF;',
20
+ 'specials' : 'color: #FF0000;'
21
+ },
22
+ 'OPERATORS' : 'color: #FF00FF;',
23
+ 'DELIMITERS' : 'color: #60CA00;'
24
+ }
25
+ };
js/editarea/reg_syntax/ruby.js ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Ruby syntax v 1.0
3
+ *
4
+ * v1.0 by Patrice De Saint Steban (2007/01/03)
5
+ *
6
+ **/
7
+ editAreaLoader.load_syntax["ruby"] = {
8
+ 'DISPLAY_NAME' : 'Ruby'
9
+ ,'COMMENT_SINGLE' : {1 : '#'}
10
+ ,'COMMENT_MULTI' : {}
11
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
12
+ ,'KEYWORD_CASE_SENSITIVE' : true
13
+ ,'KEYWORDS' : {
14
+ 'reserved' : [
15
+ 'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',
16
+ 'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if',
17
+ 'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',
18
+ 'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
19
+ ]
20
+ }
21
+ ,'OPERATORS' :[
22
+ '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
23
+ ]
24
+ ,'DELIMITERS' :[
25
+ '(', ')', '[', ']', '{', '}'
26
+ ]
27
+ ,'REGEXPS' : {
28
+ 'constants' : {
29
+ 'search' : '()([A-Z]\\w*)()'
30
+ ,'class' : 'constants'
31
+ ,'modifiers' : 'g'
32
+ ,'execute' : 'before'
33
+ }
34
+ ,'variables' : {
35
+ 'search' : '()([\$\@\%]+\\w+)()'
36
+ ,'class' : 'variables'
37
+ ,'modifiers' : 'g'
38
+ ,'execute' : 'before'
39
+ }
40
+ ,'numbers' : {
41
+ 'search' : '()(-?[0-9]+)()'
42
+ ,'class' : 'numbers'
43
+ ,'modifiers' : 'g'
44
+ ,'execute' : 'before'
45
+ }
46
+ ,'symbols' : {
47
+ 'search' : '()(:\\w+)()'
48
+ ,'class' : 'symbols'
49
+ ,'modifiers' : 'g'
50
+ ,'execute' : 'before'
51
+ }
52
+ }
53
+ ,'STYLES' : {
54
+ 'COMMENTS': 'color: #AAAAAA;'
55
+ ,'QUOTESMARKS': 'color: #660066;'
56
+ ,'KEYWORDS' : {
57
+ 'reserved' : 'font-weight: bold; color: #0000FF;'
58
+ }
59
+ ,'OPERATORS' : 'color: #993300;'
60
+ ,'DELIMITERS' : 'color: #993300;'
61
+ ,'REGEXPS' : {
62
+ 'variables' : 'color: #E0BD54;'
63
+ ,'numbers' : 'color: green;'
64
+ ,'constants' : 'color: #00AA00;'
65
+ ,'symbols' : 'color: #879EFA;'
66
+ }
67
+ }
68
+ };
js/editarea/reg_syntax/sql.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["sql"] = {
2
+ 'DISPLAY_NAME' : 'SQL'
3
+ ,'COMMENT_SINGLE' : {1 : '--'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements' : [
9
+ 'select', 'SELECT', 'where', 'order', 'by',
10
+ 'insert', 'from', 'update', 'grant', 'left join', 'right join',
11
+ 'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'
12
+ ]
13
+ ,'reserved' : [
14
+ 'null', 'enum', 'int', 'boolean', 'add', 'varchar'
15
+
16
+ ]
17
+ ,'functions' : [
18
+ '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',
19
+ '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',
20
+ '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',
21
+ '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',
22
+ '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',
23
+ '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',
24
+ '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'
25
+ ]
26
+ }
27
+ ,'OPERATORS' :[
28
+ 'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'
29
+ ]
30
+ ,'DELIMITERS' :[
31
+ '(', ')', '[', ']', '{', '}'
32
+ ]
33
+ ,'REGEXPS' : {
34
+ // highlight all variables (@...)
35
+ 'variables' : {
36
+ 'search' : '()(\\@\\w+)()'
37
+ ,'class' : 'variables'
38
+ ,'modifiers' : 'g'
39
+ ,'execute' : 'before' // before or after
40
+ }
41
+ }
42
+ ,'STYLES' : {
43
+ 'COMMENTS': 'color: #AAAAAA;'
44
+ ,'QUOTESMARKS': 'color: #879EFA;'
45
+ ,'KEYWORDS' : {
46
+ 'reserved' : 'color: #48BDDF;'
47
+ ,'functions' : 'color: #0040FD;'
48
+ ,'statements' : 'color: #60CA00;'
49
+ }
50
+ ,'OPERATORS' : 'color: #FF00FF;'
51
+ ,'DELIMITERS' : 'color: #2B60FF;'
52
+ ,'REGEXPS' : {
53
+ 'variables' : 'color: #E0BD54;'
54
+ }
55
+ }
56
+ };
js/editarea/reg_syntax/tsql.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["tsql"] = {
2
+ 'DISPLAY_NAME' : 'T-SQL'
3
+ ,'COMMENT_SINGLE' : {1 : '--'}
4
+ ,'COMMENT_MULTI' : {'/*' : '*/'}
5
+ ,'QUOTEMARKS' : {1: "'" }
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements': [
9
+ 'ADD', 'EXCEPT', 'PERCENT', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION',
10
+ 'PRIMARY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC',
11
+ 'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC', 'BACKUP', 'FOR', 'RAISERROR',
12
+ 'BEGIN', 'FOREIGN', 'READ', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
13
+ 'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY',
14
+ 'FUNCTION', 'RESTORE', 'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN',
15
+ 'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE', 'HOLDLOCK', 'ROLLBACK',
16
+ 'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE',
17
+ 'IDENTITYCOL', 'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'SCHEMA', 'COMPUTE', 'INDEX',
18
+ 'SELECT', 'CONSTRAINT', 'CONTAINS', 'INSERT', 'SET',
19
+ 'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'SOME',
20
+ 'CREATE', 'STATISTICS', 'KEY', 'CURRENT', 'KILL', 'TABLE',
21
+ 'CURRENT_DATE', 'TEXTSIZE', 'CURRENT_TIME', 'THEN', 'LINENO',
22
+ 'TO', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN', 'DATABASE', 'NOCHECK',
23
+ 'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'TRUNCATE',
24
+ 'DECLARE', 'TSEQUAL', 'DEFAULT', 'UNION', 'DELETE', 'OF', 'UNIQUE',
25
+ 'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT', 'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN',
26
+ 'DISTRIBUTED', 'OPENDATASOURCE', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING', 'DROP',
27
+ 'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'WHERE',
28
+ 'END', 'ORDER', 'WHILE', 'ERRLVL', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT'
29
+ ],
30
+ 'functions': [
31
+ 'COALESCE', 'SESSION_USER', 'CONVERT', 'SYSTEM_USER', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'NULLIF', 'USER',
32
+ 'AVG', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG', 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP', 'MAX',
33
+ '@@DATEFIRST', '@@OPTIONS', '@@DBTS', '@@REMSERVER', '@@LANGID', '@@SERVERNAME', '@@LANGUAGE', '@@SERVICENAME', '@@LOCK_TIMEOUT',
34
+ '@@SPID', '@@MAX_CONNECTIONS', '@@TEXTSIZE', '@@MAX_PRECISION', '@@VERSION', '@@NESTLEVEL',
35
+ '@@CURSOR_ROWS', 'CURSOR_STATUS', '@@FETCH_STATUS',
36
+ 'DATEADD', 'DATEDIFF', 'DATENAME', 'DATEPART', 'DAY', 'GETDATE', 'GETUTCDATE', 'MONTH', 'YEAR',
37
+ 'ABS', 'DEGREES', 'RAND', 'ACOS', 'EXP', 'ROUND', 'ASIN', 'FLOOR', 'SIGN', 'ATAN', 'LOG', 'SIN', 'ATN2', 'LOG10', 'SQRT',
38
+ 'CEILING', 'PI ', 'SQUARE', 'COS', 'POWER', 'TAN', 'COT', 'RADIANS',
39
+ '@@PROCID', 'COL_LENGTH', 'FULLTEXTCATALOGPROPERTY', 'COL_NAME', 'FULLTEXTSERVICEPROPERTY', 'COLUMNPROPERTY', 'INDEX_COL',
40
+ 'DATABASEPROPERTY', 'INDEXKEY_PROPERTY', 'DATABASEPROPERTYEX', 'INDEXPROPERTY', 'DB_ID', 'OBJECT_ID', 'DB_NAME', 'OBJECT_NAME',
41
+ 'FILE_ID', 'OBJECTPROPERTY', 'OBJECTPROPERTYEX', 'FILE_NAME', 'SQL_VARIANT_PROPERTY', 'FILEGROUP_ID', 'FILEGROUP_NAME',
42
+ 'FILEGROUPPROPERTY', 'TYPEPROPERTY', 'FILEPROPERTY',
43
+ 'CURRENT_USER', 'SUSER_ID', 'SUSER_SID', 'IS_MEMBER', 'SUSER_SNAME', 'IS_SRVROLEMEMBER', 'PERMISSIONS', 'SYSTEM_USER',
44
+ 'SUSER_NAME', 'USER_ID', 'SESSION_USER', 'USER_NAME', 'ASCII', 'SOUNDEX', 'PATINDEX', 'SPACE', 'CHARINDEX', 'QUOTENAME',
45
+ 'STR', 'DIFFERENCE', 'REPLACE', 'STUFF', 'REPLICATE', 'SUBSTRING', 'LEN', 'REVERSE', 'UNICODE', 'LOWER',
46
+ 'UPPER', 'LTRIM', 'RTRIM', 'APP_NAME', 'CAST', 'CONVERT', 'COALESCE', 'COLLATIONPROPERTY', 'COLUMNS_UPDATED', 'CURRENT_TIMESTAMP',
47
+ 'CURRENT_USER', 'DATALENGTH', '@@ERROR', 'FORMATMESSAGE', 'GETANSINULL', 'HOST_ID', 'HOST_NAME', 'IDENT_CURRENT', 'IDENT_INCR',
48
+ 'IDENT_SEED', '@@IDENTITY', 'ISDATE', 'ISNULL', 'ISNUMERIC', 'NEWID', 'NULLIF', 'PARSENAME', '@@ROWCOUNT',
49
+ 'SCOPE_IDENTITY', 'SERVERPROPERTY', 'SESSIONPROPERTY', 'SESSION_USER', 'STATS_DATE', 'SYSTEM_USER', '@@TRANCOUNT', 'USER_NAME',
50
+ '@@CONNECTIONS', '@@PACK_RECEIVED', '@@CPU_BUSY', '@@PACK_SENT', '@@TIMETICKS', '@@IDLE', '@@TOTAL_ERRORS', '@@IO_BUSY', '@@TOTAL_READ',
51
+ '@@PACKET_ERRORS', '@@TOTAL_WRITE', 'PATINDEX', 'TEXTVALID', 'TEXTPTR'
52
+ ],
53
+ 'reserved': [
54
+ 'RIGHT', 'INNER', 'IS', 'JOIN', 'CROSS', 'LEFT', 'NULL', 'OUTER'
55
+ ]
56
+ }
57
+ ,'OPERATORS' :[
58
+ '+', '-', '*', '/', '%', '=', '&' ,'|', '^', '>', '<', '>=', '<=', '<>', '!=', '!<', '!>', 'ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', '~'
59
+ ]
60
+ ,'DELIMITERS' :[
61
+ '(', ')', '[', ']', '{', '}'
62
+ ]
63
+ ,'REGEXPS' : {
64
+ // highlight all variables (@...)
65
+ 'variables' : {
66
+ 'search' : '()(\\@\\w+)()'
67
+ ,'class' : 'variables'
68
+ ,'modifiers' : 'g'
69
+ ,'execute' : 'before' // before or after
70
+ }
71
+ }
72
+ ,'STYLES' : {
73
+ 'COMMENTS': 'color: #008000;'
74
+ ,'QUOTESMARKS': 'color: #FF0000;'
75
+ ,'KEYWORDS' : {
76
+ 'reserved' : 'color: #808080;'
77
+ ,'functions' : 'color: #FF00FF;'
78
+ ,'statements' : 'color: #0000FF;'
79
+ }
80
+ ,'OPERATORS' : 'color: #808080;'
81
+ ,'DELIMITERS' : 'color: #FF8000;'
82
+ ,'REGEXPS' : {
83
+ 'variables' : 'color: #E0BD54;'
84
+ }
85
+ }
86
+ };
87
+
88
+
js/editarea/reg_syntax/vb.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ editAreaLoader.load_syntax["vb"] = {
2
+ 'DISPLAY_NAME' : 'Visual Basic'
3
+ ,'COMMENT_SINGLE' : {1 : "'"}
4
+ ,'COMMENT_MULTI' : { }
5
+ ,'QUOTEMARKS' : {1: '"'}
6
+ ,'KEYWORD_CASE_SENSITIVE' : false
7
+ ,'KEYWORDS' : {
8
+ 'statements' : [
9
+ 'if','then','for','each','while','do','loop',
10
+ 'else','elseif','select','case','end select',
11
+ 'until','next','step','to','in','end if'
12
+ ]
13
+ ,'keywords' : [
14
+ 'empty','isempty','nothing','null','isnull','true','false',
15
+ 'set','call',
16
+ 'sub','end sub','function','end function','exit','exit function',
17
+ 'dim','Mod','In','private','public','shared','const'
18
+ ]
19
+
20
+ ,'functions' : [
21
+ 'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
22
+ 'Hour','IsDate','Minute','Month',
23
+ 'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
24
+ 'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
25
+ 'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
26
+ 'Rnd','Sgn','Sin','Sqr','Tan',
27
+ 'Array','Filter','IsArray','Join','LBound','Split','UBound',
28
+ 'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
29
+ 'String','StrReverse','UCase',
30
+ 'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
31
+ 'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
32
+ 'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
33
+ ]
34
+ }
35
+ ,'OPERATORS' :[
36
+ '+', '-', '/', '*', '=', '<', '>', '!', '&'
37
+ ]
38
+ ,'DELIMITERS' :[
39
+ '(', ')', '[', ']', '{', '}'
40
+ ]
41
+ ,'STYLES' : {
42
+ 'COMMENTS': 'color: #99CC00;'
43
+ ,'QUOTESMARKS': 'color: #333399;'
44
+ ,'KEYWORDS' : {
45
+ 'keywords' : 'color: #3366FF;'
46
+ ,'functions' : 'color: #0000FF;'
47
+ ,'statements' : 'color: #3366FF;'
48
+ }
49
+ ,'OPERATORS' : 'color: #FF0000;'
50
+ ,'DELIMITERS' : 'color: #0000FF;'
51
+
52
+ }
53
+ };
js/editarea/reg_syntax/xml.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * last update: 2006-08-24
3
+ */
4
+
5
+ editAreaLoader.load_syntax["xml"] = {
6
+ 'DISPLAY_NAME' : 'XML'
7
+ ,'COMMENT_SINGLE' : {}
8
+ ,'COMMENT_MULTI' : {'<!--' : '-->'}
9
+ ,'QUOTEMARKS' : {1: "'", 2: '"'}
10
+ ,'KEYWORD_CASE_SENSITIVE' : false
11
+ ,'KEYWORDS' : {
12
+ }
13
+ ,'OPERATORS' :[
14
+ ]
15
+ ,'DELIMITERS' :[
16
+ ]
17
+ ,'REGEXPS' : {
18
+ 'xml' : {
19
+ 'search' : '()(<\\?[^>]*?\\?>)()'
20
+ ,'class' : 'xml'
21
+ ,'modifiers' : 'g'
22
+ ,'execute' : 'before' // before or after
23
+ }
24
+ ,'cdatas' : {
25
+ 'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
26
+ ,'class' : 'cdata'
27
+ ,'modifiers' : 'g'
28
+ ,'execute' : 'before' // before or after
29
+ }
30
+ ,'tags' : {
31
+ 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
32
+ ,'class' : 'tags'
33
+ ,'modifiers' : 'gi'
34
+ ,'execute' : 'before' // before or after
35
+ }
36
+ ,'attributes' : {
37
+ 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
38
+ ,'class' : 'attributes'
39
+ ,'modifiers' : 'g'
40
+ ,'execute' : 'before' // before or after
41
+ }
42
+ }
43
+ ,'STYLES' : {
44
+ 'COMMENTS': 'color: #AAAAAA;'
45
+ ,'QUOTESMARKS': 'color: #6381F8;'
46
+ ,'KEYWORDS' : {
47
+ }
48
+ ,'OPERATORS' : 'color: #E775F0;'
49
+ ,'DELIMITERS' : ''
50
+ ,'REGEXPS' : {
51
+ 'attributes': 'color: #B1AC41;'
52
+ ,'tags': 'color: #E62253;'
53
+ ,'xml': 'color: #8DCFB5;'
54
+ ,'cdata': 'color: #50B020;'
55
+ }
56
+ }
57
+ };
js/editarea/regexp.js ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
2
+ new_class="quotes";
3
+ if(v6 && v6 != undefined && v6!="")
4
+ new_class="comments";
5
+ return "µ__"+ new_class +"__µ"+v0+"µ_END_µ";
6
+
7
+ };*/
8
+
9
+ /* EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
10
+ res="<span class=htmlTag>"+v2;
11
+ alert("v2: "+v2+" v3: "+v3);
12
+ tab=v3.split("=");
13
+ attributes="";
14
+ if(tab.length>1){
15
+ attributes="<span class=attribute>"+tab[0]+"</span>=";
16
+ for(i=1; i<tab.length-1; i++){
17
+ cut=tab[i].lastIndexOf("&nbsp;");
18
+ attributes+="<span class=attributeVal>"+tab[i].substr(0,cut)+"</span>";
19
+ attributes+="<span class=attribute>"+tab[i].substr(cut)+"</span>=";
20
+ }
21
+ attributes+="<span class=attributeVal>"+tab[tab.length-1]+"</span>";
22
+ }
23
+ res+=attributes+v5+"</span>";
24
+ return res;
25
+ };*/
26
+
27
+ // determine if the selected text if a comment or a quoted text
28
+ EditArea.prototype.comment_or_quote= function(){
29
+ var new_class="", close_tag="", sy, arg, i;
30
+ sy = parent.editAreaLoader.syntax[editArea.current_code_lang];
31
+ arg = EditArea.prototype.comment_or_quote.arguments[0];
32
+
33
+ for( i in sy["quotes"] ){
34
+ if(arg.indexOf(i)==0){
35
+ new_class="quotesmarks";
36
+ close_tag=sy["quotes"][i];
37
+ }
38
+ }
39
+ if(new_class.length==0)
40
+ {
41
+ for(var i in sy["comments"]){
42
+ if( arg.indexOf(i)==0 ){
43
+ new_class="comments";
44
+ close_tag=sy["comments"][i];
45
+ }
46
+ }
47
+ }
48
+ // for single line comment the \n must not be included in the span tags
49
+ if(close_tag=="\n"){
50
+ return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
51
+ }else{
52
+ // the closing tag must be set only if the comment or quotes is closed
53
+ reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
54
+ if( arg.search(reg)!=-1 )
55
+ return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
56
+ else
57
+ return "µ__"+ new_class +"__µ"+ arg;
58
+ }
59
+ };
60
+
61
+ /*
62
+ // apply special tags arround text to highlight
63
+ EditArea.prototype.custom_highlight= function(){
64
+ res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ";
65
+ if(EditArea.prototype.custom_highlight.arguments.length>5)
66
+ res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
67
+ return res;
68
+ };
69
+ */
70
+
71
+ // return identication that allow to know if revalidating only the text line won't make the syntax go mad
72
+ EditArea.prototype.get_syntax_trace= function(text){
73
+ if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
74
+ return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
75
+ };
76
+
77
+
78
+ EditArea.prototype.colorize_text= function(text){
79
+ //text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
80
+ /*
81
+ if(this.isOpera){
82
+ // opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre
83
+ text= this.replace_tab(text);
84
+ }*/
85
+
86
+ text= " "+text; // for easier regExp
87
+
88
+ /*if(this.do_html_tags)
89
+ text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
90
+ if(this.settings["syntax"].length>0)
91
+ text= this.apply_syntax(text, this.settings["syntax"]);
92
+
93
+ // remove the first space added
94
+ return text.substr(1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/µ_END_µ/g,"</span>").replace(/µ__([a-zA-Z0-9]+)__µ/g,"<span class='$1'>");
95
+ };
96
+
97
+ EditArea.prototype.apply_syntax= function(text, lang){
98
+ var sy;
99
+ this.current_code_lang=lang;
100
+
101
+ if(!parent.editAreaLoader.syntax[lang])
102
+ return text;
103
+
104
+ sy = parent.editAreaLoader.syntax[lang];
105
+ if(sy["custom_regexp"]['before']){
106
+ for( var i in sy["custom_regexp"]['before']){
107
+ var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3";
108
+ text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
109
+ }
110
+ }
111
+
112
+ if(sy["comment_or_quote_reg_exp"]){
113
+ //setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
114
+ text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
115
+ }
116
+
117
+ if(sy["keywords_reg_exp"]){
118
+ for(var i in sy["keywords_reg_exp"]){
119
+ text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ');
120
+ }
121
+ }
122
+
123
+ if(sy["delimiters_reg_exp"]){
124
+ text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
125
+ }
126
+
127
+ if(sy["operators_reg_exp"]){
128
+ text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
129
+ }
130
+
131
+ if(sy["custom_regexp"]['after']){
132
+ for( var i in sy["custom_regexp"]['after']){
133
+ var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3";
134
+ text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);
135
+ }
136
+ }
137
+
138
+ return text;
139
+ };
js/editarea/resize_area.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ EditAreaLoader.prototype.start_resize_area= function(){
3
+ var d=document,a,div,width,height,father;
4
+
5
+ d.onmouseup= editAreaLoader.end_resize_area;
6
+ d.onmousemove= editAreaLoader.resize_area;
7
+ editAreaLoader.toggle(editAreaLoader.resize["id"]);
8
+
9
+ a = editAreas[editAreaLoader.resize["id"]]["textarea"];
10
+ div = d.getElementById("edit_area_resize");
11
+ if(!div){
12
+ div= d.createElement("div");
13
+ div.id="edit_area_resize";
14
+ div.style.border="dashed #888888 1px";
15
+ }
16
+ width = a.offsetWidth -2;
17
+ height = a.offsetHeight -2;
18
+
19
+ div.style.display = "block";
20
+ div.style.width = width+"px";
21
+ div.style.height = height+"px";
22
+ father= a.parentNode;
23
+ father.insertBefore(div, a);
24
+
25
+ a.style.display="none";
26
+
27
+ editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
28
+ editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
29
+ };
30
+
31
+ EditAreaLoader.prototype.end_resize_area= function(e){
32
+ var d=document,div,a,width,height;
33
+
34
+ d.onmouseup="";
35
+ d.onmousemove="";
36
+
37
+ div = d.getElementById("edit_area_resize");
38
+ a= editAreas[editAreaLoader.resize["id"]]["textarea"];
39
+ width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
40
+ height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
41
+ if(editAreaLoader.isIE==6){
42
+ width-=2;
43
+ height-=2;
44
+ }
45
+ a.style.width = width+"px";
46
+ a.style.height = height+"px";
47
+ div.style.display = "none";
48
+ a.style.display = "inline";
49
+ a.selectionStart = editAreaLoader.resize["selectionStart"];
50
+ a.selectionEnd = editAreaLoader.resize["selectionEnd"];
51
+ editAreaLoader.toggle(editAreaLoader.resize["id"]);
52
+
53
+ return false;
54
+ };
55
+
56
+ EditAreaLoader.prototype.resize_area= function(e){
57
+ var allow,newHeight,newWidth;
58
+ allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
59
+ if(allow=="both" || allow=="y")
60
+ {
61
+ newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
62
+ document.getElementById("edit_area_resize").style.height= newHeight+"px";
63
+ }
64
+ if(allow=="both" || allow=="x")
65
+ {
66
+ newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
67
+ document.getElementById("edit_area_resize").style.width= newWidth+"px";
68
+ }
69
+
70
+ return false;
71
+ };
72
+
73
+ editAreaLoader.waiting_loading["resize_area.js"]= "loaded";
js/editarea/search_replace.js ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ EditArea.prototype.show_search = function(){
2
+ if(_$("area_search_replace").style.visibility=="visible"){
3
+ this.hidden_search();
4
+ }else{
5
+ this.open_inline_popup("area_search_replace");
6
+ var text= this.area_get_selection();
7
+ var search= text.split("\n")[0];
8
+ _$("area_search").value= search;
9
+ _$("area_search").focus();
10
+ }
11
+ };
12
+
13
+ EditArea.prototype.hidden_search= function(){
14
+ /*_$("area_search_replace").style.visibility="hidden";
15
+ this.textarea.focus();
16
+ var icon= _$("search");
17
+ setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
18
+ this.close_inline_popup("area_search_replace");
19
+ };
20
+
21
+ EditArea.prototype.area_search= function(mode){
22
+
23
+ if(!mode)
24
+ mode="search";
25
+ _$("area_search_msg").innerHTML="";
26
+ var search=_$("area_search").value;
27
+
28
+ this.textarea.focus();
29
+ this.textarea.textareaFocused=true;
30
+
31
+ var infos= this.get_selection_infos();
32
+ var start= infos["selectionStart"];
33
+ var pos=-1;
34
+ var pos_begin=-1;
35
+ var length=search.length;
36
+
37
+ if(_$("area_search_replace").style.visibility!="visible"){
38
+ this.show_search();
39
+ return;
40
+ }
41
+ if(search.length==0){
42
+ _$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
43
+ return;
44
+ }
45
+ // advance to the next occurence if no text selected
46
+ if(mode!="replace" ){
47
+ if(_$("area_search_reg_exp").checked)
48
+ start++;
49
+ else
50
+ start+= search.length;
51
+ }
52
+
53
+ //search
54
+ if(_$("area_search_reg_exp").checked){
55
+ // regexp search
56
+ var opt="m";
57
+ if(!_$("area_search_match_case").checked)
58
+ opt+="i";
59
+ var reg= new RegExp(search, opt);
60
+ pos= infos["full_text"].substr(start).search(reg);
61
+ pos_begin= infos["full_text"].search(reg);
62
+ if(pos!=-1){
63
+ pos+=start;
64
+ length=infos["full_text"].substr(start).match(reg)[0].length;
65
+ }else if(pos_begin!=-1){
66
+ length=infos["full_text"].match(reg)[0].length;
67
+ }
68
+ }else{
69
+ if(_$("area_search_match_case").checked){
70
+ pos= infos["full_text"].indexOf(search, start);
71
+ pos_begin= infos["full_text"].indexOf(search);
72
+ }else{
73
+ pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start);
74
+ pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase());
75
+ }
76
+ }
77
+
78
+ // interpret result
79
+ if(pos==-1 && pos_begin==-1){
80
+ _$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
81
+ return;
82
+ }else if(pos==-1 && pos_begin != -1){
83
+ begin= pos_begin;
84
+ _$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
85
+ }else
86
+ begin= pos;
87
+
88
+ //_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
89
+ if(mode=="replace" && pos==infos["indexOfCursor"]){
90
+ var replace= _$("area_replace").value;
91
+ var new_text="";
92
+ if(_$("area_search_reg_exp").checked){
93
+ var opt="m";
94
+ if(!_$("area_search_match_case").checked)
95
+ opt+="i";
96
+ var reg= new RegExp(search, opt);
97
+ new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
98
+ }else{
99
+ new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
100
+ }
101
+ this.textarea.value=new_text;
102
+ this.area_select(begin, length);
103
+ this.area_search();
104
+ }else
105
+ this.area_select(begin, length);
106
+ };
107
+
108
+
109
+
110
+
111
+ EditArea.prototype.area_replace= function(){
112
+ this.area_search("replace");
113
+ };
114
+
115
+ EditArea.prototype.area_replace_all= function(){
116
+ /* this.area_select(0, 0);
117
+ _$("area_search_msg").innerHTML="";
118
+ while(_$("area_search_msg").innerHTML==""){
119
+ this.area_replace();
120
+ }*/
121
+
122
+ var base_text= this.textarea.value;
123
+ var search= _$("area_search").value;
124
+ var replace= _$("area_replace").value;
125
+ if(search.length==0){
126
+ _$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
127
+ return ;
128
+ }
129
+
130
+ var new_text="";
131
+ var nb_change=0;
132
+ if(_$("area_search_reg_exp").checked){
133
+ // regExp
134
+ var opt="mg";
135
+ if(!_$("area_search_match_case").checked)
136
+ opt+="i";
137
+ var reg= new RegExp(search, opt);
138
+ nb_change= infos["full_text"].match(reg).length;
139
+ new_text= infos["full_text"].replace(reg, replace);
140
+
141
+ }else{
142
+
143
+ if(_$("area_search_match_case").checked){
144
+ var tmp_tab=base_text.split(search);
145
+ nb_change= tmp_tab.length -1 ;
146
+ new_text= tmp_tab.join(replace);
147
+ }else{
148
+ // case insensitive
149
+ var lower_value=base_text.toLowerCase();
150
+ var lower_search=search.toLowerCase();
151
+
152
+ var start=0;
153
+ var pos= lower_value.indexOf(lower_search);
154
+ while(pos!=-1){
155
+ nb_change++;
156
+ new_text+= this.textarea.value.substring(start , pos)+replace;
157
+ start=pos+ search.length;
158
+ pos= lower_value.indexOf(lower_search, pos+1);
159
+ }
160
+ new_text+= this.textarea.value.substring(start);
161
+ }
162
+ }
163
+ if(new_text==base_text){
164
+ _$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
165
+ }else{
166
+ this.textarea.value= new_text;
167
+ _$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
168
+ // firefox and opera doesn't manage with the focus if it's done directly
169
+ //editArea.textarea.focus();editArea.textarea.textareaFocused=true;
170
+ setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
171
+ }
172
+
173
+
174
+ };
js/editarea/template.html ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
4
+ <head>
5
+ <title>EditArea</title>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
8
+ [__CSSRULES__]
9
+ [__JSCODE__]
10
+ </head>
11
+ <body>
12
+ <div id='editor'>
13
+ <div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div>
14
+ <div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div>
15
+ <div id='result'>
16
+ <div id='no_file_selected'></div>
17
+ <div id='container'>
18
+ <div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div>
19
+ <div id='end_bracket' class='edit_area_cursor'>&nbsp;</div>
20
+ <div id='selection_field'></div>
21
+ <div id='line_number' selec='none'></div>
22
+ <div id='content_highlight'></div>
23
+ <div id='test_font_size'></div>
24
+ <div id='selection_field_text'></div>
25
+ <textarea id='textarea' wrap='off' onchange='editArea.execCommand("onchange");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'>
26
+ </textarea>
27
+
28
+ </div>
29
+ </div>
30
+ <div class='area_toolbar' id='toolbar_2'>
31
+ <table class='statusbar' cellspacing='0' cellpadding='0'>
32
+ <tr>
33
+ <td class='total' selec='none'>{$position}:</td>
34
+ <td class='infos' selec='none'>
35
+ {$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span>
36
+ </td>
37
+ <td class='total' selec='none'>{$total}:</td>
38
+ <td class='infos' selec='none'>
39
+ {$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span>
40
+ </td>
41
+ <td class='resize'>
42
+ <span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span>
43
+ </td>
44
+ </tr>
45
+ </table>
46
+ </div>
47
+ </div>
48
+ <div id='processing'>
49
+ <div id='processing_text'>
50
+ {$processing}
51
+ </div>
52
+ </div>
53
+
54
+ <div id='area_search_replace' class='editarea_popup'>
55
+ <table cellspacing='2' cellpadding='0' style='width: 100%'>
56
+ <tr>
57
+ <td selec='none'>{$search}</td>
58
+ <td><input type='text' id='area_search' /></td>
59
+ <td id='close_area_search_replace'>
60
+ <a onclick='Javascript:editArea.execCommand("hidden_search")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br />
61
+ </tr><tr>
62
+ <td selec='none'>{$replace}</td>
63
+ <td><input type='text' id='area_replace' /></td>
64
+ <td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["frame_"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td>
65
+ </tr>
66
+ </table>
67
+ <div class='button'>
68
+ <input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label>
69
+ <input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label>
70
+ <br />
71
+ <a onclick='Javascript:editArea.execCommand("area_search")' selec='none'>{$find_next}</a>
72
+ <a onclick='Javascript:editArea.execCommand("area_replace")' selec='none'>{$replace}</a>
73
+ <a onclick='Javascript:editArea.execCommand("area_replace_all")' selec='none'>{$replace_all}</a><br />
74
+ </div>
75
+ <div id='area_search_msg' selec='none'></div>
76
+ </div>
77
+ <div id='edit_area_help' class='editarea_popup'>
78
+ <div class='close_popup'>
79
+ <a onclick='Javascript:editArea.execCommand("close_all_inline_popup")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a>
80
+ </div>
81
+ <div><h2>Editarea [__EA_VERSION__]</h2><br />
82
+ <h3>{$shortcuts}:</h3>
83
+ {$tab}: {$add_tab}<br />
84
+ {$shift}+{$tab}: {$remove_tab}<br />
85
+ {$ctrl}+f: {$search_command}<br />
86
+ {$ctrl}+r: {$replace_command}<br />
87
+ {$ctrl}+h: {$highlight}<br />
88
+ {$ctrl}+g: {$go_to_line}<br />
89
+ {$ctrl}+z: {$undo}<br />
90
+ {$ctrl}+y: {$redo}<br />
91
+ {$ctrl}+e: {$help}<br />
92
+ {$ctrl}+q, {$esc}: {$close_popup}<br />
93
+ {$accesskey} E: {$toggle}<br />
94
+ <br />
95
+ <em>{$about_notice}</em>
96
+ <br /><div class='copyright'>&copy; Christophe Dolivet 2007-2010</div>
97
+ </div>
98
+ </div>
99
+ </body>
100
+ </html>
js/filesystem/base64.js ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * aheadWorks Co.
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the EULA
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://ecommerce.aheadworks.com/LICENSE-M1.txt
10
+ *
11
+ * @category AW
12
+ * @package AW_Ajaxcatalog
13
+ * @copyright Copyright (c) 2011 aheadWorks Co. (http://www.aheadworks.com)
14
+ * @license http://ecommerce.aheadworks.com/LICENSE-M1.txt
15
+ */
16
+
17
+
18
+
19
+ var Base64 = {
20
+
21
+ // private property
22
+ _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
23
+
24
+ // public method for encoding
25
+ encode : function (input) {
26
+ var output = "";
27
+ var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
28
+ var i = 0;
29
+
30
+ input = Base64._utf8_encode(input);
31
+
32
+ while (i < input.length) {
33
+
34
+ chr1 = input.charCodeAt(i++);
35
+ chr2 = input.charCodeAt(i++);
36
+ chr3 = input.charCodeAt(i++);
37
+
38
+ enc1 = chr1 >> 2;
39
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
40
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
41
+ enc4 = chr3 & 63;
42
+
43
+ if (isNaN(chr2)) {
44
+ enc3 = enc4 = 64;
45
+ } else if (isNaN(chr3)) {
46
+ enc4 = 64;
47
+ }
48
+
49
+ output = output +
50
+ this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
51
+ this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
52
+
53
+ }
54
+
55
+ return output;
56
+ },
57
+
58
+ // public method for decoding
59
+ decode : function (input) {
60
+ var output = "";
61
+ var chr1, chr2, chr3;
62
+ var enc1, enc2, enc3, enc4;
63
+ var i = 0;
64
+
65
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
66
+
67
+ while (i < input.length) {
68
+
69
+ enc1 = this._keyStr.indexOf(input.charAt(i++));
70
+ enc2 = this._keyStr.indexOf(input.charAt(i++));
71
+ enc3 = this._keyStr.indexOf(input.charAt(i++));
72
+ enc4 = this._keyStr.indexOf(input.charAt(i++));
73
+
74
+ chr1 = (enc1 << 2) | (enc2 >> 4);
75
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
76
+ chr3 = ((enc3 & 3) << 6) | enc4;
77
+
78
+ output = output + String.fromCharCode(chr1);
79
+
80
+ if (enc3 != 64) {
81
+ output = output + String.fromCharCode(chr2);
82
+ }
83
+ if (enc4 != 64) {
84
+ output = output + String.fromCharCode(chr3);
85
+ }
86
+
87
+ }
88
+
89
+ output = Base64._utf8_decode(output);
90
+
91
+ return output;
92
+
93
+ },
94
+
95
+ // private method for UTF-8 encoding
96
+ _utf8_encode : function (string) {
97
+ string = string.replace(/\r\n/g,"\n");
98
+ var utftext = "";
99
+
100
+ for (var n = 0; n < string.length; n++) {
101
+
102
+ var c = string.charCodeAt(n);
103
+
104
+ if (c < 128) {
105
+ utftext += String.fromCharCode(c);
106
+ }
107
+ else if((c > 127) && (c < 2048)) {
108
+ utftext += String.fromCharCode((c >> 6) | 192);
109
+ utftext += String.fromCharCode((c & 63) | 128);
110
+ }
111
+ else {
112
+ utftext += String.fromCharCode((c >> 12) | 224);
113
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
114
+ utftext += String.fromCharCode((c & 63) | 128);
115
+ }
116
+
117
+ }
118
+
119
+ return utftext;
120
+ },
121
+
122
+ // private method for UTF-8 decoding
123
+ _utf8_decode : function (utftext) {
124
+ var string = "";
125
+ var i = 0;
126
+ var c = c1 = c2 = 0;
127
+
128
+ while ( i < utftext.length ) {
129
+
130
+ c = utftext.charCodeAt(i);
131
+
132
+ if (c < 128) {
133
+ string += String.fromCharCode(c);
134
+ i++;
135
+ }
136
+ else if((c > 191) && (c < 224)) {
137
+ c2 = utftext.charCodeAt(i+1);
138
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
139
+ i += 2;
140
+ }
141
+ else {
142
+ c2 = utftext.charCodeAt(i+1);
143
+ c3 = utftext.charCodeAt(i+2);
144
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
145
+ i += 3;
146
+ }
147
+
148
+ }
149
+
150
+ return string;
151
+ }
152
+
153
+ }
js/filesystem/jquery-1.4.2.min.js ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.4.2
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright 2010, John Resig
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * Includes Sizzle.js
10
+ * http://sizzlejs.com/
11
+ * Copyright 2010, The Dojo Foundation
12
+ * Released under the MIT, BSD, and GPL Licenses.
13
+ *
14
+ * Date: Sat Feb 13 22:33:48 2010 -0500
15
+ */
16
+ (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
17
+ e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
18
+ j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
19
+ "&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
20
+ true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
21
+ Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
22
+ (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
23
+ a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
24
+ "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
25
+ function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
26
+ c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
27
+ L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
28
+ "isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
29
+ a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
30
+ d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
31
+ a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
32
+ !c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
33
+ true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
34
+ var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
35
+ parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
36
+ false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
37
+ s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
38
+ applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
39
+ else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
40
+ a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
41
+ w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
42
+ cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
43
+ i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
44
+ " ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
45
+ this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
46
+ e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
47
+ c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
48
+ a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
49
+ function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
50
+ k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
51
+ C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
52
+ null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
53
+ e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
54
+ f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
55
+ if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
56
+ fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
57
+ d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
58
+ "events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
59
+ a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
60
+ isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
61
+ {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
62
+ if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
63
+ e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
64
+ "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
65
+ d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
66
+ !a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
67
+ toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
68
+ u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
69
+ function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
70
+ if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
71
+ e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
72
+ t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
73
+ g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
74
+ for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
75
+ 1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
76
+ CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
77
+ relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
78
+ l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
79
+ h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
80
+ CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
81
+ g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
82
+ text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
83
+ setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
84
+ h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
85
+ m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
86
+ "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
87
+ h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
88
+ !h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
89
+ h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
90
+ q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
91
+ if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
92
+ (function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
93
+ function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
94
+ gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
95
+ c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
96
+ {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
97
+ "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
98
+ d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
99
+ a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
100
+ 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
101
+ a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
102
+ c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
103
+ wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
104
+ prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
105
+ this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
106
+ return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
107
+ ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
108
+ this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
109
+ u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
110
+ 1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
111
+ return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
112
+ ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
113
+ c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
114
+ c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
115
+ function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
116
+ Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
117
+ "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
118
+ a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
119
+ a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
120
+ "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
121
+ serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
122
+ function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
123
+ global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
124
+ e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
125
+ "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
126
+ false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
127
+ false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
128
+ c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
129
+ d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
130
+ g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
131
+ 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
132
+ "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
133
+ if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
134
+ this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
135
+ "olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
136
+ animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
137
+ j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
138
+ this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
139
+ "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
140
+ c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
141
+ this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
142
+ this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
143
+ e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
144
+ c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
145
+ function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
146
+ this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
147
+ k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
148
+ f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
149
+ a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
150
+ c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
151
+ d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
152
+ f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
153
+ "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
154
+ e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
155
+
156
+
157
+ $jj = jQuery.noConflict();
js/filesystem/jqueryfiletree.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // jQuery File Tree Plugin
2
+ //
3
+ // Version 1.01
4
+ //
5
+ // Cory S.N. LaViska
6
+ // A Beautiful Site (http://abeautifulsite.net/)
7
+ // 24 March 2008
8
+ //
9
+ // Visit http://abeautifulsite.net/notebook.php?article=58 for more information
10
+ //
11
+ // Usage: $('.fileTreeDemo').fileTree( options, callback )
12
+ //
13
+ // Options: root - root folder to display; default = /
14
+ // script - location of the serverside AJAX file to use; default = jqueryFileTree.php
15
+ // folderEvent - event to trigger expand/collapse; default = click
16
+ // expandSpeed - default = 500 (ms); use -1 for no animation
17
+ // collapseSpeed - default = 500 (ms); use -1 for no animation
18
+ // expandEasing - easing function to use on expand (optional)
19
+ // collapseEasing - easing function to use on collapse (optional)
20
+ // multiFolder - whether or not to limit the browser to one subfolder at a time
21
+ // loadMessage - Message to display while initial tree loads (can be HTML)
22
+ //
23
+ // History:
24
+ //
25
+ // 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
26
+ // 1.00 - released (24 March 2008)
27
+ //
28
+ // TERMS OF USE
29
+ //
30
+ // This plugin is dual-licensed under the GNU General Public License and the MIT License and
31
+ // is copyright 2008 A Beautiful Site, LLC.
32
+ //
33
+ if(jQuery) (function($){
34
+
35
+ $.extend($.fn, {
36
+ fileTree: function(o, h) {
37
+ // Defaults
38
+ if( !o ) var o = {};
39
+ if( o.root == undefined ) o.root = '/';
40
+ if( o.script == undefined ) o.script = 'jqueryFileTree.php';
41
+ if( o.folderEvent == undefined ) o.folderEvent = 'click';
42
+ if( o.expandSpeed == undefined ) o.expandSpeed= 500;
43
+ if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
44
+ if( o.expandEasing == undefined ) o.expandEasing = null;
45
+ if( o.collapseEasing == undefined ) o.collapseEasing = null;
46
+ if( o.multiFolder == undefined ) o.multiFolder = true;
47
+ if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
48
+
49
+ $(this).each( function() {
50
+
51
+ function showTree(c, t) {
52
+ $(c).addClass('wait');
53
+ $(".jqueryFileTree.start").remove();
54
+ $.post(o.script, { dir: t }, function(data) {
55
+ $(c).find('.start').html('');
56
+ $(c).removeClass('wait').append(data);
57
+ if( o.root == t ) $(c).find('UL:hidden').show(); else $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
58
+ bindTree(c);
59
+ });
60
+ }
61
+
62
+ function bindTree(t) {
63
+ $(t).find('LI A').bind(o.folderEvent, function() {
64
+ if( $(this).parent().hasClass('directory') ) {
65
+ if( $(this).parent().hasClass('collapsed') ) {
66
+ // Expand
67
+ if( !o.multiFolder ) {
68
+ $(this).parent().parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
69
+ $(this).parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed');
70
+ }
71
+ $(this).parent().find('UL').remove(); // cleanup
72
+ showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
73
+ $(this).parent().removeClass('collapsed').addClass('expanded');
74
+ } else {
75
+ // Collapse
76
+ $(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
77
+ $(this).parent().removeClass('expanded').addClass('collapsed');
78
+ }
79
+ } else {
80
+ h($(this).attr('rel'));
81
+ }
82
+ return false;
83
+ });
84
+ // Prevent A from triggering the # on non-click events
85
+ if( o.folderEvent.toLowerCase != 'click' ) $(t).find('LI A').bind('click', function() { return false; });
86
+ }
87
+ // Loading message
88
+ $(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
89
+ // Get the initial file list
90
+ showTree( $(this), escape(o.root) );
91
+ });
92
+ }
93
+ });
94
+
95
+ })(jQuery);
js/filesystem/script.coffee ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ###
2
+ MagPleasure Co.
3
+
4
+ NOTICE OF LICENSE
5
+
6
+ This source file is subject to the EULA
7
+ that is bundled with this package in the file LICENSE.txt.
8
+ It is also available through the world-wide-web at this URL:
9
+ http://www.magpleasure.com/LICENSE.txt
10
+
11
+ @category Magpleasure
12
+ @package Magpleasure_Filesystem
13
+ @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
14
+ @license http://www.magpleasure.com/LICENSE.txt
15
+ ###
16
+
17
+ _currentId = null
18
+
19
+ _closeUrl = _saveUrl = _filesUrl = null
20
+
21
+ saveFile = (id, content) ->
22
+ if _currentId then _saveFile(_currentId, content)
23
+ return
24
+
25
+ _saveFile = (id, content) ->
26
+ new Ajax.Request _saveUrl.replace("{{file}}", id).replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
27
+ method: "post"
28
+ onSuccess: (transport) =>
29
+ try
30
+ response = eval('(' + transport.responseText + ')')
31
+ catch exception
32
+ response = {}
33
+
34
+ {success, files, error} = response
35
+ if error
36
+ alert error
37
+
38
+ if success
39
+ file = editAreaLoader.getFile "edit_area", id
40
+ file.edited = no
41
+ iframe = document.getElementById('frame_edit_area')
42
+ innerDoc = if iframe.contentDocument then iframe.contentDocument else iframe.contentWindow.document
43
+ a = innerDoc.getElementById(file.html_id).getElementsByTagName('a')[0]
44
+ a.className = ''
45
+ return
46
+ parameters: {content: content}
47
+ }
48
+
49
+ return
50
+
51
+ openFile = (url, file) ->
52
+
53
+ filename = Base64.encode file
54
+
55
+ new Ajax.Request url.replace("{{filename}}", filename).replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
56
+ method: "get"
57
+ onSuccess: (transport) ->
58
+ try
59
+ response = eval('(' + transport.responseText + ')')
60
+ catch exception
61
+ response = {}
62
+
63
+ {success, content, error, path} = response
64
+ if error
65
+ alert error
66
+ if success
67
+ new_file = eval('(' + content + ')')
68
+ {id} = new_file
69
+ _currentId = id
70
+ editAreaLoader.openFile "edit_area", new_file
71
+
72
+ file = editAreaLoader.getFile "edit_area", id
73
+ iframe = document.getElementById('frame_edit_area')
74
+ innerDoc = if iframe.contentDocument then iframe.contentDocument else iframe.contentWindow.document
75
+ a = innerDoc.getElementById(file.html_id).getElementsByTagName('a')[0]
76
+ a.title = path
77
+
78
+ return
79
+ onComplete: (transport) =>
80
+
81
+
82
+ return
83
+ }
84
+
85
+
86
+
87
+ return
88
+
89
+
90
+ closeFile = (info) ->
91
+ if info.edited is yes
92
+ answer = confirm "File was changed. Do you want to save it?"
93
+ if answer is yes
94
+ _saveFile info.id, info.text
95
+
96
+
97
+ {id} = info
98
+ _currentId = null
99
+ new Ajax.Request _closeUrl.replace("{{file}}", id).replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
100
+ method: "get"
101
+ onSuccess: (transport) ->
102
+ try
103
+ response = eval('(' + transport.responseText + ')')
104
+ catch exception
105
+ response = {}
106
+
107
+ {success, error} = response
108
+ if error
109
+ alert error
110
+ return
111
+ }
112
+
113
+ return
114
+
115
+ switchOn = (info) ->
116
+ {id} = info
117
+ if id then _currentId = id
118
+ return
119
+
120
+
121
+ getFiles = () ->
122
+ new Ajax.Request _filesUrl.replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
123
+ method: "get"
124
+ onSuccess: (transport) ->
125
+ try
126
+ response = eval('(' + transport.responseText + ')')
127
+ catch exception
128
+ response = {}
129
+
130
+ {success, files, error} = response
131
+ if error
132
+ alert error
133
+
134
+ if success
135
+ for info in files
136
+ new_file = eval('(' + info + ')')
137
+ {id, path} = new_file
138
+ _currentId = id
139
+ editAreaLoader.openFile "edit_area", new_file
140
+ file = editAreaLoader.getFile "edit_area", id
141
+ iframe = document.getElementById('frame_edit_area')
142
+ innerDoc = if iframe.contentDocument then iframe.contentDocument else iframe.contentWindow.document
143
+ a = innerDoc.getElementById(file.html_id).getElementsByTagName('a')[0]
144
+ a.title = path
145
+
146
+ return
147
+ }
148
+
149
+ return
js/filesystem/script.js ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ MagPleasure Co.
3
+
4
+ NOTICE OF LICENSE
5
+
6
+ This source file is subject to the EULA
7
+ that is bundled with this package in the file LICENSE.txt.
8
+ It is also available through the world-wide-web at this URL:
9
+ http://www.magpleasure.com/LICENSE.txt
10
+
11
+ @category Magpleasure
12
+ @package Magpleasure_Filesystem
13
+ @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
14
+ @license http://www.magpleasure.com/LICENSE.txt
15
+ */var closeFile, getFiles, openFile, saveFile, switchOn, _closeUrl, _currentId, _filesUrl, _saveFile, _saveUrl;
16
+ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
17
+ _currentId = null;
18
+ _closeUrl = _saveUrl = _filesUrl = null;
19
+ saveFile = function(id, content) {
20
+ if (_currentId) {
21
+ _saveFile(_currentId, content);
22
+ }
23
+ };
24
+ _saveFile = function(id, content) {
25
+ new Ajax.Request(_saveUrl.replace("{{file}}", id).replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
26
+ method: "post",
27
+ onSuccess: __bind(function(transport) {
28
+ var a, error, file, files, iframe, innerDoc, response, success;
29
+ try {
30
+ response = eval('(' + transport.responseText + ')');
31
+ } catch (exception) {
32
+ response = {};
33
+ }
34
+ success = response.success, files = response.files, error = response.error;
35
+ if (error) {
36
+ alert(error);
37
+ }
38
+ if (success) {
39
+ file = editAreaLoader.getFile("edit_area", id);
40
+ file.edited = false;
41
+ iframe = document.getElementById('frame_edit_area');
42
+ innerDoc = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow.document;
43
+ a = innerDoc.getElementById(file.html_id).getElementsByTagName('a')[0];
44
+ a.className = '';
45
+ }
46
+ }, this),
47
+ parameters: {
48
+ content: content
49
+ }
50
+ });
51
+ };
52
+ openFile = function(url, file) {
53
+ var filename;
54
+ filename = Base64.encode(file);
55
+ new Ajax.Request(url.replace("{{filename}}", filename).replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
56
+ method: "get",
57
+ onSuccess: function(transport) {
58
+ var a, content, error, id, iframe, innerDoc, new_file, path, response, success;
59
+ try {
60
+ response = eval('(' + transport.responseText + ')');
61
+ } catch (exception) {
62
+ response = {};
63
+ }
64
+ success = response.success, content = response.content, error = response.error, path = response.path;
65
+ if (error) {
66
+ alert(error);
67
+ }
68
+ if (success) {
69
+ new_file = eval('(' + content + ')');
70
+ id = new_file.id;
71
+ _currentId = id;
72
+ editAreaLoader.openFile("edit_area", new_file);
73
+ file = editAreaLoader.getFile("edit_area", id);
74
+ iframe = document.getElementById('frame_edit_area');
75
+ innerDoc = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow.document;
76
+ a = innerDoc.getElementById(file.html_id).getElementsByTagName('a')[0];
77
+ a.title = path;
78
+ }
79
+ },
80
+ onComplete: __bind(function(transport) {}, this)
81
+ });
82
+ };
83
+ closeFile = function(info) {
84
+ var answer, id;
85
+ if (info.edited === true) {
86
+ answer = confirm("File was changed. Do you want to save it?");
87
+ if (answer === true) {
88
+ _saveFile(info.id, info.text);
89
+ }
90
+ }
91
+ id = info.id;
92
+ _currentId = null;
93
+ new Ajax.Request(_closeUrl.replace("{{file}}", id).replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
94
+ method: "get",
95
+ onSuccess: function(transport) {
96
+ var error, response, success;
97
+ try {
98
+ response = eval('(' + transport.responseText + ')');
99
+ } catch (exception) {
100
+ response = {};
101
+ }
102
+ success = response.success, error = response.error;
103
+ if (error) {
104
+ alert(error);
105
+ }
106
+ }
107
+ });
108
+ };
109
+ switchOn = function(info) {
110
+ var id;
111
+ id = info.id;
112
+ if (id) {
113
+ _currentId = id;
114
+ }
115
+ };
116
+ getFiles = function() {
117
+ new Ajax.Request(_filesUrl.replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, '')), {
118
+ method: "get",
119
+ onSuccess: function(transport) {
120
+ var a, error, file, files, id, iframe, info, innerDoc, new_file, path, response, success, _i, _len;
121
+ try {
122
+ response = eval('(' + transport.responseText + ')');
123
+ } catch (exception) {
124
+ response = {};
125
+ }
126
+ success = response.success, files = response.files, error = response.error;
127
+ if (error) {
128
+ alert(error);
129
+ }
130
+ if (success) {
131
+ for (_i = 0, _len = files.length; _i < _len; _i++) {
132
+ info = files[_i];
133
+ new_file = eval('(' + info + ')');
134
+ id = new_file.id, path = new_file.path;
135
+ _currentId = id;
136
+ editAreaLoader.openFile("edit_area", new_file);
137
+ file = editAreaLoader.getFile("edit_area", id);
138
+ iframe = document.getElementById('frame_edit_area');
139
+ innerDoc = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow.document;
140
+ a = innerDoc.getElementById(file.html_id).getElementsByTagName('a')[0];
141
+ a.title = path;
142
+ }
143
+ }
144
+ }
145
+ });
146
+ };
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Magpleasure_Filesystem</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">GPLv3</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Magpleasure File System is a professional tool that is aimed at Magento files' editing straight from the administrative panel. It can be convenient to use it, when slight changes should be made to the system files. Then ftp or ssh connections are too expensive and difficult to use. Using File System you can easily do all the necessary operations.</summary>
10
+ <description>Magpleasure File System is a professional tool that is aimed at Magento files' editing straight from the administrative panel. It can be convenient to use it, when slight changes should be made to the system files. Then ftp or ssh connections are too expensive and difficult to use. Using File System you can easily do all the necessary operations.&#xD;
11
+ &#xD;
12
+ To use this tool you just have to install it to the system. In administrative part there will be a new menu point Filesystem-&gt;IDE. Entering that, you will see a tree of files of your shop and space for editing. Choose the file in the tree and click on it. It will open in the space for editing and after you make all necessary changes in the file - click "Save" that is situated above the space for editing. File will be saved.</description>
13
+ <notes>Ready to stable use</notes>
14
+ <authors><author><name>MagPleasure Co.</name><user>auto-converted</user><email>general@magpleasure.com</email></author></authors>
15
+ <date>2011-08-11</date>
16
+ <time>14:25:33</time>
17
+ <contents><target name="magecommunity"><dir name="Magpleasure"><dir name="Filesystem"><dir name="Block"><dir name="Adminhtml"><dir name="Ide"><file name="Editor.php" hash="8b70f3b67ffd4dff4d754d724e912963"/><file name="Tree.php" hash="7493dec0cd4314d1deabe71561734853"/></dir><file name="Ide.php" hash="d0e1e037585237ea7978db7e97500158"/></dir></dir><dir name="Helper"><file name="Data.php" hash="ffc2722c341b483babc1625158d58e8a"/></dir><dir name="Model"><file name="Tree.php" hash="b8ec9f53abac557af7d054dab129ae0a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FilesystemController.php" hash="2843314f3426ac7676f0c67e32a2e109"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ca6f31fbac9c8e75dfc4326ceb8ad27a"/><file name="config.xml" hash="80d4788f6affdb5b172c01eed7653c82"/><file name="system.xml" hash="93ca24c3fd3c8091ef42ecbba17b9998"/></dir><dir name="sql"><dir name="filesystem_setup"><file name="mysql4-install-1.0.php" hash="459152f438956f06a1b041a0accf2c48"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magpleasure_Filesystem.xml" hash="98543bd69b1e168feb387e0cae0193cc"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="filesystem.xml" hash="1db211995473c38d540bb9fdb83c7345"/></dir><dir name="template"><dir name="filesystem"><dir name="ide"><file name="editor.phtml" hash="69e9fb1a3c47d7f4d47bca88672767e9"/><file name="tree.phtml" hash="bb473af2171f0b2d8834996b0dfed728"/></dir><file name="ide.phtml" hash="de40e983b28cc354be7ec9df3ff693cf"/><file name="wrapper.phtml" hash="efde22d760dcb963e9d9a8e66ed48bb1"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="editarea"><dir name="images"><file name="autocompletion.gif" hash="a49a7f9395b32bcf6aa8e143e17c03ff"/><file name="close.gif" hash="6cc9d27bdda91ad192a4326a653ba566"/><file name="fullscreen.gif" hash="88d0dd1d465c2989dc04cb8f4473f6b9"/><file name="go_to_line.gif" hash="05aa7fa3c6c720595bb3ead7366bbe07"/><file name="help.gif" hash="4cd4a5d2cdcd74c8aeced17813afd6ea"/><file name="highlight.gif" hash="96382d6d24bb8a1b228586b323e72fb4"/><file name="load.gif" hash="203725593d5c7412fc51aa603434f96f"/><file name="move.gif" hash="0da84ad6a24533d4335cef8255101edc"/><file name="newdocument.gif" hash="24b01aa27845c551f24a186a92cbc94e"/><file name="opacity.png" hash="7f1c7b1ff1f3e04828540f6ffdde46c2"/><file name="processing.gif" hash="40418383947fe6335056fce05abe44a2"/><file name="redo.gif" hash="c2b3b80e20aa7f50ec45acb999373425"/><file name="reset_highlight.gif" hash="e9c387cc80f33b14447b628df1906639"/><file name="save.gif" hash="2392d13d22fec22e69add07becf83e20"/><file name="search.gif" hash="791e640ca1b345a84084eb611004de98"/><file name="smooth_selection.gif" hash="e6a384f19aef7c0fb2f2e0ee0bdc72e0"/><file name="spacer.gif" hash="12bf9e19374920de3146a64775f46a5e"/><file name="statusbar_resize.gif" hash="1b952cd23844b834e0a307db3c803626"/><file name="undo.gif" hash="7883b9e1f9bf0b860e77b904e1941591"/><file name="word_wrap.gif" hash="47bd30f6fe667d34f37230b01544595a"/></dir><dir name="langs"><file name="bg.js" hash="d7613d13ccef5b0d7bfec0d61301e8c7"/><file name="cs.js" hash="054fcae90443c23509c4a7ffe9be8958"/><file name="de.js" hash="654352394ecbb6415ea6c2556545172a"/><file name="dk.js" hash="f9436cf9e8ba589793d85778f6d05b6f"/><file name="en.js" hash="7f1abf7cbaaace2137ecab2656884179"/><file name="eo.js" hash="df04844abb0ad6bbfd3728d8400631bf"/><file name="es.js" hash="c51c4378eec18a18367db665c5da1381"/><file name="fi.js" hash="5a1e1631b0c99a280967e804cfd43a4b"/><file name="fr.js" hash="995ddf53def8281d7391bdb14b9081ac"/><file name="hr.js" hash="c5b57293d0f05f2eee99c70dc574e936"/><file name="it.js" hash="b161e85ab71735466852aa23d8aee93a"/><file name="ja.js" hash="5c1595a62797dbcb5b630f7e3df9eb30"/><file name="mk.js" hash="709e6e248ea163f1873c362b65129d8f"/><file name="nl.js" hash="63a7456e816d5d2dee7dddd9ca85f3b4"/><file name="pl.js" hash="f9db99b4db54ebd1c010e1e110c313f0"/><file name="pt.js" hash="89aff336ff4e1fd47758fa5d04d3596a"/><file name="ru.js" hash="845dbac0b57ca995e0f38d354f6b7491"/><file name="sk.js" hash="8a9d8a478b3b107d81c395790b7757fe"/><file name="zh.js" hash="af7516a107d8df7d6e3846bba0b512c3"/></dir><dir name="plugins"><dir name="charmap"><dir name="css"><file name="charmap.css" hash="84eed9f0eaf34e71f528444d0fbd729c"/></dir><dir name="images"><file name="charmap.gif" hash="948c608cfe393168642e3946097eba3d"/></dir><dir name="jscripts"><file name="map.js" hash="071107a09c753f3d2e88d0b99aa61820"/></dir><dir name="langs"><file name="bg.js" hash="a4c60ccea1575a77c43c964ab1d78a62"/><file name="cs.js" hash="d578b06a1b41e5da773ddb688d98bdd9"/><file name="de.js" hash="b93418619c8678c6505c023b1072b80b"/><file name="dk.js" hash="e6395e180e9b9bd87a7e96cf745b101e"/><file name="en.js" hash="17a20a2e46b7de8d7fa5370a9bf6b294"/><file name="eo.js" hash="0cc471de01b7ad207df32c450682cd3d"/><file name="es.js" hash="ea43e35253952cc33c85d3fe7c9bb27b"/><file name="fr.js" hash="96c4acb5f590d7b403d3b0e319dfb349"/><file name="hr.js" hash="578178183db00474dfa660f616db86ae"/><file name="it.js" hash="433ac140154e12f5423b226c6ed8e148"/><file name="ja.js" hash="fc17e42e8ce2ac676f885d332244cbaa"/><file name="mk.js" hash="4cc7a175a342f413101db66013f09900"/><file name="nl.js" hash="0e717e403d8c8f53e4376c3b4e09d6fd"/><file name="pl.js" hash="52627faf46a7b1f8b8f5110358d224cf"/><file name="pt.js" hash="9828da57868e6192b5c921400ab87d1f"/><file name="ru.js" hash="67e1426c248ee6fe6274ee2fed23df22"/><file name="sk.js" hash="3da0f484cce154d5a8f06572ac5a8461"/><file name="zh.js" hash="50f6ecf19890d2cd305357ca9679684c"/></dir><file name="charmap.js" hash="15d5626b8375004c217dec10ce1346a4"/><file name="popup.html" hash="7d97c56e6f29a3cdaacb934793133188"/></dir><dir name="test"><dir name="css"><file name="test.css" hash="c6d48fc50bb974b20bec7731e312f5de"/></dir><dir name="images"><file name="Thumbs.db" hash="7e5f877400e178710b38e449a474e95c"/><file name="test.gif" hash="6036655a01df362267183a8b23fead10"/></dir><dir name="langs"><file name="bg.js" hash="d7123a41255600449aec9fc1f301c147"/><file name="cs.js" hash="1cefb4fd6e169dfe1950c35b4aff1eba"/><file name="de.js" hash="7a7675c982dd18be1ced114aa70daafb"/><file name="dk.js" hash="488f8af5a93283499dfebe551fb7f4ed"/><file name="en.js" hash="acb2b331564a8dc553302aa46d5f5d36"/><file name="eo.js" hash="a010b4aa33bb848a8b16793910eb05ac"/><file name="es.js" hash="687fba1e66bc7ef6cec32cb208e2b1d7"/><file name="fr.js" hash="7091caec9d5c627073e728ab74a3a5bd"/><file name="hr.js" hash="152f29d20c99cb7d337f0f369dd71ceb"/><file name="it.js" hash="7de5456ada17577d4fcbbfc619324662"/><file name="ja.js" hash="5ccb36b44757fc4e514498c4f447577c"/><file name="mk.js" hash="7a5f9fbf31ac0783d92fcaed1f1c8295"/><file name="nl.js" hash="4b3627381f170e533d9eb767487f33d3"/><file name="pl.js" hash="255f97808244326878b647cecb64aebc"/><file name="pt.js" hash="dcbf418e8f05db1ef7b13cbc8e03782b"/><file name="ru.js" hash="37a504c426450b8e738f7ebbd3ee7587"/><file name="sk.js" hash="1e7b4e0b10b36b9d63edc4d6bfeea172"/><file name="zh.js" hash="0a68369b57f733e07b1eb10c1c238d95"/></dir><file name="test.js" hash="8559ea076cd3f47bac8540f91369e7c6"/><file name="test2.js" hash="9bef02a43a1bd789ec6534f20fbbfc5d"/></dir></dir><dir name="reg_syntax"><file name="basic.js" hash="f0ed7d9db38c7e19500f3ae24ce8070d"/><file name="brainfuck.js" hash="2288f1fd8cbc73f0e9d83482a63bc052"/><file name="c.js" hash="0326272143d7da7d389dda599beb9741"/><file name="coldfusion.js" hash="cfbe2f8431d9db31f1c0cecba4f9132f"/><file name="cpp.js" hash="681cb786b90dffaa802e19e9fc1540d0"/><file name="css.js" hash="2423a68fc6e68e8939f086f7f4650a0a"/><file name="html.js" hash="41b34e112b315e9c253e517c13ea3f89"/><file name="java.js" hash="53eb7c1d234ce09c47f594afd1ca33ab"/><file name="js.js" hash="eabb555dd63215b90166b10f804dd82f"/><file name="pas.js" hash="edd6b673fffc61524a819e6f7149591f"/><file name="perl.js" hash="8e02f4085ed1905ae021bca2ed6d20e7"/><file name="php.js" hash="d92554e80c611fbf93acb382df630594"/><file name="phtml.js" hash="04188805ef86be79b487354595221b1c"/><file name="python.js" hash="d28824657a848d1c0c27db34a321c288"/><file name="robotstxt.js" hash="824adf3afce71d12f6938bf3f6a68ae4"/><file name="ruby.js" hash="d326b7980bf1d0935e20e8e879a8b639"/><file name="sql.js" hash="b0cd0aec21393b97d773b332765a64b3"/><file name="tsql.js" hash="e8cb949959a9a2db54bb563a83204698"/><file name="vb.js" hash="6aefca10f8a4636ae9aeac6fcf298cf2"/><file name="xml.js" hash="ace3c628ad2ed1fef37a56acf3a1a6e8"/></dir><file name="autocompletion.js" hash="59ad980168ca2232f8fae535601f8c4d"/><file name="edit_area.css" hash="4001c368812c08ef2fe578cbf6b9d2c9"/><file name="edit_area.js" hash="0b0fcb249340674909ef7c1e5796de13"/><file name="edit_area_compressor.php" hash="2e0662078bda7fe736e537148e0fcee1"/><file name="edit_area_full.gz" hash="849fe923d272dc3691ab4aa33ed284d0"/><file name="edit_area_full.js" hash="411a93f72136ea38cf55a0321a505310"/><file name="edit_area_functions.js" hash="b33b59e5d5e457e493d8339a6c421248"/><file name="edit_area_loader.js" hash="2f5f212cc4a634a9dfa91dcfc32534e7"/><file name="elements_functions.js" hash="17e5e75bf6ca245789ab40cbbcb89691"/><file name="highlight.js" hash="60f2bf36aa2057b6974b70201b792981"/><file name="keyboard.js" hash="2ed537260bf1c35d99b404ed65995d1f"/><file name="license_apache.txt" hash="6801d33208f92d46a5706709e670b033"/><file name="license_bsd.txt" hash="c60b8e36d1ed6279b060df62b0da2d8f"/><file name="license_lgpl.txt" hash="c73b943dc75f6f65e007c56ac6515c8f"/><file name="manage_area.js" hash="d74ca531240a0c5ae6e24353c3ce938a"/><file name="reg_syntax.js" hash="7835f853ba88e50e0e2020fcf1d2d7c1"/><file name="regexp.js" hash="8bfa979620a145af0f8127a9b9e48ba0"/><file name="resize_area.js" hash="9d4b563f87bc5c94ad6c8d6a32115c42"/><file name="search_replace.js" hash="ec28741bef5cdd22aa5faed230756ec8"/><file name="template.html" hash="05b56dbadbb8de1fcb2ff4b7c933810f"/></dir><dir name="filesystem"><file name="base64.js" hash="cc5d6affe9552d51419d8e48bc85569f"/><file name="jquery-1.4.2.min.js" hash="c2fbf31e78d28fbd78598cb1d56dc939"/><file name="jqueryfiletree.js" hash="54f4d5be8818e449f7e9ed47198d845f"/><file name="script.coffee" hash="645469ffb0829c347e797d41de359b1e"/><file name="script.js" hash="835d9eaf2df1d7e1567b437acd477b72"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="filesystem"><dir name="css"><file name="jqueryfiletree.css" hash="63777b608ccc6d5b0ca57663367f4771"/><file name="styles.css" hash="73cb6063cb849867869901703d8867eb"/></dir><dir name="images"><file name="application.png" hash="fc517da02d6a64a68e5fea9a5de472f1"/><file name="code.png" hash="c65fadae5a0fc27f401f1a00e66f518f"/><file name="css.png" hash="783f5b06082bf73e9d1eaf79d838162f"/><file name="db.png" hash="03e2b564224bfb58ff20904bda244043"/><file name="directory.png" hash="fbd3929a893b147ae0940d48d533e023"/><file name="doc.png" hash="38af291953d5b90b0aee30dd0d2126a4"/><file name="file.png" hash="a3112ba7e266938321394347e2a6e107"/><file name="film.png" hash="5ad12582e3ca901894737c3dd44a5eb2"/><file name="flash.png" hash="132a505684e7b7b91f50ea29c072112b"/><file name="folder_open.png" hash="bf30d89d69dddfbd8e5f805a199c407f"/><file name="html.png" hash="12ace1a918403049a6d2fc152f53baec"/><file name="java.png" hash="ac467ef8defc620b6b5eb80d2047bcb7"/><file name="linux.png" hash="73c25b185fb78cc690675cd4a181ee0b"/><file name="music.png" hash="bd2244ac282a5ada48b0d79cacc59426"/><file name="pdf.png" hash="5ee15843554004d12736f0404f8d443a"/><file name="php.png" hash="48cda2a2a54a31f7a666547c862c12e7"/><file name="phtml.png" hash="48cda2a2a54a31f7a666547c862c12e7"/><file name="picture.png" hash="d2040c34ba1ffd8fa5b72ab37be11eca"/><file name="ppt.png" hash="8c366c11adee3cf2988614df4c96782b"/><file name="psd.png" hash="787a96924e9b114e75f48b540ff480a2"/><file name="ruby.png" hash="661505d2efc05b2347492e4949f564d5"/><file name="script.png" hash="13ad2158a4889c26a851f99b261e4c5c"/><file name="spinner.gif" hash="9a8269421303631316be4ab5e34870e1"/><file name="txt.png" hash="0da66bdb013f9a9d12ce7219e642bc25"/><file name="xls.png" hash="7363cb7630d1d4b441183345fd15ae62"/><file name="zip.png" hash="2eba6780fc7d3663bc44808480c6bd8a"/></dir></dir></dir></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies/>
20
+ </package>
skin/adminhtml/default/default/filesystem/css/jqueryfiletree.css ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ UL.jqueryFileTree {
2
+ font-family: Verdana, sans-serif;
3
+ font-size: 11px;
4
+ line-height: 18px;
5
+ padding: 0px;
6
+ margin: 0px;
7
+ }
8
+
9
+ UL.jqueryFileTree LI {
10
+ list-style: none;
11
+ padding: 0px;
12
+ padding-left: 20px;
13
+ margin: 0px;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ UL.jqueryFileTree A {
18
+ color: #333;
19
+ text-decoration: none;
20
+ display: block;
21
+ padding: 0px 2px;
22
+ }
23
+
24
+ UL.jqueryFileTree A:hover {
25
+ background: #BDF;
26
+ }
27
+
28
+ /* Core Styles */
29
+ .jqueryFileTree LI.directory { background: url(../images/directory.png) left top no-repeat; }
30
+ .jqueryFileTree LI.expanded { background: url(../images/folder_open.png) left top no-repeat; }
31
+ .jqueryFileTree LI.file { background: url(../images/file.png) left top no-repeat; }
32
+ .jqueryFileTree LI.wait { background: url(../images/spinner.gif) left top no-repeat; }
33
+ /* File Extensions*/
34
+ .jqueryFileTree LI.ext_3gp { background: url(../images/film.png) left top no-repeat; }
35
+ .jqueryFileTree LI.ext_afp { background: url(../images/code.png) left top no-repeat; }
36
+ .jqueryFileTree LI.ext_afpa { background: url(../images/code.png) left top no-repeat; }
37
+ .jqueryFileTree LI.ext_asp { background: url(../images/code.png) left top no-repeat; }
38
+ .jqueryFileTree LI.ext_aspx { background: url(../images/code.png) left top no-repeat; }
39
+ .jqueryFileTree LI.ext_avi { background: url(../images/film.png) left top no-repeat; }
40
+ .jqueryFileTree LI.ext_bat { background: url(../images/application.png) left top no-repeat; }
41
+ .jqueryFileTree LI.ext_bmp { background: url(../images/picture.png) left top no-repeat; }
42
+ .jqueryFileTree LI.ext_c { background: url(../images/code.png) left top no-repeat; }
43
+ .jqueryFileTree LI.ext_cfm { background: url(../images/code.png) left top no-repeat; }
44
+ .jqueryFileTree LI.ext_cgi { background: url(../images/code.png) left top no-repeat; }
45
+ .jqueryFileTree LI.ext_com { background: url(../images/application.png) left top no-repeat; }
46
+ .jqueryFileTree LI.ext_cpp { background: url(../images/code.png) left top no-repeat; }
47
+ .jqueryFileTree LI.ext_css { background: url(../images/css.png) left top no-repeat; }
48
+ .jqueryFileTree LI.ext_doc { background: url(../images/doc.png) left top no-repeat; }
49
+ .jqueryFileTree LI.ext_exe { background: url(../images/application.png) left top no-repeat; }
50
+ .jqueryFileTree LI.ext_gif { background: url(../images/picture.png) left top no-repeat; }
51
+ .jqueryFileTree LI.ext_fla { background: url(../images/flash.png) left top no-repeat; }
52
+ .jqueryFileTree LI.ext_h { background: url(../images/code.png) left top no-repeat; }
53
+ .jqueryFileTree LI.ext_htm { background: url(../images/html.png) left top no-repeat; }
54
+ .jqueryFileTree LI.ext_html { background: url(../images/html.png) left top no-repeat; }
55
+ .jqueryFileTree LI.ext_jar { background: url(../images/java.png) left top no-repeat; }
56
+ .jqueryFileTree LI.ext_jpg { background: url(../images/picture.png) left top no-repeat; }
57
+ .jqueryFileTree LI.ext_jpeg { background: url(../images/picture.png) left top no-repeat; }
58
+ .jqueryFileTree LI.ext_js { background: url(../images/script.png) left top no-repeat; }
59
+ .jqueryFileTree LI.ext_lasso { background: url(../images/code.png) left top no-repeat; }
60
+ .jqueryFileTree LI.ext_log { background: url(../images/txt.png) left top no-repeat; }
61
+ .jqueryFileTree LI.ext_m4p { background: url(../images/music.png) left top no-repeat; }
62
+ .jqueryFileTree LI.ext_mov { background: url(../images/film.png) left top no-repeat; }
63
+ .jqueryFileTree LI.ext_mp3 { background: url(../images/music.png) left top no-repeat; }
64
+ .jqueryFileTree LI.ext_mp4 { background: url(../images/film.png) left top no-repeat; }
65
+ .jqueryFileTree LI.ext_mpg { background: url(../images/film.png) left top no-repeat; }
66
+ .jqueryFileTree LI.ext_mpeg { background: url(../images/film.png) left top no-repeat; }
67
+ .jqueryFileTree LI.ext_ogg { background: url(../images/music.png) left top no-repeat; }
68
+ .jqueryFileTree LI.ext_pcx { background: url(../images/picture.png) left top no-repeat; }
69
+ .jqueryFileTree LI.ext_pdf { background: url(../images/pdf.png) left top no-repeat; }
70
+ .jqueryFileTree LI.ext_php { background: url(../images/php.png) left top no-repeat; }
71
+ .jqueryFileTree LI.ext_phtml { background: url(../images/php.png) left top no-repeat; }
72
+ .jqueryFileTree LI.ext_png { background: url(../images/picture.png) left top no-repeat; }
73
+ .jqueryFileTree LI.ext_ppt { background: url(../images/ppt.png) left top no-repeat; }
74
+ .jqueryFileTree LI.ext_psd { background: url(../images/psd.png) left top no-repeat; }
75
+ .jqueryFileTree LI.ext_pl { background: url(../images/script.png) left top no-repeat; }
76
+ .jqueryFileTree LI.ext_py { background: url(../images/script.png) left top no-repeat; }
77
+ .jqueryFileTree LI.ext_rb { background: url(../images/ruby.png) left top no-repeat; }
78
+ .jqueryFileTree LI.ext_rbx { background: url(../images/ruby.png) left top no-repeat; }
79
+ .jqueryFileTree LI.ext_rhtml { background: url(../images/ruby.png) left top no-repeat; }
80
+ .jqueryFileTree LI.ext_rpm { background: url(../images/linux.png) left top no-repeat; }
81
+ .jqueryFileTree LI.ext_ruby { background: url(../images/ruby.png) left top no-repeat; }
82
+ .jqueryFileTree LI.ext_sql { background: url(../images/db.png) left top no-repeat; }
83
+ .jqueryFileTree LI.ext_swf { background: url(../images/flash.png) left top no-repeat; }
84
+ .jqueryFileTree LI.ext_tif { background: url(../images/picture.png) left top no-repeat; }
85
+ .jqueryFileTree LI.ext_tiff { background: url(../images/picture.png) left top no-repeat; }
86
+ .jqueryFileTree LI.ext_txt { background: url(../images/txt.png) left top no-repeat; }
87
+ .jqueryFileTree LI.ext_vb { background: url(../images/code.png) left top no-repeat; }
88
+ .jqueryFileTree LI.ext_wav { background: url(../images/music.png) left top no-repeat; }
89
+ .jqueryFileTree LI.ext_wmv { background: url(../images/film.png) left top no-repeat; }
90
+ .jqueryFileTree LI.ext_xls { background: url(../images/xls.png) left top no-repeat; }
91
+ .jqueryFileTree LI.ext_xml { background: url(../images/code.png) left top no-repeat; }
92
+ .jqueryFileTree LI.ext_zip { background: url(../images/zip.png) left top no-repeat; }
skin/adminhtml/default/default/filesystem/css/styles.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ MagPleasure Co.
3
+
4
+ NOTICE OF LICENSE
5
+
6
+ This source file is subject to the EULA
7
+ that is bundled with this package in the file LICENSE.txt.
8
+ It is also available through the world-wide-web at this URL:
9
+ http://www.magpleasure.com/LICENSE.txt
10
+
11
+ @category Magpleasure
12
+ @package Magpleasure_Filesystem
13
+ @copyright Copyright (c) 2011 Magpleasure Co. (http://www.magpleasure.com)
14
+ @license http://www.magpleasure.com/LICENSE.txt
15
+ */
16
+
17
+ div.ide {
18
+ position: relative;
19
+
20
+ }
21
+
22
+ .ide div.tree {
23
+ width: 20%;
24
+ float: left;
25
+
26
+ }
27
+
28
+ .ide div.editor {
29
+ width: 80%;
30
+ float: right;
31
+
32
+ }
33
+
34
+ .editor .path {
35
+ width: 100%;
36
+ height: 30px;
37
+ }
38
+
39
+ .ide textarea {
40
+ width: 100%;
41
+ height: 600px;
42
+ }
43
+
44
+ .ide .file-tree-wrapper {
45
+ height: 619px;
46
+ width: 95%;
47
+ border: 1px solid #888888;
48
+ padding: 3px;
49
+ margin-top: -9px;
50
+
51
+ overflow:auto;
52
+ }
skin/adminhtml/default/default/filesystem/images/application.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/code.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/css.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/db.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/directory.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/doc.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/file.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/film.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/flash.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/folder_open.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/html.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/java.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/linux.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/music.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/pdf.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/php.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/phtml.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/picture.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/ppt.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/psd.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/ruby.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/script.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/spinner.gif ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/txt.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/xls.png ADDED
Binary file
skin/adminhtml/default/default/filesystem/images/zip.png ADDED
Binary file