barra-brasil.coffee 1.11 KB
divBarra = document.getElementById("barra-brasil")
if divBarra
  divBarra.removeAttribute "style"
  # conteudoBarra definido no barra-brasil-1.yaml e atribuido pelo assetgen
  divBarra.innerHTML = conteudoBarra
  head = document.getElementsByTagName("head")[0]

loadVlibras = ->
  window.VLibras.Widget 'https://vlibras.gov.br/app2', 'https://vlibras.gov.br/config/default_logo.json'

divLibras = document.createElement 'div'
divLibras.innerHTML = '<div vw class=\"enabled\"><div vw-access-button class=\"active\"></div><div vw-plugin-wrapper><div class=\"vw-plugin-top-wrapper\"></div><div class=\"vw-links\"><ul></ul></div></div></div>'
document.body.appendChild divLibras

script = document.createElement 'script'
script.setAttribute 'src', 'https://vlibras.gov.br/app2/vlibras-plugin.js'
script.type = "text/javascript"
script.onload = loadVlibras
document.body.appendChild script

window._barrabrasil =
  insere_css: (css) ->
      style = document.createElement "style"
      style.setAttribute "type","text/css"
      style.setAttribute "media","all"
      style.appendChild document.createTextNode(css)
      head.appendChild style