@geogirafe/lib-geoportal 1.1.0-dev.2334445027 → 1.1.0-dev.2361375621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/assets/i18n/de.json +3 -0
- package/assets/i18n/en.json +3 -0
- package/assets/i18n/fr.json +3 -0
- package/assets/i18n/it.json +3 -0
- package/assets/icons/3-dots-fade.svg +1 -0
- package/components/selectiongrid/tools/selectiontabulatormanager.js +5 -1
- package/components/share/component.d.ts +2 -0
- package/components/share/component.js +21 -4
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/utils/utils.js +1 -1
- package/tools/utils/utils.spec.js +5 -0
package/LICENSE
CHANGED
|
@@ -264,4 +264,31 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
264
264
|
|
|
265
265
|
-------------------------------------------------------------------------------
|
|
266
266
|
|
|
267
|
+
From:
|
|
268
|
+
- https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/3-dots-fade.svg
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
The MIT License (MIT)
|
|
272
|
+
|
|
273
|
+
Copyright (c) Utkarsh Verma
|
|
274
|
+
|
|
275
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
276
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
277
|
+
the Software without restriction, including without limitation the rights to
|
|
278
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
279
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
280
|
+
subject to the following conditions:
|
|
281
|
+
|
|
282
|
+
The above copyright notice and this permission notice shall be included in all
|
|
283
|
+
copies or substantial portions of the Software.
|
|
284
|
+
|
|
285
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
286
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
287
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
288
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
289
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
290
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
291
|
+
|
|
292
|
+
-------------------------------------------------------------------------------
|
|
293
|
+
|
|
267
294
|
===============================================================================
|
package/assets/i18n/de.json
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"contains": "enthält",
|
|
54
54
|
"Control opacity": "Deckkraft steuern",
|
|
55
55
|
"Copy ShortUrl": "Kurz-URL kopieren",
|
|
56
|
+
"Copy to Clipboard": "In die Zwischenablage kopieren",
|
|
56
57
|
"Copy value": "Wert kopieren",
|
|
57
58
|
"Create custom theme": "Thema erstellen",
|
|
58
59
|
"cross-section-settings": "Querschnitt",
|
|
@@ -150,6 +151,8 @@
|
|
|
150
151
|
"Generate and copy code": "Code generieren und kopieren",
|
|
151
152
|
"Generate and copy link": "Link generieren und kopieren",
|
|
152
153
|
"Generate CSV": "CSV generieren",
|
|
154
|
+
"Generating code": "Code wird generiert",
|
|
155
|
+
"Generating link": "Link wird generiert",
|
|
153
156
|
"GeoJSON": "GeoJSON",
|
|
154
157
|
"Geolocation browser error": "Ihr Browser unterstützt keine Geolokalisierung",
|
|
155
158
|
"Geolocation error": "Geolocation-Fehler",
|
package/assets/i18n/en.json
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"contains": "contains",
|
|
54
54
|
"Control opacity": "Control opacity",
|
|
55
55
|
"Copy ShortUrl": "Copy ShortUrl",
|
|
56
|
+
"Copy to Clipboard": "Copy to Clipboard",
|
|
56
57
|
"Copy value": "Copier value",
|
|
57
58
|
"Create custom theme": "Create custom theme",
|
|
58
59
|
"cross-section-settings": "Cross-section",
|
|
@@ -151,6 +152,8 @@
|
|
|
151
152
|
"Generate and copy code": "Generate and copy code",
|
|
152
153
|
"Generate and copy link": "Generate and copy link",
|
|
153
154
|
"Generate CSV": "Generate CSV",
|
|
155
|
+
"Generating code": "Generating code",
|
|
156
|
+
"Generating link": "Generating link",
|
|
154
157
|
"GeoJSON": "GeoJSON",
|
|
155
158
|
"Geolocation browser error": "Your browser does not support geolocation",
|
|
156
159
|
"Geolocation error": "Geolocation error",
|
package/assets/i18n/fr.json
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"contains": "contient",
|
|
54
54
|
"Control opacity": "Contrôler l'opacité",
|
|
55
55
|
"Copy ShortUrl": "Copier le lien court",
|
|
56
|
+
"Copy to Clipboard": "Copier dans le presse-papiers",
|
|
56
57
|
"Copy value": "Copier la valeur",
|
|
57
58
|
"Create custom theme": "Créer un thème personnalisé",
|
|
58
59
|
"cross-section-settings": "Coupe transversale",
|
|
@@ -150,6 +151,8 @@
|
|
|
150
151
|
"Generate and copy code": "Générer et copier le code",
|
|
151
152
|
"Generate and copy link": "Générer et copier le lien",
|
|
152
153
|
"Generate CSV": "Générer CSV",
|
|
154
|
+
"Generating code": "Génération du code",
|
|
155
|
+
"Generating link": "Génération du lien",
|
|
153
156
|
"GeoJSON": "GeoJSON",
|
|
154
157
|
"Geolocation browser error": "Votre navigateur ne supporte pas la géolocalisation",
|
|
155
158
|
"Geolocation error": "Erreur de géolocalisation",
|
package/assets/i18n/it.json
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"contains": "contiene",
|
|
54
54
|
"Control opacity": "Controlla opacità",
|
|
55
55
|
"Copy ShortUrl": "Copia ShortUrl",
|
|
56
|
+
"Copy to Clipboard": "Copia negli appunti",
|
|
56
57
|
"Copy value": "Copia il valore",
|
|
57
58
|
"Create custom theme": "Crea un tema personalizzato",
|
|
58
59
|
"cross-section-settings": "Sezione trasversale",
|
|
@@ -150,6 +151,8 @@
|
|
|
150
151
|
"Generate and copy code": "Genera e copia il codice",
|
|
151
152
|
"Generate and copy link": "Genera e copia il link",
|
|
152
153
|
"Generate CSV": "Genera CSV",
|
|
154
|
+
"Generating code": "Generazione del codice",
|
|
155
|
+
"Generating link": "Generazione del link",
|
|
153
156
|
"GeoJSON": "GeoJSON",
|
|
154
157
|
"Geolocation browser error": "Il tuo browser non supporta la geolocalizzazione",
|
|
155
158
|
"Geolocation error": "Errore di geolocalizzazione",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="4" cy="12" r="3"><animate id="b" fill="freeze" attributeName="opacity" begin="0;a.end-0.25s" dur="0.75s" values="1;.2"/></circle><circle cx="12" cy="12" r="3" opacity=".4"><animate fill="freeze" attributeName="opacity" begin="b.begin+0.15s" dur="0.75s" values="1;.2"/></circle><circle cx="20" cy="12" r="3" opacity=".3"><animate id="a" fill="freeze" attributeName="opacity" begin="b.begin+0.3s" dur="0.75s" values="1;.2"/></circle></svg>
|
|
@@ -2,6 +2,7 @@ import FeatureToGridDataById from '../../../tools/featuretogriddatabyid.js';
|
|
|
2
2
|
import { TabulatorFull as Tabulator } from 'tabulator-tables';
|
|
3
3
|
import { getUid } from 'ol/util.js';
|
|
4
4
|
import ColumnAliasHelper from '../../../tools/utils/aliases.js';
|
|
5
|
+
import { linkify } from '../../../tools/utils/utils.js';
|
|
5
6
|
const geometryColumns = new Set(['geom', 'the_geom', 'geometry']);
|
|
6
7
|
export default class SelectionTabulatorManager {
|
|
7
8
|
featureToGridData;
|
|
@@ -140,10 +141,13 @@ export default class SelectionTabulatorManager {
|
|
|
140
141
|
const columns = entry.columns;
|
|
141
142
|
const notOlProperties = entry.notOlProperties;
|
|
142
143
|
for (const [_, row] of Object.entries(notOlProperties)) {
|
|
143
|
-
for (const [key,
|
|
144
|
+
for (const [key, value] of Object.entries(row)) {
|
|
144
145
|
if (!columns.includes(key)) {
|
|
145
146
|
delete row[key];
|
|
146
147
|
}
|
|
148
|
+
else if (typeof value === 'string') {
|
|
149
|
+
row[key] = linkify(value);
|
|
150
|
+
}
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
}
|
|
@@ -15,6 +15,8 @@ declare class ShareComponent extends GirafeHTMLElement implements IGirafePanel {
|
|
|
15
15
|
mailLogo: string;
|
|
16
16
|
iframeUrl?: string;
|
|
17
17
|
iframeCode?: string;
|
|
18
|
+
awaitingShareLink: boolean;
|
|
19
|
+
awaitingIframeUrl: boolean;
|
|
18
20
|
private urlShortener?;
|
|
19
21
|
private simpleMaskManager?;
|
|
20
22
|
private readonly eventsCallbacks;
|
|
@@ -12,9 +12,9 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
12
12
|
return uHtml `<style>
|
|
13
13
|
*{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
|
|
14
14
|
</style><style>
|
|
15
|
-
#content{background:var(--bkg-color);color:var(--text-color);margin:0;padding:1rem}.group{padding-bottom:4em}.title{margin-top:0}.link{flex-direction:column;gap:.2rem;margin-top:.5rem;display:flex}.qrcode{opacity:.7;width:10rem;margin:2rem auto auto;display:block}.social{display:flex}.social button{cursor:pointer;background-color:#0000;border:none;margin:2rem auto auto}.social img{opacity:.7;width:3rem;filter:var(--svg-filter)}.social img:hover{opacity:1}input{flex-grow:1;font-size:.9rem}.error{color:var(--error-color);text-align:center;order:3;width:90%}.textarea-for-code{font-family:monospace,Arial,sans-serif;font-size:.75rem;line-height:1.1rem}.copy-success,.copy-success:hover{background-color:var(--success-color)}.checkbox-wrapper{flex-direction:row;justify-content:space-between;align-items:center;height:2rem;display:flex;& input[type=checkbox]{flex-grow:unset}}
|
|
15
|
+
#content{background:var(--bkg-color);color:var(--text-color);margin:0;padding:1rem}.group{padding-bottom:4em}.title{margin-top:0}.link{flex-direction:column;gap:.2rem;margin-top:.5rem;display:flex;& button{padding-top:.25rem;padding-bottom:.25rem}}.qrcode{opacity:.7;width:10rem;margin:2rem auto auto;display:block}.qrcode-placeholder{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=);width:10rem;height:10rem;margin:2rem auto auto;display:block}.social{display:flex}.social button{cursor:pointer;background-color:#0000;border:none;margin:2rem auto auto}.social img{opacity:.7;width:3rem;filter:var(--svg-filter)}.social img:hover{opacity:1}input{flex-grow:1;font-size:.9rem}.error{color:var(--error-color);text-align:center;order:3;width:90%}.textarea-for-code{font-family:monospace,Arial,sans-serif;font-size:.75rem;line-height:1.1rem}.copy-success,.copy-success:hover{background-color:var(--success-color)}.checkbox-wrapper{flex-direction:row;justify-content:space-between;align-items:center;height:2rem;display:flex;& input[type=checkbox]{flex-grow:unset}}.disabled{opacity:.25;pointer-events:none}.enabled{opacity:1;pointer-events:unset}.icon-loading{content:url(icons/3-dots-fade.svg)}.icon-copy{content:url(icons/content_copy.svg);margin:1px}
|
|
16
16
|
</style>
|
|
17
|
-
<div id="panel"><div id="content"><div class="${!this.urlShortener ? '' : 'hidden'}"><div class="message" i18n="Error, the shortener service is not defined.">Error, the shortener service is not defined.</div></div><div id="share-map" class="${this.urlShortener ? 'group' : 'hidden'}"><h3 class="title" i18n="Share this map">Share this map</h3><div><div class="link"><input value="${this.shareLink}" class="gg-input" disabled="disabled"> <button id="btn-copy-short" class="gg-button"
|
|
17
|
+
<div id="panel"><div id="content"><div class="${!this.urlShortener ? '' : 'hidden'}"><div class="message" i18n="Error, the shortener service is not defined.">Error, the shortener service is not defined.</div></div><div id="share-map" class="${this.urlShortener ? 'group' : 'hidden'}"><h3 class="title" i18n="Share this map">Share this map</h3><div class="${this.awaitingShareLink ? 'disabled' : 'enabled'}"><div class="link"><input value="${this.shareLink}" class="gg-input" disabled="disabled"> <button id="btn-copy-short" class="gg-button" onclick="${() => this.generateAndCopyLink()}"><img alt="loading/copy" src="" class="${this.awaitingShareLink ? 'icon-loading' : 'icon-copy'}" width="20" height="20"> <span i18n="${this.awaitingShareLink ? 'Generating link' : (!this.shareLink ? 'Generate and copy link' : 'Copy to Clipboard')}"></span></button></div><img alt="share-qrcode" class="${(this.qrCode ? 'qrcode' : 'qrcode-placeholder')}" src="${this.qrCode}"><div class="${(this.success ? 'hidden' : 'qrcode error')}"><img alt="error-icon" src="icons/error.svg"> <span i18n="Error, can not fetch the shortener service. Please try again later.">Error, can not fetch the shortener service. Please try again later.</span></div><div class="social"><button onclick="${() => this.shareFacebook()}"><img alt="share-facebook" src="${this.facebookLogo}"></button> <button onclick="${() => this.shareTwitter()}"><img alt="share-twitter" src="${this.twitterLogo}"></button> <button onclick="${() => this.shareLinkedIn()}"><img alt="share-linkedin" src="${this.linkedInLogo}"></button> <button onclick="${() => this.shareMail()}"><img alt="share-mail" src="${this.mailLogo}"></button></div></div></div><div id="embed-map" class="${this.urlShortener ? 'group' : 'hidden'}"><h3 class="title" i18n="Embed this map">Embed this map</h3><div class="link"><select class="gg-select" id="logLevel" onchange="${(evt) => this.onSizeChanged(evt)}"><option ?selected="${this.iframeSize === ''}" i18n="Select map size..." value="">Select map size...<option ?selected="${this.iframeSize === 'small'}" i18n="Small" value="small">Small<option ?selected="${this.iframeSize === 'medium'}" i18n="Medium" value="medium">Medium<option ?selected="${this.iframeSize === 'large'}" i18n="Large" value="large">Large</select><div class="checkbox-wrapper"><label for="iframe-search-visible" i18n="Search visible">Search visible</label> <input type="checkbox" class="gg-checkbox" id="iframe-search-visible" value="${this.shareState.searchComponentVisible}" onchange="${(e) => this.shareState.searchComponentVisible = e.target.checked}"></div><div class="checkbox-wrapper"><label for="iframe-basemap-visible" i18n="Basemap visible">Basemap visible</label> <input type="checkbox" class="gg-checkbox" id="iframe-basemap-visible" value="${this.shareState.basemapComponentVisible}" onchange="${(e) => this.shareState.basemapComponentVisible = e.target.checked}"></div><textarea value="${this.iframeCode}" class="gg-input gg-textarea textarea-for-code" disabled="disabled"></textarea> <button id="btn-copy-iframe" class="gg-button" ?disabled="${this.iframeSize === ''}" onclick="${() => this.generateAndCopyIframeCode()}"><img alt="loading/copy" src="" class="${this.awaitingIframeUrl ? 'icon-loading' : 'icon-copy'}" width="20" height="20"> <span i18n="${this.awaitingIframeUrl ? 'Generating code' : 'Generate and copy code'}"></span></button></div></div></div></div>`;
|
|
18
18
|
};
|
|
19
19
|
isPanelVisible = false;
|
|
20
20
|
panelTitle = 'share-panel';
|
|
@@ -28,6 +28,8 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
28
28
|
mailLogo = MailLogo;
|
|
29
29
|
iframeUrl;
|
|
30
30
|
iframeCode;
|
|
31
|
+
awaitingShareLink = false;
|
|
32
|
+
awaitingIframeUrl = false;
|
|
31
33
|
urlShortener;
|
|
32
34
|
simpleMaskManager;
|
|
33
35
|
eventsCallbacks = [];
|
|
@@ -93,6 +95,8 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
93
95
|
this.simpleMaskManager = new SimpleMaskManager(this.context.mapManager.getMap());
|
|
94
96
|
// While the component is visible, listen for changes in the state to update the shared link
|
|
95
97
|
this.registerEvents();
|
|
98
|
+
// Generate the share link when the component is rendered (but don't copy to clipboard)
|
|
99
|
+
this.generateShareLink().then(() => this.refreshRender());
|
|
96
100
|
}
|
|
97
101
|
/**
|
|
98
102
|
* Renders an empty component when it's not visible.
|
|
@@ -119,8 +123,15 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
119
123
|
this.eventsCallbacks.length = 0;
|
|
120
124
|
}
|
|
121
125
|
async generateAndCopyLink() {
|
|
122
|
-
|
|
123
|
-
this.
|
|
126
|
+
// If there's already a share link, just copy it to clipboard
|
|
127
|
+
if (this.shareLink) {
|
|
128
|
+
this.copyToClipboard('short');
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
// Otherwise generate a new link and copy it
|
|
132
|
+
await this.generateShareLink();
|
|
133
|
+
this.copyToClipboard('short');
|
|
134
|
+
}
|
|
124
135
|
this.refreshRender();
|
|
125
136
|
}
|
|
126
137
|
async generateAndCopyIframeCode() {
|
|
@@ -132,6 +143,8 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
132
143
|
if (!this.urlShortener) {
|
|
133
144
|
return;
|
|
134
145
|
}
|
|
146
|
+
this.awaitingShareLink = true;
|
|
147
|
+
this.refreshRender();
|
|
135
148
|
const baseUrl = this.context.urlManager.getBaseUrlPath();
|
|
136
149
|
const hash = this.context.shareManager.getStateToShare();
|
|
137
150
|
// Get short URL
|
|
@@ -140,11 +153,14 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
140
153
|
this.shareLink = response.shorturl;
|
|
141
154
|
this.success = response.success;
|
|
142
155
|
this.qrCode = response.qrcode;
|
|
156
|
+
this.awaitingShareLink = false;
|
|
143
157
|
}
|
|
144
158
|
async generateIframeCode() {
|
|
145
159
|
if (!this.urlShortener || !this.iframeSize) {
|
|
146
160
|
return;
|
|
147
161
|
}
|
|
162
|
+
this.awaitingIframeUrl = true;
|
|
163
|
+
this.refreshRender();
|
|
148
164
|
const baseUrl = this.context.urlManager.getRootUrl();
|
|
149
165
|
const hash = this.context.shareManager.getStateToShare();
|
|
150
166
|
// Get short URL for iframe
|
|
@@ -153,6 +169,7 @@ class ShareComponent extends GirafeHTMLElement {
|
|
|
153
169
|
const response = await this.urlShortener.shortenUrl(longIframeUrl, indexDocument);
|
|
154
170
|
this.iframeUrl = response.shorturl;
|
|
155
171
|
this.iframeCode = `<iframe title="iframe GeoGirafe" width="${this.iframeWidth}" height="${this.iframeHeight}" src="${this.iframeUrl}"></iframe>`;
|
|
172
|
+
this.awaitingIframeUrl = false;
|
|
156
173
|
}
|
|
157
174
|
closeWindow() {
|
|
158
175
|
this.state.interface.sharePanelVisible = false;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.1.0-dev.
|
|
1
|
+
{"version":"1.1.0-dev.2361375621", "build":"2361375621", "date":"03/03/2026"}
|
package/tools/utils/utils.js
CHANGED
|
@@ -168,7 +168,7 @@ export const applyFeaturesToSelection = (features, state) => {
|
|
|
168
168
|
state.selection.highlightedFeatures = [];
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
const urlRegExp = /(https?:\/\/[^"<]*?(?=\s|$|<\/[^a]>))/gi;
|
|
171
|
+
const urlRegExp = /(https?:\/\/[^"'<]*?(?=\s|$|<\/[^a]>))/gi;
|
|
172
172
|
const telRegExp = /((\b(0041|0)|\B\+41)(\s?\(0\))?(\s)?[1-9]{2}(\s)?\d{3}(\s)?\d{2}(\s)?\d{2}\b)/gi;
|
|
173
173
|
const mailRegExp = /(^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$)/gi; //NOSONAR(typescript:S5843) As this is the official Regular Expression, we will not mess around with it
|
|
174
174
|
export const linkify = (str) => {
|
|
@@ -69,6 +69,11 @@ it('should return already wrapped link unchanged', () => {
|
|
|
69
69
|
const linkifiedLink = linkify(alreadyWrappedLink);
|
|
70
70
|
expect(linkifiedLink).toEqual(alreadyWrappedLink);
|
|
71
71
|
});
|
|
72
|
+
it('should return already wrapped link using single quotation mark instead of quotation mark unchanged', () => {
|
|
73
|
+
const alreadyWrappedLink = "<a href='https://intercapi.vd.ch/territoire/intercapi/faces?type=grundstueck_grundbuch_auszug&bfs=5890&n1=210' target='_blank'>Cliquer ici</a>";
|
|
74
|
+
const linkifiedLink = linkify(alreadyWrappedLink);
|
|
75
|
+
expect(linkifiedLink).toEqual(alreadyWrappedLink);
|
|
76
|
+
});
|
|
72
77
|
it('should return phone number with country code wrapped in Anchor-Element', () => {
|
|
73
78
|
const phoneNumber = '+41 61 267 99 53';
|
|
74
79
|
const linkifiedPhoneNumber = linkify(phoneNumber);
|