activeldap 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +454 -0
- data/COPYING +340 -0
- data/LICENSE +58 -0
- data/README +101 -0
- data/Rakefile +175 -0
- data/TODO +25 -0
- data/benchmark/bench-al.rb +202 -0
- data/benchmark/config.yaml.sample +5 -0
- data/data/locale/en/LC_MESSAGES/active-ldap.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/active-ldap.mo +0 -0
- data/examples/al-admin/README +182 -0
- data/examples/al-admin/Rakefile +10 -0
- data/examples/al-admin/app/controllers/account_controller.rb +59 -0
- data/examples/al-admin/app/controllers/application.rb +34 -0
- data/examples/al-admin/app/controllers/attributes_controller.rb +17 -0
- data/examples/al-admin/app/controllers/directory_controller.rb +47 -0
- data/examples/al-admin/app/controllers/object_classes_controller.rb +17 -0
- data/examples/al-admin/app/controllers/syntaxes_controller.rb +17 -0
- data/examples/al-admin/app/controllers/users_controller.rb +51 -0
- data/examples/al-admin/app/controllers/welcome_controller.rb +10 -0
- data/examples/al-admin/app/helpers/account_helper.rb +2 -0
- data/examples/al-admin/app/helpers/application_helper.rb +42 -0
- data/examples/al-admin/app/helpers/attributes_helper.rb +15 -0
- data/examples/al-admin/app/helpers/directory_helper.rb +7 -0
- data/examples/al-admin/app/helpers/object_classes_helper.rb +10 -0
- data/examples/al-admin/app/helpers/syntaxes_helper.rb +10 -0
- data/examples/al-admin/app/helpers/url_helper.rb +13 -0
- data/examples/al-admin/app/helpers/users_helper.rb +17 -0
- data/examples/al-admin/app/helpers/welcome_helper.rb +2 -0
- data/examples/al-admin/app/models/entry.rb +23 -0
- data/examples/al-admin/app/models/ldap_user.rb +54 -0
- data/examples/al-admin/app/models/user.rb +91 -0
- data/examples/al-admin/app/views/_entry/_attributes_information.rhtml +23 -0
- data/examples/al-admin/app/views/_entry/_entry.rhtml +15 -0
- data/examples/al-admin/app/views/_schema/_aliases.rhtml +7 -0
- data/examples/al-admin/app/views/_switcher/_after.rhtml +2 -0
- data/examples/al-admin/app/views/_switcher/_before.rhtml +5 -0
- data/examples/al-admin/app/views/account/login.rhtml +26 -0
- data/examples/al-admin/app/views/account/sign_up.rhtml +28 -0
- data/examples/al-admin/app/views/attributes/_attributes.rhtml +19 -0
- data/examples/al-admin/app/views/attributes/_detail.rhtml +29 -0
- data/examples/al-admin/app/views/attributes/index.rhtml +3 -0
- data/examples/al-admin/app/views/attributes/show.rhtml +31 -0
- data/examples/al-admin/app/views/directory/_tree.rhtml +10 -0
- data/examples/al-admin/app/views/directory/_tree_view_js.rhtml +26 -0
- data/examples/al-admin/app/views/directory/index.rhtml +13 -0
- data/examples/al-admin/app/views/directory/populate.rhtml +2 -0
- data/examples/al-admin/app/views/layouts/_flash_box.rhtml +4 -0
- data/examples/al-admin/app/views/layouts/_footer.rhtml +9 -0
- data/examples/al-admin/app/views/layouts/_header_menu.rhtml +10 -0
- data/examples/al-admin/app/views/layouts/_main_menu.rhtml +18 -0
- data/examples/al-admin/app/views/layouts/application.rhtml +56 -0
- data/examples/al-admin/app/views/object_classes/_attributes.rhtml +28 -0
- data/examples/al-admin/app/views/object_classes/_object_classes.rhtml +19 -0
- data/examples/al-admin/app/views/object_classes/index.rhtml +3 -0
- data/examples/al-admin/app/views/object_classes/show.rhtml +39 -0
- data/examples/al-admin/app/views/syntaxes/_detail.rhtml +14 -0
- data/examples/al-admin/app/views/syntaxes/_syntaxes.rhtml +19 -0
- data/examples/al-admin/app/views/syntaxes/index.rhtml +3 -0
- data/examples/al-admin/app/views/syntaxes/show.rhtml +22 -0
- data/examples/al-admin/app/views/users/_attributes_update_form.rhtml +30 -0
- data/examples/al-admin/app/views/users/_form.rhtml +13 -0
- data/examples/al-admin/app/views/users/_object_classes_update_form.rhtml +40 -0
- data/examples/al-admin/app/views/users/_password_change_form.rhtml +20 -0
- data/examples/al-admin/app/views/users/edit.rhtml +15 -0
- data/examples/al-admin/app/views/users/index.rhtml +10 -0
- data/examples/al-admin/app/views/users/show.rhtml +11 -0
- data/examples/al-admin/app/views/welcome/index.rhtml +13 -0
- data/examples/al-admin/config/boot.rb +45 -0
- data/examples/al-admin/config/database.yml.example +19 -0
- data/examples/al-admin/config/environment.rb +70 -0
- data/examples/al-admin/config/environments/development.rb +21 -0
- data/examples/al-admin/config/environments/production.rb +18 -0
- data/examples/al-admin/config/environments/test.rb +19 -0
- data/examples/al-admin/config/ldap.yml.example +21 -0
- data/examples/al-admin/config/routes.rb +46 -0
- data/examples/al-admin/db/migrate/001_create_users.rb +16 -0
- data/examples/al-admin/lib/accept_http_rails_relative_url_root.rb +9 -0
- data/examples/al-admin/lib/authenticated_system.rb +124 -0
- data/examples/al-admin/lib/authenticated_test_helper.rb +113 -0
- data/examples/al-admin/lib/tasks/gettext.rake +35 -0
- data/examples/al-admin/po/en/al-admin.po +341 -0
- data/examples/al-admin/po/ja/al-admin.po +341 -0
- data/examples/al-admin/po/nl/al-admin.po +373 -0
- data/examples/al-admin/public/.htaccess +40 -0
- data/examples/al-admin/public/404.html +30 -0
- data/examples/al-admin/public/500.html +30 -0
- data/examples/al-admin/public/dispatch.cgi +10 -0
- data/examples/al-admin/public/dispatch.fcgi +24 -0
- data/examples/al-admin/public/dispatch.rb +10 -0
- data/examples/al-admin/public/favicon.ico +0 -0
- data/examples/al-admin/public/images/active-ldap.svg +6351 -0
- data/examples/al-admin/public/images/al-admin.png +0 -0
- data/examples/al-admin/public/images/al-admin.svg +6371 -0
- data/examples/al-admin/public/images/header-background.png +0 -0
- data/examples/al-admin/public/images/header-background.svg +99 -0
- data/examples/al-admin/public/images/rails.png +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_left_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_left_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_middle_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_middle_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_right_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_right_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_bottom_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_bottom_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_bottom_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_left_down_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_left_up_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_middle_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_middle_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_right_down_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_right_up_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_top_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_top_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_top_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/barchart_h.gif +0 -0
- data/examples/al-admin/public/images/spinelz/barchart_v.gif +0 -0
- data/examples/al-admin/public/images/spinelz/button.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_default_handler.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_delete.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_next_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_pre.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_pre_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_private_icon.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_schedule.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calender_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calender_back_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_back_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_next_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_pre.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_pre_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_back_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_next_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_pre.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_pre_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/grid_down.gif +0 -0
- data/examples/al-admin/public/images/spinelz/grid_state.gif +0 -0
- data/examples/al-admin/public/images/spinelz/grid_up.gif +0 -0
- data/examples/al-admin/public/images/spinelz/icon_day.gif +0 -0
- data/examples/al-admin/public/images/spinelz/icon_month.gif +0 -0
- data/examples/al-admin/public/images/spinelz/icon_week.gif +0 -0
- data/examples/al-admin/public/images/spinelz/menubar_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/menubar_subcontents_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_left_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_left_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_middle_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_middle_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_right_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_right_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/select_date.gif +0 -0
- data/examples/al-admin/public/images/spinelz/selectabletable_selected.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_about.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_menu.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_sample.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabBottomActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabBottomInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleActive2.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleInactive2.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabTopActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabTopInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabbar.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sortableTable_down.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sortableTable_normal.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sortableTable_up.gif +0 -0
- data/examples/al-admin/public/images/spinelz/switcher_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/switcher_open.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabLeftActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabLeftInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabMiddleActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabMiddleInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabRightActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabRightInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tab_bar.gif +0 -0
- data/examples/al-admin/public/images/spinelz/table_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/timepicker_clock.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_max.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_min.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_dir.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_file.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_group.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_group_special.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_state.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_user.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_bottom_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_bottom_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_bottom_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_max.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_middle_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_middle_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_min.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_top_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_top_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_top_right.gif +0 -0
- data/examples/al-admin/public/javascripts/application.js +2 -0
- data/examples/al-admin/public/javascripts/controls.js +833 -0
- data/examples/al-admin/public/javascripts/dragdrop.js +942 -0
- data/examples/al-admin/public/javascripts/effects.js +1088 -0
- data/examples/al-admin/public/javascripts/prototype.js +2515 -0
- data/examples/al-admin/public/javascripts/spinelz/accordion.js +185 -0
- data/examples/al-admin/public/javascripts/spinelz/ajaxHistory.js +157 -0
- data/examples/al-admin/public/javascripts/spinelz/balloon.js +287 -0
- data/examples/al-admin/public/javascripts/spinelz/barchart.js +524 -0
- data/examples/al-admin/public/javascripts/spinelz/calendar.js +3012 -0
- data/examples/al-admin/public/javascripts/spinelz/colorpicker.js +128 -0
- data/examples/al-admin/public/javascripts/spinelz/datepicker.js +438 -0
- data/examples/al-admin/public/javascripts/spinelz/grid.js +1391 -0
- data/examples/al-admin/public/javascripts/spinelz/grid_resizeEx.js +100 -0
- data/examples/al-admin/public/javascripts/spinelz/grid_sortabletableEx.js +129 -0
- data/examples/al-admin/public/javascripts/spinelz/inplaceEditorEx.js +148 -0
- data/examples/al-admin/public/javascripts/spinelz/menubar.js +232 -0
- data/examples/al-admin/public/javascripts/spinelz/navPanel.js +170 -0
- data/examples/al-admin/public/javascripts/spinelz/selectableTable.js +433 -0
- data/examples/al-admin/public/javascripts/spinelz/sideBarBox.js +282 -0
- data/examples/al-admin/public/javascripts/spinelz/sideBarBox_effects.js +83 -0
- data/examples/al-admin/public/javascripts/spinelz/sortableTable.js +270 -0
- data/examples/al-admin/public/javascripts/spinelz/switcher.js +78 -0
- data/examples/al-admin/public/javascripts/spinelz/tabBox.js +469 -0
- data/examples/al-admin/public/javascripts/spinelz/timepicker.js +384 -0
- data/examples/al-admin/public/javascripts/spinelz/toolbar.js +152 -0
- data/examples/al-admin/public/javascripts/spinelz/treeview.js +703 -0
- data/examples/al-admin/public/javascripts/spinelz/window.js +641 -0
- data/examples/al-admin/public/javascripts/spinelz/window_resizeEx.js +130 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/builder.js +131 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/controls.js +835 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/dragdrop.js +944 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/effects.js +1090 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/json.js +139 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/prototype.js +2515 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/resize.js +215 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/scriptaculous.js +51 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/slider.js +278 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/spinelz_util.js +1266 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/unittest.js +564 -0
- data/examples/al-admin/public/robots.txt +1 -0
- data/examples/al-admin/public/stylesheets/account.css +41 -0
- data/examples/al-admin/public/stylesheets/attributes.css +1 -0
- data/examples/al-admin/public/stylesheets/base.css +99 -0
- data/examples/al-admin/public/stylesheets/common.css +2 -0
- data/examples/al-admin/public/stylesheets/detail.css +36 -0
- data/examples/al-admin/public/stylesheets/directory.css +22 -0
- data/examples/al-admin/public/stylesheets/object-classes.css +6 -0
- data/examples/al-admin/public/stylesheets/rails.css +35 -0
- data/examples/al-admin/public/stylesheets/spinelz/accordion.css +59 -0
- data/examples/al-admin/public/stylesheets/spinelz/balloon.css +151 -0
- data/examples/al-admin/public/stylesheets/spinelz/calendar.css +564 -0
- data/examples/al-admin/public/stylesheets/spinelz/datepicker.css +175 -0
- data/examples/al-admin/public/stylesheets/spinelz/grid.css +137 -0
- data/examples/al-admin/public/stylesheets/spinelz/menubar.css +78 -0
- data/examples/al-admin/public/stylesheets/spinelz/modal.css +22 -0
- data/examples/al-admin/public/stylesheets/spinelz/navPanel.css +58 -0
- data/examples/al-admin/public/stylesheets/spinelz/selectableTable.css +28 -0
- data/examples/al-admin/public/stylesheets/spinelz/sideBarBox.css +82 -0
- data/examples/al-admin/public/stylesheets/spinelz/sortableTable.css +51 -0
- data/examples/al-admin/public/stylesheets/spinelz/switcher.css +23 -0
- data/examples/al-admin/public/stylesheets/spinelz/tabBox.css +94 -0
- data/examples/al-admin/public/stylesheets/spinelz/timepicker.css +508 -0
- data/examples/al-admin/public/stylesheets/spinelz/toolbar.css +82 -0
- data/examples/al-admin/public/stylesheets/spinelz/treeview.css +121 -0
- data/examples/al-admin/public/stylesheets/spinelz/window.css +140 -0
- data/examples/al-admin/public/stylesheets/structure.css +81 -0
- data/examples/al-admin/public/stylesheets/syntaxes.css +1 -0
- data/examples/al-admin/public/stylesheets/users.css +13 -0
- data/examples/al-admin/public/stylesheets/welcome.css +0 -0
- data/examples/al-admin/script/about +3 -0
- data/examples/al-admin/script/breakpointer +3 -0
- data/examples/al-admin/script/console +3 -0
- data/examples/al-admin/script/destroy +3 -0
- data/examples/al-admin/script/generate +3 -0
- data/examples/al-admin/script/performance/benchmarker +3 -0
- data/examples/al-admin/script/performance/profiler +3 -0
- data/examples/al-admin/script/plugin +3 -0
- data/examples/al-admin/script/process/inspector +3 -0
- data/examples/al-admin/script/process/reaper +3 -0
- data/examples/al-admin/script/process/spawner +3 -0
- data/examples/al-admin/script/runner +3 -0
- data/examples/al-admin/script/server +3 -0
- data/examples/al-admin/test/fixtures/users.yml +9 -0
- data/examples/al-admin/test/functional/account_controller_test.rb +24 -0
- data/examples/al-admin/test/functional/attributes_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/directory_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/object_classes_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/syntaxes_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/users_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/welcome_controller_test.rb +18 -0
- data/examples/al-admin/test/run-test.sh +3 -0
- data/examples/al-admin/test/test_helper.rb +28 -0
- data/examples/al-admin/test/unit/user_test.rb +13 -0
- data/examples/al-admin/vendor/plugins/exception_notification/README +111 -0
- data/examples/al-admin/vendor/plugins/exception_notification/init.rb +1 -0
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifiable.rb +99 -0
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier.rb +67 -0
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb +77 -0
- data/examples/al-admin/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb +61 -0
- data/examples/al-admin/vendor/plugins/exception_notification/test/test_helper.rb +7 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml +1 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml +7 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml +16 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml +3 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml +2 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml +3 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml +6 -0
- data/examples/config.yaml.example +5 -0
- data/examples/example.der +0 -0
- data/examples/example.jpg +0 -0
- data/examples/groupadd +41 -0
- data/examples/groupdel +35 -0
- data/examples/groupls +49 -0
- data/examples/groupmod +42 -0
- data/examples/lpasswd +55 -0
- data/examples/objects/group.rb +13 -0
- data/examples/objects/ou.rb +4 -0
- data/examples/objects/user.rb +20 -0
- data/examples/ouadd +38 -0
- data/examples/useradd +45 -0
- data/examples/useradd-binary +50 -0
- data/examples/userdel +34 -0
- data/examples/userls +50 -0
- data/examples/usermod +42 -0
- data/examples/usermod-binary-add +47 -0
- data/examples/usermod-binary-add-time +51 -0
- data/examples/usermod-binary-del +48 -0
- data/examples/usermod-lang-add +43 -0
- data/lib/active_ldap/acts/tree.rb +75 -0
- data/lib/active_ldap/adapter/base.rb +531 -0
- data/lib/active_ldap/adapter/ldap.rb +231 -0
- data/lib/active_ldap/adapter/ldap_ext.rb +69 -0
- data/lib/active_ldap/adapter/net_ldap.rb +292 -0
- data/lib/active_ldap/adapter/net_ldap_ext.rb +29 -0
- data/lib/active_ldap/association/belongs_to.rb +47 -0
- data/lib/active_ldap/association/belongs_to_many.rb +42 -0
- data/lib/active_ldap/association/children.rb +21 -0
- data/lib/active_ldap/association/collection.rb +83 -0
- data/lib/active_ldap/association/has_many.rb +31 -0
- data/lib/active_ldap/association/has_many_utils.rb +35 -0
- data/lib/active_ldap/association/has_many_wrap.rb +46 -0
- data/lib/active_ldap/association/proxy.rb +102 -0
- data/lib/active_ldap/associations.rb +172 -0
- data/lib/active_ldap/attributes.rb +211 -0
- data/lib/active_ldap/base.rb +1273 -0
- data/lib/active_ldap/callbacks.rb +19 -0
- data/lib/active_ldap/command.rb +49 -0
- data/lib/active_ldap/configuration.rb +147 -0
- data/lib/active_ldap/connection.rb +237 -0
- data/lib/active_ldap/distinguished_name.rb +251 -0
- data/lib/active_ldap/escape.rb +12 -0
- data/lib/active_ldap/get_text/parser.rb +159 -0
- data/lib/active_ldap/get_text.rb +8 -0
- data/lib/active_ldap/get_text_fallback.rb +53 -0
- data/lib/active_ldap/get_text_support.rb +26 -0
- data/lib/active_ldap/helper.rb +33 -0
- data/lib/active_ldap/human_readable.rb +112 -0
- data/lib/active_ldap/ldap_error.rb +74 -0
- data/lib/active_ldap/ldif.rb +52 -0
- data/lib/active_ldap/object_class.rb +93 -0
- data/lib/active_ldap/operations.rb +429 -0
- data/lib/active_ldap/populate.rb +44 -0
- data/lib/active_ldap/schema/syntaxes.rb +386 -0
- data/lib/active_ldap/schema.rb +530 -0
- data/lib/active_ldap/timeout.rb +75 -0
- data/lib/active_ldap/timeout_stub.rb +17 -0
- data/lib/active_ldap/user_password.rb +93 -0
- data/lib/active_ldap/validations.rb +171 -0
- data/lib/active_ldap.rb +982 -0
- data/po/en/active-ldap.po +3677 -0
- data/po/ja/active-ldap.po +3713 -0
- data/rails/plugin/active_ldap/README +54 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/USAGE +17 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb +70 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/templates/fixtures.yml +11 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/templates/model_active_ldap.rb +3 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/templates/unit_test.rb +10 -0
- data/rails/plugin/active_ldap/generators/scaffold_active_ldap/scaffold_active_ldap_generator.rb +7 -0
- data/rails/plugin/active_ldap/generators/scaffold_al/scaffold_al_generator.rb +20 -0
- data/rails/plugin/active_ldap/init.rb +26 -0
- data/test/al-test-utils.rb +362 -0
- data/test/command.rb +62 -0
- data/test/config.yaml.sample +6 -0
- data/test/run-test.rb +31 -0
- data/test/test-unit-ext/always-show-result.rb +28 -0
- data/test/test-unit-ext/backtrace-filter.rb +17 -0
- data/test/test-unit-ext/long-display-for-emacs.rb +25 -0
- data/test/test-unit-ext/priority.rb +163 -0
- data/test/test-unit-ext.rb +4 -0
- data/test/test_acts_as_tree.rb +57 -0
- data/test/test_adapter.rb +98 -0
- data/test/test_associations.rb +353 -0
- data/test/test_attributes.rb +79 -0
- data/test/test_base.rb +547 -0
- data/test/test_base_per_instance.rb +55 -0
- data/test/test_bind.rb +62 -0
- data/test/test_callback.rb +35 -0
- data/test/test_configuration.rb +40 -0
- data/test/test_connection.rb +59 -0
- data/test/test_connection_per_class.rb +58 -0
- data/test/test_connection_per_dn.rb +78 -0
- data/test/test_dn.rb +160 -0
- data/test/test_find.rb +96 -0
- data/test/test_groupadd.rb +50 -0
- data/test/test_groupdel.rb +46 -0
- data/test/test_groupls.rb +107 -0
- data/test/test_groupmod.rb +51 -0
- data/test/test_ldif.rb +35 -0
- data/test/test_lpasswd.rb +75 -0
- data/test/test_object_class.rb +56 -0
- data/test/test_reflection.rb +179 -0
- data/test/test_schema.rb +433 -0
- data/test/test_syntax.rb +329 -0
- data/test/test_user.rb +227 -0
- data/test/test_user_password.rb +93 -0
- data/test/test_useradd-binary.rb +61 -0
- data/test/test_useradd.rb +57 -0
- data/test/test_userdel.rb +48 -0
- data/test/test_userls.rb +91 -0
- data/test/test_usermod-binary-add-time.rb +64 -0
- data/test/test_usermod-binary-add.rb +63 -0
- data/test/test_usermod-binary-del.rb +66 -0
- data/test/test_usermod-lang-add.rb +59 -0
- data/test/test_usermod.rb +58 -0
- data/test/test_validation.rb +110 -0
- metadata +536 -0
@@ -0,0 +1,170 @@
|
|
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
|
+
NavPanel = Class.create();
|
23
|
+
NavPanel.className = {
|
24
|
+
navPanel : 'navPanel',
|
25
|
+
panel: 'navPanel_panel',
|
26
|
+
tab : 'navPanel_tab',
|
27
|
+
tabLeftInactive : 'navPanel_tabLeftInactive',
|
28
|
+
tabLeftActive: 'navPanel_tabLeftActive',
|
29
|
+
tabMiddleInactive : 'navPanel_tabMiddleInactive',
|
30
|
+
tabMiddleActive : 'navPanel_tabMiddleActive',
|
31
|
+
tabRightInactive : 'navPanel_tabRightInactive',
|
32
|
+
tabRightActive : 'navPanel_tabRightActive'
|
33
|
+
}
|
34
|
+
NavPanel.prototype = {
|
35
|
+
|
36
|
+
initialize: function(element) {
|
37
|
+
var options = Object.extend({
|
38
|
+
selected: 1,
|
39
|
+
cssPrefix: 'custom_'
|
40
|
+
}, arguments[1] || {});
|
41
|
+
|
42
|
+
this.options = options;
|
43
|
+
this.element = $(element);
|
44
|
+
Element.setStyle(this.element, {visibility: 'hidden'});
|
45
|
+
Element.hide(this.element);
|
46
|
+
|
47
|
+
var customCss = CssUtil.appendPrefix(this.options.cssPrefix, NavPanel.className);
|
48
|
+
this.classNames = new CssUtil([NavPanel.className, customCss]);
|
49
|
+
|
50
|
+
this.classNames.addClassNames(this.element, 'navPanel');
|
51
|
+
|
52
|
+
this.selected = (this.options.selected > 0) ? this.options.selected - 1 : 0 ;
|
53
|
+
this.start();
|
54
|
+
|
55
|
+
Element.setStyle(this.element, {visibility: 'visible'});
|
56
|
+
Element.show(this.element);
|
57
|
+
},
|
58
|
+
|
59
|
+
start: function() {
|
60
|
+
this.tabs = [];
|
61
|
+
this.panels = [];
|
62
|
+
this.panelList = [];
|
63
|
+
|
64
|
+
this.tabId = this.element.id + '_tab';
|
65
|
+
this.tabLeftId = this.tabId + '_left';
|
66
|
+
this.tabMiddleId = this.tabId + '_middle';
|
67
|
+
this.tabRightId = this.tabId + '_right';
|
68
|
+
this.panelId = this.element.id + '_panel';
|
69
|
+
|
70
|
+
this.build();
|
71
|
+
},
|
72
|
+
|
73
|
+
build: function() {
|
74
|
+
Element.cleanWhitespace(this.element);
|
75
|
+
this.panelList = this.element.childNodes;
|
76
|
+
|
77
|
+
for (var i = 0; i < this.panelList.length; i++) {
|
78
|
+
if (this.panelList[i].nodeType != 1) {
|
79
|
+
Element.remove(this.panelList[i]);
|
80
|
+
i--;
|
81
|
+
continue;
|
82
|
+
}
|
83
|
+
Element.cleanWhitespace(this.panelList[i]);
|
84
|
+
var navSet = this.panelList[i].childNodes;
|
85
|
+
this.buildTab(navSet[0], i);
|
86
|
+
this.buildPanel(navSet[0], i);
|
87
|
+
}
|
88
|
+
this.selectTab();
|
89
|
+
},
|
90
|
+
|
91
|
+
|
92
|
+
buildTab: function(tabTitle, i) {
|
93
|
+
var tab = Builder.node('div', {id:this.tabId + i});
|
94
|
+
this.classNames.addClassNames(tab, 'tab');
|
95
|
+
var tabLeft = Builder.node('div', {id:this.tabLeftId + i});
|
96
|
+
var tabMiddle = Builder.node('div', {id:this.tabMiddleId + i});
|
97
|
+
tabMiddle.appendChild(tabTitle);
|
98
|
+
var tabRight = Builder.node('div',{id:this.tabRightId + i});
|
99
|
+
|
100
|
+
tab.appendChild(tabLeft);
|
101
|
+
tab.appendChild(tabMiddle);
|
102
|
+
tab.appendChild(tabRight);
|
103
|
+
Event.observe(tab, 'click', this.selectTab.bindAsEventListener(this));
|
104
|
+
|
105
|
+
this.tabs[i] = tab;
|
106
|
+
this.setTabInactive(tab);
|
107
|
+
this.panelList[i].appendChild(tab);
|
108
|
+
},
|
109
|
+
|
110
|
+
buildPanel: function(panelContent, i) {
|
111
|
+
var panel = Builder.node('div', {id:this.panelId + i});
|
112
|
+
this.classNames.addClassNames(panel, 'panel');
|
113
|
+
panel.appendChild(panelContent);
|
114
|
+
Element.hide(panel);
|
115
|
+
this.panels[i] = panel;
|
116
|
+
this.panelList[i].appendChild(panel);
|
117
|
+
},
|
118
|
+
|
119
|
+
selectTab: function(e) {
|
120
|
+
if (!e) {
|
121
|
+
if (!this.panels[this.selected]) this.selected = 0;
|
122
|
+
Element.show(this.panels[this.selected]);
|
123
|
+
this.setTabActive(this.tabs[this.selected]);
|
124
|
+
return;
|
125
|
+
}
|
126
|
+
|
127
|
+
var targetElement = Event.element(e);
|
128
|
+
var targetIndex = this.getTargetIndex(targetElement);
|
129
|
+
if (targetIndex == this.selected) {
|
130
|
+
return;
|
131
|
+
}
|
132
|
+
|
133
|
+
var currentPanel = this.panels[this.selected];
|
134
|
+
var targetPanel = this.panels[targetIndex];
|
135
|
+
this.setTabInactive(this.tabs[this.selected]);
|
136
|
+
this.setTabActive(this.tabs[targetIndex]);
|
137
|
+
Element.show(targetPanel);
|
138
|
+
Element.hide(currentPanel);
|
139
|
+
this.selected = targetIndex;
|
140
|
+
},
|
141
|
+
|
142
|
+
setTabActive: function(tab) {
|
143
|
+
var tabChildren = tab.childNodes;
|
144
|
+
|
145
|
+
this.classNames.refreshClassNames(tabChildren[0], 'tabLeftActive');
|
146
|
+
this.classNames.refreshClassNames(tabChildren[1], 'tabMiddleActive');
|
147
|
+
this.classNames.refreshClassNames(tabChildren[2], 'tabRightActive');
|
148
|
+
},
|
149
|
+
|
150
|
+
setTabInactive: function(tab) {
|
151
|
+
var tabChildren = tab.childNodes;
|
152
|
+
|
153
|
+
this.classNames.refreshClassNames(tabChildren[0], 'tabLeftInactive');
|
154
|
+
this.classNames.refreshClassNames(tabChildren[1], 'tabMiddleInactive');
|
155
|
+
this.classNames.refreshClassNames(tabChildren[2], 'tabRightInactive');
|
156
|
+
},
|
157
|
+
|
158
|
+
getTargetIndex: function(element) {
|
159
|
+
|
160
|
+
while(element) {
|
161
|
+
if (element.id && element.id.indexOf(this.tabId, 0) >= 0) {
|
162
|
+
var index = element.id.substring(this.tabId.length);
|
163
|
+
if (!isNaN(index)) {
|
164
|
+
return index;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
element = element.parentNode;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
@@ -0,0 +1,433 @@
|
|
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
|
+
var SelectableTable = Class.create();
|
23
|
+
|
24
|
+
SelectableTable.classNames = {
|
25
|
+
table: 'selectableTable_table',
|
26
|
+
tr: 'selectableTable_tr',
|
27
|
+
trHover: 'selectableTable_trHover',
|
28
|
+
trSelected: 'selectableTable_trSelected'
|
29
|
+
};
|
30
|
+
|
31
|
+
SelectableTable.prototype = {
|
32
|
+
initialize: function(element) {
|
33
|
+
this.element = $(element);
|
34
|
+
Element.setStyle(this.element, {visibility: 'hidden'});
|
35
|
+
var defaultOptions = {
|
36
|
+
arrayDefaultData: [],
|
37
|
+
flagAllowUnselect: true,
|
38
|
+
flagInitialAllowMultiple: false,
|
39
|
+
flagKeypressAvailable: false,
|
40
|
+
flagKeypressDeleteAvailable: false,
|
41
|
+
flagKeypressInsertAvailable: false,
|
42
|
+
functionClickCallback: Prototype.emptyFunction,
|
43
|
+
functionDoubleClickCallback: Prototype.emptyFunction,
|
44
|
+
functionPostAdd: Prototype.emptyFunction,
|
45
|
+
functionPostBuild: Prototype.emptyFunction,
|
46
|
+
functionPostDelete: Prototype.emptyFunction,
|
47
|
+
functionPostPressLeft: Prototype.emptyFunction,
|
48
|
+
functionPostPressRight: Prototype.emptyFunction,
|
49
|
+
functionPostSelect: Prototype.emptyFunction,
|
50
|
+
functionPostUnselect: Prototype.emptyFunction,
|
51
|
+
functionPreAdd: function() {return true;},
|
52
|
+
functionPreDelete: function() {return true;},
|
53
|
+
functionSubmit: Prototype.emptyFunction,
|
54
|
+
initialSelected: null,
|
55
|
+
prefixTrId: 'selectable_table_',
|
56
|
+
prefixCSS: 'custom_'
|
57
|
+
}
|
58
|
+
this.options = Object.extend(defaultOptions, arguments[1] || {});
|
59
|
+
this.classNames = new CssUtil([SelectableTable.classNames, CssUtil.appendPrefix(this.options.prefixCSS, SelectableTable.classNames)]);
|
60
|
+
this.flagAllowMultiple = this.options.flagInitialAllowMultiple;
|
61
|
+
this.flagAvailable = true;
|
62
|
+
this.focused = null;
|
63
|
+
this.lastSelected = null;
|
64
|
+
this.newNumber = 1;
|
65
|
+
this.selected = new Object();
|
66
|
+
this.build();
|
67
|
+
if(arguments[2]) {
|
68
|
+
this.selectEffect(this.buildTrId(arguments[2]));
|
69
|
+
}
|
70
|
+
Element.setStyle(this.element, {visibility: 'visible'});
|
71
|
+
},
|
72
|
+
add: function() {
|
73
|
+
if(!this.flagAvailable) {return;}
|
74
|
+
if(!this.options.functionPreAdd(this)) {return;}
|
75
|
+
if(arguments[0] == null) {arguments[0] = this.options.arrayDefaultData;}
|
76
|
+
if(typeof(arguments[0]) != 'string') {
|
77
|
+
arguments = arguments[0];
|
78
|
+
}
|
79
|
+
if(arguments[0] == null) {return;}
|
80
|
+
var objTr, objTd;
|
81
|
+
objTr = document.createElement('tr');
|
82
|
+
objTr.id = 'new_' + this.newNumber;
|
83
|
+
this.buildTr(objTr);
|
84
|
+
for(var i = 0; i < arguments.length; i++) {
|
85
|
+
objTd = document.createElement('td');
|
86
|
+
objTd.innerHTML = arguments[i];
|
87
|
+
objTr.appendChild(objTd);
|
88
|
+
}
|
89
|
+
this.element.tBodies[0].appendChild(objTr);
|
90
|
+
this.newNumber++;
|
91
|
+
this.options.functionPostAdd(this);
|
92
|
+
},
|
93
|
+
addKeyboardEvent: function() {
|
94
|
+
var self = this;
|
95
|
+
if(this.options.flagKeypressAvailable) {
|
96
|
+
this.shortcutManager = new ShortcutManager();
|
97
|
+
var shortcut = [
|
98
|
+
['enter', function() {self.selectOrUnselect(self.focused, false);}],
|
99
|
+
['shift+enter', function() {self.selectOrUnselectRange(self.focused);}],
|
100
|
+
['ctrl+enter', function() {self.selectOrUnselect(self.focused, true);}],
|
101
|
+
['backspace', Prototype.emptyFunction],
|
102
|
+
['esc', Prototype.emptyFunction],
|
103
|
+
['up', function() {self.focusMove('up');}],
|
104
|
+
['down', function() {self.focusMove('down');}],
|
105
|
+
['left', function() {self.options.functionPostPressLeft(this);}],
|
106
|
+
['right', function() {self.options.functionPostPressRight(this);}]
|
107
|
+
];
|
108
|
+
if(this.options.flagKeypressInsertAvailable) {
|
109
|
+
shortcut.push(['insert', function() {self.add();}]);
|
110
|
+
}
|
111
|
+
if(this.options.flagKeypressDeleteAvailable) {
|
112
|
+
shortcut.push(['delete', function() {self.deleteAll();}]);
|
113
|
+
}
|
114
|
+
this.shortcutManager.add(shortcut);
|
115
|
+
}
|
116
|
+
//===[for Mac]============================================================//
|
117
|
+
this.cmdPressed = false;
|
118
|
+
this.cmdManager = new ShortcutManager({detectKeyup:true});
|
119
|
+
this.cmdManager.add('cmd', function() {self.cmdPressed = true;});
|
120
|
+
this.cmdManager.add('cmd', function() {self.cmdPressed = false;}, true);
|
121
|
+
//===[for Mac]===========================================================//
|
122
|
+
},
|
123
|
+
build: function() {
|
124
|
+
var lines = this.element.tBodies[0].rows;
|
125
|
+
this.classNames.addClassNames(this.element, 'table');
|
126
|
+
this.addKeyboardEvent();
|
127
|
+
for(var i = 0; i < lines.length; i++) {
|
128
|
+
this.buildTr(lines[i]);
|
129
|
+
}
|
130
|
+
var selected = this.options.initialSelected
|
131
|
+
if(selected) {
|
132
|
+
this.selectEffect(this.buildTrId(selected));
|
133
|
+
}
|
134
|
+
this.options.functionPostBuild(this);
|
135
|
+
},
|
136
|
+
buildTr: function(objTr) {
|
137
|
+
objTr.id = this.buildTrId(objTr.id);
|
138
|
+
this.classNames.addClassNames(objTr, 'tr');
|
139
|
+
Event.observe(objTr, 'click', this.eventClick.bindAsEventListener(this));
|
140
|
+
Event.observe(objTr, 'dblclick', this.eventDoubleClick.bindAsEventListener(this));
|
141
|
+
Event.observe(objTr, 'mouseout', this.eventFocusOut.bindAsEventListener(this));
|
142
|
+
Event.observe(objTr, 'mouseover', this.eventFocusOver.bindAsEventListener(this));
|
143
|
+
},
|
144
|
+
buildTrId: function(strId) {
|
145
|
+
return this.options.prefixTrId + strId
|
146
|
+
},
|
147
|
+
deleteAll: function() {
|
148
|
+
if(!this.flagAvailable) {return;}
|
149
|
+
if(!this.options.functionPreDelete(this)) {return;}
|
150
|
+
for(var trId in this.selected) {
|
151
|
+
this.element.tBodies[0].removeChild($(trId));
|
152
|
+
delete this.selected[trId];
|
153
|
+
}
|
154
|
+
this.focused = null;
|
155
|
+
this.options.functionPostDelete(this);
|
156
|
+
},
|
157
|
+
destroy: function() {
|
158
|
+
if(this.options.flagKeypressAvailable) {
|
159
|
+
this.shortcutManager.destroy();
|
160
|
+
}
|
161
|
+
//===[for Mac]============================================================//
|
162
|
+
this.cmdManager.destroy();
|
163
|
+
//===[for Mac]============================================================//
|
164
|
+
},
|
165
|
+
eventClick: function(event) {
|
166
|
+
if(!this.flagAvailable) {return;}
|
167
|
+
if(this.options.functionClickCallback.constructor == Function) {
|
168
|
+
if(this.options.functionClickCallback != Prototype.emptyFunction) {
|
169
|
+
this.options.functionClickCallback(Event.findElement(event, 'tr').id.replace(this.options.prefixTrId, ''));
|
170
|
+
}
|
171
|
+
}
|
172
|
+
if(event.shiftKey) {
|
173
|
+
this.selectOrUnselectRange(Event.findElement(event, 'tr').id);
|
174
|
+
} else {
|
175
|
+
this.selectOrUnselect(Event.findElement(event, 'tr').id, event.ctrlKey || this.cmdPressed);
|
176
|
+
}
|
177
|
+
},
|
178
|
+
eventDoubleClick: function(event) {
|
179
|
+
if(!this.flagAvailable) {return;}
|
180
|
+
if(this.options.functionDoubleClickCallback.constructor == Function) {
|
181
|
+
if(this.options.functionDoubleClickCallback != Prototype.emptyFunction) {
|
182
|
+
this.options.functionDoubleClickCallback(Event.findElement(event, 'tr').id.replace(this.options.prefixTrId, ''));
|
183
|
+
}
|
184
|
+
}
|
185
|
+
if(this.flagAllowMultiple) {
|
186
|
+
this.select(Event.findElement(event, 'tr').id, false);
|
187
|
+
this.submit();
|
188
|
+
}
|
189
|
+
},
|
190
|
+
eventFocusOut: function(event) {
|
191
|
+
if(!this.flagAvailable) {return;}
|
192
|
+
this.focusOff();
|
193
|
+
},
|
194
|
+
eventFocusOver: function(event) {
|
195
|
+
if(!this.flagAvailable) {return;}
|
196
|
+
this.focusOn(Event.findElement(event, 'tr').id);
|
197
|
+
Event.findElement(event, 'tr').focus();
|
198
|
+
},
|
199
|
+
focusMove: function(direction) {
|
200
|
+
if(!this.flagAvailable) {return;}
|
201
|
+
if(this.focused == null) {
|
202
|
+
if(this.element.tBodies[0].rows[0]) {
|
203
|
+
this.focusOn(this.element.tBodies[0].rows[0].id);
|
204
|
+
}
|
205
|
+
} else {
|
206
|
+
var rowIndex = $(this.focused).rowIndex;
|
207
|
+
var correctionValue, flagEdge;
|
208
|
+
switch(direction) {
|
209
|
+
case 'down':
|
210
|
+
correctionValue = 1;
|
211
|
+
flagEdge = this.isBottom(rowIndex);
|
212
|
+
break;
|
213
|
+
case 'up':
|
214
|
+
correctionValue = -1;
|
215
|
+
flagEdge = this.isTop(rowIndex);
|
216
|
+
break;
|
217
|
+
}
|
218
|
+
if(!flagEdge) {
|
219
|
+
this.focusOn(this.element.rows[rowIndex + correctionValue].id);
|
220
|
+
}
|
221
|
+
}
|
222
|
+
},
|
223
|
+
focusOff: function() {
|
224
|
+
if(!this.flagAvailable) {return;}
|
225
|
+
if(this.focused != null) {
|
226
|
+
var objTr = $(this.focused);
|
227
|
+
this.classNames.removeClassNames(objTr, 'trHover');
|
228
|
+
this.focused = null;
|
229
|
+
}
|
230
|
+
},
|
231
|
+
focusOn: function(trId) {
|
232
|
+
if(!this.flagAvailable) {return;}
|
233
|
+
if($(trId) != null) {
|
234
|
+
this.focusOff();
|
235
|
+
this.classNames.addClassNames($(trId), 'trHover');
|
236
|
+
this.focused = trId;
|
237
|
+
}
|
238
|
+
},
|
239
|
+
getSelected: function() {
|
240
|
+
var selectedIdList = new Array();
|
241
|
+
for(var trId in this.selected) {
|
242
|
+
selectedIdList.push(trId.replace(this.options.prefixTrId, ''));
|
243
|
+
}
|
244
|
+
return selectedIdList;
|
245
|
+
},
|
246
|
+
getSelectedElement: function(id) {
|
247
|
+
var trId = this.options.prefixTrId + id;
|
248
|
+
return $(trId)
|
249
|
+
},
|
250
|
+
isBottom: function(rowIndex) {
|
251
|
+
return (rowIndex == this.element.rows.length - 1) ? true : false;
|
252
|
+
},
|
253
|
+
isTop: function(rowIndex) {
|
254
|
+
return (rowIndex == this.element.tBodies[0].rows[0].rowIndex) ? true : false;
|
255
|
+
},
|
256
|
+
makeAvailable: function() {
|
257
|
+
this.flagAvailable = true;
|
258
|
+
if(this.options.flagKeypressAvailable) {
|
259
|
+
this.shortcutManager.start();
|
260
|
+
}
|
261
|
+
},
|
262
|
+
makeMultiple: function() {
|
263
|
+
this.flagAllowMultiple = true;
|
264
|
+
},
|
265
|
+
makeSingular: function() {
|
266
|
+
this.flagAllowMultiple = false;
|
267
|
+
this.unselectAll();
|
268
|
+
},
|
269
|
+
makeUnavailable: function() {
|
270
|
+
if(this.options.flagKeypressAvailable) {
|
271
|
+
this.shortcutManager.stop();
|
272
|
+
}
|
273
|
+
this.flagAvailable = false;
|
274
|
+
},
|
275
|
+
select: function(trId, ctrl) {
|
276
|
+
if(!this.flagAvailable) {return;}
|
277
|
+
this.selectEffect(trId, ctrl);
|
278
|
+
this.lastSelected = trId;
|
279
|
+
this.options.functionPostSelect(this);
|
280
|
+
if(!this.flagAllowMultiple) {
|
281
|
+
this.submit();
|
282
|
+
}
|
283
|
+
},
|
284
|
+
selectAll: function() {
|
285
|
+
if(!this.flagAvailable) {return;}
|
286
|
+
if(!this.flagAllowMultiple) {return;}
|
287
|
+
this.selected = new Object();
|
288
|
+
var lines = this.element.tBodies[0].rows;
|
289
|
+
for(var i = 0; i < lines.length; i++) {
|
290
|
+
this.select(lines[i].id, true);
|
291
|
+
}
|
292
|
+
},
|
293
|
+
selectEffect: function(trId, ctrl) {
|
294
|
+
if($(trId)) {
|
295
|
+
if(!this.flagAllowMultiple || !ctrl) {
|
296
|
+
this.unselectAll();
|
297
|
+
}
|
298
|
+
this.classNames.addClassNames($(trId), 'trSelected');
|
299
|
+
this.selected[trId] = true;
|
300
|
+
}
|
301
|
+
},
|
302
|
+
selectOrUnselect: function(trId, ctrl) {
|
303
|
+
if(!this.flagAvailable) {return;}
|
304
|
+
if(trId == null) {return;}
|
305
|
+
if(ctrl && this.selected[trId]) {
|
306
|
+
if(!this.flagAllowMultiple && !this.options.flagAllowUnselect) {return;}
|
307
|
+
this.unselect(trId);
|
308
|
+
} else {
|
309
|
+
this.select(trId, ctrl);
|
310
|
+
}
|
311
|
+
},
|
312
|
+
selectOrUnselectRange: function(trId) {
|
313
|
+
if(!this.flagAvailable) {return;}
|
314
|
+
if(trId == null) {return;}
|
315
|
+
if(this.lastSelected == null || this.lastSelected == trId) {
|
316
|
+
this.selectOrUnselect(trId);
|
317
|
+
return;
|
318
|
+
}
|
319
|
+
var flagSelect = false;
|
320
|
+
var lines = this.element.tBodies[0].rows;
|
321
|
+
var lastSelected = this.lastSelected
|
322
|
+
for(var i = 0; i < lines.length; i++) {
|
323
|
+
if(lines[i].id == trId || lines[i].id == lastSelected) {
|
324
|
+
flagSelect = (flagSelect) ? false : true;
|
325
|
+
} else if(!flagSelect) {
|
326
|
+
continue;
|
327
|
+
}
|
328
|
+
if(this.selected[lastSelected]) {
|
329
|
+
this.select(lines[i].id, true);
|
330
|
+
} else {
|
331
|
+
this.unselect(lines[i].id);
|
332
|
+
}
|
333
|
+
}
|
334
|
+
},
|
335
|
+
submit: function(trId) {
|
336
|
+
if(!this.flagAvailable) {return;}
|
337
|
+
var selected = this.getSelected();
|
338
|
+
this.options.functionSubmit(selected[0]);
|
339
|
+
},
|
340
|
+
unselect: function(trId) {
|
341
|
+
if(!this.flagAvailable) {return;}
|
342
|
+
this.classNames.removeClassNames($(trId), 'trSelected');
|
343
|
+
delete this.selected[trId];
|
344
|
+
this.lastSelected = trId;
|
345
|
+
this.options.functionPostUnselect(this);
|
346
|
+
},
|
347
|
+
unselectAll: function() {
|
348
|
+
if(!this.flagAvailable) {return;}
|
349
|
+
var lines = this.element.tBodies[0].rows;
|
350
|
+
for(var i = 0; i < lines.length; i++) {
|
351
|
+
this.unselect(lines[i].id);
|
352
|
+
}
|
353
|
+
}
|
354
|
+
}
|
355
|
+
|
356
|
+
var SelectableTableLib = {
|
357
|
+
navi: function(direction, element) {
|
358
|
+
var navigator = element || (SelectableTableManager.active || '') + '_navigation_top';
|
359
|
+
var element = $(navigator + '_' + direction);
|
360
|
+
if(element != null) {
|
361
|
+
if(UserAgent.isIE()) {
|
362
|
+
element.fireEvent('onclick');
|
363
|
+
} else {
|
364
|
+
var evt = document.createEvent('MouseEvents');
|
365
|
+
evt.initEvent('click', true, true);
|
366
|
+
element.dispatchEvent(evt);
|
367
|
+
}
|
368
|
+
}
|
369
|
+
}
|
370
|
+
};
|
371
|
+
|
372
|
+
var SelectableTableCreator = {
|
373
|
+
create: function() {
|
374
|
+
var key = arguments[0];
|
375
|
+
var options = arguments[1] || {};
|
376
|
+
var old_st = arguments[2] || null;
|
377
|
+
var manage = arguments[3] || false;
|
378
|
+
if(old_st) {
|
379
|
+
try {
|
380
|
+
old_st.destroy();
|
381
|
+
} catch(e) {}
|
382
|
+
}
|
383
|
+
var new_st = new SelectableTable(key, options);
|
384
|
+
if(manage) {
|
385
|
+
SelectableTableManager.push(key, new_st);
|
386
|
+
}
|
387
|
+
return new_st;
|
388
|
+
}
|
389
|
+
};
|
390
|
+
|
391
|
+
var SelectableTableManager = {
|
392
|
+
active: null,
|
393
|
+
list: $H({}),
|
394
|
+
activate: function(key) {
|
395
|
+
this.stop();
|
396
|
+
if(this.list[key]) {
|
397
|
+
this.list[key].makeAvailable();
|
398
|
+
this.active = key;
|
399
|
+
} else {
|
400
|
+
this.active = null;
|
401
|
+
}
|
402
|
+
},
|
403
|
+
deactivate: function() {
|
404
|
+
this.stop();
|
405
|
+
this.active = null;
|
406
|
+
},
|
407
|
+
destroy: function() {
|
408
|
+
this.deactivate();
|
409
|
+
this.list = $H({});
|
410
|
+
},
|
411
|
+
push: function(key, element) {
|
412
|
+
if(this.list[key]) {
|
413
|
+
this.list[key].makeUnavailable();
|
414
|
+
}
|
415
|
+
this.list[key] = element;
|
416
|
+
this.activate(key);
|
417
|
+
},
|
418
|
+
start: function() {
|
419
|
+
var active = this.active
|
420
|
+
if(active) {
|
421
|
+
this.list[active].makeAvailable();
|
422
|
+
}
|
423
|
+
},
|
424
|
+
stop: function() {
|
425
|
+
this.list.each(
|
426
|
+
function(el) {
|
427
|
+
if(el[1]) {
|
428
|
+
el[1].makeUnavailable();
|
429
|
+
}
|
430
|
+
}
|
431
|
+
);
|
432
|
+
}
|
433
|
+
};
|