Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. var userURL = document.URL;
  4.  
  5. $(window).load(function () {
  6. $content.masonry({
  7. itemSelector: '.posts',
  8. isAnimated: true,
  9. {block:IfNot1Column}
  10. isFitWidth: true
  11. {/block:IfNot1Column}
  12. }),
  13. $content.infinitescroll({
  14. navSelector : '#pagination',
  15. nextSelector : '#pagination a#nextPage',
  16. itemSelector : '.posts',
  17. loading: {
  18. finishedMsg: '',
  19. img: 'https://static.tumblr.com/dbek3sy/pX1lrx8xv/ajax-loader.gif'
  20. },
  21. bufferPx : 200,
  22. debug : false,
  23. },
  24. // call masonry as a callback.
  25. function( newElements ) {
  26. var $newElems = $( newElements );
  27. $newElems.hide();
  28. // ensure that images load before adding to masonry layout
  29. $newElems.imagesLoaded(function(){
  30. $content.masonry( 'appended',
  31. $newElems, true,
  32. function(){$newElems.fadeIn(300);}
  33. );
  34.  
  35.  
  36. });
  37.  
  38. /* repair audio players*/
  39. $('.audio').each(function(){
  40. var audioID = $(this).attr("id");
  41. var $audioPost = $(this);
  42. $.ajax({
  43. url: userURL + 'api/read/json?id=' + audioID,
  44. dataType: 'jsonp',
  45. timeout: 50000,
  46. success: function(data){
  47. $audioPost.html(data.posts[0]["audio-player"]);
  48. $(".audioplayerinto").removeClass("audio");
  49. }
  50. });
  51. });
  52.  
  53. /* repair video players*/
  54. $('.videoPost.done').each(function(){
  55. var videoID = $(this).attr("id");
  56. var $videoPost = $(this);
  57.  
  58. var videoWidth;
  59. {block:IfNot1Column}
  60. videoWidth = "-250";
  61. {/block:IfNot1Column}
  62. {block:If1Column}
  63. videoWidth = "-700";
  64. {/block:If1Column}
  65. {block:If2Columns}
  66. videoWidth = "-500";
  67. {/block:If2Columns}
  68. {block:If3Columns}
  69. videoWidth = "-250";
  70. {/block:If3Columns}
  71. {block:If4Columns}
  72. videoWidth = "-250";
  73. {/block:If4Columns}
  74. {block:If5Columns}
  75. videoWidth = "-250";
  76. {/block:If5Columns}
  77. if($videoPost.find("div#tumblr_video_container_"+videoID).length){
  78. $videoPost.parent().removeClass("done").find(".zoom_icon").remove();
  79. $.ajax({
  80. url: '/api/read/json?id=' + videoID,
  81. dataType: 'jsonp',
  82. timeout: 50000,
  83. success: function(data){
  84. $videoPost.html(data.posts[0]["video-player"+videoWidth]);
  85. $content.masonry();
  86. }
  87. });
  88. }
  89. $videoPost.removeClass("done");
  90. });
  91.  
  92. });
  93. });
  94. </script>
  95. {/block:IndexPage}
  96. {block:IfContainerFadeIn}
  97. <script type="text/javascript">
  98. $(function(){
  99. $("#container").fadeIn(500);
  100. });
  101. </script>
  102. {/block:IfContainerFadeIn}
  103.  
  104. <!-- google plus code -->
  105. <script type="text/javascript">
  106. (function() {
  107. var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
  108. po.src = 'https://apis.google.com/js/plusone.js';
  109. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  110. })();
  111. </script>
  112. <!-- google analytics code -->
  113. {block:IfGoogleAnalyticsID}
  114. <script type="text/javascript">
  115.  
  116. var _gaq = _gaq || [];
  117. _gaq.push(['_setAccount', '{text:Google Analytics ID}']);
  118. _gaq.push(['_trackPageview']);
  119.  
  120. (function() {
  121. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  122. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : '') + '.google-analytics.com/ga.js';
  123. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  124. })();
  125.  
  126. </script>
  127. {/block:IfGoogleAnalyticsID}
  128. <iframe id="likeIframe" src="" style="width:1px;height:1px;position:absolute;left:-9999px;"></iframe>
  129. <script src="http://static.tumblr.com/c7cvhvu/mCZmb3z94/is.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement