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
data/package/editor.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import Backbone from 'backbone';
2
2
  import _ from 'underscore';
3
- import { Object as Object$1, ConfigurationEditorTabView, TextInputView, UrlDisplayView, TabsView, ConfigurationEditorView, CollectionView, tooltipContainer, SelectInputView, inputView, TextAreaInputView, CheckBoxGroupInputView, i18nUtils, TableView, TextTableCellView, PresenceTableCellView, SortableCollectionView, DeleteRowTableCellView, CheckBoxInputView, SliderInputView, IconTableCellView } from 'pageflow/ui';
3
+ import { Object as Object$1, TabsView, ConfigurationEditorView, CollectionView, tooltipContainer, SelectInputView, inputView, TextInputView, TextAreaInputView, CheckBoxGroupInputView, i18nUtils, ConfigurationEditorTabView, SeparatorView, UrlDisplayView, TableView, TextTableCellView, PresenceTableCellView, SortableCollectionView, attributeBinding, DeleteRowTableCellView, CheckBoxInputView, SliderInputView, IconTableCellView } from 'pageflow/ui';
4
4
  export * from 'pageflow/ui';
5
5
  import Cocktail from 'cocktail';
6
6
  import I18n$1 from 'i18n-js';
7
7
  import Marionette from 'backbone.marionette';
8
8
  import $ from 'jquery';
9
9
  import { browser, features, Audio, events } from 'pageflow/frontend';
10
+ import 'jquery-ui';
10
11
 
