mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-06 05:26:54 +08:00
added fonts to the command line
This commit is contained in:
parent
091db7315a
commit
63f9b32458
1 changed files with 24 additions and 6 deletions
|
@ -259,6 +259,15 @@ let commands = {
|
|||
showCommandLine();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "changeFontFamily",
|
||||
display: "Change font family...",
|
||||
subgroup: true,
|
||||
exec: () => {
|
||||
currentCommands.push(commandsFonts);
|
||||
showCommandLine();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "joinDiscord",
|
||||
display: "Join the Discord server",
|
||||
|
@ -706,6 +715,11 @@ $.getJSON("funbox/list.json", function (data) {
|
|||
});
|
||||
});
|
||||
|
||||
let commandsFonts = {
|
||||
title: "Change font...",
|
||||
list: [],
|
||||
};
|
||||
|
||||
let fontsList;
|
||||
|
||||
$.getJSON("js/fonts.json", function (data) {
|
||||
|
@ -715,16 +729,20 @@ $.getJSON("js/fonts.json", function (data) {
|
|||
if (nameA > nameB) return 1;
|
||||
return 0;
|
||||
});
|
||||
data.forEach((font) => {
|
||||
commandsFonts.list.push({
|
||||
id: "changeFont" + font.name.replace(/ /g, "_"),
|
||||
display: font.name,
|
||||
exec: () => {
|
||||
setFontFamily(font.name);
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
let commandsThemes = {
|
||||
title: "Change theme...",
|
||||
list: [
|
||||
{
|
||||
id: "couldnotload",
|
||||
display: "Could not load the themes list :(",
|
||||
},
|
||||
],
|
||||
list: [],
|
||||
};
|
||||
|
||||
let commandsLanguages = {
|
||||
|
|
Loading…
Add table
Reference in a new issue