// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
    // The variable "tumblr_api_read" is now set.
    // console.debug(tumblr_api_read);
    function printTumblr(x) {
      $('#blog_previews').append("<div style='text-align:right;margin-bottom:10px;color:#7786A2;'>Posted on " + tumblr_api_read.posts[x].date + "</div>");
      if (tumblr_api_read.posts[x].type == "regular") {
        $('#blog_previews').append("<h1>"+ tumblr_api_read.posts[x]["regular-title"] + "</h1>" + tumblr_api_read.posts[x]["regular-body"]);
      } else if  (tumblr_api_read.posts[x].type == "video") {
        $('#blog_previews').append(tumblr_api_read.posts[x]["video-player"] + "<br>" + tumblr_api_read.posts[x]["video-caption"] + "<br>" );
      } else if  (tumblr_api_read.posts[x].type == "link") {
        $('#blog_previews').append("<h1><a href='" + tumblr_api_read.posts[x]["link-url"] + "'>" + tumblr_api_read.posts[x]["link-text"] + "</a></h1>" + tumblr_api_read.posts[x]["link-description"]);
    
    
      } else {
        var image1 = $('<img />').attr('src', tumblr_api_read.posts[x]["photo-url-400"]);
        $('#blog_previews').append(image1);
        $('#blog_previews').append(tumblr_api_read.posts[x]["photo-caption"])
      };
      $('#blog_previews').append("<a href=" + tumblr_api_read.posts[x]["url-with-slug"] + ">Comments</a><br><br>");
    }
