scrivito_content_browser 1.4.3 → 1.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2e230129305a9e23863747094f862d0465c168c
4
- data.tar.gz: 20fd1f06685c67b4633027f8946c21ac5cf7d6a7
3
+ metadata.gz: 3d953dddb23d78433151e47a2f31e7ec82d46b31
4
+ data.tar.gz: 38e777d29ecb7490b4051adc442d1970cf7735fb
5
5
  SHA512:
6
- metadata.gz: 70a02e727931bb2a704c28aac4a084360349eadb161e29579f776a065b8b03d6950bbb0aecfe360841617e017fd76061462294a9080d79883c9c6ec1ee89ccf5
7
- data.tar.gz: 0b1218fffef74201e169f0068d6f71f5005c90caba00da7bcf7fbcca0211525caf7a1b183cd5f01bc2a816f62f33c18626f8cca62470fd04fc100742e09eeda0
6
+ metadata.gz: 50a90e1c10b74ee23bb0c1bccb849de42294ebebf243b4657a90e475fb69ca45602031635d20342470474e7c92aa27251f250e13b5c5eb55f13db1274c14e2cc
7
+ data.tar.gz: 7a1475ea59b2c320c01d38e45ebe64491559efaed8e038b42c69fbbb6326781be557b93c82cbbfb5650af21f3b2c933bb575757fdbe21b53aa114e64b132631a
@@ -189,9 +189,11 @@
189
189
  };
190
190
  })();
191
191
 
192
- scrivito.register_public_api("content_browser", scrivito.content_browser);
192
+ scrivito.registerPublicApi("content_browser", function() {
193
+ return scrivito.content_browser;
194
+ });
193
195
 
194
- scrivito.register_browse_content(function() {
196
+ scrivito.registerBrowseContent(function() {
195
197
  return scrivito.content_browser.open({
196
198
  selection_mode: 'single',
197
199
  standAlone: true
@@ -3755,7 +3757,6 @@
3755
3757
  'content_browser.last_added.failed_upload_counts': '$1 Error(s)',
3756
3758
  'content_browser.last_added.title_info': 'Display full upload error message',
3757
3759
  'content_browser.last_added.upload_error': 'The selected filter options cannot be applied to the file(s) you wanted to upload',
3758
- 'content_browser.last_added.forbidden_upload': 'You cannot upload files here. Please select a suitable filter.',
3759
3760
  'content_browser.last_added.preset_error': "#values can not be called on an invalid Preset",
3760
3761
  'content_browser.filter.more_filters': 'more filters',
3761
3762
  'content_browser.filter.selected_filter': 'Selected',
@@ -3800,7 +3801,6 @@
3800
3801
  'content_browser.last_added.failed_upload_counts': '$1 Fehler',
3801
3802
  'content_browser.last_added.title_info': 'Vollständige Fehlermeldung anzeigen',
3802
3803
  'content_browser.last_added.upload_error': 'Die ausgewählten Filteroptionen können nicht auf die Datei(en) angewendet werden, die Sie hochladen wollten.',
3803
- 'content_browser.last_added.forbidden_upload': 'Sie können keine Dateien hierher hochladen. Bitte wählen Sie einen passenden Filter.',
3804
3804
  'content_browser.last_added.preset_error': "#values kann nicht auf einer ungültigen Vorbelegung aufgerufen werden.",
3805
3805
  'content_browser.filter.more_filters': 'Weitere Filter',
3806
3806
  'content_browser.filter.selected_filter': 'Ausgewählt',
@@ -22624,7 +22624,11 @@
22624
22624
  };
22625
22625
 
22626
22626
  ActiveNodeConfig.prototype._valueForNode = function(node) {
22627
- return node.value || node.name;
22627
+ if (node.value === void 0) {
22628
+ return node.name;
22629
+ } else {
22630
+ return node.value;
22631
+ }
22628
22632
  };
22629
22633
 
22630
22634
  ActiveNodeConfig.prototype._findConfig = function(attrName) {
@@ -23439,10 +23443,10 @@
23439
23443
  var className;
23440
23444
  className = this.baseItemsClass();
23441
23445
  if (this.state.dragInProgress) {
23442
- if (this.props.lastAdded.isVisible || !this.props.editingView) {
23443
- className += " uploader-drag-over-forbiden";
23444
- } else {
23446
+ if (this.props.editingView) {
23445
23447
  className += " uploader-drag-over";
23448
+ } else {
23449
+ className += " uploader-drag-over-forbiden";
23446
23450
  }
23447
23451
  }
23448
23452
  return className;
@@ -23481,35 +23485,35 @@
23481
23485
  _obj_class: objClass
23482
23486
  };
23483
23487
  },
23484
- uploadFiles: function(event) {
23485
- var dataTransfer, files, preset;
23488
+ handleFileDrop: function(event) {
23489
+ var files, _ref1;
23486
23490
  this.changeDragState(false)(event);
23487
- if (this.props.lastAdded.isVisible || !this.props.editingView) {
23488
- return;
23489
- }
23490
- dataTransfer = event.dataTransfer;
23491
- if (dataTransfer == null) {
23492
- return;
23493
- }
23494
- files = dataTransfer.files;
23495
- if (files.length > 0) {
23496
- preset = this.buildPreset();
23497
- if (preset.isValid()) {
23498
- this.props.disableTags();
23499
- return _.each(files, (function(_this) {
23500
- return function(file) {
23501
- var attributes;
23502
- attributes = _this._fileAttributes(file);
23503
- _this.props.createObj(attributes, _this.props.basePreset, preset.values(), _this.props.tags.activeTags);
23504
- return _this.props.filter.deselectHierarchicalFilters();
23505
- };
23506
- })(this));
23507
- } else {
23508
- return this._showConflictingPresetsAlert(preset.errors());
23509
- }
23491
+ files = (_ref1 = event.dataTransfer) != null ? _ref1.files : void 0;
23492
+ if (this.props.editingView && (files != null ? files.length : void 0)) {
23493
+ return this._uploadFiles(files);
23494
+ }
23495
+ },
23496
+ _uploadFiles: function(files) {
23497
+ var preset;
23498
+ preset = this._buildPreset();
23499
+ if (preset.isValid()) {
23500
+ this.props.disableTags();
23501
+ _.each(files, (function(_this) {
23502
+ return function(file) {
23503
+ return _this._uploadFile(file, preset);
23504
+ };
23505
+ })(this));
23506
+ return this.props.filter.deselectHierarchicalFilters();
23507
+ } else {
23508
+ return this._showConflictingPresetsAlert(preset.errors());
23510
23509
  }
23511
23510
  },
23512
- buildPreset: function() {
23511
+ _uploadFile: function(file, preset) {
23512
+ var attributes;
23513
+ attributes = this._fileAttributes(file);
23514
+ return this.props.createObj(attributes, this.props.basePreset, preset.values(), this.props.tags.activeTags);
23515
+ },
23516
+ _buildPreset: function() {
23513
23517
  var presetBuilder;
23514
23518
  presetBuilder = new PresetBuilder(this.props.filter);
23515
23519
  return presetBuilder.generatePreset();
@@ -23538,7 +23542,7 @@
23538
23542
  return React.createElement("div", {
23539
23543
  "className": this.dropZoneClass(),
23540
23544
  "onDragOver": this.changeDragState(true),
23541
- "onDrop": this.uploadFiles,
23545
+ "onDrop": this.handleFileDrop,
23542
23546
  "onDragLeave": this.changeDragState(false)
23543
23547
  }, this.renderTagBar(), (this.props.objCollection.isLoading() ? React.createElement("div", {
23544
23548
  "className": "scrivito-content-browser-loading"
@@ -24209,17 +24213,8 @@
24209
24213
 
24210
24214
  LastAddedItems = React.createClass({
24211
24215
  displayName: 'LastAddedItems',
24212
- getForbiddenUploadText: function() {
24213
- return scrivito.translate('content_browser.last_added.forbidden_upload');
24214
- },
24215
24216
  render: function() {
24216
- return React.createElement("div", null, (this.props.dragInProgress ? React.createElement("div", {
24217
- "className": "scrivito-content-browser-text"
24218
- }, React.createElement("span", {
24219
- "className": "scrivito_icon scrivito_icon_error"
24220
- }), React.createElement("span", {
24221
- "className": "scrivito_title"
24222
- }, this.getForbiddenUploadText())) : this.props.viewMode === objDisplayAction.TABLE_VIEW ? React.createElement(TableView, {
24217
+ return React.createElement("div", null, (this.props.viewMode === objDisplayAction.TABLE_VIEW ? React.createElement(TableView, {
24223
24218
  "objCollection": this.props.objCollection,
24224
24219
  "activeTags": this.props.activeTags,
24225
24220
  "toggleSelected": this.props.toggleSelected,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_content_browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.5.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-14 00:00:00.000000000 Z
11
+ date: 2016-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.3
33
+ version: 1.5.0.rc1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.4.3
40
+ version: 1.5.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement