@widgetic/editor 3.10.42 → 3.10.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/dev/editor.js CHANGED
@@ -13347,7 +13347,7 @@ WidgetEditor = (function(superClass) {
13347
13347
  this.el.append(this.tabs.el);
13348
13348
  LoginPopup.place(this.el);
13349
13349
  Blogvio.pubsub.subscribe('api/token/update', this._updateLoggedInStatus);
13350
- this.el.attr('editorVersion', "3.10.42");
13350
+ this.el.attr('editorVersion', "3.10.44");
13351
13351
  }
13352
13352
 
13353
13353
 
@@ -16683,13 +16683,17 @@ var UploadService = function (_EventsMixin) {
16683
16683
  var _this = _possibleConstructorReturn(this, (UploadService.__proto__ || Object.getPrototypeOf(UploadService)).call(this));
16684
16684
 
16685
16685
  _this.user = user.id;
16686
- _this.maxFilesize = user.premium ? 250 : 100;
16687
16686
  _this.token = token;
16688
16687
 
16689
- _this.files = [];
16690
16688
  _this.refreshed = {};
16691
16689
 
16692
- _this.quota = 1000 * 1000 * 1000;
16690
+ _this.files = [];
16691
+ // max file size in MB
16692
+ _this.maxFilesize = user.premium ? 250 : 25; // MB limit / file for premium / free
16693
+
16694
+ // max quota in bytes
16695
+ _this.quota = 250 * 1000 * 1000; // 250 MB total quota for free users
16696
+ // used quota in bytes
16693
16697
  _this.used = 0;
16694
16698
 
16695
16699
  _this.events = ['update', 'complete'];
@@ -16756,6 +16760,8 @@ var UploadService = function (_EventsMixin) {
16756
16760
  var response = JSON.parse(uploadFile.xhr.response);
16757
16761
 
16758
16762
  var id = response.files.data[0].id;
16763
+
16764
+ // read quota from response
16759
16765
  this.quota = response.quota.max;
16760
16766
  this.used = response.quota.used;
16761
16767
 
@@ -16839,6 +16845,8 @@ var UploadService = function (_EventsMixin) {
16839
16845
  headers: this.getAuthHeaders()
16840
16846
  }).then(function (response) {
16841
16847
  _this3.refreshed[type] = true;
16848
+
16849
+ // read quota from response
16842
16850
  _this3.quota = response.quota.max;
16843
16851
  _this3.used = response.quota.used;
16844
16852
 
@@ -23278,7 +23286,7 @@ try {
23278
23286
  api.token = localStorage.getItem('instagramAuthToken');
23279
23287
  } catch (error1) {}
23280
23288
 
23281
- console.log("EDITOR Instagram Service current user's token:", api.token);
23289
+ console.log("Editor Instagram Service current user's token:", api.token);
23282
23290
 
23283
23291
  auth_url = "https://api.instagram.com/oauth/authorize/?client_id=" + api.client_id + "&redirect_uri=" + api.redirect_uri + "&response_type=" + api.response_type + "&scope=" + api.scope;
23284
23292
 
@@ -23300,7 +23308,6 @@ InstagramService = (function(superClass) {
23300
23308
 
23301
23309
  InstagramService.prototype.getUser = function(token) {
23302
23310
  var url;
23303
- console.log("Editor Instagram Service getUser:", token, api.api_url);
23304
23311
  url = api.api_url + "/me";
23305
23312
  return $.ajax({
23306
23313
  url: url,
@@ -23316,16 +23323,17 @@ InstagramService = (function(superClass) {
23316
23323
  if (interactive == null) {
23317
23324
  interactive = true;
23318
23325
  }
23326
+ console.log("Editor Instagram Service _auth method:", interactive, api.token);
23319
23327
  if (api.token != null) {
23320
23328
  this.getUser(api.token).then((function(_this) {
23321
23329
  return function(result) {
23322
- console.log("Editor get User result:", result);
23330
+ console.log("Editor Instagram Service getUser result:", result);
23323
23331
  _this.user = result;
23324
23332
  return _this.trigger('auth', _this.authenticated = true);
23325
23333
  };
23326
23334
  })(this))["catch"]((function(_this) {
23327
23335
  return function() {
23328
- console.log("Editor get User error:", error);
23336
+ console.log("Editor Instagram Service getUser error:", error);
23329
23337
  return _this.deauth();
23330
23338
  };
23331
23339
  })(this));
@@ -23972,12 +23980,17 @@ InstagramBrowser = (function(superClass) {
23972
23980
  this.connectedAccount = this.content[0];
23973
23981
  this.service.getUser(this.connectedAccount.token).then((function(_this) {
23974
23982
  return function(user) {
23983
+ console.log("Editor Instagram Browser CT getUser result:", user);
23975
23984
  if (user.error) {
23976
- return _this.onAuth(false);
23985
+ return _this._updateLogoutIntent(_this.connectedAccount);
23977
23986
  } else {
23978
23987
  return _this._updateLogoutIntent(user);
23979
23988
  }
23980
23989
  };
23990
+ })(this))["catch"]((function(_this) {
23991
+ return function(err) {
23992
+ return console.log("Editor Browser getUser err:", err);
23993
+ };
23981
23994
  })(this));
23982
23995
  }
23983
23996
  }
@@ -23999,6 +24012,7 @@ InstagramBrowser = (function(superClass) {
23999
24012
  };
24000
24013
 
24001
24014
  InstagramBrowser.prototype.auth = function(e) {
24015
+ console.log("Editor Instagram Browser auth handler:", e, this.authenticated);
24002
24016
  if (this.authenticated) {
24003
24017
  return;
24004
24018
  }
@@ -24009,7 +24023,7 @@ InstagramBrowser = (function(superClass) {
24009
24023
  InstagramBrowser.prototype.onAuth = function(authenticated) {
24010
24024
  var item;
24011
24025
  this.authenticated = authenticated;
24012
- console.log("Editor browser onAuth:", this.authenticated);
24026
+ console.log("Editor Instagram Browser onAuth:", this.authenticated, this.service.user);
24013
24027
  this.el.attr({
24014
24028
  authenticated: this.authenticated
24015
24029
  });
@@ -24028,6 +24042,7 @@ InstagramBrowser = (function(superClass) {
24028
24042
  item.type = 'user_id';
24029
24043
  item.id = this.service.user.id;
24030
24044
  item.url = 'Instagram User: @' + this.service.user.username;
24045
+ item.username = this.service.user.username;
24031
24046
  this.connectedAccount = item;
24032
24047
  return this.trigger('add', item);
24033
24048
  };
@@ -24055,7 +24070,6 @@ InstagramBrowser = (function(superClass) {
24055
24070
  };
24056
24071
 
24057
24072
  InstagramBrowser.prototype._updateLogoutIntent = function(user) {
24058
- console.log("update logout intent:", user);
24059
24073
  this.logoutIntent.remove();
24060
24074
  this.logoutIntent = $(LogoutIntent(user));
24061
24075
  return this.el.append(this.logoutIntent);