text: /* Facebook gallery via https://gist.github.com/alexdunae/1239554 */
  
  (function(){
    var title = $('#facebook-title'),
    link = $('#facebook-link'),
    viewer = $('#facebook-viewer'),
    thumbs = $('#facebook-thumbs'),
    gallery_id = thumbs.attr('data-album');
    
    if(thumbs.length > 0){
      // album info
      $.getJSON('//graph.facebook.com/' + gallery_id + '?callback=?', function(json) {
        title.html('<a href="' + json.link + '" title="View album on Facebook" target="_blank">' + json.name + '</a>');
        link.html('<i class="fa fa-fw fa-facebook-square text-muted"></i> <a href="' + json.link + '" title="View album on Facebook" target="_blank">View album on Facebook</a>');
      });
  
      // images
      $.getJSON('//graph.facebook.com/' + gallery_id + '/photos?callback=?', function(json) {
        var imgs = json.data;
  
        viewer.attr('src', imgs[0].images[0].source);
  
        for (var i = 0, l = imgs.length - 1; i < l; i++) {
          $('<div class="col-sm-3"><img class="thumbnail" src="' + imgs[i].images[2].source + '" data-fullsize="' + imgs[i].images[0].source + '"></div>').appendTo(thumbs);
        }
  
        $('img', thumbs).bind('click', function(e) {
          e.preventDefault();
          viewer.attr('src', $(this).attr('data-fullsize'));
        });
      });
    }
  }());