diff --git a/Logic/UIEventSource.ts b/Logic/UIEventSource.ts index d372960..8f604fd 100644 --- a/Logic/UIEventSource.ts +++ b/Logic/UIEventSource.ts @@ -86,12 +86,8 @@ export class UIEventSource { } public ping(): void { - const old = this.data; for (const callback of this._callbacks) { callback(this.data); - if(this.data === undefined && old !== undefined){ - throw "Something undefined the data!" - } } } diff --git a/Models/Constants.ts b/Models/Constants.ts index cfb40d2..4d02054 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.5.0-rc5"; + public static vNumber = "0.5.0a"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = { diff --git a/UI/Popup/TagRenderingQuestion.ts b/UI/Popup/TagRenderingQuestion.ts index e5fa9c8..3375fd5 100644 --- a/UI/Popup/TagRenderingQuestion.ts +++ b/UI/Popup/TagRenderingQuestion.ts @@ -91,7 +91,7 @@ export default class TagRenderingQuestion extends UIElement { ).SetClass("block") } - private GenerateInputElement(): InputElement { + private GenerateInputElement(): InputElement { const ff = this.GenerateFreeform(); const self = this; let mappings = @@ -190,15 +190,20 @@ export default class TagRenderingQuestion extends UIElement { freeformField?.GetValue()?.addCallbackAndRun(value => { + // The list of indices of the selected elements const es = checkBoxes.GetValue(); const i = elements.length - 1; + // The actual index of the freeform-element const index = es.data.indexOf(i); if (value === undefined) { + // No data is set in the freeform text field; so we delete the checkmark if it is selected if (index >= 0) { es.data.splice(index, 1); es.ping(); } } else if (index < 0) { + // There is data defined in the checkmark, but the checkmark isn't checked, so we check it + // This is of course because the data changed es.data.push(i); es.ping(); } diff --git a/scripts/createLayouts.ts b/scripts/createLayouts.ts index e7e8ace..0766c4a 100644 --- a/scripts/createLayouts.ts +++ b/scripts/createLayouts.ts @@ -1,7 +1,7 @@ // We HAVE to mark this while importing import {Utils} from "../Utils"; - Utils.runningFromConsole = true; +const sharp = require('sharp'); import LayoutConfig from "../Customizations/JSON/LayoutConfig"; import {AllKnownLayouts} from "../Customizations/AllKnownLayouts"; @@ -55,7 +55,7 @@ function validate(layout: LayoutConfig) { } } - let message = `Translation completenes for theme ${layout.id}` + let message = `Translation completeness for theme ${layout.id}` let isComplete = true; for (const ln of layout.language) { const amiss = missing[ln]; @@ -121,25 +121,11 @@ async function createIcon(iconPath: string, size: number, layout: LayoutConfig) } try { - console.log("Could not create icon! ", name, newname) - /* // We already read to file, in order to crash here if the file is not found readFileSync(iconPath); - let img = await sharp(iconPath) let resized = await img.resize(size) await resized.toFile(newname) - - /* svg2img(iconPath, - // @ts-ignore - {width: size, height: size, preserveAspectRatio: true}) - .then((buffer) => { - console.log("Writing icon", newname) - writeFileSync(newname, buffer); - }).catch((error) => { - console.log("ERROR while writing" + iconPath, error) - }); - //*/ } catch (e) { console.error("Could not read icon", iconPath, "due to", e) }