Created
July 31, 2017 09:52
-
-
Save PavelLaptev/dfa0aec1df37b58abf0b44294c1e7fe6 to your computer and use it in GitHub Desktop.
Script allows you clearing print-console while you are coding
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
print.clear = () -> | |
console.clear() | |
try | |
consoleParent = document.getElementById("FramerContextRoot-PrintConsole") | |
consoleChild = consoleParent.children[0].children[1].children | |
arrForRemove = [] | |
for i in [0...consoleChild.length] | |
if consoleChild[i].textContent.indexOf('»') isnt -1 | |
arrForRemove.push(consoleChild[i]) | |
if arrForRemove.length > 0 | |
for i in [0...arrForRemove.length] | |
arrForRemove[i].remove() | |
divMsgClr = document.createElement('div') | |
divMsgClr.style.color = "rgba(0,0,0,0.3)" | |
divMsgClr.style.fontStyle = "italic" | |
divMsgClr.innerHTML = "» Print-console cleared" | |
consoleParent.children[0].children[1].appendChild(divMsgClr) | |
catch e | |
console.log "Print-console already clear" | |
print.clear() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment