mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-11 00:03:44 +08:00
-added change custom background to command line
-trimmed url input to reduce errors
This commit is contained in:
parent
bdfab7caef
commit
c7f1202944
2 changed files with 9 additions and 0 deletions
|
@ -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...",
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue