@panoramax/web-viewer 3.2.2-develop-19a0de46 → 3.2.2-develop-ef6bf81f

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.2-develop-19a0de46",
3
+ "version": "3.2.2-develop-ef6bf81f",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -22,7 +22,7 @@
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  justify-content: center;
25
- gap: 40px;
25
+ gap: 20px;
26
26
  align-items: center;
27
27
  background: #37474F;
28
28
  z-index: 9000;
@@ -53,4 +53,22 @@
53
53
  @keyframes rotating {
54
54
  from { transform: rotate(0deg); }
55
55
  to { transform: rotate(360deg); }
56
+ }
57
+
58
+ /* Call to action button */
59
+ .gvs .gvs-loader .gvs-loader-cta {
60
+ border: none;
61
+ border-radius: 7px;
62
+ font-weight: 500;
63
+ font-size: 1.0em;
64
+ color: white;
65
+ background-color: #EF6C00;
66
+ cursor: pointer;
67
+ margin: 10px;
68
+ padding: 5px 30px;
69
+ box-shadow: 2px 2px 2px rgba(0,0,0,0.3);
70
+ }
71
+
72
+ .gvs .gvs-loader .gvs-loader-cta:hover {
73
+ background-color: #F57C00;
56
74
  }
@@ -83,7 +83,15 @@ export default class Loader {
83
83
  this.container.children[0].src = LogoDead;
84
84
  this.container.children[0].style.width = "200px";
85
85
  this.container.children[0].style.animation = "unset";
86
- let errHtml = `<small>${next ? this._parent._t.gvs.error_click : this._parent._t.gvs.error_retry}</small>`;
86
+
87
+ let errHtml;
88
+ if(next) {
89
+ errHtml = `<button class="gvs-loader-cta">${this._parent._t.gvs.error_click}</button>`;
90
+ }
91
+ else {
92
+ errHtml = `<small>${this._parent._t.gvs.error_retry}</small>`;
93
+ }
94
+
87
95
  if(errMeaningful) { errHtml = errMeaningful + "<br />" + errHtml; }
88
96
  this.container.children[1].innerHTML = `${this._parent._t.gvs.error}<br />${errHtml}`;
89
97
  if(next) {
@@ -42,7 +42,7 @@
42
42
  "copy": "Copy",
43
43
  "copied": "Copied",
44
44
  "error": "We have a problem…",
45
- "error_click": "Click to continue",
45
+ "error_click": "Continue",
46
46
  "error_retry": "Please retry later",
47
47
  "sequence_next": "Next picture in sequence",
48
48
  "sequence_play": "Play along this sequence",
@@ -95,7 +95,7 @@
95
95
  "sequence_play": "Reproducir esta secuencia",
96
96
  "sequence_pause": "Pausar la secuencia",
97
97
  "sequence_prev": "Imagen anterior de la secuencia",
98
- "error_click": "Haz click para continuar",
98
+ "error_click": "Continuar",
99
99
  "error_retry": "Por favor, inténtalo más tarde",
100
100
  "error_psv": "El visor de fotos esféricas no se carga correctamente",
101
101
  "error_pic": "No se encuentra la imagen que queríamos",
@@ -42,7 +42,7 @@
42
42
  "copy": "Copier",
43
43
  "copied": "Copié",
44
44
  "error": "On a un problème…",
45
- "error_click": "Cliquez pour continuer",
45
+ "error_click": "Continuer",
46
46
  "error_retry": "Merci de réessayer plus tard",
47
47
  "sequence_next": "Photo suivante dans la séquence",
48
48
  "sequence_play": "Parcourir cette séquence",
@@ -26,7 +26,7 @@
26
26
  "copy": "Copia",
27
27
  "copied": "Copiato",
28
28
  "error": "Abbiamo un problema…",
29
- "error_click": "Clicca per continuare",
29
+ "error_click": "Continuare",
30
30
  "error_retry": "Riprovare più tardi",
31
31
  "sequence_play": "Riproduci questa sequenza",
32
32
  "sequence_pause": "Pausa la sequenza",
@@ -277,6 +277,7 @@ export default class URLHash extends EventTarget {
277
277
 
278
278
  // Change focus
279
279
  if(vals.focus && ["map", "pic"].includes(vals.focus)) {
280
+ this._viewer.setPopup(false);
280
281
  this._viewer.setFocus(vals.focus);
281
282
  }
282
283
  if(vals.focus && vals.focus == "meta") {
@@ -434,11 +435,18 @@ export default class URLHash extends EventTarget {
434
435
  const prevPic = this._getCurrentHash().pic || "";
435
436
  const nextPic = this._viewer?.psv?.getPictureMetadata()?.id || "";
436
437
 
438
+ const prevFocus = this._getCurrentHash().focus || "";
439
+ const nextFocus = nextUrl.hash.includes("focus=meta") ? "meta" : (nextUrl.hash.includes("focus=map") ? "map" : "pic");
440
+
437
441
  try {
438
442
  // If different pic, add entry in browser history
439
443
  if(prevPic != nextPic) {
440
444
  window.history.pushState(window.history.state, null, nextUrl.href);
441
445
  }
446
+ // If metadata popup is open, come back to pic/map
447
+ else if(prevFocus != nextFocus && nextFocus == "meta") {
448
+ window.history.pushState(window.history.state, null, nextUrl.href);
449
+ }
442
450
  // If same pic, just update viewer params
443
451
  else {
444
452
  window.history.replaceState(window.history.state, null, nextUrl.href);
@@ -319,6 +319,7 @@ describe("_onHashChange", () => {
319
319
  select: jest.fn(),
320
320
  setFocus: jest.fn(),
321
321
  setFilters: jest.fn(),
322
+ setPopup: jest.fn(),
322
323
  };
323
324
  const uh = new URLHash(v);
324
325
  uh._getCurrentHash = () => ({
@@ -383,6 +384,7 @@ describe("_onHashChange", () => {
383
384
  select: jest.fn(),
384
385
  setFocus: jest.fn(),
385
386
  setFilters: jest.fn(),
387
+ setPopup: jest.fn(),
386
388
  };
387
389
  const uh = new URLHash(v);
388
390
  uh._getCurrentHash = () => ({
@@ -414,6 +416,7 @@ describe("_onHashChange", () => {
414
416
  select: jest.fn(),
415
417
  setFocus: jest.fn(),
416
418
  setFilters: jest.fn(),
419
+ setPopup: jest.fn(),
417
420
  };
418
421
  const uh = new URLHash(v);
419
422
  uh._getCurrentHash = () => ({