Skip to content

Commit

Permalink
load js files based on current protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Philippe Boily committed Oct 18, 2012
1 parent bd647cb commit d8d3f63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/monologue/application/_disqus.html.erb
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion app/views/monologue/admin/comments/show.html.erb
@@ -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>
2 changes: 1 addition & 1 deletion app/views/monologue/posts/_social_sharing.html.erb
Expand Up @@ -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>
Expand Down

3 comments on commit d8d3f63

@swalkinshaw
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixing it. Thanks!

@jipiboily
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed here: c011e82

Please sign in to comment.