Skip to content
Permalink
Browse files
Update 99_altmetric.js
* Don't display 0 counts for readers (Connotea will always be 0 now)
* Include reference to list of citation types (default values have not been changed).
  • Loading branch information
jesusbagpuss committed Sep 1, 2016
1 parent cc442c8 commit f60864720bbacbc7daf05b5dc45d088accc54087
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/static/javascript/auto/99_altmetric.js
@@ -45,7 +45,12 @@ var EP_Altmetric_Badge = Class.create( {
var details_panel = new Element( 'div', { 'class': 'altmetric_details_panel' } );
this.element.insert( details_panel );

// TODO: add 'delicious', 'forum'
/* 2016-09-01 From: http://api.altmetric.com/docs/call_citations.html, 'types' available are:
posts (combined total of below?)
delicious, fbwalls, feeds, forum, gplus, linkedin, msm, peer_review_sites, pinners,
policies, qs, rdts, rh, tweeters, videos, weibo, wikipedia
Any of the above can be added to the array below.
*/
var types = [ 'tweeters', 'rdts', 'feeds', 'gplus', 'msm', 'fbwalls', 'videos' ];
var data = new Hash( json );

@@ -70,7 +75,7 @@ var EP_Altmetric_Badge = Class.create( {
for( var i=0; i < readers.length; i++ )
{
var value = data.get( readers[i] );
if( value != null )
if( ( value != null ) && ( value != 0 ) )

This comment has been minimized.

Copy link
@jesusbagpuss

jesusbagpuss Sep 1, 2016

Author Contributor

Fixes #1

{
var row = new Element( 'div', { 'class': 'altmetric_row altmetric_' + readers[i] } );
var figure = new Element( 'span' );

0 comments on commit f608647

Please sign in to comment.