From dc637f476760b01db64fa4ae349f008b40ef82b7 Mon Sep 17 00:00:00 2001 From: Vitalii Savchuk Date: Sat, 26 Oct 2013 21:04:34 +0300 Subject: [PATCH] fix counter --- angular-social.js | 2 +- angular-social.map | 2 +- angular-social.src.js | 6 ++++-- src/scripts/00-directive.js | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/angular-social.js b/angular-social.js index 0f49d1b..bff6410 100644 --- a/angular-social.js +++ b/angular-social.js @@ -1,4 +1,4 @@ -function template(a,b,c){"use strict";return a.replace(/\{([^\}]+)\}/g,function(a,d){return d in b?c?c(b[d]):b[d]:a})}var app=angular.module("ngSocial",[]);app.directive("ngSocialButtons",["$compile","$q","$parse","$http","$location",function(a,b,c,d,e){"use strict";return{restrict:"A",scope:{url:"=",title:"=",description:"=",image:"="},replace:!0,transclude:!0,template:'
',controller:["$scope","$q","$http",function(a,b,c){var d=function(){return a.url||e.absUrl()},f={init:function(a,b,c){c.counter&&(a.count=f.getCount(a.options))},link:function(b){b=b||{};var c=b.urlOptions||{};return c.url=d(),c.title=a.title,c.image=a.image,c.description=a.description||"",f.makeUrl(b.clickUrl||b.popup.url,c)},clickShare:function(b,c){if(!b.shiftKey&&!b.ctrlKey){b.preventDefault(),c.track&&angular.isArray(_gaq)&&_gaq.push(["_trackSocial",c.track.name,c.track.action,a.url]);var d=!0;if(angular.isFunction(c.click)&&(d=c.click.call(this,c)),d){var e=f.link(c);f.openPopup(e,c.popup)}}},openPopup:function(a,b){var c=Math.round(screen.width/2-b.width/2),d=0;screen.height>b.height&&(d=Math.round(screen.height/3-b.height/2));var e=window.open(a,"sl_"+this.service,"left="+c+",top="+d+","+"width="+b.width+",height="+b.height+",personalbar=0,toolbar=0,scrollbars=1,resizable=1");e?e.focus():location.href=a},getCount:function(e){var g=b.defer(),h=e.urlOptions||{};h.url=d(),h.title=a.title;var i=f.makeUrl(e.counter.url,h);return e.counter.get?e.counter.get(i,g,c):c.jsonp(i).success(function(a){e.counter.getNumber?g.resolve(e.counter.getNumber(a)):g.resolve(a)}),g.promise},makeUrl:function(a,b){return template(a,b,encodeURIComponent)}};return f}]}}]),app.directive("ngSocialFacebook",function(){"use strict";var a={counter:{url:"http://graph.facebook.com/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url%3D%22{url}%22&callback=JSON_CALLBACK",getNumber:function(a){return a.data[0].total_count}},popup:{url:"http://www.facebook.com/sharer/sharer.php?u={url}",width:600,height:500},track:{name:"facebook",action:"send"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',link:function(b,c,d,e){c.addClass("ng-social-facebook"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),app.directive("ngSocialTwitter",function(){"use strict";var a={counter:{url:"http://urls.api.twitter.com/1/urls/count.json?url={url}&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://twitter.com/intent/tweet?url={url}&text={title}",width:600,height:450},click:function(a){return/[\.:\-–—]\s*$/.test(a.pageTitle)||(a.pageTitle+=":"),!0},track:{name:"twitter",action:"tweet"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-twitter"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),app.directive("ngSocialGooglePlus",["$parse",function(a){"use strict";var b={counter:{url:"{proxy}?url={url}&type=google-plus&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"https://plus.google.com/share?url={url}",width:700,height:500},track:{name:"Google+",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',link:function(c,d,e,f){if(d.addClass("ng-social-google-plus"),f){var g=a(e.proxyUrl)(c)||"/proxy.php";b.counter.url=b.counter.url.replace("{proxy}",g),c.options=b,c.ctrl=f,f.init(c,d,b)}}}}]),app.directive("ngSocialVk",function(){"use strict";var a={counter:{url:"http://vkontakte.ru/share.php?act=count&url={url}&index={index}",get:function(b,c,d){a._||(a._=[],window.VK||(window.VK={}),window.VK.Share={count:function(b,c){a._[b].resolve(c)}});var e=a._.length;a._.push(c),d.jsonp(b.replace("{index}",e))}},popup:{url:"http://vk.com/share.php?url={url}&title={title}&description={description}&image={image}",width:550,height:330},track:{name:"VKontakte",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-vk"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialOdnoklassniki",function(){var a={counter:{url:"http://www.odnoklassniki.ru/dk?st.cmd=shareData&ref={url}&cb=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl={url}",width:550,height:360},track:{name:"Odnoklassniki",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-odnoklassniki"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialMailru",function(){var a={counter:{url:"http://connect.mail.ru/share_count?url_list={url}&callback=1&func=JSON_CALLBACK",getNumber:function(a){for(var b in a)if(a.hasOwnProperty(b))return a[b].shares}},popup:{url:"http://connect.mail.ru/share?share_url={url}&title={title}",width:550,height:360}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-mailru"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialPinterest",function(){var a={counter:{url:"http://api.pinterest.com/v1/urls/count.json?url={url}&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://pinterest.com/pin/create/button/?url={url}&description={title}",width:630,height:270}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-pinterest"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialGithubForks",function(){var a={counter:{url:"https://api.github.com/repos/{user}/{repository}?callback=JSON_CALLBACK",getNumber:function(a){return a.data.forks_count}},clickUrl:"https://github.com/{user}/{repository}/"};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-github ng-social-github-forks"),e&&(a.urlOptions={user:d.user,repository:d.repository},b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialGithub",function(){var a={counter:{url:"https://api.github.com/repos/{user}/{repository}?callback=JSON_CALLBACK",getNumber:function(a){return a.data.watchers_count}},clickUrl:"https://github.com/{user}/{repository}/"};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-github"),e&&(a.urlOptions={user:d.user,repository:d.repository},b.options=a,b.ctrl=e,e.init(b,c,a))}}}),app.directive("ngSocialStumbleupon",["$parse",function(a){"use strict";var b={counter:{url:"{proxy}?url={url}&type=stumbleupon&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://www.stumbleupon.com/submit?url={url}&title={title}",width:800,height:600},track:{name:"StumbleUpon",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',link:function(c,d,e,f){if(d.addClass("ng-social-google-plus"),f){var g=a(e.proxyUrl)(c)||"/proxy.php";b.counter.url=b.counter.url.replace("{proxy}",g),c.options=b,c.ctrl=f,f.init(c,d,b)}}}}]),angular.module("ngSocial").run(["$templateCache",function(a){a.put("/views/buttons.html",'
    ')}]); +function template(a,b,c){"use strict";return a.replace(/\{([^\}]+)\}/g,function(a,d){return d in b?c?c(b[d]):b[d]:a})}var app=angular.module("ngSocial",[]);app.directive("ngSocialButtons",["$compile","$q","$parse","$http","$location",function(a,b,c,d,e){"use strict";return{restrict:"A",scope:{url:"=",title:"=",description:"=",image:"="},replace:!0,transclude:!0,template:'
    ',controller:["$scope","$q","$http",function(a,b,c){var d=function(){return a.url||e.absUrl()},f={init:function(a,b,c){c.counter&&f.getCount(a.options).then(function(b){a.count=b})},link:function(b){b=b||{};var c=b.urlOptions||{};return c.url=d(),c.title=a.title,c.image=a.image,c.description=a.description||"",f.makeUrl(b.clickUrl||b.popup.url,c)},clickShare:function(b,c){if(!b.shiftKey&&!b.ctrlKey){b.preventDefault(),c.track&&"undefined"!=typeof _gaq&&angular.isArray(_gaq)&&_gaq.push(["_trackSocial",c.track.name,c.track.action,a.url]);var d=!0;if(angular.isFunction(c.click)&&(d=c.click.call(this,c)),d){var e=f.link(c);f.openPopup(e,c.popup)}}},openPopup:function(a,b){var c=Math.round(screen.width/2-b.width/2),d=0;screen.height>b.height&&(d=Math.round(screen.height/3-b.height/2));var e=window.open(a,"sl_"+this.service,"left="+c+",top="+d+","+"width="+b.width+",height="+b.height+",personalbar=0,toolbar=0,scrollbars=1,resizable=1");e?e.focus():location.href=a},getCount:function(e){var g=b.defer(),h=e.urlOptions||{};h.url=d(),h.title=a.title;var i=f.makeUrl(e.counter.url,h);return e.counter.get?e.counter.get(i,g,c):c.jsonp(i).success(function(a){e.counter.getNumber?g.resolve(e.counter.getNumber(a)):g.resolve(a)}),g.promise},makeUrl:function(a,b){return template(a,b,encodeURIComponent)}};return f}]}}]),app.directive("ngSocialFacebook",function(){"use strict";var a={counter:{url:"http://graph.facebook.com/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url%3D%22{url}%22&callback=JSON_CALLBACK",getNumber:function(a){return a.data[0].total_count}},popup:{url:"http://www.facebook.com/sharer/sharer.php?u={url}",width:600,height:500},track:{name:"facebook",action:"send"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',link:function(b,c,d,e){c.addClass("ng-social-facebook"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),app.directive("ngSocialTwitter",function(){"use strict";var a={counter:{url:"http://urls.api.twitter.com/1/urls/count.json?url={url}&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://twitter.com/intent/tweet?url={url}&text={title}",width:600,height:450},click:function(a){return/[\.:\-–—]\s*$/.test(a.pageTitle)||(a.pageTitle+=":"),!0},track:{name:"twitter",action:"tweet"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-twitter"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),app.directive("ngSocialGooglePlus",["$parse",function(a){"use strict";var b={counter:{url:"{proxy}?url={url}&type=google-plus&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"https://plus.google.com/share?url={url}",width:700,height:500},track:{name:"Google+",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',link:function(c,d,e,f){if(d.addClass("ng-social-google-plus"),f){var g=a(e.proxyUrl)(c)||"/proxy.php";b.counter.url=b.counter.url.replace("{proxy}",g),c.options=b,c.ctrl=f,f.init(c,d,b)}}}}]),app.directive("ngSocialVk",function(){"use strict";var a={counter:{url:"http://vkontakte.ru/share.php?act=count&url={url}&index={index}",get:function(b,c,d){a._||(a._=[],window.VK||(window.VK={}),window.VK.Share={count:function(b,c){a._[b].resolve(c)}});var e=a._.length;a._.push(c),d.jsonp(b.replace("{index}",e))}},popup:{url:"http://vk.com/share.php?url={url}&title={title}&description={description}&image={image}",width:550,height:330},track:{name:"VKontakte",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-vk"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialOdnoklassniki",function(){var a={counter:{url:"http://www.odnoklassniki.ru/dk?st.cmd=shareData&ref={url}&cb=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl={url}",width:550,height:360},track:{name:"Odnoklassniki",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-odnoklassniki"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialMailru",function(){var a={counter:{url:"http://connect.mail.ru/share_count?url_list={url}&callback=1&func=JSON_CALLBACK",getNumber:function(a){for(var b in a)if(a.hasOwnProperty(b))return a[b].shares}},popup:{url:"http://connect.mail.ru/share?share_url={url}&title={title}",width:550,height:360}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-mailru"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialPinterest",function(){var a={counter:{url:"http://api.pinterest.com/v1/urls/count.json?url={url}&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://pinterest.com/pin/create/button/?url={url}&description={title}",width:630,height:270}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-pinterest"),e&&(b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialGithubForks",function(){var a={counter:{url:"https://api.github.com/repos/{user}/{repository}?callback=JSON_CALLBACK",getNumber:function(a){return a.data.forks_count}},clickUrl:"https://github.com/{user}/{repository}/"};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-github ng-social-github-forks"),e&&(a.urlOptions={user:d.user,repository:d.repository},b.options=a,b.ctrl=e,e.init(b,c,a))}}}),angular.module("ngSocial").directive("ngSocialGithub",function(){var a={counter:{url:"https://api.github.com/repos/{user}/{repository}?callback=JSON_CALLBACK",getNumber:function(a){return a.data.watchers_count}},clickUrl:"https://github.com/{user}/{repository}/"};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',controller:function(){},link:function(b,c,d,e){c.addClass("ng-social-github"),e&&(a.urlOptions={user:d.user,repository:d.repository},b.options=a,b.ctrl=e,e.init(b,c,a))}}}),app.directive("ngSocialStumbleupon",["$parse",function(a){"use strict";var b={counter:{url:"{proxy}?url={url}&type=stumbleupon&callback=JSON_CALLBACK",getNumber:function(a){return a.count}},popup:{url:"http://www.stumbleupon.com/submit?url={url}&title={title}",width:800,height:600},track:{name:"StumbleUpon",action:"share"}};return{restrict:"C",require:"^?ngSocialButtons",scope:!0,replace:!0,transclude:!0,template:'
  • {{ count }}
  • ',link:function(c,d,e,f){if(d.addClass("ng-social-google-plus"),f){var g=a(e.proxyUrl)(c)||"/proxy.php";b.counter.url=b.counter.url.replace("{proxy}",g),c.options=b,c.ctrl=f,f.init(c,d,b)}}}}]),angular.module("ngSocial").run(["$templateCache",function(a){a.put("/views/buttons.html",'
    ')}]); /* //@ sourceMappingURL=angular-social.map */ \ No newline at end of file diff --git a/angular-social.map b/angular-social.map index 3efd81b..108a774 100644 --- a/angular-social.map +++ b/angular-social.map @@ -1 +1 @@ -{"version":3,"file":"angular-social.js","sources":["angular-social.src.js"],"names":["template","tmpl","context","filter","replace","m","key","app","angular","module","directive","$compile","$q","$parse","$http","$location","restrict","scope","url","title","description","image","transclude","controller","$scope","getUrl","absUrl","ctrl","init","element","options","counter","count","getCount","link","urlOptions","makeUrl","clickUrl","popup","clickShare","e","shiftKey","ctrlKey","preventDefault","track","isArray","_gaq","push","name","action","process","isFunction","click","call","this","openPopup","params","left","Math","round","screen","width","top","height","win","window","open","service","focus","location","href","def","defer","get","jsonp","success","res","getNumber","resolve","promise","encodeURIComponent","data","total_count","require","attrs","addClass","test","pageTitle","proxyUrl","jsonUrl","deferred","_","VK","Share","idx","number","index","length","hasOwnProperty","shares","forks_count","user","repository","watchers_count","run","$templateCache","put"],"mappings":"AAAA,QAASA,UAASC,EAAMC,EAASC,GAC7B,YAEA,OAAOF,GAAKG,QAAQ,gBAAiB,SAAUC,EAAGC,GAE9C,MAAOA,KAAOJ,GAAWC,EAASA,EAAOD,EAAQI,IAAQJ,EAAQI,GAAQD,IAIjF,GAAIE,KAAMC,QAAQC,OAAO,cAEzBF,KAAIG,UAAU,mBAAoB,WAAY,KAAM,SAAU,QAAS,YACnE,SAAUC,EAAUC,EAAIC,EAAQC,EAAOC,GACnC,YAEA,QACIC,SAAU,IACVC,OACIC,IAAO,IACPC,MAAS,IACTC,YAAe,IACfC,MAAS,KAEbjB,SAAS,EACTkB,YAAY,EACZtB,SAAU,4FACVuB,YAAa,SAAU,KAAM,QAAS,SAAUC,EAAQZ,EAAIE,GACxD,GAAIW,GAAS,WACT,MAAOD,GAAON,KAAOH,EAAUW,UAE/BC,GACAC,KAAM,SAAUX,EAAOY,EAASC,GACxBA,EAAQC,UACRd,EAAMe,MAAQL,EAAKM,SAAShB,EAAMa,WAG1CI,KAAM,SAAUJ,GACZA,EAAUA,KACV,IAAIK,GAAaL,EAAQK,cAKzB,OAJAA,GAAWjB,IAAMO,IACjBU,EAAWhB,MAAQK,EAAOL,MAC1BgB,EAAWd,MAAQG,EAAOH,MAC1Bc,EAAWf,YAAcI,EAAOJ,aAAe,GACxCO,EAAK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AS,oBACTlE,OAAO,EACPb,SAAS,EACTkB,YAAY,EACZtB,SAAU,saAOVkC,KAAM,SAAUjB,EAAOY,EAASuD,EAAOzD,GAEnC,GADAE,EAAQwD,SAAS,yBACZ1D,EAAL,CAGA,GAAI6D,GAAW3E,EAAOuE,EAAMI,UAAUvE,IAAU,YAChDa,GAAQC,QAAQb,IAAMY,EAAQC,QAAQb,IAAId,QAAQ,UAAWoF,GAC7DvE,EAAMa,QAAUA,EAChBb,EAAMU,KAAOA,EACbA,EAAKC,KAAKX,EAAOY,EAASC,SAItCtB,QAAQC,OAAO,YAAY+F,KAAK,iBAAkB,SAAUC,GAC3DA,EAAeC,IAAI,sBAAuB"} \ No newline at end of file +{"version":3,"file":"angular-social.js","sources":["angular-social.src.js"],"names":["template","tmpl","context","filter","replace","m","key","app","angular","module","directive","$compile","$q","$parse","$http","$location","restrict","scope","url","title","description","image","transclude","controller","$scope","getUrl","absUrl","ctrl","init","element","options","counter","getCount","then","count","link","urlOptions","makeUrl","clickUrl","popup","clickShare","e","shiftKey","ctrlKey","preventDefault","track","_gaq","isArray","push","name","action","process","isFunction","click","call","this","openPopup","params","left","Math","round","screen","width","top","height","win","window","open","service","focus","location","href","def","defer","get","jsonp","success","res","getNumber","resolve","promise","encodeURIComponent","data","total_count","require","attrs","addClass","test","pageTitle","proxyUrl","jsonUrl","deferred","_","VK","Share","idx","number","index","length","hasOwnProperty","shares","forks_count","user","repository","watchers_count","run","$templateCache","put"],"mappings":"AAAA,QAASA,UAASC,EAAMC,EAASC,GAC7B,YAEA,OAAOF,GAAKG,QAAQ,gBAAiB,SAAUC,EAAGC,GAE9C,MAAOA,KAAOJ,GAAWC,EAASA,EAAOD,EAAQI,IAAQJ,EAAQI,GAAQD,IAIjF,GAAIE,KAAMC,QAAQC,OAAO,cAEzBF,KAAIG,UAAU,mBAAoB,WAAY,KAAM,SAAU,QAAS,YACnE,SAAUC,EAAUC,EAAIC,EAAQC,EAAOC,GACnC,YAEA,QACIC,SAAU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AEd,QACItB,SAAU,IACVoE,QAAS,oBACTnE,OAAO,EACPb,SAAS,EACTkB,YAAY,EACZtB,SAAU,0XAOVuB,WAAY,aAEZY,KAAM,SAASlB,EAAOY,EAASwD,EAAO1D,GAClCE,EAAQyD,SAAS,oBACZ3D,IAGLG,EAAQM,YACJkE,KAAQjB,EAAMiB,KACdC,WAAclB,EAAMkB,YAExBtF,EAAMa,QAAUA,EAChBb,EAAMU,KAAOA,EACbA,EAAKC,KAAKX,EAAOY,EAASC,QAItCvB,IAAIG,UAAU,uBAAwB,SAAU,SAAUG,GACtD,YAEA,IAAIiB,IACAC,SACIb,IAAK,4DACL4D,UAAW,SAAUI,GACjB,MAAOA,GAAKhD,QAGpBK,OACIrB,IAAK,4DACL4C,MAAO,IACPE,OAAQ,KAEZnB,OACII,KAAQ,cACRC,OAAU,SAGlB,QACIlC,SAAU,IACVoE,QAAS,oBACTnE,OAAO,EACPb,SAAS,EACTkB,YAAY,EACZtB,SAAU,saAOVmC,KAAM,SAAUlB,EAAOY,EAASwD,EAAO1D,GAEnC,GADAE,EAAQyD,SAAS,yBACZ3D,EAAL,CAGA,GAAI8D,GAAW5E,EAAOwE,EAAMI,UAAUxE,IAAU,YAChDa,GAAQC,QAAQb,IAAMY,EAAQC,QAAQb,IAAId,QAAQ,UAAWqF,GAC7DxE,EAAMa,QAAUA,EAChBb,EAAMU,KAAOA,EACbA,EAAKC,KAAKX,EAAOY,EAASC,SAItCtB,QAAQC,OAAO,YAAYgG,KAAK,iBAAkB,SAAUC,GAC3DA,EAAeC,IAAI,sBAAuB"} \ No newline at end of file diff --git a/angular-social.src.js b/angular-social.src.js index 65c3a23..8461b1f 100644 --- a/angular-social.src.js +++ b/angular-social.src.js @@ -31,7 +31,9 @@ app.directive('ngSocialButtons', ['$compile', '$q', '$parse', '$http', '$locatio var ctrl = { init: function (scope, element, options) { if (options.counter) { - scope.count = ctrl.getCount(scope.options); + ctrl.getCount(scope.options).then(function(count) { + scope.count = count; + }); } }, link: function (options) { @@ -49,7 +51,7 @@ app.directive('ngSocialButtons', ['$compile', '$q', '$parse', '$http', '$locatio } e.preventDefault(); - if (options.track && angular.isArray(_gaq)) { + if (options.track && typeof _gaq != 'undefined' && angular.isArray(_gaq)) { _gaq.push(['_trackSocial', options.track.name, options.track.action, $scope.url]); } diff --git a/src/scripts/00-directive.js b/src/scripts/00-directive.js index 6348afc..405ad07 100644 --- a/src/scripts/00-directive.js +++ b/src/scripts/00-directive.js @@ -31,7 +31,9 @@ app.directive('ngSocialButtons', ['$compile', '$q', '$parse', '$http', '$locatio var ctrl = { init: function (scope, element, options) { if (options.counter) { - scope.count = ctrl.getCount(scope.options); + ctrl.getCount(scope.options).then(function(count) { + scope.count = count; + }); } }, link: function (options) { @@ -49,7 +51,7 @@ app.directive('ngSocialButtons', ['$compile', '$q', '$parse', '$http', '$locatio } e.preventDefault(); - if (options.track && angular.isArray(_gaq)) { + if (options.track && typeof _gaq != 'undefined' && angular.isArray(_gaq)) { _gaq.push(['_trackSocial', options.track.name, options.track.action, $scope.url]); }