Files
GuideInfrared/编程资料/离线网页资料/001/SaaS、PaaS、IaaS的区别_files/pc_wap_commontools-d5fda285fa.min.js.下载
2026-02-01 21:55:55 +08:00

1 line
5.3 KiB
Plaintext

$(function(){function e(){return!!window.navigator.userAgent.toLowerCase().match(/(csdn)/i)||!!u}function t(e){if(void 0!==typeof e&&null!==e&&""!==e)return e=e.toLowerCase(),class_name="hl-1",class_name}function n(e){return void 0===e||null===e||""===e}function o(e,t){n(t)||(t=t.toLowerCase().replace(/(^\s*)|(\s*$)/g,""),n(t)||(t.indexOf(" ")>0?$.each(t.split(/ +/g),function(t,n){o(e,n)}):"..."!==t&&t.length>1&&"&nbsp;"!==t&&"csdn"!==t&&"||"!==t&&(e[t]=0)))}function i(e){var t={};keyword=e.join(" "),o(t,keyword);var n=Object.keys(t);return n.sort(function(e,t){return t.length-e.length}),n}function r(n,o){for(var i=(o.html(),""),r=o.context.childNodes,a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var c=s.textContent.replace(/</gi,"&lt;"),u=/[\u4e00-\u9fa5]/gi,w=n.map(function(e){return u.test(e)?e:"\\b"+e+"\\b"}),f=new RegExp(w.join("|"),"ig"),h=!1;c=c.replace(f,function(n){var o=n.toLowerCase(),i="https://so.csdn.net/so/search?q="+encodeURIComponent(n)+"&spm=1001.2101.3001.7020";i=e()?"csdnapp://app.csdn.net/search/searchRoot?keyword="+encodeURIComponent(n)+"&t=blog&u="+username+"&from_tracking_code=art_highlight_word&backSearch=true":i;var r=e()?'{"key_word":"'+n+'"}':'{"spm":"1001.2101.3001.7020","dest":"'+i+'","extra":"{\\"searchword\\":\\"'+n+'\\"}"}';return d[o]>=1||l===o||h?n:(h=!0,d[o]=d[o]?d[o]+1:1,l=o,e()?'<a data-href="'+i+'" class="app-hl hl '+t(o)+'" data-track-view='+r+" data-report-click="+r+">"+n+"</a>":'<a href="'+i+'" target="_blank" class="hl '+t(o)+'" data-report-view='+r+" data-report-click="+r+" data-tit="+n+" data-pretit="+l+">"+n+"</a>")}),i+=c}else i+=s.outerHTML?s.outerHTML:""}o[0].innerHTML=i,e()?($(window).on("scroll",function(){p.viewCheck()}),p.viewCheck()):window.csdn.report.viewCheck()}function a(){$("a.app-hl").off("click"),$("a.app-hl").click(function(e){e.preventDefault();var t=$(this).data("href"),n=$(this).attr("data-report-click"),o={trackingInfo:n,trackingCode:"art_highlight_word"},i={url:t};f&&(window.jsCallBackListener.csdntrackevent(JSON.stringify(o)),window.jsCallBackListener.csdnjumpnewpage(JSON.stringify(i))),h&&(window.webkit.messageHandlers.csdntrackevent.postMessage(JSON.stringify(o)),window.webkit.messageHandlers.csdnjumpnewpage.postMessage(JSON.stringify(i)))})}function s(){window.keyword_list_init=!0,$.ajax({type:"GET",url:"https://redisdatarecall.csdn.net/recommend/get_head_word?bid=blog-"+articleId,dataType:"json",timeout:2e3,xhrFields:{withCredentials:!0},success:function(t){if(200==t.status&&t.content){var n=i(t.content),o=t.ext?t.ext:{};if(void 0===n||0===n.length)return;window.keyword_list=n,window.keyword_list_json=o;var s=$("#content_views").find("p,h1,h2,h3,h4,h5,h6");window.keyword_list_doms=s,$.each(s,function(e,t){var t=$(t);r(n,t)}),e()&&a()}}})}var c,d={},l="",u=!!window.isApp&&window.isApp,w=navigator.userAgent,f=w.indexOf("Android")>-1||w.indexOf("Adr")>-1,h=!!w.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),p={scrollTop:function(){return Math.max(document.body.scrollTop,document.documentElement.scrollTop)},windowHeight:function(){return"CSS1Compat"==document.compatMode?document.documentElement.clientHeight:document.body.clientHeight},getElementBottom:function(e){if("undefined"!=typeof jQuery)return $(e).offset().top+$(e).height();var t=e.offsetTop;for(e=e.offsetParent;null!=e;)t+=e.offsetTop,e=e.offsetParent;return t},isView:function(e){var t=this;if(!e)return!1;var n=p.getElementBottom(e),o=n+e.offsetHeight;return t.scrollTop()<n&&n<t.scrollTop()+t.windowHeight()||t.scrollTop()<o&&o<t.scrollTop()+t.windowHeight()},reportView:function(e){console.log("app report exposure",e),f&&(console.log("isAndroid"),window.jsCallBackListener.csdntrackexpo(JSON.stringify(e))),h&&(console.log("isiOS"),window.webkit.messageHandlers.csdntrackexpo.postMessage(JSON.stringify(e)))},viewCheck:function(){clearTimeout(c),c=setTimeout(function(){$("[data-track-view]").each(function(){var e=$(this);if(p.isView(e.get(0))){var t=e.attr("data-track-view"),n={trackingCode:"art_highlight_word",trackingInfo:t};p.reportView(n),e.removeData("trackView"),e.removeAttr("data-track-view")}})},200)}},g=void 0!==window.showHeadWord&&window.showHeadWord;if(g){s();var m=$("#keywordDecBox");m.length&&($(document).on("mouseover","#article_content .hl",function(){var e=$(this).attr("data-tit"),t=$(this).attr("data-pretit"),n=Object(keyword_list_json)[t];if(e&&n){var o=$(this).offset().left,i=$(this).offset().top,r=$(this).outerHeight(!0),a='<span class="tit">'+e+'</span><span class="dec">'+n+"</span>";m.html(a).css({left:o,top:i+r}).show()}}),$(document).on("mouseout","#article_content .hl",function(){m.hide()}),m.on({mouseover:function(){$(this).show()},mouseout:function(){$(this).hide()}}))}}),function(){function e(){return!!window.navigator.userAgent.toLowerCase().match(/(phone|pad|pod|iphone|ipod|ios|ipad|android|mobile|blackberry|iemobile|mqqbrowser|juc|fennec|wosbrowser|browserng|webos|symbian|windows phone)/i)}function t(){return!!window.navigator.userAgent.toLowerCase().match(/(csdn)/i)}function n(){var n=null;n=e()?document.querySelectorAll('[class^="container-fluid container-fluid-flex container-"]'):t()?document.querySelectorAll('[class^="recommend_item type_"]'):document.querySelectorAll('[class^="recommend-item-box type_"]'),null!==n&&n.length<=5&&$.get("https://statistic.csdn.net/blog/recommend?count="+n.length+"&articleId="+articleId)}n()}();