mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-10 01:14:27 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
48069975e7
3 changed files with 27 additions and 9 deletions
|
|
@ -2023,14 +2023,15 @@ function updateSuggestedCommands() {
|
|||
|
||||
function displayFoundCommands() {
|
||||
$("#commandLine .suggestions").empty();
|
||||
let commandsHTML = "";
|
||||
let list = currentCommands[currentCommands.length - 1];
|
||||
$.each(list.list, (index, obj) => {
|
||||
if (obj.found && (obj.available !== undefined ? obj.available() : true)) {
|
||||
$("#commandLine .suggestions").append(
|
||||
'<div class="entry" command="' + obj.id + '">' + obj.display + "</div>"
|
||||
);
|
||||
commandsHTML +=
|
||||
'<div class="entry" command="' + obj.id + '">' + obj.display + "</div>";
|
||||
}
|
||||
});
|
||||
$("#commandLine .suggestions").html(commandsHTML);
|
||||
if ($("#commandLine .suggestions .entry").length == 0) {
|
||||
$("#commandLine .separator").css({ height: 0, margin: 0 });
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -726,6 +726,20 @@ function punctuateWord(previousWord, currentWord, index, maxindex) {
|
|||
) {
|
||||
//1% chance to add quotes
|
||||
word = `"${word}"`;
|
||||
} else if (
|
||||
Math.random() < 0.01 &&
|
||||
getLastChar(previousWord) != "," &&
|
||||
getLastChar(previousWord) != "."
|
||||
) {
|
||||
//1% chance to add single quotes
|
||||
word = `'${word}'`;
|
||||
} else if (
|
||||
Math.random() < 0.01 &&
|
||||
getLastChar(previousWord) != "," &&
|
||||
getLastChar(previousWord) != "."
|
||||
) {
|
||||
//1% chance to add parentheses
|
||||
word = `(${word})`;
|
||||
} else if (Math.random() < 0.01) {
|
||||
//1% chance to add a colon
|
||||
word = word + ":";
|
||||
|
|
@ -843,14 +857,15 @@ function addWord() {
|
|||
function showWords() {
|
||||
$("#words").empty();
|
||||
|
||||
let wordsHTML = "";
|
||||
for (let i = 0; i < wordsList.length; i++) {
|
||||
let w = "<div class='word'>";
|
||||
wordsHTML += "<div class='word'>";
|
||||
for (let c = 0; c < wordsList[i].length; c++) {
|
||||
w += "<letter>" + wordsList[i].charAt(c) + "</letter>";
|
||||
wordsHTML += "<letter>" + wordsList[i].charAt(c) + "</letter>";
|
||||
}
|
||||
w += "</div>";
|
||||
$("#words").append(w);
|
||||
wordsHTML += "</div>";
|
||||
}
|
||||
$("#words").html(wordsHTML);
|
||||
|
||||
$("#wordsWrapper").removeClass("hidden");
|
||||
const wordHeight = $(document.querySelector(".word")).outerHeight(true);
|
||||
|
|
@ -3105,6 +3120,7 @@ function toggleResultWordsDisplay() {
|
|||
|
||||
async function loadWordsHistory() {
|
||||
$("#resultWordsHistory .words").empty();
|
||||
let wordsHTML = "";
|
||||
for (let i = 0; i < inputHistory.length + 2; i++) {
|
||||
let input = inputHistory[i];
|
||||
let wordEl = "";
|
||||
|
|
@ -3215,8 +3231,9 @@ async function loadWordsHistory() {
|
|||
wordEl += "</div>";
|
||||
} catch (e) {}
|
||||
}
|
||||
$("#resultWordsHistory .words").append(wordEl);
|
||||
wordsHTML += wordEl;
|
||||
}
|
||||
$("#resultWordsHistory .words").html(wordsHTML);
|
||||
$("#showWordHistoryButton").addClass("loaded");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
"yeni",
|
||||
"önce",
|
||||
"başka",
|
||||
"hâl",
|
||||
"hal",
|
||||
"orta",
|
||||
"su",
|
||||
"girmek",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue