activeldap 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (319) hide show
  1. data/CHANGES +6 -0
  2. data/README +1 -0
  3. data/lib/active_ldap/get_text_support.rb +3 -1
  4. data/lib/active_ldap.rb +1 -1
  5. metadata +5 -321
  6. data/examples/al-admin/README +0 -182
  7. data/examples/al-admin/Rakefile +0 -16
  8. data/examples/al-admin/app/controllers/account_controller.rb +0 -60
  9. data/examples/al-admin/app/controllers/application_controller.rb +0 -46
  10. data/examples/al-admin/app/controllers/attributes_controller.rb +0 -17
  11. data/examples/al-admin/app/controllers/directory_controller.rb +0 -49
  12. data/examples/al-admin/app/controllers/object_classes_controller.rb +0 -17
  13. data/examples/al-admin/app/controllers/syntaxes_controller.rb +0 -17
  14. data/examples/al-admin/app/controllers/users_controller.rb +0 -66
  15. data/examples/al-admin/app/controllers/welcome_controller.rb +0 -12
  16. data/examples/al-admin/app/helpers/account_helper.rb +0 -2
  17. data/examples/al-admin/app/helpers/application_helper.rb +0 -46
  18. data/examples/al-admin/app/helpers/attributes_helper.rb +0 -15
  19. data/examples/al-admin/app/helpers/directory_helper.rb +0 -7
  20. data/examples/al-admin/app/helpers/object_classes_helper.rb +0 -10
  21. data/examples/al-admin/app/helpers/syntaxes_helper.rb +0 -10
  22. data/examples/al-admin/app/helpers/url_helper.rb +0 -17
  23. data/examples/al-admin/app/helpers/users_helper.rb +0 -17
  24. data/examples/al-admin/app/helpers/welcome_helper.rb +0 -2
  25. data/examples/al-admin/app/models/entry.rb +0 -23
  26. data/examples/al-admin/app/models/ldap_user.rb +0 -58
  27. data/examples/al-admin/app/models/user.rb +0 -91
  28. data/examples/al-admin/app/views/_entry/_attributes_information.html.erb +0 -29
  29. data/examples/al-admin/app/views/_entry/_entry.html.erb +0 -15
  30. data/examples/al-admin/app/views/_schema/_aliases.html.erb +0 -7
  31. data/examples/al-admin/app/views/_switcher/_after.html.erb +0 -2
  32. data/examples/al-admin/app/views/_switcher/_before.html.erb +0 -5
  33. data/examples/al-admin/app/views/account/login.html.erb +0 -26
  34. data/examples/al-admin/app/views/account/sign_up.html.erb +0 -29
  35. data/examples/al-admin/app/views/attributes/_attributes.html.erb +0 -19
  36. data/examples/al-admin/app/views/attributes/_detail.html.erb +0 -29
  37. data/examples/al-admin/app/views/attributes/index.html.erb +0 -3
  38. data/examples/al-admin/app/views/attributes/show.html.erb +0 -31
  39. data/examples/al-admin/app/views/directory/_tree.html.erb +0 -10
  40. data/examples/al-admin/app/views/directory/_tree_view_js.html.erb +0 -25
  41. data/examples/al-admin/app/views/directory/index.html.erb +0 -13
  42. data/examples/al-admin/app/views/directory/populate.html.erb +0 -2
  43. data/examples/al-admin/app/views/layouts/_footer.html.erb +0 -11
  44. data/examples/al-admin/app/views/layouts/_header_menu.html.erb +0 -10
  45. data/examples/al-admin/app/views/layouts/_main_menu.html.erb +0 -18
  46. data/examples/al-admin/app/views/layouts/application.html.erb +0 -57
  47. data/examples/al-admin/app/views/object_classes/_attributes.html.erb +0 -28
  48. data/examples/al-admin/app/views/object_classes/_object_classes.html.erb +0 -19
  49. data/examples/al-admin/app/views/object_classes/index.html.erb +0 -3
  50. data/examples/al-admin/app/views/object_classes/show.html.erb +0 -39
  51. data/examples/al-admin/app/views/syntaxes/_detail.html.erb +0 -14
  52. data/examples/al-admin/app/views/syntaxes/_syntaxes.html.erb +0 -19
  53. data/examples/al-admin/app/views/syntaxes/index.html.erb +0 -3
  54. data/examples/al-admin/app/views/syntaxes/show.html.erb +0 -22
  55. data/examples/al-admin/app/views/users/_attributes_update_form.html.erb +0 -42
  56. data/examples/al-admin/app/views/users/_form.html.erb +0 -13
  57. data/examples/al-admin/app/views/users/_object_classes_update_form.html.erb +0 -46
  58. data/examples/al-admin/app/views/users/_password_change_form.html.erb +0 -20
  59. data/examples/al-admin/app/views/users/edit.html.erb +0 -15
  60. data/examples/al-admin/app/views/users/index.html.erb +0 -10
  61. data/examples/al-admin/app/views/users/show.html.erb +0 -11
  62. data/examples/al-admin/app/views/welcome/index.html.erb +0 -13
  63. data/examples/al-admin/config/boot.rb +0 -110
  64. data/examples/al-admin/config/database.yml.example +0 -19
  65. data/examples/al-admin/config/environment.rb +0 -73
  66. data/examples/al-admin/config/environments/development.rb +0 -17
  67. data/examples/al-admin/config/environments/production.rb +0 -24
  68. data/examples/al-admin/config/environments/test.rb +0 -22
  69. data/examples/al-admin/config/initializers/exception_notifier.rb +0 -2
  70. data/examples/al-admin/config/initializers/fast_gettext.rb +0 -3
  71. data/examples/al-admin/config/initializers/inflections.rb +0 -10
  72. data/examples/al-admin/config/initializers/mime_types.rb +0 -5
  73. data/examples/al-admin/config/initializers/session_store.rb +0 -23
  74. data/examples/al-admin/config/ldap.yml.example +0 -21
  75. data/examples/al-admin/config/routes.rb +0 -58
  76. data/examples/al-admin/config/session_secret.txt +0 -1
  77. data/examples/al-admin/config.ru +0 -7
  78. data/examples/al-admin/db/migrate/001_create_users.rb +0 -16
  79. data/examples/al-admin/db/schema.rb +0 -23
  80. data/examples/al-admin/lib/authenticated_system.rb +0 -124
  81. data/examples/al-admin/lib/authenticated_test_helper.rb +0 -113
  82. data/examples/al-admin/lib/ldap_test_helper.rb +0 -38
  83. data/examples/al-admin/lib/tasks/testing.rake +0 -10
  84. data/examples/al-admin/po/en/al-admin.po +0 -343
  85. data/examples/al-admin/po/ja/al-admin.po +0 -343
  86. data/examples/al-admin/po/nl/al-admin.po +0 -380
  87. data/examples/al-admin/public/.htaccess +0 -40
  88. data/examples/al-admin/public/404.html +0 -30
  89. data/examples/al-admin/public/500.html +0 -30
  90. data/examples/al-admin/public/dispatch.cgi +0 -10
  91. data/examples/al-admin/public/dispatch.fcgi +0 -24
  92. data/examples/al-admin/public/dispatch.rb +0 -10
  93. data/examples/al-admin/public/favicon.ico +0 -0
  94. data/examples/al-admin/public/images/active-ldap.svg +0 -6351
  95. data/examples/al-admin/public/images/al-admin.png +0 -0
  96. data/examples/al-admin/public/images/al-admin.svg +0 -6371
  97. data/examples/al-admin/public/images/header-background.png +0 -0
  98. data/examples/al-admin/public/images/header-background.svg +0 -99
  99. data/examples/al-admin/public/images/rails.png +0 -0
  100. data/examples/al-admin/public/images/spinelz/accordion_tab_left_active.gif +0 -0
  101. data/examples/al-admin/public/images/spinelz/accordion_tab_left_inactive.gif +0 -0
  102. data/examples/al-admin/public/images/spinelz/accordion_tab_middle_active.gif +0 -0
  103. data/examples/al-admin/public/images/spinelz/accordion_tab_middle_inactive.gif +0 -0
  104. data/examples/al-admin/public/images/spinelz/accordion_tab_right_active.gif +0 -0
  105. data/examples/al-admin/public/images/spinelz/accordion_tab_right_inactive.gif +0 -0
  106. data/examples/al-admin/public/images/spinelz/balloon_back.gif +0 -0
  107. data/examples/al-admin/public/images/spinelz/balloon_bottom_left.gif +0 -0
  108. data/examples/al-admin/public/images/spinelz/balloon_bottom_middle.gif +0 -0
  109. data/examples/al-admin/public/images/spinelz/balloon_bottom_right.gif +0 -0
  110. data/examples/al-admin/public/images/spinelz/balloon_left_down_arrow.gif +0 -0
  111. data/examples/al-admin/public/images/spinelz/balloon_left_up_arrow.gif +0 -0
  112. data/examples/al-admin/public/images/spinelz/balloon_middle_left.gif +0 -0
  113. data/examples/al-admin/public/images/spinelz/balloon_middle_right.gif +0 -0
  114. data/examples/al-admin/public/images/spinelz/balloon_right_down_arrow.gif +0 -0
  115. data/examples/al-admin/public/images/spinelz/balloon_right_up_arrow.gif +0 -0
  116. data/examples/al-admin/public/images/spinelz/balloon_top_left.gif +0 -0
  117. data/examples/al-admin/public/images/spinelz/balloon_top_middle.gif +0 -0
  118. data/examples/al-admin/public/images/spinelz/balloon_top_right.gif +0 -0
  119. data/examples/al-admin/public/images/spinelz/barchart_h.gif +0 -0
  120. data/examples/al-admin/public/images/spinelz/barchart_v.gif +0 -0
  121. data/examples/al-admin/public/images/spinelz/button.gif +0 -0
  122. data/examples/al-admin/public/images/spinelz/calendar_default_handler.gif +0 -0
  123. data/examples/al-admin/public/images/spinelz/calendar_delete.gif +0 -0
  124. data/examples/al-admin/public/images/spinelz/calendar_next.gif +0 -0
  125. data/examples/al-admin/public/images/spinelz/calendar_next_second.gif +0 -0
  126. data/examples/al-admin/public/images/spinelz/calendar_pre.gif +0 -0
  127. data/examples/al-admin/public/images/spinelz/calendar_pre_second.gif +0 -0
  128. data/examples/al-admin/public/images/spinelz/calendar_private_icon.gif +0 -0
  129. data/examples/al-admin/public/images/spinelz/calendar_schedule.gif +0 -0
  130. data/examples/al-admin/public/images/spinelz/calender_back.gif +0 -0
  131. data/examples/al-admin/public/images/spinelz/calender_back_second.gif +0 -0
  132. data/examples/al-admin/public/images/spinelz/datepicker2_back.gif +0 -0
  133. data/examples/al-admin/public/images/spinelz/datepicker2_back_second.gif +0 -0
  134. data/examples/al-admin/public/images/spinelz/datepicker2_next.gif +0 -0
  135. data/examples/al-admin/public/images/spinelz/datepicker2_next_second.gif +0 -0
  136. data/examples/al-admin/public/images/spinelz/datepicker2_pre.gif +0 -0
  137. data/examples/al-admin/public/images/spinelz/datepicker2_pre_second.gif +0 -0
  138. data/examples/al-admin/public/images/spinelz/datepicker_back.gif +0 -0
  139. data/examples/al-admin/public/images/spinelz/datepicker_back_second.gif +0 -0
  140. data/examples/al-admin/public/images/spinelz/datepicker_next.gif +0 -0
  141. data/examples/al-admin/public/images/spinelz/datepicker_next_second.gif +0 -0
  142. data/examples/al-admin/public/images/spinelz/datepicker_pre.gif +0 -0
  143. data/examples/al-admin/public/images/spinelz/datepicker_pre_second.gif +0 -0
  144. data/examples/al-admin/public/images/spinelz/grid_down.gif +0 -0
  145. data/examples/al-admin/public/images/spinelz/grid_state.gif +0 -0
  146. data/examples/al-admin/public/images/spinelz/grid_up.gif +0 -0
  147. data/examples/al-admin/public/images/spinelz/icon_day.gif +0 -0
  148. data/examples/al-admin/public/images/spinelz/icon_month.gif +0 -0
  149. data/examples/al-admin/public/images/spinelz/icon_week.gif +0 -0
  150. data/examples/al-admin/public/images/spinelz/menubar_back.gif +0 -0
  151. data/examples/al-admin/public/images/spinelz/menubar_subcontents_back.gif +0 -0
  152. data/examples/al-admin/public/images/spinelz/navPanel_tab_left_active.gif +0 -0
  153. data/examples/al-admin/public/images/spinelz/navPanel_tab_left_inactive.gif +0 -0
  154. data/examples/al-admin/public/images/spinelz/navPanel_tab_middle_active.gif +0 -0
  155. data/examples/al-admin/public/images/spinelz/navPanel_tab_middle_inactive.gif +0 -0
  156. data/examples/al-admin/public/images/spinelz/navPanel_tab_right_active.gif +0 -0
  157. data/examples/al-admin/public/images/spinelz/navPanel_tab_right_inactive.gif +0 -0
  158. data/examples/al-admin/public/images/spinelz/select_date.gif +0 -0
  159. data/examples/al-admin/public/images/spinelz/selectabletable_selected.gif +0 -0
  160. data/examples/al-admin/public/images/spinelz/sideBarBox_about.gif +0 -0
  161. data/examples/al-admin/public/images/spinelz/sideBarBox_menu.gif +0 -0
  162. data/examples/al-admin/public/images/spinelz/sideBarBox_sample.gif +0 -0
  163. data/examples/al-admin/public/images/spinelz/sideBarBox_tabBottomActive.gif +0 -0
  164. data/examples/al-admin/public/images/spinelz/sideBarBox_tabBottomInactive.gif +0 -0
  165. data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleActive.gif +0 -0
  166. data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleActive2.gif +0 -0
  167. data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleInactive.gif +0 -0
  168. data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleInactive2.gif +0 -0
  169. data/examples/al-admin/public/images/spinelz/sideBarBox_tabTopActive.gif +0 -0
  170. data/examples/al-admin/public/images/spinelz/sideBarBox_tabTopInactive.gif +0 -0
  171. data/examples/al-admin/public/images/spinelz/sideBarBox_tabbar.gif +0 -0
  172. data/examples/al-admin/public/images/spinelz/sortableTable_down.gif +0 -0
  173. data/examples/al-admin/public/images/spinelz/sortableTable_normal.gif +0 -0
  174. data/examples/al-admin/public/images/spinelz/sortableTable_up.gif +0 -0
  175. data/examples/al-admin/public/images/spinelz/switcher_close.gif +0 -0
  176. data/examples/al-admin/public/images/spinelz/switcher_open.gif +0 -0
  177. data/examples/al-admin/public/images/spinelz/tabBox_close.gif +0 -0
  178. data/examples/al-admin/public/images/spinelz/tabBox_tabLeftActive.gif +0 -0
  179. data/examples/al-admin/public/images/spinelz/tabBox_tabLeftInactive.gif +0 -0
  180. data/examples/al-admin/public/images/spinelz/tabBox_tabMiddleActive.gif +0 -0
  181. data/examples/al-admin/public/images/spinelz/tabBox_tabMiddleInactive.gif +0 -0
  182. data/examples/al-admin/public/images/spinelz/tabBox_tabRightActive.gif +0 -0
  183. data/examples/al-admin/public/images/spinelz/tabBox_tabRightInactive.gif +0 -0
  184. data/examples/al-admin/public/images/spinelz/tab_bar.gif +0 -0
  185. data/examples/al-admin/public/images/spinelz/table_back.gif +0 -0
  186. data/examples/al-admin/public/images/spinelz/timepicker_clock.gif +0 -0
  187. data/examples/al-admin/public/images/spinelz/toolbar_close.gif +0 -0
  188. data/examples/al-admin/public/images/spinelz/toolbar_left.gif +0 -0
  189. data/examples/al-admin/public/images/spinelz/toolbar_max.gif +0 -0
  190. data/examples/al-admin/public/images/spinelz/toolbar_middle.gif +0 -0
  191. data/examples/al-admin/public/images/spinelz/toolbar_min.gif +0 -0
  192. data/examples/al-admin/public/images/spinelz/toolbar_next.gif +0 -0
  193. data/examples/al-admin/public/images/spinelz/toolbar_right.gif +0 -0
  194. data/examples/al-admin/public/images/spinelz/treeview_dir.gif +0 -0
  195. data/examples/al-admin/public/images/spinelz/treeview_file.gif +0 -0
  196. data/examples/al-admin/public/images/spinelz/treeview_group.gif +0 -0
  197. data/examples/al-admin/public/images/spinelz/treeview_group_special.gif +0 -0
  198. data/examples/al-admin/public/images/spinelz/treeview_state.gif +0 -0
  199. data/examples/al-admin/public/images/spinelz/treeview_user.gif +0 -0
  200. data/examples/al-admin/public/images/spinelz/window_bottom_left.gif +0 -0
  201. data/examples/al-admin/public/images/spinelz/window_bottom_middle.gif +0 -0
  202. data/examples/al-admin/public/images/spinelz/window_bottom_right.gif +0 -0
  203. data/examples/al-admin/public/images/spinelz/window_close.gif +0 -0
  204. data/examples/al-admin/public/images/spinelz/window_max.gif +0 -0
  205. data/examples/al-admin/public/images/spinelz/window_middle_left.gif +0 -0
  206. data/examples/al-admin/public/images/spinelz/window_middle_right.gif +0 -0
  207. data/examples/al-admin/public/images/spinelz/window_min.gif +0 -0
  208. data/examples/al-admin/public/images/spinelz/window_top_left.gif +0 -0
  209. data/examples/al-admin/public/images/spinelz/window_top_middle.gif +0 -0
  210. data/examples/al-admin/public/images/spinelz/window_top_right.gif +0 -0
  211. data/examples/al-admin/public/javascripts/application.js +0 -2
  212. data/examples/al-admin/public/javascripts/controls.js +0 -963
  213. data/examples/al-admin/public/javascripts/dragdrop.js +0 -973
  214. data/examples/al-admin/public/javascripts/effects.js +0 -1128
  215. data/examples/al-admin/public/javascripts/prototype.js +0 -4320
  216. data/examples/al-admin/public/javascripts/spinelz/accordion.js +0 -185
  217. data/examples/al-admin/public/javascripts/spinelz/ajaxHistory.js +0 -157
  218. data/examples/al-admin/public/javascripts/spinelz/balloon.js +0 -287
  219. data/examples/al-admin/public/javascripts/spinelz/barchart.js +0 -524
  220. data/examples/al-admin/public/javascripts/spinelz/calendar.js +0 -3012
  221. data/examples/al-admin/public/javascripts/spinelz/colorpicker.js +0 -128
  222. data/examples/al-admin/public/javascripts/spinelz/datepicker.js +0 -438
  223. data/examples/al-admin/public/javascripts/spinelz/grid.js +0 -1391
  224. data/examples/al-admin/public/javascripts/spinelz/grid_resizeEx.js +0 -100
  225. data/examples/al-admin/public/javascripts/spinelz/grid_sortabletableEx.js +0 -129
  226. data/examples/al-admin/public/javascripts/spinelz/inplaceEditorEx.js +0 -148
  227. data/examples/al-admin/public/javascripts/spinelz/menubar.js +0 -232
  228. data/examples/al-admin/public/javascripts/spinelz/navPanel.js +0 -170
  229. data/examples/al-admin/public/javascripts/spinelz/selectableTable.js +0 -433
  230. data/examples/al-admin/public/javascripts/spinelz/sideBarBox.js +0 -282
  231. data/examples/al-admin/public/javascripts/spinelz/sideBarBox_effects.js +0 -83
  232. data/examples/al-admin/public/javascripts/spinelz/sortableTable.js +0 -270
  233. data/examples/al-admin/public/javascripts/spinelz/switcher.js +0 -78
  234. data/examples/al-admin/public/javascripts/spinelz/tabBox.js +0 -469
  235. data/examples/al-admin/public/javascripts/spinelz/timepicker.js +0 -384
  236. data/examples/al-admin/public/javascripts/spinelz/toolbar.js +0 -152
  237. data/examples/al-admin/public/javascripts/spinelz/treeview.js +0 -703
  238. data/examples/al-admin/public/javascripts/spinelz/window.js +0 -641
  239. data/examples/al-admin/public/javascripts/spinelz/window_resizeEx.js +0 -130
  240. data/examples/al-admin/public/javascripts/spinelz_lib/builder.js +0 -131
  241. data/examples/al-admin/public/javascripts/spinelz_lib/controls.js +0 -835
  242. data/examples/al-admin/public/javascripts/spinelz_lib/dragdrop.js +0 -944
  243. data/examples/al-admin/public/javascripts/spinelz_lib/effects.js +0 -1090
  244. data/examples/al-admin/public/javascripts/spinelz_lib/json.js +0 -139
  245. data/examples/al-admin/public/javascripts/spinelz_lib/prototype.js +0 -2515
  246. data/examples/al-admin/public/javascripts/spinelz_lib/resize.js +0 -215
  247. data/examples/al-admin/public/javascripts/spinelz_lib/scriptaculous.js +0 -51
  248. data/examples/al-admin/public/javascripts/spinelz_lib/slider.js +0 -278
  249. data/examples/al-admin/public/javascripts/spinelz_lib/spinelz_util.js +0 -1266
  250. data/examples/al-admin/public/javascripts/spinelz_lib/unittest.js +0 -564
  251. data/examples/al-admin/public/robots.txt +0 -1
  252. data/examples/al-admin/public/stylesheets/account.css +0 -41
  253. data/examples/al-admin/public/stylesheets/attributes.css +0 -1
  254. data/examples/al-admin/public/stylesheets/base.css +0 -104
  255. data/examples/al-admin/public/stylesheets/detail.css +0 -36
  256. data/examples/al-admin/public/stylesheets/directory.css +0 -22
  257. data/examples/al-admin/public/stylesheets/object-classes.css +0 -6
  258. data/examples/al-admin/public/stylesheets/rails.css +0 -35
  259. data/examples/al-admin/public/stylesheets/spinelz/accordion.css +0 -59
  260. data/examples/al-admin/public/stylesheets/spinelz/balloon.css +0 -151
  261. data/examples/al-admin/public/stylesheets/spinelz/calendar.css +0 -564
  262. data/examples/al-admin/public/stylesheets/spinelz/datepicker.css +0 -175
  263. data/examples/al-admin/public/stylesheets/spinelz/grid.css +0 -137
  264. data/examples/al-admin/public/stylesheets/spinelz/menubar.css +0 -78
  265. data/examples/al-admin/public/stylesheets/spinelz/modal.css +0 -22
  266. data/examples/al-admin/public/stylesheets/spinelz/navPanel.css +0 -58
  267. data/examples/al-admin/public/stylesheets/spinelz/selectableTable.css +0 -28
  268. data/examples/al-admin/public/stylesheets/spinelz/sideBarBox.css +0 -82
  269. data/examples/al-admin/public/stylesheets/spinelz/sortableTable.css +0 -51
  270. data/examples/al-admin/public/stylesheets/spinelz/switcher.css +0 -23
  271. data/examples/al-admin/public/stylesheets/spinelz/tabBox.css +0 -94
  272. data/examples/al-admin/public/stylesheets/spinelz/timepicker.css +0 -508
  273. data/examples/al-admin/public/stylesheets/spinelz/toolbar.css +0 -82
  274. data/examples/al-admin/public/stylesheets/spinelz/treeview.css +0 -121
  275. data/examples/al-admin/public/stylesheets/spinelz/window.css +0 -140
  276. data/examples/al-admin/public/stylesheets/structure.css +0 -81
  277. data/examples/al-admin/public/stylesheets/syntaxes.css +0 -1
  278. data/examples/al-admin/public/stylesheets/users.css +0 -13
  279. data/examples/al-admin/public/stylesheets/welcome.css +0 -0
  280. data/examples/al-admin/script/about +0 -3
  281. data/examples/al-admin/script/console +0 -3
  282. data/examples/al-admin/script/dbconsole +0 -3
  283. data/examples/al-admin/script/destroy +0 -3
  284. data/examples/al-admin/script/generate +0 -3
  285. data/examples/al-admin/script/performance/benchmarker +0 -3
  286. data/examples/al-admin/script/performance/profiler +0 -3
  287. data/examples/al-admin/script/performance/request +0 -3
  288. data/examples/al-admin/script/plugin +0 -3
  289. data/examples/al-admin/script/process/inspector +0 -3
  290. data/examples/al-admin/script/process/reaper +0 -3
  291. data/examples/al-admin/script/process/spawner +0 -3
  292. data/examples/al-admin/script/runner +0 -3
  293. data/examples/al-admin/script/server +0 -3
  294. data/examples/al-admin/test/fixtures/users.yml +0 -9
  295. data/examples/al-admin/test/functional/account_controller_test.rb +0 -12
  296. data/examples/al-admin/test/functional/attributes_controller_test.rb +0 -8
  297. data/examples/al-admin/test/functional/directory_controller_test.rb +0 -8
  298. data/examples/al-admin/test/functional/object_classes_controller_test.rb +0 -8
  299. data/examples/al-admin/test/functional/syntaxes_controller_test.rb +0 -8
  300. data/examples/al-admin/test/functional/users_controller_test.rb +0 -8
  301. data/examples/al-admin/test/functional/welcome_controller_test.rb +0 -8
  302. data/examples/al-admin/test/integration/sign_up_test.rb +0 -44
  303. data/examples/al-admin/test/run-test.sh +0 -3
  304. data/examples/al-admin/test/test_helper.rb +0 -52
  305. data/examples/al-admin/test/unit/user_test.rb +0 -12
  306. data/examples/al-admin/vendor/plugins/exception_notification/README +0 -111
  307. data/examples/al-admin/vendor/plugins/exception_notification/init.rb +0 -1
  308. data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifiable.rb +0 -99
  309. data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier.rb +0 -66
  310. data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb +0 -78
  311. data/examples/al-admin/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb +0 -61
  312. data/examples/al-admin/vendor/plugins/exception_notification/test/test_helper.rb +0 -7
  313. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml +0 -1
  314. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml +0 -7
  315. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml +0 -16
  316. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml +0 -4
  317. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml +0 -2
  318. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml +0 -3
  319. data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml +0 -6
