Skip to content

Instantly share code, notes, and snippets.

@collegeman
Created May 10, 2010 11:51
Show Gist options
  • Save collegeman/395964 to your computer and use it in GitHub Desktop.
Save collegeman/395964 to your computer and use it in GitHub Desktop.
smoke-alarm-expiration.es.js
(function(){var protocol=(location.protocol=='https:'?'https':'http');document.write('<div class="notifieres" style="background-color: #069; background-image: url(http://www.usfa.dhs.gov/_images/campaigns/smokealarms/widget_es.jpg); background-repeat: no-repeat; -moz-border-radius: 8px; -webkit-border-radius: 8px; box-shadow: 0px 0px 8px #666; -webkit-box-shadow: 0px 0px 8px #666; -moz-box-shadow: 0px 0px 8px #666; color: #fff; font-family: \'Trebuchet MS\', Arial, Helvetica, sans-serif; margin: 10px 0; text-align: center; width: 310px">'+'<h2 style="color: #b7d3e1; font-size: 20px; margin: 0; padding: 170px 0 0 0;"">ES UN HECHO:</h2>'+'<p style="color: #fff; font-size: 14px; margin: 0 auto; padding-bottom: 95px; width: 280px;">Si su alarma de humo se instaló hace <span id="usfa-smokealarms-notifier-date-to-replace-es"><strong>más de 10 años</strong></span>, que necesita ser <em>reemplazado</em>.</p>'+'</div>'+'<a href="'+protocol+'://www.usfa.dhs.gov/notices/ads.shtm" style="font-family: Tahoma, Geneva, sans-serif; font-size: 11px; padding: 1em">Share this widget</a>');var now=new Date();var jan=new Date(now.getFullYear(),0,1,0,0,0,0);var date=now.getTime()-jan.getTime();var d=new Date(now.getFullYear()-10,0,1,0,0,0,date);var mon=['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'][d.getMonth()];var day=d.getDate();var year=d.getFullYear();var formatted=day+' de '+mon+' '+year;var url='http://www.google.com/products?q=smoke+detector&hl=en&aq=f';var e=document.getElementById('usfa-smokealarms-notifier-date-to-replace-es');e.innerHTML='before <span class="the_date"><strong>'+formatted+'</strong></span>';})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment