@panoramax/web-viewer 3.2.0-develop-0b93c98a → 3.2.0-develop-1b7c7072

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.0-develop-0b93c98a",
3
+ "version": "3.2.0-develop-1b7c7072",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
package/src/Viewer.js CHANGED
@@ -200,6 +200,10 @@ class Viewer extends CoreView {
200
200
  if(this._options.selectedPicture) {
201
201
  this.select(null, this._options.selectedPicture, true);
202
202
  this.addEventListener("psv:picture-loaded", () => {
203
+ // Force setting of sequence ID after load
204
+ if(!this._selectedSeqId && this.psv?._myVTour?.getCurrentNode()?.sequence?.id) {
205
+ this.select(this.psv._myVTour.getCurrentNode().sequence.id, this._options.selectedPicture);
206
+ }
203
207
  if(this.map && this._options.map) {
204
208
  this.map.jumpTo(this._options.map);
205
209
  }
@@ -145,7 +145,7 @@ export default class CoreView extends EventTarget {
145
145
  select(seqId = null, picId = null, force = false) {
146
146
  const prevSeqId = this._selectedSeqId || null;
147
147
  const prevPicId = this._selectedPicId || null;
148
- if(!force && prevPicId == picId) { return; } // Avoid running if already selected
148
+ if(!force && prevPicId == picId && prevSeqId == seqId) { return; } // Avoid running if already selected
149
149
 
150
150
  this._selectedSeqId = seqId;
151
151
  this._selectedPicId = picId;
package/src/utils/I18n.js CHANGED
@@ -1,5 +1,7 @@
1
+ import T_da from "../translations/da.json";
1
2
  import T_de from "../translations/de.json";
2
3
  import T_en from "../translations/en.json";
4
+ import T_eo from "../translations/eo.json";
3
5
  import T_es from "../translations/es.json";
4
6
  import T_fr from "../translations/fr.json";
5
7
  import T_hu from "../translations/hu.json";
@@ -9,7 +11,7 @@ import T_zh_Hant from "../translations/zh_Hant.json";
9
11
 
10
12
  const FALLBACK_LOCALE = "en";
11
13
  const TRANSLATIONS = {
12
- "de": T_de, "en": T_en, "es": T_es, "fr": T_fr,
14
+ "da": T_da, "de": T_de, "eo": T_eo, "en": T_en, "es": T_es, "fr": T_fr,
13
15
  "hu": T_hu, "it": T_it, "pl": T_pl, "zh_Hant": T_zh_Hant,
14
16
  };
15
17
 
@@ -18,6 +20,7 @@ const TRANSLATIONS = {
18
20
  * @param {str[]} supportedTranslations List of supported languages
19
21
  * @param {str} fallback The fallback language
20
22
  * @returns The best matching language
23
+ * @private
21
24
  */
22
25
  export function autoDetectLocale(supportedTranslations, fallback) { // eslint-ignore import/no-unused-modules
23
26
  for (const navigatorLang of window.navigator.languages) {
@@ -46,6 +46,7 @@ const ArrowTurn = svgToPSVLink(ArrowTurnSVG, COLORS.NEXT);
46
46
  * @param {number[]} ranges The QUALITYSCORE_*_VALUES definition
47
47
  * @param {number} value The picture value
48
48
  * @return {number} The corresponding grade (1 to 5, or null if missing)
49
+ * @private
49
50
  */
50
51
  export function getGrade(ranges, value) {
51
52
  if(value === null || value === undefined || value === "") { return null; }
@@ -588,6 +589,7 @@ export function isInternetFast() {
588
589
  * Get a cookie value
589
590
  * @param {str} name The cookie name
590
591
  * @returns {str} The cookie value, or null if not found
592
+ * @private
591
593
  */
592
594
  export function getCookie(name) {
593
595
  const parts = document.cookie
@@ -602,6 +604,7 @@ export function getCookie(name) {
602
604
  /**
603
605
  * Checks if an user account exists
604
606
  * @returns {object} Object like {"id", "name"} or null if no authenticated account
607
+ * @private
605
608
  */
606
609
  export function getUserAccount() {
607
610
  const session = getCookie("session");
@@ -502,6 +502,7 @@ export function createLabel(forAttr, text, faIcon = null) {
502
502
  * Show a grade in a nice, user-friendly way
503
503
  * @param {number} grade The obtained grade
504
504
  * @returns {string} Nice to display grade display
505
+ * @private
505
506
  */
506
507
  export function showGrade(grade, t) {
507
508
  let label = "<span class=\"gvs-grade\">";
@@ -523,6 +524,7 @@ export function showGrade(grade, t) {
523
524
  * Displays a nice QualityScore
524
525
  * @param {number} grade The 1 to 5 grade
525
526
  * @returns {Element} The HTML code for showing the grade
527
+ * @private
526
528
  */
527
529
  export function showQualityScore(grade) {
528
530
  const span = document.createElement("span");