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,1082 @@
|
|
1
|
+
/******
|
2
|
+
*
|
3
|
+
* EditArea
|
4
|
+
* Developped by Christophe Dolivet
|
5
|
+
* Released under LGPL, Apache and BSD licenses (use the one you want)
|
6
|
+
*
|
7
|
+
******/
|
8
|
+
|
9
|
+
function EditAreaLoader(){
|
10
|
+
var t=this;
|
11
|
+
t.version= "0.8.1.1";
|
12
|
+
date= new Date();
|
13
|
+
t.start_time=date.getTime();
|
14
|
+
t.win= "loading"; // window loading state
|
15
|
+
t.error= false; // to know if load is interrrupt
|
16
|
+
t.baseURL="";
|
17
|
+
//t.suffix="";
|
18
|
+
t.template="";
|
19
|
+
t.lang= {}; // array of loaded speech language
|
20
|
+
t.load_syntax= {}; // array of loaded syntax language for highlight mode
|
21
|
+
t.syntax= {}; // array of initilized syntax language for highlight mode
|
22
|
+
t.loadedFiles= [];
|
23
|
+
t.waiting_loading= {}; // files that must be loaded in order to allow the script to really start
|
24
|
+
// scripts that must be loaded in the iframe
|
25
|
+
t.scripts_to_load= ["elements_functions", "resize_area", "reg_syntax"];
|
26
|
+
t.sub_scripts_to_load= ["edit_area", "manage_area" ,"edit_area_functions", "keyboard", "search_replace", "highlight", "regexp"];
|
27
|
+
|
28
|
+
t.resize= []; // contain resizing datas
|
29
|
+
t.hidden= {}; // store datas of the hidden textareas
|
30
|
+
|
31
|
+
t.default_settings= {
|
32
|
+
//id: "src" // id of the textarea to transform
|
33
|
+
debug: false
|
34
|
+
,smooth_selection: true
|
35
|
+
,font_size: "10" // not for IE
|
36
|
+
,font_family: "monospace" // can be "verdana,monospace". Allow non monospace font but Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account...
|
37
|
+
,start_highlight: false // if start with highlight
|
38
|
+
,toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
|
39
|
+
,begin_toolbar: "" // "new_document, save, load, |"
|
40
|
+
,end_toolbar: "" // or end_toolbar
|
41
|
+
,is_multi_files: false // enable the multi file mode (the textarea content is ignored)
|
42
|
+
,allow_resize: "both" // possible values: "no", "both", "x", "y"
|
43
|
+
,show_line_colors: false // if the highlight is disabled for the line currently beeing edited (if enabled => heavy CPU use)
|
44
|
+
,min_width: 400
|
45
|
+
,min_height: 125
|
46
|
+
,replace_tab_by_spaces: false
|
47
|
+
,allow_toggle: true // true or false
|
48
|
+
,language: "en"
|
49
|
+
,syntax: ""
|
50
|
+
,syntax_selection_allow: "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
|
51
|
+
,display: "onload" // onload or later
|
52
|
+
,max_undo: 30
|
53
|
+
,browsers: "known" // all or known
|
54
|
+
,plugins: "" // comma separated plugin list
|
55
|
+
,gecko_spellcheck: false // enable/disable by default the gecko_spellcheck
|
56
|
+
,fullscreen: false
|
57
|
+
,is_editable: true
|
58
|
+
,cursor_position: "begin"
|
59
|
+
,word_wrap: false // define if the text is wrapped of not in the textarea
|
60
|
+
,autocompletion: false // NOT IMPLEMENTED
|
61
|
+
,load_callback: "" // click on load button (function name)
|
62
|
+
,save_callback: "" // click on save button (function name)
|
63
|
+
,change_callback: "" // textarea onchange trigger (function name)
|
64
|
+
,submit_callback: "" // form submited (function name)
|
65
|
+
,EA_init_callback: "" // EditArea initiliazed (function name)
|
66
|
+
,EA_delete_callback: "" // EditArea deleted (function name)
|
67
|
+
,EA_load_callback: "" // EditArea fully loaded and displayed (function name)
|
68
|
+
,EA_unload_callback: "" // EditArea delete while being displayed (function name)
|
69
|
+
,EA_toggle_on_callback: "" // EditArea toggled on (function name)
|
70
|
+
,EA_toggle_off_callback: "" // EditArea toggled off (function name)
|
71
|
+
,EA_file_switch_on_callback: "" // a new tab is selected (called for the newly selected file)
|
72
|
+
,EA_file_switch_off_callback: "" // a new tab is selected (called for the previously selected file)
|
73
|
+
,EA_file_close_callback: "" // close a tab
|
74
|
+
};
|
75
|
+
|
76
|
+
t.advanced_buttons = [
|
77
|
+
// id, button img, command (it will try to find the translation of "id"), is_file_specific
|
78
|
+
['new_document', 'newdocument.gif', 'new_document', false],
|
79
|
+
['search', 'search.png', 'show_search', false],
|
80
|
+
['go_to_line', 'goto.png', 'go_to_line', false],
|
81
|
+
['undo', 'undo.png', 'undo', true],
|
82
|
+
['redo', 'redo.png', 'redo', true],
|
83
|
+
['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode', true],
|
84
|
+
['reset_highlight', 'reset_highlight.gif', 'resync_highlight', true],
|
85
|
+
['highlight', 'highlight.gif','change_highlight', true],
|
86
|
+
['help', 'help.png', 'show_help', false],
|
87
|
+
['save', 'save.png', 'save', false],
|
88
|
+
['load', 'load.gif', 'load', false],
|
89
|
+
['fullscreen', 'fullscreen.gif', 'toggle_full_screen', false],
|
90
|
+
['word_wrap', 'word_wrap.gif', 'toggle_word_wrap', true],
|
91
|
+
['autocompletion', 'autocompletion.gif', 'toggle_autocompletion', true]
|
92
|
+
];
|
93
|
+
|
94
|
+
// navigator identification
|
95
|
+
t.set_browser_infos(t);
|
96
|
+
|
97
|
+
if(t.isIE>=6 || t.isGecko || ( t.isWebKit && !t.isSafari<3 ) || t.isOpera>=9 || t.isCamino )
|
98
|
+
t.isValidBrowser=true;
|
99
|
+
else
|
100
|
+
t.isValidBrowser=false;
|
101
|
+
|
102
|
+
t.set_base_url();
|
103
|
+
|
104
|
+
for(var i=0; i<t.scripts_to_load.length; i++){
|
105
|
+
setTimeout("editAreaLoader.load_script('"+t.baseURL + t.scripts_to_load[i]+ ".js');", 1); // let the time to Object editAreaLoader to be created before loading additionnal scripts
|
106
|
+
t.waiting_loading[t.scripts_to_load[i]+ ".js"]= false;
|
107
|
+
}
|
108
|
+
t.add_event(window, "load", EditAreaLoader.prototype.window_loaded);
|
109
|
+
};
|
110
|
+
|
111
|
+
EditAreaLoader.prototype ={
|
112
|
+
has_error : function(){
|
113
|
+
this.error= true;
|
114
|
+
// set to empty all EditAreaLoader functions
|
115
|
+
for(var i in EditAreaLoader.prototype){
|
116
|
+
EditAreaLoader.prototype[i]=function(){};
|
117
|
+
}
|
118
|
+
},
|
119
|
+
|
120
|
+
// add browser informations to the object passed in parameter
|
121
|
+
set_browser_infos : function(o){
|
122
|
+
ua= navigator.userAgent;
|
123
|
+
|
124
|
+
// general detection
|
125
|
+
o.isWebKit = /WebKit/.test(ua);
|
126
|
+
o.isGecko = !o.isWebKit && /Gecko/.test(ua);
|
127
|
+
o.isMac = /Mac/.test(ua);
|
128
|
+
|
129
|
+
o.isIE = (navigator.appName == "Microsoft Internet Explorer");
|
130
|
+
if(o.isIE){
|
131
|
+
o.isIE = ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/, "$1");
|
132
|
+
if(o.isIE<6)
|
133
|
+
o.has_error();
|
134
|
+
}
|
135
|
+
|
136
|
+
if(o.isOpera = (ua.indexOf('Opera') != -1)){
|
137
|
+
o.isOpera= ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i, "$1");
|
138
|
+
if(o.isOpera<9)
|
139
|
+
o.has_error();
|
140
|
+
o.isIE=false;
|
141
|
+
}
|
142
|
+
|
143
|
+
if(o.isFirefox =(ua.indexOf('Firefox') != -1))
|
144
|
+
o.isFirefox = ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i, "$1");
|
145
|
+
// Firefox clones
|
146
|
+
if( ua.indexOf('Iceweasel') != -1 )
|
147
|
+
o.isFirefox = ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i, "$1");
|
148
|
+
if( ua.indexOf('GranParadiso') != -1 )
|
149
|
+
o.isFirefox = ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i, "$1");
|
150
|
+
if( ua.indexOf('BonEcho') != -1 )
|
151
|
+
o.isFirefox = ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i, "$1");
|
152
|
+
if( ua.indexOf('SeaMonkey') != -1)
|
153
|
+
o.isFirefox = (ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i, "$1") ) + 1;
|
154
|
+
|
155
|
+
if(o.isCamino =(ua.indexOf('Camino') != -1))
|
156
|
+
o.isCamino = ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i, "$1");
|
157
|
+
|
158
|
+
if(o.isSafari =(ua.indexOf('Safari') != -1))
|
159
|
+
o.isSafari= ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i, "$1");
|
160
|
+
|
161
|
+
if(o.isChrome =(ua.indexOf('Chrome') != -1)) {
|
162
|
+
o.isChrome = ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i, "$1");
|
163
|
+
o.isSafari = false;
|
164
|
+
}
|
165
|
+
|
166
|
+
},
|
167
|
+
|
168
|
+
window_loaded : function(){
|
169
|
+
editAreaLoader.win="loaded";
|
170
|
+
|
171
|
+
// add events on forms
|
172
|
+
if (document.forms) {
|
173
|
+
for (var i=0; i<document.forms.length; i++) {
|
174
|
+
var form = document.forms[i];
|
175
|
+
form.edit_area_replaced_submit=null;
|
176
|
+
try {
|
177
|
+
|
178
|
+
form.edit_area_replaced_submit = form.onsubmit;
|
179
|
+
form.onsubmit="";
|
180
|
+
} catch (e) {// Do nothing
|
181
|
+
}
|
182
|
+
editAreaLoader.add_event(form, "submit", EditAreaLoader.prototype.submit);
|
183
|
+
editAreaLoader.add_event(form, "reset", EditAreaLoader.prototype.reset);
|
184
|
+
}
|
185
|
+
}
|
186
|
+
editAreaLoader.add_event(window, "unload", function(){for(var i in editAreas){editAreaLoader.delete_instance(i);}}); // ini callback
|
187
|
+
},
|
188
|
+
|
189
|
+
// init the checkup of the selection of the IE textarea
|
190
|
+
init_ie_textarea : function(id){
|
191
|
+
var a=document.getElementById(id);
|
192
|
+
try{
|
193
|
+
if(a && typeof(a.focused)=="undefined"){
|
194
|
+
a.focus();
|
195
|
+
a.focused=true;
|
196
|
+
a.selectionStart= a.selectionEnd= 0;
|
197
|
+
get_IE_selection(a);
|
198
|
+
editAreaLoader.add_event(a, "focus", IE_textarea_focus);
|
199
|
+
editAreaLoader.add_event(a, "blur", IE_textarea_blur);
|
200
|
+
|
201
|
+
}
|
202
|
+
}catch(ex){}
|
203
|
+
},
|
204
|
+
|
205
|
+
init : function(settings){
|
206
|
+
var t=this,s=settings,i;
|
207
|
+
|
208
|
+
if(!s["id"])
|
209
|
+
t.has_error();
|
210
|
+
if(t.error)
|
211
|
+
return;
|
212
|
+
// if an instance of the editor already exists for this textarea => delete the previous one
|
213
|
+
if(editAreas[s["id"]])
|
214
|
+
t.delete_instance(s["id"]);
|
215
|
+
|
216
|
+
// init settings
|
217
|
+
for(i in t.default_settings){
|
218
|
+
if(typeof(s[i])=="undefined")
|
219
|
+
s[i]=t.default_settings[i];
|
220
|
+
}
|
221
|
+
|
222
|
+
if(s["browsers"]=="known" && t.isValidBrowser==false){
|
223
|
+
return;
|
224
|
+
}
|
225
|
+
|
226
|
+
if(s["begin_toolbar"].length>0)
|
227
|
+
s["toolbar"]= s["begin_toolbar"] +","+ s["toolbar"];
|
228
|
+
if(s["end_toolbar"].length>0)
|
229
|
+
s["toolbar"]= s["toolbar"] +","+ s["end_toolbar"];
|
230
|
+
s["tab_toolbar"]= s["toolbar"].replace(/ /g,"").split(",");
|
231
|
+
|
232
|
+
s["plugins"]= s["plugins"].replace(/ /g,"").split(",");
|
233
|
+
for(i=0; i<s["plugins"].length; i++){
|
234
|
+
if(s["plugins"][i].length==0)
|
235
|
+
s["plugins"].splice(i,1);
|
236
|
+
}
|
237
|
+
// alert(settings["plugins"].length+": "+ settings["plugins"].join(","));
|
238
|
+
t.get_template();
|
239
|
+
t.load_script(t.baseURL + "langs/"+ s["language"] + ".js");
|
240
|
+
|
241
|
+
if(s["syntax"].length>0){
|
242
|
+
s["syntax"]=s["syntax"].toLowerCase();
|
243
|
+
t.load_script(t.baseURL + "reg_syntax/"+ s["syntax"] + ".js");
|
244
|
+
}
|
245
|
+
//alert(this.template);
|
246
|
+
|
247
|
+
editAreas[s["id"]]= {"settings": s};
|
248
|
+
editAreas[s["id"]]["displayed"]=false;
|
249
|
+
editAreas[s["id"]]["hidden"]=false;
|
250
|
+
|
251
|
+
//if(settings["display"]=="onload")
|
252
|
+
t.start(s["id"]);
|
253
|
+
},
|
254
|
+
|
255
|
+
// delete an instance of an EditArea
|
256
|
+
delete_instance : function(id){
|
257
|
+
var d=document,fs=window.frames,span,iframe;
|
258
|
+
editAreaLoader.execCommand(id, "EA_delete");
|
259
|
+
if(fs["frame_"+id] && fs["frame_"+id].editArea)
|
260
|
+
{
|
261
|
+
if(editAreas[id]["displayed"])
|
262
|
+
editAreaLoader.toggle(id, "off");
|
263
|
+
fs["frame_"+id].editArea.execCommand("EA_unload");
|
264
|
+
}
|
265
|
+
|
266
|
+
// remove toggle infos and debug textarea
|
267
|
+
span= d.getElementById("EditAreaArroundInfos_"+id);
|
268
|
+
if(span)
|
269
|
+
span.parentNode.removeChild(span);
|
270
|
+
|
271
|
+
// remove the iframe
|
272
|
+
iframe= d.getElementById("frame_"+id);
|
273
|
+
if(iframe){
|
274
|
+
iframe.parentNode.removeChild(iframe);
|
275
|
+
//delete iframe;
|
276
|
+
try {
|
277
|
+
delete fs["frame_"+id];
|
278
|
+
} catch (e) {// Do nothing
|
279
|
+
}
|
280
|
+
}
|
281
|
+
|
282
|
+
delete editAreas[id];
|
283
|
+
},
|
284
|
+
|
285
|
+
|
286
|
+
start : function(id){
|
287
|
+
var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;
|
288
|
+
|
289
|
+
// check that the window is loaded
|
290
|
+
if(t.win!="loaded"){
|
291
|
+
setTimeout("editAreaLoader.start('"+id+"');", 50);
|
292
|
+
return;
|
293
|
+
}
|
294
|
+
|
295
|
+
// check that all needed scripts are loaded
|
296
|
+
for( i in t.waiting_loading){
|
297
|
+
if(t.waiting_loading[i]!="loaded" && typeof(t.waiting_loading[i])!="function"){
|
298
|
+
setTimeout("editAreaLoader.start('"+id+"');", 50);
|
299
|
+
return;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
// wait until language and syntax files are loaded
|
304
|
+
if(!t.lang[editAreas[id]["settings"]["language"]] || (editAreas[id]["settings"]["syntax"].length>0 && !t.load_syntax[editAreas[id]["settings"]["syntax"]]) ){
|
305
|
+
setTimeout("editAreaLoader.start('"+id+"');", 50);
|
306
|
+
return;
|
307
|
+
}
|
308
|
+
// init the regexp for syntax highlight
|
309
|
+
if(editAreas[id]["settings"]["syntax"].length>0)
|
310
|
+
t.init_syntax_regexp();
|
311
|
+
|
312
|
+
|
313
|
+
// display toggle option and debug area
|
314
|
+
if(!d.getElementById("EditAreaArroundInfos_"+id) && (editAreas[id]["settings"]["debug"] || editAreas[id]["settings"]["allow_toggle"]))
|
315
|
+
{
|
316
|
+
span= d.createElement("span");
|
317
|
+
span.id= "EditAreaArroundInfos_"+id;
|
318
|
+
if(editAreas[id]["settings"]["allow_toggle"]){
|
319
|
+
checked=(editAreas[id]["settings"]["display"]=="onload")?"checked='checked'":"";
|
320
|
+
html+="<div id='edit_area_toggle_"+i+"'>";
|
321
|
+
html+="<input id='edit_area_toggle_checkbox_"+ id +"' class='toggle_"+ id +"' type='checkbox' onclick='editAreaLoader.toggle(\""+ id +"\");' accesskey='e' "+checked+" />";
|
322
|
+
html+="<label for='edit_area_toggle_checkbox_"+ id +"'>{$toggle}</label></div>";
|
323
|
+
}
|
324
|
+
if(editAreas[id]["settings"]["debug"])
|
325
|
+
html+="<textarea id='edit_area_debug_"+ id +"' spellcheck='off' style='z-index: 20; width: 100%; height: 120px;overflow: auto; border: solid black 1px;'></textarea><br />";
|
326
|
+
html= t.translate(html, editAreas[id]["settings"]["language"]);
|
327
|
+
span.innerHTML= html;
|
328
|
+
father= d.getElementById(id).parentNode;
|
329
|
+
next= d.getElementById(id).nextSibling;
|
330
|
+
if(next==null)
|
331
|
+
father.appendChild(span);
|
332
|
+
else
|
333
|
+
father.insertBefore(span, next);
|
334
|
+
}
|
335
|
+
|
336
|
+
if(!editAreas[id]["initialized"])
|
337
|
+
{
|
338
|
+
t.execCommand(id, "EA_init"); // ini callback
|
339
|
+
if(editAreas[id]["settings"]["display"]=="later"){
|
340
|
+
editAreas[id]["initialized"]= true;
|
341
|
+
return;
|
342
|
+
}
|
343
|
+
}
|
344
|
+
|
345
|
+
if(t.isIE){ // launch IE selection checkup
|
346
|
+
t.init_ie_textarea(id);
|
347
|
+
}
|
348
|
+
|
349
|
+
// get toolbar content
|
350
|
+
area=editAreas[id];
|
351
|
+
|
352
|
+
for(i=0; i<area["settings"]["tab_toolbar"].length; i++){
|
353
|
+
// alert(this.tab_toolbar[i]+"\n"+ this.get_control_html(this.tab_toolbar[i]));
|
354
|
+
html_toolbar_content+= t.get_control_html(area["settings"]["tab_toolbar"][i], area["settings"]["language"]);
|
355
|
+
}
|
356
|
+
// translate toolbar text here for chrome 2
|
357
|
+
html_toolbar_content = t.translate(html_toolbar_content, area["settings"]["language"], "template");
|
358
|
+
|
359
|
+
|
360
|
+
// create javascript import rules for the iframe if the javascript has not been already loaded by the compressor
|
361
|
+
if(!t.iframe_script){
|
362
|
+
t.iframe_script="";
|
363
|
+
for(i=0; i<t.sub_scripts_to_load.length; i++)
|
364
|
+
t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + t.sub_scripts_to_load[i] +'.js"></script>';
|
365
|
+
}
|
366
|
+
|
367
|
+
// add plugins scripts if not already loaded by the compressor (but need to load language in all the case)
|
368
|
+
for(i=0; i<area["settings"]["plugins"].length; i++){
|
369
|
+
//if(typeof(area["settings"]["plugins"][i])=="function") continue;
|
370
|
+
if(!t.all_plugins_loaded)
|
371
|
+
t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/' + area["settings"]["plugins"][i] +'.js"></script>';
|
372
|
+
t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/langs/' + area["settings"]["language"] +'.js"></script>';
|
373
|
+
}
|
374
|
+
|
375
|
+
|
376
|
+
// create css link for the iframe if the whole css text has not been already loaded by the compressor
|
377
|
+
if(!t.iframe_css){
|
378
|
+
t.iframe_css="<link href='"+ t.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";
|
379
|
+
}
|
380
|
+
|
381
|
+
|
382
|
+
// create template
|
383
|
+
template= t.template.replace(/\[__BASEURL__\]/g, t.baseURL);
|
384
|
+
template= template.replace("[__TOOLBAR__]",html_toolbar_content);
|
385
|
+
|
386
|
+
|
387
|
+
// fill template with good language sentences
|
388
|
+
template= t.translate(template, area["settings"]["language"], "template");
|
389
|
+
|
390
|
+
// add css_code
|
391
|
+
template= template.replace("[__CSSRULES__]", t.iframe_css);
|
392
|
+
// add js_code
|
393
|
+
template= template.replace("[__JSCODE__]", t.iframe_script);
|
394
|
+
|
395
|
+
// add version_code
|
396
|
+
template= template.replace("[__EA_VERSION__]", t.version);
|
397
|
+
//template=template.replace(/\{\$([^\}]+)\}/gm, this.traduc_template);
|
398
|
+
|
399
|
+
//editAreas[area["settings"]["id"]]["template"]= template;
|
400
|
+
|
401
|
+
area.textarea=d.getElementById(area["settings"]["id"]);
|
402
|
+
editAreas[area["settings"]["id"]]["textarea"]=area.textarea;
|
403
|
+
|
404
|
+
// if removing previous instances from DOM before (fix from Marcin)
|
405
|
+
if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')
|
406
|
+
delete window.frames["frame_"+area["settings"]["id"]];
|
407
|
+
|
408
|
+
// insert template in the document after the textarea
|
409
|
+
father= area.textarea.parentNode;
|
410
|
+
/* var container= document.createElement("div");
|
411
|
+
container.id= "EditArea_frame_container_"+area["settings"]["id"];
|
412
|
+
*/
|
413
|
+
content= d.createElement("iframe");
|
414
|
+
content.name= "frame_"+area["settings"]["id"];
|
415
|
+
content.id= "frame_"+area["settings"]["id"];
|
416
|
+
content.style.borderWidth= "0px";
|
417
|
+
setAttribute(content, "frameBorder", "0"); // IE
|
418
|
+
content.style.overflow="hidden";
|
419
|
+
content.style.display="none";
|
420
|
+
|
421
|
+
|
422
|
+
next= area.textarea.nextSibling;
|
423
|
+
if(next==null)
|
424
|
+
father.appendChild(content);
|
425
|
+
else
|
426
|
+
father.insertBefore(content, next) ;
|
427
|
+
f=window.frames["frame_"+area["settings"]["id"]];
|
428
|
+
f.document.open();
|
429
|
+
f.editAreas=editAreas;
|
430
|
+
f.area_id= area["settings"]["id"];
|
431
|
+
f.document.area_id= area["settings"]["id"];
|
432
|
+
f.document.write(template);
|
433
|
+
f.document.close();
|
434
|
+
|
435
|
+
// frame.editAreaLoader=this;
|
436
|
+
//editAreas[area["settings"]["id"]]["displayed"]=true;
|
437
|
+
|
438
|
+
},
|
439
|
+
|
440
|
+
toggle : function(id, toggle_to){
|
441
|
+
|
442
|
+
/* if((editAreas[id]["displayed"]==true && toggle_to!="on") || toggle_to=="off"){
|
443
|
+
this.toggle_off(id);
|
444
|
+
}else if((editAreas[id]["displayed"]==false && toggle_to!="off") || toggle_to=="on"){
|
445
|
+
this.toggle_on(id);
|
446
|
+
}*/
|
447
|
+
if(!toggle_to)
|
448
|
+
toggle_to= (editAreas[id]["displayed"]==true)?"off":"on";
|
449
|
+
if(editAreas[id]["displayed"]==true && toggle_to=="off"){
|
450
|
+
this.toggle_off(id);
|
451
|
+
}else if(editAreas[id]["displayed"]==false && toggle_to=="on"){
|
452
|
+
this.toggle_on(id);
|
453
|
+
}
|
454
|
+
|
455
|
+
return false;
|
456
|
+
},
|
457
|
+
|
458
|
+
// static function
|
459
|
+
toggle_off : function(id){
|
460
|
+
var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;
|
461
|
+
if(fs["frame_"+id])
|
462
|
+
{
|
463
|
+
f = fs["frame_"+id];
|
464
|
+
t = editAreas[id]["textarea"];
|
465
|
+
if(f.editArea.fullscreen['isFull'])
|
466
|
+
f.editArea.toggle_full_screen(false);
|
467
|
+
editAreas[id]["displayed"]=false;
|
468
|
+
|
469
|
+
// set wrap to off to keep same display mode (some browser get problem with this, so it need more complex operation
|
470
|
+
t.wrap = "off"; // for IE
|
471
|
+
setAttribute(t, "wrap", "off"); // for Firefox
|
472
|
+
parNod = t.parentNode;
|
473
|
+
nxtSib = t.nextSibling;
|
474
|
+
parNod.removeChild(t);
|
475
|
+
parNod.insertBefore(t, nxtSib);
|
476
|
+
|
477
|
+
// restore values
|
478
|
+
t.value= f.editArea.textarea.value;
|
479
|
+
selStart = f.editArea.last_selection["selectionStart"];
|
480
|
+
selEnd = f.editArea.last_selection["selectionEnd"];
|
481
|
+
scrollTop = f.document.getElementById("result").scrollTop;
|
482
|
+
scrollLeft = f.document.getElementById("result").scrollLeft;
|
483
|
+
|
484
|
+
|
485
|
+
document.getElementById("frame_"+id).style.display='none';
|
486
|
+
|
487
|
+
t.style.display="inline";
|
488
|
+
|
489
|
+
try{ // IE will give an error when trying to focus an invisible or disabled textarea
|
490
|
+
t.focus();
|
491
|
+
} catch(e){};
|
492
|
+
if(this.isIE){
|
493
|
+
t.selectionStart= selStart;
|
494
|
+
t.selectionEnd = selEnd;
|
495
|
+
t.focused = true;
|
496
|
+
set_IE_selection(t);
|
497
|
+
}else{
|
498
|
+
if(this.isOpera && this.isOpera < 9.6 ){ // Opera bug when moving selection start and selection end
|
499
|
+
t.setSelectionRange(0, 0);
|
500
|
+
}
|
501
|
+
try{
|
502
|
+
t.setSelectionRange(selStart, selEnd);
|
503
|
+
} catch(e) {};
|
504
|
+
}
|
505
|
+
t.scrollTop= scrollTop;
|
506
|
+
t.scrollLeft= scrollLeft;
|
507
|
+
f.editArea.execCommand("toggle_off");
|
508
|
+
|
509
|
+
}
|
510
|
+
},
|
511
|
+
|
512
|
+
// static function
|
513
|
+
toggle_on : function(id){
|
514
|
+
var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;
|
515
|
+
|
516
|
+
if(fs["frame_"+id])
|
517
|
+
{
|
518
|
+
f = fs["frame_"+id];
|
519
|
+
t = editAreas[id]["textarea"];
|
520
|
+
area= f.editArea;
|
521
|
+
area.textarea.value= t.value;
|
522
|
+
|
523
|
+
// store display values;
|
524
|
+
curPos = editAreas[id]["settings"]["cursor_position"];
|
525
|
+
|
526
|
+
if(t.use_last==true)
|
527
|
+
{
|
528
|
+
selStart = t.last_selectionStart;
|
529
|
+
selEnd = t.last_selectionEnd;
|
530
|
+
scrollTop = t.last_scrollTop;
|
531
|
+
scrollLeft = t.last_scrollLeft;
|
532
|
+
t.use_last=false;
|
533
|
+
}
|
534
|
+
else if( curPos == "auto" )
|
535
|
+
{
|
536
|
+
try{
|
537
|
+
selStart = t.selectionStart;
|
538
|
+
selEnd = t.selectionEnd;
|
539
|
+
scrollTop = t.scrollTop;
|
540
|
+
scrollLeft = t.scrollLeft;
|
541
|
+
//alert(scrollTop);
|
542
|
+
}catch(ex){}
|
543
|
+
}
|
544
|
+
|
545
|
+
// set to good size
|
546
|
+
this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));
|
547
|
+
t.style.display="none";
|
548
|
+
document.getElementById("frame_"+id).style.display="block"; //"inline";
|
549
|
+
area.execCommand("focus"); // without this focus opera doesn't manage well the iframe body height
|
550
|
+
|
551
|
+
|
552
|
+
// restore display values
|
553
|
+
editAreas[id]["displayed"]=true;
|
554
|
+
area.execCommand("update_size");
|
555
|
+
|
556
|
+
f.document.getElementById("result").scrollTop= scrollTop;
|
557
|
+
f.document.getElementById("result").scrollLeft= scrollLeft;
|
558
|
+
area.area_select(selStart, selEnd-selStart);
|
559
|
+
area.execCommand("toggle_on");
|
560
|
+
|
561
|
+
|
562
|
+
}
|
563
|
+
else
|
564
|
+
{
|
565
|
+
/* if(this.isIE)
|
566
|
+
get_IE_selection(document.getElementById(id)); */
|
567
|
+
elem= document.getElementById(id);
|
568
|
+
elem.last_selectionStart= elem.selectionStart;
|
569
|
+
elem.last_selectionEnd= elem.selectionEnd;
|
570
|
+
elem.last_scrollTop= elem.scrollTop;
|
571
|
+
elem.last_scrollLeft= elem.scrollLeft;
|
572
|
+
elem.use_last=true;
|
573
|
+
editAreaLoader.start(id);
|
574
|
+
}
|
575
|
+
},
|
576
|
+
|
577
|
+
set_editarea_size_from_textarea : function(id, frame){
|
578
|
+
var elem,width,height;
|
579
|
+
elem = document.getElementById(id);
|
580
|
+
|
581
|
+
width = Math.max(editAreas[id]["settings"]["min_width"], elem.offsetWidth)+"px";
|
582
|
+
height = Math.max(editAreas[id]["settings"]["min_height"], elem.offsetHeight)+"px";
|
583
|
+
if(elem.style.width.indexOf("%")!=-1)
|
584
|
+
width = elem.style.width;
|
585
|
+
if(elem.style.height.indexOf("%")!=-1)
|
586
|
+
height = elem.style.height;
|
587
|
+
//alert("h: "+height+" w: "+width);
|
588
|
+
|
589
|
+
frame.style.width= width;
|
590
|
+
frame.style.height= height;
|
591
|
+
},
|
592
|
+
|
593
|
+
set_base_url : function(){
|
594
|
+
var t=this,elems,i,docBasePath;
|
595
|
+
|
596
|
+
if( !this.baseURL ){
|
597
|
+
elems = document.getElementsByTagName('script');
|
598
|
+
|
599
|
+
for( i=0; i<elems.length; i++ ){
|
600
|
+
if (elems[i].src && elems[i].src.match(/edit_area_[^\\\/]*$/i) ) {
|
601
|
+
var src = elems[i].src;
|
602
|
+
src = src.substring(0, src.lastIndexOf('/'));
|
603
|
+
this.baseURL = src;
|
604
|
+
this.file_name= elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);
|
605
|
+
break;
|
606
|
+
}
|
607
|
+
}
|
608
|
+
}
|
609
|
+
|
610
|
+
docBasePath = document.location.href;
|
611
|
+
if (docBasePath.indexOf('?') != -1)
|
612
|
+
docBasePath = docBasePath.substring(0, docBasePath.indexOf('?'));
|
613
|
+
docBasePath = docBasePath.substring(0, docBasePath.lastIndexOf('/'));
|
614
|
+
|
615
|
+
// If not HTTP absolute
|
616
|
+
if (t.baseURL.indexOf('://') == -1 && t.baseURL.charAt(0) != '/') {
|
617
|
+
// If site absolute
|
618
|
+
t.baseURL = docBasePath + "/" + t.baseURL;
|
619
|
+
}
|
620
|
+
t.baseURL +="/";
|
621
|
+
},
|
622
|
+
|
623
|
+
get_button_html : function(id, img, exec, isFileSpecific, baseURL) {
|
624
|
+
var cmd,html;
|
625
|
+
if(!baseURL)
|
626
|
+
baseURL= this.baseURL;
|
627
|
+
cmd = 'editArea.execCommand(\'' + exec + '\')';
|
628
|
+
html = '<a id="a_'+ id +'" href="javascript:' + cmd + '" onclick="' + cmd + ';return false;" onmousedown="return false;" target="_self" fileSpecific="'+ (isFileSpecific?'yes':'no') +'">';
|
629
|
+
html += '<img id="' + id + '" src="'+ baseURL +'images/' + img + '" title="{$' + id + '}" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';
|
630
|
+
return html;
|
631
|
+
},
|
632
|
+
|
633
|
+
get_control_html : function(button_name, lang) {
|
634
|
+
var t=this,i,but,html,si;
|
635
|
+
for (i=0; i<t.advanced_buttons.length; i++)
|
636
|
+
{
|
637
|
+
but = t.advanced_buttons[i];
|
638
|
+
if (but[0] == button_name)
|
639
|
+
{
|
640
|
+
return t.get_button_html(but[0], but[1], but[2], but[3]);
|
641
|
+
}
|
642
|
+
}
|
643
|
+
|
644
|
+
switch (button_name){
|
645
|
+
case "*":
|
646
|
+
case "return":
|
647
|
+
return "<br />";
|
648
|
+
case "|":
|
649
|
+
case "separator":
|
650
|
+
return '<img src="'+ t.baseURL +'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';
|
651
|
+
case "select_font":
|
652
|
+
html= "<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";
|
653
|
+
html+="<option value='-1'>{$font_size}</option>";
|
654
|
+
si=[8,9,10,11,12,14];
|
655
|
+
for( i=0;i<si.length;i++){
|
656
|
+
html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";
|
657
|
+
}
|
658
|
+
html+="</select>";
|
659
|
+
return html;
|
660
|
+
case "syntax_selection":
|
661
|
+
html= "<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\", this.value)' fileSpecific='yes'>";
|
662
|
+
html+="<option value='-1'>{$syntax_selection}</option>";
|
663
|
+
html+="</select>";
|
664
|
+
return html;
|
665
|
+
}
|
666
|
+
|
667
|
+
return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";
|
668
|
+
},
|
669
|
+
|
670
|
+
|
671
|
+
get_template : function(){
|
672
|
+
if(this.template=="")
|
673
|
+
{
|
674
|
+
var xhr_object = null;
|
675
|
+
if(window.XMLHttpRequest) // Firefox
|
676
|
+
xhr_object = new XMLHttpRequest();
|
677
|
+
else if(window.ActiveXObject) // Internet Explorer
|
678
|
+
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
|
679
|
+
else { // XMLHttpRequest not supported
|
680
|
+
alert("XMLHTTPRequest not supported. EditArea not loaded");
|
681
|
+
return;
|
682
|
+
}
|
683
|
+
|
684
|
+
xhr_object.open("GET", this.baseURL+"template.html", false);
|
685
|
+
xhr_object.send(null);
|
686
|
+
if(xhr_object.readyState == 4)
|
687
|
+
this.template=xhr_object.responseText;
|
688
|
+
else
|
689
|
+
this.has_error();
|
690
|
+
}
|
691
|
+
},
|
692
|
+
|
693
|
+
// translate text
|
694
|
+
translate : function(text, lang, mode){
|
695
|
+
if(mode=="word")
|
696
|
+
text=editAreaLoader.get_word_translation(text, lang);
|
697
|
+
else if(mode="template"){
|
698
|
+
editAreaLoader.current_language= lang;
|
699
|
+
text=text.replace(/\{\$([^\}]+)\}/gm, editAreaLoader.translate_template);
|
700
|
+
}
|
701
|
+
return text;
|
702
|
+
},
|
703
|
+
|
704
|
+
translate_template : function(){
|
705
|
+
return editAreaLoader.get_word_translation(EditAreaLoader.prototype.translate_template.arguments[1], editAreaLoader.current_language);
|
706
|
+
},
|
707
|
+
|
708
|
+
get_word_translation : function(val, lang){
|
709
|
+
var i;
|
710
|
+
|
711
|
+
for( i in editAreaLoader.lang[lang]){
|
712
|
+
if(i == val)
|
713
|
+
return editAreaLoader.lang[lang][i];
|
714
|
+
}
|
715
|
+
return "_"+val;
|
716
|
+
},
|
717
|
+
|
718
|
+
load_script : function(url){
|
719
|
+
try {
|
720
|
+
var t=this,d=document,script,head;
|
721
|
+
|
722
|
+
if( t.loadedFiles[url] )
|
723
|
+
return;
|
724
|
+
//alert("load: "+url);
|
725
|
+
try{
|
726
|
+
script= d.createElement("script");
|
727
|
+
script.type= "text/javascript";
|
728
|
+
script.src= url;
|
729
|
+
script.charset= "UTF-8";
|
730
|
+
d.getElementsByTagName("head")[0].appendChild(script);
|
731
|
+
}catch(e){
|
732
|
+
d.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '" charset="UTF-8"></sc'+'ript>');
|
733
|
+
}
|
734
|
+
|
735
|
+
t.loadedFiles[url] = true;
|
736
|
+
} catch (e) { debug(e); }
|
737
|
+
},
|
738
|
+
|
739
|
+
add_event : function(obj, name, handler) {
|
740
|
+
try{
|
741
|
+
if (obj.attachEvent) {
|
742
|
+
obj.attachEvent("on" + name, handler);
|
743
|
+
} else{
|
744
|
+
obj.addEventListener(name, handler, false);
|
745
|
+
}
|
746
|
+
}catch(e){}
|
747
|
+
},
|
748
|
+
|
749
|
+
remove_event : function(obj, name, handler){
|
750
|
+
try{
|
751
|
+
if (obj.detachEvent)
|
752
|
+
obj.detachEvent("on" + name, handler);
|
753
|
+
else
|
754
|
+
obj.removeEventListener(name, handler, false);
|
755
|
+
}catch(e){}
|
756
|
+
},
|
757
|
+
|
758
|
+
|
759
|
+
// reset all the editareas in the form that have been reseted
|
760
|
+
reset : function(e){
|
761
|
+
var formObj,is_child,i,x;
|
762
|
+
|
763
|
+
formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
|
764
|
+
if(formObj.tagName!='FORM')
|
765
|
+
formObj= formObj.form;
|
766
|
+
|
767
|
+
for( i in editAreas ){
|
768
|
+
is_child= false;
|
769
|
+
for( x=0;x<formObj.elements.length;x++ ) {
|
770
|
+
if(formObj.elements[x].id == i)
|
771
|
+
is_child=true;
|
772
|
+
}
|
773
|
+
|
774
|
+
if(window.frames["frame_"+i] && is_child && editAreas[i]["displayed"]==true){
|
775
|
+
|
776
|
+
var exec= 'window.frames["frame_'+ i +'"].editArea.textarea.value= document.getElementById("'+ i +'").value;';
|
777
|
+
exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("focus");';
|
778
|
+
exec+= 'window.frames["frame_'+ i +'"].editArea.check_line_selection();';
|
779
|
+
exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("reset");';
|
780
|
+
window.setTimeout(exec, 10);
|
781
|
+
}
|
782
|
+
}
|
783
|
+
return;
|
784
|
+
},
|
785
|
+
|
786
|
+
|
787
|
+
// prepare all the textarea replaced by an editarea to be submited
|
788
|
+
submit : function(e){
|
789
|
+
var formObj,is_child,fs=window.frames,i,x;
|
790
|
+
formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
|
791
|
+
if(formObj.tagName!='FORM')
|
792
|
+
formObj= formObj.form;
|
793
|
+
|
794
|
+
for( i in editAreas){
|
795
|
+
is_child= false;
|
796
|
+
for( x=0;x<formObj.elements.length;x++ ) {
|
797
|
+
if(formObj.elements[x].id == i)
|
798
|
+
is_child=true;
|
799
|
+
}
|
800
|
+
|
801
|
+
if(is_child)
|
802
|
+
{
|
803
|
+
if(fs["frame_"+i] && editAreas[i]["displayed"]==true)
|
804
|
+
document.getElementById(i).value= fs["frame_"+ i].editArea.textarea.value;
|
805
|
+
editAreaLoader.execCommand(i,"EA_submit");
|
806
|
+
}
|
807
|
+
}
|
808
|
+
if( typeof(formObj.edit_area_replaced_submit) == "function" ){
|
809
|
+
res= formObj.edit_area_replaced_submit();
|
810
|
+
if(res==false){
|
811
|
+
if(editAreaLoader.isIE)
|
812
|
+
return false;
|
813
|
+
else
|
814
|
+
e.preventDefault();
|
815
|
+
}
|
816
|
+
}
|
817
|
+
return;
|
818
|
+
},
|
819
|
+
|
820
|
+
// allow to get the value of the editarea
|
821
|
+
getValue : function(id){
|
822
|
+
if(window.frames["frame_"+id] && editAreas[id]["displayed"]==true){
|
823
|
+
return window.frames["frame_"+ id].editArea.textarea.value;
|
824
|
+
}else if(elem=document.getElementById(id)){
|
825
|
+
return elem.value;
|
826
|
+
}
|
827
|
+
return false;
|
828
|
+
},
|
829
|
+
|
830
|
+
// allow to set the value of the editarea
|
831
|
+
setValue : function(id, new_val){
|
832
|
+
var fs=window.frames;
|
833
|
+
|
834
|
+
if( ( f=fs["frame_"+id] ) && editAreas[id]["displayed"]==true){
|
835
|
+
f.editArea.textarea.value= new_val;
|
836
|
+
f.editArea.execCommand("focus");
|
837
|
+
f.editArea.check_line_selection(false);
|
838
|
+
f.editArea.execCommand("onchange");
|
839
|
+
}else if(elem=document.getElementById(id)){
|
840
|
+
elem.value= new_val;
|
841
|
+
}
|
842
|
+
},
|
843
|
+
|
844
|
+
// allow to get infos on the selection: array(start, end)
|
845
|
+
getSelectionRange : function(id){
|
846
|
+
var sel,eA,fs=window.frames;
|
847
|
+
|
848
|
+
sel= {"start": 0, "end": 0};
|
849
|
+
if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
|
850
|
+
eA= fs["frame_"+ id].editArea;
|
851
|
+
|
852
|
+
sel["start"] = eA.textarea.selectionStart;
|
853
|
+
sel["end"] = eA.textarea.selectionEnd;
|
854
|
+
|
855
|
+
}else if( elem=document.getElementById(id) ){
|
856
|
+
sel= getSelectionRange(elem);
|
857
|
+
}
|
858
|
+
return sel;
|
859
|
+
},
|
860
|
+
|
861
|
+
// allow to set the selection with the given start and end positions
|
862
|
+
setSelectionRange : function(id, new_start, new_end){
|
863
|
+
var fs=window.frames;
|
864
|
+
|
865
|
+
if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
|
866
|
+
fs["frame_"+ id].editArea.area_select(new_start, new_end-new_start);
|
867
|
+
// make an auto-scroll to the selection
|
868
|
+
if(!this.isIE){
|
869
|
+
fs["frame_"+ id].editArea.check_line_selection(false);
|
870
|
+
fs["frame_"+ id].editArea.scroll_to_view();
|
871
|
+
}
|
872
|
+
}else if(elem=document.getElementById(id)){
|
873
|
+
setSelectionRange(elem, new_start, new_end);
|
874
|
+
}
|
875
|
+
},
|
876
|
+
|
877
|
+
getSelectedText : function(id){
|
878
|
+
var sel= this.getSelectionRange(id);
|
879
|
+
|
880
|
+
return this.getValue(id).substring(sel["start"], sel["end"]);
|
881
|
+
},
|
882
|
+
|
883
|
+
setSelectedText : function(id, new_val){
|
884
|
+
var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;
|
885
|
+
|
886
|
+
new_val = new_val.replace(/\r/g, "");
|
887
|
+
sel = this.getSelectionRange(id);
|
888
|
+
text = this.getValue(id);
|
889
|
+
if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
|
890
|
+
scrollTop = fs["frame_"+ id].document.getElementById("result").scrollTop;
|
891
|
+
scrollLeft = fs["frame_"+ id].document.getElementById("result").scrollLeft;
|
892
|
+
}else{
|
893
|
+
scrollTop = d.getElementById(id).scrollTop;
|
894
|
+
scrollLeft = d.getElementById(id).scrollLeft;
|
895
|
+
}
|
896
|
+
|
897
|
+
text = text.substring(0, sel["start"])+ new_val +text.substring(sel["end"]);
|
898
|
+
this.setValue(id, text);
|
899
|
+
new_sel_end = sel["start"]+ new_val.length;
|
900
|
+
this.setSelectionRange(id, sel["start"], new_sel_end);
|
901
|
+
|
902
|
+
|
903
|
+
// fix \r problem for selection length count on IE & Opera
|
904
|
+
if(new_val != this.getSelectedText(id).replace(/\r/g, "")){
|
905
|
+
this.setSelectionRange(id, sel["start"], new_sel_end+ new_val.split("\n").length -1);
|
906
|
+
}
|
907
|
+
// restore scrolling position
|
908
|
+
if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
|
909
|
+
fs["frame_"+ id].document.getElementById("result").scrollTop= scrollTop;
|
910
|
+
fs["frame_"+ id].document.getElementById("result").scrollLeft= scrollLeft;
|
911
|
+
fs["frame_"+ id].editArea.execCommand("onchange");
|
912
|
+
}else{
|
913
|
+
d.getElementById(id).scrollTop= scrollTop;
|
914
|
+
d.getElementById(id).scrollLeft= scrollLeft;
|
915
|
+
}
|
916
|
+
},
|
917
|
+
|
918
|
+
insertTags : function(id, open_tag, close_tag){
|
919
|
+
var old_sel,new_sel;
|
920
|
+
|
921
|
+
old_sel = this.getSelectionRange(id);
|
922
|
+
text = open_tag + this.getSelectedText(id) + close_tag;
|
923
|
+
|
924
|
+
editAreaLoader.setSelectedText(id, text);
|
925
|
+
|
926
|
+
new_sel = this.getSelectionRange(id);
|
927
|
+
if(old_sel["end"] > old_sel["start"]) // if text was selected, cursor at the end
|
928
|
+
this.setSelectionRange(id, new_sel["end"], new_sel["end"]);
|
929
|
+
else // cursor in the middle
|
930
|
+
this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);
|
931
|
+
},
|
932
|
+
|
933
|
+
// hide both EditArea and normal textarea
|
934
|
+
hide : function(id){
|
935
|
+
var fs= window.frames,d=document,t=this,scrollTop,scrollLeft,span;
|
936
|
+
if(d.getElementById(id) && !t.hidden[id])
|
937
|
+
{
|
938
|
+
t.hidden[id]= {};
|
939
|
+
t.hidden[id]["selectionRange"]= t.getSelectionRange(id);
|
940
|
+
if(d.getElementById(id).style.display!="none")
|
941
|
+
{
|
942
|
+
t.hidden[id]["scrollTop"]= d.getElementById(id).scrollTop;
|
943
|
+
t.hidden[id]["scrollLeft"]= d.getElementById(id).scrollLeft;
|
944
|
+
}
|
945
|
+
|
946
|
+
if(fs["frame_"+id])
|
947
|
+
{
|
948
|
+
t.hidden[id]["toggle"]= editAreas[id]["displayed"];
|
949
|
+
|
950
|
+
if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
|
951
|
+
scrollTop = fs["frame_"+ id].document.getElementById("result").scrollTop;
|
952
|
+
scrollLeft = fs["frame_"+ id].document.getElementById("result").scrollLeft;
|
953
|
+
}else{
|
954
|
+
scrollTop = d.getElementById(id).scrollTop;
|
955
|
+
scrollLeft = d.getElementById(id).scrollLeft;
|
956
|
+
}
|
957
|
+
t.hidden[id]["scrollTop"]= scrollTop;
|
958
|
+
t.hidden[id]["scrollLeft"]= scrollLeft;
|
959
|
+
|
960
|
+
if(editAreas[id]["displayed"]==true)
|
961
|
+
editAreaLoader.toggle_off(id);
|
962
|
+
}
|
963
|
+
|
964
|
+
// hide toggle button and debug box
|
965
|
+
span= d.getElementById("EditAreaArroundInfos_"+id);
|
966
|
+
if(span){
|
967
|
+
span.style.display='none';
|
968
|
+
}
|
969
|
+
|
970
|
+
// hide textarea
|
971
|
+
d.getElementById(id).style.display= "none";
|
972
|
+
}
|
973
|
+
},
|
974
|
+
|
975
|
+
// restore hidden EditArea and normal textarea
|
976
|
+
show : function(id){
|
977
|
+
var fs= window.frames,d=document,t=this,span;
|
978
|
+
if((elem=d.getElementById(id)) && t.hidden[id])
|
979
|
+
{
|
980
|
+
elem.style.display= "inline";
|
981
|
+
elem.scrollTop= t.hidden[id]["scrollTop"];
|
982
|
+
elem.scrollLeft= t.hidden[id]["scrollLeft"];
|
983
|
+
span= d.getElementById("EditAreaArroundInfos_"+id);
|
984
|
+
if(span){
|
985
|
+
span.style.display='inline';
|
986
|
+
}
|
987
|
+
|
988
|
+
if(fs["frame_"+id])
|
989
|
+
{
|
990
|
+
|
991
|
+
// restore toggle button and debug box
|
992
|
+
|
993
|
+
|
994
|
+
// restore textarea
|
995
|
+
elem.style.display= "inline";
|
996
|
+
|
997
|
+
// restore EditArea
|
998
|
+
if(t.hidden[id]["toggle"]==true)
|
999
|
+
editAreaLoader.toggle_on(id);
|
1000
|
+
|
1001
|
+
scrollTop = t.hidden[id]["scrollTop"];
|
1002
|
+
scrollLeft = t.hidden[id]["scrollLeft"];
|
1003
|
+
|
1004
|
+
if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
|
1005
|
+
fs["frame_"+ id].document.getElementById("result").scrollTop = scrollTop;
|
1006
|
+
fs["frame_"+ id].document.getElementById("result").scrollLeft = scrollLeft;
|
1007
|
+
}else{
|
1008
|
+
elem.scrollTop = scrollTop;
|
1009
|
+
elem.scrollLeft = scrollLeft;
|
1010
|
+
}
|
1011
|
+
|
1012
|
+
}
|
1013
|
+
// restore selection
|
1014
|
+
sel = t.hidden[id]["selectionRange"];
|
1015
|
+
t.setSelectionRange(id, sel["start"], sel["end"]);
|
1016
|
+
delete t.hidden[id];
|
1017
|
+
}
|
1018
|
+
},
|
1019
|
+
|
1020
|
+
// get the current file datas (for multi file editing mode)
|
1021
|
+
getCurrentFile : function(id){
|
1022
|
+
return this.execCommand(id, 'get_file', this.execCommand(id, 'curr_file'));
|
1023
|
+
},
|
1024
|
+
|
1025
|
+
// get the given file datas (for multi file editing mode)
|
1026
|
+
getFile : function(id, file_id){
|
1027
|
+
return this.execCommand(id, 'get_file', file_id);
|
1028
|
+
},
|
1029
|
+
|
1030
|
+
// get all the openned files datas (for multi file editing mode)
|
1031
|
+
getAllFiles : function(id){
|
1032
|
+
return this.execCommand(id, 'get_all_files()');
|
1033
|
+
},
|
1034
|
+
|
1035
|
+
// open a file (for multi file editing mode)
|
1036
|
+
openFile : function(id, file_infos){
|
1037
|
+
return this.execCommand(id, 'open_file', file_infos);
|
1038
|
+
},
|
1039
|
+
|
1040
|
+
// close the given file (for multi file editing mode)
|
1041
|
+
closeFile : function(id, file_id){
|
1042
|
+
return this.execCommand(id, 'close_file', file_id);
|
1043
|
+
},
|
1044
|
+
|
1045
|
+
// close the given file (for multi file editing mode)
|
1046
|
+
setFileEditedMode : function(id, file_id, to){
|
1047
|
+
var reg1,reg2;
|
1048
|
+
reg1 = new RegExp('\\\\', 'g');
|
1049
|
+
reg2 = new RegExp('"', 'g');
|
1050
|
+
return this.execCommand(id, 'set_file_edited_mode("'+ file_id.replace(reg1, '\\\\').replace(reg2, '\\"') +'", '+ to +')');
|
1051
|
+
},
|
1052
|
+
|
1053
|
+
|
1054
|
+
// allow to access to editarea functions and datas (for advanced users only)
|
1055
|
+
execCommand : function(id, cmd, fct_param){
|
1056
|
+
switch(cmd){
|
1057
|
+
case "EA_init":
|
1058
|
+
if(editAreas[id]['settings']["EA_init_callback"].length>0)
|
1059
|
+
eval(editAreas[id]['settings']["EA_init_callback"]+"('"+ id +"');");
|
1060
|
+
break;
|
1061
|
+
case "EA_delete":
|
1062
|
+
if(editAreas[id]['settings']["EA_delete_callback"].length>0)
|
1063
|
+
eval(editAreas[id]['settings']["EA_delete_callback"]+"('"+ id +"');");
|
1064
|
+
break;
|
1065
|
+
case "EA_submit":
|
1066
|
+
if(editAreas[id]['settings']["submit_callback"].length>0)
|
1067
|
+
eval(editAreas[id]['settings']["submit_callback"]+"('"+ id +"');");
|
1068
|
+
break;
|
1069
|
+
}
|
1070
|
+
if(window.frames["frame_"+id] && window.frames["frame_"+ id].editArea){
|
1071
|
+
if(fct_param!=undefined)
|
1072
|
+
return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +'(fct_param);');
|
1073
|
+
else
|
1074
|
+
return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');
|
1075
|
+
}
|
1076
|
+
return false;
|
1077
|
+
}
|
1078
|
+
};
|
1079
|
+
|
1080
|
+
var editAreaLoader= new EditAreaLoader();
|
1081
|
+
var editAreas= {};
|
1082
|
+
|