https://github.com/kokufu/Barenote "},function(e,t,n){"use strict";n.r(t);var r=Object.freeze({REF_CLASS:"barenote",get REF_SELECTOR(){return`.${this.REF_CLASS}`},REF_LIST_CLASS:"barenote_ref_list",get REF_LIST_SELECTOR(){return`.${this.REF_LIST_CLASS}`},FLOATING_NOTE_ID:"barenote_floating_note",get FLOATING_NOTE_SELECTOR(){return`#${this.FLOATING_NOTE_ID}`},ABOUT_INDICATOR_CLASS:"barenote_about_indicator",get ABOUT_INDICATOR_SELECTOR(){return`.${this.ABOUT_INDICATOR_CLASS}`},get DEFAULT_CSS(){return this.FLOATING_NOTE_SELECTOR+" {background-color: #eeeeee;padding: 0em 1em 0em 1em;border: solid 1px;font-size: 90%;font-family: Helvetica, Sans-serif;line-height: 1.4;-moz-border-radius: .5em;-webkit-border-radius: .5em;border-radius: .5em;opacity: 0.95;}"+this.REF_LIST_SELECTOR+" {position: relative !important;}"+this.ABOUT_INDICATOR_SELECTOR+" {position: absolute !important;right: 1px !important;top: 1px !important;cursor: pointer !important;background-color: #2196F3;color: #ffffff;width: 17px;height: 17px;line-height: 17px;font-size: 10px;text-align: center;margin: 0;padding: 0;}"}});function i(e){const t=`#${e}`;let n=document.querySelector(t);if(!n){(n=document.createElement("div")).setAttribute("id",e),n.style.cssText="position: absolute !important;",n.hidden=!0,document.body.appendChild(n);const t=n.style.opacity?n.style.opacity:1;n.show=e=>{const r=e.data.element.getBoundingClientRect();let i=r.left+r.width+window.pageXOffset;const s=r.top+r.height+window.pageYOffset;i+420>window.innerWidth&&(i=window.innerWidth-420),n.isAnimating=!1,n.innerHTML=e.data.text,n.style.left=`${i}px`,n.style.top=`${s}px`,n.style.opacity=t,n.hidden=!1},n.hide=()=>{const e=window.performance.now();n.isAnimating=!0,window.requestAnimationFrame((function r(i){if(!n.isAnimating)return;const s=i-e-500;if(s<0)return void window.requestAnimationFrame(r);let o=t*(1-s/1e3);o=o<0?0:o,n.style.opacity=o,s<1e3?window.requestAnimationFrame(r):(n.hidden=!0,n.isAnimating=!1)}))}}return n}function s(){const e=window.scrollX,t=window.scrollY,n=this.getBoundingClientRect().top+window.pageYOffset,r=window.performance.now();window.requestAnimationFrame((function i(s){let o=(s-r)/200;const l=t+(n-t)*(o=o>1?1:o);window.scrollTo(e,l),1!=o&&window.requestAnimationFrame(i)}))}class o{constructor(e,t,n){const o=`${e.objectNumber}_${t}`;Object.defineProperties(this,{index:{get:()=>t},reference:{get:()=>o},originalElement:{get:()=>n}});const l=function(e){const t=new i(r.FLOATING_NOTE_ID);let n=!1;const o=document.createElement("a");return o.innerText=`${e.index+1}`,o.setAttribute("id",`fnref:${e.reference}`),o.setAttribute("href",`#fn:${e.reference}`),o.setAttribute("class",r.REF_CLASS),o.addEventListener("touchstart",r=>{r.data={element:o,text:e.originalElement.innerHTML},t.show(r),n=!0}),o.addEventListener("touchend",e=>{t.hide(),setTimeout(()=>{n=!1},500)}),o.addEventListener("mouseover",r=>{n||(r.data={element:o,text:e.originalElement.innerHTML},t.show(r))}),o.addEventListener("mouseout",e=>{t.hide()}),o.addEventListener("click",t=>{n||e.listElement.scrollToOwnTop(),t.stopPropagation(),t.preventDefault()}),o.scrollToOwnTop=s,o}(this),a=function(e){const t=document.createElement("a");t.setAttribute("href",`#fnref:${e.reference}`),t.innerHTML="↩",t.addEventListener("click",t=>{e.barenoteElement.scrollToOwnTop(),t.stopPropagation(),t.preventDefault()});const n=document.createElement("li");return n.setAttribute("id",`fn:${e.reference}`),n.innerHTML=`${e.originalElement.innerHTML} `,n.appendChild(t),n.scrollToOwnTop=s,n}(this);Object.defineProperties(this,{barenoteElement:{get:()=>l},listElement:{get:()=>a}})}}n.d(t,"Barenote",(function(){return c}));let l=!1,a=0;class c{constructor(e){if("undefined"==typeof window||"undefined"==typeof document)throw new Error("Barenote requires a window with a document");!function(){if(l)return;const e=document.createElement("style");e.setAttribute("type","text/css"),e.innerText=r.DEFAULT_CSS;let t=document.getElementsByTagName("head")[0];t?t.insertBefore(e,t.firstChild):document.rootElement.insertBefore(e,document.rootElement.firstChild),l=!0}();const t=[],i=a;a++;const s=e.querySelector(r.REF_LIST_SELECTOR),c=document.createElement("ol");s&&(s.appendChild(c),function(e){const t=n(0),i=document.createElement("div");i.appendChild(document.createTextNode("?")),i.setAttribute("class",r.ABOUT_INDICATOR_CLASS),i.addEventListener("click",e=>{window.open("","","width=500, height=200").document.write(t),e.stopPropagation(),e.preventDefault()}),e.appendChild(i)}(s));for(const[n,i]of e.querySelectorAll(r.REF_SELECTOR).entries()){const e=new o(this,n,i);t.push(e)}this.enable=()=>{for(const e of t){const t=e.originalElement.parentElement;t&&(t.replaceChild(e.barenoteElement,e.originalElement),c.appendChild(e.listElement))}},this.disable=()=>{for(const e of t){const t=e.barenoteElement.parentElement;t&&(t.replaceChild(e.originalElement,e.barenoteElement),c.removeChild(e.listElement))}},Object.defineProperties(this,{rootElement:{get:()=>e},objectNumber:{get:()=>i}}),this.enable()}static apply(e){if(console.warn("Deprecation: Barenote.apply() has been deprecated. use `new Barenote(element)` instead."),e||(e=document.querySelector("body")),"function"==typeof e[Symbol.iterator]){var t=[];for(const n of e)t.push(new c(n));return t}return new c(e)}}}])},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),s=new i.a.Renderer;s.code=function(e,t){var n=e.match(/^`(.+)\n/);if(e=e.replace(//g,">"),t){if(null!=n){e=e.replace(/^`.+\n/,"");var r=n[1].replace(/"/g,"'");return'
').concat(e,"
")}return'
').concat(e,"
")}return'
'.concat(e,"
")},s.codespan=function(e){return e=e.replace(//g,">"),"".concat(e,"
")};var o={renderer:s};function l(){"undefined"==typeof PR?setTimeout(l,100):PR.prettyPrint()}var a=function(){var e=!0,t=!1,n=void 0;try{for(var r,s=document.querySelectorAll(".marked")[Symbol.iterator]();!(e=(r=s.next()).done);e=!0){var a=r.value,c=i()(a.innerHTML.replace(/(\n+)>|^>/g,"$1>"),o),h=document.createElement("div");h.innerHTML=c,a.parentNode.replaceChild(h,a)}}catch(e){t=!0,n=e}finally{try{e||null==s.return||s.return()}finally{if(t)throw n}}l()},c=["css https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushCss.js","cpp c https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushCpp.js","c# c-sharp csharp https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushCSharp.js","diff patch pas https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushDiff.js","groovy https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushGroovy.js","java https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJava.js","js jscript javascript https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.js","perl pl https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPerl.js","php https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPhp.js","py python https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPython.js","ruby rails ror rb https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushRuby.js","bash shell https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushBash.js","sql https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushSql.js","text plain https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPlain.js","xml xhtml xslt html https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushXml.js","jsx https://kokufu.github.io/www/SyntaxHighlighter/shBrushJsx.js","lisp https://kokufu.github.io/www/SyntaxHighlighter/shBrushLisp.js","make makefile https://kokufu.github.io/www/SyntaxHighlighter/shBrushMakefile.js","console https://kokufu.github.io/www/SyntaxHighlighter/shBrushConsole.js","mq4 https://kokufu.github.io/www/SyntaxHighlighter/shBrushMq4.js","kotlin https://kokufu.github.io/www/SyntaxHighlighter/shBrushKotlin.js"],h=function(){SyntaxHighlighter.autoloader.apply(null,c),SyntaxHighlighter.config.bloggerMode=!0,SyntaxHighlighter.all()},u=n(1);document.addEventListener("DOMContentLoaded",(function(e){a(),h();var t=document.querySelectorAll("article.content"),n=!0,r=!1,i=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var l=s.value;new u.Barenote(l)}}catch(e){r=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(r)throw i}}d(p.matches)}));var p=window.matchMedia("(max-width: 1075px)");function d(e){if(e){var t=!0,n=!1,r=void 0;try{for(var i,s=function(){var e=i.value,t=e.getAttribute("url");t&&(e.onClickListener=function(e){window.location.href=t,e.stopPropagation(),e.preventDefault()},e.addEventListener("click",e.onClickListener))},o=document.querySelectorAll(".posts .post")[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)s()}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}else{var l=!0,a=!1,c=void 0;try{for(var h,u=document.querySelectorAll(".posts .post")[Symbol.iterator]();!(l=(h=u.next()).done);l=!0){var p=h.value,d=p.onClickListener;d&&(p.removeEventListener("click",d),delete p.onClickListener)}}catch(e){a=!0,c=e}finally{try{l||null==u.return||u.return()}finally{if(a)throw c}}}}p.addListener((function(e){d(e.matches)}))}]);
//]]>
0 件ã®ã³ã¡ã³ã:
ã³ã¡ã³ããæ稿