rolandjesse.de/_includes/js.html
2015-10-05 20:25:17 +05:30

143 lines
4.3 KiB
HTML
Executable file

<!-- Javascript Start -->
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="/js/grayscale.js"></script>
{% if site.google-tracking-id %}
<!-- Google Tracking Id Start -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google-tracking-id }}', 'auto');
ga('send', 'pageview');
</script>
<!-- Google Tracking Id End -->
{% endif %}
{% if site.disqus-shortname %}
<!-- Disqus -->
{% if page.section-type == "post" %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus-shortname }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
{% endif %}
{% if page.section-type == "post" or page.section-type == "blog" or page.section-type == "index" or page.section-type == "tag" %}
<!-- Comments counter Start -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{ site.disqus-shortname }}'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<!-- Comments counter End -->
{% endif %}
{% endif %}
{% if page.section-type == "post" %}
<!-- Share buttons Start -->
{% if site.twitter-share %}
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
{% endif %}
{% if site.fb-share %}
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{% endif %}
<!-- Share buttons End -->
{% endif %}
<!-- Dynamic Typing Start -->
{% if site.dynamic-typing %}
<script type="text/javascript" src="/js/typed.js"></script>
<script type="text/javascript">
var myQuotes = new Array();
{% for line in site.lines %}
myQuotes.push("{{ line.text }}");
{% endfor %}
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex ;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
{% if site.shuffle %}
shuffle(myQuotes)
{% endif %}
$(".intro-text").typed({
strings: myQuotes,
typeSpeed: {{ site.type-speed }},
backDelay: {{ site.delete-delay }},
startDelay: {{ site.start-delay }},
loop: {{ site..loop }},
loopCount: {{ site.loop-count }},
cursorChar: "|"
});
</script>
{% endif %}
<!-- Dynamic Typing End -->
<!-- Javascript End -->