diff --git a/package-lock.json b/package-lock.json index 6750625..515cad0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,18 +14,11 @@ "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^14.0.0", "css-loader": "^7.1.2", - "d3": "^7.8.5", - "file-loader": "^6.2.0", "html-loader": "^5.0.0", - "jquery": "^3.7.1", - "jquery-mousewheel": "^3.1.13", - "jquery.waitforimages": "^2.4.0", "maplibre-gl": "^5.4.0", - "resize-observer-polyfill": "^1.5.1", "sass": "^1.97.2", "sass-loader": "^16.0.5", "simplebar-vue": "^2.3.3", - "style-loader": "^4.0.0", "url-loader": "^4.1.1", "vue": "^3.3.8", "vue-style-loader": "^4.1.3" @@ -2862,15 +2855,6 @@ "dev": true, "license": "MIT" }, - "node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3001,407 +2985,6 @@ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", "license": "MIT" }, - "node_modules/d3": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", - "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", - "license": "ISC", - "dependencies": { - "d3-array": "3", - "d3-axis": "3", - "d3-brush": "3", - "d3-chord": "3", - "d3-color": "3", - "d3-contour": "4", - "d3-delaunay": "6", - "d3-dispatch": "3", - "d3-drag": "3", - "d3-dsv": "3", - "d3-ease": "3", - "d3-fetch": "3", - "d3-force": "3", - "d3-format": "3", - "d3-geo": "3", - "d3-hierarchy": "3", - "d3-interpolate": "3", - "d3-path": "3", - "d3-polygon": "3", - "d3-quadtree": "3", - "d3-random": "3", - "d3-scale": "4", - "d3-scale-chromatic": "3", - "d3-selection": "3", - "d3-shape": "3", - "d3-time": "3", - "d3-time-format": "4", - "d3-timer": "3", - "d3-transition": "3", - "d3-zoom": "3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-array": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", - "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", - "license": "ISC", - "dependencies": { - "internmap": "1 - 2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-axis": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", - "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-brush": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", - "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", - "license": "ISC", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-drag": "2 - 3", - "d3-interpolate": "1 - 3", - "d3-selection": "3", - "d3-transition": "3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-chord": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", - "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", - "license": "ISC", - "dependencies": { - "d3-path": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-color": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", - "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-contour": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", - "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", - "license": "ISC", - "dependencies": { - "d3-array": "^3.2.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-delaunay": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", - "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", - "license": "ISC", - "dependencies": { - "delaunator": "5" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-dispatch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", - "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-drag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", - "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", - "license": "ISC", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-selection": "3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-dsv": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", - "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", - "license": "ISC", - "dependencies": { - "commander": "7", - "iconv-lite": "0.6", - "rw": "1" - }, - "bin": { - "csv2json": "bin/dsv2json.js", - "csv2tsv": "bin/dsv2dsv.js", - "dsv2dsv": "bin/dsv2dsv.js", - "dsv2json": "bin/dsv2json.js", - "json2csv": "bin/json2dsv.js", - "json2dsv": "bin/json2dsv.js", - "json2tsv": "bin/json2dsv.js", - "tsv2csv": "bin/dsv2dsv.js", - "tsv2json": "bin/dsv2json.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-ease": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", - "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-fetch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", - "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", - "license": "ISC", - "dependencies": { - "d3-dsv": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-force": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", - "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", - "license": "ISC", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-quadtree": "1 - 3", - "d3-timer": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-format": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", - "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-geo": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", - "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", - "license": "ISC", - "dependencies": { - "d3-array": "2.5.0 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-hierarchy": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", - "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-interpolate": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", - "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", - "license": "ISC", - "dependencies": { - "d3-color": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", - "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-polygon": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", - "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-quadtree": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", - "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-random": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", - "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-scale": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", - "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", - "license": "ISC", - "dependencies": { - "d3-array": "2.10.0 - 3", - "d3-format": "1 - 3", - "d3-interpolate": "1.2.0 - 3", - "d3-time": "2.1.1 - 3", - "d3-time-format": "2 - 4" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-scale-chromatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", - "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", - "license": "ISC", - "dependencies": { - "d3-color": "1 - 3", - "d3-interpolate": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-selection": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", - "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-shape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", - "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", - "license": "ISC", - "dependencies": { - "d3-path": "^3.1.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-time": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", - "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", - "license": "ISC", - "dependencies": { - "d3-array": "2 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-time-format": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", - "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", - "license": "ISC", - "dependencies": { - "d3-time": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-timer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", - "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-transition": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", - "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", - "license": "ISC", - "dependencies": { - "d3-color": "1 - 3", - "d3-dispatch": "1 - 3", - "d3-ease": "1 - 3", - "d3-interpolate": "1 - 3", - "d3-timer": "1 - 3" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "d3-selection": "2 - 3" - } - }, - "node_modules/d3-zoom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", - "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", - "license": "ISC", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-drag": "2 - 3", - "d3-interpolate": "1 - 3", - "d3-selection": "2 - 3", - "d3-transition": "2 - 3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -3438,15 +3021,6 @@ "node": ">=6" } }, - "node_modules/delaunator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz", - "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==", - "license": "ISC", - "dependencies": { - "robust-predicates": "^3.0.2" - } - }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -3679,6 +3253,8 @@ "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "loader-utils": "^2.0.0", "schema-utils": "^3.0.0" @@ -3699,6 +3275,8 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3715,6 +3293,8 @@ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "license": "MIT", + "optional": true, + "peer": true, "peerDependencies": { "ajv": "^6.9.1" } @@ -3723,13 +3303,17 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/file-loader/node_modules/schema-utils": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -3967,18 +3551,6 @@ "node": ">=14" } }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/icss-utils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", @@ -4034,15 +3606,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, - "node_modules/internmap": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", - "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/interpret": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", @@ -4194,27 +3757,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jquery": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", - "license": "MIT" - }, - "node_modules/jquery-mousewheel": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jquery-mousewheel/-/jquery-mousewheel-3.2.2.tgz", - "integrity": "sha512-JP71xTAg08ZY3hcs9ZbYUZ5i+dkSsz4yRl/zpWkAmtzc+kMs5EfPkpkINSidiLYMaR0MTo3DfFGF9WIezMsFQQ==", - "license": "MIT", - "dependencies": { - "jquery": ">=1.2.6" - } - }, - "node_modules/jquery.waitforimages": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jquery.waitforimages/-/jquery.waitforimages-2.4.0.tgz", - "integrity": "sha512-GmkE2wf2vUlg+XayDq0bfUtsn/Wq7FIX1NjnOtMjl63goz/PKj7787RoTJXQx6XAaZAO3TQ3QoLfLwWsaDKOhQ==", - "license": "MIT" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5103,12 +4645,6 @@ "node": ">=0.10.0" } }, - "node_modules/resize-observer-polyfill": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", - "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", - "license": "MIT" - }, "node_modules/resolve": { "version": "1.22.12", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", @@ -5209,24 +4745,12 @@ "rimraf": "bin.js" } }, - "node_modules/robust-predicates": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz", - "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==", - "license": "Unlicense" - }, "node_modules/rw": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", "license": "BSD-3-Clause" }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, "node_modules/sass": { "version": "1.99.0", "resolved": "https://registry.npmjs.org/sass/-/sass-1.99.0.tgz", @@ -5438,22 +4962,6 @@ "source-map": "^0.6.0" } }, - "node_modules/style-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", - "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", - "license": "MIT", - "engines": { - "node": ">= 18.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.27.0" - } - }, "node_modules/supercluster": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", diff --git a/package.json b/package.json index bc97d28..fdf066b 100644 --- a/package.json +++ b/package.json @@ -27,18 +27,11 @@ "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^14.0.0", "css-loader": "^7.1.2", - "d3": "^7.8.5", - "file-loader": "^6.2.0", "html-loader": "^5.0.0", - "jquery": "^3.7.1", - "jquery-mousewheel": "^3.1.13", - "jquery.waitforimages": "^2.4.0", "maplibre-gl": "^5.4.0", - "resize-observer-polyfill": "^1.5.1", "sass": "^1.97.2", "sass-loader": "^16.0.5", "simplebar-vue": "^2.3.3", - "style-loader": "^4.0.0", "url-loader": "^4.1.1", "vue": "^3.3.8", "vue-style-loader": "^4.1.3" diff --git a/src/scripts/leaflet.helpers.js b/src/scripts/leaflet.helpers.js deleted file mode 100644 index 5b5fd05..0000000 --- a/src/scripts/leaflet.helpers.js +++ /dev/null @@ -1,14 +0,0 @@ -/* Additional Leaflet functions */ - -L.Map.include({ - setOffsetView: function (iOffsetRatioX, oCenter, iZoomLevel) { - var oCenter = (typeof oCenter == 'object')?$.extend({}, oCenter):this.getCenter(); - iZoomLevel = iZoomLevel || this.getZoom(); - - var oBounds = this.getBounds(); - var iOffsetX = (oBounds.getEast() - oBounds.getWest()) * iOffsetRatioX / ( 2 * Math.pow(2, iZoomLevel - this.getZoom())); - oCenter.lng = oCenter.lng - iOffsetX; - - this.setView(oCenter, iZoomLevel); - } -}); diff --git a/src/scripts/page.admin.js b/src/scripts/page.admin.js deleted file mode 100644 index d9cb391..0000000 --- a/src/scripts/page.admin.js +++ /dev/null @@ -1,165 +0,0 @@ -export default class Admin { - - constructor(oSpot) { - this.spot = oSpot; - } - - pageInit(asHash) { - this.spot.get('admin_get', (asElemTypes) => {this.setProjects(asElemTypes);}); - $('#new').addButton('new', this.spot.lang('new_project'), 'new', () => {this.createProject();}); - $('#toolbox').addButton('refresh', this.spot.lang('update_project'), 'refresh', () => {this.updateProject();}); - } - - onFeedback(sType, sMsg, asContext) { - delete asContext.a; - delete asContext.t; - sMsg += ' ('; - $.each(asContext, function(sKey, sElem) { - sMsg += sKey+'='+sElem+' / ' ; - }); - sMsg = sMsg.slice(0, -3)+')'; - $('#feedback').append($('

', {'class': sType}).text(sMsg)); - } - - setProjects(asElemTypes) { - let aoEvents = [ - { - on:'change', - callback: (oEvent) => {this.commit(oEvent);} - }, - { - on:'keyup', - callback: (oEvent) => {this.waitAndCommit(oEvent);} - } - ]; - let aoChangeEvent = [aoEvents[0]]; - - $.each(asElemTypes, (sElemType, aoElems) => { - $.each(aoElems, (iKey, oElem) => { - var sElemId = sElemType+'_'+oElem.id; - var bNew = ($('#'+sElemId).length == 0); - - var $Elem = (bNew?$('', {'id': sElemId}):$('#'+sElemId)) - .data('type', sElemType) - .data('id', oElem.id); - - if(oElem.del) $Elem.remove(); - else if(!bNew) { - $Elem.find('input').each((iKey, oInput) => { - var $Input = $(oInput); - if($Input.attr('name') in oElem && $Input.attr('type')!='date') $Input.val(oElem[$Input.attr('name')]); - }); - } - else { - $Elem.append($('').text(oElem.id || '')); - switch(sElemType) { - case 'project': - $Elem - .append($('').addInput('text', 'name', oElem.name, aoEvents)) - .append($('', {'class': 'mode'}).text(oElem.mode)) - .append($('').addInput('text', 'codename', oElem.codename, aoEvents)) - .append($('').addInput('date', 'active_from', oElem.active_from, aoChangeEvent)) - .append($('').addInput('date', 'active_to', oElem.active_to, aoChangeEvent)) - .append($('').addButton('close fa-lg', '', 'del_proj', (oEvent)=>{this.del(oEvent);})); - break; - case 'feed': - $Elem - .append($('').addInput('text', 'ref_feed_id', oElem.ref_feed_id, aoEvents)) - .append($('').addInput('number', 'id_spot', oElem.id_spot, aoEvents)) - .append($('').addInput('number', 'id_project', oElem.id_project, aoEvents)) - .append($('').text(oElem.name)) - .append($('').text(oElem.status)) - .append($('').text(oElem.last_update)) - .append($('').addButton('close fa-lg', '', 'del_feed', (oEvent)=>{this.del(oEvent);})); - break; - case 'spot': - $Elem - .append($('').text(oElem.ref_spot_id)) - .append($('').text(oElem.name)) - .append($('').text(oElem.model)) - break; - case 'user': - $Elem - .append($('').text(oElem.name)) - .append($('').text(oElem.language)) - .append($('').text(oElem.timezone)) - .append($('').addInput('number', 'clearance', oElem.clearance, aoEvents)) - break; - } - - $Elem.appendTo($('#'+sElemType+'_section').find('table tbody')); - } - }); - }); - } - - createProject() { - this.spot.get('admin_new', this.setProjects); - } - - updateProject() { - this.spot.get( - 'update_project', - (asData, sMsg) => {this.spot.onFeedback('success', sMsg, {'update':'project'});}, - {}, - (sMsg) => {this.spot.onFeedback('error', sMsg, {'update':'project'});} - ); - } - - commit(oEvent) { - let $Elem = $(oEvent.currentTarget); - if(typeof this.spot.tmp('wait') != 'undefined') clearTimeout(this.spot.tmp('wait')); - - var sOldVal = $Elem.data('old_value'); - var sNewVal = $Elem.val(); - if(sOldVal != sNewVal) { - $Elem.data('old_value', sNewVal); - - var $Record = $Elem.closest('tr'); - var asInputs = { - type: $Record.data('type'), - id: $Record.data('id'), - field: $Elem.attr('name'), - value: sNewVal - }; - - this.spot.get( - 'admin_set', - (asData) => { - this.spot.onFeedback('success', this.spot.lang('admin_save_success'), asInputs); - this.setProjects(asData); - }, - asInputs, - (sError) => { - $Elem.data('old_value', sOldVal); - this.spot.onFeedback('error', sError, asInputs); - } - ); - } - } - - waitAndCommit(oEvent) { - if(typeof this.spot.tmp('wait') != 'undefined') clearTimeout(this.spot.tmp('wait')); - this.spot.tmp('wait', setTimeout(() => {this.commit(oEvent);}, 2000)); - } - - del(oEvent) { - var $Record = $(oEvent.currentTarget).closest('tr'); - var asInputs = { - type: $Record.data('type'), - id: $Record.data('id') - }; - - this.spot.get( - 'admin_del', - (asData) => { - this.spot.onFeedback('success', this.spot.lang('admin_save_success'), asInputs); - this.setProjects(asData); - }, - asInputs, - (sError) => { - this.spot.onFeedback('error', sError, asInputs); - } - ); - } -} \ No newline at end of file diff --git a/src/scripts/page.project.js b/src/scripts/page.project.js deleted file mode 100644 index c7428d1..0000000 --- a/src/scripts/page.project.js +++ /dev/null @@ -1,1179 +0,0 @@ -//jQuery plugins -import autosize from 'autosize'; -import mousewheel from 'jquery-mousewheel'; -import waitforimages from 'jquery.waitforimages'; - -//Simplebar -import SimpleBar from 'simplebar'; -window.SimpleBar = SimpleBar; -import ResizeObserver from 'resize-observer-polyfill'; -window.ResizeObserver = ResizeObserver; - -//Leaflet -import 'leaflet'; -import 'leaflet-geometryutil'; -import 'leaflet.heightgraph'; -import './leaflet.helpers'; - -export default class Project { - - constructor(oSpot) { - this.spot = oSpot; - } - - pageInit(asHash) { - this.spot.tmp('first_exec', true); - this.initPage(asHash); - } - - onResize() { - this.spot.tmp('map_offset', -1 * (this.isFeedPanelOpen()?this.spot.tmp('$Feed').outerWidth(true):0) / $('body').outerWidth(true)); - - if(typeof this.spot.tmp('elev') != 'undefined' && this.spot.tmp('elev')._showState) { - this.spot.tmp('elev').resize({width:this.getElevWidth()}); - } - } - - onSamePageMove(asHash) { - if(this.spot.tmp('first_exec')) this.initPage(asHash); - else if(asHash.items[0] != this.spot.vars(['project', 'codename'])) { - this.spot.tmp('map').remove(); - this.spot.tmp('$Map').empty(); - this.spot.tmp('map', null); - this.spot.tmp('$PostList').empty(); - this.setFeedUpdateTimer(-1); - this.initProject(asHash.items[0]); - } - return false; - } - - onQuitPage() { - this.setFeedUpdateTimer(-1); - return true; - } - - onKeydown(oEvent) { - switch(oEvent.which) { - case 27: - if(!this.isLightboxOpen()) { - $bFeedPanelOpen = this.isFeedPanelOpen(); - $bSettingsPanelOpen = this.isSettingsPanelOpen(); - $bAnimation = ($bFeedPanelOpen && $bSettingsPanelOpen)?'none':null; - if($bFeedPanelOpen) this.toggleFeedPanel(false, $bAnimation); - if($bSettingsPanelOpen) this.toggleSettingsPanel(false, $bAnimation); - } - break; - } - } - - initPage(asHash) { - if(asHash.items.length==0) this.spot.setHash(asHash.page, [this.spot.vars('default_project_codename')]); - else { - this.spot.tmp('$Projects', $('#projects')); - this.spot.tmp('$Map', $('#map')); - this.spot.tmp('$Poster', $('#poster')); - this.spot.tmp('$PostList', $('#posts_list')); - this.spot.tmp('$Feed', $('#feed')); - this.spot.tmp('$Settings', $('#settings')); - this.spot.tmp('$Title', $('#title')); - this.spot.tmp('updatable', true); - this.spot.tmp('out-of-data', false); - this.spot.tmp('markers', 'object'); - this.spot.tmp('trail-markers', 'object'); - this.spot.tmp('marker_size', {width: 32, height: 32}); - - if(!this.isMobile()) this.toggleFeedPanel(true, 'none'); - - //Lightbox options - lightbox.option({ - alwaysShowNavOnTouchDevices: true, - albumLabel: ' %1 / %2', - fadeDuration: 300, - imageFadeDuration: 400, - positionFromTop: 0, - resizeDuration: 400, - hasVideo: true, - onMediaChange: (oMedia) => { - this.spot.updateHash('media', oMedia.id); - if(oMedia.set == 'post-medias') this.goToPost({type: 'media', id: oMedia.id}); - }, - onClosing: () => {this.spot.flushHash();} - }); - - //Assign Track Type Colors - this.spot.tmp('track-type-styles', 'object'); - $('#legend').find('.line').each((iKey, oLegend) => { - var $Legend = $(oLegend); - var sTrackType = $Legend.attr('class').replace('line', '').trim(); - this.spot.tmp(['track-type-styles', sTrackType], {weight: parseInt($Legend.css('height')), color: $Legend.css('background-color'), opacity: 1}); - }); - - //Post Panel one-off init (see initPosts for project related init) - //Scrollbar - this.spot.tmp('simple-bar', new SimpleBar($('#feed-panel')[0])); - this.spot.tmp('simple-bar').getScrollElement().addEventListener('scroll', (oEvent) => {this.onFeedScroll(oEvent);}); - - //Add "Loading" Post - this.getPost({type: 'loading', headerless: true, formatted_time: '', relative_time: ''}).appendTo($('#loading')); - - //Mobile Touchscreen Events - this.spot.tmp('$Feed').onSwipe( - (oPos) => { - this.$Panels = $('.leaflet-right') - .add(this.spot.tmp('$Feed')) - .each((iIndex, oElem) => { - let $Elem = $(oElem); - $Elem.data('initial-offset', parseInt($Elem.css('right'))); - }); - }, - (oPos) => { - this.$Panels.each((iIndex, oElem) => { - let $Elem = $(oElem); - $Elem.css({'right': ($Elem.data('initial-offset') + Math.min(oPos.xStart - oPos.xMove, 0))+'px', 'transition': 'none'}); - }); - }, - (oPos) => { - if(oPos.xEnd - oPos.xStart > 100 && Math.abs(oPos.yEnd - oPos.yStart) < 100) this.toggleFeedPanel(false); - this.$Panels.css({'right': '', 'transition': ''}); - } - ); - this.spot.tmp('$Settings').onSwipe( - (oPos) => { - this.$Panels = $('.leaflet-left') - .add(this.spot.tmp('$Settings')) - .each((iIndex, oElem) => { - let $Elem = $(oElem); - $Elem.data('initial-offset', parseInt($Elem.css('left'))); - }); - }, - (oPos) => { - this.$Panels.each((iIndex, oElem) => { - let $Elem = $(oElem); - $Elem.css({'left': ($Elem.data('initial-offset') + Math.min(oPos.xMove - oPos.xStart, 0))+'px', 'transition': 'none'}); - }); - }, - (oPos) => { - if(oPos.xEnd - oPos.xStart < -100 && Math.abs(oPos.yEnd - oPos.yStart) < 100) this.toggleSettingsPanel(false); - this.$Panels.css({'left': '', 'transition': ''}); - } - ); - - //Feed Panel - this.initPosts(); - - //Settings Panel - this.initSettings(); - - //project Bootstrap - var oFocusPost = asHash.items[1]?{type: asHash.items[1], id: asHash.items[2]}:null; - this.initProject(asHash.items[0], oFocusPost); - } - } - - toggleFeedPanel(bShow, sMapAction) { - let bOldValue = this.isFeedPanelOpen(); - this.spot.tmp('$Projects').toggleClass('with-feed', (typeof bShow === 'undefined')?null:bShow); - let bNewValue = this.isFeedPanelOpen(); - - if(bOldValue != bNewValue) { - this.spot.onResize(); - sMapAction = sMapAction || 'panTo'; - switch(sMapAction) { - case 'none': break; - case 'panTo': this.spot.tmp('map').panBy([(this.isFeedPanelOpen()?1:-1)*this.spot.tmp('$Feed').outerWidth(true)/2, 0], {duration: 0.5}); break; - case 'panToInstant': this.spot.tmp('map').panBy([(this.isFeedPanelOpen()?1:-1)*this.spot.tmp('$Feed').outerWidth(true)/2, 0]); break; - case 'fitBounds': this.spot.tmp('map').fitBounds(this.spot.tmp('track').getBounds(), {paddingTopLeft: L.point(5, this.spot.tmp('marker_size').height + 5), paddingBottomRight: L.point(this.spot.tmp('$Feed').outerWidth(true) + 5, 5)}); break; - } - } - } - - isFeedPanelOpen() { - return this.spot.tmp('$Projects').hasClass('with-feed'); - } - - toggleSettingsPanel(bShow, sMapAction) { - let bOldValue = this.isSettingsPanelOpen(); - this.spot.tmp('$Projects').toggleClass('with-settings', (typeof bShow === 'undefined')?null:bShow); - let bNewValue = this.isSettingsPanelOpen(); - - if(bOldValue != bNewValue) { - this.spot.onResize(); - sMapAction = sMapAction || 'panTo'; - switch(sMapAction) { - case 'none': break; - case 'panTo': this.spot.tmp('map').panBy([(this.isSettingsPanelOpen()?-1:1)*this.spot.tmp('$Settings').outerWidth(true)/2, 0], {duration: 0.5}); break; - case 'panToInstant': this.spot.tmp('map').panBy([(this.isSettingsPanelOpen()?-1:1)*this.spot.tmp('$Settings').outerWidth(true)/2, 0]); break; - } - } - } - - isSettingsPanelOpen() { - return this.spot.tmp('$Projects').hasClass('with-settings'); - } - - updateSettingsPanel(asLastUpdate) { - var $LastUpdate = this.spot.tmp('$Settings').find('#last_update').toggle(this.spot.vars(['project', 'mode']) == this.spot.consts.modes.blog && asLastUpdate.unix_time > 0); - $LastUpdate.find('abbr') - .attr('title', asLastUpdate.formatted_time) - .text(this.spot.lang('last_update')+' '+asLastUpdate.relative_time); - } - - isLightboxOpen() { - return $('#lightbox').is(':visible'); - } - - isMobile() { - return $('#mobile').is(':visible'); - } - - - initProject(sProjectCodeName, oFocusPost){ - this.spot.tmp('first_exec', false); - this.spot.vars('project', this.spot.vars(['projects', sProjectCodeName])); - - //Page Title - this.spot.setPageTitle(this.spot.vars(['project', 'name'])); - this.spot.tmp('$Title').find('#project_name').text(this.spot.vars(['project', 'name'])); - - //Load Track & Markers - $.when( - //Markers: Spot Messages & Medias - this.spot.get( - 'markers', - function(){}, - {id_project: this.spot.vars(['project', 'id'])}, - function(e){console.log(e);} - ), - //Project Geojson: Hike track - $.ajax({ - dataType: 'json', - url: this.spot.vars(['project', 'geofilepath']), - mimeType: 'application/json' - }) - ).done((aoMessages, aoTracks) => { - var asData = aoMessages[0]['data']; - this.setMapLayers(asData['maps']); - this.initSpotMessages(asData['messages'], aoTracks[0], asData['medias']); - this.updateSettingsPanel(asData['last_update']); - }); - - //Show/Hide Poster Panel - var bHistoMode = (this.spot.vars(['project', 'mode']) == this.spot.consts.modes.histo); - this.spot.tmp('$Poster').toggleClass('histo-mode', bHistoMode); - - //Feed auto-update - this.updateFeed(true, false, ()=>{this.focusOnPost(oFocusPost);}); - this.spot.tmp('simple-bar').getScrollElement().scrollTop = 0; - if(!bHistoMode) this.onAutoUpdate(true); - } - - initPosts() { - //Add post form - this.spot.tmp('$Poster').append(this.getPost({type: 'poster', formatted_time: '', relative_time: this.spot.lang('post_new_message')})); - - //Add archived Project Notice - this.spot.tmp('$Poster').append(this.getPost({type: 'archived', headerless: true})); - - //Auto-adjust text area height - autosize($('#post')); - - //Add post Event handling - $('#submit').on('click', () => { - if(this.spot.tmp('$Poster').checkForm()) { - this.spot.get( - 'add_post', - () => { - $('#post').val(''); - this.onAutoUpdate(); - }, - { - id_project: this.spot.vars(['project', 'id']), - name: $('#name').val(), - content: $('#post').val() - } - ); - } - }); - } - - initSettings(){ - //Scrollbar - new SimpleBar($('#settings-sections-scrollbox')[0]); - - //Feedback display function - let settingsFeedback = (sType, sMsg) => { - $('

', {'class': sType}) - .append($('', {'class':'fa push fa-'+sType})) - .append(sMsg) - .appendTo($('#settings-feedback')) - .slideDown('fast') - .delay(5000) - .slideUp('fast', function() {$(this).remove();}); - }; - - //Newsletter Subscription - $('#nl_btn').on('click', (oEvent) => { - var sAction = $(oEvent.currentTarget).prop('name'); - var sEmail = $('#email').val(); - var regexEmail = /^(([^<>()[\]\\.,;:\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,}))$/; - if(!regexEmail.test(sEmail)) settingsFeedback('error', this.spot.lang('nl_invalid_email')); - else { - this.spot.get( - sAction, - (asData, sDesc) => { - settingsFeedback('success', sDesc); - this.spot.vars('user', asData); - this.setUserInterface(); - }, - {'email': sEmail, 'name': $('#name').val()}, - (sDesc) => {settingsFeedback('error', sDesc);}, - (sState) => { - var bLoading = (sState=='start'); - $('#nl_btn') - .prop('disabled', bLoading) - .toggleClass('loading', bLoading); - } - ); - } - }); - - //Admin Access - $('#admin_link').toggle(this.spot.checkClearance(this.spot.consts.clearances.admin)); - - //Twink interface with user data - this.setUserInterface(); - } - - setUserInterface() { - var asUserInfo = this.spot.vars('user'); - if(asUserInfo.id_user) { //Subscribed User - $('#email').val(asUserInfo.email).prop('disabled', true); - $('#nl_btn').attr({name: 'unsubscribe', title: this.spot.lang('nl_unsubscribe'), 'class':'unsubscribe'}); - $('#nl_desc').text(this.spot.lang('nl_subscribed_desc')); - - //Populate nickname - if(asUserInfo.name) $('#name').val(asUserInfo.name); - } - else { //Unsubscribed User - $('#email').val('').prop('disabled', false); - $('#nl_btn').attr({name: 'subscribe', title: this.spot.lang('nl_subscribe'), 'class':'subscribe'}); - $('#nl_desc').text(this.spot.lang('nl_unsubscribed_desc')); - } - } - - getElevWidth() { - var - iPageWidth = this.spot.tmp('$Projects').width(), - iFeedPanelWidth = this.isFeedPanelOpen()?this.spot.tmp('$Feed').outerWidth(true):0, - iSettingsPanelWidth = this.isSettingsPanelOpen()?this.spot.tmp('$Settings').outerWidth(true):0, - iLegendWidth = $('.leaflet-bottom.leaflet-left > .leaflet-control-layers').outerWidth(true), - oElevRightMarging = parseInt($('.leaflet-bottom.leaflet-right > .leaflet-control-scale').css('margin-right').slice(0, -2)); - - return iPageWidth - iFeedPanelWidth - iSettingsPanelWidth - iLegendWidth - oElevRightMarging; - } - - setMapLayers(asLayers) { - this.spot.tmp('layers', {}); - $.each(asLayers, (iKey, asLayer) => { - var sMapName = this.spot.lang('map_'+asLayer.codename); - var asMapOptions = { - tileSize: parseInt(asLayer.tile_size), - zoomOffset: (parseInt(asLayer.tile_size) / -256 + 1), - minZoom: parseInt(asLayer.min_zoom), - maxZoom: parseInt(asLayer.max_zoom), - attribution: asLayer.attribution - } - if(asLayer.token != '') asMapOptions.token = asLayer.token; - - this.spot.tmp('layers')[sMapName] = L.tileLayer(asLayer.pattern, asMapOptions); - }); - } - - initSpotMessages(aoMessages, aoTracks, aoMedias) { - var bIsMobile = this.isMobile(); - - //Map - var oMap = L.map(this.spot.tmp('$Map')[0], { - layers: [this.spot.tmp('layers')[this.spot.lang('map_satellite')]], - attributionControl: false, - zoomControl: false - }); - this.spot.tmp('map', oMap); - - //Controls: Settings Panel - var oSettingsPanel = L.control({position: bIsMobile?'bottomleft':'topleft'}); - var $SettingsButton = $('#settings-button').clone(); - $SettingsButton.on('click', () => {this.toggleSettingsPanel();}); - oSettingsPanel.onAdd = function(oMap) {return $SettingsButton[0];}; - - //Project Title - var oTitle = L.control({position: bIsMobile?'bottomleft':'topleft'}); - var $Title = $('#title').clone(); - oTitle.onAdd = function(oMap) {return $Title[0];}; - - if(bIsMobile) { - oTitle.addTo(oMap); - oSettingsPanel.addTo(oMap); - } - else { - oSettingsPanel.addTo(oMap); - oTitle.addTo(oMap); - } - - //Controls: Feed Panel - var oFeedPanel = L.control({position: bIsMobile?'bottomright':'topright'}); - var $FeedButton = $('#feed-button').clone(); - $FeedButton.click(() => {this.toggleFeedPanel();}); - oFeedPanel.onAdd = function(oMap) {return $FeedButton[0];}; - oFeedPanel.addTo(oMap); - - //Controls: Legend - if(!bIsMobile) { - var oLegend = L.control({position: 'bottomleft'}); - oLegend.onAdd = function(oMap) {return $('#legend').clone()[0];}; - oLegend.addTo(oMap); - } - - //Controls: Projects - var $Labels = $('

', {'class': 'leaflet-control-layers-base'}); - $.each(this.spot.vars('projects'), (sCodeName, asProject) => { - var asRadioAttrs = {'type': 'radio', 'class': 'leaflet-control-layers-selector', 'name':'project', 'value': sCodeName}; - if(asProject.id == this.spot.vars(['project', 'id'])) asRadioAttrs.checked = 'checked'; - var $Radio = $('', asRadioAttrs).on('change', (oEvent) => { - this.toggleSettingsPanel(false); - this.spot.setHash(this.spot.vars('page'), [$(oEvent.currentTarget).val()]); - }); - - var $Label = $('