@denevads/dnv-smo 1.0.5 → 1.0.6
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/dist/smo.js +2 -22
- package/package.json +1 -1
- package/src/smo.ts +3 -24
package/dist/smo.js
CHANGED
|
@@ -7,11 +7,11 @@ var SMO = /** @class */ (function () {
|
|
|
7
7
|
this.vars = {};
|
|
8
8
|
this.id = "";
|
|
9
9
|
this.intervalDataSource$ = (0, rxjs_1.interval)(5 * 60 * 1000);
|
|
10
|
-
this.init();
|
|
11
10
|
this.initOnMessage();
|
|
12
11
|
this.smoCallBacks = new smoCallBacks(this);
|
|
13
12
|
this.utils = new Utils(this, this.smoCallBacks);
|
|
14
13
|
this.events = new SmoEvents(this);
|
|
14
|
+
this.init();
|
|
15
15
|
}
|
|
16
16
|
SMO.prototype.init = function () {
|
|
17
17
|
var _this = this;
|
|
@@ -21,12 +21,6 @@ var SMO = /** @class */ (function () {
|
|
|
21
21
|
while (match = search.exec(query)) {
|
|
22
22
|
this.vars[decode(match[1])] = decode(match[2]);
|
|
23
23
|
}
|
|
24
|
-
/* let hash;
|
|
25
|
-
let hashes = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&");
|
|
26
|
-
for (var i = 0; i < hashes.length; i++) {
|
|
27
|
-
hash = hashes[i].split("=");
|
|
28
|
-
this.vars[hash[0]] = hash[1];
|
|
29
|
-
}*/
|
|
30
24
|
if (this.vars.idSmo) {
|
|
31
25
|
this.id = this.vars.idSmo;
|
|
32
26
|
if (this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)) {
|
|
@@ -47,24 +41,10 @@ var SMO = /** @class */ (function () {
|
|
|
47
41
|
});
|
|
48
42
|
return;
|
|
49
43
|
}
|
|
44
|
+
return;
|
|
50
45
|
}
|
|
51
46
|
console.warn("No idSmo found in URL");
|
|
52
47
|
};
|
|
53
|
-
/*getDatasource():void{
|
|
54
|
-
if(this.smo.vars.url == undefined){
|
|
55
|
-
this.smoCallBacks.getFile(this.smo.vars.LocalData);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.smoCallBacks.getFile(this.smo.vars.url);
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
startCheckDatasource(timeout: number = 10):void{
|
|
62
|
-
this.getDatasource();
|
|
63
|
-
let self = this;
|
|
64
|
-
setInterval(function() {
|
|
65
|
-
self.getDatasource();
|
|
66
|
-
}, timeout * 1000);
|
|
67
|
-
}*/
|
|
68
48
|
SMO.prototype.initOnMessage = function () {
|
|
69
49
|
var selft = this;
|
|
70
50
|
window.onmessage = function (e) {
|
package/package.json
CHANGED
package/src/smo.ts
CHANGED
|
@@ -18,11 +18,12 @@ export class SMO {
|
|
|
18
18
|
public utils:Utils;
|
|
19
19
|
public events:SmoEvents;
|
|
20
20
|
constructor(){
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
this.initOnMessage();
|
|
23
23
|
this.smoCallBacks = new smoCallBacks(this);
|
|
24
24
|
this.utils = new Utils(this,this.smoCallBacks);
|
|
25
25
|
this.events =new SmoEvents(this);
|
|
26
|
+
this.init();
|
|
26
27
|
}
|
|
27
28
|
public init():void{
|
|
28
29
|
let match,
|
|
@@ -35,12 +36,6 @@ export class SMO {
|
|
|
35
36
|
while (match = search.exec(query)) {
|
|
36
37
|
this.vars[decode(match[1])] = decode(match[2]);
|
|
37
38
|
}
|
|
38
|
-
/* let hash;
|
|
39
|
-
let hashes = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&");
|
|
40
|
-
for (var i = 0; i < hashes.length; i++) {
|
|
41
|
-
hash = hashes[i].split("=");
|
|
42
|
-
this.vars[hash[0]] = hash[1];
|
|
43
|
-
}*/
|
|
44
39
|
if (this.vars.idSmo) {
|
|
45
40
|
this.id = this.vars.idSmo;
|
|
46
41
|
if(this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)){
|
|
@@ -61,26 +56,10 @@ export class SMO {
|
|
|
61
56
|
});
|
|
62
57
|
return;
|
|
63
58
|
}
|
|
64
|
-
}
|
|
65
|
-
console.warn("No idSmo found in URL");
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
/*getDatasource():void{
|
|
70
|
-
if(this.smo.vars.url == undefined){
|
|
71
|
-
this.smoCallBacks.getFile(this.smo.vars.LocalData);
|
|
72
59
|
return;
|
|
73
60
|
}
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
console.warn("No idSmo found in URL");
|
|
76
62
|
}
|
|
77
|
-
startCheckDatasource(timeout: number = 10):void{
|
|
78
|
-
this.getDatasource();
|
|
79
|
-
let self = this;
|
|
80
|
-
setInterval(function() {
|
|
81
|
-
self.getDatasource();
|
|
82
|
-
}, timeout * 1000);
|
|
83
|
-
}*/
|
|
84
63
|
initOnMessage():void{
|
|
85
64
|
let selft = this;
|
|
86
65
|
window.onmessage = function(e) {
|