1
0
mirror of https://github.com/mbirth/wiki.git synced 2024-09-19 06:23:25 +01: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"> <ul id="comments-tabs">
<li class="static"><strong>Comments:</strong></li> <li class="static"><strong>Comments:</strong></li>
<li data-service="disqus" data-div="comments_disqus">Disqus</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 data-service="spotim" data-div="comments_spotim">spot.im</li>
<li class="hint static">(Click to enable.)</li> <li class="hint static">(Click to enable.)</li>
</ul> </ul>
@ -17,16 +16,10 @@
</script> </script>
</div> </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="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"> <script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */ /* * * CONFIGURATION VARIABLES * * */
window.SPOTIM = { var spotim_postid = '{% if page.id %}{{ page.id }}{% else %}/index{% endif %}';
spotId: 'sp_cNwZLN9Q'
};
</script> </script>
</div> </div>

View File

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