/
disqus_comments
95 lines (73 loc) · 3.08 KB
/
disqus_comments
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<section class="disqus pattern-bg-lighter">
<div id="disqus" class="">
<h2>Comments</h2>
<div id="disqus_thread">
<a href="#disqus_thread" class="load-comments" data-disqus-identifier="http://juristr.com{{page.url}}">0</a>
</div>
</div>
<noscript>
<p class="center">
<strong>
<a href="http://disqus.com/?ref_noscript">Please enable JavaScript to view the comments powered by Disqus.</a>
</strong>
</p>
</noscript>
<script>
var disqus_shortname = 'juristr';
// var disqus_identifier = '{{ page.url }}';
// var disqus_url = '{{ page.url }}';
var disqus_developer = 0;
var disqus_config = function () {
var funky_language_code_mapping = {
'de': 'de_inf',
'es': 'es_ES',
'pt': 'pt_EU',
'sr': 'sr_CYRL',
'sv': 'sv_SE',
'zh': 'zh_HANT'
};
this.language = funky_language_code_mapping['en'] ||
'en';
this.callbacks.onReady = [ function () {
try {
// _gaq.push(['_trackEvent', 'View comments']);
} catch(err){}
} ];
this.callbacks.onNewComment = [ function (comment) {
try {
// _gaq.push(['_trackEvent', 'Commented']);
} catch(err){}
} ];
};
window.addEventListener('load', function(e) {
var c = document.createElement('script');
c.type = 'text/javascript';
c.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
c.async = true;
var s = document.getElementsByTagName('script')[0], sp = s.parentNode;
sp.insertBefore(c, s);
if (window.location.hash === '#disqus_thread'){
loadComments();
}
}, false);
var disqus_loaded = false;
function loadComments() {
if (disqus_loaded)
return;
disqus_loaded = true;
//_gaq.push(['_trackEvent', 'Interactions', 'Comments', 'Comments Loaded']);
var s = document.getElementsByTagName('script')[0], sp = s.parentNode;
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
var disqusContainer = document.getElementById('disqus');
disqusContainer.classList.add('active');
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
sp.insertBefore(dsq, s);
}
var loadCommentsButtons = document.querySelectorAll('.load-comments');
for(var l = 0; l < loadCommentsButtons.length; l++){
loadCommentsButtons[l].addEventListener('click', loadComments);
}
</script>
</section>