1
0
mirror of https://github.com/mbirth/wiki.git synced 2024-12-25 23:04:06 +00:00

Remove Google+ (*sniff*), fix spot.im

This commit is contained in:
Markus Birth 2020-01-21 18:01:54 +01:00
parent 1fc110d5f9
commit 29552bfce8
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 7 additions and 16 deletions

View File

@ -1,7 +1,6 @@
<ul id="comments-tabs">
<li class="static"><strong>Comments:</strong></li>
<li data-service="disqus" data-div="comments_disqus">Disqus</li>
<li data-service="google" data-div="comments_google">Google+</li>
<li data-service="spotim" data-div="comments_spotim">spot.im</li>
<li class="hint static">(Click to enable.)</li>
</ul>
@ -17,16 +16,10 @@
</script>
</div>
<div id="comments_google" class="comments-tab">
<div class="g-comments" data-href="{{ site.url }}{{ page.url }}" data-width="868" data-first_party_property="BLOGGER" data-view_type="FILTERED_POSTMOD">Loading Google+ comments…</div>
</div>
<div id="comments_spotim" class="comments-tab">
<div id="spot-im-frame-inpage" data-post-id="{% if page.id %}{{ page.id }}{% else %}/index{% endif %}"></div>
<div id="spot-im-frame-inpage" data-spotim-module="recirculation" data-spot-id="sp_cNwZLN9Q"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
window.SPOTIM = {
spotId: 'sp_cNwZLN9Q'
};
var spotim_postid = '{% if page.id %}{{ page.id }}{% else %}/index{% endif %}';
</script>
</div>

View File

@ -2,11 +2,13 @@
---
$(document).ready ->
$('ul#comments-tabs li').not('.static').click ->
addScript = (script) ->
addScript = (script, data = {} ) ->
scr = document.createElement 'script'
scr.type = 'text/javascript'
scr.async = true
scr.src = script
for key, value of data
scr.setAttribute "data-#{key}", value
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild scr
tab_id = $(this).attr 'data-div'
@ -18,14 +20,10 @@ $(document).ready ->
addScript("//#{disqus_shortname}.disqus.com/embed.js")
$(this).removeAttr 'data-service'
when 'google'
# load Google+
addScript('//apis.google.com/js/plusone.js')
$(this).removeAttr 'data-service'
when 'spotim'
# load spot.im
addScript('//www.spot.im/launcher/bundle.js')
addScript('//recirculation.spot.im/spot/sp_cNwZLN9Q')
addScript('//launcher.spot.im/spot/sp_cNwZLN9Q', { "post-id": window.spotim_postid, "spotim-module": "spotim-launcher" } )
$(this).removeAttr 'data-service'
$('ul#comments-tabs li.hint').remove()