Difference between revisions of "Template:Judd UK/Scripts/wiki"

 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* JSWiki Javascript Library v0.4.3
+
var st,qs = document.querySelector.bind(document),
*
+
     magic = !1,
* Copyright Aleksandur Murfitt
+
     objectList = null,
* Released under the MIT license
+
    qsa = document.querySelectorAll.bind(document),
* (<[URL]>)/license.txt
+
    page = (location.pathname.length >14)?location.pathname.substring(14).replace(/\//g, "*"):"Home",
*
+
    mouseDetected = !1,
* Date: 2017-10-01T12:38Z
+
    safe = !0;
*/
+
if (window.NodeList && !NodeList.prototype.forEach) {
var qs = document.querySelector.bind(document),
+
    NodeList.prototype.forEach = function (callback, thisArg) {
     magic = false,
+
        thisArg = thisArg || window;
     objectList = null;
+
        for (var i = 0; i < this.length; i++) {
var qsa = document.querySelectorAll.bind(document);
+
            callback.call(thisArg, this[i], i, this);
var page = location.pathname.slice(14, -5).replace(/\//g, "*");
+
        }
var html = qs(".JC" + ('content' in document.createElement('template')) ? "template" : "#content-template");
+
    };
 
+
}
var mouseDetected = false;
+
 
+
 
function animate() {
 
function animate() {
     if (!safe) return;
+
     safe && (handle.style.webkitAnimationName = "handle", handle.style.animationName = "handle", sprite.style.webkitAnimationName = "sprite", sprite.style.animationName = "sprite", safe = !1)
    handle.style.webkitAnimationName = 'handle';
+
    handle.style.animationName = 'handle';
+
    sprite.style.webkitAnimationName = 'sprite';
+
    sprite.style.animationName = 'sprite';
+
    safe = false;
+
 
}
 
}
  
function loadStyleSheet(src) {
+
function loadStyleSheet(e) {
     if (document.createStyleSheet) document.createStyleSheet(src);
+
     if (document.createStyleSheet) document.createStyleSheet(e);
 
     else {
 
     else {
         var stylesheet = document.createElement('link');
+
         var t = document.createElement("link");
         stylesheet.href = src;
+
         t.href = e, t.rel = "stylesheet", t.type = "text/css", document.getElementsByTagName("head")[0].appendChild(t)
        stylesheet.rel = 'stylesheet';
+
        stylesheet.type = 'text/css';
+
        document.getElementsByTagName('head')[0].appendChild(stylesheet);
+
 
     }
 
     }
 
}
 
}
  
function AJAX(url, callback) {
+
function AJAX(e, t, z) {
     var xmlhttp;
+
     clearTimeout(st);
     xmlhttp = new XMLHttpRequest();
+
     var n, lb = qs(".JC #loadbar");
     xmlhttp.onreadystatechange = function () {
+
     lb.style.opacity = "1";
         if (xmlhttp.readyState == 4)
+
    (n = new XMLHttpRequest).onreadystatechange = function () {
            callback(xmlhttp);
+
         if (z) lb.style.width = n.readyState * 25 + "%";
     };
+
        4 == n.readyState && t(n)
    xmlhttp.open("GET", url, true);
+
     }, n.open("GET", e, !0), n.send(), st = setTimeout(function () {
    xmlhttp.send();
+
        lb.style.opacity = "0";
 +
        st = setTimeout(function () {
 +
            lb.style.width = "0%"
 +
        }, 500)
 +
    }, 1000)
 
}
 
}
  
 
function createindex() {
 
function createindex() {
     var obj = contentIndexData;
+
     var e = contentIndexData;
     Object.keys(obj.project).forEach(function (e, i) {
+
     Object.keys(e.project).forEach(function (t, n) {
         if (typeof (obj.project[e]) == 'string') {
+
         "string" == typeof e.project[t] ? qs("#O2>ul").innerHTML += '<li><a href="£' + e.project[t] + '">' + t + "</a></li>" : (qs("#O2>ul").innerHTML += '<li id="O2-S' + n + '"><a href="#O2-S' + n + '">' + t + "</a></li>", qs("#O2>ul").innerHTML += '<li><ul class="sub"></ul></li>', e.project[t].forEach(function (e) {
            qs('#O2>ul').innerHTML += '<li><a href="£' + obj.project[e] + '">' + e + '</a></li>';
+
            qs("#O2>ul>li:last-child>ul").innerHTML += '<li><a href="£' + e.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + '">' + e + "</a></li>"
        } else {
+
        }))
            qs('#O2>ul').innerHTML += '<li id="O2-S' + i + '"><a href="#O2-S' + i + '">' + e + '</a></li>';
+
     }), Object.keys(e.team).forEach(function (t, n) {
            qs('#O2>ul').innerHTML += '<li><ul class="sub"></ul></li>';
+
         "string" == typeof e.team[t] ? qs("#O4>ul").innerHTML += '<li><a href="£' + e.team[t] + '">' + t + "</a></li>" : (qs("#O4>ul").innerHTML += '<li id="O4-S' + n + '"><a href="#O4-S' + n + '">' + t + "</a></li>", qs("#O4>ul").innerHTML += '<li><ul class="sub"></ul></li>', e.team[t].forEach(function (e) {
            obj.project[e].forEach(function (n) {
+
            qs("#O4>ul>li:last-child>ul").innerHTML += '<li><a href="£' + e.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + '">' + e + "</a></li>"
                qs('#O2>ul>li:last-child>ul').innerHTML += '<li><a href="£' + n.replace(/\s+/g, '-').replace(/[^A-Z0-9-_]+/gi, '') + '">' + n + '</a></li>';
+
        }))
            });
+
     }), Object.keys(e.humanPractices).forEach(function (t, n) {
        }
+
         "string" == typeof e.humanPractices[t] ? qs("#O3>ul").innerHTML += '<li><a href="£' + e.humanPractices[t] + '">' + t + "</a></li>" : (qs("#O3>ul").innerHTML += '<li id="O3-S' + n + '"><a href="#O3-S' + n + '">' + t + "</a></li>", qs("#O3>ul").innerHTML += '<li><ul class="sub"></ul></li>', e.humanPractices[t].forEach(function (e) {
     });
+
            qs("#O3>ul>li:last-child>ul").innerHTML += '<li><a href="£' + e.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + '">' + e + "</a></li>"
    Object.keys(obj.team).forEach(function (e, i) {
+
        }))
         if (typeof (obj.team[e]) == 'string') {
+
     })
            qs('#O4>ul').innerHTML += '<li><a href="£' + obj.team[e] + '">' + e + '</a></li>';
+
        } else {
+
            qs('#O4>ul').innerHTML += '<li id="O4-S' + i + '"><a href="#O4-S' + i + '">' + e + '</a></li>';
+
            qs('#O4>ul').innerHTML += '<li><ul class="sub"></ul></li>';
+
            obj.team[e].forEach(function (n) {
+
                qs('#O4>ul>li:last-child>ul').innerHTML += '<li><a href="£' + n.replace(/\s+/g, '-').replace(/[^A-Z0-9-_]+/gi, '') + '">' + n + '</a></li>';
+
            });
+
        }
+
     });
+
}
+
window.onpopstate = function (e) {
+
    if (magic) {
+
         magic = false;
+
        return;
+
    }
+
    if (location.pathname.replace(/\//g, "*").slice(14, -5) != page) {
+
        loadPage(location.pathname.replace(/\//g, "*").slice(14, -5));
+
     } else
+
        return;
+
 
+
 
}
 
}
  
 
function newPage(e) {
 
function newPage(e) {
     e = window.e || e;
+
     var t = (e = window.e || e).target.getAttribute("href");
    var href = e.target.getAttribute("href");
+
     if (null !== t && ("£" == t[0] || "#" == t[0])) {
     if (href === null || (href[0] != "£" && href[0] != "#")) return;
+
        if ("#" == t[0]) {
    if (href[0] == "#") {
+
            magic = !0;
        magic = true;
+
            try {
        try {
+
                qs(".JC #content-body " + t).scrollIntoView({
            qs(".JC #content-body " + href).scrollIntoView({
+
                    behavior: "smooth",
                behavior: "smooth",
+
                    block: "start",
                block: "start",
+
                    inline: "nearest"
                inline: "nearest"
+
                })
            });
+
            } catch (e) {
        } catch (e) {
+
                location.hash = t
            location.hash = href;
+
            }
 +
            return t == "#" + e.target.parentElement.id && window.scrollTo(0, document.body.scrollTop), void e.preventDefault()
 
         }
 
         }
         if (href == "#" + e.target.parentElement.id) {
+
         e.preventDefault(), loadPage(t = t.substring(1)), window.history.pushState(null, null, "/Team:Judd_UK/" + t.replace("*", "/"))
            window.scrollTo(0, document.body.scrollTop);
+
        }
+
        e.preventDefault();
+
        return;
+
 
     }
 
     }
    e.preventDefault();
 
    href = href.substring(1);
 
    loadPage(href);
 
    window.history.pushState(null, null, "/Team:Judd_UK/" + href.replace('*', "/") + ".html");
 
 
}
 
}
  
function loadPage(href) {
+
function renderPage() {
     qs(".JC #content-container").style.visibility = "hidden";
+
     var n = html.content || html;
    AJAX("/Team:Judd_UK/Pages/" + href + "?action=raw&ctype=text/plain", function (xmlhttp) {
+
    qs(".JC #content-body").innerHTML = "", qs(".JC #content-index ol").innerHTML = "", "false" != n.querySelector("div").dataset.templated && qsa("[data-selector]").forEach(function (e) {
        if (xmlhttp.status == 200) {
+
        var t = n.querySelector(e.dataset.selector);
            page = href;
+
        e.innerHTML = t ? e.dataset.text ? t.innerText : t.outerHTML : ""
            html.innerHTML = xmlhttp.responseText;
+
    }), "false" != n.querySelector("div").dataset.wiki ? (qs(".JC #content-index").style.display = "block", n.querySelectorAll("h2, h3").forEach(function (e, t) {
            var content = (html.content || html);
+
        "H2" == e.tagName ? qs(".JC #content-index ol").innerHTML += '<li><a href="#' + e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t + '">' + e.innerHTML + "</a></li>" : qs(".JC #content-index ol").lastChild.querySelector("ol") ? qs(".JC #content-index ol").lastChild.querySelector("ol").innerHTML += '<li><a href="#' + e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t + '">' + e.innerHTML + "</a></li>" : qs(".JC #content-index ol").lastChild.innerHTML += '<ol><li><a href="#' + e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t + '">' + e.innerHTML + "</a></li></ol>"
            qs('.JC #content-body').innerHTML = "";
+
    }), n.querySelectorAll("div h2, div h3").forEach(function (e, t) {
            qs('.JC #content-index ol').innerHTML = "";
+
        e.id = e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t
            if (content.querySelector("div").dataset.templated != "false")
+
    })) : qs(".JC #content-index").style.display = "none", qs(".JC #content-body").innerHTML = n.querySelector("div") ? n.querySelector("div").innerHTML : "";
                qsa("[data-selector]").forEach(function (elem) {
+
    n.querySelectorAll("script").forEach(function (p) {
                    var i = (content.querySelector(elem.dataset.selector));
+
         if (p.dataset.run != "false") eval(p.innerHTML)
                    if (i)
+
                        elem.innerHTML = (elem.dataset.text) ? i.innerText : i.outerHTML;
+
                    else
+
                        elem.innerHTML = "";
+
                });
+
            if (content.querySelector("div").dataset.wiki != "false") {
+
                qs(".JC #content-index").style.display = "block";
+
                content.querySelectorAll("h2, h3").forEach(function (elem, index) {
+
                    if (elem.tagName == "H2")
+
                        qs(".JC #content-index ol").innerHTML += '<li><a href="#' + elem.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + index + '">' + elem.innerHTML + '</a></li>';
+
                    else
+
                    if (qs(".JC #content-index ol").lastChild.querySelector("ol"))
+
                        qs(".JC #content-index ol").lastChild.querySelector("ol").innerHTML += '<li><a href="#' + elem.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + index + '">' + elem.innerHTML + '</a></li>';
+
                    else {
+
                        qs(".JC #content-index ol").lastChild.innerHTML += '<ol><li><a href="#' + elem.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + index + '">' + elem.innerHTML + '</a></li></ol>';
+
                    }
+
                });
+
                content.querySelectorAll("div h2, div h3").forEach(function (elem, index) {
+
                    elem.id = elem.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + index;
+
                });
+
            } else
+
                qs(".JC #content-index").style.display = "none";
+
            qs(".JC #content-body").innerHTML = content.querySelector("div") ? content.querySelector("div").innerHTML : "";
+
            qs(".JC #content-container").style.visibility = "visible";
+
            animate();
+
         } else {
+
            loadPage("404");
+
        }
+
 
     });
 
     });
 +
    window.slides = document.querySelectorAll('#slides .slide');
 
}
 
}
  
var handle = qs(".JC #handle");
+
function loadPage(e) {
var sprite = qs(".JC #sprite");
+
    qs(".JC #content-container").style.visibility = "hidden", AJAX("/Team:Judd_UK/Pages/" + e + "?action=raw&ctype=text/plain", function (t) {
var safe = true;
+
        if (200 == t.status) {
qs("#HQ_page #bodyContent>.mw-content-ltr").classList.remove("mw-content-ltr");
+
            page = e, html.innerHTML = t.responseText;
qs("#HQ_page #bodyContent").id = "";
+
            renderPage(), qs(".JC #content-container").style.visibility = "visible", animate()
qs("#HQ_page").id = "";
+
        } else loadPage("404")
loadPage(page);
+
    }, true)
createindex();
+
}
qs(".JC #sprite").addEventListener((qs(".JC").style.animationName === undefined ? "webkit" : "") + 'animationend', function () {
+
window.onpopstate = function (e) {
    handle.style.webkitAnimationName = '';
+
    return magic ? void(magic = !1) : void((location.pathname.length >14)?location.pathname.substring(14).replace(/\//g, "*"):"Home" != page && loadPage((location.pathname.length >14)?location.pathname.substring(14).replace(/\//g, "*"):"Home"))
    handle.style.animationName = '';
+
};
    sprite.style.webkitAnimationName = '';
+
document.addEventListener("DOMContentLoaded", function () {
    sprite.style.animationName = '';
+
window.html = qs("template");
    safe = true;
+
    var handle = qs(".JC #handle"),
}, false);
+
    sprite = qs(".JC #sprite");
qs(".JC #main-img").onmouseenter = animate;
+
    qs("#HQ_page #bodyContent>.mw-content-ltr").classList.remove("mw-content-ltr"), qs("#HQ_page #bodyContent").id = "", qs("#HQ_page").id = "", page != "Home" ? loadPage(page) : "", createindex(), qs(".JC #sprite").addEventListener((void 0 === qs(".JC").style.animationName ? "webkit" : "") + "animationend", function () {
document.addEventListener("click", newPage, false);
+
        handle.style.webkitAnimationName = "", handle.style.animationName = "", sprite.style.webkitAnimationName = "", sprite.style.animationName = "", safe = !0
document.addEventListener("mousemove", function () {
+
    }, !1), qs(".JC #main-img").onmouseenter = animate, document.addEventListener("click", newPage, !1), document.addEventListener("mousemove", function () {
    if (mouseDetected)
+
        mouseDetected && (qs("#topstyles").innerHTML = ""), mouseDetected = !0, document.removeEventListener("mousemove", arguments.callee)
        qs("#topstyles").innerHTML = "";
+
    }, !1), qs("#topstyles").innerHTML = ".JC #O1 a{transform:translateX(-150%)!important;opacity:1!important}.JC #O2 a{transform: translateX(-50%)!important;opacity:1!important}.JC #O3 a{transform:translateX(50%)!important;opacity:1!important}.JC #O4 a{transform:translateX(150%)!important;opacity:1!important}", setTimeout(function () {
    mouseDetected = true;
+
        mouseDetected ? qs("#topstyles").innerHTML = "" : mouseDetected = !0
    document.removeEventListener("mousemove", arguments.callee);
+
    }, 4e3), loadStyleSheet("https://fonts.googleapis.com/css?family=Raleway|Open+Sans:300"), loadStyleSheet("https://fonts.googleapis.com/css?family=Creepster");
}, false);
+
});
qs("#topstyles").innerHTML = ".JC #O1 a{transform:translateX(-150%)!important;opacity:1!important}.JC #O2 a{transform: translateX(-50%)!important;opacity:1!important}.JC #O3 a{transform:translateX(50%)!important;opacity:1!important}.JC #O4 a{transform:translateX(150%)!important;opacity:1!important}";
+
setTimeout(function () {
+
    if (mouseDetected)
+
        qs("#topstyles").innerHTML = "";
+
    else mouseDetected = true;
+
}, 4000);
+
loadStyleSheet("https://fonts.googleapis.com/css?family=Raleway|Open+Sans:300");
+
loadStyleSheet("https://fonts.googleapis.com/css?family=Creepster");
+

Latest revision as of 19:51, 1 November 2017

var st,qs = document.querySelector.bind(document),

   magic = !1,
   objectList = null,
   qsa = document.querySelectorAll.bind(document),
   page = (location.pathname.length >14)?location.pathname.substring(14).replace(/\//g, "*"):"Home",
   mouseDetected = !1,
   safe = !0;

if (window.NodeList && !NodeList.prototype.forEach) {

   NodeList.prototype.forEach = function (callback, thisArg) {
       thisArg = thisArg || window;
       for (var i = 0; i < this.length; i++) {
           callback.call(thisArg, this[i], i, this);
       }
   };

} function animate() {

   safe && (handle.style.webkitAnimationName = "handle", handle.style.animationName = "handle", sprite.style.webkitAnimationName = "sprite", sprite.style.animationName = "sprite", safe = !1)

}

function loadStyleSheet(e) {

   if (document.createStyleSheet) document.createStyleSheet(e);
   else {
       var t = document.createElement("link");
       t.href = e, t.rel = "stylesheet", t.type = "text/css", document.getElementsByTagName("head")[0].appendChild(t)
   }

}

function AJAX(e, t, z) {

   clearTimeout(st);
   var n, lb = qs(".JC #loadbar");
   lb.style.opacity = "1";
   (n = new XMLHttpRequest).onreadystatechange = function () {
       if (z) lb.style.width = n.readyState * 25 + "%";
       4 == n.readyState && t(n)
   }, n.open("GET", e, !0), n.send(), st = setTimeout(function () {
       lb.style.opacity = "0";
       st = setTimeout(function () {
           lb.style.width = "0%"
       }, 500)
   }, 1000)

}

function createindex() {

   var e = contentIndexData;
   Object.keys(e.project).forEach(function (t, n) {
"string" == typeof e.project[t] ? qs("#O2>ul").innerHTML += '
  • <a href="£' + e.project[t] + '">' + t + "</a>
  • " : (qs("#O2>ul").innerHTML += '
  • <a href="#O2-S' + n + '">' + t + "</a>
  • ", qs("#O2>ul").innerHTML += '
    • ', e.project[t].forEach(function (e) { qs("#O2>ul>li:last-child>ul").innerHTML += '
    • <a href="£' + e.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + '">' + e + "</a>
    • "
             }))
         }), Object.keys(e.team).forEach(function (t, n) {
      
      "string" == typeof e.team[t] ? qs("#O4>ul").innerHTML += '
    • <a href="£' + e.team[t] + '">' + t + "</a>
    • " : (qs("#O4>ul").innerHTML += '
    • <a href="#O4-S' + n + '">' + t + "</a>
    • ", qs("#O4>ul").innerHTML += '
      • ', e.team[t].forEach(function (e) { qs("#O4>ul>li:last-child>ul").innerHTML += '
      • <a href="£' + e.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + '">' + e + "</a>
      • "
               }))
           }), Object.keys(e.humanPractices).forEach(function (t, n) {
        
        "string" == typeof e.humanPractices[t] ? qs("#O3>ul").innerHTML += '
      • <a href="£' + e.humanPractices[t] + '">' + t + "</a>
      • " : (qs("#O3>ul").innerHTML += '
      • <a href="#O3-S' + n + '">' + t + "</a>
      • ", qs("#O3>ul").innerHTML += '
        • ', e.humanPractices[t].forEach(function (e) { qs("#O3>ul>li:last-child>ul").innerHTML += '
        • <a href="£' + e.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + '">' + e + "</a>
        • "
                 }))
             })
          

          }

          function newPage(e) {

             var t = (e = window.e || e).target.getAttribute("href");
             if (null !== t && ("£" == t[0] || "#" == t[0])) {
                 if ("#" == t[0]) {
                     magic = !0;
                     try {
                         qs(".JC #content-body " + t).scrollIntoView({
                             behavior: "smooth",
                             block: "start",
                             inline: "nearest"
                         })
                     } catch (e) {
                         location.hash = t
                     }
                     return t == "#" + e.target.parentElement.id && window.scrollTo(0, document.body.scrollTop), void e.preventDefault()
                 }
                 e.preventDefault(), loadPage(t = t.substring(1)), window.history.pushState(null, null, "/Team:Judd_UK/" + t.replace("*", "/"))
             }
          

          }

          function renderPage() {

             var n = html.content || html;
             qs(".JC #content-body").innerHTML = "", qs(".JC #content-index ol").innerHTML = "", "false" != n.querySelector("div").dataset.templated && qsa("[data-selector]").forEach(function (e) {
                 var t = n.querySelector(e.dataset.selector);
                 e.innerHTML = t ? e.dataset.text ? t.innerText : t.outerHTML : ""
             }), "false" != n.querySelector("div").dataset.wiki ? (qs(".JC #content-index").style.display = "block", n.querySelectorAll("h2, h3").forEach(function (e, t) {
          
          "H2" == e.tagName ? qs(".JC #content-index ol").innerHTML += '
        • <a href="#' + e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t + '">' + e.innerHTML + "</a>
        • " : qs(".JC #content-index ol").lastChild.querySelector("ol") ? qs(".JC #content-index ol").lastChild.querySelector("ol").innerHTML += '
        • <a href="#' + e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t + '">' + e.innerHTML + "</a>
        • " : qs(".JC #content-index ol").lastChild.innerHTML += '
          1. <a href="#' + e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t + '">' + e.innerHTML + "</a>
          "
             }), n.querySelectorAll("div h2, div h3").forEach(function (e, t) {
                 e.id = e.innerHTML.replace(/\s+/g, "-").replace(/[^A-Z0-9-_]+/gi, "") + "-" + t
             })) : qs(".JC #content-index").style.display = "none", qs(".JC #content-body").innerHTML = n.querySelector("div") ? n.querySelector("div").innerHTML : "";
             n.querySelectorAll("script").forEach(function (p) {
                 if (p.dataset.run != "false") eval(p.innerHTML)
             });
             window.slides = document.querySelectorAll('#slides .slide');
          

          }

          function loadPage(e) {

             qs(".JC #content-container").style.visibility = "hidden", AJAX("/Team:Judd_UK/Pages/" + e + "?action=raw&ctype=text/plain", function (t) {
                 if (200 == t.status) {
                     page = e, html.innerHTML = t.responseText;
                     renderPage(), qs(".JC #content-container").style.visibility = "visible", animate()
                 } else loadPage("404")
             }, true)
          

          } window.onpopstate = function (e) {

             return magic ? void(magic = !1) : void((location.pathname.length >14)?location.pathname.substring(14).replace(/\//g, "*"):"Home" != page && loadPage((location.pathname.length >14)?location.pathname.substring(14).replace(/\//g, "*"):"Home"))
          

          }; document.addEventListener("DOMContentLoaded", function () { window.html = qs("template");

             var handle = qs(".JC #handle"),
             sprite = qs(".JC #sprite");
             qs("#HQ_page #bodyContent>.mw-content-ltr").classList.remove("mw-content-ltr"), qs("#HQ_page #bodyContent").id = "", qs("#HQ_page").id = "", page != "Home" ? loadPage(page) : "", createindex(), qs(".JC #sprite").addEventListener((void 0 === qs(".JC").style.animationName ? "webkit" : "") + "animationend", function () {
                 handle.style.webkitAnimationName = "", handle.style.animationName = "", sprite.style.webkitAnimationName = "", sprite.style.animationName = "", safe = !0
             }, !1), qs(".JC #main-img").onmouseenter = animate, document.addEventListener("click", newPage, !1), document.addEventListener("mousemove", function () {
                 mouseDetected && (qs("#topstyles").innerHTML = ""), mouseDetected = !0, document.removeEventListener("mousemove", arguments.callee)
             }, !1), qs("#topstyles").innerHTML = ".JC #O1 a{transform:translateX(-150%)!important;opacity:1!important}.JC #O2 a{transform: translateX(-50%)!important;opacity:1!important}.JC #O3 a{transform:translateX(50%)!important;opacity:1!important}.JC #O4 a{transform:translateX(150%)!important;opacity:1!important}", setTimeout(function () {
                 mouseDetected ? qs("#topstyles").innerHTML = "" : mouseDetected = !0
             }, 4e3), loadStyleSheet("https://fonts.googleapis.com/css?family=Raleway%7COpen+Sans:300"), loadStyleSheet("https://fonts.googleapis.com/css?family=Creepster");
          

          });