-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsoc.min.js
1 lines (1 loc) · 1.71 KB
/
soc.min.js
1
!function(a){"use strict";function b(a){for(var b in h)i[b]=a.getAttribute("data-"+b)?a.getAttribute("data-"+b):h[b]}function c(a){for(var b=0;b<a.length;b++)d(a[b]);a[a.length-1].className+=" soc-icon-last"}function d(a){a.setAttribute("style","");var b=parseInt(i.size.replace("px",""));"auto"==i.radius&&(i.radius=.15*b+"px"),"circle"==i.radius&&(i.radius=.5*b+"px"),a.style.borderRadius=i.radius,a.style.MozBorderRadius=i.radius,a.style.WebkitBorderRadius=i.radius,a.style.width=i.size,a.style.height=i.size,a.style.fontSize=.55*b+"px",a.style.lineHeight=i.size,a.style.marginRight=i.spacing,"auto"!=i.buttoncolor&&(a.style.backgroundColor=i.buttoncolor),a.style.color=i.iconcolor}function e(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}function f(){var a=document.getElementsByTagName("head")[0],b=document.createElement("style");b.type="text/css",b.styleSheet.cssText=":before{content:none !important",a.appendChild(b),setTimeout(function(){a.removeChild(b)},0)}function g(){this.init()}var h={size:"30px",radius:"auto",spacing:"10px",iconcolor:"#fff",buttoncolor:"auto"},i={};document.getElementsByClassName||(document.getElementsByClassName=function(a){for(var b=[],c=document.getElementsByTagName("*"),d=new RegExp("(^|s)"+a+"(s|$)"),e=0;e<c.length;e++)d.test(c[e].className)&&b.push(c[e]);return b}),g.prototype={init:function(){var b=this;a.onload=function(){"8"==e()&&f(),b.render()}},render:function(){this.iconSets=document.getElementsByClassName("soc");for(var a=0;a<this.iconSets.length;a++)b(this.iconSets[a]),c(this.iconSets[a].getElementsByTagName("a"))}},a.Soc=g}(window);var soc=new Soc;