@widgetic/editor 3.10.37 → 3.10.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/editor",
3
- "version": "3.10.37",
3
+ "version": "3.10.41",
4
4
  "scripts": {
5
5
  "start": "webpack --config webpack.config.js --watch --progress",
6
6
  "build": "webpack --config webpack.config.js",
@@ -272,14 +272,21 @@ export default class EmbedController {
272
272
  }
273
273
 
274
274
  _showBranding() {
275
+ // read branding value
276
+ let brandingValue = new URLSearchParams(window.location.search).get('branding')
277
+ // console.log("read brandingValue:", brandingValue);
278
+ if(!brandingValue) brandingValue = 'off'
279
+
280
+ // check if user is premium
275
281
  let isPremium = (this.user && this.user.premium) ? this.user.premium : false;
276
- // console.log("_showBranding:", this.user, isPremium, window.location.search.indexOf('branding'));
277
- if(isPremium) return;
278
282
 
279
- // show branding only if the flag is on
280
- if (window.location.search.indexOf('branding') >= 0) {
281
- window.initBranding();
282
- }
283
+ // establish branding
284
+ if(!isPremium) brandingValue = "on";
285
+ // console.log("final brandingValue:", this.user, isPremium, brandingValue);
286
+
287
+
288
+ // show branding if user is free or flag is on
289
+ if (brandingValue != "off") window.initBranding();
283
290
  }
284
291
 
285
292
  _onSkinSet(skin) {
@@ -1,14 +1,14 @@
1
1
  Service = require '../../../browser/model'
2
2
 
3
3
  # Instagram service config
4
- host = 'https://widgetic.com'
4
+ host = 'https://widgetic.com' + '/services/instagram'
5
5
  INSTAGRAM_DEFAULTS = {
6
6
  client_id: '542808610040105', #widgetic instagram basic display app id
7
7
  client_secret: '0a88504381f577dbbef400d4232a4258',
8
- redirect_uri: host + '/services/instagram/auth_token',
8
+ redirect_uri: host + '/auth_token',
9
9
  scope: 'user_profile,user_media',
10
10
  response_type: 'code',
11
- api_url: host + '/services/instagram/',
11
+ api_url: host,
12
12
  demo: "IGQVJVNUw5cHB5cUFiZATFxVmgyeWtSVFJjTDYyRmNnWDZAJZA3llVXREa1BsS1EtVGJ2UEdlbHJNbDV1UUQ2YkVSZA3YwS1dPWXJzYXFGQzdZAMlhBLTBWWWNkTVNHTGNDLW10dkdhNW0wMDVqMkhZAWEhqbgZDZD",
13
13
  token_storage: "redis",
14
14
  encodeToken: false,
@@ -2,14 +2,14 @@ Service = require '../../../browser/model'
2
2
  Entry = require '../../../browser/model/entry'
3
3
 
4
4
  # Instagram service config
5
- host = 'https://widgetic.com'
5
+ host = 'https://widgetic.com' + '/services/instagram/'
6
6
  INSTAGRAM_DEFAULTS = {
7
7
  client_id: '542808610040105', #widgetic instagram basic display app id
8
8
  client_secret: '0a88504381f577dbbef400d4232a4258',
9
- redirect_uri: host + '/services/instagram/auth_token',
9
+ redirect_uri: host + 'auth_token',
10
10
  scope: 'user_profile,user_media',
11
11
  response_type: 'code',
12
- api_url: host + '/services/instagram/',
12
+ api_url: host,
13
13
  demo: "IGQVJVNUw5cHB5cUFiZATFxVmgyeWtSVFJjTDYyRmNnWDZAJZA3llVXREa1BsS1EtVGJ2UEdlbHJNbDV1UUQ2YkVSZA3YwS1dPWXJzYXFGQzdZAMlhBLTBWWWNkTVNHTGNDLW10dkdhNW0wMDVqMkhZAWEhqbgZDZD",
14
14
  token_storage: "redis",
15
15
  encodeToken: false,
@@ -2,24 +2,26 @@ Service = require '../../../browser/model'
2
2
  Entry = require '../../../browser/model/entry'
3
3
 
4
4
  # SoundCloud config
5
+ widgetic_backend_url = 'https://widgetic.com/wservices/soundcloud/'
5
6
  SC = require('soundcloud')
6
7
  config = {
8
+ api_url: 'https://api.soundcloud.com'
7
9
  # for '/connect' endpoint
8
10
  client_id : 'aed0aa63baf747a83ad0b6b246acddca'
11
+ # client_secret: '3173e3098379153d42084aba06fe3ec4',
9
12
  redirect_uri: 'https://widgetic.com/connect/soundcloud',
13
+ tracks_url: widgetic_backend_url + 'tracks/',
10
14
  # response_type: 'code',
11
- # state: 'encrypted_session_info',
15
+
12
16
  # for '/oauth2/token' endpoint
13
17
  grant_type: 'refresh_token',
14
- # client_secret: '3173e3098379153d42084aba06fe3ec4',
15
- # local options
16
- api_url: 'https://api.soundcloud.com',
17
18
  }
18
19
  SC.initialize(config);
19
- # add local config options used in this class only
20
+
21
+ # add local config options used in this file only
20
22
  SC.client_id = config.client_id
21
- SC.redirect_uri = config.redirect_uri
22
23
  SC.api_url = config.api_url
24
+ SC.tracks_url = config.tracks_url
23
25
  try SC.auth_token = localStorage.getItem 'soundcloudAuthToken'
24
26
  try SC.userId = localStorage.getItem 'soundcloudUserId'
25
27
 
@@ -30,7 +32,7 @@ class SoundCloudService extends Service
30
32
 
31
33
  SCGet: (path) ->
32
34
  url = "#{SC.api_url}" + path
33
- console.log("SCGet path:", path, SC.auth_token)
35
+ # console.log("SCGet path:", path, SC.auth_token)
34
36
  $.ajax(url: url, type: 'GET', dataType: 'json', headers: {'Authorization': 'OAuth ' + SC.auth_token})
35
37
 
36
38
  auth: (interactive) =>
@@ -43,8 +45,7 @@ class SoundCloudService extends Service
43
45
  else @checkAuth()
44
46
 
45
47
  showAuthPopup: ->
46
- # console.log("SC showAuthPopup:", SC.userId)
47
- # @SCGet("/connect?client_id=#{SC.client_id}&redirect_uri=#{SC.redirect_uri}&response_type=code")
48
+ # console.log("SC showAuthPopup:", SC)
48
49
  SC.connect()
49
50
  .then((response) =>
50
51
  # console.log("SC did connect:", response);
@@ -145,13 +146,18 @@ class SoundCloudService extends Service
145
146
  }
146
147
 
147
148
  getURL: (entry, callback) ->
148
- # console.log("getURL", entry.stream_url)
149
+ # old method
149
150
  # callback "#{entry.stream_url}?client_id=#{SC.client_id}"
150
- @SCGet("/tracks/#{entry.id}/stream")
151
- .then((streams) =>
152
- console.log("fetchTrackStreams result:", streams);
153
- callback streams
154
- ).catch (error) =>
155
- console.log 'Fetch Track Streams error: ' + error
151
+
152
+ # new 2021 api track path through widgetic endpoint
153
+ callback "#{SC.tracks_url}?id=#{entry.id}&atoken=#{SC.auth_token}"
154
+
155
+ # new 2021 api get method
156
+ # @SCGet("/tracks/#{entry.id}/streams")
157
+ # .done((streams) =>
158
+ # console.log("fetchTrackStreams result:", streams);
159
+ # # callback streams.http_mp3_128_url
160
+ # ).fail (error) =>
161
+ # console.log 'Fetch Track Streams error: ' + error
156
162
 
157
163
  module.exports = SoundCloudService