scrivito_content_browser 1.7.0.rc1 → 1.7.0.rc2

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: b70d97e2381acaf5c232b3896b120a333473b24f
4
- data.tar.gz: d68721c9a10f15299d64f150a2a036d650ddc53e
3
+ metadata.gz: c5549b3ae9ed5d91fedeff3b7377ab7edf0b7bd7
4
+ data.tar.gz: 7f42530c735bd15e38385b82dfe3312bc794ab78
5
5
  SHA512:
6
- metadata.gz: 01d0260fb0d8dc433feb774be487416c194695dfd5e825f37998eaf3984b579fd75037ba284a276266876dc9411ff000f0808448dda1c1ab84ed8e2dc1e54aaa
7
- data.tar.gz: 06d6fbec89276e688033b8062eedf8c79ec50dbb0d5aeb7de367c557c6f851bf3b835eb42abf7685b0e1d5d0b039d78a9bb44ae0efed3b81b5c1cc093dbcd1a2
6
+ metadata.gz: f021ebe07770708c8b9507b290648eddb45c8dae405d459bac3c5db58d7e208f286578fc3fb45e694da483c712e38b73b486484626ce3615bd943458e30a7121
7
+ data.tar.gz: a773bebc84dcc1a2b5859cbe66bb2aa6db9c8f4bec872699fdbcdecf974c6c0823c90c60dc5cfbbdd90cf751aef5f218c7ddaf9a373f57cda000e5d1ee30b8bc
@@ -21633,12 +21633,12 @@
21633
21633
  };
21634
21634
 
21635
21635
  ObjCollection.prototype._destroyById = function(objId) {
21636
+ this.trigger('destroy-obj', objId);
21636
21637
  return scrivito.delete_obj(objId).always((function(_this) {
21637
21638
  return function() {
21638
- _this._objs = _.reject(_this._objs, function(obj) {
21639
+ return _this._objs = _.reject(_this._objs, function(obj) {
21639
21640
  return obj.id() === objId;
21640
21641
  });
21641
- return _this.trigger('destroy-obj', objId);
21642
21642
  };
21643
21643
  })(this));
21644
21644
  };
@@ -24898,7 +24898,11 @@
24898
24898
  return 'scrivito-content-browser-meta ';
24899
24899
  },
24900
24900
  buildItems: function(objs) {
24901
- return _.map(objs, (function(_this) {
24901
+ var withoutDeleted;
24902
+ withoutDeleted = _.reject(objs, function(obj) {
24903
+ return obj.isDeleted();
24904
+ });
24905
+ return _.map(withoutDeleted, (function(_this) {
24902
24906
  return function(obj) {
24903
24907
  return React.createElement(ThumbnailItem, {
24904
24908
  "key": obj.id,
@@ -24982,11 +24986,14 @@
24982
24986
  className += MimeTypeIcon.getMimeTypeIconClassName(contentType);
24983
24987
  return className;
24984
24988
  },
24985
- _previewImage: function() {
24986
- var blob, contentType, transformed;
24987
- blob = this._obj().get('blob', 'binary');
24988
- contentType = blob != null ? blob.contentType : void 0;
24989
- if (contentType && contentType.indexOf('image/') === 0) {
24989
+ _isTransformable: function(contentType) {
24990
+ var types;
24991
+ types = ['image/jpeg', 'image/gif', 'image/png'];
24992
+ return _.contains(types, contentType);
24993
+ },
24994
+ _handleImageTransformation: function(blob) {
24995
+ var error, transformed;
24996
+ try {
24990
24997
  transformed = blob.transform({
24991
24998
  width: 260,
24992
24999
  height: 140
@@ -24994,6 +25001,27 @@
24994
25001
  return React.createElement("img", {
24995
25002
  "src": transformed.url
24996
25003
  });
25004
+ } catch (_error) {
25005
+ error = _error;
25006
+ if (error instanceof scrivito.TransformationSourceTooLargeError) {
25007
+ return React.createElement("div", {
25008
+ "className": "scrivito-content-browser-preview image-too-large"
25009
+ });
25010
+ } else {
25011
+ throw error;
25012
+ }
25013
+ }
25014
+ },
25015
+ _previewImage: function() {
25016
+ var blob, contentType;
25017
+ blob = this._obj().get('blob', 'binary');
25018
+ contentType = blob != null ? blob.contentType : void 0;
25019
+ if (this._isTransformable(contentType)) {
25020
+ return this._handleImageTransformation(blob);
25021
+ } else if (contentType && contentType.indexOf('image/') === 0) {
25022
+ return React.createElement("img", {
25023
+ "src": blob.url
25024
+ });
24997
25025
  } else {
24998
25026
  return React.createElement("span", {
24999
25027
  "className": this._mimeTypeIconClassName(contentType)
@@ -26424,7 +26452,11 @@
26424
26452
  return 'scrivito-content-browser-list-select ';
26425
26453
  },
26426
26454
  getTableViewItems: function(objs) {
26427
- return _.map(objs, (function(_this) {
26455
+ var withoutDeleted;
26456
+ withoutDeleted = _.reject(objs, function(obj) {
26457
+ return obj.isDeleted();
26458
+ });
26459
+ return _.map(withoutDeleted, (function(_this) {
26428
26460
  return function(obj) {
26429
26461
  return React.createElement(TableViewItem, {
26430
26462
  "key": obj.id,
@@ -27661,7 +27693,8 @@
27661
27693
  });
27662
27694
  case DELETE_OBJ_FINISH:
27663
27695
  return _.extend({}, state, {
27664
- selectedObjs: _.without(state.selectedObjs, action.objId)
27696
+ selectedObjs: _.without(state.selectedObjs, action.objId),
27697
+ currentlyAndPreviouslySelectedObjIds: _.without(state.currentlyAndPreviouslySelectedObjIds, action.objId)
27665
27698
  });
27666
27699
  case CREATE_OBJ_FINISH:
27667
27700
  if (action.isLastAddedVisible) {
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.7.0.rc1
4
+ version: 1.7.0.rc2
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-05 00:00:00.000000000 Z
11
+ date: 2016-12-27 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.7.0.rc1
33
+ version: 1.7.0.rc2
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.7.0.rc1
40
+ version: 1.7.0.rc2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement