jiji 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +58 -0
- data/README +1 -0
- data/base/agents/moving_average_agent.rb +78 -0
- data/base/shared_lib/moving_average.rb +35 -0
- 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/bin/jiji +5 -0
- data/html/css/calendar.css +432 -0
- data/html/css/datatable.css +299 -0
- data/html/css/default.css +627 -0
- data/html/css/dialog.css +77 -0
- data/html/css/treeview.css +205 -0
- data/html/img/auto_trade_off.gif +0 -0
- data/html/img/auto_trade_on.gif +0 -0
- data/html/img/back_bottom.gif +0 -0
- data/html/img/back_middle.gif +0 -0
- data/html/img/back_top.gif +0 -0
- data/html/img/bin_closed.png +0 -0
- data/html/img/bin_empty.png +0 -0
- data/html/img/bt-create-title-1.gif +0 -0
- data/html/img/bt-create-title-2.gif +0 -0
- data/html/img/bt-create-title-3.gif +0 -0
- data/html/img/button_add.gif +0 -0
- data/html/img/button_add_gray.gif +0 -0
- data/html/img/button_add_over.gif +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_apply.gif +0 -0
- data/html/img/button_apply_gray.gif +0 -0
- data/html/img/button_apply_over.gif +0 -0
- data/html/img/button_calendar.gif +0 -0
- data/html/img/button_calendar_over.gif +0 -0
- data/html/img/button_cancel.gif +0 -0
- data/html/img/button_cancel.jpg +0 -0
- data/html/img/button_cancel_gray.gif +0 -0
- data/html/img/button_cancel_over.gif +0 -0
- data/html/img/button_cancel_over.jpg +0 -0
- data/html/img/button_close.gif +0 -0
- data/html/img/button_close_gray.gif +0 -0
- data/html/img/button_close_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_no.gif +0 -0
- data/html/img/button_no_gray.gif +0 -0
- data/html/img/button_no_over.gif +0 -0
- data/html/img/button_ok.gif +0 -0
- data/html/img/button_ok_gray.gif +0 -0
- data/html/img/button_ok_over.gif +0 -0
- data/html/img/button_remove.gif +0 -0
- data/html/img/button_remove_gray.gif +0 -0
- data/html/img/button_remove_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/button_save.gif +0 -0
- data/html/img/button_save_gray.gif +0 -0
- data/html/img/button_save_over.gif +0 -0
- data/html/img/button_start.gif +0 -0
- data/html/img/button_start_over.gif +0 -0
- data/html/img/button_update.gif +0 -0
- data/html/img/button_update_gray.gif +0 -0
- data/html/img/button_update_over.gif +0 -0
- data/html/img/button_update_s.gif +0 -0
- data/html/img/button_update_s_gray.gif +0 -0
- data/html/img/button_update_s_over.gif +0 -0
- data/html/img/button_yes.gif +0 -0
- data/html/img/button_yes_gray.gif +0 -0
- data/html/img/button_yes_over.gif +0 -0
- data/html/img/circle.gif +0 -0
- data/html/img/control_play.png +0 -0
- data/html/img/control_play_blue.png +0 -0
- data/html/img/delta.gif +0 -0
- data/html/img/dialog_info.jpg +0 -0
- data/html/img/dialog_input.jpg +0 -0
- data/html/img/dialog_warn.jpg +0 -0
- data/html/img/dt-arrow-dn.png +0 -0
- data/html/img/dt-arrow-up.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/img/foot.jpg +0 -0
- data/html/img/goto.gif +0 -0
- data/html/img/goto_o.gif +0 -0
- data/html/img/h3_bt-create_0.gif +0 -0
- data/html/img/h3_bt-create_1.gif +0 -0
- data/html/img/h3_bt-create_2.gif +0 -0
- data/html/img/h3_result_0.gif +0 -0
- data/html/img/h3_result_1.gif +0 -0
- data/html/img/h3_result_2.gif +0 -0
- data/html/img/h3_result_3.gif +0 -0
- data/html/img/h3_result_4.gif +0 -0
- data/html/img/h3_result_5.gif +0 -0
- data/html/img/h3_result_6.gif +0 -0
- data/html/img/h3_rt-setting_0.gif +0 -0
- data/html/img/h3_rt-setting_1.gif +0 -0
- data/html/img/head.jpg +0 -0
- data/html/img/line-numbers.png +0 -0
- data/html/img/line_white.gif +0 -0
- data/html/img/loading.gif +0 -0
- data/html/img/page_white_ruby.png +0 -0
- data/html/img/panel_100_bottom.gif +0 -0
- data/html/img/panel_100_middle.gif +0 -0
- data/html/img/panel_100_top.gif +0 -0
- data/html/img/panel_140_650_b.gif +0 -0
- data/html/img/panel_140_650_m.gif +0 -0
- data/html/img/panel_140_650_t.gif +0 -0
- data/html/img/panel_140_660_b.gif +0 -0
- data/html/img/panel_140_660_m.gif +0 -0
- data/html/img/panel_140_660_t.gif +0 -0
- data/html/img/panel_140_b.gif +0 -0
- data/html/img/panel_140_m.gif +0 -0
- data/html/img/panel_140_t.gif +0 -0
- data/html/img/panel_260_b.gif +0 -0
- data/html/img/panel_260_m.gif +0 -0
- data/html/img/panel_260_t.gif +0 -0
- data/html/img/panel_300_b.gif +0 -0
- data/html/img/panel_300_m.gif +0 -0
- data/html/img/panel_300_t.gif +0 -0
- data/html/img/panel_320_b.gif +0 -0
- data/html/img/panel_320_m.gif +0 -0
- data/html/img/panel_320_t.gif +0 -0
- data/html/img/panel_360_b.gif +0 -0
- data/html/img/panel_360_m.gif +0 -0
- data/html/img/panel_360_t.gif +0 -0
- data/html/img/panel_380_b.gif +0 -0
- data/html/img/panel_380_m.gif +0 -0
- data/html/img/panel_380_t.gif +0 -0
- data/html/img/panel_500_b.gif +0 -0
- data/html/img/panel_500_m.gif +0 -0
- data/html/img/panel_500_t.gif +0 -0
- data/html/img/panel_620_b.gif +0 -0
- data/html/img/panel_620_m.gif +0 -0
- data/html/img/panel_620_t.gif +0 -0
- data/html/img/panel_780_b.gif +0 -0
- data/html/img/panel_780_m.gif +0 -0
- data/html/img/panel_780_t.gif +0 -0
- data/html/img/problem.gif +0 -0
- data/html/img/progressbar.gif +0 -0
- data/html/img/result-title-1-1.gif +0 -0
- data/html/img/result-title-1-2.gif +0 -0
- data/html/img/result-title-2-1.gif +0 -0
- data/html/img/result-title-2-2.gif +0 -0
- data/html/img/result-title-3-1.gif +0 -0
- data/html/img/result-title-4-1.gif +0 -0
- data/html/img/rt-setting-title-1.gif +0 -0
- data/html/img/rt-setting-title-2.gif +0 -0
- data/html/img/s.gif +0 -0
- data/html/img/scroll.gif +0 -0
- data/html/img/separator.gif +0 -0
- data/html/img/sidebar_agent.png +0 -0
- data/html/img/sidebar_agent_edit.png +0 -0
- data/html/img/sidebar_agent_edit_agent.png +0 -0
- data/html/img/sidebar_agent_edit_agent_over.png +0 -0
- data/html/img/sidebar_agent_edit_agent_s.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/sidebar_agent_edit_shared_lib.png +0 -0
- data/html/img/sidebar_agent_edit_shared_lib_over.png +0 -0
- data/html/img/sidebar_agent_edit_shared_lib_s.png +0 -0
- data/html/img/sidebar_back.gif +0 -0
- data/html/img/sidebar_bt.png +0 -0
- data/html/img/sidebar_bt_create.png +0 -0
- data/html/img/sidebar_bt_create_over.png +0 -0
- data/html/img/sidebar_bt_create_s.png +0 -0
- data/html/img/sidebar_bt_result.png +0 -0
- data/html/img/sidebar_bt_result_over.png +0 -0
- data/html/img/sidebar_bt_result_s.png +0 -0
- data/html/img/sidebar_result_rmt.png +0 -0
- data/html/img/sidebar_result_rmt_over.png +0 -0
- data/html/img/sidebar_result_rmt_s.png +0 -0
- data/html/img/sidebar_rt.png +0 -0
- data/html/img/sidebar_rt_setting.png +0 -0
- data/html/img/sidebar_rt_setting_over.png +0 -0
- data/html/img/sidebar_rt_setting_s.png +0 -0
- data/html/img/sprite.png +0 -0
- data/html/img/submenu_agents.png +0 -0
- data/html/img/submenu_agents_over.png +0 -0
- data/html/img/submenu_agents_s.png +0 -0
- data/html/img/submenu_graph.png +0 -0
- data/html/img/submenu_graph_over.png +0 -0
- data/html/img/submenu_graph_s.png +0 -0
- data/html/img/submenu_info.png +0 -0
- data/html/img/submenu_info_over.png +0 -0
- data/html/img/submenu_info_s.png +0 -0
- data/html/img/submenu_log.png +0 -0
- data/html/img/submenu_log_over.png +0 -0
- data/html/img/submenu_log_s.png +0 -0
- data/html/img/submenu_operation.png +0 -0
- data/html/img/submenu_operation_over.png +0 -0
- data/html/img/submenu_operation_s.png +0 -0
- data/html/img/submenu_trade.png +0 -0
- data/html/img/submenu_trade_over.png +0 -0
- data/html/img/submenu_trade_s.png +0 -0
- data/html/img/td_over.gif +0 -0
- data/html/img/td_over_d.gif +0 -0
- data/html/img/td_selected.gif +0 -0
- data/html/img/thead.gif +0 -0
- data/html/img/transparent.gif +0 -0
- data/html/img/yui/treeview-sprite.gif +0 -0
- data/html/index.html +492 -0
- 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 +666 -0
- data/html/js/app.js +198 -0
- data/html/js/bt-create-page.js +205 -0
- data/html/js/container-min.js +1 -0
- data/html/js/container-utils.js +78 -0
- data/html/js/container.js +944 -0
- data/html/js/dialog.js +279 -0
- data/html/js/edit_area/autocompletion.js +491 -0
- data/html/js/edit_area/edit_area.css +546 -0
- data/html/js/edit_area/edit_area.js +539 -0
- data/html/js/edit_area/edit_area_compressor.php +408 -0
- data/html/js/edit_area/edit_area_full.gz +0 -0
- data/html/js/edit_area/edit_area_full.js +38 -0
- data/html/js/edit_area/edit_area_full_with_plugins.gz +0 -0
- data/html/js/edit_area/edit_area_full_with_plugins.js +39 -0
- data/html/js/edit_area/edit_area_functions.js +1205 -0
- data/html/js/edit_area/edit_area_loader.js +1082 -0
- data/html/js/edit_area/elements_functions.js +334 -0
- data/html/js/edit_area/highlight.js +391 -0
- data/html/js/edit_area/images/autocompletion.gif +0 -0
- data/html/js/edit_area/images/close.gif +0 -0
- data/html/js/edit_area/images/fullscreen.gif +0 -0
- data/html/js/edit_area/images/go_to_line.gif +0 -0
- data/html/js/edit_area/images/goto.png +0 -0
- data/html/js/edit_area/images/help.gif +0 -0
- data/html/js/edit_area/images/help.png +0 -0
- data/html/js/edit_area/images/highlight.gif +0 -0
- data/html/js/edit_area/images/load.gif +0 -0
- data/html/js/edit_area/images/move.gif +0 -0
- data/html/js/edit_area/images/newdocument.gif +0 -0
- data/html/js/edit_area/images/opacity.png +0 -0
- data/html/js/edit_area/images/processing.gif +0 -0
- data/html/js/edit_area/images/redo.gif +0 -0
- data/html/js/edit_area/images/redo.png +0 -0
- data/html/js/edit_area/images/reset_highlight.gif +0 -0
- data/html/js/edit_area/images/save.gif +0 -0
- data/html/js/edit_area/images/save.png +0 -0
- data/html/js/edit_area/images/search.gif +0 -0
- data/html/js/edit_area/images/search.png +0 -0
- data/html/js/edit_area/images/smooth_selection.gif +0 -0
- data/html/js/edit_area/images/spacer.gif +0 -0
- data/html/js/edit_area/images/statusbar_resize.gif +0 -0
- data/html/js/edit_area/images/undo.gif +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 +145 -0
- data/html/js/edit_area/langs/bg.js +73 -0
- data/html/js/edit_area/langs/cs.js +67 -0
- data/html/js/edit_area/langs/de.js +67 -0
- data/html/js/edit_area/langs/dk.js +67 -0
- data/html/js/edit_area/langs/en.js +67 -0
- data/html/js/edit_area/langs/eo.js +67 -0
- data/html/js/edit_area/langs/es.js +64 -0
- data/html/js/edit_area/langs/fi.js +67 -0
- data/html/js/edit_area/langs/fr.js +67 -0
- data/html/js/edit_area/langs/hr.js +67 -0
- data/html/js/edit_area/langs/it.js +67 -0
- data/html/js/edit_area/langs/ja.js +67 -0
- data/html/js/edit_area/langs/mk.js +67 -0
- data/html/js/edit_area/langs/nl.js +67 -0
- data/html/js/edit_area/langs/pl.js +67 -0
- data/html/js/edit_area/langs/pt.js +67 -0
- data/html/js/edit_area/langs/ru.js +67 -0
- data/html/js/edit_area/langs/sk.js +67 -0
- data/html/js/edit_area/langs/zh.js +67 -0
- data/html/js/edit_area/license_apache.txt +7 -0
- data/html/js/edit_area/license_bsd.txt +10 -0
- data/html/js/edit_area/license_lgpl.txt +458 -0
- data/html/js/edit_area/manage_area.js +623 -0
- data/html/js/edit_area/plugins/charmap/charmap.js +90 -0
- data/html/js/edit_area/plugins/charmap/css/charmap.css +64 -0
- data/html/js/edit_area/plugins/charmap/images/charmap.gif +0 -0
- data/html/js/edit_area/plugins/charmap/jscripts/map.js +373 -0
- data/html/js/edit_area/plugins/charmap/langs/bg.js +12 -0
- data/html/js/edit_area/plugins/charmap/langs/cs.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/de.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/dk.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/en.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/eo.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/es.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/fr.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/hr.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/it.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/ja.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/mk.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/nl.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/pl.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/pt.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/ru.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/sk.js +6 -0
- data/html/js/edit_area/plugins/charmap/langs/zh.js +6 -0
- data/html/js/edit_area/plugins/charmap/popup.html +24 -0
- data/html/js/edit_area/plugins/test/css/test.css +3 -0
- data/html/js/edit_area/plugins/test/images/Thumbs.db +0 -0
- data/html/js/edit_area/plugins/test/images/test.gif +0 -0
- data/html/js/edit_area/plugins/test/langs/bg.js +10 -0
- data/html/js/edit_area/plugins/test/langs/cs.js +4 -0
- data/html/js/edit_area/plugins/test/langs/de.js +4 -0
- data/html/js/edit_area/plugins/test/langs/dk.js +4 -0
- data/html/js/edit_area/plugins/test/langs/en.js +4 -0
- data/html/js/edit_area/plugins/test/langs/eo.js +4 -0
- data/html/js/edit_area/plugins/test/langs/es.js +4 -0
- data/html/js/edit_area/plugins/test/langs/fr.js +4 -0
- data/html/js/edit_area/plugins/test/langs/hr.js +4 -0
- data/html/js/edit_area/plugins/test/langs/it.js +4 -0
- data/html/js/edit_area/plugins/test/langs/ja.js +4 -0
- data/html/js/edit_area/plugins/test/langs/mk.js +4 -0
- data/html/js/edit_area/plugins/test/langs/nl.js +4 -0
- data/html/js/edit_area/plugins/test/langs/pl.js +4 -0
- data/html/js/edit_area/plugins/test/langs/pt.js +4 -0
- data/html/js/edit_area/plugins/test/langs/ru.js +4 -0
- data/html/js/edit_area/plugins/test/langs/sk.js +4 -0
- data/html/js/edit_area/plugins/test/langs/zh.js +4 -0
- data/html/js/edit_area/plugins/test/test.js +110 -0
- data/html/js/edit_area/plugins/test/test2.js +1 -0
- data/html/js/edit_area/reg_syntax/basic.js +69 -0
- data/html/js/edit_area/reg_syntax/brainfuck.js +44 -0
- data/html/js/edit_area/reg_syntax/c.js +62 -0
- data/html/js/edit_area/reg_syntax/coldfusion.js +119 -0
- data/html/js/edit_area/reg_syntax/cpp.js +65 -0
- data/html/js/edit_area/reg_syntax/css.js +84 -0
- data/html/js/edit_area/reg_syntax/html.js +50 -0
- data/html/js/edit_area/reg_syntax/java.js +56 -0
- data/html/js/edit_area/reg_syntax/js.js +93 -0
- data/html/js/edit_area/reg_syntax/pas.js +82 -0
- data/html/js/edit_area/reg_syntax/perl.js +88 -0
- data/html/js/edit_area/reg_syntax/php.js +156 -0
- data/html/js/edit_area/reg_syntax/python.js +144 -0
- data/html/js/edit_area/reg_syntax/robotstxt.js +24 -0
- data/html/js/edit_area/reg_syntax/ruby.js +67 -0
- data/html/js/edit_area/reg_syntax/sql.js +55 -0
- data/html/js/edit_area/reg_syntax/tsql.js +87 -0
- data/html/js/edit_area/reg_syntax/vb.js +52 -0
- data/html/js/edit_area/reg_syntax/xml.js +56 -0
- data/html/js/edit_area/reg_syntax.js +166 -0
- data/html/js/edit_area/regexp.js +139 -0
- data/html/js/edit_area/resize_area.js +78 -0
- data/html/js/edit_area/search_replace.js +174 -0
- data/html/js/edit_area/template.html +101 -0
- data/html/js/json-broker-client.js +67 -0
- data/html/js/page-manager.js +93 -0
- data/html/js/prototype.js +4184 -0
- data/html/js/result-page.js +775 -0
- data/html/js/rt-setting-page.js +152 -0
- data/html/js/sidebar.js +263 -0
- data/html/js/templates.js +386 -0
- data/html/js/utils.js +890 -0
- data/html/js/uuid.js +103 -0
- 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 +149 -0
- data/lib/jiji/agent/agent_manager.rb +138 -0
- data/lib/jiji/agent/agent_registry.rb +165 -0
- data/lib/jiji/agent/permitter.rb +128 -0
- data/lib/jiji/agent/util.rb +16 -0
- data/lib/jiji/collector.rb +226 -0
- data/lib/jiji/command.rb +204 -0
- data/lib/jiji/configuration.rb +86 -0
- data/lib/jiji/dao/file_system_dao.rb +158 -0
- data/lib/jiji/dao/rate_dao.rb +149 -0
- data/lib/jiji/dao/timed_data_dao.rb +336 -0
- data/lib/jiji/dao/trade_result_dao.rb +128 -0
- data/lib/jiji/error.rb +49 -0
- data/lib/jiji/migration/migrator.rb +50 -0
- data/lib/jiji/migration/migrator1_0_3.rb +26 -0
- data/lib/jiji/migration/migrator1_1_0.rb +46 -0
- data/lib/jiji/migration/migrator1_2_0.rb +67 -0
- data/lib/jiji/models.rb +223 -0
- data/lib/jiji/observer.rb +105 -0
- data/lib/jiji/operator.rb +396 -0
- data/lib/jiji/output.rb +221 -0
- data/lib/jiji/output_manager.rb +84 -0
- data/lib/jiji/plugin/embedded/click_securities_demo_plugin.rb +141 -0
- data/lib/jiji/plugin/embedded/single_click_client.rb +116 -0
- data/lib/jiji/plugin/plugin_loader.rb +53 -0
- data/lib/jiji/plugin/securities_plugin.rb +134 -0
- data/lib/jiji/process.rb +234 -0
- data/lib/jiji/process_manager.rb +290 -0
- data/lib/jiji/registry.rb +349 -0
- data/lib/jiji/server.rb +127 -0
- data/lib/jiji/service/agent_service.rb +230 -0
- data/lib/jiji/service/hello_service.rb +10 -0
- data/lib/jiji/service/output_service.rb +82 -0
- data/lib/jiji/service/process_service.rb +76 -0
- data/lib/jiji/service/rate_service.rb +38 -0
- data/lib/jiji/service/system_service.rb +14 -0
- data/lib/jiji/service/trade_result_service.rb +31 -0
- data/lib/jiji/util/backtester.rb +116 -0
- data/lib/jiji/util/block_to_session.rb +70 -0
- data/lib/jiji/util/cache.rb +79 -0
- data/lib/jiji/util/csv_append_support.rb +15 -0
- data/lib/jiji/util/file_lock.rb +86 -0
- data/lib/jiji/util/fix_yaml_bug.rb +11 -0
- data/lib/jiji/util/include_proxy.rb +17 -0
- data/lib/jiji/util/iterator.rb +70 -0
- data/lib/jiji/util/json_broker.rb +55 -0
- data/lib/jiji/util/json_rpc_requestor.rb +30 -0
- data/lib/jiji/util/rate_data_importer.rb +219 -0
- data/lib/jiji/util/synchronize_interceptor.rb +41 -0
- data/lib/jiji/util/thread_use_generator.rb +52 -0
- data/lib/jiji/util/util.rb +112 -0
- data/lib/jiji_plugin.rb +6 -0
- data/swf/build.xml +23 -0
- data/swf/chart/FxChart-config.xml +9 -0
- data/swf/chart/FxChart.mxml +17 -0
- data/swf/chart/fx/chart/Chart.as +173 -0
- data/swf/chart/fx/chart/ctrl/AutoUpdate.as +96 -0
- data/swf/chart/fx/chart/ctrl/Controller.as +270 -0
- data/swf/chart/fx/chart/ctrl/Event.as +75 -0
- data/swf/chart/fx/chart/model/Model.as +228 -0
- data/swf/chart/fx/chart/model/TimedData.as +40 -0
- data/swf/chart/fx/chart/ui/AbstractChartUI.as +59 -0
- data/swf/chart/fx/chart/ui/AbstractDrawChartUI.as +63 -0
- data/swf/chart/fx/chart/ui/Constants.as +233 -0
- data/swf/chart/fx/chart/ui/InformationWindow.as +228 -0
- data/swf/chart/fx/chart/ui/LayerManager.as +95 -0
- data/swf/chart/fx/chart/ui/Loading.as +32 -0
- data/swf/chart/fx/chart/ui/Pointer.as +61 -0
- data/swf/chart/fx/chart/ui/RangeInfoWindow.as +84 -0
- data/swf/chart/fx/chart/ui/RenderingContext.as +54 -0
- data/swf/chart/fx/chart/ui/ScaleSelector.as +84 -0
- data/swf/chart/fx/chart/ui/Scroll.as +241 -0
- data/swf/chart/fx/chart/ui/ScrollBar.as +378 -0
- data/swf/chart/fx/chart/ui/Stage.as +97 -0
- data/swf/chart/fx/chart/ui/TradeDetailWindow.as +147 -0
- data/swf/chart/fx/chart/ui/TradeResult.as +330 -0
- data/swf/chart/fx/chart/ui/Window.as +96 -0
- data/swf/chart/fx/chart/ui/candle/Axis.as +112 -0
- data/swf/chart/fx/chart/ui/candle/Candle.as +79 -0
- data/swf/chart/fx/chart/ui/candle/CandleChart.as +81 -0
- data/swf/chart/fx/chart/ui/graph/Graph.as +200 -0
- data/swf/chart/fx/chart/ui/graph/GraphManager.as +192 -0
- data/swf/chart/fx/chart/ui/resource/buy.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/cursor_hand.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/diff_label.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_buy.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_buy_1.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_buy_2.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_buy_3.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_sell.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_sell_1.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_sell_2.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/down_sell_3.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/draw_buy.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/draw_sell.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/end_label.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/fixed.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/loading.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/max_label.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/min_label.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_a.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_handle.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_handle_a.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_handle_o.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_left.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_left_a.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_left_o.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_o.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_right.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_right_a.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_bar_right_o.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_handle.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_info_handle.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_left_button.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_left_button_d.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_left_button_down.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_left_button_g.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_left_button_o.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_left_button_up.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_outer.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_outer_left.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_outer_right.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_right_button.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_right_button_d.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_right_button_down.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_right_button_g.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_right_button_o.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_right_button_up.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_slider_left.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/scroll_slider_right.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/sell.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/start_label.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/stripe.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/stripe_b.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/stripe_r.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/unfixed.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_buy.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_buy_1.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_buy_2.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_buy_3.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_sell.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_sell_1.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_sell_2.gif +0 -0
- data/swf/chart/fx/chart/ui/resource/up_sell_3.gif +0 -0
- data/swf/chart/fx/net/StubFactory.as +113 -0
- data/swf/chart/fx/util/ListenerSupport.as +55 -0
- data/swf/chart/fx/util/PositionManager.as +95 -0
- data/swf/chart/fx/util/ScaleFormatter.as +156 -0
- data/swf/chart/fx/util/Util.as +61 -0
- data/swf/chart/log.as +40 -0
- data/swf/lib/corelib.swc +0 -0
- data/test/BackCollectorTest/basic/2008-08-04/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-04/USDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-04/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-05/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-05/USDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-05/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-06/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-06/USDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-06/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-07/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-07/USDJPY.csv +5 -0
- data/test/BackCollectorTest/basic/2008-08-07/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/basic/AUDJPY/raw/2008-08-04.csv +5 -0
- data/test/BackCollectorTest/basic/AUDJPY/raw/2008-08-05.csv +5 -0
- data/test/BackCollectorTest/basic/AUDJPY/raw/2008-08-06.csv +5 -0
- data/test/BackCollectorTest/basic/AUDJPY/raw/2008-08-07.csv +5 -0
- data/test/BackCollectorTest/basic/USDJPY/raw/2008-08-04.csv +5 -0
- data/test/BackCollectorTest/basic/USDJPY/raw/2008-08-05.csv +5 -0
- data/test/BackCollectorTest/basic/USDJPY/raw/2008-08-06.csv +5 -0
- data/test/BackCollectorTest/basic/USDJPY/raw/2008-08-07.csv +5 -0
- data/test/BackCollectorTest/basic/ZARJPY/raw/2008-08-04.csv +5 -0
- data/test/BackCollectorTest/basic/ZARJPY/raw/2008-08-05.csv +5 -0
- data/test/BackCollectorTest/basic/ZARJPY/raw/2008-08-06.csv +5 -0
- data/test/BackCollectorTest/basic/ZARJPY/raw/2008-08-07.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-04/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-04/USDJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-04/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-06/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-06/USDJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-06/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-07/AUDJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-07/USDJPY.csv +5 -0
- data/test/BackCollectorTest/lack/2008-08-07/ZARJPY.csv +5 -0
- data/test/BackCollectorTest/lack/AUDJPY/raw/2008-08-04.csv +5 -0
- data/test/BackCollectorTest/lack/AUDJPY/raw/2008-08-06.csv +5 -0
- data/test/BackCollectorTest/lack/AUDJPY/raw/2008-08-07.csv +5 -0
- data/test/BackCollectorTest/lack/USDJPY/raw/2008-08-04.csv +5 -0
- data/test/BackCollectorTest/lack/USDJPY/raw/2008-08-06.csv +5 -0
- data/test/BackCollectorTest/lack/USDJPY/raw/2008-08-07.csv +5 -0
- data/test/BackCollectorTest/lack/ZARJPY/raw/2008-08-04.csv +5 -0
- data/test/BackCollectorTest/lack/ZARJPY/raw/2008-08-06.csv +5 -0
- data/test/BackCollectorTest/lack/ZARJPY/raw/2008-08-07.csv +5 -0
- data/test/OutputregistryTest/conf/configuration.yaml +3 -0
- data/test/ProcessManagerTest/agents/moving_average.rb +95 -0
- data/test/ProcessManagerTest/conf/configuration.yaml +6 -0
- data/test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-21.csv +5853 -0
- data/test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-22.csv +5821 -0
- data/test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-23.csv +5921 -0
- data/test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-24.csv +5956 -0
- data/test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-25.csv +5796 -0
- data/test/ProcessManagerTest/rate_datas/USDJPY/raw/2008-08-21.csv +5853 -0
- data/test/ProcessManagerTest/rate_datas/USDJPY/raw/2008-08-22.csv +5821 -0
- data/test/ProcessManagerTest/rate_datas/USDJPY/raw/2008-08-23.csv +5921 -0
- data/test/ProcessManagerTest/rate_datas/USDJPY/raw/2008-08-24.csv +5956 -0
- data/test/ProcessManagerTest/rate_datas/USDJPY/raw/2008-08-25.csv +5796 -0
- 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 +321 -0
- data/test/agent/test_AgentRegistry.rb +662 -0
- data/test/agent/test_PeriodicallyAgent.rb +180 -0
- data/test/agent/test_Permitter.rb +217 -0
- data/test/all_tests.rb +24 -0
- data/test/dao/dao_tests.rb +9 -0
- data/test/dao/test_FileSystemDao.rb +431 -0
- data/test/dao/test_RateDao.rb +695 -0
- data/test/dao/test_TradeResultDao.rb +487 -0
- data/test/jiji_plugin.rb +7 -0
- data/test/migration/migration_tests.rb +10 -0
- data/test/migration/migrator1_0_3test_data/rmt/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75YuV5bmz5Z2H57ea/meta.yaml +12 -0
- data/test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75Yuasdwqdd/meta.yaml +12 -0
- data/test/migration/migrator1_1_0test_data/configuration.yaml +11 -0
- data/test/migration/migrator1_2_0test_data/basic/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/1d/2009-04.csv +8 -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/1d/2009-07.csv +1 -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/1d/2009-07.csv +1 -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/1d/2009-04.csv +10 -0
- data/test/migration/migrator1_2_0test_data/basic/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-05.csv +20 -0
- data/test/migration/migrator1_2_0test_data/basic/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-06.csv +20 -0
- data/test/migration/migrator1_2_0test_data/basic/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-07.csv +18 -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/1d/2009-04.csv +8 -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/1d/2009-07.csv +1 -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/1d/2009-07.csv +1 -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/1d/2009-04.csv +10 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-05.csv +20 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-06.csv +20 -0
- data/test/migration/migrator1_2_0test_data/illegal_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-07.csv +18 -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/1d/2009-04.csv +8 -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/1d/2009-07.csv +1 -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/1d/2009-07.csv +1 -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/1d/2009-04.csv +10 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-05.csv +20 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-06.csv +20 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/1d/2009-07.csv +18 -0
- data/test/migration/migrator1_2_0test_data/no_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
- data/test/migration/test_Migrator.rb +117 -0
- data/test/migration/test_Migrator1_0_3.rb +118 -0
- data/test/migration/test_Migrator1_1_0.rb +56 -0
- data/test/migration/test_Migrator1_2_0.rb +94 -0
- data/test/plugin/embedded/test_SingleClickClient.rb +144 -0
- data/test/plugin/error_test/jiji_plugin.rb +2 -0
- data/test/plugin/plugin_tests.rb +8 -0
- data/test/plugin/test/foo_plugin.rb +1 -0
- data/test/plugin/test/jiji_plugin.rb +2 -0
- data/test/plugin/test_Loader.rb +33 -0
- data/test/plugin/test_gem/a/jiji_plugin_test_gem_a-1.0.0.gem +0 -0
- data/test/plugin/test_gem/a/jiji_plugin_test_gem_a.gemspec +10 -0
- data/test/plugin/test_gem/a/lib/jiji_plugin.rb +2 -0
- data/test/plugin/test_gem/a/lib/jiji_plugin_test.rb +6 -0
- data/test/plugin/test_gem/b/jiji_plugin_test_gem_b-1.0.0.gem +0 -0
- data/test/plugin/test_gem/b/jiji_plugin_test_gem_b.gemspec +9 -0
- data/test/plugin/test_gem/b/lib/jiji_plugin.rb +2 -0
- data/test/service/all_service_tests.rb +10 -0
- data/test/service/test_AgentService.rb +185 -0
- data/test/service/test_OutputService.rb +33 -0
- data/test/service/test_RateService.rb +56 -0
- 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_BackTestCollector.rb +273 -0
- data/test/test_Collector.rb +230 -0
- data/test/test_Configuration.rb +61 -0
- data/test/test_Configuration_a.yaml +6 -0
- data/test/test_Operator.rb +501 -0
- data/test/test_Output.rb +175 -0
- data/test/test_OutputManager.rb +162 -0
- data/test/test_Output_registry.rb +42 -0
- data/test/test_Process.rb +557 -0
- data/test/test_ProcessManager.rb +723 -0
- data/test/test_utils.rb +112 -0
- data/test/util/test_BlockToSession.rb +121 -0
- data/test/util/test_CSV.rb +84 -0
- data/test/util/test_SynchronizeInterceptor.rb +76 -0
- data/test/util/util_tests.rb +9 -0
- metadata +941 -0
@@ -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,"&").replace(/</g,"<").replace(/>/g,">").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,"&").replace(/</g,"<")+"</span><span id='endTestFont'>"+lineContent.substr(cur_pos).replace(/&/g,"&").replace(/</g,"<")+"</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,"&").replace(/</g,"<");
|
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
|
+
};
|