Created
June 28, 2017 01:54
-
-
Save kyoh86/a79519fe00e3e45e879db2c1825b38fa to your computer and use it in GitHub Desktop.
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
| (() => { | |
| const escapeAttribute = "data-datetime-default-value"; | |
| const phenotypeAttribute = "title"; | |
| const interval = 2000; | |
| const format = item => { | |
| return item.getAttribute(escapeAttribute) + | |
| " (" + item.getAttribute(phenotypeAttribute) + ")" | |
| }; | |
| const process = () => { | |
| document.querySelectorAll("*[datetime][" + phenotypeAttribute + "]").forEach(item => { | |
| if (!item.hasAttribute(escapeAttribute) || | |
| ( | |
| item.getAttribute(escapeAttribute) != item.innerHTML && | |
| format(item) != item.innerHTML | |
| ) | |
| ) { | |
| item.setAttribute(escapeAttribute, item.innerHTML); | |
| } | |
| item.innerHTML = format(item); | |
| }); | |
| document.querySelectorAll("table.files td.age").forEach(item => { | |
| item.style.width = "auto"; | |
| }); | |
| window.setTimeout(process, interval); | |
| }; | |
| process(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment