Hueman Addons - Version 1.0.7

Version Description

: September 14th, 2016 = * fixed : Facebook counter not working due to API change * fixed : Twitter counter not working due to API change

Download this release

Release Info

Developer nikeo
Plugin Icon 128x128 Hueman Addons
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.6 to 1.0.7

assets/front/js/jQuerySharrre.js CHANGED
@@ -107,7 +107,7 @@ var SharrrePlatform = SharrrePlatform || (function () {
107
  return {
108
  settings: defaultSettings,
109
  url: function (url) {
110
- return "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?";
111
  },
112
  trackingAction: {site: 'facebook', action: 'like'},
113
  load: function (self) {
@@ -303,7 +303,7 @@ var SharrrePlatform = SharrrePlatform || (function () {
303
  settings: defaultSettings,
304
  trackingAction: {site: 'twitter', action: 'tweet'},
305
  url: function (test) {
306
- return "https://opensharecount.com/count.json?url={url}";
307
  },
308
  load: function (self) {
309
  var sett = this.settings;
@@ -534,7 +534,6 @@ var SharrrePlatform = SharrrePlatform || (function () {
534
  var self = this;
535
  $(this.element).append('<div class="buttons"></div>');
536
  $.each(self.options.share, function (name, val) {
537
-
538
  if (val === true) {
539
  self.platforms[name].load(self);
540
  if (self.options.enableTracking === true) { //add tracking
@@ -562,6 +561,9 @@ var SharrrePlatform = SharrrePlatform || (function () {
562
  buttonUrl = '';
563
  }
564
  url = buttonUrl.replace('{url}', replaceUrl);
 
 
 
565
  if (url !== '') { //urlCurl = '' if you don't want to used PHP script but used social button
566
  $.getJSON(url, function (json) {
567
  if (typeof json.count !== "undefined") { //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg
@@ -570,8 +572,8 @@ var SharrrePlatform = SharrrePlatform || (function () {
570
  count += parseInt(temp, 10);
571
  }
572
  //get the FB total count (shares, likes and more)
573
- else if (json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined") { //Facebook total count
574
- count += parseInt(json.data[0].total_count, 10);
575
  }
576
  else if (typeof json[0] !== "undefined") { //Delicious
577
  count += parseInt(json[0].total_posts, 10);
107
  return {
108
  settings: defaultSettings,
109
  url: function (url) {
110
+ return "https://graph.facebook.com/?id={url}&callback=?";
111
  },
112
  trackingAction: {site: 'facebook', action: 'like'},
113
  load: function (self) {
303
  settings: defaultSettings,
304
  trackingAction: {site: 'twitter', action: 'tweet'},
305
  url: function (test) {
306
+ return "http://opensharecount.com/count.json?url={url}";
307
  },
308
  load: function (self) {
309
  var sett = this.settings;
534
  var self = this;
535
  $(this.element).append('<div class="buttons"></div>');
536
  $.each(self.options.share, function (name, val) {
 
537
  if (val === true) {
538
  self.platforms[name].load(self);
539
  if (self.options.enableTracking === true) { //add tracking
561
  buttonUrl = '';
562
  }
563
  url = buttonUrl.replace('{url}', replaceUrl);
564
+ if ( 'twitter' == name ) {
565
+ buttonUrl = self.platforms[name].url();
566
+ }
567
  if (url !== '') { //urlCurl = '' if you don't want to used PHP script but used social button
568
  $.getJSON(url, function (json) {
569
  if (typeof json.count !== "undefined") { //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg
572
  count += parseInt(temp, 10);
573
  }
574
  //get the FB total count (shares, likes and more)
575
+ else if ( ( typeof json.share !== "undefined" ) && ( typeof json.share.share_count !== "undefined" ) ) { //Facebook total count
576
+ count += parseInt(json.share.share_count, 10);
577
  }
578
  else if (typeof json[0] !== "undefined") { //Delicious
579
  count += parseInt(json[0].total_posts, 10);
assets/front/js/jQuerySharrre.min.js CHANGED
@@ -1 +1 @@
1
- var SharrrePlatform=SharrrePlatform||function(){var a={};return{register:function(b,c){a[b]=c},get:function(b,c){return a[b]?new a[b](c):(console.error("Sharrre - No platform found for "+b),!1)}}}();!function(a,b){"undefined"!=typeof a&&(b.register("linkedin",function(b){return defaultSettings={url:"",urlCount:!1,counter:"",count:!0,popup:{width:550,height:550}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?"},trackingAction:{site:"linkedin",action:"share"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button linkedin"><script type="IN/share" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-counter="'+c.counter+'"></script></div>');var d=0;"undefined"==typeof window.IN&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.linkedin.com/in.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):"undefined"!=typeof window.IN&&window.IN.parse&&IN.parse(document)},tracking:function(){},popup:function(a){window.open("https://www.linkedin.com/cws/share?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&token=&isFramed=true","linkedin","toolbar=no, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("facebook",function(b){return defaultSettings={url:"",urlCount:!1,action:"like",layout:"button_count",count:!0,width:"",send:"false",faces:"false",colorscheme:"",font:"",lang:"en_US",share:"",appId:"",popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?"},trackingAction:{site:"facebook",action:"like"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-send="'+c.send+'" data-layout="'+c.layout+'" data-width="'+c.width+'" data-show-faces="'+c.faces+'" data-action="'+c.action+'" data-colorscheme="'+c.colorscheme+'" data-font="'+c.font+'" data-via="'+c.via+'" data-share="'+c.share+'"></div></div>');var d=0;"undefined"==typeof FB&&0===d?(d=1,function(a,b,d){var e,f=a.getElementsByTagName(b)[0];a.getElementById(d)||(e=a.createElement(b),e.id=d,e.src="https://connect.facebook.net/"+c.lang+"/all.js#xfbml=1",c.appId&&(e.src+="&appId="+c.appId),f.parentNode.insertBefore(e,f))}(document,"script","facebook-jssdk")):FB.XFBML.parse()},tracking:function(){fb=window.setInterval(function(){"undefined"!=typeof FB&&"undefined"!=typeof _gaq&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}),clearInterval(fb))},1e3)},popup:function(a){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&t="+a.text,"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("googlePlus",function(b){return defaultSettings={url:"",urlCount:!1,size:"medium",lang:"en-US",annotation:"",count:!0,popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return a+"?url={url}&type=googlePlus"},trackingAction:{site:"Google",action:"+1"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button googleplus"><div class="g-plusone" data-size="'+c.size+'" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-annotation="'+c.annotation+'"></div></div>'),window.___gcfg={lang:c.lang};var d=0;"undefined"!=typeof gapi&&"undefined"!=typeof gapi.plusone||0!==d?gapi.plusone.go():(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://apis.google.com/js/plusone.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}())},tracking:function(){},popup:function(a){window.open("https://plus.google.com/share?hl="+this.settings.lang+"&url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url),"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("pinterest",function(b){return defaultSettings={url:"",media:"",description:"",layout:"horizontal",popup:{width:700,height:300}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://api.pinterest.com/v1/urls/count.json?url={url}&callback=?"},trackingAction:{site:"pinterest",action:"pin"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button pinterest"><a href="https://www.pinterest.com/pin/create/button/?url='+(""!==c.url?c.url:b.options.url)+"&media="+c.media+"&description="+c.description+'" data-pin-do="buttonBookmark" count-layout="'+c.layout+'">Pin It</a></div>'),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://assets.pinterest.com/js/pinit.js",a.setAttribute("data-pin-build","parsePinBtns");var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}(),window.parsePinBtns&&window.parsePinBtns(),a(b.element).find(".pinterest").on("click",function(){b.openPopup("pinterest")})},tracking:function(){},popup:function(a){window.open("https://pinterest.com/pin/create/button/?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&media="+encodeURIComponent(this.settings.media)+"&description="+this.settings.description,"pinterest","toolbar=no,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitter",function(b){return defaultSettings={url:"",urlCount:!1,count:!1,hashtags:"",via:"",related:"",lang:"en",popup:{width:650,height:360}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"tweet"},url:function(a){return"https://opensharecount.com/count.json?url={url}"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-count="'+c.count+'" data-text="'+b.options.text+'" data-via="'+c.via+'" data-hashtags="'+c.hashtags+'" data-related="'+c.related+'" data-lang="'+c.lang+'">Tweet</a></div>');var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){tw=window.setInterval(function(){"undefined"!=typeof twttr&&(twttr.events.bind("tweet",function(a){a&&"undefined"!=typeof _gaq&&_gaq.push(["_trackSocial","twitter","tweet"])}),clearInterval(tw))},1e3)},popup:function(a){window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(a.text)+"&url="+encodeURIComponent(""!==this.settings.url?this.setting.url:a.url)+(""!==this.settings.via?"&via="+this.settings.via:""),"","toolbar=0, status=0,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitterFollow",function(b){return defaultSettings={url:"",urlCount:!1,count:!0,display:"horizontal",lang:"en",popup:{width:650,height:360},user:"",size:"default",showCount:"false"},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"follow"},url:function(a){return""},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitterFollow"><a href="https://twitter.com/'+c.user+'" class="twitter-follow-button"" data-size="'+c.size+'" data-show-count="'+c.showCount+'" data-lang="'+c.lang+'">Follow @'+c.user+"</a></div>");var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){},popup:function(a){window.open("https://twitter.com/intent/follow?screen_name="+encodeURIComponent(this.settings.user),"","toolbar=0, status=0, ,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}))}(window.jQuery,SharrrePlatform),function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend(!0,{},g,c),this.options.share=c.share,this._defaults=g,this._name=f,this.platforms={},this.init()}var f="sharrre",g={className:"sharrre",share:{},shareTotal:0,template:"",title:"",url:c.location.href,text:c.title,urlCurl:"sharrre.php",count:{},total:0,shorterTotal:!0,enableHover:!0,enableCounter:!0,enableTracking:!1,defaultUrl:"javascript:void(0);",popup:{width:900,height:500},hover:function(){},hide:function(){},click:function(){},render:function(){}};e.prototype.init=function(){var b=this;a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a]=SharrrePlatform.get(a,b.options.buttons[a]))}),a(this.element).addClass(this.options.className),"undefined"!=typeof a(this.element).data("title")&&(this.options.title=a(this.element).attr("data-title")),"undefined"!=typeof a(this.element).data("url")&&(this.options.url=a(this.element).data("url")),"undefined"!=typeof a(this.element).data("text")&&(this.options.text=a(this.element).data("text")),a.each(this.options.share,function(a,c){c===!0&&b.options.shareTotal++}),b.options.enableCounter===!0?a.each(this.options.share,function(a,c){if(c===!0)try{b.getSocialJson(a)}catch(d){}}):""!==b.options.template&&(b.renderer(),b.options.count[name]=0,b.rendererPerso()),""!==b.options.template?this.options.render(this,this.options):this.loadButtons(),a(this.element).on("mouseenter",function(){0===a(this).find(".buttons").length&&b.options.enableHover===!0&&b.loadButtons(),b.options.hover(b,b.options)}).on("mouseleave",function(){b.options.hide(b,b.options)}),a(this.element).click(function(a){return a.preventDefault(),b.options.click(b,b.options),!1})},e.prototype.loadButtons=function(){var b=this;a(this.element).append('<div class="buttons"></div>'),a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a].load(b),b.options.enableTracking===!0&&b.platforms[a].tracking())})},e.prototype.getSocialJson=function(b){var c=this,d=0,e=c.platforms[b].settings,f=c.platforms[b].url(this.options.urlCurl),g=encodeURIComponent(this.options.url);e.url.length&&(f=e.url),e.urlCount===!0&&""!==f&&(g=f),e.count===!1&&(f=""),url=f.replace("{url}",g),""!==url?a.getJSON(url,function(a){if("undefined"!=typeof a.count){var e=a.count+"";e=e.replace(" ",""),d+=parseInt(e,10)}else a.data&&a.data.length>0&&"undefined"!=typeof a.data[0].total_count?d+=parseInt(a.data[0].total_count,10):"undefined"!=typeof a[0]?d+=parseInt(a[0].total_posts,10):"undefined"!=typeof a[0];c.options.count[b]=d,c.options.total+=d,c.renderer(),c.rendererPerso()}).error(function(){c.options.count[b]=0,c.rendererPerso()}):(c.renderer(),c.options.count[b]=0,c.rendererPerso())},e.prototype.rendererPerso=function(){var a=0;for(var b in this.options.count)a++;a===this.options.shareTotal&&this.options.render(this,this.options)},e.prototype.renderer=function(){var b=this.options.total,c=this.options.template;this.options.shorterTotal===!0&&(b=this.shorterTotal(b)),""!==c?(c=c.replace("{total}",b),a(this.element).html(c)):a(this.element).html('<div class="box"><a class="count" href="'+this.options.defaultUrl+'">'+b+"</a>"+(""!==this.options.title?'<a class="share" href="'+this.options.defaultUrl+'">'+this.options.title+"</a>":"")+"</div>")},e.prototype.shorterTotal=function(a){return a>=1e6?a=(a/1e6).toFixed(2)+"M":a>=1e3&&(a=(a/1e3).toFixed(1)+"k"),a},e.prototype.openPopup=function(a){this.platforms[a].popup(this.options),this.options.enableTracking===!0&&"undefined"!=typeof _gaq&&(infos=this.platforms[a].trackingAction,_gaq.push(["_trackSocial",infos.site,infos.action]))},e.prototype.simulateClick=function(){var b=a(this.element).html();a(this.element).html(b.replace(this.options.total,this.options.total+1))},e.prototype.update=function(a,b){""!==a&&(this.options.url=a),""!==b&&(this.options.text=b)},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a(this).data("plugin_"+f)||a(this).data("plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a(this).data("plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(c,1))}):void 0}}(window.jQuery||window.Zepto,window,document);
1
+ var SharrrePlatform=SharrrePlatform||function(){var a={};return{register:function(b,c){a[b]=c},get:function(b,c){return a[b]?new a[b](c):(console.error("Sharrre - No platform found for "+b),!1)}}}();!function(a,b){"undefined"!=typeof a&&(b.register("linkedin",function(b){return defaultSettings={url:"",urlCount:!1,counter:"",count:!0,popup:{width:550,height:550}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?"},trackingAction:{site:"linkedin",action:"share"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button linkedin"><script type="IN/share" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-counter="'+c.counter+'"></script></div>');var d=0;"undefined"==typeof window.IN&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.linkedin.com/in.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):"undefined"!=typeof window.IN&&window.IN.parse&&IN.parse(document)},tracking:function(){},popup:function(a){window.open("https://www.linkedin.com/cws/share?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&token=&isFramed=true","linkedin","toolbar=no, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("facebook",function(b){return defaultSettings={url:"",urlCount:!1,action:"like",layout:"button_count",count:!0,width:"",send:"false",faces:"false",colorscheme:"",font:"",lang:"en_US",share:"",appId:"",popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://graph.facebook.com/?id={url}&callback=?"},trackingAction:{site:"facebook",action:"like"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-send="'+c.send+'" data-layout="'+c.layout+'" data-width="'+c.width+'" data-show-faces="'+c.faces+'" data-action="'+c.action+'" data-colorscheme="'+c.colorscheme+'" data-font="'+c.font+'" data-via="'+c.via+'" data-share="'+c.share+'"></div></div>');var d=0;"undefined"==typeof FB&&0===d?(d=1,function(a,b,d){var e,f=a.getElementsByTagName(b)[0];a.getElementById(d)||(e=a.createElement(b),e.id=d,e.src="https://connect.facebook.net/"+c.lang+"/all.js#xfbml=1",c.appId&&(e.src+="&appId="+c.appId),f.parentNode.insertBefore(e,f))}(document,"script","facebook-jssdk")):FB.XFBML.parse()},tracking:function(){fb=window.setInterval(function(){"undefined"!=typeof FB&&"undefined"!=typeof _gaq&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}),clearInterval(fb))},1e3)},popup:function(a){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&t="+a.text,"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("googlePlus",function(b){return defaultSettings={url:"",urlCount:!1,size:"medium",lang:"en-US",annotation:"",count:!0,popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return a+"?url={url}&type=googlePlus"},trackingAction:{site:"Google",action:"+1"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button googleplus"><div class="g-plusone" data-size="'+c.size+'" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-annotation="'+c.annotation+'"></div></div>'),window.___gcfg={lang:c.lang};var d=0;"undefined"!=typeof gapi&&"undefined"!=typeof gapi.plusone||0!==d?gapi.plusone.go():(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://apis.google.com/js/plusone.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}())},tracking:function(){},popup:function(a){window.open("https://plus.google.com/share?hl="+this.settings.lang+"&url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url),"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("pinterest",function(b){return defaultSettings={url:"",media:"",description:"",layout:"horizontal",popup:{width:700,height:300}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://api.pinterest.com/v1/urls/count.json?url={url}&callback=?"},trackingAction:{site:"pinterest",action:"pin"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button pinterest"><a href="https://www.pinterest.com/pin/create/button/?url='+(""!==c.url?c.url:b.options.url)+"&media="+c.media+"&description="+c.description+'" data-pin-do="buttonBookmark" count-layout="'+c.layout+'">Pin It</a></div>'),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://assets.pinterest.com/js/pinit.js",a.setAttribute("data-pin-build","parsePinBtns");var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}(),window.parsePinBtns&&window.parsePinBtns(),a(b.element).find(".pinterest").on("click",function(){b.openPopup("pinterest")})},tracking:function(){},popup:function(a){window.open("https://pinterest.com/pin/create/button/?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&media="+encodeURIComponent(this.settings.media)+"&description="+this.settings.description,"pinterest","toolbar=no,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitter",function(b){return defaultSettings={url:"",urlCount:!1,count:!1,hashtags:"",via:"",related:"",lang:"en",popup:{width:650,height:360}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"tweet"},url:function(a){return"http://opensharecount.com/count.json?url={url}"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-count="'+c.count+'" data-text="'+b.options.text+'" data-via="'+c.via+'" data-hashtags="'+c.hashtags+'" data-related="'+c.related+'" data-lang="'+c.lang+'">Tweet</a></div>');var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){tw=window.setInterval(function(){"undefined"!=typeof twttr&&(twttr.events.bind("tweet",function(a){a&&"undefined"!=typeof _gaq&&_gaq.push(["_trackSocial","twitter","tweet"])}),clearInterval(tw))},1e3)},popup:function(a){window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(a.text)+"&url="+encodeURIComponent(""!==this.settings.url?this.setting.url:a.url)+(""!==this.settings.via?"&via="+this.settings.via:""),"","toolbar=0, status=0,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitterFollow",function(b){return defaultSettings={url:"",urlCount:!1,count:!0,display:"horizontal",lang:"en",popup:{width:650,height:360},user:"",size:"default",showCount:"false"},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"follow"},url:function(a){return""},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitterFollow"><a href="https://twitter.com/'+c.user+'" class="twitter-follow-button"" data-size="'+c.size+'" data-show-count="'+c.showCount+'" data-lang="'+c.lang+'">Follow @'+c.user+"</a></div>");var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){},popup:function(a){window.open("https://twitter.com/intent/follow?screen_name="+encodeURIComponent(this.settings.user),"","toolbar=0, status=0, ,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}))}(window.jQuery,SharrrePlatform),function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend(!0,{},g,c),this.options.share=c.share,this._defaults=g,this._name=f,this.platforms={},this.init()}var f="sharrre",g={className:"sharrre",share:{},shareTotal:0,template:"",title:"",url:c.location.href,text:c.title,urlCurl:"sharrre.php",count:{},total:0,shorterTotal:!0,enableHover:!0,enableCounter:!0,enableTracking:!1,defaultUrl:"javascript:void(0);",popup:{width:900,height:500},hover:function(){},hide:function(){},click:function(){},render:function(){}};e.prototype.init=function(){var b=this;a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a]=SharrrePlatform.get(a,b.options.buttons[a]))}),a(this.element).addClass(this.options.className),"undefined"!=typeof a(this.element).data("title")&&(this.options.title=a(this.element).attr("data-title")),"undefined"!=typeof a(this.element).data("url")&&(this.options.url=a(this.element).data("url")),"undefined"!=typeof a(this.element).data("text")&&(this.options.text=a(this.element).data("text")),a.each(this.options.share,function(a,c){c===!0&&b.options.shareTotal++}),b.options.enableCounter===!0?a.each(this.options.share,function(a,c){if(c===!0)try{b.getSocialJson(a)}catch(d){}}):""!==b.options.template&&(b.renderer(),b.options.count[name]=0,b.rendererPerso()),""!==b.options.template?this.options.render(this,this.options):this.loadButtons(),a(this.element).on("mouseenter",function(){0===a(this).find(".buttons").length&&b.options.enableHover===!0&&b.loadButtons(),b.options.hover(b,b.options)}).on("mouseleave",function(){b.options.hide(b,b.options)}),a(this.element).click(function(a){return a.preventDefault(),b.options.click(b,b.options),!1})},e.prototype.loadButtons=function(){var b=this;a(this.element).append('<div class="buttons"></div>'),a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a].load(b),b.options.enableTracking===!0&&b.platforms[a].tracking())})},e.prototype.getSocialJson=function(b){var c=this,d=0,e=c.platforms[b].settings,f=c.platforms[b].url(this.options.urlCurl),g=encodeURIComponent(this.options.url);e.url.length&&(f=e.url),e.urlCount===!0&&""!==f&&(g=f),e.count===!1&&(f=""),url=f.replace("{url}",g),"twitter"==b&&(f=c.platforms[b].url()),""!==url?a.getJSON(url,function(a){if("undefined"!=typeof a.count){var e=a.count+"";e=e.replace(" ",""),d+=parseInt(e,10)}else"undefined"!=typeof a.share&&"undefined"!=typeof a.share.share_count?d+=parseInt(a.share.share_count,10):"undefined"!=typeof a[0]?d+=parseInt(a[0].total_posts,10):"undefined"!=typeof a[0];c.options.count[b]=d,c.options.total+=d,c.renderer(),c.rendererPerso()}).error(function(){c.options.count[b]=0,c.rendererPerso()}):(c.renderer(),c.options.count[b]=0,c.rendererPerso())},e.prototype.rendererPerso=function(){var a=0;for(var b in this.options.count)a++;a===this.options.shareTotal&&this.options.render(this,this.options)},e.prototype.renderer=function(){var b=this.options.total,c=this.options.template;this.options.shorterTotal===!0&&(b=this.shorterTotal(b)),""!==c?(c=c.replace("{total}",b),a(this.element).html(c)):a(this.element).html('<div class="box"><a class="count" href="'+this.options.defaultUrl+'">'+b+"</a>"+(""!==this.options.title?'<a class="share" href="'+this.options.defaultUrl+'">'+this.options.title+"</a>":"")+"</div>")},e.prototype.shorterTotal=function(a){return a>=1e6?a=(a/1e6).toFixed(2)+"M":a>=1e3&&(a=(a/1e3).toFixed(1)+"k"),a},e.prototype.openPopup=function(a){this.platforms[a].popup(this.options),this.options.enableTracking===!0&&"undefined"!=typeof _gaq&&(infos=this.platforms[a].trackingAction,_gaq.push(["_trackSocial",infos.site,infos.action]))},e.prototype.simulateClick=function(){var b=a(this.element).html();a(this.element).html(b.replace(this.options.total,this.options.total+1))},e.prototype.update=function(a,b){""!==a&&(this.options.url=a),""!==b&&(this.options.text=b)},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a(this).data("plugin_"+f)||a(this).data("plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a(this).data("plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(c,1))}):void 0}}(window.jQuery||window.Zepto,window,document);
hueman-addons.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Hueman Addons
4
  * Plugin URI: http://presscustomizr.com
5
  * Description: Hueman Theme Addons
6
- * Version: 1.0.6
7
  * Text Domain: hueman-addons
8
  * Author: Press Customizr
9
  * Author URI: http://presscustomizr.com
@@ -92,6 +92,7 @@ class HU_addons_plugin {
92
  'label' => __('Enable Twitter Button', 'hueman-addons'),
93
  'section' => 'social_links_sec',
94
  'type' => 'checkbox',
 
95
  'priority' => 60
96
  ),
97
  'twitter-username' => array(
3
  * Plugin Name: Hueman Addons
4
  * Plugin URI: http://presscustomizr.com
5
  * Description: Hueman Theme Addons
6
+ * Version: 1.0.7
7
  * Text Domain: hueman-addons
8
  * Author: Press Customizr
9
  * Author URI: http://presscustomizr.com
92
  'label' => __('Enable Twitter Button', 'hueman-addons'),
93
  'section' => 'social_links_sec',
94
  'type' => 'checkbox',
95
+ 'notice' => __('Since Nov. 2015, Twitter disabled the share counts from its API. If you want to get the display count anyway, you can create an account for free (as of Feb. 2016) on [https://opensharecount.com/]. The Hueman Addons plugin is configured to use opensharecount.', 'hueman-addons'),
96
  'priority' => 60
97
  ),
98
  'twitter-username' => array(
lang/en_US.po CHANGED
@@ -1,6 +1,6 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Hueman Addons v1.0.6\n"
4
  "POT-Creation-Date: 2016-05-05 14:53+0200\n"
5
  "PO-Revision-Date: 2016-05-05 14:53+0200\n"
6
  "Last-Translator: \n"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: Hueman Addons v1.0.7\n"
4
  "POT-Creation-Date: 2016-05-05 14:53+0200\n"
5
  "PO-Revision-Date: 2016-05-05 14:53+0200\n"
6
  "Last-Translator: \n"
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://github.com/presscustomizr/hueman-addons
5
  Tags: hueman theme, hueman
6
  Requires at least: 3.4
7
  Tested up to: 4.7
8
- Stable tag: 1.0.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -37,6 +37,10 @@ The plugin has been designed specifically for the Hueman WordPress theme. Lightw
37
 
38
 
39
  == Changelog ==
 
 
 
 
40
  = 1.0.6 : September 9th, 2016 =
41
  * fixed : added the text domain for internationalization
42
 
5
  Tags: hueman theme, hueman
6
  Requires at least: 3.4
7
  Tested up to: 4.7
8
+ Stable tag: 1.0.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
37
 
38
 
39
  == Changelog ==
40
+ = 1.0.7 : September 14th, 2016 =
41
+ * fixed : Facebook counter not working due to API change
42
+ * fixed : Twitter counter not working due to API change
43
+
44
  = 1.0.6 : September 9th, 2016 =
45
  * fixed : added the text domain for internationalization
46