2015-06-28 02:47:46 +01:00
|
|
|
---
|
|
|
|
---
|
|
|
|
$(document).ready ->
|
2015-06-28 16:37:34 +01:00
|
|
|
$('ul#comments-tabs li').not('.static').click ->
|
2015-06-28 02:47:46 +01:00
|
|
|
tab_id = $(this).attr 'data-div'
|
2015-06-28 22:15:28 +01:00
|
|
|
service = $(this).attr 'data-service'
|
|
|
|
|
|
|
|
switch service
|
|
|
|
when 'disqus'
|
|
|
|
# load Disqus
|
|
|
|
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
|
|
|
|
$(this).removeAttr 'data-service'
|
|
|
|
|
|
|
|
when 'google'
|
|
|
|
# load Google+
|
|
|
|
gog = document.createElement 'script'
|
|
|
|
gog.type = 'text/javascript'
|
|
|
|
gog.async = true
|
|
|
|
gog.src = '//apis.google.com/js/plusone.js'
|
|
|
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild gog
|
|
|
|
$(this).removeAttr 'data-service'
|
2015-06-28 02:47:46 +01:00
|
|
|
|
2015-06-28 23:09:06 +01:00
|
|
|
$('ul#comments-tabs li.hint').remove()
|
2015-06-28 23:07:45 +01:00
|
|
|
|
2015-06-28 02:47:46 +01:00
|
|
|
$('ul#comments-tabs li').removeClass 'current'
|
|
|
|
$('.comments-tab').removeClass 'current'
|
|
|
|
|
|
|
|
$(this).addClass 'current'
|
|
|
|
$("##{tab_id}").addClass 'current'
|