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
Binary file
|
Binary file
|
@@ -13,6 +13,7 @@
|
|
13
13
|
|
14
14
|
//= require polyfills/bind
|
15
15
|
|
16
|
+
//= require i18n
|
16
17
|
//= require jquery
|
17
18
|
//= require jquery-ui/widget
|
18
19
|
//= require jquery_ujs
|
@@ -52,6 +53,7 @@
|
|
52
53
|
//= require ./chapter_filter
|
53
54
|
//= require ./fullscreen
|
54
55
|
//= require ./multimedia_alert
|
56
|
+
//= require ./native_scrolling
|
55
57
|
|
56
58
|
//= require ./settings
|
57
59
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
pageflow.browser.agent = {
|
2
|
+
matchesSilk: function() {
|
3
|
+
return navigator.userAgent.match(/\bSilk\b/);
|
4
|
+
},
|
5
|
+
|
6
|
+
matchesDesktopSafari9: function() {
|
7
|
+
return this.matchesSafari9() && !this.matchesMobilePlatform();
|
8
|
+
},
|
9
|
+
|
10
|
+
matchesSafari9: function() {
|
11
|
+
var matchers = [/Safari\//i, /Version\/9/i];
|
12
|
+
|
13
|
+
return _.all(matchers, function(matcher) {
|
14
|
+
return navigator.userAgent.match(matcher);
|
15
|
+
});
|
16
|
+
},
|
17
|
+
|
18
|
+
matchesMobilePlatform: function() {
|
19
|
+
var matchers = [/iPod/i, /iPad/i, /iPhone/i, /Android/i, /Silk/i, /IEMobile/i];
|
20
|
+
|
21
|
+
return _.any(matchers, function(matcher) {
|
22
|
+
return navigator.userAgent.match(matcher);
|
23
|
+
});
|
24
|
+
}
|
25
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// See https://developer.mozilla.org/de/docs/Web/CSS/CSS_Animations/Detecting_CSS_animation_support
|
2
|
+
|
3
|
+
pageflow.browser.feature('css animations', function() {
|
4
|
+
var prefixes = ['Webkit', 'Moz', 'O', 'ms', 'Khtml'],
|
5
|
+
elm = document.createElement('div');
|
6
|
+
|
7
|
+
if (elm.style.animationName !== undefined) {
|
8
|
+
return true;
|
9
|
+
}
|
10
|
+
|
11
|
+
for (var i = 0; i < prefixes.length; i++) {
|
12
|
+
if (elm.style[prefixes[i] + 'AnimationName'] !== undefined) {
|
13
|
+
return true;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
return false;
|
18
|
+
});
|
@@ -1,8 +1,5 @@
|
|
1
1
|
pageflow.browser.feature('mobile platform', function() {
|
2
|
-
|
3
|
-
return _.any(matchers, function(matcher) {
|
4
|
-
return navigator.userAgent.match(matcher);
|
5
|
-
});
|
2
|
+
return pageflow.browser.agent.matchesMobilePlatform();
|
6
3
|
});
|
7
4
|
|
8
5
|
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i) && !window.navigator.standalone) {
|
@@ -13,4 +13,11 @@ pageflow.browser.feature('buffer underrun waiting support', function(has) {
|
|
13
13
|
|
14
14
|
pageflow.browser.feature('prebuffering support', function(has) {
|
15
15
|
return has.not('mobile platform');
|
16
|
-
});
|
16
|
+
});
|
17
|
+
|
18
|
+
pageflow.browser.feature('mp4 support only', function(has) {
|
19
|
+
// - Silk does not play videos with hls source
|
20
|
+
// - Desktop Safari 9.1 does not loop hls videos
|
21
|
+
return pageflow.browser.agent.matchesSilk() ||
|
22
|
+
pageflow.browser.agent.matchesDesktopSafari9();
|
23
|
+
});
|
@@ -4,28 +4,17 @@ pageflow.ChapterFilter = pageflow.Object.extend({
|
|
4
4
|
},
|
5
5
|
|
6
6
|
strategies: {
|
7
|
-
all: function() {
|
8
|
-
return true;
|
9
|
-
},
|
10
|
-
|
11
7
|
non: function() {
|
12
8
|
return false;
|
13
9
|
},
|
14
10
|
|
15
|
-
|
16
|
-
return
|
11
|
+
current_storyline: function(currentChapterId, otherChapterId) {
|
12
|
+
return this.entry.getStorylineIdByChapterId(currentChapterId) ===
|
13
|
+
this.entry.getStorylineIdByChapterId(otherChapterId);
|
17
14
|
},
|
18
15
|
|
19
16
|
inherit_from_parent: function(currentChapterId, otherChapterId) {
|
20
17
|
return this.chapterVisibleFromChapter(this.entry.getParentChapterId(currentChapterId), otherChapterId);
|
21
|
-
},
|
22
|
-
|
23
|
-
same_parent_page: function(currentChapterId, otherChapterId) {
|
24
|
-
return this.entry.getParentPagePermaId(currentChapterId) === this.entry.getParentPagePermaId(otherChapterId);
|
25
|
-
},
|
26
|
-
|
27
|
-
same_parent_chapter: function(currentChapterId, otherChapterId) {
|
28
|
-
return this.entry.getParentChapterId(currentChapterId) === this.entry.getParentChapterId(otherChapterId);
|
29
18
|
}
|
30
19
|
},
|
31
20
|
|
@@ -41,11 +30,12 @@ pageflow.ChapterFilter = pageflow.Object.extend({
|
|
41
30
|
|
42
31
|
getStrategy: function(chapterId) {
|
43
32
|
return this.strategies[this.getNavigationBarMode(chapterId)] ||
|
44
|
-
this.strategies.
|
33
|
+
this.strategies.current_storyline;
|
45
34
|
},
|
46
35
|
|
47
36
|
getNavigationBarMode: function(chapterId) {
|
48
|
-
|
37
|
+
var storylineId = this.entry.getStorylineIdByChapterId(chapterId);
|
38
|
+
return this.entry.getStorylineConfiguration(storylineId).navigation_bar_mode;
|
49
39
|
}
|
50
40
|
});
|
51
41
|
|
@@ -140,9 +140,13 @@ pageflow.EditorApi = pageflow.Object.extend({
|
|
140
140
|
/**
|
141
141
|
* Returns a promise which resolves to a page selected by the
|
142
142
|
* user.
|
143
|
+
*
|
144
|
+
* Supported options:
|
145
|
+
* - isAllowed: function which given a page returns true or false depending on
|
146
|
+
* whether the page is a valid selection
|
143
147
|
*/
|
144
|
-
this.selectPage = function() {
|
145
|
-
return pageflow.PageSelectionView.selectPage();
|
148
|
+
this.selectPage = function(options) {
|
149
|
+
return pageflow.PageSelectionView.selectPage(options);
|
146
150
|
};
|
147
151
|
|
148
152
|
/**
|
@@ -38,5 +38,17 @@ pageflow.PageType = pageflow.Object.extend({
|
|
38
38
|
'pageflow.common_page_attributes'
|
39
39
|
]
|
40
40
|
}, options));
|
41
|
+
},
|
42
|
+
|
43
|
+
createPageLinkConfigurationEditorView: function(options) {
|
44
|
+
var constructor = this.options.pageLinkConfigurationEditorView ||
|
45
|
+
pageflow.PageLinkConfigurationEditorView;
|
46
|
+
|
47
|
+
return new constructor(_.extend({
|
48
|
+
attributeTranslationKeyPrefixes: [
|
49
|
+
this.seed.translation_key_prefix + '.page_link_attributes',
|
50
|
+
'pageflow.common_page_link_attributes'
|
51
|
+
]
|
52
|
+
}, options));
|
41
53
|
}
|
42
54
|
});
|
@@ -15,11 +15,13 @@
|
|
15
15
|
|
16
16
|
//= require_self
|
17
17
|
|
18
|
+
//= require_tree ./utils
|
18
19
|
//= require_tree ./models/mixins
|
19
20
|
//= require ./models/uploaded_file
|
20
21
|
//= require ./models/hosted_file
|
21
22
|
//= require ./models/encoded_file
|
22
23
|
//= require ./models/configuration
|
24
|
+
//= require ./models/scaffold
|
23
25
|
//= require_tree ./models
|
24
26
|
//= require_tree ./collections/mixins
|
25
27
|
//= require ./collections/multi_collection
|
@@ -39,6 +41,7 @@
|
|
39
41
|
//= require_tree ./views
|
40
42
|
|
41
43
|
//= require ./initializers/setup_config
|
44
|
+
//= require ./initializers/setup_common_seed
|
42
45
|
//= require ./initializers/setup_features
|
43
46
|
//= require ./initializers/setup_audio
|
44
47
|
//= require ./initializers/setup_help_entries
|
@@ -49,6 +52,7 @@
|
|
49
52
|
//= require ./initializers/setup_hotkeys
|
50
53
|
//= require ./initializers/edit_lock
|
51
54
|
//= require ./initializers/files_polling
|
55
|
+
//= require ./initializers/stylesheet_reloading
|
52
56
|
//= require ./initializers/routing
|
53
57
|
//= require ./initializers/error_listener
|
54
58
|
//= require ./initializers/additional_initializers
|
@@ -9,7 +9,7 @@ pageflow.ChapterPagesCollection = pageflow.SubsetCollection.extend({
|
|
9
9
|
parentModel: chapter,
|
10
10
|
|
11
11
|
filter: function(item) {
|
12
|
-
return item.get('chapter_id') === chapter.id;
|
12
|
+
return !chapter.isNew() && item.get('chapter_id') === chapter.id;
|
13
13
|
},
|
14
14
|
|
15
15
|
comparator: function(item) {
|
@@ -23,6 +23,9 @@ pageflow.ChapterPagesCollection = pageflow.SubsetCollection.extend({
|
|
23
23
|
|
24
24
|
this.listenTo(this, 'add', function(model) {
|
25
25
|
model.chapter = chapter;
|
26
|
+
model.set('chapter_id', chapter.id);
|
27
|
+
|
28
|
+
pageflow.editor.trigger('add:page', model);
|
26
29
|
});
|
27
30
|
|
28
31
|
this.listenTo(this, 'remove', function(model) {
|
@@ -1,11 +1,7 @@
|
|
1
1
|
pageflow.ChaptersCollection = Backbone.Collection.extend({
|
2
2
|
model: pageflow.Chapter,
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
url: function() {
|
7
|
-
return '/entries/' + pageflow.entry.get('id') + '/chapters';
|
8
|
-
},
|
4
|
+
url: '/chapters',
|
9
5
|
|
10
6
|
comparator: function(chapter) {
|
11
7
|
return chapter.get('position');
|
@@ -0,0 +1,11 @@
|
|
1
|
+
pageflow.addAndReturnModel = {
|
2
|
+
// Backbone's add does not return the added model. push returns the
|
3
|
+
// model but does not trigger sort.
|
4
|
+
addAndReturnModel: function(model, options) {
|
5
|
+
model = this._prepareModel(model, options);
|
6
|
+
this.add(model, options);
|
7
|
+
return model;
|
8
|
+
}
|
9
|
+
};
|
10
|
+
|
11
|
+
Cocktail.mixin(Backbone.Collection, pageflow.addAndReturnModel);
|
@@ -1,9 +1,11 @@
|
|
1
1
|
pageflow.orderedCollection = {
|
2
2
|
initialize: function() {
|
3
|
-
this.
|
4
|
-
this.
|
5
|
-
|
6
|
-
|
3
|
+
if (this.autoConsolidatePositions !== false) {
|
4
|
+
this.listenTo(this, 'remove', function() {
|
5
|
+
this.consolidatePositions();
|
6
|
+
this.saveOrder();
|
7
|
+
});
|
8
|
+
}
|
7
9
|
},
|
8
10
|
|
9
11
|
consolidatePositions: function() {
|
@@ -0,0 +1,78 @@
|
|
1
|
+
pageflow.PageLinksCollection = Backbone.Collection.extend({
|
2
|
+
model: pageflow.PageLink,
|
3
|
+
|
4
|
+
initialize: function(models, options) {
|
5
|
+
this.configuration = options.configuration;
|
6
|
+
this.page = options.configuration.page;
|
7
|
+
|
8
|
+
this.load();
|
9
|
+
|
10
|
+
this.listenTo(this, 'add remove change', this.save);
|
11
|
+
this.listenTo(this.configuration, 'change:page_links', this.load);
|
12
|
+
},
|
13
|
+
|
14
|
+
addLink: function(targetPageId) {
|
15
|
+
this.addWithPosition(this.defaultPosition(), targetPageId);
|
16
|
+
},
|
17
|
+
|
18
|
+
canAddLink: function(targetPageId) {
|
19
|
+
return true;
|
20
|
+
},
|
21
|
+
|
22
|
+
updateLink: function(link, targetPageId) {
|
23
|
+
link.set('target_page_id', targetPageId);
|
24
|
+
},
|
25
|
+
|
26
|
+
removeLink: function(link) {
|
27
|
+
this.remove(link);
|
28
|
+
},
|
29
|
+
|
30
|
+
addWithPosition: function(position, targetPageId) {
|
31
|
+
this.add(this.pageLinkAttributes(position, targetPageId));
|
32
|
+
},
|
33
|
+
|
34
|
+
removeByPosition: function(position) {
|
35
|
+
this.remove(this.findByPosition(position));
|
36
|
+
},
|
37
|
+
|
38
|
+
findByPosition: function(position) {
|
39
|
+
return this.findWhere({position: position});
|
40
|
+
},
|
41
|
+
|
42
|
+
load: function() {
|
43
|
+
this.set(this.pageLinksAttributes());
|
44
|
+
},
|
45
|
+
|
46
|
+
save: function() {
|
47
|
+
this.configuration.set('page_links', this.map(function(pageLink) {
|
48
|
+
return pageLink.toSerializedJSON();
|
49
|
+
}));
|
50
|
+
},
|
51
|
+
|
52
|
+
defaultPosition: function() {
|
53
|
+
return Math.max(0, _.max(this.map(function(pageLink) {
|
54
|
+
return pageLink.get('position');
|
55
|
+
}))) + 1;
|
56
|
+
},
|
57
|
+
|
58
|
+
pageLinksAttributes: function() {
|
59
|
+
return this.configuration.get('page_links') || [];
|
60
|
+
},
|
61
|
+
|
62
|
+
pageLinkAttributes: function(position, targetPageId, id) {
|
63
|
+
return {
|
64
|
+
id: id || this.getUniqueId(),
|
65
|
+
target_page_id: targetPageId,
|
66
|
+
position: position
|
67
|
+
};
|
68
|
+
},
|
69
|
+
|
70
|
+
/** @private */
|
71
|
+
getUniqueId: function() {
|
72
|
+
var maxId = Math.max(0, _.max(this.map(function(pageLink) {
|
73
|
+
return parseInt(pageLink.id.split(':').pop(), 10);
|
74
|
+
})));
|
75
|
+
|
76
|
+
return this.configuration.page.get('perma_id') + ':' + (maxId + 1);
|
77
|
+
}
|
78
|
+
});
|
@@ -4,7 +4,13 @@ pageflow.PagesCollection = Backbone.Collection.extend({
|
|
4
4
|
url: '/pages',
|
5
5
|
|
6
6
|
comparator: function(pageA, pageB) {
|
7
|
-
if (pageA.
|
7
|
+
if (pageA.storylinePosition() > pageB.storylinePosition()) {
|
8
|
+
return 1;
|
9
|
+
}
|
10
|
+
else if (pageA.storylinePosition() < pageB.storylinePosition()) {
|
11
|
+
return -1;
|
12
|
+
}
|
13
|
+
else if (pageA.chapterPosition() > pageB.chapterPosition()) {
|
8
14
|
return 1;
|
9
15
|
}
|
10
16
|
else if (pageA.chapterPosition() < pageB.chapterPosition()) {
|
@@ -22,6 +28,6 @@ pageflow.PagesCollection = Backbone.Collection.extend({
|
|
22
28
|
},
|
23
29
|
|
24
30
|
getByPermaId: function(permaId) {
|
25
|
-
return this.findWhere({perma_id: permaId});
|
31
|
+
return this.findWhere({perma_id: parseInt(permaId, 10)});
|
26
32
|
}
|
27
|
-
});
|
33
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
pageflow.StorylineChaptersCollection = pageflow.SubsetCollection.extend({
|
2
|
+
mixins: [pageflow.orderedCollection],
|
3
|
+
|
4
|
+
constructor: function(options) {
|
5
|
+
var storyline = options.storyline;
|
6
|
+
|
7
|
+
pageflow.SubsetCollection.prototype.constructor.call(this, {
|
8
|
+
parent: options.chapters,
|
9
|
+
parentModel: storyline,
|
10
|
+
|
11
|
+
filter: function(item) {
|
12
|
+
return !storyline.isNew() && item.get('storyline_id') === storyline.id;
|
13
|
+
},
|
14
|
+
|
15
|
+
comparator: function(item) {
|
16
|
+
return item.get('position');
|
17
|
+
}
|
18
|
+
});
|
19
|
+
|
20
|
+
this.each(function(chapter) {
|
21
|
+
chapter.storyline = storyline;
|
22
|
+
});
|
23
|
+
|
24
|
+
this.listenTo(this, 'add', function(model) {
|
25
|
+
model.storyline = storyline;
|
26
|
+
model.set('storyline_id', storyline.id);
|
27
|
+
|
28
|
+
pageflow.editor.trigger('add:chapter', model);
|
29
|
+
});
|
30
|
+
|
31
|
+
this.listenTo(this, 'remove', function(model) {
|
32
|
+
model.storyline = null;
|
33
|
+
});
|
34
|
+
}
|
35
|
+
});
|
@@ -0,0 +1,33 @@
|
|
1
|
+
pageflow.StorylinesCollection = Backbone.Collection.extend({
|
2
|
+
autoConsolidatePositions: false,
|
3
|
+
|
4
|
+
mixins: [pageflow.orderedCollection],
|
5
|
+
|
6
|
+
model: pageflow.Storyline,
|
7
|
+
|
8
|
+
url: function() {
|
9
|
+
return '/entries/' + pageflow.entry.get('id') + '/storylines';
|
10
|
+
},
|
11
|
+
|
12
|
+
initialize: function() {
|
13
|
+
this.listenTo(this, 'change:main', function(model, value) {
|
14
|
+
if (value) {
|
15
|
+
this.each(function(storyline) {
|
16
|
+
if (storyline.isMain() && storyline !== model) {
|
17
|
+
storyline.configuration.unset('main');
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}
|
21
|
+
});
|
22
|
+
},
|
23
|
+
|
24
|
+
main: function() {
|
25
|
+
return this.find(function(storyline) {
|
26
|
+
return storyline.configuration.get('main');
|
27
|
+
}) || this.first();
|
28
|
+
},
|
29
|
+
|
30
|
+
comparator: function(chapter) {
|
31
|
+
return chapter.get('position');
|
32
|
+
}
|
33
|
+
});
|