Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

link opens in new tab

  • Loading branch information...
commit 22985ba505eedb78bdf2b124a0c4a54ad5bcea33 1 parent a8ff43f
@sukhada authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 reddit.js
View
7 reddit.js
@@ -108,7 +108,7 @@ function loadPosts() {
if (result.data.children[i] != undefined) {
var img = result.data.children[i].data.title;
if (!result.data.children[i].data.over_18) {
- $("#posts").append("<li><span class='upvotes'>" +result.data.children[i].data.ups+ "<span class='labelupvotes'>upvotes</span></span><a class='mainlink' href='" + result.data.children[i].data.url +"' target='_blank'><span class='title'>" + img + "</span></a><span class='author'>Submitted by <span class='color'>"
+ $("#posts").append("<li><span class='upvotes'>" +result.data.children[i].data.ups+ "<span class='labelupvotes'>upvotes</span></span><a class='mainlink' href='" + result.data.children[i].data.url +"' target='_tab'><span class='title'>" + img + "</span></a><span class='author'>Submitted by <span class='color'>"
+ result.data.children[i].data.author+ "</span></span> to <span class='subreddit'>" + result.data.children[i].data.subreddit+
" </span><span class='comments'><a href='http://www.reddit.com"+ result.data.children[i].data.permalink +"'>"+
result.data.children[i].data.num_comments + " comments</a></span></li>");
@@ -151,7 +151,7 @@ function frontPage(result) {
var img = result.data.children[i].data.title;
if (!result.data.children[i].data.over_18) {
$("#posts").append("<li><span class='upvotes'>" +result.data.children[i].data.ups+ "<span class='labelupvotes'>upvotes</span></span><a class='mainlink' href='" +
- result.data.children[i].data.url +"' target='_blank'><span class='title'>" + img + "</span></a><span class='author'>Submitted by <span class='color'>"
+ result.data.children[i].data.url +"' target='_tab'><span class='title'>" + img + "</span></a><span class='author'>Submitted by <span class='color'>"
+ result.data.children[i].data.author+ "</span></span> to <span class='subreddit'>" + result.data.children[i].data.subreddit+
" </span><span class='comments'><a href='http://www.reddit.com"+ result.data.children[i].data.permalink +"'>"+
result.data.children[i].data.num_comments + " comments</a></span></li>");
@@ -401,5 +401,4 @@ $("#listofsubreddits").on('click', ".remove", function () {
localStorage.removeItem('posts');
$(this).parent().remove();
window.location.reload();
-});
-
+});
Please sign in to comment.
Something went wrong with that request. Please try again.