gfdnavi 1.3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. data/ChangeLog +10949 -0
  2. data/LICENCE.txt +57 -0
  3. data/Makefile +18 -0
  4. data/TODO +132 -0
  5. data/app/controllers/analysis_controller.rb +700 -0
  6. data/app/controllers/application.rb +41 -0
  7. data/app/controllers/draw_method_controller.rb +172 -0
  8. data/app/controllers/explorer_controller.rb +197 -0
  9. data/app/controllers/finder_controller.rb +331 -0
  10. data/app/controllers/function_controller.rb +204 -0
  11. data/app/controllers/group_controller.rb +115 -0
  12. data/app/controllers/keyword_attributes_controller.rb +52 -0
  13. data/app/controllers/knowledge_controller.rb +928 -0
  14. data/app/controllers/nodes_controller.rb +515 -0
  15. data/app/controllers/search_controller.rb +341 -0
  16. data/app/controllers/user_controller.rb +337 -0
  17. data/app/helpers/analysis_helper.rb +2 -0
  18. data/app/helpers/application_helper.rb +105 -0
  19. data/app/helpers/description_helper.rb +2 -0
  20. data/app/helpers/function_helper.rb +2 -0
  21. data/app/helpers/group_helper.rb +2 -0
  22. data/app/helpers/search_helper.rb +3 -0
  23. data/app/helpers/user_helper.rb +2 -0
  24. data/app/helpers/work_flow_helper.rb +92 -0
  25. data/app/models/actual_file.rb +3 -0
  26. data/app/models/analysis.rb +715 -0
  27. data/app/models/analysis_history.rb +42 -0
  28. data/app/models/cross_array.rb +22 -0
  29. data/app/models/cross_result.rb +254 -0
  30. data/app/models/derived_spatial_attribute.rb +3 -0
  31. data/app/models/diagram_cache.rb +16 -0
  32. data/app/models/diagram_cache_datum.rb +4 -0
  33. data/app/models/diagram_cache_session.rb +8 -0
  34. data/app/models/directory.rb +21 -0
  35. data/app/models/draw_method.rb +48 -0
  36. data/app/models/draw_method_attribute.rb +8 -0
  37. data/app/models/draw_parameter.rb +12 -0
  38. data/app/models/explorer_query.rb +354 -0
  39. data/app/models/explorer_result.rb +312 -0
  40. data/app/models/function.rb +75 -0
  41. data/app/models/function_argument.rb +6 -0
  42. data/app/models/function_output.rb +4 -0
  43. data/app/models/group.rb +153 -0
  44. data/app/models/image.rb +20 -0
  45. data/app/models/keyword_attribute.rb +179 -0
  46. data/app/models/knowledge.rb +94 -0
  47. data/app/models/knowledge_backup.rb +32 -0
  48. data/app/models/knowledge_figure.rb +16 -0
  49. data/app/models/knowledge_figure_backup.rb +16 -0
  50. data/app/models/knowledge_parser.rb +392 -0
  51. data/app/models/node.rb +605 -0
  52. data/app/models/node_entity_abstract.rb +112 -0
  53. data/app/models/node_lineage.rb +6 -0
  54. data/app/models/node_relation.rb +4 -0
  55. data/app/models/path_node.rb +60 -0
  56. data/app/models/query.rb +193 -0
  57. data/app/models/query_history.rb +12 -0
  58. data/app/models/results.rb +48 -0
  59. data/app/models/sign_up_user.rb +25 -0
  60. data/app/models/spatial_and_time_attribute.rb +11 -0
  61. data/app/models/user.rb +115 -0
  62. data/app/models/user_mailer.rb +48 -0
  63. data/app/models/value_type.rb +3 -0
  64. data/app/models/variable.rb +70 -0
  65. data/app/models/virtual_node.rb +457 -0
  66. data/app/views/analysis/__help_analysis_tab.en.html +57 -0
  67. data/app/views/analysis/__help_draw_share.en.html +12 -0
  68. data/app/views/analysis/__help_draw_tab.en.html +6 -0
  69. data/app/views/analysis/_analysis_function_settings.rhtml +61 -0
  70. data/app/views/analysis/_analysis_settings.rhtml +28 -0
  71. data/app/views/analysis/_diagram.rhtml +70 -0
  72. data/app/views/analysis/_dimension_option.rhtml +59 -0
  73. data/app/views/analysis/_draw_general_settings.rhtml +217 -0
  74. data/app/views/analysis/_draw_settings.rhtml +73 -0
  75. data/app/views/analysis/_history.rhtml +19 -0
  76. data/app/views/analysis/_popular_diagrams.rhtml +42 -0
  77. data/app/views/analysis/_save_form.rhtml +44 -0
  78. data/app/views/analysis/_variables.rhtml +66 -0
  79. data/app/views/analysis/_variables_order.rhtml +56 -0
  80. data/app/views/analysis/index.rhtml +195 -0
  81. data/app/views/analysis/preview.rhtml +3 -0
  82. data/app/views/analysis/save.rhtml +73 -0
  83. data/app/views/analysis/show_diagram.rhtml +42 -0
  84. data/app/views/cross/_display_map.rhtml +201 -0
  85. data/app/views/cross/_result.rhtml +205 -0
  86. data/app/views/cross/_show_result_tree.rhtml +40 -0
  87. data/app/views/cross/_show_results.rhtml +80 -0
  88. data/app/views/cross/_style.rhtml +21 -0
  89. data/app/views/cross/index.rhtml +271 -0
  90. data/app/views/draw_method/_edit_form.rhtml +110 -0
  91. data/app/views/draw_method/create.rhtml +8 -0
  92. data/app/views/draw_method/details.rhtml +113 -0
  93. data/app/views/draw_method/edit.rhtml +8 -0
  94. data/app/views/draw_method/list.rhtml +80 -0
  95. data/app/views/explorer/_display_map.rhtml +199 -0
  96. data/app/views/explorer/_show_result_tree.rhtml +40 -0
  97. data/app/views/explorer/_show_results.rhtml +101 -0
  98. data/app/views/explorer/_style.rhtml +21 -0
  99. data/app/views/explorer/index.rhtml +214 -0
  100. data/app/views/finder/_children.html.erb +84 -0
  101. data/app/views/finder/_children_details.html.erb +74 -0
  102. data/app/views/finder/_children_details_tr.html.erb +196 -0
  103. data/app/views/finder/create_tree.html.erb +15 -0
  104. data/app/views/finder/flex.html.erb +52 -0
  105. data/app/views/finder/index.html.erb +47 -0
  106. data/app/views/finder/show_details.html.erb +3 -0
  107. data/app/views/finder/show_images.html.erb +3 -0
  108. data/app/views/function/_edit_form.rhtml +106 -0
  109. data/app/views/function/create.rhtml +8 -0
  110. data/app/views/function/details.rhtml +96 -0
  111. data/app/views/function/edit.rhtml +8 -0
  112. data/app/views/function/list.rhtml +80 -0
  113. data/app/views/group/add_member.rhtml +13 -0
  114. data/app/views/group/change_owner.rhtml +15 -0
  115. data/app/views/group/create.rhtml +11 -0
  116. data/app/views/group/delete_member.rhtml +14 -0
  117. data/app/views/group/list.rhtml +63 -0
  118. data/app/views/knowledge/_backup.rhtml +135 -0
  119. data/app/views/knowledge/_category.rhtml +58 -0
  120. data/app/views/knowledge/_category_list.rhtml +34 -0
  121. data/app/views/knowledge/_category_table.rhtml +23 -0
  122. data/app/views/knowledge/_comment.rhtml +64 -0
  123. data/app/views/knowledge/_comment_input_form.rhtml +19 -0
  124. data/app/views/knowledge/_comments.rhtml +84 -0
  125. data/app/views/knowledge/_form.rhtml +139 -0
  126. data/app/views/knowledge/_group_figure_form.rhtml +187 -0
  127. data/app/views/knowledge/_layout_figure.rhtml +61 -0
  128. data/app/views/knowledge/_layout_figures_in_a_row_above_text.rhtml +42 -0
  129. data/app/views/knowledge/_layout_figures_under_text.rhtml +45 -0
  130. data/app/views/knowledge/_layout_one_figure_above_text.rhtml +28 -0
  131. data/app/views/knowledge/_summary.rhtml +21 -0
  132. data/app/views/knowledge/edit.rhtml +37 -0
  133. data/app/views/knowledge/list.rhtml +287 -0
  134. data/app/views/knowledge/new.rhtml +23 -0
  135. data/app/views/knowledge/new_from_analysis.rhtml +21 -0
  136. data/app/views/knowledge/show.rhtml +196 -0
  137. data/app/views/layouts/gfdnavi.rhtml +105 -0
  138. data/app/views/nodes/_ancestors.html.erb +89 -0
  139. data/app/views/nodes/_description_methods_table.html.erb +75 -0
  140. data/app/views/nodes/_mode.html.erb +16 -0
  141. data/app/views/nodes/description.html.erb +181 -0
  142. data/app/views/nodes/description_methods.html.erb +1 -0
  143. data/app/views/nodes/edit.html.erb +73 -0
  144. data/app/views/nodes/index.html.erb +25 -0
  145. data/app/views/nodes/show.html.erb +20 -0
  146. data/app/views/search/_children_details_mapsearch.rhtml +68 -0
  147. data/app/views/search/_children_details_tr.rhtml +205 -0
  148. data/app/views/search/_show_grouplist.rhtml +74 -0
  149. data/app/views/search/_show_results.rhtml +43 -0
  150. data/app/views/search/_show_results_global.rhtml +36 -0
  151. data/app/views/search/_show_results_partial.rhtml +39 -0
  152. data/app/views/search/_show_results_partial_groupbyfile.rhtml +50 -0
  153. data/app/views/search/_show_variablelist.rhtml +28 -0
  154. data/app/views/search/mapsearch.rhtml +176 -0
  155. data/app/views/search/remapsearch.rjs +18 -0
  156. data/app/views/search/show_details.rhtml +3 -0
  157. data/app/views/user/add_user.rhtml +30 -0
  158. data/app/views/user/change_password.rhtml +25 -0
  159. data/app/views/user/edit.html.erb +50 -0
  160. data/app/views/user/index.rhtml +162 -0
  161. data/app/views/user/login.rhtml +41 -0
  162. data/app/views/user/logout.rhtml +4 -0
  163. data/app/views/user/signup.rhtml +36 -0
  164. data/app/views/user/signup_succeeded.rhtml +36 -0
  165. data/app/views/user_mailer/authorization_inform.rhtml +15 -0
  166. data/app/views/user_mailer/signup_accepted.rhtml +12 -0
  167. data/app/views/user_mailer/signup_confirm.rhtml +14 -0
  168. data/app/views/user_mailer/signup_inform.rhtml +13 -0
  169. data/app/views/user_mailer/signup_rejected.rhtml +11 -0
  170. data/app/views/work_flow/_push_wsdls.rhtml +55 -0
  171. data/app/views/work_flow/index.rhtml +46 -0
  172. data/config/database.yml.example +35 -0
  173. data/config/environment.rb +68 -0
  174. data/config/gfdnavi.yml.example +95 -0
  175. data/config/load_config.rb +151 -0
  176. data/config/routes.rb +35 -0
  177. data/consistency_checker.rb +129 -0
  178. data/data/gfdnavi_docs/how_to_draw_multiple_images.knlge +68 -0
  179. data/data/gfdnavi_docs/how_to_knowledge.knlge +138 -0
  180. data/data/gfdnavi_docs/how_to_write_document_about_Gfdnavi.knlge +30 -0
  181. data/data/samples/jmadata.SIGEN +8 -0
  182. data/data/samples/jmadata.yml +6 -0
  183. data/data/samples/jmadata/MSM-P/2006.nc.yml +2 -0
  184. data/data/samples/jmadata/MSM-P/2006.yml +17 -0
  185. data/data/samples/jmadata/MSM-P/2006/0101.nc +0 -0
  186. data/data/samples/jmadata/MSM-P/2006/0101.nc.yml +13 -0
  187. data/data/samples/jmadata/MSM-P/2006/0102.nc +0 -0
  188. data/data/samples/jmadata/MSM-P/2006/0103.nc +0 -0
  189. data/data/samples/jmadata/MSM-P/2006/0104.nc +0 -0
  190. data/data/samples/jmadata/MSM-P/2006/0105.nc +0 -0
  191. data/data/samples/jmadata/MSM-P/2006/010[1-3].nc.yml +2 -0
  192. data/data/samples/jmadata/MSM-P/2006/skip_data.rb +96 -0
  193. data/data/samples/jmadata/MSM-P/2006/skip_data.sh +6 -0
  194. data/data/samples/reanalysis.SIGEN +8 -0
  195. data/data/samples/reanalysis/era40.SIGEN +8 -0
  196. data/data/samples/reanalysis/era40.yml +2 -0
  197. data/data/samples/reanalysis/era40/t.jan.nc +0 -0
  198. data/data/samples/reanalysis/era40/t.jan.nc.yml +1 -0
  199. data/data/samples/reanalysis/ncep.SIGEN +9 -0
  200. data/data/samples/reanalysis/ncep/T.jan.100hPa.png +0 -0
  201. data/data/samples/reanalysis/ncep/T.jan.100hPa.png.yml +43 -0
  202. data/data/samples/reanalysis/ncep/T.jan.nc +0 -0
  203. data/data/samples/reanalysis/ncep/T.jan.zonal_mean.nc +0 -0
  204. data/data/samples/reanalysis/ncep/T.jan.zonal_mean.nc.yml +8 -0
  205. data/data/samples/reanalysis/ncep/T.jan_only_root.nc +0 -0
  206. data/data/samples/reanalysis/ncep/T.jan_only_root.nc.yml +4 -0
  207. data/data/samples/reanalysis/ncep/UV.jan.nc +0 -0
  208. data/data/samples/reanalysis/ncep/UV.jan.nc.yml +10 -0
  209. data/data/samples/reanalysis/ncep/UV.jan.nc.yml.ja +11 -0
  210. data/data/samples/sonde_operational.yml +5 -0
  211. data/data/samples/sonde_operational/std_plev.yml +12 -0
  212. data/data/samples/sonde_operational/std_plev/41256.spl.nc +0 -0
  213. data/data/samples/sonde_operational/std_plev/42410.spl.nc +0 -0
  214. data/data/samples/sonde_operational/std_plev/43333.spl.nc +0 -0
  215. data/data/samples/sonde_operational/std_plev/43346.spl.nc +0 -0
  216. data/data/samples/sonde_operational/std_plev/48698.spl.nc +0 -0
  217. data/data/samples/sonde_operational/std_plev/61641.spl.nc +0 -0
  218. data/data/samples/sonde_operational/std_plev/63741.spl.nc +0 -0
  219. data/data/samples/sonde_operational/std_plev/67083.spl.nc +0 -0
  220. data/data/samples/sonde_operational/std_plev/72261.spl.nc +0 -0
  221. data/data/samples/sonde_operational/std_plev/76805.spl.nc +0 -0
  222. data/data/samples/sonde_operational/std_plev/82193.spl.nc +0 -0
  223. data/data/samples/sonde_operational/std_plev/91165.spl.nc +0 -0
  224. data/data/samples/sonde_operational/std_plev/91610.spl.nc +0 -0
  225. data/data/samples/sonde_operational/std_plev/91948.spl.nc +0 -0
  226. data/data/samples/sonde_operational/std_plev/94294.spl.nc +0 -0
  227. data/db/NetCDFparser.rb +406 -0
  228. data/db/create_derived_spatial_attributes.sql +12 -0
  229. data/db/draw_methods/line.yml +6 -0
  230. data/db/draw_methods/scatter.yml +38 -0
  231. data/db/draw_methods/tone.yml +64 -0
  232. data/db/draw_methods/vector.yml +19 -0
  233. data/db/dump_db.rb +43 -0
  234. data/db/functions/additions.yml +10 -0
  235. data/db/functions/cut.yml +10 -0
  236. data/db/functions/division.yml +10 -0
  237. data/db/functions/mean.yml +28 -0
  238. data/db/functions/multiplication.yml +10 -0
  239. data/db/functions/stddev.yml +28 -0
  240. data/db/functions/subtraction.yml +10 -0
  241. data/db/migrate/001_initial_scheme.rb +289 -0
  242. data/db/migrate/002_add_open_id_authentication_tables.rb +20 -0
  243. data/db/register_directory_tree.rb +760 -0
  244. data/db/restore_db.rb +60 -0
  245. data/gfdnavi-install +828 -0
  246. data/install.rb +828 -0
  247. data/lib/activerecord_gfdnavi.rb +31 -0
  248. data/lib/basic_authorization.rb +50 -0
  249. data/lib/create_activeresources.rb +108 -0
  250. data/lib/execute_analysis.rb +472 -0
  251. data/lib/file_gfdnavi.rb +38 -0
  252. data/lib/gphys_gfdnavi.rb +81 -0
  253. data/lib/localdir.rb +110 -0
  254. data/lib/login_system.rb +110 -0
  255. data/lib/multibytes.rb +20 -0
  256. data/lib/narray_yaml.rb +58 -0
  257. data/lib/no_rdb_base.rb +40 -0
  258. data/lib/opendapdir.rb +171 -0
  259. data/lib/tar.rb +127 -0
  260. data/lib/tasks/clean.rake +65 -0
  261. data/lib/tasks/setup.rake +316 -0
  262. data/lib/tasks/update.rake +62 -0
  263. data/lib/vizshot_gfdnavi.rb +224 -0
  264. data/public/crossdomain.xml +4 -0
  265. data/public/flex/NodeTreeDescriptor.as +55 -0
  266. data/public/flex/TreeNode.as +253 -0
  267. data/public/flex/finder.mxml +304 -0
  268. data/public/flex/finder.swf +0 -0
  269. data/public/flex/gfdnavi.mxml +52 -0
  270. data/public/flex/gfdnavi.swf +0 -0
  271. data/public/images/Help_S-shots/dir_tree_with_add.jpg +0 -0
  272. data/public/images/analyze.gif +0 -0
  273. data/public/images/circle.gif +0 -0
  274. data/public/images/create_from_analysis_button.png +0 -0
  275. data/public/images/delete.png +0 -0
  276. data/public/images/down.png +0 -0
  277. data/public/images/drawbutton.gif +0 -0
  278. data/public/images/gfdnavi_home_logo.png +0 -0
  279. data/public/images/gfdnavi_logo_big.png +0 -0
  280. data/public/images/gfdnavi_logo_med.png +0 -0
  281. data/public/images/gfdnavi_logo_mini.png +0 -0
  282. data/public/images/gfdnavi_logo_nobg_big.png +0 -0
  283. data/public/images/gfdnavi_logo_nobg_med.png +0 -0
  284. data/public/images/gfdnavi_logo_nobg_small.png +0 -0
  285. data/public/images/gfdnavi_logo_small.png +0 -0
  286. data/public/images/gfdnavi_logo_xsmall.png +0 -0
  287. data/public/images/hbar.png +0 -0
  288. data/public/images/helpmark16.png +0 -0
  289. data/public/images/helpmark18.png +0 -0
  290. data/public/images/kikyu_g.gif +0 -0
  291. data/public/images/kikyu_r.gif +0 -0
  292. data/public/images/map_icon_g.gif +0 -0
  293. data/public/images/map_icon_r.gif +0 -0
  294. data/public/images/new_knowledge.png +0 -0
  295. data/public/images/openid.png +0 -0
  296. data/public/images/read_in_the_form.png +0 -0
  297. data/public/images/slider_f.gif +0 -0
  298. data/public/images/slider_f_red.gif +0 -0
  299. data/public/images/star1.gif +0 -0
  300. data/public/images/star2.gif +0 -0
  301. data/public/images/startanim.gif +0 -0
  302. data/public/images/stopanim.gif +0 -0
  303. data/public/images/tree/DL.png +0 -0
  304. data/public/images/tree/anal_viz.png +0 -0
  305. data/public/images/tree/analyze_visualize_checked_items.png +0 -0
  306. data/public/images/tree/binary.png +0 -0
  307. data/public/images/tree/details.png +0 -0
  308. data/public/images/tree/download_checked_items.png +0 -0
  309. data/public/images/tree/folder.png +0 -0
  310. data/public/images/tree/folder_close.gif +0 -0
  311. data/public/images/tree/image2.png +0 -0
  312. data/public/images/tree/knowledge.png +0 -0
  313. data/public/images/tree/knowledges.png +0 -0
  314. data/public/images/tree/last.gif +0 -0
  315. data/public/images/tree/last.png +0 -0
  316. data/public/images/tree/minus.gif +0 -0
  317. data/public/images/tree/minus_simple.gif +0 -0
  318. data/public/images/tree/none.gif +0 -0
  319. data/public/images/tree/none.png +0 -0
  320. data/public/images/tree/plus.gif +0 -0
  321. data/public/images/tree/plus_simple.gif +0 -0
  322. data/public/images/tree/show.png +0 -0
  323. data/public/images/tree/show_checked_items.png +0 -0
  324. data/public/images/tree/t.gif +0 -0
  325. data/public/images/tree/t.png +0 -0
  326. data/public/images/tree/tate.gif +0 -0
  327. data/public/images/tree/tate.png +0 -0
  328. data/public/images/up.png +0 -0
  329. data/public/images/vbar.png +0 -0
  330. data/public/images/white.bmp +0 -0
  331. data/public/images/x.gif +0 -0
  332. data/public/index.html +100 -0
  333. data/public/javascripts/AC_OETags.js +269 -0
  334. data/public/javascripts/analysis.js +751 -0
  335. data/public/javascripts/application.js +29 -0
  336. data/public/javascripts/directory_tree.js +102 -0
  337. data/public/javascripts/draw_method.js +83 -0
  338. data/public/javascripts/excanvas.js +704 -0
  339. data/public/javascripts/function.js +107 -0
  340. data/public/javascripts/gfdnavi.js +175 -0
  341. data/public/javascripts/knowledge.js +384 -0
  342. data/public/javascripts/mapsearch.js +313 -0
  343. data/public/javascripts/progress.js +42 -0
  344. data/public/javascripts/resizable_box.js +164 -0
  345. data/public/javascripts/slider.js +260 -0
  346. data/public/javascripts/tab.js +17 -0
  347. data/public/javascripts/work_flow.js +452 -0
  348. data/public/stylesheets/analysis.css +111 -0
  349. data/public/stylesheets/description.css +71 -0
  350. data/public/stylesheets/gfdnavi.css +141 -0
  351. data/public/stylesheets/knowledge.css +218 -0
  352. data/public/stylesheets/search.css +184 -0
  353. data/public/stylesheets/tree.css +45 -0
  354. data/public/stylesheets/tree_for_ie.css +3 -0
  355. data/public/stylesheets/work_flow.css +78 -0
  356. data/script/cleaner +11 -0
  357. data/script/server_ssl +131 -0
  358. data/test/fixtures/diagram_cache_data.yml +5 -0
  359. data/test/fixtures/diagram_cache_sessions.yml +6 -0
  360. data/test/fixtures/diagram_caches.yml +6 -0
  361. data/test/fixtures/directories.yml +57 -0
  362. data/test/fixtures/draw_parameters.yml +6 -0
  363. data/test/fixtures/function_arguments.yml +15 -0
  364. data/test/fixtures/function_outputs.yml +15 -0
  365. data/test/fixtures/functions.yml +29 -0
  366. data/test/fixtures/group_members.yml +33 -0
  367. data/test/fixtures/groups.yml +25 -0
  368. data/test/fixtures/images.yml +12 -0
  369. data/test/fixtures/keyword_attributes.yml +73 -0
  370. data/test/fixtures/knowledges.yml +10 -0
  371. data/test/fixtures/node_relations.yml +11 -0
  372. data/test/fixtures/nodes.yml +298 -0
  373. data/test/fixtures/sign_up_users.yml +8 -0
  374. data/test/fixtures/spatial_and_time_attributes.yml +29 -0
  375. data/test/fixtures/user_mailer/authorization_inform +11 -0
  376. data/test/fixtures/user_mailer/signup_accepted +10 -0
  377. data/test/fixtures/user_mailer/signup_confirm +17 -0
  378. data/test/fixtures/user_mailer/signup_inform +10 -0
  379. data/test/fixtures/user_mailer/signup_rejected +9 -0
  380. data/test/fixtures/users.yml +31 -0
  381. data/test/fixtures/value_types.yml +10 -0
  382. data/test/fixtures/variables.yml +17 -0
  383. data/test/functional/analysis_controller_test.rb +169 -0
  384. data/test/functional/description_controller_test.rb +18 -0
  385. data/test/functional/function_controller_test.rb +18 -0
  386. data/test/functional/group_controller_test.rb +18 -0
  387. data/test/functional/search_controller_test.rb +83 -0
  388. data/test/functional/user_controller_test.rb +77 -0
  389. data/test/functional/webservice_analysis_api_test.rb +12 -0
  390. data/test/functional/work_flow_controller_test.rb +18 -0
  391. data/test/test_helper.rb +28 -0
  392. data/test/unit/diagram_cache_datum_test.rb +10 -0
  393. data/test/unit/diagram_cache_session_test.rb +10 -0
  394. data/test/unit/diagram_cache_test.rb +10 -0
  395. data/test/unit/directory_test.rb +49 -0
  396. data/test/unit/draw_parameter_test.rb +10 -0
  397. data/test/unit/function_argument_test.rb +10 -0
  398. data/test/unit/function_output_test.rb +10 -0
  399. data/test/unit/function_test.rb +10 -0
  400. data/test/unit/group_test.rb +48 -0
  401. data/test/unit/image_test.rb +13 -0
  402. data/test/unit/keyword_attribute_test.rb +33 -0
  403. data/test/unit/knowledge_test.rb +13 -0
  404. data/test/unit/node_relation_test.rb +20 -0
  405. data/test/unit/node_test.rb +85 -0
  406. data/test/unit/sign_up_user_test.rb +20 -0
  407. data/test/unit/spatial_and_time_attribute_test.rb +29 -0
  408. data/test/unit/user_mailer_test.rb +101 -0
  409. data/test/unit/user_test.rb +134 -0
  410. data/test/unit/value_type_test.rb +10 -0
  411. data/test/unit/variable_test.rb +35 -0
  412. data/vendor/plugins/acts_as_list/README +23 -0
  413. data/vendor/plugins/acts_as_list/init.rb +3 -0
  414. data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
  415. data/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
  416. data/vendor/plugins/acts_as_tree/README +26 -0
  417. data/vendor/plugins/acts_as_tree/Rakefile +22 -0
  418. data/vendor/plugins/acts_as_tree/init.rb +1 -0
  419. data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
  420. data/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
  421. data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
  422. data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
  423. data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
  424. data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
  425. data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
  426. data/vendor/plugins/will_paginate/CHANGELOG +92 -0
  427. data/vendor/plugins/will_paginate/LICENSE +18 -0
  428. data/vendor/plugins/will_paginate/README.rdoc +131 -0
  429. data/vendor/plugins/will_paginate/Rakefile +62 -0
  430. data/vendor/plugins/will_paginate/examples/apple-circle.gif +0 -0
  431. data/vendor/plugins/will_paginate/examples/index.haml +69 -0
  432. data/vendor/plugins/will_paginate/examples/index.html +92 -0
  433. data/vendor/plugins/will_paginate/examples/pagination.css +90 -0
  434. data/vendor/plugins/will_paginate/examples/pagination.sass +91 -0
  435. data/vendor/plugins/will_paginate/init.rb +1 -0
  436. data/vendor/plugins/will_paginate/lib/will_paginate.rb +86 -0
  437. data/vendor/plugins/will_paginate/lib/will_paginate/array.rb +16 -0
  438. data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +145 -0
  439. data/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +32 -0
  440. data/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +247 -0
  441. data/vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb +132 -0
  442. data/vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb +39 -0
  443. data/vendor/plugins/will_paginate/lib/will_paginate/version.rb +9 -0
  444. data/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +373 -0
  445. data/vendor/plugins/will_paginate/will_paginate.gemspec +21 -0
  446. metadata +586 -0
@@ -0,0 +1,107 @@
1
+ var numInputs = 1;
2
+ var numArgs = 0;
3
+
4
+ function changeInput() {
5
+ numInputs = $('function_nvars').selectedIndex + 1;
6
+ var ary = new Array(numArgs+numInputs);
7
+ for (i=0; i<numArgs; i++)
8
+ ary[i] = 'arg' + i;
9
+ for (i=0; i<numInputs; i++)
10
+ ary[i+numArgs] = 'gphys' + i;
11
+ Element.update('input_args', ary.join(", "));
12
+ }
13
+
14
+ var numArgMax=0;
15
+ function changeArgument() {
16
+ numArgs = $('argument_num').selectedIndex;
17
+ changeInput();
18
+
19
+ for (i=0; i<[numArgs,numArgMax].min(); i++)
20
+ Element.show('argument_'+i);
21
+ for (i=numArgs;i<numArgMax; i++)
22
+ Element.hide('argument_'+i);
23
+
24
+ html = "";
25
+ for (i=numArgMax; i<numArgs; i++) {
26
+ html += "<div id='argument_" + i + "'>\n";
27
+ html += "<h4>argument" + i +"</h4>\n";
28
+ html += "<table>\n";
29
+ html += " <tr>\n";
30
+ html += " <td>\n";
31
+ html += " <label for='argument_" + i + "_description'>description</label>\n";
32
+ html += " </td>\n";
33
+ html += " <td>\n";
34
+ html += " <textarea rows='5' cols='40' name='argument[" + i + "][description]' id='argument_" + i + "_description'></textarea>\n";
35
+ html += " </td>\n";
36
+ html += " </tr>\n";
37
+ html += " <tr>\n";
38
+ html += " <td>\n";
39
+ html += " <label for='argument_" + i + "_value_type'>value type</label>\n";
40
+ html += " </td>\n";
41
+ html += " <td>\n";
42
+ html += " <select id='argument_" + i + "_value_type' name='argument[" + i + "][value_type]'>\n";
43
+ html += " <option selected>int</option>\n";
44
+ html += " <option>float</option>\n";
45
+ html += " <option>string</option>\n";
46
+ html += " </select>\n";
47
+ html += " </td>\n";
48
+ html += " </tr>\n";
49
+ html += " <tr>\n";
50
+ html += " <td>\n";
51
+ html += " <label for='argument_" + i + "_default'>default</label>\n";
52
+ html += " </td>\n";
53
+ html += " <td>\n";
54
+ html += " <input type='text' size='10' name='argument[" + i + "][default]' id='argument_" + i + "_default'/>\n";
55
+ html += " </td>\n";
56
+ html += " </tr>\n";
57
+ html += "</table>\n";
58
+ html += "</div>\n";
59
+ numArgMax = i+1;
60
+ }
61
+ new Insertion.Bottom('arguments_table', html);
62
+ }
63
+
64
+ var numOutMax=0;
65
+ function changeOutput() {
66
+ var num = $('output_num').selectedIndex + 1;
67
+
68
+ for (i=0; i<[num,numOutMax].min(); i++)
69
+ Element.show('output_'+i);
70
+ for (i=num; i<numOutMax; i++)
71
+ Element.hide('output_'+i);
72
+
73
+ var html = "";
74
+ for (i=numOutMax; i<num; i++) {
75
+ html += "<div id='output_" + i + "'\n";
76
+ html += "<h4>output" + i +"</h4>\n";
77
+ html += "<table>\n";
78
+ html += " <tr>\n";
79
+ html += " <td>\n";
80
+ html += " <label for='output_" + i + "_name'>name</label>\n";
81
+ html += " </td>\n";
82
+ html += " <td>\n";
83
+ html += " <input type='text' size='10' name='output[" + i + "][name]' id='output_" + i + "_name'/>\n";
84
+ html += " </td>\n";
85
+ html += " </tr>\n";
86
+ html += " <tr>\n";
87
+ html += " <td>\n";
88
+ html += " <label for='output_" + i + "_subscript'>subscript</label>\n";
89
+ html += " </td>\n";
90
+ html += " <td>\n";
91
+ html += " <input type='text' size='10' name='output[" + i + "][subscript]' id='output_" + i + "_subscript'/>\n";
92
+ html += " </td>\n";
93
+ html += " </tr>\n";
94
+ html += " <tr>\n";
95
+ html += " <td>\n";
96
+ html += " <label for='output_" + i + "_description'>description</label>\n";
97
+ html += " </td>\n";
98
+ html += " <td>\n";
99
+ html += " <textarea rows='5' cols='40' name='output[" + i + "][description]' id='output_" + i + "_description'></textarea>\n";
100
+ html += " </td>\n";
101
+ html += " </tr>\n";
102
+ html += "</table>\n";
103
+ html += "</div>\n";
104
+ numOutMax = i+1;
105
+ }
106
+ new Insertion.Bottom('outputs_table', html);
107
+ }
@@ -0,0 +1,175 @@
1
+ var gfdnaviUrlRoot;
2
+
3
+ var PopupMenu = Class.create();
4
+ PopupMenu.prototype = {
5
+ initialize: function(element, html, title) {
6
+ this.html = html;
7
+ this.title = title;
8
+ if (element)
9
+ Event.observe(element, "click", this.openMenu.bindAsEventListener(this));
10
+ },
11
+ openMenu: function(e) {
12
+ var date = new Date();
13
+ date = date.getTime();
14
+ var id = 'popup_menu_'+date;
15
+ var hid = 'popup_header_'+date;
16
+ html = '<div id="'+id+'" class="popup_menu" style="display:none">';
17
+ html += '<table cellspacing="0" cellpadding="0" border="1" bordercolor="black">'
18
+ html += '<tr id="'+hid+'" border="0" style="background-color:#ddeeff;cursor:move;">';
19
+ html += '<td>';
20
+ html += '<div align="left" style="float:left">';
21
+ if (this.title)
22
+ html += this.title;
23
+ html += '</div>';
24
+ html += '<div align="right"><a href="#" onClick="Element.remove($(\''+id+'\'));"><img src="' + gfdnaviUrlRoot + '/images/x.gif" alt="X" class="delete"/></a></div>';
25
+ html += '</td></tr>';
26
+ html += '<tr><td>';
27
+ html += '<div style="padding:5px">' + this.html + '</div>';
28
+ html += '</td></tr>';
29
+ html += '</table>';
30
+ html += '</div>';
31
+
32
+ new Insertion.Bottom(Element.extend(document.body), html);
33
+ var menu = $(id);
34
+ new Draggable(menu,{handle: hid});
35
+ if (e) {
36
+ menu.style.left = Event.pointerX(e)-5 + 'px';
37
+ menu.style.top = Event.pointerY(e)-5 + 'px';
38
+ } else {
39
+ menu.style.left = '10px';
40
+ menu.style.top = '10px';
41
+ }
42
+ Element.show(menu);
43
+ if (e)
44
+ Event.stop(e);
45
+ this.id = id;
46
+ },
47
+ closeMenu: function(e) {
48
+ Element.remove(this.id);
49
+ }
50
+ }
51
+
52
+ var BenchMark = Class.create();
53
+ BenchMark.prototype = {
54
+ initialize: function (){},
55
+ start: function() {
56
+ this.start_date = new Date();
57
+ },
58
+ set: function(ary, body) {
59
+ this.ids = ary;
60
+ this.body = body;
61
+ },
62
+ load: function(id) {
63
+ if (this.ids) {
64
+ this.ids = this.ids.without(id);
65
+ if (this.ids.length == 0)
66
+ this.complete();
67
+ }
68
+ },
69
+ complete: function() {
70
+ if ( this.start_date ) {
71
+ var html = this.body + '<br/><hr/>';
72
+ var now = new Date();
73
+ var msec = now.getTime() - this.start_date.getTime();
74
+ html += parseInt(msec/60000)+':'+parseInt((msec%60000)/1000)+'.'+parseInt(msec%1000);
75
+ var pop = new PopupMenu(null, html, 'Result of Benchmark');
76
+ pop.openMenu();
77
+ this.start_date = null;
78
+ this.ids = null;
79
+ this.body = null;
80
+ }
81
+ }
82
+ }
83
+ var benchMark = new BenchMark();
84
+
85
+
86
+ var normalBgColor = "transparent";
87
+ var highlightBgColor = "yellow";
88
+ function bgUnhighlight(obj) { obj.style.backgroundColor=normalBgColor; }
89
+ function bgHighlight(obj) { obj.style.backgroundColor=highlightBgColor; }
90
+
91
+ var html_hidden = " <font color='red'><b>(hidden currently)</b></font> ";
92
+ var temp_save_str = "";
93
+
94
+ function helpLinkHilit(id, self) {
95
+ obj = $(id);
96
+ if(obj && testElementVisible(obj)){
97
+ obj.style.backgroundColor=highlightBgColor;
98
+ } else {
99
+ temp_save_str = self.innerHTML
100
+ self.innerHTML = temp_save_str + html_hidden;
101
+ }
102
+ }
103
+ function helpLinkUnhilit(id, self) {
104
+ obj = $(id);
105
+ if(obj && testElementVisible(obj)){
106
+ obj.style.backgroundColor=normalBgColor;
107
+ } else {
108
+ self.innerHTML = temp_save_str;
109
+ }
110
+ }
111
+
112
+ function testElementVisible(obj) {
113
+ elm = obj;
114
+ while (elm) {
115
+ if (elm == document)
116
+ return true;
117
+ if (!Element.visible(elm))
118
+ return false;
119
+ elm = elm.parentNode;
120
+ }
121
+ }
122
+
123
+ function bgFlash(id){
124
+ new Effect.Highlight(id,
125
+ {startcolor:"#ff0000",endcolor:"#ffffff",restorecolor:"#ffffff"});
126
+ }
127
+
128
+ //copy of knowledge.js
129
+ function showCommentListShort () {
130
+ comment_list_short = document.getElementById("comment_list_short")
131
+ comment_list_short_button = document.getElementById("comment_list_short_button")
132
+ comment_list_hide = document.getElementById("comment_list_hide")
133
+ comment_list_hide_button = document.getElementById("comment_list_hide_button")
134
+ comment_list_all = document.getElementById("comment_list_all")
135
+ comment_list_all_button = document.getElementById("comment_list_all_button")
136
+
137
+ comment_list_short.style.display = "block";
138
+ comment_list_short_button.style.borderStyle = "solid";
139
+ comment_list_hide.style.display = "none";
140
+ comment_list_hide_button.style.borderStyle = "none";
141
+ comment_list_all.style.display = "none";
142
+ comment_list_all_button.style.borderStyle = "none";
143
+ }
144
+
145
+ function showCommentListHide () {
146
+ comment_list_short = document.getElementById("comment_list_short")
147
+ comment_list_short_button = document.getElementById("comment_list_short_button")
148
+ comment_list_hide = document.getElementById("comment_list_hide")
149
+ comment_list_hide_button = document.getElementById("comment_list_hide_button")
150
+ comment_list_all = document.getElementById("comment_list_all")
151
+ comment_list_all_button = document.getElementById("comment_list_all_button")
152
+
153
+ comment_list_short.style.display = "none";
154
+ comment_list_short_button.style.borderStyle = "none";
155
+ comment_list_hide.style.display = "block";
156
+ comment_list_hide_button.style.borderStyle = "solid";
157
+ comment_list_all.style.display = "none";
158
+ comment_list_all_button.style.borderStyle = "none";
159
+ }
160
+
161
+ function showCommentListAll () {
162
+ comment_list_short = document.getElementById("comment_list_short")
163
+ comment_list_short_button = document.getElementById("comment_list_short_button")
164
+ comment_list_hide = document.getElementById("comment_list_hide")
165
+ comment_list_hide_button = document.getElementById("comment_list_hide_button")
166
+ comment_list_all = document.getElementById("comment_list_all")
167
+ comment_list_all_button = document.getElementById("comment_list_all_button")
168
+
169
+ comment_list_short.style.display = "none";
170
+ comment_list_short_button.style.borderStyle = "none";
171
+ comment_list_hide.style.display = "none";
172
+ comment_list_hide_button.style.borderStyle = "none";
173
+ comment_list_all.style.display = "block";
174
+ comment_list_all_button.style.borderStyle = "solid";
175
+ }
@@ -0,0 +1,384 @@
1
+ var num_of_figure;
2
+ function setNumOfFigure(x) {
3
+ num_of_figure = x;
4
+ }
5
+
6
+ function swapFigure(figure_number) {
7
+ var temp;
8
+
9
+ //knowledge_figure
10
+ temp = document.getElementById("knowledge_figure_"+ figure_number +"_figure_caption").value;
11
+ document.getElementById("knowledge_figure_"+ figure_number +"_figure_caption").value = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_figure_caption").value;
12
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_figure_caption").value = temp;
13
+
14
+ //file_name and figure_path and label and png
15
+ split1 = document.getElementById("knowledge_figure_"+ figure_number +"_input").name.split("]");
16
+ split2 = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_input").name.split("]");
17
+ document.getElementById("knowledge_figure_"+ figure_number +"_input").name = split1[0] + "]" + split2[1] + "]";
18
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_input").name = split2[0] + "]" + split1[1] + "]";
19
+
20
+ temp = document.getElementById("knowledge_figure_"+ figure_number +"_input").value;
21
+ document.getElementById("knowledge_figure_"+ figure_number +"_input").value = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_input").value;
22
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_input").value = temp;
23
+
24
+ temp = document.getElementById("knowledge_figure_"+ figure_number +"_input").type;
25
+ document.getElementById("knowledge_figure_"+ figure_number +"_input").type = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_input").type;
26
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_input").type = temp;
27
+
28
+ temp = document.getElementById("label_"+ figure_number).firstChild.nodeValue;
29
+ document.getElementById("label_"+ figure_number).firstChild.nodeValue = document.getElementById("label_"+ (figure_number + 1)).firstChild.nodeValue;
30
+ document.getElementById("label_"+ (figure_number+1)).firstChild.nodeValue = temp;
31
+
32
+ temp = document.getElementById("png_"+ figure_number).firstChild.nodeValue;
33
+ document.getElementById("png_"+ figure_number).firstChild.nodeValue = document.getElementById("png_"+ (figure_number + 1)).firstChild.nodeValue;
34
+ document.getElementById("png_"+ (figure_number+1)).firstChild.nodeValue = temp;
35
+
36
+ temp = document.getElementById("knowledge_figure_"+ figure_number +"_figure_path").value;
37
+ temp2 = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_figure_path").value;
38
+ document.getElementById("knowledge_figure_"+ figure_number +"_figure_path").value = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_figure_path").value;
39
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_figure_path").value = temp;
40
+
41
+ //diagram_id
42
+ temp = document.getElementById("knowledge_figure_"+ figure_number +"_diagram_id").value;
43
+ document.getElementById("knowledge_figure_"+ figure_number +"_diagram_id").value = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_diagram_id").value;
44
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_diagram_id").value = temp;
45
+
46
+ //diagram_number (diagram_cache�p)
47
+ temp = document.getElementById("knowledge_figure_"+ figure_number +"_diagram_number").value;
48
+ document.getElementById("knowledge_figure_"+ figure_number +"_diagram_number").value = document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_diagram_number").value;
49
+ document.getElementById("knowledge_figure_"+ (figure_number + 1) +"_diagram_number").value = temp;
50
+
51
+ //image
52
+ temp = document.getElementById("img_"+ figure_number).src;
53
+ document.getElementById("img_"+ figure_number).src = document.getElementById("img_"+ (figure_number + 1)).src;
54
+ document.getElementById("img_"+ (figure_number + 1)).src = temp;
55
+
56
+ //link to image
57
+ temp = document.getElementById("link_to_img_"+ figure_number).href;
58
+ document.getElementById("link_to_img_"+ figure_number).href = document.getElementById("link_to_img_"+ (figure_number + 1)).href;
59
+ document.getElementById("link_to_img_"+ (figure_number + 1)).href = temp;
60
+
61
+ temp = document.getElementById("link_to_img_"+ figure_number).firstChild.nodeValue;
62
+ document.getElementById("link_to_img_"+ figure_number).firstChild.nodeValue = document.getElementById("link_to_img_"+ (figure_number + 1)).firstChild.nodeValue;
63
+ document.getElementById("link_to_img_"+ (figure_number + 1)).firstChild.nodeValue = temp;
64
+
65
+ //view image ...
66
+ temp = document.getElementById("view_image_"+ figure_number).firstChild.nodeValue;
67
+ document.getElementById("view_image_"+ figure_number).firstChild.nodeValue = document.getElementById("view_image_"+ (figure_number + 1)).firstChild.nodeValue;
68
+ document.getElementById("view_image_"+ (figure_number+1)).firstChild.nodeValue = temp;
69
+ }
70
+
71
+ function deleteFigure(figure_number) {
72
+ if (window.confirm("Are you sure?")){
73
+ for (var i = figure_number; i < num_of_figure; i++) {
74
+ document.getElementById("knowledge_figure_"+ i +"_figure_caption").value = document.getElementById("knowledge_figure_"+ (i+1) +"_figure_caption").value;
75
+ document.getElementById("knowledge_figure_"+ i +"_input").value = document.getElementById("knowledge_figure_"+ (i+1) +"_input").value;//figure_path
76
+ //document.getElementById("knowledge_figure_"+ i +"_input").name = document.getElementById("knowledge_figure_"+ (i+1) +"_input").name;
77
+ document.getElementById("img_"+ i).src = document.getElementById("img_"+ (i+1)).src;
78
+ document.getElementById("link_to_img_"+ i).src = document.getElementById("link_to_img_"+ (i+1)).src;
79
+ }
80
+ var delete_field;
81
+ if (delete_field = document.getElementById("figure_field_"+ num_of_figure)){
82
+ delete_field.parentNode.removeChild(delete_field);
83
+ }
84
+ num_of_figure--;
85
+ var last_down_button;
86
+ if (last_down_button = document.getElementById("down_"+ num_of_figure)){
87
+ // delete down.png
88
+ var last_down_button_parent = last_down_button.parentNode;
89
+ last_down_button_parent.removeChild(last_down_button);
90
+ // add white.png
91
+ var down_img = document.createElement("img");
92
+ down_img.setAttribute("id", "down_alternative_"+ num_of_figure);
93
+ down_img.setAttribute("alt", "Down");
94
+ down_img.setAttribute("border", "0");
95
+ down_img.setAttribute("src", "/images/white.bmp");
96
+ down_img.setAttribute("height", "50");
97
+ down_img.setAttribute("width", "50");
98
+ last_down_button_parent.appendChild(down_img);
99
+ }
100
+ }
101
+
102
+ }
103
+
104
+ function moreFigure() {
105
+ if (num_of_figure === void 0) {
106
+ num_of_figure = 1;
107
+ }
108
+
109
+ if (num_of_figure > 0) {
110
+ var down_swap_alternative = document.getElementById("down_alternative_"+ num_of_figure);
111
+ var down_swap_parent = down_swap_alternative.parentNode;
112
+ var down_swap = document.createElement("a");
113
+ down_swap.setAttribute("href", "#");
114
+ down_swap.setAttribute("id", "down_"+ num_of_figure);
115
+ if (navigator.appVersion.indexOf("MSIE") != -1) {
116
+ down_swap.setAttribute("onclick", new Function("swapFigure("+ num_of_figure + "); location.href='#knowledge_figure_form'; return false;"));//for Internet Explorer
117
+ } else {
118
+ down_swap.setAttribute("onclick", "swapFigure("+ num_of_figure + "); location.href='#knowledge_figure_form'; return false;");// for Firefox
119
+ }
120
+ var down_img = document.createElement("img");
121
+ down_img.setAttribute("alt", "Down");
122
+ down_img.setAttribute("border", "0");
123
+ down_img.setAttribute("src", "/images/down.png");
124
+ down_img.setAttribute("height", "50");
125
+ down_img.setAttribute("width", "50");
126
+
127
+ down_swap_parent.removeChild(down_swap_alternative);
128
+ down_swap_parent.appendChild(down_swap);
129
+ down_swap.appendChild(down_img);
130
+ }
131
+ num_of_figure++;
132
+
133
+ var outer_tr = document.createElement("tr");
134
+ var outer_td = document.createElement("td");
135
+ var fieldset = document.createElement("fieldset");
136
+ fieldset.setAttribute("id", "figure_field_"+ num_of_figure);
137
+ if (navigator.appVersion.indexOf("MSIE") != -1) {
138
+ fieldset.setAttribute("className", "form_fieldset");//for Internet Explorer
139
+ } else {
140
+ fieldset.setAttribute("class", "form_fieldset");//for Firefox
141
+ }
142
+ var legend = document.createElement("legend");
143
+ var legend_text = document.createTextNode("Figure "+ num_of_figure);
144
+ legend.appendChild(legend_text);
145
+ var table = document.createElement("table");
146
+ var tbody = document.createElement("tbody");
147
+ var tr = document.createElement("tr");
148
+ tr.setAttribute("valign", "top");
149
+
150
+ var td1 = document.createElement("td");
151
+ var up_swap = document.createElement("a");
152
+ up_swap.setAttribute("href", "#");
153
+ up_swap.setAttribute("id", "up_"+ num_of_figure);
154
+ if (navigator.appVersion.indexOf("MSIE") != -1) {
155
+ up_swap.setAttribute("onclick", new Function("swapFigure("+ (num_of_figure - 1) + "); location.href='#knowledge_figure_form'; return false;"));//for Internet Explorer
156
+ } else {
157
+ up_swap.setAttribute("onclick", "swapFigure("+ (num_of_figure - 1) + "); location.href='#knowledge_figure_form'; return false;");// for Firefox
158
+ }
159
+ var up_img = document.createElement("img");
160
+ up_img.setAttribute("id", "up_img_"+ num_of_figure);
161
+ up_img.setAttribute("alt", "Up");
162
+ up_img.setAttribute("border", "0");
163
+ up_img.setAttribute("src", "/images/up.png");
164
+ up_img.setAttribute("height", "50");
165
+ up_img.setAttribute("width", "50");
166
+ /*
167
+ var down_swap = document.createElement("a");
168
+ down_swap.setAttribute("href", "#");
169
+ down_swap.setAttribute("id", "down_"+ num_of_figure);
170
+ if (navigator.appVersion.indexOf("MSIE") != -1) {
171
+ down_swap.setAttribute("onclick", new Function("swapFigure("+ num_of_figure + "); location.href='#knowledge_figure_form'; return false;"));//for Internet Explorer
172
+ } else {
173
+ down_swap.setAttribute("onclick", "swapFigure("+ num_of_figure + "); location.href='#knowledge_figure_form'; return false;");// for Firefox
174
+ }
175
+ */
176
+ var down_img = document.createElement("img");
177
+ down_img.setAttribute("id", "down_alternative_"+ num_of_figure);
178
+ down_img.setAttribute("alt", "Down");
179
+ down_img.setAttribute("border", "0");
180
+ down_img.setAttribute("src", "/images/white.bmp");
181
+ down_img.setAttribute("height", "50");
182
+ down_img.setAttribute("width", "50");
183
+
184
+ var td2 = document.createElement("td");
185
+ var caption_label = document.createTextNode("Caption:");
186
+ var caption = document.createElement("textarea");
187
+ caption.setAttribute("id", "knowledge_figure_"+ num_of_figure +"_figure_caption");
188
+ caption.setAttribute("name", "knowledge_figure["+ num_of_figure +"][figure_caption]");
189
+ caption.setAttribute("cols", "50");
190
+ caption.setAttribute("rows", "4");
191
+ var label = document.createElement("div");
192
+ label.setAttribute("id", "label_"+ num_of_figure);
193
+ var label_text = document.createTextNode("Figure Path:");
194
+ var figure_path = document.createElement("input");
195
+ figure_path.setAttribute("type", "text");
196
+ if (navigator.appVersion.indexOf("MSIE") != -1) {
197
+ figure_path.setAttribute("className", "textarea_size60");//for Internet Explorer
198
+ } else {
199
+ figure_path.setAttribute("class", "textarea_size60");//for Firefox
200
+ }
201
+ figure_path.setAttribute("id", "knowledge_figure_"+ num_of_figure +"_input");
202
+ figure_path.setAttribute("name", "knowledge_figure["+ num_of_figure +"][figure_path]");
203
+ figure_path.setAttribute("value", "");
204
+ var png_span = document.createElement("span");
205
+ png_span.setAttribute("id", "png_"+ num_of_figure);
206
+ var png = document.createTextNode(".png");
207
+ var diagram_id = document.createElement("input");
208
+ diagram_id.setAttribute("id", "knowledge_figure_"+ num_of_figure +"_diagram_id");
209
+ diagram_id.setAttribute("name", "knowledge_figure[<%= i %>][diagram_id]");
210
+ diagram_id.setAttribute("type", "hidden");
211
+ diagram_id.setAttribute("value", "");
212
+ var diagram_path = document.createElement("input");
213
+ diagram_path.setAttribute("id", "knowledge_figure_"+ num_of_figure +"_figure_path");
214
+ diagram_path.setAttribute("name", "knowledge_figure[<%= i %>][diagram_path]");
215
+ diagram_path.setAttribute("type", "hidden");
216
+ diagram_path.setAttribute("value", "");
217
+
218
+ var td3 = document.createElement("td");
219
+ var figure_img = document.createElement("img");
220
+ figure_img.setAttribute("src", "/images/white.bmp");
221
+ figure_img.setAttribute("id", "img_"+ num_of_figure);
222
+ figure_img.setAttribute("name", "img_"+ num_of_figure);
223
+ figure_img.setAttribute("width", "150");
224
+ figure_img.setAttribute("height", "150");
225
+ var link_to_img = document.createElement("a");
226
+ link_to_img.setAttribute("href", "'#knowledge_figure_form'");
227
+ link_to_img.setAttribute("id", "link_to_img_"+ num_of_figure);
228
+ link_to_img.setAttribute("name", "link_to_img_"+ num_of_figure);
229
+ var view_image = document.createElement("span");
230
+ view_image.setAttribute("id", "view_image_"+ num_of_figure);
231
+ var space = document.createTextNode("");
232
+ var td4 = document.createElement("td");
233
+ var delete_button = document.createElement("a");
234
+ delete_button.setAttribute("href", "#");
235
+ delete_button.setAttribute("id", "delete_figure_"+ num_of_figure);
236
+ if (navigator.appVersion.indexOf("MSIE") != -1) {
237
+ delete_button.setAttribute("onclick", new Function("deleteFigure("+ num_of_figure +");location.href='#knowledge_figure_form';return false;"));//for Internet Explorer
238
+ } else {
239
+ delete_button.setAttribute("onclick", "deleteFigure("+ num_of_figure +");location.href='#knowledge_figure_form';return false;");//for Firefox
240
+ }
241
+ var delete_img = document.createElement("img");
242
+ delete_img.setAttribute("alt", "X");
243
+ delete_img.setAttribute("border", "0");
244
+ delete_img.setAttribute("src", "/images/delete.png");
245
+
246
+ var knowledge_figure_tbody = document.getElementById("knowledge_figure_tbody");
247
+ knowledge_figure_tbody.appendChild(outer_tr);
248
+ outer_tr.appendChild(outer_td);
249
+ outer_td.appendChild(fieldset);
250
+ fieldset.appendChild(legend);
251
+ fieldset.appendChild(table);
252
+ table.appendChild(tbody);
253
+ tbody.appendChild(tr);
254
+ tr.appendChild(td1);
255
+ td1.appendChild(document.createElement("br"));
256
+ td1.appendChild(up_swap);
257
+ up_swap.appendChild(up_img);
258
+ td1.appendChild(document.createElement("br"));
259
+ td1.appendChild(document.createElement("br"));
260
+ td1.appendChild(down_img);
261
+ tr.appendChild(td2);
262
+ td2.appendChild(caption_label);
263
+ td2.appendChild(document.createElement("br"));
264
+ td2.appendChild(caption);
265
+ td2.appendChild(document.createElement("br"));
266
+ td2.appendChild(label)
267
+ label.appendChild(label_text);
268
+ td2.appendChild(figure_path);
269
+ td2.appendChild(png_span);
270
+ png_span.appendChild(png);
271
+ td2.appendChild(diagram_id);
272
+ td2.appendChild(diagram_path);
273
+ td2.appendChild(document.createElement("br"));
274
+ tr.appendChild(td3);
275
+ td3.appendChild(figure_img);
276
+ td3.appendChild(document.createElement("br"));
277
+ td3.appendChild(link_to_img);
278
+ link_to_img.appendChild(view_image);
279
+ view_image.appendChild(space);
280
+ tr.appendChild(td4);
281
+ td4.appendChild(delete_button);
282
+ delete_button.appendChild(delete_img);
283
+
284
+ var first_up_button;
285
+ if (first_up_button = document.getElementById("up_1")){
286
+ first_up_button.parentNode.removeChild(first_up_button);
287
+ }
288
+ }
289
+
290
+ function putNumSelectMenu(n){
291
+ select_menu = document.getElementById("knowledge_horizontal_figures");
292
+ if (n == 0) {
293
+ select_menu.disabled = false;
294
+ } else {
295
+ select_menu.disabled = true;
296
+ }
297
+ }
298
+
299
+ function putCategory(id){
300
+ select = document.getElementById(id);
301
+ category = document.getElementById("knowledge_category");
302
+ category.value = select.title;
303
+ }
304
+
305
+ function showCommentListShort () {
306
+ comment_list_short = document.getElementById("comment_list_short")
307
+ comment_list_short_button = document.getElementById("comment_list_short_button")
308
+ comment_list_hide = document.getElementById("comment_list_hide")
309
+ comment_list_hide_button = document.getElementById("comment_list_hide_button")
310
+ comment_list_all = document.getElementById("comment_list_all")
311
+ comment_list_all_button = document.getElementById("comment_list_all_button")
312
+
313
+ comment_list_short.style.display = "block";
314
+ comment_list_short_button.style.borderStyle = "solid";
315
+ comment_list_hide.style.display = "none";
316
+ comment_list_hide_button.style.borderStyle = "none";
317
+ comment_list_all.style.display = "none";
318
+ comment_list_all_button.style.borderStyle = "none";
319
+ }
320
+
321
+ function showCommentListHide () {
322
+ comment_list_short = document.getElementById("comment_list_short")
323
+ comment_list_short_button = document.getElementById("comment_list_short_button")
324
+ comment_list_hide = document.getElementById("comment_list_hide")
325
+ comment_list_hide_button = document.getElementById("comment_list_hide_button")
326
+ comment_list_all = document.getElementById("comment_list_all")
327
+ comment_list_all_button = document.getElementById("comment_list_all_button")
328
+
329
+ comment_list_short.style.display = "none";
330
+ comment_list_short_button.style.borderStyle = "none";
331
+ comment_list_hide.style.display = "block";
332
+ comment_list_hide_button.style.borderStyle = "solid";
333
+ comment_list_all.style.display = "none";
334
+ comment_list_all_button.style.borderStyle = "none";
335
+ }
336
+
337
+ function showCommentListAll () {
338
+ comment_list_short = document.getElementById("comment_list_short")
339
+ comment_list_short_button = document.getElementById("comment_list_short_button")
340
+ comment_list_hide = document.getElementById("comment_list_hide")
341
+ comment_list_hide_button = document.getElementById("comment_list_hide_button")
342
+ comment_list_all = document.getElementById("comment_list_all")
343
+ comment_list_all_button = document.getElementById("comment_list_all_button")
344
+
345
+ comment_list_short.style.display = "none";
346
+ comment_list_short_button.style.borderStyle = "none";
347
+ comment_list_hide.style.display = "none";
348
+ comment_list_hide_button.style.borderStyle = "none";
349
+ comment_list_all.style.display = "block";
350
+ comment_list_all_button.style.borderStyle = "solid";
351
+ }
352
+
353
+ function deleteDisplayCommentInputFormButton () {
354
+ display_comment_input_form_button = document.getElementById("display_comment_input_form_button");
355
+ display_comment_input_form_button.style.display = "none";
356
+ }
357
+
358
+ function enableButton (button_id) {
359
+ button = document.getElementById(button_id);
360
+ button.style.display = "block";
361
+ }
362
+
363
+ function restoreDocument (title, textbody, creator, default_layout, horizontal_figures, figures_size_status, figures_size_number) {
364
+ document.getElementById("knowledge_title").value = title;
365
+ document.getElementById("knowledge_textbody").value = textbody;
366
+ document.getElementById("knowledge_creator").value = creator;
367
+
368
+ document.getElementById("knowledge_default_layout").selectedIndex = Number(default_layout);
369
+ document.getElementById("knowledge_horizontal_figures").value = Number(horizontal_figures);
370
+
371
+ document.getElementById("knowledge[height_or_width]").selectedIndex = Number(figures_size_status) % 2;
372
+ document.getElementById("knowledge[figures_size_number]").value = Number(figures_size_number);
373
+ document.getElementById("knowledge[percent_or_pixel]").selectedIndex = Number(figures_size_status) / 2;
374
+
375
+ //�O���[�v�֘A�ƊG���܂��ł��ĂȂ�
376
+ }
377
+
378
+ function restoreDocumentIncludePath (title, textbody, creator, default_layout, horizontal_figures, figures_size_status, figures_size_number, path) {
379
+ document.getElementById("node_path").value = path;
380
+ restoreDocument(title, textbody, creator, default_layout, horizontal_figures, figures_size_status, figures_size_number);
381
+ }
382
+
383
+
384
+