@widgetic/editor 3.11.2 → 3.11.3

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.11.2",
3
+ "version": "3.11.3",
4
4
  "scripts": {
5
5
  "start": "webpack --config webpack.config.js --watch --progress",
6
6
  "build": "webpack --config webpack.config.js",
@@ -26,8 +26,8 @@ File.guid = 0;
26
26
 
27
27
  const parseType = type => type.indexOf('/') > 0 ? type.slice(0, type.indexOf('/')) : type;
28
28
 
29
- // const root = "http://127.0.0.1:8091"; // for local development
30
- const root = ''; // (empty) for running on https://widgetic.com/upload
29
+ // const root = 'http://127.0.0.1:8091'; // for localhost development
30
+ const root = 'https://widgetic.com/'; // for running on widgetic.com domain
31
31
 
32
32
  export default class UploadService extends EventsMixin(Service) {
33
33
  constructor(user, token) {
@@ -64,6 +64,9 @@ export default class UploadService extends EventsMixin(Service) {
64
64
  }
65
65
 
66
66
  getUploadURL() {
67
+ // previouly: retuned the relative path to the upload endpoint
68
+ // return '/upload?user=' + this.user;
69
+
67
70
  let url = root + '/upload?user=' + this.user;
68
71
 
69
72
  // console.log("getUploadURL:", url);
@@ -246,7 +249,7 @@ export default class UploadService extends EventsMixin(Service) {
246
249
  // console.log("fetching files for type:", type);
247
250
  return jQuery
248
251
  .ajax({
249
- url: root + `/upload/?user=${this.user}&type=${type}`,
252
+ url: this.getUploadURL() + `&type=${type}`,
250
253
  headers: this.getAuthHeaders(),
251
254
  })
252
255
  .then(response => {
@@ -155,12 +155,14 @@ export default {
155
155
  const chunkSize = this.get('chunkSize');
156
156
  // console.log("Dropzone _onUploadStart chunkSize:", chunkSize);
157
157
 
158
- console.log("Dropzone _onUploadStart TUS endpoint:", this.Uploads.getUploadURL());
158
+ // get the TUS endpoint path from the Uploads service
159
+ let endpointPath = this.Uploads.getUploadURL();
160
+ console.log("Dropzone _onUploadStart TUS endpoint:", endpointPath);
159
161
 
160
162
  /* Initialize TUS upload */
161
163
  if(chunkSize) {
162
164
  const upload = new tus.Upload(file, {
163
- endpoint: this.Uploads.getUploadURL(),
165
+ endpoint: endpointPath,
164
166
  headers: this.Uploads.getAuthHeaders(),
165
167
  retryDelays: [0, 3000, 5000, 10000, 20000],
166
168
  chunkSize: chunkSize * 1024 * 1024, // in MB
@@ -4,9 +4,6 @@ import ScrollPane from './scroll-pane.html';
4
4
  import File from './file.html';
5
5
  import Service from './service.html'; // actually imports services/uploads.js
6
6
 
7
- // Third party libraries imports
8
- import * as tus from 'tus-js-client';
9
-
10
7
  const parseType = type => type.indexOf('/') > 0 ? type.slice(0, type.indexOf('/')) : type;
11
8
 
12
9
  let instanceId = 0;