Last active
September 8, 2026 15:39
-
-
Save Pysis868/0609288fc480846aba80668803e09c73 to your computer and use it in GitHub Desktop.
WoW Elysium Project Vote Buttons mark time when last pressed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name WoW Elysium Project Vote Buttons mark time when last pressed. | |
| // @updateURL https://gist.githubusercontent.com/Pysis868/0609288fc480846aba80668803e09c73/raw/082df0e0b60345d8fb045582d5748590548c9e1d/elyVoteTime.js | |
| // @match https://cp.elysium-project.org/vote | |
| // @version 1.0 | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js | |
| // @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
| // ==/UserScript== | |
| // https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js | |
| // Derived: https://gist.github.com/oneross/7c247c3aa7933df36d5e2b2591dfd19f | |
| // Derived, or not main?: https://gist.githubusercontent.com/negonix/cf6734c6eabc93172564c416a651d0e8/raw/5f4acaad8763b014730ffb4c0d840640bb133830/waitForKeyElements.js | |
| // Reference: https://stackoverflow.com/questions/19238791/how-to-use-waitforkeyelements-to-display-information-after-select-images | |
| /* global waitForKeyElements */ | |
| // https://eslint.org/docs/latest/use/configure/ | |
| // https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects | |
| // https://duckduckgo.com/?q=tampermonkey+disable+eslint | |
| // https://github.com/Tampermonkey/tampermonkey/issues/865 | |
| // https://stackoverflow.com/questions/27732209/turning-off-eslint-rule-for-a-specific-line | |
| (function() { | |
| 'use strict'; | |
| // -- Variables -- | |
| const votingRowSel = '#content-wrapper > .container > .row > .column > .vote > .row'; | |
| const voteBtnsSel = '.col > .item > .item-content > .btn'; | |
| const timeEl = document.createElement('div'); | |
| // -- Main script actions -- | |
| if(localStorage.voteTime) { | |
| timeEl.innerText = new Date(Number.parseInt(localStorage.voteTime)); | |
| } else { | |
| timeEl.innerText = 'No previously recorded last vote date time.'; | |
| } | |
| waitForKeyElements(votingRowSel, function(votingRow) { | |
| const votingRowEl = votingRow[0]; | |
| votingRowEl.parentNode.insertBefore(timeEl, votingRowEl); | |
| const voteBtns = votingRowEl.querySelectorAll(voteBtnsSel); | |
| const voteBtnsArr = Array.from(voteBtns); | |
| voteBtnsArr.forEach(function(voteBtn) { | |
| voteBtn.addEventListener('click', function() { | |
| localStorage.voteTime = new Date().getTime(); | |
| timeEl.innerText = new Date(Number.parseInt(localStorage.voteTime)); | |
| }) | |
| }); | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment