You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
8.8 KiB
JavaScript
1 line
8.8 KiB
JavaScript
|
2 years ago
|
"use strict";!function(e,s,n){var t="https://g.csdnimg.cn/user-tooltip/2.4/",i={company:"<img src="+t+"images/icon-company.png />",domainGrey:"<img src="+t+"images/icon-domain-grey.png />",domain:"<img src="+t+"images/icon-domain.png />",vip:"<img src="+t+"images/icon-vip.png />",writer:"<img src="+t+"images/icon-writer.png />"},a={getUserProfileUrl:"https://me.csdn.net/api/external/user/getUserProfile",checkFollowUrl:"https://me.csdn.net/api/relation/check",doFollowUrl:"https://me.csdn.net/api/relation/create",doUnfollowUrl:"https://me.csdn.net/api/relation/destroy",ref:"miniprofile",defaultUserProfile:{username:"yanlinpu",avatarurl:"https://profile.csdnimg.cn/1/1/B/1_yanlinpu",vip:!1,expert:!1,nickname:"木林森001",fans_num:"2万",identity:[{name:"专家"},{name:"版主"}],medal:[{type:"203",codename:"111",image:"https://g.csdnimg.cn/static/user-medal/1024huodong.svg"}]}};if(void 0===e.csdn&&(e.csdn={}),!jQuery)return!1;!function(e){var n=s.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,s.getElementsByTagName("head")[0].appendChild(n)}(t+"user-tooltip.css"),e.csdn.userTooltip=function(t){function o(){v[m].flag&&(n("#csdn-userTooltip .person_deliver").mouseover(function(){n(this).hasClass("person_deliver_letter")&&n(this).html("取 消")}),n("#csdn-userTooltip .person_deliver").mouseout(function(){n(this).hasClass("person_deliver_letter")&&n(this).html("已关注")})),n("#csdn-userTooltip .person_deliver").click(function(){var s,t;if(y){var i=n(this);if(0==v[m].flag){if(!i.hasClass("person_deliver_letter_un"))return!1;s=a.doFollowUrl,n.ajax({type:"post",url:s,dataType:"json",xhrFields:{withCredentials:!0},crossDomain:!0,data:JSON.stringify({username:m}),success:function(s){200==parseInt(s.code)&&(i.html("已关注").removeClass("person_deliver_letter_un").addClass("person_deliver_letter"),i.mouseover(function(){i.html("取 消")}),i.mouseout(function(){i.html("已关注")})),e.csdn&&e.csdn.watchBtnChange&&e.csdn.watchBtnChange(1,m),v[m].flag=!0,v[m].followClass="person_deliver person_deliver_letter",v[m].followStr="已关注"}})}else t=a.doUnfollowUrl,n.ajax({type:"post",url:t,xhrFields:{withCredentials:!0},crossDomain:!0,data:JSON.stringify({username:m}),dataType:"json",success:function(s){200==parseInt(s.code)&&(i.html("关注").removeClass("person_deliver_letter").addClass("person_deliver_letter_un"),i.unbind("mouseover"),i.unbind("mouseout")),e.csdn&&e.csdn.watchBtnChange&&e.csdn.watchBtnChange(0,m),v[m].flag=!1,v[m].followClass="person_deliver person_deliver_letter_un",v[m].followStr="关注"}})}else e.location.href="https://passport.csdn.net/"})}function r(e){var s,n=e.offset(),t=n.left,i=n.top,a=e.width(),o=e.height(),r=e[0].getBoundingClientRect(),l={};return r&&Number(r.top,10)<162?(s="left:"+(t-50+a/2)+"px;top:"+(i+o+15)+"px",l.isBottom=!0):(s="left:-999999999px;top:"+(i-165)+"px",l.realPos={left:t-50+a/2,top:i}),l.position=s,l}function l(){n("#csdn-userTooltip").remove()}t&&n.extend(a,t);var c,d,p,m,u,f,h={},v={},g="",_=!1,w='<svg id="csdnc-m-blank" viewBox="0 0 1024 1024" width="100%" height="100%" fill="#ccc"><path d="M516.266311 77.945505a8.788601 8.788601 0 0 0-8.532622 0L121.461878 292.455629a8.319307 8.319307 0 0 0-4.351637 7.252729v424.583284c0 2.986418 1.663861 5.75952 4.351637 7.252729l386.271811 214.510124a8.788601 8.788601 0 0 0 8.532622 0l386.271811-214.510124a8.319307 8.319307 0 0 0 4.351637-7.252729V299.708358a8.319307 8.319307 0 0 0-4.351637-7.252729L516.266311 77.945505z m37.671528-67.066412l386.314473 214.552788a85.027581 85.027581 0 0 1 43.900342 74.276477v424.583284c0 30.802766-16.809266 59.216399-43.943005 74.276477l-386.27181 214.552788c-26.024498 14.462795-57.808516 14.462795-83.875678 0l-386.314473-214.552788a85.027581 85.027581 0 0 1-43.900342-74.276477V299.708358c0-30.802766 16.809266-59.216399 43.943005-74.276477L470.019498 10.879093c26.024498-14.462795 57.808516-14.462795 83.875677 0z"></path></svg>';s.domain="csdn.net";var y=function(e){for(var n=s.cookie.split("; "),t=0;t<n.length;t++){var i=n[t].split("=");if(i[0]==e&&"UD"
|