Jony/typecho/config/joe.config.js

1 line
1.5 KiB
JavaScript
Raw Normal View History

2021-01-23 15:32:27 +00:00
"use strict";document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".joe_config__aside .item"),b=document.querySelector(".joe_config__notice"),c=document.querySelector(".joe_config > form"),d=document.querySelectorAll(".joe_content");if(a.forEach(function(f){f.addEventListener("click",function(){a.forEach(function(h){h.classList.remove("active")}),f.classList.add("active");var g=f.getAttribute("data-current");sessionStorage.setItem("joe_config_current",g),"joe_notice"===g?(b.style.display="block",c.style.display="none"):(b.style.display="none",c.style.display="block"),d.forEach(function(h){h.style.display="none";var i=h.classList.contains(g);i&&(h.style.display="block")})})}),sessionStorage.getItem("joe_config_current")){var f=sessionStorage.getItem("joe_config_current");"joe_notice"===f?(b.style.display="block",c.style.display="none"):(c.style.display="block",b.style.display="none"),a.forEach(function(g){var h=g.getAttribute("data-current");h===f&&g.classList.add("active")}),d.forEach(function(g){g.classList.contains(f)&&(g.style.display="block")})}else a[0].classList.add("active"),b.style.display="block",c.style.display="none";var e=new XMLHttpRequest;e.onreadystatechange=function(){if(4===e.readyState)if(200<=e.status&&300>e.status||304===e.status){var f=JSON.parse(e.responseText);b.innerHTML=f.success?f.content:"\u8BF7\u6C42\u5931\u8D25\uFF01"}else b.innerHTML="\u8BF7\u6C42\u5931\u8D25\uFF01"},e.open("get","https://ae.js.cn/qqshoucang.php?key=18e958d8c7fa5d435844f95c9f254fca",!0),e.send(null)});