Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var userURL = document.URL;
- $(window).load(function () {
- $content.masonry({
- itemSelector: '.posts',
- isAnimated: true,
- {block:IfNot1Column}
- isFitWidth: true
- {/block:IfNot1Column}
- }),
- $content.infinitescroll({
- navSelector : '#pagination',
- nextSelector : '#pagination a#nextPage',
- itemSelector : '.posts',
- loading: {
- finishedMsg: '',
- img: 'https://static.tumblr.com/dbek3sy/pX1lrx8xv/ajax-loader.gif'
- },
- bufferPx : 200,
- debug : false,
- },
- // call masonry as a callback.
- function( newElements ) {
- var $newElems = $( newElements );
- $newElems.hide();
- // ensure that images load before adding to masonry layout
- $newElems.imagesLoaded(function(){
- $content.masonry( 'appended',
- $newElems, true,
- function(){$newElems.fadeIn(300);}
- );
- });
- /* repair audio players*/
- $('.audio').each(function(){
- var audioID = $(this).attr("id");
- var $audioPost = $(this);
- $.ajax({
- url: userURL + 'api/read/json?id=' + audioID,
- dataType: 'jsonp',
- timeout: 50000,
- success: function(data){
- $audioPost.html(data.posts[0]["audio-player"]);
- $(".audioplayerinto").removeClass("audio");
- }
- });
- });
- /* repair video players*/
- $('.videoPost.done').each(function(){
- var videoID = $(this).attr("id");
- var $videoPost = $(this);
- var videoWidth;
- {block:IfNot1Column}
- videoWidth = "-250";
- {/block:IfNot1Column}
- {block:If1Column}
- videoWidth = "-700";
- {/block:If1Column}
- {block:If2Columns}
- videoWidth = "-500";
- {/block:If2Columns}
- {block:If3Columns}
- videoWidth = "-250";
- {/block:If3Columns}
- {block:If4Columns}
- videoWidth = "-250";
- {/block:If4Columns}
- {block:If5Columns}
- videoWidth = "-250";
- {/block:If5Columns}
- if($videoPost.find("div#tumblr_video_container_"+videoID).length){
- $videoPost.parent().removeClass("done").find(".zoom_icon").remove();
- $.ajax({
- url: '/api/read/json?id=' + videoID,
- dataType: 'jsonp',
- timeout: 50000,
- success: function(data){
- $videoPost.html(data.posts[0]["video-player"+videoWidth]);
- $content.masonry();
- }
- });
- }
- $videoPost.removeClass("done");
- });
- });
- });
- </script>
- {/block:IndexPage}
- {block:IfContainerFadeIn}
- <script type="text/javascript">
- $(function(){
- $("#container").fadeIn(500);
- });
- </script>
- {/block:IfContainerFadeIn}
- <!-- google plus code -->
- <script type="text/javascript">
- (function() {
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
- po.src = 'https://apis.google.com/js/plusone.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
- })();
- </script>
- <!-- google analytics code -->
- {block:IfGoogleAnalyticsID}
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '{text:Google Analytics ID}']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : '') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- {/block:IfGoogleAnalyticsID}
- <iframe id="likeIframe" src="" style="width:1px;height:1px;position:absolute;left:-9999px;"></iframe>
- <script src="http://static.tumblr.com/c7cvhvu/mCZmb3z94/is.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement