@widgetic/editor 3.10.41 → 3.10.43
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.
|
|
13350
|
+
this.el.attr('editorVersion', "3.10.43");
|
|
13351
13351
|
}
|
|
13352
13352
|
|
|
13353
13353
|
|
|
@@ -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 (
|
|
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,7 @@ InstagramService = (function(superClass) {
|
|
|
23298
23300
|
|
|
23299
23301
|
InstagramService.prototype.getUser = function(token) {
|
|
23300
23302
|
var url;
|
|
23301
|
-
url = api.api_url + "me";
|
|
23303
|
+
url = api.api_url + "/me";
|
|
23302
23304
|
return $.ajax({
|
|
23303
23305
|
url: url,
|
|
23304
23306
|
type: 'GET',
|
|
@@ -23313,14 +23315,17 @@ InstagramService = (function(superClass) {
|
|
|
23313
23315
|
if (interactive == null) {
|
|
23314
23316
|
interactive = true;
|
|
23315
23317
|
}
|
|
23318
|
+
console.log("Editor Instagram Service _auth method:", interactive, api.token);
|
|
23316
23319
|
if (api.token != null) {
|
|
23317
23320
|
this.getUser(api.token).then((function(_this) {
|
|
23318
23321
|
return function(result) {
|
|
23322
|
+
console.log("Editor Instagram Service getUser 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 Instagram Service getUser 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 (
|
|
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 (
|
|
23361
|
+
} catch (error1) {}
|
|
23357
23362
|
};
|
|
23358
23363
|
|
|
23359
23364
|
return InstagramService;
|
|
@@ -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,16 @@ 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
|
-
|
|
23975
|
+
console.log("Editor Instagram Browser CT getUser result:", user);
|
|
23976
|
+
if (user.error) {
|
|
23977
|
+
return _this._updateLogoutIntent(_this.connectedAccount);
|
|
23978
|
+
} else {
|
|
23979
|
+
return _this._updateLogoutIntent(user);
|
|
23980
|
+
}
|
|
23981
|
+
};
|
|
23982
|
+
})(this))["catch"]((function(_this) {
|
|
23983
|
+
return function(err) {
|
|
23984
|
+
return console.log("Editor Browser getUser err:", err);
|
|
23970
23985
|
};
|
|
23971
23986
|
})(this));
|
|
23972
23987
|
}
|
|
@@ -23989,6 +24004,7 @@ InstagramBrowser = (function(superClass) {
|
|
|
23989
24004
|
};
|
|
23990
24005
|
|
|
23991
24006
|
InstagramBrowser.prototype.auth = function(e) {
|
|
24007
|
+
console.log("Editor Instagram Browser auth handler:", e, this.authenticated);
|
|
23992
24008
|
if (this.authenticated) {
|
|
23993
24009
|
return;
|
|
23994
24010
|
}
|
|
@@ -23999,6 +24015,7 @@ InstagramBrowser = (function(superClass) {
|
|
|
23999
24015
|
InstagramBrowser.prototype.onAuth = function(authenticated) {
|
|
24000
24016
|
var item;
|
|
24001
24017
|
this.authenticated = authenticated;
|
|
24018
|
+
console.log("Editor Instagram Browser onAuth:", this.authenticated, this.service.user);
|
|
24002
24019
|
this.el.attr({
|
|
24003
24020
|
authenticated: this.authenticated
|
|
24004
24021
|
});
|
|
@@ -24017,6 +24034,7 @@ InstagramBrowser = (function(superClass) {
|
|
|
24017
24034
|
item.type = 'user_id';
|
|
24018
24035
|
item.id = this.service.user.id;
|
|
24019
24036
|
item.url = 'Instagram User: @' + this.service.user.username;
|
|
24037
|
+
item.username = this.service.user.username;
|
|
24020
24038
|
this.connectedAccount = item;
|
|
24021
24039
|
return this.trigger('add', item);
|
|
24022
24040
|
};
|