pageflow 16.0.0 → 16.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -33
  3. data/README.md +6 -6
  4. data/Rakefile +1 -1
  5. data/admins/pageflow/entry.rb +0 -1
  6. data/admins/pageflow/sites.rb +3 -0
  7. data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
  8. data/app/assets/javascripts/pageflow/dist/ui.js +299 -72
  9. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +1 -1
  10. data/app/assets/stylesheets/pageflow/admin/entries.scss +4 -0
  11. data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +10 -0
  12. data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +4 -0
  13. data/app/assets/stylesheets/pageflow/editor/base.scss +0 -1
  14. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +61 -7
  15. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
  16. data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -0
  17. data/app/assets/stylesheets/pageflow/editor/help.scss +3 -3
  18. data/app/assets/stylesheets/pageflow/editor/info_box.scss +7 -0
  19. data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +0 -5
  20. data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -4
  21. data/app/assets/stylesheets/pageflow/{editor/wysihtml5.scss → ui/input/text_area_input.scss} +13 -1
  22. data/app/assets/stylesheets/pageflow/ui.scss +1 -0
  23. data/app/controllers/pageflow/chapters_controller.rb +2 -2
  24. data/app/controllers/pageflow/editor/entry_publications_controller.rb +5 -1
  25. data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
  26. data/app/controllers/pageflow/editor/files_controller.rb +1 -1
  27. data/app/controllers/pageflow/entries_controller.rb +12 -2
  28. data/app/controllers/pageflow/feeds_controller.rb +18 -0
  29. data/app/controllers/pageflow/pages_controller.rb +2 -2
  30. data/app/controllers/pageflow/sitemaps_controller.rb +15 -0
  31. data/app/controllers/pageflow/storylines_controller.rb +2 -2
  32. data/app/helpers/pageflow/entries_helper.rb +4 -1
  33. data/app/helpers/pageflow/feeds_helper.rb +66 -0
  34. data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
  35. data/app/helpers/pageflow/page_types_helper.rb +10 -10
  36. data/app/helpers/pageflow/revision_file_helper.rb +3 -3
  37. data/app/helpers/pageflow/social_share_helper.rb +2 -2
  38. data/app/inputs/pageflow_permalink_input.rb +15 -3
  39. data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
  40. data/app/models/concerns/pageflow/reusable_file.rb +3 -3
  41. data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
  42. data/app/models/pageflow/account.rb +8 -0
  43. data/app/models/pageflow/audio_file_url_templates.rb +2 -1
  44. data/app/models/pageflow/draft_entry.rb +1 -1
  45. data/app/models/pageflow/entries_feed.rb +32 -0
  46. data/app/models/pageflow/entry.rb +7 -5
  47. data/app/models/pageflow/entry_at_revision.rb +2 -0
  48. data/app/models/pageflow/image_file.rb +34 -8
  49. data/app/models/pageflow/image_file_url_templates.rb +7 -1
  50. data/app/models/pageflow/membership.rb +3 -2
  51. data/app/models/pageflow/other_file.rb +5 -0
  52. data/app/models/pageflow/other_file_url_templates.rb +16 -0
  53. data/app/models/pageflow/published_entry.rb +6 -0
  54. data/app/models/pageflow/revision.rb +6 -0
  55. data/app/models/pageflow/site.rb +8 -0
  56. data/app/models/pageflow/sitemaps.rb +14 -0
  57. data/app/models/pageflow/used_file.rb +10 -2
  58. data/app/models/pageflow/video_file_url_templates.rb +3 -1
  59. data/app/models/pageflow/widget.rb +9 -1
  60. data/app/views/admin/entries/_permalink_inputs.html.erb +1 -2
  61. data/app/views/admin/sites/_attributes_table.html.arb +3 -0
  62. data/app/views/admin/sites/_fields.html.erb +6 -0
  63. data/app/views/components/pageflow/admin/extensible_attributes_table.rb +2 -2
  64. data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
  65. data/app/views/components/pageflow/admin/sites_tab.rb +3 -0
  66. data/app/views/pageflow/editor/config/_seeds.json.jbuilder +2 -0
  67. data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
  68. data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +1 -0
  69. data/app/views/pageflow/feeds/index.atom.builder +20 -0
  70. data/app/views/pageflow/image_files/_image_file.json.jbuilder +1 -0
  71. data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
  72. data/app/views/pageflow/sitemaps/index.xml.builder +9 -0
  73. data/config/initializers/features.rb +3 -0
  74. data/config/initializers/paperclip.rb +8 -0
  75. data/config/locales/de.yml +77 -6
  76. data/config/locales/en.yml +79 -4
  77. data/config/routes.rb +3 -0
  78. data/config/spring.rb +1 -1
  79. data/db/migrate/20230120092923_create_other_files.rb +23 -0
  80. data/db/migrate/20230323115745_add_feeds_enabled_to_sites.rb +5 -0
  81. data/db/migrate/20230323154323_add_sitemap_enabled_to_sites.rb +5 -0
  82. data/db/migrate/20230331103823_add_title_to_sites.rb +5 -0
  83. data/db/migrate/20230405103612_add_custom_feed_url_to_sites.rb +5 -0
  84. data/db/migrate/20231024062501_add_output_presences_to_image_files.rb +5 -0
  85. data/db/migrate/20231128124523_add_noindex_to_revisions.rb +5 -0
  86. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +710 -259
  87. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +34 -5
  88. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
  89. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
  90. data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +0 -2
  91. data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +2 -1
  92. data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
  93. data/entry_types/paged/config/initializers/features.rb +0 -1
  94. data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -1
  95. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
  96. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +3 -4
  97. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +13 -6
  98. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +11 -3
  99. data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +11 -0
  100. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +42 -0
  101. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +8 -5
  102. data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +17 -12
  103. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +9 -1
  104. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -1
  105. data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +23 -0
  106. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -1
  107. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -5
  108. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +10 -0
  109. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +44 -41
  110. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_consent_vendors.json.jbuilder +16 -0
  111. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +7 -0
  112. data/entry_types/scrolled/config/initializers/features.rb +5 -0
  113. data/entry_types/scrolled/config/locales/consent_widget.de.yml +4 -0
  114. data/entry_types/scrolled/config/locales/consent_widget.en.yml +4 -0
  115. data/entry_types/scrolled/config/locales/de.yml +225 -8
  116. data/entry_types/scrolled/config/locales/en.yml +239 -2
  117. data/entry_types/scrolled/config/routes.rb +4 -0
  118. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +69 -44
  119. data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
  120. data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
  121. data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +96 -0
  122. data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +38 -0
  123. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +13 -1
  124. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +30 -0
  125. data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +6 -1
  126. data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +1 -1
  127. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +1 -1
  128. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +1 -2
  129. data/entry_types/scrolled/package/config/webpack.js +26 -0
  130. data/entry_types/scrolled/package/contentElements-editor.js +330 -32
  131. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  132. data/entry_types/scrolled/package/contentElements-frontend.js +920 -145
  133. data/entry_types/scrolled/package/editor.js +819 -239
  134. data/entry_types/scrolled/package/frontend/{EditableInlineText.module-14c7b097.js → EditableInlineText.module-6ee0e024.js} +1975 -1792
  135. data/entry_types/scrolled/package/frontend/PhonePlatformContext-b28d991a.js +32 -0
  136. data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-8242f213.js +107 -0
  137. data/entry_types/scrolled/package/frontend/Viewer-32cd1ac1.js +154 -0
  138. data/entry_types/scrolled/package/frontend/{Viewer-b6becc57.js → Viewer-6e4d14ed.js} +32 -161
  139. data/entry_types/scrolled/package/frontend/arrowRight-e42e6011.js +77 -0
  140. data/entry_types/scrolled/package/frontend/{components-b3160dd7.js → components-24363f97.js} +188 -47
  141. data/entry_types/scrolled/package/frontend/{PhonePlatformContext-f6093cc6.js → i18n-71c39823.js} +191 -111
  142. data/entry_types/scrolled/package/frontend/index-fc4b13e6.js +118 -0
  143. data/entry_types/scrolled/package/frontend/index.css +1 -1
  144. data/entry_types/scrolled/package/frontend/index.js +252 -76
  145. data/entry_types/scrolled/package/frontend/useContentElementEditorState-245f1986.js +52 -0
  146. data/entry_types/scrolled/package/package.json +6 -4
  147. data/entry_types/scrolled/package/testHelpers.js +11 -2
  148. data/entry_types/scrolled/package/values/colors.module.css +15 -0
  149. data/entry_types/scrolled/package/widgets/consentBar.css +1 -0
  150. data/entry_types/scrolled/package/widgets/consentBar.js +426 -0
  151. data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
  152. data/entry_types/scrolled/package/widgets/defaultNavigation.js +39 -4
  153. data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -0
  154. data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +49 -0
  155. data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -0
  156. data/entry_types/scrolled/package/widgets/textInlineFileRights.js +37 -0
  157. data/lib/generators/pageflow/resque/resque_generator.rb +1 -1
  158. data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
  159. data/lib/generators/pageflow/resque/templates/resque.rb +1 -1
  160. data/lib/generators/pageflow/routes/routes_generator.rb +1 -1
  161. data/lib/pageflow/ability_mixin.rb +5 -5
  162. data/lib/pageflow/active_admin_can_can_fix.rb +2 -2
  163. data/lib/pageflow/built_in_file_type.rb +7 -0
  164. data/lib/pageflow/configuration.rb +29 -1
  165. data/lib/pageflow/engine.rb +18 -40
  166. data/lib/pageflow/entry_export_import/revision_serialization.rb +1 -1
  167. data/lib/pageflow/file_type.rb +2 -2
  168. data/lib/pageflow/global_config_api.rb +2 -2
  169. data/lib/pageflow/nested_revision_component.rb +23 -5
  170. data/lib/pageflow/page_type.rb +1 -1
  171. data/lib/pageflow/paperclip_processors/webp.rb +63 -0
  172. data/lib/pageflow/rails_version.rb +19 -0
  173. data/lib/pageflow/seeds.rb +10 -7
  174. data/lib/pageflow/user_mixin.rb +1 -1
  175. data/lib/pageflow/version.rb +1 -1
  176. data/lib/pageflow/widget_types.rb +4 -0
  177. data/package/config/jest/index.js +3 -1
  178. data/package/config/webpack5.js +14 -0
  179. data/package/editor.js +410 -181
  180. data/package/frontend.js +34 -4
  181. data/package/testHelpers.js +1 -1
  182. data/package/ui.js +297 -71
  183. data/spec/factories/entries.rb +34 -3
  184. data/spec/factories/sites.rb +3 -0
  185. data/vendor/assets/javascripts/iscroll.js +4 -7
  186. metadata +118 -80
  187. data/app/helpers/pageflow/admin/permalinks_helper.rb +0 -15
  188. data/entry_types/scrolled/package/frontend/arrowRight-78a7cee4.js +0 -42
@@ -1,4 +1,4 @@
1
- var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, ChildViewContainer, IScroll, jquery_minicolors, wysihtml5, Cocktail, frontend, frontend$1) {
1
+ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, ChildViewContainer, IScroll, jquery_minicolors, wysihtml5, jqueryUi, Cocktail, frontend, frontend$1) {
2
2
  'use strict';
3
3
 
4
4
  Backbone = Backbone && Backbone.hasOwnProperty('default') ? Backbone['default'] : Backbone;
@@ -1062,6 +1062,107 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1062
1062
  }, this), 200);
1063
1063
  }
1064
1064
  });
1065
+
1066
+ function _defineProperty(obj, key, value) {
1067
+ if (key in obj) {
1068
+ Object.defineProperty(obj, key, {
1069
+ value: value,
1070
+ enumerable: true,
1071
+ configurable: true,
1072
+ writable: true
1073
+ });
1074
+ } else {
1075
+ obj[key] = value;
1076
+ }
1077
+
1078
+ return obj;
1079
+ }
1080
+
1081
+ function ownKeys(object, enumerableOnly) {
1082
+ var keys = Object.keys(object);
1083
+
1084
+ if (Object.getOwnPropertySymbols) {
1085
+ var symbols = Object.getOwnPropertySymbols(object);
1086
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
1087
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1088
+ });
1089
+ keys.push.apply(keys, symbols);
1090
+ }
1091
+
1092
+ return keys;
1093
+ }
1094
+
1095
+ function _objectSpread2(target) {
1096
+ for (var i = 1; i < arguments.length; i++) {
1097
+ var source = arguments[i] != null ? arguments[i] : {};
1098
+
1099
+ if (i % 2) {
1100
+ ownKeys(Object(source), true).forEach(function (key) {
1101
+ _defineProperty(target, key, source[key]);
1102
+ });
1103
+ } else if (Object.getOwnPropertyDescriptors) {
1104
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1105
+ } else {
1106
+ ownKeys(Object(source)).forEach(function (key) {
1107
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1108
+ });
1109
+ }
1110
+ }
1111
+
1112
+ return target;
1113
+ }
1114
+
1115
+ var attributeBinding = {
1116
+ setupBooleanAttributeBinding: function setupBooleanAttributeBinding(optionName, updateMethod) {
1117
+ this.setupAttributeBinding(optionName, updateMethod, Boolean);
1118
+ },
1119
+ getBooleanAttributBoundOption: function getBooleanAttributBoundOption(optionName) {
1120
+ return this.getAttributeBoundOption(optionName, Boolean);
1121
+ },
1122
+ setupAttributeBinding: function setupAttributeBinding(optionName, updateMethod) {
1123
+ var _this = this;
1124
+
1125
+ var normalize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (value) {
1126
+ return value;
1127
+ };
1128
+ var binding = this.options["".concat(optionName, "Binding")];
1129
+ var view = this;
1130
+
1131
+ if (binding) {
1132
+ _.flatten([binding]).forEach(function (attribute) {
1133
+ _this.listenTo(_this.model, 'change:' + attribute, update);
1134
+ });
1135
+ }
1136
+
1137
+ update();
1138
+
1139
+ function update() {
1140
+ updateMethod.call(view, view.getAttributeBoundOption(optionName, normalize));
1141
+ }
1142
+ },
1143
+ getAttributeBoundOption: function getAttributeBoundOption(optionName) {
1144
+ var _this2 = this;
1145
+
1146
+ var normalize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (value) {
1147
+ return value;
1148
+ };
1149
+ var binding = this.options["".concat(optionName, "Binding")];
1150
+ var bindingValueOptionName = "".concat(optionName, "BindingValue");
1151
+ var value = Array.isArray(binding) ? binding.map(function (attribute) {
1152
+ return _this2.model.get(attribute);
1153
+ }) : this.model.get(binding);
1154
+
1155
+ if (bindingValueOptionName in this.options) {
1156
+ return value === this.options[bindingValueOptionName];
1157
+ } else if (typeof this.options[optionName] === 'function') {
1158
+ return normalize(this.options[optionName](value));
1159
+ } else if (optionName in this.options) {
1160
+ return normalize(this.options[optionName]);
1161
+ } else if (binding) {
1162
+ return normalize(value);
1163
+ }
1164
+ }
1165
+ };
1065
1166
  /**
1066
1167
  * Mixin for input views handling common concerns like labels,
1067
1168
  * inline help, visiblity and disabling.
@@ -1191,7 +1292,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1191
1292
  * @mixin
1192
1293
  */
1193
1294
 
1194
- var inputView = {
1295
+ var inputView = _objectSpread2(_objectSpread2({}, attributeBinding), {}, {
1195
1296
  ui: {
1196
1297
  label: 'label',
1197
1298
  labelText: 'label .name',
@@ -1235,8 +1336,8 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1235
1336
  this.ui.labelText.text(this.labelText());
1236
1337
  this.updateInlineHelp();
1237
1338
  this.setLabelFor();
1238
- this.setupAttributeBinding('disabled', this.updateDisabled);
1239
- this.setupAttributeBinding('visible', this.updateVisible);
1339
+ this.setupBooleanAttributeBinding('disabled', this.updateDisabled);
1340
+ this.setupBooleanAttributeBinding('visible', this.updateVisible);
1240
1341
  },
1241
1342
 
1242
1343
  /**
@@ -1285,7 +1386,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1285
1386
  }
1286
1387
  },
1287
1388
  isDisabled: function isDisabled() {
1288
- return this.getAttributeBoundOption('disabled');
1389
+ return this.getBooleanAttributBoundOption('disabled');
1289
1390
  },
1290
1391
  updateDisabled: function updateDisabled() {
1291
1392
  this.$el.toggleClass('input-disabled', !!this.isDisabled());
@@ -1303,46 +1404,9 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1303
1404
  }
1304
1405
  },
1305
1406
  updateVisible: function updateVisible() {
1306
- this.$el.toggleClass('input-hidden_via_binding', this.getAttributeBoundOption('visible') === false);
1307
- },
1308
- setupAttributeBinding: function setupAttributeBinding(optionName, updateMethod) {
1309
- var _this = this;
1310
-
1311
- var binding = this.options["".concat(optionName, "Binding")];
1312
- var view = this;
1313
-
1314
- if (binding) {
1315
- _.flatten([binding]).forEach(function (attribute) {
1316
- _this.listenTo(_this.model, 'change:' + attribute, update);
1317
- });
1318
- }
1319
-
1320
- update();
1321
-
1322
- function update() {
1323
- updateMethod.call(view, view.getAttributeBoundOption(optionName));
1324
- }
1325
- },
1326
- getAttributeBoundOption: function getAttributeBoundOption(optionName) {
1327
- var _this2 = this;
1328
-
1329
- var binding = this.options["".concat(optionName, "Binding")];
1330
- var bindingValueOptionName = "".concat(optionName, "BindingValue");
1331
- var value = Array.isArray(binding) ? binding.map(function (attribute) {
1332
- return _this2.model.get(attribute);
1333
- }) : this.model.get(binding);
1334
-
1335
- if (bindingValueOptionName in this.options) {
1336
- return value === this.options[bindingValueOptionName];
1337
- } else if (typeof this.options[optionName] === 'function') {
1338
- return !!this.options[optionName](value);
1339
- } else if (optionName in this.options) {
1340
- return !!this.options[optionName];
1341
- } else if (binding) {
1342
- return !!value;
1343
- }
1407
+ this.$el.toggleClass('hidden_via_binding', this.getBooleanAttributBoundOption('visible') === false);
1344
1408
  }
1345
- };
1409
+ });
1346
1410
 
1347
1411
  function template$4(data) {
1348
1412
  var __p = '';
@@ -1460,6 +1524,125 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1460
1524
  this.ui.link.attr('href', url);
1461
1525
  }
1462
1526
  });
1527
+
1528
+ function _classCallCheck(instance, Constructor) {
1529
+ if (!(instance instanceof Constructor)) {
1530
+ throw new TypeError("Cannot call a class as a function");
1531
+ }
1532
+ }
1533
+
1534
+ function _defineProperties(target, props) {
1535
+ for (var i = 0; i < props.length; i++) {
1536
+ var descriptor = props[i];
1537
+ descriptor.enumerable = descriptor.enumerable || false;
1538
+ descriptor.configurable = true;
1539
+ if ("value" in descriptor) descriptor.writable = true;
1540
+ Object.defineProperty(target, descriptor.key, descriptor);
1541
+ }
1542
+ }
1543
+
1544
+ function _createClass(Constructor, protoProps, staticProps) {
1545
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1546
+ if (staticProps) _defineProperties(Constructor, staticProps);
1547
+ return Constructor;
1548
+ }
1549
+ /**
1550
+ * Input view for a number.
1551
+ *
1552
+ * See {@link inputView} for further options.
1553
+ *
1554
+ * @param {Object} [options]
1555
+ *
1556
+ * @param {string} [options.locale]
1557
+ * Locale used to fomat and parse numbers.
1558
+ *
1559
+ * @class
1560
+ */
1561
+
1562
+
1563
+ var NumberInputView = Marionette.ItemView.extend({
1564
+ mixins: [inputView],
1565
+ template: function template() {
1566
+ return "\n <label>\n <span class=\"name\"></span>\n <span class=\"inline_help\"></span>\n </label>\n <input type=\"text\" dir=\"auto\" />\n ";
1567
+ },
1568
+ ui: {
1569
+ input: 'input'
1570
+ },
1571
+ events: {
1572
+ 'change': 'onChange'
1573
+ },
1574
+ initialize: function initialize() {
1575
+ this.parser = new NumberParser(this.options.locale);
1576
+ },
1577
+ onRender: function onRender() {
1578
+ this.load();
1579
+ this.listenTo(this.model, 'change:' + this.options.propertyName, this.load);
1580
+ },
1581
+ onChange: function onChange() {
1582
+ this.save();
1583
+ this.load();
1584
+ },
1585
+ onClose: function onClose() {
1586
+ this.save();
1587
+ },
1588
+ save: function save() {
1589
+ var inputValue = this.ui.input.val();
1590
+ this.model.set(this.options.propertyName, this.parser.parse(inputValue) || 0);
1591
+ },
1592
+ load: function load() {
1593
+ var input = this.ui.input;
1594
+ var value = this.model.get(this.options.propertyName) || 0;
1595
+ input.val(value.toLocaleString(this.options.locale, {
1596
+ useGrouping: false
1597
+ }));
1598
+ },
1599
+ displayValidationError: function displayValidationError(message) {
1600
+ this.$el.addClass('invalid');
1601
+ this.ui.input.attr('title', message);
1602
+ },
1603
+ resetValidationError: function resetValidationError(message) {
1604
+ this.$el.removeClass('invalid');
1605
+ this.ui.input.attr('title', '');
1606
+ }
1607
+ });
1608
+
1609
+ var NumberParser = /*#__PURE__*/function () {
1610
+ function NumberParser(locale) {
1611
+ _classCallCheck(this, NumberParser);
1612
+
1613
+ var format = new Intl.NumberFormat(locale);
1614
+ var parts = format.formatToParts(12345.6);
1615
+ var numerals = Array.from({
1616
+ length: 10
1617
+ }).map(function (_, i) {
1618
+ return format.format(i);
1619
+ });
1620
+ var index = new Map(numerals.map(function (d, i) {
1621
+ return [d, i];
1622
+ }));
1623
+ this._group = new RegExp("[".concat(parts.find(function (d) {
1624
+ return d.type === "group";
1625
+ }).value, "]"), "g");
1626
+ this._decimal = new RegExp("[".concat(parts.find(function (d) {
1627
+ return d.type === "decimal";
1628
+ }).value, "]"));
1629
+ this._numeral = new RegExp("[".concat(numerals.join(""), "]"), "g");
1630
+
1631
+ this._index = function (d) {
1632
+ return index.get(d);
1633
+ };
1634
+ }
1635
+
1636
+ _createClass(NumberParser, [{
1637
+ key: "parse",
1638
+ value: function parse(string) {
1639
+ string = string.trim().replace(this._group, "").replace(this._decimal, ".").replace(this._numeral, this._index);
1640
+ return string ? +string : NaN;
1641
+ }
1642
+ }]);
1643
+
1644
+ return NumberParser;
1645
+ }();
1463
1646
  /**
1464
1647
  * Text based input view that can display a placeholder.
1465
1648
  *
@@ -1482,6 +1665,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1482
1665
  * inside a given model.
1483
1666
  */
1484
1667
 
1668
+
1485
1669
  var inputWithPlaceholderText = {
1486
1670
  onRender: function onRender() {
1487
1671
  this.updatePlaceholder();
@@ -1669,11 +1853,15 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1669
1853
  this.ui.input.minicolors({
1670
1854
  changeDelay: 200,
1671
1855
  change: _.bind(function (color) {
1856
+ this._saving = true;
1857
+
1672
1858
  if (color === this.defaultValue()) {
1673
1859
  this.model.unset(this.options.propertyName);
1674
1860
  } else {
1675
1861
  this.model.set(this.options.propertyName, color);
1676
1862
  }
1863
+
1864
+ this._saving = false;
1677
1865
  }, this)
1678
1866
  });
1679
1867
  this.listenTo(this.model, 'change:' + this.options.propertyName, this.load);
@@ -1702,7 +1890,10 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
1702
1890
  }
1703
1891
  },
1704
1892
  load: function load() {
1705
- this.ui.input.minicolors('value', this.model.get(this.options.propertyName) || this.defaultValue());
1893
+ if (!this._saving) {
1894
+ this.ui.input.minicolors('value', this.model.get(this.options.propertyName) || this.defaultValue());
1895
+ }
1896
+
1706
1897
  this.$el.toggleClass('is_default', !this.model.has(this.options.propertyName));
1707
1898
  },
1708
1899
  refreshPicker: function refreshPicker() {
@@ -2082,6 +2273,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2082
2273
  var TextAreaInputView = Marionette.ItemView.extend({
2083
2274
  mixins: [inputView, inputWithPlaceholderText],
2084
2275
  template: template$8,
2276
+ className: 'text_area_input',
2085
2277
  ui: {
2086
2278
  input: 'textarea',
2087
2279
  toolbar: '.toolbar',
@@ -2258,21 +2450,6 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2258
2450
  }
2259
2451
  });
2260
2452
 
2261
- function _defineProperty(obj, key, value) {
2262
- if (key in obj) {
2263
- Object.defineProperty(obj, key, {
2264
- value: value,
2265
- enumerable: true,
2266
- configurable: true,
2267
- writable: true
2268
- });
2269
- } else {
2270
- obj[key] = value;
2271
- }
2272
-
2273
- return obj;
2274
- }
2275
-
2276
2453
  function template$9(data) {
2277
2454
  var __p = '';
2278
2455
  __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';
@@ -2537,6 +2714,25 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2537
2714
  *
2538
2715
  * @param {Object} [options]
2539
2716
  *
2717
+ * @param {number} [options.defaultValue]
2718
+ * Defaults value to display if property is not set.
2719
+ *
2720
+ * @param {number} [options.minValue=0]
2721
+ * Value when dragging slider to the very left.
2722
+ *
2723
+ * @param {number} [options.maxValue=100]
2724
+ * Value when dragging slider to the very right.
2725
+ *
2726
+ * @param {string} [options.unit="%"]
2727
+ * Unit to display after value.
2728
+ *
2729
+ * @param {function} [options.displayText]
2730
+ * Function that receives value and returns custom text to display as value.
2731
+ *
2732
+ * @param {boolean} [options.saveOnSlide]
2733
+ * Already update the model while dragging the handle - not only after
2734
+ * handle has been released.
2735
+ *
2540
2736
  * @class
2541
2737
  */
2542
2738
 
@@ -2550,15 +2746,27 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2550
2746
  value: '.value'
2551
2747
  },
2552
2748
  events: {
2553
- 'slidechange': 'save'
2749
+ 'slidechange': 'save',
2750
+ 'slide': 'handleSlide'
2554
2751
  },
2555
2752
  onRender: function onRender() {
2753
+ var _this = this;
2754
+
2556
2755
  this.ui.widget.slider({
2557
- animate: 'fast',
2558
- min: 'minValue' in this.options ? this.options.minValue : 0,
2559
- max: 'maxValue' in this.options ? this.options.maxValue : 100
2756
+ animate: 'fast'
2757
+ });
2758
+ this.setupAttributeBinding('minValue', function (value) {
2759
+ return _this.updateSliderOption('min', value || 0);
2760
+ });
2761
+ this.setupAttributeBinding('maxValue', function (value) {
2762
+ return _this.updateSliderOption('max', value || 100);
2560
2763
  });
2561
2764
  this.load();
2765
+ this.listenTo(this.model, 'change:' + this.options.propertyName, this.load);
2766
+ },
2767
+ updateSliderOption: function updateSliderOption(name, value) {
2768
+ this.ui.widget.slider('option', name, value);
2769
+ this.updateText(this.ui.widget.slider('value'));
2562
2770
  },
2563
2771
  updateDisabled: function updateDisabled(disabled) {
2564
2772
  this.$el.toggleClass('disabled', !!disabled);
@@ -2569,11 +2777,15 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2569
2777
  this.ui.widget.slider('enable');
2570
2778
  }
2571
2779
  },
2572
- save: function save() {
2573
- var value = this.ui.widget.slider('option', 'value');
2574
- var unit = 'unit' in this.options ? this.options.unit : '%';
2575
- this.ui.value.text(value + unit);
2576
- this.model.set(this.options.propertyName, value);
2780
+ handleSlide: function handleSlide(event, ui) {
2781
+ this.updateText(ui.value);
2782
+
2783
+ if (this.options.saveOnSlide) {
2784
+ this.save(event, ui);
2785
+ }
2786
+ },
2787
+ save: function save(event, ui) {
2788
+ this.model.set(this.options.propertyName, ui.value);
2577
2789
  },
2578
2790
  load: function load() {
2579
2791
  var value;
@@ -2584,7 +2796,18 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2584
2796
  value = 'defaultValue' in this.options ? this.options.defaultValue : 0;
2585
2797
  }
2586
2798
 
2587
- this.ui.widget.slider('option', 'value', value);
2799
+ this.ui.widget.slider('option', 'value', this.clampValue(value));
2800
+ this.updateText(value);
2801
+ },
2802
+ clampValue: function clampValue(value) {
2803
+ var min = this.ui.widget.slider('option', 'min');
2804
+ var max = this.ui.widget.slider('option', 'max');
2805
+ return Math.min(max, Math.max(min, value));
2806
+ },
2807
+ updateText: function updateText(value) {
2808
+ var unit = 'unit' in this.options ? this.options.unit : '%';
2809
+ var text = 'displayText' in this.options ? this.options.displayText(value) : value + unit;
2810
+ this.ui.value.text(text);
2588
2811
  }
2589
2812
  });
2590
2813
 
@@ -2971,7 +3194,10 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
2971
3194
  return view;
2972
3195
  },
2973
3196
  appendSubview: function appendSubview(view) {
2974
- return this.$el.append(this.subview(view).el);
3197
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
3198
+ to = _ref.to;
3199
+
3200
+ return (to || this.$el).append(this.subview(view).el);
2975
3201
  },
2976
3202
  onClose: function onClose() {
2977
3203
  if (this.subviews) {
@@ -3056,7 +3282,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3056
3282
  return obj;
3057
3283
  }
3058
3284
 
3059
- function ownKeys(object, enumerableOnly) {
3285
+ function ownKeys$1(object, enumerableOnly) {
3060
3286
  var keys = Object.keys(object);
3061
3287
 
3062
3288
  if (Object.getOwnPropertySymbols) {
@@ -3070,18 +3296,18 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3070
3296
  return keys;
3071
3297
  }
3072
3298
 
3073
- function _objectSpread2(target) {
3299
+ function _objectSpread2$1(target) {
3074
3300
  for (var i = 1; i < arguments.length; i++) {
3075
3301
  var source = arguments[i] != null ? arguments[i] : {};
3076
3302
 
3077
3303
  if (i % 2) {
3078
- ownKeys(Object(source), true).forEach(function (key) {
3304
+ ownKeys$1(Object(source), true).forEach(function (key) {
3079
3305
  _defineProperty$1(target, key, source[key]);
3080
3306
  });
3081
3307
  } else if (Object.getOwnPropertyDescriptors) {
3082
3308
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3083
3309
  } else {
3084
- ownKeys(Object(source)).forEach(function (key) {
3310
+ ownKeys$1(Object(source)).forEach(function (key) {
3085
3311
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3086
3312
  });
3087
3313
  }
@@ -3252,7 +3478,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3252
3478
  });
3253
3479
  var validFileTypeTranslationList = {
3254
3480
  validFileTypeTranslations: function validFileTypeTranslations(validFileTypes) {
3255
- return _.map(validFileTypes, function (validFileType) {
3481
+ return validFileTypes.map(function (validFileType) {
3256
3482
  return I18n$1.t('activerecord.models.' + validFileType.i18nKey + '.other');
3257
3483
  }).join(', ');
3258
3484
  }
@@ -3282,7 +3508,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3282
3508
  initialize: function initialize(upload, options) {
3283
3509
  var editor = options.editor;
3284
3510
  var fileType = options.fileType;
3285
- var validFileTypes = editor.nextUploadTargetFile.fileType().nestedFileTypes.fileTypes;
3511
+ var validFileTypes = editor.nextUploadTargetFile.fileType().nestedFileTypes;
3286
3512
  var validFileTypeTranslations = this.validFileTypeTranslations(validFileTypes);
3287
3513
  var typeI18nKey = fileType.i18nKey;
3288
3514
  var typeSingularTranslation = I18n$1.t('activerecord.models.' + typeI18nKey + '.one');
@@ -3331,57 +3557,6 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3331
3557
  };
3332
3558
  });
3333
3559
 
3334
- var state = window.pageflow || {};
3335
-
3336
- function template$e(data) {
3337
- var __p = '';
3338
- __p += '';
3339
- return __p;
3340
- }
3341
-
3342
- var EditFileView = Marionette.ItemView.extend({
3343
- template: template$e,
3344
- className: 'edit_file',
3345
- onRender: function onRender() {
3346
- var fileType = this.model.fileType();
3347
- var entry = this.options.entry || state.entry;
3348
- var tab = new ConfigurationEditorTabView({
3349
- model: this.model.configuration,
3350
- attributeTranslationKeyPrefixes: ['pageflow.editor.files.attributes.' + fileType.collectionName, 'pageflow.editor.files.common_attributes', 'pageflow.editor.nested_files.' + fileType.collectionName, 'pageflow.editor.nested_files.common_attributes']
3351
- });
3352
-
3353
- if (this.options.displayFileName) {
3354
- tab.input('file_name', TextInputView, {
3355
- model: this.model,
3356
- disabled: true
3357
- });
3358
- }
3359
-
3360
- tab.input('rights', TextInputView, {
3361
- model: this.model,
3362
- placeholder: entry.get('default_file_rights')
3363
- });
3364
-
3365
- _(this.fileTypeInputs()).each(function (options) {
3366
- tab.input(options.name, options.inputView, options.inputViewOptions);
3367
- });
3368
-
3369
- tab.input('original_url', UrlDisplayView, {
3370
- model: this.model
3371
- });
3372
- this.appendSubview(tab);
3373
- },
3374
- fileTypeInputs: function fileTypeInputs() {
3375
- var fileType = this.model.fileType();
3376
- return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
3377
- if (_.isFunction(inputs)) {
3378
- return inputs(this.model);
3379
- } else {
3380
- return inputs;
3381
- }
3382
- }, this).flatten().value();
3383
- }
3384
- });
3385
3560
  var app = new Marionette.Application();
3386
3561
  var dialogView = {
3387
3562
  events: {
@@ -3397,7 +3572,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3397
3572
  }
3398
3573
  };
3399
3574
 
3400
- function template$1$1(data) {
3575
+ function template$e(data) {
3401
3576
  var __t,
3402
3577
  __p = '';
3403
3578
 
@@ -3406,7 +3581,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3406
3581
  }
3407
3582
 
3408
3583
  var FileSettingsDialogView = Marionette.ItemView.extend({
3409
- template: template$1$1,
3584
+ template: template$e,
3410
3585
  className: 'file_settings_dialog editor dialog',
3411
3586
  mixins: [dialogView],
3412
3587
  ui: {
@@ -3437,11 +3612,11 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3437
3612
  app.dialogRegion.show(new FileSettingsDialogView(options));
3438
3613
  };
3439
3614
 
3440
- function template$2$1(data) {
3615
+ function template$1$1(data) {
3441
3616
  var __t,
3442
3617
  __p = '';
3443
3618
 
3444
- __p += '<a class="edit" href="" title="' + ((__t = I18n.t('pageflow.editor.templates.file_meta_data_item_value_view.edit')) == null ? '' : __t) + '">\n</a>\n<span class="value"></span>\n';
3619
+ __p += '<span class="value"></span>\n<a class="edit" href="" title="' + ((__t = I18n.t('pageflow.editor.templates.file_meta_data_item_value_view.edit')) == null ? '' : __t) + '">\n</a>\n\n';
3445
3620
  return __p;
3446
3621
  }
3447
3622
  /**
@@ -3464,7 +3639,8 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3464
3639
 
3465
3640
 
3466
3641
  var FileMetaDataItemValueView = Marionette.ItemView.extend({
3467
- template: template$2$1,
3642
+ template: template$1$1,
3643
+ className: 'value_wrapper',
3468
3644
  ui: {
3469
3645
  value: '.value',
3470
3646
  editLink: '.edit'
@@ -3505,7 +3681,13 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3505
3681
  model = this.model;
3506
3682
  }
3507
3683
 
3508
- return model.get(this.options.name);
3684
+ var value = model.get(this.options.name);
3685
+
3686
+ if (value && this.options.formatValue) {
3687
+ return this.options.formatValue(value);
3688
+ }
3689
+
3690
+ return value;
3509
3691
  }
3510
3692
  });
3511
3693
  var FileType = BaseObject.extend({
@@ -3517,6 +3699,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3517
3699
  this.paramKey = options.paramKey;
3518
3700
  this.i18nKey = options.i18nKey;
3519
3701
  this.nestedFileTypes = [];
3702
+ this.settingsDialogTabs = options.settingsDialogTabs || [];
3520
3703
  this.confirmUploadTableColumns = options.confirmUploadTableColumns || [];
3521
3704
  this.configurationEditorInputs = [].concat(options.configurationEditorInputs || []);
3522
3705
  this.configurationUpdaters = options.configurationUpdaters || [];
@@ -3524,17 +3707,8 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3524
3707
  this.nestedFilesOrder = options.nestedFilesOrder;
3525
3708
  this.skipUploadConfirmation = options.skipUploadConfirmation || false;
3526
3709
  this.filters = options.filters || [];
3527
- this.metaDataAttributes = [{
3528
- name: 'rights',
3529
- valueView: TextFileMetaDataItemValueView,
3530
- valueViewOptions: {
3531
- settingsDialogTabLink: 'general'
3532
- }
3533
- }].concat(options.metaDataAttributes || []);
3534
- this.settingsDialogTabs = [{
3535
- name: 'general',
3536
- view: EditFileView
3537
- }].concat(options.settingsDialogTabs || []);
3710
+ this.noExtendedFileRights = options.noExtendedFileRights;
3711
+ this.metaDataAttributes = options.metaDataAttributes || [];
3538
3712
 
3539
3713
  if (typeof options.matchUpload === 'function') {
3540
3714
  this.matchUpload = options.matchUpload;
@@ -3573,6 +3747,8 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3573
3747
  initialize: function initialize() {
3574
3748
  this.clientSideConfigs = [];
3575
3749
  this.clientSideConfigModifications = {};
3750
+ this.commonSettingsDialogTabs = [];
3751
+ this.commonMetaDataAttributes = [];
3576
3752
  },
3577
3753
  register: function register(name, config) {
3578
3754
  if (this._setup) {
@@ -3590,22 +3766,30 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3590
3766
  this.clientSideConfigModifications[name].push(config);
3591
3767
  },
3592
3768
  setup: function setup(serverSideConfigs) {
3769
+ var _this = this;
3770
+
3593
3771
  var clientSideConfigs = this.clientSideConfigs;
3594
3772
  this._setup = true;
3595
- this.collection = new FileTypesCollection(_.map(serverSideConfigs, function (serverSideConfig) {
3773
+
3774
+ var configs = _.chain(serverSideConfigs).map(function (serverSideConfig) {
3596
3775
  var clientSideConfig = clientSideConfigs[serverSideConfig.collectionName];
3597
3776
 
3598
3777
  if (!clientSideConfig) {
3599
3778
  throw 'Missing client side config for file type "' + serverSideConfig.collectionName + '"';
3600
3779
  }
3601
3780
 
3602
- _(this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
3603
- this.lintModification(modification, serverSideConfig.collectionName);
3604
- this.applyModification(clientSideConfig, modification);
3605
- }, this);
3781
+ _this.applyCommonConfig(clientSideConfig);
3606
3782
 
3607
- return new FileType(_.extend({}, serverSideConfig, clientSideConfig));
3608
- }, this));
3783
+ _this.applyModifications(serverSideConfig, clientSideConfig);
3784
+
3785
+ return _.extend({}, serverSideConfig, clientSideConfig);
3786
+ }).sortBy(function (config) {
3787
+ return config.priority || 10;
3788
+ }).value();
3789
+
3790
+ this.collection = new FileTypesCollection(_.map(configs, function (config) {
3791
+ return new FileType(config);
3792
+ }));
3609
3793
  var those = this;
3610
3794
 
3611
3795
  _.map(serverSideConfigs, function (serverSideConfig) {
@@ -3615,6 +3799,16 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3615
3799
  })));
3616
3800
  });
3617
3801
  },
3802
+ applyCommonConfig: function applyCommonConfig(clientSideConfig) {
3803
+ clientSideConfig.settingsDialogTabs = this.commonSettingsDialogTabs.concat(clientSideConfig.settingsDialogTabs || []);
3804
+ clientSideConfig.metaDataAttributes = this.commonMetaDataAttributes.concat(clientSideConfig.metaDataAttributes || []);
3805
+ },
3806
+ applyModifications: function applyModifications(serverSideConfig, clientSideConfig) {
3807
+ _(this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
3808
+ this.lintModification(modification, serverSideConfig.collectionName);
3809
+ this.applyModification(clientSideConfig, modification);
3810
+ }, this);
3811
+ },
3618
3812
  lintModification: function lintModification(modification, collectionName) {
3619
3813
  var unmodifyableProperties = _.difference(_.keys(modification), this.modifyableProperties);
3620
3814
 
@@ -3889,6 +4083,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3889
4083
  return !!this._optionalRoles[role];
3890
4084
  }
3891
4085
  });
4086
+ var state = window.pageflow || {};
3892
4087
  /**
3893
4088
  * Interface for engines providing editor extensions.
3894
4089
  * @alias editor
@@ -3899,6 +4094,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3899
4094
  {
3900
4095
  initialize: function initialize(options) {
3901
4096
  this.router = options && options.router;
4097
+ this.entryType = {};
3902
4098
  this.sideBarRoutings = [];
3903
4099
  this.mainMenuItems = [];
3904
4100
  this.initializers = [];
@@ -3968,9 +4164,12 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
3968
4164
  * Checks to see if the browser is supported.
3969
4165
  * @param {function} options.browserNotSupportedView
3970
4166
  * Backbone view that will be rendered if the browser is not supported.
4167
+ * @param {boolean} [options.supportsExtendedFileRights]
4168
+ * Offer additional inputs for files to specify source url, license and default
4169
+ * display location.
3971
4170
  */
3972
4171
  registerEntryType: function registerEntryType(name, options) {
3973
- this.entryType = _objectSpread2({
4172
+ this.entryType = _objectSpread2$1({
3974
4173
  name: name
3975
4174
  }, options);
3976
4175
  },
@@ -4111,10 +4310,12 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
4111
4310
  * Trigger selection of the given file type with the given
4112
4311
  * handler. Payload hash is passed to selection handler as options.
4113
4312
  *
4114
- * @param {string|{name: string, filter: string}} fileType
4313
+ * @param {string|{name: string, filter: string}|{defaultTab: string, filter: string}} fileType
4115
4314
  * Either collection name of a file type or and object containing
4116
4315
  * the collection name a file type and a the name of a file type
4117
- * filter.
4316
+ * filter or an object containingn a defaultTab property that controls
4317
+ * which tab will visible initially, while allowing selecting files of
4318
+ * any type.
4118
4319
  *
4119
4320
  * @param {string} handlerName
4120
4321
  * The name of a handler registered via {@link
@@ -4140,7 +4341,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
4140
4341
  };
4141
4342
  }
4142
4343
 
4143
- this.navigate('/files/' + fileType.name + '?handler=' + handlerName + '&payload=' + encodeURIComponent(JSON.stringify(payload)) + (fileType.filter ? '&filter=' + fileType.filter : ''), {
4344
+ this.navigate('/files/' + (fileType.defaultTab ? "".concat(fileType.defaultTab, ":default") : fileType.name) + '?handler=' + handlerName + '&payload=' + encodeURIComponent(JSON.stringify(payload)) + (fileType.filter ? '&filter=' + fileType.filter : ''), {
4144
4345
  trigger: true
4145
4346
  });
4146
4347
  },
@@ -4154,7 +4355,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
4154
4355
  * whether the page is a valid selection
4155
4356
  */
4156
4357
  selectPage: function selectPage(options) {
4157
- return this.pageSelectionView.selectPage(_objectSpread2(_objectSpread2({}, options), {}, {
4358
+ return this.pageSelectionView.selectPage(_objectSpread2$1(_objectSpread2$1({}, options), {}, {
4158
4359
  entry: state.entry
4159
4360
  }));
4160
4361
  },
@@ -4164,7 +4365,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
4164
4365
  }
4165
4366
 
4166
4367
  var payloadJson = JSON.parse(decodeURIComponent(encodedPayload));
4167
- return new this.fileSelectionHandlers[handlerName](_objectSpread2(_objectSpread2({}, payloadJson), {}, {
4368
+ return new this.fileSelectionHandlers[handlerName](_objectSpread2$1(_objectSpread2$1({}, payloadJson), {}, {
4168
4369
  entry: state.entry
4169
4370
  }));
4170
4371
  },
@@ -6316,7 +6517,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6316
6517
  },
6317
6518
  parse: function parse(response, options) {
6318
6519
  if (response) {
6319
- this.set(_.pick(response, 'published', 'published_until', 'password_protected'));
6520
+ this.set(_.pick(response, 'published', 'published_until', 'password_protected', 'last_published_with_noindex'));
6320
6521
 
6321
6522
  this._setFiles(response, {
6322
6523
  add: false,
@@ -6465,7 +6666,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6465
6666
  attrs: {
6466
6667
  collection: collectionName,
6467
6668
  files: selections.toJSON().map(function (item, index) {
6468
- return _objectSpread2(_objectSpread2({}, item), {}, {
6669
+ return _objectSpread2$1(_objectSpread2$1({}, item), {}, {
6469
6670
  url: selections.at(index).get('source_url')
6470
6671
  });
6471
6672
  })
@@ -6515,6 +6716,13 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6515
6716
  var parent = options.parent;
6516
6717
  var parentModel = options.parentModel;
6517
6718
  this.autoConsolidatePositions = options.autoConsolidatePositions;
6719
+ this.listenTo(this, 'add', function (model) {
6720
+ if (options.parentReferenceAttribute) {
6721
+ model[options.parentReferenceAttribute] = parentModel;
6722
+ }
6723
+
6724
+ model.set(options.foreignKeyAttribute, parentModel.id);
6725
+ });
6518
6726
  SubsetCollection.prototype.constructor.call(this, {
6519
6727
  parent: parent,
6520
6728
  parentModel: parentModel,
@@ -6525,13 +6733,6 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6525
6733
  return item.get('position');
6526
6734
  }
6527
6735
  });
6528
- this.listenTo(this, 'add', function (model) {
6529
- if (options.parentReferenceAttribute) {
6530
- model[options.parentReferenceAttribute] = parentModel;
6531
- }
6532
-
6533
- model.set(options.foreignKeyAttribute, parentModel.id);
6534
- });
6535
6736
  this.listenTo(parentModel, 'destroy dependentDestroy', function () {
6536
6737
  this.invoke('trigger', 'dependentDestroy');
6537
6738
  this.clear();
@@ -6773,9 +6974,67 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6773
6974
  '?storyline=:id': 'index',
6774
6975
  '.*': 'index'
6775
6976
  }
6776
- });
6977
+ });
6978
+
6979
+ function _arrayWithHoles$1(arr) {
6980
+ if (Array.isArray(arr)) return arr;
6981
+ }
6982
+
6983
+ function _iterableToArrayLimit$1(arr, i) {
6984
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
6985
+ var _arr = [];
6986
+ var _n = true;
6987
+ var _d = false;
6988
+ var _e = undefined;
6989
+
6990
+ try {
6991
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
6992
+ _arr.push(_s.value);
6993
+
6994
+ if (i && _arr.length === i) break;
6995
+ }
6996
+ } catch (err) {
6997
+ _d = true;
6998
+ _e = err;
6999
+ } finally {
7000
+ try {
7001
+ if (!_n && _i["return"] != null) _i["return"]();
7002
+ } finally {
7003
+ if (_d) throw _e;
7004
+ }
7005
+ }
7006
+
7007
+ return _arr;
7008
+ }
7009
+
7010
+ function _arrayLikeToArray$1(arr, len) {
7011
+ if (len == null || len > arr.length) len = arr.length;
7012
+
7013
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
7014
+ arr2[i] = arr[i];
7015
+ }
6777
7016
 
6778
- function template$3$1(data) {
7017
+ return arr2;
7018
+ }
7019
+
7020
+ function _unsupportedIterableToArray$1(o, minLen) {
7021
+ if (!o) return;
7022
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
7023
+ var n = Object.prototype.toString.call(o).slice(8, -1);
7024
+ if (n === "Object" && o.constructor) n = o.constructor.name;
7025
+ if (n === "Map" || n === "Set") return Array.from(n);
7026
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
7027
+ }
7028
+
7029
+ function _nonIterableRest$1() {
7030
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7031
+ }
7032
+
7033
+ function _slicedToArray$1(arr, i) {
7034
+ return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
7035
+ }
7036
+
7037
+ function template$2$1(data) {
6779
7038
  var __t,
6780
7039
  __p = '';
6781
7040
 
@@ -6784,7 +7043,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6784
7043
  }
6785
7044
 
6786
7045
  var BackButtonDecoratorView = Marionette.Layout.extend({
6787
- template: template$3$1,
7046
+ template: template$2$1,
6788
7047
  className: 'back_button_decorator',
6789
7048
  events: {
6790
7049
  'click a.back': 'goBack'
@@ -6803,7 +7062,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6803
7062
  }
6804
7063
  });
6805
7064
 
6806
- function template$4$1(data) {
7065
+ function template$3$1(data) {
6807
7066
  var __t,
6808
7067
  __p = '';
6809
7068
 
@@ -6813,7 +7072,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6813
7072
 
6814
7073
  var ConfirmableFileItemView = Marionette.ItemView.extend({
6815
7074
  tagName: 'li',
6816
- template: template$4$1,
7075
+ template: template$3$1,
6817
7076
  ui: {
6818
7077
  fileName: '.file_name',
6819
7078
  duration: '.duration',
@@ -6846,7 +7105,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6846
7105
  }
6847
7106
  });
6848
7107
 
6849
- function template$5$1(data) {
7108
+ function template$4$1(data) {
6850
7109
  var __t,
6851
7110
  __p = '';
6852
7111
 
@@ -6857,7 +7116,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
6857
7116
  }
6858
7117
 
6859
7118
  var ConfirmEncodingView = Marionette.ItemView.extend({
6860
- template: template$5$1,
7119
+ template: template$4$1,
6861
7120
  className: 'confirm_encoding',
6862
7121
  ui: {
6863
7122
  blankSlate: '.blank_slate',
@@ -7011,7 +7270,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7011
7270
  }
7012
7271
  });
7013
7272
 
7014
- function template$6$1(data) {
7273
+ function template$5$1(data) {
7015
7274
  var __t,
7016
7275
  __p = '';
7017
7276
 
@@ -7020,7 +7279,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7020
7279
  }
7021
7280
 
7022
7281
  var EditEntryView = Marionette.Layout.extend({
7023
- template: template$6$1,
7282
+ template: template$5$1,
7024
7283
  mixins: [failureIndicatingView, tooltipContainer],
7025
7284
  ui: {
7026
7285
  publishButton: 'a.publish',
@@ -7102,7 +7361,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7102
7361
  }
7103
7362
  });
7104
7363
 
7105
- function template$7$1(data) {
7364
+ function template$6$1(data) {
7106
7365
  var __t,
7107
7366
  __p = '';
7108
7367
 
@@ -7111,7 +7370,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7111
7370
  }
7112
7371
 
7113
7372
  var WidgetItemView = Marionette.Layout.extend({
7114
- template: template$7$1,
7373
+ template: template$6$1,
7115
7374
  tagName: 'li',
7116
7375
  className: 'widget_item',
7117
7376
  regions: {
@@ -7148,14 +7407,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7148
7407
  }
7149
7408
  });
7150
7409
 
7151
- function template$8$1(data) {
7410
+ function template$7$1(data) {
7152
7411
  var __p = '';
7153
7412
  __p += '<ol class="widgets">\n</ol>\n';
7154
7413
  return __p;
7155
7414
  }
7156
7415
 
7157
7416
  var EditWidgetsView = Marionette.Layout.extend({
7158
- template: template$8$1,
7417
+ template: template$7$1,
7159
7418
  ui: {
7160
7419
  widgets: '.widgets'
7161
7420
  },
@@ -7171,14 +7430,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7171
7430
  }
7172
7431
  });
7173
7432
 
7174
- function template$9$1(data) {
7433
+ function template$8$1(data) {
7175
7434
  var __p = '';
7176
7435
  __p += '<div class="image"></div>\n<div class="label"></div>\n';
7177
7436
  return __p;
7178
7437
  }
7179
7438
 
7180
7439
  var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
7181
- template: template$9$1,
7440
+ template: template$8$1,
7182
7441
  className: 'preview',
7183
7442
  modelEvents: {
7184
7443
  change: 'update'
@@ -7209,14 +7468,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7209
7468
  }
7210
7469
  });
7211
7470
 
7212
- function template$a$1(data) {
7471
+ function template$9$1(data) {
7213
7472
  var __p = '';
7214
7473
  __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';
7215
7474
  return __p;
7216
7475
  }
7217
7476
 
7218
7477
  var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
7219
- template: template$a$1,
7478
+ template: template$9$1,
7220
7479
  className: '',
7221
7480
  ui: {
7222
7481
  container: '.container',
@@ -7297,7 +7556,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7297
7556
  }
7298
7557
  });
7299
7558
 
7300
- function template$b$1(data) {
7559
+ function template$a$1(data) {
7301
7560
  var __t,
7302
7561
  __p = '';
7303
7562
 
@@ -7306,7 +7565,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7306
7565
  }
7307
7566
 
7308
7567
  var BackgroundPositioningView = Marionette.ItemView.extend({
7309
- template: template$b$1,
7568
+ template: template$a$1,
7310
7569
  className: 'background_positioning editor dialog',
7311
7570
  mixins: [dialogView],
7312
7571
  ui: {
@@ -7360,14 +7619,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7360
7619
  app.dialogRegion.show(new BackgroundPositioningView(options));
7361
7620
  };
7362
7621
 
7363
- function template$c$1(data) {
7622
+ function template$b$1(data) {
7364
7623
  var __p = '';
7365
7624
  __p += '<div class="label"></div>\n<a href="#"></a>\n';
7366
7625
  return __p;
7367
7626
  }
7368
7627
 
7369
7628
  var DropDownButtonItemView = Marionette.ItemView.extend({
7370
- template: template$c$1,
7629
+ template: template$b$1,
7371
7630
  tagName: 'li',
7372
7631
  className: 'drop_down_button_item',
7373
7632
  ui: {
@@ -7381,6 +7640,10 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7381
7640
  }
7382
7641
 
7383
7642
  event.preventDefault();
7643
+
7644
+ if (this.model.get('kind') === 'checkBox' || this.model.get('kind') === 'radio') {
7645
+ event.stopPropagation();
7646
+ }
7384
7647
  }
7385
7648
  },
7386
7649
  modelEvents: {
@@ -7400,7 +7663,11 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7400
7663
  this.ui.label.text(this.model.get('label'));
7401
7664
  this.$el.toggleClass('is_selectable', !!this.model.selected);
7402
7665
  this.$el.toggleClass('is_disabled', !!this.model.get('disabled'));
7666
+ this.$el.toggleClass('is_hidden', !!this.model.get('hidden'));
7667
+ this.$el.toggleClass('has_check_box', this.model.get('kind') === 'checkBox');
7668
+ this.$el.toggleClass('has_radio', this.model.get('kind') === 'radio');
7403
7669
  this.$el.toggleClass('is_checked', !!this.model.get('checked'));
7670
+ this.$el.toggleClass('separated', !!this.model.get('separated'));
7404
7671
  this.$el.data('name', this.model.get('name'));
7405
7672
  }
7406
7673
  });
@@ -7417,7 +7684,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7417
7684
  });
7418
7685
  };
7419
7686
 
7420
- function template$d$1(data) {
7687
+ function template$c$1(data) {
7421
7688
  var __p = '';
7422
7689
  __p += '<button></button>\n\n<div class="drop_down_button_menu">\n</div>\n';
7423
7690
  return __p;
@@ -7440,6 +7707,13 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7440
7707
  * Require click to open menu. By default, menu opens on when the
7441
7708
  * mouse enters the button.
7442
7709
  *
7710
+ * @param {String} [options.alignMenu]
7711
+ * "right" to align menu on the right. Aligned on the left by
7712
+ * default.
7713
+ *
7714
+ * @param {String} [options.buttonClassName]
7715
+ * CSS class name for button element.
7716
+ *
7443
7717
  * ## Item Models
7444
7718
  *
7445
7719
  * The following model attributes can be used to control the
@@ -7459,7 +7733,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7459
7733
 
7460
7734
 
7461
7735
  var DropDownButtonView = Marionette.ItemView.extend({
7462
- template: template$d$1,
7736
+ template: template$c$1,
7463
7737
  className: 'drop_down_button',
7464
7738
  ui: {
7465
7739
  button: '> button',
@@ -7480,7 +7754,9 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7480
7754
  this.$el.toggleClass('full_width', !!this.options.fullWidth);
7481
7755
  this.ui.button.toggleClass('has_icon_and_text', !!this.options.label);
7482
7756
  this.ui.button.toggleClass('has_icon_only', !this.options.label);
7757
+ this.ui.button.toggleClass('ellipsis_icon', !!this.options.ellipsisIcon);
7483
7758
  this.ui.button.text(this.options.label);
7759
+ this.ui.button.addClass(this.options.buttonClassName);
7484
7760
  this.ui.menu.append(this.subview(new DropDownButtonItemListView({
7485
7761
  items: this.options.items
7486
7762
  })).el);
@@ -7504,7 +7780,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7504
7780
  var offset = this.$el.offset();
7505
7781
  this.ui.menu.css({
7506
7782
  top: offset.top + this.$el.height(),
7507
- left: offset.left,
7783
+ left: this.options.alignMenu === 'right' ? offset.left + this.$el.width() - this.ui.menu.outerWidth() : offset.left,
7508
7784
  width: this.options.fullWidth ? this.$el.width() : null
7509
7785
  });
7510
7786
  },
@@ -7534,7 +7810,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7534
7810
  }
7535
7811
  });
7536
7812
 
7537
- function template$e$1(data) {
7813
+ function template$d$1(data) {
7538
7814
  var __p = '';
7539
7815
  __p += '<div class="pictogram"></div>\n';
7540
7816
  return __p;
@@ -7542,7 +7818,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7542
7818
 
7543
7819
  var FileThumbnailView = Marionette.ItemView.extend({
7544
7820
  className: 'file_thumbnail',
7545
- template: template$e$1,
7821
+ template: template$d$1,
7546
7822
  modelEvents: {
7547
7823
  'change:state': 'update'
7548
7824
  },
@@ -7638,6 +7914,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7638
7914
  if (dropDownMenuItems.length) {
7639
7915
  this.appendSubview(new DropDownButtonView({
7640
7916
  items: dropDownMenuItems,
7917
+ ellipsisIcon: true,
7641
7918
  openOnClick: true
7642
7919
  }));
7643
7920
  }
@@ -7682,15 +7959,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7682
7959
 
7683
7960
  if (file) {
7684
7961
  _.each(this.options.dropDownMenuItems, function (item) {
7685
- items.add(new FileInputView.CustomMenuItem({
7686
- name: item.name,
7687
- label: item.label
7688
- }, {
7689
- inputModel: _this.model,
7690
- propertyName: _this.options.propertyName,
7691
- file: file,
7692
- selected: item.selected
7693
- }));
7962
+ items.add(_this._createCustomMenuItem(file, item));
7694
7963
  });
7695
7964
 
7696
7965
  items.add(new FileInputView.EditFileSettingsMenuItem({
@@ -7703,6 +7972,31 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7703
7972
 
7704
7973
  return items;
7705
7974
  },
7975
+ _createCustomMenuItem: function _createCustomMenuItem(file, item) {
7976
+ var _this2 = this;
7977
+
7978
+ var options = {
7979
+ inputModel: this.model,
7980
+ propertyName: this.options.propertyName,
7981
+ file: file
7982
+ };
7983
+
7984
+ if (typeof item === 'function') {
7985
+ return new item({}, options);
7986
+ } else {
7987
+ return new FileInputView.CustomMenuItem({
7988
+ name: item.name,
7989
+ label: item.label,
7990
+ checked: item.checked,
7991
+ items: item.items && new Backbone.Collection(item.items.map(function (item) {
7992
+ return _this2._createCustomMenuItem(file, item);
7993
+ }))
7994
+ }, _objectSpread2$1(_objectSpread2$1({}, options), {}, {
7995
+ selected: item.selected,
7996
+ items: item.items
7997
+ }));
7998
+ }
7999
+ },
7706
8000
  _listenToNestedTextTrackFiles: function _listenToNestedTextTrackFiles(file) {
7707
8001
  if (this.textTrackFiles) {
7708
8002
  this.stopListening(this.textTrackFiles);
@@ -7777,6 +8071,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7777
8071
  this.update();
7778
8072
  },
7779
8073
  update: function update() {
8074
+ this.set('kind', 'radio');
7780
8075
  this.set('checked', this.options.textTrackFile == this.getDefaultTextTrackFile());
7781
8076
  this.set('name', this.options.textTrackFile ? null : 'no_default_text_track');
7782
8077
  this.set('label', this.options.textTrackFile ? this.options.textTrackFile.displayLabel() : this.options.textTrackFiles.length ? I18n$1.t('pageflow.editor.views.inputs.file_input.auto_default_text_track') : I18n$1.t('pageflow.editor.views.inputs.file_input.no_default_text_track'));
@@ -7793,14 +8088,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7793
8088
  }
7794
8089
  });
7795
8090
 
7796
- function template$f(data) {
8091
+ function template$e$1(data) {
7797
8092
  var __p = '';
7798
8093
  __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';
7799
8094
  return __p;
7800
8095
  }
7801
8096
 
7802
8097
  var LoadingView = Marionette.ItemView.extend({
7803
- template: template$f,
8098
+ template: template$e$1,
7804
8099
  className: 'loading',
7805
8100
  tagName: 'li'
7806
8101
  });
@@ -7822,7 +8117,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7822
8117
  }
7823
8118
  };
7824
8119
 
7825
- function template$g(data) {
8120
+ function template$f(data) {
7826
8121
  var __t,
7827
8122
  __p = '';
7828
8123
 
@@ -7832,7 +8127,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7832
8127
 
7833
8128
  var ThemeItemView = Marionette.ItemView.extend({
7834
8129
  tagName: 'li',
7835
- template: template$g,
8130
+ template: template$f,
7836
8131
  className: 'theme_item',
7837
8132
  mixins: [selectableView],
7838
8133
  selectionAttribute: 'theme',
@@ -7863,7 +8158,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7863
8158
  }
7864
8159
  });
7865
8160
 
7866
- function template$h(data) {
8161
+ function template$g(data) {
7867
8162
  var __t,
7868
8163
  __p = '';
7869
8164
 
@@ -7872,7 +8167,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7872
8167
  }
7873
8168
 
7874
8169
  var ChangeThemeDialogView = Marionette.ItemView.extend({
7875
- template: template$h,
8170
+ template: template$g,
7876
8171
  className: 'change_theme dialog editor',
7877
8172
  mixins: [dialogView],
7878
8173
  ui: {
@@ -7940,14 +8235,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
7940
8235
  }).promise();
7941
8236
  };
7942
8237
 
7943
- function template$i(data) {
8238
+ function template$h(data) {
7944
8239
  var __p = '';
7945
8240
  __p += '\n';
7946
8241
  return __p;
7947
8242
  }
7948
8243
 
7949
8244
  var StaticThumbnailView = Marionette.ItemView.extend({
7950
- template: template$i,
8245
+ template: template$h,
7951
8246
  className: 'static_thumbnail',
7952
8247
  modelEvents: {
7953
8248
  'change:configuration': 'update'
@@ -8010,7 +8305,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8010
8305
  }
8011
8306
  });
8012
8307
 
8013
- function template$j(data) {
8308
+ function template$i(data) {
8014
8309
  var __p = '';
8015
8310
  __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';
8016
8311
  return __p;
@@ -8026,7 +8321,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8026
8321
  /** @lends ReferenceInputView.prototype */
8027
8322
  {
8028
8323
  mixins: [inputView],
8029
- template: template$j,
8324
+ template: template$i,
8030
8325
  className: 'reference_input',
8031
8326
  ui: {
8032
8327
  title: '.title',
@@ -8124,7 +8419,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8124
8419
  }
8125
8420
  });
8126
8421
 
8127
- function template$k(data) {
8422
+ function template$j(data) {
8128
8423
  var __t,
8129
8424
  __p = '';
8130
8425
 
@@ -8133,7 +8428,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8133
8428
  }
8134
8429
 
8135
8430
  var EditMetaDataView = Marionette.Layout.extend({
8136
- template: template$k,
8431
+ template: template$j,
8137
8432
  className: 'edit_meta_data',
8138
8433
  mixins: [failureIndicatingView],
8139
8434
  regions: {
@@ -8233,7 +8528,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8233
8528
  }
8234
8529
  });
8235
8530
 
8236
- function template$l(data) {
8531
+ function template$k(data) {
8237
8532
  var __t,
8238
8533
  __p = '';
8239
8534
 
@@ -8242,7 +8537,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8242
8537
  }
8243
8538
 
8244
8539
  var EditWidgetView = Marionette.ItemView.extend({
8245
- template: template$l,
8540
+ template: template$k,
8246
8541
  className: 'edit_widget',
8247
8542
  events: {
8248
8543
  'click a.back': function clickABack() {
@@ -8273,7 +8568,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8273
8568
  }
8274
8569
  });
8275
8570
 
8276
- function template$m(data) {
8571
+ function template$l(data) {
8277
8572
  var __p = '';
8278
8573
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n';
8279
8574
  return __p;
@@ -8281,7 +8576,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8281
8576
 
8282
8577
  var ExplorerFileItemView = Marionette.ItemView.extend({
8283
8578
  tagName: 'li',
8284
- template: template$m,
8579
+ template: template$l,
8285
8580
  mixins: [loadable, selectableView],
8286
8581
  selectionAttribute: 'file',
8287
8582
  ui: {
@@ -8318,14 +8613,14 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8318
8613
  }
8319
8614
  });
8320
8615
 
8321
- function template$n(data) {
8616
+ function template$m(data) {
8322
8617
  var __p = '';
8323
8618
  __p += '<a href="">\n <span class="title"></span>\n</a>\n';
8324
8619
  return __p;
8325
8620
  }
8326
8621
 
8327
8622
  var OtherEntryItemView = Marionette.ItemView.extend({
8328
- template: template$n,
8623
+ template: template$m,
8329
8624
  className: 'other_entry_item',
8330
8625
  tagName: 'li',
8331
8626
  mixins: [selectableView],
@@ -8340,7 +8635,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8340
8635
  }
8341
8636
  });
8342
8637
 
8343
- function template$o(data) {
8638
+ function template$n(data) {
8344
8639
  var __t,
8345
8640
  __p = '';
8346
8641
 
@@ -8366,7 +8661,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8366
8661
  selection: this.options.selection
8367
8662
  },
8368
8663
  blankSlateViewConstructor: Marionette.ItemView.extend({
8369
- template: template$o,
8664
+ template: template$n,
8370
8665
  tagName: 'li',
8371
8666
  className: 'blank_slate'
8372
8667
  }),
@@ -8377,7 +8672,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8377
8672
  }
8378
8673
  });
8379
8674
 
8380
- function template$p(data) {
8675
+ function template$o(data) {
8381
8676
  var __t,
8382
8677
  __p = '';
8383
8678
 
@@ -8402,7 +8697,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8402
8697
  }
8403
8698
 
8404
8699
  var FilesExplorerView = Marionette.ItemView.extend({
8405
- template: template$p,
8700
+ template: template$o,
8406
8701
  className: 'files_explorer editor dialog',
8407
8702
  mixins: [dialogView],
8408
8703
  ui: {
@@ -8489,7 +8784,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8489
8784
  app.dialogRegion.show(new FilesExplorerView(options));
8490
8785
  };
8491
8786
 
8492
- function template$q(data) {
8787
+ function template$p(data) {
8493
8788
  var __p = '';
8494
8789
  __p += '<th></th>\n<td></td>';
8495
8790
  return __p;
@@ -8497,17 +8792,18 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8497
8792
 
8498
8793
  var FileMetaDataItemView = Marionette.ItemView.extend({
8499
8794
  tagName: 'tr',
8500
- template: template$q,
8795
+ template: template$p,
8501
8796
  ui: {
8502
8797
  label: 'th',
8503
8798
  value: 'td'
8504
8799
  },
8505
8800
  onRender: function onRender() {
8506
- this.subview(new this.options.valueView(_.extend({
8507
- el: this.ui.value,
8801
+ this.appendSubview(new this.options.valueView(_.extend({
8508
8802
  model: this.model,
8509
8803
  name: this.options.name
8510
- }, this.options.valueViewOptions || {})));
8804
+ }, this.options.valueViewOptions || {})), {
8805
+ to: this.ui.value
8806
+ });
8511
8807
  this.ui.label.text(this.labelText());
8512
8808
  },
8513
8809
  labelText: function labelText() {
@@ -8519,7 +8815,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8519
8815
  }
8520
8816
  });
8521
8817
 
8522
- function template$r(data) {
8818
+ function template$q(data) {
8523
8819
  var __p = '';
8524
8820
  __p += '<p class="percent"></p>\n<p class="description"></p>\n<p class="error_message"></p>';
8525
8821
  return __p;
@@ -8528,7 +8824,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8528
8824
  var FileStageItemView = Marionette.ItemView.extend({
8529
8825
  tagName: 'li',
8530
8826
  className: 'file_stage_item',
8531
- template: template$r,
8827
+ template: template$q,
8532
8828
  ui: {
8533
8829
  description: '.description',
8534
8830
  percent: '.percent',
@@ -8569,7 +8865,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8569
8865
  }
8570
8866
  });
8571
8867
 
8572
- function template$s(data) {
8868
+ function template$r(data) {
8573
8869
  var __t,
8574
8870
  __p = '';
8575
8871
 
@@ -8579,7 +8875,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8579
8875
 
8580
8876
  var FileItemView = Marionette.ItemView.extend({
8581
8877
  tagName: 'li',
8582
- template: template$s,
8878
+ template: template$r,
8583
8879
  mixins: [loadable],
8584
8880
  ui: {
8585
8881
  fileName: '.file_name',
@@ -8694,7 +8990,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8694
8990
  }
8695
8991
  });
8696
8992
 
8697
- function template$t(data) {
8993
+ function template$s(data) {
8698
8994
  var __t,
8699
8995
  __p = '';
8700
8996
 
@@ -8711,7 +9007,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8711
9007
  }
8712
9008
 
8713
9009
  var FilteredFilesView = Marionette.ItemView.extend({
8714
- template: template$t,
9010
+ template: template$s,
8715
9011
  className: 'filtered_files',
8716
9012
  ui: {
8717
9013
  banner: '.filtered_files-banner',
@@ -8775,7 +9071,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8775
9071
  }
8776
9072
  });
8777
9073
 
8778
- function template$u(data) {
9074
+ function template$t(data) {
8779
9075
  var __t,
8780
9076
  __p = '';
8781
9077
 
@@ -8783,7 +9079,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8783
9079
  return __p;
8784
9080
  }
8785
9081
 
8786
- function template$v(data) {
9082
+ function template$u(data) {
8787
9083
  var __t,
8788
9084
  __p = '';
8789
9085
 
@@ -8792,7 +9088,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8792
9088
  }
8793
9089
 
8794
9090
  var ImporterSelectView = Marionette.ItemView.extend({
8795
- template: template$v,
9091
+ template: template$u,
8796
9092
  className: 'importer_select',
8797
9093
  tagName: 'li',
8798
9094
  events: {
@@ -8808,7 +9104,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8808
9104
  }
8809
9105
  });
8810
9106
  var ChooseImporterView = Marionette.ItemView.extend({
8811
- template: template$u,
9107
+ template: template$t,
8812
9108
  className: 'choose_importer editor dialog',
8813
9109
  mixins: [dialogView],
8814
9110
  ui: {
@@ -8843,7 +9139,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8843
9139
  app.dialogRegion.show(new ChooseImporterView(options).render());
8844
9140
  };
8845
9141
 
8846
- function template$w(data) {
9142
+ function template$v(data) {
8847
9143
  var __t,
8848
9144
  __p = '';
8849
9145
 
@@ -8851,7 +9147,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8851
9147
  return __p;
8852
9148
  }
8853
9149
 
8854
- function template$x(data) {
9150
+ function template$w(data) {
8855
9151
  var __t,
8856
9152
  __p = '';
8857
9153
 
@@ -8859,6 +9155,72 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8859
9155
  return __p;
8860
9156
  }
8861
9157
 
9158
+ function template$x(data) {
9159
+ var __p = '';
9160
+ __p += '';
9161
+ return __p;
9162
+ }
9163
+
9164
+ var EditFileView = Marionette.ItemView.extend({
9165
+ template: template$x,
9166
+ className: 'edit_file',
9167
+ onRender: function onRender() {
9168
+ var fileType = this.model.fileType();
9169
+ var entry = this.options.entry || state.entry;
9170
+ var tab = new ConfigurationEditorTabView({
9171
+ model: this.model.configuration,
9172
+ attributeTranslationKeyPrefixes: ['pageflow.editor.files.attributes.' + fileType.collectionName, 'pageflow.editor.files.common_attributes', 'pageflow.editor.nested_files.' + fileType.collectionName, 'pageflow.editor.nested_files.common_attributes']
9173
+ });
9174
+
9175
+ if (this.options.displayFileName) {
9176
+ tab.input('file_name', TextInputView, {
9177
+ model: this.model,
9178
+ disabled: true
9179
+ });
9180
+ }
9181
+
9182
+ tab.input('rights', TextInputView, {
9183
+ model: this.model,
9184
+ placeholder: entry.get('default_file_rights')
9185
+ });
9186
+
9187
+ if (editor.entryType.supportsExtendedFileRights && !fileType.noExtendedFileRights) {
9188
+ tab.input('source_url', TextInputView);
9189
+ tab.input('license', SelectInputView, {
9190
+ includeBlank: true,
9191
+ blankTranslationKey: 'pageflow.editor.files.common_attributes.license.blank',
9192
+ values: state.config.availableFileLicenses,
9193
+ texts: state.config.availableFileLicenses.map(function (name) {
9194
+ return I18n$1.t("pageflow.file_licenses.".concat(name, ".name"));
9195
+ })
9196
+ });
9197
+ tab.input('rights_display', SelectInputView, {
9198
+ values: ['credits', 'inline']
9199
+ });
9200
+ }
9201
+
9202
+ tab.view(SeparatorView);
9203
+
9204
+ _(this.fileTypeInputs()).each(function (options) {
9205
+ tab.input(options.name, options.inputView, options.inputViewOptions);
9206
+ });
9207
+
9208
+ tab.input('original_url', UrlDisplayView, {
9209
+ model: this.model
9210
+ });
9211
+ this.appendSubview(tab);
9212
+ },
9213
+ fileTypeInputs: function fileTypeInputs() {
9214
+ var fileType = this.model.fileType();
9215
+ return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
9216
+ if (_.isFunction(inputs)) {
9217
+ return inputs(this.model);
9218
+ } else {
9219
+ return inputs;
9220
+ }
9221
+ }, this).flatten().value();
9222
+ }
9223
+ });
8862
9224
  var UploadableFilesView = Marionette.View.extend({
8863
9225
  className: 'uploadable_files',
8864
9226
  initialize: function initialize() {
@@ -8904,7 +9266,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8904
9266
  }
8905
9267
  });
8906
9268
  var ConfirmFileImportUploadView = Marionette.Layout.extend({
8907
- template: template$x,
9269
+ template: template$w,
8908
9270
  className: 'confirm_upload editor dialog',
8909
9271
  mixins: [dialogView],
8910
9272
  regions: {
@@ -8974,7 +9336,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
8974
9336
  };
8975
9337
 
8976
9338
  var FilesImporterView = Marionette.ItemView.extend({
8977
- template: template$w,
9339
+ template: template$v,
8978
9340
  className: 'files_importer editor dialog',
8979
9341
  mixins: [dialogView],
8980
9342
  ui: {
@@ -9032,7 +9394,10 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9032
9394
  content_type: file.type,
9033
9395
  file_size: -1,
9034
9396
  rights: file.rights,
9035
- source_url: file.url
9397
+ source_url: file.url,
9398
+ configuration: {
9399
+ source_url: file.source_url
9400
+ }
9036
9401
  }, {
9037
9402
  fileType: fileType
9038
9403
  });
@@ -9170,7 +9535,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9170
9535
  this.$el.append(this.subview(this.tabsView).el);
9171
9536
  },
9172
9537
  tab: function tab(fileType) {
9173
- var selectionMode = this.options.tabName === fileType.collectionName;
9538
+ var selectionMode = this.options.allowSelectingAny || this.options.tabName === fileType.collectionName;
9174
9539
  this.tabsView.tab(fileType.collectionName, _.bind(function () {
9175
9540
  return this.subview(new FilteredFilesView({
9176
9541
  entry: state.entry,
@@ -9251,7 +9616,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9251
9616
  var __t,
9252
9617
  __p = '';
9253
9618
 
9254
- __p += '<div class="files_pending notice">\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.files_pending_notice')) == null ? '' : __t) + '</p>\n <p><a href="#files">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.show_files')) == null ? '' : __t) + '</a></p>\n</div>\n\n<div>\n <div class="published notice">\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.published_notice')) == null ? '' : __t) + '</p>\n <p><a href="" target="_blank">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.view_revisions')) == null ? '' : __t) + '</a></p>\n </div>\n\n <div class="not_published notice">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.not_published_notice')) == null ? '' : __t) + '\n </div>\n\n <h2 class="sidebar-header">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.publish_current')) == null ? '' : __t) + '\n </h2>\n\n <div class="radio_input">\n <input id="publish_entry_forever" type="radio" name="mode" value="publish_forever">\n <label for="publish_entry_forever">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.unlimited')) == null ? '' : __t) + '</label>\n </div>\n\n <div class="radio_input">\n <input id="publish_entry_until" type="radio" name="mode" value="publish_until">\n <label for="publish_entry_until">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.until_including')) == null ? '' : __t) + '</label>\n </div>\n\n <div class="publish_until_fields disabled">\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.date')) == null ? '' : __t) + '\n <input type="text" name="publish_until">\n </label>\n\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.time')) == null ? '' : __t) + '\n <input type="text" name="publish_until_time" value="00:00">\n </label>\n </div>\n\n <div class="check_box_input">\n <input id="publish_password_protected" type="checkbox" name="password_protected" value="1">\n <label for="publish_password_protected">\n <span class="name">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.password_protected')) == null ? '' : __t) + '\n </span>\n <span class="inline_help">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.password_help')) == null ? '' : __t) + '\n </span>\n </label>\n </div>\n\n <div class="password_fields disabled">\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.user_name')) == null ? '' : __t) + '\n <input type="text" name="user_name" disabled>\n </label>\n\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.password')) == null ? '' : __t) + '\n <input type="text" name="password">\n </label>\n\n <p class="already_published_with_password">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.already_published_with_password_help')) == null ? '' : __t) + '\n </p>\n <p class="previously_published_with_password">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.previously_published_with_password_help')) == null ? '' : __t) + '\n </p>\n <p class="already_published_without_password">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.already_published_without_password_help')) == null ? '' : __t) + '\n </p>\n </div>\n\n <button class="save" disabled>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.publish')) == null ? '' : __t) + '</a>\n</div>\n\n<div class="success notice">\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.publish_success')) == null ? '' : __t) + '</p>\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.published_url_hint')) == null ? '' : __t) + '</p>\n <p><a href="" target="_blank"></a></p>\n</div>\n';
9619
+ __p += '<div class="files_pending notice">\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.files_pending_notice')) == null ? '' : __t) + '</p>\n <p><a href="#files">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.show_files')) == null ? '' : __t) + '</a></p>\n</div>\n\n<div>\n <div class="published notice">\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.published_notice')) == null ? '' : __t) + '</p>\n <p><a href="" target="_blank">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.view_revisions')) == null ? '' : __t) + '</a></p>\n </div>\n\n <div class="not_published notice">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.not_published_notice')) == null ? '' : __t) + '\n </div>\n\n <h2 class="sidebar-header">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.publish_current')) == null ? '' : __t) + '\n </h2>\n\n <div class="radio_input">\n <input id="publish_entry_forever" type="radio" name="mode" value="publish_forever">\n <label for="publish_entry_forever">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.unlimited')) == null ? '' : __t) + '</label>\n </div>\n\n <div class="radio_input">\n <input id="publish_entry_until" type="radio" name="mode" value="publish_until">\n <label for="publish_entry_until">' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.until_including')) == null ? '' : __t) + '</label>\n </div>\n\n <div class="publish_until_fields disabled">\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.date')) == null ? '' : __t) + '\n <input type="text" name="publish_until">\n </label>\n\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.time')) == null ? '' : __t) + '\n <input type="text" name="publish_until_time" value="00:00">\n </label>\n </div>\n\n <div class="check_box_input">\n <input id="publish_with_noindex" type="checkbox" name="noindex" value="1">\n <label for="publish_with_noindex">\n <span class="name">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.noindex')) == null ? '' : __t) + '\n </span>\n <span class="inline_help">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.noindex_help')) == null ? '' : __t) + '\n </span>\n </label>\n </div>\n\n <div class="check_box_input">\n <input id="publish_password_protected" type="checkbox" name="password_protected" value="1">\n <label for="publish_password_protected">\n <span class="name">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.password_protected')) == null ? '' : __t) + '\n </span>\n <span class="inline_help">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.password_help')) == null ? '' : __t) + '\n </span>\n </label>\n </div>\n\n <div class="password_fields disabled">\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.user_name')) == null ? '' : __t) + '\n <input type="text" name="user_name" disabled>\n </label>\n\n <label>\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.password')) == null ? '' : __t) + '\n <input type="text" name="password">\n </label>\n\n <p class="already_published_with_password">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.already_published_with_password_help')) == null ? '' : __t) + '\n </p>\n <p class="previously_published_with_password">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.previously_published_with_password_help')) == null ? '' : __t) + '\n </p>\n <p class="already_published_without_password">\n ' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.already_published_without_password_help')) == null ? '' : __t) + '\n </p>\n </div>\n\n <button class="save" disabled>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.publish')) == null ? '' : __t) + '</a>\n</div>\n\n<div class="success notice">\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.publish_success')) == null ? '' : __t) + '</p>\n <p>' + ((__t = I18n.t('pageflow.editor.templates.publish_entry.published_url_hint')) == null ? '' : __t) + '</p>\n <p><a href="" target="_blank"></a></p>\n</div>\n';
9255
9620
  return __p;
9256
9621
  }
9257
9622
 
@@ -9268,6 +9633,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9268
9633
  passwordFields: '.password_fields',
9269
9634
  userNameField: 'input[name=user_name]',
9270
9635
  passwordField: 'input[name=password]',
9636
+ noindexCheckBox: 'input[name=noindex]',
9271
9637
  alreadyPublishedWithPassword: '.already_published_with_password',
9272
9638
  previouslyPublishedWithPassword: '.previously_published_with_password',
9273
9639
  alreadyPublishedWithoutPassword: '.already_published_without_password',
@@ -9318,10 +9684,10 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9318
9684
  this.ui.publishUntilField.datepicker('setDate', publishedUntil);
9319
9685
  this.ui.publishUntilTimeField.val(timeStr(publishedUntil));
9320
9686
  } else {
9321
- this.ui.publishUntilField.datepicker('setDate', oneYearFromNow());
9687
+ this.ui.publishUntilField.datepicker('setDate', this.defaultPublishedUntilDate());
9322
9688
  }
9323
9689
 
9324
- this.ui.userNameField.val(state.account.get('name'));
9690
+ this.ui.userNameField.val(this.options.account.get('name'));
9325
9691
 
9326
9692
  if (this.model.get('password_protected')) {
9327
9693
  this.ui.passwordProtectedCheckBox.prop('checked', true);
@@ -9330,6 +9696,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9330
9696
  this.ui.passwordField.val(this.randomPassword());
9331
9697
  }
9332
9698
 
9699
+ this.ui.noindexCheckBox.prop('checked', this.model.get('last_published_with_noindex'));
9333
9700
  this.ui.alreadyPublishedWithPassword.toggle(this.model.get('published') && this.model.get('password_protected'));
9334
9701
  this.ui.previouslyPublishedWithPassword.toggle(!this.model.get('published') && this.model.get('password_protected'));
9335
9702
  this.ui.alreadyPublishedWithoutPassword.toggle(this.model.get('published') && !this.model.get('password_protected')); // Helpers
@@ -9341,12 +9708,6 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9341
9708
  return ("0" + val).slice(-2);
9342
9709
  }
9343
9710
  }
9344
-
9345
- function oneYearFromNow() {
9346
- var date = new Date();
9347
- date.setFullYear(date.getFullYear() + 1);
9348
- return date;
9349
- }
9350
9711
  },
9351
9712
  save: function save() {
9352
9713
  var publishedUntil = null;
@@ -9376,7 +9737,8 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9376
9737
  this.options.entryPublication.publish({
9377
9738
  published_until: publishedUntil,
9378
9739
  password_protected: this.ui.passwordProtectedCheckBox.is(':checked'),
9379
- password: this.ui.passwordField.val()
9740
+ password: this.ui.passwordField.val(),
9741
+ noindex: this.ui.noindexCheckBox.is(':checked')
9380
9742
  }).fail(function () {
9381
9743
  alert('Beim Veröffentlichen ist ein Fehler aufgetreten');
9382
9744
  }).always(function () {
@@ -9421,6 +9783,11 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9421
9783
  return false;
9422
9784
  }
9423
9785
  },
9786
+ defaultPublishedUntilDate: function defaultPublishedUntilDate() {
9787
+ var date = new Date();
9788
+ date.setMonth(date.getMonth() + this.options.config.defaultPublishedUntilDurationInMonths);
9789
+ return date;
9790
+ },
9424
9791
  enableSave: function enableSave() {
9425
9792
  this.ui.saveButton.removeAttr('disabled');
9426
9793
  },
@@ -9520,10 +9887,16 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9520
9887
  }));
9521
9888
  },
9522
9889
  files: function files(collectionName, handler, payload, filterName) {
9890
+ var _split = (collectionName || '').split(':'),
9891
+ _split2 = _slicedToArray$1(_split, 2),
9892
+ tabName = _split2[0],
9893
+ suffix = _split2[1];
9894
+
9523
9895
  this.region.show(new FilesView({
9524
9896
  model: this.entry,
9525
9897
  selectionHandler: handler && editor.createFileSelectionHandler(handler, payload),
9526
- tabName: collectionName,
9898
+ tabName: tabName,
9899
+ allowSelectingAny: suffix === 'default',
9527
9900
  filterName: filterName
9528
9901
  }));
9529
9902
  editor.setDefaultHelpEntry('pageflow.help_entries.files');
@@ -9550,7 +9923,9 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9550
9923
  publish: function publish() {
9551
9924
  this.region.show(PublishEntryView.create({
9552
9925
  model: this.entry,
9553
- entryPublication: new EntryPublication()
9926
+ account: state.account,
9927
+ entryPublication: new EntryPublication(),
9928
+ config: state.config
9554
9929
  }));
9555
9930
  editor.setDefaultHelpEntry('pageflow.help_entries.publish');
9556
9931
  },
@@ -9909,7 +10284,15 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
9909
10284
  });
