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.
4 lines
120 KiB
4 lines
120 KiB
5 years ago
|
function setCopyBtn(){$(".CopyToClipboard").each(function(){var t=new ZeroClipboard.Client;t.setHandCursor(!0),t.addEventListener("load",function(t){}),t.addEventListener("mouseOver",function(t){var e=t.movie.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.innerHTML;e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),t.setText(e)}),t.addEventListener("complete",function(t,e){alert("代码已经复制到你的剪贴板。")}),t.glue(this,this.parentNode)})}function m_over_m(t,e){__mm_over=!0,showMedalInfo(t.target,e)}function m_out_m(){__mm_over=!1,hideMedalInfo()}function showMedalInfo(t,e){__mm_intro&&(document.body.removeChild(__mm_intro),__mm_intro=null);var i="",n=$(t).attr("src"),o="",s="";n.indexOf("zhuanlandaren")>-1?(o="专栏达人",s="授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!"):n.indexOf("chizhiyiheng")>-1?(o="持之以恒",s="授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!"):n.indexOf("weiruanmvp")>-1?(o="微软MVP",s="授予通过CSDN博客平台积极分享微软相关技术知识和专业技能,并做出突出贡献的用户。"):n.indexOf("bokezhixing")>-1&&(o="博客之星",s='授予通过"CSDN博客之星评选"中脱颖而出的十大博客之星称号的用户。'),i+="<div style=' z-index:99999 ; left: 15%; top: -9px; position: absolute; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 8px solid #EAEAEA; '></div>",i+="<dl onmouseover='__mm_over=true;' onmouseout='m_out_m();'>",i+="<dt><img src='"+n.replace(".png","")+"middle.png' /></dt>",i+="<dd><strong>"+o+"</strong>"+s+"</dd>",i+="</dl>",__mm_intro=document.createElement("div"),__mm_intro.className="medal_intro";var a=$(t).position(),r=a.left-46;r<0&&(r=0),__mm_intro.style.left=r+"px",__mm_intro.style.top=a.top+32+4+"px",__mm_intro.innerHTML=i,document.body.appendChild(__mm_intro)}function hideMedalInfo(){setTimeout(function(){!__mm_over&&__mm_intro&&(document.body.removeChild(__mm_intro),__mm_intro=null)},500)}function computePos(){"object"==typeof toolBar&&(toolBar.setPosX(),toolBar.computePositon())}function baidudatatemp(t){var e=new RegExp("("+highlight.join("|")+")","gi"),i=/<[^>]*>/g,n=t["abstract"].replace(i,""),o=t.dispTime.replace(/^(\d*)-/,""),s=t.linkUrl,a=t.title.replace(i,"").replace(e,"<em>$1</em>"),r='<div class="recommend-item-box baiduSearch" data-track-view=\'{"mod":"popu_'+("skin3-template"==curSkin?"387":"614")+'","con":",'+s+',searchFromBaidu1"}\' data-track-click=\'{"mod":"popu_'+("skin3-template"==curSkin?"387":"614")+'","con":",'+s+',searchFromBaidu1"}\'> <a href="'+s+'" target="_blank"> \t\t<h4 class="text-truncate oneline">'+a+'</h4> <div class="info-box d-flex align-content-center"> <p> <span class="date">'+o+'</span> </p> </div> \t\t<p class="content oneline">'+n+"</p> </a> \t</div>";return r}function trackByGraylog(t,e){var i=window.location.protocol+"//statistic.csdn.net/";$.get(i+t,e)}function remoteData(){var t=function(){window.csdn.isRunBaidu||(showResult(),window.csdn.isRunBaidu=void 0)};baiduKey?(csdn.afterCasInit=function(e,i){return e?void csdn.baiduSearch(e,function(e){needInsertBaidu?(window.csdn.isRunBaidu=!0,showResult(e)):t()}):(t(),!1)},csdn.baiduSearchInstallError=t):showResult()}function trackAddblogKey(t,e,i,n){var o=/("con"\:)"(.*)"/;t=t.replace(o,function(t,e,n){return e+'"'+n+",index_"+i+'"'}),e.dataset[n]=t}function trackAddBaiduKey(t,e){var i=$(t).attr("data-track-view"),n=$(t).attr("data-track-click");return e+=1,i&&(i=JSON.parse(i),i.con=i.con+"_"+e+",-",i=JSON.stringify(i)),n&&(n=JSON.parse(n),n.con=n.con+"_"+e+",-",n=JSON.stringify(n)),t=$(t).get(0),t.dataset.trackView=
|
||
|
this},save:function(){return this._saved=s(this),delete this._saved._saved,this},update:function(t){return o(t,function(t,e){this._saved[e]=this[e],this[e]=t},this),this},transition:function(t,e){return o(t,function(t,i){this[i]=(t-this._saved[i])*e+this._saved[i]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return m(this.value)}}),i.Element.extend=c,i.Point=i.Element.extend({display:!0,inRange:function(t,e){var i=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(e-this.y,2)<Math.pow(i,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),i.Arc=i.Element.extend({inRange:function(t,e){var i=n.getAngleFromPoint(this,{x:t,y:e}),o=i.angle>=this.startAngle&&i.angle<=this.endAngle,s=i.distance>=this.innerRadius&&i.distance<=this.outerRadius;return o&&s},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,e=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*e,y:this.y+Math.sin(t)*e}},draw:function(t){var e=this.ctx;e.beginPath(),e.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),e.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),e.closePath(),e.strokeStyle=this.strokeColor,e.lineWidth=this.strokeWidth,e.fillStyle=this.fillColor,e.fill(),e.lineJoin="bevel",this.showStroke&&e.stroke()}}),i.Rectangle=i.Element.extend({draw:function(){var t=this.ctx,e=this.width/2,i=this.x-e,n=this.x+e,o=this.base-(this.base-this.y),s=this.strokeWidth/2;this.showStroke&&(i+=s,n-=s,o+=s),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(i,this.base),t.lineTo(i,o),t.lineTo(n,o),t.lineTo(n,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,e){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&e>=this.y&&e<=this.base}}),i.Tooltip=i.Element.extend({draw:function(){var t=this.chart.ctx;t.font=R(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var e=this.caretPadding=2,i=t.measureText(this.text).width+2*this.xPadding,n=this.fontSize+2*this.yPadding,o=n+this.caretHeight+e;this.x+i/2>this.chart.width?this.xAlign="left":this.x-i/2<0&&(this.xAlign="right"),this.y-o<0&&(this.yAlign="below");var s=this.x-i/2,a=this.y-o;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-e),t.lineTo(this.x+this.caretHeight,this.y-(e+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(e+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+e+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+e),t.lineTo(this.x+this.caretHeight,this.y+e+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+e+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":s=this.x-i+(this.cornerRadius+this.caretHeight);break;case"right":s=this.x-(this.cornerRadius+this.caretHeight)}M(t,s,a,i,n,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,s+i/2,a+n/2)}}}),i.MultiTooltip=i.Element.extend({initialize:function(){this.font=R(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=R(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,e=A(this.ctx,this.font,this.labels)+this.fontSize+3,i=f([e,t]);this.width=i+2*this.xPadding;var n=this.height/2;this.y-n<0?this.y=n:this.y+n>this.chart.height&&(this.y=this.chart.height-n),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var e=this.y-this.height/2+this.yPadding,i=t-1;return 0===t?e+this.titleFontSize/
|
||
|
},initialize:function(t){this.PointClass=e.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&i.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),i.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),i.each(t.datasets,function(e){var n={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,pointColor:e.pointColor,pointStrokeColor:e.pointStrokeColor,points:[]};this.datasets.push(n),i.each(e.data,function(i,o){var s;this.scale.animation||(s=this.scale.getPointPosition(o,this.scale.calculateCenterOffset(i))),n.points.push(new this.PointClass({value:i,label:t.labels[o],datasetLabel:e.label,x:this.options.animation?this.scale.xCenter:s.x,y:this.options.animation?this.scale.yCenter:s.y,strokeColor:e.pointStrokeColor,fillColor:e.pointColor,highlightFill:e.pointHighlightFill||e.pointColor,highlightStroke:e.pointHighlightStroke||e.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){i.each(this.datasets,function(e){i.each(e.points,t,this)},this)},getPointsAtEvent:function(t){var e=i.getRelativePosition(t),n=i.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},e),o=2*Math.PI/this.scale.valuesCount,s=Math.round((n.angle-1.5*Math.PI)/o),a=[];return(s>=this.scale.valuesCount||s<0)&&(s=0),n.distance<=this.scale.drawingArea&&i.each(this.datasets,function(t){a.push(t.points[s])}),a},buildScale:function(t){this.scale=new e.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var e=function(){var e=[];return i.each(t,function(t){t.data?e=e.concat(t.data):i.each(t.points,function(t){e.push(t.value)})}),e}(),n=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:i.calculateScaleRange(e,i.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);i.extend(this.scale,n)},addData:function(t,e){this.scale.valuesCount++,i.each(t,function(t,i){var n=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[i].points.push(new this.PointClass({value:t,label:e,x:n.x,y:n.y,strokeColor:this.datasets[i].pointStrokeColor,fillColor:this.datasets[i].pointColor}))},this),this.scale.labels.push(e),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),i.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(functi
|
||
|
var n="_"+Math.random().toString(36).slice(2);$(e).before('<div class="right-item" id="'+n+'"></div>'),(window.slotbydup=window.slotbydup||[]).push({id:i,container:n,display:"inlay-fix",async:!0})}function s(t){var e=document.getElementById(t.id);if(e){e.innerHTML=t.con;for(var i=e.getElementsByTagName("script"),n=i.length,o=0;o<n;){var s=i[o].parentNode,a=document.write;document.write=function(t){s.innerHTML=t};var r=document.createElement("script");r.type="text/javascript",i[o].innerHTML&&(r.innerHTML="setTimeout(function(){"+i[o].innerHTML+"},0)"),i[o].src&&(r.src=i[o].src,r.onerror=r.onload=r.onreadystatechange=function(t){t=t||window.event,r.readyState&&!/loaded|complete/.test(r.readyState)&&"error"!==t||(document.write=a)}),s.appendChild(r),s.removeChild(i[o]),n--,r.onerror=r.onload=r.onreadystatechange=null}}}function a(){$(".recommend-fixed-box").find("li.right-item").eq(6).after('<li id="479"></li>').parent().find("li.right-item").eq(27).after('<li id="480"></li>');var t={type:"GET",xhrFields:{withCredentials:!0},crossDomain:!0},e=Object.create(t);e.url="https://kunpeng.csdn.net/ad/479",e.success=s,l(e);var i=Object.create(t);i.url="https://kunpeng.csdn.net/ad/480",i.success=s,setTimeout(l,1e3,i)}function r(t){if(!isShowAds)return!1;if("string"==typeof t)return a(),!1;for(var e=$(".right-item"),i=0;i<e.length;i++){var n=e[i];S[i]&&(S[i].loginFun&¤tUserName&&(S[i].fun=S[i].loginFun,S[i].id=S[i].loginId),S[i].fun(i,n,S[i].id))}}function l(t){$.ajax(t)}function c(t){var e={};return e.flag=t.type?t.type:"",e.cover_url=t.user_face?t.user_face:t.pic,e.publisher_id=t.publisher_id?t.publisher_id:t.user_name,e.item_read_cnt=t.item_read_cnt?t.item_read_cnt:t.views,e.publish_time=t.publish_time?t.publish_time:t.created_at,e.url=t.url,e.title=t.title,e.item_id=!!t.item_id&&t.item_id,e.context=t.desc?t.desc:!!t.context&&t.context,e.type=!!t.type&&t.type,e}function h(t,e,n,o,s){var t=c(t),a=o?o:{},r="",l="";"download"==t.type&&(r='<span class="download_mark_button ">立即下载 </span>',l="content-width"),t.type!=x||t.cover_url?t.type!=x&&(t.cover_url=!1):t.cover_url="https://csdnimg.cn/release/phoenix/write/assets/book.jpg";var h=!!t.cover_url,d="",u="";h&&(u="h5width",d='<div class="imgbox float-right" ><img src="'+t.cover_url+'" alt="'+t.publisher_id+'"></div>');var p=!!t.item_read_cnt,m="";p&&"boolean"!=typeof a.read&&(m='<span class="read"> <svg class="icon no-active hover-hide" aria-hidden="true"><use xlink:href="#csdnc-m-passwords-visible"></use></svg>'+t.item_read_cnt+" </span>");var f=!!t.publish_time,g="";f&&(g='<span class="time"> '+t.publish_time.replace(/\d*-(\d*-\d*)\s(\d*:\d*):\d*/,"$1")+"</span>");var v=!!t.publisher_id,b="";v&&"boolean"!=typeof a.username&&(b='<span class="name">'+t.publisher_id+"</span>");var w="";t.type===x&&(n=714,w="oneline");var y="";0!=e&&t.type!==x||(y='data-track-view=\'{"mod":"popu_'+n+'","con":",'+t.url+",-,index_"+e+"\"}'");var C='<div class="right-item-desc '+w+'"> '+i(t.context,80)+"</div>";return a.desc&&(C=""),"4p"===s.origin&&(t.title=csdn.htmlEncode_inner(t.title)),'<li class="right-item" '+y+' data-track-click=\'{"mod":"popu_'+n+'","con":"'+encodeURIComponent(t.title)+","+t.url+",-,index_"+e+'"}\'><a href="'+t.url+'" target="_blank"><div class="context-box '+u+'"><div class="content clearfix '+l+'"><h5 class="" title="'+t.title+'">'+i(t.title,56)+"</h5>"+g+m+"</div>"+r+C+"</div>"+d+"</a></li>"}function d(t){var e={};e.notshow=t,e.url=C.url+"requestID="+C.requestID+"&sceneID="+C.sceneID+"&userID="+C.userID,e.type="POST",e.popu=718,e.data=JSON.stringify({itemID:C.itemID,itemTitle:C.itemTitle,page:1}),e.origin="4p",p(e)}function u(){m(),window.leftFixedSide.fixedSidebarInButton()}function p(t){t.success=function(e){var i="",e="object"==typeof e?e:JSON.parse(e);if(t.notshow.desc=!0,3==y&&(i+='<div class="right_recommend_comment"><h5>文章评论</h5><span class="right_recommned_write">写评论</span><div class="right_recommend_comment_content"></div></div>',t.popu=718),(3==y||e.length>0)&&n(!0),e.length>0)for(var o=0;o<35;o++)"object"==typeof e[o]&&(i+=h(e[o],o,t.popu,
|