function fixedSidebarInButton(){var h="left";isCorporate&&(h="right");var a=$("main");if(window.location.pathname.indexOf("/column/info/")>0){a=$("#column");var h="left"}window.csdn.fixedSidebar({targetBox:$(".persion_article"),mainBox:a,sidebar:$("aside"),direction:h,position:"fixed",bottom:0,zIndex:99,sidebarRightMargin:8,sidebarLeftMargin:15})}function addLoadEvent(h){var a=window.onload;"function"!=typeof window.onload?window.onload=h:window.onload=function(){a(),h()}}$(function(){var h=$("div.box-box-default"),a=$("div.box-box-large");boxAways=$("div.box-box-aways"),h.find("a.btn-remove").click(function(){h.remove()}),a.find("a.btn-remove").click(function(){a.remove()}),boxAways.find("a.btn-remove").click(function(){boxAways.remove()})}),window.addLoadEvent=window.addLoadEvent?window.addLoadEvent:function(h){var a=window.onload;"function"!=typeof window.onload?window.onload=h:window.onload=function(){a(),h()}},$(function(){function h(){}function a(h){$(h).text("点开这里查看关注").fadeIn(),setTimeout(function(){$(h).fadeOut()},3e3)}h.prototype.animation=function(){if(!currentUserName)return!1;var h=$(this).offset(),l=$(".loginCenter").offset().top,c=$(".loginCenter").offset().left+20,v=h.left+80,z=h.top+20,m=$("#pointDivs .point-pre").first().removeClass("point-pre").css({left:v+"px",top:z+"px"}),t=m.find(".point-inner");setTimeout(function(){m[0].style.webkitTransform="translate3d(0,"+(l-z)+"px,0)",t[0].style.webkitTransform="translate3d("+(c-v)+"px,0,0)",setTimeout(function(){m.removeAttr("style").addClass("point-pre"),t.removeAttr("style"),a(".guo_tip_box")},800)},1)},h.prototype.animationInit=function(){for(var h=$('
').appendTo("body"),a=0;a<5;a++)$('').appendTo(h)},window.CSDNAnimation=h});var __hasProp={}.hasOwnProperty;!function(h){var a,l,c,v;c=this,a=c.jQuery,l={},h(c,l,a),void 0===c.csdn&&(c.csdn=l);for(v in l)__hasProp.call(l,v)&&(c[v]=c.csdn[v]=l[v])}(function(h,a,l){var c,v,z,m,t;if(!(h.CNick instanceof Function&&h.cnick instanceof Function&&(null!=(t=h.csdn)?t.cnick:void 0)instanceof Function))return void 0===String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),m={},v=function(a,l){var c,v;return arguments.length>1?(m[a]=l,null!=(c=h.localStorage)?c["cnick_"+a]=+new Date+","+l:void 0):null!=a?m[a]||function(h){var a,l,c,v;if(null!=h)return c=h.split(","),a=c[0],l=c[1],0<(v=new Date-new Date(parseInt(a,10)))&&1728e5>v?l:void 0}(null!=(v=h.localStorage)?v["cnick_"+a]:void 0):void 0},a.cnick=z=function(a,c,z){var m,t,s,i,p,d,V,o,F,e;for(null==a&&(a="a.user_name"),null==c&&(c=h.document),null==z&&(z=!1),t=l(a,c).filter(function(){return z||null==l(this).data("orig_username")}).data("orig_username",""),p={},F=0,e=t.length;e>F;F++)m=t[F],V=m.innerHTML.trim(),null!=(d=v(V))?l(m).data("orig_username",V).text(d):(i=p.hasOwnProperty(V)?p[V]:p[V]=[],i.push(m));for(o=function(){var h;h=[];for(s in p)__hasProp.call(p,s)&&h.push(s);return h}();o.length>0;)l.getJSON("https://passport.csdn.net/get/nick?callback=?",{users:o.splice(0,100).join()},function(h){var a,c,z,m,t;if(c=h.status,a=h.data,c&&a)for(z=0,m=a.length;m>z;z++)t=a[z],V=t.u,s=t.n,"null"===s&&(s=V),l(p[V]).data("orig_username",V).text(function(h,a){return s||a}),v(V,s)})},l(function(){return z()}),h.CNick=c=function(){function h(h){this.selector=h}return h.prototype.showNickname=function(){return z(this.selector)},h}()}),function(h){function a(){var h,a;h=document.createElement("div"),h.innerHTML=l,l=null,a=h.getElementsByTagName("svg")[0],a&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",t(a,document.body))}var l='',c=function(){
var h=document.getElementsByTagName("script");return h[h.length-1]}(),v=c.getAttribute("data-injectcss"),z=function(a){function l(h,a){var l=h.document,c=!1,v=function(){c||(c=!0,a())},z=function(){try{l.documentElement.doScroll("left")}catch(h){return void setTimeout(z,50)}v()};z(),l.onreadystatechange=function(){"complete"==l.readyState&&(l.onreadystatechange=null,v())}}if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(a,0);else{var c=function(){document.removeEventListener("DOMContentLoaded",c,!1),a()};document.addEventListener("DOMContentLoaded",c,!1)}else document.attachEvent&&l(h,a)},m=function(h,a){a.parentNode.insertBefore(h,a)},t=function(h,a){a.firstChild?m(h,a.firstChild):a.appendChild(h)};if(v&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(s){console&&console.log(s)}}z(a)}(window),addLoadEvent(fixedSidebarInButton),$(function(){function h(){var h=document.cookie.match(new RegExp("(^| )UserName=([^;]*)(;|$)"));return h?h[2]:""}function a(h){$("#fan").text().indexOf("+")<0?$("#fan").text(parseInt($("#fan").text())+h):$("#fanBox").attr("title",parseInt($("#fanBox").attr("title"))+h)}function l(h){var l="//my.csdn.net/index.php/follow/check_is_followed/"+encodeURIComponent(h)+"/"+encodeURIComponent(username)+"?jsonpcallback=?";$.getJSON(l,{},function(h){1==h.succ&&1==h.info&&($("#btnAttent").addClass("attented").text("已关注").removeClass("btn-red-hollow").addClass("btn-gray-hollow"),a(1))},"json")}function c(h){var a=h.hasClass("attented");a?z(h):v(h)}function v(h){var l="//my.csdn.net/index.php/follow/do_follow";$.ajax({type:"POST",url:l,data:{username:username},xhrFields:{withCredentials:!0},success:function(l){if(l="object"!=typeof l?JSON.parse(l):l,101==l.succ)h.addClass("attented").text("已关注").removeClass("btn-red-hollow").addClass("btn-gray-hollow attented"),a(1);else{if(102==l.succ)return window.csdn.loginBox.show(),!1;1==l.succ?(h.addClass("attented").text("已关注").removeClass("btn-red-hollow").addClass("btn-gray-hollow attented"),a(1),m.animation.call(h)):alert(l.msg)}}})}function z(h){var l="//my.csdn.net/index.php/follow/do_unfollow?jsonpcallback=?";$.getJSON(l,{username:username},function(l){1==l.succ?(h.text("关注").addClass("btn-red-hollow").removeClass("btn-gray-hollow attented"),a(-1)):console.error(l.msg)})}var m=new window.CSDNAnimation;m.animationInit(),$("#btnAttent").click(function(h){c($(this))}),l(h())}),$(function(){$("#csdnc-memberhead").fadeIn(500)});