From c7f120294430a9e8d1b3a7a55a440be30beac5d4 Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 20:34:56 +0100 Subject: [PATCH 1/2] -added change custom background to command line -trimmed url input to reduce errors --- src/js/commandline-lists.js | 8 ++++++++ src/js/config.js | 1 + 2 files changed, 9 insertions(+) diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index bd8edf35a..fb6b67231 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -1596,6 +1596,14 @@ export let defaultCommands = { Commandline.show(); }, }, + { + id: "changeCustomBackground", + display: "Change custom background...", + input: true, + exec: (input) => { + UpdateConfig.setCustomBackground(input); + }, + }, { id: "changeTheme", display: "Change theme...", diff --git a/src/js/config.js b/src/js/config.js index 1c9fb98eb..639a0214c 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1349,6 +1349,7 @@ export function setCustomBackground(value, nosave) { if (value == null || value == undefined) { value = ""; } + value = value.trim(); if( /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test(value) || value == ""){ config.customBackground = value; ThemeController.applyCustomBackground(); From f0604c539cd42d1fd9afe86f42f0c801aaafa152 Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 20:38:12 +0100 Subject: [PATCH 2/2] selects url text when clicked --- static/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/static/index.html b/static/index.html index 8e3ae7975..e8d0c8451 100644 --- a/static/index.html +++ b/static/index.html @@ -2930,6 +2930,7 @@