mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 12:00:10 +08:00
Merge pull request #530 from corey-b/master
added enable ads to command line
This commit is contained in:
commit
848b399857
3 changed files with 41 additions and 3 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "monkeytype",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -309,6 +309,15 @@ let commands = {
|
|||
toggleShowOutOfFocusWarning();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "setEnableAds",
|
||||
display: "Set enable ads...",
|
||||
subgroup: true,
|
||||
exec: () => {
|
||||
currentCommands.push(commandsEnableAds);
|
||||
showCommandLine();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "togglePresetCustomTheme",
|
||||
display: "Toggle preset/custom theme",
|
||||
|
@ -758,6 +767,36 @@ let commandsDifficulty = {
|
|||
],
|
||||
};
|
||||
|
||||
let commandsEnableAds = {
|
||||
title: "Set enable ads...",
|
||||
list: [
|
||||
{
|
||||
id: "setEnableAdsOff",
|
||||
display: "off",
|
||||
exec: () => {
|
||||
setEnableAds("off");
|
||||
showNotification("Don't forget to refresh the page!", 3000);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "setEnableAdsOn",
|
||||
display: "on",
|
||||
exec: () => {
|
||||
setEnableAds("on");
|
||||
showNotification("Don't forget to refresh the page!", 3000);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "setEnableMax",
|
||||
display: "Sellout",
|
||||
exec: () => {
|
||||
setEnableAds("max");
|
||||
showNotification("Don't forget to refresh the page!", 3000);
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
let commandsCaretStyle = {
|
||||
title: "Change caret style...",
|
||||
list: [
|
||||
|
|
|
@ -1768,7 +1768,6 @@ function showResult(difficultyFailed = false) {
|
|||
time = secondsToString(roundTo2(testtime));
|
||||
}
|
||||
$("#result .stats .time .bottom .text").text(time);
|
||||
|
||||
$("#result .stats .raw .bottom").removeAttr("aria-label");
|
||||
$("#result .stats .acc .bottom").removeAttr("aria-label");
|
||||
$("#result .stats .time .bottom").attr(
|
||||
|
@ -1790,7 +1789,7 @@ function showResult(difficultyFailed = false) {
|
|||
$("#result .stats .wpm .top .text").text("cpm");
|
||||
$("#result .stats .wpm .bottom").attr(
|
||||
"aria-label",
|
||||
stats.wpm + ` (${roundTo2(stats.wpm)} wpm)`
|
||||
stats.wpm * 5 + ` (${roundTo2(stats.wpm)} wpm)`
|
||||
);
|
||||
$("#result .stats .wpm .bottom").text(Math.round(stats.wpm * 5));
|
||||
$("#result .stats .raw .bottom").text(Math.round(stats.wpmRaw * 5));
|
||||
|
|
Loading…
Reference in a new issue