pageflow 12.6.0 → 13.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -16
- data/README.md +8 -1
- data/Rakefile +0 -4
- data/admins/pageflow/accounts.rb +6 -9
- data/admins/pageflow/entry.rb +1 -1
- data/admins/pageflow/folder.rb +1 -1
- data/admins/pageflow/user.rb +4 -4
- data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -1
- data/app/assets/javascripts/pageflow/audio/multi_player.js +0 -4
- data/app/assets/javascripts/pageflow/audio_player.js +1 -1
- data/app/assets/javascripts/pageflow/base.js +0 -2
- data/app/assets/javascripts/pageflow/browser/agent.js +78 -92
- data/app/assets/javascripts/pageflow/browser/autoplay_support.js +2 -2
- data/app/assets/javascripts/pageflow/browser/video.js +1 -6
- data/app/assets/javascripts/pageflow/dist/react.js +1100 -2209
- data/app/assets/javascripts/pageflow/editor/models/configuration.js +5 -5
- data/app/assets/javascripts/pageflow/editor/templates/background_positioning_sliders.jst.ejs +0 -8
- data/app/assets/javascripts/pageflow/editor/views/background_positioning_sliders_view.js +23 -37
- data/app/assets/javascripts/pageflow/editor/views/background_positioning_view.js +2 -2
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/video.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/edit_widget_view.js +0 -9
- data/app/assets/javascripts/pageflow/jquery_utils.js +0 -10
- data/app/assets/javascripts/pageflow/media_player.js +3 -7
- data/app/assets/javascripts/pageflow/media_player/catch_play_promise.js +23 -0
- data/app/assets/javascripts/pageflow/media_player/volume_binding.js +1 -2
- data/app/assets/javascripts/pageflow/media_player/volume_fading/web_audio.js +24 -73
- data/app/assets/javascripts/pageflow/ready.js +1 -2
- data/app/assets/javascripts/pageflow/seed_entry_data.js +3 -3
- data/app/assets/javascripts/pageflow/slideshow.js +9 -17
- data/app/assets/javascripts/pageflow/slideshow/adjacent_pages.js +4 -9
- data/app/assets/javascripts/pageflow/slideshow/{successor_preparer.js → adjacent_preparer.js} +11 -14
- data/app/assets/javascripts/pageflow/slideshow/atmo.js +12 -23
- data/app/assets/javascripts/pageflow/slideshow/lazy_page_widget.js +2 -2
- data/app/assets/javascripts/pageflow/slideshow/progressive_preload.js +42 -0
- data/app/assets/javascripts/pageflow/ui/views/configuration_editor_view.js +2 -2
- data/app/assets/javascripts/pageflow/video_player/filter_sources.js +2 -16
- data/app/assets/javascripts/pageflow/video_player/lazy.js +1 -1
- data/app/assets/javascripts/pageflow/visited.js +0 -2
- data/app/assets/javascripts/pageflow/widgets.js +0 -1
- data/app/assets/javascripts/pageflow/widgets/multimedia_alert.js +1 -2
- data/app/assets/javascripts/pageflow/widgets/navigation.js +0 -1
- data/app/assets/javascripts/pageflow/widgets/navigation_mobile.js +0 -1
- data/app/assets/javascripts/pageflow/widgets/overview.js +1 -3
- data/app/assets/stylesheets/pageflow/admin.scss +2 -0
- data/app/assets/stylesheets/pageflow/admin/status_tags.scss +13 -0
- data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +10 -34
- data/app/assets/stylesheets/pageflow/navigation_bar.scss +4 -0
- data/app/assets/stylesheets/pageflow/page_types/video.scss +4 -1
- data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +0 -5
- data/app/assets/stylesheets/pageflow/themes/default/base.scss +0 -2
- data/app/assets/stylesheets/pageflow/themes/default/overview/icons/icon_font.scss +1 -4
- data/app/assets/stylesheets/pageflow/themes/default/page.scss +0 -19
- data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +0 -4
- data/app/assets/stylesheets/pageflow/themes/default/slideshow.scss +0 -1
- data/app/controllers/concerns/pageflow/edit_locking.rb +2 -2
- data/app/controllers/concerns/pageflow/public_https_mode.rb +1 -5
- data/app/controllers/concerns/pageflow/quota_verification.rb +1 -1
- data/app/controllers/pageflow/application_controller.rb +2 -2
- data/app/controllers/pageflow/chapters_controller.rb +2 -2
- data/app/controllers/pageflow/edit_locks_controller.rb +1 -1
- data/app/controllers/pageflow/editor/encoding_confirmations_controller.rb +1 -1
- data/app/controllers/pageflow/editor/entries_controller.rb +1 -1
- data/app/controllers/pageflow/editor/entry_publications_controller.rb +1 -1
- data/app/controllers/pageflow/editor/files_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +5 -11
- data/app/controllers/pageflow/files_controller.rb +1 -1
- data/app/controllers/pageflow/pages_controller.rb +2 -2
- data/app/controllers/pageflow/revisions_controller.rb +1 -1
- data/app/controllers/pageflow/storylines_controller.rb +2 -3
- data/app/helpers/pageflow/common_entry_seed_helper.rb +0 -1
- data/app/helpers/pageflow/entries_helper.rb +6 -31
- data/app/helpers/pageflow/entry_json_seed_helper.rb +1 -1
- data/app/helpers/pageflow/public_i18n_helper.rb +1 -6
- data/app/jobs/pageflow/application_job.rb +6 -0
- data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +2 -4
- data/app/jobs/pageflow/poll_zencoder_job.rb +8 -8
- data/app/jobs/pageflow/process_file_job.rb +4 -4
- data/app/jobs/pageflow/prune_auto_snapshots_job.rb +3 -3
- data/app/jobs/pageflow/request_meta_data_from_zencoder_job.rb +4 -4
- data/app/jobs/pageflow/submit_file_to_zencoder_job.rb +4 -4
- data/app/jobs/pageflow/upload_file_to_s3_job.rb +5 -5
- data/app/mailers/pageflow/user_mailer.rb +1 -15
- data/app/models/concerns/pageflow/uploaded_file.rb +3 -3
- data/app/models/pageflow/audio_file.rb +1 -1
- data/app/models/pageflow/chapter.rb +1 -1
- data/app/models/pageflow/entry.rb +1 -1
- data/app/models/pageflow/invited_user.rb +1 -1
- data/app/models/pageflow/membership.rb +4 -2
- data/app/models/pageflow/page.rb +1 -1
- data/app/models/pageflow/published_entry.rb +3 -4
- data/app/models/pageflow/revision.rb +5 -3
- data/app/models/pageflow/storyline.rb +5 -1
- data/app/models/pageflow/theming.rb +1 -2
- data/app/models/pageflow/used_file.rb +12 -0
- data/app/models/pageflow/video_file.rb +1 -1
- data/app/views/admin/accounts/_form.html.erb +0 -8
- data/app/views/admin/accounts/_theming_details.html.arb +0 -3
- data/app/views/pageflow/entries/_mobile_navigation.html.erb +3 -2
- data/app/views/pageflow/entries/navigation/_page.html.erb +1 -3
- data/app/views/pageflow/entries/overview/_page.html.erb +1 -1
- data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +1 -1
- data/app/views/pageflow/user_mailer/invitation.html.erb +2 -2
- data/app/views/pageflow/user_mailer/invitation.text.erb +1 -1
- data/config/locales/de.yml +6 -16
- data/config/locales/en.yml +8 -18
- data/config/routes.rb +0 -6
- data/db/migrate/20140418225525_setup_schema.rb +295 -203
- data/db/migrate/20140418240000_add_attributes_to_users.rb +3 -6
- data/lib/generators/pageflow/resque/resque_generator.rb +6 -3
- data/lib/pageflow.rb +1 -1
- data/lib/pageflow/ability_mixin.rb +0 -1
- data/lib/pageflow/active_admin_patches/views/attributes_table.rb +1 -1
- data/lib/pageflow/active_admin_patches/views/table_for.rb +1 -1
- data/lib/pageflow/built_in_widget_type.rb +0 -8
- data/lib/pageflow/built_in_widget_types_plugin.rb +0 -2
- data/lib/pageflow/configuration.rb +0 -10
- data/lib/pageflow/engine.rb +5 -9
- data/lib/pageflow/user_mixin.rb +5 -0
- data/lib/pageflow/version.rb +1 -1
- data/lib/tasks/pageflow_tasks.rake +1 -11
- data/spec/factories/accounts.rb +1 -1
- data/spec/factories/audio_files.rb +1 -1
- data/spec/factories/chapters.rb +1 -3
- data/spec/factories/edit_locks.rb +2 -4
- data/spec/factories/entries.rb +1 -1
- data/spec/factories/feature_targets.rb +1 -1
- data/spec/factories/file_usages.rb +1 -1
- data/spec/factories/folders.rb +1 -1
- data/spec/factories/hosted_files.rb +6 -6
- data/spec/factories/image_files.rb +1 -1
- data/spec/factories/invited_user.rb +1 -1
- data/spec/factories/memberships.rb +1 -1
- data/spec/factories/pages.rb +1 -1
- data/spec/factories/revisions.rb +1 -1
- data/spec/factories/storylines.rb +1 -1
- data/spec/factories/text_track_files.rb +1 -1
- data/spec/factories/themings.rb +1 -1
- data/spec/factories/users.rb +1 -1
- data/spec/factories/video_files.rb +1 -1
- data/spec/factories/widgets.rb +1 -1
- data/vendor/assets/javascripts/audio5.min.js +129 -280
- metadata +103 -219
- data/app/assets/audios/pageflow/unmute.mp3 +0 -0
- data/app/assets/javascripts/pageflow/background_media.js +0 -22
- data/app/assets/javascripts/pageflow/cookie_notice.js +0 -7
- data/app/assets/javascripts/pageflow/editor/views/info_box_view.js +0 -8
- data/app/assets/javascripts/pageflow/editor/views/widget_types/cookie_notice_bar.js +0 -15
- data/app/assets/javascripts/pageflow/media_player/handle_failed_play.js +0 -34
- data/app/assets/javascripts/pageflow/slideshow/adjacent_preloader.js +0 -26
- data/app/assets/stylesheets/pageflow/page_types/video/mobile_poster.scss +0 -15
- data/app/assets/stylesheets/pageflow/themes/default/background_media_unmute_button.scss +0 -77
- data/app/assets/stylesheets/pageflow/themes/default/cookie_notice_bar.scss +0 -57
- data/app/assets/stylesheets/pageflow/themes/default/page/hyphenate.scss +0 -24
- data/app/controllers/pageflow/admin/initial_passwords_controller.rb +0 -8
- data/app/views/pageflow/admin/initial_passwords/edit.html.erb +0 -16
- data/app/views/pageflow/entries/mobile_navigation/_page.html.erb +0 -5
- data/db/migrate/20140624135420_create_themings.rb +0 -15
- data/db/migrate/20140624135421_create_themings_for_existing_accounts.rb +0 -26
- data/db/migrate/20140624135422_change_theme_references_to_theming_references.rb +0 -45
- data/db/migrate/20140624135423_remove_attributes_from_themes.rb +0 -10
- data/db/migrate/20140624135424_create_accounts_themes_join_table.rb +0 -8
- data/db/migrate/20140624135425_move_cname_from_account_to_theming.rb +0 -21
- data/db/migrate/20140625184800_drop_themes.rb +0 -14
- data/db/migrate/20140704110631_add_confirmed_by_to_encoded_files.rb +0 -6
- data/db/migrate/20140819081454_add_home_url_attributes_to_themings_and_revisions.rb +0 -9
- data/db/migrate/20141027102310_create_widgets.rb +0 -11
- data/db/migrate/20141028125408_add_emphasize_chapter_beginning_to_revisions.rb +0 -5
- data/db/migrate/20141119164526_add_emphasize_new_pages_to_revisions.rb +0 -5
- data/db/migrate/20141119174032_add_sharing_image_to_revisions.rb +0 -7
- data/db/migrate/20141128150305_add_locale_to_users.rb +0 -5
- data/db/migrate/20141208161030_add_locale_to_revisions.rb +0 -5
- data/db/migrate/20141211110226_add_configuration_to_chapters.rb +0 -5
- data/db/migrate/20150115175116_add_features_configuration_to_accounts.rb +0 -5
- data/db/migrate/20150115175207_add_features_configuration_to_entries.rb +0 -5
- data/db/migrate/20150603091823_add_password_attributes_to_revisions.rb +0 -6
- data/db/migrate/20150825133449_update_audio_loop_pages_to_use_atmo.rb +0 -24
- data/db/migrate/20150826125417_create_pageflow_storylines.rb +0 -12
- data/db/migrate/20150826125744_add_storyline_id_to_chapters.rb +0 -6
- data/db/migrate/20150826125745_insert_main_storylines.rb +0 -28
- data/db/migrate/20150830105831_remove_revision_id_from_chapters.rb +0 -5
- data/db/migrate/20150830110006_remove_entry_id_from_chapters.rb +0 -5
- data/db/migrate/20151022080518_add_first_published_at_to_entries.rb +0 -14
- data/db/migrate/20160131222203_add_cache_counters.rb +0 -23
- data/db/migrate/20160201130118_add_additional_cnames_to_themings.rb +0 -5
- data/db/migrate/20160216130336_add_meta_fields_to_revision.rb +0 -7
- data/db/migrate/20160225075853_add_overview_button_enabled_to_revisions.rb +0 -5
- data/db/migrate/20160304072911_rename_membership_entry_and_make_polymorphic.rb +0 -19
- data/db/migrate/20160304151327_add_role_to_membership.rb +0 -19
- data/db/migrate/20160310080213_add_edited_at_to_entries.rb +0 -9
- data/db/migrate/20160425192648_add_index_for_revision_publication_timestamps.rb +0 -5
- data/db/migrate/20160504093145_replace_role_and_account_on_user.rb +0 -42
- data/db/migrate/20160531152500_update_users_count.rb +0 -27
- data/db/migrate/20160617123557_add_meta_fields_to_theming.rb +0 -7
- data/db/migrate/20160707125400_add_output_presences_to_video_files.rb +0 -5
- data/db/migrate/20160715105408_add_share_url_to_revisions.rb +0 -5
- data/db/migrate/20160824115000_add_parent_file_to_video_files.rb +0 -8
- data/db/migrate/20160824115100_add_parent_file_to_audio_files.rb +0 -8
- data/db/migrate/20160824115200_add_parent_file_to_image_files.rb +0 -8
- data/db/migrate/20160929102700_add_configuration_to_files.rb +0 -7
- data/db/migrate/20161007144500_add_text_track_files.rb +0 -31
- data/db/migrate/20161216175734_move_configuration_from_file_to_file_usage.rb +0 -27
- data/db/migrate/20161230144429_add_processed_attachment_to_text_track_files.rb +0 -8
- data/db/migrate/20170201074328_add_configuration_to_widgets.rb +0 -5
- data/db/migrate/20170222124848_update_video_file_output_presences.rb +0 -12
- data/db/migrate/20170315130000_add_theme_name_to_revisions.rb +0 -12
- data/db/migrate/20170421112300_turn_background_video_pages_into_background_image_pages.rb +0 -22
- data/db/migrate/20170912165050_reset_copied_snapshot_type.rb +0 -24
- data/db/migrate/20170913105048_fix_hls_output_presences_for_legacy_video_files.rb +0 -12
- data/db/migrate/20180528144334_add_privacy_link_url_to_themings.rb +0 -5
- data/db/migrate/20190109085744_add_default_locale_to_themings.rb +0 -6
- data/lib/generators/pageflow/resque/templates/devise_async.rb +0 -6
- data/lib/generators/pageflow/resque/templates/resque_logger.rb +0 -16
- data/lib/generators/pageflow/resque/templates/resque_mailer.rb +0 -4
- data/lib/pageflow/primary_domain_entry_redirect.rb +0 -25
@@ -40,25 +40,25 @@ pageflow.Configuration = Backbone.Model.extend({
|
|
40
40
|
},
|
41
41
|
|
42
42
|
getFilePosition: function(attribute, coord) {
|
43
|
-
var propertyName = this.
|
43
|
+
var propertyName = this._filePositionProperty(attribute, coord);
|
44
44
|
return this.has(propertyName) ? this.get(propertyName) : 50;
|
45
45
|
},
|
46
46
|
|
47
47
|
setFilePosition: function(attribute, coord, value) {
|
48
|
-
var propertyName = this.
|
48
|
+
var propertyName = this._filePositionProperty(attribute, coord);
|
49
49
|
this.set(propertyName, value);
|
50
50
|
},
|
51
51
|
|
52
52
|
setFilePositions: function(attribute, x, y) {
|
53
53
|
var attributes = {};
|
54
54
|
|
55
|
-
attributes[this.
|
56
|
-
attributes[this.
|
55
|
+
attributes[this._filePositionProperty(attribute, 'x')] = x;
|
56
|
+
attributes[this._filePositionProperty(attribute, 'y')] = y;
|
57
57
|
|
58
58
|
this.set(attributes);
|
59
59
|
},
|
60
60
|
|
61
|
-
|
61
|
+
_filePositionProperty: function(attribute, coord) {
|
62
62
|
return attribute.replace(/_id$/, '_' + coord);
|
63
63
|
},
|
64
64
|
|
@@ -6,10 +6,7 @@ pageflow.BackgroundPositioningSlidersView = Backbone.Marionette.ItemView.extend(
|
|
6
6
|
container: '.container',
|
7
7
|
|
8
8
|
sliderHorizontal: '.horizontal.slider',
|
9
|
-
sliderVertical: '.vertical.slider'
|
10
|
-
|
11
|
-
inputHorizontal: '.percent.horizontal input',
|
12
|
-
inputVertical: '.percent.vertical input'
|
9
|
+
sliderVertical: '.vertical.slider'
|
13
10
|
},
|
14
11
|
|
15
12
|
events: {
|
@@ -37,10 +34,6 @@ pageflow.BackgroundPositioningSlidersView = Backbone.Marionette.ItemView.extend(
|
|
37
34
|
}
|
38
35
|
},
|
39
36
|
|
40
|
-
modelEvents: {
|
41
|
-
change: 'update'
|
42
|
-
},
|
43
|
-
|
44
37
|
onRender: function() {
|
45
38
|
var view = this;
|
46
39
|
var file = this.model.getReference(this.options.propertyName, this.options.filesCollection),
|
@@ -50,59 +43,52 @@ pageflow.BackgroundPositioningSlidersView = Backbone.Marionette.ItemView.extend(
|
|
50
43
|
|
51
44
|
this.ui.sliderVertical.slider({
|
52
45
|
orientation: 'vertical',
|
46
|
+
step: 0.01,
|
47
|
+
value: 100 - this.model.getFilePosition(this.options.propertyName, 'y'),
|
53
48
|
|
54
|
-
change: function(
|
55
|
-
view.save(
|
49
|
+
change: function() {
|
50
|
+
view.save();
|
56
51
|
},
|
57
52
|
|
58
53
|
slide: function(event, ui) {
|
59
|
-
view.save(
|
54
|
+
view.save({y: ui.value});
|
60
55
|
}
|
61
56
|
});
|
62
57
|
|
63
58
|
this.ui.sliderHorizontal.slider({
|
64
59
|
orientation: 'horizontal',
|
60
|
+
step: 0.01,
|
61
|
+
value: this.model.getFilePosition(this.options.propertyName, 'x'),
|
65
62
|
|
66
|
-
change: function(
|
67
|
-
view.save(
|
63
|
+
change: function() {
|
64
|
+
view.save();
|
68
65
|
},
|
69
66
|
|
70
67
|
slide: function(event, ui) {
|
71
|
-
view.save(
|
68
|
+
view.save({y: ui.value});
|
72
69
|
}
|
73
70
|
});
|
74
|
-
|
75
|
-
this.ui.inputVertical.on('change', function() {
|
76
|
-
view.save('y', $(this).val());
|
77
|
-
});
|
78
|
-
|
79
|
-
this.ui.inputHorizontal.on('change', function() {
|
80
|
-
view.save('x', $(this).val());
|
81
|
-
});
|
82
|
-
|
83
|
-
this.update();
|
84
71
|
},
|
85
72
|
|
86
|
-
|
87
|
-
var x = this.model.getFilePosition(this.options.propertyName, 'x');
|
88
|
-
var y = this.model.getFilePosition(this.options.propertyName, 'y');
|
89
|
-
|
90
|
-
this.ui.sliderVertical.slider('value', 100 - y);
|
91
|
-
this.ui.sliderHorizontal.slider('value', x);
|
92
|
-
|
93
|
-
this.ui.inputVertical.val(y);
|
94
|
-
this.ui.inputHorizontal.val(x);
|
73
|
+
onShow: function() {
|
95
74
|
},
|
96
75
|
|
97
76
|
saveFromEvent: function(event) {
|
98
77
|
var x = event.pageX - this.ui.container.offset().left;
|
99
78
|
var y = event.pageY - this.ui.container.offset().top;
|
100
79
|
|
101
|
-
this.
|
102
|
-
this.
|
80
|
+
this.ui.sliderHorizontal.slider('value', x / this.ui.container.width() * 100);
|
81
|
+
this.ui.sliderVertical.slider('value', (1 - y / this.ui.container.height()) * 100);
|
82
|
+
this.save();
|
103
83
|
},
|
104
84
|
|
105
|
-
save: function(
|
106
|
-
|
85
|
+
save: function(options) {
|
86
|
+
options = options || {};
|
87
|
+
|
88
|
+
var x = x in options ? options.x : this.ui.sliderHorizontal.slider('value');
|
89
|
+
var y = y in options ? options.y : 100 - this.ui.sliderVertical.slider('value');
|
90
|
+
|
91
|
+
this.model.setFilePosition(this.options.propertyName, 'x', x);
|
92
|
+
this.model.setFilePosition(this.options.propertyName, 'y', y);
|
107
93
|
}
|
108
94
|
});
|
@@ -63,5 +63,5 @@ pageflow.BackgroundPositioningView = Backbone.Marionette.ItemView.extend({
|
|
63
63
|
});
|
64
64
|
|
65
65
|
pageflow.BackgroundPositioningView.open = function(options) {
|
66
|
-
pageflow.app.dialogRegion.show(new pageflow.BackgroundPositioningView(options));
|
67
|
-
};
|
66
|
+
pageflow.app.dialogRegion.show(new pageflow.BackgroundPositioningView(options).render());
|
67
|
+
};
|
@@ -19,7 +19,7 @@ pageflow.ConfigurationEditorView.register('video', {
|
|
19
19
|
});
|
20
20
|
this.input('mobile_poster_image_id', pageflow.FileInputView, {
|
21
21
|
collection: pageflow.imageFiles,
|
22
|
-
positioning:
|
22
|
+
positioning: false
|
23
23
|
});
|
24
24
|
this.input('thumbnail_image_id', pageflow.FileInputView, {
|
25
25
|
collection: pageflow.imageFiles,
|
@@ -8,15 +8,6 @@ pageflow.EditWidgetView = Backbone.Marionette.ItemView.extend({
|
|
8
8
|
}
|
9
9
|
},
|
10
10
|
|
11
|
-
initialize: function() {
|
12
|
-
this.model.set('editing', true);
|
13
|
-
},
|
14
|
-
|
15
|
-
onClose: function() {
|
16
|
-
Backbone.Marionette.ItemView.prototype.onClose.call(this);
|
17
|
-
this.model.set('editing', false);
|
18
|
-
},
|
19
|
-
|
20
11
|
onRender: function() {
|
21
12
|
var configurationEditor = this.model.widgetType().createConfigurationEditorView({
|
22
13
|
model: this.model.configuration,
|
@@ -10,13 +10,3 @@ $.fn.updateTitle = function () {
|
|
10
10
|
this.attr('title', this.data('title'));
|
11
11
|
}
|
12
12
|
};
|
13
|
-
|
14
|
-
$.fn.loadLazyImages = function() {
|
15
|
-
this.find('img[data-src]').each(function() {
|
16
|
-
var img = $(this);
|
17
|
-
|
18
|
-
if (!img.attr('src')) {
|
19
|
-
img.attr('src', img.data('src'));
|
20
|
-
}
|
21
|
-
});
|
22
|
-
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
//= require_self
|
2
|
-
|
3
|
-
//= require ./media_player/handle_failed_play
|
2
|
+
//= require ./media_player/catch_play_promise
|
4
3
|
//= require ./media_player/volume_fading
|
5
4
|
//= require ./media_player/volume_binding
|
6
5
|
//= require ./media_player/load_waiting
|
@@ -9,10 +8,7 @@
|
|
9
8
|
|
10
9
|
pageflow.mediaPlayer = {
|
11
10
|
enhance: function(player, options) {
|
12
|
-
pageflow.mediaPlayer.
|
13
|
-
hasAutoplaySupport: pageflow.browser.has('autoplay support')
|
14
|
-
}, options));
|
15
|
-
|
11
|
+
pageflow.mediaPlayer.catchPlayerPromise(player);
|
16
12
|
pageflow.mediaPlayer.asyncPlay(player);
|
17
13
|
|
18
14
|
if (options.hooks) {
|
@@ -28,4 +24,4 @@ pageflow.mediaPlayer = {
|
|
28
24
|
pageflow.mediaPlayer.loadWaiting(player);
|
29
25
|
}
|
30
26
|
}
|
31
|
-
};
|
27
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/*global Promise*/
|
2
|
+
|
3
|
+
// Chrome returns a promise from `play` that is rejected if another
|
4
|
+
// operation (like calling `pause` or updating the source) happens
|
5
|
+
// before playing started. If the promise rejection is not handled,
|
6
|
+
// the operation that caused `play` to abort will fail with an
|
7
|
+
// exception. Code following the operation will not be executed. Catch
|
8
|
+
// and ignore the promise to prevent this.
|
9
|
+
pageflow.mediaPlayer.catchPlayerPromise = function(player) {
|
10
|
+
var originalPlay = player.play;
|
11
|
+
|
12
|
+
player.play = function(/* arguments */) {
|
13
|
+
var result = originalPlay.apply(player, arguments);
|
14
|
+
|
15
|
+
if (result && (typeof Promise !== 'undefined') && (result instanceof Promise)) {
|
16
|
+
result.catch(function() {
|
17
|
+
pageflow.log('Caught pending play exception - continuing');
|
18
|
+
});
|
19
|
+
}
|
20
|
+
|
21
|
+
return result;
|
22
|
+
};
|
23
|
+
};
|
@@ -7,7 +7,6 @@ pageflow.mediaPlayer.volumeBinding = function(player, settings, options) {
|
|
7
7
|
var volumeFactor = 'volumeFactor' in options ? options.volumeFactor : 1;
|
8
8
|
|
9
9
|
player.play = function() {
|
10
|
-
player.intendToPlay();
|
11
10
|
player.volume(player.targetVolume());
|
12
11
|
listenToVolumeSetting();
|
13
12
|
|
@@ -72,4 +71,4 @@ pageflow.mediaPlayer.volumeBinding = function(player, settings, options) {
|
|
72
71
|
function onVolumeChange(model, value) {
|
73
72
|
player.fadeVolume(player.targetVolume(), 40);
|
74
73
|
}
|
75
|
-
};
|
74
|
+
};
|
@@ -12,84 +12,36 @@ pageflow.mediaPlayer.volumeFading.webAudio = function(player, audioContext) {
|
|
12
12
|
|
13
13
|
var allowedMinValue = 0.000001;
|
14
14
|
|
15
|
-
if (audioContext.state === 'suspended') {
|
16
|
-
pageflow.events.on('background_media:unmute', function() {
|
17
|
-
player.volume(currentValue);
|
18
|
-
});
|
19
|
-
}
|
20
|
-
|
21
|
-
function tryResumeIfSuspended() {
|
22
|
-
return new $.Deferred(function(deferred) {
|
23
|
-
if (audioContext.state === 'suspended') {
|
24
|
-
var maybePromise = audioContext.resume();
|
25
|
-
|
26
|
-
if (maybePromise && maybePromise.then) {
|
27
|
-
maybePromise.then(handleDeferred);
|
28
|
-
}
|
29
|
-
else {
|
30
|
-
setTimeout(handleDeferred, 0);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
deferred.resolve();
|
35
|
-
}
|
36
|
-
|
37
|
-
function handleDeferred() {
|
38
|
-
if (audioContext.state === 'suspended') {
|
39
|
-
deferred.reject();
|
40
|
-
}
|
41
|
-
else {
|
42
|
-
deferred.resolve();
|
43
|
-
}
|
44
|
-
}
|
45
|
-
}).promise();
|
46
|
-
}
|
47
|
-
|
48
15
|
player.volume = function(value) {
|
16
|
+
ensureGainNode();
|
17
|
+
|
49
18
|
if (typeof value !== 'undefined') {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
currentValue = ensureInAllowedRange(value);
|
56
|
-
|
57
|
-
gainNode.gain.setValueAtTime(currentValue,
|
58
|
-
audioContext.currentTime);
|
59
|
-
},
|
60
|
-
function() {
|
61
|
-
currentValue = ensureInAllowedRange(value);
|
62
|
-
}
|
63
|
-
);
|
19
|
+
cancel();
|
20
|
+
currentValue = ensureInAllowedRange(value);
|
21
|
+
|
22
|
+
return gainNode.gain.setValueAtTime(currentValue,
|
23
|
+
audioContext.currentTime);
|
64
24
|
}
|
65
25
|
|
66
26
|
return Math.round(currentValue * 100) / 100;
|
67
27
|
};
|
68
28
|
|
69
29
|
player.fadeVolume = function(value, duration) {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
currentDeferred = deferred;
|
86
|
-
}).promise();
|
87
|
-
},
|
88
|
-
function() {
|
89
|
-
currentValue = ensureInAllowedRange(value);
|
90
|
-
return new $.Deferred().resolve().promise();
|
91
|
-
}
|
92
|
-
);
|
30
|
+
ensureGainNode();
|
31
|
+
|
32
|
+
cancel();
|
33
|
+
recordFadeStart(duration);
|
34
|
+
|
35
|
+
currentValue = ensureInAllowedRange(value);
|
36
|
+
|
37
|
+
gainNode.gain.setValueAtTime(lastStartValue, audioContext.currentTime);
|
38
|
+
gainNode.gain.linearRampToValueAtTime(currentValue,
|
39
|
+
audioContext.currentTime + duration / 1000);
|
40
|
+
|
41
|
+
return new $.Deferred(function(deferred) {
|
42
|
+
currentTimeout = setTimeout(resolve, duration);
|
43
|
+
currentDeferred = deferred;
|
44
|
+
}).promise();
|
93
45
|
};
|
94
46
|
|
95
47
|
player.one('dispose', cancel);
|
@@ -141,10 +93,9 @@ pageflow.mediaPlayer.volumeFading.webAudio = function(player, audioContext) {
|
|
141
93
|
if (gainNode.gain.value == 1) {
|
142
94
|
var performedDuration = (audioContext.currentTime - lastStartTime) * 1000;
|
143
95
|
var lastDelta = currentValue - lastStartValue;
|
144
|
-
var performedFraction = lastDelta > 0 ? performedDuration / lastDuration : 1;
|
145
96
|
|
146
97
|
currentValue = ensureInAllowedRange(
|
147
|
-
lastStartValue +
|
98
|
+
lastStartValue + (performedDuration / lastDuration * lastDelta)
|
148
99
|
);
|
149
100
|
}
|
150
101
|
else {
|
@@ -155,4 +106,4 @@ pageflow.mediaPlayer.volumeFading.webAudio = function(player, audioContext) {
|
|
155
106
|
function ensureInAllowedRange(value) {
|
156
107
|
return value < allowedMinValue ? allowedMinValue : value;
|
157
108
|
}
|
158
|
-
};
|
109
|
+
};
|
@@ -6,7 +6,6 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
|
|
6
6
|
|
7
7
|
body.one('pagepreloaded', function() {
|
8
8
|
readyDeferred.resolve();
|
9
|
-
pageflow.events.trigger('ready');
|
10
9
|
});
|
11
10
|
|
12
11
|
pageflow.Visited.setup();
|
@@ -43,4 +42,4 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
|
|
43
42
|
pageflow.nativeScrolling.preventScrollingOnEmbed(slideshow);
|
44
43
|
});
|
45
44
|
};
|
46
|
-
}).promise();
|
45
|
+
}).promise();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
pageflow.SeedEntryData = pageflow.EntryData.extend({
|
2
2
|
initialize: function(options) {
|
3
|
-
this.
|
3
|
+
this.theming = options.theming;
|
4
4
|
|
5
5
|
this.storylineConfigurations = _(options.storylines).reduce(function(memo, storyline) {
|
6
6
|
memo[storyline.id] = storyline.configuration;
|
@@ -40,7 +40,7 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
40
40
|
},
|
41
41
|
|
42
42
|
getThemingOption: function(name) {
|
43
|
-
return this.
|
43
|
+
return this.theming[name];
|
44
44
|
},
|
45
45
|
|
46
46
|
getChapterConfiguration: function(id) {
|
@@ -70,4 +70,4 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
70
70
|
getStorylineIdByChapterId: function(id) {
|
71
71
|
return this.storylineIdsByChapterIds[id];
|
72
72
|
}
|
73
|
-
});
|
73
|
+
});
|
@@ -6,8 +6,8 @@
|
|
6
6
|
//=require ./slideshow/scroll_indicator
|
7
7
|
//=require ./slideshow/scroll_indicator_widget
|
8
8
|
//=require ./slideshow/hidden_text_indicator_widget
|
9
|
-
//=require ./slideshow/
|
10
|
-
//=require ./slideshow/
|
9
|
+
//=require ./slideshow/progressive_preload
|
10
|
+
//=require ./slideshow/adjacent_preparer
|
11
11
|
//=require ./slideshow/swipe_gesture
|
12
12
|
//=require ./slideshow/hide_text
|
13
13
|
//=require ./slideshow/hide_text_on_swipe
|
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
pageflow.Slideshow = function($el, configurations) {
|
17
17
|
var transitioning = false,
|
18
|
+
preload = new pageflow.ProgressivePreload(),
|
18
19
|
currentPage = $(),
|
19
20
|
pages = $(),
|
20
21
|
that = this,
|
@@ -115,7 +116,7 @@ pageflow.Slideshow = function($el, configurations) {
|
|
115
116
|
transition: transition
|
116
117
|
});
|
117
118
|
|
118
|
-
|
119
|
+
preload.start(currentPage);
|
119
120
|
$el.trigger('slideshowchangepage', [options]);
|
120
121
|
|
121
122
|
return Math.max(outDuration, inDuration);
|
@@ -160,17 +161,16 @@ pageflow.Slideshow = function($el, configurations) {
|
|
160
161
|
currentPageIndex = currentPage.index();
|
161
162
|
|
162
163
|
currentPage.page('activateAsLandingPage');
|
163
|
-
|
164
|
+
preload.start(currentPage);
|
164
165
|
}
|
165
166
|
}
|
166
167
|
|
167
168
|
function findNewCurrentPage(options) {
|
168
169
|
if (!currentPage.length) {
|
169
170
|
var permaId = options && options.landingPagePermaId;
|
170
|
-
var landingPage = permaId ? getPageByPermaId(permaId) : $();
|
171
171
|
|
172
|
-
return
|
173
|
-
|
172
|
+
return permaId ?
|
173
|
+
getPageByPermaId(permaId) :
|
174
174
|
that.scrollNavigator.getLandingPage(pages);
|
175
175
|
}
|
176
176
|
else if (!currentPage.parent().length) {
|
@@ -217,14 +217,7 @@ pageflow.Slideshow = function($el, configurations) {
|
|
217
217
|
$el.find('.scroll_indicator').scrollIndicator({parent: this});
|
218
218
|
|
219
219
|
this.scrollNavigator = new pageflow.DomOrderScrollNavigator(this, pageflow.entryData);
|
220
|
-
|
221
|
-
pageflow.AdjacentPreloader
|
222
|
-
.create(function() { return pages; }, this.scrollNavigator)
|
223
|
-
.attach(pageflow.events);
|
224
|
-
|
225
|
-
pageflow.SuccessorPreparer
|
226
|
-
.create(function() { return pages; }, this.scrollNavigator)
|
227
|
-
.attach(pageflow.events);
|
220
|
+
this.preparer = pageflow.AdjacentPreparer.create(function() { return pages; }, this.scrollNavigator).attach(pageflow.events);
|
228
221
|
};
|
229
222
|
|
230
223
|
pageflow.Slideshow.setup = function(options) {
|
@@ -245,8 +238,7 @@ pageflow.Slideshow.setup = function(options) {
|
|
245
238
|
pageflow.atmo = pageflow.Atmo.create(
|
246
239
|
pageflow.slides,
|
247
240
|
pageflow.events,
|
248
|
-
pageflow.audio
|
249
|
-
pageflow.backgroundMedia
|
241
|
+
pageflow.audio
|
250
242
|
);
|
251
243
|
|
252
244
|
pageflow.history = pageflow.History.create(
|