@widgetic/editor 3.10.40 → 3.10.42

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.40");
13350
+ this.el.attr('editorVersion', "3.10.42");
13351
13351
  }
13352
13352
 
13353
13353
 
@@ -23255,7 +23255,7 @@ var INSTAGRAM_DEFAULTS, InstagramService, Service, api, auth_url, host,
23255
23255
 
23256
23256
  Service = __webpack_require__(8);
23257
23257
 
23258
- host = 'https://widgetic.com' + '/wservices/instagram';
23258
+ host = 'https://widgetic.com' + '/services/instagram';
23259
23259
 
23260
23260
  INSTAGRAM_DEFAULTS = {
23261
23261
  client_id: '542808610040105',
@@ -23276,7 +23276,9 @@ api = window.INSTAGRAM_SERVICE_CONFIG || INSTAGRAM_DEFAULTS;
23276
23276
 
23277
23277
  try {
23278
23278
  api.token = localStorage.getItem('instagramAuthToken');
23279
- } catch (error) {}
23279
+ } catch (error1) {}
23280
+
23281
+ console.log("EDITOR Instagram Service current user's token:", api.token);
23280
23282
 
23281
23283
  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;
23282
23284
 
@@ -23298,7 +23300,8 @@ InstagramService = (function(superClass) {
23298
23300
 
23299
23301
  InstagramService.prototype.getUser = function(token) {
23300
23302
  var url;
23301
- url = api.api_url + "me";
23303
+ console.log("Editor Instagram Service getUser:", token, api.api_url);
23304
+ url = api.api_url + "/me";
23302
23305
  return $.ajax({
23303
23306
  url: url,
23304
23307
  type: 'GET',
@@ -23316,11 +23319,13 @@ InstagramService = (function(superClass) {
23316
23319
  if (api.token != null) {
23317
23320
  this.getUser(api.token).then((function(_this) {
23318
23321
  return function(result) {
23322
+ console.log("Editor get User result:", result);
23319
23323
  _this.user = result;
23320
23324
  return _this.trigger('auth', _this.authenticated = true);
23321
23325
  };
23322
23326
  })(this))["catch"]((function(_this) {
23323
23327
  return function() {
23328
+ console.log("Editor get User error:", error);
23324
23329
  return _this.deauth();
23325
23330
  };
23326
23331
  })(this));
@@ -23334,7 +23339,7 @@ InstagramService = (function(superClass) {
23334
23339
  api.token = token;
23335
23340
  try {
23336
23341
  localStorage.setItem('instagramAuthToken', api.token = token);
23337
- } catch (error) {}
23342
+ } catch (error1) {}
23338
23343
  _this.user = user;
23339
23344
  return _this.trigger('auth', _this.authenticated = true);
23340
23345
  };
@@ -23353,7 +23358,7 @@ InstagramService = (function(superClass) {
23353
23358
  this.trigger('auth', this.authenticated);
23354
23359
  try {
23355
23360
  return localStorage.removeItem('instagramAuthToken');
23356
- } catch (error) {}
23361
+ } catch (error1) {}
23357
23362
  };
23358
23363
 
23359
23364
  return InstagramService;
@@ -23377,7 +23382,7 @@ Service = __webpack_require__(8);
23377
23382
 
23378
23383
  Entry = __webpack_require__(9);
23379
23384
 
23380
- host = 'https://widgetic.com' + '/wservices/instagram/';
23385
+ host = 'https://widgetic.com' + '/services/instagram/';
23381
23386
 
23382
23387
  INSTAGRAM_DEFAULTS = {
23383
23388
  client_id: '542808610040105',
@@ -23959,6 +23964,7 @@ InstagramBrowser = (function(superClass) {
23959
23964
  this.el.addClass(this.title);
23960
23965
  this.listenTo(this.service, 'auth', this.onAuth);
23961
23966
  this.authenticated = !!this.content.length;
23967
+ console.log("Editor Instagram Browser @authenticated:", this.authenticated, this.content[0]);
23962
23968
  this.el.attr({
23963
23969
  authenticated: this.authenticated
23964
23970
  });
@@ -23966,7 +23972,11 @@ InstagramBrowser = (function(superClass) {
23966
23972
  this.connectedAccount = this.content[0];
23967
23973
  this.service.getUser(this.connectedAccount.token).then((function(_this) {
23968
23974
  return function(user) {
23969
- return _this._updateLogoutIntent(user);
23975
+ if (user.error) {
23976
+ return _this.onAuth(false);
23977
+ } else {
23978
+ return _this._updateLogoutIntent(user);
23979
+ }
23970
23980
  };
23971
23981
  })(this));
23972
23982
  }
@@ -23999,6 +24009,7 @@ InstagramBrowser = (function(superClass) {
23999
24009
  InstagramBrowser.prototype.onAuth = function(authenticated) {
24000
24010
  var item;
24001
24011
  this.authenticated = authenticated;
24012
+ console.log("Editor browser onAuth:", this.authenticated);
24002
24013
  this.el.attr({
24003
24014
  authenticated: this.authenticated
24004
24015
  });
@@ -24044,6 +24055,7 @@ InstagramBrowser = (function(superClass) {
24044
24055
  };
24045
24056
 
24046
24057
  InstagramBrowser.prototype._updateLogoutIntent = function(user) {
24058
+ console.log("update logout intent:", user);
24047
24059
  this.logoutIntent.remove();
24048
24060
  this.logoutIntent = $(LogoutIntent(user));
24049
24061
  return this.el.append(this.logoutIntent);