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
@@ -20,13 +20,17 @@ pageflow.TextAreaInputView = Backbone.Marionette.ItemView.extend({
|
|
20
20
|
|
21
21
|
this.editor = new wysihtml5.Editor(this.ui.textarea[0], {
|
22
22
|
toolbar: this.ui.toolbar[0],
|
23
|
+
autoLink: this.options.disableLinks ? 0 : 1,
|
23
24
|
parserRules: {
|
24
25
|
tags: {
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
em: {unwrap: this.options.disableRichtext ? 1 : 0, rename_tag: "i"},
|
27
|
+
strong: {unwrap: this.options.disableRichtext ? 1 : 0, rename_tag: "b"},
|
28
|
+
u: {unwrap: this.options.disableRichtext ? 1 : 0},
|
29
|
+
b: {unwrap: this.options.disableRichtext ? 1 : 0},
|
30
|
+
i: {unwrap: this.options.disableRichtext ? 1 : 0},
|
28
31
|
br: {},
|
29
32
|
a: {
|
33
|
+
unwrap: this.options.disableLinks ? 1 : 0,
|
30
34
|
check_attributes: {
|
31
35
|
href: "href"
|
32
36
|
},
|
@@ -39,6 +43,15 @@ pageflow.TextAreaInputView = Backbone.Marionette.ItemView.extend({
|
|
39
43
|
}
|
40
44
|
});
|
41
45
|
|
46
|
+
if (this.options.disableRichtext) {
|
47
|
+
this.ui.toolbar.find('a[data-wysihtml5-command="bold"]').hide();
|
48
|
+
this.ui.toolbar.find('a[data-wysihtml5-command="italic"]').hide();
|
49
|
+
this.ui.toolbar.find('a[data-wysihtml5-command="underline"]').hide();
|
50
|
+
}
|
51
|
+
if (this.options.disableLinks) {
|
52
|
+
this.ui.toolbar.find('a[data-wysihtml5-command="createLink"]').hide();
|
53
|
+
}
|
54
|
+
|
42
55
|
this.editor.on('change', _.bind(this.save, this));
|
43
56
|
this.editor.on('aftercommand:composer', _.bind(this.save, this));
|
44
57
|
},
|
@@ -63,4 +76,4 @@ pageflow.TextAreaInputView = Backbone.Marionette.ItemView.extend({
|
|
63
76
|
// we really are not IE 11.
|
64
77
|
return isGecko && !isIE11;
|
65
78
|
};
|
66
|
-
}());
|
79
|
+
}());
|
@@ -0,0 +1,42 @@
|
|
1
|
+
pageflow.tooltipContainer = {
|
2
|
+
events: {
|
3
|
+
'mouseover [data-tooltip]': function(event) {
|
4
|
+
if (!this.tooltip.visible) {
|
5
|
+
var target = $(event.target);
|
6
|
+
var key = target.data('tooltip');
|
7
|
+
var position;
|
8
|
+
|
9
|
+
if (target.data('tooltipAlign') === 'bottom left') {
|
10
|
+
position = {
|
11
|
+
left: target.position().left,
|
12
|
+
top: target.position().top + target.outerHeight()
|
13
|
+
};
|
14
|
+
}
|
15
|
+
else if (target.data('tooltipAlign') === 'bottom right') {
|
16
|
+
position = {
|
17
|
+
left: target.position().left + target.outerWidth(),
|
18
|
+
top: target.position().top + target.outerHeight()
|
19
|
+
};
|
20
|
+
}
|
21
|
+
else {
|
22
|
+
position = {
|
23
|
+
left: target.position().left + target.outerWidth(),
|
24
|
+
top: target.position().top + target.outerHeight() / 2
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
this.tooltip.show(I18n.t(key), position, {
|
29
|
+
align: target.data('tooltipAlign')
|
30
|
+
})
|
31
|
+
}
|
32
|
+
},
|
33
|
+
|
34
|
+
'mouseout [data-tooltip]': function() {
|
35
|
+
this.tooltip.hide();
|
36
|
+
}
|
37
|
+
},
|
38
|
+
|
39
|
+
onRender: function() {
|
40
|
+
this.appendSubview(this.tooltip = new pageflow.TooltipView());
|
41
|
+
}
|
42
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
pageflow.TooltipView = Backbone.Marionette.ItemView.extend({
|
2
|
+
template: 'pageflow/ui/templates/tooltip',
|
3
|
+
className: 'tooltip',
|
4
|
+
|
5
|
+
ui: {
|
6
|
+
label: '.label'
|
7
|
+
},
|
8
|
+
|
9
|
+
hide: function() {
|
10
|
+
this.visible = false;
|
11
|
+
clearTimeout(this.timeout);
|
12
|
+
this.$el.removeClass('visible');
|
13
|
+
},
|
14
|
+
|
15
|
+
show: function(text, position, options) {
|
16
|
+
options = options || {};
|
17
|
+
this.visible = true;
|
18
|
+
|
19
|
+
clearTimeout(this.timeout);
|
20
|
+
|
21
|
+
this.timeout = setTimeout(_.bind(function() {
|
22
|
+
var offsetTop;
|
23
|
+
var offsetLeft;
|
24
|
+
|
25
|
+
this.ui.label.text(text);
|
26
|
+
|
27
|
+
this.$el.toggleClass('align_bottom_right', options.align === 'bottom right');
|
28
|
+
this.$el.toggleClass('align_bottom_left', options.align === 'bottom left');
|
29
|
+
|
30
|
+
if (options.align === 'bottom right' ||
|
31
|
+
options.align === 'bottom left' ) {
|
32
|
+
|
33
|
+
offsetTop = 10;
|
34
|
+
offsetLeft = 0;
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
offsetTop = -17;
|
38
|
+
offsetLeft = 10;
|
39
|
+
}
|
40
|
+
|
41
|
+
this.$el.css({
|
42
|
+
top: (position.top + offsetTop) + 'px',
|
43
|
+
left: (position.left + offsetLeft) + 'px'
|
44
|
+
});
|
45
|
+
|
46
|
+
this.$el.addClass('visible');
|
47
|
+
}, this), 200);
|
48
|
+
}
|
49
|
+
});
|
@@ -8,13 +8,13 @@
|
|
8
8
|
//= require ./video_player/src_from_options_method
|
9
9
|
//= require ./video_player/play_button_patch
|
10
10
|
//= require ./video_player/player_buffered_patch
|
11
|
-
//= require ./video_player/
|
11
|
+
//= require ./video_player/filter_sources
|
12
12
|
//= require ./video_player/lazy
|
13
13
|
|
14
14
|
pageflow.VideoPlayer = function(element, options) {
|
15
15
|
options = options || {};
|
16
16
|
|
17
|
-
element = pageflow.VideoPlayer.
|
17
|
+
element = pageflow.VideoPlayer.filterSources(element);
|
18
18
|
var player = vjs(element, options);
|
19
19
|
|
20
20
|
pageflow.VideoPlayer.prebuffering(player);
|
@@ -1,5 +1,5 @@
|
|
1
|
-
pageflow.VideoPlayer.
|
2
|
-
if (
|
1
|
+
pageflow.VideoPlayer.filterSources = function(playerElement) {
|
2
|
+
if (pageflow.browser.has('mp4 support only')) {
|
3
3
|
// keep only mp4 source
|
4
4
|
$(playerElement).find('source').not('source[type="video/mp4"]').remove();
|
5
5
|
|
@@ -72,11 +72,6 @@
|
|
72
72
|
pageLinks.off('mouseup touchend', goToPage);
|
73
73
|
}
|
74
74
|
|
75
|
-
function closeOverview() {
|
76
|
-
$('.overview').removeClass("active");
|
77
|
-
$('.navigation_index', element).removeClass("active");
|
78
|
-
}
|
79
|
-
|
80
75
|
function hideOverlay() {
|
81
76
|
$(overlays).addClass('hidden').removeClass('visible');
|
82
77
|
}
|
@@ -86,8 +81,6 @@
|
|
86
81
|
return;
|
87
82
|
}
|
88
83
|
hideOverlay();
|
89
|
-
closeOverview();
|
90
|
-
$('.page .content, .scroll_indicator').removeClass('hidden');
|
91
84
|
pageflow.slides.goToById(this.getAttribute("data-link"));
|
92
85
|
e.preventDefault();
|
93
86
|
}
|
@@ -139,16 +132,16 @@
|
|
139
132
|
toggleIndicators = function () {
|
140
133
|
if (atBoundary('down')) {
|
141
134
|
clearInterval(scrollDownIntervalID);
|
142
|
-
bottomIndicator.
|
135
|
+
bottomIndicator.removeClass('pressed');
|
143
136
|
}
|
137
|
+
|
144
138
|
if (atBoundary('up')) {
|
145
139
|
clearInterval(scrollUpIntervalID);
|
146
|
-
topIndicator.
|
147
|
-
}
|
148
|
-
if (!atBoundary('up') && !atBoundary('down')) {
|
149
|
-
topIndicator.show();
|
150
|
-
bottomIndicator.show();
|
140
|
+
topIndicator.removeClass('pressed');
|
151
141
|
}
|
142
|
+
|
143
|
+
topIndicator.toggleClass('visible', !atBoundary('up'));
|
144
|
+
bottomIndicator.toggleClass('visible', !atBoundary('down'));
|
152
145
|
};
|
153
146
|
|
154
147
|
var keyPressHandler = function(e) {
|
@@ -193,7 +186,17 @@
|
|
193
186
|
|
194
187
|
$('ul.navigation_thumbnails', element).pageNavigationList({
|
195
188
|
scroller: scroller,
|
196
|
-
scrollToActive: true
|
189
|
+
scrollToActive: true,
|
190
|
+
animationDuration: 500,
|
191
|
+
onAnimationStart: function() {
|
192
|
+
element.addClass('is_animating');
|
193
|
+
},
|
194
|
+
onAnimationEnd: function() {
|
195
|
+
element.removeClass('is_animating');
|
196
|
+
},
|
197
|
+
onFilterChange: function() {
|
198
|
+
toggleIndicators();
|
199
|
+
}
|
197
200
|
});
|
198
201
|
|
199
202
|
pageflow.ready.then(function() {
|
@@ -33,6 +33,10 @@
|
|
33
33
|
event.stopPropagation();
|
34
34
|
});
|
35
35
|
|
36
|
+
$('.parent_page', element).parentPageButton({
|
37
|
+
visibleClass: 'is_visible'
|
38
|
+
});
|
39
|
+
|
36
40
|
$('.wrapper', element).each(function() {
|
37
41
|
var sharingMobile = $(this).parents('.sharing_mobile');
|
38
42
|
|
@@ -42,8 +46,9 @@
|
|
42
46
|
probeType: 3
|
43
47
|
});
|
44
48
|
|
45
|
-
$('ul', element).pageNavigationList({
|
46
|
-
scroller: scroller
|
49
|
+
$('ul.pages', element).pageNavigationList({
|
50
|
+
scroller: scroller,
|
51
|
+
animationDuration: 500
|
47
52
|
});
|
48
53
|
|
49
54
|
scroller.on('scroll', function() {
|
@@ -11,7 +11,6 @@ jQuery(function($) {
|
|
11
11
|
scrollerWidth = noOfChapterParts * chapterParts.outerWidth(true),
|
12
12
|
closeButton = $('.close', this.element),
|
13
13
|
indexButton = $('.navigation_index'),
|
14
|
-
homeButton = $('.navigation_home'),
|
15
14
|
overview = $('.overview'),
|
16
15
|
wrapper = $('.wrapper', this.element);
|
17
16
|
|
@@ -25,11 +24,19 @@ jQuery(function($) {
|
|
25
24
|
|
26
25
|
$('section.page').toggleClass('hidden_by_overlay', state);
|
27
26
|
scrollIndicator.toggleClass('hidden', state);
|
27
|
+
|
28
|
+
if (overview.hasClass('active')) {
|
29
|
+
pageflow.events.once('page:change', function() {
|
30
|
+
toggleContent(false);
|
31
|
+
}, that);
|
32
|
+
}
|
33
|
+
else {
|
34
|
+
pageflow.events.off('page:change', null, that);
|
35
|
+
}
|
28
36
|
};
|
29
37
|
|
30
38
|
var goToPage = function() {
|
31
39
|
if (!$(this).hasClass('active')) {
|
32
|
-
toggleContent();
|
33
40
|
pageflow.slides.goToById(this.getAttribute("data-link"));
|
34
41
|
}
|
35
42
|
};
|
@@ -98,10 +105,6 @@ jQuery(function($) {
|
|
98
105
|
closeButton.click(toggleContent);
|
99
106
|
indexButton.click(toggleContent);
|
100
107
|
|
101
|
-
homeButton.click(function() {
|
102
|
-
toggleContent(false);
|
103
|
-
});
|
104
|
-
|
105
108
|
$('body').keyup(function(e) {
|
106
109
|
if (e.which == 27 && overview.hasClass('active')) {
|
107
110
|
toggleContent();
|
@@ -1,3 +1,5 @@
|
|
1
|
+
//= require ./page_navigation_list_animation
|
2
|
+
|
1
3
|
(function($) {
|
2
4
|
$.widget('pageflow.pageNavigationList', {
|
3
5
|
_create: function() {
|
@@ -8,6 +10,7 @@
|
|
8
10
|
|
9
11
|
var chapterFilter = pageflow.ChapterFilter.create();
|
10
12
|
var highlightedPage = pageflow.HighlightedPage.create();
|
13
|
+
var animation = pageflow.PageNavigationListAnimation.create()
|
11
14
|
|
12
15
|
pageflow.ready.then(function() {
|
13
16
|
highlightUnvisitedPages(pageflow.visited.getUnvisitedPages());
|
@@ -25,14 +28,21 @@
|
|
25
28
|
|
26
29
|
function update(currentPagePermaId) {
|
27
30
|
var highlightedPagePermaId = highlightedPage.getPagePermaId(currentPagePermaId);
|
31
|
+
var highlightedChapterId = pageflow.entryData.getChapterIdByPagePermaId(highlightedPagePermaId);
|
28
32
|
|
29
33
|
element.toggleClass('inside_sub_chapter', highlightedPagePermaId !== currentPagePermaId);
|
30
34
|
|
31
|
-
|
32
|
-
|
35
|
+
filterChapters(currentPagePermaId).then(function() {
|
36
|
+
highlightPage(highlightedPagePermaId, {animate: !animation.enabled});
|
37
|
+
highlightChapter(highlightedChapterId);
|
38
|
+
|
39
|
+
if (options.onFilterChange) {
|
40
|
+
options.onFilterChange();
|
41
|
+
}
|
42
|
+
});
|
33
43
|
}
|
34
44
|
|
35
|
-
function highlightPage(permaId) {
|
45
|
+
function highlightPage(permaId, highlightOptions) {
|
36
46
|
links.each(function() {
|
37
47
|
var link = $(this);
|
38
48
|
var active = '#' + permaId === link.attr('href');
|
@@ -41,12 +51,8 @@
|
|
41
51
|
link.attr('tabindex', active ? '-1' : '3');
|
42
52
|
|
43
53
|
if (active) {
|
44
|
-
if (link.data('chapterId')) {
|
45
|
-
highlightChapter(link.data('chapterId'));
|
46
|
-
}
|
47
|
-
|
48
54
|
if (options.scrollToActive) {
|
49
|
-
scroller.scrollToElement(link[0], 800);
|
55
|
+
scroller.scrollToElement(link[0], highlightOptions.animate ? 800 : 0);
|
50
56
|
}
|
51
57
|
}
|
52
58
|
});
|
@@ -75,16 +81,48 @@
|
|
75
81
|
}
|
76
82
|
|
77
83
|
function filterChapters(currentPagePermaId) {
|
84
|
+
animation.update(currentPagePermaId);
|
85
|
+
|
78
86
|
links.each(function() {
|
79
87
|
var link = $(this);
|
88
|
+
animation.start(link.parent(), visible(currentPagePermaId, link));
|
89
|
+
});
|
80
90
|
|
81
|
-
|
82
|
-
|
83
|
-
link
|
84
|
-
|
91
|
+
return $.when(animation.enabled && animationDurationElapsed()).then(function() {
|
92
|
+
links.each(function() {
|
93
|
+
var link = $(this);
|
94
|
+
|
95
|
+
animation.finish(link.parent(), visible(currentPagePermaId, link));
|
96
|
+
link.parent().andSelf().toggleClass('filtered', !visible(currentPagePermaId, link));
|
97
|
+
});
|
98
|
+
|
99
|
+
scroller.refresh();
|
85
100
|
});
|
101
|
+
}
|
102
|
+
|
103
|
+
function visible(currentPagePermaId, link) {
|
104
|
+
return chapterFilter.chapterVisibleFromPage(
|
105
|
+
currentPagePermaId,
|
106
|
+
link.data('chapterId')
|
107
|
+
);
|
108
|
+
}
|
109
|
+
|
110
|
+
function animationDurationElapsed() {
|
111
|
+
if (options.animationDuration) {
|
112
|
+
if (options.onAnimationStart) {
|
113
|
+
options.onAnimationStart();
|
114
|
+
}
|
115
|
+
|
116
|
+
return $.Deferred(function(deferred) {
|
117
|
+
setTimeout(function() {
|
118
|
+
deferred.resolve();
|
86
119
|
|
87
|
-
|
120
|
+
if (options.onAnimationEnd) {
|
121
|
+
setTimeout(options.onAnimationEnd, 500);
|
122
|
+
}
|
123
|
+
}, 500);
|
124
|
+
}).promise();
|
125
|
+
}
|
88
126
|
}
|
89
127
|
}
|
90
128
|
});
|
@@ -0,0 +1,48 @@
|
|
1
|
+
pageflow.PageNavigationListAnimation = pageflow.Object.extend({
|
2
|
+
initialize: function(entryData) {
|
3
|
+
this.entry = entryData;
|
4
|
+
},
|
5
|
+
|
6
|
+
update: function(currentPagePermaId) {
|
7
|
+
var currentPagePosition =
|
8
|
+
this.entry.getPagePosition(currentPagePermaId);
|
9
|
+
var currentStorylineId =
|
10
|
+
this.entry.getStorylineIdByPagePermaId(currentPagePermaId);
|
11
|
+
var currentStorylineLevel =
|
12
|
+
this.entry.getStorylineLevel(currentStorylineId);
|
13
|
+
|
14
|
+
this.enabled = this.lastStorylineId && this.lastStorylineId !== currentStorylineId;
|
15
|
+
|
16
|
+
this.movingUp = (this.lastStorylineLevel > currentStorylineLevel);
|
17
|
+
this.movingDown = (this.lastStorylineLevel < currentStorylineLevel);
|
18
|
+
this.movingForwards = (this.lastStorylineLevel === currentStorylineLevel &&
|
19
|
+
this.lastPagePosition < currentPagePosition);
|
20
|
+
this.movingBackwards = (this.lastStorylineLevel === currentStorylineLevel &&
|
21
|
+
this.lastPagePosition > currentPagePosition);
|
22
|
+
|
23
|
+
this.lastPagePosition = currentPagePosition;
|
24
|
+
this.lastStorylineId = currentStorylineId;
|
25
|
+
this.lastStorylineLevel = currentStorylineLevel;
|
26
|
+
},
|
27
|
+
|
28
|
+
start: function(element, visible) {
|
29
|
+
if (this.enabled) {
|
30
|
+
element.toggleClass('moving_up', this.movingUp);
|
31
|
+
element.toggleClass('moving_down', this.movingDown);
|
32
|
+
element.toggleClass('moving_forwards', this.movingForwards);
|
33
|
+
element.toggleClass('moving_backwards', this.movingBackwards);
|
34
|
+
|
35
|
+
element.toggleClass('animate_out', !visible);
|
36
|
+
}
|
37
|
+
},
|
38
|
+
|
39
|
+
finish: function(element, visible) {
|
40
|
+
if (this.enabled) {
|
41
|
+
element.toggleClass('animate_in', !!visible);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
});
|
45
|
+
|
46
|
+
pageflow.PageNavigationListAnimation.create = function() {
|
47
|
+
return new pageflow.PageNavigationListAnimation(pageflow.entryData);
|
48
|
+
};
|
@@ -2,6 +2,7 @@
|
|
2
2
|
$.widget('pageflow.parentPageButton', {
|
3
3
|
_create: function() {
|
4
4
|
var element = this.element;
|
5
|
+
var options = this.options;
|
5
6
|
|
6
7
|
element.click(function(event) {
|
7
8
|
pageflow.slides.goToParentPage();
|
@@ -18,9 +19,15 @@
|
|
18
19
|
var pagePermaId = parseInt(pageflow.slides.currentPage().attr('id'), 10);
|
19
20
|
var chapterId = pageflow.entryData.getChapterIdByPagePermaId(pagePermaId);
|
20
21
|
var chapterConfiguration = pageflow.entryData.getChapterConfiguration(chapterId);
|
22
|
+
var visible = pageflow.slides.parentPageExists() &&
|
23
|
+
chapterConfiguration.display_parent_page_button !== false;
|
21
24
|
|
22
|
-
|
23
|
-
|
25
|
+
if (options.visibleClass) {
|
26
|
+
element.toggleClass(options.visibleClass, visible);
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
element.toggle(visible);
|
30
|
+
}
|
24
31
|
}
|
25
32
|
}
|
26
33
|
});
|