Last active
August 3, 2020 21:51
-
-
Save GabrielMMelo/1513a13a329e980c03a2bb8952fed571 to your computer and use it in GitHub Desktop.
Copy "ementa" from JusBrasil
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
[].slice.call(document.getElementsByClassName("clipboardBoxTemp")).map(element => element.remove()) | |
document.getElementsByClassName("btn btn--blue")[0].click(); | |
let div = document.createElement('div') | |
let h3 = document.createElement('h3') | |
let ta = document.createElement('textarea'); | |
div.style.textAlign = "center" | |
div.style.marginBottom = "30px" | |
div.classList.add("clipboardBoxTemp") | |
h3.textContent = "Ementa copiável ↓" | |
h3.style.marginBottom = '10px' | |
ta.value =[].slice.call(document.getElementsByClassName("FactsForReferenceModalComponent-body unprintable")[0].children).map(p => p.textContent + "\n").join(''); | |
ta.style.width = '1000px' | |
ta.style.height = '300px' | |
ta.style.padding = '10px' | |
div.appendChild(h3); | |
div.appendChild(ta); | |
document.body.appendChild(div); | |
ta.select(); | |
document.execCommand('copy'); | |
alert("Ementa copiada com sucesso!\n\n(Se estiver utilizando Internet Explorer ou Edge, copie manualmente o texto gerado ao final da página)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment