-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocuK-postProcess-2.3.js
More file actions
63 lines (63 loc) · 28.2 KB
/
docuK-postProcess-2.3.js
File metadata and controls
63 lines (63 loc) · 28.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"use strict";(()=>{(function(e,t){e.version1=".3";let m=t("codeprint.SEE");e.SEEHTMLs=e.SEEHTMLs||[];for(let l=0;l<m.length;l++){let r=m.eq(l),u="";e.SEEHTMLs[l]?u=e.SEEHTMLs[l].trim():u=r.html().trim(),r.html(""),r.after(e.renderToDocuK(u,l))}e.$docuK=t(".docuK"),async function(){e.$toTable=t("data.to-table");for(let l=0;l<e.$toTable.length;l++){const r=e.$toTable.eq(l);r.after(e.arrayToTableHTML(await e.strToJSON(r.html().trim()),r.attr("data-ratio"),r.hasClass("no-escape-HTML")))}}(),t("code").each((l,r)=>{const u=t(r);u.hasClass("no-escape-HTML")||u.html(e.escapeOnlyTag(u.html()))});let $=t("eq");for(let l=0;l<$.length;l++)$.eq(l).html(function(r,u){return"\\( "+u.trim()+" \\)"});let v=t("eqq");for(let l=0;l<v.length;l++)v.eq(l).html(function(r,u){return"\\[ "+u.trim()+" \\]"});e.logPrint("<br><br><eq> and <eqq> tags are rendered to MathJax format, being enclosed by \\ ( \\ ) and \\ [ \\ ]."),e.$docuK.has("script").addClass("noDIdHandle"),e.$docuK.length<=1&&e.$docuK.addClass("noDIdHandle");let x=e.$docuK.length;for(let l=1;l<x;l++)e.docuKProcess(l);e.$bubbleRefs=e.$docuK.find(".bubbleRef");let K=e.$docuK.find(".inRef");K.each(function(){let l=t(this),r=l.width()-2,u=l.find(".arrow"),i=parseFloat(u.css("borderWidth")),o=parseFloat(u.css("fontSize"));u.css({marginLeft:((r/2-i)/o).toFixed(2)+"em"})}),K.on("mouseenter.delayedLoad",function(){e.logPrint("<br>Do delayed-load in bubble ref."),e.$window.trigger("scroll.delayedLoad"),t(this).off("mouseenter.delayedLoad")});let S=t(".docuK .p, .docuK .cmt, .docuK .bcf, .docuK li, .docuK pre");for(let l=0;l<S.length;l++){let r=S.eq(l),u=r.parents(".docuK>.sec"),i="",o="";if(u.length){let a=u.find("h2:first-child .head-txt").text(),n=r.parents(".subsec");if(n.length){a+=`
-- `+n.find("h3:first-child .head-txt").text();let d=r.parents(".subsubsec");d.length&&(a+=`
-- `+d.find("h4:first-child .head-txt").text())}i=a.replace(/\n /g,"").replace(/\n /g,"")+`
`,o='<div class="cat">'+a.replace(/\n/g,"<br>")+"</div>"}i+="* "+r.text(),o+=`<div class="li">* ${r.html().trim().replace(/\sid=/g," squasi-id=")}</div>`,e.fsGo.fullList[S.length-1-l]={i:S.length-1-l,txt:e.splitHangul(i),html:o,$listI:r}}window.onpopstate=function(l){l.state&&(l.state?.goOn!==e.goOn&&e.$window.trigger({type:"keydown",code:"KeyG"}),l.state?.logOn!==e.logOn&&e.$window.trigger({type:"keydown",code:"KeyK"}))},e.$document.ready(function(){if(window.disqus_config){e.disqusVars={page:{}},window.disqus_config.apply(e.disqusVars);let i=e.canonicalURI=e.disqusVars.page.url;t('link[rel="canonical"]').remove(),e.$headOrBody.append(`<link rel="canonical" href="${i}" />`);let o=new URL(window.location.href),a=new URL(i);o.protocol.toLowerCase()==="https:"&&decodeURIComponent(o.pathname)!==decodeURIComponent(a.pathname)&&(window.location.pathname=a.pathname)}setTimeout(function(){let i=`URI referer REACTION_GUEST
${window.location.href} ${document.referrer} ${e.docCookies.getItem("REACTION_GUEST")}`;t.ajax({type:"POST",url:"https://recoeve.net/BlogStat",data:i,dataType:"text"}).fail(async function(o){e.logPrint("<br><br>BlogStat failed. "+await e.uriRendering(o.toString(),!0,!1))}).done(async function(o){e.logPrint("<br><br>BlogStat is logged. "+await e.uriRendering(o.toString(),!0,!1))})},e.wait),e.$title.html(e.$title.html()+` at ${window.location.host}`),e.lang=navigator.language?.substring(0,2),e.docCookies.hasItem("lang")&&(e.lang=e.docCookies.getItem("lang")),e.docCookies.setItem("lang",e.lang,1/0,"/",!1),e.docCookies.setItem("lang",e.lang,1/0,"/",`${window.location.host}`),e.lang==="ko"?e.$log.after(`<div id="floating-key">
<div id="button-hideFK" class="button" onclick="k.toggleFK()">\u25BC \uC228\uAE30\uAE30(<span class="bold underline">E</span>)</div>
<div class="button toggle-a-mess" onclick="k.$window.trigger({type:'keydown', code:'KeyA'})">Toggle <span class="bold underline">a</span> \uAD11\uACE0</div>
<div class="button button-Go" style="width:4.5rem; border-right:none" onclick="k.$window.trigger({type:'keydown', code:'KeyG'})"><span class="bold underline">G</span>o \uAC80\uC0C9</div>
<div class="button button-ToR" style="width:4.5rem" onclick="k.$window.trigger({type:'keydown', code:'KeyT'})">\uBAA9\uCC28(<span class="bold underline">T</span>)</div>
<div class="button button-log" onclick="k.$window.trigger({type:'keydown', code:'KeyK'})">\uB3C4\uD050<span class="bold underline">K</span> \uB85C\uADF8</div>
<div class="button darkgoldenrod" onclick="k.$window.trigger({type:'keydown', code:'KeyD'})">\uC704\uB85C(<span class="bold underline">D</span>)</div>
<div class="button darkgoldenrod" onclick="k.$window.trigger({type:'keydown', code:'KeyF'})">\uC544\uB798\uB85C(<span class="bold underline">F</span>)</div>
<div class="button darkgoldenrod" onclick="k.$window.trigger({type:'keydown', code:'KeyR'})">\uCC38\uACE0\uBB38\uD5CC(<span class="bold underline">R</span>)</div>
<div class="button button-list" onclick="k.$window.trigger({type:'keydown', code:'KeyL'})">\uB9AC\uC2A4\uD2B8(<span class="bold underline">L</span>)</div>
<div class="button darkgoldenrod" style="width:4.5rem; border-right:none" onclick="k.$window.trigger({type:'keydown', code:'KeyZ'})">\uB313\uAE001(<span class="bold underline">Z</span>)</div>
<div class="button darkgoldenrod" style="width:4.5rem" onclick="k.$window.trigger({type:'keydown', code:'KeyX'})">\uB313\uAE002(<span class="bold underline">X</span>)</div>
<div class="button button-cmt" onclick="k.$window.trigger({type:'keydown', code:'KeyC'})">\uB313\uAE00\uB2EC\uAE30(<span class="bold underline">C</span>)</div>
<div class="button button-cmt-handle" onclick="k.$window.trigger({type:'keydown', code:'KeyN'})">\uB313\uAE00\uCC98\uB9AC(<span class="bold underline">N</span>)</div>
${document.querySelector(".tistory-bar-login")?`<div class="button darkred" onclick="k.$window.trigger({type:'keydown', code:'KeyO'})">\uB85C\uADF8\uC544\uC6C3(<span class="bold underline">O</span>)</div>`:`<div class="button darkred" onclick="k.$window.trigger({type:'keydown', code:'KeyI'})">\uB85C\uADF8\uC778(<span class="bold underline">I</span>)</div>`}
<div id="SNS-floating"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Link.png" onclick="return m.shareSNS('link')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Tag.png" onclick="return m.shareSNS('tag')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Recoeve.png" onclick="k.shareSNS('recoeve')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-X.png" onclick="k.shareSNS('X')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Facebook.png" onclick="k.shareSNS('facebook')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Kakao.png" onclick="k.shareSNS('kakao')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Whatsapp.png" onclick="k.shareSNS('Whatsapp')"></div></div><div class="button" id="toggle-floating-key" onclick="k.toggleFK()">\u25B2</div>`):e.$log.after(`<div id="floating-key">
<div id="button-hideFK" class="button" onclick="k.toggleFK()">\u25BC Hid<span class="bold underline">e</span></div>
<div class="button toggle-a-mess" onclick="k.$window.trigger({type:'keydown', code:'KeyA'})">Toggle <span class="bold underline">a</span> mess</div>
<div class="button button-Go" style="width:4.5rem; border-right:none" onclick="k.$window.trigger({type:'keydown', code:'KeyG'})"><span class="bold underline">G</span>o (FS)</div>
<div class="button button-ToR" style="width:4.5rem" onclick="k.$window.trigger({type:'keydown', code:'KeyT'})"><span class="bold underline">T</span>ofC</div>
<div class="button button-log" onclick="k.$window.trigger({type:'keydown', code:'KeyK'})">Docu<span class="bold underline">K</span> Log</div>
<div class="button darkgoldenrod" onclick="k.$window.trigger({type:'keydown', code:'KeyD'})">Backwar<span class="bold underline">d</span></div>
<div class="button darkgoldenrod" onclick="k.$window.trigger({type:'keydown', code:'KeyF'})"><span class="bold underline">F</span>orward</div>
<div class="button darkgoldenrod" style="width:4.5rem; border-right:none" onclick="k.$window.trigger({type:'keydown', code:'KeyR'})"><span class="bold underline">R</span>RA</div>
<div class="button button-list" style="width:4.5rem" onclick="k.$window.trigger({type:'keydown', code:'KeyL'})"><span class="bold underline">L</span>ists</div>
<div class="button darkgoldenrod" style="width:4.5rem; border-right:none" onclick="k.$window.trigger({type:'keydown', code:'KeyZ'})">Cmt<span class="bold underline">Z</span></div>
<div class="button darkgoldenrod" style="width:4.5rem" onclick="k.$window.trigger({type:'keydown', code:'KeyX'})">Cmt<span class="bold underline">X</span></div>
<div class="button button-cmt" onclick="k.$window.trigger({type:'keydown', code:'KeyC'})">To <span class="bold underline">C</span>omment</div>
<div class="button button-cmt-handle" onclick="k.$window.trigger({type:'keydown', code:'KeyN'})">Ha<span class="bold underline">n</span>dle CmtZ</div>
${document.querySelector(".tistory-bar-login")?`<div class="button darkred" onclick="k.$window.trigger({type:'keydown', code:'KeyO'})">Log <span class="bold underline">o</span>ut</div>`:`<div class="button darkred" onclick="k.$window.trigger({type:'keydown', code:'KeyI'})">Log <span class="bold underline">i</span>n</div>`}
<div id="SNS-floating"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Link.png" onclick="return m.shareSNS('link')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Tag.png" onclick="return m.shareSNS('tag')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Recoeve.png" onclick="k.shareSNS('recoeve')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-X.png" onclick="k.shareSNS('X')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Facebook.png" onclick="k.shareSNS('facebook')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Kakao.png" onclick="k.shareSNS('kakao')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Whatsapp.png" onclick="k.shareSNS('Whatsapp')"></div></div><div class="button" id="toggle-floating-key" onclick="k.toggleFK()">\u25B2</div>`),e.$floating_key=t("#floating-key"),e.docCookies.getItem("hideFK")==="y"&&e.$floating_key.hide(),e.printMode||(e.$docuK.eq(1).before(e.promotingKotetsuHTML),e.$docuK.eq(e.$docuK.length-1).after(e.promoting("promoting-recoeve")+`<div class="SNS-bottom"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Link.png" onclick="return m.shareSNS('link')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Tag.png" onclick="return m.shareSNS('tag')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Recoeve.png" onclick="k.shareSNS('recoeve')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-X.png" onclick="k.shareSNS('X')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Facebook.png" onclick="k.shareSNS('facebook')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Kakao.png" onclick="k.shareSNS('kakao')"><img class="SNS-img" src="https://tistory1.daumcdn.net/tistory/1468360/skin/images/icon-Whatsapp.png" onclick="k.shareSNS('Whatsapp')"></div></div>`+e.promotingKotetsuHTML)),window.$fuzzy_search.trigger("keyup.fs"),window.$button_Go=t(".button-Go"),window.$button_log=t(".button-log");let l=t("codeprint");for(let i=0;i<l.length;i++){let o=l.eq(i).attr("id");o!=null&&o.startsWith("code-")&&e.printCode(o)}e.logPrint("<br/><br/><codeprint> tags are printed to corresponding <pre> tags, only when the tags exist in the document."),e.$docuK.find(".sec.hiden").find(">.sec-contents").css({display:"none"}),e.$deviceInfo=e.$docuK.find(".deviceInfo");let r;e.logPrint("<br>"),r=e.docCookies.getItem("m.mode"),r!==null?(e.Cmode(r),e.logPrint(`<br>Mode ${r} is set from cookie.`)):e.Cmode("Bright");for(let i=1;i<e.$docuK.length;i++)t(`#button${i}-${e.mode}`).prop("checked",!0);if(r=e.docCookies.getItem("m.fontFamily"),r!==null){e.CfontFamily(r),e.logPrint(`<br>Font ${r} is set from cookie.`);for(let i=1;i<e.$docuK.length;i++)t(`#input${i}-font-family`)[0].value=e.fontFamily}r=e.docCookies.getItem("m.fontSize"),r!==null&&(e.CfontSize(Number(r)-e.defaultStyles.fontSize),e.logPrint(`<br>Font-size ${(Number(r)*1.8).toFixed(1)} is set from cookie.`)),r=e.docCookies.getItem("m.lineHeight10"),r!==null&&(e.ClineHeight(Number(r)-e.defaultStyles.lineHeight10),e.logPrint(`<br>Line-height ${(Number(r)/10).toFixed(1)} is set from cookie.`)),e.plink=t('meta[property="dg:plink"]').attr("content"),e.logPrint("<br><br>Current styles (dark/bright mode, font-family, font-size, line-height) are shown."),e.printDeviceInfo(),window.$disqus_thread=t("#disqus_thread"),window.$disqus_thread.length||((t("#docuK-script")||t("body")).append('<div id="disqus_thread"></div>'),window.$disqus_thread=t("#disqus_thread")),e.myIPs=["14.38.247.30","175.212.158.53"],e.ignoreMe=!0,e.weekDays=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],e.daysToPlotPageViewsChart=31,e.to=[],e.from=[];let u=new Date;for(let i=0;i<e.daysToPlotPageViewsChart;i++){let o=u,a=o.getFullYear(),n=String(o.getMonth()+1).padStart(2,"0"),d=String(o.getDate()).padStart(2,"0");e.to.push({date:`${a}-${n}-${d}`,month:n,day:d,weekday:e.weekDays[o.getDay()]});let p=new Date(u.setDate(u.getDate()-1));a=p.getFullYear(),n=String(p.getMonth()+1).padStart(2,"0"),d=String(p.getDate()).padStart(2,"0"),e.from.push({date:`${a}-${n}-${d}`})}if(e.blogStatRes=[],e.getBlogStat=function(){return new Promise(function(i,o){let a="host from to";for(let n=0;n<e.daysToPlotPageViewsChart;n++)a+=`
${window.location.host} ${e.from[n].date} 15:00:00 ${e.to[n].date} 15:00:00`;t.ajax({type:"POST",url:"https://recoeve.net/BlogStat/Get",data:a,dataType:"text"}).fail(function(n){e.logPrint("<br><br>BlogStat is failed to be got."),o(n)}).done(async function(n){e.logPrint("<br><br>BlogStat is got."),e.blogStatRes=await e.strToJSON(n);for(let d=1;d<e.blogStatRes.length;d++){let p=e.blogStatRes[d];p.splice(2,1);let c=`${p.from} ${p.to}`;p.id=c,e.blogStatRes[c]=p,p.stats=await e.strToJSON(p.stats);let h=0;for(let y=1;y<p.stats.length;y++){let k=p.stats[y].ip.split(":")[0];e.ignoreMe&&(k===e.myIPs[0]||k===e.myIPs[1])||h++}p.pageViews=h}i()})})},e.loadPageViewsStat=async function(i){i?.preventDefault(),i?.stopPropagation(),await e.getBlogStat();let o='<div class="rC" style="margin:1rem 0"><div class="rSC"><div><svg width="100%" height="100%">',a=3,n=3,d=7,p=20,c=100-p,h=100-d-p,y=(100-a-n)/e.daysToPlotPageViewsChart/2;e.setIntervalBlogStatN=0,setTimeout(function k(){if(e.blogStatRes?.length<e.daysToPlotPageViewsChart&&e.setIntervalBlogStatN++<=17){setTimeout(k,2048);return}let w=0;for(let s=1;s<e.blogStatRes.length;s++){let f=e.blogStatRes[s].pageViews;f>w&&(w=f)}let g=[];for(let s=0;s<e.daysToPlotPageViewsChart;s++){let f=e.blogStatRes[s+1],b=a+(e.daysToPlotPageViewsChart-1-s)*y*2,P=a+(e.daysToPlotPageViewsChart-.5-s)*y*2,I=h*f.pageViews/w;g[s]={pageViews:f.pageViews,x:b,tick:P,month:e.to[s].month,day:e.to[s].day,weekday:e.to[s].weekday,h:I}}for(let s=0;s<g.length;s++)o+=`<rect class="column" x="${g[s].x}%" y="${c-g[s].h}%" width="${2*y}%" height="${g[s].h}%"></rect><text class="page-views" x="${g[s].tick}%" text-anchor="middle" y="${c-g[s].h-1}%" dominant-baseline="text-bottom">${g[s].pageViews?.toFixed(0)}</text>`;o+=`<line class="bar" x1="${a}%" y1="${c}%" x2="${100-n}%" y2="${c}%"/>`;for(let s=0;s<g.length;s++)o+=`<line class="bar" x1="${g[s].tick}%" y1="${c-1.5}%" x2="${g[s].tick}%" y2="${c+1}%"/>
<text class="tick${g[s].weekday==="\uD1A0"?" saturday":g[s].weekday==="\uC77C"?" sunday":""}" x="${g[s].tick}%" y="${c}%">
<tspan x="${g[s].tick}%" text-anchor="middle" dy="2.0rem">${g[s].month}</tspan>
<tspan x="${g[s].tick}%" text-anchor="middle" dy="1.1rem">/${g[s].day}</tspan>
<tspan x="${g[s].tick}%" text-anchor="middle" dy="1.6rem">${g[s].weekday}</tspan>
</text>`;o+=`<text class="now-local" x="100%" y="100%"><tspan x="100%" text-anchor="end" y="99%" dominant-baseline="text-bottom">${new Date().toLocaleString()}</tspan></text>`,o+="</svg></div></div></div>",window.$page_views_chart.html(o)},512)},window.$page_views_chart=t("#page-views-chart"),window.$page_views_chart.length||(window.$disqus_thread.after('<div id="page-views-chart" class="to-be-executed" onclick="k.loadPageViewsStat(event)">Get page views</div>'),window.$page_views_chart=t("#page-views-chart")),e.kakao_js_id="kakao-js-sdk",!t(`#${e.kakao_js_id}`).length){let i=t(`<script id="${e.kakao_js_id}" src="https://t1.kakaocdn.net/kakao_js_sdk/2.7.5/kakao.min.js"><\/script>`);e.$headOrBody.append(i)}e.logPrint(`<br><br>kakao.js with id="${e.kakao_js_id}" is loaded.`),e.kakaoInitDo=function(){window.Kakao&&window.Kakao?.isInitialized&&(clearInterval(e.kakaoInit),window.Kakao.isInitialized()||window.Kakao.init("c85c800b54a2a95faa5ca7a5e3d357ef"),e.logPrint(`<br>window.Kakao.isInitialized()=${window.Kakao.isInitialized()};`))},e.kakaoInit=setInterval(e.kakaoInitDo,2048),e.popUpKakao=function(){let i=t("meta[name='description']"),o=window.location.href;window.Kakao.Share.sendDefault({objectType:"feed",content:{title:t("title").html()||t("h1").html()||"\uC81C\uBAA9 \uC5C6\uC74C",description:i?i.attr("content"):"",imageUrl:"",link:{mobileWebUrl:o,webUrl:o}}})},e.$fdList=t("#wrap, #header, #shortkey, .promoting, .change-docuK-style, #content, #container, #wrapContent, .docuK .sec>h1, .docuK .sec>h2, .docuK .subsec>h3, .docuK .subsubsec>h4, .docuK-con, .article-reply, .article-reply ul.tt-list-reply>li.tt-item-reply, #disqus_thread, #page-views-chart, .area-aside, .box-profile, .box-category, .box-recent, .box-reply, .box-notice, .box-plugins, .box-archive, .box-calendar, .box-visit, .box-tag, #footer, .adsbygoogle"),e.fdList=e.$fdList.get().sort((i,o)=>t(i).offset().top-t(o).offset().top),e.$tocs=t(".docuK>.sec").has(".toc"),e.$rras=t(".docuK>.sec").has("ol.refs"),e.goOn=!1,e.logOn=!1,e.processShortKey=function(i){if(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey)return;switch(i.target&&i.target.nodeName){case"INPUT":case"SELECT":case"TEXTAREA":return;case"DIV":if(t(i.target).hasClass("tt-cmt"))return}let o,a,n;switch(i.code){case"KeyQ":window.location.href="/manage";break;case"KeyA":t(".toggle-a-mess.order").eq(0).trigger("click");break;case"KeyE":e.toggleFK();break;case"KeyG":i.preventDefault(),window.$fuzzy_search_container.is(":visible")?(window.$fuzzy_search_container.hide(),window.$out_focus.trigger("focus"),window.$button_Go.removeClass("enabled"),e.goOn=!1,window.history.pushState({goOn:e.goOn,logOn:e.logOn},"")):(window.$fuzzy_search_container.show(),window.$fuzzy_search.trigger("focus"),window.$button_Go.addClass("enabled"),e.goOn=!0,window.history.pushState({goOn:e.goOn,logOn:e.logOn},""));break;case"KeyK":e.$log.is(":visible")?(e.$logAll.hide(),window.$out_focus.trigger("focus"),window.$button_log.removeClass("enabled"),e.logOn=!1,window.history.pushState({goOn:e.goOn,logOn:e.logOn},"")):(e.$logAll.show(),window.$button_log.addClass("enabled"),e.logOn=!0,window.history.pushState({goOn:e.goOn,logOn:e.logOn},""));break;case"KeyF":case"KeyD":o=e.$window.scrollTop(),n=e.fdList.length;let d;if(i.code==="KeyF"){for(o+=15,a=0;a<n&&(d=t(e.fdList[a]),!(d.is(":visible")&&o<d.offset().top));a++);if(a===n)return}else{for(o-=15,a=n-1;a>=0&&(d=t(e.fdList[a]),!(d.is(":visible")&&o>d.offset().top));a--);if(a===-1)return}let c=d.find("[id]").addBack("[id]").eq(0).attr("id");c?window.location.hash=`#${c}`:window.location.hash="",e.$window.scrollTop(d.offset().top);break;case"KeyT":o=e.$window.scrollTop(),n=e.$tocs.length;let h;for(o-=10,a=n-1;a>=0&&(h=e.$tocs.eq(a),!(h.is(":visible")&&o>h.offset().top));a--);a===-1&&(h=e.$tocs.eq(n-1));let k=h.find("[id]").addBack("[id]").eq(0).attr("id");k?window.location.hash=`#${k}`:window.location.hash="",e.$window.scrollTop(h.offset().top);break;case"KeyR":o=e.$window.scrollTop(),n=e.$rras.length;let w;for(o-=10,a=n-1;a>=0&&(w=e.$rras.eq(a),!(w.is(":visible")&&o>w.offset().top));a--);a===-1&&(w=e.$rras.eq(n-1));let s=w.find("[id]").addBack("[id]").eq(0).attr("id");s?window.location.hash=`#${s}`:window.location.hash="",e.$window.scrollTop(w.offset().top);break;case"KeyL":window.location.pathname==="/entry/Lists"?window.location.pathname="/category":window.location.pathname="/entry/Lists";break;case"KeyZ":t('div[data-tistory-react-app="Comment"]').length&&e.$window.scrollTop(t('div[data-tistory-react-app="Comment"]').offset().top);break;case"KeyX":t("#disqus_thread").length&&e.$window.scrollTop(t("#disqus_thread").offset().top);break;case"KeyC":t(".tt-area-write").length&&e.$window.scrollTop(t(".tt-area-write").offset().top);break;case"KeyN":e.handleComments();break;case"KeyI":e.docCookies.removeItem("REACTION_GUEST","/"),window.location.href=`https://www.tistory.com/auth/login?redirectUrl=${encodeURIComponent(window.location.href)}&isPopup=true`;break;case"KeyO":window.location.href="https://www.tistory.com/auth/logout";break;default:window.processShortcut!==void 0&&window.processShortcut(i)}},e.$window.on("keydown.shortkey",e.processShortKey),e.logPrint("<br><br>New ShortKeys (T: Table of Contents, F: Forward Section, D: Previous Section, L: To \uC804\uCCB4\uBAA9\uB85D/[Lists]) are set."),e.logPrint(`<br><br>m.delayPad=${e.delayPad};<br>m.wait=${e.wait};`),e.handleComments=async function(){window?.MathJax?.typesetPromise?.([t(".article-reply")[0]]);let i=t(".article-reply li.tt-item-reply .tt_desc");async function o(n){let d=n.wholeText;return await e.relatedRendering(d)}e.processElement=async function(n){let d=n.contents(),p="";for(let c=0;c<d.length;c++){let h=d[c];if(h?.nodeType===Node.TEXT_NODE){let y=h?.wholeText,k=!1,w="",g="";if(/^```/.test(y)){k=!0;let s=!1;for(g=y.substring(3),c++;c<d.length;){let f=d[c],b=f?.wholeText;for(s=f?.nodeType===Node.TEXT_NODE&&typeof b=="string"&&/```\//.test(b);!s&&(f?.nodeType===Node.TEXT_NODE?w+=await o(f):w+=f.outerHTML,c++,c!==d.length);)if(f=d[c],b=f?.wholeText,s=f?.nodeType===Node.TEXT_NODE&&typeof b=="string"&&/```\//.test(b),s){w+=await o(f);break}if(s){w=w.replace(/```\//,""),c++;break}c++}}if(k){g=e.getEmmetFromHead(g);let s=e.getClassesFromEmmet(g),f=e.getIdFromEmmet(g);p+=`<pre${f?` id="${f}"`:""} class="${s.split(" ").some(b=>b==="no-linenums")?"":"line-numbers "}${s}"><code class="${s}">${e.escapeOnlyTag(w.replace(/\n{0,1}\<br\s*\/?\>\n{0,1}/gi,`
`).trim())}</code></pre>`}else p+=await o(h)}else p+=h.outerHTML}n.html(p.trim())},e.processAllElements=async function(){for(let n=0;n<i.length;n++)await e.processElement(i.eq(n))},await e.processAllElements(),t("pre>code").each((n,d)=>{const p=t(d);p.hasClass("no-escape-HTML")||p.html(e.escapeOnlyTag(p.html()))}),t("pre").hasClass("no-linenums")||t("pre").addClass("line-numbers"),e.$prePrettyScrollable=t("pre.scrollable");for(let n=0;n<e.$prePrettyScrollable.length;n++)e.$prePrettyScrollable.eq(n).parents(".preC").length||e.$prePrettyScrollable.eq(n).wrap("<div class='preC'></div>").before('<div class="preSSE">On the left side of codes is there a hiden button to toggle/switch scrollability ({max-height:some} or {max-height:none}).</div><div class="preSS" onclick="k.toggleHeight(this)"></div>');t(".article-reply").length&&(window?.MathJax?.typesetPromise?.([t(".article-reply")[0]]),window?.Prism?.highlightAll?.()),e.reNewAndReOn()},e.$window.on("resize.menubar",function(){t("#menubar_wrapper").parents().show()}),e.reNewAndReOn=function(){e.$delayedElems=t("[delayed-src], [delayed-bgimage], .to-be-executed, .MathJax_Preview"),e.$window.off("scroll.delayedLoad").on("scroll.delayedLoad",e.delayedLoadByScroll),e.$window.trigger("scroll.delayedLoad"),e.$fdList=t("#wrap, #header, #shortkey, .promoting, .change-docuK-style, #content, #container, #wrapContent, .docuK .sec>h1, .docuK .sec>h2, .docuK .subsec>h3, .docuK .subsubsec>h4, .docuK-con, .article-reply, .article-reply ul.tt-list-reply>li.tt-item-reply, #disqus_thread, #page-views-chart, .area-aside, .box-profile, .box-category, .box-recent, .box-reply, .box-notice, .box-plugins, .box-archive, .box-calendar, .box-visit, .box-tag, #footer, .adsbygoogle"),e.fdList=[...e.$fdList].sort((i,o)=>t(i).offset().top-t(o).offset().top)},e.handleComments(),setTimeout(function(){e.handleComments();let i=t(`<script>
window.MathJax={
startup: {
typeset: false, // Skip startup typeset.
ready: function () {
m.logPrint('<br><br>MathJax is loaded, but not yet initialized.');
MathJax.startup.defaultReady();
m.logPrint('<br><br>MathJax is initialized, and the initial typeset is queued.');
}
},
tex: {
inlineMath: [['\\\\(','\\\\)']], // Using $ for inline math.
displayMath: [['\\\\[','\\\\]']], // Using $$ for outline math.
processEscapes: true, // Escape \\$
processEnvironments: false // Ignore \\begin{something} ... \\end{something}
},
svg: {
fontCache: 'global'
}
};
<\/script>`);e.$headOrBody.append(i);let o=document.createElement("script");o.id="MathJax-script",o.defer=!0,o.onload=function(){e.logPrint("<br><br>MathJax.js (mathjax@3/es5/tex-mml-chtml.min.js) is loaded."),window?.MathJax?.typesetPromise?.([t("html")[0]]),window?.MathJax?.typesetPromise?.([...t(".docuK")]),window?.MathJax?.typesetPromise?.([t(".article-reply")[0]])},o.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js",e.$headOrBody.append(o),e.logPrint("<br><br>MathJax.js (mathjax@3/es5/tex-mml-chtml.min.js) is loaded."),e.mathJaxPreProcessDo=function(){if(window.MathJax?.startup&&window.MathJax.typesetPromise){let h=[];e.$docuK&&(h=[...e.$docuK]),t(".article-reply").length&&h.push(t(".article-reply")[0]),window.MathJax.typesetPromise(h),window?.MathJax?.typesetPromise?.([t("html")[0]]),window?.MathJax?.typesetPromise?.([...t(".docuK")]),window?.MathJax?.typesetPromise?.([t(".article-reply")[0]])}else setTimeout(e.mathJaxPreProcessDo,2048)},e.mathJaxPreProcess=setTimeout(e.mathJaxPreProcessDo,2048),t("pre").each((h,y)=>{const k=t(y);if(k.children("code").length===0){let w=k.attr("class")??"";k.html(`<code class="${w}">${k.html().trim()}</code>`)}}),e.$headOrBody.append('<link href="https://tistory1.daumcdn.net/tistory/1468360/skin/images/docuK-prism.css" rel="stylesheet" />');let a=document.createElement("script");a.id="prism-js",a.defer=!0,a.src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js",a.onload=()=>{window?.Prism?.highlightAll?.()},e.$headOrBody.append(a),e.logPrint("<br><br>Prism.js (code prettifier) is loaded.");let n=document.createElement("script");n.id="prism-js",n.defer=!0,n.src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js",e.$headOrBody.append(n),e.logPrint("<br>Prism-line-numbers.js is loaded.");const d={"lang-js":"javascript","lang-ts":"typescript","lang-html":"markup","lang-css":"css","lang-json":"json","lang-xml":"markup","lang-sql":"sql","lang-sh":"bash","lang-py":"python","lang-java":"java","lang-c":"c","lang-cpp":"cpp","lang-cs":"csharp","lang-php":"php","lang-bat":"batch","lang-git":"git","lang-md":"markdown","lang-env":"env"},p=t("pre, code"),c=[];p.each((h,y)=>{let k=y.classList,w=!1;for(let g of k)d[g]&&!c[g]&&(c[g]=d[g],c.push(c[g]),w=!0);w||(t(y).addClass("lang-html"),c["lang-html"]||(c["lang-html"]="html",c.push("html")))});for(let h of c){let y=document.createElement("script");y.id=h,y.defer=!0,y.src=`https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-${h}.min.js`,e.$headOrBody.append(y),e.logPrint(`<br>${h}.min.js of prism.js is loaded.`)}e.logPrint("<br><br><span class='emph'>docuK scripts are all done. Then this log is closing in 1.0 sec.</span>"),e.$window.scrollTop(t(".docuK-con").eq(0).offset().top),e.$window.scrollTop(t(window.location.hash)?.offset()?.top??e.$window.scrollTop()),setTimeout(function(){e.$logAll.hide(),e.$window.scrollTop(t(window.location.hash)?.offset()?.top??e.$window.scrollTop())},2048),e.reNewAndReOn()},2048)});const T='<div class="docuK-con"><div class="docuK-ads order">\uC774 \uAE00\uC774 \uB3C4\uC6C0\uC774 \uB418\uC168\uB2E4\uBA74, \uAD11\uACE0 \uD074\uB9AD \uD55C\uBC88\uC529\uB9CC \uBD80\uD0C1\uB4DC\uB9BD\uB2C8\uB2E4 =\u3142=\u314B.<br>(If this article was helpful, please click the ad once. Thank you. ;)</div></div>';for(let l=1;l<e.$docuK.length;l++){const r=e.$docuK.eq(l);r.before(T),r.after(T)}})(window.k,jQuery);})();
//# sourceMappingURL=docuK-postProcess-2.3.js.map