Added select2

This commit is contained in:
BuildTools 2021-03-26 01:35:26 +00:00
parent ba173e631a
commit 76b0ff53e8
2 changed files with 7 additions and 1 deletions

View file

@ -1,4 +1,6 @@
import { setCustomThemeColors } from "./config";
import * as Misc from "./misc";
import * as ThemeColors from "./theme-colors";
//import * as config from "./userconfig";
export async function showWordFilterPopup(){
@ -13,6 +15,9 @@ export async function showWordFilterPopup(){
<option value=${language}>${prettyLang}</option>
`)
})
$("#languageList").select2({
minimumResultsForSearch: -1,
});
}
function hideWordFilterPopup(){
@ -70,7 +75,6 @@ async function filter(language){
let test2 = regexcl.test(word);
if((test1 && !test2 || test1 && filterout == "") && word.length <= maxLength && word.length >= minLength){
filteredWords.push(word);
console.log(test1, test2, word, filterout, filterin, regexcl);
}
}
return filteredWords;

View file

@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Monkeytype</title>
<!-- <link rel="stylesheet" href="css/fa.css" /> -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/balloon.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="themes/serika_dark.css" id="currentTheme" />
@ -3776,5 +3777,6 @@
<script src="js/jquery.cookie-1.4.1.min.js"></script>
<script src="js/moment.min.js"></script>
<script src="js/html2canvas.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script src="js/monkeytype.js"></script>
</html>