9910
10285
  var InfoBoxView = Marionette.View.extend({
9911
10286
  className: 'info_box',
10287
+ mixins: [attributeBinding],
10288
+ initialize: function initialize() {
10289
+ this.setupBooleanAttributeBinding('visible', this.updateVisible);
10290
+ },
10291
+ updateVisible: function updateVisible() {
10292
+ this.$el.toggleClass('hidden_via_binding', this.getBooleanAttributBoundOption('visible') === false);
10293
+ },
9912
10294
  render: function render() {
10295
+ this.$el.addClass(this.options.level);
9913
10296
  this.$el.html(this.options.text);
9914
10297
  return this;
9915
10298
  }
@@ -10498,7 +10881,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
10498
10881
  }
10499
10882
  });
10500
10883
  var ConfirmUploadView = Marionette.Layout.extend({
10501
- template: template$x,
10884
+ template: template$w,
10502
10885
  className: 'confirm_upload editor dialog',
10503
10886
  mixins: [dialogView],
10504
10887
  regions: {
@@ -10785,7 +11168,60 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
10785
11168
  editor.applyDefaultHelpEntry();
10786
11169
  });
10787
11170
  });
11171
+
11172
+ function _arrayWithoutHoles(arr) {
11173
+ if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
11174
+ }
11175
+
11176
+ function _iterableToArray(iter) {
11177
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
11178
+ }
11179
+
11180
+ function _nonIterableSpread() {
11181
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11182
+ }
11183
+
11184
+ function _toConsumableArray(arr) {
11185
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
11186
+ }
11187
+
11188
+ var OtherFile = UploadableFile.extend({
11189
+ thumbnailPictogram: 'other'
11190
+ });
10788
11191
  app.addInitializer(function (options) {
11192
+ editor.fileTypes.commonMetaDataAttributes = [{
11193
+ name: 'rights',
11194
+ valueView: TextFileMetaDataItemValueView,
11195
+ valueViewOptions: {
11196
+ settingsDialogTabLink: 'general'
11197
+ }
11198
+ }];
11199
+
11200
+ if (editor.entryType.supportsExtendedFileRights) {
11201
+ editor.fileTypes.commonMetaDataAttributes = [].concat(_toConsumableArray(editor.fileTypes.commonMetaDataAttributes), [{
11202
+ name: 'source_url',
11203
+ valueView: TextFileMetaDataItemValueView,
11204
+ valueViewOptions: {
11205
+ fromConfiguration: true,
11206
+ settingsDialogTabLink: 'general'
11207
+ }
11208
+ }, {
11209
+ name: 'license',
11210
+ valueView: TextFileMetaDataItemValueView,
11211
+ valueViewOptions: {
11212
+ fromConfiguration: true,
11213
+ formatValue: function formatValue(value) {
11214
+ return I18n$1.t("pageflow.file_licenses.".concat(value, ".name"));
11215
+ },
11216
+ settingsDialogTabLink: 'general'
11217
+ }
11218
+ }]);
11219
+ }
11220
+
11221
+ editor.fileTypes.commonSettingsDialogTabs = [{
11222
+ name: 'general',
11223
+ view: EditFileView
11224
+ }];
10789
11225
  var textTracksMetaDataAttribute = {
10790
11226
  name: 'text_tracks',
10791
11227
  valueView: TextTracksFileMetaDataItemValueView,
@@ -10845,6 +11281,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
10845
11281
  return upload.name.match(/\.vtt$/) || upload.name.match(/\.srt$/);
10846
11282
  },
10847
11283
  skipUploadConfirmation: true,
11284
+ noExtendedFileRights: true,
10848
11285
  configurationEditorInputs: [{
10849
11286
  name: 'label',
10850
11287
  inputView: TextInputView,
@@ -10894,6 +11331,18 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
10894
11331
  binding: 'label'
10895
11332
  }
10896
11333
  });
11334
+ editor.fileTypes.register('other_files', {
11335
+ model: OtherFile,
11336
+ metaDataAttributes: [altMetaDataAttribute],
11337
+ matchUpload: function matchUpload() {
11338
+ return true;
11339
+ },
11340
+ priority: 100,
11341
+ configurationEditorInputs: [{
11342
+ name: 'alt',
11343
+ inputView: TextInputView
11344
+ }]
11345
+ });
10897
11346
  editor.fileTypes.setup(options.config.fileTypes);
10898
11347
  });
10899
11348
  app.addInitializer(function (options) {
@@ -12485,6 +12934,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
12485
12934
  exports.NestedFilesView = NestedFilesView;
12486
12935
  exports.NestedTypeError = NestedTypeError;
12487
12936
  exports.NotificationsView = NotificationsView;
12937
+ exports.NumberInputView = NumberInputView;
12488
12938
  exports.Object = BaseObject;
12489
12939
  exports.OrderedPageLinksCollection = OrderedPageLinksCollection;
12490
12940
  exports.OtherEntriesCollection = OtherEntriesCollection;
@@ -12561,6 +13011,7 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
12561
13011
  exports.WidgetsCollection = WidgetsCollection;
12562
13012
  exports.addAndReturnModel = addAndReturnModel;
12563
13013
  exports.app = app;
13014
+ exports.attributeBinding = attributeBinding;
12564
13015
  exports.authenticationProvider = authenticationProvider;
12565
13016
  exports.configurationContainer = configurationContainer;
12566
13017
  exports.cssModulesUtils = cssModulesUtils;
@@ -12596,4 +13047,4 @@ var pageflow_paged = (function (exports, Backbone, _, Marionette, $, I18n$1, Chi
12596
13047
 
12597
13048
  return exports;
12598
13049
 
12599
- }({}, Backbone, _, Backbone.Marionette, jQuery, I18n, Backbone.ChildViewContainer, IScroll, jQuery, wysihtml5, Cocktail, pageflow, pageflow));
13050
+ }({}, Backbone, _, Backbone.Marionette, jQuery, I18n, Backbone.ChildViewContainer, IScroll, jQuery, wysihtml5, jQuery, Cocktail, pageflow, pageflow));