backlog 0.37.2 → 0.41.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/History.txt +128 -0
- data/README.txt +4 -2
- data/bin/backlog +1 -1
- data/lib/array_helper.rb +4 -4
- data/{vendor/plugins → lib}/backlog_jira/README +0 -0
- data/{vendor/plugins → lib}/backlog_jira/Rakefile +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/backlog_jira/backlog_jira_generator.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/backlog_jira/templates/migration.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/history_model/history_model_generator.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/history_model/templates/fixtures.yml +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/history_model/templates/functional_test.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/history_model/templates/model.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/generators/history_model/templates/unit_test.rb +0 -0
- data/lib/backlog_jira/init.rb +66 -0
- data/{vendor/plugins → lib}/backlog_jira/install.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/lib/backlog_jira.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/lib/tasks/backlog_jira_tasks.rake +0 -0
- data/{vendor/plugins → lib}/backlog_jira/test/backlog_jira_test.rb +0 -0
- data/{vendor/plugins → lib}/backlog_jira/uninstall.rb +0 -0
- data/lib/big_decimal_yaml_fix.rb +16 -25
- data/lib/tasks/backup.rake +18 -18
- data/lib/time_extras.rb +6 -6
- data/lib/user_system.rb +41 -38
- data/lib/version_from_history.rb +2 -2
- metadata +196 -749
- data/Capfile +0 -2
- data/Gemfile +0 -34
- data/Gemfile.lock +0 -139
- data/MODIFICATIONS.txt +0 -13
- data/Manifest.txt +0 -0
- data/README_LOGIN_SUGAR +0 -194
- data/Rakefile +0 -73
- data/Rakefile~ +0 -73
- data/Screenshot.png +0 -0
- data/app/controllers/absences_controller.rb +0 -67
- data/app/controllers/application_controller.rb +0 -185
- data/app/controllers/application_controller.rb.rails2 +0 -186
- data/app/controllers/customers_controller.rb +0 -51
- data/app/controllers/dashboard_controller.rb +0 -17
- data/app/controllers/estimates_controller.rb +0 -49
- data/app/controllers/groups_controller.rb +0 -65
- data/app/controllers/parties_controller.rb +0 -33
- data/app/controllers/periods_controller.rb +0 -242
- data/app/controllers/projects_controller.rb +0 -185
- data/app/controllers/public_holidays_controller.rb +0 -70
- data/app/controllers/search_controller.rb +0 -15
- data/app/controllers/task_files_controller.rb +0 -19
- data/app/controllers/tasks_controller.rb +0 -305
- data/app/controllers/user_controller.rb +0 -251
- data/app/controllers/welcome_controller.rb +0 -29
- data/app/controllers/work_locks_controller.rb +0 -88
- data/app/controllers/works_controller.rb +0 -383
- data/app/helpers/absences_helper.rb +0 -2
- data/app/helpers/application_helper.rb +0 -119
- data/app/helpers/application_helper.rb.rails2 +0 -118
- data/app/helpers/customers_helper.rb +0 -2
- data/app/helpers/dashboard_helper.rb +0 -2
- data/app/helpers/estimates_helper.rb +0 -2
- data/app/helpers/groups_helper.rb +0 -2
- data/app/helpers/parties_helper.rb +0 -2
- data/app/helpers/periods_helper.rb +0 -57
- data/app/helpers/projects_helper.rb +0 -74
- data/app/helpers/public_holidays_helper.rb +0 -2
- data/app/helpers/search_helper.rb +0 -2
- data/app/helpers/task_files_helper.rb +0 -2
- data/app/helpers/tasks_helper.rb +0 -2
- data/app/helpers/user_helper.rb +0 -53
- data/app/helpers/welcome_helper.rb +0 -2
- data/app/helpers/work_locks_helper.rb +0 -2
- data/app/helpers/works_helper.rb +0 -5
- data/app/mailers/user_notify.rb +0 -76
- data/app/models/absence.rb +0 -27
- data/app/models/chart.rb +0 -5
- data/app/models/clock.rb +0 -14
- data/app/models/configuration.rb +0 -2
- data/app/models/customer.rb +0 -2
- data/app/models/estimate.rb +0 -17
- data/app/models/group.rb +0 -16
- data/app/models/party.rb +0 -27
- data/app/models/period.rb +0 -251
- data/app/models/project.rb +0 -49
- data/app/models/public_holiday.rb +0 -13
- data/app/models/report_filter.rb +0 -29
- data/app/models/search_result.rb +0 -8
- data/app/models/sidebar.rb +0 -41
- data/app/models/task.rb +0 -425
- data/app/models/task_file.rb +0 -7
- data/app/models/task_notify.rb +0 -27
- data/app/models/user.rb +0 -146
- data/app/models/work.rb +0 -191
- data/app/models/work_lock.rb +0 -11
- data/app/models/work_lock_nagger.rb +0 -60
- data/app/models/work_lock_notify.rb +0 -43
- data/app/models/works_report_filter.rb +0 -27
- data/app/views/absences/_form.rhtml +0 -10
- data/app/views/absences/edit.rhtml +0 -9
- data/app/views/absences/list.rhtml +0 -25
- data/app/views/absences/new.rhtml +0 -8
- data/app/views/absences/show.rhtml +0 -8
- data/app/views/customers/_form.rhtml +0 -7
- data/app/views/customers/_name_list.rhtml +0 -5
- data/app/views/customers/edit.rhtml +0 -9
- data/app/views/customers/list.rhtml +0 -28
- data/app/views/customers/new.rhtml +0 -8
- data/app/views/customers/show.rhtml +0 -8
- data/app/views/dashboard/show.rhtml +0 -24
- data/app/views/display_notice.rjs +0 -1
- data/app/views/groups/_form.rhtml +0 -7
- data/app/views/groups/edit.rhtml +0 -57
- data/app/views/groups/list.rhtml +0 -26
- data/app/views/groups/new.rhtml +0 -7
- data/app/views/groups/set_member.rjs +0 -1
- data/app/views/layouts/_headers.rhtml +0 -24
- data/app/views/layouts/_left_top.rhtml +0 -33
- data/app/views/layouts/_notice.rhtml +0 -12
- data/app/views/layouts/_shortcuts.rhtml +0 -22
- data/app/views/layouts/_shortcuts_js.rhtml +0 -19
- data/app/views/layouts/mwrt002.html.erb +0 -44
- data/app/views/layouts/wide.rhtml +0 -23
- data/app/views/periods/_burn_down_chart.rhtml +0 -9
- data/app/views/periods/_form.rhtml +0 -74
- data/app/views/periods/_link.rhtml +0 -3
- data/app/views/periods/_show_active.rhtml +0 -61
- data/app/views/periods/_sidebar_block.rhtml +0 -11
- data/app/views/periods/_title.rhtml +0 -18
- data/app/views/periods/edit.rhtml +0 -10
- data/app/views/periods/finish_task.rjs +0 -4
- data/app/views/periods/move_task_to_period.rjs +0 -4
- data/app/views/periods/new.rhtml +0 -9
- data/app/views/periods/order.rjs +0 -0
- data/app/views/periods/reopen_task.rjs +0 -6
- data/app/views/periods/show.rhtml +0 -56
- data/app/views/projects/_buttons.rhtml +0 -4
- data/app/views/projects/_form.rhtml +0 -44
- data/app/views/projects/_name_list.rhtml +0 -5
- data/app/views/projects/edit.rhtml +0 -14
- data/app/views/projects/finish_task.rjs +0 -3
- data/app/views/projects/list.rhtml +0 -16
- data/app/views/projects/move_task_to_period.rjs +0 -3
- data/app/views/projects/new.rhtml +0 -11
- data/app/views/projects/reopen_task.rjs +0 -3
- data/app/views/projects/show.rhtml +0 -39
- data/app/views/public_holidays/_form.rhtml +0 -7
- data/app/views/public_holidays/edit.rhtml +0 -9
- data/app/views/public_holidays/list.rhtml +0 -25
- data/app/views/public_holidays/new.rhtml +0 -8
- data/app/views/public_holidays/show.rhtml +0 -8
- data/app/views/redirect.rjs +0 -1
- data/app/views/search/results.rhtml +0 -40
- data/app/views/task_notify/invite.en.html.erb +0 -13
- data/app/views/task_notify/invite.no.html.erb +0 -13
- data/app/views/tasks/_backlog_header.rhtml +0 -17
- data/app/views/tasks/_completed.rhtml +0 -18
- data/app/views/tasks/_fields_header.rhtml +0 -13
- data/app/views/tasks/_form.rhtml +0 -125
- data/app/views/tasks/_invite.rjs +0 -1
- data/app/views/tasks/_period_header.rhtml +0 -1
- data/app/views/tasks/_task.rhtml +0 -116
- data/app/views/tasks/_update.rjs +0 -2
- data/app/views/tasks/edit.rhtml +0 -81
- data/app/views/tasks/grab.rhtml +0 -9
- data/app/views/tasks/invite.rhtml +0 -9
- data/app/views/tasks/list.rhtml +0 -77
- data/app/views/tasks/list_started.rhtml +0 -62
- data/app/views/tasks/new.rhtml +0 -10
- data/app/views/tasks/notes.rhtml +0 -12
- data/app/views/tasks/start_work.rjs +0 -1
- data/app/views/tasks/update_estimate.rjs +0 -3
- data/app/views/user/_edit.rhtml +0 -31
- data/app/views/user/_password.rhtml +0 -21
- data/app/views/user/change_password.rhtml +0 -19
- data/app/views/user/delete.rhtml +0 -14
- data/app/views/user/edit.rhtml +0 -154
- data/app/views/user/forgot_password.rhtml +0 -19
- data/app/views/user/login.rhtml +0 -33
- data/app/views/user/logout.rhtml +0 -8
- data/app/views/user/set_group.rjs +0 -1
- data/app/views/user/signup.rhtml +0 -15
- data/app/views/user/toggle_work_lock_monitoring.rjs +0 -2
- data/app/views/user/welcome.rhtml +0 -8
- data/app/views/user_notify/change_password.en.html.erb +0 -10
- data/app/views/user_notify/change_password.no.html.erb +0 -10
- data/app/views/user_notify/forgot_password.en.html.erb +0 -11
- data/app/views/user_notify/forgot_password.no.html.erb +0 -11
- data/app/views/user_notify/monitoring.en.html.erb +0 -3
- data/app/views/user_notify/monitoring.no.html.erb +0 -3
- data/app/views/user_notify/monitoring_invitation.en.html.erb +0 -7
- data/app/views/user_notify/monitoring_invitation.no.html.erb +0 -7
- data/app/views/user_notify/signup.en.html.erb +0 -12
- data/app/views/user_notify/signup.no.html.erb +0 -12
- data/app/views/work_lock_notify/lock.en.html.erb +0 -7
- data/app/views/work_lock_notify/lock.no.html.erb +0 -7
- data/app/views/work_lock_notify/nag.en.html.erb +0 -6
- data/app/views/work_lock_notify/nag.no.html.erb +0 -7
- data/app/views/work_locks/_form.rhtml +0 -10
- data/app/views/work_locks/edit.rhtml +0 -9
- data/app/views/work_locks/list.rhtml +0 -25
- data/app/views/work_locks/new.rhtml +0 -8
- data/app/views/work_locks/show.rhtml +0 -8
- data/app/views/works/_buttons.rhtml +0 -2
- data/app/views/works/_description_list.rhtml +0 -5
- data/app/views/works/_form.rhtml +0 -107
- data/app/views/works/_new_row.rhtml +0 -141
- data/app/views/works/_row.rhtml +0 -115
- data/app/views/works/_row_field.rhtml +0 -17
- data/app/views/works/_task_id_list.rhtml +0 -5
- data/app/views/works/_weekly_work_sheet_buttons.rhtml +0 -22
- data/app/views/works/daily_work_sheet.rhtml +0 -108
- data/app/views/works/edit.rhtml +0 -11
- data/app/views/works/list.rhtml +0 -148
- data/app/views/works/list_excel.rhtml +0 -114
- data/app/views/works/new.rhtml +0 -12
- data/app/views/works/show.rhtml +0 -10
- data/app/views/works/timeliste.rhtml +0 -884
- data/app/views/works/update_new_row.rjs +0 -28
- data/app/views/works/update_row.rjs +0 -18
- data/app/views/works/update_time.rjs +0 -3
- data/app/views/works/weekly_work_sheet.rhtml +0 -64
- data/app/views/works/weekly_work_sheet_details.rhtml +0 -102
- data/backlog.gemspec +0 -44
- data/config.ru +0 -4
- data/config/application.rb +0 -11
- data/config/boot.rb +0 -13
- data/config/database.yml +0 -15
- data/config/database.yml~ +0 -17
- data/config/environment.rb +0 -100
- data/config/environments/development.rb +0 -30
- data/config/environments/development.rb.rails2 +0 -26
- data/config/environments/production.rb +0 -33
- data/config/environments/test.rb +0 -24
- data/config/environments/user_environment.rb +0 -21
- data/config/initializers/backtrace_silencers.rb +0 -7
- data/config/initializers/inflections.rb +0 -10
- data/config/initializers/jdbc.rb +0 -7
- data/config/initializers/mime_types.rb +0 -5
- data/config/initializers/secret_token.rb +0 -7
- data/config/initializers/session_store.rb +0 -8
- data/config/locales/en.yml +0 -200
- data/config/locales/no.yml +0 -193
- data/config/mime_types.yaml +0 -1
- data/config/routes.rb +0 -5
- data/config/war.rb +0 -27
- data/config/warble.rb +0 -84
- data/cruise_build.sh +0 -14
- data/cruise_config.rb +0 -5
- data/db/migrate/001_create_tasks.rb +0 -22
- data/db/migrate/003_add_estimation_points.rb +0 -16
- data/db/migrate/004_add_period.rb +0 -63
- data/db/migrate/005_add_field_work_started_at.rb +0 -9
- data/db/migrate/006_works_data_fix.rb +0 -13
- data/db/migrate/007_add_task_created_at.rb +0 -23
- data/db/migrate/008_add_backlog_options.rb +0 -13
- data/db/migrate/009_add_subtasks.rb +0 -29
- data/db/migrate/010_add_work_start.rb +0 -9
- data/db/migrate/011_login_sugar.rb +0 -21
- data/db/migrate/012_add_resolution.rb +0 -12
- data/db/migrate/013_create_estimates.rb +0 -20
- data/db/migrate/014_add_customer_option.rb +0 -11
- data/db/migrate/015_add_user_option.rb +0 -33
- data/db/migrate/016_add_invoicable_flag.rb +0 -11
- data/db/migrate/017_increase_backlog_name_limit.rb +0 -10
- data/db/migrate/018_create_groups.rb +0 -118
- data/db/migrate/019_remove_unique_index_for_period_position.rb +0 -9
- data/db/migrate/020_create_task_files.rb +0 -17
- data/db/migrate/021_create_work_accounts.rb +0 -111
- data/db/migrate/022_remove_track_done_flag.rb +0 -9
- data/db/migrate/023_add_indices_for_burn_down_chart.rb +0 -13
- data/db/migrate/024_add_sprint_option.rb +0 -10
- data/db/migrate/025_add_simple_auditing_of_tasks.rb +0 -11
- data/db/migrate/026_add_users_to_tasks.rb +0 -14
- data/db/migrate/027_create_work_locks.rb +0 -25
- data/db/migrate/028_create_absences.rb +0 -34
- data/db/migrate/029_add_work_comments.rb +0 -9
- data/db/migrate/030_create_public_holidays.rb +0 -11
- data/db/migrate/031_expand_work_done_precision.rb +0 -9
- data/db/migrate/20100720124707_merge_work_account_into_backlog.rb +0 -74
- data/db/migrate/20101006092700_rename_backlogs_to_projects.rb +0 -22
- data/db/migrate/20101006092700_rename_backlogs_to_projects.rb~ +0 -22
- data/db/schema.rb +0 -159
- data/db/seeds.rb +0 -7
- data/db/test.db +0 -0
- data/etc/backlog.conf +0 -32
- data/ext/mkrf_conf.rb +0 -26
- data/lib/class_table_inheritance.rb +0 -224
- data/lib/postgresql-8.2-504.jdbc4.jar +0 -0
- data/lib/tasks/jdbc.rake +0 -8
- data/lib/url_for_fix.rb +0 -30
- data/nbproject/private/config.properties +0 -0
- data/nbproject/private/private.properties +0 -1
- data/nbproject/private/private.xml +0 -4
- data/nbproject/private/rake-t.txt +0 -95
- data/nbproject/project.properties +0 -4
- data/nbproject/project.xml +0 -9
- data/public/404.html +0 -26
- data/public/422.html +0 -26
- data/public/500.html +0 -26
- data/public/Frav/303/246rsskjema.xls +0 -0
- data/public/applets/bsf.jar +0 -0
- data/public/applets/jruby.jar +0 -0
- data/public/favicon.ico +0 -0
- data/public/images/add.png +0 -0
- data/public/images/add.svg +0 -70
- data/public/images/ajax-loading.gif +0 -0
- data/public/images/appunti_architetto_franc_01.svg +0 -92
- data/public/images/arrow-down.gif +0 -0
- data/public/images/arrow-up.gif +0 -0
- data/public/images/arrow07_2.png +0 -0
- data/public/images/arrow07_4.png +0 -0
- data/public/images/arrow_down.png +0 -0
- data/public/images/arrow_down.svg +0 -59
- data/public/images/arrow_left.png +0 -0
- data/public/images/arrow_left.svg +0 -59
- data/public/images/arrow_right.png +0 -0
- data/public/images/arrow_right.svg +0 -59
- data/public/images/arrow_up.png +0 -0
- data/public/images/arrow_up.svg +0 -59
- data/public/images/black-70.png +0 -0
- data/public/images/black.png +0 -0
- data/public/images/blank.jpg +0 -0
- data/public/images/blank.png +0 -0
- data/public/images/cestino_pieno_architetto_01.svg +0 -470
- data/public/images/checkmark.png +0 -0
- data/public/images/checkmark_org.png +0 -0
- data/public/images/clipboard.png +0 -0
- data/public/images/clipboard.svg +0 -62
- data/public/images/construction_hammer_jon__01.svg +0 -116
- data/public/images/delete.png +0 -0
- data/public/images/email.png +0 -0
- data/public/images/email_grey.png +0 -0
- data/public/images/eraser.png +0 -0
- data/public/images/eraser_org.png +0 -0
- data/public/images/ernes_stop.png +0 -0
- data/public/images/ernes_stop_org.png +0 -0
- data/public/images/flag_red.png +0 -0
- data/public/images/flag_yellow.png +0 -0
- data/public/images/grab.png +0 -0
- data/public/images/grab_gray.png +0 -0
- data/public/images/group.png +0 -0
- data/public/images/hammer.png +0 -0
- data/public/images/header.jpg +0 -0
- data/public/images/nextlabel.gif +0 -0
- data/public/images/pagebak.jpg +0 -0
- data/public/images/paper3.svg +0 -54
- data/public/images/period.png +0 -0
- data/public/images/period_org.png +0 -0
- data/public/images/person.org.png +0 -0
- data/public/images/prevlabel.gif +0 -0
- data/public/images/question.svg +0 -56
- data/public/images/rails.png +0 -0
- data/public/images/refresh.png +0 -0
- data/public/images/rmagick.gif +0 -0
- data/public/images/rmagick_270.gif +0 -0
- data/public/images/tabella_architetto_franc_01.svg +0 -105
- data/public/images/task.png +0 -0
- data/public/images/text-x-generic.png +0 -0
- data/public/images/user group.png +0 -0
- data/public/images/user.png +0 -0
- data/public/images/view_fullscreen.png +0 -0
- data/public/images/work_account.png +0 -0
- data/public/javascripts/application.js +0 -2
- data/public/javascripts/builder.js +0 -136
- data/public/javascripts/controls.js +0 -965
- data/public/javascripts/dragdrop.js +0 -974
- data/public/javascripts/effects.js +0 -1123
- data/public/javascripts/lightwindow.js +0 -1921
- data/public/javascripts/prototype.js +0 -6001
- data/public/javascripts/rails.js +0 -175
- data/public/javascripts/ruby.js +0 -46
- data/public/javascripts/scriptaculous.js +0 -58
- data/public/javascripts/slider.js +0 -275
- data/public/javascripts/sound.js +0 -55
- data/public/javascripts/unittest.js +0 -568
- data/public/javascripts/zapatec/utils/transport.js +0 -2217
- data/public/javascripts/zapatec/utils/utils.js +0 -1799
- data/public/javascripts/zapatec/utils/zapatec.js +0 -90
- data/public/javascripts/zapatec/utils/zpeventdriven.js +0 -212
- data/public/javascripts/zapatec/utils/zpwidget.js +0 -729
- data/public/javascripts/zapatec/zpcal/lang/calendar-no.js +0 -124
- data/public/javascripts/zapatec/zpcal/src/calendar-core.js +0 -2878
- data/public/javascripts/zapatec/zpcal/src/calendar-date-core.js +0 -348
- data/public/javascripts/zapatec/zpcal/src/calendar-setup.js +0 -360
- data/public/javascripts/zapatec/zpcal/src/calendar.js +0 -35
- data/public/robots.txt +0 -5
- data/public/stylesheets/backlog.css +0 -135
- data/public/stylesheets/lightwindow.css +0 -376
- data/public/stylesheets/mwrt002.css +0 -54
- data/public/stylesheets/mwrt002MAC.css +0 -3
- data/public/stylesheets/mwrt002NN.css +0 -3
- data/public/stylesheets/scaffold.css +0 -74
- data/public/stylesheets/user.css +0 -74
- data/public/stylesheets/zpcal/themes/green.css +0 -153
- data/public/stylesheets/zpcal/themes/layouts/layout-2d.css +0 -134
- data/public/stylesheets/zpcal/themes/layouts/layout-common.css +0 -74
- data/public/stylesheets/zpcal/themes/menuarrow.gif +0 -0
- data/public/stylesheets/zpcal/themes/scroller-down.gif +0 -0
- data/public/stylesheets/zpcal/themes/scroller-up.gif +0 -0
- data/script/rails +0 -6
- data/test/client/login.rb +0 -23
- data/test/client/login_test.rb +0 -64
- data/test/client/setup.rb +0 -25
- data/test/fixtures/absences.yml +0 -11
- data/test/fixtures/configurations.yml +0 -5
- data/test/fixtures/customers.yml +0 -7
- data/test/fixtures/estimates.yml +0 -10
- data/test/fixtures/groups.yml +0 -6
- data/test/fixtures/groups_users.yml +0 -3
- data/test/fixtures/parties.yml +0 -32
- data/test/fixtures/periods.yml +0 -24
- data/test/fixtures/projects.yml +0 -8
- data/test/fixtures/public_holidays.yml +0 -7
- data/test/fixtures/task_files.yml +0 -13
- data/test/fixtures/tasks.yml +0 -82
- data/test/fixtures/users.yml +0 -59
- data/test/fixtures/work_lock_subscriptions.yml +0 -7
- data/test/fixtures/work_locks.yml +0 -11
- data/test/fixtures/works.yml +0 -47
- data/test/functional/absences_controller_test.rb +0 -93
- data/test/functional/customers_controller_test.rb +0 -93
- data/test/functional/dashboard_controller_test.rb +0 -18
- data/test/functional/estimates_controller_test.rb +0 -40
- data/test/functional/groups_controller_test.rb +0 -120
- data/test/functional/parties_controller_test.rb +0 -35
- data/test/functional/periods_controller_test.rb +0 -297
- data/test/functional/projects_controller_test.rb +0 -152
- data/test/functional/public_holidays_controller_test.rb +0 -93
- data/test/functional/search_controller_test.rb +0 -24
- data/test/functional/task_files_controller_test.rb +0 -29
- data/test/functional/tasks_controller_test.rb +0 -229
- data/test/functional/user_controller_test.rb +0 -261
- data/test/functional/welcome_controller_test.rb +0 -62
- data/test/functional/work_locks_controller_test.rb +0 -93
- data/test/functional/works_controller_test.rb +0 -220
- data/test/integration/user_system_test.rb +0 -95
- data/test/mocks/test/clock.rb +0 -14
- data/test/performance/browsing_test.rb +0 -9
- data/test/performance/common.rb +0 -91
- data/test/performance/jetty_test.rb +0 -15
- data/test/performance/server_test.rb +0 -17
- data/test/test_helper.rb +0 -119
- data/test/test_helper.rb~ +0 -121
- data/test/unit/absence_test.rb +0 -29
- data/test/unit/big_decimal_yaml_fix_test.rb +0 -15
- data/test/unit/configuration_test.rb +0 -10
- data/test/unit/customer_test.rb +0 -10
- data/test/unit/estimate_test.rb +0 -10
- data/test/unit/group_test.rb +0 -10
- data/test/unit/party_test.rb +0 -10
- data/test/unit/period_test.rb +0 -9
- data/test/unit/public_holiday_test.rb +0 -10
- data/test/unit/task_file_test.rb +0 -10
- data/test/unit/task_test.rb +0 -73
- data/test/unit/time_of_day_test.rb +0 -23
- data/test/unit/user_test.rb +0 -148
- data/test/unit/work_lock_subscription_test.rb +0 -10
- data/test/unit/work_lock_test.rb +0 -10
- data/test/unit/work_test.rb +0 -81
- data/vendor/plugins/acts_as_list/README +0 -23
- data/vendor/plugins/acts_as_list/init.rb +0 -3
- data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +0 -256
- data/vendor/plugins/acts_as_list/test/list_test.rb +0 -332
- data/vendor/plugins/acts_as_tree/README +0 -26
- data/vendor/plugins/acts_as_tree/Rakefile +0 -22
- data/vendor/plugins/acts_as_tree/init.rb +0 -1
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +0 -96
- data/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
- data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +0 -219
- data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
- data/vendor/plugins/assert_cookie/MIT-LICENSE +0 -7
- data/vendor/plugins/assert_cookie/README +0 -6
- data/vendor/plugins/assert_cookie/Rakefile +0 -21
- data/vendor/plugins/assert_cookie/init.rb +0 -1
- data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +0 -73
- data/vendor/plugins/assert_cookie/meta.yml +0 -7
- data/vendor/plugins/assert_cookie/test/test_assert_cookie.rb +0 -124
- data/vendor/plugins/assert_cookie/test/test_helper.rb +0 -31
- data/vendor/plugins/auto_complete/README +0 -23
- data/vendor/plugins/auto_complete/Rakefile +0 -22
- data/vendor/plugins/auto_complete/init.rb +0 -2
- data/vendor/plugins/auto_complete/lib/auto_complete.rb +0 -47
- data/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb +0 -143
- data/vendor/plugins/auto_complete/test/auto_complete_test.rb +0 -67
- data/vendor/plugins/backlog_jira/init.rb +0 -66
- data/vendor/plugins/dynamic_form/MIT-LICENSE +0 -20
- data/vendor/plugins/dynamic_form/README +0 -13
- data/vendor/plugins/dynamic_form/Rakefile +0 -10
- data/vendor/plugins/dynamic_form/dynamic_form.gemspec +0 -12
- data/vendor/plugins/dynamic_form/init.rb +0 -1
- data/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb +0 -300
- data/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml +0 -8
- data/vendor/plugins/dynamic_form/lib/dynamic_form.rb +0 -5
- data/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb +0 -42
- data/vendor/plugins/dynamic_form/test/dynamic_form_test.rb +0 -370
- data/vendor/plugins/dynamic_form/test/test_helper.rb +0 -9
- data/vendor/plugins/has_history/README +0 -12
- data/vendor/plugins/has_history/Rakefile +0 -22
- data/vendor/plugins/has_history/generators/history_migration/history_migration_generator.rb +0 -30
- data/vendor/plugins/has_history/generators/history_migration/templates/migration.rb +0 -14
- data/vendor/plugins/has_history/generators/history_model/history_model_generator.rb +0 -39
- data/vendor/plugins/has_history/generators/history_model/templates/fixtures.yml +0 -17
- data/vendor/plugins/has_history/generators/history_model/templates/functional_test.rb +0 -129
- data/vendor/plugins/has_history/generators/history_model/templates/migration.rb +0 -14
- data/vendor/plugins/has_history/generators/history_model/templates/model.rb +0 -4
- data/vendor/plugins/has_history/generators/history_model/templates/unit_test.rb +0 -75
- data/vendor/plugins/has_history/init.rb +0 -5
- data/vendor/plugins/has_history/install.rb +0 -1
- data/vendor/plugins/has_history/lib/has_history.rb +0 -178
- data/vendor/plugins/has_history/lib/tasks/has_history_tasks.rake +0 -4
- data/vendor/plugins/has_history/test/has_history_test.rb +0 -31
- data/vendor/plugins/has_history/test/ignorant_master.rb +0 -3
- data/vendor/plugins/has_history/test/ignorant_master_history.rb +0 -4
- data/vendor/plugins/has_history/test/lone_master.rb +0 -42
- data/vendor/plugins/has_history/test/paired_master.rb +0 -5
- data/vendor/plugins/has_history/test/paired_master_history.rb +0 -5
- data/vendor/plugins/has_history/test/test_helper.rb +0 -154
- data/vendor/plugins/has_history/uninstall.rb +0 -1
- data/vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb +0 -432
- data/vendor/plugins/prototype_legacy_helper/test/test_prototype_helper.rb +0 -297
- data/vendor/plugins/rails_time/MIT-LICENSE +0 -20
- data/vendor/plugins/rails_time/README +0 -28
- data/vendor/plugins/rails_time/init.rb +0 -2
- data/vendor/plugins/rails_time/lib/activerecord_time_extension.rb +0 -28
- data/vendor/plugins/rails_time/lib/time_of_day.rb +0 -88
- data/vendor/plugins/rails_time/test/database.yml +0 -18
- data/vendor/plugins/rails_time/test/debug.log +0 -1
- data/vendor/plugins/rails_time/test/rails_time_test.rb +0 -122
- data/vendor/plugins/rails_time/test/schema.rb +0 -10
- data/vendor/plugins/rails_time/test/test_helper.rb +0 -17
- data/vendor/plugins/verification/MIT-LICENSE +0 -20
- data/vendor/plugins/verification/README +0 -34
- data/vendor/plugins/verification/Rakefile +0 -22
- data/vendor/plugins/verification/init.rb +0 -3
- data/vendor/plugins/verification/lib/action_controller/verification.rb +0 -132
- data/vendor/plugins/verification/test/test_helper.rb +0 -18
- data/vendor/plugins/verification/test/verification_test.rb +0 -270
- data/vendor/plugins/will_paginate/LICENSE +0 -18
- data/vendor/plugins/will_paginate/README +0 -138
- data/vendor/plugins/will_paginate/Rakefile +0 -27
- data/vendor/plugins/will_paginate/init.rb +0 -4
- data/vendor/plugins/will_paginate/lib/will_paginate.rb +0 -61
- data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +0 -132
- data/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +0 -80
- data/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +0 -181
- data/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +0 -206
- data/vendor/plugins/will_paginate/test/array_pagination_test.rb +0 -131
- data/vendor/plugins/will_paginate/test/boot.rb +0 -23
- data/vendor/plugins/will_paginate/test/console +0 -9
- data/vendor/plugins/will_paginate/test/finder_test.rb +0 -290
- data/vendor/plugins/will_paginate/test/fixtures/admin.rb +0 -3
- data/vendor/plugins/will_paginate/test/fixtures/developer.rb +0 -11
- data/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml +0 -13
- data/vendor/plugins/will_paginate/test/fixtures/project.rb +0 -15
- data/vendor/plugins/will_paginate/test/fixtures/projects.yml +0 -7
- data/vendor/plugins/will_paginate/test/fixtures/replies.yml +0 -34
- data/vendor/plugins/will_paginate/test/fixtures/reply.rb +0 -5
- data/vendor/plugins/will_paginate/test/fixtures/schema.rb +0 -38
- data/vendor/plugins/will_paginate/test/fixtures/topic.rb +0 -4
- data/vendor/plugins/will_paginate/test/fixtures/topics.yml +0 -30
- data/vendor/plugins/will_paginate/test/fixtures/user.rb +0 -2
- data/vendor/plugins/will_paginate/test/fixtures/users.yml +0 -35
- data/vendor/plugins/will_paginate/test/helper.rb +0 -25
- data/vendor/plugins/will_paginate/test/lib/activerecord_test_case.rb +0 -23
- data/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb +0 -67
- data/vendor/plugins/will_paginate/test/lib/load_fixtures.rb +0 -13
- data/vendor/plugins/will_paginate/test/pagination_test.rb +0 -240
@@ -1,1921 +0,0 @@
|
|
1
|
-
// lightwindow.js v2.0
|
2
|
-
//
|
3
|
-
// Copyright (c) 2007 stickmanlabs
|
4
|
-
// Author: Kevin P Miller | http://www.stickmanlabs.com
|
5
|
-
//
|
6
|
-
// LightWindow is freely distributable under the terms of an MIT-style license.
|
7
|
-
//
|
8
|
-
// I don't care what you think about the file size...
|
9
|
-
// Be a pro:
|
10
|
-
// http://www.thinkvitamin.com/features/webapps/serving-javascript-fast
|
11
|
-
// http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files
|
12
|
-
//
|
13
|
-
|
14
|
-
/*-----------------------------------------------------------------------------------------------*/
|
15
|
-
|
16
|
-
if(typeof Effect == 'undefined')
|
17
|
-
throw("lightwindow.js requires including script.aculo.us' effects.js library!");
|
18
|
-
|
19
|
-
// This will stop image flickering in IE6 when elements with images are moved
|
20
|
-
try {
|
21
|
-
document.execCommand("BackgroundImageCache", false, true);
|
22
|
-
} catch(e) {}
|
23
|
-
|
24
|
-
var lightwindow = Class.create();
|
25
|
-
lightwindow.prototype = {
|
26
|
-
//
|
27
|
-
// Setup Variables
|
28
|
-
//
|
29
|
-
element : null,
|
30
|
-
contentToFetch : null,
|
31
|
-
windowActive : false,
|
32
|
-
dataEffects : [],
|
33
|
-
dimensions : {
|
34
|
-
cruft : null,
|
35
|
-
container : null,
|
36
|
-
viewport : {
|
37
|
-
height : null,
|
38
|
-
width : null,
|
39
|
-
offsetTop : null,
|
40
|
-
offsetLeft : null
|
41
|
-
}
|
42
|
-
},
|
43
|
-
pagePosition : {
|
44
|
-
x : 0,
|
45
|
-
y : 0
|
46
|
-
},
|
47
|
-
pageDimensions : {
|
48
|
-
width : null,
|
49
|
-
height : null
|
50
|
-
},
|
51
|
-
preloadImage : [],
|
52
|
-
preloadedImage : [],
|
53
|
-
galleries : [],
|
54
|
-
resizeTo : {
|
55
|
-
height : null,
|
56
|
-
heightPercent : null,
|
57
|
-
width : null,
|
58
|
-
widthPercent : null,
|
59
|
-
fixedTop : null,
|
60
|
-
fixedLeft : null
|
61
|
-
},
|
62
|
-
scrollbarOffset : 18,
|
63
|
-
navigationObservers : {
|
64
|
-
previous : null,
|
65
|
-
next : null
|
66
|
-
},
|
67
|
-
containerChange : {
|
68
|
-
height : 0,
|
69
|
-
width : 0
|
70
|
-
},
|
71
|
-
activeGallery : false,
|
72
|
-
galleryLocation : {
|
73
|
-
current : 0,
|
74
|
-
total : 0
|
75
|
-
},
|
76
|
-
//
|
77
|
-
// Initialize the lightwindow.
|
78
|
-
//
|
79
|
-
initialize : function(options) {
|
80
|
-
this.options = Object.extend({
|
81
|
-
resizeSpeed : 8,
|
82
|
-
contentOffset : {
|
83
|
-
height : 20,
|
84
|
-
width : 20
|
85
|
-
},
|
86
|
-
dimensions : {
|
87
|
-
image : {height : 250, width : 250},
|
88
|
-
page : {height : 250, width : 250},
|
89
|
-
inline : {height : 250, width : 250},
|
90
|
-
media : {height : 250, width : 250},
|
91
|
-
external : {height : 250, width : 250},
|
92
|
-
titleHeight : 25
|
93
|
-
},
|
94
|
-
classNames : {
|
95
|
-
standard : 'lightwindow',
|
96
|
-
action : 'lightwindow_action'
|
97
|
-
},
|
98
|
-
fileTypes : {
|
99
|
-
page : ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php4', 'php3', 'php', 'php5', 'phtml', 'rhtml', 'shtml', 'txt', 'vbs', 'rb'],
|
100
|
-
media : ['aif', 'aiff', 'asf', 'avi', 'divx', 'm1v', 'm2a', 'm2v', 'm3u', 'mid', 'midi', 'mov', 'moov', 'movie', 'mp2', 'mp3', 'mpa', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpg', 'mpga', 'pps', 'qt', 'rm', 'ram', 'swf', 'viv', 'vivo', 'wav'],
|
101
|
-
image : ['bmp', 'gif', 'jpg', 'png', 'tiff']
|
102
|
-
},
|
103
|
-
mimeTypes : {
|
104
|
-
avi : 'video/avi',
|
105
|
-
aif : 'audio/aiff',
|
106
|
-
aiff : 'audio/aiff',
|
107
|
-
gif : 'image/gif',
|
108
|
-
bmp : 'image/bmp',
|
109
|
-
jpeg : 'image/jpeg',
|
110
|
-
m1v : 'video/mpeg',
|
111
|
-
m2a : 'audio/mpeg',
|
112
|
-
m2v : 'video/mpeg',
|
113
|
-
m3u : 'audio/x-mpequrl',
|
114
|
-
mid : 'audio/x-midi',
|
115
|
-
midi : 'audio/x-midi',
|
116
|
-
mjpg : 'video/x-motion-jpeg',
|
117
|
-
moov : 'video/quicktime',
|
118
|
-
mov : 'video/quicktime',
|
119
|
-
movie : 'video/x-sgi-movie',
|
120
|
-
mp2 : 'audio/mpeg',
|
121
|
-
mp3 : 'audio/mpeg3',
|
122
|
-
mpa : 'audio/mpeg',
|
123
|
-
mpa : 'video/mpeg',
|
124
|
-
mpe : 'video/mpeg',
|
125
|
-
mpeg : 'video/mpeg',
|
126
|
-
mpg : 'audio/mpeg',
|
127
|
-
mpg : 'video/mpeg',
|
128
|
-
mpga : 'audio/mpeg',
|
129
|
-
pdf : 'application/pdf',
|
130
|
-
png : 'image/png',
|
131
|
-
pps : 'application/mspowerpoint',
|
132
|
-
qt : 'video/quicktime',
|
133
|
-
ram : 'audio/x-pn-realaudio-plugin',
|
134
|
-
rm : 'application/vnd.rn-realmedia',
|
135
|
-
swf : 'application/x-shockwave-flash',
|
136
|
-
tiff : 'image/tiff',
|
137
|
-
viv : 'video/vivo',
|
138
|
-
vivo : 'video/vivo',
|
139
|
-
wav : 'audio/wav',
|
140
|
-
wmv : 'application/x-mplayer2'
|
141
|
-
},
|
142
|
-
classids : {
|
143
|
-
mov : 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
144
|
-
swf : 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
|
145
|
-
wmv : 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'
|
146
|
-
},
|
147
|
-
codebases : {
|
148
|
-
mov : 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
|
149
|
-
swf : 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0',
|
150
|
-
wmv : 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715'
|
151
|
-
},
|
152
|
-
viewportPadding : 10,
|
153
|
-
EOLASFix : 'swf,wmv,fla,flv',
|
154
|
-
overlay : {
|
155
|
-
opacity : 0.7,
|
156
|
-
image : 'images/black.png',
|
157
|
-
presetImage : 'images/black-70.png'
|
158
|
-
},
|
159
|
-
skin : {
|
160
|
-
main : '<div id="lightwindow_container" >'+
|
161
|
-
'<div id="lightwindow_title_bar" >'+
|
162
|
-
'<div id="lightwindow_title_bar_inner" >'+
|
163
|
-
'<span id="lightwindow_title_bar_title"></span>'+
|
164
|
-
'<a id="lightwindow_title_bar_close_link" >close</a>'+
|
165
|
-
'</div>'+
|
166
|
-
'</div>'+
|
167
|
-
'<div id="lightwindow_stage" >'+
|
168
|
-
'<div id="lightwindow_contents" >'+
|
169
|
-
'</div>'+
|
170
|
-
'<div id="lightwindow_navigation" >'+
|
171
|
-
'<a href="#" id="lightwindow_previous" >'+
|
172
|
-
'<span id="lightwindow_previous_title"></span>'+
|
173
|
-
'</a>'+
|
174
|
-
'<a href="#" id="lightwindow_next" >'+
|
175
|
-
'<span id="lightwindow_next_title"></span>'+
|
176
|
-
'</a>'+
|
177
|
-
'<iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe>'+
|
178
|
-
'</div>'+
|
179
|
-
'<div id="lightwindow_galleries">'+
|
180
|
-
'<div id="lightwindow_galleries_tab_container" >'+
|
181
|
-
'<a href="#" id="lightwindow_galleries_tab" >'+
|
182
|
-
'<span id="lightwindow_galleries_tab_span" class="up" >Galleries</span>'+
|
183
|
-
'</a>'+
|
184
|
-
'</div>'+
|
185
|
-
'<div id="lightwindow_galleries_list" >'+
|
186
|
-
'</div>'+
|
187
|
-
'</div>'+
|
188
|
-
'</div>'+
|
189
|
-
'<div id="lightwindow_data_slide" >'+
|
190
|
-
'<div id="lightwindow_data_slide_inner" >'+
|
191
|
-
'<div id="lightwindow_data_details" >'+
|
192
|
-
'<div id="lightwindow_data_gallery_container" >'+
|
193
|
-
'<span id="lightwindow_data_gallery_current"></span>'+
|
194
|
-
' of '+
|
195
|
-
'<span id="lightwindow_data_gallery_total"></span>'+
|
196
|
-
'</div>'+
|
197
|
-
'<div id="lightwindow_data_author_container" >'+
|
198
|
-
'by <span id="lightwindow_data_author"></span>'+
|
199
|
-
'</div>'+
|
200
|
-
'</div>'+
|
201
|
-
'<div id="lightwindow_data_caption" >'+
|
202
|
-
'</div>'+
|
203
|
-
'</div>'+
|
204
|
-
'</div>'+
|
205
|
-
'</div>',
|
206
|
-
loading : '<div id="lightwindow_loading" >'+
|
207
|
-
'<img src="images/ajax-loading.gif" alt="loading" />'+
|
208
|
-
'<span>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></span>'+
|
209
|
-
'<iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe>'+
|
210
|
-
'</div>',
|
211
|
-
iframe : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+
|
212
|
-
'<html xmlns="http://www.w3.org/1999/xhtml">'+
|
213
|
-
'<body>'+
|
214
|
-
'{body_replace}'+
|
215
|
-
'</body>'+
|
216
|
-
'</html>',
|
217
|
-
gallery : {
|
218
|
-
top : '<div class="lightwindow_galleries_list">'+
|
219
|
-
'<h1>{gallery_title_replace}</h1>'+
|
220
|
-
'<ul>',
|
221
|
-
middle : '<li>'+
|
222
|
-
'{gallery_link_replace}'+
|
223
|
-
'</li>',
|
224
|
-
bottom : '</ul>'+
|
225
|
-
'</div>'
|
226
|
-
}
|
227
|
-
},
|
228
|
-
formMethod : 'get',
|
229
|
-
hideFlash : false,
|
230
|
-
hideGalleryTab : false,
|
231
|
-
showTitleBar : true,
|
232
|
-
animationHandler : false,
|
233
|
-
navigationHandler : false,
|
234
|
-
transitionHandler : false,
|
235
|
-
finalAnimationHandler : false,
|
236
|
-
formHandler : false,
|
237
|
-
galleryAnimationHandler : false,
|
238
|
-
showGalleryCount : true
|
239
|
-
}, options || {});
|
240
|
-
this.duration = ((11-this.options.resizeSpeed)*0.15);
|
241
|
-
this._setupLinks();
|
242
|
-
this._getScroll();
|
243
|
-
this._getPageDimensions();
|
244
|
-
this._browserDimensions();
|
245
|
-
this._addLightWindowMarkup(false);
|
246
|
-
this._setupDimensions();
|
247
|
-
this.buildGalleryList();
|
248
|
-
},
|
249
|
-
//
|
250
|
-
// Activate the lightwindow.
|
251
|
-
//
|
252
|
-
activate : function(e, link){
|
253
|
-
// Clear out the window Contents
|
254
|
-
this._clearWindowContents(true);
|
255
|
-
|
256
|
-
// Add back in out loading panel
|
257
|
-
this._addLoadingWindowMarkup();
|
258
|
-
|
259
|
-
// Setup the element properties
|
260
|
-
this._setupWindowElements(link);
|
261
|
-
|
262
|
-
// Setup everything
|
263
|
-
this._getScroll();
|
264
|
-
this._browserDimensions();
|
265
|
-
this._setupDimensions();
|
266
|
-
this._toggleTroubleElements('hidden', false);
|
267
|
-
this._displayLightWindow('block', 'hidden');
|
268
|
-
this._setStatus(true);
|
269
|
-
this._monitorKeyboard(true);
|
270
|
-
this._prepareIE(true);
|
271
|
-
this._loadWindow();
|
272
|
-
},
|
273
|
-
//
|
274
|
-
// Turn off the window
|
275
|
-
//
|
276
|
-
deactivate : function(){
|
277
|
-
// The window is not active
|
278
|
-
this.windowActive = false;
|
279
|
-
|
280
|
-
// There is no longer a gallery active
|
281
|
-
this.activeGallery = false;
|
282
|
-
if (!this.options.hideGalleryTab) {
|
283
|
-
this._handleGalleryAnimation(false);
|
284
|
-
}
|
285
|
-
|
286
|
-
// Kill the animation
|
287
|
-
this.animating = false;
|
288
|
-
|
289
|
-
// Clear our element
|
290
|
-
this.element = null;
|
291
|
-
|
292
|
-
// hide the window.
|
293
|
-
this._displayLightWindow('none', 'visible');
|
294
|
-
|
295
|
-
// Clear out the window Contents
|
296
|
-
this._clearWindowContents(false);
|
297
|
-
|
298
|
-
// Stop all animation
|
299
|
-
var queue = Effect.Queues.get('lightwindowAnimation').each(function(e){e.cancel();});
|
300
|
-
|
301
|
-
// Undo the setup
|
302
|
-
this._prepareIE(false);
|
303
|
-
this._setupDimensions();
|
304
|
-
this._toggleTroubleElements('visible', false);
|
305
|
-
this._monitorKeyboard(false);
|
306
|
-
},
|
307
|
-
//
|
308
|
-
// Initialize specific window
|
309
|
-
//
|
310
|
-
createWindow : function(element, attributes) {
|
311
|
-
this._processLink($(element));
|
312
|
-
},
|
313
|
-
//
|
314
|
-
// Open a Window from a hash of attributes
|
315
|
-
//
|
316
|
-
activateWindow : function(options) {
|
317
|
-
this.element = Object.extend({
|
318
|
-
href : null,
|
319
|
-
title : null,
|
320
|
-
author : null,
|
321
|
-
caption : null,
|
322
|
-
rel : null,
|
323
|
-
top : null,
|
324
|
-
left : null,
|
325
|
-
type : null,
|
326
|
-
showImages : null,
|
327
|
-
height : null,
|
328
|
-
width : null,
|
329
|
-
loadingAnimation : null,
|
330
|
-
iframeEmbed : null,
|
331
|
-
form : null
|
332
|
-
}, options || {});
|
333
|
-
|
334
|
-
// Set the window type
|
335
|
-
this.contentToFetch = this.element.href;
|
336
|
-
this.windowType = this.element.type ? this.element.type : this._fileType(this.element.href);
|
337
|
-
|
338
|
-
// Clear out the window Contents
|
339
|
-
this._clearWindowContents(true);
|
340
|
-
|
341
|
-
// Add back in out loading panel
|
342
|
-
this._addLoadingWindowMarkup();
|
343
|
-
|
344
|
-
// Setup everything
|
345
|
-
this._getScroll();
|
346
|
-
this._browserDimensions();
|
347
|
-
this._setupDimensions();
|
348
|
-
this._toggleTroubleElements('hidden', false);
|
349
|
-
this._displayLightWindow('block', 'hidden');
|
350
|
-
this._setStatus(true);
|
351
|
-
this._monitorKeyboard(true);
|
352
|
-
this._prepareIE(true);
|
353
|
-
this._loadWindow();
|
354
|
-
},
|
355
|
-
//
|
356
|
-
// Fire off our Form handler
|
357
|
-
//
|
358
|
-
submitForm : function(e) {
|
359
|
-
if (this.options.formHandler) {
|
360
|
-
this.options.formHandler(e);
|
361
|
-
} else {
|
362
|
-
this._defaultFormHandler(e);
|
363
|
-
}
|
364
|
-
},
|
365
|
-
//
|
366
|
-
// Reload the window with another location
|
367
|
-
//
|
368
|
-
openWindow : function(element) {
|
369
|
-
var element = $(element);
|
370
|
-
|
371
|
-
// The window is active
|
372
|
-
this.windowActive = true;
|
373
|
-
|
374
|
-
// Clear out the window Contents
|
375
|
-
this._clearWindowContents(true);
|
376
|
-
|
377
|
-
// Add back in out loading panel
|
378
|
-
this._addLoadingWindowMarkup();
|
379
|
-
|
380
|
-
// Setup the element properties
|
381
|
-
this._setupWindowElements(element);
|
382
|
-
|
383
|
-
this._setStatus(true);
|
384
|
-
this._handleTransition();
|
385
|
-
},
|
386
|
-
//
|
387
|
-
// Navigate the window
|
388
|
-
//
|
389
|
-
navigateWindow : function(direction) {
|
390
|
-
this._handleNavigation(false);
|
391
|
-
if (direction == 'previous') {
|
392
|
-
this.openWindow(this.navigationObservers.previous);
|
393
|
-
} else if (direction == 'next'){
|
394
|
-
this.openWindow(this.navigationObservers.next);
|
395
|
-
}
|
396
|
-
},
|
397
|
-
//
|
398
|
-
// Build the Gallery List and Load it
|
399
|
-
//
|
400
|
-
buildGalleryList : function() {
|
401
|
-
var output = '';
|
402
|
-
var galleryLink;
|
403
|
-
for (i in this.galleries) {
|
404
|
-
if (typeof this.galleries[i] == 'object') {
|
405
|
-
output += (this.options.skin.gallery.top).replace('{gallery_title_replace}', unescape(i));
|
406
|
-
for (j in this.galleries[i]) {
|
407
|
-
if (typeof this.galleries[i][j] == 'object') {
|
408
|
-
galleryLink = '<a href="#" id="lightwindow_gallery_'+i+'_'+j+'" >'+unescape(j)+'</a>';
|
409
|
-
output += (this.options.skin.gallery.middle).replace('{gallery_link_replace}', galleryLink);
|
410
|
-
}
|
411
|
-
}
|
412
|
-
output += this.options.skin.gallery.bottom;
|
413
|
-
}
|
414
|
-
}
|
415
|
-
new Insertion.Top('lightwindow_galleries_list', output);
|
416
|
-
|
417
|
-
// Attach Events
|
418
|
-
for (i in this.galleries) {
|
419
|
-
if (typeof this.galleries[i] == 'object') {
|
420
|
-
for (j in this.galleries[i]) {
|
421
|
-
if (typeof this.galleries[i][j] == 'object') {
|
422
|
-
Event.observe($('lightwindow_gallery_'+i+'_'+j), 'click', this.openWindow.bind(this, this.galleries[i][j][0]), false);
|
423
|
-
$('lightwindow_gallery_'+i+'_'+j).onclick = function() {return false;};
|
424
|
-
}
|
425
|
-
}
|
426
|
-
}
|
427
|
-
}
|
428
|
-
},
|
429
|
-
//
|
430
|
-
// Set Links Up
|
431
|
-
//
|
432
|
-
_setupLinks : function() {
|
433
|
-
var links = $$('.'+this.options.classNames.standard);
|
434
|
-
links.each(function(link) {
|
435
|
-
this._processLink(link);
|
436
|
-
}.bind(this));
|
437
|
-
},
|
438
|
-
//
|
439
|
-
// Process a Link
|
440
|
-
//
|
441
|
-
_processLink : function(link) {
|
442
|
-
if ((this._fileType(link.getAttribute('href')) == 'image' || this._fileType(link.getAttribute('href')) == 'media')) {
|
443
|
-
if (gallery = this._getGalleryInfo(link.rel)) {
|
444
|
-
if (!this.galleries[gallery[0]]) {
|
445
|
-
this.galleries[gallery[0]] = new Array();
|
446
|
-
}
|
447
|
-
if (!this.galleries[gallery[0]][gallery[1]]) {
|
448
|
-
this.galleries[gallery[0]][gallery[1]] = new Array();
|
449
|
-
}
|
450
|
-
this.galleries[gallery[0]][gallery[1]].push(link);
|
451
|
-
}
|
452
|
-
}
|
453
|
-
|
454
|
-
// Take care of our inline content
|
455
|
-
var url = link.getAttribute('href');
|
456
|
-
if (url.indexOf('?') > -1) {
|
457
|
-
url = url.substring(0, url.indexOf('?'));
|
458
|
-
}
|
459
|
-
|
460
|
-
var container = url.substring(url.indexOf('#')+1);
|
461
|
-
if($(container)) {
|
462
|
-
$(container).setStyle({
|
463
|
-
display : 'none'
|
464
|
-
});
|
465
|
-
}
|
466
|
-
|
467
|
-
Event.observe(link, 'click', this.activate.bindAsEventListener(this, link), false);
|
468
|
-
link.onclick = function() {return false;};
|
469
|
-
},
|
470
|
-
//
|
471
|
-
// Setup our actions
|
472
|
-
//
|
473
|
-
_setupActions : function() {
|
474
|
-
var links = $$('#lightwindow_container .'+this.options.classNames.action);
|
475
|
-
links.each(function(link) {
|
476
|
-
Event.observe(link, 'click', this[link.getAttribute('rel')].bindAsEventListener(this, link), false);
|
477
|
-
link.onclick = function() {return false;};
|
478
|
-
}.bind(this));
|
479
|
-
},
|
480
|
-
//
|
481
|
-
// Add the markup to the page.
|
482
|
-
//
|
483
|
-
_addLightWindowMarkup : function(rebuild) {
|
484
|
-
var overlay = Element.extend(document.createElement('div'));
|
485
|
-
overlay.setAttribute('id', 'lightwindow_overlay');
|
486
|
-
// FF Mac has a problem with putting Flash above a layer without a 100% opacity background, so we need to use a pre-made
|
487
|
-
if (Prototype.Browser.Gecko) {
|
488
|
-
overlay.setStyle({
|
489
|
-
backgroundImage: 'url('+this.options.overlay.presetImage+')',
|
490
|
-
backgroundRepeat: 'repeat',
|
491
|
-
height: this.pageDimensions.height+'px'
|
492
|
-
});
|
493
|
-
} else {
|
494
|
-
overlay.setStyle({
|
495
|
-
opacity: this.options.overlay.opacity,
|
496
|
-
backgroundImage: 'url('+this.options.overlay.image+')',
|
497
|
-
backgroundRepeat: 'repeat',
|
498
|
-
height: this.pageDimensions.height+'px'
|
499
|
-
});
|
500
|
-
}
|
501
|
-
|
502
|
-
var lw = document.createElement('div');
|
503
|
-
lw.setAttribute('id', 'lightwindow');
|
504
|
-
lw.innerHTML = this.options.skin.main;
|
505
|
-
|
506
|
-
var body = document.getElementsByTagName('body')[0];
|
507
|
-
body.appendChild(overlay);
|
508
|
-
body.appendChild(lw);
|
509
|
-
|
510
|
-
if ($('lightwindow_title_bar_close_link')) {
|
511
|
-
Event.observe('lightwindow_title_bar_close_link', 'click', this.deactivate.bindAsEventListener(this));
|
512
|
-
$('lightwindow_title_bar_close_link').onclick = function() {return false;};
|
513
|
-
}
|
514
|
-
|
515
|
-
Event.observe($('lightwindow_previous'), 'click', this.navigateWindow.bind(this, 'previous'), false);
|
516
|
-
$('lightwindow_previous').onclick = function() {return false;};
|
517
|
-
Event.observe($('lightwindow_next'), 'click', this.navigateWindow.bind(this, 'next'), false);
|
518
|
-
$('lightwindow_next').onclick = function() {return false;};
|
519
|
-
|
520
|
-
if (!this.options.hideGalleryTab) {
|
521
|
-
Event.observe($('lightwindow_galleries_tab'), 'click', this._handleGalleryAnimation.bind(this, true), false);
|
522
|
-
$('lightwindow_galleries_tab').onclick = function() {return false;};
|
523
|
-
}
|
524
|
-
|
525
|
-
// Because we use position absolute, kill the scroll Wheel on animations
|
526
|
-
if (Prototype.Browser.IE) {
|
527
|
-
Event.observe(document, 'mousewheel', this._stopScrolling.bindAsEventListener(this), false);
|
528
|
-
} else {
|
529
|
-
Event.observe(window, 'DOMMouseScroll', this._stopScrolling.bindAsEventListener(this), false);
|
530
|
-
}
|
531
|
-
|
532
|
-
Event.observe(overlay, 'click', this.deactivate.bindAsEventListener(this), false);
|
533
|
-
overlay.onclick = function() {return false;};
|
534
|
-
},
|
535
|
-
//
|
536
|
-
// Add loading window markup
|
537
|
-
//
|
538
|
-
_addLoadingWindowMarkup : function() {
|
539
|
-
$('lightwindow_contents').innerHTML += this.options.skin.loading;
|
540
|
-
},
|
541
|
-
//
|
542
|
-
// Setup the window elements
|
543
|
-
//
|
544
|
-
_setupWindowElements : function(link) {
|
545
|
-
this.element = link;
|
546
|
-
this.element.title = null ? '' : link.getAttribute('title');
|
547
|
-
this.element.author = null ? '' : link.getAttribute('author');
|
548
|
-
this.element.caption = null ? '' : link.getAttribute('caption');
|
549
|
-
this.element.rel = null ? '' : link.getAttribute('rel');
|
550
|
-
this.element.params = null ? '' : link.getAttribute('params');
|
551
|
-
|
552
|
-
// Set the window type
|
553
|
-
this.contentToFetch = this.element.href;
|
554
|
-
this.windowType = this._getParameter('lightwindow_type') ? this._getParameter('lightwindow_type') : this._fileType(this.contentToFetch);
|
555
|
-
},
|
556
|
-
//
|
557
|
-
// Clear the window contents out
|
558
|
-
//
|
559
|
-
_clearWindowContents : function(contents) {
|
560
|
-
// If there is an iframe, its got to go
|
561
|
-
if ($('lightwindow_iframe')) {
|
562
|
-
Element.remove($('lightwindow_iframe'));
|
563
|
-
}
|
564
|
-
|
565
|
-
// Stop playing an object if its still around
|
566
|
-
if ($('lightwindow_media_primary')) {
|
567
|
-
try {
|
568
|
-
$('lightwindow_media_primary').Stop();
|
569
|
-
} catch(e) {}
|
570
|
-
Element.remove($('lightwindow_media_primary'));
|
571
|
-
}
|
572
|
-
|
573
|
-
// Stop playing an object if its still around
|
574
|
-
if ($('lightwindow_media_secondary')) {
|
575
|
-
try {
|
576
|
-
$('lightwindow_media_secondary').Stop();
|
577
|
-
} catch(e) {}
|
578
|
-
Element.remove($('lightwindow_media_secondary'));
|
579
|
-
}
|
580
|
-
|
581
|
-
this.activeGallery = false;
|
582
|
-
this._handleNavigation(this.activeGallery);
|
583
|
-
|
584
|
-
if (contents) {
|
585
|
-
// Empty the contents
|
586
|
-
$('lightwindow_contents').innerHTML = '';
|
587
|
-
|
588
|
-
// Reset the scroll bars
|
589
|
-
$('lightwindow_contents').setStyle({
|
590
|
-
overflow: 'hidden'
|
591
|
-
});
|
592
|
-
|
593
|
-
if (!this.windowActive) {
|
594
|
-
$('lightwindow_data_slide_inner').setStyle({
|
595
|
-
display: 'none'
|
596
|
-
});
|
597
|
-
|
598
|
-
$('lightwindow_title_bar_title').innerHTML = '';
|
599
|
-
}
|
600
|
-
|
601
|
-
// Because of browser differences and to maintain flexible captions we need to reset this height at close
|
602
|
-
$('lightwindow_data_slide').setStyle({
|
603
|
-
height: 'auto'
|
604
|
-
});
|
605
|
-
}
|
606
|
-
|
607
|
-
this.resizeTo.height = null;
|
608
|
-
this.resizeTo.width = null;
|
609
|
-
},
|
610
|
-
//
|
611
|
-
// Set the status of our animation to keep things from getting clunky
|
612
|
-
//
|
613
|
-
_setStatus : function(status) {
|
614
|
-
this.animating = status;
|
615
|
-
if (status) {
|
616
|
-
Element.show('lightwindow_loading');
|
617
|
-
}
|
618
|
-
if (!(/MSIE 6./i.test(navigator.userAgent))) {
|
619
|
-
this._fixedWindow(status);
|
620
|
-
}
|
621
|
-
},
|
622
|
-
//
|
623
|
-
// Make this window Fixed
|
624
|
-
//
|
625
|
-
_fixedWindow : function(status) {
|
626
|
-
if (status) {
|
627
|
-
if (this.windowActive) {
|
628
|
-
this._getScroll();
|
629
|
-
$('lightwindow').setStyle({
|
630
|
-
position: 'absolute',
|
631
|
-
top: parseFloat($('lightwindow').getStyle('top'))+this.pagePosition.y+'px',
|
632
|
-
left: parseFloat($('lightwindow').getStyle('left'))+this.pagePosition.x+'px'
|
633
|
-
});
|
634
|
-
} else {
|
635
|
-
$('lightwindow').setStyle({
|
636
|
-
position: 'absolute'
|
637
|
-
});
|
638
|
-
}
|
639
|
-
} else {
|
640
|
-
if (this.windowActive) {
|
641
|
-
this._getScroll();
|
642
|
-
$('lightwindow').setStyle({
|
643
|
-
position: 'fixed',
|
644
|
-
top: parseFloat($('lightwindow').getStyle('top'))-this.pagePosition.y+'px',
|
645
|
-
left: parseFloat($('lightwindow').getStyle('left'))-this.pagePosition.x+'px'
|
646
|
-
});
|
647
|
-
} else {
|
648
|
-
if ($('lightwindow_iframe')) {
|
649
|
-
// Ideally here we would set a 50% value for top and left, but Safari rears it ugly head again and we need to do it by pixels
|
650
|
-
this._browserDimensions();
|
651
|
-
}
|
652
|
-
$('lightwindow').setStyle({
|
653
|
-
position: 'fixed',
|
654
|
-
top: (parseFloat(this._getParameter('lightwindow_top')) ? parseFloat(this._getParameter('lightwindow_top'))+'px' : this.dimensions.viewport.height/2+'px'),
|
655
|
-
left: (parseFloat(this._getParameter('lightwindow_left')) ? parseFloat(this._getParameter('lightwindow_left'))+'px' : this.dimensions.viewport.width/2+'px')
|
656
|
-
});
|
657
|
-
}
|
658
|
-
}
|
659
|
-
},
|
660
|
-
//
|
661
|
-
// Prepare the window for IE.
|
662
|
-
//
|
663
|
-
_prepareIE : function(setup) {
|
664
|
-
if (Prototype.Browser.IE) {
|
665
|
-
var height, overflowX, overflowY;
|
666
|
-
if (setup) {
|
667
|
-
var height = '100%';
|
668
|
-
} else {
|
669
|
-
var height = 'auto';
|
670
|
-
}
|
671
|
-
var body = document.getElementsByTagName('body')[0];
|
672
|
-
var html = document.getElementsByTagName('html')[0];
|
673
|
-
html.style.height = body.style.height = height;
|
674
|
-
}
|
675
|
-
},
|
676
|
-
_stopScrolling : function(e) {
|
677
|
-
if (this.animating) {
|
678
|
-
if (e.preventDefault) {
|
679
|
-
e.preventDefault();
|
680
|
-
}
|
681
|
-
e.returnValue = false;
|
682
|
-
}
|
683
|
-
},
|
684
|
-
//
|
685
|
-
// Get the scroll for the page.
|
686
|
-
//
|
687
|
-
_getScroll : function(){
|
688
|
-
if(typeof(window.pageYOffset) == 'number') {
|
689
|
-
this.pagePosition.x = window.pageXOffset;
|
690
|
-
this.pagePosition.y = window.pageYOffset;
|
691
|
-
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
692
|
-
this.pagePosition.x = document.body.scrollLeft;
|
693
|
-
this.pagePosition.y = document.body.scrollTop;
|
694
|
-
} else if(document.documentElement) {
|
695
|
-
this.pagePosition.x = document.documentElement.scrollLeft;
|
696
|
-
this.pagePosition.y = document.documentElement.scrollTop;
|
697
|
-
}
|
698
|
-
},
|
699
|
-
//
|
700
|
-
// Reset the scroll.
|
701
|
-
//
|
702
|
-
_setScroll : function(x, y) {
|
703
|
-
document.documentElement.scrollLeft = x;
|
704
|
-
document.documentElement.scrollTop = y;
|
705
|
-
},
|
706
|
-
//
|
707
|
-
// Hide Selects from the page because of IE.
|
708
|
-
// We could use iframe shims instead here but why add all the extra markup for one browser when this is much easier and cleaner
|
709
|
-
//
|
710
|
-
_toggleTroubleElements : function(visibility, content){
|
711
|
-
|
712
|
-
if (content) {
|
713
|
-
var selects = $('lightwindow_contents').getElementsByTagName('select');
|
714
|
-
} else {
|
715
|
-
var selects = document.getElementsByTagName('select');
|
716
|
-
}
|
717
|
-
|
718
|
-
for(var i = 0; i < selects.length; i++) {
|
719
|
-
selects[i].style.visibility = visibility;
|
720
|
-
}
|
721
|
-
|
722
|
-
if (!content) {
|
723
|
-
if (this.options.hideFlash){
|
724
|
-
var objects = document.getElementsByTagName('object');
|
725
|
-
for (i = 0; i != objects.length; i++) {
|
726
|
-
objects[i].style.visibility = visibility;
|
727
|
-
}
|
728
|
-
var embeds = document.getElementsByTagName('embed');
|
729
|
-
for (i = 0; i != embeds.length; i++) {
|
730
|
-
embeds[i].style.visibility = visibility;
|
731
|
-
}
|
732
|
-
}
|
733
|
-
var iframes = document.getElementsByTagName('iframe');
|
734
|
-
for (i = 0; i != iframes.length; i++) {
|
735
|
-
iframes[i].style.visibility = visibility;
|
736
|
-
}
|
737
|
-
}
|
738
|
-
},
|
739
|
-
//
|
740
|
-
// Get the actual page size
|
741
|
-
//
|
742
|
-
_getPageDimensions : function() {
|
743
|
-
var xScroll, yScroll;
|
744
|
-
if (window.innerHeight && window.scrollMaxY) {
|
745
|
-
xScroll = document.body.scrollWidth;
|
746
|
-
yScroll = window.innerHeight + window.scrollMaxY;
|
747
|
-
} else if (document.body.scrollHeight > document.body.offsetHeight){
|
748
|
-
xScroll = document.body.scrollWidth;
|
749
|
-
yScroll = document.body.scrollHeight;
|
750
|
-
} else {
|
751
|
-
xScroll = document.body.offsetWidth;
|
752
|
-
yScroll = document.body.offsetHeight;
|
753
|
-
}
|
754
|
-
|
755
|
-
var windowWidth, windowHeight;
|
756
|
-
if (self.innerHeight) {
|
757
|
-
windowWidth = self.innerWidth;
|
758
|
-
windowHeight = self.innerHeight;
|
759
|
-
} else if (document.documentElement && document.documentElement.clientHeight) {
|
760
|
-
windowWidth = document.documentElement.clientWidth;
|
761
|
-
windowHeight = document.documentElement.clientHeight;
|
762
|
-
} else if (document.body) {
|
763
|
-
windowWidth = document.body.clientWidth;
|
764
|
-
windowHeight = document.body.clientHeight;
|
765
|
-
}
|
766
|
-
|
767
|
-
if(yScroll < windowHeight){
|
768
|
-
this.pageDimensions.height = windowHeight;
|
769
|
-
} else {
|
770
|
-
this.pageDimensions.height = yScroll;
|
771
|
-
}
|
772
|
-
|
773
|
-
if(xScroll < windowWidth){
|
774
|
-
this.pageDimensions.width = windowWidth;
|
775
|
-
} else {
|
776
|
-
this.pageDimensions.width = xScroll;
|
777
|
-
}
|
778
|
-
},
|
779
|
-
//
|
780
|
-
// Display the lightWindow.
|
781
|
-
//
|
782
|
-
_displayLightWindow : function(display, visibility) {
|
783
|
-
$('lightwindow_overlay').style.display = $('lightwindow').style.display = $('lightwindow_container').style.display = display;
|
784
|
-
$('lightwindow_overlay').style.visibility = $('lightwindow').style.visibility = $('lightwindow_container').style.visibility = visibility;
|
785
|
-
},
|
786
|
-
//
|
787
|
-
// Setup Dimensions of lightwindow.
|
788
|
-
|
789
|
-
//
|
790
|
-
_setupDimensions : function() {
|
791
|
-
|
792
|
-
var originalHeight, originalWidth;
|
793
|
-
switch (this.windowType) {
|
794
|
-
case 'page' :
|
795
|
-
originalHeight = this.options.dimensions.page.height;
|
796
|
-
originalWidth = this.options.dimensions.page.width;
|
797
|
-
break;
|
798
|
-
|
799
|
-
case 'image' :
|
800
|
-
originalHeight = this.options.dimensions.image.height;
|
801
|
-
originalWidth = this.options.dimensions.image.width;
|
802
|
-
break;
|
803
|
-
|
804
|
-
case 'media' :
|
805
|
-
originalHeight = this.options.dimensions.media.height;
|
806
|
-
originalWidth = this.options.dimensions.media.width;
|
807
|
-
break;
|
808
|
-
|
809
|
-
case 'external' :
|
810
|
-
originalHeight = this.options.dimensions.external.height;
|
811
|
-
originalWidth = this.options.dimensions.external.width;
|
812
|
-
break;
|
813
|
-
|
814
|
-
case 'inline' :
|
815
|
-
originalHeight = this.options.dimensions.inline.height;
|
816
|
-
originalWidth = this.options.dimensions.inline.width;
|
817
|
-
break;
|
818
|
-
|
819
|
-
default :
|
820
|
-
originalHeight = this.options.dimensions.page.height;
|
821
|
-
originalWidth = this.options.dimensions.page.width;
|
822
|
-
break;
|
823
|
-
|
824
|
-
}
|
825
|
-
|
826
|
-
var offsetHeight = this._getParameter('lightwindow_top') ? parseFloat(this._getParameter('lightwindow_top'))+this.pagePosition.y : this.dimensions.viewport.height/2+this.pagePosition.y;
|
827
|
-
var offsetWidth = this._getParameter('lightwindow_left') ? parseFloat(this._getParameter('lightwindow_left'))+this.pagePosition.x : this.dimensions.viewport.width/2+this.pagePosition.x;
|
828
|
-
|
829
|
-
// So if a theme has say shadowed edges, they should be consistant and take care of in the contentOffset
|
830
|
-
$('lightwindow').setStyle({
|
831
|
-
top: offsetHeight+'px',
|
832
|
-
left: offsetWidth+'px'
|
833
|
-
});
|
834
|
-
|
835
|
-
$('lightwindow_container').setStyle({
|
836
|
-
height: originalHeight+'px',
|
837
|
-
width: originalWidth+'px',
|
838
|
-
left: -(originalWidth/2)+'px',
|
839
|
-
top: -(originalHeight/2)+'px'
|
840
|
-
});
|
841
|
-
|
842
|
-
$('lightwindow_contents').setStyle({
|
843
|
-
height: originalHeight+'px',
|
844
|
-
width: originalWidth+'px'
|
845
|
-
});
|
846
|
-
},
|
847
|
-
//
|
848
|
-
// Get the type of file.
|
849
|
-
//
|
850
|
-
_fileType : function(url) {
|
851
|
-
var image = new RegExp("[^\.]\.("+this.options.fileTypes.image.join('|')+")\s*$", "i");
|
852
|
-
if (image.test(url)) return 'image';
|
853
|
-
if (url.indexOf('#') > -1 && (document.domain == this._getDomain(url))) return 'inline';
|
854
|
-
if (url.indexOf('?') > -1) url = url.substring(0, url.indexOf('?'));
|
855
|
-
var type = 'unknown';
|
856
|
-
var page = new RegExp("[^\.]\.("+this.options.fileTypes.page.join('|')+")\s*$", "i");
|
857
|
-
var media = new RegExp("[^\.]\.("+this.options.fileTypes.media.join('|')+")\s*$", "i");
|
858
|
-
if (document.domain != this._getDomain(url)) type = 'external';
|
859
|
-
if (media.test(url)) type = 'media';
|
860
|
-
if (type == 'external' || type == 'media') return type;
|
861
|
-
if (page.test(url) || url.substr((url.length-1), url.length) == '/') type = 'page';
|
862
|
-
return type;
|
863
|
-
},
|
864
|
-
//
|
865
|
-
// Get file Extension
|
866
|
-
//
|
867
|
-
_fileExtension : function(url) {
|
868
|
-
if (url.indexOf('?') > -1) {
|
869
|
-
url = url.substring(0, url.indexOf('?'));
|
870
|
-
}
|
871
|
-
var extenstion = '';
|
872
|
-
for (var x = (url.length-1); x > -1; x--) {
|
873
|
-
if (url.charAt(x) == '.') {
|
874
|
-
return extenstion;
|
875
|
-
}
|
876
|
-
extenstion = url.charAt(x)+extenstion;
|
877
|
-
}
|
878
|
-
},
|
879
|
-
//
|
880
|
-
// Monitor the keyboard while this lightwindow is up
|
881
|
-
//
|
882
|
-
_monitorKeyboard : function(status) {
|
883
|
-
if (status) document.onkeydown = this._eventKeypress.bind(this);
|
884
|
-
else document.onkeydown = '';
|
885
|
-
},
|
886
|
-
//
|
887
|
-
// Perform keyboard actions
|
888
|
-
//
|
889
|
-
_eventKeypress : function(e) {
|
890
|
-
if (e == null) {
|
891
|
-
var keycode = event.keyCode;
|
892
|
-
} else {
|
893
|
-
var keycode = e.which;
|
894
|
-
}
|
895
|
-
|
896
|
-
switch (keycode) {
|
897
|
-
case 27:
|
898
|
-
this.deactivate();
|
899
|
-
break;
|
900
|
-
|
901
|
-
case 13:
|
902
|
-
return;
|
903
|
-
|
904
|
-
default:
|
905
|
-
break;
|
906
|
-
}
|
907
|
-
|
908
|
-
// Gotta stop those quick fingers
|
909
|
-
if (this.animating) {
|
910
|
-
return false;
|
911
|
-
}
|
912
|
-
|
913
|
-
switch (String.fromCharCode(keycode).toLowerCase()) {
|
914
|
-
case 'p':
|
915
|
-
if (this.navigationObservers.previous) {
|
916
|
-
this.navigateWindow('previous');
|
917
|
-
}
|
918
|
-
break;
|
919
|
-
|
920
|
-
case 'n':
|
921
|
-
if (this.navigationObservers.next) {
|
922
|
-
this.navigateWindow('next');
|
923
|
-
}
|
924
|
-
break;
|
925
|
-
|
926
|
-
default:
|
927
|
-
break;
|
928
|
-
}
|
929
|
-
},
|
930
|
-
//
|
931
|
-
// Get Gallery Information
|
932
|
-
//
|
933
|
-
_getGalleryInfo : function(rel) {
|
934
|
-
if (!rel) return false;
|
935
|
-
if (rel.indexOf('[') > -1) {
|
936
|
-
return new Array(escape(rel.substring(0, rel.indexOf('['))), escape(rel.substring(rel.indexOf('[')+1, rel.indexOf(']'))));
|
937
|
-
} else {
|
938
|
-
return false;
|
939
|
-
}
|
940
|
-
},
|
941
|
-
//
|
942
|
-
// Get the domain from a string.
|
943
|
-
//
|
944
|
-
_getDomain : function(url) {
|
945
|
-
var leadSlashes = url.indexOf('//');
|
946
|
-
var domainStart = leadSlashes+2;
|
947
|
-
var withoutResource = url.substring(domainStart, url.length);
|
948
|
-
var nextSlash = withoutResource.indexOf('/');
|
949
|
-
var domain = withoutResource.substring(0, nextSlash);
|
950
|
-
if (domain.indexOf(':') > -1){
|
951
|
-
var portColon = domain.indexOf(':');
|
952
|
-
domain = domain.substring(0, portColon);
|
953
|
-
}
|
954
|
-
return domain;
|
955
|
-
},
|
956
|
-
//
|
957
|
-
// Get the value from the params attribute string.
|
958
|
-
//
|
959
|
-
_getParameter : function(parameter, parameters) {
|
960
|
-
if (!this.element) return false;
|
961
|
-
if (parameter == 'lightwindow_top' && this.element.top) {
|
962
|
-
return unescape(this.element.top);
|
963
|
-
} else if (parameter == 'lightwindow_left' && this.element.left) {
|
964
|
-
return unescape(this.element.left);
|
965
|
-
} else if (parameter == 'lightwindow_type' && this.element.type) {
|
966
|
-
return unescape(this.element.type);
|
967
|
-
} else if (parameter == 'lightwindow_show_images' && this.element.showImages) {
|
968
|
-
return unescape(this.element.showImages);
|
969
|
-
} else if (parameter == 'lightwindow_height' && this.element.height) {
|
970
|
-
return unescape(this.element.height);
|
971
|
-
} else if (parameter == 'lightwindow_width' && this.element.width) {
|
972
|
-
return unescape(this.element.width);
|
973
|
-
} else if (parameter == 'lightwindow_loading_animation' && this.element.loadingAnimation) {
|
974
|
-
return unescape(this.element.loadingAnimation);
|
975
|
-
} else if (parameter == 'lightwindow_iframe_embed' && this.element.iframeEmbed) {
|
976
|
-
return unescape(this.element.iframeEmbed);
|
977
|
-
} else if (parameter == 'lightwindow_form' && this.element.form) {
|
978
|
-
return unescape(this.element.form);
|
979
|
-
} else {
|
980
|
-
if (!parameters) {
|
981
|
-
if (this.element.params) parameters = this.element.params;
|
982
|
-
else return;
|
983
|
-
}
|
984
|
-
var value;
|
985
|
-
var parameterArray = parameters.split(',');
|
986
|
-
var compareString = parameter+'=';
|
987
|
-
var compareLength = compareString.length;
|
988
|
-
for (var i = 0; i < parameterArray.length; i++) {
|
989
|
-
if (parameterArray[i].substr(0, compareLength) == compareString) {
|
990
|
-
var currentParameter = parameterArray[i].split('=');
|
991
|
-
value = currentParameter[1];
|
992
|
-
break;
|
993
|
-
}
|
994
|
-
}
|
995
|
-
if (!value) return false;
|
996
|
-
else return unescape(value);
|
997
|
-
}
|
998
|
-
},
|
999
|
-
//
|
1000
|
-
// Get the Browser Viewport Dimensions
|
1001
|
-
//
|
1002
|
-
_browserDimensions : function() {
|
1003
|
-
if (Prototype.Browser.IE) {
|
1004
|
-
this.dimensions.viewport.height = document.documentElement.clientHeight;
|
1005
|
-
this.dimensions.viewport.width = document.documentElement.clientWidth;
|
1006
|
-
} else {
|
1007
|
-
this.dimensions.viewport.height = window.innerHeight;
|
1008
|
-
this.dimensions.viewport.width = document.width || document.body.offsetWidth;
|
1009
|
-
}
|
1010
|
-
},
|
1011
|
-
//
|
1012
|
-
// Get the scrollbar offset, I don't like this method but there is really no other way I can find.
|
1013
|
-
//
|
1014
|
-
_getScrollerWidth : function() {
|
1015
|
-
var scrollDiv = Element.extend(document.createElement('div'));
|
1016
|
-
scrollDiv.setAttribute('id', 'lightwindow_scroll_div');
|
1017
|
-
scrollDiv.setStyle({
|
1018
|
-
position: 'absolute',
|
1019
|
-
top: '-10000px',
|
1020
|
-
left: '-10000px',
|
1021
|
-
width: '100px',
|
1022
|
-
height: '100px',
|
1023
|
-
overflow: 'hidden'
|
1024
|
-
});
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
var contentDiv = Element.extend(document.createElement('div'));
|
1029
|
-
contentDiv.setAttribute('id', 'lightwindow_content_scroll_div');
|
1030
|
-
contentDiv.setStyle({
|
1031
|
-
width: '100%',
|
1032
|
-
height: '200px'
|
1033
|
-
});
|
1034
|
-
|
1035
|
-
scrollDiv.appendChild(contentDiv);
|
1036
|
-
|
1037
|
-
var body = document.getElementsByTagName('body')[0];
|
1038
|
-
body.appendChild(scrollDiv);
|
1039
|
-
|
1040
|
-
var noScroll = $('lightwindow_content_scroll_div').offsetWidth;
|
1041
|
-
scrollDiv.style.overflow = 'auto';
|
1042
|
-
var withScroll = $('lightwindow_content_scroll_div').offsetWidth;
|
1043
|
-
|
1044
|
-
Element.remove($('lightwindow_scroll_div'));
|
1045
|
-
|
1046
|
-
this.scrollbarOffset = noScroll-withScroll;
|
1047
|
-
},
|
1048
|
-
|
1049
|
-
|
1050
|
-
//
|
1051
|
-
// Add a param to an object dynamically created
|
1052
|
-
//
|
1053
|
-
_addParamToObject : function(name, value, object, id) {
|
1054
|
-
var param = document.createElement('param');
|
1055
|
-
param.setAttribute('value', value);
|
1056
|
-
param.setAttribute('name', name);
|
1057
|
-
if (id) {
|
1058
|
-
param.setAttribute('id', id);
|
1059
|
-
}
|
1060
|
-
object.appendChild(param);
|
1061
|
-
return object;
|
1062
|
-
},
|
1063
|
-
//
|
1064
|
-
// Get the outer HTML of an object CROSS BROWSER
|
1065
|
-
//
|
1066
|
-
_outerHTML : function(object) {
|
1067
|
-
if (Prototype.Browser.IE) {
|
1068
|
-
return object.outerHTML;
|
1069
|
-
} else {
|
1070
|
-
var clone = object.cloneNode(true);
|
1071
|
-
var cloneDiv = document.createElement('div');
|
1072
|
-
cloneDiv.appendChild(clone);
|
1073
|
-
return cloneDiv.innerHTML;
|
1074
|
-
}
|
1075
|
-
},
|
1076
|
-
//
|
1077
|
-
// Convert an object to markup
|
1078
|
-
//
|
1079
|
-
_convertToMarkup : function(object, closeTag) {
|
1080
|
-
var markup = this._outerHTML(object).replace('</'+closeTag+'>', '');
|
1081
|
-
if (Prototype.Browser.IE) {
|
1082
|
-
for (var i = 0; i < object.childNodes.length; i++){
|
1083
|
-
markup += this._outerHTML(object.childNodes[i]);
|
1084
|
-
}
|
1085
|
-
markup += '</'+closeTag+'>';
|
1086
|
-
}
|
1087
|
-
return markup;
|
1088
|
-
},
|
1089
|
-
//
|
1090
|
-
// Depending what type of browser it is we have to append the object differently... DAMN YOU IE!!
|
1091
|
-
//
|
1092
|
-
_appendObject : function(object, closeTag, appendTo) {
|
1093
|
-
if (Prototype.Browser.IE) {
|
1094
|
-
appendTo.innerHTML += this._convertToMarkup(object, closeTag);
|
1095
|
-
|
1096
|
-
// Fix the Eolas activate thing but only for specified media, for example doing this to a quicktime film breaks it.
|
1097
|
-
if (this.options.EOLASFix.indexOf(this._fileType(this.element.href)) > -1) {
|
1098
|
-
var objectElements = document.getElementsByTagName('object');
|
1099
|
-
for (var i = 0; i < objectElements.length; i++) {
|
1100
|
-
if (objectElements[i].getAttribute("data")) objectElements[i].removeAttribute('data');
|
1101
|
-
objectElements[i].outerHTML = objectElements[i].outerHTML;
|
1102
|
-
objectElements[i].style.visibility = "visible";
|
1103
|
-
}
|
1104
|
-
}
|
1105
|
-
} else {
|
1106
|
-
appendTo.appendChild(object);
|
1107
|
-
}
|
1108
|
-
},
|
1109
|
-
//
|
1110
|
-
// Add in iframe
|
1111
|
-
//
|
1112
|
-
_appendIframe : function(scroll) {
|
1113
|
-
var iframe = document.createElement('iframe');
|
1114
|
-
iframe.setAttribute('id', 'lightwindow_iframe');
|
1115
|
-
iframe.setAttribute('name', 'lightwindow_iframe');
|
1116
|
-
iframe.setAttribute('src', 'about:blank');
|
1117
|
-
iframe.setAttribute('height', '100%');
|
1118
|
-
iframe.setAttribute('width', '100%');
|
1119
|
-
iframe.setAttribute('frameborder', '0');
|
1120
|
-
iframe.setAttribute('marginwidth', '0');
|
1121
|
-
iframe.setAttribute('marginheight', '0');
|
1122
|
-
iframe.setAttribute('scrolling', scroll);
|
1123
|
-
|
1124
|
-
this._appendObject(iframe, 'iframe', $('lightwindow_contents'));
|
1125
|
-
},
|
1126
|
-
//
|
1127
|
-
// Write Content to the iframe using the skin
|
1128
|
-
//
|
1129
|
-
_writeToIframe : function(content) {
|
1130
|
-
var template = this.options.skin.iframe;
|
1131
|
-
template = template.replace('{body_replace}', content);
|
1132
|
-
if ($('lightwindow_iframe').contentWindow){
|
1133
|
-
$('lightwindow_iframe').contentWindow.document.open();
|
1134
|
-
$('lightwindow_iframe').contentWindow.document.write(template);
|
1135
|
-
$('lightwindow_iframe').contentWindow.document.close();
|
1136
|
-
} else {
|
1137
|
-
$('lightwindow_iframe').contentDocument.open();
|
1138
|
-
$('lightwindow_iframe').contentDocument.write(template);
|
1139
|
-
$('lightwindow_iframe').contentDocument.close();
|
1140
|
-
}
|
1141
|
-
},
|
1142
|
-
//
|
1143
|
-
// Load the window Information
|
1144
|
-
//
|
1145
|
-
_loadWindow : function() {
|
1146
|
-
switch (this.windowType) {
|
1147
|
-
case 'image' :
|
1148
|
-
|
1149
|
-
var current = 0;
|
1150
|
-
var images = [];
|
1151
|
-
this.checkImage = [];
|
1152
|
-
this.resizeTo.height = this.resizeTo.width = 0;
|
1153
|
-
this.imageCount = this._getParameter('lightwindow_show_images') ? parseInt(this._getParameter('lightwindow_show_images')) : 1;
|
1154
|
-
|
1155
|
-
// If there is a gallery get it
|
1156
|
-
if (gallery = this._getGalleryInfo(this.element.rel)) {
|
1157
|
-
for (current = 0; current < this.galleries[gallery[0]][gallery[1]].length; current++) {
|
1158
|
-
if (this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][current].href) > -1) {
|
1159
|
-
break;
|
1160
|
-
}
|
1161
|
-
}
|
1162
|
-
if (this.galleries[gallery[0]][gallery[1]][current-this.imageCount]) {
|
1163
|
-
this.navigationObservers.previous = this.galleries[gallery[0]][gallery[1]][current-this.imageCount];
|
1164
|
-
} else {
|
1165
|
-
this.navigationObservers.previous = false;
|
1166
|
-
}
|
1167
|
-
if (this.galleries[gallery[0]][gallery[1]][current+this.imageCount]) {
|
1168
|
-
this.navigationObservers.next = this.galleries[gallery[0]][gallery[1]][current+this.imageCount];
|
1169
|
-
} else {
|
1170
|
-
this.navigationObservers.next = false;
|
1171
|
-
}
|
1172
|
-
|
1173
|
-
this.activeGallery = true;
|
1174
|
-
} else {
|
1175
|
-
this.navigationObservers.previous = false;
|
1176
|
-
this.navigationObservers.next = false;
|
1177
|
-
|
1178
|
-
this.activeGallery = false;
|
1179
|
-
}
|
1180
|
-
|
1181
|
-
for (var i = current; i < (current+this.imageCount); i++) {
|
1182
|
-
|
1183
|
-
if (gallery && this.galleries[gallery[0]][gallery[1]][i]) {
|
1184
|
-
this.contentToFetch = this.galleries[gallery[0]][gallery[1]][i].href;
|
1185
|
-
|
1186
|
-
this.galleryLocation = {current: (i+1)/this.imageCount, total: (this.galleries[gallery[0]][gallery[1]].length)/this.imageCount};
|
1187
|
-
|
1188
|
-
if (!this.galleries[gallery[0]][gallery[1]][i+this.imageCount]) {
|
1189
|
-
$('lightwindow_next').setStyle({
|
1190
|
-
display: 'none'
|
1191
|
-
});
|
1192
|
-
} else {
|
1193
|
-
$('lightwindow_next').setStyle({
|
1194
|
-
display: 'block'
|
1195
|
-
});
|
1196
|
-
$('lightwindow_next_title').innerHTML = this.galleries[gallery[0]][gallery[1]][i+this.imageCount].title;
|
1197
|
-
}
|
1198
|
-
|
1199
|
-
if (!this.galleries[gallery[0]][gallery[1]][i-this.imageCount]) {
|
1200
|
-
$('lightwindow_previous').setStyle({
|
1201
|
-
display: 'none'
|
1202
|
-
});
|
1203
|
-
} else {
|
1204
|
-
$('lightwindow_previous').setStyle({
|
1205
|
-
display: 'block'
|
1206
|
-
});
|
1207
|
-
$('lightwindow_previous_title').innerHTML = this.galleries[gallery[0]][gallery[1]][i-this.imageCount].title;
|
1208
|
-
}
|
1209
|
-
}
|
1210
|
-
|
1211
|
-
images[i] = document.createElement('img');
|
1212
|
-
images[i].setAttribute('id', 'lightwindow_image_'+i);
|
1213
|
-
images[i].setAttribute('border', '0');
|
1214
|
-
images[i].setAttribute('src', this.contentToFetch);
|
1215
|
-
$('lightwindow_contents').appendChild(images[i]);
|
1216
|
-
|
1217
|
-
// We have to do this instead of .onload
|
1218
|
-
this.checkImage[i] = new PeriodicalExecuter(function(i) {
|
1219
|
-
if (!(typeof $('lightwindow_image_'+i).naturalWidth != "undefined" && $('lightwindow_image_'+i).naturalWidth == 0)) {
|
1220
|
-
|
1221
|
-
this.checkImage[i].stop();
|
1222
|
-
|
1223
|
-
var imageHeight = $('lightwindow_image_'+i).getHeight();
|
1224
|
-
if (imageHeight > this.resizeTo.height) {
|
1225
|
-
this.resizeTo.height = imageHeight;
|
1226
|
-
}
|
1227
|
-
this.resizeTo.width += $('lightwindow_image_'+i).getWidth();
|
1228
|
-
this.imageCount--;
|
1229
|
-
|
1230
|
-
$('lightwindow_image_'+i).setStyle({
|
1231
|
-
height: '100%'
|
1232
|
-
});
|
1233
|
-
|
1234
|
-
if (this.imageCount == 0) {
|
1235
|
-
this._processWindow();
|
1236
|
-
}
|
1237
|
-
}
|
1238
|
-
|
1239
|
-
}.bind(this, i), 1);
|
1240
|
-
}
|
1241
|
-
|
1242
|
-
|
1243
|
-
break;
|
1244
|
-
|
1245
|
-
case 'media' :
|
1246
|
-
|
1247
|
-
var current = 0;
|
1248
|
-
this.resizeTo.height = this.resizeTo.width = 0;
|
1249
|
-
|
1250
|
-
// If there is a gallery get it
|
1251
|
-
if (gallery = this._getGalleryInfo(this.element.rel)) {
|
1252
|
-
for (current = 0; current < this.galleries[gallery[0]][gallery[1]].length; current++) {
|
1253
|
-
if (this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][current].href) > -1) {
|
1254
|
-
break;
|
1255
|
-
}
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
if (this.galleries[gallery[0]][gallery[1]][current-1]) {
|
1259
|
-
this.navigationObservers.previous = this.galleries[gallery[0]][gallery[1]][current-1];
|
1260
|
-
} else {
|
1261
|
-
this.navigationObservers.previous = false;
|
1262
|
-
}
|
1263
|
-
if (this.galleries[gallery[0]][gallery[1]][current+1]) {
|
1264
|
-
this.navigationObservers.next = this.galleries[gallery[0]][gallery[1]][current+1];
|
1265
|
-
} else {
|
1266
|
-
this.navigationObservers.next = false;
|
1267
|
-
}
|
1268
|
-
|
1269
|
-
this.activeGallery = true;
|
1270
|
-
} else {
|
1271
|
-
this.navigationObservers.previous = false;
|
1272
|
-
this.navigationObservers.next = false;
|
1273
|
-
|
1274
|
-
this.activeGallery = false;
|
1275
|
-
}
|
1276
|
-
|
1277
|
-
|
1278
|
-
if (gallery && this.galleries[gallery[0]][gallery[1]][current]) {
|
1279
|
-
this.contentToFetch = this.galleries[gallery[0]][gallery[1]][current].href;
|
1280
|
-
|
1281
|
-
this.galleryLocation = {current: current+1, total: this.galleries[gallery[0]][gallery[1]].length};
|
1282
|
-
|
1283
|
-
if (!this.galleries[gallery[0]][gallery[1]][current+1]) {
|
1284
|
-
$('lightwindow_next').setStyle({
|
1285
|
-
display: 'none'
|
1286
|
-
});
|
1287
|
-
} else {
|
1288
|
-
$('lightwindow_next').setStyle({
|
1289
|
-
display: 'block'
|
1290
|
-
});
|
1291
|
-
$('lightwindow_next_title').innerHTML = this.galleries[gallery[0]][gallery[1]][current+1].title;
|
1292
|
-
}
|
1293
|
-
|
1294
|
-
if (!this.galleries[gallery[0]][gallery[1]][current-1]) {
|
1295
|
-
$('lightwindow_previous').setStyle({
|
1296
|
-
display: 'none'
|
1297
|
-
});
|
1298
|
-
} else {
|
1299
|
-
$('lightwindow_previous').setStyle({
|
1300
|
-
display: 'block'
|
1301
|
-
});
|
1302
|
-
$('lightwindow_previous_title').innerHTML = this.galleries[gallery[0]][gallery[1]][current-1].title;
|
1303
|
-
}
|
1304
|
-
}
|
1305
|
-
|
1306
|
-
if (this._getParameter('lightwindow_iframe_embed')) {
|
1307
|
-
this.resizeTo.height = this.dimensions.viewport.height;
|
1308
|
-
this.resizeTo.width = this.dimensions.viewport.width;
|
1309
|
-
} else {
|
1310
|
-
this.resizeTo.height = this._getParameter('lightwindow_height');
|
1311
|
-
this.resizeTo.width = this._getParameter('lightwindow_width');
|
1312
|
-
}
|
1313
|
-
|
1314
|
-
this._processWindow();
|
1315
|
-
|
1316
|
-
break;
|
1317
|
-
|
1318
|
-
case 'external' :
|
1319
|
-
|
1320
|
-
this._appendIframe('auto');
|
1321
|
-
|
1322
|
-
this.resizeTo.height = this.dimensions.viewport.height;
|
1323
|
-
this.resizeTo.width = this.dimensions.viewport.width;
|
1324
|
-
|
1325
|
-
this._processWindow();
|
1326
|
-
|
1327
|
-
break;
|
1328
|
-
|
1329
|
-
case 'page' :
|
1330
|
-
|
1331
|
-
var newAJAX = new Ajax.Request(
|
1332
|
-
this.contentToFetch, {
|
1333
|
-
method: 'get',
|
1334
|
-
parameters: '',
|
1335
|
-
onComplete: function(response) {
|
1336
|
-
$('lightwindow_contents').innerHTML += response.responseText;
|
1337
|
-
this.resizeTo.height = $('lightwindow_contents').scrollHeight+(this.options.contentOffset.height);
|
1338
|
-
this.resizeTo.width = $('lightwindow_contents').scrollWidth+(this.options.contentOffset.width);
|
1339
|
-
this._processWindow();
|
1340
|
-
}.bind(this)
|
1341
|
-
}
|
1342
|
-
);
|
1343
|
-
|
1344
|
-
break;
|
1345
|
-
|
1346
|
-
case 'inline' :
|
1347
|
-
|
1348
|
-
var content = this.contentToFetch;
|
1349
|
-
if (content.indexOf('?') > -1) {
|
1350
|
-
content = content.substring(0, content.indexOf('?'));
|
1351
|
-
}
|
1352
|
-
content = content.substring(content.indexOf('#')+1);
|
1353
|
-
|
1354
|
-
new Insertion.Top($('lightwindow_contents'), $(content).innerHTML);
|
1355
|
-
|
1356
|
-
this.resizeTo.height = $('lightwindow_contents').scrollHeight+(this.options.contentOffset.height);
|
1357
|
-
this.resizeTo.width = $('lightwindow_contents').scrollWidth+(this.options.contentOffset.width);
|
1358
|
-
|
1359
|
-
this._toggleTroubleElements('hidden', true);
|
1360
|
-
this._processWindow();
|
1361
|
-
|
1362
|
-
break;
|
1363
|
-
|
1364
|
-
default :
|
1365
|
-
throw("Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch);
|
1366
|
-
break;
|
1367
|
-
}
|
1368
|
-
},
|
1369
|
-
//
|
1370
|
-
// Resize the Window to fit the viewport if necessary
|
1371
|
-
//
|
1372
|
-
_resizeWindowToFit : function() {
|
1373
|
-
if (this.resizeTo.height+this.dimensions.cruft.height > this.dimensions.viewport.height) {
|
1374
|
-
var heightRatio = this.resizeTo.height/this.resizeTo.width;
|
1375
|
-
this.resizeTo.height = this.dimensions.viewport.height-this.dimensions.cruft.height-(2*this.options.viewportPadding);
|
1376
|
-
// We only care about ratio's with this window type
|
1377
|
-
if (this.windowType == 'image' || (this.windowType == 'media' && !this._getParameter('lightwindow_iframe_embed'))) {
|
1378
|
-
this.resizeTo.width = this.resizeTo.height/heightRatio;
|
1379
|
-
$('lightwindow_data_slide_inner').setStyle({
|
1380
|
-
width: this.resizeTo.width+'px'
|
1381
|
-
});
|
1382
|
-
}
|
1383
|
-
}
|
1384
|
-
if (this.resizeTo.width+this.dimensions.cruft.width > this.dimensions.viewport.width) {
|
1385
|
-
var widthRatio = this.resizeTo.width/this.resizeTo.height;
|
1386
|
-
this.resizeTo.width = this.dimensions.viewport.width-2*this.dimensions.cruft.width-(2*this.options.viewportPadding);
|
1387
|
-
// We only care about ratio's with this window type
|
1388
|
-
if (this.windowType == 'image' || (this.windowType == 'media' && !this._getParameter('lightwindow_iframe_embed'))) {
|
1389
|
-
this.resizeTo.height = this.resizeTo.width/widthRatio;
|
1390
|
-
$('lightwindow_data_slide_inner').setStyle({
|
1391
|
-
height: this.resizeTo.height+'px'
|
1392
|
-
});
|
1393
|
-
}
|
1394
|
-
}
|
1395
|
-
|
1396
|
-
},
|
1397
|
-
//
|
1398
|
-
// Set the Window to a preset size
|
1399
|
-
//
|
1400
|
-
_presetWindowSize : function() {
|
1401
|
-
if (this._getParameter('lightwindow_height')) {
|
1402
|
-
this.resizeTo.height = parseFloat(this._getParameter('lightwindow_height'));
|
1403
|
-
}
|
1404
|
-
if (this._getParameter('lightwindow_width')) {
|
1405
|
-
this.resizeTo.width = parseFloat(this._getParameter('lightwindow_width'));
|
1406
|
-
}
|
1407
|
-
},
|
1408
|
-
//
|
1409
|
-
// Process the Window
|
1410
|
-
//
|
1411
|
-
_processWindow : function() {
|
1412
|
-
// Clean out our effects
|
1413
|
-
this.dimensions.dataEffects = [];
|
1414
|
-
|
1415
|
-
// Set up the data-slide if we have caption information
|
1416
|
-
if (this.element.caption || this.element.author || (this.activeGallery && this.options.showGalleryCount)) {
|
1417
|
-
if (this.element.caption) {
|
1418
|
-
$('lightwindow_data_caption').innerHTML = this.element.caption;
|
1419
|
-
$('lightwindow_data_caption').setStyle({
|
1420
|
-
display: 'block'
|
1421
|
-
});
|
1422
|
-
} else {
|
1423
|
-
$('lightwindow_data_caption').setStyle({
|
1424
|
-
display: 'none'
|
1425
|
-
});
|
1426
|
-
}
|
1427
|
-
if (this.element.author) {
|
1428
|
-
$('lightwindow_data_author').innerHTML = this.element.author;
|
1429
|
-
$('lightwindow_data_author_container').setStyle({
|
1430
|
-
display: 'block'
|
1431
|
-
});
|
1432
|
-
} else {
|
1433
|
-
$('lightwindow_data_author_container').setStyle({
|
1434
|
-
display: 'none'
|
1435
|
-
});
|
1436
|
-
}
|
1437
|
-
if (this.activeGallery && this.options.showGalleryCount) {
|
1438
|
-
$('lightwindow_data_gallery_current').innerHTML = this.galleryLocation.current;
|
1439
|
-
$('lightwindow_data_gallery_total').innerHTML = this.galleryLocation.total;
|
1440
|
-
$('lightwindow_data_gallery_container').setStyle({
|
1441
|
-
display: 'block'
|
1442
|
-
});
|
1443
|
-
} else {
|
1444
|
-
$('lightwindow_data_gallery_container').setStyle({
|
1445
|
-
display: 'none'
|
1446
|
-
});
|
1447
|
-
}
|
1448
|
-
|
1449
|
-
$('lightwindow_data_slide_inner').setStyle({
|
1450
|
-
width: this.resizeTo.width+'px',
|
1451
|
-
height: 'auto',
|
1452
|
-
visibility: 'visible',
|
1453
|
-
display: 'block'
|
1454
|
-
});
|
1455
|
-
$('lightwindow_data_slide').setStyle({
|
1456
|
-
height: $('lightwindow_data_slide').getHeight()+'px',
|
1457
|
-
width: '1px',
|
1458
|
-
overflow: 'hidden',
|
1459
|
-
display: 'block'
|
1460
|
-
});
|
1461
|
-
} else {
|
1462
|
-
$('lightwindow_data_slide').setStyle({
|
1463
|
-
display: 'none',
|
1464
|
-
width: 'auto'
|
1465
|
-
});
|
1466
|
-
$('lightwindow_data_slide_inner').setStyle({
|
1467
|
-
display: 'none',
|
1468
|
-
visibility: 'hidden',
|
1469
|
-
width: this.resizeTo.width+'px',
|
1470
|
-
height: '0px'
|
1471
|
-
});
|
1472
|
-
}
|
1473
|
-
|
1474
|
-
if (this.element.title != 'null') {
|
1475
|
-
$('lightwindow_title_bar_title').innerHTML = this.element.title;
|
1476
|
-
} else {
|
1477
|
-
$('lightwindow_title_bar_title').innerHTML = '';
|
1478
|
-
}
|
1479
|
-
|
1480
|
-
var originalContainerDimensions = {height: $('lightwindow_container').getHeight(), width: $('lightwindow_container').getWidth()};
|
1481
|
-
// Position the window
|
1482
|
-
$('lightwindow_container').setStyle({
|
1483
|
-
height: 'auto',
|
1484
|
-
// We need to set the width to a px not auto as opera has problems with it
|
1485
|
-
width: $('lightwindow_container').getWidth()+this.options.contentOffset.width-(this.windowActive ? this.options.contentOffset.width : 0)+'px'
|
1486
|
-
});
|
1487
|
-
var newContainerDimensions = {height: $('lightwindow_container').getHeight(), width: $('lightwindow_container').getWidth()};
|
1488
|
-
|
1489
|
-
// We need to record the container dimension changes
|
1490
|
-
this.containerChange = {height: originalContainerDimensions.height-newContainerDimensions.height, width: originalContainerDimensions.width-newContainerDimensions.width};
|
1491
|
-
|
1492
|
-
// Get out general dimensions
|
1493
|
-
this.dimensions.container = {height: $('lightwindow_container').getHeight(), width: $('lightwindow_container').getWidth()};
|
1494
|
-
this.dimensions.cruft = {height: this.dimensions.container.height-$('lightwindow_contents').getHeight()+this.options.contentOffset.height, width: this.dimensions.container.width-$('lightwindow_contents').getWidth()+this.options.contentOffset.width};
|
1495
|
-
|
1496
|
-
// Set Sizes if we need too
|
1497
|
-
this._presetWindowSize();
|
1498
|
-
this._resizeWindowToFit(); // Even if the window is preset we still don't want it to go outside of the viewport
|
1499
|
-
|
1500
|
-
if (!this.windowActive) {
|
1501
|
-
// Position the window
|
1502
|
-
$('lightwindow_container').setStyle({
|
1503
|
-
left: -(this.dimensions.container.width/2)+'px',
|
1504
|
-
top: -(this.dimensions.container.height/2)+'px'
|
1505
|
-
});
|
1506
|
-
}
|
1507
|
-
$('lightwindow_container').setStyle({
|
1508
|
-
height: this.dimensions.container.height+'px',
|
1509
|
-
width: this.dimensions.container.width+'px'
|
1510
|
-
});
|
1511
|
-
|
1512
|
-
// We are ready, lets show this puppy off!
|
1513
|
-
this._displayLightWindow('block', 'visible');
|
1514
|
-
this._animateLightWindow();
|
1515
|
-
},
|
1516
|
-
//
|
1517
|
-
// Fire off our animation handler
|
1518
|
-
//
|
1519
|
-
_animateLightWindow : function() {
|
1520
|
-
if (this.options.animationHandler) {
|
1521
|
-
this.options.animationHandler().bind(this);
|
1522
|
-
} else {
|
1523
|
-
this._defaultAnimationHandler();
|
1524
|
-
}
|
1525
|
-
},
|
1526
|
-
//
|
1527
|
-
// Fire off our transition handler
|
1528
|
-
//
|
1529
|
-
_handleNavigation : function(display) {
|
1530
|
-
if (this.options.navigationHandler) {
|
1531
|
-
this.options.navigationHandler().bind(this, display);
|
1532
|
-
} else {
|
1533
|
-
this._defaultDisplayNavigation(display);
|
1534
|
-
}
|
1535
|
-
},
|
1536
|
-
//
|
1537
|
-
// Fire off our transition handler
|
1538
|
-
//
|
1539
|
-
_handleTransition : function() {
|
1540
|
-
if (this.options.transitionHandler) {
|
1541
|
-
this.options.transitionHandler().bind(this);
|
1542
|
-
} else {
|
1543
|
-
this._defaultTransitionHandler();
|
1544
|
-
}
|
1545
|
-
},
|
1546
|
-
//
|
1547
|
-
// Handle the finish of the window animation
|
1548
|
-
//
|
1549
|
-
_handleFinalWindowAnimation : function(delay) {
|
1550
|
-
if (this.options.finalAnimationHandler) {
|
1551
|
-
this.options.finalAnimationHandler().bind(this, delay);
|
1552
|
-
} else {
|
1553
|
-
this._defaultfinalWindowAnimationHandler(delay);
|
1554
|
-
}
|
1555
|
-
},
|
1556
|
-
//
|
1557
|
-
// Handle the gallery Animation
|
1558
|
-
//
|
1559
|
-
_handleGalleryAnimation : function(list) {
|
1560
|
-
if (this.options.galleryAnimationHandler) {
|
1561
|
-
this.options.galleryAnimationHandler().bind(this, list);
|
1562
|
-
} else {
|
1563
|
-
this._defaultGalleryAnimationHandler(list);
|
1564
|
-
}
|
1565
|
-
},
|
1566
|
-
//
|
1567
|
-
// Display the navigation
|
1568
|
-
//
|
1569
|
-
_defaultDisplayNavigation : function(display) {
|
1570
|
-
if (display) {
|
1571
|
-
$('lightwindow_navigation').setStyle({
|
1572
|
-
display: 'block',
|
1573
|
-
height: $('lightwindow_contents').getHeight()+'px',
|
1574
|
-
width: '100%',
|
1575
|
-
marginTop: this.options.dimensions.titleHeight+'px'
|
1576
|
-
});
|
1577
|
-
} else {
|
1578
|
-
$('lightwindow_navigation').setStyle({
|
1579
|
-
display: 'none',
|
1580
|
-
height: 'auto',
|
1581
|
-
width: 'auto'
|
1582
|
-
});
|
1583
|
-
}
|
1584
|
-
},
|
1585
|
-
//
|
1586
|
-
// This is the default animation handler for LightWindow
|
1587
|
-
//
|
1588
|
-
_defaultAnimationHandler : function() {
|
1589
|
-
// Now that we have figures out the cruft lets make the caption go away and add its effects
|
1590
|
-
if (this.element.caption || this.element.author || (this.activeGallery && this.options.showGalleryCount)) {
|
1591
|
-
$('lightwindow_data_slide').setStyle({
|
1592
|
-
display: 'none',
|
1593
|
-
width: 'auto'
|
1594
|
-
});
|
1595
|
-
this.dimensions.dataEffects.push(
|
1596
|
-
new Effect.SlideDown('lightwindow_data_slide', {sync: true}),
|
1597
|
-
new Effect.Appear('lightwindow_data_slide', {sync: true, from: 0.0, to: 1.0})
|
1598
|
-
);
|
1599
|
-
}
|
1600
|
-
|
1601
|
-
// Set up the Title if we have one
|
1602
|
-
$('lightwindow_title_bar_inner').setStyle({
|
1603
|
-
height: '0px',
|
1604
|
-
marginTop: this.options.dimensions.titleHeight+'px'
|
1605
|
-
});
|
1606
|
-
|
1607
|
-
// We always want the title bar as well
|
1608
|
-
this.dimensions.dataEffects.push(
|
1609
|
-
new Effect.Morph('lightwindow_title_bar_inner', {sync: true, style: {height: this.options.dimensions.titleHeight+'px', marginTop: '0px'}}),
|
1610
|
-
new Effect.Appear('lightwindow_title_bar_inner', {sync: true, from: 0.0, to: 1.0})
|
1611
|
-
);
|
1612
|
-
|
1613
|
-
if (!this.options.hideGalleryTab) {
|
1614
|
-
this._handleGalleryAnimation(false);
|
1615
|
-
if ($('lightwindow_galleries_tab_container').getHeight() == 0) {
|
1616
|
-
this.dimensions.dataEffects.push(
|
1617
|
-
new Effect.Morph('lightwindow_galleries_tab_container', {sync: true, style: {height: '20px', marginTop: '0px'}})
|
1618
|
-
);
|
1619
|
-
$('lightwindow_galleries').setStyle({
|
1620
|
-
width: '0px'
|
1621
|
-
});
|
1622
|
-
}
|
1623
|
-
}
|
1624
|
-
|
1625
|
-
var resized = false;
|
1626
|
-
var ratio = this.dimensions.container.width-$('lightwindow_contents').getWidth()+this.resizeTo.width+this.options.contentOffset.width;
|
1627
|
-
if (ratio != $('lightwindow_container').getWidth()) {
|
1628
|
-
new Effect.Parallel([
|
1629
|
-
new Effect.Scale('lightwindow_contents', 100*(this.resizeTo.width/$('lightwindow_contents').getWidth()), {scaleFrom: 100*($('lightwindow_contents').getWidth()/($('lightwindow_contents').getWidth()+(this.options.contentOffset.width))), sync: true, scaleY: false, scaleContent: false}),
|
1630
|
-
new Effect.Scale('lightwindow_container', 100*(ratio/(this.dimensions.container.width)), {sync: true, scaleY: false, scaleFromCenter: true, scaleContent: false})
|
1631
|
-
], {
|
1632
|
-
duration: this.duration,
|
1633
|
-
delay: 0.25,
|
1634
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1635
|
-
}
|
1636
|
-
);
|
1637
|
-
}
|
1638
|
-
|
1639
|
-
ratio = this.dimensions.container.height-$('lightwindow_contents').getHeight()+this.resizeTo.height+this.options.contentOffset.height;
|
1640
|
-
if (ratio != $('lightwindow_container').getHeight()) {
|
1641
|
-
new Effect.Parallel([
|
1642
|
-
new Effect.Scale('lightwindow_contents', 100*(this.resizeTo.height/$('lightwindow_contents').getHeight()), {scaleFrom: 100*($('lightwindow_contents').getHeight()/($('lightwindow_contents').getHeight()+(this.options.contentOffset.height))), sync: true, scaleX: false, scaleContent: false}),
|
1643
|
-
new Effect.Scale('lightwindow_container', 100*(ratio/(this.dimensions.container.height)), {sync: true, scaleX: false, scaleFromCenter: true, scaleContent: false})
|
1644
|
-
], {
|
1645
|
-
duration: this.duration,
|
1646
|
-
afterFinish: function() {
|
1647
|
-
if (this.dimensions.dataEffects.length > 0) {
|
1648
|
-
if (!this.options.hideGalleryTab) {
|
1649
|
-
$('lightwindow_galleries').setStyle({
|
1650
|
-
width: this.resizeTo.width+'px'
|
1651
|
-
});
|
1652
|
-
}
|
1653
|
-
new Effect.Parallel(this.dimensions.dataEffects, {
|
1654
|
-
duration: this.duration,
|
1655
|
-
afterFinish: function() {
|
1656
|
-
this._finishWindow();
|
1657
|
-
}.bind(this),
|
1658
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1659
|
-
}
|
1660
|
-
);
|
1661
|
-
}
|
1662
|
-
}.bind(this),
|
1663
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1664
|
-
}
|
1665
|
-
);
|
1666
|
-
resized = true;
|
1667
|
-
}
|
1668
|
-
|
1669
|
-
// We need to do our data effect since there was no resizing
|
1670
|
-
if (!resized && this.dimensions.dataEffects.length > 0) {
|
1671
|
-
new Effect.Parallel(this.dimensions.dataEffects, {
|
1672
|
-
duration: this.duration,
|
1673
|
-
beforeStart: function() {
|
1674
|
-
if (!this.options.hideGalleryTab) {
|
1675
|
-
$('lightwindow_galleries').setStyle({
|
1676
|
-
width: this.resizeTo.width+'px'
|
1677
|
-
});
|
1678
|
-
}
|
1679
|
-
if (this.containerChange.height != 0 || this.containerChange.width != 0) {
|
1680
|
-
new Effect.MoveBy('lightwindow_container', this.containerChange.height, this.containerChange.width, {transition: Effect.Transitions.sinoidal});
|
1681
|
-
}
|
1682
|
-
}.bind(this),
|
1683
|
-
afterFinish: function() {
|
1684
|
-
this._finishWindow();
|
1685
|
-
}.bind(this),
|
1686
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1687
|
-
}
|
1688
|
-
);
|
1689
|
-
}
|
1690
|
-
|
1691
|
-
},
|
1692
|
-
//
|
1693
|
-
// Finish up Window Animation
|
1694
|
-
//
|
1695
|
-
_defaultfinalWindowAnimationHandler : function(delay) {
|
1696
|
-
if (this.windowType == 'media' || this._getParameter('lightwindow_loading_animation')) {
|
1697
|
-
// Because of major flickering with the overlay we just hide it in this case
|
1698
|
-
Element.hide('lightwindow_loading');
|
1699
|
-
this._handleNavigation(this.activeGallery);
|
1700
|
-
this._setStatus(false);
|
1701
|
-
} else {
|
1702
|
-
Effect.Fade('lightwindow_loading', {
|
1703
|
-
duration: 0.75,
|
1704
|
-
delay: 1.0,
|
1705
|
-
afterFinish: function() {
|
1706
|
-
// Just in case we need some scroll goodness (this also avoids the swiss cheese effect)
|
1707
|
-
if (this.windowType != 'image' && this.windowType != 'media' && this.windowType != 'external') {
|
1708
|
-
$('lightwindow_contents').setStyle({
|
1709
|
-
overflow: 'auto'
|
1710
|
-
});
|
1711
|
-
}
|
1712
|
-
this._handleNavigation(this.activeGallery);
|
1713
|
-
this._defaultGalleryAnimationHandler();
|
1714
|
-
this._setStatus(false);
|
1715
|
-
}.bind(this),
|
1716
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1717
|
-
});
|
1718
|
-
}
|
1719
|
-
},
|
1720
|
-
//
|
1721
|
-
// Handle the gallery Animation
|
1722
|
-
//
|
1723
|
-
_defaultGalleryAnimationHandler : function(list) {
|
1724
|
-
if (this.activeGallery) {
|
1725
|
-
$('lightwindow_galleries').setStyle({
|
1726
|
-
display: 'block',
|
1727
|
-
marginBottom: $('lightwindow_data_slide').getHeight()+this.options.contentOffset.height/2+'px'
|
1728
|
-
});
|
1729
|
-
$('lightwindow_navigation').setStyle({
|
1730
|
-
height: $('lightwindow_contents').getHeight()-20+'px'
|
1731
|
-
});
|
1732
|
-
} else {
|
1733
|
-
$('lightwindow_galleries').setStyle({
|
1734
|
-
display: 'none'
|
1735
|
-
});
|
1736
|
-
$('lightwindow_galleries_tab_container').setStyle({
|
1737
|
-
height: '0px',
|
1738
|
-
marginTop: '20px'
|
1739
|
-
});
|
1740
|
-
$('lightwindow_galleries_list').setStyle({
|
1741
|
-
height: '0px'
|
1742
|
-
});
|
1743
|
-
return false;
|
1744
|
-
}
|
1745
|
-
|
1746
|
-
if (list) {
|
1747
|
-
if ($('lightwindow_galleries_list').getHeight() == 0) {
|
1748
|
-
var height = $('lightwindow_contents').getHeight()*0.80;
|
1749
|
-
$('lightwindow_galleries_tab_span').className = 'down';
|
1750
|
-
} else {
|
1751
|
-
var height = 0;
|
1752
|
-
$('lightwindow_galleries_tab_span').className = 'up';
|
1753
|
-
}
|
1754
|
-
|
1755
|
-
new Effect.Morph('lightwindow_galleries_list', {
|
1756
|
-
duration: this.duration,
|
1757
|
-
transition: Effect.Transitions.sinoidal,
|
1758
|
-
style: {height: height+'px'},
|
1759
|
-
beforeStart: function() {
|
1760
|
-
$('lightwindow_galleries_list').setStyle({
|
1761
|
-
overflow: 'hidden'
|
1762
|
-
});
|
1763
|
-
},
|
1764
|
-
afterFinish: function() {
|
1765
|
-
$('lightwindow_galleries_list').setStyle({
|
1766
|
-
overflow: 'auto'
|
1767
|
-
});
|
1768
|
-
},
|
1769
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1770
|
-
});
|
1771
|
-
}
|
1772
|
-
|
1773
|
-
|
1774
|
-
},
|
1775
|
-
//
|
1776
|
-
// Default Transition Handler
|
1777
|
-
//
|
1778
|
-
_defaultTransitionHandler : function() {
|
1779
|
-
// Clean out our effects
|
1780
|
-
this.dimensions.dataEffects = [];
|
1781
|
-
|
1782
|
-
// Now that we have figures out the cruft lets make the caption go away and add its effects
|
1783
|
-
if ($('lightwindow_data_slide').getStyle('display') != 'none') {
|
1784
|
-
this.dimensions.dataEffects.push(
|
1785
|
-
new Effect.SlideUp('lightwindow_data_slide', {sync: true}),
|
1786
|
-
new Effect.Fade('lightwindow_data_slide', {sync: true, from: 1.0, to: 0.0})
|
1787
|
-
);
|
1788
|
-
}
|
1789
|
-
|
1790
|
-
if (!this.options.hideGalleryTab) {
|
1791
|
-
if ($('lightwindow_galleries').getHeight() != 0 && !this.options.hideGalleryTab) {
|
1792
|
-
this.dimensions.dataEffects.push(
|
1793
|
-
new Effect.Morph('lightwindow_galleries_tab_container', {sync: true, style: {height: '0px', marginTop: '20px'}})
|
1794
|
-
);
|
1795
|
-
}
|
1796
|
-
|
1797
|
-
if ($('lightwindow_galleries_list').getHeight() != 0) {
|
1798
|
-
$('lightwindow_galleries_tab_span').className = 'up';
|
1799
|
-
this.dimensions.dataEffects.push(
|
1800
|
-
new Effect.Morph('lightwindow_galleries_list', {
|
1801
|
-
sync: true,
|
1802
|
-
style: {height: '0px'},
|
1803
|
-
transition: Effect.Transitions.sinoidal,
|
1804
|
-
beforeStart: function() {
|
1805
|
-
$('lightwindow_galleries_list').setStyle({
|
1806
|
-
overflow: 'hidden'
|
1807
|
-
});
|
1808
|
-
},
|
1809
|
-
afterFinish: function() {
|
1810
|
-
$('lightwindow_galleries_list').setStyle({
|
1811
|
-
overflow: 'auto'
|
1812
|
-
});
|
1813
|
-
}
|
1814
|
-
})
|
1815
|
-
);
|
1816
|
-
}
|
1817
|
-
}
|
1818
|
-
|
1819
|
-
// We always want the title bar as well
|
1820
|
-
this.dimensions.dataEffects.push(
|
1821
|
-
new Effect.Morph('lightwindow_title_bar_inner', {sync: true, style: {height: '0px', marginTop: this.options.dimensions.titleHeight+'px'}}),
|
1822
|
-
new Effect.Fade('lightwindow_title_bar_inner', {sync: true, from: 1.0, to: 0.0})
|
1823
|
-
);
|
1824
|
-
|
1825
|
-
new Effect.Parallel(this.dimensions.dataEffects, {
|
1826
|
-
duration: this.duration,
|
1827
|
-
afterFinish: function() {
|
1828
|
-
this._loadWindow();
|
1829
|
-
}.bind(this),
|
1830
|
-
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1831
|
-
}
|
1832
|
-
);
|
1833
|
-
},
|
1834
|
-
//
|
1835
|
-
// Default Form handler for LightWindow
|
1836
|
-
//
|
1837
|
-
_defaultFormHandler : function(e) {
|
1838
|
-
var element = Event.element(e).parentNode;
|
1839
|
-
var parameterString = Form.serialize(this._getParameter('lightwindow_form', element.getAttribute('params')));
|
1840
|
-
if (this.options.formMethod == 'post') {
|
1841
|
-
var newAJAX = new Ajax.Request(element.href, {
|
1842
|
-
method: 'post',
|
1843
|
-
postBody: parameterString,
|
1844
|
-
onComplete: this.openWindow.bind(this, element)
|
1845
|
-
});
|
1846
|
-
} else if (this.options.formMethod == 'get') {
|
1847
|
-
var newAJAX = new Ajax.Request(element.href, {
|
1848
|
-
method: 'get',
|
1849
|
-
parameters: parameterString,
|
1850
|
-
onComplete: this.openWindow.bind(this, element)
|
1851
|
-
});
|
1852
|
-
}
|
1853
|
-
},
|
1854
|
-
//
|
1855
|
-
// Wrap everything up
|
1856
|
-
//
|
1857
|
-
_finishWindow : function() {
|
1858
|
-
if (this.windowType == 'external') {
|
1859
|
-
// We set the externals source here because it allows for a much smoother animation
|
1860
|
-
$('lightwindow_iframe').setAttribute('src', this.element.href);
|
1861
|
-
this._handleFinalWindowAnimation(1);
|
1862
|
-
} else if (this.windowType == 'media') {
|
1863
|
-
|
1864
|
-
var outerObject = document.createElement('object');
|
1865
|
-
outerObject.setAttribute('classid', this.options.classids[this._fileExtension(this.contentToFetch)]);
|
1866
|
-
outerObject.setAttribute('codebase', this.options.codebases[this._fileExtension(this.contentToFetch)]);
|
1867
|
-
outerObject.setAttribute('id', 'lightwindow_media_primary');
|
1868
|
-
outerObject.setAttribute('name', 'lightwindow_media_primary');
|
1869
|
-
outerObject.setAttribute('width', this.resizeTo.width);
|
1870
|
-
outerObject.setAttribute('height', this.resizeTo.height);
|
1871
|
-
outerObject = this._addParamToObject('movie', this.contentToFetch, outerObject);
|
1872
|
-
outerObject = this._addParamToObject('src', this.contentToFetch, outerObject);
|
1873
|
-
outerObject = this._addParamToObject('controller', 'true', outerObject);
|
1874
|
-
outerObject = this._addParamToObject('wmode', 'transparent', outerObject);
|
1875
|
-
outerObject = this._addParamToObject('cache', 'false', outerObject);
|
1876
|
-
outerObject = this._addParamToObject('quality', 'high', outerObject);
|
1877
|
-
|
1878
|
-
if (!Prototype.Browser.IE) {
|
1879
|
-
var innerObject = document.createElement('object');
|
1880
|
-
innerObject.setAttribute('type', this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);
|
1881
|
-
innerObject.setAttribute('data', this.contentToFetch);
|
1882
|
-
innerObject.setAttribute('id', 'lightwindow_media_secondary');
|
1883
|
-
innerObject.setAttribute('name', 'lightwindow_media_secondary');
|
1884
|
-
innerObject.setAttribute('width', this.resizeTo.width);
|
1885
|
-
innerObject.setAttribute('height', this.resizeTo.height);
|
1886
|
-
innerObject = this._addParamToObject('controller', 'true', innerObject);
|
1887
|
-
innerObject = this._addParamToObject('wmode', 'transparent', innerObject);
|
1888
|
-
innerObject = this._addParamToObject('cache', 'false', innerObject);
|
1889
|
-
innerObject = this._addParamToObject('quality', 'high', innerObject);
|
1890
|
-
|
1891
|
-
outerObject.appendChild(innerObject);
|
1892
|
-
}
|
1893
|
-
|
1894
|
-
if (this._getParameter('lightwindow_iframe_embed')) {
|
1895
|
-
this._appendIframe('no');
|
1896
|
-
this._writeToIframe(this._convertToMarkup(outerObject, 'object'));
|
1897
|
-
} else {
|
1898
|
-
this._appendObject(outerObject, 'object', $('lightwindow_contents'));
|
1899
|
-
}
|
1900
|
-
|
1901
|
-
this._handleFinalWindowAnimation(0);
|
1902
|
-
} else {
|
1903
|
-
this._handleFinalWindowAnimation(0);
|
1904
|
-
}
|
1905
|
-
|
1906
|
-
// Initialize any actions
|
1907
|
-
this._setupActions();
|
1908
|
-
}
|
1909
|
-
}
|
1910
|
-
|
1911
|
-
/*-----------------------------------------------------------------------------------------------*/
|
1912
|
-
|
1913
|
-
Event.observe(window, 'load', lightwindowInit, false);
|
1914
|
-
|
1915
|
-
//
|
1916
|
-
// Set up all of our links
|
1917
|
-
//
|
1918
|
-
var myLightWindow = null;
|
1919
|
-
function lightwindowInit() {
|
1920
|
-
myLightWindow = new lightwindow();
|
1921
|
-
}
|