Permalink
Browse files

load js files based on current protocol

  • Loading branch information...
1 parent bd647cb commit d8d3f635ba42a532f53b1c841327f483a1645aa0 Jean-Philippe Boily committed Oct 18, 2012
@@ -11,7 +11,7 @@
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
- s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
+ s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
@@ -1,4 +1,4 @@
<div id="recentcomments" class="dsq-widget">
<h1 class="dsq-widget-title"><%= t(".recent_comments") %></h1>
- <script type="text/javascript" src="http://<%= Monologue.disqus_shortname%>.disqus.com/recent_comments_widget.js?num_items=20&hide_avatars=0&avatar_size=48&excerpt_length=500"></script>
+ <script type="text/javascript" src="//<%= Monologue.disqus_shortname%>.disqus.com/recent_comments_widget.js?num_items=20&hide_avatars=0&avatar_size=48&excerpt_length=500"></script>
</div>
@@ -12,7 +12,7 @@
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
- po.src = 'https://apis.google.com/js/plusone.js';
+ po.src = '//apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

3 comments on commit d8d3f63

@swalkinshaw

Good eye on the recent comments widget. plusone.js actually only loads via https. So technically, loading it via http will be slower with a redirect involved. Should probably stay as https.

@jipiboily
Owner

Good catch, fixing it. Thanks!

@jipiboily
Owner

Fixed here: c011e82

Please sign in to comment.