pageflow 15.2.0 → 15.5.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 -5
- data/CHANGELOG.md +89 -83
- data/README.md +2 -3
- data/admins/pageflow/accounts.rb +1 -98
- data/admins/pageflow/entry.rb +21 -1
- data/admins/pageflow/entry_templates.rb +140 -0
- data/admins/pageflow/membership.rb +12 -0
- data/admins/pageflow/user.rb +5 -5
- data/app/assets/javascripts/pageflow/admin/accounts.js +1 -1
- data/app/assets/javascripts/pageflow/admin/entries.js +65 -0
- data/app/assets/javascripts/pageflow/admin/users.js +1 -1
- data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -0
- data/app/assets/javascripts/pageflow/base.js +0 -12
- data/app/assets/javascripts/pageflow/components.js +2 -6
- data/app/assets/javascripts/pageflow/dist/ui.js +178 -55
- data/app/assets/javascripts/pageflow/editor/vendor.js +1 -0
- data/app/assets/javascripts/pageflow/vendor.js +12 -10
- data/app/assets/stylesheets/pageflow/base.scss +0 -7
- data/app/assets/stylesheets/pageflow/editor/base.scss +5 -2
- data/app/assets/stylesheets/pageflow/editor/composables.scss +5 -1
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +44 -55
- data/app/assets/stylesheets/pageflow/editor/help.scss +2 -2
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -1
- data/app/assets/stylesheets/pageflow/entries.scss +1 -1
- data/app/assets/stylesheets/pageflow/loading_spinner.scss +4 -1
- data/app/assets/stylesheets/pageflow/navigation_mobile.scss +4 -4
- data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/page.scss +7 -0
- data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/shared/menu_bar.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/control_bar.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/quality_menu.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/waveform/wave.scss +1 -1
- data/app/assets/stylesheets/pageflow/ui/forms.scss +9 -2
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +2 -2
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +17 -3
- data/app/helpers/pageflow/admin/entries_helper.rb +16 -0
- data/app/helpers/pageflow/structured_data_helper.rb +0 -2
- data/app/models/pageflow/account.rb +21 -1
- data/app/models/pageflow/account_role_query.rb +1 -1
- data/app/models/pageflow/chapter.rb +3 -9
- data/app/models/pageflow/entry.rb +9 -2
- data/app/models/pageflow/entry_duplicate.rb +1 -0
- data/app/models/pageflow/entry_template.rb +16 -2
- data/app/models/pageflow/managed_user_query.rb +1 -1
- data/app/models/pageflow/page.rb +1 -4
- data/app/models/pageflow/revision.rb +0 -4
- data/app/models/pageflow/storyline.rb +2 -9
- data/app/policies/pageflow/account_policy.rb +10 -0
- data/app/policies/pageflow/entry_template_policy.rb +5 -1
- data/app/policies/pageflow/folder_policy.rb +2 -2
- data/app/policies/pageflow/membership_policy.rb +2 -2
- data/app/policies/pageflow/theming_policy.rb +2 -2
- data/app/policies/pageflow/user_policy.rb +1 -1
- data/app/views/admin/accounts/_entry_template_details.html.arb +7 -5
- data/app/views/admin/accounts/_form.html.erb +3 -49
- data/app/views/admin/entries/_attributes_table.html.arb +5 -0
- data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +2 -0
- data/app/views/admin/entries/entry_types.json.jbuilder +4 -0
- data/app/views/admin/entry_templates/_form.html.erb +58 -0
- data/app/views/admin/users/_not_allowed_to_see_user_quota.html.erb +3 -0
- data/app/views/components/pageflow/admin/entry_templates_tab.rb +48 -0
- data/app/views/pageflow/admin/initial_passwords/edit.html.erb +2 -1
- data/app/views/pageflow/admin/users/_quota_exhausted.html.erb +1 -1
- data/app/views/pageflow/themes/_theme.json.jbuilder +1 -1
- data/app/views/pageflow/video_files/_video_file.json.jbuilder +8 -1
- data/config/initializers/admin_resource_tabs.rb +5 -0
- data/config/initializers/help_entries.rb +1 -5
- data/config/initializers/revision_components.rb +5 -0
- data/config/locales/de.yml +88 -155
- data/config/locales/en.yml +79 -143
- data/db/migrate/20200515112500_add_constraints_to_entry_templates.rb +21 -0
- data/db/migrate/20200807135200_rename_pageflow_entry_template_entry_type_to_entry_type_name.rb +7 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/components.js +7 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +1528 -1349
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +9258 -0
- data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-client.js +1 -1
- data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-server.js +3 -3
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/frontend.js +6 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/server_rendering.js +9 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +9 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/videojs.js +6 -0
- data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +2 -2
- data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/page_background_asset_helper.rb +4 -3
- data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/react_server_side_rendering_helper.rb +23 -2
- data/entry_types/paged/app/views/layouts/pageflow_paged/_loading_spinner_inline_script.html.erb +1 -0
- data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +3 -3
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +4 -2
- data/entry_types/paged/app/views/pageflow_paged/entries/_entry.html.erb +1 -1
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/page_background_asset/_element.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/_widget.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/page.html.erb +0 -0
- data/entry_types/paged/config/initializers/features.rb +1 -1
- data/entry_types/paged/config/initializers/help_entries.rb +17 -0
- data/entry_types/paged/config/locales/new/help.de.yml +162 -0
- data/entry_types/paged/config/locales/new/help.en.yml +153 -0
- data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -0
- data/entry_types/paged/lib/pageflow_paged/plugin.rb +5 -1
- data/entry_types/paged/lib/pageflow_paged/react.rb +12 -0
- data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/page_type.rb +2 -2
- data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/widget_type.rb +2 -2
- data/entry_types/paged/lib/tasks/pageflow_paged_tasks.rake +7 -0
- data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react-server.js +20613 -0
- data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react.js +21495 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/dash.all.min.js +0 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs-dash.js +0 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs.js +0 -0
- data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react-server.js +24 -0
- data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react.js +24 -0
- data/entry_types/scrolled/app/assets/javascripts/pageflow_scrolled/legacy.js +0 -0
- 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 +14 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +10 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +7 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/favicon_helper.rb +21 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +40 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +36 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +3 -9
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +37 -2
- data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +3 -9
- data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +1 -9
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/content_elements/batch.json.jbuilder +2 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -7
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/_global_notices.html.erb +10 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +28 -11
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +3 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +8 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +10 -0
- data/entry_types/scrolled/config/initializers/help_entries.rb +16 -0
- data/entry_types/scrolled/config/locales/de.yml +669 -0
- data/entry_types/scrolled/config/locales/en.yml +488 -0
- data/entry_types/scrolled/config/routes.rb +1 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +76 -6
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-192x192.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-512x512.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/apple-touch-icon.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/browserconfig.xml +9 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-16x16.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-32x32.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon.ico +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/mstile-150x150.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/safari-pinned-tab.svg +46 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/site.webmanifest +19 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg +56 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg +22 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/unmute.mp3 +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +26 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +4 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +3 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +90 -30
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/create_bundle_symlinks_for_yarn.rake +32 -0
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +8 -0
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +173 -0
- data/entry_types/scrolled/package/contentElements-editor.js +541 -0
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements-frontend.js +1169 -0
- data/entry_types/scrolled/package/editor.js +2930 -371
- data/entry_types/scrolled/package/frontend-server.js +228 -0
- data/entry_types/scrolled/package/frontend/EditableText-7093fd0e.js +1071 -0
- data/entry_types/scrolled/package/frontend/Viewer-e49e7807.js +387 -0
- data/entry_types/scrolled/package/frontend/Wavesurfer-0adf5667.js +375 -0
- data/entry_types/scrolled/package/frontend/components-6a6793ca.js +2534 -0
- data/entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js +86 -0
- data/entry_types/scrolled/package/frontend/i18n-4dc6c377.js +1092 -0
- data/entry_types/scrolled/package/frontend/index.css +9 -0
- data/entry_types/scrolled/package/frontend/index.js +5686 -0
- data/entry_types/scrolled/package/frontend/useBrowserFeature-91a4c29d.js +33 -0
- data/entry_types/scrolled/package/package.json +30 -9
- data/entry_types/scrolled/spec/fixtures/audio.m4a +0 -0
- data/entry_types/scrolled/spec/fixtures/video.mp4 +0 -0
- data/lib/generators/pageflow/initializer/templates/pageflow.rb +14 -9
- data/lib/pageflow/ability_mixin.rb +14 -2
- data/lib/pageflow/configuration.rb +6 -5
- data/lib/pageflow/entry_export_import/revision_serialization.rb +15 -13
- data/lib/pageflow/entry_export_import/revision_serialization/import.rb +18 -26
- data/lib/pageflow/entry_type_configuration.rb +2 -0
- data/lib/pageflow/global_config_api.rb +5 -4
- data/lib/pageflow/nested_revision_component.rb +49 -0
- data/lib/pageflow/react.rb +4 -2
- data/lib/pageflow/revision_component.rb +6 -2
- data/lib/pageflow/themes.rb +4 -0
- data/lib/pageflow/user_mixin.rb +2 -1
- data/lib/pageflow/version.rb +1 -1
- data/{packages/pageflow → package}/config/jest/index.js +8 -2
- data/{packages/pageflow → package}/config/jest/transformers/jst.js +0 -0
- data/{packages/pageflow → package}/config/jest/transformers/upwardBabel.js +0 -0
- data/{packages/pageflow → package}/config/webpack.js +7 -0
- data/{packages/pageflow → package}/editor.js +482 -1130
- data/package/frontend.js +2553 -0
- data/{packages/pageflow → package}/package.json +3 -0
- data/{packages/pageflow → package}/testHelpers.js +114 -13
- data/{packages/pageflow → package}/ui.js +178 -55
- data/spec/factories/accounts.rb +3 -1
- data/spec/factories/entry_templates.rb +1 -0
- data/spec/factories/published_entries.rb +6 -1
- data/spec/factories/test_revision_components.rb +4 -0
- metadata +96 -37
- data/app/assets/javascripts/pageflow/dist/editor.js +0 -11890
- data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
- data/app/assets/javascripts/pageflow/videojs.js +0 -6
- data/config/initializers/entry_types.rb +0 -4
- data/entry_types/scrolled/config/locales/new/de.yml +0 -269
- data/entry_types/scrolled/config/locales/new/en.yml +0 -264
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +0 -96
- data/entry_types/scrolled/package/frontend.js +0 -2879
- data/packages/pageflow/config/jest/transformers/cssModules.js +0 -1
@@ -4,17 +4,60 @@ module PageflowScrolled
|
|
4
4
|
class InstallGenerator < Rails::Generators::Base
|
5
5
|
desc 'Installs Pageflow Scrolled entry type.'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
source_root File.expand_path('templates', __dir__)
|
8
|
+
|
9
|
+
def initializer
|
10
|
+
inject_into_file('config/initializers/pageflow.rb',
|
11
|
+
after: "Pageflow.configure do |config|\n") do
|
12
|
+
" config.plugin(PageflowScrolled.plugin)\n\n" \
|
13
|
+
" config.for_entry_type(PageflowScrolled.entry_type) do |entry_type_config|\n" \
|
14
|
+
" entry_type_config.plugin(ScrolledThemesPlugin.new)\n" \
|
15
|
+
" end\n\n"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def theme_plugin
|
20
|
+
# Ruby files in the lib directory are eager loaded in
|
21
|
+
# production. This includes template files in
|
22
|
+
# lib/generators. Template file extension (.tt) is removed by
|
23
|
+
# Thor automatically and ensures the file is not picked up by
|
24
|
+
# eager loading.
|
25
|
+
template 'themes_plugin.rb.tt', 'app/plugins/scrolled_themes_plugin.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
def install_packages
|
29
|
+
run 'yarn add postcss-url@^8.0.0 @fontsource/source-sans-pro'
|
11
30
|
end
|
12
31
|
|
13
32
|
def webpack_environment
|
14
33
|
inject_into_file('config/webpack/environment.js',
|
15
34
|
before: "module.exports = environment\n") do
|
16
|
-
"
|
17
|
-
"environment.config.merge(
|
35
|
+
"environment.config.merge(require('pageflow/config/webpack'))\n" \
|
36
|
+
"environment.config.merge(require('pageflow-scrolled/config/webpack'))\n\n" \
|
37
|
+
"// Opt into future default behavior of Webpacker [1] to work around\n" \
|
38
|
+
"// problems with Video.js DASH service worker.\n" \
|
39
|
+
"//\n" \
|
40
|
+
"// [1] https://github.com/rails/webpacker/pull/2624\n" \
|
41
|
+
"environment.loaders.delete('nodeModules')\n\n"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def webpacker_yml
|
46
|
+
gsub_file('config/webpacker.yml',
|
47
|
+
'extract_css: false',
|
48
|
+
'extract_css: true')
|
49
|
+
|
50
|
+
inject_into_file('config/webpacker.yml',
|
51
|
+
after: "- .woff2\n") do
|
52
|
+
" - .mp3\n - .webmanifest\n - .xml\n"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def postcss_config
|
57
|
+
inject_into_file('postcss.config.js',
|
58
|
+
after: "require('postcss-import'),\n") do
|
59
|
+
" // Make relative urls in fontsource packages work\n" \
|
60
|
+
" require('postcss-url')({url: 'rebase'}),\n"
|
18
61
|
end
|
19
62
|
end
|
20
63
|
|
@@ -30,8 +73,35 @@ module PageflowScrolled
|
|
30
73
|
create_file 'app/javascript/packs/pageflow-scrolled-frontend.js', <<-JS
|
31
74
|
import 'pageflow-scrolled/frontend';
|
32
75
|
import 'pageflow-scrolled/contentElements-frontend';
|
76
|
+
|
77
|
+
require.context('../pageflow-scrolled/themes', true);
|
78
|
+
JS
|
79
|
+
end
|
80
|
+
|
81
|
+
def server_pack
|
82
|
+
create_file 'app/javascript/packs/pageflow-scrolled-server.js', <<-JS
|
83
|
+
import 'pageflow-scrolled/frontend-server';
|
84
|
+
import 'pageflow-scrolled/contentElements-frontend';
|
85
|
+
JS
|
86
|
+
end
|
87
|
+
|
88
|
+
def theme_pack
|
89
|
+
create_file 'app/javascript/packs/pageflow-scrolled-theme.css', <<-JS
|
90
|
+
@import "pageflow-scrolled/frontend/index.css";
|
91
|
+
@import "pageflow-scrolled/contentElements-frontend.css";
|
33
92
|
JS
|
34
93
|
end
|
94
|
+
|
95
|
+
def default_font_pack
|
96
|
+
create_file 'app/javascript/packs/fonts/sourceSansPro.css', <<-CSS
|
97
|
+
@import "@fontsource/source-sans-pro/400.css";
|
98
|
+
@import "@fontsource/source-sans-pro/700.css";
|
99
|
+
CSS
|
100
|
+
end
|
101
|
+
|
102
|
+
def default_theme
|
103
|
+
directory 'theme', 'app/javascript/pageflow-scrolled/themes/default'
|
104
|
+
end
|
35
105
|
end
|
36
106
|
end
|
37
107
|
end
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<browserconfig>
|
3
|
+
<msapplication>
|
4
|
+
<tile>
|
5
|
+
<square150x150logo src="/packs/media/pageflow-scrolled/themes/default/favicons/mstile-150x150-b864e2984146784ebc748b287926ef50.png"/>
|
6
|
+
<TileColor>#da532c</TileColor>
|
7
|
+
</tile>
|
8
|
+
</msapplication>
|
9
|
+
</browserconfig>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
5
|
+
width="678.000000pt" height="678.000000pt" viewBox="0 0 678.000000 678.000000"
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
7
|
+
<metadata>
|
8
|
+
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
9
|
+
</metadata>
|
10
|
+
<g transform="translate(0.000000,678.000000) scale(0.100000,-0.100000)"
|
11
|
+
fill="#000000" stroke="none">
|
12
|
+
<path d="M3879 5786 c-2 -2 -42 -7 -89 -10 -47 -3 -96 -8 -110 -11 -14 -3 -41
|
13
|
+
-8 -60 -11 -41 -7 -113 -28 -190 -56 -54 -19 -220 -97 -230 -108 -3 -3 -21
|
14
|
+
-14 -40 -24 -119 -65 -214 -149 -648 -581 -327 -325 -474 -478 -528 -550 -41
|
15
|
+
-55 -79 -105 -84 -111 -18 -23 -100 -181 -129 -250 -38 -89 -77 -224 -88 -301
|
16
|
+
-10 -70 -9 -306 0 -348 4 -16 10 -46 13 -65 3 -19 10 -43 15 -52 5 -10 7 -18
|
17
|
+
5 -18 -10 0 46 -136 86 -210 92 -172 123 -205 1073 -1158 l920 -923 480 482
|
18
|
+
c482 483 537 546 634 711 39 67 111 227 111 247 0 6 4 19 10 29 8 16 46 178
|
19
|
+
49 212 21 250 -13 446 -110 641 -42 85 -138 230 -181 272 -33 33 -35 46 -10
|
20
|
+
73 17 18 74 96 97 132 60 94 142 251 150 287 1 5 7 23 14 39 14 34 49 167 57
|
21
|
+
217 14 80 13 296 -1 368 -21 105 -60 221 -105 310 -38 76 -134 224 -167 259
|
22
|
+
-10 10 -43 45 -74 78 -163 173 -331 289 -510 355 -109 40 -186 57 -290 64 -26
|
23
|
+
1 -51 5 -57 9 -5 3 -11 4 -13 2z m141 -206 c80 -15 167 -44 242 -81 60 -30
|
24
|
+
203 -125 235 -156 19 -18 0 -37 -809 -848 -501 -503 -852 -862 -888 -910 -33
|
25
|
+
-44 -64 -85 -68 -90 -5 -6 -11 -15 -13 -20 -2 -6 -21 -39 -41 -75 -33 -58
|
26
|
+
-102 -211 -113 -252 -2 -5 -4 -10 -5 -13 -1 -3 -3 -8 -4 -12 -2 -5 -8 -26 -14
|
27
|
+
-48 -6 -22 -14 -53 -16 -70 -3 -16 -9 -41 -12 -55 -12 -52 -12 -301 1 -355 7
|
28
|
+
-30 9 -55 5 -55 -13 0 -435 435 -465 480 -16 25 -35 50 -42 57 -20 22 -112
|
29
|
+
217 -123 263 -46 190 -47 336 -4 504 42 161 143 357 258 501 40 50 888 902
|
30
|
+
936 940 76 61 273 186 300 191 3 0 30 12 60 26 179 83 395 112 580 78z m693
|
31
|
+
-466 c187 -249 246 -497 191 -789 -22 -116 -138 -374 -206 -460 -5 -5 -27 -35
|
32
|
+
-50 -65 -23 -30 -240 -255 -482 -498 -502 -505 -448 -449 -507 -527 -159 -209
|
33
|
+
-266 -461 -294 -690 -6 -53 -7 -191 0 -235 2 -19 7 -56 10 -82 4 -26 10 -62
|
34
|
+
16 -80 7 -27 -35 11 -219 198 -250 253 -253 257 -304 329 -83 117 -161 302
|
35
|
+
-175 415 -11 86 -5 255 11 325 9 39 19 81 22 95 3 13 10 30 16 37 6 7 8 13 5
|
36
|
+
13 -4 0 6 28 22 63 15 34 34 77 42 95 7 17 17 32 20 32 4 0 9 8 12 19 2 10 31
|
37
|
+
58 63 107 50 77 175 207 898 932 462 463 843 842 847 842 3 0 31 -34 62 -76z
|
38
|
+
m-34 -1678 c28 -35 51 -68 51 -74 0 -6 4 -12 8 -14 24 -9 127 -231 138 -298 3
|
39
|
+
-14 7 -32 10 -40 17 -48 22 -213 9 -310 -10 -72 -48 -204 -80 -273 -14 -31
|
40
|
+
-25 -58 -25 -60 0 -7 -82 -151 -90 -157 -3 -3 -18 -25 -34 -49 -43 -66 -61
|
41
|
+
-85 -469 -495 l-378 -379 -29 33 c-16 18 -42 51 -57 74 -15 22 -31 42 -35 44
|
42
|
+
-5 2 -8 8 -8 13 0 5 -11 26 -24 47 -27 44 -93 204 -100 247 -3 17 -9 51 -14
|
43
|
+
76 -21 110 -6 263 42 449 8 29 77 185 98 220 105 174 132 206 532 608 220 221
|
44
|
+
401 402 402 402 1 0 25 -29 53 -64z"/>
|
45
|
+
</g>
|
46
|
+
</svg>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "",
|
3
|
+
"short_name": "",
|
4
|
+
"icons": [
|
5
|
+
{
|
6
|
+
"src": "/packs/media/pageflow-scrolled/themes/default/favicons/android-chrome-192x192-51c13a8bffeb2de9cad6501969363159.png",
|
7
|
+
"sizes": "192x192",
|
8
|
+
"type": "image/png"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"src": "/packs/media/pageflow-scrolled/themes/default/favicons/android-chrome-512x512-a4f131c6059e0d4b2f15e5f9aecfcf16.png",
|
12
|
+
"sizes": "512x512",
|
13
|
+
"type": "image/png"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"theme_color": "#ffffff",
|
17
|
+
"background_color": "#ffffff",
|
18
|
+
"display": "standalone"
|
19
|
+
}
|
data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 20.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
+
viewBox="0 -50 951.9 338.9" xml:space="preserve">
|
5
|
+
<style type="text/css">
|
6
|
+
.st0{fill:#343434;}
|
7
|
+
.st1{fill:#343434;stroke:#343434;}
|
8
|
+
</style>
|
9
|
+
<title>Element 1</title>
|
10
|
+
<g id="Ebene_2">
|
11
|
+
<g id="Ebene_1-2">
|
12
|
+
<path class="st0" d="M106.3,238.9l-86.7-86.7C-3.7,129-2,105.3,3.4,89.5c3.8-10.6,9.7-20.2,17.4-28.4l6.5,6.5
|
13
|
+
C20.5,74.8,15.3,83.4,12,92.8c-6.6,19.3-1.8,37.1,14,52.9l80.2,80.2l39.1-39.1l6.5,6.5L106.3,238.9z"/>
|
14
|
+
<path class="st0" d="M104.2,234.5c-23.2-23.2-21.8-46.8-16.5-62.4c3.6-10.5,9.4-20,17-28.1l42.3-42.3l6.5,6.5l-42.3,42.3
|
15
|
+
c-6.6,7.2-11.7,15.7-14.9,24.9c-6.3,19-1.5,36.8,14.3,52.6L104.2,234.5z"/>
|
16
|
+
<path class="st0" d="M61.3,193.9c-23.2-23.2-21.8-46.8-16.5-62.4c3.6-10.5,9.4-20,17-28.1l84-84l6.5,6.5l-84,84
|
17
|
+
c-6.6,7.2-11.7,15.7-14.9,24.9c-6.4,19.1-1.5,36.8,14.4,52.7L61.3,193.9z"/>
|
18
|
+
<path class="st0" d="M151.6,110.1l-6.5-6.5c6.7-7.2,11.8-15.7,15-25c6.4-19.1,1.6-36.9-14.3-52.7S112.1,5.4,92.6,12.2
|
19
|
+
C83.1,15.7,74.4,21,67,27.8L25.1,69.7l-6.5-6.5l41.9-41.9c8.3-7.8,18.1-13.8,28.8-17.7c16-5.6,39.9-7.5,63.1,15.8
|
20
|
+
s21.7,46.8,16.4,62.5C165.1,92.4,159.2,102,151.6,110.1z"/>
|
21
|
+
<path class="st0" d="M151.2,194l-6.5-6.5l3.2,3.2l-3.3-3.2c6.5-7.1,11.5-15.5,14.6-24.6c6.2-18.9,1.3-36.5-14.6-52.4l6.5-6.5
|
22
|
+
c23.2,23.2,21.9,46.6,16.8,62.1C164.5,176.5,158.7,186,151.2,194z"/>
|
23
|
+
<path class="st0" d="M102.2,69.6"/>
|
24
|
+
<path class="st0" d="M106.8,224.7"/>
|
25
|
+
<path class="st1" d="M239.2,70.9c0-1.8,0.9-2.8,2.7-2.8h24.5c14.1,0,24.3,9.2,24.3,23.7s-10.2,24.1-24.3,24.1H247V144
|
26
|
+
c0.2,1.4-0.8,2.6-2.2,2.8c-0.2,0-0.3,0-0.5,0H242c-1.8,0-2.7-1-2.7-2.8L239.2,70.9z M265.4,109c10.5,0,17.4-6.4,17.4-17.1
|
27
|
+
s-6.8-16.8-17.2-16.8H247V109H265.4z"/>
|
28
|
+
<path class="st1" d="M326.5,70.4c0.3-1.4,1.6-2.3,3-2.2h3.7c1.4-0.1,2.7,0.9,3,2.2l27.1,73.2c0.6,2-0.2,3.2-2.2,3.2h-2.5
|
29
|
+
c-1.5,0.1-2.8-0.8-3.1-2.2l-8.4-22.8h-31.5l-8.3,22.8c-0.3,1.4-1.7,2.4-3.1,2.2h-2.4c-2.1,0-2.9-1.2-2.4-3.2L326.5,70.4z
|
30
|
+
M344.9,115l-10.4-28.5c-1.2-3.7-2.9-10.3-2.9-10.3h-0.2c0,0-1.8,6.6-3,10.3L317.8,115H344.9z"/>
|
31
|
+
<path class="st1" d="M449.2,130.2c-1.9,6.2-16.6,18-32.8,18c-21.6,0-38.6-17.4-38.6-40.6c0-22.9,17-40.7,39.7-40.7
|
32
|
+
c13.4,0,22.5,5.2,25.9,7.5c1.1,0.6,1.5,2.1,0.9,3.2c-0.1,0.2-0.3,0.4-0.4,0.6l-1,1.4c-0.6,1.2-2.1,1.6-3.3,1
|
33
|
+
c-0.2-0.1-0.3-0.2-0.5-0.3c-6.4-4-13.7-6.2-21.3-6.2c-19,0-31.9,14.7-31.9,33.2c0,19.2,13.3,33.6,31.2,33.6
|
34
|
+
c15.8,0,24.9-11.5,24.9-11.5v-13.2h-19.6c-1.5,0-2.8-1.3-2.8-2.8V112c0-1.5,1.3-2.8,2.8-2.8h24.1c1.5,0,2.7,1.2,2.7,2.7
|
35
|
+
c0,0,0,0,0,0L449.2,130.2"/>
|
36
|
+
<path class="st1" d="M474.2,70.9c0-1.8,0.9-2.8,2.7-2.8h38.8c1.4-0.2,2.6,0.9,2.8,2.3c0,0.2,0,0.4,0,0.5v1.3
|
37
|
+
c0.2,1.4-0.9,2.6-2.3,2.8c-0.2,0-0.4,0-0.5,0h-33.8v28.7H509c1.8,0,2.8,0.9,2.8,2.7v1.4c0.2,1.4-0.9,2.6-2.3,2.8
|
38
|
+
c-0.2,0-0.4,0-0.5,0h-27.1v29.2h35.8c1.4-0.2,2.6,0.9,2.8,2.3c0,0.2,0,0.4,0,0.5v1.3c0.2,1.4-0.9,2.6-2.3,2.8c-0.2,0-0.4,0-0.5,0
|
39
|
+
h-40.9c-1.8,0-2.7-1-2.7-2.8L474.2,70.9z"/>
|
40
|
+
<path class="st1" d="M543.5,70.9c0-1.8,0.9-2.8,2.7-2.8h35.9c1.4-0.2,2.6,0.9,2.8,2.3c0,0.2,0,0.4,0,0.5v1.3
|
41
|
+
c0.2,1.4-0.9,2.6-2.3,2.8c-0.2,0-0.4,0-0.5,0h-30.9v29.6h26.2c1.3-0.2,2.5,0.7,2.7,2c0,0.2,0,0.5,0,0.7v1.4c0,1.8-0.9,2.8-2.7,2.8
|
42
|
+
h-26.2V144c0.2,1.4-0.8,2.6-2.2,2.8c-0.2,0-0.3,0-0.5,0h-2.3c-1.8,0-2.7-1-2.7-2.8V70.9z"/>
|
43
|
+
<path class="st1" d="M606.6,70.9c0-1.8,0.9-2.8,2.7-2.8h2.3c1.4-0.1,2.6,0.9,2.7,2.3c0,0.2,0,0.3,0,0.5v68.9H648
|
44
|
+
c1.4-0.2,2.6,0.9,2.8,2.3c0,0.2,0,0.4,0,0.5v1.3c0.2,1.4-0.9,2.6-2.3,2.8c-0.2,0-0.4,0-0.5,0h-38.7c-1.8,0-2.7-1-2.7-2.8
|
45
|
+
L606.6,70.9z"/>
|
46
|
+
<path class="st1" d="M699.6,66.8c23.1,0,40.1,17.6,40.1,40.2c0,23.1-17,41.2-40.1,41.2S659.5,130,659.5,107
|
47
|
+
C659.5,84.4,676.6,66.8,699.6,66.8z M699.6,140.9c18.5,0,32-14.8,32-33.9c0-18.7-13.5-32.9-32-32.9s-32,14.2-32,32.9
|
48
|
+
C667.6,126.1,681.2,140.9,699.6,140.9z"/>
|
49
|
+
<path class="st1" d="M756.7,71.2c-0.5-1.9,0.5-3,2.5-3h2.5c1.5-0.1,2.8,1,3,2.5l14.7,58.7c1,4,1.8,8.4,1.8,8.4h0.2
|
50
|
+
c0,0,0.8-4.4,1.9-8.4l16.3-58.8c0.3-1.4,1.6-2.4,3-2.3h2.6c1.5-0.1,2.8,0.9,3,2.3l16.1,58.8c0.8,2.8,1.5,5.6,2,8.4h0.2
|
51
|
+
c0,0,0.7-4.4,1.7-8.4l15.3-58.7c0.2-1.5,1.5-2.5,3-2.5h2.5c1.9,0,2.9,1.1,2.3,3l-19.5,73.3c-0.3,1.5-1.6,2.5-3.1,2.4h-4.2
|
52
|
+
c-1.5,0.1-2.8-0.9-3.1-2.4l-14.5-53c-1.5-5-2.8-11.8-2.8-11.8h-0.3c0,0-1.3,6.7-2.8,11.8l-14.7,53c-0.3,1.4-1.6,2.4-3,2.4h-4.4
|
53
|
+
c-1.5,0.1-2.8-1-3-2.5L756.7,71.2z"/>
|
54
|
+
</g>
|
55
|
+
</g>
|
56
|
+
</svg>
|
data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 20.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
+
viewBox="-50 -50 272.07254 338.90793" xml:space="preserve">
|
5
|
+
<style type="text/css">
|
6
|
+
.st0{fill:#343434;}
|
7
|
+
</style>
|
8
|
+
<title>Pageflow</title>
|
9
|
+
<path class="st0" d="M106.3,238.9l-86.7-86.7C-3.7,129-2,105.3,3.4,89.5c3.8-10.6,9.7-20.2,17.4-28.4l6.5,6.5
|
10
|
+
C20.5,74.8,15.3,83.4,12,92.8c-6.6,19.3-1.8,37.1,14,52.9l80.2,80.2l39.1-39.1l6.5,6.5L106.3,238.9z"/>
|
11
|
+
<path class="st0" d="M104.2,234.5c-23.2-23.2-21.8-46.8-16.5-62.4c3.6-10.5,9.4-20,17-28.1l42.3-42.3l6.5,6.5l-42.3,42.3
|
12
|
+
c-6.6,7.2-11.7,15.7-14.9,24.9c-6.3,19-1.5,36.8,14.3,52.6L104.2,234.5z"/>
|
13
|
+
<path class="st0" d="M61.3,193.9c-23.2-23.2-21.8-46.8-16.5-62.4c3.6-10.5,9.4-20,17-28.1l84-84l6.5,6.5l-84,84
|
14
|
+
c-6.6,7.2-11.7,15.7-14.9,24.9c-6.4,19.1-1.5,36.8,14.4,52.7L61.3,193.9z"/>
|
15
|
+
<path class="st0" d="M151.6,110.1l-6.5-6.5c6.7-7.2,11.8-15.7,15-25c6.4-19.1,1.6-36.9-14.3-52.7S112.1,5.4,92.6,12.2
|
16
|
+
C83.1,15.7,74.4,21,67,27.8L25.1,69.7l-6.5-6.5l41.9-41.9c8.3-7.8,18.1-13.8,28.8-17.7c16-5.6,39.9-7.5,63.1,15.8
|
17
|
+
s21.7,46.8,16.4,62.5C165.1,92.4,159.2,102,151.6,110.1z"/>
|
18
|
+
<path class="st0" d="M151.2,194l-6.5-6.5l3.2,3.2l-3.3-3.2c6.5-7.1,11.5-15.5,14.6-24.6c6.2-18.9,1.3-36.5-14.6-52.4l6.5-6.5
|
19
|
+
c23.2,23.2,21.9,46.6,16.8,62.1C164.5,176.5,158.7,186,151.2,194z"/>
|
20
|
+
<path class="st0" d="M102.2,69.6"/>
|
21
|
+
<path class="st0" d="M106.8,224.7"/>
|
22
|
+
</svg>
|
Binary file
|
data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Extracted from initializer to allow auto loading changes in
|
2
|
+
# development
|
3
|
+
class ScrolledThemesPlugin
|
4
|
+
def configure(config) # rubocop:disable Metrics/MethodLength
|
5
|
+
config.themes.register(:default,
|
6
|
+
stylesheet_packs: ['fonts/sourceSansPro'],
|
7
|
+
font_family: {
|
8
|
+
entry: '"Source Sans Pro", sans-serif',
|
9
|
+
navigation: '"Source Sans Pro", sans-serif'
|
10
|
+
},
|
11
|
+
colors: {
|
12
|
+
accent: '#e10028',
|
13
|
+
navigation: {
|
14
|
+
surface: '#fff',
|
15
|
+
on_surface: '#000',
|
16
|
+
primary_on_surface: '#00375a',
|
17
|
+
secondary_on_surface: '#c2c2c2',
|
18
|
+
background: 'rgba(255, 255, 255, 0.95)',
|
19
|
+
on_background: '#000',
|
20
|
+
primary_on_background: '#00375a'
|
21
|
+
}
|
22
|
+
},
|
23
|
+
logo_alt_text: 'Pageflow',
|
24
|
+
theme_color: '#ffffff')
|
25
|
+
end
|
26
|
+
end
|
@@ -5,5 +5,9 @@ module PageflowScrolled
|
|
5
5
|
|
6
6
|
config.paths.add('lib', eager_load: true)
|
7
7
|
config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]
|
8
|
+
|
9
|
+
initializer 'pageflow_scrolled.assets.precompile' do |app|
|
10
|
+
app.config.assets.precompile += %w[pageflow_scrolled/legacy.js]
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
@@ -2,7 +2,9 @@ module PageflowScrolled
|
|
2
2
|
# @api private
|
3
3
|
class Plugin < Pageflow::Plugin
|
4
4
|
def configure(config)
|
5
|
-
config.
|
5
|
+
config.features.register('scrolled_entry_type') do |feature_config|
|
6
|
+
feature_config.entry_types.register(PageflowScrolled.entry_type)
|
7
|
+
end
|
6
8
|
|
7
9
|
config.for_entry_type(PageflowScrolled.entry_type) do |c|
|
8
10
|
c.file_types.register(Pageflow::BuiltInFileType.image)
|
@@ -20,9 +20,17 @@ module PageflowScrolled
|
|
20
20
|
# to determine the React component used to render this content element.
|
21
21
|
# @option attributes [Hash] :image_files A hash mapping image
|
22
22
|
# names used in properties like `backdrop.image` to urls.
|
23
|
+
# @option attributes [Hash] :audio_files A hash mapping audio files to urls.
|
24
|
+
# @option attributes [Hash] :video_files A hash mapping video
|
25
|
+
# names used in properties like `backdrop.video` to urls.
|
26
|
+
# @option attributes [Hash] :text_track_files A hash mapping text track files to urls.
|
23
27
|
# @yield [entry] a block to be called before the entry is saved
|
28
|
+
# @param [Hash] options options for entry and files creation
|
29
|
+
# @option options [Boolean] :skip_encoding
|
30
|
+
# Flag indicating whether to encode video and audio files on creation or set them directly to
|
31
|
+
# encoded
|
24
32
|
# @return [Entry] newly created entry
|
25
|
-
def sample_scrolled_entry(attributes)
|
33
|
+
def sample_scrolled_entry(attributes:, options: {})
|
26
34
|
entry = Pageflow::Entry.where(type_name: 'scrolled')
|
27
35
|
.where(attributes.slice(:account, :title))
|
28
36
|
.first
|
@@ -30,18 +38,44 @@ module PageflowScrolled
|
|
30
38
|
if entry.nil?
|
31
39
|
entry = Pageflow::Entry.create!(type_name: 'scrolled',
|
32
40
|
**attributes.except(:chapters,
|
33
|
-
:image_files
|
41
|
+
:image_files,
|
42
|
+
:video_files,
|
43
|
+
:audio_files,
|
44
|
+
:text_track_files)) do |created_entry|
|
34
45
|
created_entry.theming = attributes.fetch(:account).default_theming
|
35
46
|
|
36
47
|
say_creating_scrolled_entry(created_entry)
|
37
48
|
yield(created_entry) if block_given?
|
38
49
|
end
|
39
50
|
|
40
|
-
|
41
|
-
|
51
|
+
draft_entry = Pageflow::DraftEntry.new(entry)
|
52
|
+
|
53
|
+
image_files_by_name = create_files(draft_entry,
|
54
|
+
:image,
|
55
|
+
attributes.fetch(:image_files, {}))
|
56
|
+
|
57
|
+
video_files_by_name = create_files(draft_entry,
|
58
|
+
:video,
|
59
|
+
attributes.fetch(:video_files, {}),
|
60
|
+
options.fetch(:skip_encoding, false))
|
61
|
+
|
62
|
+
audio_files_by_name = create_files(draft_entry,
|
63
|
+
:audio,
|
64
|
+
attributes.fetch(:audio_files, {}),
|
65
|
+
options.fetch(:skip_encoding, false))
|
66
|
+
|
67
|
+
files_by_name = image_files_by_name.merge(video_files_by_name).merge(audio_files_by_name)
|
68
|
+
|
69
|
+
# rewrite parent file references to actual ids
|
70
|
+
text_tracks_by_name = attributes.fetch(:text_track_files, {})
|
71
|
+
text_tracks_by_name.each do |_name, text_track_config|
|
72
|
+
parent_file = files_by_name.fetch(text_track_config['parent_file_id'])
|
73
|
+
text_track_config['parent_file_id'] = parent_file.id
|
74
|
+
end
|
75
|
+
create_files(draft_entry, :text_track, text_tracks_by_name)
|
42
76
|
|
43
77
|
attributes[:chapters].each_with_index do |chapter_config, i|
|
44
|
-
create_chapter(entry, chapter_config, i,
|
78
|
+
create_chapter(entry, chapter_config, i, files_by_name)
|
45
79
|
end
|
46
80
|
end
|
47
81
|
|
@@ -58,18 +92,46 @@ module PageflowScrolled
|
|
58
92
|
say(" sample scrolled entry '#{entry.title}'\n")
|
59
93
|
end
|
60
94
|
|
61
|
-
def
|
62
|
-
|
63
|
-
say(" creating
|
95
|
+
def create_files(draft_entry, file_type, file_data_by_name, skip_encoding = false)
|
96
|
+
file_data_by_name.transform_values do |data|
|
97
|
+
say(" creating #{file_type} file from #{data['url']}")
|
98
|
+
|
99
|
+
file_state = %i[image text_track].include?(file_type) ? 'processed' : 'uploading'
|
100
|
+
file = draft_entry.create_file!(Pageflow::BuiltInFileType.send(file_type),
|
101
|
+
state: file_state,
|
102
|
+
attachment: URI.parse(data['url']),
|
103
|
+
configuration: data['configuration'],
|
104
|
+
parent_file_model_type: data['parent_file_model_type'],
|
105
|
+
parent_file_id: data['parent_file_id'],
|
106
|
+
**data.slice('width', 'height').symbolize_keys)
|
107
|
+
if %i[audio video].include?(file_type)
|
108
|
+
if skip_encoding
|
109
|
+
file.update!(state: 'encoded')
|
110
|
+
if file_type.eql?(:video)
|
111
|
+
file.update!(output_presences: {
|
112
|
+
"dash-playlist" => true,
|
113
|
+
"hls-playlist" => true,
|
114
|
+
"dash-medium"=> true,
|
115
|
+
"hls-medium" => true,
|
116
|
+
"dash-high" => true,
|
117
|
+
"hls-high" => true,
|
118
|
+
"dash-low" => true,
|
119
|
+
"hls-low" => true,
|
120
|
+
"medium" => true,
|
121
|
+
"high" => true,
|
122
|
+
"low" => true
|
123
|
+
})
|
124
|
+
end
|
125
|
+
else
|
126
|
+
file.publish!
|
127
|
+
end
|
128
|
+
end
|
64
129
|
|
65
|
-
|
66
|
-
state: 'processed',
|
67
|
-
attachment: URI.parse(data['url']),
|
68
|
-
configuration: data['configuration'])
|
130
|
+
file
|
69
131
|
end
|
70
132
|
end
|
71
133
|
|
72
|
-
def create_chapter(entry, chapter_config, position,
|
134
|
+
def create_chapter(entry, chapter_config, position, files_by_name)
|
73
135
|
section_configs = chapter_config.delete('sections') || []
|
74
136
|
chapter = Chapter.create!(
|
75
137
|
revision: entry.draft,
|
@@ -81,34 +143,33 @@ module PageflowScrolled
|
|
81
143
|
)
|
82
144
|
|
83
145
|
section_configs.each_with_index do |section_config, i|
|
84
|
-
create_section(chapter, section_config, i,
|
146
|
+
create_section(chapter, section_config, i, files_by_name)
|
85
147
|
end
|
86
148
|
end
|
87
149
|
|
88
|
-
def create_section(chapter, section_config, position,
|
150
|
+
def create_section(chapter, section_config, position, files_by_name)
|
89
151
|
content_element_configs = section_config.delete('foreground') || []
|
90
152
|
|
91
153
|
rewrite_file_references!(section_config['backdrop'],
|
92
|
-
[
|
93
|
-
|
154
|
+
%w[image imageMobile video],
|
155
|
+
files_by_name)
|
94
156
|
|
95
157
|
section = Section.create!(chapter: chapter,
|
96
158
|
configuration: section_config,
|
97
159
|
position: position)
|
98
160
|
|
99
161
|
content_element_configs.each_with_index do |content_element_config, i|
|
100
|
-
create_content_element(section, content_element_config, i,
|
162
|
+
create_content_element(section, content_element_config, i, files_by_name)
|
101
163
|
end
|
102
164
|
end
|
103
165
|
|
104
|
-
def create_content_element(section, content_element_config, position,
|
105
|
-
if %w[
|
106
|
-
|
107
|
-
)
|
166
|
+
def create_content_element(section, content_element_config, position, files_by_name)
|
167
|
+
if %w[inlineAudio inlineBeforeAfter inlineImage inlineVideo stickyImage]
|
168
|
+
.include?(content_element_config['type'])
|
108
169
|
rewrite_file_references!(
|
109
170
|
content_element_config['props'],
|
110
|
-
[
|
111
|
-
|
171
|
+
%w[id before_id after_id],
|
172
|
+
files_by_name
|
112
173
|
)
|
113
174
|
end
|
114
175
|
|
@@ -119,20 +180,19 @@ module PageflowScrolled
|
|
119
180
|
)
|
120
181
|
end
|
121
182
|
|
122
|
-
def rewrite_file_references!(hash, keys,
|
183
|
+
def rewrite_file_references!(hash, keys, files_by_name)
|
123
184
|
return unless hash
|
124
185
|
|
125
186
|
keys.each do |key|
|
126
187
|
next unless hash[key]
|
127
|
-
next if
|
188
|
+
next if non_file_reference?(hash[key])
|
128
189
|
|
129
|
-
hash[key] =
|
190
|
+
hash[key] = files_by_name.fetch(hash[key]).perma_id
|
130
191
|
end
|
131
192
|
end
|
132
193
|
|
133
|
-
def
|
134
|
-
value.starts_with?('#')
|
135
|
-
value.starts_with?('video')
|
194
|
+
def non_file_reference?(value)
|
195
|
+
value.starts_with?('#')
|
136
196
|
end
|
137
197
|
end
|
138
198
|
end
|