diff options
Diffstat (limited to 'layouts/partials/after_footer.html')
-rw-r--r-- | layouts/partials/after_footer.html | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/layouts/partials/after_footer.html b/layouts/partials/after_footer.html new file mode 100644 index 0000000..56c292a --- /dev/null +++ b/layouts/partials/after_footer.html @@ -0,0 +1,159 @@ +<script src="{{ .Site.BaseURL }}js/jquery-2.1.0.min.js"></script> +<script type="text/javascript"> +$(document).ready(function(){ + $('.navbar').click(function(){ + $('header nav').toggleClass('shownav'); + }); + var myWidth = 0; + function getSize(){ + if( typeof( window.innerWidth ) == 'number' ) { + myWidth = window.innerWidth; + } else if( document.documentElement && document.documentElement.clientWidth) { + myWidth = document.documentElement.clientWidth; + }; + }; + var m = $('#main'), + a = $('#asidepart'), + c = $('.closeaside'), + o = $('.openaside'); + $(window).resize(function(){ + getSize(); + if (myWidth >= 1024) { + $('header nav').removeClass('shownav'); + }else + { + m.removeClass('moveMain'); + a.css('display', 'block').removeClass('fadeOut'); + o.css('display', 'none'); + } + }); + c.click(function(){ + a.addClass('fadeOut').css('display', 'none'); + o.css('display', 'block').addClass('fadeIn'); + m.addClass('moveMain'); + }); + o.click(function(){ + o.css('display', 'none').removeClass('beforeFadeIn'); + a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn'); + m.removeClass('moveMain'); + }); + $(window).scroll(function(){ + o.css("top",Math.max(80,260-$(this).scrollTop())); + }); +}); +</script> +{{ if eq .Section "post" }} +<script type="text/javascript"> +$(document).ready(function(){ + var ai = $('.article-content>iframe'), + ae = $('.article-content>embed'), + t = $('#toc'), + h = $('article h2') + ah = $('article h2'), + ta = $('#toc.toc-aside'), + o = $('.openaside'), + c = $('.closeaside'); + if(ai.length>0){ + ai.wrap('<div class="video-container" />'); + }; + if(ae.length>0){ + ae.wrap('<div class="video-container" />'); + }; + if(ah.length==0){ + t.css('display','none'); + }else{ + c.click(function(){ + ta.css('display', 'block').addClass('fadeIn'); + }); + o.click(function(){ + ta.css('display', 'none'); + }); + $(window).scroll(function(){ + ta.css("top",Math.max(140,320-$(this).scrollTop())); + }); + }; +}); +</script> +{{ end }} +<script type="text/javascript"> +$(document).ready(function(){ + var $this = $('.share'), + url = $this.attr('data-url'), + encodedUrl = encodeURIComponent(url), + title = $this.attr('data-title'), + tsina = $this.attr('data-tsina'); + var html = [ + '<a href="#" class="overlay" id="qrcode"></a>', + '<div class="qrcode clearfix"><span>扫描二维码分享到微信朋友圈</span><a class="qrclose" href="#share"></a><strong>Loading...Please wait</strong><img id="qrcode-pic" data-src="http://s.jiathis.com/qrcode.php?url=' + encodedUrl + '"/></div>', + '<a href="#textlogo" class="article-back-to-top" title="Top"></a>', + '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>', + '<a href="#qrcode" class="article-share-qrcode" title="QRcode"></a>', + '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>', + '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="Weibo"></a>', + '<span title="Share to"></span>' + ].join(''); + $this.append(html); + $('.article-share-qrcode').click(function(){ + var imgSrc = $('#qrcode-pic').attr('data-src'); + $('#qrcode-pic').attr('src', imgSrc); + $('#qrcode-pic').load(function(){ + $('.qrcode strong').text(' '); + }); + }); +}); +</script> +{{ if .Site.Params.DuoShuo }} +<script type="text/javascript"> + var duoshuoQuery = {short_name:"{{ .Site.Params.DuoShuo }}"}; + (function() { + var ds = document.createElement('script'); + ds.type = 'text/javascript';ds.async = true; + ds.src = '//static.duoshuo.com/embed.js'; + ds.charset = 'UTF-8'; + (document.getElementsByTagName('head')[0] + || document.getElementsByTagName('body')[0]).appendChild(ds); + })(); +</script> +{{ end }} +{{ if or (eq .Section "tag") (eq .Section "category") }} +<script type="text/javascript"> +$(document).ready(function(){ + var list = $('.archive-title a'), + box = $('.all-list-box'), + first = $('.archive-title a:first-of-type'); + box.load(first.attr('data-src').toString()+' #archive-page'); + first.addClass('current'); + list.each(function(){ + $(this).click(function(){ + var listSrc=$(this).attr('data-src').toString()+' #archive-page'; + box.load(listSrc); + list.removeClass('current'); + $(this).addClass('current'); + }); + }); + }); +</script> +{{ end }} +{{ if and (eq .Section "post") (.Site.Params.FancyBox) }} +<link rel="stylesheet" href="{{ .Site.BaseURL }}fancybox/jquery.fancybox.css" media="screen" type="text/css"> +<script src="{{ .Site.BaseURL }}fancybox/jquery.fancybox.pack.js"></script> +<script type="text/javascript"> +$(document).ready(function(){ + $('.article-content').each(function(i){ + $(this).find('img').each(function(){ + if ($(this).parent().hasClass('fancybox')) return; + var alt = this.alt; + if (alt) $(this).after('<span class="caption">' + alt + '</span>'); + $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>'); + }); + $(this).find('.fancybox').each(function(){ + $(this).attr('rel', 'article' + i); + }); + }); + if($.fancybox){ + $('.fancybox').fancybox(); + } +}); +</script> +{{ end }} +{{ partial "google_analytics.html" . }} |