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,524 @@
|
|
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 AbstractBarChart = Class.create();
|
23
|
+
AbstractBarChart.prototype = {
|
24
|
+
|
25
|
+
initialize: function(element, params) {
|
26
|
+
this.options = Object.extend({
|
27
|
+
title: '',
|
28
|
+
graduation: true,
|
29
|
+
graduationMin: 0,
|
30
|
+
graduationMax: 30,
|
31
|
+
graduationInterval: 10,
|
32
|
+
graduationRange: 50,
|
33
|
+
titleFont: 'normal bold 20px serif'
|
34
|
+
}, arguments[2] || {});
|
35
|
+
|
36
|
+
this.fontSize = 'normal normal 12px serif';
|
37
|
+
this.graduationLine = '2px solid gray';
|
38
|
+
this.element = $(element);
|
39
|
+
Element.setStyle(this.element, {visibility: 'hidden'});
|
40
|
+
Element.hide(this.element);
|
41
|
+
this.params = params;
|
42
|
+
|
43
|
+
this.init();
|
44
|
+
|
45
|
+
this.hide();
|
46
|
+
this.refresh();
|
47
|
+
Element.setStyle(this.element, {visibility: 'visible'});
|
48
|
+
Element.show(this.element);
|
49
|
+
},
|
50
|
+
|
51
|
+
build: function() {
|
52
|
+
return Builder.node(
|
53
|
+
'DIV',
|
54
|
+
[this.buildTitle(), this.buildGraduationLine(), this.buildContent()]);
|
55
|
+
},
|
56
|
+
|
57
|
+
buildTitle: function() {
|
58
|
+
return Builder.node(
|
59
|
+
'DIV',
|
60
|
+
{style: 'font: ' + this.options.titleFont + '; margin-bottom: 5px; text-align: center;'},
|
61
|
+
[this.options.title]
|
62
|
+
);
|
63
|
+
},
|
64
|
+
|
65
|
+
show: function() {
|
66
|
+
Element.show(this.element);
|
67
|
+
},
|
68
|
+
|
69
|
+
hide: function() {
|
70
|
+
Element.hide(this.element);
|
71
|
+
},
|
72
|
+
|
73
|
+
refresh: function(subject) {
|
74
|
+
if (this.chart) this.remove();
|
75
|
+
|
76
|
+
this.chart = this.build();
|
77
|
+
this.element.appendChild(this.chart);
|
78
|
+
},
|
79
|
+
|
80
|
+
getParam: function(name) {
|
81
|
+
return this.params.detect(function(child) {
|
82
|
+
return (child.getName() == name);
|
83
|
+
});
|
84
|
+
},
|
85
|
+
|
86
|
+
remove: function() {
|
87
|
+
var chart = this.chart;
|
88
|
+
var element = this.element;
|
89
|
+
|
90
|
+
$A(this.element.childNodes).any(function(child) {
|
91
|
+
if (child == chart) {
|
92
|
+
element.removeChild(child);
|
93
|
+
return true;
|
94
|
+
}
|
95
|
+
return false;
|
96
|
+
});
|
97
|
+
|
98
|
+
this.chart = null;
|
99
|
+
},
|
100
|
+
|
101
|
+
getChartSize: function() {
|
102
|
+
return this.getPlusChartSize() + this.getMinusChartSize();
|
103
|
+
},
|
104
|
+
|
105
|
+
getPlusChartSize: function() {
|
106
|
+
if (this.options.graduationMax <= 0) return 0;
|
107
|
+
return this.options.graduationMax / this.options.graduationInterval * this.options.graduationRange;
|
108
|
+
},
|
109
|
+
|
110
|
+
getMinusChartSize: function() {
|
111
|
+
if (this.options.graduationMin >= 0) return 0;
|
112
|
+
return Math.abs(this.options.graduationMin) / this.options.graduationInterval * this.options.graduationRange;
|
113
|
+
},
|
114
|
+
|
115
|
+
getBarSize: function(param) {
|
116
|
+
var size = param.getValue() / this.options.graduationInterval * this.options.graduationRange;
|
117
|
+
return Math.abs(size);
|
118
|
+
},
|
119
|
+
|
120
|
+
getFontSize: function() {
|
121
|
+
var arr = this.fontSize.split(' ');
|
122
|
+
if (arr.length == 0) return 0;
|
123
|
+
|
124
|
+
var size = arr.detect(function(child) {
|
125
|
+
return child.match(/px$/);
|
126
|
+
});
|
127
|
+
if (!size) return 0;
|
128
|
+
|
129
|
+
var index = size.indexOf('px');
|
130
|
+
if (index < 1) return 0;
|
131
|
+
|
132
|
+
size = size.substring(0, index);
|
133
|
+
if (isNaN(size)) return 0;
|
134
|
+
|
135
|
+
return parseInt(size);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
var HorizontalBarChart = Class.create();
|
140
|
+
Object.extend(Object.extend(HorizontalBarChart.prototype, AbstractBarChart.prototype), {
|
141
|
+
|
142
|
+
init: function() {
|
143
|
+
this.nameWidth = 125;
|
144
|
+
this.valueWidth = 50;
|
145
|
+
this.itemInterval = 35;
|
146
|
+
this.adjustWidth = (document.all) ? 5 : 0;
|
147
|
+
},
|
148
|
+
|
149
|
+
buildGraduationLine: function() {
|
150
|
+
if (!this.options.graduation)
|
151
|
+
return Builder.node('DIV', {style: 'margin-bottom: 5px; text-align: center;'});
|
152
|
+
|
153
|
+
var array = new Array();
|
154
|
+
var i = this.options.graduationMin;
|
155
|
+
//var width = (document.all) ? this.options.graduationRange : this.options.graduationRange - 2;
|
156
|
+
var width = this.options.graduationRange;
|
157
|
+
|
158
|
+
var style = new StyleManager();
|
159
|
+
style.cache('border-left', this.graduationLine);
|
160
|
+
style.cache('height', '5px');
|
161
|
+
style.cache('font-size', '5px');
|
162
|
+
|
163
|
+
while (i <= this.options.graduationMax) {
|
164
|
+
|
165
|
+
var j = i + this.options.graduationInterval;
|
166
|
+
if (j <= this.options.graduationMax)
|
167
|
+
style.add('border-top', this.graduationLine);
|
168
|
+
|
169
|
+
var elm = Builder.node(
|
170
|
+
'DIV',
|
171
|
+
{style: 'float: left; font: ' + this.fontSize + '; width: ' + width + 'px;'},
|
172
|
+
[
|
173
|
+
Builder.node('DIV', [i]),
|
174
|
+
Builder.node('DIV', {style: style.output()})
|
175
|
+
]
|
176
|
+
);
|
177
|
+
|
178
|
+
array.push(elm);
|
179
|
+
i = j;
|
180
|
+
style.clear();
|
181
|
+
}
|
182
|
+
return Builder.node('DIV', {style: 'margin-left: ' + (this.nameWidth + this.valueWidth) + 'px; padding-bottom: ' + this.itemInterval + 'px;'}, array);
|
183
|
+
},
|
184
|
+
|
185
|
+
buildContent: function() {
|
186
|
+
var nodes = new Array();
|
187
|
+
|
188
|
+
var valueStyle = new StyleManager();
|
189
|
+
valueStyle.cache('font', this.fontSize);
|
190
|
+
valueStyle.cache('text-align', 'right');
|
191
|
+
|
192
|
+
for (var i = 0; i < this.params.length; i++) {
|
193
|
+
var child = this.params[i];
|
194
|
+
|
195
|
+
var maxSize;
|
196
|
+
if (child.getValue() > 0) maxSize = this.getPlusChartSize();
|
197
|
+
else maxSize = this.getMinusChartSize();
|
198
|
+
|
199
|
+
var barSize = this.getBarSize(child);
|
200
|
+
barSize = (barSize > maxSize) ? maxSize : barSize;
|
201
|
+
|
202
|
+
var barNode;
|
203
|
+
if (child.options.image) {
|
204
|
+
if (child.getValue() > 0) {
|
205
|
+
|
206
|
+
barNode = Builder.node('DIV',
|
207
|
+
[
|
208
|
+
Builder.node(
|
209
|
+
'IMG',
|
210
|
+
{
|
211
|
+
src: child.options.image,
|
212
|
+
alt: 'bar',
|
213
|
+
width: barSize + 'px',
|
214
|
+
height: child.options.imageHeight + 'px',
|
215
|
+
style: 'float: left; margin-left: ' + (this.getMinusChartSize() + this.valueWidth) + 'px;'
|
216
|
+
}),
|
217
|
+
Builder.node(
|
218
|
+
'DIV',
|
219
|
+
{style: 'font: ' + this.fontSize + ';'},
|
220
|
+
[child.getValue()])
|
221
|
+
]);
|
222
|
+
} else {
|
223
|
+
// IE fix
|
224
|
+
var leftMargin = this.getMinusChartSize() - barSize;
|
225
|
+
var width;
|
226
|
+
if (document.all && leftMargin > 125) {
|
227
|
+
width = leftMargin + this.valueWidth;
|
228
|
+
leftMargin = 0;
|
229
|
+
} else {
|
230
|
+
width = this.valueWidth;
|
231
|
+
}
|
232
|
+
|
233
|
+
valueStyle.add('margin-left', leftMargin + 'px');
|
234
|
+
valueStyle.add('width', width + 'px');
|
235
|
+
valueStyle.add('float', 'left');
|
236
|
+
|
237
|
+
barNode = Builder.node(
|
238
|
+
'DIV',
|
239
|
+
[
|
240
|
+
Builder.node('DIV', {style: valueStyle.output()}, [child.getValue()]),
|
241
|
+
Builder.node('IMG', {src: child.options.image, alt: 'bar', width: barSize + 'px', height: child.options.imageHeight + 'px'})
|
242
|
+
]);
|
243
|
+
}
|
244
|
+
|
245
|
+
} else {
|
246
|
+
if (child.getValue() > 0) {
|
247
|
+
barNode = Builder.node(
|
248
|
+
'DIV',
|
249
|
+
{style: 'font: ' + this.fontSize + '; margin-left: ' + (this.getMinusChartSize() + this.nameWidth + this.valueWidth + this.adjustWidth) + 'px; border-left: ' + barSize + 'px solid ' + child.options.color + ';'},
|
250
|
+
[child.getValue()]
|
251
|
+
);
|
252
|
+
} else {
|
253
|
+
var width = (document.all) ? (this.valueWidth + barSize) : this.valueWidth;
|
254
|
+
|
255
|
+
valueStyle.add('margin-left', (this.nameWidth + this.getMinusChartSize() - barSize) + 'px');
|
256
|
+
valueStyle.add('width', width + 'px');
|
257
|
+
valueStyle.add('border-right', barSize + 'px solid ' + child.options.color);
|
258
|
+
|
259
|
+
barNode = Builder.node(
|
260
|
+
'DIV',
|
261
|
+
[
|
262
|
+
Builder.node('DIV', {style: valueStyle.output()}, [child.getValue()])
|
263
|
+
]
|
264
|
+
);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
var elm = Builder.node(
|
269
|
+
'DIV',
|
270
|
+
{style: 'margin-bottom: 10px;'},
|
271
|
+
[
|
272
|
+
Builder.node('DIV', {style: 'text-align: right; font: ' + this.fontSize + ';float: left; width: ' + this.nameWidth + 'px;'}, [child.getName()]),
|
273
|
+
barNode
|
274
|
+
]);
|
275
|
+
|
276
|
+
nodes.push(elm);
|
277
|
+
valueStyle.clear();
|
278
|
+
}
|
279
|
+
|
280
|
+
return nodes;
|
281
|
+
}
|
282
|
+
});
|
283
|
+
|
284
|
+
var VerticalBarChart = Class.create();
|
285
|
+
Object.extend(Object.extend(VerticalBarChart.prototype, AbstractBarChart.prototype), {
|
286
|
+
|
287
|
+
init: function() {
|
288
|
+
},
|
289
|
+
|
290
|
+
buildGraduationLine: function() {
|
291
|
+
if (!this.options.graduation) return Builder.node('DIV');
|
292
|
+
|
293
|
+
var numberArray = new Array();
|
294
|
+
var lineArray = new Array();
|
295
|
+
var i = this.options.graduationMax;
|
296
|
+
var next;
|
297
|
+
var lineHeight = (document.all) ? this.options.graduationRange : this.options.graduationRange - 2;
|
298
|
+
var marginTop = lineHeight - this.getFontSize();
|
299
|
+
|
300
|
+
var numberStyle = new StyleManager();
|
301
|
+
numberStyle.cache('font', this.fontSize);
|
302
|
+
|
303
|
+
var lineStyle = new StyleManager();
|
304
|
+
lineStyle.cache('font', this.fontSize);
|
305
|
+
|
306
|
+
while (i >= this.options.graduationMin) {
|
307
|
+
next = i - this.options.graduationInterval;
|
308
|
+
lineHeight = (document.all) ? lineHeight - 0.3: lineHeight - 0.1;
|
309
|
+
|
310
|
+
if (i == this.options.graduationMax) {
|
311
|
+
lineStyle.add('margin-top', '0px');
|
312
|
+
|
313
|
+
} else if (next < this.options.graduationMin) {
|
314
|
+
numberStyle.add('margin-top', marginTop + 'px');
|
315
|
+
lineStyle.add('border-left', this.graduationLine);
|
316
|
+
lineStyle.add('border-top', this.graduationLine);
|
317
|
+
lineStyle.add('border-bottom', this.graduationLine)
|
318
|
+
lineStyle.add('height', lineHeight + 'px');
|
319
|
+
lineStyle.add('width', '100%');
|
320
|
+
|
321
|
+
} else {
|
322
|
+
numberStyle.add('margin-top', marginTop + 'px');
|
323
|
+
lineStyle.add('border-left', this.graduationLine);
|
324
|
+
lineStyle.add('border-top', this.graduationLine);
|
325
|
+
lineStyle.add('height', lineHeight + 'px');
|
326
|
+
lineStyle.add('width', '100%');
|
327
|
+
}
|
328
|
+
|
329
|
+
numberArray.push(Builder.node('DIV', {style: numberStyle.output()}, [i]));
|
330
|
+
|
331
|
+
if (i == this.options.graduationMax) {
|
332
|
+
lineArray.push(Builder.node('DIV', {style: lineStyle.output()}, [Builder.node('BR')]));
|
333
|
+
} else {
|
334
|
+
lineArray.push(Builder.node('DIV', {style: lineStyle.output()}));
|
335
|
+
}
|
336
|
+
|
337
|
+
numberStyle.clear();
|
338
|
+
lineStyle.clear();
|
339
|
+
|
340
|
+
marginTop -= (document.all) ? 0.05 : 0.1;
|
341
|
+
i = next;
|
342
|
+
}
|
343
|
+
|
344
|
+
return [
|
345
|
+
Builder.node('DIV', {style: 'float: left; margin-left: 10px; width: 25px; text-align: right;'}, numberArray),
|
346
|
+
Builder.node('DIV', {style: 'float: left; margin-right: 10px; margin-left: 10px; width: 5px;'}, lineArray)
|
347
|
+
];
|
348
|
+
},
|
349
|
+
|
350
|
+
buildContent: function() {
|
351
|
+
var nodes = new Array();
|
352
|
+
|
353
|
+
for (var i = 0; i < this.params.length; i++) {
|
354
|
+
var child = this.params[i];
|
355
|
+
|
356
|
+
var maxSize;
|
357
|
+
if (child.getValue() > 0) maxSize = this.getPlusChartSize();
|
358
|
+
else maxSize = this.getMinusChartSize();
|
359
|
+
|
360
|
+
var barSize = this.getBarSize(child);
|
361
|
+
barSize = (barSize > maxSize) ? maxSize : barSize;
|
362
|
+
|
363
|
+
var bar;
|
364
|
+
if (child.options.image) {
|
365
|
+
bar = Builder.node('IMG', {src: child.getImage(), alt: 'bar', width: '10px', height: barSize + 'px'});
|
366
|
+
} else {
|
367
|
+
bar = Builder.node('DIV', {style: 'border-top: ' + barSize + 'px solid ' + child.options.color + '; width: 10px; font-size: 0;'});
|
368
|
+
}
|
369
|
+
|
370
|
+
var elm;
|
371
|
+
if (child.getValue() > 0) {
|
372
|
+
elm = Builder.node(
|
373
|
+
'DIV',
|
374
|
+
{style: 'float: left; margin-right: 10px; width: 25px;'},
|
375
|
+
[
|
376
|
+
Builder.node('DIV', {style: 'margin-top: ' + (maxSize - barSize) + 'px; font: ' + this.fontSize + ';'}, [child.getValue()]),
|
377
|
+
bar,
|
378
|
+
Builder.node('DIV', {style: 'margin-top: ' + (this.getMinusChartSize() + 15) + 'px; font: ' + this.fontSize + '; padding-top: 5px; width: 10px;'}, [child.getName()])
|
379
|
+
]);
|
380
|
+
} else {
|
381
|
+
elm = Builder.node(
|
382
|
+
'DIV',
|
383
|
+
{style: 'float: left; margin-right: 10px; width: 25px;'},
|
384
|
+
[
|
385
|
+
Builder.node('DIV', {style: 'margin-top: ' + (this.getPlusChartSize() + this.getFontSize()) + 'px'}),
|
386
|
+
bar,
|
387
|
+
Builder.node('DIV', {style: 'font: ' + this.fontSize + ';'}, [child.getValue()]),
|
388
|
+
Builder.node('DIV', {style: 'margin-top: ' + (maxSize + 15 - (this.getFontSize() + barSize)) + 'px; font: ' + this.fontSize + '; padding-top: 5px; width: 10px;'}, [child.getName()])
|
389
|
+
]);
|
390
|
+
}
|
391
|
+
|
392
|
+
nodes.push(elm);
|
393
|
+
}
|
394
|
+
|
395
|
+
nodes.push(Builder.node('DIV', {style: 'clear: left;'}));
|
396
|
+
return nodes;
|
397
|
+
}
|
398
|
+
});
|
399
|
+
|
400
|
+
var ChartParameter = Class.create();
|
401
|
+
ChartParameter.prototype = {
|
402
|
+
|
403
|
+
initialize: function(name, value) {
|
404
|
+
if (isNaN(value)) throw '[ChartParameter] value property must be number!(' + value + ')';
|
405
|
+
|
406
|
+
this.name = name;
|
407
|
+
this.value = value;
|
408
|
+
|
409
|
+
this.options = Object.extend({
|
410
|
+
color: '#FF0000',
|
411
|
+
barHeight: '15',
|
412
|
+
image: false,
|
413
|
+
imageHeight: '15',
|
414
|
+
action: false
|
415
|
+
}, arguments[2] || {});
|
416
|
+
},
|
417
|
+
|
418
|
+
getName: function() {
|
419
|
+
return this.name;
|
420
|
+
},
|
421
|
+
|
422
|
+
getValue: function() {
|
423
|
+
return this.value;
|
424
|
+
},
|
425
|
+
|
426
|
+
setValue: function(value) {
|
427
|
+
if (!value || isNaN(value)) this.value = 0;
|
428
|
+
else this.value = value;
|
429
|
+
},
|
430
|
+
|
431
|
+
getImage: function() {
|
432
|
+
return this.options.image;
|
433
|
+
}
|
434
|
+
}
|
435
|
+
|
436
|
+
var StyleManager = Class.create();
|
437
|
+
StyleManager.prototype = {
|
438
|
+
|
439
|
+
initialize: function() {
|
440
|
+
this.cacheItems = new Array();
|
441
|
+
this.items = new Array();
|
442
|
+
},
|
443
|
+
|
444
|
+
cache: function(style) {
|
445
|
+
if (typeof(style) == 'object')
|
446
|
+
this.cacheItems.push(style);
|
447
|
+
else if (arguments[1])
|
448
|
+
this.cacheItems.push(new StyleItem(style, arguments[1]));
|
449
|
+
},
|
450
|
+
|
451
|
+
add: function(style) {
|
452
|
+
if (typeof(style) == 'object')
|
453
|
+
this.items.push(style);
|
454
|
+
else if (arguments[1])
|
455
|
+
this.items.push(new StyleItem(style, arguments[1]));
|
456
|
+
},
|
457
|
+
|
458
|
+
get: function(name) {
|
459
|
+
return this.items.detect(function(child) {
|
460
|
+
return child.getName() == name;
|
461
|
+
});
|
462
|
+
},
|
463
|
+
|
464
|
+
remove: function(name) {
|
465
|
+
this.items = this.items.findAll(function(child) {
|
466
|
+
return child.getName() != name;
|
467
|
+
});
|
468
|
+
},
|
469
|
+
|
470
|
+
clear: function(name) {
|
471
|
+
this.items = new Array();
|
472
|
+
},
|
473
|
+
|
474
|
+
modify: function(name, value) {
|
475
|
+
var item = this.get(name);
|
476
|
+
|
477
|
+
if (item) item.setValue(value);
|
478
|
+
else this.add(name, value);
|
479
|
+
},
|
480
|
+
|
481
|
+
output: function() {
|
482
|
+
var style = '';
|
483
|
+
|
484
|
+
this.cacheItems.each(function(child) {
|
485
|
+
style += child.toString();
|
486
|
+
});
|
487
|
+
|
488
|
+
this.items.each(function(child) {
|
489
|
+
style += child.toString();
|
490
|
+
});
|
491
|
+
|
492
|
+
return style;
|
493
|
+
}
|
494
|
+
}
|
495
|
+
|
496
|
+
var StyleItem = Class.create();
|
497
|
+
StyleItem.prototype = {
|
498
|
+
|
499
|
+
initialize: function(name, value) {
|
500
|
+
this.name = name;
|
501
|
+
this.value = value;
|
502
|
+
},
|
503
|
+
|
504
|
+
setName: function(name) {
|
505
|
+
this.name = name;
|
506
|
+
},
|
507
|
+
|
508
|
+
setValue: function(value) {
|
509
|
+
this.value = value;
|
510
|
+
},
|
511
|
+
|
512
|
+
getName: function() {
|
513
|
+
return this.name;
|
514
|
+
},
|
515
|
+
|
516
|
+
getValue: function() {
|
517
|
+
return this.value;
|
518
|
+
},
|
519
|
+
|
520
|
+
toString: function() {
|
521
|
+
return this.getName() + ':' + this.getValue() + '; ';
|
522
|
+
}
|
523
|
+
}
|
524
|
+
|