Skip to content

Commit

Permalink
trying validation in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
PXNX committed Dec 24, 2023
1 parent 9020ff8 commit 45866ae
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 513 deletions.
65 changes: 34 additions & 31 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function showMap(img:HTMLImageElement) {
});
document.getElementById("map").classList.remove("hidden");
}
}*/

function shareLink(title, url = window.location.href) {
if (navigator.share) {
Expand All @@ -127,47 +127,50 @@ function shareLink(title, url = window.location.href) {
} else {
// fallback
}
} */
import { Map, View } from "ol";
}

import {Map, View} from "ol";
import TileLayer from "ol/layer/Tile";
import OSM from "ol/source/OSM";

export function replaceImg(img) {
img.onerror = null;
img.src = "/dist/icons/account.svg";
img.onerror = null;
img.src = "/dist/icons/account.svg";
}

export const registerServiceWorker = async () => {
if ("serviceWorker" in navigator) {
try {
const registration = await navigator.serviceWorker.register(
"/dist/sw.js",
{
scope: "/",
if ("serviceWorker" in navigator) {
try {
const registration = await navigator.serviceWorker.register(
"/dist/sw.js",
{
scope: "/",
}
);
if (registration.installing) {
console.log("Service worker installing");
} else if (registration.waiting) {
console.log("Service worker installed");
} else if (registration.active) {
console.log("Service worker active");
}
} catch (error) {
console.error(`Registration failed with ${error}`);
}
);
if (registration.installing) {
console.log("Service worker installing");
} else if (registration.waiting) {
console.log("Service worker installed");
} else if (registration.active) {
console.log("Service worker active");
}
} catch (error) {
console.error(`Registration failed with ${error}`);
}
}
};
//https://www.digitalocean.com/community/tools/minify
//const {ol} = require('ol');
export function showMap2() {
console.log("ma2p");
new Map({
layers: [new TileLayer({ source: new OSM() })],
view: new View({
center: [0, 0],
zoom: 2,
}),
target: "map",
});
console.log("ma2p");
new Map({
layers: [new TileLayer({source: new OSM()})],
view: new View({
center: [0, 0],
zoom: 2,
}),
target: "map",
});
}

showMap2();
Loading

0 comments on commit 45866ae

Please sign in to comment.