platform 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +191 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +5 -0
- data/Rakefile +37 -0
- data/app/assets/images/platform/.gitkeep +0 -0
- data/app/assets/images/platform/accept.png +0 -0
- data/app/assets/images/platform/action_tab_bkgd.gif +0 -0
- data/app/assets/images/platform/action_tab_white_bkgd.gif +0 -0
- data/app/assets/images/platform/add.png +0 -0
- data/app/assets/images/platform/apps/app_icon.gif +0 -0
- data/app/assets/images/platform/apps/app_logo.gif +0 -0
- data/app/assets/images/platform/arrow_down.gif +0 -0
- data/app/assets/images/platform/arrow_down.png +0 -0
- data/app/assets/images/platform/arrow_down_grey.png +0 -0
- data/app/assets/images/platform/arrow_right.gif +0 -0
- data/app/assets/images/platform/arrow_up.png +0 -0
- data/app/assets/images/platform/arrow_up_grey.png +0 -0
- data/app/assets/images/platform/bullet_go.png +0 -0
- data/app/assets/images/platform/buttons.png +0 -0
- data/app/assets/images/platform/cancel.png +0 -0
- data/app/assets/images/platform/clipboard_icon.gif +0 -0
- data/app/assets/images/platform/close.gif +0 -0
- data/app/assets/images/platform/cross.png +0 -0
- data/app/assets/images/platform/default_app_icon.gif +0 -0
- data/app/assets/images/platform/default_app_logo.gif +0 -0
- data/app/assets/images/platform/delete.png +0 -0
- data/app/assets/images/platform/disk.png +0 -0
- data/app/assets/images/platform/exclamation.png +0 -0
- data/app/assets/images/platform/eye.png +0 -0
- data/app/assets/images/platform/eye_not.png +0 -0
- data/app/assets/images/platform/field_sprite.gif +0 -0
- data/app/assets/images/platform/find.png +0 -0
- data/app/assets/images/platform/globe.gif +0 -0
- data/app/assets/images/platform/help.png +0 -0
- data/app/assets/images/platform/help/app_reg.png +0 -0
- data/app/assets/images/platform/help/app_reg_ext.png +0 -0
- data/app/assets/images/platform/help/app_reg_web.png +0 -0
- data/app/assets/images/platform/help/auth_desktop.png +0 -0
- data/app/assets/images/platform/help/auth_iframe.png +0 -0
- data/app/assets/images/platform/help/auth_iphone.png +0 -0
- data/app/assets/images/platform/help/auth_web.png +0 -0
- data/app/assets/images/platform/help/authorize.png +0 -0
- data/app/assets/images/platform/help/ext.png +0 -0
- data/app/assets/images/platform/help/login.png +0 -0
- data/app/assets/images/platform/help/login_desktop.png +0 -0
- data/app/assets/images/platform/help/login_iphone.png +0 -0
- data/app/assets/images/platform/help/login_web.png +0 -0
- data/app/assets/images/platform/help2.png +0 -0
- data/app/assets/images/platform/information.png +0 -0
- data/app/assets/images/platform/keyboard.png +0 -0
- data/app/assets/images/platform/language_selector_arrow.gif +0 -0
- data/app/assets/images/platform/left_quote.png +0 -0
- data/app/assets/images/platform/lightning.png +0 -0
- data/app/assets/images/platform/loading.gif +0 -0
- data/app/assets/images/platform/loading2.gif +0 -0
- data/app/assets/images/platform/loading3.gif +0 -0
- data/app/assets/images/platform/loading_animation.gif +0 -0
- data/app/assets/images/platform/loading_large.gif +0 -0
- data/app/assets/images/platform/lock.png +0 -0
- data/app/assets/images/platform/lock_add.png +0 -0
- data/app/assets/images/platform/lock_delete.png +0 -0
- data/app/assets/images/platform/lock_open.png +0 -0
- data/app/assets/images/platform/medals/bronze.png +0 -0
- data/app/assets/images/platform/medals/gold.png +0 -0
- data/app/assets/images/platform/medals/runner.png +0 -0
- data/app/assets/images/platform/medals/silver.png +0 -0
- data/app/assets/images/platform/minus_node.png +0 -0
- data/app/assets/images/platform/oauth/perm_tile.gif +0 -0
- data/app/assets/images/platform/oauth/right_grey.png +0 -0
- data/app/assets/images/platform/pencil.png +0 -0
- data/app/assets/images/platform/photo_silhouette.gif +0 -0
- data/app/assets/images/platform/pixel.gif +0 -0
- data/app/assets/images/platform/platform.png +0 -0
- data/app/assets/images/platform/platform2.png +0 -0
- data/app/assets/images/platform/platform3.png +0 -0
- data/app/assets/images/platform/platform4.png +0 -0
- data/app/assets/images/platform/platform5.png +0 -0
- data/app/assets/images/platform/plus.png +0 -0
- data/app/assets/images/platform/plus_node.png +0 -0
- data/app/assets/images/platform/random.png +0 -0
- data/app/assets/images/platform/random2.png +0 -0
- data/app/assets/images/platform/rating_star0.png +0 -0
- data/app/assets/images/platform/rating_star05.png +0 -0
- data/app/assets/images/platform/rating_star1.png +0 -0
- data/app/assets/images/platform/rating_stars.gif +0 -0
- data/app/assets/images/platform/rating_stars.psd +0 -0
- data/app/assets/images/platform/reply.png +0 -0
- data/app/assets/images/platform/right_quote.png +0 -0
- data/app/assets/images/platform/rotating_world.gif +0 -0
- data/app/assets/images/platform/script.png +0 -0
- data/app/assets/images/platform/script_edit.png +0 -0
- data/app/assets/images/platform/script_gear.png +0 -0
- data/app/assets/images/platform/site_sprite.gif +0 -0
- data/app/assets/images/platform/spinner.gif +0 -0
- data/app/assets/images/platform/star.png +0 -0
- data/app/assets/images/platform/table_edit.png +0 -0
- data/app/assets/images/platform/table_gear.png +0 -0
- data/app/assets/images/platform/table_multiple.png +0 -0
- data/app/assets/images/platform/thumb_down.png +0 -0
- data/app/assets/images/platform/thumb_up.png +0 -0
- data/app/assets/images/platform/top_left_stem.png +0 -0
- data/app/assets/images/platform/top_right_stem.png +0 -0
- data/app/assets/images/platform/translate_icn.gif +0 -0
- data/app/assets/images/platform/treeview/diffDoc.gif +0 -0
- data/app/assets/images/platform/treeview/diffFolder.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2blank.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2doc.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2folderclosed.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2folderopen.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2lastnode.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2link.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2mlastnode.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2mnode.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2node.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2plastnode.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2pnode.gif +0 -0
- data/app/assets/images/platform/treeview/ftv2vertline.gif +0 -0
- data/app/assets/images/platform/wizard.png +0 -0
- data/app/assets/images/platform/world_link.png +0 -0
- data/app/assets/javascripts/platform/api_explorer.js +628 -0
- data/app/assets/javascripts/platform/application.js +9 -0
- data/app/assets/javascripts/platform/ftiens4.js +1197 -0
- data/app/assets/javascripts/platform/jsdk.js +539 -0
- data/app/assets/javascripts/platform/platform.js +447 -0
- data/app/assets/javascripts/platform/shortcut.js +223 -0
- data/app/assets/javascripts/platform/ua.js +147 -0
- data/app/assets/stylesheets/platform/api_explorer.css.scss +140 -0
- data/app/assets/stylesheets/platform/application.css.scss +6 -0
- data/app/assets/stylesheets/platform/components.css.scss +208 -0
- data/app/assets/stylesheets/platform/layout.css.scss +119 -0
- data/app/assets/stylesheets/platform/oauth.css +51 -0
- data/app/assets/stylesheets/platform/platform.css.scss +311 -0
- data/app/controllers/platform/admin/apps_controller.rb +99 -0
- data/app/controllers/platform/admin/base_controller.rb +60 -0
- data/app/controllers/platform/admin/categories_controller.rb +132 -0
- data/app/controllers/platform/admin/clientsdk_controller.rb +30 -0
- data/app/controllers/platform/admin/developers_controller.rb +30 -0
- data/app/controllers/platform/admin/exceptions_controller.rb +30 -0
- data/app/controllers/platform/admin/forum_controller.rb +34 -0
- data/app/controllers/platform/admin/metrics_controller.rb +42 -0
- data/app/controllers/platform/api/apps_controller.rb +40 -0
- data/app/controllers/platform/api/base_controller.rb +541 -0
- data/app/controllers/platform/apps_controller.rb +142 -0
- data/app/controllers/platform/base_controller.rb +127 -0
- data/app/controllers/platform/developer/api_explorer_controller.rb +56 -0
- data/app/controllers/platform/developer/apps_controller.rb +161 -0
- data/app/controllers/platform/developer/base_controller.rb +51 -0
- data/app/controllers/platform/developer/blog_controller.rb +29 -0
- data/app/controllers/platform/developer/dashboard_controller.rb +63 -0
- data/app/controllers/platform/developer/forum_controller.rb +85 -0
- data/app/controllers/platform/developer/help_controller.rb +113 -0
- data/app/controllers/platform/developer/info_controller.rb +41 -0
- data/app/controllers/platform/developer/registration_controller.rb +39 -0
- data/app/controllers/platform/developer/resources_controller.rb +30 -0
- data/app/controllers/platform/forum_controller.rb +74 -0
- data/app/controllers/platform/oauth_controller.rb +421 -0
- data/app/controllers/platform/ratings_controller.rb +61 -0
- data/app/helpers/platform/admin/categories_helper.rb +54 -0
- data/app/helpers/platform/apps_helper.rb +26 -0
- data/app/helpers/platform/developer/dashboard_helper.rb +42 -0
- data/app/helpers/platform/developer/help_helper.rb +45 -0
- data/app/helpers/platform_helper.rb +26 -0
- data/app/models/platform/application.rb +394 -0
- data/app/models/platform/application_category.rb +34 -0
- data/app/models/platform/application_developer.rb +30 -0
- data/app/models/platform/application_filter.rb +30 -0
- data/app/models/platform/application_log.rb +32 -0
- data/app/models/platform/application_log_filter.rb +34 -0
- data/app/models/platform/application_metric.rb +58 -0
- data/app/models/platform/application_metric_filter.rb +34 -0
- data/app/models/platform/application_permission.rb +30 -0
- data/app/models/platform/application_permission_filter.rb +30 -0
- data/app/models/platform/application_usage_metric.rb +58 -0
- data/app/models/platform/application_usage_metric_filter.rb +34 -0
- data/app/models/platform/application_user.rb +45 -0
- data/app/models/platform/application_user_filter.rb +34 -0
- data/app/models/platform/base_filter.rb +46 -0
- data/app/models/platform/category.rb +64 -0
- data/app/models/platform/daily_application_metric.rb +31 -0
- data/app/models/platform/developer.rb +45 -0
- data/app/models/platform/developer_filter.rb +26 -0
- data/app/models/platform/forum_message.rb +35 -0
- data/app/models/platform/forum_message_filter.rb +26 -0
- data/app/models/platform/forum_topic.rb +38 -0
- data/app/models/platform/forum_topic_filter.rb +26 -0
- data/app/models/platform/logged_exception.rb +290 -0
- data/app/models/platform/logged_exception_filter.rb +58 -0
- data/app/models/platform/media/image.rb +26 -0
- data/app/models/platform/media/media.rb +58 -0
- data/app/models/platform/monthly_application_metric.rb +31 -0
- data/app/models/platform/oauth/access_token.rb +57 -0
- data/app/models/platform/oauth/client_token.rb +38 -0
- data/app/models/platform/oauth/oauth_model_methods.rb +41 -0
- data/app/models/platform/oauth/oauth_token.rb +57 -0
- data/app/models/platform/oauth/oauth_token_filter.rb +34 -0
- data/app/models/platform/oauth/refresh_token.rb +47 -0
- data/app/models/platform/oauth/request_token.rb +50 -0
- data/app/models/platform/permission.rb +27 -0
- data/app/models/platform/rating.rb +43 -0
- data/app/models/platform/rating_filter.rb +30 -0
- data/app/models/platform/rollup_log.rb +27 -0
- data/app/models/platform/rollup_log_filter.rb +30 -0
- data/app/models/platform/total_application_metric.rb +40 -0
- data/app/models/platform/weekly_application_metric.rb +31 -0
- data/app/views/platform/admin/apps/_categories.html.erb +17 -0
- data/app/views/platform/admin/apps/_categories_scripts.html.erb +17 -0
- data/app/views/platform/admin/apps/_tabs.html.erb +25 -0
- data/app/views/platform/admin/apps/index.html.erb +32 -0
- data/app/views/platform/admin/apps/permissions.html.erb +7 -0
- data/app/views/platform/admin/apps/ratings.html.erb +7 -0
- data/app/views/platform/admin/apps/tokens.html.erb +18 -0
- data/app/views/platform/admin/apps/users.html.erb +7 -0
- data/app/views/platform/admin/apps/view.html.erb +170 -0
- data/app/views/platform/admin/categories/_tabs.html.erb +22 -0
- data/app/views/platform/admin/categories/category_assigner.html.erb +9 -0
- data/app/views/platform/admin/categories/category_assigner_tree.html.erb +81 -0
- data/app/views/platform/admin/categories/index.html.erb +106 -0
- data/app/views/platform/admin/categories/items.html.erb +153 -0
- data/app/views/platform/admin/categories/lb_update_application_category.html.erb +54 -0
- data/app/views/platform/admin/categories/lb_update_category.html.erb +64 -0
- data/app/views/platform/admin/categories/tree.html.erb +64 -0
- data/app/views/platform/admin/clientsdk/index.html.erb +89 -0
- data/app/views/platform/admin/common/_footer.html.erb +1 -0
- data/app/views/platform/admin/common/_header.html.erb +32 -0
- data/app/views/platform/admin/common/_lightbox_buttons.html.erb +5 -0
- data/app/views/platform/admin/common/_paginator.html.erb +20 -0
- data/app/views/platform/admin/developers/_tabs.html.erb +22 -0
- data/app/views/platform/admin/developers/index.html.erb +7 -0
- data/app/views/platform/admin/exceptions/_tabs.html.erb +22 -0
- data/app/views/platform/admin/exceptions/index.html.erb +7 -0
- data/app/views/platform/admin/forum/_tabs.html.erb +22 -0
- data/app/views/platform/admin/forum/index.html.erb +7 -0
- data/app/views/platform/admin/forum/messages.html.erb +7 -0
- data/app/views/platform/admin/metrics/_tabs.html.erb +25 -0
- data/app/views/platform/admin/metrics/application_log.html.erb +7 -0
- data/app/views/platform/admin/metrics/index.html.erb +9 -0
- data/app/views/platform/admin/metrics/rollup_log.html.erb +7 -0
- data/app/views/platform/admin/metrics/usage.html.erb +7 -0
- data/app/views/platform/apps/_actions_module.html.erb +3 -0
- data/app/views/platform/apps/_app_footer.html.erb +8 -0
- data/app/views/platform/apps/_app_header.html.erb +25 -0
- data/app/views/platform/apps/_apps_module.html.erb +42 -0
- data/app/views/platform/apps/_authorize_form.html.erb +11 -0
- data/app/views/platform/apps/_categories_module.html.erb +11 -0
- data/app/views/platform/apps/_featured_apps_module.html.erb +40 -0
- data/app/views/platform/apps/_left.html.erb +20 -0
- data/app/views/platform/apps/_monthly_users_module.html.erb +8 -0
- data/app/views/platform/apps/_paginator.html.erb +13 -0
- data/app/views/platform/apps/_rank_module.html.erb +18 -0
- data/app/views/platform/apps/_search_apps_module.html.erb +35 -0
- data/app/views/platform/apps/canvas_app.html.erb +15 -0
- data/app/views/platform/apps/index.html.erb +86 -0
- data/app/views/platform/apps/view.html.erb +71 -0
- data/app/views/platform/apps/xd.html.erb +11 -0
- data/app/views/platform/common/_footer.html.erb +1 -0
- data/app/views/platform/common/_header.html.erb +4 -0
- data/app/views/platform/common/_paginator.html.erb +32 -0
- data/app/views/platform/common/_scripts.html.erb +7 -0
- data/app/views/platform/common/_user_login.html.erb +11 -0
- data/app/views/platform/developer/api_explorer/history.html.erb +31 -0
- data/app/views/platform/developer/api_explorer/index.html.erb +134 -0
- data/app/views/platform/developer/api_explorer/oauth_lander.html.erb +4 -0
- data/app/views/platform/developer/api_explorer/options.html.erb +44 -0
- data/app/views/platform/developer/apps/_form.html.erb +340 -0
- data/app/views/platform/developer/apps/create_version.html.erb +19 -0
- data/app/views/platform/developer/apps/edit.html.erb +21 -0
- data/app/views/platform/developer/apps/index.html.erb +375 -0
- data/app/views/platform/developer/apps/new.html.erb +20 -0
- data/app/views/platform/developer/blog/index.html.erb +7 -0
- data/app/views/platform/developer/common/_footer.html.erb +1 -0
- data/app/views/platform/developer/common/_header.html.erb +34 -0
- data/app/views/platform/developer/dashboard/_apps_info.html.erb +84 -0
- data/app/views/platform/developer/dashboard/_discussions.html.erb +68 -0
- data/app/views/platform/developer/dashboard/_header.html.erb +12 -0
- data/app/views/platform/developer/dashboard/_reviews.html.erb +53 -0
- data/app/views/platform/developer/dashboard/_statistics.html.erb +105 -0
- data/app/views/platform/developer/dashboard/index.html.erb +85 -0
- data/app/views/platform/developer/dashboard/settings.html.erb +23 -0
- data/app/views/platform/developer/forum/_message.html.erb +17 -0
- data/app/views/platform/developer/forum/_messages.html.erb +14 -0
- data/app/views/platform/developer/forum/_new_message.html.erb +28 -0
- data/app/views/platform/developer/forum/_new_topic.html.erb +39 -0
- data/app/views/platform/developer/forum/index.html.erb +89 -0
- data/app/views/platform/developer/forum/topic.html.erb +28 -0
- data/app/views/platform/developer/help/_footer.html.erb +4 -0
- data/app/views/platform/developer/help/_header.html.erb +95 -0
- data/app/views/platform/developer/help/_navigation.html.erb +99 -0
- data/app/views/platform/developer/help/api.html.erb +120 -0
- data/app/views/platform/developer/help/credits.html.erb +77 -0
- data/app/views/platform/developer/help/index.html.erb +19 -0
- data/app/views/platform/developer/help/license.html.erb +586 -0
- data/app/views/platform/developer/help/oauth_app_login.html.erb +177 -0
- data/app/views/platform/developer/help/oauth_client_side.html.erb +264 -0
- data/app/views/platform/developer/help/oauth_desktop.html.erb +191 -0
- data/app/views/platform/developer/help/oauth_extensions.html.erb +342 -0
- data/app/views/platform/developer/help/oauth_intro.html.erb +371 -0
- data/app/views/platform/developer/help/oauth_mobile.html.erb +292 -0
- data/app/views/platform/developer/help/oauth_server_side.html.erb +603 -0
- data/app/views/platform/developer/help/oauth_trusted_client.html.erb +202 -0
- data/app/views/platform/developer/help/reference.html.erb +42 -0
- data/app/views/platform/developer/help/sdk_ios.html.erb +31 -0
- data/app/views/platform/developer/help/sdk_js.html.erb +202 -0
- data/app/views/platform/developer/info/_basic_info.html.erb +74 -0
- data/app/views/platform/developer/info/_header.html.erb +12 -0
- data/app/views/platform/developer/info/index.html.erb +23 -0
- data/app/views/platform/developer/registration/index.html.erb +134 -0
- data/app/views/platform/developer/resources/index.html.erb +23 -0
- data/app/views/platform/forum/_message.html.erb +17 -0
- data/app/views/platform/forum/_messages.html.erb +14 -0
- data/app/views/platform/forum/_new_message.html.erb +26 -0
- data/app/views/platform/forum/_new_topic.html.erb +38 -0
- data/app/views/platform/forum/_topic.html.erb +18 -0
- data/app/views/platform/forum/_topics.html.erb +74 -0
- data/app/views/platform/login/index.html.erb +31 -0
- data/app/views/platform/login/register.html.erb +55 -0
- data/app/views/platform/oauth/_authorization_box.html.erb +75 -0
- data/app/views/platform/oauth/_authorization_popup.html.erb +38 -0
- data/app/views/platform/oauth/_authorize_form.html.erb +11 -0
- data/app/views/platform/oauth/auth_failed.html.erb +0 -0
- data/app/views/platform/oauth/auth_success.html.erb +0 -0
- data/app/views/platform/oauth/authorize_desktop.html.erb +76 -0
- data/app/views/platform/oauth/authorize_failure_iframe.html.erb +1 -0
- data/app/views/platform/oauth/authorize_failure_mobile.html.erb +24 -0
- data/app/views/platform/oauth/authorize_failure_popup.html.erb +24 -0
- data/app/views/platform/oauth/authorize_failure_web.html.erb +1 -0
- data/app/views/platform/oauth/authorize_iframe.html.erb +16 -0
- data/app/views/platform/oauth/authorize_mobile.html.erb +1 -0
- data/app/views/platform/oauth/authorize_popup.html.erb +1 -0
- data/app/views/platform/oauth/authorize_success_iframe.html.erb +1 -0
- data/app/views/platform/oauth/authorize_success_mobile.html.erb +24 -0
- data/app/views/platform/oauth/authorize_success_popup.html.erb +24 -0
- data/app/views/platform/oauth/authorize_success_web.html.erb +1 -0
- data/app/views/platform/oauth/authorize_web.html.erb +3 -0
- data/app/views/platform/oauth/xd.html.erb +13 -0
- data/app/views/platform/ratings/_list.html.erb +30 -0
- data/app/views/platform/ratings/_new.html.erb +70 -0
- data/app/views/platform/ratings/_rating.html.erb +17 -0
- data/config/platform/config.yml +133 -0
- data/config/platform/data/default_applications.yml +39 -0
- data/config/platform/data/default_categories.yml +56 -0
- data/config/platform/data/default_permissions.yml +0 -0
- data/config/platform/site/features.yml +66 -0
- data/config/routes.rb +59 -0
- data/db/migrate/20110602232141_create_platform_tables.rb +262 -0
- data/docs/Classes.graffle +7315 -0
- data/docs/Classes.pdf +0 -0
- data/lib/generators/platform/platform_generator.rb +56 -0
- data/lib/generators/platform/templates/db/create_platform_tables.rb +262 -0
- data/lib/generators/platform/templates/layouts/platform.html.erb +49 -0
- data/lib/generators/platform/templates/layouts/platform_admin.html.erb +60 -0
- data/lib/platform.rb +6 -0
- data/lib/platform/api/already_jsoned_string.rb +9 -0
- data/lib/platform/api/proxy.rb +45 -0
- data/lib/platform/api/proxy/base.rb +62 -0
- data/lib/platform/cache.rb +78 -0
- data/lib/platform/config.rb +666 -0
- data/lib/platform/engine.rb +5 -0
- data/lib/platform/exception.rb +27 -0
- data/lib/platform/extensions/action_controller_extension.rb +65 -0
- data/lib/platform/extensions/action_view_extension.rb +168 -0
- data/lib/platform/extensions/object_extension.rb +51 -0
- data/lib/platform/helper.rb +33 -0
- data/lib/platform/logger.rb +62 -0
- data/lib/platform/railtie.rb +52 -0
- data/lib/platform/random_password_generator.rb +76 -0
- data/lib/platform/simple_string_permissions.rb +40 -0
- data/lib/platform/version.rb +3 -0
- data/lib/tasks/platform.rake +119 -0
- data/platform.gemspec +45 -0
- data/script/rails +6 -0
- data/spec/config/config_spec.rb +10 -0
- data/spec/dummy_app.rb +52 -0
- data/spec/models/application_spec.rb +53 -0
- data/spec/models/developer_spec.rb +23 -0
- data/spec/spec_helper.rb +29 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +7 -0
- data/test/dummy/app/assets/stylesheets/admin.css +200 -0
- data/test/dummy/app/assets/stylesheets/application.css +47 -0
- data/test/dummy/app/assets/stylesheets/components.css.scss +211 -0
- data/test/dummy/app/assets/stylesheets/layout.css.scss +143 -0
- data/test/dummy/app/controllers/admin/admins_controller.rb +7 -0
- data/test/dummy/app/controllers/admin/base_controller.rb +12 -0
- data/test/dummy/app/controllers/admin/bookmarks_controller.rb +7 -0
- data/test/dummy/app/controllers/admin/users_controller.rb +19 -0
- data/test/dummy/app/controllers/api/base_controller.rb +5 -0
- data/test/dummy/app/controllers/api/bookmarks_controller.rb +35 -0
- data/test/dummy/app/controllers/api/users_controller.rb +19 -0
- data/test/dummy/app/controllers/application_controller.rb +31 -0
- data/test/dummy/app/controllers/home_controller.rb +7 -0
- data/test/dummy/app/controllers/login_controller.rb +65 -0
- data/test/dummy/app/helpers/application_helper.rb +9 -0
- data/test/dummy/app/helpers/home_helper.rb +2 -0
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/models/admin.rb +4 -0
- data/test/dummy/app/models/admin_filter.rb +7 -0
- data/test/dummy/app/models/bookmark.rb +7 -0
- data/test/dummy/app/models/user.rb +34 -0
- data/test/dummy/app/views/admin/admins/index.html.erb +7 -0
- data/test/dummy/app/views/admin/bookmarks/index.html.erb +5 -0
- data/test/dummy/app/views/admin/users/index.html.erb +10 -0
- data/test/dummy/app/views/demo/index.rhtml +108 -0
- data/test/dummy/app/views/demo/tokens.rhtml +35 -0
- data/test/dummy/app/views/home/index.html.erb +43 -0
- data/test/dummy/app/views/layouts/_footer.html.erb +16 -0
- data/test/dummy/app/views/layouts/_header.html.erb +22 -0
- data/test/dummy/app/views/layouts/admin.html.erb +97 -0
- data/test/dummy/app/views/layouts/application.html.erb +25 -0
- data/test/dummy/app/views/layouts/minimal.html.erb +37 -0
- data/test/dummy/app/views/layouts/popup.html.erb +43 -0
- data/test/dummy/app/views/login/index.html.erb +34 -0
- data/test/dummy/app/views/login/register.html.erb +51 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +51 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +30 -0
- data/test/dummy/config/environments/production.rb +60 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/platform/api/0/bookmark.yml +18 -0
- data/test/dummy/config/platform/api/0/user.yml +17 -0
- data/test/dummy/config/platform/api/1/bookmark.yml +58 -0
- data/test/dummy/config/platform/api/1/user.yml +36 -0
- data/test/dummy/config/platform/config.yml +135 -0
- data/test/dummy/config/platform/data/default_applications.yml +39 -0
- data/test/dummy/config/platform/data/default_categories.yml +56 -0
- data/test/dummy/config/platform/data/default_permissions.yml +0 -0
- data/test/dummy/config/platform/site/features.yml +66 -0
- data/test/dummy/config/platform/site/sample_apps.yml +100 -0
- data/test/dummy/config/routes.rb +30 -0
- data/test/dummy/config/tr8n/config.yml +247 -0
- data/test/dummy/config/tr8n/data/ip_locations.csv +93460 -0
- data/test/dummy/config/tr8n/rules/default_date_rules.yml +20 -0
- data/test/dummy/config/tr8n/rules/default_gender_list_rules.yml +82 -0
- data/test/dummy/config/tr8n/rules/default_gender_rules.yml +20 -0
- data/test/dummy/config/tr8n/rules/default_language_cases.yml +272 -0
- data/test/dummy/config/tr8n/rules/default_list_rules.yml +19 -0
- data/test/dummy/config/tr8n/rules/default_numeric_rules.yml +42 -0
- data/test/dummy/config/tr8n/rules/default_value_rules.yml +18 -0
- data/test/dummy/config/tr8n/site/default_glossary.yml +18 -0
- data/test/dummy/config/tr8n/site/default_languages.yml +1591 -0
- data/test/dummy/config/tr8n/site/features.yml +111 -0
- data/test/dummy/config/tr8n/site/shortcuts.yml +55 -0
- data/test/dummy/config/tr8n/site/sitemap.json +42 -0
- data/test/dummy/config/tr8n/tokens/data.yml +19 -0
- data/test/dummy/config/tr8n/tokens/decorations.yml +19 -0
- data/test/dummy/config/will_filter/config.yml +99 -0
- data/test/dummy/db/migrate/20101207014543_create_users.rb +23 -0
- data/test/dummy/db/migrate/20110113223509_create_admins.rb +15 -0
- data/test/dummy/db/migrate/20110930041143_create_will_filter_filters.rb +15 -0
- data/test/dummy/db/migrate/20110930041150_create_tr8n_tables.rb +350 -0
- data/test/dummy/db/migrate/20111004075531_create_platform_tables.rb +262 -0
- data/test/dummy/db/migrate/20111012055603_create_bookmarks.rb +10 -0
- data/test/dummy/db/schema.rb +683 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/lib/platform/api/bookmark_proxy_0.rb +12 -0
- data/test/dummy/lib/platform/api/bookmark_proxy_1.rb +12 -0
- data/test/dummy/lib/platform/api/user_proxy_0.rb +12 -0
- data/test/dummy/lib/platform/api/user_proxy_1.rb +12 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/documents.yml +11 -0
- data/test/dummy/test/unit/document_test.rb +7 -0
- metadata +886 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,1197 @@
|
|
1
|
+
//****************************************************************
|
2
|
+
// You must keep this copyright notice:
|
3
|
+
//
|
4
|
+
// This script is Copyright (c) 2006 by Conor O'Mahony.
|
5
|
+
// For inquiries, please email GubuSoft@GubuSoft.com.
|
6
|
+
// GubuSoft is owned and operated by Conor O'Mahony.
|
7
|
+
// Original author of TreeView script is Marcelino Martins.
|
8
|
+
//
|
9
|
+
// Do not download the script's files from here. For a free
|
10
|
+
// download and full instructions go to the following site:
|
11
|
+
// http://www.TreeView.net
|
12
|
+
//****************************************************************
|
13
|
+
|
14
|
+
// Log of changes:
|
15
|
+
// 26 Sep 06 - Updated preLoadIcons function;
|
16
|
+
// Fix small bugs or typos (in the Folder, InitializeFolder,
|
17
|
+
// and blockStartHTML functions)
|
18
|
+
// 14 Feb 06 - Re-brand as GubuSoft
|
19
|
+
// 08 Jun 04 - Very small change to one error message
|
20
|
+
// 21 Mar 04 - Support for folder.addChildren allows for much bigger trees
|
21
|
+
// 12 May 03 - Support for Safari Beta 3
|
22
|
+
// 01 Mar 03 - VERSION 4.3 - Support for checkboxes
|
23
|
+
// 21 Feb 03 - Added support for Opera 7
|
24
|
+
// 22 Sep 02 - Added maySelect member for node-by-node control
|
25
|
+
// of selection and highlight
|
26
|
+
// 21 Sep 02 - Cookie values are now separated by cookieCutter
|
27
|
+
// 12 Sep 02 - VERSION 4.2 - Can highlight Selected Nodes and
|
28
|
+
// can preserve state through external (DB) IDs
|
29
|
+
// 29 Aug 02 - Fine tune 'supportDeferral' for IE4 and IE Mac
|
30
|
+
// 25 Aug 02 - Fixes: STARTALLOPEN, and multi-page frameless
|
31
|
+
// 09 Aug 02 - Fix repeated folder on Mozilla 1.x
|
32
|
+
// 31 Jul 02 - VERSION 4.1 - Dramatic speed increase for trees
|
33
|
+
// with hundreds or thousands of nodes; changes to the control
|
34
|
+
// flags of the gLnk function
|
35
|
+
// 18 Jul 02 - Changes in pre-load images function
|
36
|
+
// 13 Jun 02 - Add ICONPATH var to allow for gif subdir
|
37
|
+
// 20 Apr 02 - Improve support for frame-less layout
|
38
|
+
// 07 Apr 02 - Minor changes to support server-side dynamic feeding
|
39
|
+
// (example: FavoritesManagerASP)
|
40
|
+
|
41
|
+
|
42
|
+
// Definition of class Folder
|
43
|
+
// *****************************************************************
|
44
|
+
function Folder(folderDescription, hreference) //constructor
|
45
|
+
{
|
46
|
+
//constant data
|
47
|
+
this.desc = folderDescription;
|
48
|
+
this.hreference = hreference;
|
49
|
+
this.id = -1;
|
50
|
+
this.navObj = 0;
|
51
|
+
this.iconImg = 0;
|
52
|
+
this.nodeImg = 0;
|
53
|
+
this.iconSrc = ICONPATH + "ftv2folderopen.gif";
|
54
|
+
this.iconSrcClosed = ICONPATH + "ftv2folderclosed.gif";
|
55
|
+
this.children = new Array;
|
56
|
+
this.nChildren = 0;
|
57
|
+
this.level = 0;
|
58
|
+
this.leftSideCoded = "";
|
59
|
+
this.isLastNode=false;
|
60
|
+
this.parentObj = null;
|
61
|
+
this.maySelect=true;
|
62
|
+
this.prependHTML = ""
|
63
|
+
|
64
|
+
//dynamic data
|
65
|
+
this.isOpen = false
|
66
|
+
this.isLastOpenedFolder = false
|
67
|
+
this.isRendered = 0
|
68
|
+
|
69
|
+
//methods
|
70
|
+
this.initialize = initializeFolder
|
71
|
+
this.setState = setStateFolder
|
72
|
+
this.addChild = addChild
|
73
|
+
this.addChildren = addChildren
|
74
|
+
this.createIndex = createEntryIndex
|
75
|
+
this.escondeBlock = escondeBlock
|
76
|
+
this.esconde = escondeFolder
|
77
|
+
this.folderMstr = folderMstr
|
78
|
+
this.renderOb = drawFolder
|
79
|
+
this.totalHeight = totalHeight
|
80
|
+
this.subEntries = folderSubEntries
|
81
|
+
this.linkHTML = linkFolderHTML
|
82
|
+
this.blockStartHTML = blockStartHTML
|
83
|
+
this.blockEndHTML = blockEndHTML
|
84
|
+
this.nodeImageSrc = nodeImageSrc
|
85
|
+
this.iconImageSrc = iconImageSrc
|
86
|
+
this.getID = getID
|
87
|
+
this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders
|
88
|
+
}
|
89
|
+
|
90
|
+
function initializeFolder(level, lastNode, leftSide)
|
91
|
+
{
|
92
|
+
var i=0
|
93
|
+
nc = this.nChildren
|
94
|
+
|
95
|
+
this.createIndex()
|
96
|
+
this.level = level
|
97
|
+
this.leftSideCoded = leftSide
|
98
|
+
|
99
|
+
if (browserVersion == 0 || STARTALLOPEN==1)
|
100
|
+
this.isOpen=true;
|
101
|
+
|
102
|
+
if (level>0)
|
103
|
+
if (lastNode) //the last child in the children array
|
104
|
+
leftSide = leftSide + "0"
|
105
|
+
else
|
106
|
+
leftSide = leftSide + "1"
|
107
|
+
|
108
|
+
this.isLastNode = lastNode
|
109
|
+
|
110
|
+
if (nc > 0)
|
111
|
+
{
|
112
|
+
level = level + 1
|
113
|
+
for (i=0 ; i < this.nChildren; i++)
|
114
|
+
{
|
115
|
+
if (typeof this.children[i].initialize == 'undefined') //document node was specified using the addChildren function
|
116
|
+
{
|
117
|
+
if (typeof this.children[i][0] == 'undefined' || typeof this.children[i] == 'string')
|
118
|
+
{
|
119
|
+
this.children[i] = ["item incorrectly defined", ""];
|
120
|
+
}
|
121
|
+
|
122
|
+
//Basic initialization of the Item object
|
123
|
+
//These members or methods are needed even before the Item is rendered
|
124
|
+
this.children[i].initialize=initializeItem;
|
125
|
+
this.children[i].createIndex=createEntryIndex;
|
126
|
+
if (typeof this.children[i].maySelect == 'undefined')
|
127
|
+
this.children[i].maySelect=true
|
128
|
+
this.children[i].forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders
|
129
|
+
}
|
130
|
+
if (i == this.nChildren-1)
|
131
|
+
this.children[i].initialize(level, 1, leftSide)
|
132
|
+
else
|
133
|
+
this.children[i].initialize(level, 0, leftSide)
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
138
|
+
function drawFolder(insertAtObj)
|
139
|
+
{
|
140
|
+
var nodeName = ""
|
141
|
+
var auxEv = ""
|
142
|
+
var docW = ""
|
143
|
+
var i=0
|
144
|
+
|
145
|
+
finalizeCreationOfChildDocs(this)
|
146
|
+
|
147
|
+
var leftSide = leftSideHTML(this.leftSideCoded)
|
148
|
+
|
149
|
+
if (browserVersion > 0)
|
150
|
+
auxEv = "<a href='javascript:clickOnNode(\""+this.getID()+"\")'>"
|
151
|
+
else
|
152
|
+
auxEv = "<a>"
|
153
|
+
|
154
|
+
nodeName = this.nodeImageSrc()
|
155
|
+
|
156
|
+
if (this.level>0) {
|
157
|
+
if (this.isLastNode) //the last child in the children array
|
158
|
+
leftSide = leftSide + "<td valign=top>" + auxEv + "<img name='nodeIcon" + this.id + "' id='nodeIcon" + this.id + "' src='" + nodeName + "' width=16 height=22 border=0></a></td>"
|
159
|
+
else
|
160
|
+
leftSide = leftSide + "<td valign=top background=" + ICONPATH + "ftv2vertline.gif>" + auxEv + "<img name='nodeIcon" + this.id + "' id='nodeIcon" + this.id + "' src='" + nodeName + "' width=16 height=22 border=0></a></td>"
|
161
|
+
}
|
162
|
+
|
163
|
+
this.isRendered = 1
|
164
|
+
|
165
|
+
if (browserVersion == 2) {
|
166
|
+
if (!doc.yPos)
|
167
|
+
doc.yPos=20
|
168
|
+
}
|
169
|
+
|
170
|
+
docW = this.blockStartHTML("folder");
|
171
|
+
|
172
|
+
if (foldersTree.xID == this.xID && DISPLAYROOT==0) {
|
173
|
+
docW = docW + "<tr style='display:none'>";
|
174
|
+
} else {
|
175
|
+
docW = docW + "<tr>";
|
176
|
+
}
|
177
|
+
|
178
|
+
docW = docW + leftSide + "<td valign=top>";
|
179
|
+
|
180
|
+
if (USEICONS)
|
181
|
+
{
|
182
|
+
docW = docW + this.linkHTML(false)
|
183
|
+
docW = docW + "<img id='folderIcon" + this.id + "' name='folderIcon" + this.id + "' src='" + this.iconImageSrc() + "' border=0></a>"
|
184
|
+
}
|
185
|
+
else
|
186
|
+
{
|
187
|
+
if (this.prependHTML == "")
|
188
|
+
docW = docW + "<img src=" + ICONPATH + "ftv2blank.gif height=2 width=2>"
|
189
|
+
}
|
190
|
+
if (WRAPTEXT)
|
191
|
+
docW = docW + "</td>"+this.prependHTML+"<td valign=middle width=100%>"
|
192
|
+
else
|
193
|
+
docW = docW + "</td>"+this.prependHTML+"<td valign=middle nowrap width=100%>"
|
194
|
+
if (USETEXTLINKS)
|
195
|
+
{
|
196
|
+
docW = docW + this.linkHTML(true)
|
197
|
+
docW = docW + this.desc + "</a>"
|
198
|
+
}
|
199
|
+
else
|
200
|
+
docW = docW + this.desc
|
201
|
+
docW = docW + "</td>"
|
202
|
+
|
203
|
+
docW = docW + this.blockEndHTML()
|
204
|
+
|
205
|
+
if (insertAtObj == null)
|
206
|
+
{
|
207
|
+
if (supportsDeferral) {
|
208
|
+
doc.write("<div id=domRoot></div>") //transition between regular flow HTML, and node-insert DOM DHTML
|
209
|
+
insertAtObj = getElById("domRoot")
|
210
|
+
insertAtObj.insertAdjacentHTML("beforeEnd", docW)
|
211
|
+
}
|
212
|
+
else
|
213
|
+
doc.write(docW)
|
214
|
+
}
|
215
|
+
else
|
216
|
+
{
|
217
|
+
insertAtObj.insertAdjacentHTML("afterEnd", docW)
|
218
|
+
}
|
219
|
+
|
220
|
+
if (browserVersion == 2)
|
221
|
+
{
|
222
|
+
this.navObj = doc.layers["folder"+this.id]
|
223
|
+
if (USEICONS)
|
224
|
+
this.iconImg = this.navObj.document.images["folderIcon"+this.id]
|
225
|
+
this.nodeImg = this.navObj.document.images["nodeIcon"+this.id]
|
226
|
+
doc.yPos=doc.yPos+this.navObj.clip.height
|
227
|
+
}
|
228
|
+
else if (browserVersion != 0)
|
229
|
+
{
|
230
|
+
this.navObj = getElById("folder"+this.id)
|
231
|
+
if (USEICONS)
|
232
|
+
this.iconImg = getElById("folderIcon"+this.id)
|
233
|
+
this.nodeImg = getElById("nodeIcon"+this.id)
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
function setStateFolder(isOpen)
|
238
|
+
{
|
239
|
+
var subEntries
|
240
|
+
var totalHeight
|
241
|
+
var fIt = 0
|
242
|
+
var i=0
|
243
|
+
var currentOpen
|
244
|
+
|
245
|
+
if (isOpen == this.isOpen)
|
246
|
+
return
|
247
|
+
|
248
|
+
if (browserVersion == 2)
|
249
|
+
{
|
250
|
+
totalHeight = 0
|
251
|
+
for (i=0; i < this.nChildren; i++)
|
252
|
+
totalHeight = totalHeight + this.children[i].navObj.clip.height
|
253
|
+
subEntries = this.subEntries()
|
254
|
+
if (this.isOpen)
|
255
|
+
totalHeight = 0 - totalHeight
|
256
|
+
for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++)
|
257
|
+
indexOfEntries[fIt].navObj.moveBy(0, totalHeight)
|
258
|
+
}
|
259
|
+
this.isOpen = isOpen;
|
260
|
+
|
261
|
+
if (this.getID()!=foldersTree.getID() && PRESERVESTATE && !this.isOpen) //closing
|
262
|
+
{
|
263
|
+
currentOpen = GetCookie("clickedFolder")
|
264
|
+
if (currentOpen != null) {
|
265
|
+
currentOpen = currentOpen.replace(this.getID()+cookieCutter, "")
|
266
|
+
SetCookie("clickedFolder", currentOpen)
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
if (!this.isOpen && this.isLastOpenedfolder)
|
271
|
+
{
|
272
|
+
lastOpenedFolder = null;
|
273
|
+
this.isLastOpenedfolder = false;
|
274
|
+
}
|
275
|
+
propagateChangesInState(this)
|
276
|
+
}
|
277
|
+
|
278
|
+
function propagateChangesInState(folder)
|
279
|
+
{
|
280
|
+
var i=0
|
281
|
+
|
282
|
+
//Change icon
|
283
|
+
if (folder.nChildren > 0 && folder.level>0) //otherwise the one given at render stays
|
284
|
+
folder.nodeImg.src = folder.nodeImageSrc()
|
285
|
+
|
286
|
+
//Change node
|
287
|
+
if (USEICONS)
|
288
|
+
folder.iconImg.src = folder.iconImageSrc()
|
289
|
+
|
290
|
+
//Propagate changes
|
291
|
+
for (i=folder.nChildren-1; i>=0; i--) {
|
292
|
+
if (folder.isOpen)
|
293
|
+
folder.children[i].folderMstr(folder.navObj)
|
294
|
+
else
|
295
|
+
folder.children[i].esconde()
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
function escondeFolder()
|
300
|
+
{
|
301
|
+
this.escondeBlock()
|
302
|
+
|
303
|
+
this.setState(0)
|
304
|
+
}
|
305
|
+
|
306
|
+
function linkFolderHTML(isTextLink)
|
307
|
+
{
|
308
|
+
var docW = "";
|
309
|
+
|
310
|
+
if (this.hreference)
|
311
|
+
{
|
312
|
+
if (USEFRAMES)
|
313
|
+
docW = docW + "<a href='" + this.hreference + "' TARGET=\"basefrm\" "
|
314
|
+
else
|
315
|
+
docW = docW + "<a href='" + this.hreference + "' TARGET=_top "
|
316
|
+
|
317
|
+
if (isTextLink) {
|
318
|
+
docW += "id=\"itemTextLink"+this.id+"\" ";
|
319
|
+
}
|
320
|
+
|
321
|
+
if (browserVersion > 0)
|
322
|
+
docW = docW + "onClick='javascript:clickOnFolder(\""+this.getID()+"\")'"
|
323
|
+
|
324
|
+
docW = docW + ">"
|
325
|
+
}
|
326
|
+
else
|
327
|
+
docW = docW + "<a>"
|
328
|
+
|
329
|
+
return docW;
|
330
|
+
}
|
331
|
+
|
332
|
+
function addChild(childNode)
|
333
|
+
{
|
334
|
+
this.children[this.nChildren] = childNode
|
335
|
+
childNode.parentObj = this
|
336
|
+
this.nChildren++
|
337
|
+
return childNode
|
338
|
+
}
|
339
|
+
|
340
|
+
//The list can contain either a Folder object or a sub list with the arguments for Item
|
341
|
+
function addChildren(listOfChildren)
|
342
|
+
{
|
343
|
+
this.children = listOfChildren
|
344
|
+
this.nChildren = listOfChildren.length
|
345
|
+
for (i=0; i<this.nChildren; i++)
|
346
|
+
this.children[i].parentObj = this
|
347
|
+
}
|
348
|
+
|
349
|
+
function folderSubEntries()
|
350
|
+
{
|
351
|
+
var i = 0
|
352
|
+
var se = this.nChildren
|
353
|
+
|
354
|
+
for (i=0; i < this.nChildren; i++){
|
355
|
+
if (this.children[i].children) //is a folder
|
356
|
+
se = se + this.children[i].subEntries()
|
357
|
+
}
|
358
|
+
|
359
|
+
return se
|
360
|
+
}
|
361
|
+
|
362
|
+
function nodeImageSrc() {
|
363
|
+
var srcStr = "";
|
364
|
+
|
365
|
+
if (this.isLastNode) //the last child in the children array
|
366
|
+
{
|
367
|
+
if (this.nChildren == 0)
|
368
|
+
srcStr = ICONPATH + "ftv2lastnode.gif"
|
369
|
+
else
|
370
|
+
if (this.isOpen)
|
371
|
+
srcStr = ICONPATH + "ftv2mlastnode.gif"
|
372
|
+
else
|
373
|
+
srcStr = ICONPATH + "ftv2plastnode.gif"
|
374
|
+
}
|
375
|
+
else
|
376
|
+
{
|
377
|
+
if (this.nChildren == 0)
|
378
|
+
srcStr = ICONPATH + "ftv2node.gif"
|
379
|
+
else
|
380
|
+
if (this.isOpen)
|
381
|
+
srcStr = ICONPATH + "ftv2mnode.gif"
|
382
|
+
else
|
383
|
+
srcStr = ICONPATH + "ftv2pnode.gif"
|
384
|
+
}
|
385
|
+
return srcStr;
|
386
|
+
}
|
387
|
+
|
388
|
+
function iconImageSrc() {
|
389
|
+
if (this.isOpen)
|
390
|
+
return(this.iconSrc)
|
391
|
+
else
|
392
|
+
return(this.iconSrcClosed)
|
393
|
+
}
|
394
|
+
|
395
|
+
// Definition of class Item (a document or link inside a Folder)
|
396
|
+
// *************************************************************
|
397
|
+
|
398
|
+
function Item(itemDescription) // Constructor
|
399
|
+
{
|
400
|
+
// constant data
|
401
|
+
this.desc = itemDescription
|
402
|
+
|
403
|
+
this.level = 0
|
404
|
+
this.isLastNode = false
|
405
|
+
this.leftSideCoded = ""
|
406
|
+
this.parentObj = null
|
407
|
+
|
408
|
+
this.maySelect=true
|
409
|
+
|
410
|
+
this.initialize = initializeItem;
|
411
|
+
this.createIndex = createEntryIndex;
|
412
|
+
this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders;
|
413
|
+
|
414
|
+
finalizeCreationOfItem(this)
|
415
|
+
}
|
416
|
+
|
417
|
+
//Assignments that can be delayed when the item is created with folder.addChildren
|
418
|
+
//The assignments that cannot be delayed are done in addChildren and in initializeFolder
|
419
|
+
//Additionaly, some assignments are also done in finalizeCreationOfChildDocs itself
|
420
|
+
function finalizeCreationOfItem(itemArray)
|
421
|
+
{
|
422
|
+
itemArray.navObj = 0 //initialized in render()
|
423
|
+
itemArray.iconImg = 0 //initialized in render()
|
424
|
+
itemArray.iconSrc = ICONPATH + "ftv2doc.gif"
|
425
|
+
itemArray.isRendered = 0
|
426
|
+
itemArray.nChildren = 0
|
427
|
+
itemArray.prependHTML = ""
|
428
|
+
|
429
|
+
// methods
|
430
|
+
itemArray.escondeBlock = escondeBlock
|
431
|
+
itemArray.esconde = escondeBlock
|
432
|
+
itemArray.folderMstr = folderMstr
|
433
|
+
itemArray.renderOb = drawItem
|
434
|
+
itemArray.totalHeight = totalHeight
|
435
|
+
itemArray.blockStartHTML = blockStartHTML
|
436
|
+
itemArray.blockEndHTML = blockEndHTML
|
437
|
+
itemArray.getID = getID
|
438
|
+
}
|
439
|
+
|
440
|
+
function initializeItem(level, lastNode, leftSide)
|
441
|
+
{
|
442
|
+
this.createIndex()
|
443
|
+
this.level = level
|
444
|
+
this.leftSideCoded = leftSide
|
445
|
+
this.isLastNode = lastNode
|
446
|
+
}
|
447
|
+
|
448
|
+
function drawItem(insertAtObj)
|
449
|
+
{
|
450
|
+
var leftSide = leftSideHTML(this.leftSideCoded)
|
451
|
+
var docW = ""
|
452
|
+
|
453
|
+
var fullLink = "href=\""+this.link+"\" target=\""+this.target+"\" onClick=\"clickOnLink('"+this.getID()+"\', '"+this.link+"','"+this.target+"');return false;\"";
|
454
|
+
this.isRendered = 1
|
455
|
+
|
456
|
+
if (this.level>0)
|
457
|
+
if (this.isLastNode) //the last 'brother' in the children array
|
458
|
+
{
|
459
|
+
leftSide = leftSide + "<td valign=top><img src='" + ICONPATH + "ftv2lastnode.gif' width=16 height=22></td>"
|
460
|
+
}
|
461
|
+
else
|
462
|
+
{
|
463
|
+
leftSide = leftSide + "<td valign=top background=" + ICONPATH + "ftv2vertline.gif><img src='" + ICONPATH + "ftv2node.gif' width=16 height=22></td>"
|
464
|
+
}
|
465
|
+
|
466
|
+
docW = docW + this.blockStartHTML("item")
|
467
|
+
|
468
|
+
docW = docW + "<tr>" + leftSide + "<td valign=top>"
|
469
|
+
if (USEICONS)
|
470
|
+
docW = docW + "<a " + fullLink + " id=\"itemIconLink"+this.id+"\">" + "<img id='itemIcon"+this.id+"' " + "src='"+this.iconSrc+"' border=0>" + "</a>"
|
471
|
+
else
|
472
|
+
if (this.prependHTML == "")
|
473
|
+
docW = docW + "<img src=" + ICONPATH + "ftv2blank.gif height=2 width=3>"
|
474
|
+
|
475
|
+
if (WRAPTEXT)
|
476
|
+
docW = docW + "</td>"+this.prependHTML+"<td valign=middle width=100%>"
|
477
|
+
else
|
478
|
+
docW = docW + "</td>"+this.prependHTML+"<td valign=middle nowrap width=100%>"
|
479
|
+
|
480
|
+
if (USETEXTLINKS)
|
481
|
+
docW = docW + "<a " + fullLink + " id=\"itemTextLink"+this.id+"\">" + this.desc + "</a>"
|
482
|
+
else
|
483
|
+
docW = docW + this.desc
|
484
|
+
|
485
|
+
docW = docW + "</td>"
|
486
|
+
|
487
|
+
docW = docW + this.blockEndHTML()
|
488
|
+
|
489
|
+
if (insertAtObj == null)
|
490
|
+
{
|
491
|
+
doc.write(docW)
|
492
|
+
}
|
493
|
+
else
|
494
|
+
{
|
495
|
+
insertAtObj.insertAdjacentHTML("afterEnd", docW)
|
496
|
+
}
|
497
|
+
|
498
|
+
if (browserVersion == 2) {
|
499
|
+
this.navObj = doc.layers["item"+this.id]
|
500
|
+
if (USEICONS)
|
501
|
+
this.iconImg = this.navObj.document.images["itemIcon"+this.id]
|
502
|
+
doc.yPos=doc.yPos+this.navObj.clip.height
|
503
|
+
} else if (browserVersion != 0) {
|
504
|
+
this.navObj = getElById("item"+this.id)
|
505
|
+
if (USEICONS)
|
506
|
+
this.iconImg = getElById("itemIcon"+this.id)
|
507
|
+
}
|
508
|
+
}
|
509
|
+
|
510
|
+
|
511
|
+
// Methods common to both objects (pseudo-inheritance)
|
512
|
+
// ********************************************************
|
513
|
+
|
514
|
+
function forceOpeningOfAncestorFolders() {
|
515
|
+
if (this.parentObj == null || this.parentObj.isOpen)
|
516
|
+
return
|
517
|
+
else {
|
518
|
+
this.parentObj.forceOpeningOfAncestorFolders()
|
519
|
+
clickOnNodeObj(this.parentObj)
|
520
|
+
}
|
521
|
+
}
|
522
|
+
|
523
|
+
function escondeBlock()
|
524
|
+
{
|
525
|
+
if (browserVersion == 1 || browserVersion == 3) {
|
526
|
+
if (this.navObj.style.display == "none")
|
527
|
+
return
|
528
|
+
this.navObj.style.display = "none"
|
529
|
+
} else {
|
530
|
+
if (this.navObj.visibility == "hidden")
|
531
|
+
return
|
532
|
+
this.navObj.visibility = "hidden"
|
533
|
+
}
|
534
|
+
}
|
535
|
+
|
536
|
+
function folderMstr(domObj)
|
537
|
+
{
|
538
|
+
if (browserVersion == 1 || browserVersion == 3) {
|
539
|
+
if (t==-1)
|
540
|
+
return
|
541
|
+
var str = new String(doc.links[t])
|
542
|
+
if (str.slice(14,16) != "em")
|
543
|
+
return
|
544
|
+
}
|
545
|
+
|
546
|
+
if (!this.isRendered)
|
547
|
+
this.renderOb(domObj)
|
548
|
+
else
|
549
|
+
if (browserVersion == 1 || browserVersion == 3)
|
550
|
+
this.navObj.style.display = "block"
|
551
|
+
else
|
552
|
+
this.navObj.visibility = "show"
|
553
|
+
}
|
554
|
+
|
555
|
+
function blockStartHTML(idprefix) {
|
556
|
+
var idParam = "id='" + idprefix + this.id + "'"
|
557
|
+
var docW = ""
|
558
|
+
|
559
|
+
if (browserVersion == 2)
|
560
|
+
docW = "<layer "+ idParam + " top=" + doc.yPos + " visibility=show>"
|
561
|
+
else if (browserVersion != 0)
|
562
|
+
docW = "<div " + idParam + " style='display:block;'>"
|
563
|
+
|
564
|
+
docW = docW + "<table border=0 cellspacing=0 cellpadding=0 width=100% >"
|
565
|
+
|
566
|
+
return docW
|
567
|
+
}
|
568
|
+
|
569
|
+
function blockEndHTML() {
|
570
|
+
var docW = ""
|
571
|
+
|
572
|
+
docW = "</table>"
|
573
|
+
|
574
|
+
if (browserVersion == 2)
|
575
|
+
docW = docW + "</layer>"
|
576
|
+
else if (browserVersion != 0)
|
577
|
+
docW = docW + "</div>"
|
578
|
+
|
579
|
+
return docW
|
580
|
+
}
|
581
|
+
|
582
|
+
function createEntryIndex()
|
583
|
+
{
|
584
|
+
this.id = nEntries
|
585
|
+
indexOfEntries[nEntries] = this
|
586
|
+
nEntries++
|
587
|
+
}
|
588
|
+
|
589
|
+
// total height of subEntries open
|
590
|
+
function totalHeight() //used with browserVersion == 2
|
591
|
+
{
|
592
|
+
var h = this.navObj.clip.height
|
593
|
+
var i = 0
|
594
|
+
|
595
|
+
if (this.isOpen) //is a folder and _is_ open
|
596
|
+
for (i=0 ; i < this.nChildren; i++)
|
597
|
+
h = h + this.children[i].totalHeight()
|
598
|
+
|
599
|
+
return h
|
600
|
+
}
|
601
|
+
|
602
|
+
|
603
|
+
function leftSideHTML(leftSideCoded) {
|
604
|
+
var i;
|
605
|
+
var retStr = "";
|
606
|
+
|
607
|
+
for (i=0; i<leftSideCoded.length; i++)
|
608
|
+
{
|
609
|
+
if (leftSideCoded.charAt(i) == "1")
|
610
|
+
{
|
611
|
+
retStr = retStr + "<td valign=top background=" + ICONPATH + "ftv2vertline.gif><img src='" + ICONPATH + "ftv2vertline.gif' width=16 height=22></td>"
|
612
|
+
}
|
613
|
+
if (leftSideCoded.charAt(i) == "0")
|
614
|
+
{
|
615
|
+
retStr = retStr + "<td valign=top><img src='" + ICONPATH + "ftv2blank.gif' width=16 height=22></td>"
|
616
|
+
}
|
617
|
+
}
|
618
|
+
return retStr
|
619
|
+
}
|
620
|
+
|
621
|
+
function getID()
|
622
|
+
{
|
623
|
+
//define a .xID in all nodes (folders and items) if you want to PERVESTATE that
|
624
|
+
//work when the tree changes. The value eXternal value must be unique for each
|
625
|
+
//node and must node change when other nodes are added or removed
|
626
|
+
//The value may be numeric or string, but cannot have the same char used in cookieCutter
|
627
|
+
if (typeof this.xID != "undefined")
|
628
|
+
return this.xID
|
629
|
+
else
|
630
|
+
return this.id
|
631
|
+
}
|
632
|
+
|
633
|
+
|
634
|
+
// Events
|
635
|
+
// *********************************************************
|
636
|
+
|
637
|
+
function clickOnFolder(folderId)
|
638
|
+
{
|
639
|
+
var clicked = findObj(folderId)
|
640
|
+
|
641
|
+
if (typeof clicked=='undefined' || clicked==null)
|
642
|
+
{
|
643
|
+
alert("Treeview was not able to find the node object corresponding to ID=" + folderId + ". If the configuration file sets a.xID values, it must set them for ALL nodes, including the foldersTree root.")
|
644
|
+
return;
|
645
|
+
}
|
646
|
+
|
647
|
+
if (!clicked.isOpen) {
|
648
|
+
clickOnNodeObj(clicked)
|
649
|
+
}
|
650
|
+
|
651
|
+
if (lastOpenedFolder != null && lastOpenedFolder != folderId)
|
652
|
+
clickOnNode(lastOpenedFolder); //sets lastOpenedFolder to null
|
653
|
+
|
654
|
+
if (clicked.nChildren==0) {
|
655
|
+
lastOpenedFolder = folderId;
|
656
|
+
clicked.isLastOpenedfolder = true
|
657
|
+
}
|
658
|
+
|
659
|
+
if (isLinked(clicked.hreference)) {
|
660
|
+
highlightObjLink(clicked);
|
661
|
+
}
|
662
|
+
}
|
663
|
+
|
664
|
+
function clickOnNode(folderId)
|
665
|
+
{
|
666
|
+
fOb = findObj(folderId);
|
667
|
+
if (typeof fOb=='undefined' || fOb==null)
|
668
|
+
{
|
669
|
+
alert("Treeview was not able to find the node object corresponding to ID=" + folderId + ". If the configuration file sets a.xID, it must set foldersTree.xID as well.")
|
670
|
+
return;
|
671
|
+
}
|
672
|
+
|
673
|
+
clickOnNodeObj(fOb);
|
674
|
+
}
|
675
|
+
|
676
|
+
function clickOnNodeObj(folderObj)
|
677
|
+
{
|
678
|
+
var state = 0
|
679
|
+
var currentOpen
|
680
|
+
|
681
|
+
state = folderObj.isOpen
|
682
|
+
folderObj.setState(!state) //open<->close
|
683
|
+
|
684
|
+
if (folderObj.id!=foldersTree.id && PRESERVESTATE)
|
685
|
+
{
|
686
|
+
currentOpen = GetCookie("clickedFolder")
|
687
|
+
if (currentOpen == null)
|
688
|
+
currentOpen = ""
|
689
|
+
|
690
|
+
if (!folderObj.isOpen) //closing
|
691
|
+
{
|
692
|
+
currentOpen = currentOpen.replace(folderObj.getID()+cookieCutter, "")
|
693
|
+
SetCookie("clickedFolder", currentOpen)
|
694
|
+
}
|
695
|
+
else
|
696
|
+
SetCookie("clickedFolder", currentOpen+folderObj.getID()+cookieCutter)
|
697
|
+
}
|
698
|
+
}
|
699
|
+
|
700
|
+
function clickOnLink(clickedId, target, windowName) {
|
701
|
+
highlightObjLink(findObj(clickedId));
|
702
|
+
if (isLinked(target)) {
|
703
|
+
window.open(target,windowName);
|
704
|
+
}
|
705
|
+
}
|
706
|
+
|
707
|
+
function ld ()
|
708
|
+
{
|
709
|
+
return document.links.length-1
|
710
|
+
}
|
711
|
+
|
712
|
+
|
713
|
+
// Auxiliary Functions
|
714
|
+
// *******************
|
715
|
+
|
716
|
+
function finalizeCreationOfChildDocs(folderObj) {
|
717
|
+
for(i=0; i < folderObj.nChildren; i++) {
|
718
|
+
child = folderObj.children[i]
|
719
|
+
if (typeof child[0] != 'undefined')
|
720
|
+
{
|
721
|
+
// Amazingly, arrays can have members, so a = ["a", "b"]; a.desc="asdas" works
|
722
|
+
// If a doc was inserted as an array, we can transform it into an itemObj by adding
|
723
|
+
// the missing members and functions
|
724
|
+
child.desc = child[0]
|
725
|
+
setItemLink(child, GLOBALTARGET, child[1])
|
726
|
+
finalizeCreationOfItem(child)
|
727
|
+
}
|
728
|
+
}
|
729
|
+
}
|
730
|
+
|
731
|
+
function findObj(id)
|
732
|
+
{
|
733
|
+
var i=0;
|
734
|
+
var nodeObj;
|
735
|
+
|
736
|
+
if (typeof foldersTree.xID != "undefined") {
|
737
|
+
nodeObj = indexOfEntries[i];
|
738
|
+
for(i=0;i<nEntries&&indexOfEntries[i].xID!=id;i++) //may need optimization
|
739
|
+
;
|
740
|
+
id = i
|
741
|
+
}
|
742
|
+
if (id >= nEntries)
|
743
|
+
return null; //example: node removed in DB
|
744
|
+
else
|
745
|
+
return indexOfEntries[id];
|
746
|
+
}
|
747
|
+
|
748
|
+
function isLinked(hrefText) {
|
749
|
+
var result = true;
|
750
|
+
result = (result && hrefText !=null);
|
751
|
+
result = (result && hrefText != '');
|
752
|
+
result = (result && hrefText.indexOf('undefined') < 0);
|
753
|
+
result = (result && hrefText.indexOf('parent.op') < 0);
|
754
|
+
return result;
|
755
|
+
}
|
756
|
+
|
757
|
+
// Do highlighting by changing background and foreg. colors of folder or doc text
|
758
|
+
function highlightObjLink(nodeObj) {
|
759
|
+
if (!HIGHLIGHT || nodeObj==null || nodeObj.maySelect==false) {//node deleted in DB
|
760
|
+
return;
|
761
|
+
}
|
762
|
+
|
763
|
+
if (browserVersion == 1 || browserVersion == 3) {
|
764
|
+
var clickedDOMObj = getElById('itemTextLink'+nodeObj.id);
|
765
|
+
if (clickedDOMObj != null) {
|
766
|
+
if (lastClicked != null) {
|
767
|
+
var prevClickedDOMObj = getElById('itemTextLink'+lastClicked.id);
|
768
|
+
prevClickedDOMObj.style.color=lastClickedColor;
|
769
|
+
prevClickedDOMObj.style.backgroundColor=lastClickedBgColor;
|
770
|
+
}
|
771
|
+
|
772
|
+
lastClickedColor = clickedDOMObj.style.color;
|
773
|
+
lastClickedBgColor = clickedDOMObj.style.backgroundColor;
|
774
|
+
clickedDOMObj.style.color=HIGHLIGHT_COLOR;
|
775
|
+
clickedDOMObj.style.backgroundColor=HIGHLIGHT_BG;
|
776
|
+
}
|
777
|
+
}
|
778
|
+
lastClicked = nodeObj;
|
779
|
+
if (PRESERVESTATE)
|
780
|
+
SetCookie('highlightedTreeviewLink', nodeObj.getID());
|
781
|
+
}
|
782
|
+
|
783
|
+
function insFld(parentFolder, childFolder)
|
784
|
+
{
|
785
|
+
return parentFolder.addChild(childFolder)
|
786
|
+
}
|
787
|
+
|
788
|
+
function insDoc(parentFolder, document)
|
789
|
+
{
|
790
|
+
return parentFolder.addChild(document)
|
791
|
+
}
|
792
|
+
|
793
|
+
function gFld(description, hreference)
|
794
|
+
{
|
795
|
+
folder = new Folder(description, hreference);
|
796
|
+
return folder;
|
797
|
+
}
|
798
|
+
|
799
|
+
function gLnk(optionFlags, description, linkData)
|
800
|
+
{
|
801
|
+
if (optionFlags>=0) { //is numeric (old style) or empty (error)
|
802
|
+
//Target changed from numeric to string in Aug 2002, and support for numeric style was entirely dropped in Mar 2004
|
803
|
+
alert("Change your Treeview configuration file to use the new style of target argument in gLnk");
|
804
|
+
return;
|
805
|
+
}
|
806
|
+
|
807
|
+
newItem = new Item(description);
|
808
|
+
setItemLink(newItem, optionFlags, linkData);
|
809
|
+
return newItem;
|
810
|
+
}
|
811
|
+
|
812
|
+
function setItemLink(item, optionFlags, linkData) {
|
813
|
+
var targetFlag = "";
|
814
|
+
var target = "";
|
815
|
+
var protocolFlag = "";
|
816
|
+
var protocol = "";
|
817
|
+
|
818
|
+
targetFlag = optionFlags.charAt(0)
|
819
|
+
if (targetFlag=="B")
|
820
|
+
target = "_blank"
|
821
|
+
if (targetFlag=="P")
|
822
|
+
target = "_parent"
|
823
|
+
if (targetFlag=="R")
|
824
|
+
target = "basefrm"
|
825
|
+
if (targetFlag=="S")
|
826
|
+
target = "_self"
|
827
|
+
if (targetFlag=="T")
|
828
|
+
target = "_top"
|
829
|
+
|
830
|
+
if (optionFlags.length > 1) {
|
831
|
+
protocolFlag = optionFlags.charAt(1)
|
832
|
+
if (protocolFlag=="h")
|
833
|
+
protocol = "http://"
|
834
|
+
if (protocolFlag=="s")
|
835
|
+
protocol = "https://"
|
836
|
+
if (protocolFlag=="f")
|
837
|
+
protocol = "ftp://"
|
838
|
+
if (protocolFlag=="m")
|
839
|
+
protocol = "mailto:"
|
840
|
+
}
|
841
|
+
|
842
|
+
item.link = protocol+linkData;
|
843
|
+
item.target = target
|
844
|
+
}
|
845
|
+
|
846
|
+
//Function created for backwards compatibility purposes
|
847
|
+
//Function contents voided in March 2004
|
848
|
+
function oldGLnk(target, description, linkData)
|
849
|
+
{
|
850
|
+
}
|
851
|
+
|
852
|
+
function preLoadIcons() {
|
853
|
+
arImageSrc = new Array (
|
854
|
+
"ftv2vertline.gif",
|
855
|
+
"ftv2mlastnode.gif",
|
856
|
+
"ftv2mnode.gif",
|
857
|
+
"ftv2plastnode.gif",
|
858
|
+
"ftv2pnode.gif",
|
859
|
+
"ftv2blank.gif",
|
860
|
+
"ftv2lastnode.gif",
|
861
|
+
"ftv2node.gif",
|
862
|
+
"ftv2folderclosed.gif",
|
863
|
+
"ftv2folderopen.gif",
|
864
|
+
"ftv2doc.gif"
|
865
|
+
)
|
866
|
+
arImageList = new Array ();
|
867
|
+
for (counter in arImageSrc) {
|
868
|
+
arImageList[counter] = new Image();
|
869
|
+
arImageList[counter].src = ICONPATH + arImageSrc[counter];
|
870
|
+
}
|
871
|
+
}
|
872
|
+
|
873
|
+
//Open some folders for initial layout, if necessary
|
874
|
+
function setInitialLayout() {
|
875
|
+
if (browserVersion > 0 && !STARTALLOPEN)
|
876
|
+
clickOnNodeObj(foldersTree);
|
877
|
+
|
878
|
+
if (!STARTALLOPEN && (browserVersion > 0) && PRESERVESTATE)
|
879
|
+
PersistentFolderOpening();
|
880
|
+
}
|
881
|
+
|
882
|
+
//Used with NS4 and STARTALLOPEN
|
883
|
+
function renderAllTree(nodeObj, parent) {
|
884
|
+
var i=0;
|
885
|
+
nodeObj.renderOb(parent)
|
886
|
+
if (supportsDeferral)
|
887
|
+
for (i=nodeObj.nChildren-1; i>=0; i--)
|
888
|
+
renderAllTree(nodeObj.children[i], nodeObj.navObj)
|
889
|
+
else
|
890
|
+
for (i=0 ; i < nodeObj.nChildren; i++)
|
891
|
+
renderAllTree(nodeObj.children[i], null)
|
892
|
+
}
|
893
|
+
|
894
|
+
function hideWholeTree(nodeObj, hideThisOne, nodeObjMove) {
|
895
|
+
var i=0;
|
896
|
+
var heightContained=0;
|
897
|
+
var childrenMove=nodeObjMove;
|
898
|
+
|
899
|
+
if (hideThisOne)
|
900
|
+
nodeObj.escondeBlock()
|
901
|
+
|
902
|
+
if (browserVersion == 2)
|
903
|
+
nodeObj.navObj.moveBy(0, 0-nodeObjMove)
|
904
|
+
|
905
|
+
for (i=0 ; i < nodeObj.nChildren; i++) {
|
906
|
+
heightContainedInChild = hideWholeTree(nodeObj.children[i], true, childrenMove)
|
907
|
+
if (browserVersion == 2) {
|
908
|
+
heightContained = heightContained + heightContainedInChild + nodeObj.children[i].navObj.clip.height
|
909
|
+
childrenMove = childrenMove + heightContainedInChild
|
910
|
+
}
|
911
|
+
}
|
912
|
+
|
913
|
+
return heightContained;
|
914
|
+
}
|
915
|
+
|
916
|
+
|
917
|
+
// Simulating inserAdjacentHTML on NS6
|
918
|
+
// Code by thor@jscript.dk
|
919
|
+
// ******************************************
|
920
|
+
|
921
|
+
if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){
|
922
|
+
HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode)
|
923
|
+
{
|
924
|
+
switch (where){
|
925
|
+
case 'beforeBegin':
|
926
|
+
this.parentNode.insertBefore(parsedNode,this)
|
927
|
+
break;
|
928
|
+
case 'afterBegin':
|
929
|
+
this.insertBefore(parsedNode,this.firstChild);
|
930
|
+
break;
|
931
|
+
case 'beforeEnd':
|
932
|
+
this.appendChild(parsedNode);
|
933
|
+
break;
|
934
|
+
case 'afterEnd':
|
935
|
+
if (this.nextSibling)
|
936
|
+
this.parentNode.insertBefore(parsedNode,this.nextSibling);
|
937
|
+
else this.parentNode.appendChild(parsedNode);
|
938
|
+
break;
|
939
|
+
}
|
940
|
+
}
|
941
|
+
|
942
|
+
HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr)
|
943
|
+
{
|
944
|
+
var r = this.ownerDocument.createRange();
|
945
|
+
r.setStartBefore(this);
|
946
|
+
var parsedHTML = r.createContextualFragment(htmlStr);
|
947
|
+
this.insertAdjacentElement(where,parsedHTML)
|
948
|
+
}
|
949
|
+
}
|
950
|
+
|
951
|
+
function getElById(idVal) {
|
952
|
+
if (document.getElementById != null)
|
953
|
+
return document.getElementById(idVal)
|
954
|
+
if (document.all != null)
|
955
|
+
return document.all[idVal]
|
956
|
+
|
957
|
+
alert("Problem getting element by id")
|
958
|
+
return null
|
959
|
+
}
|
960
|
+
|
961
|
+
|
962
|
+
// Functions for cookies
|
963
|
+
// Note: THESE FUNCTIONS ARE OPTIONAL. No cookies are used unless
|
964
|
+
// the PRESERVESTATE variable is set to 1 (default 0)
|
965
|
+
// The separator currently in use is ^ (chr 94)
|
966
|
+
// ***********************************************************
|
967
|
+
|
968
|
+
function PersistentFolderOpening()
|
969
|
+
{
|
970
|
+
var stateInCookie;
|
971
|
+
var fldStr=""
|
972
|
+
var fldArr
|
973
|
+
var fldPos=0
|
974
|
+
var id
|
975
|
+
var nodeObj
|
976
|
+
stateInCookie = GetCookie("clickedFolder");
|
977
|
+
SetCookie('clickedFolder', "") //at the end of function it will be back, minus null cases
|
978
|
+
|
979
|
+
if(stateInCookie!=null)
|
980
|
+
{
|
981
|
+
fldArr = stateInCookie.split(cookieCutter)
|
982
|
+
for (fldPos=0; fldPos<fldArr.length; fldPos++)
|
983
|
+
{
|
984
|
+
fldStr=fldArr[fldPos]
|
985
|
+
if (fldStr != "") {
|
986
|
+
nodeObj = findObj(fldStr)
|
987
|
+
if (nodeObj!=null) //may have been deleted
|
988
|
+
if (nodeObj.setState) {
|
989
|
+
nodeObj.forceOpeningOfAncestorFolders()
|
990
|
+
clickOnNodeObj(nodeObj);
|
991
|
+
}
|
992
|
+
else
|
993
|
+
alert("Internal id is not pointing to a folder anymore.\nConsider giving an ID to the tree and external IDs to the individual nodes.")
|
994
|
+
}
|
995
|
+
}
|
996
|
+
}
|
997
|
+
}
|
998
|
+
|
999
|
+
function storeAllNodesInClickCookie(treeNodeObj)
|
1000
|
+
{
|
1001
|
+
var currentOpen
|
1002
|
+
var i = 0
|
1003
|
+
|
1004
|
+
if (typeof treeNodeObj.setState != "undefined") //is folder
|
1005
|
+
{
|
1006
|
+
currentOpen = GetCookie("clickedFolder")
|
1007
|
+
if (currentOpen == null)
|
1008
|
+
currentOpen = ""
|
1009
|
+
|
1010
|
+
if (treeNodeObj.getID() != foldersTree.getID())
|
1011
|
+
SetCookie("clickedFolder", currentOpen+treeNodeObj.getID()+cookieCutter)
|
1012
|
+
|
1013
|
+
for (i=0; i < treeNodeObj.nChildren; i++)
|
1014
|
+
storeAllNodesInClickCookie(treeNodeObj.children[i])
|
1015
|
+
}
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
function CookieBranding(name) {
|
1019
|
+
if (typeof foldersTree.treeID != "undefined")
|
1020
|
+
return name+foldersTree.treeID //needed for multi-tree sites. make sure treeId does not contain cookieCutter
|
1021
|
+
else
|
1022
|
+
return name
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
function GetCookie(name)
|
1026
|
+
{
|
1027
|
+
name = CookieBranding(name)
|
1028
|
+
|
1029
|
+
var arg = name + "=";
|
1030
|
+
var alen = arg.length;
|
1031
|
+
var clen = document.cookie.length;
|
1032
|
+
var i = 0;
|
1033
|
+
|
1034
|
+
while (i < clen) {
|
1035
|
+
var j = i + alen;
|
1036
|
+
if (document.cookie.substring(i, j) == arg)
|
1037
|
+
return getCookieVal (j);
|
1038
|
+
i = document.cookie.indexOf(" ", i) + 1;
|
1039
|
+
if (i == 0) break;
|
1040
|
+
}
|
1041
|
+
return null;
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
function getCookieVal(offset) {
|
1045
|
+
var endstr = document.cookie.indexOf (";", offset);
|
1046
|
+
if (endstr == -1)
|
1047
|
+
endstr = document.cookie.length;
|
1048
|
+
return unescape(document.cookie.substring(offset, endstr));
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
function SetCookie(name, value)
|
1052
|
+
{
|
1053
|
+
var argv = SetCookie.arguments;
|
1054
|
+
var argc = SetCookie.arguments.length;
|
1055
|
+
var expires = (argc > 2) ? argv[2] : null;
|
1056
|
+
//var path = (argc > 3) ? argv[3] : null;
|
1057
|
+
var domain = (argc > 4) ? argv[4] : null;
|
1058
|
+
var secure = (argc > 5) ? argv[5] : false;
|
1059
|
+
var path = "/"; //allows the tree to remain open across pages with diff names & paths
|
1060
|
+
|
1061
|
+
name = CookieBranding(name)
|
1062
|
+
|
1063
|
+
document.cookie = name + "=" + escape (value) +
|
1064
|
+
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
|
1065
|
+
((path == null) ? "" : ("; path=" + path)) +
|
1066
|
+
((domain == null) ? "" : ("; domain=" + domain)) +
|
1067
|
+
((secure == true) ? "; secure" : "");
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
function ExpireCookie (name)
|
1071
|
+
{
|
1072
|
+
var exp = new Date();
|
1073
|
+
exp.setTime (exp.getTime() - 1);
|
1074
|
+
var cval = GetCookie (name);
|
1075
|
+
name = CookieBranding(name)
|
1076
|
+
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
|
1077
|
+
}
|
1078
|
+
|
1079
|
+
|
1080
|
+
//To customize the tree, overwrite these variables in the configuration file (demoFramesetNode.js, etc.)
|
1081
|
+
var USETEXTLINKS = 0;
|
1082
|
+
var STARTALLOPEN = 0;
|
1083
|
+
var USEFRAMES = 0;
|
1084
|
+
var USEICONS = 1;
|
1085
|
+
var WRAPTEXT = 0;
|
1086
|
+
var PERSERVESTATE = 0; //backward compatibility
|
1087
|
+
var PRESERVESTATE = 0;
|
1088
|
+
var ICONPATH = '/assets/platform/treeview/';
|
1089
|
+
var HIGHLIGHT = 0;
|
1090
|
+
var HIGHLIGHT_COLOR = 'white';
|
1091
|
+
var HIGHLIGHT_BG = 'blue';
|
1092
|
+
var BUILDALL = 0;
|
1093
|
+
var GLOBALTARGET = "R"; // variable only applicable for addChildren uses
|
1094
|
+
|
1095
|
+
var DISPLAYROOT = 1;
|
1096
|
+
|
1097
|
+
|
1098
|
+
//Other variables
|
1099
|
+
var lastClicked = null;
|
1100
|
+
var lastClickedColor;
|
1101
|
+
var lastClickedBgColor;
|
1102
|
+
var indexOfEntries = new Array
|
1103
|
+
var nEntries = 0
|
1104
|
+
var browserVersion = 0
|
1105
|
+
var selectedFolder=0
|
1106
|
+
var lastOpenedFolder=null
|
1107
|
+
var t=5
|
1108
|
+
var doc = document
|
1109
|
+
var supportsDeferral = false
|
1110
|
+
var cookieCutter = '^' //You can change this if you need to use ^ in your xID or treeID values
|
1111
|
+
|
1112
|
+
doc.yPos = 0
|
1113
|
+
|
1114
|
+
// Main function
|
1115
|
+
// *************
|
1116
|
+
|
1117
|
+
// This function uses an object (navigator) defined in
|
1118
|
+
// ua.js, imported in the main html page (left frame).
|
1119
|
+
function initializeDocument()
|
1120
|
+
{
|
1121
|
+
preLoadIcons();
|
1122
|
+
switch(navigator.family)
|
1123
|
+
{
|
1124
|
+
case 'ie4':
|
1125
|
+
browserVersion = 1 //Simply means IE > 3.x
|
1126
|
+
break;
|
1127
|
+
case 'opera':
|
1128
|
+
browserVersion = (navigator.version > 6 ? 1 : 0); //opera7 has a good DOM
|
1129
|
+
break;
|
1130
|
+
case 'nn4':
|
1131
|
+
browserVersion = 2 //NS4.x
|
1132
|
+
break;
|
1133
|
+
case 'gecko':
|
1134
|
+
browserVersion = 3 //NS6.x
|
1135
|
+
break;
|
1136
|
+
case 'safari':
|
1137
|
+
browserVersion = 1 //Safari Beta 3 seems to behave like IE in spite of being based on Konkeror
|
1138
|
+
break;
|
1139
|
+
default:
|
1140
|
+
browserVersion = 0 //other, possibly without DHTML
|
1141
|
+
break;
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
// backward compatibility
|
1145
|
+
if (PERSERVESTATE)
|
1146
|
+
PRESERVESTATE = 1;
|
1147
|
+
|
1148
|
+
supportsDeferral = ((navigator.family=='ie4' && navigator.version >= 5 && navigator.OS != "mac") || browserVersion == 3);
|
1149
|
+
supportsDeferral = supportsDeferral & (!BUILDALL)
|
1150
|
+
if (!USEFRAMES && browserVersion == 2)
|
1151
|
+
browserVersion = 0;
|
1152
|
+
eval(String.fromCharCode(116,61,108,100,40,41))
|
1153
|
+
|
1154
|
+
//If PRESERVESTATE is on, STARTALLOPEN can only be effective the first time the page
|
1155
|
+
//loads during the session. For subsequent (re)loads the PRESERVESTATE data stored
|
1156
|
+
//in cookies takes over the control of the initial expand/collapse
|
1157
|
+
if (PRESERVESTATE && GetCookie("clickedFolder") != null)
|
1158
|
+
STARTALLOPEN = 0
|
1159
|
+
|
1160
|
+
//foldersTree (with the site's data) is created in an external .js (demoFramesetNode.js, for example)
|
1161
|
+
foldersTree.initialize(0, true, "")
|
1162
|
+
if (supportsDeferral && !STARTALLOPEN) {
|
1163
|
+
foldersTree.renderOb(null) //delay construction of nodes
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
else {
|
1167
|
+
renderAllTree(foldersTree, null);
|
1168
|
+
|
1169
|
+
if (PRESERVESTATE && STARTALLOPEN)
|
1170
|
+
storeAllNodesInClickCookie(foldersTree)
|
1171
|
+
|
1172
|
+
//To force the scrollable area to be big enough
|
1173
|
+
if (browserVersion == 2)
|
1174
|
+
doc.write("<layer top=" + indexOfEntries[nEntries-1].navObj.top + "> </layer>")
|
1175
|
+
|
1176
|
+
if (browserVersion != 0 && !STARTALLOPEN)
|
1177
|
+
hideWholeTree(foldersTree, false, 0)
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
setInitialLayout()
|
1181
|
+
|
1182
|
+
if (PRESERVESTATE && GetCookie('highlightedTreeviewLink')!=null && GetCookie('highlightedTreeviewLink')!="") {
|
1183
|
+
var nodeObj = findObj(GetCookie('highlightedTreeviewLink'))
|
1184
|
+
if (nodeObj!=null){
|
1185
|
+
nodeObj.forceOpeningOfAncestorFolders()
|
1186
|
+
highlightObjLink(nodeObj);
|
1187
|
+
}
|
1188
|
+
else
|
1189
|
+
SetCookie('highlightedTreeviewLink', '')
|
1190
|
+
}
|
1191
|
+
}
|
1192
|
+
|
1193
|
+
function findAndHighlight(id) {
|
1194
|
+
node = findObj(id);
|
1195
|
+
highlightObjLink(node);
|
1196
|
+
}
|
1197
|
+
|