Sha256: 8ff7af94f354647f2e690495639f87f21051c4418e3fa6cb9d6d4ebf7b2b23a0
Contents?: true
Size: 1.24 KB
Versions: 14
Compression:
Stored size: 1.24 KB
Contents
<script> $(document).ready(function () { var disqusPublicKey = "{{ site.disqus.public_key }}"; var disqusShortname = "{{ site.disqus.shortname }}"; var threadUrl = 'link:' + $('.comments .show-hidden').attr('data-disqus-url'); $.ajax({ type: 'GET', url: '//disqus.com/api/3.0/threads/set.jsonp', data: { api_key: disqusPublicKey, forum: disqusShortname, thread: threadUrl }, cache: false, dataType: 'jsonp', success: function (result) { if (result.response.length === 1) { btnText = '{{ site.data.i18n[site.lang].show_comments }} (' + result.response[0].posts + ')'; $('.comments .show-hidden').html(btnText); } } }); $('.comments .show-hidden').on('click', function () { $.ajaxSetup({cache: true}); $.getScript('//' + disqusShortname + '.disqus.com/embed.js'); $.ajaxSetup({cache: false}); $(this).remove(); }); if (/\#comments/.test(location.hash)) { $('.comments .show-hidden').trigger('click'); } }); </script>
Version data entries
14 entries across 14 versions & 1 rubygems