pageflow 15.1.0.beta2 → 15.1.0.beta3

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.

Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +141 -1
  3. data/README.md +3 -6
  4. data/admins/pageflow/entry.rb +1 -1
  5. data/app/assets/javascripts/pageflow/dist/editor.js +1241 -1281
  6. data/app/assets/javascripts/pageflow/dist/react-client.js +3 -3
  7. data/app/assets/javascripts/pageflow/dist/react-server.js +2 -2
  8. data/app/assets/javascripts/pageflow/dist/ui.js +241 -57
  9. data/app/assets/javascripts/pageflow/editor/base.js +0 -20
  10. data/app/assets/javascripts/pageflow/editor/vendor.js +16 -0
  11. data/app/assets/stylesheets/pageflow/admin/embedded_index_table.scss +5 -1
  12. data/app/controllers/concerns/pageflow/controller_delegation.rb +31 -0
  13. data/app/controllers/concerns/pageflow/entry_password_protection.rb +4 -4
  14. data/app/controllers/pageflow/editor/entries_controller.rb +35 -0
  15. data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
  16. data/app/controllers/pageflow/editor/files_controller.rb +1 -1
  17. data/app/controllers/pageflow/entries_controller.rb +29 -71
  18. data/app/controllers/pageflow/revisions_controller.rb +16 -5
  19. data/app/helpers/pageflow/common_entry_seed_helper.rb +9 -24
  20. data/app/helpers/pageflow/config_helper.rb +25 -3
  21. data/app/helpers/pageflow/editor/config_helper.rb +12 -0
  22. data/app/helpers/pageflow/editor/entries_helper.rb +10 -0
  23. data/app/helpers/pageflow/editor/files_helper.rb +24 -0
  24. data/app/helpers/pageflow/entries_helper.rb +5 -4
  25. data/app/helpers/pageflow/entry_json_seed_helper.rb +1 -0
  26. data/app/helpers/pageflow/files_helper.rb +14 -13
  27. data/app/helpers/pageflow/page_types_helper.rb +4 -1
  28. data/app/helpers/pageflow/render_json_helper.rb +30 -5
  29. data/app/models/concerns/pageflow/auto_generated_perma_id.rb +16 -0
  30. data/app/models/concerns/pageflow/feature_target.rb +3 -3
  31. data/app/models/pageflow/draft_entry.rb +3 -0
  32. data/app/models/pageflow/home_button.rb +3 -1
  33. data/app/models/pageflow/page.rb +1 -6
  34. data/app/models/pageflow/published_entry.rb +1 -0
  35. data/app/models/pageflow/revision.rb +3 -0
  36. data/app/models/pageflow/storyline.rb +0 -2
  37. data/app/views/admin/entries/_links.html.arb +1 -1
  38. data/app/views/admin/features/_form.html.erb +1 -1
  39. data/app/views/components/pageflow/admin/add_membership_button.rb +13 -1
  40. data/app/views/layouts/pageflow/application.html.erb +3 -19
  41. data/app/views/layouts/pageflow/editor.html.erb +18 -0
  42. data/app/views/pageflow/admin/accounts/_cannot_add_account.html.erb +0 -0
  43. data/app/views/pageflow/admin/entries/_cannot_add_user.html.erb +5 -0
  44. data/app/views/pageflow/admin/users/_cannot_add.html.erb +8 -0
  45. data/app/views/pageflow/admin/users/_cannot_add_account.html.erb +0 -0
  46. data/app/views/pageflow/admin/users/_cannot_add_entry.html +0 -0
  47. data/app/views/pageflow/{config/_editor_seeds.json.jbuilder → editor/config/_seeds.json.jbuilder} +3 -2
  48. data/app/views/pageflow/editor/entries/seed.json.erb +5 -4
  49. data/app/views/pageflow/{entries/edit.html.erb → editor/entries/show.html.erb} +5 -9
  50. data/app/views/pageflow/{entries → editor/entries}/show.json.jbuilder +0 -0
  51. data/app/views/pageflow/entries/{show.css.erb → stylesheet.css.erb} +0 -0
  52. data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +2 -8
  53. data/config/initializers/entry_types.rb +4 -0
  54. data/config/initializers/features.rb +0 -10
  55. data/config/initializers/help_entries.rb +0 -8
  56. data/config/locales/de.yml +4 -0
  57. data/config/locales/en.yml +4 -0
  58. data/config/routes.rb +10 -5
  59. data/db/migrate/20191202145757_create_pageflow_scrolled_sections.rb +21 -0
  60. data/db/migrate/20191202150657_create_pageflow_scrolled_chapters.rb +11 -0
  61. data/db/migrate/20191202154723_create_pageflow_scrolled_content_elements.rb +21 -0
  62. data/db/migrate/20191219143450_add_position_to_content_elements.rb +5 -0
  63. data/db/migrate/20191220100946_create_pageflow_scrolled_storylines.rb +24 -0
  64. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +9805 -114
  65. data/entry_types/paged/app/assets/javascripts/pageflow_paged/editor.js +7 -0
  66. data/entry_types/paged/app/assets/stylesheets/pageflow_paged/editor.scss +1 -0
  67. data/entry_types/paged/app/controllers/concerns/pageflow_paged/without_controller_namespace_partial_path_prefix.rb +21 -0
  68. data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +25 -0
  69. data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +17 -0
  70. data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +25 -0
  71. data/{app/views/layouts/pageflow → entry_types/paged/app/views/layouts/pageflow_paged}/_ie_include_tags.html.erb +0 -0
  72. data/{app/views/layouts/pageflow → entry_types/paged/app/views/layouts/pageflow_paged}/_loading_spinner_inline_script.html.erb +0 -0
  73. data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +33 -0
  74. data/entry_types/paged/app/views/pageflow_paged/chapters/_chapter.html.erb +7 -0
  75. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_body.html.erb +4 -0
  76. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +12 -0
  77. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_indicators_seed.html.erb +3 -0
  78. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_seed.json.jbuilder +0 -0
  79. data/entry_types/paged/app/views/pageflow_paged/editor/entries/partials.html.erb +3 -0
  80. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_entry.html.erb +7 -5
  81. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_header.html.erb +0 -0
  82. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_ie8_hint.html.erb +0 -0
  83. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_indicators.html.erb +0 -0
  84. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_multimedia_alert.html.erb +0 -0
  85. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_non_js_hint.html.erb +0 -0
  86. data/entry_types/paged/app/views/pageflow_paged/entries/_overview.html.erb +1 -0
  87. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_skip_links.html.erb +0 -0
  88. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/overview/_chapter.html.erb +3 -1
  89. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/overview/_entry.html.erb +1 -1
  90. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/overview/_page.html.erb +0 -0
  91. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/show.html.erb +3 -3
  92. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/pages/_page.html.erb +1 -1
  93. data/entry_types/paged/config/initializers/features.rb +16 -0
  94. data/entry_types/paged/config/initializers/page_types.rb +16 -0
  95. data/entry_types/paged/config/routes.rb +3 -0
  96. data/entry_types/paged/lib/pageflow_paged.rb +19 -0
  97. data/entry_types/paged/lib/pageflow_paged/configuration.rb +16 -0
  98. data/entry_types/paged/lib/pageflow_paged/engine.rb +7 -0
  99. data/entry_types/paged/lib/pageflow_paged/plugin.rb +8 -0
  100. data/entry_types/scrolled/app/assets/stylesheets/pageflow_scrolled/editor.scss +1 -0
  101. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +56 -0
  102. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +61 -0
  103. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/entries_controller.rb +8 -0
  104. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +59 -0
  105. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +10 -0
  106. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +21 -0
  107. data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +33 -0
  108. data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +40 -0
  109. data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +17 -0
  110. data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +26 -0
  111. data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +39 -0
  112. data/entry_types/scrolled/app/views/pageflow_scrolled/chapters/_chapter.json.jbuilder +8 -0
  113. data/entry_types/scrolled/app/views/pageflow_scrolled/content_elements/_content_element.json.jbuilder +9 -0
  114. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_body.html.erb +1 -0
  115. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +12 -0
  116. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -0
  117. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +22 -0
  118. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +35 -0
  119. data/entry_types/scrolled/app/views/pageflow_scrolled/sections/_section.json.jbuilder +8 -0
  120. data/entry_types/scrolled/config/routes.rb +23 -0
  121. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +34 -0
  122. data/entry_types/scrolled/lib/pageflow_scrolled.rb +19 -0
  123. data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +6 -0
  124. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +16 -0
  125. data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +133 -0
  126. data/entry_types/scrolled/spec/factories/chapters.rb +12 -0
  127. data/entry_types/scrolled/spec/factories/content_elements.rb +36 -0
  128. data/entry_types/scrolled/spec/factories/sections.rb +26 -0
  129. data/entry_types/scrolled/spec/factories/storylines.rb +12 -0
  130. data/entry_types/scrolled/spec/fixtures/image.jpg +0 -0
  131. data/lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb +1 -1
  132. data/lib/generators/pageflow/assets/assets_generator.rb +2 -2
  133. data/lib/pageflow/built_in_page_types_plugin.rb +5 -3
  134. data/lib/pageflow/built_in_widget_types_plugin.rb +38 -12
  135. data/lib/pageflow/configuration.rb +76 -15
  136. data/lib/pageflow/editor_controller.rb +44 -0
  137. data/lib/pageflow/engine.rb +2 -3
  138. data/lib/pageflow/entries_controller_env_helper.rb +44 -0
  139. data/lib/pageflow/entry_type.rb +19 -2
  140. data/lib/pageflow/entry_type_configuration.rb +44 -0
  141. data/lib/pageflow/entry_types.rb +22 -0
  142. data/lib/pageflow/feature.rb +11 -5
  143. data/lib/pageflow/file_importers.rb +2 -2
  144. data/lib/pageflow/file_type.rb +3 -2
  145. data/lib/pageflow/file_types.rb +23 -3
  146. data/lib/pageflow/global_config_api.rb +11 -4
  147. data/lib/pageflow/page_types.rb +30 -0
  148. data/lib/pageflow/partial_editor_fragment_renderer.rb +37 -0
  149. data/lib/pageflow/revision_component.rb +2 -5
  150. data/lib/pageflow/revision_components.rb +18 -0
  151. data/lib/pageflow/version.rb +1 -1
  152. data/lib/pageflow/widget_type.rb +3 -0
  153. data/lib/pageflow/widget_types.rb +1 -1
  154. data/spec/factories/draft_entries.rb +11 -0
  155. data/spec/factories/published_entries.rb +17 -0
  156. data/vendor/assets/javascripts/dash.all.min.js +0 -1
  157. metadata +146 -29
  158. data/app/views/pageflow/chapters/_chapter.html.erb +0 -5
  159. data/app/views/pageflow/editor/entries/_indicators_seed.html.erb +0 -3
  160. data/app/views/pageflow/entries/_overview.html.erb +0 -1
  161. data/app/views/pageflow/entries/partials.html.erb +0 -3
  162. data/config/initializers/page_type_helpers.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e6bebc8ab1b52e739e53dd904dcb3368d8c7377efb97d0560fe05b7e40c030a
4
- data.tar.gz: 9dc8a17a0d956d868fa84cec00d65c516be85f302b6437e0ea066ec14aed3624
3
+ metadata.gz: c5d9a6a5ac383de659a43bebd5b2661ea4f6e4a23e7e38bcefec77081748c090
4
+ data.tar.gz: ede9d4a4348d772766395273832161b491610d8e3359981d2eadf84d7426f46d
5
5
  SHA512:
