$(function () {

  // Setup
  Portada.visiblePosts = 10;
  Portada.feeds = [];

  jQuery.timeago.settings.strings = {
     prefixAgo: "Hace",
     prefixFromNow: "Dentro de",
     suffixAgo: "",
     suffixFromNow: "",
     seconds: "Menos de un minuto",
     minute: "un minuto",
     minutes: "unos %d minutos",
     hour: "una hora",
     hours: "%d horas",
     day: "un día",
     days: "%d días",
     month: "un mes",
     months: "%d meses",
     year: "un año",
     years: "%d años"
  };

  if ($('body').hasClass('page-settings')) {
    if (undefined == store.get('sources')) {
      console.log('im undefined', store, store.get('sources'));
      var sources = [];
      $('.chk-medium').each(function(){
        sources.push($(this).data('medium-id'));
      });
      store.set('sources', sources);
    };
  }

  if ($('body').hasClass('page-settings')) {
    Portada.loadSettings();
  }

  $('.js-load-more').on('click', function () {
    Portada.visiblePosts = Portada.visiblePosts + 10;
    $('.news-item:lt(' + Portada.visiblePosts + ')').fadeIn();

    if (Portada.visiblePosts >= 100) {
      $(this).text('Eso es todo. Salí a jugar :)');
    }
  });

  if ($('body').hasClass('page-home')) {
    $.ajax({
      url: '/feed',
      type: 'get',
      data: {
        sources: store.get('sources')
      },
      success: function (data) {
        Portada.feeds = data;
        var template = $('#template').html();
        Mustache.parse(template);
        var rendered = Mustache.render(template, data);
        $('.news-list').html(rendered);
        $('.js-load-more').addClass('show');
        if (store.get('openLinksInNewWindow')) {
          $('.js-news-item-link').attr('target', '_blank');
        }
        if (store.get('openLinksInReadability')) {
          $('.js-news-item-link').each(function(){
            $(this).attr('href', $(this).data('readability'));
          });
        }

        // init human-friendly dates
        $(".timeago").timeago();

      }
    });
  }

  if ($('body').hasClass('page-feed')) {
    $.ajax({
      url: '/feed',
      type: 'get',
      data: {
        sources: [$('body').data('feed')]
      },
      success: function (data) {
        Portada.feeds = data;
        var template = $('#template').html();
        Mustache.parse(template);
        var rendered = Mustache.render(template, data);
        $('.news-list').html(rendered);
        $('.js-load-more').addClass('show');
        if (store.get('openLinksInNewWindow')) {
          $('.js-news-item-link').attr('target', '_blank');
        }
        if (store.get('openLinksInReadability')) {
          $('.js-news-item-link').each(function(){
            $(this).attr('href', $(this).data('readability'));
          });
        }
        // init human-friendly dates
        $(".timeago").timeago();
      }
    });
  }

  // Settings
  $('input[type="checkbox"]').change(function() {
    var $this = $(this);
    $('.notification').removeClass('notification--show');

    Portada.saveSettings();

    // Trigger notification
    Portada.saveTimer = setTimeout ( function(){
      $('.notification').removeClass('notification--show').addClass('notification--show');
    }, 400 );

  });


}); // End Ready

Portada.loadSettings = function(){
  for (var i = store.get('sources').length - 1; i >= 0; i--) {
    $('#chk-medium-' + store.get('sources')[i]).prop('checked', true);
    $('.js-chk-open-new-window').attr('checked', true);
  };

  if (store.get('openLinksInNewWindow') == true) {
    $('.js-chk-open-new-window').attr('checked', true);
  }
  else{
    $('.js-chk-open-new-window').prop('checked', false); 
    store.set('openLinksInNewWindow', false);
  }

  if (store.get('openLinksInReadability') == true) {
    $('.js-chk-open-readability').prop('checked', true);
    store.set('openLinksInReadability', true);
  }
  else{
    $('.js-chk-open-readability').prop('checked', false); 
    store.set('openLinksInReadability', false);
  }

};

Portada.saveSettings = function(){

  // Save Sources
  var sources = [];

  $('.chk-medium').each(function(index, val) {
     if ($(this).prop('checked')) {
      sources.push($(this).data('medium-id'));
     }
  });

  store.set('sources', sources);

  // Save Target=Blank
  store.set('openLinksInNewWindow', $('.js-chk-open-new-window').prop('checked'));

  // Save Readability
  store.set('openLinksInReadability', $('.js-chk-open-readability').prop('checked'));

};



@@ -73,16 +73,55 @@
  = %5B%5D;%0A%0A
+  if (undefined != jQuery.timeago) %7B%0A  
   jQuery
@@ -151,24 +151,26 @@
 gs = %7B%0A     
+  
 prefixAgo: %22
@@ -172,24 +172,26 @@
 go: %22Hace%22,%0A
+  
      prefixF
@@ -212,24 +212,26 @@
 o de%22,%0A     
+  
 suffixAgo: %22
@@ -229,24 +229,26 @@
 fixAgo: %22%22,%0A
+  
      suffixF
@@ -264,16 +264,18 @@
 %22,%0A     
+ 
+ 
 seconds:
@@ -298,24 +298,26 @@
 nuto%22,%0A     
+  
 minute: %22un 
@@ -321,24 +321,26 @@
 un minuto%22,%0A
+  
      minutes
@@ -361,24 +361,26 @@
 utos%22,%0A     
+  
 hour: %22una h
@@ -381,24 +381,26 @@
 %22una hora%22,%0A
+  
      hours: 
@@ -416,16 +416,18 @@
 %22,%0A     
+  
 day: %22un
@@ -429,24 +429,26 @@
 : %22un d%C3%ADa%22,%0A
+  
      days: %22
@@ -458,24 +458,26 @@
 d%C3%ADas%22,%0A     
+ 
+ 
 month: %22un m
@@ -477,24 +477,26 @@
 : %22un mes%22,%0A
+  
      months:
@@ -509,24 +509,26 @@
 eses%22,%0A     
+ 
+ 
 year: %22un a%C3%B1
@@ -527,24 +527,26 @@
 : %22un a%C3%B1o%22,%0A
+  
      years: 
@@ -555,20 +555,26 @@
 d a%C3%B1os%22%0A
+  
   %7D;
+%0A  %7D
 %0A%0A  if (

Fix en javascript en opciones