ohzi-core 6.6.0 → 6.6.1

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": "ohzi-core",
3
- "version": "6.6.0",
3
+ "version": "6.6.1",
4
4
  "description": "OHZI Core Library",
5
5
  "source": "src/index.js",
6
6
  "module": "build/index.module.js",
@@ -1,40 +1,20 @@
1
1
  import AbstractLoader from './AbstractLoader';
2
2
 
3
- import { FileLoader as THREEFileLoader } from 'three';
4
-
5
3
  export default class JSONLoader extends AbstractLoader
6
4
  {
7
5
  constructor(resource_id, url, size)
8
6
  {
9
7
  super(resource_id, url, size);
10
-
11
- this.loader = new THREEFileLoader();
12
8
  }
13
9
 
14
- on_preloaded_finished(resource_container)
10
+ on_preloaded_finished(resource_container, response)
15
11
  {
16
- const ctx = this;
17
-
18
- this.loader.load(this.url, (data) =>
12
+ response.json().then((json) =>
19
13
  {
20
- resource_container.set_resource(ctx.resource_id, ctx.url, JSON.parse(data));
14
+ resource_container.set_resource(this.resource_id, this.url, json);
21
15
 
22
- ctx.__update_downloaded_bytes(1, 1);
23
- ctx.__loading_ended();
24
- },
25
- (xhr) =>
26
- {
27
- // if (xhr)
28
- // {
29
- // let total = xhr.total || this.total_bytes;
30
- // ctx.__update_downloaded_bytes(xhr.loaded, total);
31
- // }
32
- },
33
- (msg) =>
34
- {
35
- ctx.__set_error(msg + '\n\n\t If the error says something about unexpected token < in JSON then the probably the problem is related to the file not being found. Check the name and path of the resource');
36
- ctx.__loading_ended();
37
- }
38
- );
16
+ this.__update_downloaded_bytes(1, 1);
17
+ this.__loading_ended();
18
+ });
39
19
  }
40
20
  }