-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,5 +90,10 @@ | |
{% endblock %} | ||
|
||
|
||
{% block scripts %} | ||
{{ block.super }} | ||
{% include 'blocks/_disqus_script.html' %} | ||
{% endblock %} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,11 @@ | ||
<div class="row"> | ||
<div class="comments-container"> | ||
<button | ||
class="show-comments btn btn-success btn-large"> | ||
Load Disqus comments | ||
</button> | ||
<div id="disqus_thread"></div> | ||
<script type="text/javascript"> | ||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | ||
var disqus_shortname = 'pythondigest'; // required: replace example with your forum shortname | ||
{% if identifier %} | ||
var disqus_identifier = '{{ identifier }}'; | ||
{% endif %} | ||
|
||
/* * * DON'T EDIT BELOW THIS LINE * * */ | ||
(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> | ||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span | ||
class="logo-disqus">Disqus</span></a> | ||
</div> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script type="text/javascript"> | ||
$(document).ready(function () { | ||
$('.show-comments').on('click', function () { | ||
var disqus_shortname = 'pythondigest'; // required: replace example with your forum shortname | ||
{% if identifier %} | ||
var disqus_identifier = '{{ identifier }}'; | ||
{% endif %} | ||
|
||
// ajax request to load the disqus javascript | ||
$.ajax({ | ||
type: "GET", | ||
url: "http://" + disqus_shortname + ".disqus.com/embed.js", | ||
dataType: "script", | ||
cache: true | ||
}); | ||
// hide the button once comments load | ||
$(this).fadeOut(); | ||
}); | ||
}); | ||
</script> | ||
<noscript>Please enable JavaScript to view comments</noscript> |