Commit eb51b8da authored by Niels Holt's avatar Niels Holt

Adjust to fcoo-application version 5.6.0 and grunt-fcoo-grunt-plugin 4.2

Checking for document.readyState == "complete" before creating time-slider
Adjusting buttons etc. to jquery-bootstrap and font-awesome 5 Pro
New message regarding v 5.1.0
parent 6b6ce4ab
......@@ -22,56 +22,18 @@ CONTACT : info@fcoo.dk
<meta name='copyright' content='fcoo.dk'>
<meta name='owner' content='fcoo.dk'>
<meta name="google" content="notranslate" />
<script type="text/javascript">
/* fcoo/fcoo-global-switches */
!function(i){
"use strict";
var n="ios"==function(){
var n=navigator.userAgent||navigator.vendor||i.opera;
return /windows phone/i.test(n) ?
"windows_phone" :
/android/i.test(n) ?
"android" :
/iPad|iPhone|iPod/.test(n) && !i.MSStream ?
"ios" : null
}();
i.L_DISABLE_3D=n
}(this);
</script>
<link href="{CSS_FILE_NAME}" rel="stylesheet">
</head>
<body>
<div class="loading">
<div class="loading fcoo-app-background">
<div class="version fcoo-app-color"></div>
<div class="logo fcoo-app-color"></div>
</div>
<!-- <div class="fa leaflet-default-icon-path modernizr-mediaquery-media-query modernizr-mediaquery-min-max lang-flag-icon-flag lang-flag-icon-lang lang-flag-icon-flag-modernizr lang-flag-icon-lang-modernizr" style="display:none"></div> -->
<div id="map"></div>
<script type="text/javascript" src="{JS_FILE_NAME}"></script>
<script type="text/javascript" src="{JS_FILE_NAME}" defer></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>
-->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['disableCookies']);
......@@ -89,7 +51,6 @@ CONTACT : info@fcoo.dk
<noscript>
<p><img src="//analytics.fcoo.dk/piwik/piwik.php?idsite={APPLICATION_PIWIKSITEID}" style="border:0;" alt="" /></p>
</noscript>
<!-- End Piwik Code -->
</body>
......
......@@ -9,7 +9,14 @@
"date": "2018-04-18",
"url": "data/ifm-maps-v5.0.0.md",
"title": {"da":"Ny version af Sejladsudsigt (v5.0.0)", "en":"New version of Marine Forecast (v5.0.0)"}
},
{
"id": "5_1_0",
"date": "2018-06-01",
"url": "data/ifm-maps-v5.1.0.md",
"title": {"da":"Ny version af Sejladsudsigt (v5.1.0)", "en":"New version of Marine Forecast (v5.1.0)"}
}
]
}
\ No newline at end of file
<da>
Ny version af Sejladsudsigt med følgende tilføjelser og rettelser
</da>
<en>
New verison of Marine Forecast with the following additions and corrections
</en>
- <da>Korte meteorologiske prognoser for Grønland fra DMIs nye prognosemodel HARMONIE-IGB (2.5km)</da><en>Short-range weather forecast for Greenland from DMI's new forecast model HARMONIE-IGB (2.5km)</en>
- <da>Rettelse af fejl inklusiv navn til Web Application på mobile enheder ("Føj til Startskærm")</da><en>Corrections of errors including name for Web Application on mobile devices ("Add to Home Screen")</en>
- <da>Bedre og (lidt) hurtigere indlæsning af siden</da><en>Better and (a bit) faster loading of the page</en>
- <da>Zoom med muse-hjul forbedret og tilnærmet Google Maps</da><en>Zoom using the mouse wheel improved and ??? to google Maps</en>
- <da>Mindre rettelser af design, knapper og "Vis din position"</da><en>Minor corrections of design, buttons, and "Show your location"</en>
\ No newline at end of file
(function ($, L, window /*, document, undefined*/){
(function ($, L, window, document/*, undefined*/){
"use strict";
......@@ -321,13 +321,27 @@
}
// Add geocoder control
// Add geocoder control and convert to leaflet-fa-button (big fix)
map.addControl(mapStore.controls.OSMGeocoder);
$(mapStore.controls.OSMGeocoder._container).addClass("hide-for-print show-for-large-up");
var $container = $(mapStore.controls.OSMGeocoder._container),
$button = $container.find('a');
// Add text input position control
$container.addClass("leaflet-bar leaflet-control-fa-button hide-for-print show-for-large-up");
$button
.addClass('leaflet-bar-part leaflet-bar-part-single')
.append('<i class="far fa-search"/>');
// Add text input position control and convert to leaflet-fa-button (big fix)
map.addControl(mapStore.controls.position);
$(mapStore.controls.position._container).addClass("hide-for-print show-for-large-up");
$container = $(mapStore.controls.position._container),
$button = $container.find('a');
$container.addClass("leaflet-bar leaflet-control-fa-button hide-for-print show-for-large-up");
$button
.addClass('leaflet-bar-part leaflet-bar-part-single')
.css('background-image', 'none')
.append('<i class="far fa-map-marker-alt"/>');
// Add print control
if (enablePrint) {
......@@ -385,11 +399,6 @@
.append( $('<a/>')
.addClass('link')
.i18n({ da:'Vælg', en:'Select'})
//HER.on('click', function(){
//HERconsole.log(
//HER window.location.href.split('#')[0].split('?')[0] + (window.i18next.language=='en'?'?lang=en':'')
//HER)})
//HER .attr('href', window.location.href.split('#')[0].split('?')[0]) //<- not pretty
.attr( 'href', window.location.href.split('#')[0].split('?')[0]+(window.i18next.language=='en'?'?lang=en':'') ) //<- not pretty
.css({float: 'right'})
);
......@@ -425,7 +434,7 @@
var callback = callback_obj.changeDatetime;
function checkTimesteps() {
var dates = getTimeSteps(overlayMaps);
if (dates !== null) {
if ((dates !== null) && (document.readyState == "complete")) {
// Only include datetime selector in first window
if (index === 0) {
var datetimeControl;
......@@ -434,6 +443,7 @@
if (desktop) {
datetimeControl = new L.Control.TimeSlider({
lang: window.i18next.language, //TODO: removed when TimeSlider is updated
iconClassName: 'far fa-clock',
position: datetime_pos,
defaultMinimized: false,
displayAsLocal: true,
......@@ -663,7 +673,7 @@
text: window.getI18n('Locate'),
callback: function (results) {
if (results.length === 0) {
window.noty({text: "Didn't find a result", type: 'error'});
window.noty({text: {da: "Kunne ikke finde et resultat", en:"Didn't find a result"}, type: 'error'});
return;
}
var bbox = results[0].boundingbox,
......
......@@ -486,7 +486,10 @@
legendControlOptions: {inclHeader: false, containerClassName: 'leaflet-control-box-container hide-when-minimized'} //Legend with no header and hidden when minimized
});
$(document).ready(function () {
//Create top menu when all resources (js and css) are loaded
// $(document).ready(function () {
// $(window).on('load', function () {
window.fcoo.events.on('load', function () {
var topMenu =
window.fcoo.createTopMenu({
leftMenu : true,
......
.leaflet-control-geocoder a {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-control-geocoder {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
background: #fff;
border-radius: 4px;
}
.leaflet-control-geocoder a {
background-image: url(images/geocoder.png);
width: 26px;
height: 26px;
}
.leaflet-touch .leaflet-control-geocoder a {
width: 26px;
height: 26px;
}
.leaflet-control-geocoder .leaflet-control-geocoder-form,
.leaflet-control-geocoder-expanded .leaflet-control-geocoder-toggle {
display: none;
......
......@@ -12,8 +12,8 @@
"url": "git://github.com/FCOO/ifm-maps.git"
},
"dependencies": {
"fcoo-application": "fcoo/fcoo-application#^5.0.0",
"fcoo-leaflet": "fcoo/fcoo-leaflet#^4.0.0",
"fcoo-application": "https://gitlab.com/FCOO/fcoo-application.git#^5.3.0",
"fcoo-leaflet": "https://gitlab.com/fcoo/fcoo-leaflet.git#^4.3.0",
"jquery-ui": "^1.12.1",
"leaflet-control-position": "fcoo/leaflet-control-position#~0.2.5",
"leaflet-categorized-layers": "fcoo/leaflet-categorized-layers#^2.0.0",
......@@ -21,13 +21,12 @@
"leaflet-time-slider": "fcoo/leaflet-time-slider#^4.0.0",
"leaflet-control-vertical": "fcoo/leaflet-control-vertical#^2.0.0",
"leaflet-control-datetime": "fcoo/leaflet-control-datetime#^1.0.0",
"leaflet-tilelayer-wms-pydap": "fcoo/leaflet-tilelayer-wms-pydap#^4.0.0",
"leaflet-tilelayer-wms-fcoo": "fcoo/leaflet-tilelayer-wms-fcoo#^5.0.0",
"leaflet-tilelayer-wms-pydap": "https://gitlab.com/fcoo/leaflet-tilelayer-wms-pydap.git#^4.0.0",
"fcoo-leaflet-tilelayer-wms": "https://gitlab.com/fcoo/fcoo-leaflet-tilelayer-wms.git#^5.0.0",
"leaflet-geojsonlayer-fwarn": "fcoo/leaflet-geojsonlayer-fwarn#^1.0.0",
"leaflet-layer-sealevel-denmark": "fcoo/leaflet-layer-sealevel-denmark#^0.2.0",
"leaflet-layer-tides-greenland": "fcoo/leaflet-layer-tides-greenland#^0.1.5",
"leaflet-geojsonlayer-msi": "fcoo/leaflet-geojsonlayer-msi#^1.0.0",
"fcoo-leaflet-control-legend": "fcoo/fcoo-leaflet-control-legend#^2.0.0",
"babel-polyfill": "^0.0.1"
},
"overrides": {
......@@ -45,6 +44,60 @@
"main": [
"Control.OSMGeocoder.js"
]
},
"offline": {
"main": [
"offline.js"
]
},
"url.js": {
"main": [
"src/url.min.js"
]
},
"moment": {
"main": [
"moment.js",
"locale/da.js",
"locale/de.js",
"locale/sv.js",
"locale/nb.js",
"locale/fo.js"
]
},
"select2": {
"main": [
"dist/js/select2.js"
]
},
"jquery.scrollbar": {
"main": [
"jquery.scrollbar.js"
]
},
"bootstrap": {
"dependencies": {
"jquery": "latest"
},
"main": [
"dist/js/bootstrap.bundle.js"
]
},
"leaflet.locatecontrol": {
"main": [
"src/L.Control.Locate.js"
]
},
"leaflet-icon-pulse": {
"main": [
"src/L.Icon.Pulse.js",
"src/L.Icon.Pulse.css"
]
},
"leaflet-pip": {
"main": [
"leaflet-pip.js"
]
}
},
"devDependencies": {
......@@ -62,5 +115,26 @@
],
"moduleType": [
"es6"
]
],
"resolutions": {
"jquery": "~3.3.0",
"fcoo-global-events": "^1.0.0",
"fcoo-settings": "^1.3.0",
"fcoo-language": "^4.0.0",
"fcoo-number": "^1.0.0",
"fcoo-moment": "^1.0.0",
"fcoo-latlng-format": "^1.0.0",
"fcoo-value-format": "^1.1.0",
"fcoo-fontawesome": "^3.0.0",
"url.js-extensions": "^2.0.0",
"javascript-utilities": "^1.0.0",
"fcoo-polyfill": "^3.0.0",
"fcoo-modernizr-mediaquery-device": "^4.0.0",
"offline": "~0.7.18",
"imagesloaded": "~4.1.1",
"raven-js": "^3.19.0",
"url.js": "2.4.0",
"i18next-phrases": "^2.0.0",
"bootstrap": "^4.0.0"
}
}
\ No newline at end of file
......@@ -15,7 +15,9 @@ module.exports = function(grunt) {
default: {
"application" : {
"id" : "ifm", //application id. Default=0
"name" : "{'da':'Sejladsudsigt', 'en':'Marine Forecast'}", //application name. Default="FCOO.dk"
"name" : '{"da":"Sejladsudsigt", "en":"Marine Forecast"}', //application name. Default="FCOO.dk"
"name_da" : "Sejladsudsigt", //application danish name. Default=application.name
"name_en" : "Marine Forecast", //application english name. Default=application.name
"color" : "", //background-color of favicons. Default="" => blue color of FCOO's logo. Must have format "#123456"
"faviconColor" : "", //Color of the favicon. Default = "" => automatic set to highest contrast to "color" between 'white' and 'blue color of FCOO's logo'
......
This diff is collapsed.
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