pageflow 15.2.2 → 15.3.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 +4 -4
- data/CHANGELOG.md +338 -85
- 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 -3
- 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 +47 -14
- data/app/assets/javascripts/pageflow/vendor.js +13 -10
- data/app/assets/stylesheets/pageflow/base.scss +0 -7
- data/app/assets/stylesheets/pageflow/editor/base.scss +2 -0
- data/app/assets/stylesheets/pageflow/editor/composables.scss +5 -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/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/entry.rb +9 -2
- data/app/models/pageflow/entry_duplicate.rb +1 -0
- data/app/models/pageflow/entry_template.rb +16 -2
- data/app/policies/pageflow/account_policy.rb +10 -0
- data/app/policies/pageflow/entry_template_policy.rb +5 -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/users/_quota_exhausted.html.erb +1 -1
- data/config/initializers/admin_resource_tabs.rb +5 -0
- data/config/initializers/help_entries.rb +1 -5
- 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 +1479 -1391
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +9218 -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 +8 -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/application.html.erb +2 -2
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +2 -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/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/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 +8 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +6 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +33 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +8 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +38 -0
- 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/show.html.erb +19 -3
- 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 +7 -0
- data/entry_types/scrolled/config/initializers/help_entries.rb +16 -0
- data/entry_types/scrolled/config/locales/new/de.yml +345 -13
- data/entry_types/scrolled/config/locales/new/en.yml +257 -14
- data/entry_types/scrolled/config/routes.rb +1 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +28 -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/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_tasks.rake +64 -27
- data/entry_types/scrolled/package/contentElements-editor.js +242 -183
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements-frontend.js +624 -279
- data/entry_types/scrolled/package/editor.js +2561 -363
- data/entry_types/scrolled/package/frontend-server.js +228 -0
- data/entry_types/scrolled/package/frontend/EditableText-4264c349.js +1993 -0
- data/entry_types/scrolled/package/frontend/Wavesurfer-c3c45324.js +378 -0
- data/entry_types/scrolled/package/frontend/components-cfe6a479.js +2115 -0
- data/entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js +86 -0
- data/entry_types/scrolled/package/frontend/index.css +9 -0
- data/entry_types/scrolled/package/frontend/index.js +4425 -0
- data/entry_types/scrolled/package/package.json +17 -6
- 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 +20 -9
- data/lib/pageflow/ability_mixin.rb +14 -2
- data/lib/pageflow/configuration.rb +6 -5
- data/lib/pageflow/engine.rb +1 -0
- data/lib/pageflow/entry_type_configuration.rb +1 -0
- data/lib/pageflow/global_config_api.rb +5 -4
- data/lib/pageflow/react.rb +4 -2
- data/lib/pageflow/version.rb +1 -1
- data/{packages/pageflow → package}/config/jest/index.js +2 -1
- data/{packages/pageflow → package}/config/jest/transformers/jst.js +0 -0
- data/{packages/pageflow → package}/config/jest/transformers/upwardBabel.js +0 -0
- data/package/config/webpack.js +22 -0
- data/{packages/pageflow → package}/editor.js +480 -1129
- data/package/frontend.js +2525 -0
- data/{packages/pageflow → package}/package.json +3 -0
- data/{packages/pageflow → package}/testHelpers.js +114 -13
- data/{packages/pageflow → package}/ui.js +47 -14
- data/spec/factories/accounts.rb +3 -1
- data/spec/factories/entry_templates.rb +1 -0
- data/spec/factories/published_entries.rb +6 -1
- metadata +62 -26
- data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
- data/config/initializers/entry_types.rb +0 -4
- data/entry_types/scrolled/package/frontend.js +0 -2879
- data/packages/pageflow/config/jest/transformers/cssModules.js +0 -1
- data/packages/pageflow/config/webpack.js +0 -14
@@ -7,22 +7,33 @@
|
|
7
7
|
"author": "Codevise Solutions GmbH <info@codevise.de>",
|
8
8
|
"license": "MIT",
|
9
9
|
"dependencies": {
|
10
|
+
"core-js": "^3.6.5",
|
11
|
+
"debounce": "^1.2.0",
|
12
|
+
"deep-assign": "^3.0.0",
|
13
|
+
"intersection-observer": "^0.7.0",
|
10
14
|
"prop-types": "^15.7.2",
|
11
|
-
"react": "
|
12
|
-
"react-
|
15
|
+
"react-compare-image": "https://github.com/codevise/react-compare-image#offset-width-fix",
|
16
|
+
"react-draggable": "^4.4.2",
|
17
|
+
"react-measure": "^2.3.0",
|
13
18
|
"react-player": "^1.15.2",
|
14
19
|
"react-tooltip": "^3.11.1",
|
15
|
-
"
|
20
|
+
"react_ujs": "^2.6.1",
|
21
|
+
"slate": "^0.57.3",
|
22
|
+
"slate-react": "^0.57.3",
|
23
|
+
"wavesurfer.js": "https://github.com/tf/wavesurfer.js#patches",
|
24
|
+
"whatwg-fetch": "^3.0.0"
|
16
25
|
},
|
17
26
|
"peerDependencies": {
|
18
|
-
"pageflow": "15.1.0"
|
27
|
+
"pageflow": "15.1.0",
|
28
|
+
"react": "^16.9.0",
|
29
|
+
"react-dom": "^16.9.0"
|
19
30
|
},
|
20
31
|
"devDependencies": {
|
21
32
|
"@percy/storybook": "^3.2.0",
|
22
33
|
"@storybook/addon-viewport": "^5.3.13",
|
23
34
|
"@storybook/react": "^5.3.9",
|
24
35
|
"@testing-library/jest-dom": "^4.2.4",
|
25
|
-
"@testing-library/react": "^
|
36
|
+
"@testing-library/react": "^10.3.0",
|
26
37
|
"@testing-library/react-hooks": "^3.2.1",
|
27
38
|
"@typescript-eslint/eslint-plugin": "2.x",
|
28
39
|
"@typescript-eslint/parser": "2.x",
|
@@ -39,8 +50,8 @@
|
|
39
50
|
"eslint-plugin-react": "7.x",
|
40
51
|
"eslint-plugin-react-hooks": "1.x",
|
41
52
|
"jest": "^24.9.0",
|
42
|
-
"jest-css-modules-transform": "^3.1.0",
|
43
53
|
"jest-svg-transformer": "^1.0.0",
|
54
|
+
"react-svg-loader": "^3.0.3",
|
44
55
|
"react-test-renderer": "^16.9.0"
|
45
56
|
},
|
46
57
|
"scripts": {
|
Binary file
|
Binary file
|
@@ -3,19 +3,30 @@ Pageflow.configure do |config|
|
|
3
3
|
# users.
|
4
4
|
config.mailer_sender = 'change-me-at-config-initializers-pageflow@example.com'
|
5
5
|
|
6
|
-
#
|
6
|
+
# Entry type plugins
|
7
|
+
config.plugin(PageflowPaged.plugin)
|
8
|
+
config.plugin(PageflowScrolled.plugin)
|
9
|
+
|
10
|
+
# Plugins that provide page types and widget types.
|
7
11
|
config.plugin(Pageflow.built_in_page_types_plugin)
|
8
12
|
config.plugin(Pageflow.built_in_widget_types_plugin)
|
9
13
|
# config.plugin(Pageflow::Rainbow.plugin)
|
10
14
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
config.for_entry_type(PageflowPaged.entry_type) do |entry_type_config|
|
16
|
+
# Add custom themes by invoking the pageflow:theme generator and
|
17
|
+
# registering the theme here.
|
18
|
+
#
|
19
|
+
# $ rails generate pageflow:theme my_custom_theme
|
20
|
+
# => creates app/assets/stylesheets/pageflow/themes/my_custom_theme.css.scss
|
21
|
+
#
|
22
|
+
entry_type_config.themes.register(:default)
|
23
|
+
# config.themes.register(:my_custom_theme)
|
24
|
+
end
|
25
|
+
|
26
|
+
config.for_entry_type(PageflowScrolled.entry_type) do |entry_type_config|
|
27
|
+
entry_type_config.themes.register(:default,
|
28
|
+
logo_alt_text: 'Pageflow')
|
29
|
+
end
|
19
30
|
|
20
31
|
# String to interpolate into paths of files generated by paperclip
|
21
32
|
# preprocessors. This allows to refresh cdn caches after
|
@@ -23,6 +23,10 @@ module Pageflow
|
|
23
23
|
AccountPolicy.new(user, account).add_member_to?
|
24
24
|
end
|
25
25
|
|
26
|
+
can :see_user_quota, Account do |account|
|
27
|
+
AccountPolicy.new(user, account).see_user_quota?
|
28
|
+
end
|
29
|
+
|
26
30
|
can :see_badge_belonging_to, Account do |account|
|
27
31
|
AccountPolicy.new(user, account).see_badge_belonging_to?
|
28
32
|
end
|
@@ -95,6 +99,10 @@ module Pageflow
|
|
95
99
|
Admin::AdminOnlyTabPolicy.new(user, tab).see?
|
96
100
|
end
|
97
101
|
|
102
|
+
can :see_entry_types, Account do |account|
|
103
|
+
AccountPolicy.new(user, account).see_entry_types?
|
104
|
+
end
|
105
|
+
|
98
106
|
unless user.admin?
|
99
107
|
can :configure_folder_on, Account do |account|
|
100
108
|
AccountPolicy.new(user, account).configure_folder_on?
|
@@ -214,8 +222,12 @@ module Pageflow
|
|
214
222
|
ThemingPolicy.new(user, theming).edit?
|
215
223
|
end
|
216
224
|
|
217
|
-
can :
|
218
|
-
EntryTemplatePolicy.new(user, entry_template).
|
225
|
+
can :create, EntryTemplate do |entry_template|
|
226
|
+
EntryTemplatePolicy.new(user, entry_template).create?
|
227
|
+
end
|
228
|
+
|
229
|
+
can :update, EntryTemplate do |entry_template|
|
230
|
+
EntryTemplatePolicy.new(user, entry_template).update?
|
219
231
|
end
|
220
232
|
|
221
233
|
can :create, ::User do |managed_user|
|
@@ -500,13 +500,14 @@ module Pageflow
|
|
500
500
|
# Restricts the configuration interface to those parts which can
|
501
501
|
# be used from inside features.
|
502
502
|
FeatureLevelConfiguration = Struct.new(:config) do
|
503
|
-
delegate :page_types, to: :config
|
504
|
-
delegate :widget_types, to: :config
|
505
|
-
delegate :help_entries, to: :config
|
506
|
-
delegate :admin_form_inputs, to: :config
|
507
503
|
delegate :admin_attributes_table_rows, to: :config
|
508
|
-
delegate :
|
504
|
+
delegate :admin_form_inputs, to: :config
|
505
|
+
delegate :entry_types, to: :config
|
509
506
|
delegate :file_importers, to: :config
|
507
|
+
delegate :help_entries, to: :config
|
508
|
+
delegate :page_types, to: :config
|
509
|
+
delegate :themes, to: :config
|
510
|
+
delegate :widget_types, to: :config
|
510
511
|
|
511
512
|
delegate :for_entry_type, to: :config
|
512
513
|
end
|
data/lib/pageflow/engine.rb
CHANGED
@@ -44,13 +44,14 @@ module Pageflow
|
|
44
44
|
# @return [Configuration]
|
45
45
|
# @since 0.9
|
46
46
|
def config_for(target)
|
47
|
-
config = build_config(
|
47
|
+
config = build_config(
|
48
|
+
target.respond_to?(:entry_type) && target.entry_type.name
|
49
|
+
) do |c|
|
48
50
|
c.enable_features(target.enabled_feature_names(c))
|
49
51
|
end
|
50
52
|
|
51
|
-
if target.respond_to?(:
|
52
|
-
config = Configuration::ConfigView.new(config,
|
53
|
-
config.entry_types.find_by_name!(target.type_name))
|
53
|
+
if target.respond_to?(:entry_type)
|
54
|
+
config = Configuration::ConfigView.new(config, target.entry_type)
|
54
55
|
end
|
55
56
|
|
56
57
|
config
|
data/lib/pageflow/react.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
module Pageflow
|
2
2
|
module React
|
3
|
+
# @deprecated Use `PageflowPaged::React.create_page_type` instead.
|
3
4
|
def self.create_page_type(name, options = {})
|
4
|
-
|
5
|
+
PageflowPaged::React.create_page_type(name, options)
|
5
6
|
end
|
6
7
|
|
8
|
+
# @deprecated Use `PageflowPaged::React.create_widget_type` instead.
|
7
9
|
def self.create_widget_type(name, role, options = {})
|
8
|
-
|
10
|
+
PageflowPaged::React.create_widget_type(name, role, options)
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
data/lib/pageflow/version.rb
CHANGED
@@ -12,12 +12,13 @@ module.exports = {
|
|
12
12
|
'^cocktail$': resolve('../../src/vendor/cocktail'),
|
13
13
|
'^iscroll$': resolve('../../src/vendor/iscroll'),
|
14
14
|
'^wysihtml5': resolve('../../spec/support/wysihtmlStub'),
|
15
|
+
'^videojs$': resolve('../../../vendor/assets/javascripts/videojs')
|
15
16
|
},
|
16
17
|
|
17
18
|
transform: {
|
18
19
|
'^.+\\.jst$': resolve('./transformers/jst'),
|
19
20
|
'^.+\\.jsx?$': resolve('./transformers/upwardBabel'),
|
20
|
-
'^.+\\.module.css$':
|
21
|
+
'^.+\\.module.css$': 'jest-css-modules-processor'
|
21
22
|
}
|
22
23
|
}
|
23
24
|
|
File without changes
|
File without changes
|
@@ -0,0 +1,22 @@
|
|
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
|
+
'videojs': 'videojs',
|
14
|
+
},
|
15
|
+
// Webpack's chunk loading code references `window` by default -
|
16
|
+
// which is not available in server side rendering context.
|
17
|
+
//
|
18
|
+
// https://github.com/webpack/webpack/blob/c9d4ff7b054fc581c96ce0e53432d44f9dd8ca72/lib/web/JsonpMainTemplatePlugin.js#L493
|
19
|
+
output: {
|
20
|
+
globalObject: 'this'
|
21
|
+
}
|
22
|
+
};
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import Backbone from 'backbone';
|
2
|
-
import _
|
3
|
-
import { Object as Object$1, ConfigurationEditorTabView, TextInputView, UrlDisplayView, TabsView, ConfigurationEditorView, CollectionView,
|
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';
|
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
|
-
import '
|
9
|
+
import { browser, features, Audio, events } from 'pageflow/frontend';
|
10
10
|
|
11
11
|
(function () {
|
12
12
|
var sync = Backbone.sync;
|
@@ -36,6 +36,40 @@ function _defineProperty(obj, key, value) {
|
|
36
36
|
return obj;
|
37
37
|
}
|
38
38
|
|
39
|
+
function ownKeys(object, enumerableOnly) {
|
40
|
+
var keys = Object.keys(object);
|
41
|
+
|
42
|
+
if (Object.getOwnPropertySymbols) {
|
43
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
44
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
45
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
46
|
+
});
|
47
|
+
keys.push.apply(keys, symbols);
|
48
|
+
}
|
49
|
+
|
50
|
+
return keys;
|
51
|
+
}
|
52
|
+
|
53
|
+
function _objectSpread2(target) {
|
54
|
+
for (var i = 1; i < arguments.length; i++) {
|
55
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
56
|
+
|
57
|
+
if (i % 2) {
|
58
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
59
|
+
_defineProperty(target, key, source[key]);
|
60
|
+
});
|
61
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
62
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
63
|
+
} else {
|
64
|
+
ownKeys(Object(source)).forEach(function (key) {
|
65
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
66
|
+
});
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
return target;
|
71
|
+
}
|
72
|
+
|
39
73
|
var CommonPageConfigurationTabs = Object$1.extend({
|
40
74
|
initialize: function initialize() {
|
41
75
|
this.configureFns = {};
|
@@ -44,7 +78,7 @@ var CommonPageConfigurationTabs = Object$1.extend({
|
|
44
78
|
this.configureFns[name] = configureFn;
|
45
79
|
},
|
46
80
|
apply: function apply(configurationEditorView) {
|
47
|
-
_
|
81
|
+
_.each(this.configureFns, function (configureFn, name) {
|
48
82
|
configurationEditorView.tab(name, function () {
|
49
83
|
configureFn.call(prefixInputDecorator(name, this));
|
50
84
|
});
|
@@ -138,13 +172,13 @@ var FailuresAPI = Object$1.extend(
|
|
138
172
|
});
|
139
173
|
},
|
140
174
|
retry: function retry() {
|
141
|
-
_
|
175
|
+
_.each(this.failures, function (failure, key) {
|
142
176
|
this.remove(key);
|
143
177
|
failure.retry();
|
144
178
|
}, this);
|
145
179
|
},
|
146
180
|
isEmpty: function isEmpty() {
|
147
|
-
return _
|
181
|
+
return _.size(this.failures) === 0;
|
148
182
|
},
|
149
183
|
|
150
184
|
/**
|
@@ -155,18 +189,18 @@ var FailuresAPI = Object$1.extend(
|
|
155
189
|
*/
|
156
190
|
add: function add(failure) {
|
157
191
|
this.failures[failure.key()] = failure;
|
158
|
-
this.length = _
|
192
|
+
this.length = _.size(this.failures);
|
159
193
|
},
|
160
194
|
remove: function remove(key) {
|
161
195
|
delete this.failures[key];
|
162
|
-
this.length = _
|
196
|
+
this.length = _.size(this.failures);
|
163
197
|
},
|
164
198
|
count: function count() {
|
165
199
|
return this.length;
|
166
200
|
}
|
167
201
|
});
|
168
202
|
|
169
|
-
_
|
203
|
+
_.extend(FailuresAPI.prototype, Backbone.Events);
|
170
204
|
|
171
205
|
var UploadError = Object$1.extend({
|
172
206
|
setMessage: function setMessage(options) {
|
@@ -200,7 +234,7 @@ var UnmatchedUploadError = UploadError.extend({
|
|
200
234
|
});
|
201
235
|
var validFileTypeTranslationList = {
|
202
236
|
validFileTypeTranslations: function validFileTypeTranslations(validFileTypes) {
|
203
|
-
return _
|
237
|
+
return _.map(validFileTypes, function (validFileType) {
|
204
238
|
return I18n$1.t('activerecord.models.' + validFileType.i18nKey + '.other');
|
205
239
|
}).join(', ');
|
206
240
|
}
|
@@ -272,11 +306,11 @@ var FileTypesCollection = Object$1.extend({
|
|
272
306
|
}
|
273
307
|
});
|
274
308
|
|
275
|
-
_
|
309
|
+
_.each(['each', 'map', 'reduce', 'first', 'find', 'contains', 'filter'], function (method) {
|
276
310
|
FileTypesCollection.prototype[method] = function () {
|
277
311
|
var args = Array.prototype.slice.call(arguments);
|
278
312
|
args.unshift(this._fileTypes);
|
279
|
-
return _
|
313
|
+
return _[method].apply(_, args);
|
280
314
|
};
|
281
315
|
});
|
282
316
|
|
@@ -307,7 +341,7 @@ var EditFileView = Marionette.ItemView.extend({
|
|
307
341
|
placeholder: entry.get('default_file_rights')
|
308
342
|
});
|
309
343
|
|
310
|
-
_
|
344
|
+
_(this.fileTypeInputs()).each(function (options) {
|
311
345
|
tab.input(options.name, options.inputView, options.inputViewOptions);
|
312
346
|
});
|
313
347
|
|
@@ -318,8 +352,8 @@ var EditFileView = Marionette.ItemView.extend({
|
|
318
352
|
},
|
319
353
|
fileTypeInputs: function fileTypeInputs() {
|
320
354
|
var fileType = this.model.fileType();
|
321
|
-
return _
|
322
|
-
if (_
|
355
|
+
return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
|
356
|
+
if (_.isFunction(inputs)) {
|
323
357
|
return inputs(this.model);
|
324
358
|
} else {
|
325
359
|
return inputs;
|
@@ -366,9 +400,9 @@ var FileSettingsDialogView = Marionette.ItemView.extend({
|
|
366
400
|
defaultTab: this.options.tabName
|
367
401
|
});
|
368
402
|
|
369
|
-
_
|
370
|
-
this.tabsView.tab(options.name, _
|
371
|
-
return this.subview(new options.view(_
|
403
|
+
_.each(this.model.fileType().settingsDialogTabs, function (options) {
|
404
|
+
this.tabsView.tab(options.name, _.bind(function () {
|
405
|
+
return this.subview(new options.view(_.extend({
|
372
406
|
model: this.model
|
373
407
|
}, options.viewOptions)));
|
374
408
|
}, this));
|
@@ -504,7 +538,7 @@ var FileType = Object$1.extend({
|
|
504
538
|
this.nestedFileTypes = fileTypesCollection;
|
505
539
|
},
|
506
540
|
getFilter: function getFilter(name) {
|
507
|
-
var result = _
|
541
|
+
var result = _(this.filters).find(function (filter) {
|
508
542
|
return filter.name === name;
|
509
543
|
});
|
510
544
|
|
@@ -540,44 +574,44 @@ var FileTypes = Object$1.extend({
|
|
540
574
|
setup: function setup(serverSideConfigs) {
|
541
575
|
var clientSideConfigs = this.clientSideConfigs;
|
542
576
|
this._setup = true;
|
543
|
-
this.collection = new FileTypesCollection(_
|
577
|
+
this.collection = new FileTypesCollection(_.map(serverSideConfigs, function (serverSideConfig) {
|
544
578
|
var clientSideConfig = clientSideConfigs[serverSideConfig.collectionName];
|
545
579
|
|
546
580
|
if (!clientSideConfig) {
|
547
581
|
throw 'Missing client side config for file type "' + serverSideConfig.collectionName + '"';
|
548
582
|
}
|
549
583
|
|
550
|
-
_
|
584
|
+
_(this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
|
551
585
|
this.lintModification(modification, serverSideConfig.collectionName);
|
552
586
|
this.applyModification(clientSideConfig, modification);
|
553
587
|
}, this);
|
554
588
|
|
555
|
-
return new FileType(_
|
589
|
+
return new FileType(_.extend({}, serverSideConfig, clientSideConfig));
|
556
590
|
}, this));
|
557
591
|
var those = this;
|
558
592
|
|
559
|
-
_
|
593
|
+
_.map(serverSideConfigs, function (serverSideConfig) {
|
560
594
|
var fileType = those.findByCollectionName(serverSideConfig.collectionName);
|
561
|
-
fileType.setNestedFileTypes(new FileTypesCollection(_
|
595
|
+
fileType.setNestedFileTypes(new FileTypesCollection(_.map(serverSideConfig.nestedFileTypes, function (nestedFileType) {
|
562
596
|
return those.findByCollectionName(nestedFileType.collectionName);
|
563
597
|
})));
|
564
598
|
});
|
565
599
|
},
|
566
600
|
lintModification: function lintModification(modification, collectionName) {
|
567
|
-
var unmodifyableProperties = _
|
601
|
+
var unmodifyableProperties = _.difference(_.keys(modification), this.modifyableProperties);
|
568
602
|
|
569
603
|
if (unmodifyableProperties.length) {
|
570
604
|
throw 'Only the following properties are allowed in FileTypes#modify: ' + this.modifyableProperties.join(', ') + '. Given in modification for ' + collectionName + ': ' + unmodifyableProperties.join(', ') + '.';
|
571
605
|
}
|
572
606
|
},
|
573
607
|
applyModification: function applyModification(target, modification) {
|
574
|
-
_
|
608
|
+
_(this.modifyableProperties).each(function (property) {
|
575
609
|
target[property] = (target[property] || []).concat(modification[property] || []);
|
576
610
|
});
|
577
611
|
}
|
578
612
|
});
|
579
613
|
|
580
|
-
_
|
614
|
+
_.each(['each', 'map', 'reduce', 'first', 'find', 'findByUpload', 'findByCollectionName', 'contains', 'filter'], function (method) {
|
581
615
|
FileTypes.prototype[method] = function () {
|
582
616
|
if (!this._setup) {
|
583
617
|
throw 'File types are not yet set up.';
|
@@ -661,14 +695,14 @@ var PageType = Object$1.extend({
|
|
661
695
|
createConfigurationEditorView: function createConfigurationEditorView(options) {
|
662
696
|
var constructor = this.configurationEditorView();
|
663
697
|
options.pageType = this.seed;
|
664
|
-
return new constructor(_
|
698
|
+
return new constructor(_.extend({
|
665
699
|
tabTranslationKeyPrefixes: [this.seed.translation_key_prefix + '.page_configuration_tabs', 'pageflow.common_page_configuration_tabs'],
|
666
700
|
attributeTranslationKeyPrefixes: [this.seed.translation_key_prefix + '.page_attributes', 'pageflow.common_page_attributes']
|
667
701
|
}, options));
|
668
702
|
},
|
669
703
|
createPageLinkConfigurationEditorView: function createPageLinkConfigurationEditorView(options) {
|
670
704
|
var constructor = this.options.pageLinkConfigurationEditorView || PageLinkConfigurationEditorView;
|
671
|
-
return new constructor(_
|
705
|
+
return new constructor(_.extend({
|
672
706
|
tabTranslationKeyPrefixes: [this.seed.translation_key_prefix + '.page_link_configuration_tabs', 'pageflow.common_page_link_configuration_tabs'],
|
673
707
|
attributeTranslationKeyPrefixes: [this.seed.translation_key_prefix + '.page_link_attributes', 'pageflow.common_page_link_attributes']
|
674
708
|
}, options));
|
@@ -692,7 +726,7 @@ var PageTypes = Object$1.extend({
|
|
692
726
|
setup: function setup(serverSideConfigs) {
|
693
727
|
var clientSideConfigs = this.clientSideConfigs;
|
694
728
|
this._setup = true;
|
695
|
-
this.pageTypes = _
|
729
|
+
this.pageTypes = _.map(serverSideConfigs, function (serverSideConfig) {
|
696
730
|
var clientSideConfig = clientSideConfigs[serverSideConfig.name] || {};
|
697
731
|
return new PageType(serverSideConfig.name, clientSideConfig, serverSideConfig);
|
698
732
|
});
|
@@ -713,7 +747,7 @@ var PageTypes = Object$1.extend({
|
|
713
747
|
}
|
714
748
|
});
|
715
749
|
|
716
|
-
_
|
750
|
+
_.each(['each', 'map', 'reduce', 'first', 'find', 'pluck'], function (method) {
|
717
751
|
PageTypes.prototype[method] = function () {
|
718
752
|
if (!this._setup) {
|
719
753
|
throw 'Page types are not yet set up.';
|
@@ -721,7 +755,7 @@ _$1.each(['each', 'map', 'reduce', 'first', 'find', 'pluck'], function (method)
|
|
721
755
|
|
722
756
|
var args = Array.prototype.slice.call(arguments);
|
723
757
|
args.unshift(this.pageTypes);
|
724
|
-
return _
|
758
|
+
return _[method].apply(_, args);
|
725
759
|
};
|
726
760
|
});
|
727
761
|
|
@@ -733,18 +767,18 @@ var MultiCollection = function MultiCollection() {
|
|
733
767
|
this.length = 0;
|
734
768
|
};
|
735
769
|
|
736
|
-
_
|
770
|
+
_.extend(MultiCollection.prototype, {
|
737
771
|
add: function add(record) {
|
738
772
|
if (!this.records[record.cid]) {
|
739
773
|
this.records[record.cid] = record;
|
740
|
-
this.length = _
|
774
|
+
this.length = _.keys(this.records).length;
|
741
775
|
this.trigger('add', record);
|
742
776
|
}
|
743
777
|
},
|
744
778
|
remove: function remove(record) {
|
745
779
|
if (this.records[record.cid]) {
|
746
780
|
delete this.records[record.cid];
|
747
|
-
this.length = _
|
781
|
+
this.length = _.keys(this.records).length;
|
748
782
|
this.trigger('remove', record);
|
749
783
|
}
|
750
784
|
},
|
@@ -753,7 +787,7 @@ _$1.extend(MultiCollection.prototype, {
|
|
753
787
|
}
|
754
788
|
});
|
755
789
|
|
756
|
-
_
|
790
|
+
_.extend(MultiCollection.prototype, Backbone.Events);
|
757
791
|
|
758
792
|
MultiCollection.extend = Backbone.Collection.extend;
|
759
793
|
|
@@ -793,7 +827,7 @@ var WidgetType = Object$1.extend({
|
|
793
827
|
},
|
794
828
|
createConfigurationEditorView: function createConfigurationEditorView(options) {
|
795
829
|
var constructor = this.configurationEditorView;
|
796
|
-
return new constructor(_
|
830
|
+
return new constructor(_.extend({
|
797
831
|
attributeTranslationKeyPrefixes: ['pageflow.editor.widgets.attributes.' + this.name, 'pageflow.editor.widgets.common_attributes']
|
798
832
|
}, options));
|
799
833
|
}
|
@@ -815,10 +849,10 @@ var WidgetTypes = Object$1.extend({
|
|
815
849
|
this._setup = true;
|
816
850
|
this._widgetTypesByName = {};
|
817
851
|
|
818
|
-
var roles = _
|
852
|
+
var roles = _.keys(serverSideConfigsByRole);
|
819
853
|
|
820
|
-
this._widgetTypesByRole = roles.reduce(_
|
821
|
-
result[role] = serverSideConfigsByRole[role].map(_
|
854
|
+
this._widgetTypesByRole = roles.reduce(_.bind(function (result, role) {
|
855
|
+
result[role] = serverSideConfigsByRole[role].map(_.bind(function (serverSideConfig) {
|
822
856
|
var clientSideConfig = this._clientSideConfigs[serverSideConfig.name] || {};
|
823
857
|
var widgetType = new WidgetType(serverSideConfig, clientSideConfig);
|
824
858
|
this._widgetTypesByName[serverSideConfig.name] = widgetType;
|
@@ -845,9 +879,6 @@ var WidgetTypes = Object$1.extend({
|
|
845
879
|
}
|
846
880
|
});
|
847
881
|
|
848
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
849
|
-
|
850
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
851
882
|
/**
|
852
883
|
* Interface for engines providing editor extensions.
|
853
884
|
* @alias editor
|
@@ -923,9 +954,13 @@ var EditorApi = Object$1.extend(
|
|
923
954
|
* Backbone view that will render the live preview of the entry.
|
924
955
|
* @param {function} options.EntryOutlineView
|
925
956
|
* Backbone view that will be rendered in the side bar.
|
957
|
+
* @param {function} options.isBrowserSupported
|
958
|
+
* Checks to see if the browser is supported.
|
959
|
+
* @param {function} options.browserNotSupportedView
|
960
|
+
* Backbone view that will be rendered if the browser is not supported.
|
926
961
|
*/
|
927
962
|
registerEntryType: function registerEntryType(name, options) {
|
928
|
-
this.entryType =
|
963
|
+
this.entryType = _objectSpread2({
|
929
964
|
name: name
|
930
965
|
}, options);
|
931
966
|
},
|
@@ -1109,7 +1144,7 @@ var EditorApi = Object$1.extend(
|
|
1109
1144
|
* whether the page is a valid selection
|
1110
1145
|
*/
|
1111
1146
|
selectPage: function selectPage(options) {
|
1112
|
-
return this.pageSelectionView.selectPage(
|
1147
|
+
return this.pageSelectionView.selectPage(_objectSpread2(_objectSpread2({}, options), {}, {
|
1113
1148
|
entry: state.entry
|
1114
1149
|
}));
|
1115
1150
|
},
|
@@ -1119,20 +1154,34 @@ var EditorApi = Object$1.extend(
|
|
1119
1154
|
}
|
1120
1155
|
|
1121
1156
|
var payloadJson = JSON.parse(decodeURIComponent(encodedPayload));
|
1122
|
-
return new this.fileSelectionHandlers[handlerName](
|
1157
|
+
return new this.fileSelectionHandlers[handlerName](_objectSpread2(_objectSpread2({}, payloadJson), {}, {
|
1123
1158
|
entry: state.entry
|
1124
1159
|
}));
|
1125
1160
|
},
|
1126
1161
|
createPageConfigurationEditorView: function createPageConfigurationEditorView(page, options) {
|
1127
|
-
var view = this.pageTypes.findByPage(page).createConfigurationEditorView(_
|
1162
|
+
var view = this.pageTypes.findByPage(page).createConfigurationEditorView(_.extend(options, {
|
1128
1163
|
model: page.configuration
|
1129
1164
|
}));
|
1130
1165
|
this.commonPageConfigurationTabs.apply(view);
|
1131
1166
|
return view;
|
1167
|
+
},
|
1168
|
+
ensureBrowserSupport: function ensureBrowserSupport(start) {
|
1169
|
+
if (this.entryType.isBrowserSupported) {
|
1170
|
+
var isBrowserSupported = this.entryType.isBrowserSupported();
|
1171
|
+
|
1172
|
+
if (isBrowserSupported) {
|
1173
|
+
start();
|
1174
|
+
} else {
|
1175
|
+
var browserNotSupportedView = new this.entryType.browserNotSupportedView();
|
1176
|
+
app.mainRegion.show(browserNotSupportedView);
|
1177
|
+
}
|
1178
|
+
} else {
|
1179
|
+
start();
|
1180
|
+
}
|
1132
1181
|
}
|
1133
1182
|
});
|
1134
1183
|
|
1135
|
-
var editor
|
1184
|
+
var editor = new EditorApi();
|
1136
1185
|
var startEditor = function startEditor(options) {
|
1137
1186
|
// In Webpack builds, I18n object from the i18n-js module is not
|
1138
1187
|
// identical to window.I18n which is provided by the i18n-js gem via
|
@@ -1142,10 +1191,12 @@ var startEditor = function startEditor(options) {
|
|
1142
1191
|
I18n$1.locale = window.I18n.locale;
|
1143
1192
|
I18n$1.translations = window.I18n.translations;
|
1144
1193
|
$(function () {
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1194
|
+
editor.ensureBrowserSupport(function () {
|
1195
|
+
$.when($.getJSON('/editor/entries/' + options.entryId + '/seed'), browser.detectFeatures()).done(function (result) {
|
1196
|
+
app.start(result[0]);
|
1197
|
+
}).fail(function () {
|
1198
|
+
alert('Error while starting editor.');
|
1199
|
+
});
|
1149
1200
|
});
|
1150
1201
|
});
|
1151
1202
|
};
|
@@ -1220,7 +1271,7 @@ var entryTypeEditorControllerUrls = {
|
|
1220
1271
|
};
|
1221
1272
|
|
1222
1273
|
function entryTypeEditorControllerUrl(resources) {
|
1223
|
-
return [state.entry.url(), editor
|
1274
|
+
return [state.entry.url(), editor.entryType.name, resources].join('/');
|
1224
1275
|
}
|
1225
1276
|
|
1226
1277
|
var formDataUtils = {
|
@@ -1231,7 +1282,7 @@ var formDataUtils = {
|
|
1231
1282
|
},
|
1232
1283
|
fromObject: function fromObject(object) {
|
1233
1284
|
var queryString = $.param(object).replace(/\+/g, '%20');
|
1234
|
-
return _
|
1285
|
+
return _(queryString.split('&')).reduce(function (result, param) {
|
1235
1286
|
var pair = param.split('=');
|
1236
1287
|
result[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
1237
1288
|
return result;
|
@@ -1330,7 +1381,7 @@ var SubsetCollection = Backbone.Collection.extend({
|
|
1330
1381
|
this.reset();
|
1331
1382
|
},
|
1332
1383
|
url: function url() {
|
1333
|
-
return this.parentModel.url() + (_
|
1384
|
+
return this.parentModel.url() + (_.result(this.parent, 'urlSuffix') || _.result(this.parent, 'url'));
|
1334
1385
|
},
|
1335
1386
|
dispose: function dispose() {
|
1336
1387
|
this.stopListening();
|
@@ -1353,7 +1404,7 @@ var FilesCollection = Backbone.Collection.extend({
|
|
1353
1404
|
return '/editor/entries/' + this.getEntry().get('id') + '/files/' + this.name;
|
1354
1405
|
},
|
1355
1406
|
fetch: function fetch(options) {
|
1356
|
-
options = _
|
1407
|
+
options = _.extend({
|
1357
1408
|
fileType: this.fileType
|
1358
1409
|
}, options || {});
|
1359
1410
|
return Backbone.Collection.prototype.fetch.call(this, options);
|
@@ -1410,7 +1461,7 @@ FilesCollection.createForFileTypes = function (fileTypes, files, options) {
|
|
1410
1461
|
};
|
1411
1462
|
|
1412
1463
|
FilesCollection.createForFileType = function (fileType, files, options) {
|
1413
|
-
return new FilesCollection(files, _
|
1464
|
+
return new FilesCollection(files, _.extend({
|
1414
1465
|
fileType: fileType,
|
1415
1466
|
model: fileType.model
|
1416
1467
|
}, options || {}));
|
@@ -1458,7 +1509,7 @@ var transientReferences = {
|
|
1458
1509
|
},
|
1459
1510
|
getReference: function getReference(attribute, collection) {
|
1460
1511
|
if (typeof collection === 'string') {
|
1461
|
-
var fileType = editor
|
1512
|
+
var fileType = editor.fileTypes.findByCollectionName(collection);
|
1462
1513
|
collection = state.entry.getFileCollection(fileType);
|
1463
1514
|
}
|
1464
1515
|
|
@@ -1498,16 +1549,16 @@ var transientReferences = {
|
|
1498
1549
|
// Backbone collections update their modelsById map in the change
|
1499
1550
|
// event which is dispatched after the `change:<attribute>`
|
1500
1551
|
// events.
|
1501
|
-
record.once('change', _
|
1552
|
+
record.once('change', _.bind(callback, this));
|
1502
1553
|
},
|
1503
1554
|
_listenForReady: function _listenForReady(attribute, record) {
|
1504
1555
|
if (!record.isReady()) {
|
1505
1556
|
this.pendingReferences[attribute] = record;
|
1506
|
-
this.listenTo(record, 'change:state', function () {
|
1557
|
+
this.listenTo(record, 'change:state', function (model, value, options) {
|
1507
1558
|
if (record.isReady()) {
|
1508
1559
|
this._cleanUpReadyListener(attribute);
|
1509
1560
|
|
1510
|
-
this.trigger('change');
|
1561
|
+
this.trigger('change', this, options);
|
1511
1562
|
this.trigger('change:' + attribute + ':ready');
|
1512
1563
|
}
|
1513
1564
|
});
|
@@ -1627,8 +1678,8 @@ var Configuration = Backbone.Model.extend({
|
|
1627
1678
|
return sources;
|
1628
1679
|
}
|
1629
1680
|
|
1630
|
-
return _
|
1631
|
-
var clone = _
|
1681
|
+
return _.map(sources, function (source) {
|
1682
|
+
var clone = _.clone(source);
|
1632
1683
|
|
1633
1684
|
clone.src = clone.src + '?e=' + parent.id + '&t=' + new Date().getTime();
|
1634
1685
|
return clone;
|
@@ -1779,7 +1830,7 @@ var Page = Backbone.Model.extend({
|
|
1779
1830
|
},
|
1780
1831
|
thumbnailFile: function thumbnailFile() {
|
1781
1832
|
var configuration = this.configuration;
|
1782
|
-
return _
|
1833
|
+
return _.reduce(this.pageType().thumbnailCandidates(), function (result, candidate) {
|
1783
1834
|
if (candidate.condition && !conditionMet(candidate.condition, configuration)) {
|
1784
1835
|
return result;
|
1785
1836
|
}
|
@@ -1791,10 +1842,10 @@ var Page = Backbone.Model.extend({
|
|
1791
1842
|
return this.pageType().pageLinks(this.configuration);
|
1792
1843
|
},
|
1793
1844
|
pageType: function pageType() {
|
1794
|
-
return editor
|
1845
|
+
return editor.pageTypes.findByName(this.get('template'));
|
1795
1846
|
},
|
1796
1847
|
toJSON: function toJSON() {
|
1797
|
-
return _
|
1848
|
+
return _.extend(_.clone(this.attributes), {
|
1798
1849
|
configuration: this.configuration.toJSON()
|
1799
1850
|
});
|
1800
1851
|
},
|
@@ -1848,7 +1899,7 @@ var StorylineScaffold = Scaffold.extend({
|
|
1848
1899
|
this.page = this.chapter.buildPage();
|
1849
1900
|
}
|
1850
1901
|
|
1851
|
-
editor
|
1902
|
+
editor.trigger('scaffold:storyline', this.storyline);
|
1852
1903
|
return this.storyline;
|
1853
1904
|
},
|
1854
1905
|
load: function load(response) {
|
@@ -1886,7 +1937,7 @@ FileReuse.submit = function (otherEntry, file, options) {
|
|
1886
1937
|
var FileConfiguration = Configuration.extend({
|
1887
1938
|
defaults: {},
|
1888
1939
|
applyUpdaters: function applyUpdaters(updaters, newAttributes) {
|
1889
|
-
_
|
1940
|
+
_(updaters).each(function (updater) {
|
1890
1941
|
updater(this, newAttributes);
|
1891
1942
|
}, this);
|
1892
1943
|
}
|
@@ -1920,7 +1971,7 @@ var NestedFilesCollection = SubsetCollection.extend({
|
|
1920
1971
|
|
1921
1972
|
var retryable = {
|
1922
1973
|
retry: function retry(options) {
|
1923
|
-
options = options ? _
|
1974
|
+
options = options ? _.clone(options) : {};
|
1924
1975
|
if (options.parse === void 0) options.parse = true;
|
1925
1976
|
var model = this;
|
1926
1977
|
|
@@ -1994,8 +2045,8 @@ var FileStage = Backbone.Model.extend({
|
|
1994
2045
|
var stageProvider = {
|
1995
2046
|
initialize: function initialize() {
|
1996
2047
|
var finishedStates = [this.readyState];
|
1997
|
-
var stages = _
|
1998
|
-
this.stages = new Backbone.Collection(_
|
2048
|
+
var stages = _.result(this, 'stages') || [];
|
2049
|
+
this.stages = new Backbone.Collection(_.chain(stages).slice().reverse().map(function (options) {
|
1999
2050
|
var name = options.name;
|
2000
2051
|
options.file = this;
|
2001
2052
|
options.finishedStates = finishedStates;
|
@@ -2030,7 +2081,7 @@ var ReusableFile = Backbone.Model.extend({
|
|
2030
2081
|
this.listenTo(this.configuration, 'change', function () {
|
2031
2082
|
this.trigger('change:configuration', this);
|
2032
2083
|
|
2033
|
-
_
|
2084
|
+
_.chain(this.configuration.changed).keys().each(function (name) {
|
2034
2085
|
this.trigger('change:configuration:' + name, this, this.configuration.get(name));
|
2035
2086
|
}, this);
|
2036
2087
|
|
@@ -2099,7 +2150,7 @@ var ReusableFile = Backbone.Model.extend({
|
|
2099
2150
|
return false;
|
2100
2151
|
},
|
2101
2152
|
toJSON: function toJSON() {
|
2102
|
-
return _
|
2153
|
+
return _.extend(_.pick(this.attributes, 'file_name', 'rights', 'parent_file_id', 'parent_file_model_type', 'content_type', 'file_size'), {
|
2103
2154
|
configuration: this.configuration.toJSON()
|
2104
2155
|
});
|
2105
2156
|
},
|
@@ -2127,7 +2178,7 @@ var UploadableFile = ReusableFile.extend({
|
|
2127
2178
|
name: 'uploading',
|
2128
2179
|
activeStates: ['uploading'],
|
2129
2180
|
failedStates: ['uploading_failed']
|
2130
|
-
}].concat(_
|
2181
|
+
}].concat(_.result(this, 'processingStages'));
|
2131
2182
|
},
|
2132
2183
|
processingStages: [],
|
2133
2184
|
readyState: 'uploaded'
|
@@ -2182,7 +2233,7 @@ var WidgetConfigurationFileSelectionHandler = function WidgetConfigurationFileSe
|
|
2182
2233
|
return '/widgets/' + widget.id;
|
2183
2234
|
};
|
2184
2235
|
};
|
2185
|
-
editor
|
2236
|
+
editor.registerFileSelectionHandler('widgetConfiguration', WidgetConfigurationFileSelectionHandler);
|
2186
2237
|
|
2187
2238
|
var EncodingConfirmation = Backbone.Model.extend({
|
2188
2239
|
paramRoot: 'encoding_confirmation',
|
@@ -2302,11 +2353,15 @@ var EntryMetadata = Configuration.extend({
|
|
2302
2353
|
defaults: {},
|
2303
2354
|
initialize: function initialize(attributes, options) {
|
2304
2355
|
Configuration.prototype.initialize.apply(this, attributes, options);
|
2305
|
-
this.configuration = new EntryMetadataConfiguration(_
|
2356
|
+
this.configuration = new EntryMetadataConfiguration(_.clone(attributes.configuration) || {});
|
2306
2357
|
this.listenTo(this.configuration, 'change', function () {
|
2307
2358
|
this.trigger('change');
|
2308
2359
|
this.parent.save();
|
2309
2360
|
});
|
2361
|
+
},
|
2362
|
+
// Pageflow Scrolled only synchronizes saved records to entry state.
|
2363
|
+
isNew: function isNew() {
|
2364
|
+
return false;
|
2310
2365
|
}
|
2311
2366
|
});
|
2312
2367
|
|
@@ -2380,7 +2435,7 @@ var StorylineOrdering = function StorylineOrdering(storylines, pages) {
|
|
2380
2435
|
};
|
2381
2436
|
|
2382
2437
|
function visit(storylines, offset, level) {
|
2383
|
-
return _
|
2438
|
+
return _(storylines).reduce(function (position, storyline, index) {
|
2384
2439
|
storyline.set('position', position);
|
2385
2440
|
storyline.set('level', level);
|
2386
2441
|
return visit(children(storyline), position + 1, level + 1);
|
@@ -2396,7 +2451,7 @@ var StorylineOrdering = function StorylineOrdering(storylines, pages) {
|
|
2396
2451
|
}
|
2397
2452
|
|
2398
2453
|
function prepare() {
|
2399
|
-
storylinesByParent = _
|
2454
|
+
storylinesByParent = _(groupStorylinesByParentStoryline()).reduce(function (result, storylines, key) {
|
2400
2455
|
result[key] = storylines.sort(compareStorylines);
|
2401
2456
|
return result;
|
2402
2457
|
}, {});
|
@@ -2464,7 +2519,7 @@ var PageConfigurationFileSelectionHandler = function PageConfigurationFileSelect
|
|
2464
2519
|
return '/pages/' + page.id + '/' + (options.returnToTab || 'files');
|
2465
2520
|
};
|
2466
2521
|
};
|
2467
|
-
editor
|
2522
|
+
editor.registerFileSelectionHandler('pageConfiguration', PageConfigurationFileSelectionHandler);
|
2468
2523
|
|
2469
2524
|
var ImageFile = ReusableFile.extend({
|
2470
2525
|
stages: [{
|
@@ -2495,7 +2550,7 @@ var EntryMetadataFileSelectionHandler = function EntryMetadataFileSelectionHandl
|
|
2495
2550
|
return '/meta_data/' + (options.returnToTab || 'general');
|
2496
2551
|
};
|
2497
2552
|
};
|
2498
|
-
editor
|
2553
|
+
editor.registerFileSelectionHandler('entryMetadata', EntryMetadataFileSelectionHandler);
|
2499
2554
|
|
2500
2555
|
var EntryPublication = Backbone.Model.extend({
|
2501
2556
|
paramRoot: 'entry_publication',
|
@@ -2542,121 +2597,6 @@ var ChapterScaffold = Scaffold.extend({
|
|
2542
2597
|
}
|
2543
2598
|
});
|
2544
2599
|
|
2545
|
-
// https://github.com/jashkenas/backbone/issues/2601
|
2546
|
-
|
2547
|
-
function BaseObject(options) {
|
2548
|
-
this.initialize.apply(this, arguments);
|
2549
|
-
}
|
2550
|
-
|
2551
|
-
_$1.extend(BaseObject.prototype, Backbone.Events, {
|
2552
|
-
initialize: function initialize(options) {}
|
2553
|
-
}); // The self-propagating extend function that Backbone classes use.
|
2554
|
-
|
2555
|
-
|
2556
|
-
BaseObject.extend = Backbone.Model.extend;
|
2557
|
-
|
2558
|
-
var EntryData = BaseObject.extend({
|
2559
|
-
getThemingOption: function getThemingOption(name) {
|
2560
|
-
throw 'Not implemented';
|
2561
|
-
},
|
2562
|
-
getFile: function getFile(collectionName, id) {
|
2563
|
-
throw 'Not implemented';
|
2564
|
-
},
|
2565
|
-
getPageConfiguration: function getPageConfiguration(permaId) {
|
2566
|
-
throw 'Not implemented';
|
2567
|
-
},
|
2568
|
-
getPagePosition: function getPagePosition(permaId) {
|
2569
|
-
throw 'Not implemented';
|
2570
|
-
},
|
2571
|
-
getChapterConfiguration: function getChapterConfiguration(id) {
|
2572
|
-
throw 'Not implemented';
|
2573
|
-
},
|
2574
|
-
getStorylineConfiguration: function getStorylineConfiguration(id) {
|
2575
|
-
throw 'Not implemented';
|
2576
|
-
},
|
2577
|
-
getChapterIdByPagePermaId: function getChapterIdByPagePermaId(permaId) {
|
2578
|
-
throw 'Not implemented';
|
2579
|
-
},
|
2580
|
-
getStorylineIdByChapterId: function getStorylineIdByChapterId(permaId) {
|
2581
|
-
throw 'Not implemented';
|
2582
|
-
},
|
2583
|
-
getChapterPagePermaIds: function getChapterPagePermaIds(id) {
|
2584
|
-
throw 'Not implemented';
|
2585
|
-
},
|
2586
|
-
getParentPagePermaIdByPagePermaId: function getParentPagePermaIdByPagePermaId(permaId) {
|
2587
|
-
var storylineId = this.getStorylineIdByPagePermaId(permaId);
|
2588
|
-
return this.getParentPagePermaId(storylineId);
|
2589
|
-
},
|
2590
|
-
getStorylineIdByPagePermaId: function getStorylineIdByPagePermaId(permaId) {
|
2591
|
-
var chapterId = this.getChapterIdByPagePermaId(permaId);
|
2592
|
-
return this.getStorylineIdByChapterId(chapterId);
|
2593
|
-
},
|
2594
|
-
getParentStorylineId: function getParentStorylineId(storylineId) {
|
2595
|
-
var parentPagePermaId = this.getParentPagePermaId(storylineId);
|
2596
|
-
return parentPagePermaId && this.getStorylineIdByPagePermaId(parentPagePermaId);
|
2597
|
-
},
|
2598
|
-
getParentChapterId: function getParentChapterId(chapterId) {
|
2599
|
-
var storylineId = this.getStorylineIdByChapterId(chapterId);
|
2600
|
-
var pagePermaId = this.getParentPagePermaId(storylineId);
|
2601
|
-
return pagePermaId && this.getChapterIdByPagePermaId(pagePermaId);
|
2602
|
-
},
|
2603
|
-
getParentPagePermaId: function getParentPagePermaId(storylineId) {
|
2604
|
-
return this.getStorylineConfiguration(storylineId).parent_page_perma_id;
|
2605
|
-
},
|
2606
|
-
getStorylineLevel: function getStorylineLevel(storylineId) {
|
2607
|
-
var parentStorylineId = this.getParentStorylineId(storylineId);
|
2608
|
-
|
2609
|
-
if (parentStorylineId) {
|
2610
|
-
return this.getStorylineLevel(parentStorylineId) + 1;
|
2611
|
-
} else {
|
2612
|
-
return 0;
|
2613
|
-
}
|
2614
|
-
}
|
2615
|
-
});
|
2616
|
-
|
2617
|
-
var PreviewEntryData = EntryData.extend({
|
2618
|
-
initialize: function initialize(options) {
|
2619
|
-
this.entry = options.entry;
|
2620
|
-
this.storylines = options.storylines;
|
2621
|
-
this.chapters = options.chapters;
|
2622
|
-
this.pages = options.pages;
|
2623
|
-
},
|
2624
|
-
getThemingOption: function getThemingOption(name) {
|
2625
|
-
return this.entry.getTheme().get(name);
|
2626
|
-
},
|
2627
|
-
getFile: function getFile(collectionName, permaId) {
|
2628
|
-
var file = this.entry.getFileCollection(collectionName).getByPermaId(permaId);
|
2629
|
-
return file && file.attributes;
|
2630
|
-
},
|
2631
|
-
getStorylineConfiguration: function getStorylineConfiguration(id) {
|
2632
|
-
var storyline = this.storylines.get(id);
|
2633
|
-
return storyline ? storyline.configuration.attributes : {};
|
2634
|
-
},
|
2635
|
-
getChapterConfiguration: function getChapterConfiguration(id) {
|
2636
|
-
var chapter = this.chapters.get(id);
|
2637
|
-
return chapter ? chapter.configuration.attributes : {};
|
2638
|
-
},
|
2639
|
-
getChapterPagePermaIds: function getChapterPagePermaIds(id) {
|
2640
|
-
var chapter = this.chapters.get(id);
|
2641
|
-
return chapter ? chapter.pages.pluck('perma_id') : [];
|
2642
|
-
},
|
2643
|
-
getStorylineIdByChapterId: function getStorylineIdByChapterId(id) {
|
2644
|
-
var chapter = this.chapters.get(id);
|
2645
|
-
return chapter && chapter.get('storyline_id');
|
2646
|
-
},
|
2647
|
-
getChapterIdByPagePermaId: function getChapterIdByPagePermaId(permaId) {
|
2648
|
-
var page = this.pages.getByPermaId(permaId);
|
2649
|
-
return page && page.get('chapter_id');
|
2650
|
-
},
|
2651
|
-
getPageConfiguration: function getPageConfiguration(permaId) {
|
2652
|
-
var page = this.pages.getByPermaId(permaId);
|
2653
|
-
return page ? page.configuration.attributes : {};
|
2654
|
-
},
|
2655
|
-
getPagePosition: function getPagePosition(permaId) {
|
2656
|
-
return this.pages.indexOf(this.pages.getByPermaId(permaId));
|
2657
|
-
}
|
2658
|
-
});
|
2659
|
-
|
2660
2600
|
var EditLockContainer = Backbone.Model.extend({
|
2661
2601
|
initialize: function initialize() {
|
2662
2602
|
this.storageKey = 'pageflow.edit_lock.' + state.entry.id;
|
@@ -2680,7 +2620,7 @@ var EditLockContainer = Backbone.Model.extend({
|
|
2680
2620
|
},
|
2681
2621
|
startPolling: function startPolling() {
|
2682
2622
|
if (!this.pollingInteval) {
|
2683
|
-
this.pollingInteval = setInterval(_
|
2623
|
+
this.pollingInteval = setInterval(_.bind(function () {
|
2684
2624
|
this.acquire({
|
2685
2625
|
polling: true
|
2686
2626
|
});
|
@@ -2824,7 +2764,7 @@ var FileUploader = Object$1.extend({
|
|
2824
2764
|
},
|
2825
2765
|
add: function add(upload, options) {
|
2826
2766
|
options = options || {};
|
2827
|
-
var editor = options.editor || editor
|
2767
|
+
var editor$1 = options.editor || editor;
|
2828
2768
|
var fileType = this.fileTypes.findByUpload(upload);
|
2829
2769
|
var file = new fileType.model({
|
2830
2770
|
state: 'uploadable',
|
@@ -2834,12 +2774,12 @@ var FileUploader = Object$1.extend({
|
|
2834
2774
|
}, {
|
2835
2775
|
fileType: fileType
|
2836
2776
|
});
|
2837
|
-
var setTargetFile = editor.nextUploadTargetFile;
|
2777
|
+
var setTargetFile = editor$1.nextUploadTargetFile;
|
2838
2778
|
|
2839
2779
|
if (setTargetFile) {
|
2840
2780
|
if (fileType.topLevelType || !setTargetFile.fileType().nestedFileTypes.contains(fileType)) {
|
2841
2781
|
throw new InvalidNestedTypeError(upload, {
|
2842
|
-
editor: editor,
|
2782
|
+
editor: editor$1,
|
2843
2783
|
fileType: fileType
|
2844
2784
|
});
|
2845
2785
|
}
|
@@ -2876,12 +2816,12 @@ var FileUploader = Object$1.extend({
|
|
2876
2816
|
});
|
2877
2817
|
},
|
2878
2818
|
submit: function submit() {
|
2879
|
-
_
|
2819
|
+
_(this.deferreds).invoke('resolve');
|
2880
2820
|
|
2881
2821
|
this.deferreds = [];
|
2882
2822
|
},
|
2883
2823
|
abort: function abort() {
|
2884
|
-
_
|
2824
|
+
_(this.deferreds).invoke('reject');
|
2885
2825
|
|
2886
2826
|
this.deferreds = [];
|
2887
2827
|
}
|
@@ -2919,7 +2859,7 @@ var orderedCollection = {
|
|
2919
2859
|
parentModel.trigger('sync:order', parentModel, response, {});
|
2920
2860
|
},
|
2921
2861
|
error: function error(jqXHR, textStatus, errorThrown) {
|
2922
|
-
editor
|
2862
|
+
editor.failures.add(new OrderingFailure(parentModel, collection));
|
2923
2863
|
}
|
2924
2864
|
});
|
2925
2865
|
}
|
@@ -2945,7 +2885,7 @@ var ChapterPagesCollection = SubsetCollection.extend({
|
|
2945
2885
|
this.listenTo(this, 'add', function (model) {
|
2946
2886
|
model.chapter = chapter;
|
2947
2887
|
model.set('chapter_id', chapter.id);
|
2948
|
-
editor
|
2888
|
+
editor.trigger('add:page', model);
|
2949
2889
|
});
|
2950
2890
|
this.listenTo(this, 'remove', function (model) {
|
2951
2891
|
model.chapter = null;
|
@@ -2992,10 +2932,10 @@ var Chapter = Backbone.Model.extend({
|
|
2992
2932
|
chapter_id: this.id,
|
2993
2933
|
position: this.pages.length
|
2994
2934
|
};
|
2995
|
-
return this.pages.addAndReturnModel(_
|
2935
|
+
return this.pages.addAndReturnModel(_.extend(defaults, attributes));
|
2996
2936
|
},
|
2997
2937
|
toJSON: function toJSON() {
|
2998
|
-
return _
|
2938
|
+
return _.extend(_.clone(this.attributes), {
|
2999
2939
|
configuration: this.configuration.toJSON()
|
3000
2940
|
});
|
3001
2941
|
},
|
@@ -3024,7 +2964,7 @@ var StorylineChaptersCollection = SubsetCollection.extend({
|
|
3024
2964
|
this.listenTo(this, 'add', function (model) {
|
3025
2965
|
model.storyline = storyline;
|
3026
2966
|
model.set('storyline_id', storyline.id);
|
3027
|
-
editor
|
2967
|
+
editor.trigger('add:chapter', model);
|
3028
2968
|
});
|
3029
2969
|
this.listenTo(this, 'remove', function (model) {
|
3030
2970
|
model.storyline = null;
|
@@ -3058,7 +2998,7 @@ var Storyline = Backbone.Model.extend({
|
|
3058
2998
|
return this.isNew() ? this.collection.url() : '/storylines';
|
3059
2999
|
},
|
3060
3000
|
displayTitle: function displayTitle() {
|
3061
|
-
return _
|
3001
|
+
return _([this.title() || !this.isMain() && I18n$1.t('pageflow.storylines.untitled'), this.isMain() && I18n$1.t('pageflow.storylines.main')]).compact().join(' - ');
|
3062
3002
|
},
|
3063
3003
|
title: function title() {
|
3064
3004
|
return this.configuration.get('title');
|
@@ -3092,7 +3032,7 @@ var Storyline = Backbone.Model.extend({
|
|
3092
3032
|
title: '',
|
3093
3033
|
position: this.chapters.length
|
3094
3034
|
};
|
3095
|
-
return this.chapters.addAndReturnModel(_
|
3035
|
+
return this.chapters.addAndReturnModel(_.extend(defaults, attributes));
|
3096
3036
|
},
|
3097
3037
|
scaffoldChapter: function scaffoldChapter(options) {
|
3098
3038
|
var scaffold = new ChapterScaffold(this, options);
|
@@ -3125,7 +3065,7 @@ var PageLink = Backbone.Model.extend({
|
|
3125
3065
|
return this.collection.page.id;
|
3126
3066
|
},
|
3127
3067
|
toSerializedJSON: function toSerializedJSON() {
|
3128
|
-
return _
|
3068
|
+
return _.omit(this.attributes, 'highlighted', 'position');
|
3129
3069
|
},
|
3130
3070
|
highlight: function highlight() {
|
3131
3071
|
this.set('highlighted', true);
|
@@ -3150,7 +3090,7 @@ var PageLinkFileSelectionHandler = function PageLinkFileSelectionHandler(options
|
|
3150
3090
|
return '/page_links/' + pageLink.id;
|
3151
3091
|
};
|
3152
3092
|
};
|
3153
|
-
editor
|
3093
|
+
editor.registerFileSelectionHandler('pageLink', PageLinkFileSelectionHandler);
|
3154
3094
|
|
3155
3095
|
/**
|
3156
3096
|
* Mixins for models with a nested configuration model.
|
@@ -3194,14 +3134,14 @@ function configurationContainer() {
|
|
3194
3134
|
initialize: function initialize() {
|
3195
3135
|
this.configuration = new configurationModel(this.get('configuration'));
|
3196
3136
|
this.configuration.parent = this;
|
3197
|
-
this.listenTo(this.configuration, 'change', function () {
|
3198
|
-
if (!this.isNew() && (!this.isDestroying || !this.isDestroying()) && (!this.isDestroyed || !this.isDestroyed()) && autoSave) {
|
3137
|
+
this.listenTo(this.configuration, 'change', function (model, options) {
|
3138
|
+
if (!this.isNew() && (!this.isDestroying || !this.isDestroying()) && (!this.isDestroyed || !this.isDestroyed()) && autoSave && options.autoSave !== false) {
|
3199
3139
|
this.save();
|
3200
3140
|
}
|
3201
3141
|
|
3202
|
-
this.trigger('change:configuration', this);
|
3142
|
+
this.trigger('change:configuration', this, undefined, options);
|
3203
3143
|
|
3204
|
-
_
|
3144
|
+
_.chain(this.configuration.changed).keys().each(function (name) {
|
3205
3145
|
this.trigger('change:configuration:' + name, this, this.configuration.get(name));
|
3206
3146
|
}, this);
|
3207
3147
|
});
|
@@ -3210,12 +3150,12 @@ function configurationContainer() {
|
|
3210
3150
|
var attributes = {};
|
3211
3151
|
|
3212
3152
|
if (includeAttributesInJSON === true) {
|
3213
|
-
attributes = _
|
3153
|
+
attributes = _.clone(this.attributes);
|
3214
3154
|
} else if (includeAttributesInJSON) {
|
3215
|
-
attributes = _
|
3155
|
+
attributes = _.pick(this.attributes, includeAttributesInJSON);
|
3216
3156
|
}
|
3217
3157
|
|
3218
|
-
return _
|
3158
|
+
return _.extend(attributes, {
|
3219
3159
|
configuration: this.configuration.toJSON()
|
3220
3160
|
});
|
3221
3161
|
}
|
@@ -3265,7 +3205,7 @@ var filesCountWatcher = {
|
|
3265
3205
|
},
|
3266
3206
|
updateFilesCount: function updateFilesCount(trait, name, collection, filter) {
|
3267
3207
|
this.set(trait + '_' + name + '_count', collection.filter(filter).length);
|
3268
|
-
this.set(trait + '_files_count', _
|
3208
|
+
this.set(trait + '_files_count', _.reduce(this.watchedFileCollectionNames, function (sum, name) {
|
3269
3209
|
return sum + this.get(trait + '_' + name + '_count');
|
3270
3210
|
}, 0, this));
|
3271
3211
|
}
|
@@ -3283,7 +3223,7 @@ var polling = {
|
|
3283
3223
|
},
|
3284
3224
|
startPolling: function startPolling() {
|
3285
3225
|
if (!this.pollingInterval) {
|
3286
|
-
this.pollingInterval = setInterval(_
|
3226
|
+
this.pollingInterval = setInterval(_.bind(function () {
|
3287
3227
|
this.fetch();
|
3288
3228
|
}, this), 1000);
|
3289
3229
|
}
|
@@ -3318,7 +3258,7 @@ var Entry = Backbone.Model.extend({
|
|
3318
3258
|
this.configuration = this.metadata;
|
3319
3259
|
this.themes = options.themes || state.themes;
|
3320
3260
|
this.files = options.files || state.files;
|
3321
|
-
this.fileTypes = options.fileTypes || editor
|
3261
|
+
this.fileTypes = options.fileTypes || editor.fileTypes;
|
3322
3262
|
this.storylines = options.storylines || state.storylines;
|
3323
3263
|
this.storylines.parentModel = this;
|
3324
3264
|
this.chapters = options.chapters || state.chapters;
|
@@ -3352,6 +3292,9 @@ var Entry = Backbone.Model.extend({
|
|
3352
3292
|
getTheme: function getTheme() {
|
3353
3293
|
return this.themes.findByName(this.metadata.get('theme_name'));
|
3354
3294
|
},
|
3295
|
+
supportsPhoneEmulation: function supportsPhoneEmulation() {
|
3296
|
+
return true;
|
3297
|
+
},
|
3355
3298
|
addStoryline: function addStoryline(attributes) {
|
3356
3299
|
var storyline = this.buildStoryline(attributes);
|
3357
3300
|
storyline.save();
|
@@ -3361,7 +3304,7 @@ var Entry = Backbone.Model.extend({
|
|
3361
3304
|
var defaults = {
|
3362
3305
|
title: ''
|
3363
3306
|
};
|
3364
|
-
return this.storylines.addAndReturnModel(_
|
3307
|
+
return this.storylines.addAndReturnModel(_.extend(defaults, attributes));
|
3365
3308
|
},
|
3366
3309
|
scaffoldStoryline: function scaffoldStoryline(options) {
|
3367
3310
|
var scaffold = new StorylineScaffold(this, options);
|
@@ -3369,12 +3312,12 @@ var Entry = Backbone.Model.extend({
|
|
3369
3312
|
return scaffold;
|
3370
3313
|
},
|
3371
3314
|
addChapterInNewStoryline: function addChapterInNewStoryline(options) {
|
3372
|
-
return this.scaffoldStoryline(_
|
3315
|
+
return this.scaffoldStoryline(_.extend({
|
3373
3316
|
depth: 'chapter'
|
3374
3317
|
}, options)).chapter;
|
3375
3318
|
},
|
3376
3319
|
addPageInNewStoryline: function addPageInNewStoryline(options) {
|
3377
|
-
return this.scaffoldStoryline(_
|
3320
|
+
return this.scaffoldStoryline(_.extend({
|
3378
3321
|
depth: 'page'
|
3379
3322
|
}, options)).page;
|
3380
3323
|
},
|
@@ -3403,7 +3346,7 @@ var Entry = Backbone.Model.extend({
|
|
3403
3346
|
},
|
3404
3347
|
parse: function parse(response, options) {
|
3405
3348
|
if (response) {
|
3406
|
-
this.set(_
|
3349
|
+
this.set(_.pick(response, 'published', 'published_until', 'password_protected'));
|
3407
3350
|
|
3408
3351
|
this._setFiles(response, {
|
3409
3352
|
add: false,
|
@@ -3421,12 +3364,12 @@ var Entry = Backbone.Model.extend({
|
|
3421
3364
|
// the rights attribute.
|
3422
3365
|
|
3423
3366
|
if (options.merge !== false) {
|
3424
|
-
filesAttributes = _
|
3425
|
-
return _
|
3367
|
+
filesAttributes = _.map(filesAttributes, function (fileAttributes) {
|
3368
|
+
return _.omit(fileAttributes, 'rights');
|
3426
3369
|
});
|
3427
3370
|
}
|
3428
3371
|
|
3429
|
-
this.getFileCollection(fileType).set(filesAttributes, _
|
3372
|
+
this.getFileCollection(fileType).set(filesAttributes, _.extend({
|
3430
3373
|
fileType: fileType
|
3431
3374
|
}, options));
|
3432
3375
|
delete response[fileType.collectionName];
|
@@ -3572,8 +3515,8 @@ var FileImport = Backbone.Model.extend({
|
|
3572
3515
|
|
3573
3516
|
if (localFile) {
|
3574
3517
|
state.files[collectionName].remove(localFile);
|
3575
|
-
var fileType = editor
|
3576
|
-
|
3518
|
+
var fileType = editor.fileTypes.findByUpload(file);
|
3519
|
+
file = new fileType.model(file, {
|
3577
3520
|
fileType: fileType
|
3578
3521
|
});
|
3579
3522
|
currentEntry.getFileCollection(fileType).add(file);
|
@@ -3617,6 +3560,7 @@ var ForeignKeySubsetCollection = SubsetCollection.extend({
|
|
3617
3560
|
constructor: function constructor(options) {
|
3618
3561
|
var parent = options.parent;
|
3619
3562
|
var parentModel = options.parentModel;
|
3563
|
+
this.autoConsolidatePositions = options.autoConsolidatePositions;
|
3620
3564
|
SubsetCollection.prototype.constructor.call(this, {
|
3621
3565
|
parent: parent,
|
3622
3566
|
parentModel: parentModel,
|
@@ -3690,7 +3634,7 @@ var PageLinksCollection = Backbone.Collection.extend({
|
|
3690
3634
|
}));
|
3691
3635
|
},
|
3692
3636
|
defaultPosition: function defaultPosition() {
|
3693
|
-
return Math.max(0, _
|
3637
|
+
return Math.max(0, _.max(this.map(function (pageLink) {
|
3694
3638
|
return pageLink.get('position');
|
3695
3639
|
}))) + 1;
|
3696
3640
|
},
|
@@ -3707,7 +3651,7 @@ var PageLinksCollection = Backbone.Collection.extend({
|
|
3707
3651
|
|
3708
3652
|
/** @private */
|
3709
3653
|
getUniqueId: function getUniqueId() {
|
3710
|
-
var maxId = Math.max(0, _
|
3654
|
+
var maxId = Math.max(0, _.max(this.map(function (pageLink) {
|
3711
3655
|
return parseInt(pageLink.id.split(':').pop(), 10);
|
3712
3656
|
})));
|
3713
3657
|
return this.configuration.page.get('perma_id') + ':' + (maxId + 1);
|
@@ -3725,7 +3669,7 @@ var OtherEntriesCollection = Backbone.Collection.extend({
|
|
3725
3669
|
// of the "other" entries, after all.
|
3726
3670
|
parse: function parse(response) {
|
3727
3671
|
var excludeEntry = this.getExcludeEntry(),
|
3728
|
-
filteredResponse = _
|
3672
|
+
filteredResponse = _.filter(response, function (entry) {
|
3729
3673
|
return entry.id != excludeEntry.id;
|
3730
3674
|
});
|
3731
3675
|
|
@@ -3806,7 +3750,7 @@ var PagesCollection = Backbone.Collection.extend({
|
|
3806
3750
|
}
|
3807
3751
|
});
|
3808
3752
|
this.listenTo(this, 'change:id', function (model) {
|
3809
|
-
setTimeout(_
|
3753
|
+
setTimeout(_.bind(function () {
|
3810
3754
|
this._persisted.add(model);
|
3811
3755
|
}, this), 0);
|
3812
3756
|
});
|
@@ -3843,7 +3787,7 @@ var WidgetsCollection = Backbone.Collection.extend({
|
|
3843
3787
|
},
|
3844
3788
|
batchSave: function batchSave(options) {
|
3845
3789
|
var subject = this.subject;
|
3846
|
-
return Backbone.sync('patch', subject, _
|
3790
|
+
return Backbone.sync('patch', subject, _.extend(options || {}, {
|
3847
3791
|
url: this.url() + '/batch',
|
3848
3792
|
attrs: {
|
3849
3793
|
widgets: this.map(function (widget) {
|
@@ -3870,11 +3814,6 @@ Cocktail.mixin(Backbone.Collection, addAndReturnModel);
|
|
3870
3814
|
|
3871
3815
|
var SidebarRouter = Marionette.AppRouter.extend({
|
3872
3816
|
appRoutes: {
|
3873
|
-
'page_links/:id': 'pageLink',
|
3874
|
-
'pages/:id': 'page',
|
3875
|
-
'pages/:id/:tab': 'page',
|
3876
|
-
'chapters/:id': 'chapter',
|
3877
|
-
'storylines/:id': 'storyline',
|
3878
3817
|
'widgets/:id': 'widget',
|
3879
3818
|
'files/:collectionName?handler=:handler&payload=:payload&filter=:filter': 'files',
|
3880
3819
|
'files/:collectionName?handler=:handler&payload=:payload': 'files',
|
@@ -3912,7 +3851,7 @@ var BackButtonDecoratorView = Marionette.Layout.extend({
|
|
3912
3851
|
},
|
3913
3852
|
goBack: function goBack() {
|
3914
3853
|
this.options.view.onGoBack && this.options.view.onGoBack();
|
3915
|
-
editor
|
3854
|
+
editor.navigate('/', {
|
3916
3855
|
trigger: true
|
3917
3856
|
});
|
3918
3857
|
}
|
@@ -4073,7 +4012,7 @@ function modelLifecycleTrackingView(_ref) {
|
|
4073
4012
|
var classNames = _ref.classNames;
|
4074
4013
|
return {
|
4075
4014
|
events: _defineProperty({}, "click .".concat(classNames.retryButton), function click() {
|
4076
|
-
editor
|
4015
|
+
editor.failures.retry();
|
4077
4016
|
return false;
|
4078
4017
|
}),
|
4079
4018
|
initialize: function initialize() {
|
@@ -4133,63 +4072,6 @@ var failureIndicatingView = modelLifecycleTrackingView({
|
|
4133
4072
|
|
4134
4073
|
function template$6(data) {
|
4135
4074
|
var __t, __p = '';
|
4136
|
-
__p += '<a class="back">' +
|
4137
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.outline') )) == null ? '' : __t) +
|
4138
|
-
'</a>\n<a class="destroy">' +
|
4139
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.destroy') )) == null ? '' : __t) +
|
4140
|
-
'</a>\n\n<div class="failure">\n <p>' +
|
4141
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.save_error') )) == null ? '' : __t) +
|
4142
|
-
'</p>\n <p class="message"></p>\n <a class="retry" href="">' +
|
4143
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.retry') )) == null ? '' : __t) +
|
4144
|
-
'</a>\n</div>\n\n<div class="form_container"></div>';
|
4145
|
-
return __p
|
4146
|
-
}
|
4147
|
-
|
4148
|
-
var EditChapterView = Marionette.Layout.extend({
|
4149
|
-
template: template$6,
|
4150
|
-
className: 'edit_chapter',
|
4151
|
-
mixins: [failureIndicatingView],
|
4152
|
-
regions: {
|
4153
|
-
formContainer: '.form_container'
|
4154
|
-
},
|
4155
|
-
events: {
|
4156
|
-
'click a.back': 'goBack',
|
4157
|
-
'click a.destroy': 'destroy'
|
4158
|
-
},
|
4159
|
-
onRender: function onRender() {
|
4160
|
-
var configurationEditor = new ConfigurationEditorView({
|
4161
|
-
model: this.model.configuration
|
4162
|
-
});
|
4163
|
-
this.configure(configurationEditor);
|
4164
|
-
this.formContainer.show(configurationEditor);
|
4165
|
-
},
|
4166
|
-
configure: function configure(configurationEditor) {
|
4167
|
-
var view = this;
|
4168
|
-
configurationEditor.tab('general', function () {
|
4169
|
-
this.input('title', TextInputView, {
|
4170
|
-
model: view.model
|
4171
|
-
});
|
4172
|
-
|
4173
|
-
if (pageflow.features.isEnabled('chapter_hierachy')) {
|
4174
|
-
this.input('display_parent_page_button', CheckBoxInputView);
|
4175
|
-
}
|
4176
|
-
});
|
4177
|
-
},
|
4178
|
-
destroy: function destroy() {
|
4179
|
-
if (confirm(I18n$1.t('pageflow.editor.views.edit_chapter_view.confirm_destroy'))) {
|
4180
|
-
this.model.destroy();
|
4181
|
-
this.goBack();
|
4182
|
-
}
|
4183
|
-
},
|
4184
|
-
goBack: function goBack() {
|
4185
|
-
editor$1.navigate('/', {
|
4186
|
-
trigger: true
|
4187
|
-
});
|
4188
|
-
}
|
4189
|
-
});
|
4190
|
-
|
4191
|
-
function template$7(data) {
|
4192
|
-
var __t, __p = '';
|
4193
4075
|
__p += '<a class="close" href="#">' +
|
4194
4076
|
((__t = ( I18n.t('pageflow.editor.templates.edit_entry.close') )) == null ? '' : __t) +
|
4195
4077
|
'</a>\n<a class="publish" href="#" data-tooltip-align="bottom right">\n ' +
|
@@ -4205,7 +4087,7 @@ return __p
|
|
4205
4087
|
}
|
4206
4088
|
|
4207
4089
|
var EditEntryView = Marionette.Layout.extend({
|
4208
|
-
template: template$
|
4090
|
+
template: template$6,
|
4209
4091
|
mixins: [failureIndicatingView, tooltipContainer],
|
4210
4092
|
ui: {
|
4211
4093
|
publishButton: 'a.publish',
|
@@ -4223,7 +4105,7 @@ var EditEntryView = Marionette.Layout.extend({
|
|
4223
4105
|
},
|
4224
4106
|
'click a.publish': function clickAPublish() {
|
4225
4107
|
if (!this.ui.publishButton.hasClass('disabled')) {
|
4226
|
-
editor
|
4108
|
+
editor.navigate('/publish', {
|
4227
4109
|
trigger: true
|
4228
4110
|
});
|
4229
4111
|
}
|
@@ -4231,7 +4113,7 @@ var EditEntryView = Marionette.Layout.extend({
|
|
4231
4113
|
return false;
|
4232
4114
|
},
|
4233
4115
|
'click .menu a': function clickMenuA(event) {
|
4234
|
-
editor
|
4116
|
+
editor.navigate($(event.target).data('path'), {
|
4235
4117
|
trigger: true
|
4236
4118
|
});
|
4237
4119
|
return false;
|
@@ -4242,7 +4124,7 @@ var EditEntryView = Marionette.Layout.extend({
|
|
4242
4124
|
|
4243
4125
|
this._updatePublishButton();
|
4244
4126
|
|
4245
|
-
this.outlineRegion.show(new editor
|
4127
|
+
this.outlineRegion.show(new editor.entryType.outlineView({
|
4246
4128
|
entry: state.entry,
|
4247
4129
|
navigatable: true,
|
4248
4130
|
editable: true,
|
@@ -4264,7 +4146,7 @@ var EditEntryView = Marionette.Layout.extend({
|
|
4264
4146
|
_addMenuItems: function _addMenuItems() {
|
4265
4147
|
var view = this;
|
4266
4148
|
|
4267
|
-
_
|
4149
|
+
_.each(editor.mainMenuItems, function (options) {
|
4268
4150
|
var item = $('<li><a href="#"></a></li>');
|
4269
4151
|
var link = item.find('a');
|
4270
4152
|
|
@@ -4283,7 +4165,7 @@ var EditEntryView = Marionette.Layout.extend({
|
|
4283
4165
|
}
|
4284
4166
|
});
|
4285
4167
|
|
4286
|
-
function template$
|
4168
|
+
function template$7(data) {
|
4287
4169
|
var __t, __p = '';
|
4288
4170
|
__p += '<div class="widget_type">\n</div>\n<a class="settings" title="' +
|
4289
4171
|
((__t = ( I18n.t('pageflow.editor.templates.widget_item.settings') )) == null ? '' : __t) +
|
@@ -4292,7 +4174,7 @@ return __p
|
|
4292
4174
|
}
|
4293
4175
|
|
4294
4176
|
var WidgetItemView = Marionette.Layout.extend({
|
4295
|
-
template: template$
|
4177
|
+
template: template$7,
|
4296
4178
|
tagName: 'li',
|
4297
4179
|
className: 'widget_item',
|
4298
4180
|
regions: {
|
@@ -4306,7 +4188,7 @@ var WidgetItemView = Marionette.Layout.extend({
|
|
4306
4188
|
},
|
4307
4189
|
events: {
|
4308
4190
|
'click .settings': function clickSettings() {
|
4309
|
-
editor
|
4191
|
+
editor.navigate('/widgets/' + this.model.role(), {
|
4310
4192
|
trigger: true
|
4311
4193
|
});
|
4312
4194
|
return false;
|
@@ -4332,14 +4214,14 @@ var WidgetItemView = Marionette.Layout.extend({
|
|
4332
4214
|
}
|
4333
4215
|
});
|
4334
4216
|
|
4335
|
-
function template$
|
4217
|
+
function template$8(data) {
|
4336
4218
|
var __p = '';
|
4337
4219
|
__p += '<ol class="widgets">\n</ol>\n';
|
4338
4220
|
return __p
|
4339
4221
|
}
|
4340
4222
|
|
4341
4223
|
var EditWidgetsView = Marionette.Layout.extend({
|
4342
|
-
template: template$
|
4224
|
+
template: template$8,
|
4343
4225
|
ui: {
|
4344
4226
|
widgets: '.widgets'
|
4345
4227
|
},
|
@@ -4355,14 +4237,14 @@ var EditWidgetsView = Marionette.Layout.extend({
|
|
4355
4237
|
}
|
4356
4238
|
});
|
4357
4239
|
|
4358
|
-
function template$
|
4240
|
+
function template$9(data) {
|
4359
4241
|
var __p = '';
|
4360
4242
|
__p += '<div class="image"></div>\n<div class="label"></div>\n';
|
4361
4243
|
return __p
|
4362
4244
|
}
|
4363
4245
|
|
4364
4246
|
var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
|
4365
|
-
template: template$
|
4247
|
+
template: template$9,
|
4366
4248
|
className: 'preview',
|
4367
4249
|
modelEvents: {
|
4368
4250
|
change: 'update'
|
@@ -4393,14 +4275,14 @@ var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
|
|
4393
4275
|
}
|
4394
4276
|
});
|
4395
4277
|
|
4396
|
-
function template$
|
4278
|
+
function template$a(data) {
|
4397
4279
|
var __p = '';
|
4398
4280
|
__p += '<div class="container">\n <div class="slider horizontal">\n </div>\n <div class="slider vertical">\n </div>\n <div class="percent horizontal">\n <input type="number" min="0" max="100">\n %\n </div>\n <div class="percent vertical">\n <input type="number" min="0" max="100">\n %\n </div>\n</div>\n';
|
4399
4281
|
return __p
|
4400
4282
|
}
|
4401
4283
|
|
4402
4284
|
var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
|
4403
|
-
template: template$
|
4285
|
+
template: template$a,
|
4404
4286
|
className: '',
|
4405
4287
|
ui: {
|
4406
4288
|
container: '.container',
|
@@ -4481,7 +4363,7 @@ var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
|
|
4481
4363
|
}
|
4482
4364
|
});
|
4483
4365
|
|
4484
|
-
function template$
|
4366
|
+
function template$b(data) {
|
4485
4367
|
var __t, __p = '';
|
4486
4368
|
__p += '<div class="box">\n <h2>' +
|
4487
4369
|
((__t = ( I18n.t('pageflow.editor.templates.background_positioning.title') )) == null ? '' : __t) +
|
@@ -4498,7 +4380,7 @@ return __p
|
|
4498
4380
|
}
|
4499
4381
|
|
4500
4382
|
var BackgroundPositioningView = Marionette.ItemView.extend({
|
4501
|
-
template: template$
|
4383
|
+
template: template$b,
|
4502
4384
|
className: 'background_positioning dialog',
|
4503
4385
|
mixins: [dialogView],
|
4504
4386
|
ui: {
|
@@ -4535,7 +4417,7 @@ var BackgroundPositioningView = Marionette.ItemView.extend({
|
|
4535
4417
|
createPreviews: function createPreviews() {
|
4536
4418
|
var view = this;
|
4537
4419
|
|
4538
|
-
_
|
4420
|
+
_.each(view.previews, function (ratio, name) {
|
4539
4421
|
view.ui.previews.append(view.subview(new BackgroundPositioningPreviewView({
|
4540
4422
|
model: view.transientModel,
|
4541
4423
|
propertyName: view.options.propertyName,
|
@@ -4552,14 +4434,14 @@ BackgroundPositioningView.open = function (options) {
|
|
4552
4434
|
app.dialogRegion.show(new BackgroundPositioningView(options));
|
4553
4435
|
};
|
4554
4436
|
|
4555
|
-
function template$
|
4437
|
+
function template$c(data) {
|
4556
4438
|
var __p = '';
|
4557
4439
|
__p += '<div class="label"></div>\n<a href="#"></a>\n';
|
4558
4440
|
return __p
|
4559
4441
|
}
|
4560
4442
|
|
4561
4443
|
var DropDownButtonItemView = Marionette.ItemView.extend({
|
4562
|
-
template: template$
|
4444
|
+
template: template$c,
|
4563
4445
|
tagName: 'li',
|
4564
4446
|
className: 'drop_down_button_item',
|
4565
4447
|
ui: {
|
@@ -4609,7 +4491,7 @@ var DropDownButtonItemListView = function DropDownButtonItemListView(options) {
|
|
4609
4491
|
});
|
4610
4492
|
};
|
4611
4493
|
|
4612
|
-
function template$
|
4494
|
+
function template$d(data) {
|
4613
4495
|
var __p = '';
|
4614
4496
|
__p += '<button></button>\n\n<div class="drop_down_button_menu">\n</div>\n';
|
4615
4497
|
return __p
|
@@ -4644,7 +4526,7 @@ return __p
|
|
4644
4526
|
*/
|
4645
4527
|
|
4646
4528
|
var DropDownButtonView = Marionette.ItemView.extend({
|
4647
|
-
template: template$
|
4529
|
+
template: template$d,
|
4648
4530
|
className: 'drop_down_button',
|
4649
4531
|
ui: {
|
4650
4532
|
button: '> button',
|
@@ -4707,11 +4589,11 @@ var DropDownButtonView = Marionette.ItemView.extend({
|
|
4707
4589
|
}
|
4708
4590
|
},
|
4709
4591
|
scheduleHideMenu: function scheduleHideMenu() {
|
4710
|
-
this.hideMenuTimeout = setTimeout(_
|
4592
|
+
this.hideMenuTimeout = setTimeout(_.bind(this.hideMenu, this), 300);
|
4711
4593
|
}
|
4712
4594
|
});
|
4713
4595
|
|
4714
|
-
function template$
|
4596
|
+
function template$e(data) {
|
4715
4597
|
var __p = '';
|
4716
4598
|
__p += '<div class="pictogram"></div>\n';
|
4717
4599
|
return __p
|
@@ -4719,7 +4601,7 @@ return __p
|
|
4719
4601
|
|
4720
4602
|
var FileThumbnailView = Marionette.ItemView.extend({
|
4721
4603
|
className: 'file_thumbnail',
|
4722
|
-
template: template$
|
4604
|
+
template: template$e,
|
4723
4605
|
modelEvents: {
|
4724
4606
|
'change:state': 'update'
|
4725
4607
|
},
|
@@ -4762,7 +4644,7 @@ var FileThumbnailView = Marionette.ItemView.extend({
|
|
4762
4644
|
}
|
4763
4645
|
});
|
4764
4646
|
|
4765
|
-
function template$
|
4647
|
+
function template$f(data) {
|
4766
4648
|
var __t, __p = '';
|
4767
4649
|
__p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="file_thumbnail"></div>\n<div class="file_name"></div>\n\n<a href="" class="unset" title="' +
|
4768
4650
|
((__t = ( I18n.t('pageflow.ui.templates.inputs.file_input.reset') )) == null ? '' : __t) +
|
@@ -4780,7 +4662,7 @@ return __p
|
|
4780
4662
|
|
4781
4663
|
var FileInputView = Marionette.ItemView.extend({
|
4782
4664
|
mixins: [inputView],
|
4783
|
-
template: template$
|
4665
|
+
template: template$f,
|
4784
4666
|
className: 'file_input',
|
4785
4667
|
ui: {
|
4786
4668
|
fileName: '.file_name',
|
@@ -4788,10 +4670,10 @@ var FileInputView = Marionette.ItemView.extend({
|
|
4788
4670
|
},
|
4789
4671
|
events: {
|
4790
4672
|
'click .choose': function clickChoose() {
|
4791
|
-
editor
|
4673
|
+
editor.selectFile({
|
4792
4674
|
name: this.options.collection.name,
|
4793
4675
|
filter: this.options.filter
|
4794
|
-
}, this.options.fileSelectionHandler || 'pageConfiguration', _
|
4676
|
+
}, this.options.fileSelectionHandler || 'pageConfiguration', _.extend({
|
4795
4677
|
id: this.model.getRoutableId ? this.model.getRoutableId() : this.model.id,
|
4796
4678
|
attributeName: this.options.propertyName,
|
4797
4679
|
returnToTab: this.options.parentTab
|
@@ -4804,13 +4686,13 @@ var FileInputView = Marionette.ItemView.extend({
|
|
4804
4686
|
}
|
4805
4687
|
},
|
4806
4688
|
initialize: function initialize() {
|
4807
|
-
this.options = _
|
4689
|
+
this.options = _.extend({
|
4808
4690
|
positioning: true,
|
4809
4691
|
textTrackFiles: state.textTrackFiles
|
4810
4692
|
}, this.options);
|
4811
4693
|
|
4812
4694
|
if (typeof this.options.collection === 'string') {
|
4813
|
-
this.options.collection = state.entry.getFileCollection(editor
|
4695
|
+
this.options.collection = state.entry.getFileCollection(editor.fileTypes.findByCollectionName(this.options.collection));
|
4814
4696
|
}
|
4815
4697
|
|
4816
4698
|
this.textTrackMenuItems = new Backbone.Collection();
|
@@ -4840,6 +4722,8 @@ var FileInputView = Marionette.ItemView.extend({
|
|
4840
4722
|
}));
|
4841
4723
|
},
|
4842
4724
|
_dropDownMenuItems: function _dropDownMenuItems() {
|
4725
|
+
var _this = this;
|
4726
|
+
|
4843
4727
|
var file = this._getFile(file);
|
4844
4728
|
|
4845
4729
|
var items = new Backbone.Collection();
|
@@ -4864,6 +4748,18 @@ var FileInputView = Marionette.ItemView.extend({
|
|
4864
4748
|
}
|
4865
4749
|
|
4866
4750
|
if (file) {
|
4751
|
+
_.each(this.options.dropDownMenuItems, function (item) {
|
4752
|
+
items.add(new FileInputView.CustomMenuItem({
|
4753
|
+
name: item.name,
|
4754
|
+
label: item.label
|
4755
|
+
}, {
|
4756
|
+
inputModel: _this.model,
|
4757
|
+
propertyName: _this.options.propertyName,
|
4758
|
+
file: file,
|
4759
|
+
selected: item.selected
|
4760
|
+
}));
|
4761
|
+
});
|
4762
|
+
|
4867
4763
|
items.add(new FileInputView.EditFileSettingsMenuItem({
|
4868
4764
|
name: 'edit_file_settings',
|
4869
4765
|
label: I18n$1.t('pageflow.editor.views.inputs.file_input.edit_file_settings')
|
@@ -4914,6 +4810,18 @@ FileInputView.EditBackgroundPositioningMenuItem = Backbone.Model.extend({
|
|
4914
4810
|
});
|
4915
4811
|
}
|
4916
4812
|
});
|
4813
|
+
FileInputView.CustomMenuItem = Backbone.Model.extend({
|
4814
|
+
initialize: function initialize(attributes, options) {
|
4815
|
+
this.options = options;
|
4816
|
+
},
|
4817
|
+
selected: function selected() {
|
4818
|
+
this.options.selected({
|
4819
|
+
inputModel: this.options.inputModel,
|
4820
|
+
propertyName: this.options.propertyName,
|
4821
|
+
file: this.options.file
|
4822
|
+
});
|
4823
|
+
}
|
4824
|
+
});
|
4917
4825
|
FileInputView.EditFileSettingsMenuItem = Backbone.Model.extend({
|
4918
4826
|
initialize: function initialize(attributes, options) {
|
4919
4827
|
this.options = options;
|
@@ -4952,14 +4860,14 @@ FileInputView.DefaultTextTrackFileMenuItem = Backbone.Model.extend({
|
|
4952
4860
|
}
|
4953
4861
|
});
|
4954
4862
|
|
4955
|
-
function template$
|
4863
|
+
function template$g(data) {
|
4956
4864
|
var __p = '';
|
4957
4865
|
__p += '<div class="spinner">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n</div>\n';
|
4958
4866
|
return __p
|
4959
4867
|
}
|
4960
4868
|
|
4961
4869
|
var LoadingView = Marionette.ItemView.extend({
|
4962
|
-
template: template$
|
4870
|
+
template: template$g,
|
4963
4871
|
className: 'loading',
|
4964
4872
|
tagName: 'li'
|
4965
4873
|
});
|
@@ -4982,7 +4890,7 @@ var selectableView = {
|
|
4982
4890
|
}
|
4983
4891
|
};
|
4984
4892
|
|
4985
|
-
function template$
|
4893
|
+
function template$h(data) {
|
4986
4894
|
var __t, __p = '';
|
4987
4895
|
__p += '<span class="theme_name"></span>\n<span class="button_or_checkmark">\n <p class="theme_in_use"></p>\n <a class="use_theme">' +
|
4988
4896
|
((__t = ( I18n.t('pageflow.editor.templates.theme.use') )) == null ? '' : __t) +
|
@@ -4992,7 +4900,7 @@ return __p
|
|
4992
4900
|
|
4993
4901
|
var ThemeItemView = Marionette.ItemView.extend({
|
4994
4902
|
tagName: 'li',
|
4995
|
-
template: template$
|
4903
|
+
template: template$h,
|
4996
4904
|
className: 'theme_item',
|
4997
4905
|
mixins: [selectableView],
|
4998
4906
|
selectionAttribute: 'theme',
|
@@ -5023,7 +4931,7 @@ var ThemeItemView = Marionette.ItemView.extend({
|
|
5023
4931
|
}
|
5024
4932
|
});
|
5025
4933
|
|
5026
|
-
function template$
|
4934
|
+
function template$i(data) {
|
5027
4935
|
var __t, __p = '';
|
5028
4936
|
__p += '<div class="box">\n <div class="content">\n <div>\n <h2 class="themes_header">' +
|
5029
4937
|
((__t = ( I18n.t('pageflow.editor.templates.change_theme_dialog.header') )) == null ? '' : __t) +
|
@@ -5038,7 +4946,7 @@ return __p
|
|
5038
4946
|
}
|
5039
4947
|
|
5040
4948
|
var ChangeThemeDialogView = Marionette.ItemView.extend({
|
5041
|
-
template: template$
|
4949
|
+
template: template$i,
|
5042
4950
|
className: 'change_theme dialog editor',
|
5043
4951
|
mixins: [dialogView],
|
5044
4952
|
ui: {
|
@@ -5107,14 +5015,14 @@ ChangeThemeDialogView.changeTheme = function (options) {
|
|
5107
5015
|
}).promise();
|
5108
5016
|
};
|
5109
5017
|
|
5110
|
-
function template$
|
5018
|
+
function template$j(data) {
|
5111
5019
|
var __p = '';
|
5112
5020
|
__p += '\n';
|
5113
5021
|
return __p
|
5114
5022
|
}
|
5115
5023
|
|
5116
5024
|
var StaticThumbnailView = Marionette.ItemView.extend({
|
5117
|
-
template: template$
|
5025
|
+
template: template$j,
|
5118
5026
|
className: 'static_thumbnail',
|
5119
5027
|
modelEvents: {
|
5120
5028
|
'change:configuration': 'update'
|
@@ -5147,7 +5055,7 @@ var ModelThumbnailView = Marionette.View.extend({
|
|
5147
5055
|
},
|
5148
5056
|
update: function update() {
|
5149
5057
|
if (this.model) {
|
5150
|
-
if (_
|
5058
|
+
if (_.isFunction(this.model.thumbnailFile)) {
|
5151
5059
|
var file = this.model && this.model.thumbnailFile();
|
5152
5060
|
|
5153
5061
|
if (this.thumbnailView && this.currentFileThumbnail == file) {
|
@@ -5178,7 +5086,7 @@ var ModelThumbnailView = Marionette.View.extend({
|
|
5178
5086
|
}
|
5179
5087
|
});
|
5180
5088
|
|
5181
|
-
function template$
|
5089
|
+
function template$k(data) {
|
5182
5090
|
var __p = '';
|
5183
5091
|
__p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="title"></div>\n<button class="unset"></button>\n<button class="choose"></button>\n';
|
5184
5092
|
return __p
|
@@ -5194,7 +5102,7 @@ var ReferenceInputView = Marionette.ItemView.extend(
|
|
5194
5102
|
/** @lends ReferenceInputView.prototype */
|
5195
5103
|
{
|
5196
5104
|
mixins: [inputView],
|
5197
|
-
template: template$
|
5105
|
+
template: template$k,
|
5198
5106
|
className: 'reference_input',
|
5199
5107
|
ui: {
|
5200
5108
|
title: '.title',
|
@@ -5293,7 +5201,7 @@ var ThemeInputView = ReferenceInputView.extend({
|
|
5293
5201
|
}
|
5294
5202
|
});
|
5295
5203
|
|
5296
|
-
function template$
|
5204
|
+
function template$l(data) {
|
5297
5205
|
var __t, __p = '';
|
5298
5206
|
__p += '<a class="back">' +
|
5299
5207
|
((__t = ( I18n.t('pageflow.editor.templates.edit_meta_data.outline') )) == null ? '' : __t) +
|
@@ -5306,7 +5214,7 @@ return __p
|
|
5306
5214
|
}
|
5307
5215
|
|
5308
5216
|
var EditMetaDataView = Marionette.Layout.extend({
|
5309
|
-
template: template$
|
5217
|
+
template: template$l,
|
5310
5218
|
className: 'edit_meta_data',
|
5311
5219
|
mixins: [failureIndicatingView],
|
5312
5220
|
regions: {
|
@@ -5332,7 +5240,7 @@ var EditMetaDataView = Marionette.Layout.extend({
|
|
5332
5240
|
});
|
5333
5241
|
this.input('locale', SelectInputView, {
|
5334
5242
|
values: state.config.availablePublicLocales,
|
5335
|
-
texts: _
|
5243
|
+
texts: _.map(state.config.availablePublicLocales, function (locale) {
|
5336
5244
|
return I18n$1.t('pageflow.public._language', {
|
5337
5245
|
locale: locale
|
5338
5246
|
});
|
@@ -5400,298 +5308,67 @@ var EditMetaDataView = Marionette.Layout.extend({
|
|
5400
5308
|
this.formContainer.show(configurationEditor);
|
5401
5309
|
},
|
5402
5310
|
goBack: function goBack() {
|
5403
|
-
editor.navigate('/', {
|
5311
|
+
this.options.editor.navigate('/', {
|
5404
5312
|
trigger: true
|
5405
5313
|
});
|
5406
5314
|
}
|
5407
5315
|
});
|
5408
5316
|
|
5409
|
-
function template$
|
5317
|
+
function template$m(data) {
|
5410
5318
|
var __t, __p = '';
|
5411
5319
|
__p += '<a class="back">' +
|
5412
|
-
((__t = ( I18n.t('pageflow.editor.templates.
|
5413
|
-
'</a>\n
|
5414
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_page_link.destroy') )) == null ? '' : __t) +
|
5415
|
-
'</a>\n<div class="form_container"></div>\n';
|
5320
|
+
((__t = ( I18n.t('pageflow.editor.templates.edit_widget.back') )) == null ? '' : __t) +
|
5321
|
+
'</a>\n';
|
5416
5322
|
return __p
|
5417
5323
|
}
|
5418
5324
|
|
5419
|
-
var
|
5420
|
-
template: template$
|
5421
|
-
|
5422
|
-
formContainer: '.form_container'
|
5423
|
-
},
|
5424
|
-
ui: {
|
5425
|
-
backButton: 'a.back'
|
5426
|
-
},
|
5325
|
+
var EditWidgetView = Marionette.ItemView.extend({
|
5326
|
+
template: template$m,
|
5327
|
+
className: 'edit_widget',
|
5427
5328
|
events: {
|
5428
|
-
'click a.back':
|
5429
|
-
|
5430
|
-
|
5431
|
-
|
5432
|
-
|
5433
|
-
var configurationEditor = pageType.createPageLinkConfigurationEditorView({
|
5434
|
-
model: this.model,
|
5435
|
-
page: this.options.page
|
5436
|
-
});
|
5437
|
-
this.formContainer.show(configurationEditor);
|
5438
|
-
this.highlight();
|
5329
|
+
'click a.back': function clickABack() {
|
5330
|
+
editor.navigate('/meta_data/widgets', {
|
5331
|
+
trigger: true
|
5332
|
+
});
|
5333
|
+
}
|
5439
5334
|
},
|
5440
|
-
|
5441
|
-
this.model.
|
5442
|
-
this.listenTo(this, 'close', function () {
|
5443
|
-
this.model.resetHighlight();
|
5444
|
-
});
|
5335
|
+
initialize: function initialize() {
|
5336
|
+
this.model.set('editing', true);
|
5445
5337
|
},
|
5446
|
-
|
5447
|
-
|
5448
|
-
|
5449
|
-
this.goBack();
|
5450
|
-
}
|
5338
|
+
onClose: function onClose() {
|
5339
|
+
Marionette.ItemView.prototype.onClose.call(this);
|
5340
|
+
this.model.set('editing', false);
|
5451
5341
|
},
|
5452
|
-
|
5453
|
-
|
5454
|
-
|
5342
|
+
onRender: function onRender() {
|
5343
|
+
var configurationEditor = this.model.widgetType().createConfigurationEditorView({
|
5344
|
+
model: this.model.configuration,
|
5345
|
+
tab: this.options.tab
|
5455
5346
|
});
|
5347
|
+
this.appendSubview(configurationEditor);
|
5456
5348
|
}
|
5457
5349
|
});
|
5458
5350
|
|
5459
|
-
|
5460
|
-
|
5461
|
-
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
'</a>\n</div>\n\n<div class="page_type"></div>\n\n<div class="configuration_container"></div>';
|
5351
|
+
var loadable = modelLifecycleTrackingView({
|
5352
|
+
classNames: {
|
5353
|
+
creating: 'creating',
|
5354
|
+
destroying: 'destroying'
|
5355
|
+
}
|
5356
|
+
});
|
5357
|
+
|
5358
|
+
function template$n(data) {
|
5359
|
+
var __p = '';
|
5360
|
+
__p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n';
|
5470
5361
|
return __p
|
5471
5362
|
}
|
5472
5363
|
|
5473
|
-
var
|
5474
|
-
|
5475
|
-
|
5476
|
-
mixins: [
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
events: {
|
5482
|
-
'click a.back': 'goBack',
|
5483
|
-
'click a.destroy': 'destroy'
|
5484
|
-
},
|
5485
|
-
modelEvents: {
|
5486
|
-
'change:template': 'load'
|
5487
|
-
},
|
5488
|
-
onRender: function onRender() {
|
5489
|
-
var _this = this;
|
5490
|
-
|
5491
|
-
this.pageTypeContainer.show(new ExtendedSelectInputView({
|
5492
|
-
model: this.model,
|
5493
|
-
propertyName: 'template',
|
5494
|
-
collection: this.options.api.pageTypes.pluck('seed'),
|
5495
|
-
valueProperty: 'name',
|
5496
|
-
translationKeyProperty: 'translation_key',
|
5497
|
-
groupTranslationKeyProperty: 'category_translation_key',
|
5498
|
-
descriptionTranslationKeyProperty: 'description_translation_key',
|
5499
|
-
pictogramClass: 'type_pictogram',
|
5500
|
-
helpLinkClicked: function helpLinkClicked(value) {
|
5501
|
-
var pageType = _this.options.api.pageTypes.findByName(value);
|
5502
|
-
|
5503
|
-
app.trigger('toggle-help', pageType.seed.help_entry_translation_key);
|
5504
|
-
}
|
5505
|
-
}));
|
5506
|
-
this.load();
|
5507
|
-
this.model.trigger('edit', this.model);
|
5508
|
-
},
|
5509
|
-
onShow: function onShow() {
|
5510
|
-
this.configurationEditor.refreshScroller();
|
5511
|
-
},
|
5512
|
-
load: function load() {
|
5513
|
-
this.configurationEditor = this.options.api.createPageConfigurationEditorView(this.model, {
|
5514
|
-
tab: this.options.tab
|
5515
|
-
});
|
5516
|
-
this.configurationContainer.show(this.configurationEditor);
|
5517
|
-
},
|
5518
|
-
destroy: function destroy() {
|
5519
|
-
if (confirm(I18n$1.t('pageflow.editor.views.edit_page_view.confirm_destroy'))) {
|
5520
|
-
this.model.destroy();
|
5521
|
-
this.goBack();
|
5522
|
-
}
|
5523
|
-
},
|
5524
|
-
goBack: function goBack() {
|
5525
|
-
editor$1.navigate('/', {
|
5526
|
-
trigger: true
|
5527
|
-
});
|
5528
|
-
}
|
5529
|
-
});
|
5530
|
-
|
5531
|
-
var PageLinkInputView = ReferenceInputView.extend({
|
5532
|
-
choose: function choose() {
|
5533
|
-
return editor$1.selectPage({
|
5534
|
-
isAllowed: this.options.isAllowed
|
5535
|
-
});
|
5536
|
-
},
|
5537
|
-
getTarget: function getTarget(permaId) {
|
5538
|
-
return state.pages.getByPermaId(permaId);
|
5539
|
-
}
|
5540
|
-
});
|
5541
|
-
|
5542
|
-
function template$p(data) {
|
5543
|
-
var __t, __p = '';
|
5544
|
-
__p += '<a class="back">' +
|
5545
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_storyline.outline') )) == null ? '' : __t) +
|
5546
|
-
'</a>\n<a class="destroy" data-tooltip-align="bottom right">\n ' +
|
5547
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_storyline.destroy') )) == null ? '' : __t) +
|
5548
|
-
'\n</a>\n\n<div class="failure">\n <p>' +
|
5549
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_storyline.save_error') )) == null ? '' : __t) +
|
5550
|
-
'</p>\n <p class="message"></p>\n <a class="retry" href="">' +
|
5551
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_storyline.retry') )) == null ? '' : __t) +
|
5552
|
-
'</a>\n</div>\n\n<div class="form_container"></div>\n';
|
5553
|
-
return __p
|
5554
|
-
}
|
5555
|
-
|
5556
|
-
var EditStorylineView = Marionette.Layout.extend({
|
5557
|
-
template: template$p,
|
5558
|
-
className: 'edit_storyline',
|
5559
|
-
mixins: [failureIndicatingView, tooltipContainer],
|
5560
|
-
regions: {
|
5561
|
-
formContainer: '.form_container'
|
5562
|
-
},
|
5563
|
-
ui: {
|
5564
|
-
destroyButton: 'a.destroy'
|
5565
|
-
},
|
5566
|
-
events: {
|
5567
|
-
'click a.back': 'goBack',
|
5568
|
-
'click a.destroy': 'destroy'
|
5569
|
-
},
|
5570
|
-
onRender: function onRender() {
|
5571
|
-
var configurationEditor = new ConfigurationEditorView({
|
5572
|
-
model: this.model.configuration,
|
5573
|
-
attributeTranslationKeyPrefixes: ['pageflow.storyline_attributes']
|
5574
|
-
});
|
5575
|
-
this.configure(configurationEditor, this.model.transitiveChildPages());
|
5576
|
-
this.formContainer.show(configurationEditor);
|
5577
|
-
this.updateDestroyButton();
|
5578
|
-
},
|
5579
|
-
updateDestroyButton: function updateDestroyButton() {
|
5580
|
-
var disabled = this.model.chapters.length > 0;
|
5581
|
-
this.ui.destroyButton.toggleClass('disabled', disabled);
|
5582
|
-
|
5583
|
-
if (disabled) {
|
5584
|
-
this.ui.destroyButton.attr('data-tooltip', 'pageflow.editor.views.edit_storyline_view.cannot_destroy');
|
5585
|
-
} else {
|
5586
|
-
this.ui.destroyButton.removeAttr('data-tooltip');
|
5587
|
-
}
|
5588
|
-
},
|
5589
|
-
configure: function configure(configurationEditor, storylineChildPages) {
|
5590
|
-
configurationEditor.tab('general', function () {
|
5591
|
-
this.input('title', TextInputView);
|
5592
|
-
this.input('main', CheckBoxInputView, {
|
5593
|
-
disabled: true,
|
5594
|
-
visibleBinding: 'main'
|
5595
|
-
});
|
5596
|
-
this.group('page_transitions', {
|
5597
|
-
includeBlank: true
|
5598
|
-
});
|
5599
|
-
this.input('main', CheckBoxInputView, {
|
5600
|
-
visibleBinding: 'main',
|
5601
|
-
visible: function visible(isMain) {
|
5602
|
-
return !isMain;
|
5603
|
-
}
|
5604
|
-
});
|
5605
|
-
this.input('parent_page_perma_id', PageLinkInputView, {
|
5606
|
-
visibleBinding: 'main',
|
5607
|
-
visible: function visible(isMain) {
|
5608
|
-
return !isMain && state.storylines.length > 1;
|
5609
|
-
},
|
5610
|
-
isAllowed: function isAllowed(page) {
|
5611
|
-
return !storylineChildPages.contain(page);
|
5612
|
-
}
|
5613
|
-
});
|
5614
|
-
this.input('scroll_successor_id', PageLinkInputView);
|
5615
|
-
|
5616
|
-
if (pageflow.features.isEnabled('chapter_hierachy')) {
|
5617
|
-
this.input('navigation_bar_mode', SelectInputView, {
|
5618
|
-
values: pageflow.ChapterFilter.strategies
|
5619
|
-
});
|
5620
|
-
}
|
5621
|
-
});
|
5622
|
-
},
|
5623
|
-
destroy: function destroy() {
|
5624
|
-
if (this.model.chapters.length) {
|
5625
|
-
return;
|
5626
|
-
}
|
5627
|
-
|
5628
|
-
if (confirm(I18n$1.t('pageflow.editor.views.edit_storyline_view.confirm_destroy'))) {
|
5629
|
-
this.model.destroy();
|
5630
|
-
this.goBack();
|
5631
|
-
}
|
5632
|
-
},
|
5633
|
-
goBack: function goBack() {
|
5634
|
-
editor$1.navigate('/?storyline=' + this.model.id, {
|
5635
|
-
trigger: true
|
5636
|
-
});
|
5637
|
-
}
|
5638
|
-
});
|
5639
|
-
|
5640
|
-
function template$q(data) {
|
5641
|
-
var __t, __p = '';
|
5642
|
-
__p += '<a class="back">' +
|
5643
|
-
((__t = ( I18n.t('pageflow.editor.templates.edit_widget.back') )) == null ? '' : __t) +
|
5644
|
-
'</a>\n';
|
5645
|
-
return __p
|
5646
|
-
}
|
5647
|
-
|
5648
|
-
var EditWidgetView = Marionette.ItemView.extend({
|
5649
|
-
template: template$q,
|
5650
|
-
className: 'edit_widget',
|
5651
|
-
events: {
|
5652
|
-
'click a.back': function clickABack() {
|
5653
|
-
editor$1.navigate('/meta_data/widgets', {
|
5654
|
-
trigger: true
|
5655
|
-
});
|
5656
|
-
}
|
5657
|
-
},
|
5658
|
-
initialize: function initialize() {
|
5659
|
-
this.model.set('editing', true);
|
5660
|
-
},
|
5661
|
-
onClose: function onClose() {
|
5662
|
-
Marionette.ItemView.prototype.onClose.call(this);
|
5663
|
-
this.model.set('editing', false);
|
5664
|
-
},
|
5665
|
-
onRender: function onRender() {
|
5666
|
-
var configurationEditor = this.model.widgetType().createConfigurationEditorView({
|
5667
|
-
model: this.model.configuration,
|
5668
|
-
tab: this.options.tab
|
5669
|
-
});
|
5670
|
-
this.appendSubview(configurationEditor);
|
5671
|
-
}
|
5672
|
-
});
|
5673
|
-
|
5674
|
-
var loadable = modelLifecycleTrackingView({
|
5675
|
-
classNames: {
|
5676
|
-
creating: 'creating',
|
5677
|
-
destroying: 'destroying'
|
5678
|
-
}
|
5679
|
-
});
|
5680
|
-
|
5681
|
-
function template$r(data) {
|
5682
|
-
var __p = '';
|
5683
|
-
__p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n';
|
5684
|
-
return __p
|
5685
|
-
}
|
5686
|
-
|
5687
|
-
var ExplorerFileItemView = Marionette.ItemView.extend({
|
5688
|
-
tagName: 'li',
|
5689
|
-
template: template$r,
|
5690
|
-
mixins: [loadable, selectableView],
|
5691
|
-
selectionAttribute: 'file',
|
5692
|
-
ui: {
|
5693
|
-
fileName: '.file_name',
|
5694
|
-
thumbnail: '.file_thumbnail'
|
5364
|
+
var ExplorerFileItemView = Marionette.ItemView.extend({
|
5365
|
+
tagName: 'li',
|
5366
|
+
template: template$n,
|
5367
|
+
mixins: [loadable, selectableView],
|
5368
|
+
selectionAttribute: 'file',
|
5369
|
+
ui: {
|
5370
|
+
fileName: '.file_name',
|
5371
|
+
thumbnail: '.file_thumbnail'
|
5695
5372
|
},
|
5696
5373
|
events: {
|
5697
5374
|
'click': function click() {
|
@@ -5719,18 +5396,18 @@ var ExplorerFileItemView = Marionette.ItemView.extend({
|
|
5719
5396
|
this.ui.fileName.text(this.model.get('file_name') || '(Unbekannt)');
|
5720
5397
|
},
|
5721
5398
|
isDisabled: function isDisabled() {
|
5722
|
-
return this.options.disabledIds && _
|
5399
|
+
return this.options.disabledIds && _.contains(this.options.disabledIds, this.model.get('id'));
|
5723
5400
|
}
|
5724
5401
|
});
|
5725
5402
|
|
5726
|
-
function template$
|
5403
|
+
function template$o(data) {
|
5727
5404
|
var __p = '';
|
5728
5405
|
__p += '<a href="">\n <span class="title"></span>\n</a>\n';
|
5729
5406
|
return __p
|
5730
5407
|
}
|
5731
5408
|
|
5732
5409
|
var OtherEntryItemView = Marionette.ItemView.extend({
|
5733
|
-
template: template$
|
5410
|
+
template: template$o,
|
5734
5411
|
className: 'other_entry_item',
|
5735
5412
|
tagName: 'li',
|
5736
5413
|
mixins: [selectableView],
|
@@ -5745,7 +5422,7 @@ var OtherEntryItemView = Marionette.ItemView.extend({
|
|
5745
5422
|
}
|
5746
5423
|
});
|
5747
5424
|
|
5748
|
-
function template$
|
5425
|
+
function template$p(data) {
|
5749
5426
|
var __t, __p = '';
|
5750
5427
|
__p +=
|
5751
5428
|
((__t = ( I18n.t('pageflow.editor.templates.other_entries_blank_slate.none_available') )) == null ? '' : __t) +
|
@@ -5771,7 +5448,7 @@ var OtherEntriesCollectionView = Marionette.View.extend({
|
|
5771
5448
|
selection: this.options.selection
|
5772
5449
|
},
|
5773
5450
|
blankSlateViewConstructor: Marionette.ItemView.extend({
|
5774
|
-
template: template$
|
5451
|
+
template: template$p,
|
5775
5452
|
tagName: 'li',
|
5776
5453
|
className: 'blank_slate'
|
5777
5454
|
}),
|
@@ -5782,7 +5459,7 @@ var OtherEntriesCollectionView = Marionette.View.extend({
|
|
5782
5459
|
}
|
5783
5460
|
});
|
5784
5461
|
|
5785
|
-
function template$
|
5462
|
+
function template$q(data) {
|
5786
5463
|
var __t, __p = '';
|
5787
5464
|
__p += '<div class="box">\n <h2>' +
|
5788
5465
|
((__t = ( I18n.t('pageflow.editor.templates.files_explorer.reuse_files') )) == null ? '' : __t) +
|
@@ -5811,7 +5488,7 @@ return __p
|
|
5811
5488
|
}
|
5812
5489
|
|
5813
5490
|
var FilesExplorerView = Marionette.ItemView.extend({
|
5814
|
-
template: template$
|
5491
|
+
template: template$q,
|
5815
5492
|
className: 'files_explorer editor dialog',
|
5816
5493
|
mixins: [dialogView],
|
5817
5494
|
ui: {
|
@@ -5848,7 +5525,7 @@ var FilesExplorerView = Marionette.ItemView.extend({
|
|
5848
5525
|
i18n: 'pageflow.editor.files.tabs',
|
5849
5526
|
defaultTab: this.options.tabName
|
5850
5527
|
});
|
5851
|
-
editor
|
5528
|
+
editor.fileTypes.each(function (fileType) {
|
5852
5529
|
if (fileType.topLevelType) {
|
5853
5530
|
this.tab(fileType);
|
5854
5531
|
}
|
@@ -5857,7 +5534,7 @@ var FilesExplorerView = Marionette.ItemView.extend({
|
|
5857
5534
|
this.ui.okButton.prop('disabled', true);
|
5858
5535
|
},
|
5859
5536
|
tab: function tab(fileType) {
|
5860
|
-
this.tabsView.tab(fileType.collectionName, _
|
5537
|
+
this.tabsView.tab(fileType.collectionName, _.bind(function () {
|
5861
5538
|
var collection = this._collection(fileType);
|
5862
5539
|
|
5863
5540
|
var disabledIds = state.entry.getFileCollection(fileType).pluck('id');
|
@@ -5898,7 +5575,7 @@ FilesExplorerView.open = function (options) {
|
|
5898
5575
|
app.dialogRegion.show(new FilesExplorerView(options));
|
5899
5576
|
};
|
5900
5577
|
|
5901
|
-
function template$
|
5578
|
+
function template$r(data) {
|
5902
5579
|
var __p = '';
|
5903
5580
|
__p += '<th></th>\n<td></td>';
|
5904
5581
|
return __p
|
@@ -5906,13 +5583,13 @@ return __p
|
|
5906
5583
|
|
5907
5584
|
var FileMetaDataItemView = Marionette.ItemView.extend({
|
5908
5585
|
tagName: 'tr',
|
5909
|
-
template: template$
|
5586
|
+
template: template$r,
|
5910
5587
|
ui: {
|
5911
5588
|
label: 'th',
|
5912
5589
|
value: 'td'
|
5913
5590
|
},
|
5914
5591
|
onRender: function onRender() {
|
5915
|
-
this.subview(new this.options.valueView(_
|
5592
|
+
this.subview(new this.options.valueView(_.extend({
|
5916
5593
|
el: this.ui.value,
|
5917
5594
|
model: this.model,
|
5918
5595
|
name: this.options.name
|
@@ -5928,7 +5605,7 @@ var FileMetaDataItemView = Marionette.ItemView.extend({
|
|
5928
5605
|
}
|
5929
5606
|
});
|
5930
5607
|
|
5931
|
-
function template$
|
5608
|
+
function template$s(data) {
|
5932
5609
|
var __p = '';
|
5933
5610
|
__p += '<p class="percent"></p>\n<p class="description"></p>\n<p class="error_message"></p>';
|
5934
5611
|
return __p
|
@@ -5937,7 +5614,7 @@ return __p
|
|
5937
5614
|
var FileStageItemView = Marionette.ItemView.extend({
|
5938
5615
|
tagName: 'li',
|
5939
5616
|
className: 'file_stage_item',
|
5940
|
-
template: template$
|
5617
|
+
template: template$s,
|
5941
5618
|
ui: {
|
5942
5619
|
description: '.description',
|
5943
5620
|
percent: '.percent',
|
@@ -5978,7 +5655,7 @@ var FileStageItemView = Marionette.ItemView.extend({
|
|
5978
5655
|
}
|
5979
5656
|
});
|
5980
5657
|
|
5981
|
-
function template$
|
5658
|
+
function template$t(data) {
|
5982
5659
|
var __t, __p = '';
|
5983
5660
|
__p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n<a class="select">' +
|
5984
5661
|
((__t = ( I18n.t('pageflow.editor.templates.file_item.select') )) == null ? '' : __t) +
|
@@ -6002,7 +5679,7 @@ return __p
|
|
6002
5679
|
|
6003
5680
|
var FileItemView = Marionette.ItemView.extend({
|
6004
5681
|
tagName: 'li',
|
6005
|
-
template: template$
|
5682
|
+
template: template$t,
|
6006
5683
|
mixins: [loadable],
|
6007
5684
|
ui: {
|
6008
5685
|
fileName: '.file_name',
|
@@ -6023,7 +5700,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6023
5700
|
var result = this.options.selectionHandler.call(this.model);
|
6024
5701
|
|
6025
5702
|
if (result !== false) {
|
6026
|
-
editor
|
5703
|
+
editor.navigate(this.options.selectionHandler.getReferer(), {
|
6027
5704
|
trigger: true
|
6028
5705
|
});
|
6029
5706
|
}
|
@@ -6056,7 +5733,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6056
5733
|
itemViewConstructor: FileStageItemView
|
6057
5734
|
}));
|
6058
5735
|
|
6059
|
-
_
|
5736
|
+
_.each(this.metaDataViews(), function (view) {
|
6060
5737
|
this.ui.metaData.append(this.subview(view).el);
|
6061
5738
|
}, this);
|
6062
5739
|
},
|
@@ -6068,7 +5745,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6068
5745
|
this.$el.attr('data-id', this.model.id);
|
6069
5746
|
this.ui.fileName.text(this.model.get('file_name') || '(Unbekannt)');
|
6070
5747
|
this.ui.downloadLink.attr('href', this.model.get('original_url'));
|
6071
|
-
this.ui.downloads.toggle(this.model.isUploaded() && !_
|
5748
|
+
this.ui.downloads.toggle(this.model.isUploaded() && !_.isEmpty(this.model.get('original_url')));
|
6072
5749
|
this.ui.selectButton.toggle(!!this.options.selectionHandler);
|
6073
5750
|
this.ui.settingsButton.toggle(!this.model.isNew());
|
6074
5751
|
this.ui.cancelButton.toggle(this.model.isUploading());
|
@@ -6079,7 +5756,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6079
5756
|
},
|
6080
5757
|
metaDataViews: function metaDataViews() {
|
6081
5758
|
var model = this.model;
|
6082
|
-
return _
|
5759
|
+
return _.map(this.options.metaDataAttributes, function (options) {
|
6083
5760
|
if (typeof options === 'string') {
|
6084
5761
|
options = {
|
6085
5762
|
name: options,
|
@@ -6087,7 +5764,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6087
5764
|
};
|
6088
5765
|
}
|
6089
5766
|
|
6090
|
-
return new FileMetaDataItemView(_
|
5767
|
+
return new FileMetaDataItemView(_.extend({
|
6091
5768
|
model: model
|
6092
5769
|
}, options));
|
6093
5770
|
});
|
@@ -6108,7 +5785,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6108
5785
|
this.model.cancelUpload();
|
6109
5786
|
},
|
6110
5787
|
confirm: function confirm() {
|
6111
|
-
editor
|
5788
|
+
editor.navigate('/confirmable_files?type=' + this.model.modelName + '&id=' + this.model.id, {
|
6112
5789
|
trigger: true
|
6113
5790
|
});
|
6114
5791
|
},
|
@@ -6117,7 +5794,7 @@ var FileItemView = Marionette.ItemView.extend({
|
|
6117
5794
|
}
|
6118
5795
|
});
|
6119
5796
|
|
6120
|
-
function template$
|
5797
|
+
function template$u(data) {
|
6121
5798
|
var __t, __p = '';
|
6122
5799
|
__p += '<div class="filtered_files-banner">\n <span class="filtered_files-banner_prefix">\n ' +
|
6123
5800
|
((__t = ( I18n.t('pageflow.editor.views.filtered_files_view.banner_prefix') )) == null ? '' : __t) +
|
@@ -6136,7 +5813,7 @@ return __p
|
|
6136
5813
|
}
|
6137
5814
|
|
6138
5815
|
var FilteredFilesView = Marionette.ItemView.extend({
|
6139
|
-
template: template$
|
5816
|
+
template: template$u,
|
6140
5817
|
className: 'filtered_files',
|
6141
5818
|
ui: {
|
6142
5819
|
banner: '.filtered_files-banner',
|
@@ -6144,7 +5821,7 @@ var FilteredFilesView = Marionette.ItemView.extend({
|
|
6144
5821
|
},
|
6145
5822
|
events: {
|
6146
5823
|
'click .filtered_files-reset_filter': function clickFiltered_filesReset_filter() {
|
6147
|
-
editor
|
5824
|
+
editor.navigate('/files/' + this.options.fileType.collectionName, {
|
6148
5825
|
trigger: true
|
6149
5826
|
});
|
6150
5827
|
return false;
|
@@ -6200,7 +5877,7 @@ var FilteredFilesView = Marionette.ItemView.extend({
|
|
6200
5877
|
}
|
6201
5878
|
});
|
6202
5879
|
|
6203
|
-
function template$
|
5880
|
+
function template$v(data) {
|
6204
5881
|
var __t, __p = '';
|
6205
5882
|
__p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
|
6206
5883
|
((__t = ( I18n.t('pageflow.editor.views.files_view.importer.heading') )) == null ? '' : __t) +
|
@@ -6210,7 +5887,7 @@ __p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
|
|
6210
5887
|
return __p
|
6211
5888
|
}
|
6212
5889
|
|
6213
|
-
function template$
|
5890
|
+
function template$w(data) {
|
6214
5891
|
var __t, __p = '';
|
6215
5892
|
__p += '<button class=\'importer\' data-key=\'' +
|
6216
5893
|
((__t = ( data.fileImporter.key )) == null ? '' : __t) +
|
@@ -6225,7 +5902,7 @@ return __p
|
|
6225
5902
|
}
|
6226
5903
|
|
6227
5904
|
var ImporterSelectView = Marionette.ItemView.extend({
|
6228
|
-
template: template$
|
5905
|
+
template: template$w,
|
6229
5906
|
className: 'importer_select',
|
6230
5907
|
tagName: 'li',
|
6231
5908
|
events: {
|
@@ -6242,7 +5919,7 @@ var ImporterSelectView = Marionette.ItemView.extend({
|
|
6242
5919
|
});
|
6243
5920
|
|
6244
5921
|
var ChooseImporterView = Marionette.ItemView.extend({
|
6245
|
-
template: template$
|
5922
|
+
template: template$v,
|
6246
5923
|
className: 'choose_importer editor dialog',
|
6247
5924
|
mixins: [dialogView],
|
6248
5925
|
ui: {
|
@@ -6263,7 +5940,7 @@ var ChooseImporterView = Marionette.ItemView.extend({
|
|
6263
5940
|
},
|
6264
5941
|
onRender: function onRender() {
|
6265
5942
|
var self = this;
|
6266
|
-
editor
|
5943
|
+
editor.fileImporters.values().forEach(function (fileImporter) {
|
6267
5944
|
var importerSelectView = new ImporterSelectView({
|
6268
5945
|
importer: fileImporter,
|
6269
5946
|
parentView: self
|
@@ -6277,7 +5954,7 @@ ChooseImporterView.open = function (options) {
|
|
6277
5954
|
app.dialogRegion.show(new ChooseImporterView(options).render());
|
6278
5955
|
};
|
6279
5956
|
|
6280
|
-
function template$
|
5957
|
+
function template$x(data) {
|
6281
5958
|
var __t, __p = '';
|
6282
5959
|
__p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
|
6283
5960
|
((__t = ( I18n.t('pageflow.editor.file_importers.'+data.importerKey+'.dialog_label') )) == null ? '' : __t) +
|
@@ -6291,7 +5968,7 @@ __p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
|
|
6291
5968
|
return __p
|
6292
5969
|
}
|
6293
5970
|
|
6294
|
-
function template$
|
5971
|
+
function template$y(data) {
|
6295
5972
|
var __t, __p = '';
|
6296
5973
|
__p += '<div class="box">\n <h1 class="dialog-header">' +
|
6297
5974
|
((__t = ( I18n.t('pageflow.editor.templates.confirm_upload.header') )) == null ? '' : __t) +
|
@@ -6307,14 +5984,14 @@ __p += '<div class="box">\n <h1 class="dialog-header">' +
|
|
6307
5984
|
return __p
|
6308
5985
|
}
|
6309
5986
|
|
6310
|
-
function template$
|
5987
|
+
function template$z(data) {
|
6311
5988
|
var __p = '';
|
6312
5989
|
__p += '<h2></h2>\n';
|
6313
5990
|
return __p
|
6314
5991
|
}
|
6315
5992
|
|
6316
5993
|
var UploadableFilesView = Marionette.ItemView.extend({
|
6317
|
-
template: template$
|
5994
|
+
template: template$z,
|
6318
5995
|
className: 'uploadable_files',
|
6319
5996
|
ui: {
|
6320
5997
|
header: 'h2'
|
@@ -6351,8 +6028,8 @@ var UploadableFilesView = Marionette.ItemView.extend({
|
|
6351
6028
|
}];
|
6352
6029
|
},
|
6353
6030
|
fileTypeColumns: function fileTypeColumns() {
|
6354
|
-
return _
|
6355
|
-
return _
|
6031
|
+
return _(this.options.fileType.confirmUploadTableColumns).map(function (column) {
|
6032
|
+
return _.extend({}, column, {
|
6356
6033
|
configurationAttribute: true
|
6357
6034
|
});
|
6358
6035
|
});
|
@@ -6360,7 +6037,7 @@ var UploadableFilesView = Marionette.ItemView.extend({
|
|
6360
6037
|
});
|
6361
6038
|
|
6362
6039
|
var ConfirmFileImportUploadView = Marionette.Layout.extend({
|
6363
|
-
template: template$
|
6040
|
+
template: template$y,
|
6364
6041
|
className: 'confirm_upload editor dialog',
|
6365
6042
|
mixins: [dialogView],
|
6366
6043
|
regions: {
|
@@ -6380,15 +6057,11 @@ var ConfirmFileImportUploadView = Marionette.Layout.extend({
|
|
6380
6057
|
getSelectedFiles: function getSelectedFiles() {
|
6381
6058
|
var files = [];
|
6382
6059
|
|
6383
|
-
|
6384
|
-
if (
|
6385
|
-
|
6386
|
-
|
6387
|
-
if (collection.length > 0) {
|
6388
|
-
files = files.concat(collection.toJSON());
|
6389
|
-
}
|
6060
|
+
_.each(state.files, function (collection) {
|
6061
|
+
if (collection.length > 0) {
|
6062
|
+
files = files.concat(collection.toJSON());
|
6390
6063
|
}
|
6391
|
-
}
|
6064
|
+
});
|
6392
6065
|
|
6393
6066
|
return files;
|
6394
6067
|
},
|
@@ -6420,7 +6093,7 @@ var ConfirmFileImportUploadView = Marionette.Layout.extend({
|
|
6420
6093
|
var file = this.selection.get('file');
|
6421
6094
|
|
6422
6095
|
if (file) {
|
6423
|
-
this.selectedFileRegion.show(new
|
6096
|
+
this.selectedFileRegion.show(new EditFileView({
|
6424
6097
|
model: file
|
6425
6098
|
}));
|
6426
6099
|
} else {
|
@@ -6434,7 +6107,7 @@ ConfirmFileImportUploadView.open = function (options) {
|
|
6434
6107
|
};
|
6435
6108
|
|
6436
6109
|
var FilesImporterView = Marionette.ItemView.extend({
|
6437
|
-
template: template$
|
6110
|
+
template: template$x,
|
6438
6111
|
className: 'files_importer editor dialog',
|
6439
6112
|
mixins: [dialogView],
|
6440
6113
|
ui: {
|
@@ -6485,8 +6158,8 @@ var FilesImporterView = Marionette.ItemView.extend({
|
|
6485
6158
|
|
6486
6159
|
for (var i = 0; i < metaData.files.length; i++) {
|
6487
6160
|
var file = metaData.files[i];
|
6488
|
-
var fileType = editor
|
6489
|
-
|
6161
|
+
var fileType = editor.fileTypes.findByUpload(file);
|
6162
|
+
file = new fileType.model({
|
6490
6163
|
state: 'uploadable',
|
6491
6164
|
file_name: file.name,
|
6492
6165
|
content_type: file.type,
|
@@ -6500,7 +6173,7 @@ var FilesImporterView = Marionette.ItemView.extend({
|
|
6500
6173
|
}
|
6501
6174
|
|
6502
6175
|
ConfirmFileImportUploadView.open({
|
6503
|
-
fileTypes: editor
|
6176
|
+
fileTypes: editor.fileTypes,
|
6504
6177
|
fileImportModel: self.model,
|
6505
6178
|
files: state.files
|
6506
6179
|
});
|
@@ -6521,7 +6194,7 @@ FilesImporterView.open = function (options) {
|
|
6521
6194
|
app.dialogRegion.show(new FilesImporterView(options).render());
|
6522
6195
|
};
|
6523
6196
|
|
6524
|
-
function template$
|
6197
|
+
function template$A(data) {
|
6525
6198
|
var __t, __p = '';
|
6526
6199
|
__p += '<button class="">\n <span class="label">' +
|
6527
6200
|
((__t = ( I18n.t('pageflow.editor.templates.select_button.select') )) == null ? '' : __t) +
|
@@ -6530,7 +6203,7 @@ return __p
|
|
6530
6203
|
}
|
6531
6204
|
|
6532
6205
|
var SelectButtonView = Marionette.ItemView.extend({
|
6533
|
-
template: template$
|
6206
|
+
template: template$A,
|
6534
6207
|
className: 'select_button',
|
6535
6208
|
ui: {
|
6536
6209
|
button: 'button',
|
@@ -6565,7 +6238,7 @@ var SelectButtonView = Marionette.ItemView.extend({
|
|
6565
6238
|
}
|
6566
6239
|
});
|
6567
6240
|
|
6568
|
-
function template$
|
6241
|
+
function template$B(data) {
|
6569
6242
|
var __t, __p = '';
|
6570
6243
|
__p += '<a class="back">' +
|
6571
6244
|
((__t = ( I18n.t('pageflow.editor.templates.files.back') )) == null ? '' : __t) +
|
@@ -6574,7 +6247,7 @@ return __p
|
|
6574
6247
|
}
|
6575
6248
|
|
6576
6249
|
var FilesView = Marionette.ItemView.extend({
|
6577
|
-
template: template$
|
6250
|
+
template: template$B,
|
6578
6251
|
className: 'manage_files',
|
6579
6252
|
events: {
|
6580
6253
|
'click a.back': 'goBack',
|
@@ -6595,7 +6268,7 @@ var FilesView = Marionette.ItemView.extend({
|
|
6595
6268
|
}
|
6596
6269
|
}];
|
6597
6270
|
|
6598
|
-
if (editor
|
6271
|
+
if (editor.fileImporters.keys().length > 0) {
|
6599
6272
|
menuOptions.push({
|
6600
6273
|
label: I18n$1.t('pageflow.editor.views.files_view.import'),
|
6601
6274
|
handler: function handler() {
|
@@ -6622,7 +6295,7 @@ var FilesView = Marionette.ItemView.extend({
|
|
6622
6295
|
i18n: 'pageflow.editor.files.tabs',
|
6623
6296
|
defaultTab: this.options.tabName
|
6624
6297
|
});
|
6625
|
-
editor
|
6298
|
+
editor.fileTypes.each(function (fileType) {
|
6626
6299
|
if (fileType.topLevelType) {
|
6627
6300
|
this.tab(fileType);
|
6628
6301
|
}
|
@@ -6631,7 +6304,7 @@ var FilesView = Marionette.ItemView.extend({
|
|
6631
6304
|
},
|
6632
6305
|
tab: function tab(fileType) {
|
6633
6306
|
var selectionMode = this.options.tabName === fileType.collectionName;
|
6634
|
-
this.tabsView.tab(fileType.collectionName, _
|
6307
|
+
this.tabsView.tab(fileType.collectionName, _.bind(function () {
|
6635
6308
|
return this.subview(new FilteredFilesView({
|
6636
6309
|
entry: state.entry,
|
6637
6310
|
fileType: fileType,
|
@@ -6645,11 +6318,11 @@ var FilesView = Marionette.ItemView.extend({
|
|
6645
6318
|
},
|
6646
6319
|
goBack: function goBack() {
|
6647
6320
|
if (this.options.selectionHandler) {
|
6648
|
-
editor
|
6321
|
+
editor.navigate(this.options.selectionHandler.getReferer(), {
|
6649
6322
|
trigger: true
|
6650
6323
|
});
|
6651
6324
|
} else {
|
6652
|
-
editor
|
6325
|
+
editor.navigate('/', {
|
6653
6326
|
trigger: true
|
6654
6327
|
});
|
6655
6328
|
}
|
@@ -6659,14 +6332,14 @@ var FilesView = Marionette.ItemView.extend({
|
|
6659
6332
|
}
|
6660
6333
|
});
|
6661
6334
|
|
6662
|
-
function template$
|
6335
|
+
function template$C(data) {
|
6663
6336
|
var __p = '';
|
6664
6337
|
__p += '<div class="quota_state">\n</div>\n<div class="outlet">\n</div>\n<div class="exhausted_message">\n</div>\n';
|
6665
6338
|
return __p
|
6666
6339
|
}
|
6667
6340
|
|
6668
6341
|
var EntryPublicationQuotaDecoratorView = Marionette.Layout.extend({
|
6669
|
-
template: template$
|
6342
|
+
template: template$C,
|
6670
6343
|
className: 'quota_decorator',
|
6671
6344
|
regions: {
|
6672
6345
|
outlet: '.outlet'
|
@@ -6707,7 +6380,7 @@ var EntryPublicationQuotaDecoratorView = Marionette.Layout.extend({
|
|
6707
6380
|
}
|
6708
6381
|
});
|
6709
6382
|
|
6710
|
-
function template$
|
6383
|
+
function template$D(data) {
|
6711
6384
|
var __t, __p = '';
|
6712
6385
|
__p += '<div class="files_pending notice">\n <p>' +
|
6713
6386
|
((__t = ( I18n.t('pageflow.editor.templates.publish_entry.files_pending_notice') )) == null ? '' : __t) +
|
@@ -6754,7 +6427,7 @@ return __p
|
|
6754
6427
|
}
|
6755
6428
|
|
6756
6429
|
var PublishEntryView = Marionette.ItemView.extend({
|
6757
|
-
template: template$
|
6430
|
+
template: template$D,
|
6758
6431
|
className: 'publish_entry',
|
6759
6432
|
ui: {
|
6760
6433
|
publishUntilFields: '.publish_until_fields',
|
@@ -6949,14 +6622,14 @@ var PublishEntryView = Marionette.ItemView.extend({
|
|
6949
6622
|
this.enableSave();
|
6950
6623
|
},
|
6951
6624
|
checkForm: function checkForm() {
|
6952
|
-
if (_
|
6625
|
+
if (_.all([this.checkPublishUntil(), this.checkPassword()])) {
|
6953
6626
|
this.enableSave();
|
6954
6627
|
} else {
|
6955
6628
|
this.disableSave();
|
6956
6629
|
}
|
6957
6630
|
},
|
6958
6631
|
checkPublishUntil: function checkPublishUntil() {
|
6959
|
-
return this.ui.publishForeverRadioBox.is(':checked') || this.ui.publishUntilRadioBox.is(':checked') && _
|
6632
|
+
return this.ui.publishForeverRadioBox.is(':checked') || this.ui.publishUntilRadioBox.is(':checked') && _.all([this.checkPublishUntilDate(), this.checkPublishUntilTime()]);
|
6960
6633
|
},
|
6961
6634
|
checkPublishUntilDate: function checkPublishUntilDate() {
|
6962
6635
|
if (this.ui.publishUntilField.datepicker('getDate')) {
|
@@ -6991,7 +6664,7 @@ var PublishEntryView = Marionette.ItemView.extend({
|
|
6991
6664
|
},
|
6992
6665
|
randomPassword: function randomPassword() {
|
6993
6666
|
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
6994
|
-
return _
|
6667
|
+
return _(10).times(function () {
|
6995
6668
|
return possible.charAt(Math.floor(Math.random() * possible.length));
|
6996
6669
|
}).join('');
|
6997
6670
|
}
|
@@ -7020,11 +6693,11 @@ var SidebarController = Marionette.Controller.extend({
|
|
7020
6693
|
files: function files(collectionName, handler, payload, filterName) {
|
7021
6694
|
this.region.show(new FilesView({
|
7022
6695
|
model: this.entry,
|
7023
|
-
selectionHandler: handler && editor
|
6696
|
+
selectionHandler: handler && editor.createFileSelectionHandler(handler, payload),
|
7024
6697
|
tabName: collectionName,
|
7025
6698
|
filterName: filterName
|
7026
6699
|
}));
|
7027
|
-
editor
|
6700
|
+
editor.setDefaultHelpEntry('pageflow.help_entries.files');
|
7028
6701
|
},
|
7029
6702
|
confirmableFiles: function confirmableFiles(preselectedFileType, preselectedFileId) {
|
7030
6703
|
this.region.show(ConfirmEncodingView.create({
|
@@ -7039,8 +6712,8 @@ var SidebarController = Marionette.Controller.extend({
|
|
7039
6712
|
model: this.entry,
|
7040
6713
|
tab: tab,
|
7041
6714
|
state: state,
|
7042
|
-
features:
|
7043
|
-
editor: editor
|
6715
|
+
features: features,
|
6716
|
+
editor: editor
|
7044
6717
|
}));
|
7045
6718
|
},
|
7046
6719
|
publish: function publish() {
|
@@ -7048,35 +6721,7 @@ var SidebarController = Marionette.Controller.extend({
|
|
7048
6721
|
model: this.entry,
|
7049
6722
|
entryPublication: new EntryPublication()
|
7050
6723
|
}));
|
7051
|
-
editor
|
7052
|
-
},
|
7053
|
-
storyline: function storyline(id) {
|
7054
|
-
this.region.show(new EditStorylineView({
|
7055
|
-
model: this.entry.storylines.get(id)
|
7056
|
-
}));
|
7057
|
-
},
|
7058
|
-
chapter: function chapter(id) {
|
7059
|
-
this.region.show(new EditChapterView({
|
7060
|
-
model: this.entry.chapters.get(id)
|
7061
|
-
}));
|
7062
|
-
},
|
7063
|
-
page: function page(id, tab) {
|
7064
|
-
var page = this.entry.pages.get(id);
|
7065
|
-
this.region.show(new EditPageView({
|
7066
|
-
model: page,
|
7067
|
-
api: editor$1,
|
7068
|
-
tab: tab
|
7069
|
-
}));
|
7070
|
-
editor$1.setDefaultHelpEntry(page.pageType().help_entry_translation_key);
|
7071
|
-
},
|
7072
|
-
pageLink: function pageLink(linkId) {
|
7073
|
-
var pageId = linkId.split(':')[0];
|
7074
|
-
var page = state.pages.getByPermaId(pageId);
|
7075
|
-
this.region.show(new EditPageLinkView({
|
7076
|
-
model: page.pageLinks().get(linkId),
|
7077
|
-
page: page,
|
7078
|
-
api: editor$1
|
7079
|
-
}));
|
6724
|
+
editor.setDefaultHelpEntry('pageflow.help_entries.publish');
|
7080
6725
|
},
|
7081
6726
|
widget: function widget(id) {
|
7082
6727
|
this.region.show(new EditWidgetView({
|
@@ -7165,7 +6810,7 @@ var ScrollingView = Marionette.View.extend({
|
|
7165
6810
|
}
|
7166
6811
|
});
|
7167
6812
|
|
7168
|
-
function template$
|
6813
|
+
function template$E(data) {
|
7169
6814
|
var __t, __p = '';
|
7170
6815
|
__p += '<div class="box">\n <h2>' +
|
7171
6816
|
((__t = ( I18n.t('pageflow.editor.templates.help.title') )) == null ? '' : __t) +
|
@@ -7176,7 +6821,7 @@ return __p
|
|
7176
6821
|
}
|
7177
6822
|
|
7178
6823
|
var HelpView = Marionette.ItemView.extend({
|
7179
|
-
template: template$
|
6824
|
+
template: template$E,
|
7180
6825
|
className: 'help',
|
7181
6826
|
ui: {
|
7182
6827
|
placeholder: '.placeholder',
|
@@ -7213,7 +6858,7 @@ var HelpView = Marionette.ItemView.extend({
|
|
7213
6858
|
initialize: function initialize() {
|
7214
6859
|
this.listenTo(app, 'toggle-help', function (name) {
|
7215
6860
|
this.toggle();
|
7216
|
-
this.showSection(name || editor
|
6861
|
+
this.showSection(name || editor.defaultHelpEntry || this.defaultHelpEntry(), {
|
7217
6862
|
scrollIntoView: true
|
7218
6863
|
});
|
7219
6864
|
});
|
@@ -7253,7 +6898,7 @@ var PageThumbnailView = ModelThumbnailView.extend({
|
|
7253
6898
|
className: 'model_thumbnail page_thumbnail'
|
7254
6899
|
});
|
7255
6900
|
|
7256
|
-
function template$
|
6901
|
+
function template$F(data) {
|
7257
6902
|
var __t, __p = '';
|
7258
6903
|
__p += '<div>\n <span class="missing_page_thumbnail"></span>\n <span class="page_thumbnail"></span>\n <div class="title"></div>\n <div class="label"></div>\n <a class="remove" title="' +
|
7259
6904
|
((__t = ( I18n.t('pageflow.editor.templates.page_link_item.remove') )) == null ? '' : __t) +
|
@@ -7264,7 +6909,7 @@ return __p
|
|
7264
6909
|
}
|
7265
6910
|
|
7266
6911
|
var PageLinkItemView = Marionette.ItemView.extend({
|
7267
|
-
template: template$
|
6912
|
+
template: template$F,
|
7268
6913
|
tagName: 'li',
|
7269
6914
|
className: 'page_link',
|
7270
6915
|
ui: {
|
@@ -7276,7 +6921,7 @@ var PageLinkItemView = Marionette.ItemView.extend({
|
|
7276
6921
|
},
|
7277
6922
|
events: {
|
7278
6923
|
'click .edit': function clickEdit() {
|
7279
|
-
editor
|
6924
|
+
editor.navigate(this.model.editPath(), {
|
7280
6925
|
trigger: true
|
7281
6926
|
});
|
7282
6927
|
return false;
|
@@ -7314,7 +6959,7 @@ var PageLinkItemView = Marionette.ItemView.extend({
|
|
7314
6959
|
}
|
7315
6960
|
});
|
7316
6961
|
|
7317
|
-
function template$
|
6962
|
+
function template$G(data) {
|
7318
6963
|
var __t, __p = '';
|
7319
6964
|
__p += '<label>\n <span class="name">' +
|
7320
6965
|
((__t = ( I18n.t('pageflow.editor.templates.page_links.label') )) == null ? '' : __t) +
|
@@ -7325,7 +6970,7 @@ return __p
|
|
7325
6970
|
}
|
7326
6971
|
|
7327
6972
|
var PageLinksView = Marionette.ItemView.extend({
|
7328
|
-
template: template$
|
6973
|
+
template: template$G,
|
7329
6974
|
className: 'page_links',
|
7330
6975
|
ui: {
|
7331
6976
|
links: 'ul.links',
|
@@ -7334,7 +6979,7 @@ var PageLinksView = Marionette.ItemView.extend({
|
|
7334
6979
|
events: {
|
7335
6980
|
'click .add_link': function clickAdd_link() {
|
7336
6981
|
var view = this;
|
7337
|
-
editor
|
6982
|
+
editor.selectPage().then(function (page) {
|
7338
6983
|
view.model.pageLinks().addLink(page.get('perma_id'));
|
7339
6984
|
});
|
7340
6985
|
return false;
|
@@ -7361,61 +7006,48 @@ var PageLinksView = Marionette.ItemView.extend({
|
|
7361
7006
|
}
|
7362
7007
|
});
|
7363
7008
|
|
7364
|
-
function template$
|
7365
|
-
var
|
7366
|
-
__p += '<div class="emulation_mode_button-
|
7367
|
-
((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.header') )) == null ? '' : __t) +
|
7368
|
-
'\n </div>\n <ul>\n <li class="emulation_mode_button-menu_item emulation_mode_button-desktop">\n <a class="emulation_mode_button-menu_link">\n ' +
|
7369
|
-
((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.desktop') )) == null ? '' : __t) +
|
7370
|
-
'\n </a>\n </li>\n <li class="emulation_mode_button-menu_item emulation_mode_button-phone">\n <a class="emulation_mode_button-menu_link">\n ' +
|
7371
|
-
((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.phone') )) == null ? '' : __t) +
|
7372
|
-
'\n <div class="emulation_mode_button-disabled_hint">\n ' +
|
7373
|
-
((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.disabled_hint') )) == null ? '' : __t) +
|
7374
|
-
'\n </div>\n </a>\n </li>\n </ul>\n</div>\n<div class="emulation_mode_button-display emulation_mode_button-desktop">\n ' +
|
7375
|
-
((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.desktop') )) == null ? '' : __t) +
|
7376
|
-
'\n</div>\n<div class="emulation_mode_button-display emulation_mode_button-phone">\n ' +
|
7377
|
-
((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.phone') )) == null ? '' : __t) +
|
7378
|
-
'\n</div>\n';
|
7009
|
+
function template$H(data) {
|
7010
|
+
var __p = '';
|
7011
|
+
__p += '<div class="emulation_mode_button-wrapper"\n data-tooltip-align="top center">\n <div class="emulation_mode_button-desktop_icon"/>\n <div class="emulation_mode_button-phone_icon"/>\n <div class="emulation_mode_button-track" />\n <div class="emulation_mode_button-thumb" />\n</div>\n';
|
7379
7012
|
return __p
|
7380
7013
|
}
|
7381
7014
|
|
7382
7015
|
var EmulationModeButtonView = Marionette.ItemView.extend({
|
7383
|
-
template: template$
|
7016
|
+
template: template$H,
|
7384
7017
|
className: 'emulation_mode_button',
|
7018
|
+
mixins: [tooltipContainer],
|
7385
7019
|
ui: {
|
7386
|
-
|
7387
|
-
|
7388
|
-
|
7389
|
-
desktopDisplay: '.emulation_mode_button-display.emulation_mode_button-desktop'
|
7020
|
+
wrapper: '.emulation_mode_button-wrapper',
|
7021
|
+
desktopIcon: '.emulation_mode_button-desktop_icon',
|
7022
|
+
phoneIcon: '.emulation_mode_button-phone_icon'
|
7390
7023
|
},
|
7391
7024
|
events: {
|
7392
|
-
'click
|
7393
|
-
this.model.
|
7394
|
-
},
|
7395
|
-
'click .emulation_mode_button-phone a': function clickEmulation_mode_buttonPhoneA() {
|
7396
|
-
if (!this.model.get('current_page_supports_emulation_mode')) {
|
7025
|
+
'click': function click() {
|
7026
|
+
if (this.model.get('emulation_mode_disabled')) {
|
7397
7027
|
return;
|
7398
7028
|
}
|
7399
7029
|
|
7400
|
-
this.model.
|
7030
|
+
if (this.model.has('emulation_mode')) {
|
7031
|
+
this.model.unset('emulation_mode');
|
7032
|
+
} else {
|
7033
|
+
this.model.set('emulation_mode', 'phone');
|
7034
|
+
}
|
7401
7035
|
}
|
7402
7036
|
},
|
7403
7037
|
modelEvents: {
|
7404
|
-
'change:emulation_mode change:
|
7038
|
+
'change:emulation_mode change:emulation_mode_disabled': 'update'
|
7405
7039
|
},
|
7406
7040
|
onRender: function onRender() {
|
7407
7041
|
this.update();
|
7408
7042
|
},
|
7409
7043
|
update: function update() {
|
7410
|
-
this.
|
7411
|
-
this.
|
7412
|
-
this.ui.
|
7413
|
-
this.ui.phoneDisplay.toggleClass('active', this.model.has('emulation_mode'));
|
7414
|
-
this.ui.desktopDisplay.toggleClass('active', !this.model.has('emulation_mode'));
|
7044
|
+
this.$el.toggleClass('disabled', !!this.model.get('emulation_mode_disabled'));
|
7045
|
+
this.$el.toggleClass('active', this.model.has('emulation_mode'));
|
7046
|
+
this.ui.wrapper.attr('data-tooltip', this.model.get('emulation_mode_disabled') ? 'pageflow.editor.templates.emulation_mode_button.disabled_hint' : 'pageflow.editor.templates.emulation_mode_button.tooltip');
|
7415
7047
|
}
|
7416
7048
|
});
|
7417
7049
|
|
7418
|
-
function template$
|
7050
|
+
function template$I(data) {
|
7419
7051
|
var __t, __p = '';
|
7420
7052
|
__p +=
|
7421
7053
|
((__t = ( I18n.t('pageflow.editor.templates.help_button.open_help') )) == null ? '' : __t);
|
@@ -7423,7 +7055,7 @@ return __p
|
|
7423
7055
|
}
|
7424
7056
|
|
7425
7057
|
var HelpButtonView = Marionette.ItemView.extend({
|
7426
|
-
template: template$
|
7058
|
+
template: template$I,
|
7427
7059
|
className: 'help_button',
|
7428
7060
|
events: {
|
7429
7061
|
'click': function click() {
|
@@ -7435,7 +7067,7 @@ var HelpButtonView = Marionette.ItemView.extend({
|
|
7435
7067
|
var SidebarFooterView = Marionette.View.extend({
|
7436
7068
|
className: 'sidebar_footer',
|
7437
7069
|
render: function render() {
|
7438
|
-
if (
|
7070
|
+
if (this.model.supportsPhoneEmulation()) {
|
7439
7071
|
this.appendSubview(new EmulationModeButtonView({
|
7440
7072
|
model: this.model
|
7441
7073
|
}));
|
@@ -7463,7 +7095,7 @@ var InfoBoxView = Marionette.View.extend({
|
|
7463
7095
|
}
|
7464
7096
|
});
|
7465
7097
|
|
7466
|
-
function template$
|
7098
|
+
function template$J(data) {
|
7467
7099
|
var __t, __p = '';
|
7468
7100
|
__p += '<span class="list_item_thumbnail"></span>\n<span class="list_item_missing_thumbnail"></span>\n<span class="list_item_type_pictogram type_pictogram"></span>\n\n<div class="list_item_title"></div>\n<div class="list_item_description"></div>\n\n<div class="list_item_buttons">\n <a class="list_item_edit_button" title="' +
|
7469
7101
|
((__t = ( I18n.t('pageflow.editor.templates.list_item.edit') )) == null ? '' : __t) +
|
@@ -7474,7 +7106,7 @@ return __p
|
|
7474
7106
|
}
|
7475
7107
|
|
7476
7108
|
var ListItemView = Marionette.ItemView.extend({
|
7477
|
-
template: template$
|
7109
|
+
template: template$J,
|
7478
7110
|
tagName: 'li',
|
7479
7111
|
className: 'list_item',
|
7480
7112
|
ui: {
|
@@ -7548,7 +7180,7 @@ var ListItemView = Marionette.ItemView.extend({
|
|
7548
7180
|
}
|
7549
7181
|
});
|
7550
7182
|
|
7551
|
-
function template$
|
7183
|
+
function template$K(data) {
|
7552
7184
|
var __t, __p = '';
|
7553
7185
|
__p += '<div class="checking notice">\n <p>' +
|
7554
7186
|
((__t = ( I18n.t('pageflow.editor.templates.locked.loading') )) == null ? '' : __t) +
|
@@ -7563,7 +7195,7 @@ return __p
|
|
7563
7195
|
}
|
7564
7196
|
|
7565
7197
|
var LockedView = Marionette.ItemView.extend({
|
7566
|
-
template: template$
|
7198
|
+
template: template$K,
|
7567
7199
|
className: 'locked checking',
|
7568
7200
|
ui: {
|
7569
7201
|
breakButton: '.break',
|
@@ -7604,7 +7236,7 @@ var LockedView = Marionette.ItemView.extend({
|
|
7604
7236
|
});
|
7605
7237
|
|
7606
7238
|
var EditorView = Backbone.View.extend({
|
7607
|
-
scrollNavigationKeys: _
|
7239
|
+
scrollNavigationKeys: _.values({
|
7608
7240
|
pageUp: 33,
|
7609
7241
|
pageDown: 34,
|
7610
7242
|
end: 35,
|
@@ -7726,7 +7358,7 @@ var LazyVideoEmbeddedView = Marionette.View.extend({
|
|
7726
7358
|
},
|
7727
7359
|
render: function render() {
|
7728
7360
|
this.videoPlayer = this.$el.data('videoPlayer');
|
7729
|
-
this.videoPlayer.ready(_
|
7361
|
+
this.videoPlayer.ready(_.bind(function () {
|
7730
7362
|
this.videoPlayer.src(this.model.getVideoFileSources(this.options.propertyName));
|
7731
7363
|
}, this));
|
7732
7364
|
this.update();
|
@@ -7756,7 +7388,7 @@ var LazyVideoEmbeddedView = Marionette.View.extend({
|
|
7756
7388
|
}
|
7757
7389
|
});
|
7758
7390
|
|
7759
|
-
function template$
|
7391
|
+
function template$L(data) {
|
7760
7392
|
var __t, __p = '';
|
7761
7393
|
__p += '<li class="uploading"><span class="count">0</span>' +
|
7762
7394
|
((__t = ( I18n.t('pageflow.editor.templates.notification.upload_pending') )) == null ? '' : __t) +
|
@@ -7779,7 +7411,7 @@ return __p
|
|
7779
7411
|
var NotificationsView = Marionette.ItemView.extend({
|
7780
7412
|
className: 'notifications',
|
7781
7413
|
tagName: 'ul',
|
7782
|
-
template: template$
|
7414
|
+
template: template$L,
|
7783
7415
|
ui: {
|
7784
7416
|
failedCount: '.failed .count',
|
7785
7417
|
uploadingCount: '.uploading .count',
|
@@ -7787,23 +7419,23 @@ var NotificationsView = Marionette.ItemView.extend({
|
|
7787
7419
|
},
|
7788
7420
|
events: {
|
7789
7421
|
'click .retry': function clickRetry() {
|
7790
|
-
editor
|
7422
|
+
editor.failures.retry();
|
7791
7423
|
}
|
7792
7424
|
},
|
7793
7425
|
onRender: function onRender() {
|
7794
7426
|
this.listenTo(state.entry, 'change:uploading_files_count', this.notifyUploadCount);
|
7795
7427
|
this.listenTo(state.entry, 'change:confirmable_files_count', this.notifyConfirmableFilesCount);
|
7796
|
-
this.listenTo(editor
|
7797
|
-
this.listenTo(editor
|
7798
|
-
this.listenTo(editor
|
7799
|
-
this.listenTo(editor
|
7428
|
+
this.listenTo(editor.savingRecords, 'add', this.update);
|
7429
|
+
this.listenTo(editor.savingRecords, 'remove', this.update);
|
7430
|
+
this.listenTo(editor.failures, 'add', this.update);
|
7431
|
+
this.listenTo(editor.failures, 'remove', this.update);
|
7800
7432
|
this.update();
|
7801
7433
|
this.notifyConfirmableFilesCount();
|
7802
7434
|
},
|
7803
7435
|
update: function update() {
|
7804
|
-
this.$el.toggleClass('failed', !editor
|
7805
|
-
this.$el.toggleClass('saving', !editor
|
7806
|
-
this.ui.failedCount.text(editor
|
7436
|
+
this.$el.toggleClass('failed', !editor.failures.isEmpty());
|
7437
|
+
this.$el.toggleClass('saving', !editor.savingRecords.isEmpty());
|
7438
|
+
this.ui.failedCount.text(editor.failures.count());
|
7807
7439
|
},
|
7808
7440
|
notifyUploadCount: function notifyUploadCount(model, uploadCount) {
|
7809
7441
|
this.$el.toggleClass('uploading', uploadCount > 0);
|
@@ -7821,7 +7453,7 @@ var FileProcessingStateDisplayView = Marionette.View.extend({
|
|
7821
7453
|
mixins: [inputView],
|
7822
7454
|
initialize: function initialize() {
|
7823
7455
|
if (typeof this.options.collection === 'string') {
|
7824
|
-
this.options.collection = state.entry.getFileCollection(editor
|
7456
|
+
this.options.collection = state.entry.getFileCollection(editor.fileTypes.findByCollectionName(this.options.collection));
|
7825
7457
|
}
|
7826
7458
|
|
7827
7459
|
this.listenTo(this.model, 'change:' + this.options.propertyName, this._update);
|
@@ -7866,14 +7498,14 @@ var FileProcessingStateDisplayView = Marionette.View.extend({
|
|
7866
7498
|
}
|
7867
7499
|
});
|
7868
7500
|
|
7869
|
-
function template$
|
7501
|
+
function template$M(data) {
|
7870
7502
|
var __p = '';
|
7871
7503
|
__p += '<h2></h2>\n';
|
7872
7504
|
return __p
|
7873
7505
|
}
|
7874
7506
|
|
7875
7507
|
var NestedFilesView = Marionette.ItemView.extend({
|
7876
|
-
template: template$
|
7508
|
+
template: template$M,
|
7877
7509
|
className: 'nested_files',
|
7878
7510
|
ui: {
|
7879
7511
|
header: 'h2'
|
@@ -7908,8 +7540,8 @@ var NestedFilesView = Marionette.ItemView.extend({
|
|
7908
7540
|
this.$el.toggleClass('is_empty', this.collection.length === 0);
|
7909
7541
|
},
|
7910
7542
|
columns: function columns(fileType) {
|
7911
|
-
var nestedFilesColumns = _
|
7912
|
-
return _
|
7543
|
+
var nestedFilesColumns = _(fileType.nestedFileTableColumns).map(function (column) {
|
7544
|
+
return _.extend({}, column, {
|
7913
7545
|
configurationAttribute: true
|
7914
7546
|
});
|
7915
7547
|
});
|
@@ -7936,7 +7568,7 @@ var NestedFilesView = Marionette.ItemView.extend({
|
|
7936
7568
|
this.options.selection.set('file', nextFile);
|
7937
7569
|
}
|
7938
7570
|
},
|
7939
|
-
setNextFile: _
|
7571
|
+
setNextFile: _.debounce(function () {
|
7940
7572
|
var fileIndex = this.collection.indexOf(this.options.selection.get('file'));
|
7941
7573
|
|
7942
7574
|
if (typeof this.collection.at(fileIndex + 1) !== 'undefined') {
|
@@ -7949,7 +7581,7 @@ var NestedFilesView = Marionette.ItemView.extend({
|
|
7949
7581
|
}, 200)
|
7950
7582
|
});
|
7951
7583
|
|
7952
|
-
function template$
|
7584
|
+
function template$N(data) {
|
7953
7585
|
var __t, __p = '';
|
7954
7586
|
__p += '<div class="text_tracks_container">\n <div class="files_upload_panel">\n <div class="files_panel">\n </div>\n <a class="upload" href="">' +
|
7955
7587
|
((__t = ( I18n.t('pageflow.editor.templates.text_tracks.upload') )) == null ? '' : __t) +
|
@@ -7960,7 +7592,7 @@ return __p
|
|
7960
7592
|
}
|
7961
7593
|
|
7962
7594
|
var TextTracksView = Marionette.Layout.extend({
|
7963
|
-
template: template$
|
7595
|
+
template: template$N,
|
7964
7596
|
className: 'text_tracks',
|
7965
7597
|
regions: {
|
7966
7598
|
selectedFileRegion: '.selected_file_region'
|
@@ -7980,17 +7612,17 @@ var TextTracksView = Marionette.Layout.extend({
|
|
7980
7612
|
onRender: function onRender() {
|
7981
7613
|
this.nestedFilesView = new NestedFilesView({
|
7982
7614
|
collection: this.model.nestedFiles(this.options.supersetCollection),
|
7983
|
-
fileType: editor
|
7615
|
+
fileType: editor.fileTypes.findByCollectionName('text_track_files'),
|
7984
7616
|
selection: this.selection,
|
7985
7617
|
model: this.model,
|
7986
7618
|
tableBlankSlateText: I18n$1.t('pageflow.editor.nested_files.text_track_files.no_files_blank_slate')
|
7987
7619
|
});
|
7988
7620
|
this.ui.filesPanel.append(this.subview(this.nestedFilesView).el);
|
7989
7621
|
this.update();
|
7990
|
-
editor
|
7622
|
+
editor.setUploadTargetFile(this.model);
|
7991
7623
|
},
|
7992
7624
|
onClose: function onClose() {
|
7993
|
-
editor
|
7625
|
+
editor.setUploadTargetFile(undefined);
|
7994
7626
|
},
|
7995
7627
|
update: function update() {
|
7996
7628
|
var selectedFile = this.selection.get('file');
|
@@ -8023,29 +7655,7 @@ var TextTracksFileMetaDataItemValueView = FileMetaDataItemValueView.extend({
|
|
8023
7655
|
}
|
8024
7656
|
});
|
8025
7657
|
|
8026
|
-
|
8027
|
-
className: 'disabled_atmo_indicator',
|
8028
|
-
events: {
|
8029
|
-
'click': function click() {
|
8030
|
-
pageflow.atmo.enable();
|
8031
|
-
}
|
8032
|
-
},
|
8033
|
-
initialize: function initialize() {
|
8034
|
-
this.listenTo(pageflow.events, 'atmo:disabled', function () {
|
8035
|
-
this.$el.show();
|
8036
|
-
});
|
8037
|
-
this.listenTo(pageflow.events, 'atmo:enabled', function () {
|
8038
|
-
this.$el.hide();
|
8039
|
-
});
|
8040
|
-
this.$el.toggle(!!pageflow.atmo && pageflow.atmo.disabled);
|
8041
|
-
},
|
8042
|
-
render: function render() {
|
8043
|
-
this.$el.attr('title', I18n$1.t('pageflow.editor.atmo.disabled'));
|
8044
|
-
return this;
|
8045
|
-
}
|
8046
|
-
});
|
8047
|
-
|
8048
|
-
function template$S(data) {
|
7658
|
+
function template$O(data) {
|
8049
7659
|
var __p = '';
|
8050
7660
|
__p += '<label>\n <span class="list_label"></span>\n</label>\n\n<ul class="list_items"></ul>\n';
|
8051
7661
|
return __p
|
@@ -8092,7 +7702,7 @@ return __p
|
|
8092
7702
|
*/
|
8093
7703
|
|
8094
7704
|
var ListView = Marionette.ItemView.extend({
|
8095
|
-
template: template$
|
7705
|
+
template: template$O,
|
8096
7706
|
className: 'list',
|
8097
7707
|
ui: {
|
8098
7708
|
label: '.list_label',
|
@@ -8104,12 +7714,12 @@ var ListView = Marionette.ItemView.extend({
|
|
8104
7714
|
el: this.ui.items,
|
8105
7715
|
collection: this.collection,
|
8106
7716
|
itemViewConstructor: ListItemView,
|
8107
|
-
itemViewOptions: _
|
7717
|
+
itemViewOptions: _.extend({
|
8108
7718
|
description: this.options.itemDescription,
|
8109
7719
|
typeName: this.options.itemTypeName,
|
8110
7720
|
typeDescription: this.options.itemTypeDescription,
|
8111
7721
|
isInvalid: this.options.itemIsInvalid
|
8112
|
-
}, _
|
7722
|
+
}, _(this.options).pick('onEdit', 'onRemove', 'highlight')),
|
8113
7723
|
blankSlateViewConstructor: Marionette.ItemView.extend({
|
8114
7724
|
tagName: 'li',
|
8115
7725
|
className: 'list_blank_slate',
|
@@ -8122,7 +7732,7 @@ var ListView = Marionette.ItemView.extend({
|
|
8122
7732
|
});
|
8123
7733
|
|
8124
7734
|
var ConfirmUploadView = Marionette.Layout.extend({
|
8125
|
-
template: template$
|
7735
|
+
template: template$y,
|
8126
7736
|
className: 'confirm_upload editor dialog',
|
8127
7737
|
mixins: [dialogView],
|
8128
7738
|
regions: {
|
@@ -8211,6 +7821,9 @@ ConfirmUploadView.open = function (options) {
|
|
8211
7821
|
* * `<translationKeyPrefix>.retry` (optional): Label of the retry
|
8212
7822
|
* button of the failure message.
|
8213
7823
|
*
|
7824
|
+
* Override the `destroyModel` method to customize destroy behavior.
|
7825
|
+
* Calls `destroyWithDelay` by default.
|
7826
|
+
*
|
8214
7827
|
* @param {Object} options
|
8215
7828
|
* @param {Backbone.Model} options.model -
|
8216
7829
|
* Model including the {@link configurationContainer},
|
@@ -8243,7 +7856,7 @@ var EditConfigurationView = Marionette.Layout.extend({
|
|
8243
7856
|
'click a.destroy': 'destroy'
|
8244
7857
|
},
|
8245
7858
|
onRender: function onRender() {
|
8246
|
-
var translationKeyPrefix = _
|
7859
|
+
var translationKeyPrefix = _.result(this, 'translationKeyPrefix');
|
8247
7860
|
|
8248
7861
|
this.configurationEditor = new ConfigurationEditorView({
|
8249
7862
|
tabTranslationKeyPrefix: "".concat(translationKeyPrefix, ".tabs"),
|
@@ -8258,17 +7871,21 @@ var EditConfigurationView = Marionette.Layout.extend({
|
|
8258
7871
|
},
|
8259
7872
|
destroy: function destroy() {
|
8260
7873
|
if (window.confirm(this.t('confirm_destroy'))) {
|
8261
|
-
this.
|
8262
|
-
|
7874
|
+
if (this.destroyModel() !== false) {
|
7875
|
+
this.goBack();
|
7876
|
+
}
|
8263
7877
|
}
|
8264
7878
|
},
|
7879
|
+
destroyModel: function destroyModel() {
|
7880
|
+
this.model.destroyWithDelay();
|
7881
|
+
},
|
8265
7882
|
goBack: function goBack() {
|
8266
|
-
editor
|
7883
|
+
editor.navigate('/', {
|
8267
7884
|
trigger: true
|
8268
7885
|
});
|
8269
7886
|
},
|
8270
7887
|
t: function t(suffix) {
|
8271
|
-
var translationKeyPrefix = _
|
7888
|
+
var translationKeyPrefix = _.result(this, 'translationKeyPrefix');
|
8272
7889
|
|
8273
7890
|
return I18n$1.t("".concat(translationKeyPrefix, ".").concat(suffix), {
|
8274
7891
|
defaultValue: I18n$1.t("pageflow.editor.views.edit_configuration.".concat(suffix))
|
@@ -8276,245 +7893,7 @@ var EditConfigurationView = Marionette.Layout.extend({
|
|
8276
7893
|
}
|
8277
7894
|
});
|
8278
7895
|
|
8279
|
-
|
8280
|
-
configure: function configure() {
|
8281
|
-
this.tab('general', function () {
|
8282
|
-
this.group('general', {
|
8283
|
-
supportsTextPositionCenter: true
|
8284
|
-
});
|
8285
|
-
this.input('additional_title', TextInputView);
|
8286
|
-
this.input('additional_description', TextAreaInputView, {
|
8287
|
-
size: 'short'
|
8288
|
-
});
|
8289
|
-
});
|
8290
|
-
this.tab('files', function () {
|
8291
|
-
this.input('audio_file_id', FileInputView, {
|
8292
|
-
collection: state.audioFiles,
|
8293
|
-
defaultTextTrackFilePropertyName: 'default_text_track_file_id'
|
8294
|
-
});
|
8295
|
-
this.group('background');
|
8296
|
-
this.input('thumbnail_image_id', FileInputView, {
|
8297
|
-
collection: state.imageFiles,
|
8298
|
-
positioning: false
|
8299
|
-
});
|
8300
|
-
});
|
8301
|
-
this.tab('options', function () {
|
8302
|
-
if (pageflow.features.isEnabled('waveform_player_controls')) {
|
8303
|
-
this.input('audio_player_controls_variant', SelectInputView, {
|
8304
|
-
values: ['default', 'waveform']
|
8305
|
-
});
|
8306
|
-
}
|
8307
|
-
|
8308
|
-
this.input('waveform_color', ColorInputView, {
|
8309
|
-
visibleBinding: 'audio_player_controls_variant',
|
8310
|
-
visibleBindingValue: 'waveform',
|
8311
|
-
defaultValue: pageflow.theme.mainColor(),
|
8312
|
-
swatches: usedWaveformColors()
|
8313
|
-
});
|
8314
|
-
this.input('autoplay', CheckBoxInputView);
|
8315
|
-
this.group('options', {
|
8316
|
-
canPauseAtmo: true
|
8317
|
-
});
|
8318
|
-
});
|
8319
|
-
|
8320
|
-
function usedWaveformColors() {
|
8321
|
-
return _$1.chain(state.pages.map(function (page) {
|
8322
|
-
return page.configuration.get('waveform_color');
|
8323
|
-
})).uniq().compact().value();
|
8324
|
-
}
|
8325
|
-
}
|
8326
|
-
});
|
8327
|
-
|
8328
|
-
ConfigurationEditorView.register('background_image', {
|
8329
|
-
configure: function configure() {
|
8330
|
-
this.tab('general', function () {
|
8331
|
-
this.group('general', {
|
8332
|
-
supportsTextPositionCenter: true
|
8333
|
-
});
|
8334
|
-
});
|
8335
|
-
this.tab('files', function () {
|
8336
|
-
this.group('background');
|
8337
|
-
this.input('thumbnail_image_id', FileInputView, {
|
8338
|
-
collection: state.imageFiles,
|
8339
|
-
positioning: false
|
8340
|
-
});
|
8341
|
-
});
|
8342
|
-
this.tab('options', function () {
|
8343
|
-
this.group('options');
|
8344
|
-
});
|
8345
|
-
}
|
8346
|
-
});
|
8347
|
-
|
8348
|
-
ConfigurationEditorView.register('video', {
|
8349
|
-
configure: function configure() {
|
8350
|
-
this.tab('general', function () {
|
8351
|
-
this.group('general', {
|
8352
|
-
supportsTextPositionCenter: true
|
8353
|
-
});
|
8354
|
-
this.input('additional_title', TextInputView);
|
8355
|
-
this.input('additional_description', TextAreaInputView, {
|
8356
|
-
size: 'short'
|
8357
|
-
});
|
8358
|
-
});
|
8359
|
-
this.tab('files', function () {
|
8360
|
-
this.input('video_file_id', FileInputView, {
|
8361
|
-
collection: state.videoFiles,
|
8362
|
-
positioning: false,
|
8363
|
-
defaultTextTrackFilePropertyName: 'default_text_track_file_id'
|
8364
|
-
});
|
8365
|
-
this.input('poster_image_id', FileInputView, {
|
8366
|
-
collection: state.imageFiles,
|
8367
|
-
positioning: false
|
8368
|
-
});
|
8369
|
-
this.input('mobile_poster_image_id', FileInputView, {
|
8370
|
-
collection: state.imageFiles,
|
8371
|
-
positioning: true
|
8372
|
-
});
|
8373
|
-
this.input('thumbnail_image_id', FileInputView, {
|
8374
|
-
collection: state.imageFiles,
|
8375
|
-
positioning: false
|
8376
|
-
});
|
8377
|
-
});
|
8378
|
-
this.tab('options', function () {
|
8379
|
-
this.input('autoplay', CheckBoxInputView);
|
8380
|
-
|
8381
|
-
if (pageflow.features.isEnabled('auto_change_page')) {
|
8382
|
-
this.input('auto_change_page_on_ended', CheckBoxInputView);
|
8383
|
-
}
|
8384
|
-
|
8385
|
-
this.group('options', {
|
8386
|
-
canPauseAtmo: true
|
8387
|
-
});
|
8388
|
-
});
|
8389
|
-
}
|
8390
|
-
});
|
8391
|
-
|
8392
|
-
ConfigurationEditorTabView.groups.define('background', function (options) {
|
8393
|
-
options = options || {};
|
8394
|
-
var prefix = options.propertyNamePrefix ? options.propertyNamePrefix + '_' : '';
|
8395
|
-
var backgroundTypeProperty = prefix + 'background_type';
|
8396
|
-
this.input(backgroundTypeProperty, SelectInputView, {
|
8397
|
-
values: ['image', 'video'],
|
8398
|
-
ensureValueDefined: true
|
8399
|
-
});
|
8400
|
-
this.input(prefix + 'background_image_id', FileInputView, {
|
8401
|
-
collection: state.imageFiles,
|
8402
|
-
visibleBinding: backgroundTypeProperty,
|
8403
|
-
visibleBindingValue: 'image',
|
8404
|
-
fileSelectionHandlerOptions: options
|
8405
|
-
});
|
8406
|
-
this.input(prefix + 'video_file_id', FileInputView, {
|
8407
|
-
collection: state.videoFiles,
|
8408
|
-
visibleBinding: backgroundTypeProperty,
|
8409
|
-
visibleBindingValue: 'video',
|
8410
|
-
fileSelectionHandlerOptions: options
|
8411
|
-
});
|
8412
|
-
this.input(prefix + 'poster_image_id', FileInputView, {
|
8413
|
-
collection: state.imageFiles,
|
8414
|
-
visibleBinding: backgroundTypeProperty,
|
8415
|
-
visibleBindingValue: 'video',
|
8416
|
-
fileSelectionHandlerOptions: options
|
8417
|
-
});
|
8418
|
-
this.input(prefix + 'mobile_poster_image_id', FileInputView, {
|
8419
|
-
collection: state.imageFiles,
|
8420
|
-
visibleBinding: backgroundTypeProperty,
|
8421
|
-
visibleBindingValue: 'video',
|
8422
|
-
fileSelectionHandlerOptions: options
|
8423
|
-
});
|
8424
|
-
});
|
8425
|
-
|
8426
|
-
ConfigurationEditorTabView.groups.define('general', function (options) {
|
8427
|
-
this.input('title', TextInputView, {
|
8428
|
-
required: true,
|
8429
|
-
maxLength: 5000
|
8430
|
-
});
|
8431
|
-
this.input('hide_title', CheckBoxInputView);
|
8432
|
-
this.input('tagline', TextInputView, {
|
8433
|
-
maxLength: 5000
|
8434
|
-
});
|
8435
|
-
this.input('subtitle', TextInputView, {
|
8436
|
-
maxLength: 5000
|
8437
|
-
});
|
8438
|
-
this.input('text', TextAreaInputView, {
|
8439
|
-
fragmentLinkInputView: PageLinkInputView,
|
8440
|
-
enableLists: true
|
8441
|
-
});
|
8442
|
-
this.input('text_position', SelectInputView, {
|
8443
|
-
values: options.supportsTextPositionCenter ? Page.textPositions : Page.textPositionsWithoutCenterOption
|
8444
|
-
});
|
8445
|
-
this.input('gradient_opacity', SliderInputView);
|
8446
|
-
this.input('invert', CheckBoxInputView);
|
8447
|
-
});
|
8448
|
-
|
8449
|
-
ConfigurationEditorTabView.groups.define('page_link', function () {
|
8450
|
-
this.input('label', TextInputView);
|
8451
|
-
this.input('target_page_id', PageLinkInputView);
|
8452
|
-
this.group('page_transitions', {
|
8453
|
-
includeBlank: true
|
8454
|
-
});
|
8455
|
-
});
|
8456
|
-
|
8457
|
-
ConfigurationEditorTabView.groups.define('page_transitions', function (options) {
|
8458
|
-
var inputOptions = {
|
8459
|
-
translationKeyPrefix: 'pageflow.page_transitions',
|
8460
|
-
blankTranslationKey: 'pageflow.page_transitions.default',
|
8461
|
-
values: pageflow.pageTransitions.names()
|
8462
|
-
};
|
8463
|
-
|
8464
|
-
if (pageflow.navigationDirection.isHorizontalOnPhone()) {
|
8465
|
-
inputOptions.additionalInlineHelpText = I18n$1.t('pageflow.editor.phone_horizontal_slideshow_mode.page_transitions_inline_help');
|
8466
|
-
}
|
8467
|
-
|
8468
|
-
this.input(options.propertyName || 'page_transition', SelectInputView, _$1.extend(inputOptions, options));
|
8469
|
-
});
|
8470
|
-
|
8471
|
-
ConfigurationEditorTabView.groups.define('options', function (options) {
|
8472
|
-
var theme = state.entry.getTheme();
|
8473
|
-
this.input('display_in_navigation', CheckBoxInputView);
|
8474
|
-
|
8475
|
-
if (theme.supportsEmphasizedPages()) {
|
8476
|
-
this.input('emphasize_in_navigation', CheckBoxInputView);
|
8477
|
-
}
|
8478
|
-
|
8479
|
-
this.group('page_transitions', {
|
8480
|
-
propertyName: 'transition'
|
8481
|
-
});
|
8482
|
-
|
8483
|
-
if (pageflow.features.isEnabled('delayed_text_fade_in')) {
|
8484
|
-
this.input('delayed_text_fade_in', SelectInputView, {
|
8485
|
-
values: Page.delayedTextFadeIn
|
8486
|
-
});
|
8487
|
-
}
|
8488
|
-
|
8489
|
-
this.input('description', TextAreaInputView, {
|
8490
|
-
size: 'short',
|
8491
|
-
disableLinks: true
|
8492
|
-
});
|
8493
|
-
this.input('atmo_audio_file_id', FileInputView, {
|
8494
|
-
collection: state.audioFiles
|
8495
|
-
});
|
8496
|
-
|
8497
|
-
if (theme.supportsHideLogoOnPages()) {
|
8498
|
-
this.input('hide_logo', CheckBoxInputView);
|
8499
|
-
}
|
8500
|
-
|
8501
|
-
if (options.canPauseAtmo) {
|
8502
|
-
this.input('atmo_during_playback', SelectInputView, {
|
8503
|
-
values: pageflow.Atmo.duringPlaybackModes
|
8504
|
-
});
|
8505
|
-
}
|
8506
|
-
|
8507
|
-
if (theme.supportsScrollIndicatorModes()) {
|
8508
|
-
this.input('scroll_indicator_mode', SelectInputView, {
|
8509
|
-
values: Page.scrollIndicatorModes
|
8510
|
-
});
|
8511
|
-
this.input('scroll_indicator_orientation', SelectInputView, {
|
8512
|
-
values: Page.scrollIndicatorOrientations
|
8513
|
-
});
|
8514
|
-
}
|
8515
|
-
});
|
8516
|
-
|
8517
|
-
editor$1.widgetTypes.register('classic_loading_spinner', {
|
7896
|
+
editor.widgetTypes.register('classic_loading_spinner', {
|
8518
7897
|
configurationEditorView: ConfigurationEditorView.extend({
|
8519
7898
|
configure: function configure() {
|
8520
7899
|
this.tab('loading_spinner', function () {
|
@@ -8526,10 +7905,10 @@ editor$1.widgetTypes.register('classic_loading_spinner', {
|
|
8526
7905
|
})
|
8527
7906
|
});
|
8528
7907
|
|
8529
|
-
editor
|
7908
|
+
editor.widgetTypes.registerRole('cookie_notice', {
|
8530
7909
|
isOptional: true
|
8531
7910
|
});
|
8532
|
-
editor
|
7911
|
+
editor.widgetTypes.register('cookie_notice_bar', {
|
8533
7912
|
configurationEditorView: ConfigurationEditorView.extend({
|
8534
7913
|
configure: function configure() {
|
8535
7914
|
this.tab('cookie_notice_bar', function () {
|
@@ -8541,7 +7920,7 @@ editor$1.widgetTypes.register('cookie_notice_bar', {
|
|
8541
7920
|
})
|
8542
7921
|
});
|
8543
7922
|
|
8544
|
-
editor
|
7923
|
+
editor.widgetTypes.register('media_loading_spinner', {
|
8545
7924
|
configurationEditorView: ConfigurationEditorView.extend({
|
8546
7925
|
configure: function configure() {
|
8547
7926
|
this.tab('loading_spinner', function () {
|
@@ -8555,12 +7934,18 @@ editor$1.widgetTypes.register('media_loading_spinner', {
|
|
8555
7934
|
this.input('invert', CheckBoxInputView);
|
8556
7935
|
this.input('remove_logo', CheckBoxInputView);
|
8557
7936
|
this.input('blur_strength', SliderInputView);
|
7937
|
+
this.input('animation_duration', SliderInputView, {
|
7938
|
+
minValue: 1,
|
7939
|
+
maxValue: 7,
|
7940
|
+
defaultValue: 7,
|
7941
|
+
unit: 's'
|
7942
|
+
});
|
8558
7943
|
});
|
8559
7944
|
}
|
8560
7945
|
})
|
8561
7946
|
});
|
8562
7947
|
|
8563
|
-
editor
|
7948
|
+
editor.widgetTypes.register('phone_horizontal_slideshow_mode', {
|
8564
7949
|
configurationEditorView: ConfigurationEditorView.extend({
|
8565
7950
|
configure: function configure() {
|
8566
7951
|
this.tab('phone_horizontal_slideshow_mode', function () {
|
@@ -8575,7 +7960,7 @@ editor$1.widgetTypes.register('phone_horizontal_slideshow_mode', {
|
|
8575
7960
|
})
|
8576
7961
|
});
|
8577
7962
|
|
8578
|
-
editor
|
7963
|
+
editor.widgetTypes.register('title_loading_spinner', {
|
8579
7964
|
configurationEditorView: ConfigurationEditorView.extend({
|
8580
7965
|
configure: function configure() {
|
8581
7966
|
this.tab('loading_spinner', function () {
|
@@ -8593,6 +7978,12 @@ editor$1.widgetTypes.register('title_loading_spinner', {
|
|
8593
7978
|
this.input('invert', CheckBoxInputView);
|
8594
7979
|
this.input('remove_logo', CheckBoxInputView);
|
8595
7980
|
this.input('blur_strength', SliderInputView);
|
7981
|
+
this.input('animation_duration', SliderInputView, {
|
7982
|
+
minValue: 1,
|
7983
|
+
maxValue: 7,
|
7984
|
+
defaultValue: 7,
|
7985
|
+
unit: 's'
|
7986
|
+
});
|
8596
7987
|
});
|
8597
7988
|
}
|
8598
7989
|
})
|
@@ -8611,11 +8002,11 @@ app.addInitializer(function (options) {
|
|
8611
8002
|
});
|
8612
8003
|
|
8613
8004
|
app.addInitializer(function (options) {
|
8614
|
-
|
8005
|
+
features.enable('editor', options.entry.enabled_feature_names);
|
8615
8006
|
});
|
8616
8007
|
|
8617
8008
|
app.addInitializer(function (options) {
|
8618
|
-
|
8009
|
+
Audio.setup({
|
8619
8010
|
getSources: function getSources(audioFileId) {
|
8620
8011
|
var file = state.audioFiles.getByPermaId(audioFileId);
|
8621
8012
|
return file ? file.getSources() : '';
|
@@ -8625,7 +8016,7 @@ app.addInitializer(function (options) {
|
|
8625
8016
|
|
8626
8017
|
app.addInitializer(function () {
|
8627
8018
|
Backbone.history.on('route', function () {
|
8628
|
-
editor
|
8019
|
+
editor.applyDefaultHelpEntry();
|
8629
8020
|
});
|
8630
8021
|
});
|
8631
8022
|
|
@@ -8654,7 +8045,7 @@ app.addInitializer(function (options) {
|
|
8654
8045
|
settingsDialogTabLink: 'general'
|
8655
8046
|
}
|
8656
8047
|
};
|
8657
|
-
editor
|
8048
|
+
editor.fileTypes.register('image_files', {
|
8658
8049
|
model: ImageFile,
|
8659
8050
|
metaDataAttributes: ['dimensions', altMetaDataAttribute],
|
8660
8051
|
matchUpload: /^image/,
|
@@ -8663,7 +8054,7 @@ app.addInitializer(function (options) {
|
|
8663
8054
|
inputView: TextInputView
|
8664
8055
|
}]
|
8665
8056
|
});
|
8666
|
-
editor
|
8057
|
+
editor.fileTypes.register('video_files', {
|
8667
8058
|
model: VideoFile,
|
8668
8059
|
metaDataAttributes: ['format', 'dimensions', 'duration', textTracksMetaDataAttribute, altMetaDataAttribute],
|
8669
8060
|
matchUpload: /^video/,
|
@@ -8673,7 +8064,7 @@ app.addInitializer(function (options) {
|
|
8673
8064
|
}],
|
8674
8065
|
settingsDialogTabs: [textTracksSettingsDialogTab]
|
8675
8066
|
});
|
8676
|
-
editor
|
8067
|
+
editor.fileTypes.register('audio_files', {
|
8677
8068
|
model: AudioFile,
|
8678
8069
|
metaDataAttributes: ['format', 'duration', textTracksMetaDataAttribute, altMetaDataAttribute],
|
8679
8070
|
matchUpload: /^audio/,
|
@@ -8683,7 +8074,7 @@ app.addInitializer(function (options) {
|
|
8683
8074
|
}],
|
8684
8075
|
settingsDialogTabs: [textTracksSettingsDialogTab]
|
8685
8076
|
});
|
8686
|
-
editor
|
8077
|
+
editor.fileTypes.register('text_track_files', {
|
8687
8078
|
model: TextTrackFile,
|
8688
8079
|
matchUpload: function matchUpload(upload) {
|
8689
8080
|
return upload.name.match(/\.vtt$/) || upload.name.match(/\.srt$/);
|
@@ -8738,90 +8129,66 @@ app.addInitializer(function (options) {
|
|
8738
8129
|
binding: 'label'
|
8739
8130
|
}
|
8740
8131
|
});
|
8741
|
-
editor
|
8132
|
+
editor.fileTypes.setup(options.config.fileTypes);
|
8742
8133
|
});
|
8743
8134
|
|
8744
8135
|
app.addInitializer(function (options) {
|
8745
|
-
editor
|
8136
|
+
editor.widgetTypes.registerRole('navigation', {
|
8746
8137
|
isOptional: true
|
8747
8138
|
});
|
8748
|
-
editor
|
8139
|
+
editor.widgetTypes.setup(options.widget_types);
|
8749
8140
|
});
|
8750
8141
|
|
8751
8142
|
app.addInitializer(function (options) {
|
8752
|
-
state.files = FilesCollection.createForFileTypes(editor
|
8143
|
+
state.files = FilesCollection.createForFileTypes(editor.fileTypes, options.files);
|
8753
8144
|
state.imageFiles = state.files.image_files;
|
8754
8145
|
state.videoFiles = state.files.video_files;
|
8755
8146
|
state.audioFiles = state.files.audio_files;
|
8756
8147
|
state.textTrackFiles = state.files.text_track_files;
|
8757
8148
|
var widgets = new WidgetsCollection(options.widgets, {
|
8758
|
-
widgetTypes: editor
|
8149
|
+
widgetTypes: editor.widgetTypes
|
8759
8150
|
});
|
8760
8151
|
state.themes = new ThemesCollection(options.themes);
|
8761
8152
|
state.pages = new PagesCollection(options.pages);
|
8762
8153
|
state.chapters = new ChaptersCollection(options.chapters);
|
8763
8154
|
state.storylines = new StorylinesCollection(options.storylines);
|
8764
|
-
state.entry = editor
|
8155
|
+
state.entry = editor.createEntryModel(options, {
|
8765
8156
|
widgets: widgets
|
8766
8157
|
});
|
8767
8158
|
state.theming = new Theming(options.theming);
|
8768
8159
|
state.account = new Backbone.Model(options.account);
|
8769
8160
|
widgets.subject = state.entry;
|
8770
|
-
state.entryData = new PreviewEntryData({
|
8771
|
-
entry: state.entry,
|
8772
|
-
storylines: state.storylines,
|
8773
|
-
chapters: state.chapters,
|
8774
|
-
pages: state.pages
|
8775
|
-
});
|
8776
8161
|
state.storylineOrdering = new StorylineOrdering(state.storylines, state.pages);
|
8777
8162
|
state.storylineOrdering.sort({
|
8778
8163
|
silent: true
|
8779
8164
|
});
|
8780
8165
|
state.storylineOrdering.watch();
|
8781
8166
|
state.pages.sort();
|
8782
|
-
state.storylines.on('sort', _
|
8167
|
+
state.storylines.on('sort', _.debounce(function () {
|
8783
8168
|
state.storylines.saveOrder();
|
8784
8169
|
}, 100));
|
8785
|
-
editor
|
8786
|
-
editor
|
8787
|
-
editor
|
8788
|
-
editor
|
8789
|
-
editor
|
8790
|
-
|
8170
|
+
editor.failures.watch(state.entry);
|
8171
|
+
editor.failures.watch(state.pages);
|
8172
|
+
editor.failures.watch(state.chapters);
|
8173
|
+
editor.savingRecords.watch(state.pages);
|
8174
|
+
editor.savingRecords.watch(state.chapters);
|
8175
|
+
events.trigger('seed:loaded');
|
8791
8176
|
});
|
8792
8177
|
|
8793
8178
|
app.addInitializer(function (options) {
|
8794
8179
|
state.fileUploader = new FileUploader({
|
8795
8180
|
entry: state.entry,
|
8796
|
-
fileTypes: editor
|
8181
|
+
fileTypes: editor.fileTypes
|
8797
8182
|
});
|
8798
|
-
ConfirmUploadView.watch(state.fileUploader, editor
|
8799
|
-
});
|
8800
|
-
|
8801
|
-
app.addInitializer(function (options) {
|
8802
|
-
editor$1.pageTypes.setup(options.page_types);
|
8183
|
+
ConfirmUploadView.watch(state.fileUploader, editor.fileTypes, state.files);
|
8803
8184
|
});
|
8804
8185
|
|
8805
8186
|
app.addInitializer(function (options) {
|
8806
|
-
|
8807
|
-
var KEY_X = 88;
|
8808
|
-
$(document).on('keydown', function (event) {
|
8809
|
-
if (event.altKey && event.which === KEY_A) {
|
8810
|
-
if (pageflow.atmo.disabled) {
|
8811
|
-
pageflow.atmo.enable();
|
8812
|
-
} else {
|
8813
|
-
pageflow.atmo.disable();
|
8814
|
-
}
|
8815
|
-
} else if (event.altKey && event.which === KEY_X) {
|
8816
|
-
editor$1.navigate('pages/' + pageflow.slides.currentPage().data('id'), {
|
8817
|
-
trigger: true
|
8818
|
-
});
|
8819
|
-
}
|
8820
|
-
});
|
8187
|
+
editor.pageTypes.setup(options.page_types);
|
8821
8188
|
});
|
8822
8189
|
|
8823
8190
|
app.addInitializer(function (options) {
|
8824
|
-
editor
|
8191
|
+
editor.fileImporters.setup(options.config.fileImporters);
|
8825
8192
|
});
|
8826
8193
|
|
8827
8194
|
app.addInitializer(function (options) {
|
@@ -8834,23 +8201,8 @@ app.addInitializer(function (options) {
|
|
8834
8201
|
state.entry.pollForPendingFiles();
|
8835
8202
|
});
|
8836
8203
|
|
8837
|
-
app.addInitializer(function (options) {
|
8838
|
-
state.entry.on('change:pending_files_count', function (model, value) {
|
8839
|
-
if (value < state.entry.previous('pending_files_count')) {
|
8840
|
-
pageflow.stylesheet.reload('entry');
|
8841
|
-
}
|
8842
|
-
});
|
8843
|
-
state.entry.on('use:files', function () {
|
8844
|
-
pageflow.stylesheet.reload('entry');
|
8845
|
-
});
|
8846
|
-
state.entry.metadata.on('change:theme_name', function () {
|
8847
|
-
var theme = state.entry.getTheme();
|
8848
|
-
pageflow.stylesheet.update('theme', theme.get('stylesheet_path'));
|
8849
|
-
});
|
8850
|
-
});
|
8851
|
-
|
8852
8204
|
app.addInitializer(function () {
|
8853
|
-
_
|
8205
|
+
_.each(editor.sideBarRoutings, function (options) {
|
8854
8206
|
new options.router({
|
8855
8207
|
controller: new options.controller({
|
8856
8208
|
region: app.sidebarRegion,
|
@@ -8859,13 +8211,13 @@ app.addInitializer(function () {
|
|
8859
8211
|
});
|
8860
8212
|
});
|
8861
8213
|
|
8862
|
-
editor
|
8214
|
+
editor.router = new SidebarRouter({
|
8863
8215
|
controller: new SidebarController({
|
8864
8216
|
region: app.sidebarRegion,
|
8865
8217
|
entry: state.entry
|
8866
8218
|
})
|
8867
8219
|
});
|
8868
|
-
window.editor = editor
|
8220
|
+
window.editor = editor.router;
|
8869
8221
|
});
|
8870
8222
|
|
8871
8223
|
app.addInitializer(function () {
|
@@ -8887,7 +8239,7 @@ app.addInitializer(function ()
|
|
8887
8239
|
var context = this;
|
8888
8240
|
var args = arguments;
|
8889
8241
|
|
8890
|
-
_
|
8242
|
+
_.each(editor.initializers, function (fn) {
|
8891
8243
|
fn.call(context, args);
|
8892
8244
|
});
|
8893
8245
|
});
|
@@ -8900,10 +8252,9 @@ app.addInitializer(function (options) {
|
|
8900
8252
|
el: $('sidebar .scrolling'),
|
8901
8253
|
region: app.sidebarRegion
|
8902
8254
|
}).render();
|
8903
|
-
app.previewRegion.show(new editor
|
8255
|
+
app.previewRegion.show(new editor.entryType.previewView({
|
8904
8256
|
model: state.entry
|
8905
8257
|
}));
|
8906
|
-
app.indicatorsRegion.show(new DisabledAtmoIndicatorView());
|
8907
8258
|
app.notificationsRegion.show(new NotificationsView());
|
8908
8259
|
app.sidebarFooterRegion.show(new SidebarFooterView({
|
8909
8260
|
model: state.entry
|
@@ -8922,4 +8273,4 @@ app.addRegions({
|
|
8922
8273
|
sidebarFooterRegion: 'sidebar .sidebar_footer_container'
|
8923
8274
|
});
|
8924
8275
|
|
8925
|
-
export { AudioFile, BackButtonDecoratorView, BackgroundImageEmbeddedView, BackgroundPositioningPreviewView, BackgroundPositioningSlidersView, BackgroundPositioningView, ChangeThemeDialogView, Chapter, ChapterConfiguration, ChapterPagesCollection, ChapterScaffold, ChaptersCollection, ChooseImporterView, Configuration, ConfirmEncodingView, ConfirmFileImportUploadView, ConfirmUploadView, ConfirmableFileItemView,
|
8276
|
+
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, Theming, 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 };
|