pageflow 0.9.2 → 0.10.0
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 +5 -13
- data/CHANGELOG.md +193 -11
- data/README.md +9 -1
- data/Rakefile +5 -0
- data/admins/pageflow/accounts.rb +2 -1
- data/admins/pageflow/entry.rb +21 -1
- data/admins/pageflow/revisions.rb +1 -1
- data/app/assets/fonts/pageflow/entypo-license.txt +358 -0
- data/app/assets/fonts/pageflow/fontawesome-license.txt +1 -0
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.svg +1236 -194
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-license.txt +93 -0
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.svg +1153 -839
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.svg +1252 -199
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.woff +0 -0
- data/app/assets/javascripts/pageflow/base.js +2 -0
- data/app/assets/javascripts/pageflow/browser/agent.js +25 -0
- data/app/assets/javascripts/pageflow/browser/css_animations.js +18 -0
- data/app/assets/javascripts/pageflow/browser/mobile_platform.js +1 -4
- data/app/assets/javascripts/pageflow/browser/video.js +8 -1
- data/app/assets/javascripts/pageflow/chapter_filter.js +6 -16
- data/app/assets/javascripts/pageflow/editor/api.js +6 -2
- data/app/assets/javascripts/pageflow/editor/api/page_type.js +12 -0
- data/app/assets/javascripts/pageflow/editor/base.js +4 -0
- data/app/assets/javascripts/pageflow/editor/collections/chapter_pages_collection.js +4 -1
- data/app/assets/javascripts/pageflow/editor/collections/chapters_collection.js +1 -5
- data/app/assets/javascripts/pageflow/editor/collections/mixins/add_and_return_model.js +11 -0
- data/app/assets/javascripts/pageflow/editor/collections/mixins/ordered_collection.js +6 -4
- data/app/assets/javascripts/pageflow/editor/collections/ordered_page_links_collection.js +9 -0
- data/app/assets/javascripts/pageflow/editor/collections/page_links_collection.js +78 -0
- data/app/assets/javascripts/pageflow/editor/collections/pages_collection.js +9 -3
- data/app/assets/javascripts/pageflow/editor/collections/storyline_chapters_collection.js +35 -0
- data/app/assets/javascripts/pageflow/editor/collections/storylines_collection.js +33 -0
- data/app/assets/javascripts/pageflow/editor/controllers/sidebar_controller.js +19 -2
- data/app/assets/javascripts/pageflow/editor/initializers/edit_lock.js +1 -1
- data/app/assets/javascripts/pageflow/editor/initializers/setup_collections.js +11 -0
- data/app/assets/javascripts/pageflow/editor/initializers/setup_common_seed.js +3 -0
- data/app/assets/javascripts/pageflow/editor/initializers/stylesheet_reloading.js +11 -0
- data/app/assets/javascripts/pageflow/editor/models/chapter.js +14 -7
- data/app/assets/javascripts/pageflow/editor/models/chapter_scaffold.js +13 -0
- data/app/assets/javascripts/pageflow/editor/models/edit_lock_container.js +4 -4
- data/app/assets/javascripts/pageflow/editor/models/entry.js +33 -4
- data/app/assets/javascripts/pageflow/editor/models/mixins/persited_promise.js +18 -0
- data/app/assets/javascripts/pageflow/editor/models/page.js +4 -0
- data/app/assets/javascripts/pageflow/editor/models/page_link.js +37 -0
- data/app/assets/javascripts/pageflow/editor/models/page_link_file_selection_handler.js +14 -0
- data/app/assets/javascripts/pageflow/editor/models/preview_entry_data.js +15 -0
- data/app/assets/javascripts/pageflow/editor/models/scaffold.js +26 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline.js +99 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_configuration.js +15 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_ordering.js +117 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_scaffold.js +23 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_transitive_child_pages.js +33 -0
- data/app/assets/javascripts/pageflow/editor/routers/sidebar_router.js +3 -0
- data/app/assets/javascripts/pageflow/editor/templates/edit_entry.jst.ejs +1 -6
- data/app/assets/javascripts/pageflow/editor/templates/edit_page_link.jst.ejs +3 -0
- data/app/assets/javascripts/pageflow/editor/templates/edit_storyline.jst.ejs +12 -0
- data/app/assets/javascripts/pageflow/editor/templates/page_link_item.jst.ejs +1 -0
- data/app/assets/javascripts/pageflow/editor/templates/page_selection.jst.ejs +2 -2
- data/app/assets/javascripts/pageflow/editor/templates/storyline_outline.jst.ejs +4 -0
- data/app/assets/javascripts/pageflow/editor/templates/storyline_picker.jst.ejs +7 -0
- data/app/assets/javascripts/pageflow/editor/utils/reload_stylesheet.js +9 -0
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/options.js +2 -2
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/page_link.js +10 -0
- data/app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js +0 -4
- data/app/assets/javascripts/pageflow/editor/views/edit_entry_view.js +9 -15
- data/app/assets/javascripts/pageflow/editor/views/edit_meta_data_view.js +14 -6
- data/app/assets/javascripts/pageflow/editor/views/edit_page_link_view.js +47 -0
- data/app/assets/javascripts/pageflow/editor/views/edit_storyline_view.js +97 -0
- data/app/assets/javascripts/pageflow/editor/views/editor_view.js +6 -3
- data/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js +13 -7
- data/app/assets/javascripts/pageflow/editor/views/file_item_view.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/inputs/page_link_input_view.js +3 -1
- data/app/assets/javascripts/pageflow/editor/views/locked_view.js +3 -3
- data/app/assets/javascripts/pageflow/editor/views/mixins/loadable.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/page_item_view.js +2 -0
- data/app/assets/javascripts/pageflow/editor/views/page_link_configuration_editor_view.js +7 -0
- data/app/assets/javascripts/pageflow/editor/views/page_link_item_view.js +8 -1
- data/app/assets/javascripts/pageflow/editor/views/page_preview_view.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/page_selection_view.js +13 -12
- data/app/assets/javascripts/pageflow/editor/views/storyline_outline_view.js +33 -0
- data/app/assets/javascripts/pageflow/editor/views/storyline_picker_view.js +114 -0
- data/app/assets/javascripts/pageflow/entry_data.js +38 -4
- data/app/assets/javascripts/pageflow/highlighted_page.js +5 -5
- data/app/assets/javascripts/pageflow/history.js +1 -1
- data/app/assets/javascripts/pageflow/native_scrolling.js +14 -0
- data/app/assets/javascripts/pageflow/page_transitions.js +3 -1
- data/app/assets/javascripts/pageflow/page_type.js +2 -0
- data/app/assets/javascripts/pageflow/ready.js +4 -1
- data/app/assets/javascripts/pageflow/seed_entry_data.js +28 -1
- data/app/assets/javascripts/pageflow/slideshow.js +11 -8
- data/app/assets/javascripts/pageflow/slideshow/dom_order_scroll_navigator.js +93 -8
- data/app/assets/javascripts/pageflow/slideshow/hidden_text_indicator_widget.js +5 -3
- data/app/assets/javascripts/pageflow/slideshow/lazy_page_widget.js +4 -0
- data/app/assets/javascripts/pageflow/slideshow/page_widget.js +15 -6
- data/app/assets/javascripts/pageflow/ui/templates/tooltip.jst.ejs +2 -0
- data/app/assets/javascripts/pageflow/ui/views/inputs/text_area_input_view.js +17 -4
- data/app/assets/javascripts/pageflow/ui/views/mixins/tooltip_container.js +42 -0
- data/app/assets/javascripts/pageflow/ui/views/tooltip_view.js +49 -0
- data/app/assets/javascripts/pageflow/video_player.js +2 -2
- data/app/assets/javascripts/pageflow/video_player/{filter_for_silk.js → filter_sources.js} +2 -2
- data/app/assets/javascripts/pageflow/widgets/navigation.js +17 -14
- data/app/assets/javascripts/pageflow/widgets/navigation_mobile.js +7 -2
- data/app/assets/javascripts/pageflow/widgets/overview.js +9 -6
- data/app/assets/javascripts/pageflow/widgets/page_navigation_list.js +51 -13
- data/app/assets/javascripts/pageflow/widgets/page_navigation_list_animation.js +48 -0
- data/app/assets/javascripts/pageflow/widgets/parent_page_button.js +9 -2
- data/app/assets/stylesheets/pageflow/admin.css.scss +2 -15
- data/app/assets/stylesheets/pageflow/admin/features.scss +5 -0
- data/app/assets/stylesheets/pageflow/admin/forms.scss +18 -0
- data/app/assets/stylesheets/pageflow/animations.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/animations/navigation_bar.scss +89 -0
- data/app/assets/stylesheets/pageflow/delayed_text_fade_in.css.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/base.css.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/menu.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/editor/outline.css.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/page_links.css.scss +9 -1
- data/app/assets/stylesheets/pageflow/editor/page_selection.css.scss +7 -1
- data/app/assets/stylesheets/pageflow/editor/storyline_picker.css.scss +32 -0
- data/app/assets/stylesheets/pageflow/extendables.scss +26 -0
- data/app/assets/stylesheets/pageflow/mixins/pageflow.css.scss +25 -0
- data/app/assets/stylesheets/pageflow/navigation_bar.css.scss +64 -4
- data/app/assets/stylesheets/pageflow/navigation_mobile.css.scss +56 -0
- data/app/assets/stylesheets/pageflow/page_transitions.css.scss +4 -1
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_over_from_left.scss +12 -0
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_over_from_right.scss +12 -0
- data/app/assets/stylesheets/pageflow/page_types/video.css.scss +5 -1
- data/app/assets/stylesheets/pageflow/themes/default/page.css.scss +180 -42
- data/app/assets/stylesheets/pageflow/ui.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/ui/forms.css.scss +11 -2
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/ui/tabs_view.css.scss +0 -3
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +57 -0
- data/app/controllers/concerns/pageflow/entry_password_protection.rb +13 -0
- data/app/controllers/pageflow/chapters_controller.rb +24 -9
- data/app/controllers/pageflow/edit_locks_controller.rb +2 -2
- data/app/controllers/pageflow/editor/files_controller.rb +0 -2
- data/app/controllers/pageflow/editor/widgets_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +5 -9
- data/app/controllers/pageflow/files_controller.rb +3 -0
- data/app/controllers/pageflow/storylines_controller.rb +69 -0
- data/app/helpers/pageflow/admin/features_helper.rb +17 -6
- data/app/helpers/pageflow/admin/widgets_helper.rb +18 -0
- data/app/helpers/pageflow/audio_files_helper.rb +2 -2
- data/app/helpers/pageflow/common_entry_seed_helper.rb +52 -0
- data/app/helpers/pageflow/entries_helper.rb +7 -1
- data/app/helpers/pageflow/entry_json_seed_helper.rb +27 -10
- data/app/helpers/pageflow/meta_tags_helper.rb +11 -0
- data/app/helpers/pageflow/page_types_helper.rb +9 -5
- data/app/helpers/pageflow/pages_helper.rb +9 -96
- data/app/helpers/pageflow/public_i18n_helper.rb +13 -0
- data/app/helpers/pageflow/social_share_helper.rb +1 -1
- data/app/helpers/pageflow/video_files_helper.rb +133 -0
- data/app/helpers/pageflow/widgets_helper.rb +3 -9
- data/app/models/concerns/pageflow/feature_target.rb +21 -3
- data/app/models/concerns/pageflow/hosted_file.rb +4 -0
- data/app/models/pageflow/account.rb +2 -2
- data/app/models/pageflow/chapter.rb +4 -4
- data/app/models/pageflow/chapter_scaffold.rb +33 -0
- data/app/models/pageflow/cname_theming_request_scope.rb +7 -1
- data/app/models/pageflow/draft_entry.rb +13 -2
- data/app/models/pageflow/edit_lock.rb +2 -2
- data/app/models/pageflow/entry.rb +3 -2
- data/app/models/pageflow/image_file.rb +6 -0
- data/app/models/pageflow/published_entry.rb +13 -2
- data/app/models/pageflow/revision.rb +17 -4
- data/app/models/pageflow/storyline.rb +23 -0
- data/app/models/pageflow/storyline_scaffold.rb +27 -0
- data/app/models/pageflow/theming.rb +4 -0
- data/app/models/pageflow/widget.rb +16 -12
- data/app/views/admin/accounts/_form.html.erb +8 -12
- data/app/views/admin/accounts/_widgets_inline_help.html.erb +5 -0
- data/app/views/layouts/pageflow/application.html.erb +4 -1
- data/app/views/pageflow/admin/widgets/_fields.html.erb +9 -0
- data/app/views/pageflow/config/_editor_seeds.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entries/_entry.json.jbuilder +2 -2
- data/app/views/pageflow/editor/entries/_other_entry.json.jbuilder +1 -0
- data/app/views/pageflow/editor/entries/index.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entries/seed.json.erb +4 -1
- data/app/views/pageflow/editor/files/_file.json.jbuilder +4 -0
- data/app/views/pageflow/editor/themings/_theming.json.jbuilder +1 -0
- data/app/views/pageflow/entries/_entry.html.erb +2 -2
- data/app/views/pageflow/entries/_ie8_hint.html.erb +2 -2
- data/app/views/pageflow/entries/_indicators.html.erb +3 -3
- data/app/views/pageflow/entries/_mobile_navigation.html.erb +6 -5
- data/app/views/pageflow/entries/_multimedia_alert.html.erb +6 -6
- data/app/views/pageflow/entries/_non_js_hint.html.erb +1 -1
- data/app/views/pageflow/entries/_skip_links.html.erb +3 -3
- data/app/views/pageflow/entries/edit.html.erb +4 -2
- data/app/views/pageflow/entries/navigation/_bar_bottom.html.erb +6 -5
- data/app/views/pageflow/entries/navigation/_bar_top.html.erb +13 -13
- data/app/views/pageflow/entries/navigation/_home_button.html.erb +2 -2
- data/app/views/pageflow/entries/navigation/_page.html.erb +1 -1
- data/app/views/pageflow/entries/overview/_chapter.html.erb +1 -1
- data/app/views/pageflow/entries/overview/_entry.html.erb +7 -6
- data/app/views/pageflow/entries/share_menu/_facebook_link.html.erb +1 -1
- data/app/views/pageflow/entries/share_menu/_google_link.html.erb +1 -1
- data/app/views/pageflow/entries/share_menu/_twitter_link.html.erb +1 -1
- data/app/views/pageflow/entries/show.html.erb +4 -1
- data/app/views/pageflow/file_types/_thumbnails.css.erb +2 -0
- data/app/views/pageflow/meta_tags/_entry.html.erb +4 -0
- data/app/views/pageflow/pages/_page.html.erb +2 -2
- data/app/views/pageflow/pages/templates/_audio.html.erb +2 -2
- data/app/views/pageflow/pages/templates/_audio_loop.html.erb +1 -1
- data/app/views/pageflow/pages/templates/_background_video.html.erb +8 -3
- data/app/views/pageflow/pages/templates/_video.html.erb +9 -4
- data/app/views/pageflow/public_i18n/_javascript_tag.html.erb +5 -0
- data/app/views/pageflow/social_share/_entry_meta_tags.html.erb +1 -1
- data/app/views/pageflow/video_files/_script_tag.html.erb +3 -0
- data/app/views/pageflow/video_files/_video_file.html.erb +4 -1
- data/app/views/pageflow/video_files/_video_tag.html.erb +7 -0
- data/config/initializers/admin_resource_tabs.rb +1 -0
- data/config/initializers/features.rb +3 -1
- data/config/initializers/paperclip.rb +5 -0
- data/config/locales/de.yml +205 -601
- data/config/locales/en.yml +198 -405
- data/config/routes.rb +10 -2
- data/db/migrate/20150826125417_create_pageflow_storylines.rb +12 -0
- data/db/migrate/20150826125744_add_storyline_id_to_chapters.rb +6 -0
- data/db/migrate/20150826125745_insert_main_storylines.rb +28 -0
- data/db/migrate/20150830105831_remove_revision_id_from_chapters.rb +5 -0
- data/db/migrate/20150830110006_remove_entry_id_from_chapters.rb +5 -0
- data/db/migrate/20160201130118_add_additional_cnames_to_themings.rb +5 -0
- data/db/migrate/20160216130336_add_meta_fields_to_revision.rb +7 -0
- data/lib/generators/pageflow/initializer/templates/pageflow.rb +7 -0
- data/lib/pageflow/ability_mixin.rb +7 -1
- data/lib/pageflow/configuration.rb +27 -2
- data/lib/pageflow/engine.rb +4 -1
- data/lib/pageflow/features.rb +24 -0
- data/lib/pageflow/global_config_api.rb +1 -0
- data/lib/pageflow/seeds.rb +4 -2
- data/lib/pageflow/theme.rb +4 -0
- data/lib/pageflow/version.rb +1 -1
- data/spec/factories/chapters.rb +6 -3
- data/spec/factories/storylines.rb +13 -0
- metadata +1021 -928
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.svg +0 -768
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.svg +0 -968
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/thesansboldplain.eot +0 -0
- data/app/assets/fonts/pageflow/thesansboldplain.svg +0 -228
- data/app/assets/fonts/pageflow/thesansboldplain.ttf +0 -0
- data/app/assets/fonts/pageflow/thesansboldplain.woff +0 -0
- data/app/assets/fonts/pageflow/thesanssemiboldplain.eot +0 -0
- data/app/assets/fonts/pageflow/thesanssemiboldplain.svg +0 -228
- data/app/assets/fonts/pageflow/thesanssemiboldplain.ttf +0 -0
- data/app/assets/fonts/pageflow/thesanssemiboldplain.woff +0 -0
- data/app/assets/javascripts/pageflow/browser/hashchange_support.js +0 -8
- data/app/assets/javascripts/pageflow/widgets/button.js +0 -22
- data/app/views/layouts/pageflow/_meta_tags.html.erb +0 -5
- data/app/views/pageflow/pages/_video_tag.html.erb +0 -13
@@ -7,29 +7,63 @@ pageflow.EntryData = pageflow.Object.extend({
|
|
7
7
|
throw 'Not implemented';
|
8
8
|
},
|
9
9
|
|
10
|
+
getPagePosition: function(permaId) {
|
11
|
+
throw 'Not implemented';
|
12
|
+
},
|
13
|
+
|
10
14
|
getChapterConfiguration: function(id) {
|
11
15
|
throw 'Not implemented';
|
12
16
|
},
|
13
17
|
|
18
|
+
getStorylineConfiguration: function(id) {
|
19
|
+
throw 'Not implemented';
|
20
|
+
},
|
21
|
+
|
14
22
|
getChapterIdByPagePermaId: function(permaId) {
|
15
23
|
throw 'Not implemented';
|
16
24
|
},
|
17
25
|
|
26
|
+
getStorylineIdByChapterId: function(permaId) {
|
27
|
+
throw 'Not implemented';
|
28
|
+
},
|
29
|
+
|
18
30
|
getChapterPagePermaIds: function(id) {
|
19
31
|
throw 'Not implemented';
|
20
32
|
},
|
21
33
|
|
22
34
|
getParentPagePermaIdByPagePermaId: function(permaId) {
|
35
|
+
var storylineId = this.getStorylineIdByPagePermaId(permaId);
|
36
|
+
return this.getParentPagePermaId(storylineId);
|
37
|
+
},
|
38
|
+
|
39
|
+
getStorylineIdByPagePermaId: function(permaId) {
|
23
40
|
var chapterId = this.getChapterIdByPagePermaId(permaId);
|
24
|
-
return this.
|
41
|
+
return this.getStorylineIdByChapterId(chapterId);
|
42
|
+
},
|
43
|
+
|
44
|
+
getParentStorylineId: function(storylineId) {
|
45
|
+
var parentPagePermaId = this.getParentPagePermaId(storylineId);
|
46
|
+
return parentPagePermaId && this.getStorylineIdByPagePermaId(parentPagePermaId);
|
25
47
|
},
|
26
48
|
|
27
49
|
getParentChapterId: function(chapterId) {
|
28
|
-
var
|
50
|
+
var storylineId = this.getStorylineIdByChapterId(chapterId);
|
51
|
+
var pagePermaId = this.getParentPagePermaId(storylineId);
|
29
52
|
return pagePermaId && this.getChapterIdByPagePermaId(pagePermaId);
|
30
53
|
},
|
31
54
|
|
32
|
-
getParentPagePermaId: function(
|
33
|
-
return this.
|
55
|
+
getParentPagePermaId: function(storylineId) {
|
56
|
+
return this.getStorylineConfiguration(storylineId).parent_page_perma_id;
|
57
|
+
},
|
58
|
+
|
59
|
+
getStorylineLevel: function(storylineId) {
|
60
|
+
var parentStorylineId = this.getParentStorylineId(storylineId);
|
61
|
+
|
62
|
+
if (parentStorylineId) {
|
63
|
+
return this.getStorylineLevel(parentStorylineId) + 1;
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
return 0;
|
67
|
+
}
|
34
68
|
}
|
35
69
|
});
|
@@ -4,10 +4,10 @@ pageflow.HighlightedPage = pageflow.Object.extend({
|
|
4
4
|
},
|
5
5
|
|
6
6
|
getPagePermaId: function(currentPagePermaId) {
|
7
|
-
var
|
7
|
+
var storylineId = this.entry.getStorylineIdByPagePermaId(currentPagePermaId);
|
8
8
|
|
9
|
-
if (this.getNavigationBarMode(
|
10
|
-
var parentPagePermaId = this.entry.getParentPagePermaId(
|
9
|
+
if (this.getNavigationBarMode(storylineId) === 'inherit_from_parent') {
|
10
|
+
var parentPagePermaId = this.entry.getParentPagePermaId(storylineId);
|
11
11
|
|
12
12
|
return parentPagePermaId &&
|
13
13
|
this.getPagePermaId(parentPagePermaId);
|
@@ -27,8 +27,8 @@ pageflow.HighlightedPage = pageflow.Object.extend({
|
|
27
27
|
return this.entry.getPageConfiguration(permaId).display_in_navigation !== false;
|
28
28
|
},
|
29
29
|
|
30
|
-
getNavigationBarMode: function(
|
31
|
-
return this.entry.
|
30
|
+
getNavigationBarMode: function(storylineId) {
|
31
|
+
return this.entry.getStorylineConfiguration(storylineId).navigation_bar_mode;
|
32
32
|
},
|
33
33
|
|
34
34
|
getChapterPagesUntil: function(pagePermaId) {
|
@@ -46,7 +46,7 @@ pageflow.History.create = function(slideshow, options) {
|
|
46
46
|
|
47
47
|
var adapter;
|
48
48
|
|
49
|
-
if (options.simulate
|
49
|
+
if (options.simulate) {
|
50
50
|
adapter = new pageflow.History.SimulatedAdapter();
|
51
51
|
}
|
52
52
|
else if (pageflow.browser.has('pushstate support')) {
|
@@ -0,0 +1,14 @@
|
|
1
|
+
pageflow.nativeScrolling = {
|
2
|
+
preventScrollBouncing: function(slideshow) {
|
3
|
+
slideshow.on('touchmove', function (e) {
|
4
|
+
e.preventDefault();
|
5
|
+
});
|
6
|
+
},
|
7
|
+
|
8
|
+
preventScrollingOnEmbed: function(slideshow) {
|
9
|
+
slideshow.on('wheel mousewheel DOMMouseScroll', function(e) {
|
10
|
+
e.stopPropagation();
|
11
|
+
e.preventDefault();
|
12
|
+
});
|
13
|
+
}
|
14
|
+
};
|
@@ -24,4 +24,6 @@ pageflow.pageTransitions.register('fade_to_black', {duration: 2100});
|
|
24
24
|
pageflow.pageTransitions.register('cut', {duration: 1100});
|
25
25
|
pageflow.pageTransitions.register('scroll', {duration: 1100});
|
26
26
|
pageflow.pageTransitions.register('scroll_right', {duration: 1100});
|
27
|
-
pageflow.pageTransitions.register('scroll_left', {duration: 1100});
|
27
|
+
pageflow.pageTransitions.register('scroll_left', {duration: 1100});
|
28
|
+
pageflow.pageTransitions.register('scroll_over_from_right', {duration: 1100});
|
29
|
+
pageflow.pageTransitions.register('scroll_over_from_left', {duration: 1100});
|
@@ -14,6 +14,8 @@ pageflow.pageType = (function() {
|
|
14
14
|
deactivating: function(pageElement, configuarion) {},
|
15
15
|
deactivated: function(pageElement, configuarion) {},
|
16
16
|
update: function(pageElement, configuarion) {},
|
17
|
+
cleanup: function(pageElement, configuarion) {},
|
18
|
+
|
17
19
|
embeddedEditorViews: function() {},
|
18
20
|
|
19
21
|
linkedPages: function() {
|
@@ -1,11 +1,13 @@
|
|
1
1
|
pageflow.ready = new $.Deferred(function(readyDeferred) {
|
2
2
|
window.onload = function() {
|
3
3
|
pageflow.browser.detectFeatures().then(function() {
|
4
|
+
var slideshow = $('[data-role=slideshow]');
|
5
|
+
|
4
6
|
$('body').one('pagepreloaded', function() {
|
5
7
|
readyDeferred.resolve();
|
6
8
|
});
|
7
9
|
|
8
|
-
|
10
|
+
slideshow.each(function() {
|
9
11
|
pageflow.entryData = new pageflow.SeedEntryData(
|
10
12
|
pageflow.seed
|
11
13
|
);
|
@@ -30,6 +32,7 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
|
|
30
32
|
});
|
31
33
|
|
32
34
|
pageflow.links.setup();
|
35
|
+
pageflow.nativeScrolling.preventScrollingOnEmbed(slideshow);
|
33
36
|
});
|
34
37
|
};
|
35
38
|
}).promise();
|
@@ -2,7 +2,17 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
2
2
|
initialize: function(options) {
|
3
3
|
this.theming = options.theming;
|
4
4
|
|
5
|
-
this.
|
5
|
+
this.storylineConfigurations = options.storyline_configurations;
|
6
|
+
|
7
|
+
this.storylineIdsByChapterIds = _(options.chapters).reduce(function(memo, chapter) {
|
8
|
+
memo[chapter.id] = chapter.storyline_id;
|
9
|
+
return memo;
|
10
|
+
}, {});
|
11
|
+
|
12
|
+
this.chapterConfigurations = _.reduce(options.chapters, function(memo, chapter) {
|
13
|
+
memo[chapter.id] = chapter.configuration;
|
14
|
+
return memo;
|
15
|
+
}, {});
|
6
16
|
|
7
17
|
this.chapterPagePermaIds = _(options.pages).reduce(function(memo, page) {
|
8
18
|
memo[page.chapter_id] = memo[page.chapter_id] || [];
|
@@ -19,6 +29,11 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
19
29
|
memo[page.perma_id] = page.configuration;
|
20
30
|
return memo;
|
21
31
|
}, {});
|
32
|
+
|
33
|
+
this.pagePositions = _.reduce(options.pages, function(memo, page, index) {
|
34
|
+
memo[page.perma_id] = index;
|
35
|
+
return memo;
|
36
|
+
}, {});
|
22
37
|
},
|
23
38
|
|
24
39
|
getThemingOption: function(name) {
|
@@ -37,7 +52,19 @@ pageflow.SeedEntryData = pageflow.EntryData.extend({
|
|
37
52
|
return this.pageConfigurations[permaId] || {};
|
38
53
|
},
|
39
54
|
|
55
|
+
getPagePosition: function(permaId) {
|
56
|
+
return this.pagePositions[permaId];
|
57
|
+
},
|
58
|
+
|
40
59
|
getChapterIdByPagePermaId: function(permaId) {
|
41
60
|
return this.chapterIdsByPagePermaIds[permaId];
|
61
|
+
},
|
62
|
+
|
63
|
+
getStorylineConfiguration: function(id) {
|
64
|
+
return this.storylineConfigurations[id] || {};
|
65
|
+
},
|
66
|
+
|
67
|
+
getStorylineIdByChapterId: function(id) {
|
68
|
+
return this.storylineIdsByChapterIds[id];
|
42
69
|
}
|
43
70
|
});
|
@@ -63,11 +63,11 @@ pageflow.Slideshow = function($el, configurations) {
|
|
63
63
|
};
|
64
64
|
|
65
65
|
this.back = function() {
|
66
|
-
this.scrollNavigator.back(currentPage);
|
66
|
+
this.scrollNavigator.back(currentPage, pages);
|
67
67
|
};
|
68
68
|
|
69
69
|
this.next = function() {
|
70
|
-
this.scrollNavigator.next(currentPage);
|
70
|
+
this.scrollNavigator.next(currentPage, pages);
|
71
71
|
};
|
72
72
|
|
73
73
|
this.parentPageExists = function() {
|
@@ -97,17 +97,21 @@ pageflow.Slideshow = function($el, configurations) {
|
|
97
97
|
currentPage = page;
|
98
98
|
currentPageIndex = currentPage.index();
|
99
99
|
|
100
|
-
var
|
100
|
+
var transition = options.transition ||
|
101
|
+
this.scrollNavigator.getDefaultTransition(previousPage, currentPage, pages);
|
102
|
+
|
103
|
+
var direction =
|
104
|
+
this.scrollNavigator.getTransitionDirection(previousPage, currentPage, options);
|
101
105
|
|
102
106
|
var outDuration = previousPage.page('deactivate', {
|
103
107
|
direction: direction,
|
104
|
-
transition:
|
108
|
+
transition: transition
|
105
109
|
});
|
106
110
|
|
107
111
|
var inDuration = currentPage.page('activate', {
|
108
112
|
direction: direction,
|
109
113
|
position: options.position,
|
110
|
-
transition:
|
114
|
+
transition: transition
|
111
115
|
});
|
112
116
|
|
113
117
|
preload.start(currentPage);
|
@@ -190,8 +194,7 @@ pageflow.Slideshow = function($el, configurations) {
|
|
190
194
|
|
191
195
|
$(window).on('resize', this.triggerResizeHooks);
|
192
196
|
|
193
|
-
|
194
|
-
$(document).on('touchmove', function (e) { e.preventDefault(); });
|
197
|
+
pageflow.nativeScrolling.preventScrollBouncing($el);
|
195
198
|
|
196
199
|
$el.addClass('slideshow');
|
197
200
|
|
@@ -202,7 +205,7 @@ pageflow.Slideshow = function($el, configurations) {
|
|
202
205
|
|
203
206
|
$el.find('.scroll_indicator').scrollIndicator({parent: this});
|
204
207
|
|
205
|
-
this.scrollNavigator = new pageflow.DomOrderScrollNavigator(this);
|
208
|
+
this.scrollNavigator = new pageflow.DomOrderScrollNavigator(this, pageflow.entryData);
|
206
209
|
this.preparer = pageflow.AdjacentPreparer.create(function() { return pages; }, this.scrollNavigator).attach(pageflow.events);
|
207
210
|
};
|
208
211
|
|
@@ -1,29 +1,114 @@
|
|
1
|
-
pageflow.DomOrderScrollNavigator = function(slideshow) {
|
1
|
+
pageflow.DomOrderScrollNavigator = function(slideshow, entryData) {
|
2
2
|
this.getLandingPage = function(pages) {
|
3
3
|
return pages.first();
|
4
4
|
};
|
5
5
|
|
6
|
-
this.back = function(currentPage) {
|
7
|
-
|
6
|
+
this.back = function(currentPage, pages) {
|
7
|
+
var position = 'bottom';
|
8
|
+
var previousPage = this.getPreviousPage(currentPage, pages);
|
9
|
+
|
10
|
+
if (previousPage.is(getParentPage(currentPage, pages))) {
|
11
|
+
position = null;
|
12
|
+
}
|
13
|
+
|
14
|
+
slideshow.goTo(previousPage, {
|
15
|
+
position: position
|
16
|
+
});
|
8
17
|
};
|
9
18
|
|
10
|
-
this.next = function(currentPage) {
|
11
|
-
slideshow.goTo(
|
19
|
+
this.next = function(currentPage, pages) {
|
20
|
+
slideshow.goTo(this.getNextPage(currentPage, pages));
|
12
21
|
};
|
13
22
|
|
14
23
|
this.nextPageExists = function(currentPage, pages) {
|
15
|
-
return
|
24
|
+
return !!this.getNextPage(currentPage, pages).length;
|
16
25
|
};
|
17
26
|
|
18
27
|
this.previousPageExists = function(currentPage, pages) {
|
19
|
-
return
|
28
|
+
return !!this.getPreviousPage(currentPage, pages).length;
|
20
29
|
};
|
21
30
|
|
22
31
|
this.getNextPage = function(currentPage, pages) {
|
23
|
-
|
32
|
+
var nextPage = currentPage.next('.page');
|
33
|
+
|
34
|
+
if (sameStoryline(currentPage, nextPage)) {
|
35
|
+
return nextPage;
|
36
|
+
}
|
37
|
+
|
38
|
+
var scrollSuccessor = getScrollSuccessor(currentPage, pages);
|
39
|
+
|
40
|
+
if (scrollSuccessor.length) {
|
41
|
+
return scrollSuccessor;
|
42
|
+
}
|
43
|
+
|
44
|
+
return getParentPage(currentPage, pages);
|
45
|
+
};
|
46
|
+
|
47
|
+
this.getPreviousPage = function(currentPage, pages) {
|
48
|
+
var previousPage = currentPage.prev('.page');
|
49
|
+
|
50
|
+
if (sameStoryline(currentPage, previousPage)) {
|
51
|
+
return previousPage;
|
52
|
+
}
|
53
|
+
|
54
|
+
return getParentPage(currentPage, pages);
|
24
55
|
};
|
25
56
|
|
26
57
|
this.getTransitionDirection = function(previousPage, currentPage, options) {
|
27
58
|
return (currentPage.index() > previousPage.index() ? 'forwards' : 'backwards');
|
28
59
|
};
|
60
|
+
|
61
|
+
this.getDefaultTransition = function(previousPage, currentPage, pages) {
|
62
|
+
if (inParentStorylineOf(currentPage, previousPage, pages)) {
|
63
|
+
return getStorylinePageTransition(currentPage);
|
64
|
+
}
|
65
|
+
else if (inParentStorylineOf(previousPage, currentPage, pages)) {
|
66
|
+
return getStorylinePageTransition(previousPage);
|
67
|
+
}
|
68
|
+
};
|
69
|
+
|
70
|
+
function inParentStorylineOf(page, otherPage, pages) {
|
71
|
+
var parentPage = getParentPage(page, pages);
|
72
|
+
|
73
|
+
return entryData.getStorylineIdByPagePermaId(parentPage.page('getPermaId')) ==
|
74
|
+
entryData.getStorylineIdByPagePermaId(otherPage.page('getPermaId'));
|
75
|
+
}
|
76
|
+
|
77
|
+
function sameStoryline(page1, page2) {
|
78
|
+
return entryData.getStorylineIdByPagePermaId(page1.page('getPermaId')) ==
|
79
|
+
entryData.getStorylineIdByPagePermaId(page2.page('getPermaId'));
|
80
|
+
}
|
81
|
+
|
82
|
+
function getParentPage(page, pages) {
|
83
|
+
var storylineConfiguration = getStorylineConfiguration(page);
|
84
|
+
|
85
|
+
if ('parent_page_perma_id' in storylineConfiguration &&
|
86
|
+
entryData.getThemingOption('change_to_parent_page_at_storyline_boundary')) {
|
87
|
+
|
88
|
+
return pages.filter('#' + storylineConfiguration.parent_page_perma_id);
|
89
|
+
}
|
90
|
+
|
91
|
+
return $();
|
92
|
+
}
|
93
|
+
|
94
|
+
function getStorylinePageTransition(page) {
|
95
|
+
var storylineConfiguration = getStorylineConfiguration(page);
|
96
|
+
return storylineConfiguration.page_transition || 'scroll_over_from_right';
|
97
|
+
}
|
98
|
+
|
99
|
+
function getScrollSuccessor(page, pages) {
|
100
|
+
var storylineConfiguration = getStorylineConfiguration(page);
|
101
|
+
|
102
|
+
if ('scroll_successor_id' in storylineConfiguration) {
|
103
|
+
return pages.filter('#' + storylineConfiguration.scroll_successor_id);
|
104
|
+
}
|
105
|
+
|
106
|
+
return $();
|
107
|
+
}
|
108
|
+
|
109
|
+
function getStorylineConfiguration(page) {
|
110
|
+
var permaId = page.page('getPermaId');
|
111
|
+
var storylineId = entryData.getStorylineIdByPagePermaId(permaId);
|
112
|
+
return entryData.getStorylineConfiguration(storylineId);
|
113
|
+
}
|
29
114
|
};
|
@@ -6,10 +6,12 @@
|
|
6
6
|
|
7
7
|
parent.on('pageactivate', function(event) {
|
8
8
|
that.element.toggleClass('invert', $(event.target).hasClass('invert'));
|
9
|
-
that.element.toggleClass('hidden',
|
9
|
+
that.element.toggleClass('hidden',
|
10
|
+
$(event.target).hasClass('hide_content_with_text') ||
|
11
|
+
$(event.target).hasClass('no_hidden_text_indicator'));
|
10
12
|
});
|
11
13
|
|
12
|
-
parent.on('hidetextactivate', function(
|
14
|
+
parent.on('hidetextactivate', function() {
|
13
15
|
that.element.addClass('visible');
|
14
16
|
});
|
15
17
|
|
@@ -18,4 +20,4 @@
|
|
18
20
|
});
|
19
21
|
}
|
20
22
|
});
|
21
|
-
}(jQuery));
|
23
|
+
}(jQuery));
|
@@ -16,6 +16,10 @@
|
|
16
16
|
return this.element.nonLazyPage.apply(this.element, [method].concat([].slice.call(args)));
|
17
17
|
},
|
18
18
|
|
19
|
+
getPermaId: function() {
|
20
|
+
return parseInt(this.element.attr('id'), 10);
|
21
|
+
},
|
22
|
+
|
19
23
|
getConfiguration: function() {
|
20
24
|
return this.configuration;
|
21
25
|
},
|
@@ -5,7 +5,6 @@
|
|
5
5
|
this.configuration = this.element.data('configuration') || this.options.configuration;
|
6
6
|
this.index = this.options.index;
|
7
7
|
|
8
|
-
this.preloaded = false;
|
9
8
|
this.reinit();
|
10
9
|
},
|
11
10
|
|
@@ -25,8 +24,15 @@
|
|
25
24
|
reinit: function() {
|
26
25
|
this.pageType = pageflow.pageType.get(this.element.data('template'));
|
27
26
|
this.element.data('pageType', this.pageType);
|
27
|
+
this.preloaded = false;
|
28
|
+
|
29
|
+
if (this.pageType.scroller === false) {
|
30
|
+
this.content = $();
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
this.content = this.element.find('.scroller');
|
34
|
+
}
|
28
35
|
|
29
|
-
this.content = this.element.find('.scroller');
|
30
36
|
this.content.scroller(this.pageType.scrollerOptions || {});
|
31
37
|
this.pageType.scroller = this.content.scroller('instance');
|
32
38
|
|
@@ -38,6 +44,8 @@
|
|
38
44
|
|
39
45
|
reactivate: function() {
|
40
46
|
if (this.element.hasClass('active')) {
|
47
|
+
this.preload();
|
48
|
+
|
41
49
|
this.content.scroller('enable');
|
42
50
|
this.content.scroller('resetPosition');
|
43
51
|
this.content.scroller('afterAnimationHook');
|
@@ -50,6 +58,7 @@
|
|
50
58
|
cleanup: function() {
|
51
59
|
this._triggerPageTypeHook('deactivating');
|
52
60
|
this._triggerDelayedPageTypeHook('deactivated');
|
61
|
+
this._triggerPageTypeHook('cleanup');
|
53
62
|
},
|
54
63
|
|
55
64
|
refreshScroller: function() {
|
@@ -116,7 +125,7 @@
|
|
116
125
|
|
117
126
|
this.content.scroller('resetPosition', {position: options.position});
|
118
127
|
this._trigger('activate', null, {page: this});
|
119
|
-
this._triggerPageTypeHook('activating');
|
128
|
+
this._triggerPageTypeHook('activating', {position: options.position});
|
120
129
|
|
121
130
|
return duration;
|
122
131
|
},
|
@@ -161,13 +170,13 @@
|
|
161
170
|
that._triggerPageTypeHook(name);
|
162
171
|
});
|
163
172
|
|
164
|
-
this.element.one('
|
173
|
+
this.element.one('pagedeactivate', function() {
|
165
174
|
handle.cancel();
|
166
175
|
});
|
167
176
|
},
|
168
177
|
|
169
|
-
_triggerPageTypeHook: function(name) {
|
170
|
-
return this.pageType[name](this.element, this.configuration);
|
178
|
+
_triggerPageTypeHook: function(name, options) {
|
179
|
+
return this.pageType[name](this.element, this.configuration, options || {});
|
171
180
|
},
|
172
181
|
|
173
182
|
_setupHideTextOnSwipe: function() {
|