Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
stw
stwkit
Commits
009eb85a
Commit
009eb85a
authored
Sep 21, 2017
by
Tomas Pettersson
🏸
Browse files
using initials
parent
122b461a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
src/components/cards.js
View file @
009eb85a
...
...
@@ -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
oo
load
=
STWkit
.
getParamValue
(
'
oo
load
'
,
param
);
if
(
oo
load
!==
null
)
{
var
load
=
STWkit
.
getParamValue
(
self
.
initials
+
'
load
'
,
param
);
if
(
load
!==
null
)
{
reqwest
({
url
:
"
input/
"
+
oo
load
,
url
:
"
input/
"
+
load
,
method
:
'
get
'
,
type
:
'
json
'
,
success
:
function
(
inputjson
)
{
...
...
@@ -548,7 +529,7 @@ var STWkit;
'
geojson
'
:
inputjson
});
window
.
dispatchEvent
(
cardevt
);
STWkit
.
deleteParam
(
'
oo
load
'
,
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
);
});
...
...
src/components/cards.js.map
View file @
009eb85a
This diff is collapsed.
Click to expand it.
src/components/cards.ts
View file @
009eb85a
...
...
@@ -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
oo
load
=
STWkit
.
getParamValue
(
'
oo
load
'
,
param
);
if
(
oo
load
!==
null
)
{
var
load
=
STWkit
.
getParamValue
(
self
.
initials
+
'
load
'
,
param
);
if
(
load
!==
null
)
{
reqwest
({
url
:
"
input/
"
+
oo
load
,
url
:
"
input/
"
+
load
,
method
:
'
get
'
,
type
:
'
json
'
,
success
:
function
(
inputjson
)
{
...
...
@@ -617,7 +597,7 @@ module STWkit {
'
geojson
'
:
inputjson
});
window
.
dispatchEvent
(
cardevt
);
STWkit
.
deleteParam
(
'
oo
load
'
,
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment