pageflow 15.8.0 → 16.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +183 -103
- data/README.md +0 -1
- data/Rakefile +1 -1
- data/admins/pageflow/accounts.rb +12 -16
- data/admins/pageflow/entry.rb +28 -26
- data/admins/pageflow/entry_templates.rb +5 -7
- data/admins/pageflow/sites.rb +53 -0
- data/app/assets/javascripts/pageflow/admin/entries.js +16 -7
- data/app/assets/javascripts/pageflow/dist/ui.js +298 -72
- data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +10 -0
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +6 -1
- data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -0
- data/app/assets/stylesheets/pageflow/editor/help.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +7 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +0 -5
- data/app/assets/stylesheets/pageflow/ui/forms.scss +1 -1
- data/app/controllers/pageflow/chapters_controller.rb +2 -2
- data/app/controllers/pageflow/editor/files_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +12 -2
- data/app/controllers/pageflow/feeds_controller.rb +18 -0
- data/app/controllers/pageflow/pages_controller.rb +2 -2
- data/app/controllers/pageflow/sitemaps_controller.rb +15 -0
- data/app/controllers/pageflow/storylines_controller.rb +2 -2
- data/app/helpers/pageflow/common_entry_seed_helper.rb +1 -1
- data/app/helpers/pageflow/embed_code_helper.rb +1 -1
- data/app/helpers/pageflow/entries_helper.rb +16 -15
- data/app/helpers/pageflow/feeds_helper.rb +66 -0
- data/app/helpers/pageflow/page_types_helper.rb +9 -9
- data/app/helpers/pageflow/sites_helper.rb +11 -0
- data/app/helpers/pageflow/social_share_helper.rb +2 -2
- data/app/inputs/pageflow_permalink_input.rb +15 -3
- data/app/models/concerns/pageflow/reusable_file.rb +3 -3
- data/app/models/pageflow/account.rb +13 -31
- data/app/models/pageflow/audio_file_url_templates.rb +2 -1
- data/app/models/pageflow/{cname_theming_request_scope.rb → cname_site_request_scope.rb} +3 -3
- data/app/models/pageflow/customized_theme.rb +1 -1
- data/app/models/pageflow/draft_entry.rb +1 -1
- data/app/models/pageflow/entries_feed.rb +32 -0
- data/app/models/pageflow/entry.rb +3 -4
- data/app/models/pageflow/entry_at_revision.rb +2 -2
- data/app/models/pageflow/entry_duplicate.rb +1 -1
- data/app/models/pageflow/entry_template.rb +4 -4
- data/app/models/pageflow/home_button.rb +7 -7
- data/app/models/pageflow/image_file.rb +14 -3
- data/app/models/pageflow/membership.rb +3 -2
- data/app/models/pageflow/other_file.rb +5 -0
- data/app/models/pageflow/other_file_url_templates.rb +16 -0
- data/app/models/pageflow/permalink.rb +3 -3
- data/app/models/pageflow/permalink_directory.rb +2 -2
- data/app/models/pageflow/published_entry.rb +8 -2
- data/app/models/pageflow/revision.rb +4 -0
- data/app/models/pageflow/site.rb +67 -0
- data/app/models/pageflow/sitemaps.rb +13 -0
- data/app/models/pageflow/theme_customization.rb +1 -1
- data/app/models/pageflow/used_file.rb +2 -2
- data/app/models/pageflow/video_file_url_templates.rb +3 -1
- data/app/models/pageflow/widget.rb +9 -1
- data/app/policies/pageflow/account_policy.rb +2 -2
- data/app/policies/pageflow/entry_policy.rb +2 -2
- data/app/policies/pageflow/entry_template_policy.rb +1 -1
- data/app/policies/pageflow/{theming_policy.rb → site_policy.rb} +13 -11
- data/app/views/admin/accounts/_entry_template_details.html.arb +1 -1
- data/app/views/admin/accounts/_form.html.erb +4 -22
- data/app/views/admin/accounts/_site_defaults_inline_help.html.erb +5 -0
- data/app/views/admin/entries/_form.html.erb +4 -13
- data/app/views/admin/entries/_permalink_inputs.html.erb +2 -3
- data/app/views/admin/entries/_site_input.html.erb +15 -0
- data/app/views/admin/entries/{entry_type_name_input.html.erb → entry_site_and_type_name_input.html.erb} +3 -0
- data/app/views/admin/entry_templates/_form.html.erb +5 -5
- data/app/views/admin/sites/_attributes_table.html.arb +12 -0
- data/app/views/admin/sites/_fields.html.erb +23 -0
- data/app/views/admin/sites/_form.html.erb +5 -0
- data/app/views/components/pageflow/admin/entries_tab.rb +1 -2
- data/app/views/components/pageflow/admin/entry_templates_tab.rb +10 -11
- data/app/views/components/pageflow/admin/extensible_attributes_table.rb +8 -2
- data/app/views/components/pageflow/admin/features_tab.rb +1 -1
- data/app/views/components/pageflow/admin/sites_tab.rb +35 -0
- data/app/views/components/pageflow/admin/users_tab.rb +1 -2
- data/app/views/pageflow/editor/config/_seeds.json.jbuilder +1 -0
- data/app/views/pageflow/editor/entries/seed.json.erb +1 -1
- data/app/views/pageflow/editor/sites/_site.json.jbuilder +1 -0
- data/app/views/pageflow/entries/stylesheet.css.erb +1 -1
- data/app/views/pageflow/feeds/index.atom.builder +20 -0
- data/app/views/pageflow/sitemaps/index.xml.builder +9 -0
- data/app/views/pageflow/social_share/_entry_meta_tags.html.erb +1 -1
- data/app/views/pageflow/social_share/_page_meta_tags.html.erb +1 -1
- data/config/initializers/admin_resource_tabs.rb +29 -12
- data/config/initializers/features.rb +1 -0
- data/config/initializers/paperclip.rb +4 -0
- data/config/locales/de.yml +42 -19
- data/config/locales/en.yml +45 -17
- data/config/routes.rb +3 -0
- data/config/spring.rb +1 -1
- data/db/migrate/20221215101134_rename_theming_to_site.rb +9 -0
- data/db/migrate/20221215120856_associate_entry_templates_with_sites.rb +34 -0
- data/db/migrate/20221219203023_add_name_to_sites.rb +5 -0
- data/db/migrate/20230103155934_associate_theme_customizations_with_sites.rb +27 -0
- data/db/migrate/20230120092923_create_other_files.rb +23 -0
- data/db/migrate/20230323115745_add_feeds_enabled_to_sites.rb +5 -0
- data/db/migrate/20230323154323_add_sitemap_enabled_to_sites.rb +5 -0
- data/db/migrate/20230331103823_add_title_to_sites.rb +5 -0
- data/db/migrate/20230405103612_add_custom_feed_url_to_sites.rb +5 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +455 -119
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +31 -8
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
- data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +0 -2
- data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +1 -0
- data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
- data/entry_types/paged/config/initializers/features.rb +0 -1
- data/entry_types/paged/lib/pageflow_paged/engine.rb +17 -1
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +3 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +13 -6
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +2 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +11 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +42 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +3 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +31 -10
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +9 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +3 -1
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +23 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +6 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -5
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +10 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +44 -41
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_consent_vendors.json.jbuilder +16 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +8 -5
- data/entry_types/scrolled/config/initializers/features.rb +5 -0
- data/entry_types/scrolled/config/locales/consent_widget.de.yml +4 -0
- data/entry_types/scrolled/config/locales/consent_widget.en.yml +4 -0
- data/entry_types/scrolled/config/locales/de.yml +189 -8
- data/entry_types/scrolled/config/locales/en.yml +207 -2
- data/entry_types/scrolled/config/routes.rb +4 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +97 -5
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +96 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +38 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +17 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +24 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +6 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +1 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +1 -2
- data/entry_types/scrolled/package/contentElements-editor.js +307 -22
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +690 -71
- data/entry_types/scrolled/package/editor.js +616 -220
- data/entry_types/scrolled/package/frontend/{EditableInlineText.module-c6672f27.js → EditableInlineText.module-fa9e3aff.js} +1669 -1674
- data/entry_types/scrolled/package/frontend/PhonePlatformContext-10a1d600.js +32 -0
- data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-727cce0d.js +107 -0
- data/entry_types/scrolled/package/frontend/Viewer-169e14ca.js +154 -0
- data/entry_types/scrolled/package/frontend/{Viewer-6b05522f.js → Viewer-ee1aa590.js} +32 -161
- data/entry_types/scrolled/package/frontend/arrowRight-92a34ccc.js +77 -0
- data/entry_types/scrolled/package/frontend/{components-487daafa.js → components-4a09bfa3.js} +185 -45
- data/entry_types/scrolled/package/frontend/{PhonePlatformContext-22e65f92.js → i18n-ddd92820.js} +162 -292
- data/entry_types/scrolled/package/frontend/index-02378634.js +118 -0
- data/entry_types/scrolled/package/frontend/index.css +1 -1
- data/entry_types/scrolled/package/frontend/index.js +375 -40
- data/entry_types/scrolled/package/frontend/useContentElementEditorState-63045393.js +52 -0
- data/entry_types/scrolled/package/package.json +2 -1
- data/entry_types/scrolled/package/testHelpers.js +9 -2
- data/entry_types/scrolled/package/values/colors.module.css +15 -0
- data/entry_types/scrolled/package/widgets/consentBar.css +1 -0
- data/entry_types/scrolled/package/widgets/consentBar.js +426 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +16 -9
- data/lib/generators/pageflow/resque/resque_generator.rb +1 -1
- data/lib/pageflow/ability_mixin.rb +21 -13
- data/lib/pageflow/active_admin_can_can_fix.rb +2 -2
- data/lib/pageflow/admin/attributes_table_rows.rb +1 -1
- data/lib/pageflow/admin/form_inputs.rb +1 -1
- data/lib/pageflow/admin/tabs.rb +1 -1
- data/lib/pageflow/built_in_file_type.rb +7 -0
- data/lib/pageflow/configuration/permissions.rb +3 -3
- data/lib/pageflow/configuration.rb +38 -17
- data/lib/pageflow/engine.rb +60 -39
- data/lib/pageflow/entry_export_import/entry_serialization.rb +1 -1
- data/lib/pageflow/entry_export_import/revision_serialization.rb +1 -1
- data/lib/pageflow/file_type.rb +2 -2
- data/lib/pageflow/global_config_api.rb +2 -2
- data/lib/pageflow/nested_revision_component.rb +23 -5
- data/lib/pageflow/primary_domain_entry_redirect.rb +7 -7
- data/lib/pageflow/rails_version.rb +19 -0
- data/lib/pageflow/seeds.rb +20 -17
- data/lib/pageflow/theme_customizations.rb +10 -10
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow/widget_types.rb +4 -0
- data/package/config/webpack5.js +14 -0
- data/package/editor.js +148 -37
- data/package/frontend.js +26 -2
- data/package/testHelpers.js +1 -1
- data/package/ui.js +296 -71
- data/spec/factories/accounts.rb +5 -2
- data/spec/factories/draft_entries.rb +2 -2
- data/spec/factories/entries.rb +19 -5
- data/spec/factories/entry_templates.rb +1 -1
- data/spec/factories/permalink_directory.rb +1 -1
- data/spec/factories/published_entries.rb +2 -2
- data/spec/factories/sites.rb +12 -0
- data/vendor/assets/javascripts/iscroll.js +4 -7
- metadata +84 -59
- data/app/helpers/pageflow/admin/permalinks_helper.rb +0 -15
- data/app/helpers/pageflow/themings_helper.rb +0 -11
- data/app/models/pageflow/theming.rb +0 -30
- data/app/views/admin/accounts/_theming_defaults_inline_help.html.erb +0 -5
- data/app/views/admin/accounts/_theming_details.html.arb +0 -5
- data/app/views/pageflow/editor/themings/_theming.json.jbuilder +0 -1
- data/entry_types/scrolled/package/frontend/arrowRight-7e3d9dd5.js +0 -42
- data/spec/factories/themings.rb +0 -7
- /data/app/views/pageflow/entries/{_theming.css.erb → _site.css.erb} +0 -0
data/lib/pageflow/seeds.rb
CHANGED
@@ -19,7 +19,7 @@ module Pageflow
|
|
19
19
|
module Seeds
|
20
20
|
DEFAULT_USER_PASSWORD = '!Pass123'
|
21
21
|
|
22
|
-
# Create an {Account} with a default {
|
22
|
+
# Create an {Account} with a default {Site} if no account by
|
23
23
|
# that name exists.
|
24
24
|
#
|
25
25
|
# @param [Hash] attributes attributes to override defaults
|
@@ -30,29 +30,29 @@ module Pageflow
|
|
30
30
|
Account.find_or_create_by!(attributes.slice(:name)) do |account|
|
31
31
|
account.attributes = attributes.reverse_merge(name: 'Pageflow')
|
32
32
|
|
33
|
-
|
33
|
+
build_default_site_for(account)
|
34
34
|
|
35
35
|
say_creating_account(account)
|
36
36
|
yield(account) if block_given?
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
# Build a default {
|
40
|
+
# Build a default {Site} for an {Account}. To be used inside a
|
41
41
|
# block passed to {#account}.
|
42
42
|
#
|
43
43
|
# @example
|
44
44
|
#
|
45
45
|
# account(name: 'example') do |account|
|
46
|
-
#
|
47
|
-
#
|
46
|
+
# build_default_site_for(account) do |site|
|
47
|
+
# site.theme_name = 'mdr'
|
48
48
|
# end
|
49
49
|
# end
|
50
50
|
#
|
51
51
|
# @param [Account] account the account to build a default themeing for
|
52
52
|
# @param [Hash] attributes further attributes to override defaults
|
53
|
-
# @yield [
|
54
|
-
# @return [
|
55
|
-
def
|
53
|
+
# @yield [site] a block which is passed the newly built site
|
54
|
+
# @return [Site] newly built site
|
55
|
+
def build_default_site_for(account, attributes = {}, &block)
|
56
56
|
default_attributes = {
|
57
57
|
imprint_link_label: 'Impressum',
|
58
58
|
imprint_link_url: 'http://example.com/impressum.html',
|
@@ -60,7 +60,7 @@ module Pageflow
|
|
60
60
|
copyright_link_url: 'http://www.example.com/copyright.html'
|
61
61
|
}
|
62
62
|
|
63
|
-
account.
|
63
|
+
account.build_default_site(default_attributes.merge(attributes), &block)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Create a {User} if none with the given email exists yet.
|
@@ -97,33 +97,36 @@ module Pageflow
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
# Create a sample {Entry} with some chapter
|
101
|
-
# entry with that title exists in the given account.
|
100
|
+
# Create a sample {Entry} with some chapter, pages, and optional
|
101
|
+
# text if no entry with that title exists in the given account.
|
102
102
|
#
|
103
103
|
# @param [Hash] attributes attributes to override defaults
|
104
104
|
# @option attributes [Account] :account required
|
105
|
-
# @option attributes [
|
105
|
+
# @option attributes [String] :title required
|
106
|
+
# @option attributes [String] :text optional
|
106
107
|
# @yield [entry] a block to be called before the entry is saved
|
107
108
|
# @return [Entry] newly created entry
|
108
109
|
def sample_entry(attributes)
|
109
110
|
entry = Entry.where(attributes.slice(:account, :title)).first
|
111
|
+
page_text = attributes.delete(:text) { |_| '' }
|
110
112
|
|
111
113
|
if entry.nil?
|
112
114
|
entry = Entry.create!(attributes) do |created_entry|
|
113
|
-
created_entry.
|
115
|
+
created_entry.site = attributes.fetch(:account).default_site
|
114
116
|
|
115
117
|
say_creating_entry(created_entry)
|
116
118
|
yield(created_entry) if block_given?
|
117
119
|
end
|
118
120
|
|
119
121
|
storyline = entry.draft.storylines.first
|
120
|
-
|
121
122
|
chapter = storyline.chapters.create!(title: 'Chapter 1', position: 0)
|
122
|
-
chapter.pages.create!(template: 'background_image'
|
123
|
-
|
123
|
+
chapter.pages.create!(template: 'background_image',
|
124
|
+
configuration: {text: page_text})
|
125
|
+
chapter.pages.create!(template: 'background_image',
|
126
|
+
configuration: {text: page_text})
|
124
127
|
|
125
128
|
chapter = storyline.chapters.create!(title: 'Chapter 2', position: 1)
|
126
|
-
chapter.pages.create!(template: 'video')
|
129
|
+
chapter.pages.create!(template: 'video', configuration: {text: page_text})
|
127
130
|
end
|
128
131
|
|
129
132
|
entry
|
@@ -5,10 +5,10 @@ module Pageflow
|
|
5
5
|
# @since 15.7
|
6
6
|
class ThemeCustomizations
|
7
7
|
# Override theme options and files for entries of an entry type in
|
8
|
-
# a specific
|
9
|
-
def update(
|
8
|
+
# a specific site.
|
9
|
+
def update(site:, entry_type_name:, overrides: {}, file_ids: {})
|
10
10
|
ThemeCustomization
|
11
|
-
.find_or_initialize_by(
|
11
|
+
.find_or_initialize_by(site: site, entry_type_name: entry_type_name)
|
12
12
|
.update!(overrides: overrides, selected_file_ids: file_ids)
|
13
13
|
end
|
14
14
|
|
@@ -16,10 +16,10 @@ module Pageflow
|
|
16
16
|
# its theme without actually updating the theme customization.
|
17
17
|
#
|
18
18
|
# @return [PublishedEntry]
|
19
|
-
def preview(
|
19
|
+
def preview(site:, entry:, overrides: {}, file_ids: {})
|
20
20
|
theme_customization =
|
21
21
|
ThemeCustomization
|
22
|
-
.find_or_initialize_by(
|
22
|
+
.find_or_initialize_by(site: site, entry_type_name: entry.type_name)
|
23
23
|
|
24
24
|
theme_customization.assign_attributes(overrides: overrides, selected_file_ids: file_ids)
|
25
25
|
|
@@ -30,12 +30,12 @@ module Pageflow
|
|
30
30
|
PublishedEntry.new(entry, entry.draft, theme: theme)
|
31
31
|
end
|
32
32
|
|
33
|
-
# Get customization for entry type and
|
33
|
+
# Get customization for entry type and site.
|
34
34
|
#
|
35
35
|
# @return [ThemeCustomization]
|
36
|
-
def get(
|
36
|
+
def get(site:, entry_type_name:)
|
37
37
|
ThemeCustomization
|
38
|
-
.find_or_initialize_by(
|
38
|
+
.find_or_initialize_by(site: site, entry_type_name: entry_type_name)
|
39
39
|
end
|
40
40
|
|
41
41
|
# Upload a file that shall be used to customize a theme. Uploading
|
@@ -43,10 +43,10 @@ module Pageflow
|
|
43
43
|
# assign a role via the `file_ids` parameter.
|
44
44
|
#
|
45
45
|
# @return [ThemeCustomizationFile]
|
46
|
-
def upload_file(
|
46
|
+
def upload_file(site:, entry_type_name:, type_name:, attachment:)
|
47
47
|
theme_customization_file =
|
48
48
|
ThemeCustomization
|
49
|
-
.find_or_create_by(
|
49
|
+
.find_or_create_by(site: site, entry_type_name: entry_type_name)
|
50
50
|
.uploaded_files
|
51
51
|
.build(type_name: type_name)
|
52
52
|
|
data/lib/pageflow/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
module.exports = {
|
2
|
+
externals: {
|
3
|
+
'backbone': 'Backbone',
|
4
|
+
'backbone.babysitter': 'Backbone.ChildViewContainer',
|
5
|
+
'cocktail': 'Cocktail',
|
6
|
+
'jquery': 'jQuery',
|
7
|
+
'jquery-ui': 'jQuery',
|
8
|
+
'jquery.minicolors': 'jQuery',
|
9
|
+
'underscore': '_',
|
10
|
+
'backbone.marionette': 'Backbone.Marionette',
|
11
|
+
'iscroll': 'IScroll',
|
12
|
+
'wysihtml5': 'wysihtml5'
|
13
|
+
}
|
14
|
+
};
|
data/package/editor.js
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
import Backbone from 'backbone';
|
2
2
|
import _ from 'underscore';
|
3
|
-
import { Object as Object$1, ConfigurationEditorTabView, TextInputView, UrlDisplayView, TabsView, ConfigurationEditorView, CollectionView, tooltipContainer, SelectInputView, inputView, TextAreaInputView, CheckBoxGroupInputView, i18nUtils, TableView, TextTableCellView, PresenceTableCellView, SortableCollectionView, DeleteRowTableCellView, CheckBoxInputView, SliderInputView, IconTableCellView } from 'pageflow/ui';
|
3
|
+
import { Object as Object$1, ConfigurationEditorTabView, TextInputView, UrlDisplayView, TabsView, ConfigurationEditorView, CollectionView, tooltipContainer, SelectInputView, inputView, TextAreaInputView, CheckBoxGroupInputView, i18nUtils, TableView, TextTableCellView, PresenceTableCellView, SortableCollectionView, attributeBinding, DeleteRowTableCellView, CheckBoxInputView, SliderInputView, IconTableCellView } from 'pageflow/ui';
|
4
4
|
export * from 'pageflow/ui';
|
5
5
|
import Cocktail from 'cocktail';
|
6
6
|
import I18n$1 from 'i18n-js';
|
7
7
|
import Marionette from 'backbone.marionette';
|
8
8
|
import $ from 'jquery';
|
9
9
|
import { browser, features, Audio, events } from 'pageflow/frontend';
|
10
|
+
import 'jquery-ui';
|
10
11
|
|
11
12
|
(function () {
|
12
13
|
var sync = Backbone.sync;
|
@@ -234,7 +235,7 @@ var UnmatchedUploadError = UploadError.extend({
|
|
234
235
|
});
|
235
236
|
var validFileTypeTranslationList = {
|
236
237
|
validFileTypeTranslations: function validFileTypeTranslations(validFileTypes) {
|
237
|
-
return
|
238
|
+
return validFileTypes.map(function (validFileType) {
|
238
239
|
return I18n$1.t('activerecord.models.' + validFileType.i18nKey + '.other');
|
239
240
|
}).join(', ');
|
240
241
|
}
|
@@ -264,7 +265,7 @@ var InvalidNestedTypeError = UploadError.extend({
|
|
264
265
|
initialize: function initialize(upload, options) {
|
265
266
|
var editor = options.editor;
|
266
267
|
var fileType = options.fileType;
|
267
|
-
var validFileTypes = editor.nextUploadTargetFile.fileType().nestedFileTypes
|
268
|
+
var validFileTypes = editor.nextUploadTargetFile.fileType().nestedFileTypes;
|
268
269
|
var validFileTypeTranslations = this.validFileTypeTranslations(validFileTypes);
|
269
270
|
var typeI18nKey = fileType.i18nKey;
|
270
271
|
var typeSingularTranslation = I18n$1.t('activerecord.models.' + typeI18nKey + '.one');
|
@@ -578,22 +579,31 @@ var FileTypes = Object$1.extend({
|
|
578
579
|
this.clientSideConfigModifications[name].push(config);
|
579
580
|
},
|
580
581
|
setup: function setup(serverSideConfigs) {
|
582
|
+
var _this = this;
|
583
|
+
|
581
584
|
var clientSideConfigs = this.clientSideConfigs;
|
582
585
|
this._setup = true;
|
583
|
-
|
586
|
+
|
587
|
+
var configs = _.chain(serverSideConfigs).map(function (serverSideConfig) {
|
584
588
|
var clientSideConfig = clientSideConfigs[serverSideConfig.collectionName];
|
585
589
|
|
586
590
|
if (!clientSideConfig) {
|
587
591
|
throw 'Missing client side config for file type "' + serverSideConfig.collectionName + '"';
|
588
592
|
}
|
589
593
|
|
590
|
-
_(
|
594
|
+
_(_this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
|
591
595
|
this.lintModification(modification, serverSideConfig.collectionName);
|
592
596
|
this.applyModification(clientSideConfig, modification);
|
593
|
-
},
|
597
|
+
}, _this);
|
594
598
|
|
595
|
-
return
|
596
|
-
}
|
599
|
+
return _.extend({}, serverSideConfig, clientSideConfig);
|
600
|
+
}).sortBy(function (config) {
|
601
|
+
return config.priority || 10;
|
602
|
+
}).value();
|
603
|
+
|
604
|
+
this.collection = new FileTypesCollection(_.map(configs, function (config) {
|
605
|
+
return new FileType(config);
|
606
|
+
}));
|
597
607
|
var those = this;
|
598
608
|
|
599
609
|
_.map(serverSideConfigs, function (serverSideConfig) {
|
@@ -1107,10 +1117,12 @@ var EditorApi = Object$1.extend(
|
|
1107
1117
|
* Trigger selection of the given file type with the given
|
1108
1118
|
* handler. Payload hash is passed to selection handler as options.
|
1109
1119
|
*
|
1110
|
-
* @param {string|{name: string, filter: string}} fileType
|
1120
|
+
* @param {string|{name: string, filter: string}|{defaultTab: string, filter: string}} fileType
|
1111
1121
|
* Either collection name of a file type or and object containing
|
1112
1122
|
* the collection name a file type and a the name of a file type
|
1113
|
-
* filter
|
1123
|
+
* filter or an object containingn a defaultTab property that controls
|
1124
|
+
* which tab will visible initially, while allowing selecting files of
|
1125
|
+
* any type.
|
1114
1126
|
*
|
1115
1127
|
* @param {string} handlerName
|
1116
1128
|
* The name of a handler registered via {@link
|
@@ -1136,7 +1148,7 @@ var EditorApi = Object$1.extend(
|
|
1136
1148
|
};
|
1137
1149
|
}
|
1138
1150
|
|
1139
|
-
this.navigate('/files/' + fileType.name + '?handler=' + handlerName + '&payload=' + encodeURIComponent(JSON.stringify(payload)) + (fileType.filter ? '&filter=' + fileType.filter : ''), {
|
1151
|
+
this.navigate('/files/' + (fileType.defaultTab ? "".concat(fileType.defaultTab, ":default") : fileType.name) + '?handler=' + handlerName + '&payload=' + encodeURIComponent(JSON.stringify(payload)) + (fileType.filter ? '&filter=' + fileType.filter : ''), {
|
1140
1152
|
trigger: true
|
1141
1153
|
});
|
1142
1154
|
},
|
@@ -2684,10 +2696,10 @@ var EditLockContainer = Backbone.Model.extend({
|
|
2684
2696
|
handleError: function handleError() {}
|
2685
2697
|
});
|
2686
2698
|
|
2687
|
-
var
|
2688
|
-
modelName: '
|
2689
|
-
i18nKey: 'pageflow/
|
2690
|
-
collectionName: '
|
2699
|
+
var Site = Backbone.Model.extend({
|
2700
|
+
modelName: 'site',
|
2701
|
+
i18nKey: 'pageflow/site',
|
2702
|
+
collectionName: 'sites'
|
2691
2703
|
});
|
2692
2704
|
|
2693
2705
|
var ChapterConfiguration = Configuration.extend({
|
@@ -3555,6 +3567,13 @@ var ForeignKeySubsetCollection = SubsetCollection.extend({
|
|
3555
3567
|
var parent = options.parent;
|
3556
3568
|
var parentModel = options.parentModel;
|
3557
3569
|
this.autoConsolidatePositions = options.autoConsolidatePositions;
|
3570
|
+
this.listenTo(this, 'add', function (model) {
|
3571
|
+
if (options.parentReferenceAttribute) {
|
3572
|
+
model[options.parentReferenceAttribute] = parentModel;
|
3573
|
+
}
|
3574
|
+
|
3575
|
+
model.set(options.foreignKeyAttribute, parentModel.id);
|
3576
|
+
});
|
3558
3577
|
SubsetCollection.prototype.constructor.call(this, {
|
3559
3578
|
parent: parent,
|
3560
3579
|
parentModel: parentModel,
|
@@ -3565,13 +3584,6 @@ var ForeignKeySubsetCollection = SubsetCollection.extend({
|
|
3565
3584
|
return item.get('position');
|
3566
3585
|
}
|
3567
3586
|
});
|
3568
|
-
this.listenTo(this, 'add', function (model) {
|
3569
|
-
if (options.parentReferenceAttribute) {
|
3570
|
-
model[options.parentReferenceAttribute] = parentModel;
|
3571
|
-
}
|
3572
|
-
|
3573
|
-
model.set(options.foreignKeyAttribute, parentModel.id);
|
3574
|
-
});
|
3575
3587
|
this.listenTo(parentModel, 'destroy dependentDestroy', function () {
|
3576
3588
|
this.invoke('trigger', 'dependentDestroy');
|
3577
3589
|
this.clear();
|
@@ -3824,6 +3836,64 @@ var SidebarRouter = Marionette.AppRouter.extend({
|
|
3824
3836
|
}
|
3825
3837
|
});
|
3826
3838
|
|
3839
|
+
function _arrayWithHoles(arr) {
|
3840
|
+
if (Array.isArray(arr)) return arr;
|
3841
|
+
}
|
3842
|
+
|
3843
|
+
function _iterableToArrayLimit(arr, i) {
|
3844
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
3845
|
+
var _arr = [];
|
3846
|
+
var _n = true;
|
3847
|
+
var _d = false;
|
3848
|
+
var _e = undefined;
|
3849
|
+
|
3850
|
+
try {
|
3851
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
3852
|
+
_arr.push(_s.value);
|
3853
|
+
|
3854
|
+
if (i && _arr.length === i) break;
|
3855
|
+
}
|
3856
|
+
} catch (err) {
|
3857
|
+
_d = true;
|
3858
|
+
_e = err;
|
3859
|
+
} finally {
|
3860
|
+
try {
|
3861
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
3862
|
+
} finally {
|
3863
|
+
if (_d) throw _e;
|
3864
|
+
}
|
3865
|
+
}
|
3866
|
+
|
3867
|
+
return _arr;
|
3868
|
+
}
|
3869
|
+
|
3870
|
+
function _arrayLikeToArray(arr, len) {
|
3871
|
+
if (len == null || len > arr.length) len = arr.length;
|
3872
|
+
|
3873
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
3874
|
+
arr2[i] = arr[i];
|
3875
|
+
}
|
3876
|
+
|
3877
|
+
return arr2;
|
3878
|
+
}
|
3879
|
+
|
3880
|
+
function _unsupportedIterableToArray(o, minLen) {
|
3881
|
+
if (!o) return;
|
3882
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
3883
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
3884
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
3885
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
3886
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
3887
|
+
}
|
3888
|
+
|
3889
|
+
function _nonIterableRest() {
|
3890
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
3891
|
+
}
|
3892
|
+
|
3893
|
+
function _slicedToArray(arr, i) {
|
3894
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
3895
|
+
}
|
3896
|
+
|
3827
3897
|
function template$3(data) {
|
3828
3898
|
var __t, __p = '';
|
3829
3899
|
__p += '<a class="back">' +
|
@@ -4514,6 +4584,13 @@ return __p
|
|
4514
4584
|
* Require click to open menu. By default, menu opens on when the
|
4515
4585
|
* mouse enters the button.
|
4516
4586
|
*
|
4587
|
+
* @param {String} [options.alignMenu]
|
4588
|
+
* "right" to align menu on the right. Aligned on the left by
|
4589
|
+
* default.
|
4590
|
+
*
|
4591
|
+
* @param {String} [options.buttonClassName]
|
4592
|
+
* CSS class name for button element.
|
4593
|
+
*
|
4517
4594
|
* ## Item Models
|
4518
4595
|
*
|
4519
4596
|
* The following model attributes can be used to control the
|
@@ -4553,7 +4630,9 @@ var DropDownButtonView = Marionette.ItemView.extend({
|
|
4553
4630
|
this.$el.toggleClass('full_width', !!this.options.fullWidth);
|
4554
4631
|
this.ui.button.toggleClass('has_icon_and_text', !!this.options.label);
|
4555
4632
|
this.ui.button.toggleClass('has_icon_only', !this.options.label);
|
4633
|
+
this.ui.button.toggleClass('ellipsis_icon', !!this.options.ellipsisIcon);
|
4556
4634
|
this.ui.button.text(this.options.label);
|
4635
|
+
this.ui.button.addClass(this.options.buttonClassName);
|
4557
4636
|
this.ui.menu.append(this.subview(new DropDownButtonItemListView({
|
4558
4637
|
items: this.options.items
|
4559
4638
|
})).el);
|
@@ -4577,7 +4656,7 @@ var DropDownButtonView = Marionette.ItemView.extend({
|
|
4577
4656
|
var offset = this.$el.offset();
|
4578
4657
|
this.ui.menu.css({
|
4579
4658
|
top: offset.top + this.$el.height(),
|
4580
|
-
left: offset.left,
|
4659
|
+
left: this.options.alignMenu === 'right' ? offset.left + this.$el.width() - this.ui.menu.outerWidth() : offset.left,
|
4581
4660
|
width: this.options.fullWidth ? this.$el.width() : null
|
4582
4661
|
});
|
4583
4662
|
},
|
@@ -4712,6 +4791,7 @@ var FileInputView = Marionette.ItemView.extend({
|
|
4712
4791
|
if (dropDownMenuItems.length) {
|
4713
4792
|
this.appendSubview(new DropDownButtonView({
|
4714
4793
|
items: dropDownMenuItems,
|
4794
|
+
ellipsisIcon: true,
|
4715
4795
|
openOnClick: true
|
4716
4796
|
}));
|
4717
4797
|
}
|
@@ -5272,7 +5352,7 @@ var EditMetaDataView = Marionette.Layout.extend({
|
|
5272
5352
|
configurationEditor.tab('widgets', function () {
|
5273
5353
|
editor.entryType.appearanceInputs && editor.entryType.appearanceInputs(this, {
|
5274
5354
|
entry: entry,
|
5275
|
-
|
5355
|
+
site: state.site
|
5276
5356
|
});
|
5277
5357
|
entry.widgets && this.view(EditWidgetsView, {
|
5278
5358
|
model: entry,
|
@@ -6302,7 +6382,7 @@ var FilesView = Marionette.ItemView.extend({
|
|
6302
6382
|
this.$el.append(this.subview(this.tabsView).el);
|
6303
6383
|
},
|
6304
6384
|
tab: function tab(fileType) {
|
6305
|
-
var selectionMode = this.options.tabName === fileType.collectionName;
|
6385
|
+
var selectionMode = this.options.allowSelectingAny || this.options.tabName === fileType.collectionName;
|
6306
6386
|
this.tabsView.tab(fileType.collectionName, _.bind(function () {
|
6307
6387
|
return this.subview(new FilteredFilesView({
|
6308
6388
|
entry: state.entry,
|
@@ -6488,10 +6568,10 @@ var PublishEntryView = Marionette.ItemView.extend({
|
|
6488
6568
|
this.ui.publishUntilField.datepicker('setDate', publishedUntil);
|
6489
6569
|
this.ui.publishUntilTimeField.val(timeStr(publishedUntil));
|
6490
6570
|
} else {
|
6491
|
-
this.ui.publishUntilField.datepicker('setDate',
|
6571
|
+
this.ui.publishUntilField.datepicker('setDate', this.defaultPublishedUntilDate());
|
6492
6572
|
}
|
6493
6573
|
|
6494
|
-
this.ui.userNameField.val(
|
6574
|
+
this.ui.userNameField.val(this.options.account.get('name'));
|
6495
6575
|
|
6496
6576
|
if (this.model.get('password_protected')) {
|
6497
6577
|
this.ui.passwordProtectedCheckBox.prop('checked', true);
|
@@ -6511,12 +6591,6 @@ var PublishEntryView = Marionette.ItemView.extend({
|
|
6511
6591
|
return ("0" + val).slice(-2);
|
6512
6592
|
}
|
6513
6593
|
}
|
6514
|
-
|
6515
|
-
function oneYearFromNow() {
|
6516
|
-
var date = new Date();
|
6517
|
-
date.setFullYear(date.getFullYear() + 1);
|
6518
|
-
return date;
|
6519
|
-
}
|
6520
6594
|
},
|
6521
6595
|
save: function save() {
|
6522
6596
|
var publishedUntil = null;
|
@@ -6591,6 +6665,11 @@ var PublishEntryView = Marionette.ItemView.extend({
|
|
6591
6665
|
return false;
|
6592
6666
|
}
|
6593
6667
|
},
|
6668
|
+
defaultPublishedUntilDate: function defaultPublishedUntilDate() {
|
6669
|
+
var date = new Date();
|
6670
|
+
date.setMonth(date.getMonth() + this.options.config.defaultPublishedUntilDurationInMonths);
|
6671
|
+
return date;
|
6672
|
+
},
|
6594
6673
|
enableSave: function enableSave() {
|
6595
6674
|
this.ui.saveButton.removeAttr('disabled');
|
6596
6675
|
},
|
@@ -6690,10 +6769,16 @@ var SidebarController = Marionette.Controller.extend({
|
|
6690
6769
|
}));
|
6691
6770
|
},
|
6692
6771
|
files: function files(collectionName, handler, payload, filterName) {
|
6772
|
+
var _split = (collectionName || '').split(':'),
|
6773
|
+
_split2 = _slicedToArray(_split, 2),
|
6774
|
+
tabName = _split2[0],
|
6775
|
+
suffix = _split2[1];
|
6776
|
+
|
6693
6777
|
this.region.show(new FilesView({
|
6694
6778
|
model: this.entry,
|
6695
6779
|
selectionHandler: handler && editor.createFileSelectionHandler(handler, payload),
|
6696
|
-
tabName:
|
6780
|
+
tabName: tabName,
|
6781
|
+
allowSelectingAny: suffix === 'default',
|
6697
6782
|
filterName: filterName
|
6698
6783
|
}));
|
6699
6784
|
editor.setDefaultHelpEntry('pageflow.help_entries.files');
|
@@ -6720,7 +6805,9 @@ var SidebarController = Marionette.Controller.extend({
|
|
6720
6805
|
publish: function publish() {
|
6721
6806
|
this.region.show(PublishEntryView.create({
|
6722
6807
|
model: this.entry,
|
6723
|
-
|
6808
|
+
account: state.account,
|
6809
|
+
entryPublication: new EntryPublication(),
|
6810
|
+
config: state.config
|
6724
6811
|
}));
|
6725
6812
|
editor.setDefaultHelpEntry('pageflow.help_entries.publish');
|
6726
6813
|
},
|
@@ -7090,7 +7177,15 @@ var HelpImageView = Marionette.View.extend({
|
|
7090
7177
|
|
7091
7178
|
var InfoBoxView = Marionette.View.extend({
|
7092
7179
|
className: 'info_box',
|
7180
|
+
mixins: [attributeBinding],
|
7181
|
+
initialize: function initialize() {
|
7182
|
+
this.setupBooleanAttributeBinding('visible', this.updateVisible);
|
7183
|
+
},
|
7184
|
+
updateVisible: function updateVisible() {
|
7185
|
+
this.$el.toggleClass('hidden_via_binding', this.getBooleanAttributBoundOption('visible') === false);
|
7186
|
+
},
|
7093
7187
|
render: function render() {
|
7188
|
+
this.$el.addClass(this.options.level);
|
7094
7189
|
this.$el.html(this.options.text);
|
7095
7190
|
return this;
|
7096
7191
|
}
|
@@ -8006,6 +8101,10 @@ app.addInitializer(function () {
|
|
8006
8101
|
});
|
8007
8102
|
});
|
8008
8103
|
|
8104
|
+
var OtherFile = UploadableFile.extend({
|
8105
|
+
thumbnailPictogram: 'other'
|
8106
|
+
});
|
8107
|
+
|
8009
8108
|
app.addInitializer(function (options) {
|
8010
8109
|
var textTracksMetaDataAttribute = {
|
8011
8110
|
name: 'text_tracks',
|
@@ -8115,6 +8214,18 @@ app.addInitializer(function (options) {
|
|
8115
8214
|
binding: 'label'
|
8116
8215
|
}
|
8117
8216
|
});
|
8217
|
+
editor.fileTypes.register('other_files', {
|
8218
|
+
model: OtherFile,
|
8219
|
+
metaDataAttributes: [altMetaDataAttribute],
|
8220
|
+
matchUpload: function matchUpload() {
|
8221
|
+
return true;
|
8222
|
+
},
|
8223
|
+
priority: 100,
|
8224
|
+
configurationEditorInputs: [{
|
8225
|
+
name: 'alt',
|
8226
|
+
inputView: TextInputView
|
8227
|
+
}]
|
8228
|
+
});
|
8118
8229
|
editor.fileTypes.setup(options.config.fileTypes);
|
8119
8230
|
});
|
8120
8231
|
|
@@ -8141,7 +8252,7 @@ app.addInitializer(function (options) {
|
|
8141
8252
|
state.entry = editor.createEntryModel(options, {
|
8142
8253
|
widgets: widgets
|
8143
8254
|
});
|
8144
|
-
state.
|
8255
|
+
state.site = new Site(options.site);
|
8145
8256
|
state.account = new Backbone.Model(options.account);
|
8146
8257
|
widgets.subject = state.entry;
|
8147
8258
|
state.storylineOrdering = new StorylineOrdering(state.storylines, state.pages);
|
@@ -8257,4 +8368,4 @@ app.addRegions({
|
|
8257
8368
|
sidebarFooterRegion: 'sidebar .sidebar_footer_container'
|
8258
8369
|
});
|
8259
8370
|
|
8260
|
-
export { AudioFile, BackButtonDecoratorView, BackgroundImageEmbeddedView, BackgroundPositioningPreviewView, BackgroundPositioningSlidersView, BackgroundPositioningView, ChangeThemeDialogView, Chapter, ChapterConfiguration, ChapterPagesCollection, ChapterScaffold, ChaptersCollection, ChooseImporterView, Configuration, ConfirmEncodingView, ConfirmFileImportUploadView, ConfirmUploadView, ConfirmableFileItemView, DropDownButtonItemListView, DropDownButtonItemView, DropDownButtonView, EditConfigurationView, EditEntryView, EditFileView, EditLock, EditLockContainer, EditMetaDataView, EditWidgetView, EditWidgetsView, EditorApi, EditorView, EmulationModeButtonView, EncodedFile, EncodingConfirmation, Entry, EntryMetadata, EntryMetadataFileSelectionHandler, EntryPublication, EntryPublicationQuotaDecoratorView, ExplorerFileItemView, Failure, FileConfiguration, FileImport, FileInputView, FileItemView, FileMetaDataItemValueView, FileMetaDataItemView, FileProcessingStateDisplayView, FileReuse, FileSettingsDialogView, FileStage, FileStageItemView, FileThumbnailView, FileTypes, FileTypesCollection, FileUploader, FilesCollection, FilesExplorerView, FilesImporterView, FilesView, FilteredFilesView, ForeignKeySubsetCollection, HelpButtonView, HelpImageView, HelpView, ImageFile, InfoBoxView, InvalidNestedTypeError, LazyVideoEmbeddedView, ListItemView, ListView, LoadingView, LockedView, ModelThumbnailView, NestedFilesCollection, NestedFilesView, NestedTypeError, NotificationsView, OrderedPageLinksCollection, OtherEntriesCollection, OtherEntriesCollectionView, OtherEntry, OtherEntryItemView, Page, PageConfigurationFileSelectionHandler, PageLink, PageLinkConfigurationEditorView, PageLinkFileSelectionHandler, PageLinkItemView, PageLinksCollection, PageLinksView, PageThumbnailView, PagesCollection, PublishEntryView, ReferenceInputView, ReusableFile, Scaffold, ScrollingView, SelectButtonView, SidebarController, SidebarFooterView, SidebarRouter, StaticThumbnailView, Storyline, StorylineChaptersCollection, StorylineConfiguration, StorylineOrdering, StorylineScaffold, StorylineTransitiveChildPages, StorylinesCollection, SubsetCollection, TextFileMetaDataItemValueView, TextTrackFile, TextTracksFileMetaDataItemValueView, TextTracksView, Theme, ThemeInputView, ThemeItemView, ThemesCollection,
|
8371
|
+
export { AudioFile, BackButtonDecoratorView, BackgroundImageEmbeddedView, BackgroundPositioningPreviewView, BackgroundPositioningSlidersView, BackgroundPositioningView, ChangeThemeDialogView, Chapter, ChapterConfiguration, ChapterPagesCollection, ChapterScaffold, ChaptersCollection, ChooseImporterView, Configuration, ConfirmEncodingView, ConfirmFileImportUploadView, ConfirmUploadView, ConfirmableFileItemView, DropDownButtonItemListView, DropDownButtonItemView, DropDownButtonView, EditConfigurationView, EditEntryView, EditFileView, EditLock, EditLockContainer, EditMetaDataView, EditWidgetView, EditWidgetsView, EditorApi, EditorView, EmulationModeButtonView, EncodedFile, EncodingConfirmation, Entry, EntryMetadata, EntryMetadataFileSelectionHandler, EntryPublication, EntryPublicationQuotaDecoratorView, ExplorerFileItemView, Failure, FileConfiguration, FileImport, FileInputView, FileItemView, FileMetaDataItemValueView, FileMetaDataItemView, FileProcessingStateDisplayView, FileReuse, FileSettingsDialogView, FileStage, FileStageItemView, FileThumbnailView, FileTypes, FileTypesCollection, FileUploader, FilesCollection, FilesExplorerView, FilesImporterView, FilesView, FilteredFilesView, ForeignKeySubsetCollection, HelpButtonView, HelpImageView, HelpView, ImageFile, InfoBoxView, InvalidNestedTypeError, LazyVideoEmbeddedView, ListItemView, ListView, LoadingView, LockedView, ModelThumbnailView, NestedFilesCollection, NestedFilesView, NestedTypeError, NotificationsView, OrderedPageLinksCollection, OtherEntriesCollection, OtherEntriesCollectionView, OtherEntry, OtherEntryItemView, Page, PageConfigurationFileSelectionHandler, PageLink, PageLinkConfigurationEditorView, PageLinkFileSelectionHandler, PageLinkItemView, PageLinksCollection, PageLinksView, PageThumbnailView, PagesCollection, PublishEntryView, ReferenceInputView, ReusableFile, Scaffold, ScrollingView, SelectButtonView, SidebarController, SidebarFooterView, SidebarRouter, Site, StaticThumbnailView, Storyline, StorylineChaptersCollection, StorylineConfiguration, StorylineOrdering, StorylineScaffold, StorylineTransitiveChildPages, StorylinesCollection, SubsetCollection, TextFileMetaDataItemValueView, TextTrackFile, TextTracksFileMetaDataItemValueView, TextTracksView, Theme, ThemeInputView, ThemeItemView, ThemesCollection, UnmatchedUploadError, UploadError, UploadableFile, UploadableFilesView, UploaderView, VideoFile, Widget, WidgetConfiguration, WidgetConfigurationFileSelectionHandler, WidgetItemView, WidgetTypes, WidgetsCollection, addAndReturnModel, app, authenticationProvider, configurationContainer, delayedDestroying, dialogView, editor, entryTypeEditorControllerUrls, failureIndicatingView, failureTracking, fileWithType, filesCountWatcher, formDataUtils, loadable, modelLifecycleTrackingView, orderedCollection, persistedPromise, polling, retryable, selectableView, stageProvider, startEditor, state, stylesheet, transientReferences, validFileTypeTranslationList };
|
data/package/frontend.js
CHANGED
@@ -1240,7 +1240,7 @@ var volumeBinding = function volumeBinding(player, settings, options) {
|
|
1240
1240
|
};
|
1241
1241
|
|
1242
1242
|
player.targetVolume = function () {
|
1243
|
-
return settings.get('volume') * volumeFactor;
|
1243
|
+
return (options.ignoreVolumeSetting ? 1 : settings.get('volume')) * volumeFactor;
|
1244
1244
|
};
|
1245
1245
|
|
1246
1246
|
function listenToVolumeSetting() {
|
@@ -1615,6 +1615,21 @@ mediaPlayer.loadWaiting = loadWaiting;
|
|
1615
1615
|
mediaPlayer.hooks = hooks;
|
1616
1616
|
mediaPlayer.asyncPlay = asyncPlay;
|
1617
1617
|
|
1618
|
+
// Replacement for Underscore's throttle, because scrolled entries
|
1619
|
+
// don't have Underscore anymore
|
1620
|
+
function throttle(func, timeFrame) {
|
1621
|
+
var lastTime = 0;
|
1622
|
+
return function (options) {
|
1623
|
+
var now = new Date();
|
1624
|
+
func = func.bind(this);
|
1625
|
+
|
1626
|
+
if (now - lastTime >= timeFrame) {
|
1627
|
+
func(options);
|
1628
|
+
lastTime = now;
|
1629
|
+
}
|
1630
|
+
};
|
1631
|
+
}
|
1632
|
+
|
1618
1633
|
var mediaEvents = function mediaEvents(player, context) {
|
1619
1634
|
function triggerMediaEvent(name) {
|
1620
1635
|
events.trigger('media:' + name, {
|
@@ -1633,6 +1648,9 @@ var mediaEvents = function mediaEvents(player, context) {
|
|
1633
1648
|
player.on('timeupdate', function () {
|
1634
1649
|
triggerMediaEvent('timeupdate');
|
1635
1650
|
});
|
1651
|
+
player.on('timeupdate', throttle(function () {
|
1652
|
+
triggerMediaEvent('timeupdate_throttled');
|
1653
|
+
}, 5000));
|
1636
1654
|
player.on('pause', function () {
|
1637
1655
|
triggerMediaEvent('pause');
|
1638
1656
|
});
|
@@ -2150,6 +2168,9 @@ var mediaEvents$1 = function mediaEvents(player, context) {
|
|
2150
2168
|
player.on('timeupdate', function () {
|
2151
2169
|
triggerMediaEvent('timeupdate');
|
2152
2170
|
});
|
2171
|
+
player.on('timeupdate', throttle(function () {
|
2172
|
+
triggerMediaEvent('timeupdate_throttled');
|
2173
|
+
}, 5000));
|
2153
2174
|
player.on('pause', function () {
|
2154
2175
|
triggerMediaEvent('pause');
|
2155
2176
|
});
|
@@ -2291,11 +2312,13 @@ var createMediaPlayer = function createMediaPlayer(options) {
|
|
2291
2312
|
nativeCaptions: !isAudio && browser.has('iphone platform'),
|
2292
2313
|
// Only used by pageflow-scrolled
|
2293
2314
|
vhs: {
|
2294
|
-
useBandwidthFromLocalStorage: true
|
2315
|
+
useBandwidthFromLocalStorage: true,
|
2316
|
+
usePlayerObjectFit: true
|
2295
2317
|
}
|
2296
2318
|
},
|
2297
2319
|
bufferUnderrunWaiting: true,
|
2298
2320
|
fallbackToMutedAutoplay: !isAudio,
|
2321
|
+
ignoreVolumeSetting: true,
|
2299
2322
|
volumeFading: true,
|
2300
2323
|
hooks: {},
|
2301
2324
|
mediaEvents: true,
|
@@ -2524,6 +2547,7 @@ var MediaPool = /*#__PURE__*/function () {
|
|
2524
2547
|
tagName: type
|
2525
2548
|
});
|
2526
2549
|
mediaEl.setAttribute('src', blankSources[type].src);
|
2550
|
+
player.muted(true);
|
2527
2551
|
this.unAllocatedPlayers[type].push(player);
|
2528
2552
|
return player;
|
2529
2553
|
}
|
data/package/testHelpers.js
CHANGED
@@ -174,7 +174,7 @@ var ConfigurationEditorTab = Base.extend({
|
|
174
174
|
}).get();
|
175
175
|
},
|
176
176
|
visibleInputPropertyNames: function visibleInputPropertyNames() {
|
177
|
-
return this.$el.find('.input:not(.
|
177
|
+
return this.$el.find('.input:not(.hidden_via_binding)').map(function () {
|
178
178
|
return $(this).data('inputPropertyName');
|
179
179
|
}).get();
|
180
180
|
},
|