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
@@ -0,0 +1,15 @@
|
|
1
|
+
pageflow.StorylineConfiguration = pageflow.Configuration.extend({
|
2
|
+
modelName: 'storyline',
|
3
|
+
i18nKey: 'pageflow/storyline',
|
4
|
+
|
5
|
+
defaults: {
|
6
|
+
},
|
7
|
+
|
8
|
+
initialize: function() {
|
9
|
+
this.listenTo(this, 'change:main', function(model, value) {
|
10
|
+
if (value) {
|
11
|
+
this.unset('parent_page_perma_id');
|
12
|
+
}
|
13
|
+
});
|
14
|
+
}
|
15
|
+
});
|
@@ -0,0 +1,117 @@
|
|
1
|
+
pageflow.StorylineOrdering = function(storylines, pages) {
|
2
|
+
var storylinesByParent;
|
3
|
+
|
4
|
+
this.watch = function() {
|
5
|
+
storylines.on('add change:configuration', function() {
|
6
|
+
this.sort();
|
7
|
+
}, this);
|
8
|
+
|
9
|
+
pages.on('change:position change:chapter_id', function() {
|
10
|
+
this.sort();
|
11
|
+
}, this);
|
12
|
+
};
|
13
|
+
|
14
|
+
this.sort = function(options) {
|
15
|
+
prepare();
|
16
|
+
visit(storylinesWithoutParent(), 1, 0);
|
17
|
+
|
18
|
+
storylines.sort(options);
|
19
|
+
};
|
20
|
+
|
21
|
+
function visit(storylines, offset, level) {
|
22
|
+
return _(storylines).reduce(function(position, storyline, index) {
|
23
|
+
storyline.set('position', position);
|
24
|
+
storyline.set('level', level);
|
25
|
+
|
26
|
+
return visit(children(storyline), position + 1, level + 1);
|
27
|
+
}, offset);
|
28
|
+
}
|
29
|
+
|
30
|
+
function storylinesWithoutParent() {
|
31
|
+
return storylinesByParent[-1];
|
32
|
+
}
|
33
|
+
|
34
|
+
function children(storyline) {
|
35
|
+
return storylinesByParent[storyline.cid] || [];
|
36
|
+
}
|
37
|
+
|
38
|
+
function prepare() {
|
39
|
+
storylinesByParent = _(groupStorylinesByParentStoryline())
|
40
|
+
.reduce(function(result, storylines, key) {
|
41
|
+
result[key] = storylines.sort(compareStorylines);
|
42
|
+
return result;
|
43
|
+
}, {});
|
44
|
+
}
|
45
|
+
|
46
|
+
function groupStorylinesByParentStoryline() {
|
47
|
+
return storylines
|
48
|
+
.groupBy(function(storyline) {
|
49
|
+
var parentPage = getParentPage(storyline);
|
50
|
+
return parentPage && parentPage.chapter ? parentPage.chapter.storyline.cid : -1;
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
function compareStorylines(storylineA, storylineB) {
|
55
|
+
return compareByMainFlag(storylineA, storylineB) ||
|
56
|
+
compareByParentPagePosition(storylineA, storylineB) ||
|
57
|
+
compareByLane(storylineA, storylineB) ||
|
58
|
+
compareByRow(storylineA, storylineB) ||
|
59
|
+
compareByTitle(storylineA, storylineB);
|
60
|
+
}
|
61
|
+
|
62
|
+
function compareByMainFlag(storylineA, storylineB) {
|
63
|
+
return compare(
|
64
|
+
storylineA.isMain() ? -1 : 1,
|
65
|
+
storylineB.isMain() ? -1 : 1
|
66
|
+
);
|
67
|
+
}
|
68
|
+
|
69
|
+
function compareByParentPagePosition(storylineA, storylineB) {
|
70
|
+
return compare(
|
71
|
+
getParentPagePosition(storylineA),
|
72
|
+
getParentPagePosition(storylineB)
|
73
|
+
);
|
74
|
+
}
|
75
|
+
|
76
|
+
function compareByLane(storylineA, storylineB) {
|
77
|
+
return compare(
|
78
|
+
storylineA.lane(),
|
79
|
+
storylineB.lane()
|
80
|
+
);
|
81
|
+
}
|
82
|
+
|
83
|
+
function compareByRow(storylineA, storylineB) {
|
84
|
+
return compare(
|
85
|
+
storylineA.row(),
|
86
|
+
storylineB.row()
|
87
|
+
);
|
88
|
+
}
|
89
|
+
|
90
|
+
function compareByTitle(storylineA, storylineB) {
|
91
|
+
return compare(
|
92
|
+
storylineA.title(),
|
93
|
+
storylineB.title()
|
94
|
+
);
|
95
|
+
}
|
96
|
+
|
97
|
+
function compare(a, b) {
|
98
|
+
if (a > b) {
|
99
|
+
return 1;
|
100
|
+
}
|
101
|
+
else if (a < b) {
|
102
|
+
return -1;
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
return 0;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
function getParentPagePosition(storyline) {
|
110
|
+
var parentPage = getParentPage(storyline);
|
111
|
+
return parentPage && parentPage.get('position');
|
112
|
+
}
|
113
|
+
|
114
|
+
function getParentPage(storyline) {
|
115
|
+
return pages.getByPermaId(storyline.parentPagePermaId());
|
116
|
+
}
|
117
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
pageflow.StorylineScaffold = pageflow.Scaffold.extend({
|
2
|
+
build: function() {
|
3
|
+
this.storyline = this.parent.buildStoryline(this.options.storylineAttributes);
|
4
|
+
this.chapter = this.storyline.buildChapter();
|
5
|
+
|
6
|
+
if (this.options.depth === 'page') {
|
7
|
+
this.page = this.chapter.buildPage();
|
8
|
+
}
|
9
|
+
|
10
|
+
pageflow.editor.trigger('scaffold:storyline', this.storyline);
|
11
|
+
|
12
|
+
return this.storyline;
|
13
|
+
},
|
14
|
+
|
15
|
+
load: function(response) {
|
16
|
+
this.storyline.set(response.storyline);
|
17
|
+
this.chapter.set(response.chapter);
|
18
|
+
|
19
|
+
if (this.page) {
|
20
|
+
this.page.set(response.page);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
});
|
@@ -0,0 +1,33 @@
|
|
1
|
+
pageflow.StorylineTransitiveChildPages = function(storyline, storylines, pages) {
|
2
|
+
var isTranstiveChildStoryline;
|
3
|
+
|
4
|
+
this.contain = function(page) {
|
5
|
+
if (!isTranstiveChildStoryline) {
|
6
|
+
search();
|
7
|
+
}
|
8
|
+
|
9
|
+
return !!isTranstiveChildStoryline[page.chapter.storyline.id];
|
10
|
+
};
|
11
|
+
|
12
|
+
function search() {
|
13
|
+
isTranstiveChildStoryline = storylines.reduce(function(memo, other) {
|
14
|
+
var current = other;
|
15
|
+
|
16
|
+
while (current) {
|
17
|
+
if (current === storyline || memo[current.id]) {
|
18
|
+
memo[other.id] = true;
|
19
|
+
return memo;
|
20
|
+
}
|
21
|
+
|
22
|
+
current = parentStoryline(current);
|
23
|
+
}
|
24
|
+
|
25
|
+
return memo;
|
26
|
+
}, {});
|
27
|
+
}
|
28
|
+
|
29
|
+
function parentStoryline(storyline) {
|
30
|
+
var parentPage = pages.getByPermaId(storyline.parentPagePermaId());
|
31
|
+
return parentPage && parentPage.chapter && parentPage.chapter.storyline;
|
32
|
+
}
|
33
|
+
};
|
@@ -1,8 +1,10 @@
|
|
1
1
|
pageflow.SidebarRouter = Backbone.Marionette.AppRouter.extend({
|
2
2
|
appRoutes: {
|
3
|
+
'page_links/:id': 'pageLink',
|
3
4
|
'pages/:id': 'page',
|
4
5
|
'pages/:id/:tab': 'page',
|
5
6
|
'chapters/:id': 'chapter',
|
7
|
+
'storylines/:id': 'storyline',
|
6
8
|
|
7
9
|
'files/:collectionName?handler=:handler&payload=:payload': 'files',
|
8
10
|
'files/:collectionName': 'files',
|
@@ -15,6 +17,7 @@ pageflow.SidebarRouter = Backbone.Marionette.AppRouter.extend({
|
|
15
17
|
'meta_data/:tab': 'metaData',
|
16
18
|
'publish': 'publish',
|
17
19
|
|
20
|
+
'?storyline=:id': 'index',
|
18
21
|
'.*': 'index'
|
19
22
|
}
|
20
23
|
});
|
@@ -11,9 +11,4 @@
|
|
11
11
|
</li>
|
12
12
|
</ul>
|
13
13
|
|
14
|
-
<
|
15
|
-
|
16
|
-
<ul class="chapters outline navigatable">
|
17
|
-
</ul>
|
18
|
-
|
19
|
-
<a class="add_chapter" href=""><%= I18n.t('pageflow.editor.templates.edit_entry.new_chapter') %></a>
|
14
|
+
<div class="edit_entry_storylines storyline_picker"></div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<a class="back"><%= I18n.t('pageflow.editor.templates.edit_storyline.outline') %></a>
|
2
|
+
<a class="destroy" data-tooltip-align="bottom right">
|
3
|
+
<%= I18n.t('pageflow.editor.templates.edit_storyline.destroy') %>
|
4
|
+
</a>
|
5
|
+
|
6
|
+
<div class="failure">
|
7
|
+
<p><%= I18n.t('pageflow.editor.templates.edit_storyline.save_error') %></p>
|
8
|
+
<p class="message"></p>
|
9
|
+
<a class="retry" href=""><%= I18n.t('pageflow.editor.templates.edit_storyline.retry') %></a>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="form_container"></div>
|
@@ -3,5 +3,6 @@
|
|
3
3
|
<span class="page_thumbnail"></span>
|
4
4
|
<div class="title"></div>
|
5
5
|
<div class="label"></div>
|
6
|
+
<a class="remove" title="<%= I18n.t('pageflow.editor.templates.page_link_item.remove') %>"></a>
|
6
7
|
<a class="edit" title="<%= I18n.t('pageflow.editor.templates.page_link_item.edit') %>"></a>
|
7
8
|
<div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="storyline_picker_storylines">
|
2
|
+
<div class="storyline_picker_select_region"></div>
|
3
|
+
<a href="" class="add_storyline" title="<%= I18n.t('pageflow.editor.templates.storyline_picker.add') %>"></a>
|
4
|
+
<a href="" class="edit_storyline" title="<%= I18n.t('pageflow.editor.templates.storyline_picker.edit') %>"></a>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="storyline_picker_main_region"></div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
pageflow.reloadStylesheet = function(name) {
|
2
|
+
var link = $('head link[data-name=' + name + ']');
|
3
|
+
|
4
|
+
if (!link.data('originalHref')) {
|
5
|
+
link.data('originalHref', link.attr('href'));
|
6
|
+
}
|
7
|
+
|
8
|
+
link.attr('href', link.data('originalHref') + '&reload=' + new Date().getTime());
|
9
|
+
};
|
@@ -11,7 +11,7 @@ pageflow.ConfigurationEditorTabView.groups.define('options', function(options) {
|
|
11
11
|
this.input('delayed_text_fade_in', pageflow.SelectInputView, {values: pageflow.Page.delayedTextFadeIn});
|
12
12
|
}
|
13
13
|
|
14
|
-
this.input('description', pageflow.TextAreaInputView, {size: 'short'});
|
14
|
+
this.input('description', pageflow.TextAreaInputView, {size: 'short', disableLinks: true});
|
15
15
|
|
16
16
|
if (pageflow.features.isEnabled('atmo')) {
|
17
17
|
this.input('atmo_audio_file_id', pageflow.FileInputView, {
|
@@ -34,4 +34,4 @@ pageflow.ConfigurationEditorTabView.groups.define('options', function(options) {
|
|
34
34
|
values: pageflow.Page.scrollIndicatorOrientations
|
35
35
|
});
|
36
36
|
}
|
37
|
-
});
|
37
|
+
});
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pageflow.ConfigurationEditorTabView.groups.define('page_link', function() {
|
2
|
+
this.input('label', pageflow.TextInputView);
|
3
|
+
this.input('target_page_id', pageflow.PageLinkInputView);
|
4
|
+
this.input('page_transition', pageflow.SelectInputView, {
|
5
|
+
translationKeyPrefix: 'pageflow.page_transitions',
|
6
|
+
includeBlank: true,
|
7
|
+
blankTranslationKey: 'pageflow.editor.views.edit_page_link_view.default_page_transition',
|
8
|
+
values: pageflow.pageTransitions.names()
|
9
|
+
});
|
10
|
+
});
|
@@ -31,11 +31,7 @@ pageflow.EditChapterView = Backbone.Marionette.Layout.extend({
|
|
31
31
|
});
|
32
32
|
|
33
33
|
if (pageflow.features.isEnabled('chapter_hierachy')) {
|
34
|
-
this.input('parent_page_perma_id', pageflow.PageLinkInputView);
|
35
34
|
this.input('display_parent_page_button', pageflow.CheckBoxInputView);
|
36
|
-
this.input('navigation_bar_mode', pageflow.SelectInputView, {
|
37
|
-
values: pageflow.ChapterFilter.strategies
|
38
|
-
});
|
39
35
|
}
|
40
36
|
});
|
41
37
|
},
|
@@ -5,7 +5,8 @@ pageflow.EditEntryView = Backbone.Marionette.ItemView.extend({
|
|
5
5
|
|
6
6
|
ui: {
|
7
7
|
publicationStateButton: 'a.publication_state',
|
8
|
-
menu: '.menu'
|
8
|
+
menu: '.menu',
|
9
|
+
storylines: '.edit_entry_storylines'
|
9
10
|
},
|
10
11
|
|
11
12
|
events: {
|
@@ -20,10 +21,6 @@ pageflow.EditEntryView = Backbone.Marionette.ItemView.extend({
|
|
20
21
|
return false;
|
21
22
|
},
|
22
23
|
|
23
|
-
'click a.add_chapter': function() {
|
24
|
-
this.model.addChapter();
|
25
|
-
},
|
26
|
-
|
27
24
|
'click .menu a': function(event) {
|
28
25
|
editor.navigate($(event.target).data('path'), {trigger: true});
|
29
26
|
return false;
|
@@ -33,16 +30,13 @@ pageflow.EditEntryView = Backbone.Marionette.ItemView.extend({
|
|
33
30
|
onRender: function() {
|
34
31
|
this._addMenuItems();
|
35
32
|
|
36
|
-
this.subview(new pageflow.
|
37
|
-
el: this
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
displayInNavigationHint: true
|
44
|
-
}
|
45
|
-
}
|
33
|
+
this.subview(new pageflow.StorylinePickerView({
|
34
|
+
el: this.ui.storylines,
|
35
|
+
navigatable: true,
|
36
|
+
editable: true,
|
37
|
+
displayInNavigationHint: true,
|
38
|
+
rememberLastSelection: true,
|
39
|
+
storylineId: this.options.storylineId
|
46
40
|
}));
|
47
41
|
},
|
48
42
|
|
@@ -23,15 +23,20 @@ pageflow.EditMetaDataView = Backbone.Marionette.Layout.extend({
|
|
23
23
|
});
|
24
24
|
|
25
25
|
configurationEditor.tab('general', function() {
|
26
|
-
this.input('title', pageflow.TextInputView
|
26
|
+
this.input('title', pageflow.TextInputView, {
|
27
|
+
placeholder: entry.attributes.entry_title
|
28
|
+
});
|
27
29
|
this.input('locale', pageflow.SelectInputView, {
|
28
|
-
values: pageflow.config.
|
29
|
-
texts: _.map(pageflow.config.
|
30
|
-
return I18n.t('
|
30
|
+
values: pageflow.config.availablePublicLocales,
|
31
|
+
texts: _.map(pageflow.config.availablePublicLocales, function(locale) {
|
32
|
+
return I18n.t('pageflow.public._language', {locale: locale});
|
31
33
|
})
|
32
34
|
});
|
33
35
|
|
34
36
|
this.input('credits', pageflow.TextAreaInputView);
|
37
|
+
this.input('author', pageflow.TextInputView);
|
38
|
+
this.input('publisher', pageflow.TextInputView);
|
39
|
+
this.input('keywords', pageflow.TextInputView);
|
35
40
|
});
|
36
41
|
|
37
42
|
configurationEditor.tab('widgets', function() {
|
@@ -59,7 +64,10 @@ pageflow.EditMetaDataView = Backbone.Marionette.Layout.extend({
|
|
59
64
|
collection: pageflow.imageFiles,
|
60
65
|
fileSelectionHandler: 'entryConfiguration'
|
61
66
|
});
|
62
|
-
this.input('summary', pageflow.TextAreaInputView
|
67
|
+
this.input('summary', pageflow.TextAreaInputView, {
|
68
|
+
disableRichtext: true,
|
69
|
+
disableLinks: true
|
70
|
+
});
|
63
71
|
});
|
64
72
|
|
65
73
|
this.formContainer.show(configurationEditor);
|
@@ -68,4 +76,4 @@ pageflow.EditMetaDataView = Backbone.Marionette.Layout.extend({
|
|
68
76
|
goBack: function() {
|
69
77
|
editor.navigate('/', {trigger: true});
|
70
78
|
}
|
71
|
-
});
|
79
|
+
});
|
@@ -0,0 +1,47 @@
|
|
1
|
+
pageflow.EditPageLinkView = Backbone.Marionette.Layout.extend({
|
2
|
+
template: 'pageflow/editor/templates/edit_page_link',
|
3
|
+
|
4
|
+
regions: {
|
5
|
+
formContainer: '.form_container'
|
6
|
+
},
|
7
|
+
|
8
|
+
ui: {
|
9
|
+
backButton: 'a.back'
|
10
|
+
},
|
11
|
+
|
12
|
+
events: {
|
13
|
+
'click a.back': 'goBack',
|
14
|
+
|
15
|
+
'click a.destroy': 'destroy'
|
16
|
+
},
|
17
|
+
|
18
|
+
onRender: function() {
|
19
|
+
var configurationEditor = this.options.page.pageType().createPageLinkConfigurationEditorView({
|
20
|
+
model: this.model,
|
21
|
+
page: this.options.page
|
22
|
+
});
|
23
|
+
|
24
|
+
this.formContainer.show(configurationEditor);
|
25
|
+
|
26
|
+
this.highlight();
|
27
|
+
},
|
28
|
+
|
29
|
+
highlight: function() {
|
30
|
+
this.model.highlight();
|
31
|
+
|
32
|
+
this.listenTo(this, 'close', function() {
|
33
|
+
this.model.resetHighlight();
|
34
|
+
});
|
35
|
+
},
|
36
|
+
|
37
|
+
destroy: function() {
|
38
|
+
if (confirm(I18n.t('pageflow.internal_links.editor.views.edit_page_link_view.confirm_destroy'))) {
|
39
|
+
this.model.remove();
|
40
|
+
this.goBack();
|
41
|
+
}
|
42
|
+
},
|
43
|
+
|
44
|
+
goBack: function() {
|
45
|
+
pageflow.editor.navigate('/pages/' + this.options.page.id + '/links', {trigger: true});
|
46
|
+
}
|
47
|
+
});
|