6
- metadata.gz: 63156ad7cb52427ae9163c2c917555613e5203dcb780ea10a172d6d2577601f3a33710050fe470551cbfaba1374c18a2cdc431aa17e886ad7400bdf0bb99feb7
7
- data.tar.gz: e1b45fb7b1b6157f3b3a5996752a23083290dfbd287fc22a8314fc01850af870f3f83ebd68aa14eaa89c05ef02785f590e11f245197329c6291198b36f35ecf1
6
+ metadata.gz: dc22ea8b562e6c9eec9f824a237c1b8b484053cc8fbf5e9c7a1ae87b27d19d8d445ef8a7e306b2560379e3ba96ba8e5df058ac187cf0cce2d307018cab7c60be
7
+ data.tar.gz: 952e0196d24fe608826f65bb2c30f14898b7987ce70b667a0e275de01488817b49f84e7ae7c46a86281b9bf6480697b8ef13e891489f3ee807445e0c7abfa4d6
@@ -1,5 +1,145 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### Version 15.1.0.beta3
4
+
5
+ 2020-01-29
6
+
7
+ [Compare changes](https://github.com/codevise/pageflow/compare/v15.1.0.beta2...v15.1.0.beta3)
8
+
9
+ #### Core
10
+
11
+ ##### Host Application
12
+
13
+ - Updated active admin to 2.5.0
14
+ ([#1280](https://github.com/codevise/pageflow/pull/1280))
15
+ - Improve support for Webpack setup in host appplication
16
+ ([#1276](https://github.com/codevise/pageflow/pull/1276),
17
+ [#1279](https://github.com/codevise/pageflow/pull/1279))
18
+
19
+ ##### Admin
20
+
21
+ - Improve add member button
22
+ ([#1195](https://github.com/codevise/pageflow/pull/1195))
23
+
24
+ ##### Editor
25
+
26
+ - Bug fix: Prevent including pageflow/ui in pageflow/editor
27
+ ([#1309](https://github.com/codevise/pageflow/pull/1309))
28
+
29
+ ##### Engine Config
30
+
31
+ - Render entry type specific editor seed data
32
+ ([#1265](https://github.com/codevise/pageflow/pull/1265))
33
+ - Entry type specific editor views
34
+ ([#1262](https://github.com/codevise/pageflow/pull/1262))
35
+ - Entry type specific editor assets
36
+ ([#1257](https://github.com/codevise/pageflow/pull/1257))
37
+ - Let entry types provide frontend apps to render entries
38
+ ([#1254](https://github.com/codevise/pageflow/pull/1254),
39
+ [#1255](https://github.com/codevise/pageflow/pull/1255))
40
+ - Extend config DSL for entry types
41
+ ([#1267](https://github.com/codevise/pageflow/pull/1267))
42
+ - Allow scoping file types and widget types by entry types
43
+ ([#1283](https://github.com/codevise/pageflow/pull/1283))
44
+ - Decouple revision components and file types from page types
45
+ ([#1256](https://github.com/codevise/pageflow/pull/1256),
46
+ [#1259](https://github.com/codevise/pageflow/pull/1259))
47
+ - Consider feature flags for file types available in editor
48
+ ([#1275](https://github.com/codevise/pageflow/pull/1275))
49
+ - Extract part of appearance options into paged entry type
50
+ ([#1304](https://github.com/codevise/pageflow/pull/1304))
51
+ - Scope existing built ins to paged entry type
52
+ ([#1296](https://github.com/codevise/pageflow/pull/1296))
53
+ - Integrate entry type specific config with feature flags
54
+ ([#1295](https://github.com/codevise/pageflow/pull/1295))
55
+ - Decouple editor layout
56
+ ([#1284](https://github.com/codevise/pageflow/pull/1284))
57
+ - Let entry types define editor controllers
58
+ ([#1271](https://github.com/codevise/pageflow/pull/1271))
59
+
60
+ ##### File Importers
61
+
62
+ - Mentioned that file importer should be registered in a feature flag
63
+ ([#1266](https://github.com/codevise/pageflow/pull/1266))
64
+ - File import feature flag
65
+ ([#1258](https://github.com/codevise/pageflow/pull/1258))
66
+ - Bug fix: Minor file import lint change
67
+ ([#1269](https://github.com/codevise/pageflow/pull/1269))
68
+
69
+ #### Paged Entry Type
70
+
71
+ ##### Editor
72
+
73
+ - Bug fix: Fix page selection view
74
+ ([#1281](https://github.com/codevise/pageflow/pull/1281))
75
+
76
+ ##### Published Entry
77
+
78
+ - Bug fix: Invalidate page partial cache on locale change
79
+ ([#1311](https://github.com/codevise/pageflow/pull/1311))
80
+ - Bug fix: Do not prefix partial paths with pageflow_paged
81
+ ([#1320](https://github.com/codevise/pageflow/pull/1320))
82
+ - Bug fix: Fix `link_to home_button` raises URLGenerationError
83
+ ([#1310](https://github.com/codevise/pageflow/pull/1310))
84
+
85
+ ##### Internal
86
+
87
+ - Move PagedEntriesController to paged entry type engine
88
+ ([#1285](https://github.com/codevise/pageflow/pull/1285))
89
+ - Move editor actions into editor controller
90
+ ([#1282](https://github.com/codevise/pageflow/pull/1282))
91
+
92
+ #### Scrolled Entry Type
93
+
94
+ ##### Published Entry
95
+
96
+ - Import scrolled entry type React app
97
+ ([#1264](https://github.com/codevise/pageflow/pull/1264))
98
+ - Use seed data in scrolled entries
99
+ ([#1248](https://github.com/codevise/pageflow/pull/1248),
100
+ [#1270](https://github.com/codevise/pageflow/pull/1270),
101
+ [#1278](https://github.com/codevise/pageflow/pull/1278),
102
+ [#1286](https://github.com/codevise/pageflow/pull/1286))
103
+ - Fix section index and references to adjacent chapters
104
+ ([#1316](https://github.com/codevise/pageflow/pull/1316))
105
+ - Render uploaded images in scrolled entries
106
+ ([#1299](https://github.com/codevise/pageflow/pull/1299),
107
+ [#1303](https://github.com/codevise/pageflow/pull/1303))
108
+ - Use chapters from db in navigaition bar
109
+ ([#1298](https://github.com/codevise/pageflow/pull/1298),
110
+ [#1308](https://github.com/codevise/pageflow/pull/1308))
111
+
112
+ ##### Editor
113
+
114
+ - Render demo in editor
115
+ ([#1268](https://github.com/codevise/pageflow/pull/1268))
116
+ - Use data from Backbone collections in scrolled editor preview
117
+ ([#1293](https://github.com/codevise/pageflow/pull/1293),
118
+ [#1294](https://github.com/codevise/pageflow/pull/1294))
119
+
120
+ ##### Internal
121
+
122
+ - Pass scrolled entry to watchCollections in tests
123
+ ([#1317](https://github.com/codevise/pageflow/pull/1317))
124
+ - Setup Capybara for scrolled engine
125
+ ([#1289](https://github.com/codevise/pageflow/pull/1289))
126
+ - Set PAGEFLOW_EDITOR global in scrolled editor
127
+ ([#1287](https://github.com/codevise/pageflow/pull/1287))
128
+
129
+ #### Development Setup
130
+
131
+ - DB seed data for scrolled entries
132
+ ([#1274](https://github.com/codevise/pageflow/pull/1274),
133
+ [#1302](https://github.com/codevise/pageflow/pull/1302))
134
+ - Split Travis run into multiple jobs
135
+ ([#1261](https://github.com/codevise/pageflow/pull/1261))
136
+ - Generate JSDoc and SassDoc in GitHub workflow
137
+ ([#1307](https://github.com/codevise/pageflow/pull/1307))
138
+ - Add needed command to node package development docs
139
+ ([#1290](https://github.com/codevise/pageflow/pull/1290))
140
+ - Improve Capybara Chrome setup
141
+ ([#1291](https://github.com/codevise/pageflow/pull/1291))
142
+
3
143
  ### Version 15.1.0.beta2
4
144
 
5
145
  2019-12-05
@@ -36,7 +176,7 @@
36
176
  - Bug fix: Change revision#locale to always return string
37
177
  ([#1239](https://github.com/codevise/pageflow/pull/1239))
38
178
 
39
- #### Intenal
179
+ #### Internal
40
180
 
41
181
  - Add entry type engines
42
182
  ([#1247](https://github.com/codevise/pageflow/pull/1247))
data/README.md CHANGED
@@ -13,14 +13,11 @@ For a high level introduction and example Pageflow stories see
13
13
 
14
14
  * [Getting Started](https://github.com/codevise/pageflow/wiki/Getting-Started)
15
15
  * [Guides](https://github.com/codevise/pageflow/blob/master/doc/index.md)
16
- * [JavaScript API Reference](https://doclets.io/codevise/pageflow/master)
17
- * [Theme API Reference](http://codevise.github.io/pageflow/theme/master/)
16
+ * [JavaScript API Reference of `pageflow` package](http://codevise.github.io/pageflow-docs/js/master/index.html)
17
+ * [JavaScript API Reference of `pageflow-scrolled` package](http://codevise.github.io/pageflow-docs/scrolled/js/master/index.html)
18
+ * [Theme API Reference](http://codevise.github.io/pageflow-docs/theme/master/index.html)
18
19
  * [List of Plugins](https://github.com/codevise/pageflow/wiki/List-of-Plugins)
19
20
 
20
- **NOTE:** The master branch now hosts the code for v13.x.x.
21
- Please refer to [12-x-stable](https://github.com/codevise/pageflow/tree/12-x-stable)
22
- branch for 12.x documentation.
23
-
24
21
  ## Updating
25
22
 
26
23
  For instructions on how to update from a prior version of the gem see
@@ -31,7 +31,7 @@ module Pageflow
31
31
 
32
32
  column class: 'buttons' do |entry|
33
33
  if authorized?(:edit, entry)
34
- icon_link_to(pageflow.edit_entry_path(entry),
34
+ icon_link_to(pageflow.editor_entry_path(entry),
35
35
  tooltip: I18n.t('pageflow.admin.entries.editor_hint'),
36
36
  class: 'editor')
37
37
  end
@@ -25,6 +25,21 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
25
25
  };
26
26
  })();
27
27
 
28
+ function _defineProperty(obj, key, value) {
29
+ if (key in obj) {
30
+ Object.defineProperty(obj, key, {
31
+ value: value,
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true
35
+ });
36
+ } else {
37
+ obj[key] = value;
38
+ }
39
+
40
+ return obj;
41
+ }
42
+
28
43
  /*global JST*/
29
44
 
30
45
  Marionette.Renderer.render = function (template, data) {
@@ -42,13 +57,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
42
57
 
43
58
  return JST[template](data);
44
59
  };
45
-
46
- /**
47
- * Helpers functions for handling translations.
48
- *
49
- * @memberof module:pageflow/ui
50
- */
51
-
52
60
  /**
53
61
  * Returns an array of translation keys based on the `prefixes`
54
62
  * option and the given `keyName`.
@@ -68,8 +76,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
68
76
  * Required if `fallbackPrefix` option is present.
69
77
  *
70
78
  * @return {string[]}
79
+ * @memberof i18nUtils
71
80
  * @since 12.0
72
- */
81
+ */
82
+
73
83
 
74
84
  function attributeTranslationKeys(attributeName, keyName, options) {
75
85
  var result = [];
@@ -88,14 +98,15 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
88
98
  }
89
99
  /**
90
100
  * Takes the same parameters as {@link
91
- * module:pageflow/ui.attributeTranslationKeys
92
- * i18nUtils.attributeTranslationKeys}, but returns the first
93
- * existing translation.
101
+ * #i18nutilsattributetranslationkeys attributeTranslationKeys}, but returns the first existing
102
+ * translation.
94
103
  *
95
104
  * @return {string}
105
+ * @memberof i18nUtils
96
106
  * @since 12.0
97
107
  */
98
108
 
109
+
99
110
  function attributeTranslation(attributeName, keyName, options) {
100
111
  return findTranslation(attributeTranslationKeys(attributeName, keyName, options));
101
112
  }
@@ -114,9 +125,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
114
125
  * If true, also search for keys ending in '_html' and HTML-escape
115
126
  * keys that do not end in 'html'
116
127
  *
128
+ * @memberof i18nUtils
117
129
  * @return {string}
118
130
  */
119
131
 
132
+
120
133
  function findTranslation(keys, options) {
121
134
  options = options || {};
122
135
 
@@ -143,9 +156,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
143
156
  * @param {string[]} keys
144
157
  * Translation key candidates.
145
158
  *
159
+ * @memberof i18nUtils
146
160
  * @return {string}
147
161
  */
148
162
 
163
+
149
164
  function findKeyWithTranslation(keys) {
150
165
  var missing = '_not_translated';
151
166
  return _$1(keys).detect(function (key) {
@@ -154,13 +169,16 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
154
169
  }) !== missing;
155
170
  }) || _$1.first(keys);
156
171
  }
172
+
157
173
  function translationKeysWithSuffix(keys, suffix) {
158
174
  return _$1.chain(keys).map(function (key) {
159
175
  return [key + '_' + suffix, key];
160
176
  }).flatten().value();
161
177
  }
162
178
 
163
- var i18nUtils = /*#__PURE__*/Object.freeze({
179
+ var i18nUtils =
180
+ /*#__PURE__*/
181
+ Object.freeze({
164
182
  __proto__: null,
165
183
  attributeTranslationKeys: attributeTranslationKeys,
166
184
  attributeTranslation: attributeTranslation,
@@ -169,7 +187,180 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
169
187
  translationKeysWithSuffix: translationKeysWithSuffix
170
188
  });
171
189
 
172
- // https://github.com/jashkenas/backbone/issues/2601
190
+ function _arrayWithHoles(arr) {
191
+ if (Array.isArray(arr)) return arr;
192
+ }
193
+
194
+ function _iterableToArrayLimit(arr, i) {
195
+ if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
196
+ return;
197
+ }
198
+
199
+ var _arr = [];
200
+ var _n = true;
201
+ var _d = false;
202
+ var _e = undefined;
203
+
204
+ try {
205
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
206
+ _arr.push(_s.value);
207
+
208
+ if (i && _arr.length === i) break;
209
+ }
210
+ } catch (err) {
211
+ _d = true;
212
+ _e = err;
213
+ } finally {
214
+ try {
215
+ if (!_n && _i["return"] != null) _i["return"]();
216
+ } finally {
217
+ if (_d) throw _e;
218
+ }
219
+ }
220
+
221
+ return _arr;
222
+ }
223
+
224
+ function _nonIterableRest() {
225
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
226
+ }
227
+
228
+ function _slicedToArray(arr, i) {
229
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
230
+ }
231
+ /**
232
+ * Create object that can be passed to Marionette ui property from CSS
233
+ * module object.
234
+ *
235
+ * @param {Object} styles
236
+ * Class name mapping imported from `.module.css` file.
237
+ *
238
+ * @param {...string} classNames
239
+ * Keys from the styles object that shall be used in the ui object.
240
+ *
241
+ * @return {Object}
242
+ *
243
+ * @example
244
+ *
245
+ * // MyView.module.css
246
+ *
247
+ * .container {}
248
+ *
249
+ * // MyView.js
250
+ *
251
+ * import Marionette from 'marionette';
252
+ * import {cssModulesUtils} from 'pageflow/ui';
253
+ *
254
+ * import styles from './MyView.module.css';
255
+ *
256
+ * export const MyView = Marionette.ItemView({
257
+ * template: () => `
258
+ * <div class=${styles.container}></div>
259
+ * `,
260
+ *
261
+ * ui: cssModulesUtils.ui(styles, 'container'),
262
+ *
263
+ * onRender() {
264
+ * this.ui.container // => JQuery wrapper for container element
265
+ * }
266
+ * });
267
+ *
268
+ * @memberof cssModulesUtils
269
+ */
270
+
271
+
272
+ function ui(styles) {
273
+ for (var _len = arguments.length, classNames = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
274
+ classNames[_key - 1] = arguments[_key];
275
+ }
276
+
277
+ return classNames.reduce(function (result, className) {
278
+ result[className] = selector(styles, className);
279
+ return result;
280
+ }, {});
281
+ }
282
+ /**
283
+ * Create object that can be passed to Marionette events property from CSS
284
+ * module object.
285
+ *
286
+ * @param {Object} styles
287
+ * Class name mapping imported from `.module.css` file.
288
+ *
289
+ * @param {Object} mapping
290
+ * Events mapping using keys from the `styles` instead of CSS class names.
291
+ *
292
+ * @return {Object}
293
+ *
294
+ * @example
295
+ *
296
+ * // MyView.module.css
297
+ *
298
+ * .addButton {}
299
+ *
300
+ * // MyView.js
301
+ *
302
+ * import Marionette from 'marionette';
303
+ * import {cssModulesUtils} from 'pageflow/ui';
304
+ *
305
+ * import styles from './MyView.module.css';
306
+ *
307
+ * export const MyView = Marionette.ItemView({
308
+ * template: () => `
309
+ * <button class=${styles.addButton}></button>
310
+ * `,
311
+ *
312
+ * events: cssModulesUtils.ui(styles, {
313
+ * 'click addButton': () => console.log('clicked add button');
314
+ * })
315
+ * });
316
+ *
317
+ * @memberof cssModulesUtils
318
+ */
319
+
320
+
321
+ function events(styles, mapping) {
322
+ return Object.keys(mapping).reduce(function (result, key) {
323
+ var _key$split = key.split(' '),
324
+ _key$split2 = _slicedToArray(_key$split, 2),
325
+ event = _key$split2[0],
326
+ className = _key$split2[1];
327
+
328
+ result["".concat(event, " ").concat(selector(styles, className))] = mapping[key];
329
+ return result;
330
+ }, {});
331
+ }
332
+ /**
333
+ * Generates a CSS selector from a CSS module rule.
334
+ *
335
+ * @param {Object} styles
336
+ * Class name mapping imported from `.module.css` file.
337
+ *
338
+ * @param {String} className
339
+ * Key from the `styles` object.
340
+ *
341
+ * @return {String} CSS Selector
342
+ * @memberof cssModulesUtils
343
+ */
344
+
345
+
346
+ function selector(styles, className) {
347
+ var classNames = styles[className];
348
+
349
+ if (!classNames) {
350
+ throw new Error("Unknown class name ".concat(className, " in mapping. Knwon names: ").concat(Object.keys(styles).join(', '), "."));
351
+ }
352
+
353
+ return ".".concat(classNames.replace(/ /g, '.'));
354
+ }
355
+
356
+ var cssModulesUtils =
357
+ /*#__PURE__*/
358
+ Object.freeze({
359
+ __proto__: null,
360
+ ui: ui,
361
+ events: events,
362
+ selector: selector
363
+ }); // https://github.com/jashkenas/backbone/issues/2601
173
364
 
174
365
  function BaseObject(options) {
175
366
  this.initialize.apply(this, arguments);
@@ -181,7 +372,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
181
372
 
182
373
 
183
374
  BaseObject.extend = Backbone.Model.extend;
184
-
185
375
  var CollectionView = Marionette.View.extend({
186
376
  initialize: function initialize() {
187
377
  this.rendered = false;
@@ -301,7 +491,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
301
491
  }
302
492
  }
303
493
  });
304
-
305
494
  var SortableCollectionView = CollectionView.extend({
306
495
  render: function render() {
307
496
  CollectionView.prototype.render.call(this);
@@ -350,7 +539,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
350
539
  });
351
540
  }
352
541
  });
353
-
354
542
  var ConfigurationEditorTabView = Marionette.View.extend({
355
543
  className: 'configuration_editor_tab',
356
544
  initialize: function initialize() {
@@ -409,15 +597,17 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
409
597
  ConfigurationEditorTabView.groups = new ConfigurationEditorTabView.Groups();
410
598
 
411
599
  function template(data) {
412
- var __p = '';
413
- __p += '<div class="tabs_view-scroller">\n <ul class="tabs_view-headers"></ul>\n</div>\n<div class="tabs_view-container"></div>\n';
414
- return __p
600
+ var __p = '';
601
+ __p += '<div class="tabs_view-scroller">\n <ul class="tabs_view-headers"></ul>\n</div>\n<div class="tabs_view-container"></div>\n';
602
+ return __p;
415
603
  }
416
-
417
604
  /*global pageflow*/
605
+
418
606
  /**
419
607
  * Switch between different views using tabs.
420
608
  *
609
+ * @param {Object} [options]
610
+ *
421
611
  * @param {string} [options.defaultTab]
422
612
  * Name of the tab to enable by default.
423
613
  *
@@ -432,10 +622,12 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
432
622
  * Legacy alias for `fallbackTranslationKeyPrefix`.
433
623
  *
434
624
  * @class
435
- * @memberof module:pageflow/ui
436
625
  */
437
626
 
438
- var TabsView = Marionette.Layout.extend({
627
+
628
+ var TabsView = Marionette.Layout.extend(
629
+ /* @lends TabView.prototype */
630
+ {
439
631
  template: template,
440
632
  className: 'tabs_view',
441
633
  ui: {
@@ -541,10 +733,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
541
733
  }
542
734
  }
543
735
  });
544
-
545
736
  /**
546
737
  * Render a inputs on multiple tabs.
547
738
  *
739
+ * @param {Object} [options]
740
+ *
548
741
  * @param {string} [options.model]
549
742
  * Backbone model to use for input views.
550
743
  *
@@ -564,7 +757,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
564
757
  * Prefixes to append tab name to.
565
758
  *
566
759
  * @class
567
- * @memberof module:pageflow/ui
568
760
  */
569
761
 
570
762
  var ConfigurationEditorView = Marionette.View.extend({
@@ -618,11 +810,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
618
810
  });
619
811
 
620
812
  function template$1(data) {
621
- var __p = '';
622
- __p += '';
623
- return __p
813
+ var __p = '';
814
+ __p += '';
815
+ return __p;
624
816
  }
625
-
626
817
  /**
627
818
  * Base class for table cell views.
628
819
  *
@@ -630,12 +821,15 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
630
821
  * `this.options.column`. Override the `update` method to populate the
631
822
  * element.
632
823
  *
824
+ * @param {Object} [options]
825
+ *
633
826
  * @param {string} [options.className]
634
827
  * Class attribute to apply to the cell element.
635
828
  *
636
829
  * @since 12.0
637
830
  */
638
831
 
832
+
639
833
  var TableCellView = Marionette.ItemView.extend({
640
834
  tagName: 'td',
641
835
  template: template$1,
@@ -716,7 +910,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
716
910
  }
717
911
  }
718
912
  });
719
-
720
913
  var TableHeaderCellView = TableCellView.extend({
721
914
  tagName: 'th',
722
915
  render: function render() {
@@ -725,7 +918,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
725
918
  return this;
726
919
  }
727
920
  });
728
-
729
921
  var TableRowView = Marionette.View.extend({
730
922
  tagName: 'tr',
731
923
  events: {
@@ -764,19 +956,17 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
764
956
  });
765
957
 
766
958
  function template$2(data) {
767
- var __p = '';
768
- __p += '<table>\n <thead>\n <tr></tr>\n </thead>\n <tbody>\n </tbody>\n</table>\n';
769
- return __p
959
+ var __p = '';
960
+ __p += '<table>\n <thead>\n <tr></tr>\n </thead>\n <tbody>\n </tbody>\n</table>\n';
961
+ return __p;
770
962
  }
771
963
 
772
964
  function blankSlateTemplate(data) {
773
- var __t, __p = '';
774
- __p += '<td colspan="' +
775
- ((__t = ( data.colSpan )) == null ? '' : __t) +
776
- '">\n ' +
777
- ((__t = ( data.blankSlateText )) == null ? '' : __t) +
778
- '\n</td>\n';
779
- return __p
965
+ var __t,
966
+ __p = '';
967
+
968
+ __p += '<td colspan="' + ((__t = data.colSpan) == null ? '' : __t) + '">\n ' + ((__t = data.blankSlateText) == null ? '' : __t) + '\n</td>\n';
969
+ return __p;
780
970
  }
781
971
 
782
972
  var TableView = Marionette.ItemView.extend({
@@ -823,9 +1013,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
823
1013
  });
824
1014
 
825
1015
  function template$3(data) {
826
- var __p = '';
827
- __p += '<span class="label">\n</span>\n';
828
- return __p
1016
+ var __p = '';
1017
+ __p += '<span class="label">\n</span>\n';
1018
+ return __p;
829
1019
  }
830
1020
 
831
1021
  var TooltipView = Marionette.ItemView.extend({
@@ -866,7 +1056,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
866
1056
  }, this), 200);
867
1057
  }
868
1058
  });
869
-
870
1059
  /**
871
1060
  * Mixin for input views handling common concerns like labels,
872
1061
  * inline help, visiblity and disabling.
@@ -977,7 +1166,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
977
1166
  * attribute equals the value of this option.
978
1167
  *
979
1168
  * @mixin
980
- * @memberof module:pageflow/ui
981
1169
  */
982
1170
 
983
1171
  var inputView = {
@@ -990,13 +1178,12 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
990
1178
  * Returns an array of translation keys based on the
991
1179
  * `attributeTranslationKeyPrefixes` option and the given keyName.
992
1180
  *
993
- * Combined with {@link
994
- * module:pageflow/ui.findTranslation
1181
+ * Combined with {@link #i18nutils
995
1182
  * i18nUtils.findTranslation}, this can be used inside input views
996
1183
  * to obtain additional translations with the same logic as for
997
1184
  * labels and inline help texts.
998
1185
  *
999
- * findTranslation(this.attributeTranslationKeys('default_value'));
1186
+ * findTranslation(this.attributeTranslationKeys('default_value'));
1000
1187
  *
1001
1188
  * @param {string} keyName
1002
1189
  * Suffix to append to prefixes.
@@ -1100,19 +1287,20 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1100
1287
  };
1101
1288
 
1102
1289
  function template$4(data) {
1103
- var __p = '';
1104
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="check_boxes_container" />\n';
1105
- return __p
1290
+ var __p = '';
1291
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="check_boxes_container" />\n';
1292
+ return __p;
1106
1293
  }
1107
-
1108
1294
  /**
1109
1295
  * Input view for attributes storing configuration hashes with boolean values.
1296
+ * See {@link inputView} for further options.
1297
+ *
1298
+ * @param {Object} [options]
1110
1299
  *
1111
- * @see {@link module:pageflow/ui.inputView inputView} for further options
1112
1300
  * @class
1113
- * @memberof module:pageflow/ui
1114
1301
  */
1115
1302
 
1303
+
1116
1304
  var CheckBoxGroupInputView = Marionette.ItemView.extend({
1117
1305
  mixins: [inputView],
1118
1306
  template: template$4,
@@ -1171,24 +1359,25 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1171
1359
  });
1172
1360
 
1173
1361
  function template$5(data) {
1174
- var __t, __p = '';
1175
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<a class="original" href="#" download target="_blank">\n ' +
1176
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.url_display.link_text') )) == null ? '' : __t) +
1177
- '\n</a>\n';
1178
- return __p
1179
- }
1362
+ var __t,
1363
+ __p = '';
1180
1364
 
1365
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<a class="original" href="#" download target="_blank">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.url_display.link_text')) == null ? '' : __t) + '\n</a>\n';
1366
+ return __p;
1367
+ }
1181
1368
  /**
1182
1369
  * Display view for a link to a URL, to be used like an input view.
1370
+ * See {@link inputView} for further options
1371
+ *
1372
+ * @param {Object} [options]
1183
1373
  *
1184
1374
  * @param {string} [options.propertyName]
1185
1375
  * Target URL for link
1186
1376
  *
1187
- * @see {@link module:pageflow/ui.inputView inputView} for further options
1188
1377
  * @class
1189
- * @memberof module:pageflow/ui
1190
1378
  */
1191
1379
 
1380
+
1192
1381
  var UrlDisplayView = Marionette.ItemView.extend({
1193
1382
  mixins: [inputView],
1194
1383
  template: template$5,
@@ -1213,10 +1402,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1213
1402
  this.ui.link.attr('href', url);
1214
1403
  }
1215
1404
  });
1216
-
1217
1405
  /**
1218
1406
  * Text based input view that can display a placeholder.
1219
1407
  *
1408
+ * @param {Object} [options]
1409
+ *
1220
1410
  * @param {string|function} [options.placeholder]
1221
1411
  * Display a placeholder string if the input is blank. Either a
1222
1412
  * string or a function taking the model as a first parameter and
@@ -1232,10 +1422,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1232
1422
  * @param {Backbone.Model} [options.placeholderModel]
1233
1423
  * Obtain placeholder by looking up the configured `propertyName`
1234
1424
  * inside a given model.
1235
- *
1236
- * @mixin
1237
- * @memberof module:pageflow/ui
1238
1425
  */
1426
+
1239
1427
  var inputWithPlaceholderText = {
1240
1428
  onRender: function onRender() {
1241
1429
  this.updatePlaceholder();
@@ -1266,31 +1454,31 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1266
1454
  };
1267
1455
 
1268
1456
  function template$6(data) {
1269
- var __p = '';
1270
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<input type="text" dir="auto" />\n';
1271
- return __p
1457
+ var __p = '';
1458
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<input type="text" dir="auto" />\n';
1459
+ return __p;
1272
1460
  }
1273
-
1274
1461
  /**
1275
1462
  * Input view for a single line of text.
1276
1463
  *
1464
+ * See {@link inputWithPlaceholderText} for placeholder related
1465
+ * further options. See {@link inputView} for further options.
1466
+ *
1467
+ * @param {Object} [options]
1468
+ *
1277
1469
  * @param {boolean} [options.required=false]
1278
- * Display an error if the input is blank.
1470
+ * Display an error if the input is blank.
1279
1471
  *
1280
1472
  * @param {number} [options.maxLength=255]
1281
- * Maximum length of characters for this input.
1282
- * To support legacy data which consists of more characters than the specified maxLength,
1283
- * the option will only take effect for data which is shorter than the specified maxLength.
1473
+ * Maximum length of characters for this input. To support legacy
1474
+ * data which consists of more characters than the specified
1475
+ * maxLength, the option will only take effect for data which is
1476
+ * shorter than the specified maxLength.
1284
1477
  *
1285
- * @see
1286
- * {@link module:pageflow/ui.inputWithPlaceholderText inputWithPlaceholderText}
1287
- * for placeholder related further options
1288
- *
1289
- * @see {@link module:pageflow/ui.inputView inputView} for further options
1290
1478
  * @class
1291
- * @memberof module:pageflow/ui
1292
1479
  */
1293
1480
 
1481
+
1294
1482
  var TextInputView = Marionette.ItemView.extend({
1295
1483
  mixins: [inputView, inputWithPlaceholderText],
1296
1484
  template: template$6,
@@ -1354,9 +1542,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1354
1542
  this.ui.input.attr('title', '');
1355
1543
  }
1356
1544
  });
1357
-
1358
1545
  /**
1359
1546
  * Input view for a color value in hex representation.
1547
+ * See {@link inputView} for further options
1548
+ *
1549
+ * @param {Object} [options]
1360
1550
  *
1361
1551
  * @param {string|function} [options.defaultValue]
1362
1552
  * Color value to display by default. The corresponding value is not
@@ -1375,9 +1565,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1375
1565
  * down. The default value, if present, is always used as the
1376
1566
  * first swatch automatically.
1377
1567
  *
1378
- * @see {@link module:pageflow/ui.inputView inputView} for further options
1379
1568
  * @class
1380
- * @memberof module:pageflow/ui
1381
1569
  */
1382
1570
 
1383
1571
  var ColorInputView = Marionette.ItemView.extend({
@@ -1444,13 +1632,15 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1444
1632
  });
1445
1633
 
1446
1634
  function template$7(data) {
1447
- var __p = '';
1448
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<select></select>';
1449
- return __p
1635
+ var __p = '';
1636
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<select></select>';
1637
+ return __p;
1450
1638
  }
1451
-
1452
1639
  /**
1453
1640
  * A drop down with support for grouped items.
1641
+ * See {@link inputView} for further options
1642
+ *
1643
+ * @param {Object} [options]
1454
1644
  *
1455
1645
  * @param {string[]} [options.values]
1456
1646
  * List of possible values to persist in the attribute.
@@ -1464,7 +1654,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1464
1654
  * @param {string[]} [options.translationKeyPrefix]
1465
1655
  * Obtain texts for items from translations by appending the item
1466
1656
  * value to this prefix separated by a dot. By default the
1467
- * [`attributeTranslationKeyPrefixes` option]{@link module:pageflow/ui:inputView}
1657
+ * [`attributeTranslationKeyPrefixes` option]{@link inputView}
1468
1658
  * is used by appending the suffix `.values` to each candidate.
1469
1659
  *
1470
1660
  * @param {string[]} [options.groups]
@@ -1518,11 +1708,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1518
1708
  * value of the `placeholderModel` occurs whenever the attribute is
1519
1709
  * blank.
1520
1710
  *
1521
- * @see {@link module:pageflow/ui.inputView inputView} for further options
1522
1711
  * @class
1523
- * @memberof module:pageflow/ui
1524
1712
  */
1525
1713
 
1714
+
1526
1715
  var SelectInputView = Marionette.ItemView.extend({
1527
1716
  mixins: [inputView],
1528
1717
  template: template$7,
@@ -1654,7 +1843,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1654
1843
  }
1655
1844
  }
1656
1845
  });
1657
-
1658
1846
  var ExtendedSelectInputView = SelectInputView.extend({
1659
1847
  className: 'extended_select_input',
1660
1848
  initialize: function initialize() {
@@ -1755,41 +1943,18 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1755
1943
  });
1756
1944
 
1757
1945
  function template$8(data) {
1758
- var __t, __p = '';
1759
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n\n<!-- inline style for wysihtml5 to pick up -->\n<textarea style="width: 100%;" dir="auto"></textarea>\n\n<div class="toolbar">\n <a data-wysihtml5-command="bold" title="' +
1760
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.bold') )) == null ? '' : __t) +
1761
- '"></a>\n <a data-wysihtml5-command="italic" title="' +
1762
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.italic') )) == null ? '' : __t) +
1763
- '"></a>\n <a data-wysihtml5-command="underline" title="' +
1764
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.underline') )) == null ? '' : __t) +
1765
- '"></a>\n <a data-wysihtml5-command="createLink" class="link_button" title="' +
1766
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.create_link') )) == null ? '' : __t) +
1767
- '"></a>\n <a data-wysihtml5-command="insertOrderedList" title="' +
1768
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.insert_ordered_list') )) == null ? '' : __t) +
1769
- '"></a>\n <a data-wysihtml5-command="insertUnorderedList" title="' +
1770
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.insert_unordered_list') )) == null ? '' : __t) +
1771
- '"></a>\n\n <div data-wysihtml5-dialog="createLink" class="dialog link_dialog" style="display: none;">\n <div class="link_type_select">\n <label>\n <input type="radio" name="link_type" class="url_link_radio_button">\n ' +
1772
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.link_type.url') )) == null ? '' : __t) +
1773
- '\n </label>\n <label>\n <input type="radio" name="link_type" class="fragment_link_radio_button">\n ' +
1774
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.link_type.page_link') )) == null ? '' : __t) +
1775
- '\n </label>\n </div>\n <div class="url_link_panel">\n <label>\n ' +
1776
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.target') )) == null ? '' : __t) +
1777
- '\n </label>\n <input type="text" class="display_url">\n <div class="open_in_new_tab_section">\n <label>\n <input type="checkbox" class="open_in_new_tab">\n ' +
1778
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab') )) == null ? '' : __t) +
1779
- '\n </label>\n <span class="inline_help">\n ' +
1780
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab_help') )) == null ? '' : __t) +
1781
- '\n </span>\n </div>\n </div>\n <div class="fragment_link_panel">\n <!-- LinkInputView is inserted here -->\n </div>\n\n <!-- wysihtml5 does not handle hidden fields correctly -->\n <div class="internal">\n <input type="text" data-wysihtml5-dialog-field="href" class="current_url" value="http://">\n <input type="text" data-wysihtml5-dialog-field="target" class="current_target" value="_blank">\n </div>\n\n <a class="button" data-wysihtml5-dialog-action="save">\n ' +
1782
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.save') )) == null ? '' : __t) +
1783
- '\n </a>\n <a class="button" data-wysihtml5-dialog-action="cancel">\n ' +
1784
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.cancel') )) == null ? '' : __t) +
1785
- '\n </a>\n\n <a data-wysihtml5-command="removeLink">' +
1786
- ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.remove_link') )) == null ? '' : __t) +
1787
- '</a>\n </div>\n</div>\n';
1788
- return __p
1789
- }
1946
+ var __t,
1947
+ __p = '';
1790
1948
 
1949
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n\n<!-- inline style for wysihtml5 to pick up -->\n<textarea style="width: 100%;" dir="auto"></textarea>\n\n<div class="toolbar">\n <a data-wysihtml5-command="bold" title="' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.bold')) == null ? '' : __t) + '"></a>\n <a data-wysihtml5-command="italic" title="' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.italic')) == null ? '' : __t) + '"></a>\n <a data-wysihtml5-command="underline" title="' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.underline')) == null ? '' : __t) + '"></a>\n <a data-wysihtml5-command="createLink" class="link_button" title="' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.create_link')) == null ? '' : __t) + '"></a>\n <a data-wysihtml5-command="insertOrderedList" title="' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.insert_ordered_list')) == null ? '' : __t) + '"></a>\n <a data-wysihtml5-command="insertUnorderedList" title="' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.insert_unordered_list')) == null ? '' : __t) + '"></a>\n\n <div data-wysihtml5-dialog="createLink" class="dialog link_dialog" style="display: none;">\n <div class="link_type_select">\n <label>\n <input type="radio" name="link_type" class="url_link_radio_button">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.link_type.url')) == null ? '' : __t) + '\n </label>\n <label>\n <input type="radio" name="link_type" class="fragment_link_radio_button">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.link_type.page_link')) == null ? '' : __t) + '\n </label>\n </div>\n <div class="url_link_panel">\n <label>\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.target')) == null ? '' : __t) + '\n </label>\n <input type="text" class="display_url">\n <div class="open_in_new_tab_section">\n <label>\n <input type="checkbox" class="open_in_new_tab">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab')) == null ? '' : __t) + '\n </label>\n <span class="inline_help">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab_help')) == null ? '' : __t) + '\n </span>\n </div>\n </div>\n <div class="fragment_link_panel">\n <!-- LinkInputView is inserted here -->\n </div>\n\n <!-- wysihtml5 does not handle hidden fields correctly -->\n <div class="internal">\n <input type="text" data-wysihtml5-dialog-field="href" class="current_url" value="http://">\n <input type="text" data-wysihtml5-dialog-field="target" class="current_target" value="_blank">\n </div>\n\n <a class="button" data-wysihtml5-dialog-action="save">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.save')) == null ? '' : __t) + '\n </a>\n <a class="button" data-wysihtml5-dialog-action="cancel">\n ' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.cancel')) == null ? '' : __t) + '\n </a>\n\n <a data-wysihtml5-command="removeLink">' + ((__t = I18n.t('pageflow.ui.templates.inputs.text_area_input.remove_link')) == null ? '' : __t) + '</a>\n </div>\n</div>\n';
1950
+ return __p;
1951
+ }
1791
1952
  /**
1792
1953
  * Input view for multi line text with simple formatting options.
1954
+ * See {@link inputWithPlaceholderText} for placeholder related options.
1955
+ * See {@link inputView} for further options.
1956
+ *
1957
+ * @param {Object} [options]
1793
1958
  *
1794
1959
  * @param {string} [options.size="normal"]
1795
1960
  * Pass `"short"` to reduce the text area height.
@@ -1805,15 +1970,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1805
1970
  * of a url fragment. Will receive a model with a `linkId`
1806
1971
  * attribute.
1807
1972
  *
1808
- * @see
1809
- * {@link module:pageflow/ui.inputWithPlaceholderText inputWithPlaceholderText}
1810
- * for placeholder related options
1811
- *
1812
- * @see {@link module:pageflow/ui.inputView inputView} for further options
1813
1973
  * @class
1814
- * @memberof module:pageflow/ui
1815
1974
  */
1816
1975
 
1976
+
1817
1977
  var TextAreaInputView = Marionette.ItemView.extend({
1818
1978
  mixins: [inputView, inputWithPlaceholderText],
1819
1979
  template: template$8,
@@ -1994,13 +2154,15 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
1994
2154
  });
1995
2155
 
1996
2156
  function template$9(data) {
1997
- var __p = '';
1998
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<input type="text" />\n<div class="validation"></div>\n';
1999
- return __p
2157
+ var __p = '';
2158
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<input type="text" />\n<div class="validation"></div>\n';
2159
+ return __p;
2000
2160
  }
2001
-
2002
2161
  /**
2003
2162
  * Input view for URLs.
2163
+ * See {@link inputView} for further options
2164
+ *
2165
+ * @param {Object} [options]
2004
2166
  *
2005
2167
  * @param {string[]} options.supportedHosts
2006
2168
  * List of allowed url prefixes.
@@ -2011,13 +2173,12 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2011
2173
  * @param {boolean} [options.permitHttps=false]
2012
2174
  * Allow urls with https protocol.
2013
2175
  *
2014
- * @see {@link module:pageflow/ui.inputView inputView} for further options
2015
2176
  * @class
2016
- * @memberof module:pageflow/ui
2017
2177
  */
2018
2178
 
2179
+
2019
2180
  var UrlInputView = Marionette.Layout.extend(
2020
- /** @lends module:pageflow/ui.UrlInputView# */
2181
+ /** @lends UrlInputView.prototype */
2021
2182
  {
2022
2183
  mixins: [inputView],
2023
2184
  template: template$9,
@@ -2143,7 +2304,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2143
2304
  }
2144
2305
  }
2145
2306
  });
2146
-
2147
2307
  /**
2148
2308
  * Input view that verifies that a certain URL is reachable via a
2149
2309
  * proxy. To conform with same origin restrictions, this input view
@@ -2155,6 +2315,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2155
2315
  * `http://example.com/some/path` but the string `/example/some/path`
2156
2316
  * is persisited to the database.
2157
2317
  *
2318
+ * See {@link inputView} for further options
2319
+ *
2320
+ * @param {Object} options
2321
+ *
2158
2322
  * @param {string} options.displayPropertyName
2159
2323
  * Attribute name to store the url entered by the user.
2160
2324
  *
@@ -2184,13 +2348,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2184
2348
  * ]
2185
2349
  * });
2186
2350
  *
2187
- * @see {@link module:pageflow/ui.inputView inputView} for further options
2188
2351
  * @class
2189
- * @memberof module:pageflow/ui
2190
2352
  */
2191
2353
 
2192
2354
  var ProxyUrlInputView = UrlInputView.extend(
2193
- /** @lends module:pageflow/ui.ProxyUrlInputView# */
2355
+ /** @lends ProxyUrlInputView.prototype */
2194
2356
  {
2195
2357
  // @override
2196
2358
  validateUrl: function validateUrl(url) {
@@ -2207,11 +2369,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2207
2369
  });
2208
2370
  }).promise();
2209
2371
  },
2210
- // @override
2372
+ // override
2211
2373
  transformPropertyValue: function transformPropertyValue(url) {
2212
2374
  return this.rewriteUrl(url);
2213
2375
  },
2214
- // @override
2376
+ // override
2215
2377
  supportedHosts: function supportedHosts() {
2216
2378
  return _$1.pluck(this.options.proxies, 'url');
2217
2379
  },
@@ -2225,19 +2387,20 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2225
2387
  });
2226
2388
 
2227
2389
  function template$a(data) {
2228
- var __p = '';
2229
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="value"></div>\n<div class="slider"></div>\n';
2230
- return __p
2390
+ var __p = '';
2391
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="value"></div>\n<div class="slider"></div>\n';
2392
+ return __p;
2231
2393
  }
2232
-
2233
2394
  /**
2234
2395
  * A slider for numeric inputs.
2396
+ * See {@link inputView} for options
2397
+ *
2398
+ * @param {Object} [options]
2235
2399
  *
2236
- * @see {@link module:pageflow/ui.inputView inputView} for options
2237
2400
  * @class
2238
- * @memberof module:pageflow/ui
2239
2401
  */
2240
2402
 
2403
+
2241
2404
  var SliderInputView = Marionette.ItemView.extend({
2242
2405
  mixins: [inputView],
2243
2406
  className: 'slider_input',
@@ -2277,9 +2440,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2277
2440
  });
2278
2441
 
2279
2442
  function template$b(data) {
2280
- var __p = '';
2281
- __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n\n<textarea></textarea>\n';
2282
- return __p
2443
+ var __p = '';
2444
+ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n\n<textarea></textarea>\n';
2445
+ return __p;
2283
2446
  }
2284
2447
 
2285
2448
  var JsonInputView = Marionette.ItemView.extend({
@@ -2346,23 +2509,24 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2346
2509
  });
2347
2510
 
2348
2511
  function template$c(data) {
2349
- var __p = '';
2350
- __p += '<input type="checkbox" />\n<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>';
2351
- return __p
2512
+ var __p = '';
2513
+ __p += '<input type="checkbox" />\n<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>';
2514
+ return __p;
2352
2515
  }
2353
-
2354
2516
  /**
2355
2517
  * Input view for boolean values.
2518
+ * See {@link inputView} for further options
2519
+ *
2520
+ * @param {Object} [options]
2356
2521
  *
2357
2522
  * @param {boolean} [options.displayUncheckedIfDisabled=false]
2358
2523
  * Ignore the attribute value if the input is disabled and display
2359
2524
  * an unchecked check box.
2360
2525
  *
2361
- * @see {@link module:pageflow/ui.inputView inputView} for further options
2362
2526
  * @class
2363
- * @memberof module:pageflow/ui
2364
2527
  */
2365
2528
 
2529
+
2366
2530
  var CheckBoxInputView = Marionette.ItemView.extend({
2367
2531
  mixins: [inputView],
2368
2532
  template: template$c,
@@ -2398,7 +2562,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2398
2562
  }
2399
2563
  }
2400
2564
  });
2401
-
2402
2565
  /**
2403
2566
  * A table cell mapping column attribute values to a list of
2404
2567
  * translations.
@@ -2426,13 +2589,12 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2426
2589
  });
2427
2590
 
2428
2591
  function template$d(data) {
2429
- var __t, __p = '';
2430
- __p += '<a class="remove" title="' +
2431
- ((__t = ( I18n.t('pageflow.editor.templates.row.destroy') )) == null ? '' : __t) +
2432
- '"></a>\n';
2433
- return __p
2434
- }
2592
+ var __t,
2593
+ __p = '';
2435
2594
 
2595
+ __p += '<a class="remove" title="' + ((__t = I18n.t('pageflow.editor.templates.row.destroy')) == null ? '' : __t) + '"></a>\n';
2596
+ return __p;
2597
+ }
2436
2598
  /**
2437
2599
  * A table cell providing a button which destroys the model that the
2438
2600
  * current row refers to.
@@ -2443,6 +2605,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2443
2605
  *
2444
2606
  * - `.cell_title` - Used as title attribute.
2445
2607
  *
2608
+ * @param {Object} [options]
2609
+ *
2446
2610
  * @param {function} [options.toggleDeleteButton]
2447
2611
  * A function with boolean return value to be called on
2448
2612
  * this.getModel(). Delete button will be visible only if the
@@ -2454,6 +2618,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2454
2618
  * @since 12.0
2455
2619
  */
2456
2620
 
2621
+
2457
2622
  var DeleteRowTableCellView = TableCellView.extend({
2458
2623
  className: 'delete_row_table_cell',
2459
2624
  template: template$d,
@@ -2488,7 +2653,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2488
2653
  this.getModel().destroy();
2489
2654
  }
2490
2655
  });
2491
-
2492
2656
  /**
2493
2657
  * A table cell representing whether the column attribute is present
2494
2658
  * on the row model.
@@ -2516,7 +2680,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2516
2680
  this.$el.toggleClass('is_present', isPresent);
2517
2681
  }
2518
2682
  });
2519
-
2520
2683
  /**
2521
2684
  * A table cell mapping column attribute values to icons.
2522
2685
  *
@@ -2527,6 +2690,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2527
2690
  * - `.cell_title.<attribute_value>` - Used as title attribute.
2528
2691
  * - `.cell_title.blank` - Used as title attribute if attribute is blank.
2529
2692
  *
2693
+ * @param {Object} [options]
2694
+ *
2530
2695
  * @param {string[]} [options.icons]
2531
2696
  * An array of all possible attribute values to be mapped to HTML
2532
2697
  * classes of the same name. A global mapping from those classes to
@@ -2551,12 +2716,13 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2551
2716
  this.$el.removeClass(this.options.icons.join(' '));
2552
2717
  }
2553
2718
  });
2554
-
2555
2719
  /**
2556
2720
  * A table cell using the row model's value of the column attribute as
2557
2721
  * text. If attribute value is empty, use most specific default
2558
2722
  * available.
2559
2723
  *
2724
+ * @param {Object} [options]
2725
+ *
2560
2726
  * @param {function|string} [options.column.default]
2561
2727
  * A function returning a default value for display if attribute
2562
2728
  * value is empty.
@@ -2596,7 +2762,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2596
2762
  }
2597
2763
  }
2598
2764
  });
2599
-
2600
2765
  var subviewContainer = {
2601
2766
  subview: function subview(view) {
2602
2767
  this.subviews = this.subviews || new ChildViewContainer();
@@ -2613,7 +2778,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2613
2778
  }
2614
2779
  };
2615
2780
  Cocktail.mixin(Marionette.View, subviewContainer);
2616
-
2617
2781
  var tooltipContainer = {
2618
2782
  events: {
2619
2783
  'mouseover [data-tooltip]': function mouseoverDataTooltip(event) {
@@ -2685,7 +2849,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2685
2849
  * Retryable failures should implement `retryAction`.
2686
2850
  *
2687
2851
  * @class
2688
- * @memberof module:pageflow/editor
2689
2852
  */
2690
2853
 
2691
2854
  var Failure = BaseObject.extend({
@@ -2706,25 +2869,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2706
2869
  return this.model.cid + '-' + this.type;
2707
2870
  }
2708
2871
  });
2709
- /**
2710
- * SavingFailure represents a unsuccessful attempt to save
2711
- * a model on the server.
2712
- *
2713
- * @class
2714
- * @memberof module:pageflow/editor
2715
- */
2716
-
2717
2872
  var SavingFailure = Failure.extend({
2718
2873
  type: 'SavingFailure'
2719
2874
  });
2720
- /**
2721
- * OrderingFailure represent a unsuccessful attempt to save
2722
- * the ordering of a orderedCollection.
2723
- *
2724
- * @class
2725
- * @memberof module:pageflow/editor
2726
- */
2727
-
2728
2875
  var OrderingFailure = Failure.extend({
2729
2876
  type: 'OrderingFailure',
2730
2877
  initialize: function initialize(model, collection) {
@@ -2748,12 +2895,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2748
2895
  *
2749
2896
  * editor.failures.add(new OrderingFailure(model, collection));
2750
2897
  *
2751
- * @alias pageflow.Failures
2752
- * @memberof module:pageflow/editor
2898
+ * @alias Failures
2753
2899
  */
2754
2900
 
2755
2901
  var FailuresAPI = BaseObject.extend(
2756
- /** @lends module:pageflow/editor.pageflow.Failures */
2902
+ /** @lends Failures.prototype */
2757
2903
  {
2758
2904
  initialize: function initialize() {
2759
2905
  this.failures = {};
@@ -2762,8 +2908,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2762
2908
 
2763
2909
  /**
2764
2910
  * Listen to the `error` and `sync` events of a collection and
2765
- * create {@link module:pageflow/editor.SavingFailure
2766
- * SavingFailure} objects.
2911
+ * create failure objects.
2767
2912
  */
2768
2913
  watch: function watch(collection) {
2769
2914
  this.listenTo(collection, 'sync', this.remove);
@@ -2916,8 +3061,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
2916
3061
  };
2917
3062
  });
2918
3063
 
2919
- /*global pageflow*/
2920
- var state = pageflow;
3064
+ var state = window.pageflow || {};
2921
3065
 
2922
3066
  function template$e(data) {
2923
3067
  var __p = '';
@@ -3031,6 +3175,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3031
3175
  * Base class for views used as `valueView` for file type meta data
3032
3176
  * attributes.
3033
3177
  *
3178
+ * @param {Object} [options]
3179
+ *
3034
3180
  * @param {string} [options.name]
3035
3181
  * Name of the meta data item used in translation keys.
3036
3182
  *
@@ -3041,7 +3187,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3041
3187
  * @since 12.0
3042
3188
  *
3043
3189
  * @class
3044
- * @memberof module:pageflow/editor
3045
3190
  */
3046
3191
 
3047
3192
  var FileMetaDataItemValueView = Marionette.ItemView.extend({
@@ -3077,18 +3222,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3077
3222
  }
3078
3223
  });
3079
3224
 
3080
- /**
3081
- * Renders the value of the attribute given in `options.name`.
3082
- *
3083
- * @see {@link module:pageflow/editor.FileMetaDataItemValueView
3084
- * FileMetaDataItemValueView} for further options.
3085
- *
3086
- * @since 12.0
3087
- *
3088
- * @class
3089
- * @memberof module:pageflow/editor
3090
- */
3091
-
3092
3225
  var TextFileMetaDataItemValueView = FileMetaDataItemValueView.extend({
3093
3226
  getText: function getText() {
3094
3227
  var model;
@@ -3249,12 +3382,16 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3249
3382
  },
3250
3383
  setup: function setup(serverSideConfigs) {
3251
3384
  this._setup = true;
3252
- var importers = this.importers;
3385
+ var registeredImporters = this.importers;
3386
+ var importers = {};
3253
3387
  serverSideConfigs.forEach(function (importer) {
3254
- importers[importer.importerName]['authenticationRequired'] = importer.authenticationRequired;
3255
- importers[importer.importerName]['authenticationProvider'] = importer.authenticationProvider;
3256
- importers[importer.importerName]['logoSource'] = importer.logoSource;
3388
+ var regImporter = registeredImporters[importer.importerName];
3389
+ regImporter['authenticationRequired'] = importer.authenticationRequired;
3390
+ regImporter['authenticationProvider'] = importer.authenticationProvider;
3391
+ regImporter['logoSource'] = importer.logoSource;
3392
+ importers[importer.importerName] = regImporter;
3257
3393
  });
3394
+ this.importers = importers;
3258
3395
  },
3259
3396
  find: function find(name) {
3260
3397
  if (!this.importers[name]) {
@@ -3369,27 +3506,83 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3369
3506
  };
3370
3507
  });
3371
3508
 
3372
- var WidgetType = BaseObject.extend({
3373
- initialize: function initialize(serverSideConfig, clientSideConfig) {
3374
- this.name = serverSideConfig.name;
3375
- this.translationKey = serverSideConfig.translationKey;
3376
- this.configurationEditorView = clientSideConfig.configurationEditorView;
3377
- this.isOptional = clientSideConfig.isOptional;
3509
+ // different model types. Backbone.Collection tries to merge records
3510
+ // if they have the same id.
3511
+
3512
+ var MultiCollection = function MultiCollection() {
3513
+ this.records = {};
3514
+ this.length = 0;
3515
+ };
3516
+
3517
+ _$1.extend(MultiCollection.prototype, {
3518
+ add: function add(record) {
3519
+ if (!this.records[record.cid]) {
3520
+ this.records[record.cid] = record;
3521
+ this.length = _$1.keys(this.records).length;
3522
+ this.trigger('add', record);
3523
+ }
3378
3524
  },
3379
- hasConfiguration: function hasConfiguration() {
3380
- return !!this.configurationEditorView;
3525
+ remove: function remove(record) {
3526
+ if (this.records[record.cid]) {
3527
+ delete this.records[record.cid];
3528
+ this.length = _$1.keys(this.records).length;
3529
+ this.trigger('remove', record);
3530
+ }
3381
3531
  },
3382
- createConfigurationEditorView: function createConfigurationEditorView(options) {
3383
- var constructor = this.configurationEditorView;
3384
- return new constructor(_$1.extend({
3385
- attributeTranslationKeyPrefixes: ['pageflow.editor.widgets.attributes.' + this.name, 'pageflow.editor.widgets.common_attributes']
3386
- }, options));
3532
+ isEmpty: function isEmpty() {
3533
+ return this.length === 0;
3387
3534
  }
3388
3535
  });
3389
3536
 
3390
- var WidgetTypes = BaseObject.extend({
3391
- initialize: function initialize() {
3392
- this._clientSideConfigs = {};
3537
+ _$1.extend(MultiCollection.prototype, Backbone.Events);
3538
+
3539
+ MultiCollection.extend = Backbone.Collection.extend;
3540
+
3541
+ /**
3542
+ * Watch Backbone collections to track which models are currently
3543
+ * being saved. Used to update the notifications view displaying
3544
+ * saving status/failutes.
3545
+ */
3546
+
3547
+ var SavingRecordsCollection = MultiCollection.extend({
3548
+ /**
3549
+ * Listen to events of models in collection to track when they are
3550
+ * being saved.
3551
+ *
3552
+ * @param {Backbone.Collection} collection - Collection to watch.
3553
+ */
3554
+ watch: function watch(collection) {
3555
+ var that = this;
3556
+ this.listenTo(collection, 'request', function (model, xhr) {
3557
+ that.add(model);
3558
+ xhr.always(function () {
3559
+ that.remove(model);
3560
+ });
3561
+ });
3562
+ }
3563
+ });
3564
+
3565
+ var WidgetType = BaseObject.extend({
3566
+ initialize: function initialize(serverSideConfig, clientSideConfig) {
3567
+ this.name = serverSideConfig.name;
3568
+ this.translationKey = serverSideConfig.translationKey;
3569
+ this.configurationEditorView = clientSideConfig.configurationEditorView;
3570
+ this.isOptional = clientSideConfig.isOptional;
3571
+ },
3572
+ hasConfiguration: function hasConfiguration() {
3573
+ return !!this.configurationEditorView;
3574
+ },
3575
+ createConfigurationEditorView: function createConfigurationEditorView(options) {
3576
+ var constructor = this.configurationEditorView;
3577
+ return new constructor(_$1.extend({
3578
+ attributeTranslationKeyPrefixes: ['pageflow.editor.widgets.attributes.' + this.name, 'pageflow.editor.widgets.common_attributes']
3579
+ }, options));
3580
+ }
3581
+ });
3582
+
3583
+ var WidgetTypes = BaseObject.extend({
3584
+ initialize: function initialize() {
3585
+ this._clientSideConfigs = {};
3393
3586
  this._optionalRoles = {};
3394
3587
  },
3395
3588
  register: function register(name, config) {
@@ -3433,14 +3626,16 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3433
3626
  }
3434
3627
  });
3435
3628
 
3629
+ 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; }
3630
+
3631
+ 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; }
3436
3632
  /**
3437
3633
  * Interface for engines providing editor extensions.
3438
3634
  * @alias editor
3439
- * @memberof module:pageflow/editor
3440
3635
  */
3441
3636
 
3442
3637
  var EditorApi = BaseObject.extend(
3443
- /** @lends module:pageflow/editor.editor */
3638
+ /** @lends editor */
3444
3639
  {
3445
3640
  initialize: function initialize(options) {
3446
3641
  this.router = options && options.router;
@@ -3451,50 +3646,80 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3451
3646
  /**
3452
3647
  * Failures API
3453
3648
  *
3454
- * @returns {pageflow.Failures}
3455
- *
3456
- * @alias failures
3457
- * @memberof module:pageflow/editor.editor
3649
+ * @returns {Failures}
3650
+ * @memberof editor
3458
3651
  */
3459
3652
 
3460
3653
  this.failures = new FailuresAPI();
3654
+ /**
3655
+ * Tracking records that are currently being saved.
3656
+ *
3657
+ * @returns {SavingRecordsCollection}
3658
+ * @memberof editor
3659
+ * @since 15.1
3660
+ */
3661
+
3662
+ this.savingRecords = new SavingRecordsCollection();
3461
3663
  /**
3462
3664
  * Set up editor integration for page types.
3463
- * @alias pageTypes
3464
- * @memberof module:pageflow/editor.editor
3665
+ * @memberof editor
3465
3666
  */
3466
3667
 
3467
3668
  this.pageTypes = new PageTypes();
3468
3669
  /**
3469
3670
  * Add tabs to the configuration editor of all pages.
3470
- * @alias commonPageConfigurationTabs
3471
- * @memberof module:pageflow/editor.editor
3671
+ * @memberof editor
3472
3672
  */
3473
3673
 
3474
3674
  this.commonPageConfigurationTabs = new CommonPageConfigurationTabs();
3475
3675
  /**
3476
3676
  * Setup editor integration for widget types.
3477
- * @alias widgetType
3478
- * @memberof module:pageflow/editor.editor
3677
+ * @memberof editor
3479
3678
  */
3480
3679
 
3481
3680
  this.widgetTypes = new WidgetTypes();
3482
3681
  /**
3483
- * @alias fileTypes
3484
- * @memberof module:pageflow/editor.editor
3485
3682
  * Set up editor integration for file types
3683
+ * @memberof editor
3486
3684
  */
3487
3685
 
3488
3686
  this.fileTypes = new FileTypes();
3489
3687
  /**
3490
3688
  * List of available file import plugins
3491
- * @alias fileImporters
3492
- *
3689
+ * @memberof editor
3493
3690
  */
3494
3691
 
3495
3692
  this.fileImporters = new FileImporters();
3496
3693
  },
3497
3694
 
3695
+ /**
3696
+ * Configure editor for entry type.
3697
+ *
3698
+ * @param {string} name
3699
+ * Must match name of entry type registered in Ruby configuration.
3700
+ * @param {Object} options
3701
+ * @param {function} options.EntryModel
3702
+ * Backbone model extending {Entry} to store entry state.
3703
+ * @param {function} options.EntryPreviewView
3704
+ * Backbone view that will render the live preview of the entry.
3705
+ * @param {function} options.EntryOutlineView
3706
+ * Backbone view that will be rendered in the side bar.
3707
+ */
3708
+ registerEntryType: function registerEntryType(name, options) {
3709
+ this.entryType = _objectSpread({
3710
+ name: name
3711
+ }, options);
3712
+ },
3713
+ createEntryModel: function createEntryModel(seed, options) {
3714
+ var entry = new this.entryType.entryModel(seed.entry, options);
3715
+
3716
+ if (entry.setupFromEntryTypeSeed) {
3717
+ entry.setupFromEntryTypeSeed(seed.entry_type, state);
3718
+ }
3719
+
3720
+ return entry;
3721
+ },
3722
+
3498
3723
  /**
3499
3724
  * Display Backbone/Marionette View inside the main panel
3500
3725
  * of the editor.
@@ -3598,7 +3823,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3598
3823
  * File selection handlers let editor extensions use the files view
3599
3824
  * to select files for usage in their custom models.
3600
3825
  *
3601
- * See {@link module:pageflow/editor.editor.selectFile
3826
+ * See {@link #editorselectfile
3602
3827
  * selectFile} method for details how to trigger file selection.
3603
3828
  *
3604
3829
  * Example:
@@ -3629,7 +3854,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3629
3854
  *
3630
3855
  * @param {string} handlerName
3631
3856
  * The name of a handler registered via {@link
3632
- * module:pageflow/editor.editor.registerFileSelectionHandler}.
3857
+ * #editorregisterfileselectionhandler registerFileSelectionHandler}.
3633
3858
  *
3634
3859
  * @param {Object} payload
3635
3860
  * Options passed to the file selection handler.
@@ -3665,7 +3890,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3665
3890
  * whether the page is a valid selection
3666
3891
  */
3667
3892
  selectPage: function selectPage(options) {
3668
- return this.pageSelectionView.selectPage(options);
3893
+ return this.pageSelectionView.selectPage(_objectSpread({}, options, {
3894
+ entry: state.entry
3895
+ }));
3669
3896
  },
3670
3897
  createFileSelectionHandler: function createFileSelectionHandler(handlerName, encodedPayload) {
3671
3898
  if (!this.fileSelectionHandlers[handlerName]) {
@@ -3673,7 +3900,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3673
3900
  }
3674
3901
 
3675
3902
  var payloadJson = JSON.parse(decodeURIComponent(encodedPayload));
3676
- return new this.fileSelectionHandlers[handlerName](payloadJson);
3903
+ return new this.fileSelectionHandlers[handlerName](_objectSpread({}, payloadJson, {
3904
+ entry: state.entry
3905
+ }));
3677
3906
  },
3678
3907
  createPageConfigurationEditorView: function createPageConfigurationEditorView(page, options) {
3679
3908
  var view = this.pageTypes.findByPage(page).createConfigurationEditorView(_$1.extend(options, {
@@ -3684,11 +3913,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3684
3913
  }
3685
3914
  });
3686
3915
 
3687
- /**
3688
- * The Pageflow editor.
3689
- * @module pageflow/editor
3690
- */
3691
-
3692
3916
  var editor = new EditorApi();
3693
3917
  var startEditor = function startEditor(options) {
3694
3918
  $(function () {
@@ -3700,6 +3924,79 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3700
3924
  });
3701
3925
  };
3702
3926
 
3927
+ /**
3928
+ * Mixins for Backbone models and collections that use entry type
3929
+ * specific editor controllers registered via the `editor_app` entry
3930
+ * type option.
3931
+ */
3932
+
3933
+ var entryTypeEditorControllerUrls = {
3934
+ /**
3935
+ * Mixins for Backbone collections that defines `url` method.
3936
+ *
3937
+ * @param {Object} options
3938
+ * @param {String} options.resources - Path suffix of the controller route
3939
+ *
3940
+ * @example
3941
+ *
3942
+ * import {editor, entryTypeEditorControllerUrls} from 'pageflow/editor';
3943
+ *
3944
+ * editor.registerEntryType('test', {
3945
+ // ...
3946
+ });
3947
+ *
3948
+ * export const ItemsCollection = Backbone.Collection.extend({
3949
+ * mixins: [entryTypeEditorControllerUrls.forCollection({resources: 'items'})
3950
+ * });
3951
+ *
3952
+ * new ItemsCollection().url() // => '/editor/entries/10/test/items'
3953
+ */
3954
+ forCollection: function forCollection(_ref) {
3955
+ var resources = _ref.resources;
3956
+ return {
3957
+ url: function url() {
3958
+ return entryTypeEditorControllerUrl(resources);
3959
+ },
3960
+ urlSuffix: function urlSuffix() {
3961
+ return "/".concat(resources);
3962
+ }
3963
+ };
3964
+ },
3965
+
3966
+ /**
3967
+ * Mixins for Backbone models that defines `urlRoot` method.
3968
+ *
3969
+ * @param {Object} options
3970
+ * @param {String} options.resources - Path suffix of the controller route
3971
+ *
3972
+ * @example
3973
+ *
3974
+ * import {editor, entryTypeEditorControllerUrls} from 'pageflow/editor';
3975
+ *
3976
+ * editor.registerEntryType('test', {
3977
+ // ...
3978
+ });
3979
+ *
3980
+ * export const Item = Backbone.Model.extend({
3981
+ * mixins: [entryTypeEditorControllerUrls.forModel({resources: 'items'})
3982
+ * });
3983
+ *
3984
+ * new Item({id: 20}).url() // => '/editor/entries/10/test/items/20'
3985
+ */
3986
+ forModel: function forModel(_ref2) {
3987
+ var resources = _ref2.resources;
3988
+ return {
3989
+ urlRoot: function urlRoot() {
3990
+ return this.isNew() ? this.collection.url() : entryTypeEditorControllerUrl(resources);
3991
+ }
3992
+ };
3993
+ }
3994
+ };
3995
+
3996
+ function entryTypeEditorControllerUrl(resources) {
3997
+ return [state.entry.url(), editor.entryType.name, resources].join('/');
3998
+ }
3999
+
3703
4000
  var formDataUtils = {
3704
4001
  fromModel: function fromModel(model) {
3705
4002
  var object = {};
@@ -3807,7 +4104,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3807
4104
  this.reset();
3808
4105
  },
3809
4106
  url: function url() {
3810
- return this.parentModel.url() + _$1.result(this.parent, 'url');
4107
+ return this.parentModel.url() + (_$1.result(this.parent, 'urlSuffix') || _$1.result(this.parent, 'url'));
3811
4108
  },
3812
4109
  dispose: function dispose() {
3813
4110
  this.stopListening();
@@ -3918,7 +4215,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
3918
4215
  var EditLock = Backbone.Model.extend({
3919
4216
  paramRoot: 'edit_lock',
3920
4217
  url: function url() {
3921
- return state.entry.url() + '/edit_lock?timestamp=' + new Date().getTime();
4218
+ return '/entries/' + state.entry.get('id') + '/edit_lock?timestamp=' + new Date().getTime();
3922
4219
  },
3923
4220
  toJSON: function toJSON() {
3924
4221
  return {
@@ -4116,10 +4413,22 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
4116
4413
  Cocktail.mixin(Configuration, mixin);
4117
4414
  });
4118
4415
 
4416
+ /**
4417
+ * Remove model from collection only after the `DELETE` request has
4418
+ * succeeded. Still allow tracking that the model is being destroyed
4419
+ * by triggering a `destroying` event and adding a `isDestroying`
4420
+ * method.
4421
+ */
4422
+
4119
4423
  var delayedDestroying = {
4120
4424
  initialize: function initialize() {
4121
4425
  this._destroying = false;
4122
4426
  },
4427
+
4428
+ /**
4429
+ * Trigger `destroying` event and send `DELETE` request. Only remove
4430
+ * model from collection once the request is done.
4431
+ */
4123
4432
  destroyWithDelay: function destroyWithDelay() {
4124
4433
  var model = this;
4125
4434
  this._destroying = true;
@@ -4134,11 +4443,19 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
4134
4443
  }
4135
4444
  });
4136
4445
  },
4446
+
4447
+ /**
4448
+ * Get whether the model is currently being destroyed.
4449
+ */
4137
4450
  isDestroying: function isDestroying() {
4138
4451
  return this._destroying;
4139
4452
  }
4140
4453
  };
4141
4454
 
4455
+ /**
4456
+ * Mixin for Backbone models that shall be watched by {@link
4457
+ * modelLifecycleTrackingView} mixin.
4458
+ */
4142
4459
  var failureTracking = {
4143
4460
  initialize: function initialize() {
4144
4461
  this._saveFailed = false;
@@ -4735,9 +5052,23 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
4735
5052
  }
4736
5053
  });
4737
5054
 
4738
- var EntryConfiguration = Configuration.extend({
5055
+ var EntryMetadataConfiguration = Configuration.extend({
5056
+ modelName: 'entry_metadata_configuration',
5057
+ i18nKey: 'pageflow/entry_metadata_configuration',
5058
+ defaults: {}
5059
+ });
5060
+
5061
+ var EntryMetadata = Configuration.extend({
4739
5062
  modelName: 'entry',
4740
- i18nKey: 'pageflow/entry'
5063
+ i18nKey: 'pageflow/entry',
5064
+ defaults: {},
5065
+ initialize: function initialize(attributes, options) {
5066
+ this.configuration = new EntryMetadataConfiguration(_$1.clone(attributes.configuration) || {});
5067
+ this.listenTo(this.configuration, 'change', function () {
5068
+ this.trigger('change');
5069
+ this.parent.save();
5070
+ });
5071
+ }
4741
5072
  });
4742
5073
 
4743
5074
  var StorylineConfiguration = Configuration.extend({
@@ -4916,16 +5247,16 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
4916
5247
  }
4917
5248
  });
4918
5249
 
4919
- var EntryConfigurationFileSelectionHandler = function EntryConfigurationFileSelectionHandler(options) {
5250
+ var EntryMetadataFileSelectionHandler = function EntryMetadataFileSelectionHandler(options) {
4920
5251
  this.call = function (file) {
4921
- state.entry.configuration.setReference(options.attributeName, file);
5252
+ state.entry.metadata.setReference(options.attributeName, file);
4922
5253
  };
4923
5254
 
4924
5255
  this.getReferer = function () {
4925
5256
  return '/meta_data/' + (options.returnToTab || 'general');
4926
5257
  };
4927
5258
  };
4928
- editor.registerFileSelectionHandler('entryConfiguration', EntryConfigurationFileSelectionHandler);
5259
+ editor.registerFileSelectionHandler('entryMetadata', EntryMetadataFileSelectionHandler);
4929
5260
 
4930
5261
  var EntryPublication = Backbone.Model.extend({
4931
5262
  paramRoot: 'entry_publication',
@@ -4972,7 +5303,20 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
4972
5303
  }
4973
5304
  });
4974
5305
 
4975
- var EntryData = BaseObject.extend({
5306
+ // https://github.com/jashkenas/backbone/issues/2601
5307
+
5308
+ function BaseObject$1(options) {
5309
+ this.initialize.apply(this, arguments);
5310
+ }
5311
+
5312
+ _$1.extend(BaseObject$1.prototype, Backbone.Events, {
5313
+ initialize: function initialize(options) {}
5314
+ }); // The self-propagating extend function that Backbone classes use.
5315
+
5316
+
5317
+ BaseObject$1.extend = Backbone.Model.extend;
5318
+
5319
+ var EntryData = BaseObject$1.extend({
4976
5320
  getThemingOption: function getThemingOption(name) {
4977
5321
  throw 'Not implemented';
4978
5322
  },
@@ -5569,6 +5913,76 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
5569
5913
  };
5570
5914
  editor.registerFileSelectionHandler('pageLink', PageLinkFileSelectionHandler);
5571
5915
 
5916
+ /**
5917
+ * Mixins for models with a nested configuration model.
5918
+ *
5919
+ * Triggers events on the parent model of the form
5920
+ * `change:configuration` and `change:configuration:<attribute>`, when
5921
+ * the configuration changes.
5922
+ *
5923
+ * @param {Object} [options]
5924
+ * @param {Function} [options.configurationModel] -
5925
+ * Backbone model to use for nested configuration model.
5926
+ * @param {Boolean} [options.autoSave] -
5927
+ * Save model when configuration changes.
5928
+ * @param {Boolean|Array<String>} [options.includeAttributesInJSON] -
5929
+ * Include all or specific attributes of the parent model in the
5930
+ * data returned by `toJSON` besides the `configuration` property.
5931
+ * @returns {Object} - Mixin to be included in model.
5932
+ *
5933
+ * @example
5934
+ *
5935
+ * import {configurationContainer} from 'pageflow/editor';
5936
+ *
5937
+ * const Section = Backbone.Model.extend({
5938
+ * mixins: [configurationContainer({autoSave: true})]
5939
+ * });
5940
+ *
5941
+ * const section = new Section({configuration: {some: 'value'}});
5942
+ * section.configuration.get('some') // => 'value';
5943
+ */
5944
+
5945
+ function configurationContainer() {
5946
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
5947
+ configurationModel = _ref.configurationModel,
5948
+ autoSave = _ref.autoSave,
5949
+ includeAttributesInJSON = _ref.includeAttributesInJSON;
5950
+
5951
+ configurationModel = configurationModel || Configuration.extend({
5952
+ defaults: {}
5953
+ });
5954
+ return {
5955
+ initialize: function initialize() {
5956
+ this.configuration = new configurationModel(this.get('configuration'));
5957
+ this.configuration.parent = this;
5958
+ this.listenTo(this.configuration, 'change', function () {
5959
+ if (!this.isNew() && autoSave) {
5960
+ this.save();
5961
+ }
5962
+
5963
+ this.trigger('change:configuration', this);
5964
+
5965
+ _$1.chain(this.configuration.changed).keys().each(function (name) {
5966
+ this.trigger('change:configuration:' + name, this, this.configuration.get(name));
5967
+ }, this);
5968
+ });
5969
+ },
5970
+ toJSON: function toJSON() {
5971
+ var attributes = {};
5972
+
5973
+ if (includeAttributesInJSON === true) {
5974
+ attributes = _$1.clone(this.attributes);
5975
+ } else if (includeAttributesInJSON) {
5976
+ attributes = _$1.pick(this.attributes, includeAttributesInJSON);
5977
+ }
5978
+
5979
+ return _$1.extend(attributes, {
5980
+ configuration: this.configuration.toJSON()
5981
+ });
5982
+ }
5983
+ };
5984
+ }
5985
+
5572
5986
  var persistedPromise = {
5573
5987
  persisted: function persisted() {
5574
5988
  var model = this;
@@ -5645,15 +6059,15 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
5645
6059
 
5646
6060
  var Entry = Backbone.Model.extend({
5647
6061
  paramRoot: 'entry',
5648
- urlRoot: '/entries',
6062
+ urlRoot: '/editor/entries',
5649
6063
  modelName: 'entry',
5650
6064
  i18nKey: 'pageflow/entry',
5651
6065
  collectionName: 'entries',
5652
6066
  mixins: [filesCountWatcher, polling, failureTracking],
5653
6067
  initialize: function initialize(attributes, options) {
5654
6068
  options = options || {};
5655
- this.configuration = new EntryConfiguration(this.get('configuration') || {});
5656
- this.configuration.parent = this;
6069
+ this.metadata = new EntryMetadata(this.get('metadata') || {});
6070
+ this.metadata.parent = this;
5657
6071
  this.themes = options.themes || state.themes;
5658
6072
  this.files = options.files || state.files;
5659
6073
  this.fileTypes = options.fileTypes || editor.fileTypes;
@@ -5675,11 +6089,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
5675
6089
  this.listenTo(this.chapters, 'sort', function () {
5676
6090
  this.pages.sort();
5677
6091
  });
5678
- this.listenTo(this.configuration, 'change', function () {
5679
- this.trigger('change:configuration');
6092
+ this.listenTo(this.metadata, 'change', function () {
6093
+ this.trigger('change:metadata');
5680
6094
  this.save();
5681
6095
  });
5682
- this.listenTo(this.configuration, 'change:locale', function () {
6096
+ this.listenTo(this.metadata, 'change:locale', function () {
5683
6097
  this.once('sync', function () {
5684
6098
  // No other way of updating page templates used in
5685
6099
  // EntryPreviewView at the moment.
@@ -5688,7 +6102,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
5688
6102
  });
5689
6103
  },
5690
6104
  getTheme: function getTheme() {
5691
- return this.themes.findByName(this.configuration.get('theme_name'));
6105
+ return this.themes.findByName(this.metadata.get('theme_name'));
6106
+ },
6107
+ supportsPhoneEmulation: function supportsPhoneEmulation() {
6108
+ return pageflow.features.isEnabled('editor_emulation_mode');
5692
6109
  },
5693
6110
  addStoryline: function addStoryline(attributes) {
5694
6111
  var storyline = this.buildStoryline(attributes);
@@ -5771,7 +6188,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
5771
6188
  }, this);
5772
6189
  },
5773
6190
  toJSON: function toJSON() {
5774
- return this.configuration.toJSON();
6191
+ var metadataJSON = this.metadata.toJSON();
6192
+ var configJSON = this.metadata.configuration.toJSON();
6193
+ metadataJSON.configuration = configJSON;
6194
+ return metadataJSON;
5775
6195
  }
5776
6196
  });
5777
6197
 
@@ -5929,6 +6349,61 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
5929
6349
  }
5930
6350
  });
5931
6351
 
6352
+ /**
6353
+ * A Backbone collection that is automatically updated to only
6354
+ * contain models with a foreign key matching the id of a parent
6355
+ * model.
6356
+ *
6357
+ * @param {Object} options
6358
+ * @param {Backbone.Model} options.parentModel -
6359
+ * Model whose id is compared to foreign keys.
6360
+ * @param {Backbone.Collection} options.parent -
6361
+ * Collection to filter items with matching foreign key from.
6362
+ * @param {String} options.foreignKeyAttribute -
6363
+ * Attribute to compare to id of parent model.
6364
+ * @param {String} options.parentReferenceAttribute -
6365
+ * Set reference to parent model on models in collection.
6366
+ *
6367
+ * @since 15.1
6368
+ */
6369
+
6370
+ var ForeignKeySubsetCollection = SubsetCollection.extend({
6371
+ mixins: [orderedCollection],
6372
+ constructor: function constructor(options) {
6373
+ var parent = options.parent;
6374
+ var parentModel = options.parentModel;
6375
+ SubsetCollection.prototype.constructor.call(this, {
6376
+ parent: parent,
6377
+ parentModel: parentModel,
6378
+ filter: function filter(item) {
6379
+ return !parentModel.isNew() && item.get(options.foreignKeyAttribute) === parentModel.id;
6380
+ },
6381
+ comparator: function comparator(item) {
6382
+ return item.get('position');
6383
+ }
6384
+ });
6385
+ this.listenTo(this, 'add', function (model) {
6386
+ if (options.parentReferenceAttribute) {
6387
+ model[options.parentReferenceAttribute] = parentModel;
6388
+ }
6389
+
6390
+ model.set(options.foreignKeyAttribute, parentModel.id);
6391
+ });
6392
+ this.listenTo(parentModel, 'destroy', function () {
6393
+ this.clear();
6394
+ });
6395
+
6396
+ if (options.parentReferenceAttribute) {
6397
+ this.each(function (model) {
6398
+ return model[options.parentReferenceAttribute] = parentModel;
6399
+ });
6400
+ this.listenTo(this, 'remove', function (model) {
6401
+ model[options.parentReferenceAttribute] = null;
6402
+ });
6403
+ }
6404
+ }
6405
+ });
6406
+
5932
6407
  var PageLinksCollection = Backbone.Collection.extend({
5933
6408
  model: PageLink,
5934
6409
  initialize: function initialize(models, options) {
@@ -6148,50 +6623,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6148
6623
  };
6149
6624
  Cocktail.mixin(Backbone.Collection, addAndReturnModel);
6150
6625
 
6151
- // different model types. Backbone.Collection tries to merge records
6152
- // if they have the same id.
6153
-
6154
- var MultiCollection = function MultiCollection() {
6155
- this.records = {};
6156
- this.length = 0;
6157
- };
6158
-
6159
- _$1.extend(MultiCollection.prototype, {
6160
- add: function add(record) {
6161
- if (!this.records[record.cid]) {
6162
- this.records[record.cid] = record;
6163
- this.length = _$1.keys(this.records).length;
6164
- this.trigger('add', record);
6165
- }
6166
- },
6167
- remove: function remove(record) {
6168
- if (this.records[record.cid]) {
6169
- delete this.records[record.cid];
6170
- this.length = _$1.keys(this.records).length;
6171
- this.trigger('remove', record);
6172
- }
6173
- },
6174
- isEmpty: function isEmpty() {
6175
- return this.length === 0;
6176
- }
6177
- });
6178
-
6179
- _$1.extend(MultiCollection.prototype, Backbone.Events);
6180
-
6181
- MultiCollection.extend = Backbone.Collection.extend;
6182
-
6183
- var SavingRecordsCollection = MultiCollection.extend({
6184
- watch: function watch(collection) {
6185
- var that = this;
6186
- this.listenTo(collection, 'request', function (model, xhr) {
6187
- that.add(model);
6188
- xhr.always(function () {
6189
- that.remove(model);
6190
- });
6191
- });
6192
- }
6193
- });
6194
-
6195
6626
  var SidebarRouter = Marionette.AppRouter.extend({
6196
6627
  appRoutes: {
6197
6628
  'page_links/:id': 'pageLink',
@@ -6235,6 +6666,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6235
6666
  this.outlet.show(this.options.view);
6236
6667
  },
6237
6668
  goBack: function goBack() {
6669
+ this.options.view.onGoBack && this.options.view.onGoBack();
6238
6670
  editor.navigate('/', {
6239
6671
  trigger: true
6240
6672
  });
@@ -6372,35 +6804,98 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6372
6804
  });
6373
6805
  };
6374
6806
 
6375
- var failureIndicatingView = {
6376
- modelEvents: {
6377
- 'change:failed': 'updateFailIndicator'
6378
- },
6379
- events: {
6380
- 'click .retry': function clickRetry() {
6807
+ /**
6808
+ * Mixin for Marionette Views that sets css class names according to
6809
+ * life cycle events of its model.
6810
+ *
6811
+ * @param {Object} options
6812
+ * @param {Object} options.classNames
6813
+ * @param {String} options.classNames.creating -
6814
+ * Class name to add to root element while model is still being created.
6815
+ * @param {String} options.classNames.destroying -
6816
+ * Class name to add to root element while model is being destroyed.
6817
+ * @param {String} options.classNames.failed -
6818
+ * Class name to add to root element while model is in failed state.
6819
+ * Model needs to include {@link failureTracking} mixin.
6820
+ * @param {String} options.classNames.failureMessage -
6821
+ * Class name of the element that shall be updated with the failure
6822
+ * message. Model needs to include {@link failureTracking} mixin.
6823
+ * @param {String} options.classNames.retryButton -
6824
+ * Class name of the element that shall act as a retry button.
6825
+ */
6826
+
6827
+ function modelLifecycleTrackingView(_ref) {
6828
+ var classNames = _ref.classNames;
6829
+ return {
6830
+ events: _defineProperty({}, "click .".concat(classNames.retryButton), function click() {
6381
6831
  editor.failures.retry();
6382
6832
  return false;
6383
- }
6384
- },
6385
- onRender: function onRender() {
6386
- this.updateFailIndicator();
6387
- },
6388
- updateFailIndicator: function updateFailIndicator() {
6389
- this.$el.toggleClass('failed', this.model.isFailed());
6390
- this.$el.find('.failure .message').text(this.model.getFailureMessage());
6391
- }
6392
- };
6833
+ }),
6834
+ initialize: function initialize() {
6835
+ var _this = this;
6393
6836
 
6394
- function template$k(data) {
6395
- var __t, __p = '';
6396
- __p += '<a class="back">' +
6397
- ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.outline') )) == null ? '' : __t) +
6398
- '</a>\n<a class="destroy">' +
6399
- ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.destroy') )) == null ? '' : __t) +
6400
- '</a>\n\n<div class="failure">\n <p>' +
6401
- ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.save_error') )) == null ? '' : __t) +
6402
- '</p>\n <p class="message"></p>\n <a class="retry" href="">' +
6403
- ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.retry') )) == null ? '' : __t) +
6837
+ if (classNames.creating) {
6838
+ this.listenTo(this.model, 'change:id', function () {
6839
+ this.$el.removeClass(classNames.creating);
6840
+ });
6841
+ }
6842
+
6843
+ if (classNames.destroying) {
6844
+ this.listenTo(this.model, 'destroying', function () {
6845
+ this.$el.addClass(classNames.destroying);
6846
+ });
6847
+ this.listenTo(this.model, 'error', function () {
6848
+ this.$el.removeClass(classNames.destroying);
6849
+ });
6850
+ }
6851
+
6852
+ if (classNames.failed || classNames.failureMessage) {
6853
+ this.listenTo(this.model, 'change:failed', function () {
6854
+ return _this.updateFailIndicator();
6855
+ });
6856
+ }
6857
+ },
6858
+ render: function render() {
6859
+ if (this.model.isNew()) {
6860
+ this.$el.addClass(classNames.creating);
6861
+ }
6862
+
6863
+ if (this.model.isDestroying && this.model.isDestroying()) {
6864
+ this.$el.addClass(classNames.destroying);
6865
+ }
6866
+
6867
+ this.updateFailIndicator();
6868
+ },
6869
+ updateFailIndicator: function updateFailIndicator() {
6870
+ if (classNames.failed) {
6871
+ this.$el.toggleClass(classNames.failed, this.model.isFailed());
6872
+ }
6873
+
6874
+ if (classNames.failureMessage) {
6875
+ this.$el.find(".".concat(classNames.failureMessage)).text(this.model.getFailureMessage());
6876
+ }
6877
+ }
6878
+ };
6879
+ }
6880
+
6881
+ var failureIndicatingView = modelLifecycleTrackingView({
6882
+ classNames: {
6883
+ failed: 'failed',
6884
+ failureMessage: 'failure .message',
6885
+ retryButton: 'retry'
6886
+ }
6887
+ });
6888
+
6889
+ function template$k(data) {
6890
+ var __t, __p = '';
6891
+ __p += '<a class="back">' +
6892
+ ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.outline') )) == null ? '' : __t) +
6893
+ '</a>\n<a class="destroy">' +
6894
+ ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.destroy') )) == null ? '' : __t) +
6895
+ '</a>\n\n<div class="failure">\n <p>' +
6896
+ ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.save_error') )) == null ? '' : __t) +
6897
+ '</p>\n <p class="message"></p>\n <a class="retry" href="">' +
6898
+ ((__t = ( I18n.t('pageflow.editor.templates.edit_chapter.retry') )) == null ? '' : __t) +
6404
6899
  '</a>\n</div>\n\n<div class="form_container"></div>';
6405
6900
  return __p
6406
6901
  }
@@ -6449,421 +6944,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6449
6944
  });
6450
6945
 
6451
6946
  function template$l(data) {
6452
- var __p = '';
6453
- __p += '<div class="pictogram"></div>\n';
6454
- return __p
6455
- }
6456
-
6457
- var FileThumbnailView = Marionette.ItemView.extend({
6458
- className: 'file_thumbnail',
6459
- template: template$l,
6460
- modelEvents: {
6461
- 'change:state': 'update'
6462
- },
6463
- ui: {
6464
- pictogram: '.pictogram'
6465
- },
6466
- onRender: function onRender() {
6467
- this.update();
6468
- },
6469
- update: function update() {
6470
- if (this.model) {
6471
- var stage = this.model.currentStage();
6472
-
6473
- if (stage) {
6474
- this.setStageClassName(stage.get('name'));
6475
- this.ui.pictogram.toggleClass('action_required', stage.get('action_required'));
6476
- this.ui.pictogram.toggleClass('failed', stage.get('failed'));
6477
- } else {
6478
- this.ui.pictogram.removeClass(this.model.stages.pluck('name').join(' '));
6479
- }
6480
-
6481
- this.ui.pictogram.addClass(this.model.thumbnailPictogram);
6482
- this.$el.css('background-image', this._imageUrl() ? 'url(' + this._imageUrl() + ')' : '');
6483
- this.$el.removeClass('empty').toggleClass('always_picogram', !!this.model.thumbnailPictogram).toggleClass('ready', this.model.isReady());
6484
- } else {
6485
- this.$el.css('background-image', '');
6486
- this.$el.removeClass('ready');
6487
- this.ui.pictogram.addClass('empty');
6488
- }
6489
- },
6490
- setStageClassName: function setStageClassName(name) {
6491
- if (!this.$el.hasClass(name)) {
6492
- this.ui.pictogram.removeClass('empty');
6493
- this.ui.pictogram.removeClass(this.model.stages.pluck('name').join(' '));
6494
- this.ui.pictogram.addClass(name);
6495
- }
6496
- },
6497
- _imageUrl: function _imageUrl() {
6498
- return this.model.get(this.options.imageUrlPropertyName || 'thumbnail_url');
6499
- }
6500
- });
6501
-
6502
- function template$m(data) {
6503
- var __p = '';
6504
- __p += '\n';
6505
- return __p
6506
- }
6507
-
6508
- var StaticThumbnailView = Marionette.ItemView.extend({
6509
- template: template$m,
6510
- className: 'static_thumbnail',
6511
- modelEvents: {
6512
- 'change:configuration': 'update'
6513
- },
6514
- onRender: function onRender() {
6515
- this.update();
6516
- },
6517
- update: function update() {
6518
- this.$el.css('background-image', 'url(' + this._imageUrl() + ')');
6519
- },
6520
- _imageUrl: function _imageUrl() {
6521
- return this.model.thumbnailUrl();
6522
- }
6523
- });
6524
-
6525
- /**
6526
- * Base thumbnail view for models supporting a `thumbnailFile` method.
6527
- *
6528
- * @class
6529
- * @memberof module:pageflow/editor
6530
- */
6531
-
6532
- var ModelThumbnailView = Marionette.View.extend({
6533
- className: 'model_thumbnail',
6534
- modelEvents: {
6535
- 'change:configuration': 'update'
6536
- },
6537
- render: function render() {
6538
- this.update();
6539
- return this;
6540
- },
6541
- update: function update() {
6542
- if (this.model) {
6543
- if (_$1.isFunction(this.model.thumbnailFile)) {
6544
- var file = this.model && this.model.thumbnailFile();
6545
-
6546
- if (this.thumbnailView && this.currentFileThumbnail == file) {
6547
- return;
6548
- }
6549
-
6550
- this.currentFileThumbnail = file;
6551
- this.newThumbnailView = new FileThumbnailView({
6552
- model: file,
6553
- className: 'thumbnail file_thumbnail',
6554
- imageUrlPropertyName: this.options.imageUrlPropertyName
6555
- });
6556
- } else {
6557
- this.newThumbnailView = this.newThumbnailView || new StaticThumbnailView({
6558
- model: this.model
6559
- });
6560
- }
6561
- }
6562
-
6563
- if (this.thumbnailView) {
6564
- this.thumbnailView.close();
6565
- }
6566
-
6567
- if (this.model) {
6568
- this.thumbnailView = this.subview(this.newThumbnailView);
6569
- this.$el.append(this.thumbnailView.el);
6570
- }
6571
- }
6572
- });
6573
-
6574
- var PageThumbnailView = ModelThumbnailView.extend({
6575
- className: 'model_thumbnail page_thumbnail'
6576
- });
6577
-
6578
- function template$n(data) {
6579
- var __t, __p = '';
6580
- __p += '<a href="">\n <span class="type_pictogram"></span>\n <span class="page_thumbnail"></span>\n <span class="title"></span>\n <span class="failure_icon" title="' +
6581
- ((__t = ( I18n.t('pageflow.editor.templates.page_item.save_error') )) == null ? '' : __t) +
6582
- '" />\n</a>\n';
6583
- return __p
6584
- }
6585
-
6586
- var PageItemView = Marionette.ItemView.extend({
6587
- tagName: 'li',
6588
- template: template$n,
6589
- ui: {
6590
- title: '.title',
6591
- pictogram: '.type_pictogram',
6592
- pageThumbnail: '.page_thumbnail'
6593
- },
6594
- modelEvents: {
6595
- 'change:title': 'update',
6596
- 'change:active': 'update'
6597
- },
6598
- onRender: function onRender() {
6599
- this.subview(new PageThumbnailView({
6600
- el: this.ui.pageThumbnail,
6601
- model: this.model
6602
- }));
6603
- this.update();
6604
- },
6605
- update: function update() {
6606
- this.$el.attr('data-id', this.model.id);
6607
- this.$el.attr('data-perma-id', this.model.get('perma_id'));
6608
- this.$el.toggleClass('active', this.model.get('active'));
6609
- this.$el.toggleClass('disabled', !!(this.options.isDisabled && this.options.isDisabled(this.model)));
6610
- this.$el.toggleClass('display_in_navigation', !!this.model.configuration.get('display_in_navigation'));
6611
- this.$el.removeClass(editor.pageTypes.pluck('name').join(' ')).addClass(this.model.get('template'));
6612
- this.ui.pictogram.attr('title', this._getPictogramTitle());
6613
- this.ui.title.text(this.model.title() || I18n$1.t('pageflow.editor.views.page_item_view.unnamed'));
6614
- },
6615
- _getPictogramTitle: function _getPictogramTitle() {
6616
- var result = I18n$1.t(this.model.pageType().translationKey());
6617
- result += ' Seite';
6618
-
6619
- if (this.options.displayInNavigationHint && !this.model.configuration.get('display_in_navigation')) {
6620
- result += ' (nicht in Navigationsleiste)';
6621
- }
6622
-
6623
- return result;
6624
- }
6625
- });
6626
-
6627
- var loadable = {
6628
- modelEvents: {
6629
- 'change:id': function changeId() {
6630
- this.$el.removeClass('creating');
6631
- },
6632
- destroying: function destroying() {
6633
- this.$el.addClass('destroying');
6634
- },
6635
- error: function error() {
6636
- this.$el.removeClass('destroying');
6637
- }
6638
- },
6639
- render: function render() {
6640
- if (this.model.isNew()) {
6641
- this.$el.addClass('creating');
6642
- }
6643
-
6644
- if (this.model.isDestroying && this.model.isDestroying()) {
6645
- this.$el.addClass('destroying');
6646
- }
6647
- }
6648
- };
6649
-
6650
- var NavigatablePageItemView = PageItemView.extend({
6651
- mixins: [loadable, failureIndicatingView],
6652
- className: 'draggable',
6653
- events: {
6654
- 'click': function click() {
6655
- if (!this.model.isNew() && !this.model.isDestroying()) {
6656
- editor.navigate('/pages/' + this.model.get('id'), {
6657
- trigger: true
6658
- });
6659
- }
6660
-
6661
- return false;
6662
- }
6663
- }
6664
- });
6665
-
6666
- function template$o(data) {
6667
- var __t, __p = '';
6668
- __p += '<a class="edit_chapter" href="">\n <span class="pictogram"></span>\n <span class="number"></span>\n <span class="title"></span>\n <span class="failure_icon" title=' +
6669
- ((__t = ( I18n.t('pageflow.editor.templates.chapter_item.save_error') )) == null ? '' : __t) +
6670
- ' />\n</a>\n\n<ul class="pages outline"></ul>\n\n<a href="" class="add_page">' +
6671
- ((__t = ( I18n.t('pageflow.editor.templates.chapter_item.new_page') )) == null ? '' : __t) +
6672
- '</a>\n';
6673
- return __p
6674
- }
6675
-
6676
- var ChapterItemView = Marionette.ItemView.extend({
6677
- tagName: 'li',
6678
- template: template$o,
6679
- ui: {
6680
- title: '> a > .title',
6681
- number: '> a > .number',
6682
- pages: 'ul.pages'
6683
- },
6684
- modelEvents: {
6685
- change: 'update'
6686
- },
6687
- onRender: function onRender() {
6688
- var collectionView = this.options.sortable ? SortableCollectionView : CollectionView;
6689
- this.subview(new collectionView({
6690
- el: this.ui.pages,
6691
- collection: this.model.pages,
6692
- itemViewConstructor: this.options.pageItemView || NavigatablePageItemView,
6693
- itemViewOptions: this.options.pageItemViewOptions,
6694
- connectWith: 'ul.pages'
6695
- }));
6696
- this.update();
6697
- },
6698
- update: function update() {
6699
- this.ui.title.text(this.model.get('title') || I18n$1.t('pageflow.editor.views.chapter_item_view.unnamed'));
6700
- this.ui.number.text(I18n$1.t('pageflow.editor.views.chapter_item_view.chapter') + ' ' + (this.model.get('position') + 1));
6701
- }
6702
- });
6703
-
6704
- var NavigatableChapterItemView = ChapterItemView.extend({
6705
- mixins: [loadable, failureIndicatingView],
6706
- events: {
6707
- 'click a.add_page': function clickAAdd_page() {
6708
- this.model.addPage();
6709
- },
6710
- 'click a.edit_chapter': function clickAEdit_chapter() {
6711
- if (!this.model.isNew() && !this.model.isDestroying()) {
6712
- editor.navigate('/chapters/' + this.model.get('id'), {
6713
- trigger: true
6714
- });
6715
- }
6716
-
6717
- return false;
6718
- }
6719
- }
6720
- });
6721
-
6722
- function template$p(data) {
6723
- var __t, __p = '';
6724
- __p += '<h2>' +
6725
- ((__t = ( I18n.t('pageflow.editor.templates.storyline_outline.header') )) == null ? '' : __t) +
6726
- '</h2>\n<ul class="storyline_outline_chapters chapters"></ul>\n\n<a class="add_chapter" href="">' +
6727
- ((__t = ( I18n.t('pageflow.editor.templates.storyline_outline.new_chapter') )) == null ? '' : __t) +
6728
- '</a>\n';
6729
- return __p
6730
- }
6731
-
6732
- var StorylineOutlineView = Marionette.Layout.extend({
6733
- template: template$p,
6734
- className: 'storyline_outline',
6735
- ui: {
6736
- chapters: 'ul.storyline_outline_chapters'
6737
- },
6738
- events: {
6739
- 'click a.add_chapter': function clickAAdd_chapter() {
6740
- this.model.scaffoldChapter();
6741
- }
6742
- },
6743
- onRender: function onRender() {
6744
- this.ui.chapters.toggleClass('outline navigatable', !!this.options.navigatable);
6745
- var collectionView = this.options.sortable ? SortableCollectionView : CollectionView;
6746
- new collectionView({
6747
- el: this.ui.chapters,
6748
- collection: this.model.chapters,
6749
- itemViewConstructor: this.options.navigatable ? NavigatableChapterItemView : ChapterItemView,
6750
- itemViewOptions: {
6751
- sortable: this.options.sortable,
6752
- pageItemView: this.options.navigatable ? NavigatablePageItemView : PageItemView,
6753
- pageItemViewOptions: _$1.extend({
6754
- displayInNavigationHint: this.options.displayInNavigationHint
6755
- }, this.options.pageItemViewOptions || {})
6756
- }
6757
- }).render();
6758
- }
6759
- });
6760
-
6761
- function template$q(data) {
6762
- var __t, __p = '';
6763
- __p += '<div class="storyline_picker_storylines">\n <div class="storyline_picker_select_region"></div>\n <a href="" class="add_storyline" title="' +
6764
- ((__t = ( I18n.t('pageflow.editor.templates.storyline_picker.add') )) == null ? '' : __t) +
6765
- '"></a>\n <a href="" class="edit_storyline" title="' +
6766
- ((__t = ( I18n.t('pageflow.editor.templates.storyline_picker.edit') )) == null ? '' : __t) +
6767
- '"></a>\n</div>\n\n<div class="storyline_picker_main_region"></div>\n';
6768
- return __p
6769
- }
6770
-
6771
- var StorylinePickerView = Marionette.Layout.extend({
6772
- template: template$q,
6773
- className: 'storyline_picker',
6774
- regions: {
6775
- selectRegion: '.storyline_picker_select_region',
6776
- mainRegion: '.storyline_picker_main_region'
6777
- },
6778
- ui: {
6779
- storylines: '.storyline_picker_storylines'
6780
- },
6781
- events: {
6782
- 'click .add_storyline': function clickAdd_storyline() {
6783
- var storyline = state.entry.scaffoldStoryline({
6784
- depth: 'page'
6785
- }).storyline;
6786
- this.listenToOnce(storyline, 'sync', function () {
6787
- this.updateSelect();
6788
- this.model.set('storyline_id', storyline.id);
6789
- });
6790
- return false;
6791
- },
6792
- 'click .edit_storyline': function clickEdit_storyline() {
6793
- editor.navigate('storylines/' + this.model.get('storyline_id'), {
6794
- trigger: true
6795
- });
6796
- return false;
6797
- }
6798
- },
6799
- initialize: function initialize() {
6800
- this.model = new Backbone.Model({
6801
- storyline_id: this.defaultStorylineId()
6802
- });
6803
- this.listenTo(state.storylines, 'add sort remove', this.updateSelect);
6804
- this.listenTo(this.model, 'change', this.load);
6805
- },
6806
- onRender: function onRender() {
6807
- this.$el.toggleClass('editable', !!this.options.editable);
6808
- this.ui.storylines.toggle(!!pageflow.features.isEnabled('storylines'));
6809
- this.updateSelect();
6810
- this.load();
6811
- },
6812
- updateSelect: function updateSelect() {
6813
- this.selectRegion.show(new SelectInputView({
6814
- model: this.model,
6815
- label: I18n$1.t('pageflow.editor.views.storylines_picker_view.label'),
6816
- propertyName: 'storyline_id',
6817
- values: state.storylines.pluck('id'),
6818
- texts: state.storylines.map(function (storyline) {
6819
- return this.indentation(storyline) + storyline.displayTitle();
6820
- }, this),
6821
- groups: state.storylines.reduce(function (result, storyline) {
6822
- if (storyline.isMain() || storyline.parentPage()) {
6823
- result.push(_$1.last(result));
6824
- } else {
6825
- result.push(I18n$1.t('pageflow.editor.views.storylines_picker_view.without_parent_page'));
6826
- }
6827
-
6828
- return result;
6829
- }, [])
6830
- }));
6831
- },
6832
- load: function load() {
6833
- var storyline = state.storylines.get(this.model.get('storyline_id'));
6834
- this.saveRememberedStorylineId(storyline.id);
6835
- this.mainRegion.show(new StorylineOutlineView({
6836
- model: storyline,
6837
- navigatable: this.options.navigatable,
6838
- sortable: this.options.editable,
6839
- chapterItemView: this.options.chapterItemView,
6840
- pageItemView: this.options.pageItemView,
6841
- pageItemViewOptions: this.options.pageItemViewOptions,
6842
- displayInNavigationHint: this.options.displayInNavigationHint
6843
- }));
6844
- },
6845
- defaultStorylineId: function defaultStorylineId() {
6846
- var storyline = state.storylines.get(this.options.storylineId) || state.storylines.get(this.rememberedStorylineId()) || state.storylines.first();
6847
- return storyline.id;
6848
- },
6849
- rememberedStorylineId: function rememberedStorylineId() {
6850
- if (this.options.rememberLastSelection) {
6851
- return StorylinePickerView._rememberedStorylineId;
6852
- }
6853
- },
6854
- saveRememberedStorylineId: function saveRememberedStorylineId(id) {
6855
- if (this.options.rememberLastSelection) {
6856
- StorylinePickerView._rememberedStorylineId = id;
6857
- }
6858
- },
6859
- indentation: function indentation(storyline) {
6860
- return _$1(storyline.get('level') || 0).times(function () {
6861
- return "\xA0\xA0\xA0";
6862
- }).join('');
6863
- }
6864
- });
6865
-
6866
- function template$r(data) {
6867
6947
  var __t, __p = '';
6868
6948
  __p += '<a class="close" href="#">' +
6869
6949
  ((__t = ( I18n.t('pageflow.editor.templates.edit_entry.close') )) == null ? '' : __t) +
@@ -6875,18 +6955,20 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6875
6955
  ((__t = ( I18n.t('pageflow.editor.templates.edit_entry.save_error') )) == null ? '' : __t) +
6876
6956
  '" />\n </li>\n <li>\n <a class="manage_files" href="#" data-path="/files">' +
6877
6957
  ((__t = ( I18n.t('pageflow.editor.templates.edit_entry.manage_files') )) == null ? '' : __t) +
6878
- '</a>\n </li>\n</ul>\n\n<div class="edit_entry_storylines storyline_picker"></div>\n';
6958
+ '</a>\n </li>\n</ul>\n\n<div class="edit_entry_outline_region"></div>\n';
6879
6959
  return __p
6880
6960
  }
6881
6961
 
6882
- var EditEntryView = Marionette.ItemView.extend({
6883
- template: template$r,
6962
+ var EditEntryView = Marionette.Layout.extend({
6963
+ template: template$l,
6884
6964
  mixins: [failureIndicatingView, tooltipContainer],
6885
6965
  ui: {
6886
6966
  publishButton: 'a.publish',
6887
6967
  publicationStateButton: 'a.publication_state',
6888
- menu: '.menu',
6889
- storylines: '.edit_entry_storylines'
6968
+ menu: '.menu'
6969
+ },
6970
+ regions: {
6971
+ outlineRegion: '.edit_entry_outline_region'
6890
6972
  },
6891
6973
  events: {
6892
6974
  'click a.close': function clickAClose() {
@@ -6915,8 +6997,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6915
6997
 
6916
6998
  this._updatePublishButton();
6917
6999
 
6918
- this.subview(new StorylinePickerView({
6919
- el: this.ui.storylines,
7000
+ this.outlineRegion.show(new editor.entryType.outlineView({
7001
+ entry: state.entry,
6920
7002
  navigatable: true,
6921
7003
  editable: true,
6922
7004
  displayInNavigationHint: true,
@@ -6925,7 +7007,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6925
7007
  }));
6926
7008
  },
6927
7009
  _updatePublishButton: function _updatePublishButton() {
6928
- var disabled = !state.entry.get('publishable');
7010
+ var disabled = !this.model.get('publishable');
6929
7011
  this.ui.publishButton.toggleClass('disabled', disabled);
6930
7012
 
6931
7013
  if (disabled) {
@@ -6956,7 +7038,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6956
7038
  }
6957
7039
  });
6958
7040
 
6959
- function template$s(data) {
7041
+ function template$m(data) {
6960
7042
  var __t, __p = '';
6961
7043
  __p += '<div class="widget_type">\n</div>\n<a class="settings" title="' +
6962
7044
  ((__t = ( I18n.t('pageflow.editor.templates.widget_item.settings') )) == null ? '' : __t) +
@@ -6965,7 +7047,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
6965
7047
  }
6966
7048
 
6967
7049
  var WidgetItemView = Marionette.Layout.extend({
6968
- template: template$s,
7050
+ template: template$m,
6969
7051
  tagName: 'li',
6970
7052
  className: 'widget_item',
6971
7053
  regions: {
@@ -7005,14 +7087,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7005
7087
  }
7006
7088
  });
7007
7089
 
7008
- function template$t(data) {
7090
+ function template$n(data) {
7009
7091
  var __p = '';
7010
7092
  __p += '<ol class="widgets">\n</ol>\n';
7011
7093
  return __p
7012
7094
  }
7013
7095
 
7014
7096
  var EditWidgetsView = Marionette.Layout.extend({
7015
- template: template$t,
7097
+ template: template$n,
7016
7098
  ui: {
7017
7099
  widgets: '.widgets'
7018
7100
  },
@@ -7028,14 +7110,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7028
7110
  }
7029
7111
  });
7030
7112
 
7031
- function template$u(data) {
7113
+ function template$o(data) {
7032
7114
  var __p = '';
7033
7115
  __p += '<div class="image"></div>\n<div class="label"></div>\n';
7034
7116
  return __p
7035
7117
  }
7036
7118
 
7037
7119
  var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
7038
- template: template$u,
7120
+ template: template$o,
7039
7121
  className: 'preview',
7040
7122
  modelEvents: {
7041
7123
  change: 'update'
@@ -7066,14 +7148,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7066
7148
  }
7067
7149
  });
7068
7150
 
7069
- function template$v(data) {
7151
+ function template$p(data) {
7070
7152
  var __p = '';
7071
7153
  __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';
7072
7154
  return __p
7073
7155
  }
7074
7156
 
7075
7157
  var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
7076
- template: template$v,
7158
+ template: template$p,
7077
7159
  className: '',
7078
7160
  ui: {
7079
7161
  container: '.container',
@@ -7154,7 +7236,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7154
7236
  }
7155
7237
  });
7156
7238
 
7157
- function template$w(data) {
7239
+ function template$q(data) {
7158
7240
  var __t, __p = '';
7159
7241
  __p += '<div class="box">\n <h2>' +
7160
7242
  ((__t = ( I18n.t('pageflow.editor.templates.background_positioning.title') )) == null ? '' : __t) +
@@ -7171,7 +7253,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7171
7253
  }
7172
7254
 
7173
7255
  var BackgroundPositioningView = Marionette.ItemView.extend({
7174
- template: template$w,
7256
+ template: template$q,
7175
7257
  className: 'background_positioning dialog',
7176
7258
  mixins: [dialogView],
7177
7259
  ui: {
@@ -7225,16 +7307,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7225
7307
  app.dialogRegion.show(new BackgroundPositioningView(options));
7226
7308
  };
7227
7309
 
7228
- function template$x(data) {
7310
+ function template$r(data) {
7229
7311
  var __p = '';
7230
7312
  __p += '<div class="label"></div>\n<a href="#"></a>\n';
7231
7313
  return __p
7232
7314
  }
7233
7315
 
7234
- /** @api private */
7235
-
7236
7316
  var DropDownButtonItemView = Marionette.ItemView.extend({
7237
- template: template$x,
7317
+ template: template$r,
7238
7318
  tagName: 'li',
7239
7319
  className: 'drop_down_button_item',
7240
7320
  ui: {
@@ -7272,8 +7352,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7272
7352
  }
7273
7353
  });
7274
7354
 
7275
- /** @api private */
7276
-
7277
7355
  var DropDownButtonItemListView = function DropDownButtonItemListView(options) {
7278
7356
  return new CollectionView({
7279
7357
  tagName: 'ul',
@@ -7286,7 +7364,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7286
7364
  });
7287
7365
  };
7288
7366
 
7289
- function template$y(data) {
7367
+ function template$s(data) {
7290
7368
  var __p = '';
7291
7369
  __p += '<button></button>\n\n<div class="drop_down_button_menu">\n</div>\n';
7292
7370
  return __p
@@ -7295,6 +7373,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7295
7373
  /**
7296
7374
  * A button that displays a drop down menu on hover.
7297
7375
  *
7376
+ * @param {Object} options
7377
+ *
7298
7378
  * @param {String} options.label
7299
7379
  * Button text.
7300
7380
  *
@@ -7316,11 +7396,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7316
7396
  * when the menu item is clicked.
7317
7397
  *
7318
7398
  * @class
7319
- * @memberof module:pageflow/editor
7320
7399
  */
7321
7400
 
7322
7401
  var DropDownButtonView = Marionette.ItemView.extend({
7323
- template: template$y,
7402
+ template: template$s,
7324
7403
  className: 'drop_down_button',
7325
7404
  ui: {
7326
7405
  button: '> button',
@@ -7387,7 +7466,58 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7387
7466
  }
7388
7467
  });
7389
7468
 
7390
- function template$z(data) {
7469
+ function template$t(data) {
7470
+ var __p = '';
7471
+ __p += '<div class="pictogram"></div>\n';
7472
+ return __p
7473
+ }
7474
+
7475
+ var FileThumbnailView = Marionette.ItemView.extend({
7476
+ className: 'file_thumbnail',
7477
+ template: template$t,
7478
+ modelEvents: {
7479
+ 'change:state': 'update'
7480
+ },
7481
+ ui: {
7482
+ pictogram: '.pictogram'
7483
+ },
7484
+ onRender: function onRender() {
7485
+ this.update();
7486
+ },
7487
+ update: function update() {
7488
+ if (this.model) {
7489
+ var stage = this.model.currentStage();
7490
+
7491
+ if (stage) {
7492
+ this.setStageClassName(stage.get('name'));
7493
+ this.ui.pictogram.toggleClass('action_required', stage.get('action_required'));
7494
+ this.ui.pictogram.toggleClass('failed', stage.get('failed'));
7495
+ } else {
7496
+ this.ui.pictogram.removeClass(this.model.stages.pluck('name').join(' '));
7497
+ }
7498
+
7499
+ this.ui.pictogram.addClass(this.model.thumbnailPictogram);
7500
+ this.$el.css('background-image', this._imageUrl() ? 'url(' + this._imageUrl() + ')' : '');
7501
+ this.$el.removeClass('empty').toggleClass('always_picogram', !!this.model.thumbnailPictogram).toggleClass('ready', this.model.isReady());
7502
+ } else {
7503
+ this.$el.css('background-image', '');
7504
+ this.$el.removeClass('ready');
7505
+ this.ui.pictogram.addClass('empty');
7506
+ }
7507
+ },
7508
+ setStageClassName: function setStageClassName(name) {
7509
+ if (!this.$el.hasClass(name)) {
7510
+ this.ui.pictogram.removeClass('empty');
7511
+ this.ui.pictogram.removeClass(this.model.stages.pluck('name').join(' '));
7512
+ this.ui.pictogram.addClass(name);
7513
+ }
7514
+ },
7515
+ _imageUrl: function _imageUrl() {
7516
+ return this.model.get(this.options.imageUrlPropertyName || 'thumbnail_url');
7517
+ }
7518
+ });
7519
+
7520
+ function template$u(data) {
7391
7521
  var __t, __p = '';
7392
7522
  __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="' +
7393
7523
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.file_input.reset') )) == null ? '' : __t) +
@@ -7401,12 +7531,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7401
7531
  * Input view to reference a file.
7402
7532
  *
7403
7533
  * @class
7404
- * @memberof module:pageflow/editor
7405
7534
  */
7406
7535
 
7407
7536
  var FileInputView = Marionette.ItemView.extend({
7408
7537
  mixins: [inputView],
7409
- template: template$z,
7538
+ template: template$u,
7410
7539
  className: 'file_input',
7411
7540
  ui: {
7412
7541
  fileName: '.file_name',
@@ -7578,14 +7707,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7578
7707
  }
7579
7708
  });
7580
7709
 
7581
- function template$A(data) {
7710
+ function template$v(data) {
7582
7711
  var __p = '';
7583
7712
  __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';
7584
7713
  return __p
7585
7714
  }
7586
7715
 
7587
7716
  var LoadingView = Marionette.ItemView.extend({
7588
- template: template$A,
7717
+ template: template$v,
7589
7718
  className: 'loading',
7590
7719
  tagName: 'li'
7591
7720
  });
@@ -7608,7 +7737,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7608
7737
  }
7609
7738
  };
7610
7739
 
7611
- function template$B(data) {
7740
+ function template$w(data) {
7612
7741
  var __t, __p = '';
7613
7742
  __p += '<span class="theme_name"></span>\n<span class="button_or_checkmark">\n <p class="theme_in_use"></p>\n <a class="use_theme">' +
7614
7743
  ((__t = ( I18n.t('pageflow.editor.templates.theme.use') )) == null ? '' : __t) +
@@ -7616,11 +7745,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7616
7745
  return __p
7617
7746
  }
7618
7747
 
7619
- /** @api private */
7620
-
7621
7748
  var ThemeItemView = Marionette.ItemView.extend({
7622
7749
  tagName: 'li',
7623
- template: template$B,
7750
+ template: template$w,
7624
7751
  className: 'theme_item',
7625
7752
  mixins: [selectableView],
7626
7753
  selectionAttribute: 'theme',
@@ -7651,7 +7778,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7651
7778
  }
7652
7779
  });
7653
7780
 
7654
- function template$C(data) {
7781
+ function template$x(data) {
7655
7782
  var __t, __p = '';
7656
7783
  __p += '<div class="box">\n <div class="content">\n <div>\n <h2 class="themes_header">' +
7657
7784
  ((__t = ( I18n.t('pageflow.editor.templates.change_theme_dialog.header') )) == null ? '' : __t) +
@@ -7666,7 +7793,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7666
7793
  }
7667
7794
 
7668
7795
  var ChangeThemeDialogView = Marionette.ItemView.extend({
7669
- template: template$C,
7796
+ template: template$x,
7670
7797
  className: 'change_theme dialog editor',
7671
7798
  mixins: [dialogView],
7672
7799
  ui: {
@@ -7735,7 +7862,78 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7735
7862
  }).promise();
7736
7863
  };
7737
7864
 
7738
- function template$D(data) {
7865
+ function template$y(data) {
7866
+ var __p = '';
7867
+ __p += '\n';
7868
+ return __p
7869
+ }
7870
+
7871
+ var StaticThumbnailView = Marionette.ItemView.extend({
7872
+ template: template$y,
7873
+ className: 'static_thumbnail',
7874
+ modelEvents: {
7875
+ 'change:configuration': 'update'
7876
+ },
7877
+ onRender: function onRender() {
7878
+ this.update();
7879
+ },
7880
+ update: function update() {
7881
+ this.$el.css('background-image', 'url(' + this._imageUrl() + ')');
7882
+ },
7883
+ _imageUrl: function _imageUrl() {
7884
+ return this.model.thumbnailUrl();
7885
+ }
7886
+ });
7887
+
7888
+ /**
7889
+ * Base thumbnail view for models supporting a `thumbnailFile` method.
7890
+ *
7891
+ * @class
7892
+ */
7893
+
7894
+ var ModelThumbnailView = Marionette.View.extend({
7895
+ className: 'model_thumbnail',
7896
+ modelEvents: {
7897
+ 'change:configuration': 'update'
7898
+ },
7899
+ render: function render() {
7900
+ this.update();
7901
+ return this;
7902
+ },
7903
+ update: function update() {
7904
+ if (this.model) {
7905
+ if (_$1.isFunction(this.model.thumbnailFile)) {
7906
+ var file = this.model && this.model.thumbnailFile();
7907
+
7908
+ if (this.thumbnailView && this.currentFileThumbnail == file) {
7909
+ return;
7910
+ }
7911
+
7912
+ this.currentFileThumbnail = file;
7913
+ this.newThumbnailView = new FileThumbnailView({
7914
+ model: file,
7915
+ className: 'thumbnail file_thumbnail',
7916
+ imageUrlPropertyName: this.options.imageUrlPropertyName
7917
+ });
7918
+ } else {
7919
+ this.newThumbnailView = this.newThumbnailView || new StaticThumbnailView({
7920
+ model: this.model
7921
+ });
7922
+ }
7923
+ }
7924
+
7925
+ if (this.thumbnailView) {
7926
+ this.thumbnailView.close();
7927
+ }
7928
+
7929
+ if (this.model) {
7930
+ this.thumbnailView = this.subview(this.newThumbnailView);
7931
+ this.$el.append(this.thumbnailView.el);
7932
+ }
7933
+ }
7934
+ });
7935
+
7936
+ function template$z(data) {
7739
7937
  var __p = '';
7740
7938
  __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';
7741
7939
  return __p
@@ -7745,14 +7943,13 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7745
7943
  * Base class for input views that reference models.
7746
7944
  *
7747
7945
  * @class
7748
- * @memberof module:pageflow/editor
7749
7946
  */
7750
7947
 
7751
7948
  var ReferenceInputView = Marionette.ItemView.extend(
7752
- /** @lends module:pageflow/editor.ReferenceInputView# */
7949
+ /** @lends ReferenceInputView.prototype */
7753
7950
  {
7754
7951
  mixins: [inputView],
7755
- template: template$D,
7952
+ template: template$z,
7756
7953
  className: 'reference_input',
7757
7954
  ui: {
7758
7955
  title: '.title',
@@ -7851,7 +8048,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7851
8048
  }
7852
8049
  });
7853
8050
 
7854
- function template$E(data) {
8051
+ function template$A(data) {
7855
8052
  var __t, __p = '';
7856
8053
  __p += '<a class="back">' +
7857
8054
  ((__t = ( I18n.t('pageflow.editor.templates.edit_meta_data.outline') )) == null ? '' : __t) +
@@ -7864,7 +8061,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7864
8061
  }
7865
8062
 
7866
8063
  var EditMetaDataView = Marionette.Layout.extend({
7867
- template: template$E,
8064
+ template: template$A,
7868
8065
  className: 'edit_meta_data',
7869
8066
  mixins: [failureIndicatingView],
7870
8067
  regions: {
@@ -7876,12 +8073,13 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7876
8073
  onRender: function onRender() {
7877
8074
  var entry = this.model;
7878
8075
  var configurationEditor = new ConfigurationEditorView({
7879
- model: entry.configuration,
8076
+ model: entry.metadata.configuration,
7880
8077
  tab: this.options.tab
7881
8078
  });
7882
8079
  configurationEditor.tab('general', function () {
7883
8080
  this.input('title', TextInputView, {
7884
- placeholder: entry.get('entry_title')
8081
+ placeholder: entry.get('entry_title'),
8082
+ model: entry.metadata
7885
8083
  });
7886
8084
  this.input('locale', SelectInputView, {
7887
8085
  values: state.config.availablePublicLocales,
@@ -7889,46 +8087,33 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7889
8087
  return I18n$1.t('pageflow.public._language', {
7890
8088
  locale: locale
7891
8089
  });
7892
- })
8090
+ }),
8091
+ model: entry.metadata
8092
+ });
8093
+ this.input('credits', TextAreaInputView, {
8094
+ model: entry.metadata
7893
8095
  });
7894
- this.input('credits', TextAreaInputView);
7895
8096
  this.input('author', TextInputView, {
7896
- placeholder: state.config.defaultAuthorMetaTag
8097
+ placeholder: state.config.defaultAuthorMetaTag,
8098
+ model: entry.metadata
7897
8099
  });
7898
8100
  this.input('publisher', TextInputView, {
7899
- placeholder: state.config.defaultPublisherMetaTag
8101
+ placeholder: state.config.defaultPublisherMetaTag,
8102
+ model: entry.metadata
7900
8103
  });
7901
8104
  this.input('keywords', TextInputView, {
7902
- placeholder: state.config.defaultKeywordsMetaTag
8105
+ placeholder: state.config.defaultKeywordsMetaTag,
8106
+ model: entry.metadata
7903
8107
  });
7904
8108
  });
7905
8109
  configurationEditor.tab('widgets', function () {
7906
- var theme = entry.getTheme();
7907
- this.input('manual_start', CheckBoxInputView);
7908
- this.input('emphasize_chapter_beginning', CheckBoxInputView);
7909
- this.input('emphasize_new_pages', CheckBoxInputView);
7910
- this.input('home_button_enabled', CheckBoxInputView, {
7911
- disabled: !theme.hasHomeButton(),
7912
- displayUncheckedIfDisabled: true
7913
- });
7914
- this.input('overview_button_enabled', CheckBoxInputView, {
7915
- disabled: !theme.hasOverviewButton(),
7916
- displayUncheckedIfDisabled: true
7917
- });
7918
-
7919
- if (theme.hasHomeButton()) {
7920
- this.input('home_url', TextInputView, {
7921
- placeholder: state.theming.get('pretty_url'),
7922
- visibleBinding: 'home_button_enabled'
7923
- });
7924
- }
7925
-
7926
- this.view(EditWidgetsView, {
8110
+ editor.entryType.appearanceInputs && editor.entryType.appearanceInputs(this, entry, state.theming);
8111
+ entry.widgets && this.view(EditWidgetsView, {
7927
8112
  model: entry,
7928
8113
  widgetTypes: editor.widgetTypes
7929
8114
  });
7930
8115
 
7931
- if (pageflow.features.isEnabled('selectable_themes') && state.themes.length > 1) {
8116
+ if (pageflow.features && pageflow.features.isEnabled('selectable_themes') && state.themes.length > 1) {
7932
8117
  this.view(ThemeInputView, {
7933
8118
  themes: state.themes,
7934
8119
  propertyName: 'theme_name'
@@ -7938,21 +8123,25 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7938
8123
  configurationEditor.tab('social', function () {
7939
8124
  this.input('share_image_id', FileInputView, {
7940
8125
  collection: state.imageFiles,
7941
- fileSelectionHandler: 'entryConfiguration'
8126
+ fileSelectionHandler: 'entryMetadata',
8127
+ model: entry.metadata
7942
8128
  });
7943
8129
  this.input('summary', TextAreaInputView, {
7944
8130
  disableRichtext: true,
7945
- disableLinks: true
8131
+ disableLinks: true,
8132
+ model: entry.metadata
7946
8133
  });
7947
8134
  this.input('share_url', TextInputView, {
7948
- placeholder: state.entry.get('pretty_url')
8135
+ placeholder: state.entry.get('pretty_url'),
8136
+ model: entry.metadata
7949
8137
  });
7950
8138
  this.input('share_providers', CheckBoxGroupInputView, {
7951
8139
  values: state.config.availableShareProviders,
7952
- translationKeyPrefix: 'activerecord.values.pageflow/entry.share_providers'
8140
+ translationKeyPrefix: 'activerecord.values.pageflow/entry.share_providers',
8141
+ model: entry.metadata
7953
8142
  });
7954
8143
  });
7955
- this.listenTo(entry.configuration, 'change:theme_name', function () {
8144
+ this.listenTo(entry.metadata, 'change:theme_name', function () {
7956
8145
  configurationEditor.refresh();
7957
8146
  });
7958
8147
  this.formContainer.show(configurationEditor);
@@ -7964,7 +8153,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7964
8153
  }
7965
8154
  });
7966
8155
 
7967
- function template$F(data) {
8156
+ function template$B(data) {
7968
8157
  var __t, __p = '';
7969
8158
  __p += '<a class="back">' +
7970
8159
  ((__t = ( I18n.t('pageflow.editor.templates.edit_page_link.back') )) == null ? '' : __t) +
@@ -7975,7 +8164,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
7975
8164
  }
7976
8165
 
7977
8166
  var EditPageLinkView = Marionette.Layout.extend({
7978
- template: template$F,
8167
+ template: template$B,
7979
8168
  regions: {
7980
8169
  formContainer: '.form_container'
7981
8170
  },
@@ -8014,7 +8203,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8014
8203
  }
8015
8204
  });
8016
8205
 
8017
- function template$G(data) {
8206
+ function template$C(data) {
8018
8207
  var __t, __p = '';
8019
8208
  __p += '<a class="back">' +
8020
8209
  ((__t = ( I18n.t('pageflow.editor.templates.edit_page.outline') )) == null ? '' : __t) +
@@ -8029,7 +8218,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8029
8218
  }
8030
8219
 
8031
8220
  var EditPageView = Marionette.Layout.extend({
8032
- template: template$G,
8221
+ template: template$C,
8033
8222
  className: 'edit_page',
8034
8223
  mixins: [failureIndicatingView],
8035
8224
  regions: {
@@ -8083,13 +8272,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8083
8272
  }
8084
8273
  });
8085
8274
 
8086
- /**
8087
- * Input view to reference a page.
8088
- *
8089
- * @class
8090
- * @memberof module:pageflow/editor
8091
- */
8092
-
8093
8275
  var PageLinkInputView = ReferenceInputView.extend({
8094
8276
  choose: function choose() {
8095
8277
  return editor.selectPage({
@@ -8101,7 +8283,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8101
8283
  }
8102
8284
  });
8103
8285
 
8104
- function template$H(data) {
8286
+ function template$D(data) {
8105
8287
  var __t, __p = '';
8106
8288
  __p += '<a class="back">' +
8107
8289
  ((__t = ( I18n.t('pageflow.editor.templates.edit_storyline.outline') )) == null ? '' : __t) +
@@ -8116,7 +8298,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8116
8298
  }
8117
8299
 
8118
8300
  var EditStorylineView = Marionette.Layout.extend({
8119
- template: template$H,
8301
+ template: template$D,
8120
8302
  className: 'edit_storyline',
8121
8303
  mixins: [failureIndicatingView, tooltipContainer],
8122
8304
  regions: {
@@ -8199,7 +8381,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8199
8381
  }
8200
8382
  });
8201
8383
 
8202
- function template$I(data) {
8384
+ function template$E(data) {
8203
8385
  var __t, __p = '';
8204
8386
  __p += '<a class="back">' +
8205
8387
  ((__t = ( I18n.t('pageflow.editor.templates.edit_widget.back') )) == null ? '' : __t) +
@@ -8208,7 +8390,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8208
8390
  }
8209
8391
 
8210
8392
  var EditWidgetView = Marionette.ItemView.extend({
8211
- template: template$I,
8393
+ template: template$E,
8212
8394
  className: 'edit_widget',
8213
8395
  events: {
8214
8396
  'click a.back': function clickABack() {
@@ -8233,7 +8415,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8233
8415
  }
8234
8416
  });
8235
8417
 
8236
- function template$J(data) {
8418
+ var loadable = modelLifecycleTrackingView({
8419
+ classNames: {
8420
+ creating: 'creating',
8421
+ destroying: 'destroying'
8422
+ }
8423
+ });
8424
+
8425
+ function template$F(data) {
8237
8426
  var __p = '';
8238
8427
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n';
8239
8428
  return __p
@@ -8241,7 +8430,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8241
8430
 
8242
8431
  var ExplorerFileItemView = Marionette.ItemView.extend({
8243
8432
  tagName: 'li',
8244
- template: template$J,
8433
+ template: template$F,
8245
8434
  mixins: [loadable, selectableView],
8246
8435
  selectionAttribute: 'file',
8247
8436
  ui: {
@@ -8278,14 +8467,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8278
8467
  }
8279
8468
  });
8280
8469
 
8281
- function template$K(data) {
8470
+ function template$G(data) {
8282
8471
  var __p = '';
8283
8472
  __p += '<a href="">\n <span class="title"></span>\n</a>\n';
8284
8473
  return __p
8285
8474
  }
8286
8475
 
8287
8476
  var OtherEntryItemView = Marionette.ItemView.extend({
8288
- template: template$K,
8477
+ template: template$G,
8289
8478
  className: 'other_entry_item',
8290
8479
  tagName: 'li',
8291
8480
  mixins: [selectableView],
@@ -8300,7 +8489,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8300
8489
  }
8301
8490
  });
8302
8491
 
8303
- function template$L(data) {
8492
+ function template$H(data) {
8304
8493
  var __t, __p = '';
8305
8494
  __p +=
8306
8495
  ((__t = ( I18n.t('pageflow.editor.templates.other_entries_blank_slate.none_available') )) == null ? '' : __t) +
@@ -8326,7 +8515,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8326
8515
  selection: this.options.selection
8327
8516
  },
8328
8517
  blankSlateViewConstructor: Marionette.ItemView.extend({
8329
- template: template$L,
8518
+ template: template$H,
8330
8519
  tagName: 'li',
8331
8520
  className: 'blank_slate'
8332
8521
  }),
@@ -8337,7 +8526,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8337
8526
  }
8338
8527
  });
8339
8528
 
8340
- function template$M(data) {
8529
+ function template$I(data) {
8341
8530
  var __t, __p = '';
8342
8531
  __p += '<div class="box">\n <h2>' +
8343
8532
  ((__t = ( I18n.t('pageflow.editor.templates.files_explorer.reuse_files') )) == null ? '' : __t) +
@@ -8366,7 +8555,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8366
8555
  }
8367
8556
 
8368
8557
  var FilesExplorerView = Marionette.ItemView.extend({
8369
- template: template$M,
8558
+ template: template$I,
8370
8559
  className: 'files_explorer editor dialog',
8371
8560
  mixins: [dialogView],
8372
8561
  ui: {
@@ -8453,7 +8642,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8453
8642
  app.dialogRegion.show(new FilesExplorerView(options));
8454
8643
  };
8455
8644
 
8456
- function template$N(data) {
8645
+ function template$J(data) {
8457
8646
  var __p = '';
8458
8647
  __p += '<th></th>\n<td></td>';
8459
8648
  return __p
@@ -8461,7 +8650,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8461
8650
 
8462
8651
  var FileMetaDataItemView = Marionette.ItemView.extend({
8463
8652
  tagName: 'tr',
8464
- template: template$N,
8653
+ template: template$J,
8465
8654
  ui: {
8466
8655
  label: 'th',
8467
8656
  value: 'td'
@@ -8475,7 +8664,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8475
8664
  this.ui.label.text(this.labelText());
8476
8665
  },
8477
8666
  labelText: function labelText() {
8478
- return attributeTranslation(this.options.name, 'label', {
8667
+ return i18nUtils.attributeTranslation(this.options.name, 'label', {
8479
8668
  prefixes: ['pageflow.editor.files.attributes.' + this.model.fileType().collectionName, 'pageflow.editor.files.common_attributes'],
8480
8669
  fallbackPrefix: 'activerecord.attributes',
8481
8670
  fallbackModelI18nKey: this.model.i18nKey
@@ -8483,7 +8672,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8483
8672
  }
8484
8673
  });
8485
8674
 
8486
- function template$O(data) {
8675
+ function template$K(data) {
8487
8676
  var __p = '';
8488
8677
  __p += '<p class="percent"></p>\n<p class="description"></p>\n<p class="error_message"></p>';
8489
8678
  return __p
@@ -8492,7 +8681,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8492
8681
  var FileStageItemView = Marionette.ItemView.extend({
8493
8682
  tagName: 'li',
8494
8683
  className: 'file_stage_item',
8495
- template: template$O,
8684
+ template: template$K,
8496
8685
  ui: {
8497
8686
  description: '.description',
8498
8687
  percent: '.percent',
@@ -8533,7 +8722,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8533
8722
  }
8534
8723
  });
8535
8724
 
8536
- function template$P(data) {
8725
+ function template$L(data) {
8537
8726
  var __t, __p = '';
8538
8727
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n<a class="select">' +
8539
8728
  ((__t = ( I18n.t('pageflow.editor.templates.file_item.select') )) == null ? '' : __t) +
@@ -8557,7 +8746,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8557
8746
 
8558
8747
  var FileItemView = Marionette.ItemView.extend({
8559
8748
  tagName: 'li',
8560
- template: template$P,
8749
+ template: template$L,
8561
8750
  mixins: [loadable],
8562
8751
  ui: {
8563
8752
  fileName: '.file_name',
@@ -8672,7 +8861,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8672
8861
  }
8673
8862
  });
8674
8863
 
8675
- function template$Q(data) {
8864
+ function template$M(data) {
8676
8865
  var __t, __p = '';
8677
8866
  __p += '<div class="filtered_files-banner">\n <span class="filtered_files-banner_prefix">\n ' +
8678
8867
  ((__t = ( I18n.t('pageflow.editor.views.filtered_files_view.banner_prefix') )) == null ? '' : __t) +
@@ -8691,7 +8880,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8691
8880
  }
8692
8881
 
8693
8882
  var FilteredFilesView = Marionette.ItemView.extend({
8694
- template: template$Q,
8883
+ template: template$M,
8695
8884
  className: 'filtered_files',
8696
8885
  ui: {
8697
8886
  banner: '.filtered_files-banner',
@@ -8746,7 +8935,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8746
8935
  },
8747
8936
  filterTranslation: function filterTranslation(keyName, options) {
8748
8937
  var filterName = this.options.filterName;
8749
- return findTranslation(['pageflow.editor.files.filters.' + this.options.fileType.collectionName + '.' + filterName + '.' + keyName, 'pageflow.editor.files.common_filters.' + keyName], options);
8938
+ return i18nUtils.findTranslation(['pageflow.editor.files.filters.' + this.options.fileType.collectionName + '.' + filterName + '.' + keyName, 'pageflow.editor.files.common_filters.' + keyName], options);
8750
8939
  },
8751
8940
  onClose: function onClose() {
8752
8941
  if (this.filteredCollection) {
@@ -8755,7 +8944,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8755
8944
  }
8756
8945
  });
8757
8946
 
8758
- function template$R(data) {
8947
+ function template$N(data) {
8759
8948
  var __t, __p = '';
8760
8949
  __p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
8761
8950
  ((__t = ( I18n.t('pageflow.editor.views.files_view.importer.heading') )) == null ? '' : __t) +
@@ -8765,7 +8954,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8765
8954
  return __p
8766
8955
  }
8767
8956
 
8768
- function template$S(data) {
8957
+ function template$O(data) {
8769
8958
  var __t, __p = '';
8770
8959
  __p += '<button class=\'importer\' data-key=\'' +
8771
8960
  ((__t = ( data.fileImporter.key )) == null ? '' : __t) +
@@ -8780,7 +8969,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8780
8969
  }
8781
8970
 
8782
8971
  var ImporterSelectView = Marionette.ItemView.extend({
8783
- template: template$S,
8972
+ template: template$O,
8784
8973
  className: 'importer_select',
8785
8974
  tagName: 'li',
8786
8975
  events: {
@@ -8797,7 +8986,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8797
8986
  });
8798
8987
 
8799
8988
  var ChooseImporterView = Marionette.ItemView.extend({
8800
- template: template$R,
8989
+ template: template$N,
8801
8990
  className: 'choose_importer editor dialog',
8802
8991
  mixins: [dialogView],
8803
8992
  ui: {
@@ -8832,7 +9021,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8832
9021
  app.dialogRegion.show(new ChooseImporterView(options).render());
8833
9022
  };
8834
9023
 
8835
- function template$T(data) {
9024
+ function template$P(data) {
8836
9025
  var __t, __p = '';
8837
9026
  __p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
8838
9027
  ((__t = ( I18n.t('pageflow.editor.file_importers.'+data.importerKey+'.dialog_label') )) == null ? '' : __t) +
@@ -8846,7 +9035,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8846
9035
  return __p
8847
9036
  }
8848
9037
 
8849
- function template$U(data) {
9038
+ function template$Q(data) {
8850
9039
  var __t, __p = '';
8851
9040
  __p += '<div class="box">\n <h1 class="dialog-header">' +
8852
9041
  ((__t = ( I18n.t('pageflow.editor.templates.confirm_upload.header') )) == null ? '' : __t) +
@@ -8862,14 +9051,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8862
9051
  return __p
8863
9052
  }
8864
9053
 
8865
- function template$V(data) {
9054
+ function template$R(data) {
8866
9055
  var __p = '';
8867
9056
  __p += '<h2></h2>\n';
8868
9057
  return __p
8869
9058
  }
8870
9059
 
8871
9060
  var UploadableFilesView = Marionette.ItemView.extend({
8872
- template: template$V,
9061
+ template: template$R,
8873
9062
  className: 'uploadable_files',
8874
9063
  ui: {
8875
9064
  header: 'h2'
@@ -8915,7 +9104,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8915
9104
  });
8916
9105
 
8917
9106
  var ConfirmFileImportUploadView = Marionette.Layout.extend({
8918
- template: template$U,
9107
+ template: template$Q,
8919
9108
  className: 'confirm_upload editor dialog',
8920
9109
  mixins: [dialogView],
8921
9110
  regions: {
@@ -8989,7 +9178,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
8989
9178
  };
8990
9179
 
8991
9180
  var FilesImporterView = Marionette.ItemView.extend({
8992
- template: template$T,
9181
+ template: template$P,
8993
9182
  className: 'files_importer editor dialog',
8994
9183
  mixins: [dialogView],
8995
9184
  ui: {
@@ -9076,7 +9265,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9076
9265
  app.dialogRegion.show(new FilesImporterView(options).render());
9077
9266
  };
9078
9267
 
9079
- function template$W(data) {
9268
+ function template$S(data) {
9080
9269
  var __t, __p = '';
9081
9270
  __p += '<button class="">\n <span class="label">' +
9082
9271
  ((__t = ( I18n.t('pageflow.editor.templates.select_button.select') )) == null ? '' : __t) +
@@ -9085,7 +9274,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9085
9274
  }
9086
9275
 
9087
9276
  var SelectButtonView = Marionette.ItemView.extend({
9088
- template: template$W,
9277
+ template: template$S,
9089
9278
  className: 'select_button',
9090
9279
  ui: {
9091
9280
  button: 'button',
@@ -9120,7 +9309,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9120
9309
  }
9121
9310
  });
9122
9311
 
9123
- function template$X(data) {
9312
+ function template$T(data) {
9124
9313
  var __t, __p = '';
9125
9314
  __p += '<a class="back">' +
9126
9315
  ((__t = ( I18n.t('pageflow.editor.templates.files.back') )) == null ? '' : __t) +
@@ -9129,28 +9318,29 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9129
9318
  }
9130
9319
 
9131
9320
  var FilesView = Marionette.ItemView.extend({
9132
- template: template$X,
9321
+ template: template$T,
9133
9322
  className: 'manage_files',
9134
9323
  events: {
9135
9324
  'click a.back': 'goBack',
9136
9325
  'file-selected': 'updatePage'
9137
9326
  },
9138
9327
  onRender: function onRender() {
9139
- this.addFileModel = new Backbone.Model({
9140
- label: I18n$1.t('pageflow.editor.views.files_view.add'),
9141
- options: [{
9142
- label: I18n$1.t('pageflow.editor.views.files_view.upload'),
9143
- handler: this.upload.bind(this)
9144
- }, {
9145
- label: I18n$1.t('pageflow.editor.views.files_view.reuse'),
9146
- handler: function handler() {
9147
- FilesExplorerView.open({
9148
- callback: function callback(otherEntry, file) {
9149
- state.entry.reuseFile(otherEntry, file);
9150
- }
9151
- });
9152
- }
9153
- }, {
9328
+ var menuOptions = [{
9329
+ label: I18n$1.t('pageflow.editor.views.files_view.upload'),
9330
+ handler: this.upload.bind(this)
9331
+ }, {
9332
+ label: I18n$1.t('pageflow.editor.views.files_view.reuse'),
9333
+ handler: function handler() {
9334
+ FilesExplorerView.open({
9335
+ callback: function callback(otherEntry, file) {
9336
+ state.entry.reuseFile(otherEntry, file);
9337
+ }
9338
+ });
9339
+ }
9340
+ }];
9341
+
9342
+ if (editor.fileImporters.keys().length > 0) {
9343
+ menuOptions.push({
9154
9344
  label: I18n$1.t('pageflow.editor.views.files_view.import'),
9155
9345
  handler: function handler() {
9156
9346
  ChooseImporterView.open({
@@ -9161,7 +9351,12 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9161
9351
  }
9162
9352
  });
9163
9353
  }
9164
- }]
9354
+ });
9355
+ }
9356
+
9357
+ this.addFileModel = new Backbone.Model({
9358
+ label: I18n$1.t('pageflow.editor.views.files_view.add'),
9359
+ options: menuOptions
9165
9360
  });
9166
9361
  this.$el.append(this.subview(new SelectButtonView({
9167
9362
  model: this.addFileModel
@@ -9208,14 +9403,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9208
9403
  }
9209
9404
  });
9210
9405
 
9211
- function template$Y(data) {
9406
+ function template$U(data) {
9212
9407
  var __p = '';
9213
9408
  __p += '<div class="quota_state">\n</div>\n<div class="outlet">\n</div>\n<div class="exhausted_message">\n</div>\n';
9214
9409
  return __p
9215
9410
  }
9216
9411
 
9217
9412
  var EntryPublicationQuotaDecoratorView = Marionette.Layout.extend({
9218
- template: template$Y,
9413
+ template: template$U,
9219
9414
  className: 'quota_decorator',
9220
9415
  regions: {
9221
9416
  outlet: '.outlet'
@@ -9256,7 +9451,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9256
9451
  }
9257
9452
  });
9258
9453
 
9259
- function template$Z(data) {
9454
+ function template$V(data) {
9260
9455
  var __t, __p = '';
9261
9456
  __p += '<div class="files_pending notice">\n <p>' +
9262
9457
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.files_pending_notice') )) == null ? '' : __t) +
@@ -9303,7 +9498,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9303
9498
  }
9304
9499
 
9305
9500
  var PublishEntryView = Marionette.ItemView.extend({
9306
- template: template$Z,
9501
+ template: template$V,
9307
9502
  className: 'publish_entry',
9308
9503
  ui: {
9309
9504
  publishUntilFields: '.publish_until_fields',
@@ -9711,123 +9906,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9711
9906
  }
9712
9907
  });
9713
9908
 
9714
- function template$_(data) {
9715
- var __t, __p = '';
9716
- __p += '<h2>' +
9717
- ((__t = ( I18n.t('pageflow.editor.blank_entry.header') )) == null ? '' : __t) +
9718
- '</h2>\n<p>' +
9719
- ((__t = ( I18n.t('pageflow.editor.blank_entry.intro') )) == null ? '' : __t) +
9720
- '</p>\n<ol>\n <li>' +
9721
- ((__t = ( I18n.t('pageflow.editor.blank_entry.create_chapter') )) == null ? '' : __t) +
9722
- '</li>\n <li>' +
9723
- ((__t = ( I18n.t('pageflow.editor.blank_entry.create_page') )) == null ? '' : __t) +
9724
- '</li>\n <li>' +
9725
- ((__t = ( I18n.t('pageflow.editor.blank_entry.edit_page') )) == null ? '' : __t) +
9726
- '</li>\n</ol>\n<p>' +
9727
- ((__t = ( I18n.t('pageflow.editor.blank_entry.outro') )) == null ? '' : __t) +
9728
- '</p>\n';
9729
- return __p
9730
- }
9731
-
9732
- var BlankEntryView = Marionette.ItemView.extend({
9733
- template: template$_,
9734
- className: 'blank_entry'
9735
- });
9736
-
9737
- var PagePreviewView = Marionette.View.extend({
9738
- tagName: 'section',
9739
- className: 'page',
9740
- modelEvents: {
9741
- 'change:template': 'updateTemplate',
9742
- 'change:configuration': 'update',
9743
- 'change:position': 'updatePositionClassNames',
9744
- 'change:id': function changeId() {
9745
- this.$el.attr('data-id', this.model.id);
9746
- this.$el.attr('data-perma-id', this.model.get('perma_id'));
9747
- this.$el.attr('id', this.model.get('perma_id'));
9748
- }
9749
- },
9750
- events: {
9751
- pageactivate: function pageactivate() {
9752
- this.model.set('active', true);
9753
- },
9754
- pagedeactivate: function pagedeactivate() {
9755
- this.model.set('active', false);
9756
- }
9757
- },
9758
- render: function render() {
9759
- this.$el.html(this.pageTemplate());
9760
- this.$el.attr('data-id', this.model.id);
9761
- this.$el.attr('data-perma-id', this.model.get('perma_id'));
9762
- this.$el.attr('id', this.model.get('perma_id'));
9763
- this.$el.attr('data-chapter-id', this.model.get('chapter_id'));
9764
- this.$el.data('template', this.model.get('template'));
9765
- this.$el.data('configuration', this.model.get('configuration'));
9766
- this.$el.on('pageenhanced', _$1.bind(function () {
9767
- this.update();
9768
- this.initEmbeddedViews();
9769
- this.$el.page('reactivate');
9770
- }, this));
9771
- return this;
9772
- },
9773
- onClose: function onClose() {
9774
- this.$el.page('cleanup');
9775
- },
9776
- updateTemplate: function updateTemplate() {
9777
- this.$el.page('cleanup');
9778
- this.$el.html(this.pageTemplate());
9779
- this.$el.data('template', this.model.get('template'));
9780
- setTimeout(_$1.bind(function () {
9781
- this.$el.page('reinit');
9782
- }, this), 0);
9783
- },
9784
- update: function update() {
9785
- this.$el.page('update', this.model.configuration);
9786
- pageflow.events.trigger('page:update', this.model);
9787
- this.refreshScroller();
9788
- this.updatePositionClassNames();
9789
- },
9790
- updatePositionClassNames: function updatePositionClassNames() {
9791
- this.$el.toggleClass('chapter_beginning', this.model.isChapterBeginning());
9792
- this.$el.toggleClass('first_page', this.model.isFirstPage());
9793
- },
9794
- pageTypeHooks: function pageTypeHooks() {
9795
- return pageflow.pageType.get(this.model.get('template'));
9796
- },
9797
- pageTemplate: function pageTemplate() {
9798
- return this._unescape($('script[data-template="' + this.model.get('template') + '_page"]').html());
9799
- },
9800
- refreshScroller: function refreshScroller() {
9801
- this.$el.page('refreshScroller');
9802
- },
9803
- initEmbeddedViews: function initEmbeddedViews() {
9804
- var view = this;
9805
-
9806
- if (view.embeddedViews) {
9807
- view.embeddedViews.call('close');
9808
- }
9809
-
9810
- view.embeddedViews = new ChildViewContainer();
9811
-
9812
- _$1.each(view.embeddedViewDefinitions(), function (item, selector) {
9813
- view.$(selector).each(function () {
9814
- view.embeddedViews.add(new item.view(_$1.extend(item.options || {}, {
9815
- el: this,
9816
- model: view.model.configuration,
9817
- container: view
9818
- })).render());
9819
- });
9820
- });
9821
- },
9822
- embeddedViewDefinitions: function embeddedViewDefinitions() {
9823
- return _$1.extend({}, this.pageTypeHooks().embeddedEditorViews() || {}, this.model.pageType().embeddedViews());
9824
- },
9825
- _unescape: function _unescape(text) {
9826
- return $('<div/>').html(text).text();
9827
- }
9828
- });
9829
-
9830
- function template$$(data) {
9909
+ function template$W(data) {
9831
9910
  var __t, __p = '';
9832
9911
  __p += '<div class="box">\n <h2>' +
9833
9912
  ((__t = ( I18n.t('pageflow.editor.templates.help.title') )) == null ? '' : __t) +
@@ -9838,7 +9917,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9838
9917
  }
9839
9918
 
9840
9919
  var HelpView = Marionette.ItemView.extend({
9841
- template: template$$,
9920
+ template: template$W,
9842
9921
  className: 'help',
9843
9922
  ui: {
9844
9923
  placeholder: '.placeholder',
@@ -9911,7 +9990,11 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9911
9990
  }
9912
9991
  });
9913
9992
 
9914
- function template$10(data) {
9993
+ var PageThumbnailView = ModelThumbnailView.extend({
9994
+ className: 'model_thumbnail page_thumbnail'
9995
+ });
9996
+
9997
+ function template$X(data) {
9915
9998
  var __t, __p = '';
9916
9999
  __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="' +
9917
10000
  ((__t = ( I18n.t('pageflow.editor.templates.page_link_item.remove') )) == null ? '' : __t) +
@@ -9922,7 +10005,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9922
10005
  }
9923
10006
 
9924
10007
  var PageLinkItemView = Marionette.ItemView.extend({
9925
- template: template$10,
10008
+ template: template$X,
9926
10009
  tagName: 'li',
9927
10010
  className: 'page_link',
9928
10011
  ui: {
@@ -9972,7 +10055,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9972
10055
  }
9973
10056
  });
9974
10057
 
9975
- function template$11(data) {
10058
+ function template$Y(data) {
9976
10059
  var __t, __p = '';
9977
10060
  __p += '<label>\n <span class="name">' +
9978
10061
  ((__t = ( I18n.t('pageflow.editor.templates.page_links.label') )) == null ? '' : __t) +
@@ -9983,7 +10066,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
9983
10066
  }
9984
10067
 
9985
10068
  var PageLinksView = Marionette.ItemView.extend({
9986
- template: template$11,
10069
+ template: template$Y,
9987
10070
  className: 'page_links',
9988
10071
  ui: {
9989
10072
  links: 'ul.links',
@@ -10019,7 +10102,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10019
10102
  }
10020
10103
  });
10021
10104
 
10022
- function template$12(data) {
10105
+ function template$Z(data) {
10023
10106
  var __t, __p = '';
10024
10107
  __p += '<div class="emulation_mode_button-menu">\n <div class="emulation_mode_button-menu_header">\n ' +
10025
10108
  ((__t = ( I18n.t('pageflow.editor.templates.emulation_mode_button.header') )) == null ? '' : __t) +
@@ -10038,7 +10121,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10038
10121
  }
10039
10122
 
10040
10123
  var EmulationModeButtonView = Marionette.ItemView.extend({
10041
- template: template$12,
10124
+ template: template$Z,
10042
10125
  className: 'emulation_mode_button',
10043
10126
  ui: {
10044
10127
  phoneItem: '.emulation_mode_button-phone',
@@ -10051,7 +10134,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10051
10134
  this.model.unset('emulation_mode');
10052
10135
  },
10053
10136
  'click .emulation_mode_button-phone a': function clickEmulation_mode_buttonPhoneA() {
10054
- if (!this.model.get('current_page_supports_emulation_mode')) {
10137
+ if (this.model.get('emulation_mode_disabled')) {
10055
10138
  return;
10056
10139
  }
10057
10140
 
@@ -10059,13 +10142,13 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10059
10142
  }
10060
10143
  },
10061
10144
  modelEvents: {
10062
- 'change:emulation_mode change:current_page_supports_emulation_mode': 'update'
10145
+ 'change:emulation_mode change:emulation_mode_disabled': 'update'
10063
10146
  },
10064
10147
  onRender: function onRender() {
10065
10148
  this.update();
10066
10149
  },
10067
10150
  update: function update() {
10068
- this.ui.phoneItem.toggleClass('disabled', !this.model.get('current_page_supports_emulation_mode'));
10151
+ this.ui.phoneItem.toggleClass('disabled', !!this.model.get('emulation_mode_disabled'));
10069
10152
  this.ui.phoneItem.toggleClass('active', this.model.has('emulation_mode'));
10070
10153
  this.ui.desktopItem.toggleClass('active', !this.model.has('emulation_mode'));
10071
10154
  this.ui.phoneDisplay.toggleClass('active', this.model.has('emulation_mode'));
@@ -10073,7 +10156,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10073
10156
  }
10074
10157
  });
10075
10158
 
10076
- function template$13(data) {
10159
+ function template$_(data) {
10077
10160
  var __t, __p = '';
10078
10161
  __p +=
10079
10162
  ((__t = ( I18n.t('pageflow.editor.templates.help_button.open_help') )) == null ? '' : __t);
@@ -10081,7 +10164,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10081
10164
  }
10082
10165
 
10083
10166
  var HelpButtonView = Marionette.ItemView.extend({
10084
- template: template$13,
10167
+ template: template$_,
10085
10168
  className: 'help_button',
10086
10169
  events: {
10087
10170
  'click': function click() {
@@ -10093,7 +10176,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10093
10176
  var SidebarFooterView = Marionette.View.extend({
10094
10177
  className: 'sidebar_footer',
10095
10178
  render: function render() {
10096
- if (pageflow.features.isEnabled('editor_emulation_mode')) {
10179
+ if (this.model.supportsPhoneEmulation()) {
10097
10180
  this.appendSubview(new EmulationModeButtonView({
10098
10181
  model: this.model
10099
10182
  }));
@@ -10104,166 +10187,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10104
10187
  }
10105
10188
  });
10106
10189
 
10107
- function template$14(data) {
10108
- var __t, __p = '';
10109
- __p += '<div class="container">\n <div class="header"></div>\n <div class="overview"></div>\n\n <div class="entry"></div>\n</div>\n<div class="navigation_disabled_hint">\n ' +
10110
- ((__t = ( I18n.t('pageflow.editor.templates.entry_preview.navigation_disabled_hint') )) == null ? '' : __t) +
10111
- '\n</div>\n';
10112
- return __p
10113
- }
10114
-
10115
- var EntryPreviewView = Marionette.ItemView.extend({
10116
- template: template$14,
10117
- className: 'entry_preview',
10118
- ui: {
10119
- container: '> .container',
10120
- header: '> .container > .header',
10121
- entry: '> .container > .entry',
10122
- overview: '> .container > .overview',
10123
- navigationDisabledHint: '.navigation_disabled_hint'
10124
- },
10125
- initialize: function initialize() {
10126
- this.pages = this.model.pages.persisted();
10127
- this.widgets = $();
10128
- this.debouncedFetchWidgets = _$1.debounce(this.fetchWidgets, 200);
10129
- },
10130
- onRender: function onRender() {
10131
- this.pageViews = this.subview(new CollectionView({
10132
- el: this.ui.entry,
10133
- collection: this.pages,
10134
- itemViewConstructor: PagePreviewView,
10135
- blankSlateViewConstructor: BlankEntryView
10136
- }));
10137
- this.ui.entry.append($('#indicators_seed > *'));
10138
- this.update();
10139
- this.listenTo(state.entry, 'sync:order sync:widgets', this.update);
10140
- this.listenTo(state.entry, 'change:configuration', function () {
10141
- state.entry.once('sync', this.update, this);
10142
- });
10143
- this.listenTo(state.entry, 'change:emulation_mode', this.updateEmulationMode);
10144
- this.listenTo(state.storylines, 'sync', this.update);
10145
- this.listenTo(state.chapters, 'sync', this.update);
10146
- this.listenTo(state.pages, 'sync', this.update);
10147
- this.listenTo(state.audioFiles, 'sync', this.update);
10148
- this.listenTo(state.imageFiles, 'sync', this.update);
10149
- this.listenTo(state.videoFiles, 'sync', this.update);
10150
- this.listenTo(pageflow.events, 'page:changing', function (event) {
10151
- if (state.entry.get('emulation_mode')) {
10152
- this.ui.navigationDisabledHint.css('opacity', 1);
10153
- clearTimeout(this.navigationDisabledHintTimeout);
10154
- this.navigationDisabledHintTimeout = setTimeout(_$1.bind(function () {
10155
- this.ui.navigationDisabledHint.css('opacity', 0);
10156
- }, this), 2000);
10157
- event.cancel();
10158
- }
10159
- });
10160
- this.listenTo(pageflow.events, 'page:change', function (page) {
10161
- this.updateEmulationModeSupport(page.getPermaId());
10162
- });
10163
- },
10164
- onShow: function onShow() {
10165
- var slideshow = pageflow.Slideshow.setup({
10166
- element: this.ui.entry,
10167
- enabledFeatureNames: state.entry.get('enabled_feature_names'),
10168
- simulateHistory: true
10169
- });
10170
- pageflow.delayedStart.perform();
10171
- this.listenTo(this.pages, 'add', function () {
10172
- slideshow.update();
10173
- });
10174
- this.listenTo(this.pages, 'remove', function () {
10175
- slideshow.update();
10176
- });
10177
- this.listenTo(this.pages, 'edit', function (model) {
10178
- if (this.lastEditedPage != model) {
10179
- state.entry.unset('emulation_mode');
10180
- }
10181
-
10182
- this.lastEditedPage = model;
10183
- slideshow.goTo(this.pageViews.itemViews.findByModel(model).$el);
10184
- });
10185
- this.listenTo(app, 'resize', function () {
10186
- slideshow.triggerResizeHooks();
10187
- this.updateSimulatedMediaQueryClasses();
10188
- });
10189
- this.listenTo(state.pages, 'change:template', function () {
10190
- this.updateEmulationModeSupport(slideshow.currentPagePermaId());
10191
- });
10192
- this.updateSimulatedMediaQueryClasses();
10193
- },
10194
- updateEmulationModeSupport: function updateEmulationModeSupport(permaId) {
10195
- var model = state.pages.getByPermaId(permaId);
10196
- state.entry.set('current_page_supports_emulation_mode', model && model.pageType().supportsPhoneEmulation());
10197
- },
10198
- updateSimulatedMediaQueryClasses: function updateSimulatedMediaQueryClasses() {
10199
- var width = this.ui.container.width();
10200
- var height = this.ui.container.height();
10201
- var portrait = width < height;
10202
- $('html').toggleClass('simulate_mobile', width <= 900).toggleClass('simulate_phone', portrait && width <= 500 || !portrait && height <= 500).toggleClass('simulate_desktop', portrait && width > 500 || !portrait && height > 500).toggleClass('simulate_narrow_desktop', width <= 1200).toggleClass('simulate_wide_desktop', width > 1600).toggleClass('simulate_pad_portrait', width <= 768 && portrait).toggleClass('simulate_phone_portrait', width <= 500 && portrait);
10203
- },
10204
- update: function update() {
10205
- this.debouncedFetchWidgets();
10206
- this.$el.toggleClass('emphasize_chapter_beginning', !!this.model.configuration.get('emphasize_chapter_beginning'));
10207
- },
10208
- fetchWidgets: function fetchWidgets() {
10209
- var view = this;
10210
- $.ajax(this.model.url() + '/partials').success(function (response) {
10211
- var partials = $('<div />').html(response);
10212
- view.ui.header.replaceWith(partials.find('> .header'));
10213
- view.ui.overview.replaceWith(partials.find('> .overview'));
10214
- view.bindUIElements();
10215
- view.updateWidgets(partials);
10216
- view.ui.header.header({
10217
- slideshow: pageflow.slides
10218
- });
10219
- view.ui.overview.overview();
10220
- });
10221
- },
10222
- updateWidgets: function updateWidgets(partials) {
10223
- var widgets = partials.find('[data-widget]');
10224
- this.updatePresentWidgetsCssClasses(widgets);
10225
- this.widgets.remove();
10226
- this.widgets = widgets;
10227
- this.ui.entry.before(this.widgets);
10228
- pageflow.widgetTypes.enhance(this.$el);
10229
- },
10230
- updatePresentWidgetsCssClasses: function updatePresentWidgetsCssClasses(newWidgets) {
10231
- var previousClasses = this.widgetNames(this.widgets);
10232
- var newClasses = this.widgetNames(newWidgets);
10233
-
10234
- var removedClasses = _$1.difference(previousClasses, newClasses);
10235
-
10236
- var addedClasses = _$1.difference(newClasses, previousClasses);
10237
-
10238
- this.$el.addClass('widgets_present');
10239
- this.$el.removeClass(removedClasses.join(' '));
10240
- this.$el.addClass(addedClasses.join(' '));
10241
-
10242
- if (removedClasses.length || addedClasses.length) {
10243
- pageflow.events.trigger('widgets:update');
10244
- }
10245
- },
10246
- widgetNames: function widgetNames(widgets) {
10247
- return widgets.map(function () {
10248
- return 'widget_' + $(this).data('widget') + '_present';
10249
- }).get();
10250
- },
10251
- updateEmulationMode: function updateEmulationMode() {
10252
- if (state.entry.previous('emulation_mode')) {
10253
- this.$el.removeClass(this.emulationModeClassName(state.entry.previous('emulation_mode')));
10254
- }
10255
-
10256
- if (state.entry.get('emulation_mode')) {
10257
- this.$el.addClass(this.emulationModeClassName(state.entry.get('emulation_mode')));
10258
- }
10259
-
10260
- app.trigger('resize');
10261
- },
10262
- emulationModeClassName: function emulationModeClassName(mode) {
10263
- return 'emulation_mode_' + mode;
10264
- }
10265
- });
10266
-
10267
10190
  var HelpImageView = Marionette.View.extend({
10268
10191
  tagName: 'img',
10269
10192
  className: 'help_image',
@@ -10281,60 +10204,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10281
10204
  }
10282
10205
  });
10283
10206
 
10284
- function template$15(data) {
10285
- var __t, __p = '';
10286
- __p += '<div class="box">\n <h2>' +
10287
- ((__t = ( I18n.t('pageflow.editor.templates.page_selection.title') )) == null ? '' : __t) +
10288
- '</h2>\n\n <div class="wrapper editor">\n <div class="storyline_picker">\n </div>\n </div>\n\n <div class="footer">\n <a href="" class="close">' +
10289
- ((__t = ( I18n.t('pageflow.editor.templates.page_selection.cancel') )) == null ? '' : __t) +
10290
- '</a>\n </div>\n</div>\n';
10291
- return __p
10292
- }
10293
-
10294
- var PageSelectionView = Marionette.ItemView.extend({
10295
- template: template$15,
10296
- className: 'page_selection dialog',
10297
- mixins: [dialogView],
10298
- ui: {
10299
- storylines: '.storyline_picker',
10300
- chapters: '.chapters'
10301
- },
10302
- events: {
10303
- 'click ul.pages li': function clickUlPagesLi(event) {
10304
- this.options.onSelect(state.pages.get($(event.currentTarget).data('id')));
10305
- this.close();
10306
- }
10307
- },
10308
- onRender: function onRender() {
10309
- var options = this.options;
10310
- this.subview(new StorylinePickerView({
10311
- el: this.ui.storylines,
10312
- pageItemViewOptions: {
10313
- isDisabled: function isDisabled(page) {
10314
- return options.isAllowed && !options.isAllowed(page);
10315
- }
10316
- }
10317
- }));
10318
- }
10319
- });
10320
-
10321
- PageSelectionView.selectPage = function (options) {
10322
- return $.Deferred(function (deferred) {
10323
- var view = new PageSelectionView({
10324
- model: state.entry,
10325
- onSelect: deferred.resolve,
10326
- isAllowed: options && options.isAllowed
10327
- });
10328
- view.on('close', function () {
10329
- deferred.reject();
10330
- });
10331
- app.dialogRegion.show(view.render());
10332
- }).promise();
10333
- };
10334
-
10335
- editor.pageSelectionView = PageSelectionView;
10336
-
10337
- function template$16(data) {
10207
+ function template$$(data) {
10338
10208
  var __t, __p = '';
10339
10209
  __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="' +
10340
10210
  ((__t = ( I18n.t('pageflow.editor.templates.list_item.edit') )) == null ? '' : __t) +
@@ -10344,10 +10214,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10344
10214
  return __p
10345
10215
  }
10346
10216
 
10347
- /** @api private */
10348
-
10349
10217
  var ListItemView = Marionette.ItemView.extend({
10350
- template: template$16,
10218
+ template: template$$,
10351
10219
  tagName: 'li',
10352
10220
  className: 'list_item',
10353
10221
  ui: {
@@ -10421,7 +10289,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10421
10289
  }
10422
10290
  });
10423
10291
 
10424
- function template$17(data) {
10292
+ function template$10(data) {
10425
10293
  var __t, __p = '';
10426
10294
  __p += '<div class="checking notice">\n <p>' +
10427
10295
  ((__t = ( I18n.t('pageflow.editor.templates.locked.loading') )) == null ? '' : __t) +
@@ -10436,7 +10304,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10436
10304
  }
10437
10305
 
10438
10306
  var LockedView = Marionette.ItemView.extend({
10439
- template: template$17,
10307
+ template: template$10,
10440
10308
  className: 'locked checking',
10441
10309
  ui: {
10442
10310
  breakButton: '.break',
@@ -10513,6 +10381,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10513
10381
  resizerTip: I18n$1.t('pageflow.editor.views.editor_views.resize_editor'),
10514
10382
  enableCursorHotkey: false,
10515
10383
  fxName: 'none',
10384
+ maskIframesOnResize: true,
10516
10385
  onresize: function onresize() {
10517
10386
  app.trigger('resize');
10518
10387
  }
@@ -10628,7 +10497,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10628
10497
  }
10629
10498
  });
10630
10499
 
10631
- function template$18(data) {
10500
+ function template$11(data) {
10632
10501
  var __t, __p = '';
10633
10502
  __p += '<li class="uploading"><span class="count">0</span>' +
10634
10503
  ((__t = ( I18n.t('pageflow.editor.templates.notification.upload_pending') )) == null ? '' : __t) +
@@ -10651,7 +10520,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10651
10520
  var NotificationsView = Marionette.ItemView.extend({
10652
10521
  className: 'notifications',
10653
10522
  tagName: 'ul',
10654
- template: template$18,
10523
+ template: template$11,
10655
10524
  ui: {
10656
10525
  failedCount: '.failed .count',
10657
10526
  uploadingCount: '.uploading .count',
@@ -10665,8 +10534,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10665
10534
  onRender: function onRender() {
10666
10535
  this.listenTo(state.entry, 'change:uploading_files_count', this.notifyUploadCount);
10667
10536
  this.listenTo(state.entry, 'change:confirmable_files_count', this.notifyConfirmableFilesCount);
10668
- this.listenTo(state.savingRecords, 'add', this.update);
10669
- this.listenTo(state.savingRecords, 'remove', this.update);
10537
+ this.listenTo(editor.savingRecords, 'add', this.update);
10538
+ this.listenTo(editor.savingRecords, 'remove', this.update);
10670
10539
  this.listenTo(editor.failures, 'add', this.update);
10671
10540
  this.listenTo(editor.failures, 'remove', this.update);
10672
10541
  this.update();
@@ -10674,7 +10543,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10674
10543
  },
10675
10544
  update: function update() {
10676
10545
  this.$el.toggleClass('failed', !editor.failures.isEmpty());
10677
- this.$el.toggleClass('saving', !state.savingRecords.isEmpty());
10546
+ this.$el.toggleClass('saving', !editor.savingRecords.isEmpty());
10678
10547
  this.ui.failedCount.text(editor.failures.count());
10679
10548
  },
10680
10549
  notifyUploadCount: function notifyUploadCount(model, uploadCount) {
@@ -10738,14 +10607,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10738
10607
  }
10739
10608
  });
10740
10609
 
10741
- function template$19(data) {
10610
+ function template$12(data) {
10742
10611
  var __p = '';
10743
10612
  __p += '<h2></h2>\n';
10744
10613
  return __p
10745
10614
  }
10746
10615
 
10747
10616
  var NestedFilesView = Marionette.ItemView.extend({
10748
- template: template$19,
10617
+ template: template$12,
10749
10618
  className: 'nested_files',
10750
10619
  ui: {
10751
10620
  header: 'h2'
@@ -10821,7 +10690,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10821
10690
  }, 200)
10822
10691
  });
10823
10692
 
10824
- function template$1a(data) {
10693
+ function template$13(data) {
10825
10694
  var __t, __p = '';
10826
10695
  __p += '<div class="text_tracks_container">\n <div class="files_upload_panel">\n <div class="files_panel">\n </div>\n <a class="upload" href="">' +
10827
10696
  ((__t = ( I18n.t('pageflow.editor.templates.text_tracks.upload') )) == null ? '' : __t) +
@@ -10832,7 +10701,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10832
10701
  }
10833
10702
 
10834
10703
  var TextTracksView = Marionette.Layout.extend({
10835
- template: template$1a,
10704
+ template: template$13,
10836
10705
  className: 'text_tracks',
10837
10706
  regions: {
10838
10707
  selectedFileRegion: '.selected_file_region'
@@ -10909,7 +10778,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10909
10778
  this.listenTo(pageflow.events, 'atmo:enabled', function () {
10910
10779
  this.$el.hide();
10911
10780
  });
10912
- this.$el.toggle(pageflow.atmo.disabled);
10781
+ this.$el.toggle(!!pageflow.atmo && pageflow.atmo.disabled);
10913
10782
  },
10914
10783
  render: function render() {
10915
10784
  this.$el.attr('title', I18n$1.t('pageflow.editor.atmo.disabled'));
@@ -10917,7 +10786,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10917
10786
  }
10918
10787
  });
10919
10788
 
10920
- function template$1b(data) {
10789
+ function template$14(data) {
10921
10790
  var __p = '';
10922
10791
  __p += '<label>\n <span class="list_label"></span>\n</label>\n\n<ul class="list_items"></ul>\n';
10923
10792
  return __p
@@ -10939,6 +10808,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10939
10808
  *
10940
10809
  * @param {Backbone.Collection} options.collection
10941
10810
  *
10811
+ * @param {Object} options
10812
+ *
10942
10813
  * @param {string} options.label
10943
10814
  * Text of the label to display above the list.
10944
10815
  *
@@ -10959,11 +10830,10 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10959
10830
  * @param {function} [options.onRemove]
10960
10831
  *
10961
10832
  * @class
10962
- * @memberof module:pageflow/editor
10963
10833
  */
10964
10834
 
10965
10835
  var ListView = Marionette.ItemView.extend({
10966
- template: template$1b,
10836
+ template: template$14,
10967
10837
  className: 'list',
10968
10838
  ui: {
10969
10839
  label: '.list_label',
@@ -10993,7 +10863,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
10993
10863
  });
10994
10864
 
10995
10865
  var ConfirmUploadView = Marionette.Layout.extend({
10996
- template: template$U,
10866
+ template: template$Q,
10997
10867
  className: 'confirm_upload editor dialog',
10998
10868
  mixins: [dialogView],
10999
10869
  regions: {
@@ -11052,6 +10922,100 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11052
10922
  app.dialogRegion.show(new ConfirmUploadView(options));
11053
10923
  };
11054
10924
 
10925
+ /**
10926
+ * Base view to edit configuration container models. Extend and
10927
+ * override the `configure` method which receives a {@link
10928
+ * ConfigurationEditorView} to define the tabs and inputs that shall
10929
+ * be displayed.
10930
+ *
10931
+ * Add a `translationKeyPrefix` property to the prototype and define
10932
+ * the following translations:
10933
+ *
10934
+ * * `<translationKeyPrefix>.tabs`: used as `tabTranslationKeyPrefix`
10935
+ * of the `ConfigurationEditorView`.
10936
+ *
10937
+ * * `<translationKeyPrefix>.attributes`: used as one of the
10938
+ * `attributeTranslationKeyPrefixes` of the
10939
+ * `ConfigurationEditorView`.
10940
+ *
10941
+ * * `<translationKeyPrefix>.back` (optional): Back button label.
10942
+ *
10943
+ * * `<translationKeyPrefix>.destroy` (optional): Destroy button
10944
+ * label.
10945
+ *
10946
+ * * `<translationKeyPrefix>.confirm_destroy` (optional): Confirm
10947
+ * message displayed before destroying.
10948
+ *
10949
+ * * `<translationKeyPrefix>.save_error` (optional): Header of the
10950
+ * failure message that is displayed if the model cannot be saved.
10951
+ *
10952
+ * * `<translationKeyPrefix>.retry` (optional): Label of the retry
10953
+ * button of the failure message.
10954
+ *
10955
+ * @param {Object} options
10956
+ * @param {Backbone.Model} options.model -
10957
+ * Model including the {@link configurationContainer},
10958
+ * {@link failureTracking} and {@link delayedDestroying} mixins.
10959
+ *
10960
+ * @since 15.1
10961
+ */
10962
+
10963
+ var EditConfigurationView = Marionette.Layout.extend({
10964
+ template: function template(_ref) {
10965
+ var t = _ref.t;
10966
+ return "\n <a class=\"back\">".concat(t('back'), "</a>\n <a class=\"destroy\">").concat(t('destroy'), "</a>\n\n <div class=\"failure\">\n <p>").concat(t('save_error'), "</p>\n <p class=\"message\"></p>\n <a class=\"retry\" href=\"\">").concat(t('retry'), "</a>\n </div>\n\n <div class=\"configuration_container\"></div>\n ");
10967
+ },
10968
+ serializeData: function serializeData() {
10969
+ var _this = this;
10970
+
10971
+ return {
10972
+ t: function t(key) {
10973
+ return _this.t(key);
10974
+ }
10975
+ };
10976
+ },
10977
+ mixins: [failureIndicatingView],
10978
+ regions: {
10979
+ configurationContainer: '.configuration_container'
10980
+ },
10981
+ events: {
10982
+ 'click a.back': 'goBack',
10983
+ 'click a.destroy': 'destroy'
10984
+ },
10985
+ onRender: function onRender() {
10986
+ var translationKeyPrefix = _$1.result(this, 'translationKeyPrefix');
10987
+
10988
+ this.configurationEditor = new ConfigurationEditorView({
10989
+ tabTranslationKeyPrefix: "".concat(translationKeyPrefix, ".tabs"),
10990
+ attributeTranslationKeyPrefixes: ["".concat(translationKeyPrefix, ".attributes")],
10991
+ model: this.model.configuration
10992
+ });
10993
+ this.configure(this.configurationEditor);
10994
+ this.configurationContainer.show(this.configurationEditor);
10995
+ },
10996
+ onShow: function onShow() {
10997
+ this.configurationEditor.refreshScroller();
10998
+ },
10999
+ destroy: function destroy() {
11000
+ if (window.confirm(this.t('confirm_destroy'))) {
11001
+ this.model.destroyWithDelay();
11002
+ this.goBack();
11003
+ }
11004
+ },
11005
+ goBack: function goBack() {
11006
+ editor.navigate('/', {
11007
+ trigger: true
11008
+ });
11009
+ },
11010
+ t: function t(suffix) {
11011
+ var translationKeyPrefix = _$1.result(this, 'translationKeyPrefix');
11012
+
11013
+ return I18n$1.t("".concat(translationKeyPrefix, ".").concat(suffix), {
11014
+ defaultValue: I18n$1.t("pageflow.editor.views.edit_configuration.".concat(suffix))
11015
+ });
11016
+ }
11017
+ });
11018
+
11055
11019
  ConfigurationEditorView.register('audio', {
11056
11020
  configure: function configure() {
11057
11021
  this.tab('general', function () {
@@ -11355,7 +11319,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11355
11319
  text: I18n$1.t('pageflow.editor.title_loading_spinner.widget_type_info_box_text')
11356
11320
  });
11357
11321
  this.input('title', TextInputView, {
11358
- placeholder: state.entry.configuration.get('title') || state.entry.get('entry_title')
11322
+ placeholder: state.entry.metadata.get('title') || state.entry.get('entry_title')
11359
11323
  });
11360
11324
  this.input('subtitle', TextInputView);
11361
11325
  this.input('custom_background_image_id', FileInputView, {
@@ -11533,7 +11497,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11533
11497
  state.pages = new PagesCollection(options.pages);
11534
11498
  state.chapters = new ChaptersCollection(options.chapters);
11535
11499
  state.storylines = new StorylinesCollection(options.storylines);
11536
- state.entry = new Entry(options.entry, {
11500
+ state.entry = editor.createEntryModel(options, {
11537
11501
  widgets: widgets
11538
11502
  });
11539
11503
  state.theming = new Theming(options.theming);
@@ -11557,9 +11521,8 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11557
11521
  editor.failures.watch(state.entry);
11558
11522
  editor.failures.watch(state.pages);
11559
11523
  editor.failures.watch(state.chapters);
11560
- state.savingRecords = new SavingRecordsCollection();
11561
- state.savingRecords.watch(state.pages);
11562
- state.savingRecords.watch(state.chapters);
11524
+ editor.savingRecords.watch(state.pages);
11525
+ editor.savingRecords.watch(state.chapters);
11563
11526
  pageflow.events.trigger('seed:loaded');
11564
11527
  });
11565
11528
 
@@ -11616,7 +11579,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11616
11579
  state.entry.on('use:files', function () {
11617
11580
  pageflow.stylesheet.reload('entry');
11618
11581
  });
11619
- state.entry.configuration.on('change:theme_name', function () {
11582
+ state.entry.metadata.on('change:theme_name', function () {
11620
11583
  var theme = state.entry.getTheme();
11621
11584
  pageflow.stylesheet.update('theme', theme.get('stylesheet_path'));
11622
11585
  });
@@ -11673,7 +11636,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11673
11636
  el: $('sidebar .scrolling'),
11674
11637
  region: app.sidebarRegion
11675
11638
  }).render();
11676
- app.previewRegion.show(new EntryPreviewView({
11639
+ app.previewRegion.show(new editor.entryType.previewView({
11677
11640
  model: state.entry
11678
11641
  }));
11679
11642
  app.indicatorsRegion.show(new DisabledAtmoIndicatorView());
@@ -11701,11 +11664,9 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11701
11664
  exports.BackgroundPositioningPreviewView = BackgroundPositioningPreviewView;
11702
11665
  exports.BackgroundPositioningSlidersView = BackgroundPositioningSlidersView;
11703
11666
  exports.BackgroundPositioningView = BackgroundPositioningView;
11704
- exports.BlankEntryView = BlankEntryView;
11705
11667
  exports.ChangeThemeDialogView = ChangeThemeDialogView;
11706
11668
  exports.Chapter = Chapter;
11707
11669
  exports.ChapterConfiguration = ChapterConfiguration;
11708
- exports.ChapterItemView = ChapterItemView;
11709
11670
  exports.ChapterPagesCollection = ChapterPagesCollection;
11710
11671
  exports.ChapterScaffold = ChapterScaffold;
11711
11672
  exports.ChaptersCollection = ChaptersCollection;
@@ -11727,6 +11688,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11727
11688
  exports.DropDownButtonItemView = DropDownButtonItemView;
11728
11689
  exports.DropDownButtonView = DropDownButtonView;
11729
11690
  exports.EditChapterView = EditChapterView;
11691
+ exports.EditConfigurationView = EditConfigurationView;
11730
11692
  exports.EditEntryView = EditEntryView;
11731
11693
  exports.EditFileView = EditFileView;
11732
11694
  exports.EditLock = EditLock;
@@ -11743,14 +11705,14 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11743
11705
  exports.EncodedFile = EncodedFile;
11744
11706
  exports.EncodingConfirmation = EncodingConfirmation;
11745
11707
  exports.Entry = Entry;
11746
- exports.EntryConfiguration = EntryConfiguration;
11747
- exports.EntryConfigurationFileSelectionHandler = EntryConfigurationFileSelectionHandler;
11748
- exports.EntryPreviewView = EntryPreviewView;
11708
+ exports.EntryMetadata = EntryMetadata;
11709
+ exports.EntryMetadataFileSelectionHandler = EntryMetadataFileSelectionHandler;
11749
11710
  exports.EntryPublication = EntryPublication;
11750
11711
  exports.EntryPublicationQuotaDecoratorView = EntryPublicationQuotaDecoratorView;
11751
11712
  exports.EnumTableCellView = EnumTableCellView;
11752
11713
  exports.ExplorerFileItemView = ExplorerFileItemView;
11753
11714
  exports.ExtendedSelectInputView = ExtendedSelectInputView;
11715
+ exports.Failure = Failure;
11754
11716
  exports.FileConfiguration = FileConfiguration;
11755
11717
  exports.FileImport = FileImport;
11756
11718
  exports.FileInputView = FileInputView;
@@ -11763,6 +11725,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11763
11725
  exports.FileStage = FileStage;
11764
11726
  exports.FileStageItemView = FileStageItemView;
11765
11727
  exports.FileThumbnailView = FileThumbnailView;
11728
+ exports.FileTypes = FileTypes;
11766
11729
  exports.FileTypesCollection = FileTypesCollection;
11767
11730
  exports.FileUploader = FileUploader;
11768
11731
  exports.FilesCollection = FilesCollection;
@@ -11770,6 +11733,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11770
11733
  exports.FilesImporterView = FilesImporterView;
11771
11734
  exports.FilesView = FilesView;
11772
11735
  exports.FilteredFilesView = FilteredFilesView;
11736
+ exports.ForeignKeySubsetCollection = ForeignKeySubsetCollection;
11773
11737
  exports.HelpButtonView = HelpButtonView;
11774
11738
  exports.HelpImageView = HelpImageView;
11775
11739
  exports.HelpView = HelpView;
@@ -11784,9 +11748,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11784
11748
  exports.LoadingView = LoadingView;
11785
11749
  exports.LockedView = LockedView;
11786
11750
  exports.ModelThumbnailView = ModelThumbnailView;
11787
- exports.MultiCollection = MultiCollection;
11788
- exports.NavigatableChapterItemView = NavigatableChapterItemView;
11789
- exports.NavigatablePageItemView = NavigatablePageItemView;
11790
11751
  exports.NestedFilesCollection = NestedFilesCollection;
11791
11752
  exports.NestedFilesView = NestedFilesView;
11792
11753
  exports.NestedTypeError = NestedTypeError;
@@ -11799,7 +11760,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11799
11760
  exports.OtherEntryItemView = OtherEntryItemView;
11800
11761
  exports.Page = Page;
11801
11762
  exports.PageConfigurationFileSelectionHandler = PageConfigurationFileSelectionHandler;
11802
- exports.PageItemView = PageItemView;
11803
11763
  exports.PageLink = PageLink;
11804
11764
  exports.PageLinkConfigurationEditorView = PageLinkConfigurationEditorView;
11805
11765
  exports.PageLinkFileSelectionHandler = PageLinkFileSelectionHandler;
@@ -11807,8 +11767,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11807
11767
  exports.PageLinkItemView = PageLinkItemView;
11808
11768
  exports.PageLinksCollection = PageLinksCollection;
11809
11769
  exports.PageLinksView = PageLinksView;
11810
- exports.PagePreviewView = PagePreviewView;
11811
- exports.PageSelectionView = PageSelectionView;
11812
11770
  exports.PageThumbnailView = PageThumbnailView;
11813
11771
  exports.PagesCollection = PagesCollection;
11814
11772
  exports.PresenceTableCellView = PresenceTableCellView;
@@ -11817,7 +11775,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11817
11775
  exports.PublishEntryView = PublishEntryView;
11818
11776
  exports.ReferenceInputView = ReferenceInputView;
11819
11777
  exports.ReusableFile = ReusableFile;
11820
- exports.SavingRecordsCollection = SavingRecordsCollection;
11821
11778
  exports.Scaffold = Scaffold;
11822
11779
  exports.ScrollingView = ScrollingView;
11823
11780
  exports.SelectButtonView = SelectButtonView;
@@ -11832,8 +11789,6 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11832
11789
  exports.StorylineChaptersCollection = StorylineChaptersCollection;
11833
11790
  exports.StorylineConfiguration = StorylineConfiguration;
11834
11791
  exports.StorylineOrdering = StorylineOrdering;
11835
- exports.StorylineOutlineView = StorylineOutlineView;
11836
- exports.StorylinePickerView = StorylinePickerView;
11837
11792
  exports.StorylineScaffold = StorylineScaffold;
11838
11793
  exports.StorylineTransitiveChildPages = StorylineTransitiveChildPages;
11839
11794
  exports.StorylinesCollection = StorylinesCollection;
@@ -11868,13 +11823,17 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11868
11823
  exports.WidgetConfiguration = WidgetConfiguration;
11869
11824
  exports.WidgetConfigurationFileSelectionHandler = WidgetConfigurationFileSelectionHandler;
11870
11825
  exports.WidgetItemView = WidgetItemView;
11826
+ exports.WidgetTypes = WidgetTypes;
11871
11827
  exports.WidgetsCollection = WidgetsCollection;
11872
11828
  exports.addAndReturnModel = addAndReturnModel;
11873
11829
  exports.app = app;
11874
11830
  exports.authenticationProvider = authenticationProvider;
11831
+ exports.configurationContainer = configurationContainer;
11832
+ exports.cssModulesUtils = cssModulesUtils;
11875
11833
  exports.delayedDestroying = delayedDestroying;
11876
11834
  exports.dialogView = dialogView;
11877
11835
  exports.editor = editor;
11836
+ exports.entryTypeEditorControllerUrls = entryTypeEditorControllerUrls;
11878
11837
  exports.failureIndicatingView = failureIndicatingView;
11879
11838
  exports.failureTracking = failureTracking;
11880
11839
  exports.fileWithType = fileWithType;
@@ -11884,6 +11843,7 @@ this.pageflow._editorGlobalInterop = (function (exports, Backbone, _$1, Marionet
11884
11843
  exports.inputView = inputView;
11885
11844
  exports.inputWithPlaceholderText = inputWithPlaceholderText;
11886
11845
  exports.loadable = loadable;
11846
+ exports.modelLifecycleTrackingView = modelLifecycleTrackingView;
11887
11847
  exports.orderedCollection = orderedCollection;
11888
11848
  exports.persistedPromise = persistedPromise;
11889
11849
  exports.polling = polling;