You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
599 KiB

5 years ago
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=$('<div id="pointDivs"></div>').appendTo("body"),a=0;a<5;a++)$('<div class="point-outer point-pre"><div class="point-inner"/></div></div>').appendTo(h)},window.CSDNAnimation=h}),!function(h){var a,l='<svg><symbol id="csdnc-zhifubao" viewBox="0 0 1756 1024"><path d="M1002.928571 659.892857c-85.285714 102.392857-173.5 165-307.214286 165s-221.892857-82.5-210.5-182c5.714286-65.392857 51.214286-173.5 247.5-156.392857 102.392857 8.5 150.785714 28.392857 236.107143 56.892857 22.785714-39.785714 39.785714-85.285714 54-130.785714L647.321429 412.607143l0-37 184.892857 0L832.214286 310 607.5 310 607.5 267.285714l224.714286 0L832.214286 170.607143c0 0 2.785714-14.214286 19.892857-14.214286l93.892857 0 0 110.892857 238.892857 0 0 39.785714-241.785714 0L943.107143 372.5l196.285714 0c-17.107143 74-45.5 142.214286-79.607143 199.107143 48.392857 17.107143 244.607143 76.785714 301.5 93.892857L1361.285714 167.785714c0-79.607143-65.392857-142.214286-142.214286-142.214286L533.607143 25.571429c-79.714286 0-142.285714 65.392857-142.285714 142.214286l0 688.392857c0 79.607143 65.392857 142.214286 142.214286 142.214286l688.392857 0c79.607143 0 142.214286-65.392857 142.214286-142.214286l0-34.214286C1315.714286 799.285714 1099.607143 705.392857 1002.928571 659.892857zM525 634.285714c-8.5 37 14.214286 125.214286 156.392857 125.214286 85.285714 0 170.714286-54 238.892857-142.214286-96.714286-48.392857-176.392857-71.107143-267.392857-71.107143C573.321429 549 533.5 597.285714 525 634.285714z" ></path></symbol><symbol id="csdnc-alevel-3" viewBox="0 0 3072 1024"><path d="M372.99884256 80.14660493h2375.19367285a107.96334877 107.96334877 0 0 1 107.96334876 107.96334877v647.7800926a107.96334877 107.96334877 0 0 1-107.96334876 107.96334877H372.99884256a107.96334877 107.96334877 0 0 1-107.96334877-107.96334877V188.1099537a107.96334877 107.96334877 0 0 1 107.96334877-107.96334877z" fill="#83B53A" ></path><path d="M1938.46739967 134.12827933h809.72511574a53.98167438 53.98167438 0 0 1 53.98167437 53.98167437v647.7800926a53.98167438 53.98167438 0 0 1-53.98167437 53.98167437H1938.46739967V134.12827933z" fill="#2D5315" ></path><path d="M2547.65059507 392.16068286v77.73361112c0 10.41846315-1.78139526 19.43340277-5.39816744 26.9908372 13.65736361 14.41310706 20.51303627 31.30937114 20.51303627 50.74277391v84.21141205c0 20.51303627-7.17956269 38.05708044-21.59266976 52.63213251s-31.84918789 21.86257812-52.36222415 21.86257812h-236.43973378c-
if(c&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(a){console&&console.log(a)}}!function(a){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(a,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),a()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(c=a,v=h.document,z=!1,m=function(){z||(z=!0,c())},(t=function(){try{v.documentElement.doScroll("left")}catch(h){return void setTimeout(t,50)}m()})(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,m())});var c,v,z,m,t}(function(){var h,a,c,v,z,m;(h=document.createElement("div")).innerHTML=l,l=null,(a=h.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",c=a,(v=document.body).firstChild?(z=c,(m=v.firstChild).parentNode.insertBefore(z,m)):v.appendChild(c))})}(window),(isCorporate||"undefined"==typeof articleId||$(window).width()<1537)&&addLoadEvent(fixedSidebarInButton),window.leftFixedSide?window.leftFixedSide:window.leftFixedSide={},window.leftFixedSide.fixedSidebarInButton=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(){function h(h){var a=document.createElement("div");void 0!=a.textContent?a.textContent=h:a.innerText=h;var l=a.innerHTML;return a=null,l}function a(h){var a="";return 0==h.length?"":(a=h.replace(/</g,"&lt;"),a=a.replace(/>/g,"&gt;"))}window.csdn?window.csdn:window.csdn={},window.csdn.htmlEncode_inner=h,window.csdn.htmlEncode_Escape=a}(),$(function(){$("#csdnc-memberhead").fadeIn(500)});