Merge master

This commit is contained in:
pietervdvn 2021-04-21 02:06:45 +02:00
commit 1bc2187802
4 changed files with 12 additions and 8 deletions

View file

@ -2,7 +2,7 @@ import { Utils } from "../Utils";
export default class Constants {
public static vNumber = "0.6.9";
public static vNumber = "0.6.9a";
// The user journey states thresholds when a new feature gets unlocked
public static userJourney = {

View file

@ -23,7 +23,7 @@ export default class DirectionInput extends InputElement<string> {
return;
}
const cone = selfElement.getElementsByClassName("direction-svg")[0] as HTMLElement
cone.style.rotate = rotation + "deg";
cone.style.transform = `rotate(${rotation}deg)`;
})
@ -38,7 +38,7 @@ export default class DirectionInput extends InputElement<string> {
return new Combine([
`<div id="direction-leaflet-div-${this.id}" style="width:100%;height: 100%;position: absolute;top:0;left:0;border-radius:100%;"></div>`,
Svg.direction_svg().SetStyle(
`position: absolute;top: 0;left: 0;width: 100%;height: 100%;rotate:${this.value.data}deg;`)
`position: absolute;top: 0;left: 0;width: 100%;height: 100%;transform:rotate(${this.value.data ?? 0}deg);`)
.SetClass("direction-svg"),
Svg.compass_svg().SetStyle(
"position: absolute;top: 0;left: 0;width: 100%;height: 100%;")
@ -74,7 +74,7 @@ export default class DirectionInput extends InputElement<string> {
htmlElement.onmousedown = (ev: MouseEvent) => {
isDown = true;
onPosChange(ev.x, ev.y);
onPosChange(ev.clientX, ev.clientY);
ev.preventDefault();
}
@ -84,7 +84,7 @@ export default class DirectionInput extends InputElement<string> {
htmlElement.onmousemove = (ev: MouseEvent) => {
if (isDown) {
onPosChange(ev.x, ev.y);
onPosChange(ev.clientX, ev.clientY);
} ev.preventDefault();
}
}

View file

@ -84,13 +84,17 @@ if (layoutFromBase64.startsWith("http")) {
success: (data) => {
try {
const parsed = JSON.parse(data);
console.log("Received ", data)
let parsed = data;
if(typeof parsed == "string"){
parsed = JSON.parse(data);
}
// Overwrite the id to the wiki:value
parsed.id = link;
const layout = new LayoutConfig(parsed, false).patchImages(link, data);
InitUiElements.InitAll(layout, layoutFromBase64, testing, layoutFromBase64, btoa(data));
} catch (e) {
new FixedUiElement(`<a href="${link}">${link}</a> is invalid:<br/>${e}<br/> <a href='https://${window.location.host}/'>Go back</a>")`)
new FixedUiElement(`<a href="${link}">${link}</a> is invalid:<br/>${e}<br/> <a href='https://${window.location.host}/'>Go back</a>`)
.SetClass("clickable")
.AttachTo("centermessage");
console.error("Could not parse the text", data)

View file

@ -14,7 +14,7 @@
"generate:images": "ts-node scripts/generateIncludedImages.ts",
"generate:translations": "ts-node scripts/generateTranslations.ts",
"generate:layouts": "ts-node scripts/generateLayouts.ts",
"generate:docs": "ts-node scripts/generateDocs.ts",
"generate:docs": "ts-node scripts/generateDocs.ts && ts-node scripts/generateTaginfoProjectFiles.ts",
"generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail",
"generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail",
"validate:layeroverview": "ts-node scripts/generateLayerOverview.ts --report",