From 2c04d534a21b7e83f36efcfc2ca8800f3efd1b23 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Fri, 19 Feb 2021 22:10:56 +0100 Subject: [PATCH] Improve startup time --- js/interface/themes.js | 56 ++++++++++++++++++++++-------------------- package-lock.json | 28 +++++++++++++-------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/js/interface/themes.js b/js/interface/themes.js index 7036da02..42a9e5ea 100644 --- a/js/interface/themes.js +++ b/js/interface/themes.js @@ -95,35 +95,37 @@ const CustomTheme = { }) Vue.nextTick(function() { CustomTheme.fetchFromStorage(); - - var wrapper = $('#color_wrapper'); - for (var key in CustomTheme.defaultColors) { - (() => { - var scope_key = key; - var hex = CustomTheme.data.colors[scope_key]; - var last_color = hex; - var field = wrapper.find('#color_field_'+scope_key); - - field.spectrum({ - preferredFormat: "hex", - color: hex, - showAlpha: false, - showInput: true, - move(c) { - CustomTheme.data.colors[scope_key] = c.toHexString(); - }, - change(c) { - last_color = c.toHexString(); - }, - hide(c) { - CustomTheme.data.colors[scope_key] = last_color; - field.spectrum('set', last_color); - } - }); - })() - } }) }, + setupDialog() { + var wrapper = $('#color_wrapper'); + for (var key in CustomTheme.defaultColors) { + (() => { + var scope_key = key; + var hex = CustomTheme.data.colors[scope_key]; + var last_color = hex; + var field = wrapper.find('#color_field_'+scope_key); + + field.spectrum({ + preferredFormat: "hex", + color: hex, + showAlpha: false, + showInput: true, + move(c) { + CustomTheme.data.colors[scope_key] = c.toHexString(); + }, + change(c) { + last_color = c.toHexString(); + }, + hide(c) { + CustomTheme.data.colors[scope_key] = last_color; + field.spectrum('set', last_color); + } + }); + })() + } + CustomTheme.dialog_is_setup = true; + }, fetchFromStorage() { var legacy_colors = 0; var stored_theme = 0; diff --git a/package-lock.json b/package-lock.json index 7ee851b7..aa68293f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,9 +30,9 @@ } }, "@electron/get": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.2.tgz", - "integrity": "sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.4.tgz", + "integrity": "sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg==", "dev": true, "requires": { "debug": "^4.1.1", @@ -42,8 +42,16 @@ "global-tunnel-ng": "^2.7.1", "got": "^9.6.0", "progress": "^2.0.3", - "sanitize-filename": "^1.6.2", + "semver": "^6.2.0", "sumchecker": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "@sindresorhus/is": { @@ -652,9 +660,9 @@ } }, "core-js": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz", - "integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.0.tgz", + "integrity": "sha512-PyFBJaLq93FlyYdsndE5VaueA9K5cNB7CGzeCj191YYLhkQM0gdZR2SKihM70oF0wdqKSKClv/tEBOpoRmdOVQ==", "dev": true, "optional": true }, @@ -836,9 +844,9 @@ }, "dependencies": { "@types/node": { - "version": "12.19.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.9.tgz", - "integrity": "sha512-yj0DOaQeUrk3nJ0bd3Y5PeDRJ6W0r+kilosLA+dzF3dola/o9hxhMSg2sFvVcA2UHS5JSOsZp4S0c1OEXc4m1Q==", + "version": "12.20.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.4.tgz", + "integrity": "sha512-xRCgeE0Q4pT5UZ189TJ3SpYuX/QGl6QIAOAIeDSbAVAd2gX1NxSZup4jNVK7cxIeP8KDSbJgcckun495isP1jQ==", "dev": true } }