Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7acdd74129 | |||
| cdd3167728 | |||
| 802fa79eec | |||
| 9cc991c286 | |||
| d5e32b4829 | |||
| a0483cb07e | |||
| dcc9265adb | |||
| 34780a741a | |||
| 49a3d4d493 | |||
| f3534eb17e | |||
| eb0236195d | |||
| 4dc432c2f5 | |||
| edd7268b7b | |||
| facd974814 | |||
| 4de91e933f | |||
| 12fb7f4962 | |||
| 311178d16d | |||
| 4b4990b123 | |||
| a5b62f30a2 | |||
| bb0f44d4c7 | |||
| 3746131d1f | |||
| 3f6daf97eb | |||
| a4ac19e516 | |||
| fbaff3bdf3 | |||
| b52b15accf | |||
| 51f3418bcf | |||
| 1b56a8ba12 | |||
| aa98770385 | |||
| 73b1a3b24f | |||
| c2e40b812a | |||
| 07d01839d1 | |||
| ce50b1cecd | |||
| eeca874d35 | |||
| 230b364206 | |||
| b44a986e4d | |||
| a17b9290be | |||
| 22db8f4575 | |||
| 358d7659b8 | |||
| 08cf3333a8 | |||
| 8e0b2d874c | |||
| 3958a610f9 | |||
| cf7a722429 | |||
| d891afbdf4 | |||
| e963a3e179 | |||
| 0f8af9b014 | |||
| 64f55efca8 | |||
| 43ff4dff97 | |||
| 5ef6a9c5a7 | |||
| b0b5da9447 | |||
| e05e78c71d | |||
| cadb4b5fbd | |||
| 76e46bd9b6 | |||
| e169396914 | |||
| 15923516c7 | |||
| 6c45d14d21 | |||
| f76a2f2ecd | |||
| b6e1141d93 | |||
| f83a2adf06 | |||
| 06e1d9d14f | |||
| 10a8c9bcb2 |
53
questionary.js
Normal file
53
questionary.js
Normal file
@ -0,0 +1,53 @@
|
||||
// ==UserScript==
|
||||
// @name Runcity Questionary
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 2024-11-18
|
||||
// @description Add red border for empty inputs
|
||||
// @author You
|
||||
// @match https://www.runcity.org/ru/events/*/online/
|
||||
// @icon https://www.google.com/s2/favicons?sz=64&domain=runcity.org
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
/* COPY FROM MAIN */
|
||||
|
||||
function addStylesToHead(styles) {
|
||||
let styleSheet = document.createElement("style")
|
||||
styleSheet.textContent = styles
|
||||
document.head.append(styleSheet)
|
||||
}
|
||||
|
||||
/* END COPY FROM MAIN */
|
||||
|
||||
function addClassIfEmptyInput(input) {
|
||||
if (input.value.trim() == "") {
|
||||
input.classList.add("empty-input")
|
||||
}
|
||||
else {
|
||||
input.classList.remove("empty-input")
|
||||
}
|
||||
}
|
||||
|
||||
function addEmptyInputCheck() {
|
||||
let inputs = [...document.querySelectorAll(`input.cp_team_answer`)]
|
||||
|
||||
for (const input of inputs) {
|
||||
addClassIfEmptyInput(input)
|
||||
|
||||
input.addEventListener("input", e => {
|
||||
addClassIfEmptyInput(input)
|
||||
})
|
||||
}
|
||||
|
||||
addStylesToHead(`
|
||||
.empty-input {
|
||||
border-color: red !important;
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
||||
addEmptyInputCheck()
|
||||
})();
|
||||
Loading…
Reference in New Issue
Block a user