Commit 78854ad6

mo khan <mo@mokhan.ca>
2013-07-06 03:35:44
move single sign on configuration above the disqus service call
1 parent 288f580
Changed files (1)
app
views
app/views/shared/_disqus.html.erb
@@ -2,16 +2,16 @@
 <script type="text/javascript">
 var disqus_shortname = '<%= ENV['DISQUS_SHORTNAME'] %>';
 var disqus_identifier = '<%= id %>';
-(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);
 <% if current_user %>
   var disqus_config = function(){
     this.page.remote_auth_s3 = '<%= disqus_auth %>';
     this.page.api_key = '<%= ENV['DISQUS_API_KEY'] %>';
   };
 <% end %>
+(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>
 <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>