Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
richterb committed Nov 5, 2024
2 parents 6c66328 + 10daaab commit 127c02c
Show file tree
Hide file tree
Showing 30 changed files with 1,403 additions and 1,840 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.17.0
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
This log tries to follow the good principles of [Keep a CHANGELOG](http://keepachangelog.com/).


## 2.1.1 - 2024-11-05

### Added
- `odsPicto`: New `local-id` parameter that is used to clone a reference SVG prexisting in the page,
to avoid having to fetch the SVG remotely.
- `odsSocialButtons`: Twitter logo has been replaced with the new X logo.
- `odsTable`: Every text field is now sortable.

## 2.1.0 - 2023-10-03
This version notably adds the support of jQuery 3, while keeping compatibility with jQuery 2 as well.

Expand Down
34 changes: 25 additions & 9 deletions dist/libs/ods-clustermarker/clustermarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ L.ClusterMarker = L.FeatureGroup.extend({
getClusterShape: function() {
return this._clusterShape;
},
_escapeHtmlValue: function(html) {
if (!html) {
return html;
}
if (typeof html !== 'string') {
return html;
}
return html
.replace(/&(?!#?\w+;)/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
},
_getMarkerIcon: function(color,
opacity,
count,
Expand Down Expand Up @@ -133,15 +147,17 @@ L.ClusterMarker = L.FeatureGroup.extend({
var sizeStyle = size + 'px';
return L.divIcon({
html: '<div class="cluster-marker-circle" ' +
' style="width: ' + sizeStyle + '; ' +
' height: ' + sizeStyle + '; ' +
' background-color: ' + bgcolor.css() + '; ' +
' border: solid ' + borderSize + 'px '+ realBorderColor.css('rgba') +'; ' +
' top: calc(-'+sizeStyle+'/2); ' +
' left: calc(-'+sizeStyle+'/2); ' +
' opacity: ' + opacity + '; ' +
' font-size: '+textSize+'px;">' +
'<span style="color: ' + textcolor.css() + '; line-height: ' + sizeStyle + ';">' + displayedNumber + '</span>' +
' style="width: ' + this._escapeHtmlValue(sizeStyle) + '; ' +
' height: ' + this._escapeHtmlValue(sizeStyle) + '; ' +
' background-color: ' + this._escapeHtmlValue(bgcolor.css()) + '; ' +
' border: solid ' + this._escapeHtmlValue(borderSize) + 'px '+ this._escapeHtmlValue(realBorderColor.css('rgba')) +'; ' +
' top: calc(-'+this._escapeHtmlValue(sizeStyle)+'/2); ' +
' left: calc(-'+this._escapeHtmlValue(sizeStyle)+'/2); ' +
' opacity: ' + this._escapeHtmlValue(opacity) + '; ' +
' font-size: '+this._escapeHtmlValue(textSize)+'px;">' +
' <span style="color: ' + this._escapeHtmlValue(textcolor.css()) + '; line-height: ' + this._escapeHtmlValue(sizeStyle) + ';">' +
this._escapeHtmlValue(displayedNumber) +
' </span>' +
'</div>',
className: 'cluster-marker'
});
Expand Down
34 changes: 6 additions & 28 deletions dist/libs/ods-map/ods-tilelayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ L.ODSTileLayer = L.TileLayer.extend({
var attrib = this._addAttributionPart('', prependAttribution);

if (basemap.provider === 'opencycle' || basemap.provider === 'osmtransport') {
attrib = this._addAttributionPart(attrib, 'Tiles Courtesy of <a href="http://www.thunderforest.com" target="_blank">Thunderforest</a> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, 'Tiles Courtesy of <a href="http://www.thunderforest.com" target="_blank">Thunderforest</a> - Map data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, appendAttribution);
var thunderforestUrl = 'http://{s}.tile.thunderforest.com/' + (basemap.provider === 'osmtransport' ? 'transport' : 'cycle') + '/{z}/{x}/{y}.png';
if (basemap.thunderforest_api_key) {
Expand Down Expand Up @@ -100,7 +100,7 @@ L.ODSTileLayer = L.TileLayer.extend({
mapId = basemap.mapid
}

attrib = this._addAttributionPart(attrib, 'Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, 'Map data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, appendAttribution);
layerOptions = {
minZoom: 2,
Expand All @@ -118,7 +118,7 @@ L.ODSTileLayer = L.TileLayer.extend({
}
L.TileLayer.prototype.initialize.call(this, this._mapboxStylesUrl(mapId, basemap.mapbox_access_token), layerOptions);
} else if (basemap.provider === 'mapbox') {
attrib = this._addAttributionPart(attrib, 'Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, 'Map data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, appendAttribution);
layerOptions = {
minZoom: 2,
Expand All @@ -133,24 +133,6 @@ L.ODSTileLayer = L.TileLayer.extend({
layerOptions.maxZoom = basemap.maxZoom;
}
L.TileLayer.prototype.initialize.call(this, this._mapboxTilesetUrl(basemap.mapid, basemap.mapbox_access_token), layerOptions);
} else if (basemap.provider.indexOf('stamen.') === 0) {
var stamenMap = basemap.provider.substring(7);
var stamenUrl = '//stamen-tiles-{s}.a.ssl.fastly.net/' + stamenMap + '/{z}/{x}/{y}.png';

if (stamenMap === 'toner') {
attrib = this._addAttributionPart(attrib, 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.');
} else {
attrib = this._addAttributionPart(attrib, 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.');
}
attrib = this._addAttributionPart(attrib, appendAttribution);
layerOptions = {
minZoom: 2,
maxNativeZoom: 18,
maxZoom: 19,
attribution: !disableAttribution ? attrib : '',
subdomains: "abcd"
};
L.TileLayer.prototype.initialize.call(this, stamenUrl, layerOptions);
} else if (basemap.provider.startsWith('jawg.') || basemap.provider === 'mapquest') {
var jawgMaps = {
'streets': '71ba5a33-9529-48cb-8dbe-b6b9c33a3391',
Expand Down Expand Up @@ -184,9 +166,9 @@ L.ODSTileLayer = L.TileLayer.extend({
}

if (basemap.shortAttribution) {
attrib = this._addAttributionPart(attrib, '<a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16" alt="Jawg"> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a>');
attrib = this._addAttributionPart(attrib, '<a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16" alt="Jawg"> - Map data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>');
} else {
attrib = this._addAttributionPart(attrib, 'Tiles Courtesy of <a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16" alt="Jawg"> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
attrib = this._addAttributionPart(attrib, 'Tiles Courtesy of <a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16" alt="Jawg"> - Map data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors');
}
attrib = this._addAttributionPart(attrib, appendAttribution);

Expand All @@ -200,26 +182,22 @@ L.ODSTileLayer = L.TileLayer.extend({
var ignMaps = {
'planv2': {
ignLayer: 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2',
service: 'pratique',
minZoom: 1,
maxZoom: 19
},
'orthophotos': {
ignLayer: 'ORTHOIMAGERY.ORTHOPHOTOS',
imageFormat: 'image/jpeg',
service: 'pratique',
minZoom: 1,
maxZoom: 19
},
'parcellaire-express': {
ignLayer: 'CADASTRALPARCELS.PARCELLAIRE_EXPRESS',
service: 'parcellaire',
minZoom: 2,
maxZoom: 19
},
'limites-admin-express': {
ignLayer: 'LIMITES_ADMINISTRATIVES_EXPRESS.LATEST',
service: 'administratif',
minZoom: 6,
maxZoom: 16
}
Expand All @@ -237,7 +215,7 @@ L.ODSTileLayer = L.TileLayer.extend({

angular.extend(layerOptions, ignMaps[basemapName]);

var ignUrl = 'https://wxs.ign.fr/{service}/geoportail/wmts?&REQUEST=GetTile' +
var ignUrl = 'https://data.geopf.fr/wmts?&REQUEST=GetTile' +
'&SERVICE=WMTS&VERSION=1.0.0&TILEMATRIXSET=PM'+
'&LAYER={ignLayer}&STYLE=normal&FORMAT={imageFormat}'+
'&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}';
Expand Down
20 changes: 17 additions & 3 deletions dist/libs/ods-vectormarker/vectormarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,23 @@ L.VectorMarker = L.Marker.extend({
return '';
} else {

return ' style="'+styles.join('; ')+'"';
return ' style="'+this._escapeHtmlValue(styles.join('; '))+'"';
}
},
_escapeHtmlValue: function(html) {
if (!html) {
return html;
}
if (typeof html !== 'string') {
return html;
}
return html
.replace(/&(?!#?\w+;)/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
},
_getVectorIcon: function(color, icon, marker, opacity, extraClasses) {
var sizeMultiplier = this.options.size + 1;
var baseWidth = 5;
Expand Down Expand Up @@ -63,8 +77,8 @@ L.VectorMarker = L.Marker.extend({

html = '<svg id="svg-vectormarker-marker" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 56">' +
'<g id="svg-vectormarker" fill-rule="nonzero" fill="none">' +
'<path id="svg_2" fill="'+ fillColor +'" fill-rule="evenodd" d="M16 0C7.222 0 0 7.217 0 16.157c0 4.86 1.03 8.446 2.66 12.027L16 56l13.34-27.816c1.63-3.58 2.66-7.167 2.66-12.027C32 7.217 24.778 0 16 0z"/>' +
'<path stroke="' + borderColor + '" d="M16 54.844l12.886-26.868c1.79-3.933 2.614-7.42 2.614-11.82C31.5 7.52 24.527.5 16 .5 7.473.5.5 7.52.5 16.157c0 4.4.824 7.886 2.61 11.81L16 54.844z"/>' +
'<path id="svg_2" fill="'+ this._escapeHtmlValue(fillColor) +'" fill-rule="evenodd" d="M16 0C7.222 0 0 7.217 0 16.157c0 4.86 1.03 8.446 2.66 12.027L16 56l13.34-27.816c1.63-3.58 2.66-7.167 2.66-12.027C32 7.217 24.778 0 16 0z"/>' +
'<path stroke="' + this._escapeHtmlValue(borderColor) + '" d="M16 54.844l12.886-26.868c1.79-3.933 2.614-7.42 2.614-11.82C31.5 7.52 24.527.5 16 .5 7.473.5.5 7.52.5 16.157c0 4.4.824 7.886 2.61 11.81L16 54.844z"/>' +
'</g>' +
'</svg>';
if (icon) {
Expand Down
19 changes: 15 additions & 4 deletions dist/ods-widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,11 @@ html[dir=rtl] .odswidget-reuses__reuse-thumbnail-image--no-thumbnail {
text-decoration: none;
background-color: #ec643c;
}
.odswidget-social-buttons__button__fa-x-twitter {
width: 1em;
height: 1em;
vertical-align: -0.125em;
}
.odswidget-spinner__backdrop {
position: absolute;
top: 0;
Expand Down Expand Up @@ -2479,6 +2484,16 @@ html[dir=rtl] .odswidget-text-search__reset {
.odswidget-theme-picto .ods-svginliner__svg-container {
height: 100%;
}
.odswidget-theme-picto .odswidget-theme-picto__container {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
height: 100%;
}
.odswidget-theme-picto .odswidget-theme-picto__container img {
object-fit: contain;
}
/* ==========================================================================
Timerange Widget
Expand Down Expand Up @@ -2753,10 +2768,6 @@ html[dir=rtl] .odswidget-text-search__reset {
.ods-slideshow:focus {
outline: none;
}
.ods-slideshow:-webkit-full-screen {
width: 100% !important;
height: 100% !important;
}
.ods-slideshow:-ms-fullscreen {
width: 100% !important;
height: 100% !important;
Expand Down
Loading

0 comments on commit 127c02c

Please sign in to comment.