Commit 009eb85a authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

using initials

parent 122b461a
......@@ -102,17 +102,6 @@ var STWkit;
geojson["type"] = "FeatureCollection";
geojson["features"] = [];
geojson["features"].push(geojsonfeature);
var observation = {
"id": id,
"provider": "EMSA",
"providerDataRef": null,
"providerImgRef": null,
"providerType": null,
"type": "SAT",
"date": moment.utc(timestamp).valueOf()
};
geojson.features[0].properties["observation"] = [];
geojson.features[0].properties["observation"].push(observation);
geojson.features[0].properties["simulation"] = {};
self.populateCard(geojson);
};
......@@ -362,14 +351,6 @@ var STWkit;
LocationCard.prototype.clear = function () {
var self = this;
_super.prototype.clear.call(this);
if (self.satObs) {
if (self.satDetectionChevronIcon.classList.contains('uk-icon-chevron-up')) {
self.satDetectionChevronIcon.classList.remove('uk-icon-chevron-up');
self.satDetectionChevronIcon.classList.add('uk-icon-chevron-down');
self.satDetectionContent.style.display = 'none';
self.satObs.hide();
}
}
if (self.forcingBoundary)
self.forcingBoundary.hide();
self.control.clear();
......@@ -412,7 +393,7 @@ var STWkit;
}
else {
reqwest({
url: "lang/itracer." + self.lang + ".json",
url: "lang/" + self.name + "." + self.lang + ".json",
method: 'get',
type: 'json',
success: function (lang) {
......@@ -536,10 +517,10 @@ var STWkit;
self.openCard(id, open);
});
var param = STWkit.getURLParams();
var ooload = STWkit.getParamValue('ooload', param);
if (ooload !== null) {
var load = STWkit.getParamValue(self.initials + 'load', param);
if (load !== null) {
reqwest({
url: "input/" + ooload,
url: "input/" + load,
method: 'get',
type: 'json',
success: function (inputjson) {
......@@ -548,7 +529,7 @@ var STWkit;
'geojson': inputjson
});
window.dispatchEvent(cardevt);
STWkit.deleteParam('ooload', param);
STWkit.deleteParam(self.initials + 'load', param);
STWkit.updateUrl(param);
}
});
......@@ -557,7 +538,7 @@ var STWkit;
};
CardControl.prototype.open = function (geojson) {
var self = this;
if (geojson.features[0].properties.type == 'oil' && geojson.features[0].properties.subtype == 'observation') {
if (geojson.features[0].properties.type == self.type && geojson.features[0].properties.subtype == self.subtype) {
self.clear();
for (var i in self.cardMap) {
if (self.cardMap.hasOwnProperty(i)) {
......@@ -579,7 +560,7 @@ var STWkit;
var self = this;
self.compname = name;
var p = STWkit.getURLParams();
var pindex = STWkit.getParamIndex('oo', 1, p);
var pindex = STWkit.getParamIndex(self.initials, 1, p);
if (pindex >= 0) {
p[pindex][1] = 0;
if (history.pushState) {
......@@ -593,10 +574,10 @@ var STWkit;
window.dispatchEvent(showevt);
}
}
var gindex = STWkit.getParamIndex('guide', 'oo', p);
var gindex = STWkit.getParamIndex('guide', self.initials, p);
if (gindex >= 0) {
reqwest({
url: 'guide/oo',
url: 'guide/' + self.initials,
method: 'get',
type: 'json',
success: function (guide) {
......@@ -609,14 +590,14 @@ var STWkit;
});
intro.oncomplete(function () {
var param = STWkit.getURLParams();
if (STWkit.hasParam('guide', 'oo', param))
if (STWkit.hasParam('guide', self.initials, param))
STWkit.replaceParam('guide', 'player', param);
STWkit.updateUrl(param);
self.startButton.click();
});
intro.onexit(function () {
var param = STWkit.getURLParams();
if (STWkit.hasParam('guide', 'oo', param))
if (STWkit.hasParam('guide', self.initials, param))
STWkit.deleteParam('guide', param);
STWkit.updateUrl(param);
});
......
This diff is collapsed.
......@@ -107,9 +107,6 @@ module STWkit {
public datetimeTFormat: string;
public hasPosition: boolean;
public geometryType: string;
private satObs: any;
private satDetectionContent: HTMLDivElement;
private satDetectionChevronIcon: HTMLSpanElement;
private forcingBoundary: any;
constructor(id, title ,parentDiv, lang, langData, map, forcing) {
......@@ -126,17 +123,6 @@ module STWkit {
geojson["type"] = "FeatureCollection";
geojson["features"] = [];
geojson["features"].push(geojsonfeature);
var observation = {
"id": id,
"provider": "EMSA",
"providerDataRef": null,
"providerImgRef": null,
"providerType": null,
"type": "SAT",
"date": moment.utc(timestamp).valueOf()
};
geojson.features[0].properties["observation"] = [];
geojson.features[0].properties["observation"].push(observation);
geojson.features[0].properties["simulation"] = {};
self.populateCard(geojson);
};
......@@ -404,14 +390,6 @@ module STWkit {
public clear() {
var self = this;
super.clear();
if (self.satObs) {
if (self.satDetectionChevronIcon.classList.contains('uk-icon-chevron-up')) {
self.satDetectionChevronIcon.classList.remove('uk-icon-chevron-up');
self.satDetectionChevronIcon.classList.add('uk-icon-chevron-down');
self.satDetectionContent.style.display = 'none';
self.satObs.hide();
}
}
if (self.forcingBoundary) self.forcingBoundary.hide();
self.control.clear();
self.control.hideTable();
......@@ -422,7 +400,6 @@ module STWkit {
}
export class CardControl extends L.Control {
private id: any;
......@@ -441,8 +418,11 @@ module STWkit {
private selectCalculationMode: HTMLSelectElement;
private uncertaintyInput: HTMLInputElement;
private startButton: HTMLButtonElement;
private type: string;
private subtype: string;
private name: string;
private initials: string;
constructor(options) {
super(options);
this.domain = "HELCOM";
......@@ -473,7 +453,7 @@ module STWkit {
self.setup(map);
} else {
reqwest({
url: "lang/itracer." + self.lang + ".json",
url: "lang/"+self.name+"." + self.lang + ".json",
method: 'get',
type: 'json',
success: function (lang) {
......@@ -605,10 +585,10 @@ module STWkit {
self.openCard(id, open);
});
var param = STWkit.getURLParams();
var ooload = STWkit.getParamValue('ooload', param);
if (ooload !== null) {
var load = STWkit.getParamValue(self.initials+'load', param);
if (load !== null) {
reqwest({
url: "input/" + ooload,
url: "input/" + load,
method: 'get',
type: 'json',
success: function (inputjson) {
......@@ -617,7 +597,7 @@ module STWkit {
'geojson': inputjson
});
window.dispatchEvent(cardevt);
STWkit.deleteParam('ooload', param);
STWkit.deleteParam(self.initials+'load', param);
STWkit.updateUrl(param);
}
});
......@@ -631,7 +611,7 @@ module STWkit {
public open(geojson) {
var self = this;
if (geojson.features[0].properties.type == 'oil' && geojson.features[0].properties.subtype == 'observation') {
if (geojson.features[0].properties.type == self.type && geojson.features[0].properties.subtype == self.subtype) {
self.clear();
for (var i in self.cardMap) {
if (self.cardMap.hasOwnProperty(i)) {
......@@ -655,7 +635,7 @@ module STWkit {
var self = this;
self.compname = name;
var p = STWkit.getURLParams();
var pindex = STWkit.getParamIndex('oo', 1, p);
var pindex = STWkit.getParamIndex(self.initials, 1, p);
if (pindex >= 0) {
p[pindex][1] = 0;
if (history.pushState) {
......@@ -670,10 +650,10 @@ module STWkit {
}
}
var gindex = STWkit.getParamIndex('guide', 'oo', p);
var gindex = STWkit.getParamIndex('guide', self.initials, p);
if (gindex >= 0) {
reqwest({
url: 'guide/oo',
url: 'guide/'+self.initials,
method: 'get',
type: 'json',
success: function (guide) {
......@@ -686,13 +666,13 @@ module STWkit {
});
intro.oncomplete(function() {
var param = STWkit.getURLParams();
if (STWkit.hasParam('guide', 'oo', param)) STWkit.replaceParam('guide', 'player', param);
if (STWkit.hasParam('guide', self.initials, param)) STWkit.replaceParam('guide', 'player', param);
STWkit.updateUrl(param);
self.startButton.click();
});
intro.onexit(function () {
var param = STWkit.getURLParams();
if (STWkit.hasParam('guide', 'oo', param)) STWkit.deleteParam('guide', param);
if (STWkit.hasParam('guide', self.initials, param)) STWkit.deleteParam('guide', param);
STWkit.updateUrl(param);
});
intro.start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment