unageanu-jiji 1.1.4 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +24 -1
- data/README +0 -0
- data/base/shared_lib/moving_average.rb +34 -33
- data/base/shared_lib/system/cross.rb +76 -0
- data/base/shared_lib/system/position_manager.rb +160 -0
- data/base/shared_lib/system/signal.rb +347 -0
- data/html/css/datatable.css +4 -4
- data/html/css/default.css +57 -5
- data/html/css/treeview.css +205 -0
- data/html/img/bin_closed.png +0 -0
- data/html/img/bin_empty.png +0 -0
- data/html/img/button_add_small.gif +0 -0
- data/html/img/button_add_small_gray.gif +0 -0
- data/html/img/button_add_small_over.gif +0 -0
- data/html/img/button_mkcol.gif +0 -0
- data/html/img/button_mkcol_gray.gif +0 -0
- data/html/img/button_mkcol_over.gif +0 -0
- data/html/img/button_remove_small.gif +0 -0
- data/html/img/button_remove_small_gray.gif +0 -0
- data/html/img/button_remove_small_over.gif +0 -0
- data/html/img/button_rename.gif +0 -0
- data/html/img/button_rename_gray.gif +0 -0
- data/html/img/button_rename_over.gif +0 -0
- data/html/img/control_play.png +0 -0
- data/html/img/control_play_blue.png +0 -0
- data/html/img/folder.png +0 -0
- data/html/img/folder_brick.png +0 -0
- data/html/img/folder_user.png +0 -0
- data/html/{js/codepress/images → img}/line-numbers.png +0 -0
- data/html/img/page_white_ruby.png +0 -0
- data/html/img/sidebar_agent_edit.png +0 -0
- data/html/img/sidebar_agent_edit_over.png +0 -0
- data/html/img/sidebar_agent_edit_s.png +0 -0
- data/html/img/yui/treeview-sprite.gif +0 -0
- data/html/index.html +34 -18
- data/html/js/agent-editor/agent-editor-page.js +324 -0
- data/html/js/agent-editor/agent-editor.js +363 -0
- data/html/js/agent-editor/agent-list-tree.js +251 -0
- data/html/js/agent-selector.js +23 -28
- data/html/js/app.js +63 -91
- data/html/js/bt-create-page.js +25 -19
- data/html/js/container-min.js +1 -1
- data/html/js/container.js +944 -0
- data/html/js/edit_area/autocompletion.js +11 -13
- data/html/js/edit_area/edit_area.css +79 -40
- data/html/js/edit_area/edit_area.js +255 -226
- data/html/js/edit_area/edit_area_compressor.php +4 -4
- data/html/js/edit_area/edit_area_full.gz +0 -0
- data/html/js/edit_area/edit_area_full.js +31 -31
- data/html/js/edit_area/edit_area_full_with_plugins.gz +0 -0
- data/html/js/edit_area/edit_area_full_with_plugins.js +31 -31
- data/html/js/edit_area/edit_area_functions.js +448 -341
- data/html/js/edit_area/edit_area_loader.js +409 -397
- data/html/js/edit_area/elements_functions.js +120 -123
- data/html/js/edit_area/highlight.js +305 -197
- data/html/js/edit_area/images/goto.png +0 -0
- data/html/js/edit_area/images/help.png +0 -0
- data/html/js/edit_area/images/redo.png +0 -0
- data/html/js/edit_area/images/save.png +0 -0
- data/html/js/edit_area/images/search.png +0 -0
- data/html/js/edit_area/images/undo.png +0 -0
- data/html/js/edit_area/images/word_wrap.gif +0 -0
- data/html/js/edit_area/keyboard.js +5 -5
- data/html/js/edit_area/langs/bg.js +73 -0
- data/html/js/edit_area/langs/cs.js +2 -0
- data/html/js/edit_area/langs/de.js +2 -0
- data/html/js/edit_area/langs/dk.js +2 -0
- data/html/js/edit_area/langs/en.js +2 -0
- data/html/js/edit_area/langs/eo.js +2 -0
- data/html/js/edit_area/langs/es.js +2 -0
- data/html/js/edit_area/langs/fi.js +67 -0
- data/html/js/edit_area/langs/fr.js +2 -0
- data/html/js/edit_area/langs/hr.js +2 -0
- data/html/js/edit_area/langs/it.js +2 -0
- data/html/js/edit_area/langs/ja.js +2 -0
- data/html/js/edit_area/langs/mk.js +2 -0
- data/html/js/edit_area/langs/nl.js +2 -0
- data/html/js/edit_area/langs/pl.js +2 -0
- data/html/js/edit_area/langs/pt.js +2 -0
- data/html/js/edit_area/langs/ru.js +2 -0
- data/html/js/edit_area/langs/sk.js +2 -0
- data/html/js/edit_area/langs/zh.js +67 -0
- data/html/js/edit_area/manage_area.js +362 -205
- data/html/js/edit_area/plugins/charmap/langs/bg.js +12 -0
- data/html/js/edit_area/plugins/charmap/langs/zh.js +6 -0
- data/html/js/edit_area/plugins/test/langs/bg.js +10 -0
- data/html/js/edit_area/plugins/test/langs/zh.js +4 -0
- data/html/js/edit_area/reg_syntax/java.js +56 -0
- data/html/js/edit_area/reg_syntax/ruby.js +9 -9
- data/html/js/edit_area/reg_syntax.js +15 -13
- data/html/js/edit_area/regexp.js +36 -32
- data/html/js/edit_area/resize_area.js +43 -47
- data/html/js/edit_area/search_replace.js +29 -29
- data/html/js/edit_area/template.html +6 -4
- data/html/js/json-broker-client.js +23 -17
- data/html/js/result-page.js +107 -57
- data/html/js/rt-setting-page.js +38 -15
- data/html/js/sidebar.js +41 -27
- data/html/js/templates.js +167 -32
- data/html/js/utils.js +143 -7
- data/html/js/yui/treeview.js +3671 -0
- data/html/swf/chart.swf +0 -0
- data/html/test/agent_editor_spec.js +815 -0
- data/html/test/index.html +40 -0
- data/html/test/jsspec/JSSpec.css +224 -0
- data/html/test/jsspec/JSSpec.js +1549 -0
- data/html/test/jsspec/diff_match_patch.js +1 -0
- data/html/test/utils_spec.js +111 -0
- data/lib/jiji/agent/agent.rb +69 -12
- data/lib/jiji/agent/agent_manager.rb +18 -12
- data/lib/jiji/agent/agent_registry.rb +35 -121
- data/lib/jiji/collector.rb +16 -6
- data/lib/jiji/command.rb +46 -5
- data/lib/jiji/dao/file_system_dao.rb +158 -0
- data/lib/jiji/dao/timed_data_dao.rb +2 -0
- data/lib/jiji/dao/trade_result_dao.rb +1 -1
- data/lib/jiji/error.rb +24 -8
- data/lib/jiji/migration/migrator1_2_0.rb +67 -0
- data/lib/jiji/models.rb +82 -24
- data/lib/jiji/operator.rb +55 -51
- data/lib/jiji/output.rb +85 -29
- data/lib/jiji/output_manager.rb +84 -0
- data/lib/jiji/plugin/embedded/single_click_client.rb +2 -2
- data/lib/jiji/plugin/securities_plugin.rb +0 -1
- data/lib/jiji/process.rb +229 -208
- data/lib/jiji/process_manager.rb +190 -96
- data/lib/jiji/registry.rb +87 -19
- data/lib/jiji/server.rb +1 -0
- data/lib/jiji/service/agent_service.rb +147 -48
- data/lib/jiji/service/output_service.rb +37 -17
- data/lib/jiji/service/process_service.rb +3 -5
- data/lib/jiji/service/trade_result_service.rb +4 -5
- data/lib/jiji/util/file_lock.rb +4 -4
- data/lib/jiji/util/include_proxy.rb +17 -0
- data/lib/jiji/util/json_broker.rb +6 -4
- data/lib/jiji/util/util.rb +1 -1
- data/swf/chart/fx/chart/Chart.as +7 -0
- data/swf/chart/fx/chart/ui/graph/GraphManager.as +15 -2
- data/test/ProcessTest/agents/foo.rb +10 -0
- data/test/ProcessTest/conf/configuration.yaml +3 -0
- data/test/agent/agent_tests.rb +10 -0
- data/test/agent/test_AgentManager.rb +28 -12
- data/test/agent/test_AgentRegistry.rb +194 -99
- data/test/agent/test_PeriodicallyAgent.rb +1 -2
- data/test/agent/test_Permitter.rb +1 -2
- data/test/all_tests.rb +7 -19
- data/test/dao/dao_tests.rb +9 -0
- data/test/dao/test_FileSystemDao.rb +431 -0
- data/test/dao/test_RateDao.rb +5 -7
- data/test/dao/test_TradeResultDao.rb +1 -2
- data/test/migration/migration_tests.rb +10 -0
- data/test/migration/migrator1_2_0test_data/basic/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/basic/out/MDVhYzcxMjYtMGFlMS00Mzk0LWEyNmUtYjVjZjgwNDA0ZmE2/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/basic/out/MzA1YTk0NDgtNzhjNi00NDk3LTk2NTktYzE1ZjBhNzdiYjNj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/basic/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
- data/test/migration/migrator1_2_0test_data/basic/props.yaml +85 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/MDVhYzcxMjYtMGFlMS00Mzk0LWEyNmUtYjVjZjgwNDA0ZmE2/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/MzA1YTk0NDgtNzhjNi00NDk3LTk2NTktYzE1ZjBhNzdiYjNj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/props.yaml +1 -0
- data/test/migration/migrator1_2_0test_data/no_outs/props.yaml +85 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/MDVhYzcxMjYtMGFlMS00Mzk0LWEyNmUtYjVjZjgwNDA0ZmE2/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/MzA1YTk0NDgtNzhjNi00NDk3LTk2NTktYzE1ZjBhNzdiYjNj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
- data/test/migration/test_Migrator.rb +1 -1
- data/test/migration/test_Migrator1_0_3.rb +1 -1
- data/test/migration/test_Migrator1_1_0.rb +1 -1
- data/test/migration/test_Migrator1_2_0.rb +94 -0
- data/test/plugin/embedded/test_SingleClickClient.rb +1 -2
- data/test/plugin/plugin_tests.rb +8 -0
- data/test/plugin/test_Loader.rb +1 -1
- data/test/shared/rate.csv +144 -0
- data/test/shared/shared_tests.rb +9 -0
- data/test/shared/test_Cross.rb +144 -0
- data/test/shared/test_PositionManager.rb +285 -0
- data/test/shared/test_Signal.rb +65 -0
- data/test/test_Output.rb +28 -21
- data/test/test_OutputManager.rb +162 -0
- data/test/test_Output_registry.rb +6 -17
- data/test/test_Process.rb +434 -222
- data/test/test_ProcessManager.rb +458 -101
- data/test/test_utils.rb +71 -8
- data/test/util/test_BlockToSession.rb +1 -2
- data/test/util/test_CSV.rb +1 -2
- data/test/util/test_SynchronizeInterceptor.rb +1 -2
- data/test/util/util_tests.rb +9 -0
- metadata +127 -47
- data/html/js/agent-editor-page.js +0 -440
- data/html/js/codepress/codepress.css +0 -21
- data/html/js/codepress/codepress.html +0 -35
- data/html/js/codepress/codepress.js +0 -138
- data/html/js/codepress/engines/gecko.js +0 -293
- data/html/js/codepress/engines/khtml.js +0 -0
- data/html/js/codepress/engines/msie.js +0 -304
- data/html/js/codepress/engines/older.js +0 -0
- data/html/js/codepress/engines/opera.js +0 -260
- data/html/js/codepress/images/line-numbers.gif +0 -0
- data/html/js/codepress/index.html +0 -443
- data/html/js/codepress/languages/asp.css +0 -71
- data/html/js/codepress/languages/asp.js +0 -117
- data/html/js/codepress/languages/autoit.css +0 -13
- data/html/js/codepress/languages/autoit.js +0 -32
- data/html/js/codepress/languages/csharp.css +0 -9
- data/html/js/codepress/languages/csharp.js +0 -25
- data/html/js/codepress/languages/css.css +0 -10
- data/html/js/codepress/languages/css.js +0 -23
- data/html/js/codepress/languages/generic.css +0 -9
- data/html/js/codepress/languages/generic.js +0 -25
- data/html/js/codepress/languages/html.css +0 -13
- data/html/js/codepress/languages/html.js +0 -59
- data/html/js/codepress/languages/java.css +0 -7
- data/html/js/codepress/languages/java.js +0 -24
- data/html/js/codepress/languages/javascript.css +0 -8
- data/html/js/codepress/languages/javascript.js +0 -30
- data/html/js/codepress/languages/perl.css +0 -11
- data/html/js/codepress/languages/perl.js +0 -27
- data/html/js/codepress/languages/php.css +0 -12
- data/html/js/codepress/languages/php.js +0 -61
- data/html/js/codepress/languages/ruby.css +0 -10
- data/html/js/codepress/languages/ruby.js +0 -26
- data/html/js/codepress/languages/sql.css +0 -10
- data/html/js/codepress/languages/sql.js +0 -30
- data/html/js/codepress/languages/text.css +0 -5
- data/html/js/codepress/languages/text.js +0 -9
- data/html/js/codepress/languages/vbscript.css +0 -71
- data/html/js/codepress/languages/vbscript.js +0 -117
- data/html/js/codepress/languages/xsl.css +0 -15
- data/html/js/codepress/languages/xsl.js +0 -103
- data/html/js/codepress/license.txt +0 -458
- data/html/js/edit_area/images/Thumbs.db +0 -0
- data/test/plugin/test_gem/a/lib/jiji_plugin_test.rb +0 -6
@@ -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
|
+
});
|
@@ -0,0 +1,56 @@
|
|
1
|
+
editAreaLoader.load_syntax["java"] = {
|
2
|
+
'COMMENT_SINGLE': { 1: '//', 2: '@' }
|
3
|
+
, 'COMMENT_MULTI': { '/*': '*/' }
|
4
|
+
, 'QUOTEMARKS': { 1: "'", 2: '"' }
|
5
|
+
, 'KEYWORD_CASE_SENSITIVE': true
|
6
|
+
, 'KEYWORDS': {
|
7
|
+
'constants': [
|
8
|
+
'null', 'false', 'true'
|
9
|
+
]
|
10
|
+
, 'types': [
|
11
|
+
'String', 'int', 'short', 'long', 'char', 'double', 'byte',
|
12
|
+
'float', 'static', 'void', 'private', 'boolean', 'protected',
|
13
|
+
'public', 'const', 'class', 'final', 'abstract', 'volatile',
|
14
|
+
'enum', 'transient', 'interface'
|
15
|
+
]
|
16
|
+
, 'statements': [
|
17
|
+
'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
|
18
|
+
'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
|
19
|
+
'break', 'case', 'default', 'goto'
|
20
|
+
]
|
21
|
+
, 'keywords': [
|
22
|
+
'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
|
23
|
+
'instanceof', 'strictfp'
|
24
|
+
]
|
25
|
+
}
|
26
|
+
, 'OPERATORS': [
|
27
|
+
'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
|
28
|
+
]
|
29
|
+
, 'DELIMITERS': [
|
30
|
+
'(', ')', '[', ']', '{', '}'
|
31
|
+
]
|
32
|
+
, 'REGEXPS': {
|
33
|
+
'precompiler': {
|
34
|
+
'search': '()(#[^\r\n]*)()'
|
35
|
+
, 'class': 'precompiler'
|
36
|
+
, 'modifiers': 'g'
|
37
|
+
, 'execute': 'before'
|
38
|
+
}
|
39
|
+
}
|
40
|
+
, 'STYLES': {
|
41
|
+
'COMMENTS': 'color: #AAAAAA;'
|
42
|
+
, 'QUOTESMARKS': 'color: #6381F8;'
|
43
|
+
, 'KEYWORDS': {
|
44
|
+
'constants': 'color: #EE0000;'
|
45
|
+
, 'types': 'color: #0000EE;'
|
46
|
+
, 'statements': 'color: #60CA00;'
|
47
|
+
, 'keywords': 'color: #48BDDF;'
|
48
|
+
}
|
49
|
+
, 'OPERATORS': 'color: #FF00FF;'
|
50
|
+
, 'DELIMITERS': 'color: #0038E1;'
|
51
|
+
, 'REGEXPS': {
|
52
|
+
'precompiler': 'color: #009900;'
|
53
|
+
, 'precompilerstring': 'color: #994400;'
|
54
|
+
}
|
55
|
+
}
|
56
|
+
};
|
@@ -50,18 +50,18 @@ editAreaLoader.load_syntax["ruby"] = {
|
|
50
50
|
}
|
51
51
|
}
|
52
52
|
,'STYLES' : {
|
53
|
-
'COMMENTS': 'color: #
|
54
|
-
,'QUOTESMARKS': 'color: #
|
53
|
+
'COMMENTS': 'color: #3F7F5F;'
|
54
|
+
,'QUOTESMARKS': 'color: #999999;'
|
55
55
|
,'KEYWORDS' : {
|
56
|
-
'reserved' : '
|
56
|
+
'reserved' : 'color: #A4357A;'
|
57
57
|
}
|
58
|
-
,'OPERATORS' : 'color: #
|
59
|
-
,'DELIMITERS' : 'color: #
|
58
|
+
,'OPERATORS' : 'color: #003399;'
|
59
|
+
,'DELIMITERS' : 'color: #003399;'
|
60
60
|
,'REGEXPS' : {
|
61
|
-
'variables' : 'color: #
|
62
|
-
,'numbers' : 'color:
|
63
|
-
,'constants' : 'color: #
|
64
|
-
,'symbols' : 'color: #
|
61
|
+
'variables' : 'color: #004080;'
|
62
|
+
,'numbers' : 'color: #0080FF;'
|
63
|
+
,'constants' : 'color: #777777;'
|
64
|
+
,'symbols' : 'color: #FF3030;'
|
65
65
|
}
|
66
66
|
}
|
67
67
|
};
|
@@ -17,16 +17,16 @@
|
|
17
17
|
|
18
18
|
|
19
19
|
EditAreaLoader.prototype.get_escaped_regexp= function(str){
|
20
|
-
return str.replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
|
20
|
+
return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
|
21
21
|
};
|
22
22
|
|
23
23
|
EditAreaLoader.prototype.init_syntax_regexp= function(){
|
24
|
-
var lang_style=
|
24
|
+
var lang_style= {};
|
25
25
|
for(var lang in this.load_syntax){
|
26
26
|
if(!this.syntax[lang]) // init the regexp if not already initialized
|
27
27
|
{
|
28
|
-
this.syntax[lang]=
|
29
|
-
this.syntax[lang]["keywords_reg_exp"]=
|
28
|
+
this.syntax[lang]= {};
|
29
|
+
this.syntax[lang]["keywords_reg_exp"]= {};
|
30
30
|
this.keywords_reg_exp_nb=0;
|
31
31
|
|
32
32
|
if(this.load_syntax[lang]['KEYWORDS']){
|
@@ -70,24 +70,26 @@
|
|
70
70
|
|
71
71
|
|
72
72
|
// /(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
|
73
|
-
var syntax_trace=
|
73
|
+
var syntax_trace=[];
|
74
74
|
|
75
75
|
// /("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
|
76
76
|
|
77
|
-
this.syntax[lang]["quotes"]=
|
78
|
-
var quote_tab=
|
77
|
+
this.syntax[lang]["quotes"]={};
|
78
|
+
var quote_tab= [];
|
79
79
|
if(this.load_syntax[lang]['QUOTEMARKS']){
|
80
80
|
for(var i in this.load_syntax[lang]['QUOTEMARKS']){
|
81
81
|
if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;
|
82
82
|
var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
|
83
83
|
this.syntax[lang]["quotes"][x]=x;
|
84
84
|
//quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
|
85
|
-
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
|
+
|
86
88
|
syntax_trace.push(x);
|
87
89
|
}
|
88
90
|
}
|
89
91
|
|
90
|
-
this.syntax[lang]["comments"]=
|
92
|
+
this.syntax[lang]["comments"]={};
|
91
93
|
if(this.load_syntax[lang]['COMMENT_SINGLE']){
|
92
94
|
for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){
|
93
95
|
if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;
|
@@ -116,27 +118,27 @@
|
|
116
118
|
this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
|
117
119
|
|
118
120
|
if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
|
119
|
-
this.syntax[lang]["script_delimiters"]=
|
121
|
+
this.syntax[lang]["script_delimiters"]= {};
|
120
122
|
for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
|
121
123
|
if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;
|
122
124
|
this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
|
123
125
|
}
|
124
126
|
}
|
125
127
|
|
126
|
-
this.syntax[lang]["custom_regexp"]=
|
128
|
+
this.syntax[lang]["custom_regexp"]= {};
|
127
129
|
if(this.load_syntax[lang]['REGEXPS']){
|
128
130
|
for(var i in this.load_syntax[lang]['REGEXPS']){
|
129
131
|
if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
|
130
132
|
var val= this.load_syntax[lang]['REGEXPS'][i];
|
131
133
|
if(!this.syntax[lang]["custom_regexp"][val['execute']])
|
132
|
-
this.syntax[lang]["custom_regexp"][val['execute']]=
|
134
|
+
this.syntax[lang]["custom_regexp"][val['execute']]= {};
|
133
135
|
this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
|
134
136
|
, 'class' : val['class']};
|
135
137
|
}
|
136
138
|
}
|
137
139
|
|
138
140
|
if(this.load_syntax[lang]['STYLES']){
|
139
|
-
lang_style[lang]=
|
141
|
+
lang_style[lang]= {};
|
140
142
|
for(var i in this.load_syntax[lang]['STYLES']){
|
141
143
|
if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
|
142
144
|
if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
|
data/html/js/edit_area/regexp.js
CHANGED
@@ -26,33 +26,35 @@
|
|
26
26
|
|
27
27
|
// determine if the selected text if a comment or a quoted text
|
28
28
|
EditArea.prototype.comment_or_quote= function(){
|
29
|
-
var new_class="";
|
30
|
-
|
31
|
-
|
32
|
-
|
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){
|
33
35
|
new_class="quotesmarks";
|
34
|
-
close_tag=
|
36
|
+
close_tag=sy["quotes"][i];
|
35
37
|
}
|
36
38
|
}
|
37
39
|
if(new_class.length==0)
|
38
40
|
{
|
39
|
-
for(var i in
|
40
|
-
if(
|
41
|
+
for(var i in sy["comments"]){
|
42
|
+
if( arg.indexOf(i)==0 ){
|
41
43
|
new_class="comments";
|
42
|
-
close_tag=
|
44
|
+
close_tag=sy["comments"][i];
|
43
45
|
}
|
44
46
|
}
|
45
47
|
}
|
46
48
|
// for single line comment the \n must not be included in the span tags
|
47
49
|
if(close_tag=="\n"){
|
48
|
-
return "µ__"+ new_class +"__µ"+
|
50
|
+
return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
|
49
51
|
}else{
|
50
52
|
// the closing tag must be set only if the comment or quotes is closed
|
51
53
|
reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
|
52
|
-
if(
|
53
|
-
return "µ__"+ new_class +"__µ"+
|
54
|
+
if( arg.search(reg)!=-1 )
|
55
|
+
return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
|
54
56
|
else
|
55
|
-
return "µ__"+ new_class +"__µ"+
|
57
|
+
return "µ__"+ new_class +"__µ"+ arg;
|
56
58
|
}
|
57
59
|
};
|
58
60
|
|
@@ -76,7 +78,7 @@
|
|
76
78
|
EditArea.prototype.colorize_text= function(text){
|
77
79
|
//text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
|
78
80
|
/*
|
79
|
-
if(this.
|
81
|
+
if(this.isOpera){
|
80
82
|
// opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre
|
81
83
|
text= this.replace_tab(text);
|
82
84
|
}*/
|
@@ -93,41 +95,43 @@
|
|
93
95
|
};
|
94
96
|
|
95
97
|
EditArea.prototype.apply_syntax= function(text, lang){
|
98
|
+
var sy;
|
96
99
|
this.current_code_lang=lang;
|
97
100
|
|
98
101
|
if(!parent.editAreaLoader.syntax[lang])
|
99
102
|
return text;
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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);
|
105
109
|
}
|
106
110
|
}
|
107
111
|
|
108
|
-
if(
|
109
|
-
//setTimeout("$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
|
110
|
-
text= text.replace(
|
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);
|
111
115
|
}
|
112
116
|
|
113
|
-
if(
|
114
|
-
for(var i in
|
115
|
-
text= text.replace(
|
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_µ');
|
116
120
|
}
|
117
121
|
}
|
118
122
|
|
119
|
-
if(
|
120
|
-
text= text.replace(
|
123
|
+
if(sy["delimiters_reg_exp"]){
|
124
|
+
text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
|
121
125
|
}
|
122
126
|
|
123
|
-
if(
|
124
|
-
text= text.replace(
|
127
|
+
if(sy["operators_reg_exp"]){
|
128
|
+
text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
|
125
129
|
}
|
126
130
|
|
127
|
-
if(
|
128
|
-
for( var i in
|
129
|
-
var convert="$1µ__"+
|
130
|
-
text= text.replace(
|
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);
|
131
135
|
}
|
132
136
|
}
|
133
137
|
|
@@ -1,81 +1,77 @@
|
|
1
1
|
|
2
2
|
EditAreaLoader.prototype.start_resize_area= function(){
|
3
|
-
document
|
4
|
-
|
3
|
+
var d=document,a,div,width,height,father;
|
4
|
+
|
5
|
+
d.onmouseup= editAreaLoader.end_resize_area;
|
6
|
+
d.onmousemove= editAreaLoader.resize_area;
|
5
7
|
editAreaLoader.toggle(editAreaLoader.resize["id"]);
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
a = editAreas[editAreaLoader.resize["id"]]["textarea"];
|
10
|
+
div = d.getElementById("edit_area_resize");
|
9
11
|
if(!div){
|
10
|
-
div=
|
12
|
+
div= d.createElement("div");
|
11
13
|
div.id="edit_area_resize";
|
12
14
|
div.style.border="dashed #888888 1px";
|
13
15
|
}
|
14
|
-
|
15
|
-
|
16
|
-
/*if(this.nav['isGecko']){
|
17
|
-
width-=2;
|
18
|
-
height-=2;
|
19
|
-
}*/
|
16
|
+
width = a.offsetWidth -2;
|
17
|
+
height = a.offsetHeight -2;
|
20
18
|
|
21
|
-
div.style.display="block";
|
22
|
-
div.style.width= width+"px";
|
23
|
-
div.style.height= height+"px";
|
24
|
-
|
25
|
-
father.insertBefore(div,
|
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);
|
26
24
|
|
27
|
-
|
25
|
+
a.style.display="none";
|
28
26
|
|
29
27
|
editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
|
30
|
-
editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
|
31
|
-
|
32
|
-
|
33
|
-
/*var next= textarea.nextSibling;
|
34
|
-
if(next==null)
|
35
|
-
father.appendChild(div);
|
36
|
-
else
|
37
|
-
father.insertBefore(div, next);*/
|
38
|
-
|
28
|
+
editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);
|
39
29
|
};
|
40
30
|
|
41
31
|
EditAreaLoader.prototype.end_resize_area= function(e){
|
42
|
-
document
|
43
|
-
document.onmousemove="";
|
32
|
+
var d=document,div,a,width,height;
|
44
33
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
34
|
+
d.onmouseup="";
|
35
|
+
d.onmousemove="";
|
36
|
+
|
37
|
+
div = d.getElementById("edit_area_resize");
|
38
|
+
a= editAreas[editAreaLoader.resize["id"]]["textarea"];
|
39
|
+
var x = editAreas[editAreaLoader.resize["id"]];
|
40
|
+
if(x.fullscreen && x.fullscreen['isFull']){
|
41
|
+
width = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
|
42
|
+
} else {
|
43
|
+
width = 498;
|
44
|
+
}
|
45
|
+
height = Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
|
46
|
+
if(editAreaLoader.isIE==6){
|
50
47
|
width-=2;
|
51
48
|
height-=2;
|
52
49
|
}
|
53
|
-
|
54
|
-
|
55
|
-
div.style.display="none";
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
a.style.width = width+"px";
|
51
|
+
a.style.height = height+"px";
|
52
|
+
div.style.display = "none";
|
53
|
+
a.style.display = "inline";
|
54
|
+
a.selectionStart = editAreaLoader.resize["selectionStart"];
|
55
|
+
a.selectionEnd = editAreaLoader.resize["selectionEnd"];
|
59
56
|
editAreaLoader.toggle(editAreaLoader.resize["id"]);
|
60
57
|
|
61
58
|
return false;
|
62
59
|
};
|
63
60
|
|
64
61
|
EditAreaLoader.prototype.resize_area= function(e){
|
65
|
-
var allow
|
62
|
+
var allow,newHeight,newWidth;
|
63
|
+
allow = editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
|
66
64
|
if(allow=="both" || allow=="y")
|
67
65
|
{
|
68
|
-
|
69
|
-
|
70
|
-
document.getElementById("edit_area_resize").style.height= new_height+"px";
|
66
|
+
newHeight = Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
|
67
|
+
document.getElementById("edit_area_resize").style.height= newHeight+"px";
|
71
68
|
}
|
72
69
|
if(allow=="both" || allow=="x")
|
73
70
|
{
|
74
|
-
|
75
|
-
|
76
|
-
document.getElementById("edit_area_resize").style.width= new_width+"px";
|
71
|
+
newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
|
72
|
+
document.getElementById("edit_area_resize").style.width= newWidth+"px";
|
77
73
|
}
|
78
|
-
|
74
|
+
|
79
75
|
return false;
|
80
76
|
};
|
81
77
|
|
@@ -1,19 +1,19 @@
|
|
1
1
|
EditArea.prototype.show_search = function(){
|
2
|
-
if($("area_search_replace").style.visibility=="visible"){
|
2
|
+
if(_$("area_search_replace").style.visibility=="visible"){
|
3
3
|
this.hidden_search();
|
4
4
|
}else{
|
5
5
|
this.open_inline_popup("area_search_replace");
|
6
6
|
var text= this.area_get_selection();
|
7
7
|
var search= text.split("\n")[0];
|
8
|
-
$("area_search").value= search;
|
9
|
-
$("area_search").focus();
|
8
|
+
_$("area_search").value= search;
|
9
|
+
_$("area_search").focus();
|
10
10
|
}
|
11
11
|
};
|
12
12
|
|
13
13
|
EditArea.prototype.hidden_search= function(){
|
14
|
-
|
14
|
+
/*_$("area_search_replace").style.visibility="hidden";
|
15
15
|
this.textarea.focus();
|
16
|
-
var icon= $("search");
|
16
|
+
var icon= _$("search");
|
17
17
|
setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
|
18
18
|
this.close_inline_popup("area_search_replace");
|
19
19
|
};
|
@@ -22,8 +22,8 @@
|
|
22
22
|
|
23
23
|
if(!mode)
|
24
24
|
mode="search";
|
25
|
-
$("area_search_msg").innerHTML="";
|
26
|
-
var search
|
25
|
+
_$("area_search_msg").innerHTML="";
|
26
|
+
var search=_$("area_search").value;
|
27
27
|
|
28
28
|
this.textarea.focus();
|
29
29
|
this.textarea.textareaFocused=true;
|
@@ -34,27 +34,27 @@
|
|
34
34
|
var pos_begin=-1;
|
35
35
|
var length=search.length;
|
36
36
|
|
37
|
-
if($("area_search_replace").style.visibility!="visible"){
|
37
|
+
if(_$("area_search_replace").style.visibility!="visible"){
|
38
38
|
this.show_search();
|
39
39
|
return;
|
40
40
|
}
|
41
41
|
if(search.length==0){
|
42
|
-
$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
|
42
|
+
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
|
43
43
|
return;
|
44
44
|
}
|
45
45
|
// advance to the next occurence if no text selected
|
46
46
|
if(mode!="replace" ){
|
47
|
-
if($("area_search_reg_exp").checked)
|
47
|
+
if(_$("area_search_reg_exp").checked)
|
48
48
|
start++;
|
49
49
|
else
|
50
50
|
start+= search.length;
|
51
51
|
}
|
52
52
|
|
53
53
|
//search
|
54
|
-
if($("area_search_reg_exp").checked){
|
54
|
+
if(_$("area_search_reg_exp").checked){
|
55
55
|
// regexp search
|
56
56
|
var opt="m";
|
57
|
-
if(
|
57
|
+
if(!_$("area_search_match_case").checked)
|
58
58
|
opt+="i";
|
59
59
|
var reg= new RegExp(search, opt);
|
60
60
|
pos= infos["full_text"].substr(start).search(reg);
|
@@ -66,7 +66,7 @@
|
|
66
66
|
length=infos["full_text"].match(reg)[0].length;
|
67
67
|
}
|
68
68
|
}else{
|
69
|
-
if($("area_search_match_case").checked){
|
69
|
+
if(_$("area_search_match_case").checked){
|
70
70
|
pos= infos["full_text"].indexOf(search, start);
|
71
71
|
pos_begin= infos["full_text"].indexOf(search);
|
72
72
|
}else{
|
@@ -77,21 +77,21 @@
|
|
77
77
|
|
78
78
|
// interpret result
|
79
79
|
if(pos==-1 && pos_begin==-1){
|
80
|
-
$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
|
80
|
+
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
|
81
81
|
return;
|
82
82
|
}else if(pos==-1 && pos_begin != -1){
|
83
83
|
begin= pos_begin;
|
84
|
-
$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
|
84
|
+
_$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
|
85
85
|
}else
|
86
86
|
begin= pos;
|
87
87
|
|
88
|
-
|
88
|
+
//_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
|
89
89
|
if(mode=="replace" && pos==infos["indexOfCursor"]){
|
90
|
-
var replace= $("area_replace").value;
|
90
|
+
var replace= _$("area_replace").value;
|
91
91
|
var new_text="";
|
92
|
-
if($("area_search_reg_exp").checked){
|
92
|
+
if(_$("area_search_reg_exp").checked){
|
93
93
|
var opt="m";
|
94
|
-
if(
|
94
|
+
if(!_$("area_search_match_case").checked)
|
95
95
|
opt+="i";
|
96
96
|
var reg= new RegExp(search, opt);
|
97
97
|
new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
|
@@ -114,25 +114,25 @@
|
|
114
114
|
|
115
115
|
EditArea.prototype.area_replace_all= function(){
|
116
116
|
/* this.area_select(0, 0);
|
117
|
-
$("area_search_msg").innerHTML="";
|
118
|
-
while($("area_search_msg").innerHTML==""){
|
117
|
+
_$("area_search_msg").innerHTML="";
|
118
|
+
while(_$("area_search_msg").innerHTML==""){
|
119
119
|
this.area_replace();
|
120
120
|
}*/
|
121
121
|
|
122
122
|
var base_text= this.textarea.value;
|
123
|
-
var search= $("area_search").value;
|
124
|
-
var replace= $("area_replace").value;
|
123
|
+
var search= _$("area_search").value;
|
124
|
+
var replace= _$("area_replace").value;
|
125
125
|
if(search.length==0){
|
126
|
-
$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
|
126
|
+
_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
|
127
127
|
return ;
|
128
128
|
}
|
129
129
|
|
130
130
|
var new_text="";
|
131
131
|
var nb_change=0;
|
132
|
-
if($("area_search_reg_exp").checked){
|
132
|
+
if(_$("area_search_reg_exp").checked){
|
133
133
|
// regExp
|
134
134
|
var opt="mg";
|
135
|
-
if(
|
135
|
+
if(!_$("area_search_match_case").checked)
|
136
136
|
opt+="i";
|
137
137
|
var reg= new RegExp(search, opt);
|
138
138
|
nb_change= infos["full_text"].match(reg).length;
|
@@ -140,7 +140,7 @@
|
|
140
140
|
|
141
141
|
}else{
|
142
142
|
|
143
|
-
if($("area_search_match_case").checked){
|
143
|
+
if(_$("area_search_match_case").checked){
|
144
144
|
var tmp_tab=base_text.split(search);
|
145
145
|
nb_change= tmp_tab.length -1 ;
|
146
146
|
new_text= tmp_tab.join(replace);
|
@@ -161,10 +161,10 @@
|
|
161
161
|
}
|
162
162
|
}
|
163
163
|
if(new_text==base_text){
|
164
|
-
$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
|
164
|
+
_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
|
165
165
|
}else{
|
166
166
|
this.textarea.value= new_text;
|
167
|
-
$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
|
167
|
+
_$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
|
168
168
|
// firefox and opera doesn't manage with the focus if it's done directly
|
169
169
|
//editArea.textarea.focus();editArea.textarea.textareaFocused=true;
|
170
170
|
setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
|