pageflow 13.0.0.beta6 → 13.0.0.beta7
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 +74 -0
- data/README.md +1 -0
- data/app/assets/audios/pageflow/unmute.mp3 +0 -0
- data/app/assets/images/pageflow/editor/help/phone_horizontal_slideshow_mode.gif +0 -0
- data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -1
- data/app/assets/javascripts/pageflow/audio/multi_player.js +4 -0
- data/app/assets/javascripts/pageflow/audio_player.js +1 -1
- data/app/assets/javascripts/pageflow/background_media.js +22 -0
- data/app/assets/javascripts/pageflow/base.js +1 -0
- data/app/assets/javascripts/pageflow/browser/agent.js +92 -78
- data/app/assets/javascripts/pageflow/browser/autoplay_support.js +2 -2
- data/app/assets/javascripts/pageflow/dist/react.js +711 -252
- data/app/assets/javascripts/pageflow/editor/api/page_type.js +4 -0
- data/app/assets/javascripts/pageflow/editor/base.js +1 -0
- data/app/assets/javascripts/pageflow/editor/collections/files_collection.js +8 -0
- data/app/assets/javascripts/pageflow/editor/initializers/boot.js +6 -4
- data/app/assets/javascripts/pageflow/editor/initializers/setup_asset_urls.js +3 -0
- data/app/assets/javascripts/pageflow/editor/models/entry.js +2 -2
- data/app/assets/javascripts/pageflow/editor/models/file_stage.js +6 -1
- data/app/assets/javascripts/pageflow/editor/models/mixins/stage_provider.js +9 -0
- data/app/assets/javascripts/pageflow/editor/models/mixins/transient_references.js +12 -2
- data/app/assets/javascripts/pageflow/editor/models/preview_entry_data.js +5 -0
- data/app/assets/javascripts/pageflow/editor/models/uploaded_file.js +6 -1
- data/app/assets/javascripts/pageflow/editor/templates/emulation_mode_button.jst.ejs +26 -0
- data/app/assets/javascripts/pageflow/editor/templates/entry_preview.jst.ejs +8 -3
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/options.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/page_link.js +3 -6
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/page_transitions.js +14 -4
- data/app/assets/javascripts/pageflow/editor/views/edit_storyline_view.js +3 -6
- data/app/assets/javascripts/pageflow/editor/views/embedded/background_image_embedded_view.js +47 -12
- data/app/assets/javascripts/pageflow/editor/views/emulation_mode_button_view.js +45 -0
- data/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js +62 -8
- data/app/assets/javascripts/pageflow/editor/views/file_stage_item_view.js +7 -0
- data/app/assets/javascripts/pageflow/editor/views/help_image_view.js +9 -0
- data/app/assets/javascripts/pageflow/editor/views/info_box_view.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/inputs/file_processing_state_display_view.js +60 -0
- data/app/assets/javascripts/pageflow/editor/views/sidebar_footer_view.js +12 -0
- data/app/assets/javascripts/pageflow/editor/views/widget_types/phone_horizontal_slideshow_mode.js +14 -0
- data/app/assets/javascripts/pageflow/entry_data.js +4 -0
- data/app/assets/javascripts/pageflow/media_player.js +7 -3
- data/app/assets/javascripts/pageflow/media_player/handle_failed_play.js +34 -0
- data/app/assets/javascripts/pageflow/media_player/volume_fading/web_audio.js +29 -3
- data/app/assets/javascripts/pageflow/page_transitions.js +59 -15
- data/app/assets/javascripts/pageflow/page_type.js +5 -1
- data/app/assets/javascripts/pageflow/seed_entry_data.js +13 -0
- data/app/assets/javascripts/pageflow/slideshow.js +31 -11
- data/app/assets/javascripts/pageflow/slideshow/atmo.js +23 -12
- data/app/assets/javascripts/pageflow/slideshow/lazy_page_widget.js +9 -3
- data/app/assets/javascripts/pageflow/slideshow/navigation_direction.js +37 -0
- data/app/assets/javascripts/pageflow/slideshow/page_widget.js +12 -6
- data/app/assets/javascripts/pageflow/slideshow/scroll_indicator_widget.js +13 -16
- data/app/assets/javascripts/pageflow/slideshow/scroller_widget.js +49 -14
- data/app/assets/javascripts/pageflow/ui/views/mixins/input_view.js +10 -3
- data/app/assets/javascripts/pageflow/video_player/lazy.js +1 -1
- data/app/assets/stylesheets/pageflow/animations/bounce.scss +13 -1
- data/app/assets/stylesheets/pageflow/editor/base.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +78 -0
- data/app/assets/stylesheets/pageflow/editor/entry_preview.scss +41 -0
- data/app/assets/stylesheets/pageflow/editor/file_stages.scss +11 -3
- data/app/assets/stylesheets/pageflow/editor/help.scss +4 -14
- data/app/assets/stylesheets/pageflow/editor/help_image.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/inputs.scss +1 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/file_processing_state_display.scss +18 -0
- data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +12 -0
- data/app/assets/stylesheets/pageflow/entries.scss +29 -6
- data/app/assets/stylesheets/pageflow/mixins/breakpoints.scss +5 -3
- data/app/assets/stylesheets/pageflow/mixins/icons/fontawesome.scss +1 -1
- data/app/assets/stylesheets/pageflow/navigation_mobile.scss +5 -1
- data/app/assets/stylesheets/pageflow/page_transitions.scss +0 -6
- data/app/assets/stylesheets/pageflow/page_transitions/crossfade.scss +5 -1
- data/app/assets/stylesheets/pageflow/page_transitions/fade.scss +44 -36
- data/app/assets/stylesheets/pageflow/page_transitions/scroll.scss +96 -11
- data/app/assets/stylesheets/pageflow/slideshow.scss +0 -4
- data/app/assets/stylesheets/pageflow/themes/default/background_media_unmute_button.scss +68 -0
- data/app/assets/stylesheets/pageflow/themes/default/base.scss +1 -0
- data/app/assets/stylesheets/pageflow/themes/default/indicators/icons/icon_font.scss +7 -0
- data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -0
- data/app/controllers/pageflow/editor/files_controller.rb +9 -1
- data/app/helpers/pageflow/asset_urls_helper.rb +9 -0
- data/app/helpers/pageflow/background_image_helper.rb +6 -10
- data/app/helpers/pageflow/file_background_images_helper.rb +78 -0
- data/app/helpers/pageflow/pages_helper.rb +2 -2
- data/app/helpers/pageflow/render_json_helper.rb +3 -2
- data/app/models/concerns/pageflow/hosted_file.rb +2 -9
- data/app/models/concerns/pageflow/uploaded_file.rb +9 -0
- data/app/models/pageflow/draft_entry.rb +2 -2
- data/app/models/pageflow/image_file.rb +5 -20
- data/app/models/pageflow/image_file_css_background_image_urls.rb +17 -0
- data/app/models/pageflow/video_file_css_background_image_urls.rb +13 -0
- data/app/views/pageflow/editor/asset_urls/_asset_urls.json.jbuilder +4 -0
- data/app/views/pageflow/editor/entries/seed.json.erb +3 -1
- data/app/views/pageflow/editor/image_files/_image_file.json.jbuilder +1 -1
- data/app/views/pageflow/entries/_indicators.html.erb +8 -3
- data/app/views/pageflow/entries/edit.html.erb +1 -1
- data/app/views/pageflow/entries/show.css.erb +6 -20
- data/app/views/pageflow/file_background_images/_rule.css.erb +3 -0
- data/config/initializers/features.rb +1 -0
- data/config/locales/de.yml +20 -8
- data/config/locales/en.yml +23 -11
- data/config/routes.rb +1 -0
- data/lib/pageflow/built_in_file_type.rb +4 -0
- data/lib/pageflow/built_in_widget_type.rb +12 -0
- data/lib/pageflow/built_in_widget_types_plugin.rb +5 -0
- data/lib/pageflow/file_type.rb +39 -0
- data/lib/pageflow/file_types.rb +6 -0
- data/lib/pageflow/version.rb +1 -1
- data/spec/factories/hosted_files.rb +12 -8
- data/vendor/assets/javascripts/audio5.min.js +280 -129
- data/vendor/assets/javascripts/iscroll.js +16 -11
- metadata +47 -16
- data/app/assets/javascripts/pageflow/media_player/catch_play_promise.js +0 -23
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_in.scss +0 -66
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_in_right.scss +0 -68
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_left.scss +0 -20
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_over_from_left.scss +0 -12
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_over_from_right.scss +0 -12
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_right.scss +0 -20
- data/lib/pageflow/images/palette.png +0 -0
@@ -16,6 +16,13 @@ pageflow.FileStageItemView = Backbone.Marionette.ItemView.extend({
|
|
16
16
|
onRender: function() {
|
17
17
|
this.update();
|
18
18
|
this.$el.addClass(this.model.get('name'));
|
19
|
+
|
20
|
+
if (this.options.standAlone) {
|
21
|
+
this.$el.addClass('stand_alone');
|
22
|
+
}
|
23
|
+
else {
|
24
|
+
this.$el.addClass('indented');
|
25
|
+
}
|
19
26
|
},
|
20
27
|
|
21
28
|
update: function() {
|
data/app/assets/javascripts/pageflow/editor/views/inputs/file_processing_state_display_view.js
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
pageflow.FileProcessingStateDisplayView = Backbone.Marionette.View.extend({
|
2
|
+
className: 'file_processing_state_display',
|
3
|
+
|
4
|
+
mixins: [pageflow.inputView],
|
5
|
+
|
6
|
+
initialize: function() {
|
7
|
+
if (typeof this.options.collection === 'string') {
|
8
|
+
this.options.collection = pageflow.entry.getFileCollection(
|
9
|
+
pageflow.editor.fileTypes.findByCollectionName(this.options.collection)
|
10
|
+
);
|
11
|
+
}
|
12
|
+
|
13
|
+
this.listenTo(this.model, 'change:' + this.options.propertyName, this._update);
|
14
|
+
},
|
15
|
+
|
16
|
+
render: function() {
|
17
|
+
this._update();
|
18
|
+
return this;
|
19
|
+
},
|
20
|
+
|
21
|
+
_update: function() {
|
22
|
+
if (this.fileStagesView) {
|
23
|
+
this.stopListening(this.file.unfinishedStages);
|
24
|
+
|
25
|
+
this.fileStagesView.close();
|
26
|
+
this.fileStagesView = null;
|
27
|
+
}
|
28
|
+
|
29
|
+
this.file = this._getFile();
|
30
|
+
|
31
|
+
if (this.file) {
|
32
|
+
this.listenTo(this.file.unfinishedStages, 'add remove', this._updateClassNames);
|
33
|
+
|
34
|
+
this.fileStagesView = new pageflow.CollectionView({
|
35
|
+
tagName: 'ul',
|
36
|
+
collection: this.file.unfinishedStages,
|
37
|
+
itemViewConstructor: pageflow.FileStageItemView,
|
38
|
+
itemViewOptions: {
|
39
|
+
standAlone: true
|
40
|
+
}
|
41
|
+
});
|
42
|
+
|
43
|
+
this.appendSubview(this.fileStagesView);
|
44
|
+
}
|
45
|
+
|
46
|
+
this._updateClassNames();
|
47
|
+
},
|
48
|
+
|
49
|
+
_updateClassNames: function() {
|
50
|
+
this.$el.toggleClass('file_processing_state_display-empty', !this._hasItems());
|
51
|
+
},
|
52
|
+
|
53
|
+
_hasItems: function() {
|
54
|
+
return this.file && this.file.unfinishedStages.length;
|
55
|
+
},
|
56
|
+
|
57
|
+
_getFile: function() {
|
58
|
+
return this.model.getReference(this.options.propertyName, this.options.collection);
|
59
|
+
}
|
60
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
pageflow.SidebarFooterView = Backbone.Marionette.View.extend({
|
2
|
+
className: 'sidebar_footer',
|
3
|
+
|
4
|
+
render: function() {
|
5
|
+
if (pageflow.features.isEnabled('editor_emulation_mode')) {
|
6
|
+
this.appendSubview(new pageflow.EmulationModeButtonView({model: this.model}));
|
7
|
+
}
|
8
|
+
|
9
|
+
this.appendSubview(new pageflow.HelpButtonView());
|
10
|
+
return this;
|
11
|
+
}
|
12
|
+
});
|
data/app/assets/javascripts/pageflow/editor/views/widget_types/phone_horizontal_slideshow_mode.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
pageflow.editor.widgetTypes.register('phone_horizontal_slideshow_mode', {
|
2
|
+
configurationEditorView: pageflow.ConfigurationEditorView.extend({
|
3
|
+
configure: function() {
|
4
|
+
this.tab('phone_horizontal_slideshow_mode', function() {
|
5
|
+
this.view(pageflow.InfoBoxView, {
|
6
|
+
text: I18n.t('pageflow.editor.phone_horizontal_slideshow_mode.widget_type_info_box_text')
|
7
|
+
});
|
8
|
+
this.view(pageflow.HelpImageView, {
|
9
|
+
imageName: 'phone_horizontal_slideshow_mode'
|
10
|
+
});
|
11
|
+
});
|
12
|
+
}
|
13
|
+
})
|
14
|
+
});
|
@@ -1,5 +1,6 @@
|
|
1
1
|
//= require_self
|
2
|
-
|
2
|
+
|
3
|
+
//= require ./media_player/handle_failed_play
|
3
4
|
//= require ./media_player/volume_fading
|
4
5
|
//= require ./media_player/volume_binding
|
5
6
|
//= require ./media_player/load_waiting
|
@@ -8,7 +9,10 @@
|
|
8
9
|
|
9
10
|
pageflow.mediaPlayer = {
|
10
11
|
enhance: function(player, options) {
|
11
|
-
pageflow.mediaPlayer.
|
12
|
+
pageflow.mediaPlayer.handleFailedPlay(player, _.extend({
|
13
|
+
hasAutoplaySupport: pageflow.browser.has('autoplay support')
|
14
|
+
}, options));
|
15
|
+
|
12
16
|
pageflow.mediaPlayer.asyncPlay(player);
|
13
17
|
|
14
18
|
if (options.hooks) {
|
@@ -24,4 +28,4 @@ pageflow.mediaPlayer = {
|
|
24
28
|
pageflow.mediaPlayer.loadWaiting(player);
|
25
29
|
}
|
26
30
|
}
|
27
|
-
};
|
31
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
pageflow.mediaPlayer.handleFailedPlay = function(player, options) {
|
2
|
+
var originalPlay = player.play;
|
3
|
+
|
4
|
+
player.play = function(/* arguments */) {
|
5
|
+
var result = originalPlay.apply(player, arguments);
|
6
|
+
|
7
|
+
if (result && typeof result.catch !== 'undefined') {
|
8
|
+
return result.catch(function(e) {
|
9
|
+
if (e.name === 'NotAllowedError' && options.hasAutoplaySupport) {
|
10
|
+
if (options.fallbackToMutedAutoplay) {
|
11
|
+
player.muted(true);
|
12
|
+
|
13
|
+
return originalPlay.apply(player, arguments).then(
|
14
|
+
function() {
|
15
|
+
player.trigger('playmuted');
|
16
|
+
},
|
17
|
+
function() {
|
18
|
+
player.trigger('playfailed');
|
19
|
+
}
|
20
|
+
);
|
21
|
+
}
|
22
|
+
else {
|
23
|
+
player.trigger('playfailed');
|
24
|
+
}
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
pageflow.log('Caught play exception for video.');
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
};
|
@@ -12,10 +12,31 @@ pageflow.mediaPlayer.volumeFading.webAudio = function(player, audioContext) {
|
|
12
12
|
|
13
13
|
var allowedMinValue = 0.000001;
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
var originalPlay = player.play;
|
16
|
+
|
17
|
+
if (audioContext.state === 'suspended') {
|
18
|
+
pageflow.events.on('background_media:unmute', function() {
|
19
|
+
audioContext.resume();
|
20
|
+
});
|
21
|
+
|
22
|
+
audioContext.addEventListener('statechange', function() {
|
23
|
+
player.volume(currentValue);
|
24
|
+
});
|
25
|
+
}
|
26
|
+
|
27
|
+
player.play = function(/* arguments */) {
|
28
|
+
return originalPlay.apply(player, arguments);
|
29
|
+
};
|
17
30
|
|
31
|
+
player.volume = function(value) {
|
18
32
|
if (typeof value !== 'undefined') {
|
33
|
+
if (audioContext.state === 'suspended') {
|
34
|
+
currentValue = ensureInAllowedRange(value);
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
|
38
|
+
ensureGainNode();
|
39
|
+
|
19
40
|
cancel();
|
20
41
|
currentValue = ensureInAllowedRange(value);
|
21
42
|
|
@@ -27,6 +48,11 @@ pageflow.mediaPlayer.volumeFading.webAudio = function(player, audioContext) {
|
|
27
48
|
};
|
28
49
|
|
29
50
|
player.fadeVolume = function(value, duration) {
|
51
|
+
if (audioContext.state === 'suspended') {
|
52
|
+
currentValue = ensureInAllowedRange(value);
|
53
|
+
return new $.Deferred().resolve().promise();
|
54
|
+
}
|
55
|
+
|
30
56
|
ensureGainNode();
|
31
57
|
|
32
58
|
cancel();
|
@@ -106,4 +132,4 @@ pageflow.mediaPlayer.volumeFading.webAudio = function(player, audioContext) {
|
|
106
132
|
function ensureInAllowedRange(value) {
|
107
133
|
return value < allowedMinValue ? allowedMinValue : value;
|
108
134
|
}
|
109
|
-
};
|
135
|
+
};
|
@@ -1,29 +1,73 @@
|
|
1
|
-
pageflow.
|
2
|
-
|
1
|
+
pageflow.PageTransitions = pageflow.Object.extend({
|
2
|
+
initialize: function(navigationDirection) {
|
3
|
+
this.repository = {};
|
4
|
+
this.navigationDirection = navigationDirection;
|
5
|
+
},
|
3
6
|
|
4
7
|
register: function(name, options) {
|
5
8
|
this.repository[name] = options;
|
6
9
|
},
|
7
10
|
|
8
11
|
get: function(name) {
|
9
|
-
|
12
|
+
var transition = this.repository[name];
|
13
|
+
|
14
|
+
if (!transition) {
|
10
15
|
throw 'Unknown page transition "' + name + '"';
|
11
16
|
}
|
12
17
|
|
13
|
-
return this.
|
18
|
+
return this.navigationDirection.isHorizontal() ?
|
19
|
+
transition.h :
|
20
|
+
transition.v;
|
14
21
|
},
|
15
22
|
|
16
23
|
names: function() {
|
17
24
|
return _.keys(this.repository);
|
18
25
|
}
|
19
|
-
};
|
20
|
-
|
21
|
-
pageflow.pageTransitions.
|
22
|
-
|
23
|
-
pageflow.pageTransitions.register('
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
pageflow.pageTransitions.register('
|
29
|
-
|
26
|
+
});
|
27
|
+
|
28
|
+
pageflow.pageTransitions = new pageflow.PageTransitions(pageflow.navigationDirection);
|
29
|
+
|
30
|
+
pageflow.pageTransitions.register('fade', {
|
31
|
+
v: {className: 'fade fade-v', duration: 1100},
|
32
|
+
h: {className: 'fade fade-h', duration: 600}
|
33
|
+
});
|
34
|
+
|
35
|
+
pageflow.pageTransitions.register('crossfade', {
|
36
|
+
v: {className: 'crossfade', duration: 1100},
|
37
|
+
h: {className: 'crossfade crossfade-fast', duration: 600}
|
38
|
+
});
|
39
|
+
|
40
|
+
pageflow.pageTransitions.register('fade_to_black', {
|
41
|
+
v: {className: 'fade_to_black', duration: 2100},
|
42
|
+
h: {className: 'fade_to_black', duration: 2100}
|
43
|
+
});
|
44
|
+
|
45
|
+
pageflow.pageTransitions.register('cut', {
|
46
|
+
v: {className: 'cut', duration: 1100},
|
47
|
+
h: {className: 'cut', duration: 1100}
|
48
|
+
});
|
49
|
+
|
50
|
+
pageflow.pageTransitions.register('scroll', {
|
51
|
+
v: {className: 'scroll scroll-in scroll-from_bottom', duration: 1100},
|
52
|
+
h: {className: 'scroll scroll-in scroll-from_right scroll-fast', duration: 600}
|
53
|
+
});
|
54
|
+
|
55
|
+
pageflow.pageTransitions.register('scroll_right', {
|
56
|
+
v: {className: 'scroll scroll-in scroll-from_right', duration: 1100},
|
57
|
+
h: {className: 'scroll scroll-in scroll-from_bottom scroll-fast', duration: 600}
|
58
|
+
});
|
59
|
+
|
60
|
+
pageflow.pageTransitions.register('scroll_left', {
|
61
|
+
v: {className: 'scroll scroll-in scroll-from_left', duration: 1100},
|
62
|
+
h: {className: 'scroll scroll-in scroll-from_top scroll-fast', duration: 600}
|
63
|
+
});
|
64
|
+
|
65
|
+
pageflow.pageTransitions.register('scroll_over_from_right', {
|
66
|
+
v: {className: 'scroll scroll-over scroll-from_right', duration: 1100},
|
67
|
+
h: {className: 'scroll scroll-over scroll-from_bottom scroll-fast', duration: 600}
|
68
|
+
});
|
69
|
+
|
70
|
+
pageflow.pageTransitions.register('scroll_over_from_left', {
|
71
|
+
v: {className: 'scroll scroll-over scroll-from_left', duration: 1100},
|
72
|
+
h: {className: 'scroll scroll-over scroll-from_top scroll-fast', duration: 600}
|
73
|
+
});
|
@@ -21,6 +21,10 @@ pageflow.pageType = (function() {
|
|
21
21
|
return [];
|
22
22
|
},
|
23
23
|
|
24
|
+
isPageChangeAllowed: function(pageElement, configuarion, options) {
|
25
|
+
return true;
|
26
|
+
},
|
27
|
+
|
24
28
|
prepareNextPageTimeout: 200
|
25
29
|
};
|
26
30
|
|
@@ -42,4 +46,4 @@ pageflow.pageType = (function() {
|
|
42
46
|
return new this.repository[name]();
|
43
47
|
}
|
44
48
|
};
|
45
|
-
}());
|
49
|
+
}());
|
@@ -2,6 +2,15 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
2
2
|
initialize: function(options) {
|
3
3
|
this.theme = options.theme;
|
4
4
|
|
5
|
+
this.files = _(_.keys(options.files || {})).reduce(function(memo, collectionName) {
|
6
|
+
memo[collectionName] = _(options.files[collectionName]).reduce(function(result, file) {
|
7
|
+
result[file.id] = file;
|
8
|
+
return result;
|
9
|
+
}, {});
|
10
|
+
|
11
|
+
return memo;
|
12
|
+
}, {});
|
13
|
+
|
5
14
|
this.storylineConfigurations = _(options.storylines).reduce(function(memo, storyline) {
|
6
15
|
memo[storyline.id] = storyline.configuration;
|
7
16
|
return memo;
|
@@ -43,6 +52,10 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
43
52
|
return this.theme[name];
|
44
53
|
},
|
45
54
|
|
55
|
+
getFile: function(collectionName, id) {
|
56
|
+
return this.files[collectionName][id];
|
57
|
+
},
|
58
|
+
|
46
59
|
getChapterConfiguration: function(id) {
|
47
60
|
return this.chapterConfigurations[id] || {};
|
48
61
|
},
|
@@ -12,6 +12,7 @@
|
|
12
12
|
//=require ./slideshow/hide_text
|
13
13
|
//=require ./slideshow/hide_text_on_swipe
|
14
14
|
//=require ./slideshow/dom_order_scroll_navigator
|
15
|
+
//=require ./slideshow/navigation_direction
|
15
16
|
|
16
17
|
pageflow.Slideshow = function($el, configurations) {
|
17
18
|
var transitioning = false,
|
@@ -44,10 +45,6 @@ pageflow.Slideshow = function($el, configurations) {
|
|
44
45
|
return result;
|
45
46
|
}
|
46
47
|
|
47
|
-
function currentPagePermaId() {
|
48
|
-
return parseInt(currentPage.attr('id'), 10);
|
49
|
-
}
|
50
|
-
|
51
48
|
this.nextPageExists = function() {
|
52
49
|
return this.scrollNavigator.nextPageExists(currentPage, pages);
|
53
50
|
};
|
@@ -73,11 +70,13 @@ pageflow.Slideshow = function($el, configurations) {
|
|
73
70
|
};
|
74
71
|
|
75
72
|
this.parentPageExists = function() {
|
76
|
-
return !!pageflow.entryData.getParentPagePermaIdByPagePermaId(currentPagePermaId());
|
73
|
+
return !!pageflow.entryData.getParentPagePermaIdByPagePermaId(this.currentPagePermaId());
|
77
74
|
};
|
78
75
|
|
79
76
|
this.goToParentPage = function() {
|
80
|
-
this.goToByPermaId(pageflow.entryData.getParentPagePermaIdByPagePermaId(
|
77
|
+
this.goToByPermaId(pageflow.entryData.getParentPagePermaIdByPagePermaId(
|
78
|
+
this.currentPagePermaId()
|
79
|
+
));
|
81
80
|
};
|
82
81
|
|
83
82
|
this.goToById = function(id, options) {
|
@@ -94,6 +93,18 @@ pageflow.Slideshow = function($el, configurations) {
|
|
94
93
|
options = options || {};
|
95
94
|
|
96
95
|
if (page.length && !page.is(currentPage)) {
|
96
|
+
var cancelled = false;
|
97
|
+
|
98
|
+
pageflow.events.trigger('page:changing', {
|
99
|
+
cancel: function() {
|
100
|
+
cancelled = true;
|
101
|
+
}
|
102
|
+
});
|
103
|
+
|
104
|
+
if (cancelled) {
|
105
|
+
return;
|
106
|
+
}
|
107
|
+
|
97
108
|
transitionMutex(function() {
|
98
109
|
var previousPage = currentPage;
|
99
110
|
currentPage = page;
|
@@ -149,6 +160,10 @@ pageflow.Slideshow = function($el, configurations) {
|
|
149
160
|
return currentPage;
|
150
161
|
};
|
151
162
|
|
163
|
+
this.currentPagePermaId = function() {
|
164
|
+
return parseInt(currentPage.attr('id'), 10);
|
165
|
+
};
|
166
|
+
|
152
167
|
this.currentPageConfiguration = function() {
|
153
168
|
return currentPage.page('getConfiguration');
|
154
169
|
};
|
@@ -191,12 +206,16 @@ pageflow.Slideshow = function($el, configurations) {
|
|
191
206
|
pageflow.events.trigger('resize');
|
192
207
|
};
|
193
208
|
|
194
|
-
$el.on('
|
195
|
-
|
209
|
+
$el.on(pageflow.navigationDirection.getEventName('scrollerbumpback'), _.bind(function(event) {
|
210
|
+
if (currentPage.page('isPageChangeAllowed', {type: 'bumpback'})) {
|
211
|
+
this.back();
|
212
|
+
}
|
196
213
|
}, this));
|
197
214
|
|
198
|
-
$el.on('
|
199
|
-
|
215
|
+
$el.on(pageflow.navigationDirection.getEventName('scrollerbumpnext'), _.bind(function(event) {
|
216
|
+
if (currentPage.page('isPageChangeAllowed', {type: 'bumpnext'})) {
|
217
|
+
this.next();
|
218
|
+
}
|
200
219
|
}, this));
|
201
220
|
|
202
221
|
$el.on('click', 'a.to_top', _.bind(function() {
|
@@ -238,7 +257,8 @@ pageflow.Slideshow.setup = function(options) {
|
|
238
257
|
pageflow.atmo = pageflow.Atmo.create(
|
239
258
|
pageflow.slides,
|
240
259
|
pageflow.events,
|
241
|
-
pageflow.audio
|
260
|
+
pageflow.audio,
|
261
|
+
pageflow.backgroundMedia
|
242
262
|
);
|
243
263
|
|
244
264
|
pageflow.history = pageflow.History.create(
|