Commit 6ee8e90d3aa7cb75bb909c4f12166f364f42f6ee
1 parent
1e64439f
Exists in
master
organizando a chamada ao script de estat?stica do Serpro
Showing
3 changed files
with
11 additions
and
9 deletions
Show diff stats
assets/barra-brasil.coffee
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | idNovaDiv = document.createAttribute("id") | 10 | idNovaDiv = document.createAttribute("id") |
11 | idNovaDiv.nodeValue = "barra-brasil" | 11 | idNovaDiv.nodeValue = "barra-brasil" |
12 | novaDiv.setAttributeNode idNovaDiv | 12 | novaDiv.setAttributeNode idNovaDiv |
13 | + # conteudoBarra definido no barra-brasil-1.yaml e atribuido pelo assetgen | ||
13 | novaDiv.innerHTML = conteudoBarra | 14 | novaDiv.innerHTML = conteudoBarra |
14 | body.insertBefore(novaDiv, body.childNodes[0]) | 15 | body.insertBefore(novaDiv, body.childNodes[0]) |
15 | 16 | ||
@@ -29,12 +30,3 @@ | @@ -29,12 +30,3 @@ | ||
29 | style.appendChild conteudo | 30 | style.appendChild conteudo |
30 | head.appendChild style | 31 | head.appendChild style |
31 | 32 | ||
32 | - #Inserindo tag javascript do Serpro Analytics | ||
33 | - novoScript = document.createElement("script") | ||
34 | - tipo = document.createAttribute("type") | ||
35 | - tipo.nodeValue = "text/javascript" | ||
36 | - src = document.createAttribute("src") | ||
37 | - src.nodeValue = "http://coletajavascript.serpro.gov.br/estatistica.js" | ||
38 | - novoScript.setAttributeNode tipo | ||
39 | - novoScript.setAttributeNode src | ||
40 | - head.appendChild novoScript |
@@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
1 | + head = document.getElementsByTagName("head")[0] | ||
2 | + novoScript = document.createElement("script") | ||
3 | + tipo = document.createAttribute("type") | ||
4 | + tipo.nodeValue = "text/javascript" | ||
5 | + src = document.createAttribute("src") | ||
6 | + src.nodeValue = "http://coletajavascript.serpro.gov.br/estatistica.js" | ||
7 | + novoScript.setAttributeNode tipo | ||
8 | + novoScript.setAttributeNode src | ||
9 | + head.appendChild novoScript |
barra-brasil-1.yaml
@@ -8,6 +8,7 @@ generate: | @@ -8,6 +8,7 @@ generate: | ||
8 | source: | 8 | source: |
9 | - assets/conteudo-barra.html | 9 | - assets/conteudo-barra.html |
10 | - assets/barra-brasil.coffee | 10 | - assets/barra-brasil.coffee |
11 | + - assets/estatisticas.coffee | ||
11 | - raw: "})();" # fechamento do escopo da funcao anonima (ver template abaixo) | 12 | - raw: "})();" # fechamento do escopo da funcao anonima (ver template abaixo) |
12 | template: | | 13 | template: | |
13 | (function(){ | 14 | (function(){ |