@panoramax/web-viewer 3.2.1-develop-4458bd99 → 3.2.1-develop-0f0a36ec

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.1-develop-4458bd99",
3
+ "version": "3.2.1-develop-0f0a36ec",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
package/src/Editor.js CHANGED
@@ -253,6 +253,7 @@ export default class Editor extends CoreView {
253
253
 
254
254
  const imgBgStreets = document.createElement("img");
255
255
  imgBgStreets.src = BackgroundStreets;
256
+ imgBgStreets.alt = "";
256
257
 
257
258
  labelBgStreets.appendChild(imgBgStreets);
258
259
  labelBgStreets.appendChild(document.createTextNode(this._t.gvs.map_background_streets));
@@ -272,6 +273,7 @@ export default class Editor extends CoreView {
272
273
 
273
274
  const imgBgAerial = document.createElement("img");
274
275
  imgBgAerial.src = BackgroundAerial;
276
+ imgBgAerial.alt = "";
275
277
 
276
278
  labelBgAerial.appendChild(imgBgAerial);
277
279
  labelBgAerial.appendChild(document.createTextNode(this._t.gvs.map_background_aerial));
@@ -18,6 +18,7 @@ export default class Loader {
18
18
  // Logo
19
19
  const logo = document.createElement("img");
20
20
  logo.src = LoaderImg;
21
+ logo.alt = "";
21
22
  logo.title = this._parent._t.map.loading;
22
23
  logo.classList.add("gvs-loader-img");
23
24
  this.container.appendChild(logo);
@@ -793,6 +793,7 @@ export default class Map extends maplibregl.Map {
793
793
  _getPictureMarker(selected = true) {
794
794
  const img = document.createElement("img");
795
795
  img.src = selected ? MarkerSelectedSVG : MarkerBaseSVG;
796
+ img.alt = "";
796
797
  return new maplibregl.Marker({
797
798
  element: img
798
799
  });
@@ -678,7 +678,7 @@ export default class Photo extends PSViewer {
678
678
  else {
679
679
  console.error(e);
680
680
  this.overlay.show({
681
- image: `<img style="width: 200px" src="${LogoDead}" />`,
681
+ image: `<img style="width: 200px" src="${LogoDead}" alt="" />`,
682
682
  title: this._parent._t.gvs.error,
683
683
  text: label + "<br />" + this._parent._t.gvs.error_click,
684
684
  dissmisable,
@@ -22,6 +22,7 @@
22
22
  "show_psv": "Show the picture viewer",
23
23
  "show_map": "Show the map",
24
24
  "minimize": "Hide this widget, you can show it again using button in bottom left corner",
25
+ "minimize_short": "Hide",
25
26
  "options": "Options",
26
27
  "filters": "Filters",
27
28
  "layers": "Layers",
@@ -98,7 +99,7 @@
98
99
  "filter_user": "User",
99
100
  "filter_user_mypics": "My pictures",
100
101
  "filter_picture": "Picture type",
101
- "filter_zoom_in": "Zoom-in for filters to be visible",
102
+ "filter_zoom_in": "Zoom-in to see this filter",
102
103
  "picture_flat": "Classic",
103
104
  "picture_360": "360°",
104
105
  "filter_qualityscore": "Quality score",
@@ -22,6 +22,7 @@
22
22
  "show_psv": "Afficher la visionneuse de photos",
23
23
  "show_map": "Afficher la carte",
24
24
  "minimize": "Masquer ce widget, vous pouvez l'afficher de nouveau grâce au bouton dans le coin en bas à gauche",
25
+ "minimize_short": "Masquer",
25
26
  "options": "Options",
26
27
  "filters": "Filtres",
27
28
  "layers": "Calques",
@@ -107,7 +108,7 @@
107
108
  "qualityscore_doc_2": "Le score est affiché sous la forme d'une lettre A/B/C/D/E (A étant le meilleur, E le moins bon), et visualisable grâce à cette échelle :",
108
109
  "qualityscore_doc_3": "Il est calculé en fonction de la précision du GPS ainsi que la résolution de la photo. Un matériel professionnel aura une note de A, une caméra sportive 360° une note de B, et un smartphone une note de C à E.",
109
110
  "qualityscore_doc_link": "Plus d'infos sur le calcul du Score Qualité dans notre documentation.",
110
- "filter_zoom_in": "Zoomez plus pour voir les filtres",
111
+ "filter_zoom_in": "Zoomez plus pour voir ce filtre",
111
112
  "map_background": "Fond de carte",
112
113
  "map_background_aerial": "Satellite",
113
114
  "map_background_streets": "Plan",
@@ -117,6 +117,7 @@ function svgToPSVLink(svg, fillColor) {
117
117
  catch(e) {
118
118
  const img = document.createElement("img");
119
119
  img.src = svg;
120
+ img.alt = "";
120
121
  return img;
121
122
  }
122
123
  }
@@ -669,6 +669,7 @@ a.gvs-btn { text-decoration: none; }
669
669
  #gvs-filter-panel {
670
670
  width: 350px;
671
671
  max-width: 350px;
672
+ padding: 0;
672
673
  }
673
674
  #gvs-filter-panel .gvs-filter-active {
674
675
  background-color: var(--widget-bg-active);
@@ -686,11 +687,32 @@ a.gvs-btn { text-decoration: none; }
686
687
  color: var(--widget-font-active);
687
688
  background: none;
688
689
  }
689
- #gvs-filter-zoomin {
690
+ .gvs-filter-block {
691
+ position: relative;
692
+ padding: 10px 15px;
693
+ border-bottom: 2px solid var(--widget-border-div);
694
+ }
695
+ .gvs-filter-block:first-child {
696
+ padding-top: 15px;
697
+ }
698
+ .gvs-filter-block:last-child {
699
+ border-bottom: none;
700
+ padding-bottom: 15px;
701
+ }
702
+ .gvs-filter-zoomin {
703
+ z-index: 10;
704
+ background-color: rgba(255,255,255,0.8);
690
705
  text-align: center;
691
706
  font-weight: bold;
692
- margin-bottom: 15px;
693
- color: var(--orange);
707
+ position: absolute;
708
+ top: 0;
709
+ right: 0;
710
+ left: 0;
711
+ bottom: 0;
712
+ display: flex;
713
+ justify-content: center;
714
+ align-items: center;
715
+ border-radius: 25px;
694
716
  }
695
717
 
696
718
  #gvs-filter-qualityscore {
@@ -731,6 +731,9 @@ export default class Widgets {
731
731
  _initWidgetMiniActions() {
732
732
  // Mini widget expand
733
733
  const imgExpand = document.createElement("img");
734
+ imgExpand.alt = "";
735
+ imgExpand.height = 120;
736
+ imgExpand.draggable = false;
734
737
  imgExpand.src = SwitchBig;
735
738
  const lblExpand = document.createElement("span");
736
739
  lblExpand.classList.add("gvs-mobile-hidden");
@@ -744,6 +747,9 @@ export default class Widgets {
744
747
 
745
748
  // Mini widget hide
746
749
  const imgReduce = document.createElement("img");
750
+ imgReduce.alt = this._t.gvs.minimize_short;
751
+ imgReduce.height = 120;
752
+ imgReduce.draggable = false;
747
753
  imgReduce.src = SwitchMini;
748
754
  const btnHide = createButton("gvs-mini-hide", imgReduce, this._t.gvs.minimize, ["gvs-only-mini", "gvs-print-hidden"]);
749
755
  this._corners["mini-bottom-left"].appendChild(btnHide);
@@ -874,12 +880,12 @@ export default class Widgets {
874
880
  <div id="gvs-map-bg" class="gvs-input-group">
875
881
  <input type="radio" id="gvs-map-bg-streets" name="gvs-map-bg" value="streets" />
876
882
  <label for="gvs-map-bg-streets">
877
- <img id="gvs-map-bg-streets-img" />
883
+ <img id="gvs-map-bg-streets-img" alt="" />
878
884
  ${this._t.gvs.map_background_streets}
879
885
  </label>
880
886
  <input type="radio" id="gvs-map-bg-aerial" name="gvs-map-bg" value="aerial" />
881
887
  <label for="gvs-map-bg-aerial">
882
- <img id="gvs-map-bg-aerial-img" />
888
+ <img id="gvs-map-bg-aerial-img" alt="" />
883
889
  ${this._t.gvs.map_background_aerial}
884
890
  </label>
885
891
  </div>`;
@@ -1007,23 +1013,27 @@ export default class Widgets {
1007
1013
  const pnlFilter = createPanel(this, btnFilter, []);
1008
1014
  pnlFilter.innerHTML = `
1009
1015
  <form id="gvs-filter-form">
1010
- <div id="gvs-filter-zoomin">${fat(faTriangleExclamation)} ${this._t.gvs.filter_zoom_in}</div>
1011
- <h4>${fat(faCalendar)} ${this._t.gvs.filter_date}</h4>
1012
- <div class="gvs-input-shortcuts">
1013
- <button data-for="gvs-filter-date-from" data-value="${new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1month}</button>
1014
- <button data-for="gvs-filter-date-from" data-value="${new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1year}</button>
1015
- </div>
1016
- <div class="gvs-input-group">
1017
- <input type="date" id="gvs-filter-date-from" />
1018
- ${fat(faArrowRight)}
1019
- <input type="date" id="gvs-filter-date-end" />
1016
+ <div class="gvs-filter-block">
1017
+ <div class="gvs-filter-zoomin">${this._t.gvs.filter_zoom_in}</div>
1018
+ <h4>${fat(faCalendar)} ${this._t.gvs.filter_date}</h4>
1019
+ <div class="gvs-input-shortcuts">
1020
+ <button data-for="gvs-filter-date-from" data-value="${new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1month}</button>
1021
+ <button data-for="gvs-filter-date-from" data-value="${new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1year}</button>
1022
+ </div>
1023
+ <div class="gvs-input-group">
1024
+ <input type="date" id="gvs-filter-date-from" />
1025
+ ${fat(faArrowRight)}
1026
+ <input type="date" id="gvs-filter-date-end" />
1027
+ </div>
1020
1028
  </div>
1021
- <h4>${fat(faImage)} ${this._t.gvs.filter_picture}</h4>
1022
- <div class="gvs-input-group gvs-checkbox-btns" style="justify-content: center;">
1023
- <input type="checkbox" id="gvs-filter-type-flat" name="flat" />
1024
- <label for="gvs-filter-type-flat">${fat(faImage)} ${this._t.gvs.picture_flat}</label>
1025
- <input type="checkbox" id="gvs-filter-type-360" name="360" />
1026
- <label for="gvs-filter-type-360">${fat(faPanorama)} ${this._t.gvs.picture_360}</label>
1029
+ <div class="gvs-filter-block">
1030
+ <h4>${fat(faImage)} ${this._t.gvs.filter_picture}</h4>
1031
+ <div class="gvs-input-group gvs-checkbox-btns" style="justify-content: center;">
1032
+ <input type="checkbox" id="gvs-filter-type-flat" name="flat" />
1033
+ <label for="gvs-filter-type-flat">${fat(faImage)} ${this._t.gvs.picture_flat}</label>
1034
+ <input type="checkbox" id="gvs-filter-type-360" name="360" />
1035
+ <label for="gvs-filter-type-360">${fat(faPanorama)} ${this._t.gvs.picture_360}</label>
1036
+ </div>
1027
1037
  </div>
1028
1038
  </form>
1029
1039
  `;
@@ -1050,11 +1060,20 @@ export default class Widgets {
1050
1060
 
1051
1061
  // Create qualityscore filter
1052
1062
  if(hasQualityScore) {
1063
+ const block = document.createElement("div");
1064
+ block.classList.add("gvs-filter-block");
1065
+ form.appendChild(block);
1066
+
1067
+ const zoomLbl = document.createElement("div");
1068
+ zoomLbl.classList.add("gvs-filter-zoomin");
1069
+ zoomLbl.appendChild(document.createTextNode(this._t.gvs.filter_zoom_in));
1070
+ block.appendChild(zoomLbl);
1071
+
1053
1072
  const title = document.createElement("h4");
1054
1073
  title.innerHTML = `${fat(faMedal)} ${this._t.gvs.filter_qualityscore} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${fat(faInfoCircle)}</button>`;
1055
1074
  title.style.marginBottom = "3px";
1056
1075
  title.lastChild.addEventListener("click", () => this._showQualityScoreDoc());
1057
- form.appendChild(title);
1076
+ block.appendChild(title);
1058
1077
 
1059
1078
  const div = document.createElement("div");
1060
1079
  div.id = "gvs-filter-qualityscore";
@@ -1077,14 +1096,18 @@ export default class Widgets {
1077
1096
  div.appendChild(label);
1078
1097
  });
1079
1098
 
1080
- form.appendChild(div);
1099
+ block.appendChild(div);
1081
1100
  }
1082
1101
 
1083
1102
  // Create search bar for users
1084
1103
  if(hasUserSearch) {
1104
+ const block = document.createElement("div");
1105
+ block.classList.add("gvs-filter-block");
1106
+ form.appendChild(block);
1107
+
1085
1108
  const title = document.createElement("h4");
1086
1109
  title.innerHTML = `${fat(faUser)} ${this._t.gvs.filter_user}`;
1087
- form.appendChild(title);
1110
+ block.appendChild(title);
1088
1111
 
1089
1112
  // Shortcut for my own pictures
1090
1113
  const userAccount = getUserAccount();
@@ -1095,7 +1118,7 @@ export default class Widgets {
1095
1118
  mypics = document.createElement("button");
1096
1119
  mypics.appendChild(document.createTextNode(this._t.gvs.filter_user_mypics));
1097
1120
  shortcuts.appendChild(mypics);
1098
- form.appendChild(shortcuts);
1121
+ block.appendChild(shortcuts);
1099
1122
  }
1100
1123
 
1101
1124
  const input = document.createElement("div");
@@ -1124,12 +1147,12 @@ export default class Widgets {
1124
1147
  this,
1125
1148
  true
1126
1149
  );
1127
- form.addEventListener("reset", () => {
1150
+ block.addEventListener("reset", () => {
1128
1151
  userSearch.classList.remove("gvs-filter-active");
1129
1152
  userSearch.resetSearch();
1130
1153
  });
1131
1154
  input.appendChild(userSearch);
1132
- form.appendChild(input);
1155
+ block.appendChild(input);
1133
1156
 
1134
1157
  // Trigger "my pictures" shortcut action
1135
1158
  if(userAccount) {
@@ -1294,10 +1317,12 @@ export default class Widgets {
1294
1317
  });
1295
1318
 
1296
1319
  // Show/hide zoom in warning when map zoom changes
1297
- const lblZoomIn = document.getElementById("gvs-filter-zoomin");
1320
+ const lblsZoomIn = document.getElementsByClassName("gvs-filter-zoomin");
1298
1321
  const changeLblZoomInDisplay = () => {
1299
- if(this._viewer.map.getZoom() < 7) { lblZoomIn.style.display = null; }
1300
- else { lblZoomIn.style.display = "none"; }
1322
+ for(let lblZoomIn of lblsZoomIn) {
1323
+ if(this._viewer.map.getZoom() < 7) { lblZoomIn.style.display = null; }
1324
+ else { lblZoomIn.style.display = "none"; }
1325
+ }
1301
1326
  };
1302
1327
  changeLblZoomInDisplay();
1303
1328
  this._viewer.map.on("zoomend", changeLblZoomInDisplay);
@@ -16,6 +16,7 @@ exports[`_addMapBackgroundWidget works 1`] = `
16
16
  for="gvs-map-bg-streets"
17
17
  >
18
18
  <img
19
+ alt=""
19
20
  src="bg_streets.jpg"
20
21
  />
21
22
  Streets
@@ -30,6 +31,7 @@ exports[`_addMapBackgroundWidget works 1`] = `
30
31
  for="gvs-map-bg-aerial"
31
32
  >
32
33
  <img
34
+ alt=""
33
35
  src="bg_aerial.jpg"
34
36
  />
35
37
  Aerial
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`constructor works 1`] = `"<img src=\\"marker.svg\\" title=\\"undefined\\" class=\\"gvs-loader-img\\"><div><span>Loading...</span></div>"`;
3
+ exports[`constructor works 1`] = `"<img src=\\"marker.svg\\" alt=\\"\\" title=\\"undefined\\" class=\\"gvs-loader-img\\"><div><span>Loading...</span></div>"`;
4
4
 
5
5
  exports[`dismiss works when no error set 1`] = `
6
6
  Array [
@@ -12,4 +12,4 @@ Array [
12
12
  ]
13
13
  `;
14
14
 
15
- exports[`dismiss works with error set 1`] = `"<img src=\\"logo_dead.svg\\" title=\\"undefined\\" class=\\"gvs-loader-img\\" style=\\"width: 200px; animation: unset;\\"><div>undefined<br>Oops it's broken<br><small>undefined</small></div>"`;
15
+ exports[`dismiss works with error set 1`] = `"<img src=\\"logo_dead.svg\\" alt=\\"\\" title=\\"undefined\\" class=\\"gvs-loader-img\\" style=\\"width: 200px; animation: unset;\\"><div>undefined<br>Oops it's broken<br><small>undefined</small></div>"`;
@@ -19,6 +19,7 @@ Object {
19
19
  Object {
20
20
  "arrowStyle": Object {
21
21
  "element": <img
22
+ alt=""
22
23
  src="arrow_triangle.svg"
23
24
  />,
24
25
  "size": Object {
@@ -38,6 +39,7 @@ Object {
38
39
  Object {
39
40
  "arrowStyle": Object {
40
41
  "element": <img
42
+ alt=""
41
43
  src="arrow_triangle.svg"
42
44
  />,
43
45
  "size": Object {