11
12
  (function () {
12
13
  var sync = Backbone.sync;
@@ -234,7 +235,7 @@ var UnmatchedUploadError = UploadError.extend({
234
235
  });
235
236
  var validFileTypeTranslationList = {
236
237
  validFileTypeTranslations: function validFileTypeTranslations(validFileTypes) {
237
- return _.map(validFileTypes, function (validFileType) {
238
+ return validFileTypes.map(function (validFileType) {
238
239
  return I18n$1.t('activerecord.models.' + validFileType.i18nKey + '.other');
239
240
  }).join(', ');
240
241
  }
@@ -264,7 +265,7 @@ var InvalidNestedTypeError = UploadError.extend({
264
265
  initialize: function initialize(upload, options) {
265
266
  var editor = options.editor;
266
267
  var fileType = options.fileType;
267
- var validFileTypes = editor.nextUploadTargetFile.fileType().nestedFileTypes.fileTypes;
268
+ var validFileTypes = editor.nextUploadTargetFile.fileType().nestedFileTypes;
268
269
  var validFileTypeTranslations = this.validFileTypeTranslations(validFileTypes);
269
270
  var typeI18nKey = fileType.i18nKey;
270
271
  var typeSingularTranslation = I18n$1.t('activerecord.models.' + typeI18nKey + '.one');
@@ -314,58 +315,6 @@ _.each(['each', 'map', 'reduce', 'first', 'find', 'contains', 'filter'], functio
314
315
  };
315
316
  });
316
317
 
317
- var state = window.pageflow || {};
318
-
319
- function template(data) {
320
- var __p = '';
321
- __p += '';
322
- return __p
323
- }
324
-
325
- var EditFileView = Marionette.ItemView.extend({
326
- template: template,
327
- className: 'edit_file',
328
- onRender: function onRender() {
329
- var fileType = this.model.fileType();
330
- var entry = this.options.entry || state.entry;
331
- var tab = new ConfigurationEditorTabView({
332
- model: this.model.configuration,
333
- attributeTranslationKeyPrefixes: ['pageflow.editor.files.attributes.' + fileType.collectionName, 'pageflow.editor.files.common_attributes', 'pageflow.editor.nested_files.' + fileType.collectionName, 'pageflow.editor.nested_files.common_attributes']
334
- });
335
-
336
- if (this.options.displayFileName) {
337
- tab.input('file_name', TextInputView, {
338
- model: this.model,
339
- disabled: true
340
- });
341
- }
342
-
343
- tab.input('rights', TextInputView, {
344
- model: this.model,
345
- placeholder: entry.get('default_file_rights')
346
- });
347
-
348
- _(this.fileTypeInputs()).each(function (options) {
349
- tab.input(options.name, options.inputView, options.inputViewOptions);
350
- });
351
-
352
- tab.input('original_url', UrlDisplayView, {
353
- model: this.model
354
- });
355
- this.appendSubview(tab);
356
- },
357
- fileTypeInputs: function fileTypeInputs() {
358
- var fileType = this.model.fileType();
359
- return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
360
- if (_.isFunction(inputs)) {
361
- return inputs(this.model);
362
- } else {
363
- return inputs;
364
- }
365
- }, this).flatten().value();
366
- }
367
- });
368
-
369
318
  var app = new Marionette.Application();
370
319
 
371
320
  var dialogView = {
@@ -382,7 +331,7 @@ var dialogView = {
382
331
  }
383
332
  };
384
333
 
385
- function template$1(data) {
334
+ function template(data) {
386
335
  var __t, __p = '';
387
336
  __p += '<div class="box">\n <div class="content">\n <h1 class="dialog-header"></h1>\n </div>\n\n <div class="footer">\n <a href="" class="close">\n ' +
388
337
  ((__t = ( I18n.t('pageflow.editor.templates.file_settings_dialog.close') )) == null ? '' : __t) +
@@ -391,7 +340,7 @@ return __p
391
340
  }
392
341
 
393
342
  var FileSettingsDialogView = Marionette.ItemView.extend({
394
- template: template$1,
343
+ template: template,
395
344
  className: 'file_settings_dialog editor dialog',
396
345
  mixins: [dialogView],
397
346
  ui: {
@@ -422,11 +371,11 @@ FileSettingsDialogView.open = function (options) {
422
371
  app.dialogRegion.show(new FileSettingsDialogView(options));
423
372
  };
424
373
 
425
- function template$2(data) {
374
+ function template$1(data) {
426
375
  var __t, __p = '';
427
- __p += '<a class="edit" href="" title="' +
376
+ __p += '<span class="value"></span>\n<a class="edit" href="" title="' +
428
377
  ((__t = ( I18n.t('pageflow.editor.templates.file_meta_data_item_value_view.edit') )) == null ? '' : __t) +
429
- '">\n</a>\n<span class="value"></span>\n';
378
+ '">\n</a>\n\n';
430
379
  return __p
431
380
  }
432
381
 
@@ -449,7 +398,8 @@ return __p
449
398
  */
450
399
 
451
400
  var FileMetaDataItemValueView = Marionette.ItemView.extend({
452
- template: template$2,
401
+ template: template$1,
402
+ className: 'value_wrapper',
453
403
  ui: {
454
404
  value: '.value',
455
405
  editLink: '.edit'
@@ -491,7 +441,13 @@ var TextFileMetaDataItemValueView = FileMetaDataItemValueView.extend({
491
441
  model = this.model;
492
442
  }
493
443
 
494
- return model.get(this.options.name);
444
+ var value = model.get(this.options.name);
445
+
446
+ if (value && this.options.formatValue) {
447
+ return this.options.formatValue(value);
448
+ }
449
+
450
+ return value;
495
451
  }
496
452
  });
497
453
 
@@ -504,6 +460,7 @@ var FileType = Object$1.extend({
504
460
  this.paramKey = options.paramKey;
505
461
  this.i18nKey = options.i18nKey;
506
462
  this.nestedFileTypes = [];
463
+ this.settingsDialogTabs = options.settingsDialogTabs || [];
507
464
  this.confirmUploadTableColumns = options.confirmUploadTableColumns || [];
508
465
  this.configurationEditorInputs = [].concat(options.configurationEditorInputs || []);
509
466
  this.configurationUpdaters = options.configurationUpdaters || [];
@@ -511,17 +468,8 @@ var FileType = Object$1.extend({
511
468
  this.nestedFilesOrder = options.nestedFilesOrder;
512
469
  this.skipUploadConfirmation = options.skipUploadConfirmation || false;
513
470
  this.filters = options.filters || [];
514
- this.metaDataAttributes = [{
515
- name: 'rights',
516
- valueView: TextFileMetaDataItemValueView,
517
- valueViewOptions: {
518
- settingsDialogTabLink: 'general'
519
- }
520
- }].concat(options.metaDataAttributes || []);
521
- this.settingsDialogTabs = [{
522
- name: 'general',
523
- view: EditFileView
524
- }].concat(options.settingsDialogTabs || []);
471
+ this.noExtendedFileRights = options.noExtendedFileRights;
472
+ this.metaDataAttributes = options.metaDataAttributes || [];
525
473
 
526
474
  if (typeof options.matchUpload === 'function') {
527
475
  this.matchUpload = options.matchUpload;
@@ -561,6 +509,8 @@ var FileTypes = Object$1.extend({
561
509
  initialize: function initialize() {
562
510
  this.clientSideConfigs = [];
563
511
  this.clientSideConfigModifications = {};
512
+ this.commonSettingsDialogTabs = [];
513
+ this.commonMetaDataAttributes = [];
564
514
  },
565
515
  register: function register(name, config) {
566
516
  if (this._setup) {
@@ -578,22 +528,30 @@ var FileTypes = Object$1.extend({
578
528
  this.clientSideConfigModifications[name].push(config);
579
529
  },
580
530
  setup: function setup(serverSideConfigs) {
531
+ var _this = this;
532
+
581
533
  var clientSideConfigs = this.clientSideConfigs;
582
534
  this._setup = true;
583
- this.collection = new FileTypesCollection(_.map(serverSideConfigs, function (serverSideConfig) {
535
+
536
+ var configs = _.chain(serverSideConfigs).map(function (serverSideConfig) {
584
537
  var clientSideConfig = clientSideConfigs[serverSideConfig.collectionName];
585
538
 
586
539
  if (!clientSideConfig) {
587
540
  throw 'Missing client side config for file type "' + serverSideConfig.collectionName + '"';
588
541
  }
589
542
 
590
- _(this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
591
- this.lintModification(modification, serverSideConfig.collectionName);
592
- this.applyModification(clientSideConfig, modification);
593
- }, this);
543
+ _this.applyCommonConfig(clientSideConfig);
594
544
 
595
- return new FileType(_.extend({}, serverSideConfig, clientSideConfig));
596
- }, this));
545
+ _this.applyModifications(serverSideConfig, clientSideConfig);
546
+
547
+ return _.extend({}, serverSideConfig, clientSideConfig);
548
+ }).sortBy(function (config) {
549
+ return config.priority || 10;
550
+ }).value();
551
+
552
+ this.collection = new FileTypesCollection(_.map(configs, function (config) {
553
+ return new FileType(config);
554
+ }));
597
555
  var those = this;
598
556
 
599
557
  _.map(serverSideConfigs, function (serverSideConfig) {
@@ -603,6 +561,16 @@ var FileTypes = Object$1.extend({
603
561
  })));
604
562
  });
605
563
  },
564
+ applyCommonConfig: function applyCommonConfig(clientSideConfig) {
565
+ clientSideConfig.settingsDialogTabs = this.commonSettingsDialogTabs.concat(clientSideConfig.settingsDialogTabs || []);
566
+ clientSideConfig.metaDataAttributes = this.commonMetaDataAttributes.concat(clientSideConfig.metaDataAttributes || []);
567
+ },
568
+ applyModifications: function applyModifications(serverSideConfig, clientSideConfig) {
569
+ _(this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
570
+ this.lintModification(modification, serverSideConfig.collectionName);
571
+ this.applyModification(clientSideConfig, modification);
572
+ }, this);
573
+ },
606
574
  lintModification: function lintModification(modification, collectionName) {
607
575
  var unmodifyableProperties = _.difference(_.keys(modification), this.modifyableProperties);
608
576
 
@@ -885,6 +853,8 @@ var WidgetTypes = Object$1.extend({
885
853
  }
886
854
  });
887
855
 
856
+ var state = window.pageflow || {};
857
+
888
858
  /**
889
859
  * Interface for engines providing editor extensions.
890
860
  * @alias editor
@@ -895,6 +865,7 @@ var EditorApi = Object$1.extend(
895
865
  {
896
866
  initialize: function initialize(options) {
897
867
  this.router = options && options.router;
868
+ this.entryType = {};
898
869
  this.sideBarRoutings = [];
899
870
  this.mainMenuItems = [];
900
871
  this.initializers = [];
@@ -964,6 +935,9 @@ var EditorApi = Object$1.extend(
964
935
  * Checks to see if the browser is supported.
965
936
  * @param {function} options.browserNotSupportedView
966
937
  * Backbone view that will be rendered if the browser is not supported.
938
+ * @param {boolean} [options.supportsExtendedFileRights]
939
+ * Offer additional inputs for files to specify source url, license and default
940
+ * display location.
967
941
  */
968
942
  registerEntryType: function registerEntryType(name, options) {
969
943
  this.entryType = _objectSpread2({
@@ -1107,10 +1081,12 @@ var EditorApi = Object$1.extend(
1107
1081
  * Trigger selection of the given file type with the given
1108
1082
  * handler. Payload hash is passed to selection handler as options.
1109
1083
  *
1110
- * @param {string|{name: string, filter: string}} fileType
1084
+ * @param {string|{name: string, filter: string}|{defaultTab: string, filter: string}} fileType
1111
1085
  * Either collection name of a file type or and object containing
1112
1086
  * the collection name a file type and a the name of a file type
1113
- * filter.
1087
+ * filter or an object containingn a defaultTab property that controls
1088
+ * which tab will visible initially, while allowing selecting files of
1089
+ * any type.
1114
1090
  *
1115
1091
  * @param {string} handlerName
1116
1092
  * The name of a handler registered via {@link
@@ -1136,7 +1112,7 @@ var EditorApi = Object$1.extend(
1136
1112
  };
1137
1113
  }
1138
1114
 
1139
- this.navigate('/files/' + fileType.name + '?handler=' + handlerName + '&payload=' + encodeURIComponent(JSON.stringify(payload)) + (fileType.filter ? '&filter=' + fileType.filter : ''), {
1115
+ this.navigate('/files/' + (fileType.defaultTab ? "".concat(fileType.defaultTab, ":default") : fileType.name) + '?handler=' + handlerName + '&payload=' + encodeURIComponent(JSON.stringify(payload)) + (fileType.filter ? '&filter=' + fileType.filter : ''), {
1140
1116
  trigger: true
1141
1117
  });
1142
1118
  },
@@ -3352,7 +3328,7 @@ var Entry = Backbone.Model.extend({
3352
3328
  },
3353
3329
  parse: function parse(response, options) {
3354
3330
  if (response) {
3355
- this.set(_.pick(response, 'published', 'published_until', 'password_protected'));
3331
+ this.set(_.pick(response, 'published', 'published_until', 'password_protected', 'last_published_with_noindex'));
3356
3332
 
3357
3333
  this._setFiles(response, {
3358
3334
  add: false,
@@ -3555,6 +3531,13 @@ var ForeignKeySubsetCollection = SubsetCollection.extend({
3555
3531
  var parent = options.parent;
3556
3532
  var parentModel = options.parentModel;
3557
3533
  this.autoConsolidatePositions = options.autoConsolidatePositions;
3534
+ this.listenTo(this, 'add', function (model) {
3535
+ if (options.parentReferenceAttribute) {
3536
+ model[options.parentReferenceAttribute] = parentModel;
3537
+ }
3538
+
3539
+ model.set(options.foreignKeyAttribute, parentModel.id);
3540
+ });
3558
3541
  SubsetCollection.prototype.constructor.call(this, {
3559
3542
  parent: parent,
3560
3543
  parentModel: parentModel,
@@ -3565,13 +3548,6 @@ var ForeignKeySubsetCollection = SubsetCollection.extend({
3565
3548
  return item.get('position');
3566
3549
  }
3567
3550
  });
3568
- this.listenTo(this, 'add', function (model) {
3569
- if (options.parentReferenceAttribute) {
3570
- model[options.parentReferenceAttribute] = parentModel;
3571
- }
3572
-
3573
- model.set(options.foreignKeyAttribute, parentModel.id);
3574
- });
3575
3551
  this.listenTo(parentModel, 'destroy dependentDestroy', function () {
3576
3552
  this.invoke('trigger', 'dependentDestroy');
3577
3553
  this.clear();
@@ -3824,7 +3800,65 @@ var SidebarRouter = Marionette.AppRouter.extend({
3824
3800
  }
3825
3801
  });
3826
3802
 
3827
- function template$3(data) {
3803
+ function _arrayWithHoles(arr) {
3804
+ if (Array.isArray(arr)) return arr;
3805
+ }
3806
+
3807
+ function _iterableToArrayLimit(arr, i) {
3808
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
3809
+ var _arr = [];
3810
+ var _n = true;
3811
+ var _d = false;
3812
+ var _e = undefined;
3813
+
3814
+ try {
3815
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3816
+ _arr.push(_s.value);
3817
+
3818
+ if (i && _arr.length === i) break;
3819
+ }
3820
+ } catch (err) {
3821
+ _d = true;
3822
+ _e = err;
3823
+ } finally {
3824
+ try {
3825
+ if (!_n && _i["return"] != null) _i["return"]();
3826
+ } finally {
3827
+ if (_d) throw _e;
3828
+ }
3829
+ }
3830
+
3831
+ return _arr;
3832
+ }
3833
+
3834
+ function _arrayLikeToArray(arr, len) {
3835
+ if (len == null || len > arr.length) len = arr.length;
3836
+
3837
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
3838
+ arr2[i] = arr[i];
3839
+ }
3840
+
3841
+ return arr2;
3842
+ }
3843
+
3844
+ function _unsupportedIterableToArray(o, minLen) {
3845
+ if (!o) return;
3846
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
3847
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3848
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3849
+ if (n === "Map" || n === "Set") return Array.from(n);
3850
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
3851
+ }
3852
+
3853
+ function _nonIterableRest() {
3854
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3855
+ }
3856
+
3857
+ function _slicedToArray(arr, i) {
3858
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
3859
+ }
3860
+
3861
+ function template$2(data) {
3828
3862
  var __t, __p = '';
3829
3863
  __p += '<a class="back">' +
3830
3864
  ((__t = ( I18n.t('pageflow.editor.templates.back_button_decorator.outline') )) == null ? '' : __t) +
@@ -3833,7 +3867,7 @@ return __p
3833
3867
  }
3834
3868
 
3835
3869
  var BackButtonDecoratorView = Marionette.Layout.extend({
3836
- template: template$3,
3870
+ template: template$2,
3837
3871
  className: 'back_button_decorator',
3838
3872
  events: {
3839
3873
  'click a.back': 'goBack'
@@ -3852,7 +3886,7 @@ var BackButtonDecoratorView = Marionette.Layout.extend({
3852
3886
  }
3853
3887
  });
3854
3888
 
3855
- function template$4(data) {
3889
+ function template$3(data) {
3856
3890
  var __t, __p = '';
3857
3891
  __p += '<input type="checkbox">\n<label class="file_name"></label>\n<span class="duration"></span>\n\n<div class="actions">\n <a class="remove" title="' +
3858
3892
  ((__t = ( I18n.t('pageflow.editor.templates.confirmable_file_item.remove') )) == null ? '' : __t) +
@@ -3862,7 +3896,7 @@ return __p
3862
3896
 
3863
3897
  var ConfirmableFileItemView = Marionette.ItemView.extend({
3864
3898
  tagName: 'li',
3865
- template: template$4,
3899
+ template: template$3,
3866
3900
  ui: {
3867
3901
  fileName: '.file_name',
3868
3902
  duration: '.duration',
@@ -3895,7 +3929,7 @@ var ConfirmableFileItemView = Marionette.ItemView.extend({
3895
3929
  }
3896
3930
  });
3897
3931
 
3898
- function template$5(data) {
3932
+ function template$4(data) {
3899
3933
  var __t, __p = '';
3900
3934
  __p += '<div class="blank_slate">\n <p>\n ' +
3901
3935
  ((__t = ( I18n.t('pageflow.editor.templates.confirm_encoding.all_released') )) == null ? '' : __t) +
@@ -3914,7 +3948,7 @@ return __p
3914
3948
  }
3915
3949
 
3916
3950
  var ConfirmEncodingView = Marionette.ItemView.extend({
3917
- template: template$5,
3951
+ template: template$4,
3918
3952
  className: 'confirm_encoding',
3919
3953
  ui: {
3920
3954
  blankSlate: '.blank_slate',
@@ -4068,7 +4102,7 @@ var failureIndicatingView = modelLifecycleTrackingView({
4068
4102
  }
4069
4103
  });
4070
4104
 
4071
- function template$6(data) {
4105
+ function template$5(data) {
4072
4106
  var __t, __p = '';
4073
4107
  __p += '<a class="close" href="#">' +
4074
4108
  ((__t = ( I18n.t('pageflow.editor.templates.edit_entry.close') )) == null ? '' : __t) +
@@ -4085,7 +4119,7 @@ return __p
4085
4119
  }
4086
4120
 
4087
4121
  var EditEntryView = Marionette.Layout.extend({
4088
- template: template$6,
4122
+ template: template$5,
4089
4123
  mixins: [failureIndicatingView, tooltipContainer],
4090
4124
  ui: {
4091
4125
  publishButton: 'a.publish',
@@ -4167,7 +4201,7 @@ var EditEntryView = Marionette.Layout.extend({
4167
4201
  }
4168
4202
  });
4169
4203
 
4170
- function template$7(data) {
4204
+ function template$6(data) {
4171
4205
  var __t, __p = '';
4172
4206
  __p += '<div class="widget_type">\n</div>\n<a class="settings" title="' +
4173
4207
  ((__t = ( I18n.t('pageflow.editor.templates.widget_item.settings') )) == null ? '' : __t) +
@@ -4176,7 +4210,7 @@ return __p
4176
4210
  }
4177
4211
 
4178
4212
  var WidgetItemView = Marionette.Layout.extend({
4179
- template: template$7,
4213
+ template: template$6,
4180
4214
  tagName: 'li',
4181
4215
  className: 'widget_item',
4182
4216
  regions: {
@@ -4213,14 +4247,14 @@ var WidgetItemView = Marionette.Layout.extend({
4213
4247
  }
4214
4248
  });
4215
4249
 
4216
- function template$8(data) {
4250
+ function template$7(data) {
4217
4251
  var __p = '';
4218
4252
  __p += '<ol class="widgets">\n</ol>\n';
4219
4253
  return __p
4220
4254
  }
4221
4255
 
4222
4256
  var EditWidgetsView = Marionette.Layout.extend({
4223
- template: template$8,
4257
+ template: template$7,
4224
4258
  ui: {
4225
4259
  widgets: '.widgets'
4226
4260
  },
@@ -4236,14 +4270,14 @@ var EditWidgetsView = Marionette.Layout.extend({
4236
4270
  }
4237
4271
  });
4238
4272
 
4239
- function template$9(data) {
4273
+ function template$8(data) {
4240
4274
  var __p = '';
4241
4275
  __p += '<div class="image"></div>\n<div class="label"></div>\n';
4242
4276
  return __p
4243
4277
  }
4244
4278
 
4245
4279
  var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
4246
- template: template$9,
4280
+ template: template$8,
4247
4281
  className: 'preview',
4248
4282
  modelEvents: {
4249
4283
  change: 'update'
@@ -4274,14 +4308,14 @@ var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
4274
4308
  }
4275
4309
  });
4276
4310
 
4277
- function template$a(data) {
4311
+ function template$9(data) {
4278
4312
  var __p = '';
4279
4313
  __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';
4280
4314
  return __p
4281
4315
  }
4282
4316
 
4283
4317
  var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
4284
- template: template$a,
4318
+ template: template$9,
4285
4319
  className: '',
4286
4320
  ui: {
4287
4321
  container: '.container',
@@ -4362,7 +4396,7 @@ var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
4362
4396
  }
4363
4397
  });
4364
4398
 
4365
- function template$b(data) {
4399
+ function template$a(data) {
4366
4400
  var __t, __p = '';
4367
4401
  __p += '<div class="box">\n <div class="content">\n <h2 class="dialog-header">' +
4368
4402
  ((__t = ( I18n.t('pageflow.editor.templates.background_positioning.title') )) == null ? '' : __t) +
@@ -4379,7 +4413,7 @@ return __p
4379
4413
  }
4380
4414
 
4381
4415
  var BackgroundPositioningView = Marionette.ItemView.extend({
4382
- template: template$b,
4416
+ template: template$a,
4383
4417
  className: 'background_positioning editor dialog',
4384
4418
  mixins: [dialogView],
4385
4419
  ui: {
@@ -4433,14 +4467,14 @@ BackgroundPositioningView.open = function (options) {
4433
4467
  app.dialogRegion.show(new BackgroundPositioningView(options));
4434
4468
  };
4435
4469
 
4436
- function template$c(data) {
4470
+ function template$b(data) {
4437
4471
  var __p = '';
4438
4472
  __p += '<div class="label"></div>\n<a href="#"></a>\n';
4439
4473
  return __p
4440
4474
  }
4441
4475
 
4442
4476
  var DropDownButtonItemView = Marionette.ItemView.extend({
4443
- template: template$c,
4477
+ template: template$b,
4444
4478
  tagName: 'li',
4445
4479
  className: 'drop_down_button_item',
4446
4480
  ui: {
@@ -4454,6 +4488,10 @@ var DropDownButtonItemView = Marionette.ItemView.extend({
4454
4488
  }
4455
4489
 
4456
4490
  event.preventDefault();
4491
+
4492
+ if (this.model.get('kind') === 'checkBox' || this.model.get('kind') === 'radio') {
4493
+ event.stopPropagation();
4494
+ }
4457
4495
  }
4458
4496
  },
4459
4497
  modelEvents: {
@@ -4473,7 +4511,11 @@ var DropDownButtonItemView = Marionette.ItemView.extend({
4473
4511
  this.ui.label.text(this.model.get('label'));
4474
4512
  this.$el.toggleClass('is_selectable', !!this.model.selected);
4475
4513
  this.$el.toggleClass('is_disabled', !!this.model.get('disabled'));
4514
+ this.$el.toggleClass('is_hidden', !!this.model.get('hidden'));
4515
+ this.$el.toggleClass('has_check_box', this.model.get('kind') === 'checkBox');
4516
+ this.$el.toggleClass('has_radio', this.model.get('kind') === 'radio');
4476
4517
  this.$el.toggleClass('is_checked', !!this.model.get('checked'));
4518
+ this.$el.toggleClass('separated', !!this.model.get('separated'));
4477
4519
  this.$el.data('name', this.model.get('name'));
4478
4520
  }
4479
4521
  });
@@ -4490,7 +4532,7 @@ var DropDownButtonItemListView = function DropDownButtonItemListView(options) {
4490
4532
  });
4491
4533
  };
4492
4534
 
4493
- function template$d(data) {
4535
+ function template$c(data) {
4494
4536
  var __p = '';
4495
4537
  __p += '<button></button>\n\n<div class="drop_down_button_menu">\n</div>\n';
4496
4538
  return __p
@@ -4514,6 +4556,13 @@ return __p
4514
4556
  * Require click to open menu. By default, menu opens on when the
4515
4557
  * mouse enters the button.
4516
4558
  *
4559
+ * @param {String} [options.alignMenu]
4560
+ * "right" to align menu on the right. Aligned on the left by
4561
+ * default.
4562
+ *
4563
+ * @param {String} [options.buttonClassName]
4564
+ * CSS class name for button element.
4565
+ *
4517
4566
  * ## Item Models
4518
4567
  *
4519
4568
  * The following model attributes can be used to control the
@@ -4532,7 +4581,7 @@ return __p
4532
4581
  */
4533
4582
 
4534
4583
  var DropDownButtonView = Marionette.ItemView.extend({
4535
- template: template$d,
4584
+ template: template$c,
4536
4585
  className: 'drop_down_button',
4537
4586
  ui: {
4538
4587
  button: '> button',
@@ -4553,7 +4602,9 @@ var DropDownButtonView = Marionette.ItemView.extend({
4553
4602
  this.$el.toggleClass('full_width', !!this.options.fullWidth);
4554
4603
  this.ui.button.toggleClass('has_icon_and_text', !!this.options.label);
4555
4604
  this.ui.button.toggleClass('has_icon_only', !this.options.label);
4605
+ this.ui.button.toggleClass('ellipsis_icon', !!this.options.ellipsisIcon);
4556
4606
  this.ui.button.text(this.options.label);
4607
+ this.ui.button.addClass(this.options.buttonClassName);
4557
4608
  this.ui.menu.append(this.subview(new DropDownButtonItemListView({
4558
4609
  items: this.options.items
4559
4610
  })).el);
@@ -4577,7 +4628,7 @@ var DropDownButtonView = Marionette.ItemView.extend({
4577
4628
  var offset = this.$el.offset();
4578
4629
  this.ui.menu.css({
4579
4630
  top: offset.top + this.$el.height(),
4580
- left: offset.left,
4631
+ left: this.options.alignMenu === 'right' ? offset.left + this.$el.width() - this.ui.menu.outerWidth() : offset.left,
4581
4632
  width: this.options.fullWidth ? this.$el.width() : null
4582
4633
  });
4583
4634
  },
@@ -4607,7 +4658,7 @@ var DropDownButtonView = Marionette.ItemView.extend({
4607
4658
  }
4608
4659
  });
4609
4660
 
4610
- function template$e(data) {
4661
+ function template$d(data) {
4611
4662
  var __p = '';
4612
4663
  __p += '<div class="pictogram"></div>\n';
4613
4664
  return __p
@@ -4615,7 +4666,7 @@ return __p
4615
4666
 
4616
4667
  var FileThumbnailView = Marionette.ItemView.extend({
4617
4668
  className: 'file_thumbnail',
4618
- template: template$e,
4669
+ template: template$d,
4619
4670
  modelEvents: {
4620
4671
  'change:state': 'update'
4621
4672
  },
@@ -4712,6 +4763,7 @@ var FileInputView = Marionette.ItemView.extend({
4712
4763
  if (dropDownMenuItems.length) {
4713
4764
  this.appendSubview(new DropDownButtonView({
4714
4765
  items: dropDownMenuItems,
4766
+ ellipsisIcon: true,
4715
4767
  openOnClick: true
4716
4768
  }));
4717
4769
  }
@@ -4756,15 +4808,7 @@ var FileInputView = Marionette.ItemView.extend({
4756
4808
 
4757
4809
  if (file) {
4758
4810
  _.each(this.options.dropDownMenuItems, function (item) {
4759
- items.add(new FileInputView.CustomMenuItem({
4760
- name: item.name,
4761
- label: item.label
4762
- }, {
4763
- inputModel: _this.model,
4764
- propertyName: _this.options.propertyName,
4765
- file: file,
4766
- selected: item.selected
4767
- }));
4811
+ items.add(_this._createCustomMenuItem(file, item));
4768
4812
  });
4769
4813
 
4770
4814
  items.add(new FileInputView.EditFileSettingsMenuItem({
@@ -4777,6 +4821,31 @@ var FileInputView = Marionette.ItemView.extend({
4777
4821
 
4778
4822
  return items;
4779
4823
  },
4824
+ _createCustomMenuItem: function _createCustomMenuItem(file, item) {
4825
+ var _this2 = this;
4826
+
4827
+ var options = {
4828
+ inputModel: this.model,
4829
+ propertyName: this.options.propertyName,
4830
+ file: file
4831
+ };
4832
+
4833
+ if (typeof item === 'function') {
4834
+ return new item({}, options);
4835
+ } else {
4836
+ return new FileInputView.CustomMenuItem({
4837
+ name: item.name,
4838
+ label: item.label,
4839
+ checked: item.checked,
4840
+ items: item.items && new Backbone.Collection(item.items.map(function (item) {
4841
+ return _this2._createCustomMenuItem(file, item);
4842
+ }))
4843
+ }, _objectSpread2(_objectSpread2({}, options), {}, {
4844
+ selected: item.selected,
4845
+ items: item.items
4846
+ }));
4847
+ }
4848
+ },
4780
4849
  _listenToNestedTextTrackFiles: function _listenToNestedTextTrackFiles(file) {
4781
4850
  if (this.textTrackFiles) {
4782
4851
  this.stopListening(this.textTrackFiles);
@@ -4851,6 +4920,7 @@ FileInputView.DefaultTextTrackFileMenuItem = Backbone.Model.extend({
4851
4920
  this.update();
4852
4921
  },
4853
4922
  update: function update() {
4923
+ this.set('kind', 'radio');
4854
4924
  this.set('checked', this.options.textTrackFile == this.getDefaultTextTrackFile());
4855
4925
  this.set('name', this.options.textTrackFile ? null : 'no_default_text_track');
4856
4926
  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'));
@@ -4867,14 +4937,14 @@ FileInputView.DefaultTextTrackFileMenuItem = Backbone.Model.extend({
4867
4937
  }
4868
4938
  });
4869
4939
 
4870
- function template$f(data) {
4940
+ function template$e(data) {
4871
4941
  var __p = '';
4872
4942
  __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';
4873
4943
  return __p
4874
4944
  }
4875
4945
 
4876
4946
  var LoadingView = Marionette.ItemView.extend({
4877
- template: template$f,
4947
+ template: template$e,
4878
4948
  className: 'loading',
4879
4949
  tagName: 'li'
4880
4950
  });
@@ -4897,7 +4967,7 @@ var selectableView = {
4897
4967
  }
4898
4968
  };
4899
4969
 
4900
- function template$g(data) {
4970
+ function template$f(data) {
4901
4971
  var __t, __p = '';
4902
4972
  __p += '<span class="theme_name"></span>\n<span class="button_or_checkmark">\n <p class="theme_in_use"></p>\n <a class="use_theme">' +
4903
4973
  ((__t = ( I18n.t('pageflow.editor.templates.theme.use') )) == null ? '' : __t) +
@@ -4907,7 +4977,7 @@ return __p
4907
4977
 
4908
4978
  var ThemeItemView = Marionette.ItemView.extend({
4909
4979
  tagName: 'li',
4910
- template: template$g,
4980
+ template: template$f,
4911
4981
  className: 'theme_item',
4912
4982
  mixins: [selectableView],
4913
4983
  selectionAttribute: 'theme',
@@ -4938,7 +5008,7 @@ var ThemeItemView = Marionette.ItemView.extend({
4938
5008
  }
4939
5009
  });
4940
5010
 
4941
- function template$h(data) {
5011
+ function template$g(data) {
4942
5012
  var __t, __p = '';
4943
5013
  __p += '<div class="box">\n <h1 class="dialog-header">\n ' +
4944
5014
  ((__t = ( I18n.t('pageflow.editor.templates.change_theme_dialog.header') )) == null ? '' : __t) +
@@ -4953,7 +5023,7 @@ return __p
4953
5023
  }
4954
5024
 
4955
5025
  var ChangeThemeDialogView = Marionette.ItemView.extend({
4956
- template: template$h,
5026
+ template: template$g,
4957
5027
  className: 'change_theme dialog editor',
4958
5028
  mixins: [dialogView],
4959
5029
  ui: {
@@ -5021,14 +5091,14 @@ ChangeThemeDialogView.changeTheme = function (options) {
5021
5091
  }).promise();
5022
5092
  };
5023
5093
 
5024
- function template$i(data) {
5094
+ function template$h(data) {
5025
5095
  var __p = '';
5026
5096
  __p += '\n';
5027
5097
  return __p
5028
5098
  }
5029
5099
 
5030
5100
  var StaticThumbnailView = Marionette.ItemView.extend({
5031
- template: template$i,
5101
+ template: template$h,
5032
5102
  className: 'static_thumbnail',
5033
5103
  modelEvents: {
5034
5104
  'change:configuration': 'update'
@@ -5092,7 +5162,7 @@ var ModelThumbnailView = Marionette.View.extend({
5092
5162
  }
5093
5163
  });
5094
5164
 
5095
- function template$j(data) {
5165
+ function template$i(data) {
5096
5166
  var __p = '';
5097
5167
  __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';
5098
5168
  return __p
@@ -5108,7 +5178,7 @@ var ReferenceInputView = Marionette.ItemView.extend(
5108
5178
  /** @lends ReferenceInputView.prototype */
5109
5179
  {
5110
5180
  mixins: [inputView],
5111
- template: template$j,
5181
+ template: template$i,
5112
5182
  className: 'reference_input',
5113
5183
  ui: {
5114
5184
  title: '.title',
@@ -5207,7 +5277,7 @@ var ThemeInputView = ReferenceInputView.extend({
5207
5277
  }
5208
5278
  });
5209
5279
 
5210
- function template$k(data) {
5280
+ function template$j(data) {
5211
5281
  var __t, __p = '';
5212
5282
  __p += '<a class="back">' +
5213
5283
  ((__t = ( I18n.t('pageflow.editor.templates.edit_meta_data.outline') )) == null ? '' : __t) +
@@ -5220,7 +5290,7 @@ return __p
5220
5290
  }
5221
5291
 
5222
5292
  var EditMetaDataView = Marionette.Layout.extend({
5223
- template: template$k,
5293
+ template: template$j,
5224
5294
  className: 'edit_meta_data',
5225
5295
  mixins: [failureIndicatingView],
5226
5296
  regions: {
@@ -5320,7 +5390,7 @@ var EditMetaDataView = Marionette.Layout.extend({
5320
5390
  }
5321
5391
  });
5322
5392
 
5323
- function template$l(data) {
5393
+ function template$k(data) {
5324
5394
  var __t, __p = '';
5325
5395
  __p += '<a class="back">' +
5326
5396
  ((__t = ( I18n.t('pageflow.editor.templates.edit_widget.back') )) == null ? '' : __t) +
@@ -5329,7 +5399,7 @@ return __p
5329
5399
  }
5330
5400
 
5331
5401
  var EditWidgetView = Marionette.ItemView.extend({
5332
- template: template$l,
5402
+ template: template$k,
5333
5403
  className: 'edit_widget',
5334
5404
  events: {
5335
5405
  'click a.back': function clickABack() {
@@ -5361,7 +5431,7 @@ var loadable = modelLifecycleTrackingView({
5361
5431
  }
5362
5432
  });
5363
5433
 
5364
- function template$m(data) {
5434
+ function template$l(data) {
5365
5435
  var __p = '';
5366
5436
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n';
5367
5437
  return __p
@@ -5369,7 +5439,7 @@ return __p
5369
5439
 
5370
5440
  var ExplorerFileItemView = Marionette.ItemView.extend({
5371
5441
  tagName: 'li',
5372
- template: template$m,
5442
+ template: template$l,
5373
5443
  mixins: [loadable, selectableView],
5374
5444
  selectionAttribute: 'file',
5375
5445
  ui: {
@@ -5406,14 +5476,14 @@ var ExplorerFileItemView = Marionette.ItemView.extend({
5406
5476
  }
5407
5477
  });
5408
5478
 
5409
- function template$n(data) {
5479
+ function template$m(data) {
5410
5480
  var __p = '';
5411
5481
  __p += '<a href="">\n <span class="title"></span>\n</a>\n';
5412
5482
  return __p
5413
5483
  }
5414
5484
 
5415
5485
  var OtherEntryItemView = Marionette.ItemView.extend({
5416
- template: template$n,
5486
+ template: template$m,
5417
5487
  className: 'other_entry_item',
5418
5488
  tagName: 'li',
5419
5489
  mixins: [selectableView],
@@ -5428,7 +5498,7 @@ var OtherEntryItemView = Marionette.ItemView.extend({
5428
5498
  }
5429
5499
  });
5430
5500
 
5431
- function template$o(data) {
5501
+ function template$n(data) {
5432
5502
  var __t, __p = '';
5433
5503
  __p +=
5434
5504
  ((__t = ( I18n.t('pageflow.editor.templates.other_entries_blank_slate.none_available') )) == null ? '' : __t) +
@@ -5454,7 +5524,7 @@ var OtherEntriesCollectionView = Marionette.View.extend({
5454
5524
  selection: this.options.selection
5455
5525
  },
5456
5526
  blankSlateViewConstructor: Marionette.ItemView.extend({
5457
- template: template$o,
5527
+ template: template$n,
5458
5528
  tagName: 'li',
5459
5529
  className: 'blank_slate'
5460
5530
  }),
@@ -5465,7 +5535,7 @@ var OtherEntriesCollectionView = Marionette.View.extend({
5465
5535
  }
5466
5536
  });
5467
5537
 
5468
- function template$p(data) {
5538
+ function template$o(data) {
5469
5539
  var __t, __p = '';
5470
5540
  __p += '<div class="box">\n <h1 class="dialog-header">\n ' +
5471
5541
  ((__t = ( I18n.t('pageflow.editor.templates.files_explorer.reuse_files') )) == null ? '' : __t) +
@@ -5494,7 +5564,7 @@ return __p
5494
5564
  }
5495
5565
 
5496
5566
  var FilesExplorerView = Marionette.ItemView.extend({
5497
- template: template$p,
5567
+ template: template$o,
5498
5568
  className: 'files_explorer editor dialog',
5499
5569
  mixins: [dialogView],
5500
5570
  ui: {
@@ -5581,7 +5651,7 @@ FilesExplorerView.open = function (options) {
5581
5651
  app.dialogRegion.show(new FilesExplorerView(options));
5582
5652
  };
5583
5653
 
5584
- function template$q(data) {
5654
+ function template$p(data) {
5585
5655
  var __p = '';
5586
5656
  __p += '<th></th>\n<td></td>';
5587
5657
  return __p
@@ -5589,17 +5659,18 @@ return __p
5589
5659
 
5590
5660
  var FileMetaDataItemView = Marionette.ItemView.extend({
5591
5661
  tagName: 'tr',
5592
- template: template$q,
5662
+ template: template$p,
5593
5663
  ui: {
5594
5664
  label: 'th',
5595
5665
  value: 'td'
5596
5666
  },
5597
5667
  onRender: function onRender() {
5598
- this.subview(new this.options.valueView(_.extend({
5599
- el: this.ui.value,
5668
+ this.appendSubview(new this.options.valueView(_.extend({
5600
5669
  model: this.model,
5601
5670
  name: this.options.name
5602
- }, this.options.valueViewOptions || {})));
5671
+ }, this.options.valueViewOptions || {})), {
5672
+ to: this.ui.value
5673
+ });
5603
5674
  this.ui.label.text(this.labelText());
5604
5675
  },
5605
5676
  labelText: function labelText() {
@@ -5611,7 +5682,7 @@ var FileMetaDataItemView = Marionette.ItemView.extend({
5611
5682
  }
5612
5683
  });
5613
5684
 
5614
- function template$r(data) {
5685
+ function template$q(data) {
5615
5686
  var __p = '';
5616
5687
  __p += '<p class="percent"></p>\n<p class="description"></p>\n<p class="error_message"></p>';
5617
5688
  return __p
@@ -5620,7 +5691,7 @@ return __p
5620
5691
  var FileStageItemView = Marionette.ItemView.extend({
5621
5692
  tagName: 'li',
5622
5693
  className: 'file_stage_item',
5623
- template: template$r,
5694
+ template: template$q,
5624
5695
  ui: {
5625
5696
  description: '.description',
5626
5697
  percent: '.percent',
@@ -5661,7 +5732,7 @@ var FileStageItemView = Marionette.ItemView.extend({
5661
5732
  }
5662
5733
  });
5663
5734
 
5664
- function template$s(data) {
5735
+ function template$r(data) {
5665
5736
  var __t, __p = '';
5666
5737
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n<a class="select">' +
5667
5738
  ((__t = ( I18n.t('pageflow.editor.templates.file_item.select') )) == null ? '' : __t) +
@@ -5685,7 +5756,7 @@ return __p
5685
5756
 
5686
5757
  var FileItemView = Marionette.ItemView.extend({
5687
5758
  tagName: 'li',
5688
- template: template$s,
5759
+ template: template$r,
5689
5760
  mixins: [loadable],
5690
5761
  ui: {
5691
5762
  fileName: '.file_name',
@@ -5800,7 +5871,7 @@ var FileItemView = Marionette.ItemView.extend({
5800
5871
  }
5801
5872
  });
5802
5873
 
5803
- function template$t(data) {
5874
+ function template$s(data) {
5804
5875
  var __t, __p = '';
5805
5876
  __p += '<div class="filtered_files-banner">\n <span class="filtered_files-banner_prefix">\n ' +
5806
5877
  ((__t = ( I18n.t('pageflow.editor.views.filtered_files_view.banner_prefix') )) == null ? '' : __t) +
@@ -5819,7 +5890,7 @@ return __p
5819
5890
  }
5820
5891
 
5821
5892
  var FilteredFilesView = Marionette.ItemView.extend({
5822
- template: template$t,
5893
+ template: template$s,
5823
5894
  className: 'filtered_files',
5824
5895
  ui: {
5825
5896
  banner: '.filtered_files-banner',
@@ -5883,7 +5954,7 @@ var FilteredFilesView = Marionette.ItemView.extend({
5883
5954
  }
5884
5955
  });
5885
5956
 
5886
- function template$u(data) {
5957
+ function template$t(data) {
5887
5958
  var __t, __p = '';
5888
5959
  __p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
5889
5960
  ((__t = ( I18n.t('pageflow.editor.views.files_view.importer.heading') )) == null ? '' : __t) +
@@ -5893,7 +5964,7 @@ __p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
5893
5964
  return __p
5894
5965
  }
5895
5966
 
5896
- function template$v(data) {
5967
+ function template$u(data) {
5897
5968
  var __t, __p = '';
5898
5969
  __p += '<button class=\'importer\' data-key=\'' +
5899
5970
  ((__t = ( data.fileImporter.key )) == null ? '' : __t) +
@@ -5908,7 +5979,7 @@ return __p
5908
5979
  }
5909
5980
 
5910
5981
  var ImporterSelectView = Marionette.ItemView.extend({
5911
- template: template$v,
5982
+ template: template$u,
5912
5983
  className: 'importer_select',
5913
5984
  tagName: 'li',
5914
5985
  events: {
@@ -5925,7 +5996,7 @@ var ImporterSelectView = Marionette.ItemView.extend({
5925
5996
  });
5926
5997
 
5927
5998
  var ChooseImporterView = Marionette.ItemView.extend({
5928
- template: template$u,
5999
+ template: template$t,
5929
6000
  className: 'choose_importer editor dialog',
5930
6001
  mixins: [dialogView],
5931
6002
  ui: {
@@ -5960,7 +6031,7 @@ ChooseImporterView.open = function (options) {
5960
6031
  app.dialogRegion.show(new ChooseImporterView(options).render());
5961
6032
  };
5962
6033
 
5963
- function template$w(data) {
6034
+ function template$v(data) {
5964
6035
  var __t, __p = '';
5965
6036
  __p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
5966
6037
  ((__t = ( I18n.t('pageflow.editor.file_importers.'+data.importerKey+'.dialog_label') )) == null ? '' : __t) +
@@ -5974,7 +6045,7 @@ __p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
5974
6045
  return __p
5975
6046
  }
5976
6047
 
5977
- function template$x(data) {
6048
+ function template$w(data) {
5978
6049
  var __t, __p = '';
5979
6050
  __p += '<div class="box">\n <h1 class="dialog-header">' +
5980
6051
  ((__t = ( I18n.t('pageflow.editor.templates.confirm_upload.header') )) == null ? '' : __t) +
@@ -5990,6 +6061,73 @@ __p += '<div class="box">\n <h1 class="dialog-header">' +
5990
6061
  return __p
5991
6062
  }
5992
6063
 
6064
+ function template$x(data) {
6065
+ var __p = '';
6066
+ __p += '';
6067
+ return __p
6068
+ }
6069
+
6070
+ var EditFileView = Marionette.ItemView.extend({
6071
+ template: template$x,
6072
+ className: 'edit_file',
6073
+ onRender: function onRender() {
6074
+ var fileType = this.model.fileType();
6075
+ var entry = this.options.entry || state.entry;
6076
+ var tab = new ConfigurationEditorTabView({
6077
+ model: this.model.configuration,
6078
+ attributeTranslationKeyPrefixes: ['pageflow.editor.files.attributes.' + fileType.collectionName, 'pageflow.editor.files.common_attributes', 'pageflow.editor.nested_files.' + fileType.collectionName, 'pageflow.editor.nested_files.common_attributes']
6079
+ });
6080
+
6081
+ if (this.options.displayFileName) {
6082
+ tab.input('file_name', TextInputView, {
6083
+ model: this.model,
6084
+ disabled: true
6085
+ });
6086
+ }
6087
+
6088
+ tab.input('rights', TextInputView, {
6089
+ model: this.model,
6090
+ placeholder: entry.get('default_file_rights')
6091
+ });
6092
+
6093
+ if (editor.entryType.supportsExtendedFileRights && !fileType.noExtendedFileRights) {
6094
+ tab.input('source_url', TextInputView);
6095
+ tab.input('license', SelectInputView, {
6096
+ includeBlank: true,
6097
+ blankTranslationKey: 'pageflow.editor.files.common_attributes.license.blank',
6098
+ values: state.config.availableFileLicenses,
6099
+ texts: state.config.availableFileLicenses.map(function (name) {
6100
+ return I18n$1.t("pageflow.file_licenses.".concat(name, ".name"));
6101
+ })
6102
+ });
6103
+ tab.input('rights_display', SelectInputView, {
6104
+ values: ['credits', 'inline']
6105
+ });
6106
+ }
6107
+
6108
+ tab.view(SeparatorView);
6109
+
6110
+ _(this.fileTypeInputs()).each(function (options) {
6111
+ tab.input(options.name, options.inputView, options.inputViewOptions);
6112
+ });
6113
+
6114
+ tab.input('original_url', UrlDisplayView, {
6115
+ model: this.model
6116
+ });
6117
+ this.appendSubview(tab);
6118
+ },
6119
+ fileTypeInputs: function fileTypeInputs() {
6120
+ var fileType = this.model.fileType();
6121
+ return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
6122
+ if (_.isFunction(inputs)) {
6123
+ return inputs(this.model);
6124
+ } else {
6125
+ return inputs;
6126
+ }
6127
+ }, this).flatten().value();
6128
+ }
6129
+ });
6130
+
5993
6131
  var UploadableFilesView = Marionette.View.extend({
5994
6132
  className: 'uploadable_files',
5995
6133
  initialize: function initialize() {
@@ -6036,7 +6174,7 @@ var UploadableFilesView = Marionette.View.extend({
6036
6174
  });
6037
6175
 
6038
6176
  var ConfirmFileImportUploadView = Marionette.Layout.extend({
6039
- template: template$x,
6177
+ template: template$w,
6040
6178
  className: 'confirm_upload editor dialog',
6041
6179
  mixins: [dialogView],
6042
6180
  regions: {
@@ -6106,7 +6244,7 @@ ConfirmFileImportUploadView.open = function (options) {
6106
6244
  };
6107
6245
 
6108
6246
  var FilesImporterView = Marionette.ItemView.extend({
6109
- template: template$w,
6247
+ template: template$v,
6110
6248
  className: 'files_importer editor dialog',
6111
6249
  mixins: [dialogView],
6112
6250
  ui: {
@@ -6164,7 +6302,10 @@ var FilesImporterView = Marionette.ItemView.extend({
6164
6302
  content_type: file.type,
6165
6303
  file_size: -1,
6166
6304
  rights: file.rights,
6167
- source_url: file.url
6305
+ source_url: file.url,
6306
+ configuration: {
6307
+ source_url: file.source_url
6308
+ }
6168
6309
  }, {
6169
6310
  fileType: fileType
6170
6311
  });
@@ -6302,7 +6443,7 @@ var FilesView = Marionette.ItemView.extend({
6302
6443
  this.$el.append(this.subview(this.tabsView).el);
6303
6444
  },
6304
6445
  tab: function tab(fileType) {
6305
- var selectionMode = this.options.tabName === fileType.collectionName;
6446
+ var selectionMode = this.options.allowSelectingAny || this.options.tabName === fileType.collectionName;
6306
6447
  this.tabsView.tab(fileType.collectionName, _.bind(function () {
6307
6448
  return this.subview(new FilteredFilesView({
6308
6449
  entry: state.entry,
@@ -6401,7 +6542,11 @@ __p += '<div class="files_pending notice">\n <p>' +
6401
6542
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.date') )) == null ? '' : __t) +
6402
6543
  '\n <input type="text" name="publish_until">\n </label>\n\n <label>\n ' +
6403
6544
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.time') )) == null ? '' : __t) +
6404
- '\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 ' +
6545
+ '\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 ' +
6546
+ ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.noindex') )) == null ? '' : __t) +
6547
+ '\n </span>\n <span class="inline_help">\n ' +
6548
+ ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.noindex_help') )) == null ? '' : __t) +
6549
+ '\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 ' +
6405
6550
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.password_protected') )) == null ? '' : __t) +
6406
6551
  '\n </span>\n <span class="inline_help">\n ' +
6407
6552
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.password_help') )) == null ? '' : __t) +
@@ -6438,6 +6583,7 @@ var PublishEntryView = Marionette.ItemView.extend({
6438
6583
  passwordFields: '.password_fields',
6439
6584
  userNameField: 'input[name=user_name]',
6440
6585
  passwordField: 'input[name=password]',
6586
+ noindexCheckBox: 'input[name=noindex]',
6441
6587
  alreadyPublishedWithPassword: '.already_published_with_password',
6442
6588
  previouslyPublishedWithPassword: '.previously_published_with_password',
6443
6589
  alreadyPublishedWithoutPassword: '.already_published_without_password',
@@ -6488,10 +6634,10 @@ var PublishEntryView = Marionette.ItemView.extend({
6488
6634
  this.ui.publishUntilField.datepicker('setDate', publishedUntil);
6489
6635
  this.ui.publishUntilTimeField.val(timeStr(publishedUntil));
6490
6636
  } else {
6491
- this.ui.publishUntilField.datepicker('setDate', oneYearFromNow());
6637
+ this.ui.publishUntilField.datepicker('setDate', this.defaultPublishedUntilDate());
6492
6638
  }
6493
6639
 
6494
- this.ui.userNameField.val(state.account.get('name'));
6640
+ this.ui.userNameField.val(this.options.account.get('name'));
6495
6641
 
6496
6642
  if (this.model.get('password_protected')) {
6497
6643
  this.ui.passwordProtectedCheckBox.prop('checked', true);
@@ -6500,6 +6646,7 @@ var PublishEntryView = Marionette.ItemView.extend({
6500
6646
  this.ui.passwordField.val(this.randomPassword());
6501
6647
  }
6502
6648
 
6649
+ this.ui.noindexCheckBox.prop('checked', this.model.get('last_published_with_noindex'));
6503
6650
  this.ui.alreadyPublishedWithPassword.toggle(this.model.get('published') && this.model.get('password_protected'));
6504
6651
  this.ui.previouslyPublishedWithPassword.toggle(!this.model.get('published') && this.model.get('password_protected'));
6505
6652
  this.ui.alreadyPublishedWithoutPassword.toggle(this.model.get('published') && !this.model.get('password_protected')); // Helpers
@@ -6511,12 +6658,6 @@ var PublishEntryView = Marionette.ItemView.extend({
6511
6658
  return ("0" + val).slice(-2);
6512
6659
  }
6513
6660
  }
6514
-
6515
- function oneYearFromNow() {
6516
- var date = new Date();
6517
- date.setFullYear(date.getFullYear() + 1);
6518
- return date;
6519
- }
6520
6661
  },
6521
6662
  save: function save() {
6522
6663
  var publishedUntil = null;
@@ -6546,7 +6687,8 @@ var PublishEntryView = Marionette.ItemView.extend({
6546
6687
  this.options.entryPublication.publish({
6547
6688
  published_until: publishedUntil,
6548
6689
  password_protected: this.ui.passwordProtectedCheckBox.is(':checked'),
6549
- password: this.ui.passwordField.val()
6690
+ password: this.ui.passwordField.val(),
6691
+ noindex: this.ui.noindexCheckBox.is(':checked')
6550
6692
  }).fail(function () {
6551
6693
  alert('Beim Veröffentlichen ist ein Fehler aufgetreten');
6552
6694
  }).always(function () {
@@ -6591,6 +6733,11 @@ var PublishEntryView = Marionette.ItemView.extend({
6591
6733
  return false;
6592
6734
  }
6593
6735
  },
6736
+ defaultPublishedUntilDate: function defaultPublishedUntilDate() {
6737
+ var date = new Date();
6738
+ date.setMonth(date.getMonth() + this.options.config.defaultPublishedUntilDurationInMonths);
6739
+ return date;
6740
+ },
6594
6741
  enableSave: function enableSave() {
6595
6742
  this.ui.saveButton.removeAttr('disabled');
6596
6743
  },
@@ -6690,10 +6837,16 @@ var SidebarController = Marionette.Controller.extend({
6690
6837
  }));
6691
6838
  },
6692
6839
  files: function files(collectionName, handler, payload, filterName) {
6840
+ var _split = (collectionName || '').split(':'),
6841
+ _split2 = _slicedToArray(_split, 2),
6842
+ tabName = _split2[0],
6843
+ suffix = _split2[1];
6844
+
6693
6845
  this.region.show(new FilesView({
6694
6846
  model: this.entry,
6695
6847
  selectionHandler: handler && editor.createFileSelectionHandler(handler, payload),
6696
- tabName: collectionName,
6848
+ tabName: tabName,
6849
+ allowSelectingAny: suffix === 'default',
6697
6850
  filterName: filterName
6698
6851
  }));
6699
6852
  editor.setDefaultHelpEntry('pageflow.help_entries.files');
@@ -6720,7 +6873,9 @@ var SidebarController = Marionette.Controller.extend({
6720
6873
  publish: function publish() {
6721
6874
  this.region.show(PublishEntryView.create({
6722
6875
  model: this.entry,
6723
- entryPublication: new EntryPublication()
6876
+ account: state.account,
6877
+ entryPublication: new EntryPublication(),
6878
+ config: state.config
6724
6879
  }));
6725
6880
  editor.setDefaultHelpEntry('pageflow.help_entries.publish');
6726
6881
  },
@@ -7090,7 +7245,15 @@ var HelpImageView = Marionette.View.extend({
7090
7245
 
7091
7246
  var InfoBoxView = Marionette.View.extend({
7092
7247
  className: 'info_box',
7248
+ mixins: [attributeBinding],
7249
+ initialize: function initialize() {
7250
+ this.setupBooleanAttributeBinding('visible', this.updateVisible);
7251
+ },
7252
+ updateVisible: function updateVisible() {
7253
+ this.$el.toggleClass('hidden_via_binding', this.getBooleanAttributBoundOption('visible') === false);
7254
+ },
7093
7255
  render: function render() {
7256
+ this.$el.addClass(this.options.level);
7094
7257
  this.$el.html(this.options.text);
7095
7258
  return this;
7096
7259
  }
@@ -7706,7 +7869,7 @@ var ListView = Marionette.ItemView.extend({
7706
7869
  });
7707
7870
 
7708
7871
  var ConfirmUploadView = Marionette.Layout.extend({
7709
- template: template$x,
7872
+ template: template$w,
7710
7873
  className: 'confirm_upload editor dialog',
7711
7874
  mixins: [dialogView],
7712
7875
  regions: {
@@ -8006,7 +8169,60 @@ app.addInitializer(function () {
8006
8169
  });
8007
8170
  });
8008
8171
 
8172
+ function _arrayWithoutHoles(arr) {
8173
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
8174
+ }
8175
+
8176
+ function _iterableToArray(iter) {
8177
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
8178
+ }
8179
+
8180
+ function _nonIterableSpread() {
8181
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8182
+ }
8183
+
8184
+ function _toConsumableArray(arr) {
8185
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
8186
+ }
8187
+
8188
+ var OtherFile = UploadableFile.extend({
8189
+ thumbnailPictogram: 'other'
8190
+ });
8191
+
8009
8192
  app.addInitializer(function (options) {
8193
+ editor.fileTypes.commonMetaDataAttributes = [{
8194
+ name: 'rights',
8195
+ valueView: TextFileMetaDataItemValueView,
8196
+ valueViewOptions: {
8197
+ settingsDialogTabLink: 'general'
8198
+ }
8199
+ }];
8200
+
8201
+ if (editor.entryType.supportsExtendedFileRights) {
8202
+ editor.fileTypes.commonMetaDataAttributes = [].concat(_toConsumableArray(editor.fileTypes.commonMetaDataAttributes), [{
8203
+ name: 'source_url',
8204
+ valueView: TextFileMetaDataItemValueView,
8205
+ valueViewOptions: {
8206
+ fromConfiguration: true,
8207
+ settingsDialogTabLink: 'general'
8208
+ }
8209
+ }, {
8210
+ name: 'license',
8211
+ valueView: TextFileMetaDataItemValueView,
8212
+ valueViewOptions: {
8213
+ fromConfiguration: true,
8214
+ formatValue: function formatValue(value) {
8215
+ return I18n$1.t("pageflow.file_licenses.".concat(value, ".name"));
8216
+ },
8217
+ settingsDialogTabLink: 'general'
8218
+ }
8219
+ }]);
8220
+ }
8221
+
8222
+ editor.fileTypes.commonSettingsDialogTabs = [{
8223
+ name: 'general',
8224
+ view: EditFileView
8225
+ }];
8010
8226
  var textTracksMetaDataAttribute = {
8011
8227
  name: 'text_tracks',
8012
8228
  valueView: TextTracksFileMetaDataItemValueView,
@@ -8066,6 +8282,7 @@ app.addInitializer(function (options) {
8066
8282
  return upload.name.match(/\.vtt$/) || upload.name.match(/\.srt$/);
8067
8283
  },
8068
8284
  skipUploadConfirmation: true,
8285
+ noExtendedFileRights: true,
8069
8286
  configurationEditorInputs: [{
8070
8287
  name: 'label',
8071
8288
  inputView: TextInputView,
@@ -8115,6 +8332,18 @@ app.addInitializer(function (options) {
8115
8332
  binding: 'label'
8116
8333
  }
8117
8334
  });
8335
+ editor.fileTypes.register('other_files', {
8336
+ model: OtherFile,
8337
+ metaDataAttributes: [altMetaDataAttribute],
8338
+ matchUpload: function matchUpload() {
8339
+ return true;
8340
+ },
8341
+ priority: 100,
8342
+ configurationEditorInputs: [{
8343
+ name: 'alt',
8344
+ inputView: TextInputView
8345
+ }]
8346
+ });
8118
8347
  editor.fileTypes.setup(options.config.fileTypes);
8119
8348
  });
8120
8349