Commit c7172efef59c5be2ecc23a9d9312498a24b71f1a
1 parent
9eb4e8bf
Exists in
master
Movemos a div com id 'barra-brasil' para o in?cio do elemento body, visando maio…
…r compatibilidade com CMSs que dificultam o acesso ao primeiro n?vel do elemento body
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
assets/barra-brasil.coffee
| 1 | divBarra = document.getElementById("barra-brasil") | 1 | divBarra = document.getElementById("barra-brasil") |
| 2 | + divBarra.parentNode.removeChild(divBarra) | ||
| 2 | head = document.getElementsByTagName("head")[0] | 3 | head = document.getElementsByTagName("head")[0] |
| 4 | + body = document.getElementsByTagName("body")[0] | ||
| 5 | + | ||
| 3 | link = document.createElement("link") | 6 | link = document.createElement("link") |
| 4 | href = document.createAttribute("href") | 7 | href = document.createAttribute("href") |
| 8 | + | ||
| 9 | + novaDiv = document.createElement("div") | ||
| 10 | + idNovaDiv = document.createAttribute("id") | ||
| 11 | + idNovaDiv.nodeValue = "barra-brasil" | ||
| 12 | + novaDiv.setAttributeNode idNovaDiv | ||
| 13 | + novaDiv.innerHTML = conteudoBarra | ||
| 14 | + body.insertBefore(novaDiv, body.childNodes[0]) | ||
| 5 | 15 | ||
| 6 | # src.nodeValue = "http://barra.brasil.gov.br/estilo-barra.css"; | 16 | # src.nodeValue = "http://barra.brasil.gov.br/estilo-barra.css"; |
| 7 | # href.nodeValue = "http://189.9.137.173/estilo-barra.css"; | 17 | # href.nodeValue = "http://189.9.137.173/estilo-barra.css"; |
| @@ -19,4 +29,3 @@ | @@ -19,4 +29,3 @@ | ||
| 19 | style.appendChild conteudo | 29 | style.appendChild conteudo |
| 20 | head.appendChild style | 30 | head.appendChild style |
| 21 | 31 | ||
| 22 | - divBarra.innerHTML = conteudoBarra |