1 line
7.9 KiB
JavaScript
1 line
7.9 KiB
JavaScript
|
function externalLinks(){if(document.getElementsByTagName)for(var e=document.getElementsByTagName("a"),t=0;t<e.length;t++){var n=e[t];n.getAttribute("href")&&"external"===n.getAttribute("class")&&(n.target="_blank")}}window.onload=externalLinks,function(e,t){function n(){var e=v.elements;return"string"==typeof e?e.split(" "):e}function r(e){var t=m[e[u]];return t||(t={},h++,e[u]=h,m[h]=t),t}function a(e,n,a){return n||(n=t),c?n.createElement(e):(a||(a=r(n)),n=a.cache[e]?a.cache[e].cloneNode():f.test(e)?(a.cache[e]=a.createElem(e)).cloneNode():a.createElem(e),n.canHaveChildren&&!d.test(e)?a.frag.appendChild(n):n)}function i(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return v.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+n().join().replace(/[\w\-]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(v,t.frag)}function o(e){e||(e=t);var n=r(e);if(v.shivCSS&&!s&&!n.hasCSS){var a,o=e;a=o.createElement("p"),o=o.getElementsByTagName("head")[0]||o.documentElement,a.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>",a=o.insertBefore(a.lastChild,o.firstChild),n.hasCSS=!!a}return c||i(e,n),e}var s,c,l=e.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,u="_html5shiv",h=0,m={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",s="hidden"in e;var n;if(!(n=1==e.childNodes.length)){t.createElement("a");var r=t.createDocumentFragment();n="undefined"==typeof r.cloneNode||"undefined"==typeof r.createDocumentFragment||"undefined"==typeof r.createElement}c=n}catch(a){c=s=!0}}();var v={elements:l.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==l.shivCSS,supportsUnknownElements:c,shivMethods:!1!==l.shivMethods,type:"default",shivDocument:o,createElement:a,createDocumentFragment:function(e,a){if(e||(e=t),c)return e.createDocumentFragment();for(var a=a||r(e),i=a.frag.cloneNode(),o=0,s=n(),l=s.length;l>o;o++)i.createElement(s[o]);return i}};e.html5=v,o(t)}(this,document);var InstantClick=function(e,t){function n(e){var t=e.indexOf("#");return 0>t?e:e.substr(0,t)}function r(e){for(;"A"!=e.nodeName;)e=e.parentNode;return e}function a(e){do{if(!e.hasAttribute)break;if(e.hasAttribute("data-instant"))return!1;if(e.hasAttribute("data-no-instant"))return!0}while(e=e.parentNode);return!1}function i(e){do{if(!e.hasAttribute)break;if(e.hasAttribute("data-no-instant"))return!1;if(e.hasAttribute("data-instant"))return!0}while(e=e.parentNode);return!1}function o(e,t){for(var n=0;n<z[e].length;n++)z[e][n](t)}function s(t,r,a,i){if(e.title=t,e.documentElement.replaceChild(r,e.body),a){history.pushState(null,null,a);var s=a.indexOf("#"),c=s>-1&&e.getElementById(a.substr(s+1)),l=0;if(c)for(;c.offsetParent;)l+=c.offsetTop,c=c.offsetParent;scrollTo(0,l),E=n(a)}else scrollTo(0,i);v(),W.done(),o("change",!1)}function c(){Y=!1,O=!1}function l(e){g(r(e.target).href)}function d(e){var t=r(e.target);t.addEventListener("mouseout",h),C?(T=t.href,w=setTimeout(g,C)):g(t.href)}function f(e){var t=r(e.target);x?t.removeEventListener("mousedown",l):t.removeEventListener("mouseover",d),g(t.href)}function u(e){e.which>1||e.metaKey||e.ctrlKey||(e.preventDefault(),p(r(e.target).href))}function h(){return w?(clearTimeout(w),void(w=!1)):void(Y&&!O&&(L.abort(),c()))}function m(){if(!(L.readyState<4)&&0!=L.status){if(F.ready=+new Date-F.start,o("receive"),L.getResponseHeader("Content-Type").match(/\/(x|ht|xht)ml/)){var t=e.implementation.createHTMLDocument("");t.documentElement.innerHTML=L.response
|