mirror of
https://github.com/smittix/intercept.git
synced 2026-07-18 06:18:11 -07:00
Avoid duplicate/deprecated Three.js globe script loading
This commit is contained in:
@@ -34,7 +34,6 @@ const GPS = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const GPS_GLOBE_SCRIPT_URLS = [
|
const GPS_GLOBE_SCRIPT_URLS = [
|
||||||
'https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js',
|
|
||||||
'https://cdn.jsdelivr.net/npm/globe.gl@2.33.1/dist/globe.gl.min.js',
|
'https://cdn.jsdelivr.net/npm/globe.gl@2.33.1/dist/globe.gl.min.js',
|
||||||
];
|
];
|
||||||
const GPS_GLOBE_TEXTURE_URL = '/static/images/globe/earth-dark.jpg';
|
const GPS_GLOBE_TEXTURE_URL = '/static/images/globe/earth-dark.jpg';
|
||||||
@@ -160,7 +159,7 @@ const GPS = (function() {
|
|||||||
function loadGpsGlobeScript(src) {
|
function loadGpsGlobeScript(src) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const existing = document.querySelector(
|
const existing = document.querySelector(
|
||||||
`script[data-websdr-src="${src}"], script[data-gps-globe-src="${src}"]`
|
`script[data-websdr-src="${src}"], script[data-gps-globe-src="${src}"], script[src="${src}"]`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ let websdrResizeHooked = false;
|
|||||||
let websdrGlobeFallbackNotified = false;
|
let websdrGlobeFallbackNotified = false;
|
||||||
|
|
||||||
const WEBSDR_GLOBE_SCRIPT_URLS = [
|
const WEBSDR_GLOBE_SCRIPT_URLS = [
|
||||||
'https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js',
|
|
||||||
'https://cdn.jsdelivr.net/npm/globe.gl@2.33.1/dist/globe.gl.min.js',
|
'https://cdn.jsdelivr.net/npm/globe.gl@2.33.1/dist/globe.gl.min.js',
|
||||||
];
|
];
|
||||||
const WEBSDR_GLOBE_TEXTURE_URL = '/static/images/globe/earth-dark.jpg';
|
const WEBSDR_GLOBE_TEXTURE_URL = '/static/images/globe/earth-dark.jpg';
|
||||||
@@ -187,7 +186,7 @@ async function ensureWebsdrGlobeLibrary() {
|
|||||||
|
|
||||||
function loadWebsdrScript(src) {
|
function loadWebsdrScript(src) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const selector = `script[data-websdr-src="${src}"]`;
|
const selector = `script[data-websdr-src="${src}"], script[data-gps-globe-src="${src}"], script[src="${src}"]`;
|
||||||
const existing = document.querySelector(selector);
|
const existing = document.querySelector(selector);
|
||||||
|
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
|||||||
Reference in New Issue
Block a user