Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

link opens in new tab

  • Loading branch information...
commit e8c9f39058a71d989e5f69296c9b4a1c773062ff 1 parent d6e8930
Sukhada Kulkarni authored March 16, 2013
94  jquery.cookie.js
... ...
@@ -0,0 +1,94 @@
10  reddit.js
@@ -152,7 +152,7 @@ function frontPage(result) {
152 152
       var img = result.data.children[i].data.title;
153 153
       if (!result.data.children[i].data.over_18) {
154 154
         $("#posts").append("<li><span class='upvotes'>" +result.data.children[i].data.ups+  "<span class='labelupvotes'>upvotes</span></span><a class='mainlink' href='" + 
155  
-          result.data.children[i].data.url +"'><span class='title'>" + img + "</span></a><span class='author'>Submitted by <span class='color'>" 
  155
+          result.data.children[i].data.url +"' target='_blank'><span class='title'>" + img + "</span></a><span class='author'>Submitted by <span class='color'>" 
156 156
           + result.data.children[i].data.author+ "</span></span> to <span class='subreddit'>" + result.data.children[i].data.subreddit+ 
157 157
           " </span><span class='comments'><a href='http://www.reddit.com"+ result.data.children[i].data.permalink +"'>"+ 
158 158
           result.data.children[i].data.num_comments + " comments</a></span></li>");
@@ -269,7 +269,7 @@ window.onload = function() {
269 269
   	}
270 270
 } 
271 271
 
272  
-if ($(window).width > 704) {
  272
+if ($(window).width() > 704) {
273 273
   $("#open").on('mouseenter', function() {
274 274
     clearTimeout(r);  
275 275
     $(".modal").removeClass("hide");
@@ -293,8 +293,6 @@ else {
293 293
   $("#open").on('click', function() {
294 294
     $(".modal").toggleClass("hide");
295 295
   });
296  
-
297  
-
298 296
 }
299 297
 
300 298
 $(".close").click(function() {
@@ -380,8 +378,10 @@ $("#refresh").click(function() {
380 378
 	window.location.reload();
381 379
 });
382 380
 
383  
-$("#loadmore").click(function () {
  381
+$("#loadmore").click(function (e) {
384 382
 	loadPosts();
  383
+  e.preventDefault();  
  384
+  return false;  
385 385
 });
386 386
 
387 387
 
7  scrollsaver.min.js
... ...
@@ -0,0 +1,7 @@
  1
+// scrollsaver.js
  2
+// Copyright (C) 2009 M. Mahdi Hasheminezhad (hasheminezhad at gmail dot com)
  3
+// Maintain scroll position of every element on postbacks and partial updates
  4
+// This source is licensed under Common Public License Version 1.0 (CPL) 
  5
+// History:
  6
+// 2009-08-21 First Public Release M. Mahdi Hasheminezhad (http://hasheminezhad.com)
  7
+(function(){function ls(){var c=document.cookie.split(';');for(var i=0;i<c.length;i++){var p=c[i].split('=');if(p[0]=='scrollPosition'){p=unescape(p[1]).split('/');for(var j=0;j<p.length;j++){var e=p[j].split(',');try{if(e[0]=='window'){window.scrollTo(e[1],e[2]);}else if(e[0]){var o=document.getElementById(e[0]);o.scrollLeft=e[1];o.scrollTop=e[2];}}catch(ex){}}return;}}}function ss(){var s='scrollPosition=';var l,t;if(window.pageXOffset!==undefined){l=window.pageXOffset;t=window.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollLeft!==undefined){l=document.documentElement.scrollLeft;t=document.documentElement.scrollTop;}else{l=document.body.scrollLeft;t=document.body.scrollTop;}if(l||t){s+='window,'+l+','+t+'/';}var es=(document.all)?document.all:document.getElementsByTagName('*');for(var i=0;i<es.length;i++){var e=es[i];if(e.id&&(e.scrollLeft||e.scrollTop)){s+=e.id+','+e.scrollLeft+','+e.scrollTop+'/';}}document.cookie=s+';';}var a,p;if(window.attachEvent){a=window.attachEvent;p='on';}else{a=window.addEventListener;p='';}a(p+'load',function(){ls();if(typeof Sys!='undefined'&&typeof Sys.WebForms!='undefined'){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ls);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(ss);}},false);a(p+'unload',ss,false);})();

0 notes on commit e8c9f39

Please sign in to comment.
Something went wrong with that request. Please try again.