Commit b5b0d392 authored by Niels Holt's avatar Niels Holt

Merge branch 'release/2.1.1'

parents fc39fe8e 82415930
{
"browserslist": [
"last 1 Chrome versions" //Google Chrome.
, "last 1 Firefox versions" //Mozilla Firefox.
, "ie >= 9" //Explorer Internet Explorer.
, "last 1 Edge versions" //Microsoft Edge.
, "last 1 iOS versions" //iOS Safari.
, "last 1 Opera versions" //Opera.
, "last 1 Safari versions" //desktop Safari.
, "last 1 ExplorerMobile versions" //Internet Explorer Mobile.
// Other
, "last 1 Android versions" //Android WebView.
, "last 1 BlackBerry versions" //Blackberry browser.
, "last 1 ChromeAndroid versions" //Chrome for Android (in Other section, because mostly same as common Chrome).
, "last 1 FirefoxAndroid versions" //Firefox for Android.
, "last 1 OperaMobile versions" //Opera Mobile.
// , "last 1 OperaMini versions" //Opera Mini
]
}
\ No newline at end of file
{
"env": {
"browser": true,
"jquery" : true
},
"extends": "eslint:recommended",
"globals": {
"$" : false,
"L" : false,
"window" : false,
"document" : false,
"undefined" : false,
"moment" : false,
"Raven" : false
},
"allowInlineConfig": true,
"rules": {
"strict" : "error",
"camelcase" : "off",
"no-mixed-spaces-and-tabs": "warn",
"semi" : "warn",
"no-extra-semi" : "warn"
}
}
/*.bak
/node_modules/
/bower_components/
/.sass-cache/
/dist/
/dev/
*.bak
.*.swp
/dist/
/temp*/
\ No newline at end of file
{
"bitwise" : true,
"curly" : false,
"eqeqeq" : false,
"es3" : false,
"es5" : false,
"esnext" : false,
"forin" : false,
"freeze" : true,
"funcscope" : false,
"futurehostile" : true,
"iterator" : false,
"latedef" : true,
"lastsemic" : true,
"noarg" : true,
"nocomma" : false,
"nonew" : true,
"notypeof" : true,
"shadow" : false,
"strict" : true,
"sub" : true,
"undef" : true,
"unused" : true,
"boss" : true,
"eqnull" : true,
"node" : true,
"globals": {
"jQuery" : true,
"console" : false,
"module" : true,
"document" : false,
"L" : true,
"Raven" : true,
"$" : false,
"moment" : false,
"_" : false,
"DEBUG" : false,
"alert" : false
}
}
//Compression options for UglifyJS
{
// "sequences" : true, //(default: true) -- join consecutive simple statements using the comma operator. May be set to a positive integer to specify the maximum number of consecutive comma sequences that will be generated. If this option is set to true then the default sequences limit is 200. Set option to false or 0 to disable. The smallest sequences length is 2. A sequences value of 1 is grandfathered to be equivalent to true and as such means 200. On rare occasions the default sequences limit leads to very slow compress times in which case a value of 20 or less is recommended.
// "properties" : true, //-- rewrite property access using the dot notation, for example foo["bar"] → foo.bar
// "dead_code" : true, //-- remove unreachable code
// "drop_debugger" : notDEBUG, //-- remove debugger; statements
// "unsafe" : true, //(default: false) -- apply "unsafe" transformations (discussion below)
// "unsafe_comps" : true, //(default: false) -- Reverse < and <= to > and >= to allow improved compression. This might be unsafe when an at least one of two operands is an object with computed values due the use of methods like get, or valueOf. This could cause change in execution order after operands in the comparison are switching. Compression only works if both comparisons and unsafe_comps are both set to true.
// "conditionals" : true, //-- apply optimizations for if-s and conditional expressions
// "comparisons" : true, //-- apply certain optimizations to binary nodes, for example: !(a <= b) → a > b (only when unsafe_comps), attempts to negate binary nodes, e.g. a = !b && !c && !d && !e → a=!(b||c||d||e) etc.
// "evaluate" : true, //-- attempt to evaluate constant expressions
// "booleans" : true, //-- various optimizations for boolean context, for example !!a ? b : c → a ? b : c
// "loops" : true, //-- optimizations for do, while and for loops when we can statically determine the condition
// "unused" : true, //-- drop unreferenced functions and variables
// "hoist_funs" : true, //-- hoist function declarations
// "hoist_vars" : true, //(default: false) -- hoist var declarations (this is false by default because it seems to increase the size of the output in general)
// "if_return" : true, //-- optimizations for if/return and if/continue
// "join_vars" : true, //-- join consecutive var statements
// "cascade" : true, //-- small optimization for sequences, transform x, x into x and x = something(), x into x = something()
// "collapse_vars" : true, //-- default false. Collapse single-use var and const definitions when possible.
// "warnings" : DEBUG, //-- display warnings when dropping unreachable code or unused declarations etc.
// "negate_iife" : true, //-- negate "Immediately-Called Function Expressions" where the return value is discarded, to avoid the parens that the code generator would insert.
// "pure_getters" : false, //-- the default is false. If you pass true for this, UglifyJS will assume that object property access (e.g. foo.bar or foo["bar"]) doesn't have any side effects.
// "pure_funcs" : null, //-- default null. You can pass an array of names and UglifyJS will assume that those functions do not produce side effects. DANGER: will not check if the name is redefined in scope. An example case here, for instance var q = Math.floor(a/b). If variable q is not used elsewhere, UglifyJS will drop it, but will still keep the Math.floor(a/b), not knowing what it does. You can pass pure_funcs: [ 'Math.floor' ] to let it know that this function won't produce any side effect, in which case the whole statement would get discarded. The current implementation adds some overhead (compression will be slower).
// "drop_console" : notDEBUG, //-- default false. Pass true to discard calls to console.* functions.
// "keep_fargs" : true, //-- default true. Prevents the compressor from discarding unused function arguments. You need this for code which relies on Function.length.
// "keep_fnames" : true, //-- default false. Pass true to prevent the compressor from discarding function names. Useful for code relying on Function.prototype.name. See also: the keep_fnames mangle option.
// "passes" : 1 //-- default 1. Number of times to run compress. Use an integer argument larger than 1 to further reduce code size in some cases. Note: raising the number of passes will increase uglify compress time.
}
\ No newline at end of file
{
"isApplication" : true, //true for stand-alone applications. false for packages/plugins
"haveJavaScript" : true, //true if the packages have js-files
"haveStyleSheet" : true, //true if the packages have css and/or scss-files
"haveGhPages" : false, //true if there is a branch "gh-pages" used for demos
"minimizeBowerComponentsJS" : true, //Only for application: Minifies the bower components js-file
"minimizeBowerComponentsCSS" : true, //Only for application: Minifies the bower components css-file
"beforeProdCmd" : "", //Cmd to be run at the start of prod-task. Multi cmd can be separated by "&"
"beforeDevCmd" : "", //Cmd to be run at the start of dev-task. Multi cmd can be separated by "&"
"afterProdCmd" : "", //Cmd to be run at the end of prod-task. Multi cmd can be separated by "&"
"afterDevCmd" : "", //Cmd to be run at the end of dev-task. Multi cmd can be separated by "&"
"exitOnJSHintError" : true, //if false any error in JSHint will not exit the task
"cleanUp" : true, //In debug: set to false
"bowerCheckExistence" : true, //true=all bower components must be present. false=allows missing files (only in debug)
"bowerDebugging" : false
}
Copyright (c) 2016 Danish Defence
Copyright (c) 2016 Niels Holt
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
*****************************************************
THIS IS A DEVELOPMENT VERSION OF
{APPLICATION_NAME}
IT IS *ONLY* FOR INTERNAL USE BY FCOO
*****************************************************
-->
<html lang="cl" style="font-size: 100%">
<head>
<title>{TITLE} - DEVELOPMENT</title>
<meta charset="utf-8" />
<meta http-equiv='x-dns-prefetch-control' content='on'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name='copyright' content='fcoo.dk'>
<meta name='owner' content='fcoo.dk'>
<meta name="application-name" content="fcoo.dk">
<!-- bower:css -->
<!-- endbower -->
{LINK_CSS}
</head>
<body>
<div id="map"></div>
<!-- bower:js -->
<!-- endbower -->
{SCRIPT_JS}
</body>
</html>
\ No newline at end of file
......@@ -19,33 +19,34 @@ CONTACT : info@fcoo.dk
<meta charset="utf-8" />
<meta http-equiv='x-dns-prefetch-control' content='on'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name='copyright' content='fcoo.dk'>
<meta name='owner' content='fcoo.dk'>
<meta name="application-name" content="fcoo.dk">
<meta name="apple-mobile-web-app-title" content="fcoo.dk">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="manifest" href="manifest.json">
<meta name="msapplication-TileImage" content="/apple-touch-icon.png">
<meta name="msapplication-TileColor" content="#1C4B88">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="shortcut icon" href="/apple-touch-icon.png">
<!-- <meta http-equiv="refresh" content="30"> -->
<!-- <meta name='description' content='150 words'> -->
<!-- <meta name='subject' content='your website's subject'> -->
<!-- <meta http-equiv='Expires' content='0'> -->
{HEAD}
<meta name='copyright' content='fcoo.dk'>
<meta name='owner' content='fcoo.dk'>
<link href="{CSS_FILE_NAME}" rel="stylesheet">
</head>
<body>
{BODY}
<div id="map"></div>
<script type="text/javascript" src="{JS_FILE_NAME}"></script>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.fcoo.dk/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//analytics.fcoo.dk/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
</body>
</html>
Directory for images used in the html-document
\ No newline at end of file
(function (L /*, window, document, undefined*/) {
"use strict";
L.Control.FcooLocate = L.Control.Locate.extend({
start: function() {
L.Control.Locate.prototype.start.call(this);
this._map.fire('startlocator', this);
},
stop: function() {
L.Control.Locate.prototype.stop.call(this);
this._map.fire('stoplocator', this);
}
});
}(L, this, document));
\ No newline at end of file
;(function (L, window, document, undefined){
(function (L /*, window, document, undefined*/){
"use strict";
......@@ -41,7 +41,7 @@
});
//L.Control.Layers.include({
L.Control.CategorizedLayers.include({
L.Control.CategorizedLayers.include({
chooseBaseLayer: function(name) {
//console.log('Choosing baselayer');
var layer, obj, i;
......
;(function (L, window, document, undefined){
(function (L /*, window, document, undefined*/){
"use strict";
/**
......
;(function (L, window, document, undefined){
(function (L /*, window, document, undefined*/){
"use strict";
L.Control.Permalink.include({
......
;(function (L, window, document, undefined){
(function (L /*, window, document, undefined*/){
"use strict";
L.Control.Permalink.include({
......
(function (window, document, undefined){
(function (window /*, document, undefined*/){
"use strict";
/*jslint browser: true*/
/*global updateUrlParameter*/
......@@ -14,19 +14,19 @@
* @param String lang the language id
* @return String the localized text item or the id if there's no translation found
*/
function getI18n(key, lang) {
function getI18n(key, lang) {
var i18n = {
en: {
'fcoo-name' : 'Defence Centre for Operational Oceanography',
'ifm-name' : 'Marine Forecast',
'fcoo-name' : 'Defence Centre for Operational Oceanography',
'ifm-name' : 'Marine Forecast',
'domain-denmark' : 'Denmark',
'domain-greenland' : 'Greenland',
'domain-faroe_islands': 'Faroe Islands',
'domain-mediterranean': 'Mediterranean',
'domain-indian_ocean' : 'Indian Ocean',
'domain-denmark' : 'Denmark',
'domain-greenland' : 'Greenland',
'domain-faroe_islands': 'Faroe Islands',
'domain-mediterranean': 'Mediterranean',
'domain-indian_ocean' : 'Indian Ocean',
maps: 'Maps',
maps: 'Maps',
layers: 'Layers',
boundaries: 'Boundaries',
places: 'Places',
......@@ -65,14 +65,14 @@
//visibility: 'Erseqqarissuseq'
//},
da: {
'fcoo-name' : 'Forsvarets Center for Operativ Oceanografi',
'ifm-name' : 'Sejladsudsigt',
'fcoo-name' : 'Forsvarets Center for Operativ Oceanografi',
'ifm-name' : 'Sejladsudsigt',
'domain-denmark' : 'Danmark',
'domain-greenland' : 'Grønland',
'domain-faroe_islands': 'Færøerne',
'domain-mediterranean': 'Middelhavet',
'domain-indian_ocean' : 'Indiske Ocean',
'domain-denmark' : 'Danmark',
'domain-greenland' : 'Grønland',
'domain-faroe_islands': 'Færøerne',
'domain-mediterranean': 'Middelhavet',
'domain-indian_ocean' : 'Indiske Ocean',
'maps': 'Kort',
'Home': 'Hjem',
......@@ -171,9 +171,9 @@
// 1. try to read URL parameter 'lang'
lang = window.getUrlParameters()['lang'];
lang = window.getUrlParameters()['lang'];
/*
if (qs) {
if (qs) {
if (qs.substring(0, 1) === '?') {
qs = qs.substring(1);
}
......
;(function ($, L, window, document, undefined){
(function ($, L, window /*, document, undefined*/){
"use strict";
/**
......@@ -41,7 +41,6 @@
*/
this.changeDatetime = function (type, arg) {
var i, j, k,
myOverlays,
layergroup,
layer,
timesteps,
......@@ -49,7 +48,6 @@
popstr,
t,
dt;
myOverlays = overlays;
if (type == 'datetime') {
for (i in overlays) {
layergroup = overlays[i];
......@@ -284,7 +282,7 @@
//map.fire('viewreset');
//});
//map.attributionControl.setPrefix(window.version !== undefined ? "Version: "+window.version : "");
//map.attributionControl.setPrefix(window.version !== undefined ? "Version: "+window.version : "");
//if (version !== undefined) {
// map.attributionControl.setPrefix("<a href='" + location.protocol + "//fcoo.dk/ifm-maps/'>IFM Maps version: " + version + "</a>");
//} else {
......@@ -514,7 +512,7 @@
var appendOverlays = 'Safety.MSI%2CSafety.Firing warnings';
var overlayNames = permalinkControl.options.layers.overlayNames();
if (overlayNames === '') {
appendOverlays = appendOverlays;
//appendOverlays = appendOverlays;
} else {
appendOverlays = permalinkControl.options.layers.overlayNames() + '%2C' + appendOverlays;
}
......@@ -778,7 +776,7 @@
text: window.getI18n('Locate', localLang),
callback: function (results) {
if (results.length === 0) {
console.log("ERROR: didn't find a result");
window.noty({text: "ERROR: didn't find a result", type: 'error'});
return;
}
var bbox = results[0].boundingbox,
......
;(function ($, L, Raven, window, document, undefined){
(function ($, L, Raven, window /*, document, undefined*/){
"use strict";
// Let raven report all uncaught exceptions to sentry
......@@ -36,7 +36,7 @@
var overlays2; // For impact maps test
var lang = window.getLocalLanguage();
var store = new L.Control.FcooLayerStore({language: lang});
//var istore = new L.Control.ImpactLayerStore({language: lang});
//var istore = new L.Control.ImpactLayerStore({language: lang});
var basemap = "FCOO Standard";
var langs = ['da', 'en'];
var useGeoMetoc = false;
......@@ -68,9 +68,9 @@
}
});
switch (window.domain){
//*********************************
case 'denmark':
switch (window.domain){
//*********************************
case 'denmark':
zoom = 7;
lat = 55.7;
lon = 11.1;
......@@ -124,9 +124,9 @@
},
"Safety": {
"MSI": new L.GeoJSON.MSI({
language: lang,
protocol: protocol
}),
language: lang,
protocol: protocol
}),
"Firing warnings": L.layerGroup([new L.GeoJSON.Fwarn({language: lang, protocol: protocol}), store.getFiringAreas()])
},
"Celestial information": {
......@@ -137,10 +137,10 @@
}
};
break;
break;
//*********************************
case 'faroe_islands':
//*********************************
case 'faroe_islands':
overlays = {
"Short range forecasts": {
"wind": store.getLayer({'dataset': 'DMI/HIRLAM/S03', 'parameter': 'windDirection', 'options': stdOpts, wmsParams: {styles: 'vector_method=color_quiver1,vector_spacing=80,vector_offset=20'}, legendParams: {show: true}}),
......@@ -187,10 +187,10 @@
zoom = 7;
lat = 61.5;
lon = -6.0;
break;
break;
//*********************************
case 'greenland':
//*********************************
case 'greenland':
zoom = 6;
lat = 62.0;
lon = -45.0;
......@@ -245,10 +245,10 @@
"SAR": store.getSAR()
}
};
break;
break;
//*********************************
case 'indian_ocean':
//*********************************
case 'indian_ocean':
overlays = {
"Forecasts": {
"wind": store.getLayer({'dataset': 'ECMWF/DXD/AFR', 'parameter': 'windDirection', 'options': stdOpts, wmsParams: {styles: 'vector_method=color_quiver1,vector_spacing=80,vector_offset=20'}, legendParams: {show: true}}),
......@@ -279,10 +279,10 @@
zoom = 5;
lat = 0.0;
lon = 56.0;
break;
break;
//*********************************
case 'mediterranean':
//*********************************
case 'mediterranean':
overlays = {
"Forecasts": {
"wind": store.getLayer({'dataset': 'ECMWF/DXD/MEDITERRANEAN', 'parameter': 'windDirection', 'options': stdOpts, wmsParams: {styles: 'vector_method=color_quiver1,vector_spacing=80,vector_offset=20'}, legendParams: {show: true}}),
......@@ -313,10 +313,10 @@
zoom = 5;
lat = 36.8;
lon = 20.4;
break;
break;
//*********************************
case 'europe':
//*********************************
case 'europe':
overlays = {
"Forecasts": {
"wind": store.getLayer({'dataset': 'ECMWF/DXD/ATLANTIC', 'parameter': 'windDirection', 'options': stdOpts, wmsParams: {styles: 'vector_method=color_quiver1,vector_spacing=80,vector_offset=20'}, legendParams: {show: true}}),
......@@ -344,20 +344,20 @@
lon = -18.0;
break;
//*********************************
default:
var hash = window.location.hash.slice(1),
search = window.location.search,
href = window.location.href,
hrefArray = href.split('/');
hrefArray.pop();
hrefArray.push('select');
hrefArray.push('index.html');
//*********************************
default:
var hash = window.location.hash.slice(1),
search = window.location.search,
href = window.location.href,
hrefArray = href.split('/');
hrefArray.pop();
hrefArray.push('select');
hrefArray.push('index.html');
window.location.href = hrefArray.join('/') + search + (hash ? '#' + hash : '');
return;
//throw new Error('Valid domain not specified: ' + window.domain);
}
window.location.href = hrefArray.join('/') + search + (hash ? '#' + hash : '');
return;
//throw new Error('Valid domain not specified: ' + window.domain);
}
/*
if (window.domain === 'denmark_impact') {
zoom = 7;
......@@ -1116,6 +1116,6 @@
window.createCommonMap(store, basemap, maps, minZoom, maxZoom, zoom, lat, lon, enablePrint, useGeoMetoc, mapStore);
//console.profileEnd();
});
});
})(jQuery, L, Raven, this, document);
......@@ -16,8 +16,8 @@
</head>
<body>
<div class="container">
<a class="show-for-lang-da" href="//fcoo.dk/" border="0"><img class="logo" width="270" height="90" src="//media.fcoo.dk/logos/FCOO_logo_270x90.png" alt="Forsvarets Center for Operativ Oceanografi"></a>
<a class="show-for-lang-en" href="//fcoo.dk/?lang=eng" border="0"><img class="logo" width="270" height="90" src="//media.fcoo.dk/logos/FCOO_logo_270x90.png" alt="Defence Centre for Operational Oceanography"></a>
<a class="show-for-lang-da" href="//fcoo.dk/" border="0"><img class="logo" width="270" height="90" src="../images/FCOO_logo_270x90.png" alt="Forsvarets Center for Operativ Oceanografi"></a>
<a class="show-for-lang-en" href="//fcoo.dk/?lang=eng" border="0"><img class="logo" width="270" height="90" src="../images/FCOO_logo_270x90.png" alt="Defence Centre for Operational Oceanography"></a>
<h1 class="show-for-lang-da">Sejladsudsigt</h1>
<h1 class="show-for-lang-en">Marine Forecast</h1>
......
/*
SCSS for start page of ifm.fcoo.dk
*/
//Default = lang-da
.show-for-lang-da { display: inherit !important; }
.show-for-lang-en { display: none !important; }
.lang-en {
.show-for-lang-en { display: inherit !important; }
.show-for-lang-da { display: none !important; }
}
body {
background-color: white;
margin: 0;
padding: 0;
overflow: hidden;
.container {
box-sizing: border-box;
margin : 0 auto;
width : 100%;
max-width : 480px;
min-width : 280px;
height : 100%;
min-height: 480px;
}
.logo, select, #map {
display: block;
margin : 0 auto;
padding: 0;
}
h1 {
margin: 5px;
text-align: center;
color: #1c4b88;
font-size: 16pt;
font-weight: bold;
font-family: Tahoma,Helvetica,sans-serif;
}
select {
width: 250px;
}
select, select option {
color: #1c4b88;
font-size: 12pt;
font-weight: bold;
font-family: Tahoma,Helvetica,sans-serif;
text-align: center;
text-align-last:center; //Chrome
}
#map {
margin-top: 10px;
width : 100%;
height : 300px;
}
@media screen and (min-height: 481px) and (max-height: 568px) { #map {height: 380px; } }
@media screen and (min-height: 569px) and (max-height: 640px) { #map {height: 450px; } }
@media screen and (min-height: 641px) { #map {height: 550px; } }
}
Directory for stylesheets and SASS files
\ No newline at end of file
#map {
height: 100%; }
/* Container for multiple maps on a page */
.map-container {
border: 1px solid black;
margin: 2px;
float: left; }
.fcoo-layercontrol-header {
font-size: larger;
font-weight: bold;
display: block;
position: relative; }
.fcoo-title {
font-size: x-large;
font-weight: bold;
display: block;
background-color: white;
position: relative;
z-index: 9999; }
.icon-location {
font-size: 18px; }