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(); diff --git a/static/index.html b/static/index.html index 70db6c2a4..8914100f6 100644 --- a/static/index.html +++ b/static/index.html @@ -2934,6 +2934,7 @@ placeholder="image url" class="input" tabindex="0" + onClick="this.select();" />