@@ -1,1391 +0,0 @@
1
- // Copyright (c) 2005 spinelz.org (http://script.spinelz.org/)
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining
4
- // a copy of this software and associated documentation files (the
5
- // "Software"), to deal in the Software without restriction, including
6
- // without limitation the rights to use, copy, modify, merge, publish,
7
- // distribute, sublicense, and/or sell copies of the Software, and to
8
- // permit persons to whom the Software is furnished to do so, subject to
9
- // the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be
12
- // included in all copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- Grid = Class.create();
23
- Grid.className = {
24
- container: 'grid_container',
25
-
26
- baseTable: 'grid_baseTable',
27
- baseRow: 'grid_baseRow',
28
- baseCell: 'grid_baseCell',
29
-
30
- headerTable: 'grid_headerTable',
31
- headerRow: 'grid_headerRow',
32
- headerCell: 'grid_headerCell',
33
- headerCellDrag: 'grid_headerCellDrag',
34
- headerCellSort: 'grid_headerCellVal',
35
-
36
- idTable: 'grid_idTable',
37
- idRow: 'grid_idRow',
38
- idCell: 'grid_idCell',
39
- idCellVal: 'grid_idCellVal',
40
-
41
- cellTable: 'grid_cellTable',
42
- cellTbody: 'grid_cellTbody',
43
- cellRow: 'grid_cellRow',
44
- cell: 'grid_cell',
45
- cellVal: 'grid_cellVal',
46
- cellSelected: 'grid_cellSelected',
47
- state: 'grid_state',
48
- stateEmpty: 'grid_stateEmpty',
49
- stateOpen: 'grid_stateOpen',
50
- stateClose: 'grid_stateClose',
51
-
52
- inplaceEditor: 'grid_inplaceEditor'
53
- }
54
- Grid.scrollTop = 0;
55
- Grid.scrollLeft = 0;
56
- Grid.options = {}
57
- Grid.options.baseTable = {
58
- border:1,
59
- frame : 'border',
60
- cellSpacing:0,
61
- cellPadding:0
62
- }
63
- Grid.options.headerTable = {
64
- border:1,
65
- frame : 'border',
66
- cellSpacing:0,
67
- cellPadding:0
68
- }
69
- Grid.options.idTable = {
70
- border:1,
71
- frame : 'border',
72
- cellSpacing:0,
73
- cellPadding:0
74
- }
75
- Grid.options.cellTable = {
76
- border:1,
77
- frame : 'border',
78
- cellSpacing:0,
79
- cellPadding:0
80
- }
81
- Grid.prototype = {
82
-
83
- initialize : function(element) {
84
-
85
- this.element = $(element);
86
- Element.setStyle(this.element, {visibility: 'hidden'});
87
- Element.hide(this.element);
88
-
89
- var options = Object.extend({
90
- cssPrefix: 'custum_',
91
- cellMinWidth: 10,
92
- cellMinHeight: 10,
93
- cellDefaultWidth: 72,
94
- cellDefaultHeight: 25,
95
- defaultRowLength: 10,
96
- baseWidth: 40,
97
- baseHeight: 25,
98
- baseTop: 0,
99
- baseLeft: 0,
100
- cellEditUrl: '',
101
- updateGridUrl: '',
102
- updateGridReceiver: '',
103
- hierarchy: false,
104
- hierarchyCol: false,
105
- hierarchyIndent: 20,
106
- sortOptions: {}
107
- }, arguments[1] || {});
108
-
109
- this.options = options;
110
- this.custumCss = CssUtil.appendPrefix(options.cssPrefix, Grid.className);
111
- this.cssUtil = new CssUtil([Grid.className, this.custumCss]);
112
- this.cssUtil.addClassNames(this.element, 'container');
113
- this.hierarchyCol = this.options.hierarchyCol ? $(this.options.hierarchyCol) : false;
114
- this.hierarchyColIndex = this.hierarchyCol ? this.hierarchyCol.cellIndex : 0;
115
- Element.makePositioned(this.element);
116
- Position.includeScrollOffsets = true;
117
- this.stateDivWidth = parseInt(CssUtil.getCssRuleBySelectorText('.' + Grid.className.state).style.width, 10);
118
-
119
- this.marginSize = this.options.marginSize ? this.options.marginSize : 4;
120
- this.stateIndent = 15;
121
-
122
- this.rowIdBase = this.element.id + '_row_';
123
- this.topLevelList = new Array();
124
- this.removeList = new Array();
125
- this.build();
126
- this.removeList.each(function(r) {
127
- r.parentNode.removeChild(r);
128
- });
129
- var sortOptions = {
130
- relate : this.idTable,
131
- handle:this.headerTable,
132
- callBack:this.finishSort.bind(this)
133
- };
134
- sortOptions = $H(sortOptions).merge(this.options.sortOptions);
135
- this.sortTable = new SortableTableGridEx(this.cellTable, sortOptions);
136
- Element.setStyle(this.element, {visibility: 'visible'});
137
- Element.show(this.element);
138
- },
139
-
140
- build: function() {
141
- Element.cleanWhitespace(this.element);
142
- this.cellTable = this.element.childNodes[0];
143
- Element.cleanWhitespace(this.cellTable);
144
-
145
- this.colLength = this.cellTable.tHead.rows[0].cells.length;
146
- this.rowLength = this.cellTable.tBodies[0].rows.length;
147
- if (this.rowLength == 0)this.rowLength = this.options.defaultRowLength;
148
- this.buildBaseTable();
149
- this.buildHeaderTable();
150
- this.buildIdTable();
151
- this.buildCellTable();
152
-
153
- Event.observe(this.element, 'scroll', this.fixTablePosition.bindAsEventListener(this));
154
- },
155
-
156
- buildBaseTable: function() {
157
-
158
- this.baseTable = Builder.node('table', Grid.options.baseTable);
159
- this.cssUtil.addClassNames(this.baseTable, 'baseTable');
160
- with (this.baseTable.style) {
161
- width = this.options.baseWidth + 'px';
162
- height = this.options.baseHeight + 'px';
163
- position = 'absolute';
164
- top = this.options.baseTop + 'px';
165
- left = this.options.baseLeft + 'px';
166
- }
167
-
168
- var row = this.baseTable.insertRow(0);
169
- var cell = row.insertCell(0);
170
-
171
- this.cssUtil.addClassNames(row, 'baseRow');
172
- this.cssUtil.addClassNames(cell, 'baseCell');
173
-
174
- this.element.appendChild(this.baseTable);
175
- },
176
-
177
- buildHeaderTable: function() {
178
- this.headerTable = Builder.node('table', Grid.options.headerTable);
179
- this.cssUtil.addClassNames(this.headerTable, 'headerTable');
180
-
181
- var thead = this.cellTable.tHead;
182
- var row = thead.rows[0];
183
- row.id = this.element.id + '_headerTable_row';
184
- var cells = row.cells;
185
- Element.cleanWhitespace(thead);
186
- Element.cleanWhitespace(row);
187
-
188
- this.cssUtil.addClassNames(row, 'headerRow');
189
- for (var i = 0; i < cells.length; i++) {
190
- var cell = cells[i];
191
- var value = cell.firstChild;
192
- var title = cell.innerHTML;
193
- this.buildHeaderCell(cell, title, i);
194
- this.removeList.push(value);
195
- }
196
- this.headerTable.appendChild(thead);
197
- with (this.headerTable.style) {
198
- width = this.options.cellDefaultWidth * this.colLength + 'px';
199
- height = this.baseTable.style.height;
200
- position= 'absolute';
201
- top = Element.getStyle(this.baseTable, 'top');
202
- left = parseInt(Element.getStyle(this.baseTable, 'left')) + parseInt(Element.getStyle(this.baseTable, 'width')) + 'px';
203
- }
204
- this.element.appendChild(this.headerTable);
205
- Sortable.create(
206
- row,
207
- {
208
- tag:'td',
209
- handle:Grid.className.headerCellDrag,
210
- constraint:true,
211
- overlap:'horizontal',
212
- scroll:this.element,
213
- onUpdate:this.updateCellLine.bind(this)
214
- });
215
- },
216
-
217
- buildHeaderCell : function(cell, title, index) {
218
-
219
- cell.id = this.element.id + '_header_col_' + index;
220
-
221
- var drag = Builder.node('div');
222
- var sort = Builder.node('div');
223
-
224
- this.cssUtil.addClassNames(cell, 'headerCell');
225
- this.cssUtil.addClassNames(drag, 'headerCellDrag');
226
- this.cssUtil.addClassNames(sort, 'headerCellSort');
227
-
228
- cell.style.width = this.options.cellDefaultWidth + 'px';
229
- var dragWidth = parseInt(Element.getStyle(cell, 'width')) - (this.marginSize * 2);
230
- var sortWidth = dragWidth - (this.marginSize * 2);
231
- var cellHeight = this.options.baseHeight - (Grid.options.headerTable.border * 4);
232
- with (drag.style) {
233
- width = dragWidth + 'px';
234
- height = cellHeight + 'px';
235
- marginLeft = this.marginSize + 'px';
236
- marginRight = this.marginSize + 'px';
237
- }
238
- with (sort.style) {
239
- width = sortWidth + 'px';
240
- height = cellHeight + 'px';
241
- marginLeft = this.marginSize + 'px';
242
- marginRight = this.marginSize + 'px';
243
- }
244
-
245
- sort.innerHTML = title;
246
- drag.appendChild(sort);
247
- cell.appendChild(drag);
248
-
249
- new ResizeableGridEx(cell, {minWidth: this.options.cellMinWidth, top:0,right:2, bottom:0, left:0 ,draw:this.updateCellWidth.bind(this)});
250
- Event.observe(cell, 'mousedown', this.setSelectedColumn.bindAsEventListener(this));
251
- Event.observe(drag, 'mousedown', this.setSelectedColumn.bindAsEventListener(this));
252
- Event.observe(sort, 'mousedown', this.setSelectedColumn.bindAsEventListener(this));
253
- },
254
-
255
- buildIdTable: function() {
256
-
257
- this.idTable = Builder.node('table', Grid.options.idTable);
258
- this.cssUtil.addClassNames(this.idTable, 'idTable');
259
- for (var i = 0; i < this.rowLength; i++) {
260
-
261
- var row = this.idTable.insertRow(i);
262
- this.buildIdRow(row, i);
263
- }
264
-
265
- with(this.idTable.style) {
266
- width = this.options.baseWidth + 'px';
267
- position = 'absolute';
268
- top = parseInt(Element.getStyle(this.baseTable, 'top')) + parseInt(Element.getStyle(this.baseTable, 'height')) + 'px';
269
- left = Element.getStyle(this.baseTable, 'left');
270
- }
271
-
272
- this.element.appendChild(this.idTable);
273
- var tbody = this.idTable.tBodies[0];
274
- tbody.id = this.element.id + '_idTable_tbody';
275
- Sortable.create(
276
- tbody,
277
- {
278
- tag:'tr',
279
- handle:Grid.className.idCellVal,
280
- scroll:this.element,
281
- constraint:true,
282
- overlap:'vertical',
283
- onUpdate:this.updateRowLine.bind(this)
284
- });
285
- },
286
-
287
- buildIdRow : function(row, index) {
288
- row.id = this.rowIdBase + '_id_' + index;
289
-
290
- var cell = row.insertCell(0);
291
- var valueDiv = Builder.node('div');
292
-
293
- this.cssUtil.addClassNames(row, 'idRow');
294
- this.cssUtil.addClassNames(cell, 'idCell');
295
- this.cssUtil.addClassNames(valueDiv, 'idCellVal');
296
-
297
- with (cell.style) {
298
- width = this.options.baseWidth + 'px';
299
- height = this.options.cellDefaultHeight + 'px';
300
- }
301
- with (valueDiv.style) {
302
- marginTop = this.marginSize + 'px';
303
- marginBottom = this.marginSize + 'px';
304
- width = this.options.baseWidth - (Grid.options.idTable.border * 4) + 'px';
305
- height = this.options.cellDefaultHeight - (this.marginSize * 2) + 'px';
306
- }
307
-
308
- valueDiv.innerHTML = index + 1;
309
- cell.appendChild(valueDiv);
310
-
311
- new ResizeableGridEx(cell, {minHeight: this.options.cellMinHeight, top:0, right: 0, bottom: 2, left: 0, draw:this.updateCellHeight.bind(this)});
312
-
313
- Event.observe(row, 'mousedown', this.setSelectedRow.bindAsEventListener(this));
314
- Event.observe(cell, 'mousedown', this.setSelectedRow.bindAsEventListener(this));
315
- Event.observe(valueDiv, 'mousedown', this.setSelectedRow.bindAsEventListener(this));
316
- },
317
-
318
- buildCellTable: function() {
319
- var tbody = this.cellTable.tBodies[0];
320
- Element.cleanWhitespace(tbody);
321
- with(this.cellTable){
322
- border = Grid.options.cellTable.border;
323
- cellSpacing = Grid.options.cellTable.cellSpacing;
324
- cellPadding = Grid.options.cellTable.cellPadding;
325
- }
326
- this.cssUtil.addClassNames(this.cellTable, 'cellTable');
327
- this.cssUtil.addClassNames(tbody, 'cellTbody');
328
- this.element.appendChild(this.cellTable);
329
- var rows = this.cellTable.rows;
330
-
331
- if (!rows || rows.length == 0) {
332
- for(var i = 0; i < this.rowLength; i++) {
333
-
334
- var newRow = this.cellTable.insertRow(i);
335
- newRow.id = this.rowIdBase + i;
336
- this.cssUtil.addClassNames(newRow, 'cellRow');
337
-
338
- for (var j = 0; j < this.colLength; j++) {
339
- var newCell = newRow.insertCell(j);
340
- this.buildCell(newCell, j, "");
341
- }
342
- if (this.options.hierarchy) {
343
- this.setHierarchyRow(newRow);
344
- }
345
- }
346
-
347
- } else {
348
- for (var i = 0; i < this.rowLength; i++) {
349
- var row = rows[i];
350
- Element.cleanWhitespace(row);
351
- this.cssUtil.addClassNames(row, 'cellRow');
352
- row.id = this.rowIdBase + i;
353
- var cells = row.cells;
354
-
355
- for (var j = 0; j < cells.length; j++) {
356
- var cell = cells[j];
357
- Element.cleanWhitespace(cell);
358
- this.buildCell(cell, j, Element.collectTextNodes(cell));
359
- this.removeList.push(cell.firstChild);
360
- }
361
- if (this.options.hierarchy) {
362
- this.setHierarchyRow(row);
363
- }
364
- }
365
- }
366
-
367
- with (this.cellTable.style) {
368
- width = this.options.cellDefaultWidth * this.colLength + 'px';
369
- position = 'absolute';
370
- top = parseInt(Element.getStyle(this.baseTable, 'top')) + parseInt(Element.getStyle(this.baseTable, 'height')) + 'px';
371
- left = parseInt(Element.getStyle(this.baseTable, 'left')) + parseInt(Element.getStyle(this.baseTable, 'width')) + 'px';
372
- }
373
-
374
- this.cellTable.getIdRow = this.getIdRow.bind(this);
375
- },
376
-
377
- buildCell : function(cell, cellIdIndex, value) {
378
-
379
- var cellValueDiv = Builder.node('div');
380
- cellValueDiv.innerHTML = value;
381
-
382
- cell.appendChild(cellValueDiv);
383
- cell.id = cell.parentNode.id + '_col_' + cellIdIndex;
384
-
385
- this.cssUtil.addClassNames(cell, 'cell');
386
- this.cssUtil.addClassNames(cellValueDiv, 'cellVal');
387
-
388
- with (cell.style) {
389
- width = Element.getStyle(this.getHeaderCell(cell), 'width');
390
- height = Element.getStyle(this.getIdRow(cell.parentNode).cells[0], 'height');
391
- }
392
- with (cellValueDiv.style) {
393
- width = cell.style.width;
394
- height = cell.style.height;
395
- marginTop = '0px';
396
- marginBottom = '0px';
397
- }
398
-
399
- Event.observe(cell, 'click', this.setSelectedCell.bindAsEventListener(this));
400
-
401
- var ajax = new Ajax.InPlaceEditor(cellValueDiv, this.options.cellEditUrl,
402
- {
403
- formClassName: this.cssUtil.joinClassNames('inplaceEditor'),
404
- rows: 2,
405
- cols:12,
406
- okButton: false,
407
- cancelLink:false,
408
- submitOnBlur:true,
409
- hoverClassName: "cellHover",
410
- highlightcolor: "#becfeb",
411
- highlightendcolor: "#becfeb",
412
- onComplete: this.showStateDiv.bind(this),
413
- callback : this.createInplaceEditorParams.bind(this),
414
- formId : cell.id + '_form'
415
- }
416
- );
417
- cellValueDiv.ajax = ajax;
418
- Event.stopObserving(cellValueDiv, 'click', ajax.onclickListener);
419
- Event.stopObserving(cellValueDiv, 'mouseover', ajax.mouseoverListener);
420
- Event.stopObserving(cellValueDiv, 'mouseout', ajax.mouseoutListener);
421
-
422
-
423
- Event.observe(cellValueDiv, 'dblclick', this.setTextAreaSize.bindAsEventListener(this));
424
- if (this.options.hierarchy && cell.cellIndex == this.hierarchyColIndex) {
425
- Event.observe(cellValueDiv, 'dblclick', this.hideStateDiv.bindAsEventListener(this));
426
- }
427
- Event.observe(cellValueDiv, 'dblclick', ajax.onclickListener);
428
-
429
- },
430
-
431
- addColumn: function(index, colTitle, values) {
432
- var headerRow = this.headerTable.rows[0];
433
- var insertIndex = (!isNaN(index)) ? index : this.colLength;
434
- var colIdIndex = this.colLength;
435
- var headerCell = headerRow.insertCell(insertIndex);
436
- this.buildHeaderCell(headerCell, colTitle, insertIndex);
437
-
438
- var rows = this.cellTable.rows;
439
- var idRows = this.idTable.rows;
440
- for (var i = 0; i < rows.length; i++) {
441
-
442
- var cell = rows[i].insertCell(insertIndex);
443
- var cellValue = "";
444
- if (values && values[i]) {
445
- cellValue = values[i];
446
- }
447
- this.buildCell(cell, colIdIndex, cellValue);
448
- }
449
-
450
- this.headerTable.style.width = parseInt(Element.getStyle(this.headerTable, 'width')) + this.options.cellDefaultWidth + 'px';
451
- this.cellTable.style.width = this.headerTable.style.width;
452
-
453
- var sortableOptions = Sortable.options(headerRow);
454
-
455
- sortableOptions.draggables.push(
456
- new Draggable(
457
- headerCell,
458
- {
459
- revert: true,
460
- constraint: true,
461
- scroll: this.element,
462
- handle: Element.getElementsByClassName(headerCell, Grid.className.headerCellDrag)[0]
463
- }
464
- )
465
- );
466
- Droppables.add(headerCell, {overlap:'horizontal', containment:headerRow, onHover:Sortable.onHover, greedy:true});
467
- sortableOptions.droppables.push(headerCell);
468
- this.sortTable.addEvent(Element.getElementsByClassName(headerCell, Grid.className.headerCellSort)[0]);
469
- this.colLength += 1;
470
- },
471
-
472
- deleteColumn : function(index) {
473
- if((isNaN(index)) || index >= this.colLength) {
474
- return;
475
- }
476
- var headerRow = this.headerTable.rows[0];
477
- if (!headerRow) return;
478
- var headerCell = headerRow.cells[index];
479
- if (!headerCell) return;
480
-
481
- var width = headerCell.offsetWidth;
482
- var rows = this.cellTable.rows;
483
- headerRow.deleteCell(index);
484
-
485
- for (var i = 0; i < rows.length; i++) {
486
- rows[i].deleteCell(index);
487
- }
488
-
489
- var headerTableWidth = parseInt(Element.getStyle(this.headerTable, 'width')) - width;
490
-
491
- this.headerTable.style.width = headerTableWidth >= 0 ? headerTableWidth + 'px' : '0px';
492
- this.cellTable.style.width = this.headerTable.style.width;
493
- this.colLength -= 1;
494
- this.fixTablePosition();
495
- },
496
-
497
- addRow : function(index, values) {
498
- var insertIndex = (!isNaN(index)) ? index : this.idTable.rows.length;
499
- var rowIdIndex = this.idTable.rows.length;
500
- var idRow = this.idTable.insertRow(index);
501
- idRow.id = this.rowIdBase + '_id_' + rowIdIndex;
502
- this.buildIdRow(idRow, rowIdIndex);
503
- this.updateId();
504
-
505
- var cellRow = this.cellTable.insertRow(insertIndex);
506
- cellRow.id = this.rowIdBase + rowIdIndex;
507
- this.cssUtil.addClassNames(cellRow, 'cellRow');
508
- var headerCells = this.headerTable.rows[0].cells;
509
-
510
- for (var i = 0; i < headerCells.length; i++) {
511
- var headerCell = headerCells[i];
512
- var colIdIndex = headerCell.id.substring(headerCell.id.indexOf('_col_',0) + '_col_'.length);
513
- var cell = cellRow.insertCell(i);
514
- var cellValue = (values && values[i]) ? values[i] : "";
515
- this.buildCell(cell, colIdIndex, cellValue);
516
- }
517
-
518
- this.sortTable.defaultOrder.insert(index, cellRow);
519
-
520
- var idTbody = this.idTable.tBodies[0];
521
- var sortableOptions = Sortable.options(idTbody);
522
-
523
- sortableOptions.draggables.push(
524
- new Draggable(
525
- idRow,
526
- {
527
- revert: true,
528
- constraint: true,
529
- scroll: this.element,
530
- handle: Element.getElementsByClassName(idRow, Grid.className.idCellVal)[0]
531
- }
532
- )
533
- );
534
- Droppables.add(idRow, {overlap:'vertical', containment:idTbody, onHover:Sortable.onHover, greedy:true});
535
- sortableOptions.droppables.push(idRow);
536
- this.rowLength += 1;
537
- return cellRow;
538
- },
539
-
540
- deleteRow : function(index) {
541
- if(isNaN(index) || index >= this.rowLength) {
542
- return;
543
- }
544
-
545
- var targetId = null;
546
- if (this.cellTable.rows[index])
547
- targetId = this.cellTable.rows[index].id;
548
- else
549
- return;
550
-
551
- this.sortTable.defaultOrder.reverse();
552
- var newOrder = new Array();
553
-
554
- for (var i = 0; this.sortTable.defaultOrder.length > 0; i++) {
555
- var row = this.sortTable.defaultOrder.pop();
556
- if (row.id == targetId) {
557
- continue;
558
- }
559
- newOrder.push(row);
560
- }
561
-
562
- this.sortTable.defaultOrder = newOrder;
563
- this.idTable.deleteRow(index);
564
- this.cellTable.deleteRow(index);
565
-
566
- this.fixTablePosition();
567
- this.rowLength -= 1;
568
- this.updateId();
569
- },
570
-
571
- getHeaderCell : function(cell) {
572
- return this.headerTable.rows[0].cells[cell.cellIndex];
573
- },
574
-
575
- getCells : function(index) {
576
- var rows = this.cellTable.rows;
577
- var columns = new Array();
578
- for (var i = 0; i < rows.length; i++){
579
- columns.push(rows[i].cells[index]);
580
- }
581
- return columns;
582
- },
583
-
584
- getRow : function(index) {
585
- return this.cellTable.rows[index];
586
- },
587
-
588
- getIdRow : function(cellRow) {
589
- var id = cellRow.id;
590
- var index = id.substring(this.rowIdBase.length);
591
- var targetRow = $(this.rowIdBase + '_id_' + index);
592
- return targetRow;
593
- },
594
-
595
- getColTitle : function(index) {
596
- var headerCell = this.headerTable.rows[0].cells[index];
597
- var title = Element.collectTextNodes(headerCell);
598
- return title;
599
- },
600
-
601
- finishSort : function() {
602
- for (var i = 0; i < this.cellTable.rows.length; i++) {
603
- this.idTable.tBodies[0].appendChild(this.getIdRow(this.cellTable.rows[i]));
604
- }
605
- this.updateId();
606
- },
607
-
608
- setSelectedCell : function(event) {
609
- this.removeSelectedClasses();
610
- var src = Event.element(event);
611
-
612
- if (src.tagName.toUpperCase() != 'TH' && src.tagName.toUpperCase() != 'TD') {
613
- src = Element.getParentByTagName(['TH,TD'], src);
614
- }
615
-
616
- this.targetCell = src;
617
-
618
- if (this.targetCell) {
619
- this.targetColIndex = this.targetCell.cellIndex;
620
- this.targetRowIndex = this.targetCell.parentNode.rowIndex;
621
- this.targetColumn = this.getCells(this.targetColIndex);
622
- this.targetRow = this.getRow(this.targetRowIndex);
623
- }
624
-
625
- this.cssUtil.addClassNames(this.targetCell, 'cellSelected');
626
- var childNodes = Element.getTagNodes(this.targetCell, true);
627
- for (var i = 0; i < childNodes.length; i++) {
628
- this.cssUtil.addClassNames(childNodes[i], 'cellSelected');
629
- }
630
- },
631
-
632
- setSelectedColumn : function(event) {
633
- this.removeSelectedClasses();
634
-
635
- this.targetCell = null;
636
- this.targetRowIndex = null;
637
- this.targetRow = null;
638
- this.targetIdRow = null;
639
- var src = Event.element(event);
640
- if (src && (src.tagName.toUpperCase() == 'TH' || src.tagName.toUpperCase() == 'TD')) {
641
- this.targetHeaderCell = src;
642
- } else {
643
- this.targetHeaderCell = Element.getParentByTagName(['TH,TD'], src);
644
- }
645
- if (this.targetHeaderCell) {
646
- this.targetColIndex = this.targetHeaderCell.cellIndex;
647
- this.targetColumn = this.getCells(this.targetColIndex);
648
- this.cssUtil.addClassNames(this.targetHeaderCell, 'cellSelected');
649
- var childNodes = Element.getTagNodes(this.targetHeaderCell, true);
650
- for (var i = 0; i < childNodes.length; i++) {
651
- this.cssUtil.addClassNames(childNodes[i], 'cellSelected');
652
- }
653
- for(var i = 0; i < this.targetColumn.length; i++) {
654
- this.cssUtil.addClassNames(this.targetColumn[i], 'cellSelected');
655
- var cellChildNodes = Element.getTagNodes(this.targetColumn[i], true);
656
- for (var j = 0; j < cellChildNodes.length; j++) {
657
- this.cssUtil.addClassNames(cellChildNodes.length[j], 'cellSelected');
658
- }
659
- }
660
- }
661
- },
662
-
663
- setSelectedRow : function(event) {
664
- this.removeSelectedClasses();
665
- var src = Event.element(event);
666
- if (src && src.tagName.toUpperCase() == 'TR') {
667
- this.targetIdRow = src;
668
- } else {
669
- this.targetIdRow = Element.getParentByTagName(['TR'], src);
670
- }
671
- if (this.targetIdRow) {
672
- this.targetRowIndex = this.targetIdRow.rowIndex;
673
- this.targetRow = this.getRow(this.targetRowIndex);
674
-
675
- this.cssUtil.addClassNames(this.targetRow, 'cellSelected');
676
- var childNodes = Element.getTagNodes(this.targetRow, true);
677
- for (var i = 0; i < childNodes.length; i++) {
678
- this.cssUtil.addClassNames(childNodes[i], 'cellSelected');
679
- }
680
- this.cssUtil.addClassNames(this.targetIdRow, 'cellSelected');
681
- childNodes = Element.getTagNodes(this.targetIdRow, true);
682
- for (var i = 0; i < childNodes.length; i++) {
683
- this.cssUtil.addClassNames(childNodes[i], 'cellSelected');
684
- }
685
- }
686
-
687
- },
688
-
689
- removeSelectedClasses : function() {
690
- if (this.targetHeaderCell) {
691
- this.cssUtil.removeClassNames(this.targetHeaderCell, 'cellSelected');
692
- var childNodes = Element.getTagNodes(this.targetHeaderCell, true);
693
- for (var i = 0; i < childNodes.length; i++) {
694
- this.cssUtil.removeClassNames(childNodes[i], 'cellSelected');
695
- }
696
- for(var i = 0; i < this.targetColumn.length; i++) {
697
- this.cssUtil.removeClassNames(this.targetColumn[i], 'cellSelected');
698
- var cellChildNodes = Element.getTagNodes(this.targetColumn[i], true);
699
- for (var j = 0; j < cellChildNodes.length; j++) {
700
- this.cssUtil.removeClassNames(cellChildNodes.length[j], 'cellSelected');
701
- }
702
- }
703
-
704
- }
705
- if (this.targetCell) {
706
- this.cssUtil.removeClassNames(this.targetCell, 'cellSelected');
707
- var childNodes = Element.getTagNodes(this.targetCell, true);
708
- for (var i = 0; i < childNodes.length; i++) {
709
- this.cssUtil.removeClassNames(childNodes[i], 'cellSelected');
710
- }
711
-
712
- }
713
-
714
- if (this.targetRow) {
715
- this.cssUtil.removeClassNames(this.targetRow, 'cellSelected');
716
- var childNodes = Element.getTagNodes(this.targetRow, true);
717
- for (var i = 0; i < childNodes.length; i++) {
718
- this.cssUtil.removeClassNames(childNodes[i], 'cellSelected');
719
- }
720
- this.cssUtil.removeClassNames(this.targetIdRow, 'cellSelected');
721
- childNodes = Element.getTagNodes(this.targetIdRow, true);
722
- for (var i = 0; i < childNodes.length; i++) {
723
- this.cssUtil.removeClassNames(childNodes[i], 'cellSelected');
724
- }
725
- }
726
-
727
- this.targetHeaderCell = null;
728
- this.targetColumn = null;
729
- this.targetColIndex = null;
730
- this.targetCell = null;
731
- this.targetRowIndex = null;
732
- this.targetRow = null;
733
- this.targetIdRow = null;
734
- },
735
-
736
- updateId : function() {
737
- var rows = this.idTable.rows;
738
- for (var i = 0; i < rows.length; i++) {
739
- var idValue = document.getElementsByClassName(this.custumCss.idCellVal, rows[i])[0];
740
-
741
- idValue.innerHTML = i + 1;
742
- }
743
- },
744
-
745
- updateRowLine : function(target) {
746
- var targetCellRow = this.cellTable.rows[this.targetRowIndex];
747
- var updateRowIndex = this.targetIdRow.rowIndex;
748
- var cellTableBody = targetCellRow.parentNode;
749
- var cellTableRows = cellTableBody.rows;
750
-
751
- if (this.options.hierarchy) {
752
- var checkRow = cellTableBody.rows[this.targetIdRow.rowIndex];
753
- if (this.isParentRow(checkRow, targetCellRow)) {
754
- var idBody = this.idTable.tBodies[0];
755
- idBody.insertBefore(this.targetIdRow, idBody.rows[this.targetRowIndex]);
756
- return;
757
- }
758
- }
759
- if (updateRowIndex == cellTableRows.length - 1) {
760
- cellTableBody.appendChild(targetCellRow);
761
- } else if (this.targetRowIndex < updateRowIndex) {
762
- cellTableBody.insertBefore(targetCellRow, cellTableRows[updateRowIndex + 1]);
763
- } else {
764
- cellTableBody.insertBefore(targetCellRow, cellTableRows[updateRowIndex]);
765
- }
766
- if (this.options.hierarchy) {
767
- this.updateOutline(targetCellRow);
768
- }
769
- this.targetRowIndex = updateRowIndex;
770
- this.updateId();
771
- },
772
- updateCellLine : function(target){
773
- var targetCells = this.getCells(this.targetColIndex);
774
- var updateColIndex = this.targetHeaderCell.cellIndex;
775
-
776
- var rows = this.cellTable.rows;
777
-
778
- for (var i = 0; i < rows.length; i++) {
779
- var cells = rows[i].cells;
780
- var targetCell = targetCells[i];
781
-
782
- if (updateColIndex == cells.length -1) {
783
- rows[i].appendChild(targetCell);
784
- } else if (this.targetColIndex < updateColIndex) {
785
- rows[i].insertBefore(targetCell, cells[updateColIndex + 1]);
786
- } else {
787
- rows[i].insertBefore(targetCell, cells[updateColIndex]);
788
- }
789
- }
790
- this.targetColIndex = updateColIndex;
791
- },
792
-
793
- updateCellWidth : function(newStyle, headColumn) {
794
-
795
- if(newStyle.width > this.options.cellMinWidth) {
796
- var dragDiv = Element.getElementsByClassName(headColumn, Grid.className.headerCellDrag)[0];
797
- var sortDiv = Element.getElementsByClassName(headColumn, Grid.className.headerCellSort)[0];
798
- var val = newStyle.width - (parseInt(Element.getStyle(headColumn, 'width')));
799
-
800
- val = parseInt(val);
801
-
802
- this.headerTable.style.width = (parseInt(Element.getStyle(this.headerTable, 'width')) + val) + 'px';
803
-
804
- dragDiv.style.width = newStyle.width - (this.marginSize * 2) + 'px';
805
- sortDiv.style.width = parseInt(Element.getStyle(dragDiv, 'width')) - (this.marginSize * 2) + 'px';
806
-
807
- var index = headColumn.cellIndex ;
808
- var rows = this.cellTable.rows;
809
-
810
- this.cellTable.style.width = this.headerTable.style.width
811
-
812
- for(var i = 0; i < rows.length; i++){
813
- var cell = rows[i].cells[index];
814
- var cellValueDiv = Element.getElementsByClassName(cell, Grid.className.cellVal)[0];
815
- cellValueDiv.style.width = newStyle.width + 'px';
816
- cell.style.width = newStyle.width + 'px';
817
- }
818
-
819
- }
820
- },
821
-
822
- updateCellHeight : function(newStyle, idCell) {
823
- if(newStyle.height > this.options.cellMinHeight) {
824
- var row = idCell.parentNode;
825
- var index = row.rowIndex;
826
- var idValueDiv = Element.getElementsByClassName(idCell, Grid.className.idCellVal)[0];
827
- idValueDiv.style.height = newStyle.height - (this.marginSize * 2) + 'px';
828
- var padding = parseInt(idValueDiv.style.paddingTop);
829
- var cellRow = this.cellTable.rows[index];
830
- var cells = cellRow.cells;
831
- for (var i = 0; i < cells.length; i++) {
832
- cells[i].style.height = newStyle.height + 'px';
833
- var cellValueDiv = Element.getElementsByClassName(cells[i], Grid.className.cellVal)[0];
834
- cellValueDiv.style.height = newStyle.height + 'px';
835
- }
836
- }
837
- },
838
-
839
- setTextAreaSize : function(event) {
840
- var target = Event.element(event);
841
- var rows = parseInt(Element.getStyle(target, 'height'));
842
- var cols = parseInt(Element.getStyle(target, 'width'));
843
- target.ajax.options.rows = Math.round(rows/20);
844
- target.ajax.options.cols = Math.round(cols/20);
845
- },
846
-
847
- fixTablePosition : function(event) {
848
- Grid.scrollTop = this.element.scrollTop;
849
- Grid.scrollLeft = this.element.scrollLeft;
850
- this.baseTable.style.top = Grid.scrollTop + 'px';
851
- this.baseTable.style.left = Grid.scrollLeft + 'px';
852
- this.headerTable.style.top = Grid.scrollTop + 'px';
853
- this.idTable.style.left = Grid.scrollLeft + 'px';
854
- },
855
-
856
- //----------ajax request param method---------------------------------------------------------------------------
857
- createInplaceEditorParams : function(form, value) {
858
- var rowIndexEnd = form.id.indexOf('_col_', 0);
859
- var rowIndex = form.id.substring(this.rowIdBase.length, rowIndexEnd);
860
-
861
- var colIndexStart = rowIndexEnd + '_col_'.length;
862
- var colIndexEnd = form.id.indexOf('_form', 0);
863
- var colIndex = form.id.substring(colIndexStart, colIndexEnd);
864
- var jsonRowObj = this.rowDataToJsonObj(rowIndex);
865
-
866
- var targetColTitle = this.getColTitle(colIndex);
867
- jsonRowObj.each(function(j) {
868
- if (j.column == targetColTitle) {
869
- j.value = value;
870
- throw $break;
871
- }
872
- });
873
- var jsonRowText = JSON.stringify(jsonRowObj);
874
- var params = {
875
- rowData: jsonRowText,
876
- column: targetColTitle,
877
- value: value
878
- };
879
- return $H(params).toQueryString();
880
- },
881
-
882
- gridDataToJsonObj : function() {
883
- var rows = this.cellTable.rows;
884
- var jsonDataList = [];
885
- for (var i = 0; i < this.rowLength; i++) {
886
- var rowData = this.rowDataToJsonObj(i);
887
- jsonDataList.push(rowData);
888
- }
889
- return jsonDataList;
890
- },
891
-
892
- rowDataToJsonObj : function(index) {
893
- var jsonRowObj = [];
894
- var row = $A(this.cellTable.rows).detect(function(r) {return r.id.getSuffix() == index});
895
- for (var i = 0; i < this.colLength; i++) {
896
- var jsonCellObj = {};
897
- jsonCellObj['column'] = this.getColTitle(i);
898
- jsonCellObj['value'] = Element.collectTextNodes(row.cells[i]);
899
- jsonRowObj.push(jsonCellObj);
900
- }
901
- return jsonRowObj;
902
- },
903
-
904
- updateGridData : function() {
905
-
906
- var jsonDataText = JSON.stringify(this.gridDataToJsonObj());
907
- var params = 'id=' + encodeURIComponent(this.element.id) + '&data=' + encodeURIComponent(jsonDataText);
908
-
909
- new Ajax.Updater(
910
- this.options.updateGridReceiver,
911
- this.options.updateGridUrl,
912
- {
913
- parameters: params,
914
- evalScripts: true, asynchronous:true
915
-
916
- }
917
- );
918
- },
919
-
920
- //----------hierarchy grid method---------------------------------------------------------------------------
921
- setHierarchyRow : function(row, outlineLevel, outlineNum){
922
- row.outlineLevel = outlineLevel || 1;
923
- row.list = row.list || new Array();
924
- if (row.outlineLevel == 1) {
925
- this.topLevelList.push(row);
926
- row.outlineNum = outlineNum || this.topLevelList.length;
927
- } else {
928
- var parentRow = this.getParentRow(row);
929
- parentRow.list.push(row);
930
- var num = parentRow.length;
931
- row.outlineNum = outlineNum || parentRow.outlineNum + '.' + parentRow.list.length;
932
-
933
- }
934
-
935
- this.buildStateDiv(row.cells[this.hierarchyColIndex]);
936
- this.setOutlineIndent(row);
937
- this.setFontWeight(row);
938
- },
939
-
940
- buildStateDiv : function (cell) {
941
- var stateDiv = Builder.node('div');
942
- var valueDiv = Element.getElementsByClassName(cell, Grid.className.cellVal)[0];
943
- this.cssUtil.addClassNames(stateDiv, 'state');
944
- cell.insertBefore(stateDiv, valueDiv);
945
-
946
- if (document.all) {
947
- stateDiv.style.position = "absolute";
948
- } else {
949
- stateDiv.style.position = "relative";
950
- stateDiv.style.cssFloat = "left";
951
- }
952
- this.addStateClass(cell, stateDiv);
953
- Event.observe(stateDiv, 'click', this.toggleState.bindAsEventListener(this));
954
- },
955
-
956
- addStateClass : function (cell, stateDiv) {
957
- var row = cell.parentNode;
958
- if (row.list.length == 0) {
959
- this.cssUtil.addClassNames(stateDiv, 'stateEmpty');
960
- } else if (this.options.open){
961
- this.cssUtil.addClassNames(stateDiv, 'stateOpen');
962
- } else {
963
- this.cssUtil.addClassNames(stateDiv, 'stateClose');
964
- this.closeRow(row);
965
- }
966
- },
967
-
968
- toggleState : function(event) {
969
- var src = Event.element(event);
970
- var row = src.parentNode.parentNode;
971
-
972
- if (!Element.hasClassName(src, Grid.className.stateEmpty)) {
973
- if (Element.hasClassName(src, Grid.className.stateOpen)) {
974
- this.closeRow(row.list);
975
- this.cssUtil.removeClassNames(src, 'stateOpen');
976
- this.cssUtil.addClassNames(src, 'stateClose');
977
- } else {
978
- this.openRow(row.list);
979
- this.cssUtil.removeClassNames(src, 'stateClose');
980
- this.cssUtil.addClassNames(src, 'stateOpen');
981
- }
982
- }
983
- },
984
-
985
- openRow : function(list) {
986
- for (var i = 0; i < list.length; i++) {
987
- var row = list[i];
988
- Element.show(row);
989
- Element.show(this.getIdRow(row));
990
- var stateDiv = Element.getElementsByClassName(row.cells[this.hierarchyColIndex], Grid.className.state)[0];
991
- if (Element.hasClassName(stateDiv, Grid.className.stateOpen)) {
992
- this.openRow(row.list)
993
- }
994
- }
995
- },
996
-
997
- closeRow : function(list) {
998
- for (var i = 0; i < list.length; i++) {
999
- Element.hide(list[i]);
1000
- Element.hide(this.getIdRow(list[i]));
1001
- this.closeRow(list[i].list)
1002
- }
1003
- },
1004
-
1005
-
1006
- showStateDiv : function(transport, element) {
1007
- var row = Element.getParentByTagName(['TR'], element);
1008
- var state = Element.getElementsByClassName(row, Grid.className.state)[0];
1009
- Element.show(state);
1010
- },
1011
-
1012
- hideStateDiv : function(event) {
1013
- var src = Event.element(event);
1014
- var row = Element.getParentByTagName(['TR'], src);
1015
- var state = Element.getElementsByClassName(row, Grid.className.state)[0];
1016
-
1017
- Element.hide(state);
1018
- },
1019
-
1020
- addHierarchyRow : function(index, values) {
1021
- if (this.colLength == 0) {
1022
- return;
1023
- }
1024
- var newRow = this.addRow(index, values);
1025
-
1026
- newRow.list = new Array();
1027
- var previousRow = newRow.previousSibling;
1028
- var parentRow = null;
1029
- var parentList = null;
1030
- var insertIndex = 0;
1031
- if (!previousRow) {
1032
- newRow.outlineLevel = 1;
1033
- parentList = this.topLevelList;
1034
- } else if (previousRow.list.length > 0) {
1035
- newRow.outlineLevel = previousRow.outlineLevel + 1;
1036
- parentRow = previousRow;
1037
- parentList = parentRow.list;
1038
- } else {
1039
- newRow.outlineLevel = previousRow.outlineLevel;
1040
- parentRow = this.getParentRow(previousRow);
1041
- parentList = parentRow ? parentRow.list : this.topLevelList;
1042
- insertIndex = parentList.indexOf(previousRow) + 1;
1043
- }
1044
- parentList.insert(insertIndex, newRow);
1045
- this.buildStateDiv(newRow.cells[this.hierarchyColIndex]);
1046
- for (var i = insertIndex; i < parentList.length; i++) {
1047
- if (parentList[i].outlineLevel != 1) {
1048
- parentList[i].outlineNum = parentRow.outlineNum + '.' + (i + 1);
1049
- } else {
1050
- parentList[i].outlineNum = i + 1;
1051
- }
1052
- this.setOutline(parentList[i]);
1053
- }
1054
-
1055
- },
1056
-
1057
- deleteHierarchyRow : function(index) {
1058
- if(isNaN(index) || index >= this.rowLength) {
1059
- return;
1060
- }
1061
- var row = this.getRow(index);
1062
- if (!row) {
1063
- return;
1064
- }
1065
- var parentRow = this.getParentRow(row);
1066
- var parentList = parentRow ? parentRow.list : this.topLevelList;
1067
- var removeIndex = parentList.indexOf(row);
1068
- var childList = row.list;
1069
-
1070
- for (var i = 0; i < childList.length; i++) {
1071
- this.deleteChildRow(childList[i]);
1072
- }
1073
- parentList.remove(removeIndex);
1074
- this.deleteRow(index);
1075
-
1076
- for (var i = removeIndex; i < parentList.length; i++) {
1077
- var updateRow = parentList[i];
1078
- if (updateRow.outlineLevel == 1) {
1079
- updateRow.outlineNum = i + 1;
1080
- } else {
1081
- updateRow.outlineNum = this.getParentRow(updateRow).outlineNum + '.' + (i + 1);
1082
- }
1083
- this.setOutline(parentList[i]);
1084
- }
1085
- this.setFontWeight(parentRow);
1086
- },
1087
-
1088
- deleteChildRow : function(childRow) {
1089
- var list = childRow.list;
1090
-
1091
- for (var i = 0; i < list.length; i++) {
1092
- this.deleteChildRow(list[i]);
1093
- }
1094
- this.deleteRow(childRow.rowIndex);
1095
- },
1096
-
1097
- levelUp : function(row) {
1098
- if (!row) {
1099
- return;
1100
- }
1101
- var previousRow = row.previousSibling;
1102
- if (row.outlineLevel == 1 || !previousRow) {
1103
- return;
1104
- }
1105
-
1106
- var parentRow = this.getParentRow(row);
1107
- var currentList = parentRow.list;
1108
-
1109
- var newParentRow = this.getParentRow(parentRow);
1110
- var targetList = newParentRow ? newParentRow.list : this.topLevelList;
1111
-
1112
- var currentIndex = currentList.indexOf(row);
1113
- var targetIndex = targetList.indexOf(parentRow) + 1;
1114
-
1115
- row.outlineLevel -= 1;
1116
- targetList.insert(targetIndex, row);
1117
- currentList.remove(currentIndex);
1118
-
1119
- while (currentList[currentIndex]) {
1120
- var moveRow = currentList[currentIndex];
1121
- row.list.push(moveRow);
1122
- currentList.remove(currentIndex);
1123
- }
1124
-
1125
- if (row.outlineLevel != 1) {
1126
- row.outlineNum = newParentRow.outlineNum + '.' + (targetIndex + 1);
1127
- } else {
1128
- row.outlineNum = targetIndex + 1;
1129
- }
1130
-
1131
- this.setOutline(row);
1132
-
1133
- for (var i = targetIndex + 1; i < targetList.length; i++) {
1134
- if (targetList[i].outlineLevel != 1) {
1135
- targetList[i].outlineNum = newParentRow.outlineNum + '.' + (i + 1);
1136
- } else {
1137
- targetList[i].outlineNum = i + 1;
1138
- }
1139
- this.setOutline(targetList[i]);
1140
- }
1141
-
1142
- this.setFontWeight(row);
1143
- this.setFontWeight(parentRow);
1144
- this.setFontWeight(newParentRow);
1145
- this.setStateClass(row);
1146
- this.setStateClass(previousRow);
1147
- },
1148
-
1149
- levelDown : function(row) {
1150
- if (!row) {
1151
- return;
1152
- }
1153
- var previousRow = row.previousSibling;
1154
- var parentRow = this.getParentRow(row);
1155
- if (!previousRow || parentRow == previousRow) {
1156
- return;
1157
- }
1158
- var currentList = (row.outlineLevel == 1) ? this.topLevelList : parentRow.list;
1159
- var currentIndex = currentList.indexOf(row);
1160
-
1161
- row.outlineLevel += 1;
1162
-
1163
- var newParentRow = this.getParentRow(row);
1164
- var targetList = newParentRow.list;
1165
- var targetIndex = targetList.length;
1166
-
1167
- currentList.remove(currentIndex);
1168
- targetList.push(row);
1169
-
1170
- row.outlineNum = newParentRow.outlineNum + '.' + (targetIndex + 1);
1171
- this.setOutline(row);
1172
- for (var i = currentIndex; i < currentList.length; i++) {
1173
- if (currentList[i].outlineLevel != 1) {
1174
- currentList[i].outlineNum = parentRow.outlineNum + '.' + (i + 1);
1175
- } else {
1176
- currentList[i].outlineNum = i + 1;
1177
- }
1178
- this.setOutline(currentList[i]);
1179
- }
1180
-
1181
- for (var i = targetIndex + 1; i < targetList.length; i++) {
1182
- targetList[i].outlineNum = newParentRow.outlineNum + '.' + (i + 1);
1183
- this.setOutline(targetList[i]);
1184
- }
1185
-
1186
- this.setFontWeight(row);
1187
- this.setFontWeight(parentRow);
1188
- this.setFontWeight(newParentRow);
1189
- this.setStateClass(row);
1190
- this.setStateClass(previousRow);
1191
-
1192
- },
1193
-
1194
- setStateClass : function(row) {
1195
- if (!row.list) return;
1196
- var stateDiv = Element.getElementsByClassName(row.cells[this.hierarchyColIndex], Grid.className.state)[0];
1197
-
1198
- if (Element.hasClassName(stateDiv, Grid.className.stateEmpty) && row.list.length > 0) {
1199
- this.cssUtil.removeClassNames(stateDiv, 'stateEmpty');
1200
- this.cssUtil.addClassNames(stateDiv, 'stateOpen');
1201
- } else if (!Element.hasClassName(stateDiv, Grid.className.stateEmpty) && row.list.length == 0) {
1202
- this.cssUtil.removeClassNames(stateDiv, 'stateOpen');
1203
- this.cssUtil.addClassNames(stateDiv, 'stateEmpty');
1204
- }
1205
- },
1206
-
1207
- setOutline : function(row) {
1208
- var childList = row.list;
1209
- if (!childList) return;
1210
- for(var i = 0; i < childList.length; i++) {
1211
- var childRow = childList[i];
1212
- childRow.outlineLevel = row.outlineLevel + 1;
1213
- childRow.outlineNum = row.outlineNum + '.' + (i + 1);
1214
- this.setOutline(childRow);
1215
- }
1216
- this.setOutlineIndent(row);
1217
- },
1218
-
1219
- setOutlineIndent : function(row) {
1220
- var cell = row.cells[this.hierarchyColIndex];
1221
- if (!cell) {
1222
- return;
1223
- }
1224
- var cellValueDiv = Element.getElementsByClassName(cell, Grid.className.cellVal)[0];
1225
- var stateDiv = Element.getElementsByClassName(cell, Grid.className.state)[0];
1226
- if (!stateDiv) return;
1227
- var stateDivWidth = stateDiv.offsetWidth || this.stateDivWidth;
1228
- var left = this.options.hierarchyIndent * (row.outlineLevel - 1);
1229
- var valueLeft = document.all ? left + stateDivWidth : left;
1230
- cellValueDiv.style.left = valueLeft + 'px';
1231
- stateDiv.style.left = left + 'px';
1232
- },
1233
-
1234
- setFontWeight : function(row) {
1235
- if (row) {
1236
- if (!row.list) return;
1237
- if (row.list.length > 0){
1238
- row.style.fontWeight = 'bold';
1239
- } else {
1240
- row.style.fontWeight = 'normal';
1241
- }
1242
- }
1243
- },
1244
-
1245
- updateOutline : function(row) {
1246
- var previousRow = row.previousSibling;
1247
- var newParentRow = null;
1248
- var insertIndex = 0;
1249
- var newParentList = null;
1250
-
1251
- if (!previousRow.list) return;
1252
- if (!previousRow) {
1253
- newParentList = this.topLevelList;
1254
- }else if(previousRow.list.length > 0) {
1255
- newParentRow = previousRow;
1256
- newParentList = newParentRow.list;
1257
- } else {
1258
- newParentRow = this.getParentRow(previousRow);
1259
- newParentList = newParentRow ? newParentRow.list : this.topLevelList;
1260
- insertIndex = newParentList.indexOf(previousRow) + 1;
1261
- }
1262
- var parentRow = this.getParentRowByIndex(row, this.targetRowIndex);
1263
- var parentList = null;
1264
-
1265
- var outlineNumBase = '';
1266
- if (parentRow) {
1267
- parentList = parentRow.list;
1268
- outlineNumBase = parentRow.outlineNum + '.';
1269
- } else {
1270
- parentList = this.topLevelList;
1271
- if (!parentList) return;
1272
- }
1273
- var removeIndex = parentList.indexOf(row);
1274
-
1275
- if (parentList == newParentList && removeIndex < insertIndex) {
1276
- insertIndex -= 1;
1277
- parentList.remove(removeIndex);
1278
- parentList.insert(insertIndex, row);
1279
- for (var i = removeIndex; i < parentList.length; i++) {
1280
- try {
1281
- parentList[i].outlineNum = outlineNumBase + (i + 1);
1282
- this.setOutline(parentList[i]);
1283
- } catch (e) {}
1284
- }
1285
-
1286
- } else {
1287
- parentList.remove(removeIndex);
1288
- newParentList.insert(insertIndex, row);
1289
- for (var i = removeIndex; i < parentList.length; i++) {
1290
- parentList[i].outlineNum = outlineNumBase + (i + 1);
1291
- this.setOutline(parentList[i]);
1292
- }
1293
- var newOutlineNumBase = newParentRow ? newParentRow.outlineNum + '.' : '';
1294
- var newOutlineLevelBase = newParentRow ? newParentRow.outlineLevel : 0;
1295
- row.outlineNum = newOutlineNumBase + (insertIndex + 1);
1296
- row.outlineLevel = newOutlineLevelBase + 1;
1297
- for (var i = insertIndex; i < newParentList.length; i++) {
1298
- newParentList[i].outlineNum = newOutlineNumBase + (i + 1);
1299
- this.setOutline(newParentList[i]);
1300
- }
1301
- this.setOutline(row);
1302
- }
1303
- this.setFontWeight(row);
1304
- this.setStateClass(row);
1305
- if (parentRow) {
1306
- this.setFontWeight(parentRow);
1307
- this.setStateClass(parentRow);
1308
- }
1309
- if (newParentRow) {
1310
- this.setFontWeight(newParentRow);
1311
- this.setStateClass(newParentRow);
1312
- }
1313
- this.updateHierarchyRowLine(row);
1314
- },
1315
-
1316
- updateHierarchyRowLine : function(row, existingRow) {
1317
- if (!row.list) return;
1318
- var rowIndex = row.rowIndex;
1319
- var cellBody = this.cellTable.tBodies[0];
1320
- var idBody = this.idTable.tBodies[0];
1321
- if (!existingRow) {
1322
- existingRow = cellBody.rows[rowIndex + 1]
1323
- }
1324
-
1325
- for (var i = 0; i < row.list.length; i++) {
1326
- if (!existingRow) {
1327
- cellBody.appendChild(row.list[i]);
1328
- idBody.appendChild(this.getIdRow(row.list[i]));
1329
- } else {
1330
- cellBody.insertBefore(row.list[i], existingRow);
1331
- idBody.insertBefore(this.getIdRow(row.list[i]), this.getIdRow(existingRow));
1332
- }
1333
- this.updateHierarchyRowLine(row.list[i], existingRow);
1334
- }
1335
- },
1336
-
1337
- getParentRow : function(row) {
1338
- if (row.outlineLevel == 1) {
1339
- return null;
1340
- }
1341
-
1342
- var previousRow = row.previousSibling;
1343
- if (!previousRow) {
1344
- return null;
1345
- }
1346
- try {
1347
- while (previousRow.outlineLevel != (row.outlineLevel - 1)) {
1348
- previousRow = previousRow.previousSibling;
1349
- }
1350
- return previousRow;
1351
- } catch (e) {}
1352
- },
1353
-
1354
- getParentRowByIndex : function(row, index) {
1355
- if (row.outlineLevel == 1) {
1356
- return null;
1357
- }
1358
- if (this.targetRowIndex) {
1359
- for(var i = 0; i < this.targetRowIndex + 1; i++) {
1360
- if (!this.cellTable.rows[i].list) return;
1361
- if (this.cellTable.rows[i].list.indexOf(row) != -1) {
1362
- return this.cellTable.rows[i];
1363
- }
1364
- }
1365
- }
1366
- return null;
1367
- },
1368
-
1369
- getPreviousRootRow : function(row) {
1370
- var previousRow = row.previousSibling;
1371
- if (!previousRow) {
1372
- return;
1373
- }
1374
- while (previousRow.outlineLevel != 1) {
1375
- previousRow = previousRow.previousSibling;
1376
- }
1377
-
1378
- return previousRow;
1379
- },
1380
-
1381
- isParentRow : function(row, parentRow) {
1382
- var temp = this.getParentRow(row);
1383
- if (!temp) {
1384
- return false;
1385
- } else if (temp == parentRow) {
1386
- return true;
1387
- } else {
1388
- return this.isParentRow(temp, parentRow);
1389
- }
1390
- }
1391
- }