/*! Social Likes v2.0.7 by Artem Sapegin - http://sapegin.github.com/social-likes - Licensed MIT */ (function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){"use strict";function e(t){this.container=t,this.init()}function i(e,i){this.widget=e,this.options=t.extend({},i),this.detectService(),this.service&&this.init()}function n(t,e){return o(t,e,encodeURIComponent)}function o(t,e,i){return t.replace(/\{([^\}]+)\}/g,function(t,n){return n in e?i?i(e[n]):e[n]:t})}function r(t,e){var i=u+t;return i+" "+i+"_"+e}function s(e){function i(r){"keydown"===r.type&&27!==r.which||t(r.target).closest(e).length||(e.fadeOut(l),n.off(o,i))}var n=t(document),o="click touchstart keydown";n.on(o,i)}function a(t,e){if(document.documentElement.getBoundingClientRect){var i=parseInt(t.css("left"),10),n=parseInt(t.css("top"),10);t.css("visibility","hidden").show();var o=t[0].getBoundingClientRect();e>o.left?t.css("left",e-o.left+i):o.right>window.innerWidth-e&&t.css("left",window.innerWidth-o.right-e+i),e>o.top?t.css("top",e-o.top+n):o.bottom>window.innerHeight-e&&t.css("top",window.innerHeight-o.bottom-e+n),t.hide().css("visibility","visible")}t.fadeIn(l)}var u="social-likes__",l="fast",c={facebook:{counterUrl:"http://graph.facebook.com/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url%3D%22{url}%22&callback=?",convertNumber:function(t){return t.data[0].total_count},popupUrl:"http://www.facebook.com/sharer/sharer.php?u={url}",popupWidth:600,popupHeight:500},twitter:{counterUrl:"http://urls.api.twitter.com/1/urls/count.json?url={url}&callback=?",convertNumber:function(t){return t.count},popupUrl:"http://twitter.com/intent/tweet?url={url}&text={title}",popupWidth:600,popupHeight:450,click:function(){return/[\.:\-–—]\s*$/.test(this.options.pageTitle)||(this.options.pageTitle+=":"),!0}},mailru:{counterUrl:"http://connect.mail.ru/share_count?url_list={url}&callback=1&func=?",convertNumber:function(t){for(var e in t)if(t.hasOwnProperty(e))return t[e].shares},popupUrl:"http://connect.mail.ru/share?share_url={url}&title={title}",popupWidth:550,popupHeight:360},vkontakte:{counterUrl:"http://vkontakte.ru/share.php?act=count&url={url}&index={index}",counter:function(e,i){var o=c.vkontakte;o._||(o._=[],window.VK||(window.VK={}),window.VK.Share={count:function(t,e){o._[t].resolve(e)}});var r=o._.length;o._.push(i),t.ajax({url:n(e,{index:r}),dataType:"jsonp"})},popupUrl:"http://vk.com/share.php?url={url}&title={title}",popupWidth:550,popupHeight:330},odnoklassniki:{counterUrl:"http://www.odnoklassniki.ru/dk?st.cmd=shareData&ref={url}&cb=?",convertNumber:function(t){return t.count},popupUrl:"http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl={url}",popupWidth:550,popupHeight:360},plusone:{popupUrl:"https://plus.google.com/share?url={url}",popupWidth:700,popupHeight:500},livejournal:{click:function(){var e=this._livejournalForm;if(!e){var i=this.options.pageHtml.replace(/&/g,"&").replace(/"/g,""");e=t(o('
',{title:this.options.pageTitle,html:i})),this.widget.append(e),this._livejournalForm=e}e.submit()}},pinterest:{counterUrl:"http://api.pinterest.com/v1/urls/count.json?url={url}&callback=?",convertNumber:function(t){return t.count},popupUrl:"http://pinterest.com/pin/create/button/?url={url}&description={title}",popupWidth:630,popupHeight:270}},p={promises:{},fetch:function(e,i,o){p.promises[e]||(p.promises[e]={});var r=p.promises[e];if(r[i])return r[i];var s=t.extend({},c[e],o),a=t.Deferred(),u=s.counterUrl&&n(s.counterUrl,{url:i});return t.isFunction(s.counter)?s.counter(u,a):s.counterUrl&&t.getJSON(u).done(function(e){try{var i=e;t.isFunction(s.convertNumber)&&(i=s.convertNumber(e)),a.resolve(i)}catch(n){a.reject(n)}}),r[i]=a.promise(),r[i]}};t.fn.socialLikes=function(){return this.each(function(){new e(t(this))})},e.prototype={optionsMap:{pageUrl:{attr:"url",defaultValue:function(){return window.location.href.replace(window.location.hash,"")}},pageTitle:{attr:"title",defaultValue:function(){return document.title}},pageHtml:{attr:"html",defaultValue:function(){return''+this.options.pageTitle+""}},pageCounters:{attr:"counters",defaultValue:"yes",convert:function(t){return"yes"===t}}},init:function(){this.container.addClass("social-likes"),this.readOptions(),this.single=this.container.hasClass("social-likes_single"),this.initUserButtons(),this.single&&(this.makeSingleButton(),this.container.on("counter.social-likes",t.proxy(this.updateCounter,this)));var e=this.options;this.container.find("li").each(function(){new i(t(this),e)})},readOptions:function(){this.options={};for(var e in this.optionsMap){var i=this.optionsMap[e];this.options[e]=this.container.data(i.attr)||(t.isFunction(i.defaultValue)?t.proxy(i.defaultValue,this)():i.defaultValue),t.isFunction(i.convert)&&(this.options[e]=i.convert(this.options[e]))}},initUserButtons:function(){!this.userButtonInited&&window.socialLikesButtons&&t.extend(c,socialLikesButtons),this.userButtonInited=!0},makeSingleButton:function(){var e=this.container;e.addClass("social-likes_vertical"),e.wrap(t("