mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 06:01:28 +08:00
Merge branch 'Miodec:master' into master
This commit is contained in:
commit
c48eeb8255
2 changed files with 16 additions and 10 deletions
|
|
@ -65,15 +65,15 @@ async function filter(language) {
|
|||
return filteredWords;
|
||||
}
|
||||
|
||||
async function apply() {
|
||||
async function apply(set) {
|
||||
let language = $("#wordFilterPopup .languageInput").val();
|
||||
let filteredWords = await filter(language);
|
||||
let customText = "";
|
||||
filteredWords.forEach((word) => {
|
||||
customText += word + " ";
|
||||
});
|
||||
let customText = filteredWords.join(" ");
|
||||
|
||||
$("#customTextPopup textarea").val(
|
||||
(index, val) => (set ? "" : val + " ") + customText
|
||||
);
|
||||
hide();
|
||||
$("#customTextPopup textarea").val(customText);
|
||||
}
|
||||
|
||||
$("#wordFilterPopupWrapper").mousedown((e) => {
|
||||
|
|
@ -90,8 +90,9 @@ $("#wordFilterPopupWrapper .button").mousedown((e) => {
|
|||
$("#wordFilterPopupWrapper .loadingIndicator").removeClass("hidden");
|
||||
$("#wordFilterPopupWrapper .button").addClass("hidden");
|
||||
setTimeout(() => {
|
||||
apply();
|
||||
$("#wordFilterPopupWrapper .loadingIndicator").addClass("hidden");
|
||||
$("#wordFilterPopupWrapper .button").removeClass("hidden");
|
||||
apply($(e.target).is("#set")).then(() => {
|
||||
$("#wordFilterPopupWrapper .loadingIndicator").addClass("hidden");
|
||||
$("#wordFilterPopupWrapper .button").removeClass("hidden");
|
||||
});
|
||||
}, 1);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -202,10 +202,15 @@
|
|||
Use the above filters to include and exclude words or characters
|
||||
(separated by spaces)
|
||||
</div>
|
||||
<div class="tip">
|
||||
"Set" replaces the current custom word list with the filter result, "Add"
|
||||
appends the filter result to the current custom word list
|
||||
</div>
|
||||
<i
|
||||
class="fas fa-fw fa-spin fa-circle-notch hidden loadingIndicator"
|
||||
></i>
|
||||
<div class="button">ok</div>
|
||||
<div class="button" id="set">set</div>
|
||||
<div class="button">add</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="customWordAmountPopupWrapper" class="hidden">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue