JUST EVO

Patches & tools for JUST Website

目前为 2021-09-24 提交的版本。查看 最新版本

// ==UserScript==
// @name        JUST EVO
// @description Patches & tools for JUST Website
// @namespace   https://gf.qytechs.cn/users/197529
// @version     0.1.0
// @author      kkocdko
// @license     Unlicense
// @match       *://*.just.edu.cn/*
// @noframes
// ==/UserScript==
"use strict";

const { addFloatButton } = {
  addFloatButton(text, onClick) /* 20200707-123713 */ {
    if (!document.addFloatButton) {
      const container = document.body
        .appendChild(document.createElement("div"))
        .attachShadow({ mode: "open" });
      container.innerHTML =
        "<style>:host{position:fixed;top:3px;left:3px;z-index:2147483647;height:0}#i{display:none}*{float:left;margin:4px;padding:1em;outline:0;border:0;border-radius:5px;background:#1e88e5;box-shadow:0 1px 4px rgba(0,0,0,.1);color:#fff;font-size:14px;line-height:0;transition:.3s}:active{background:#42a5f5;box-shadow:0 2px 5px rgba(0,0,0,.2)}button:active{transition:0s}:checked~button{visibility:hidden;opacity:0;transform:translateY(-3em)}label{border-radius:50%}:checked~label{opacity:.3;transform:translateY(3em)}</style><input id=i type=checkbox><label for=i></label>";
      document.addFloatButton = (text, onClick) => {
        const button = document.createElement("button");
        button.textContent = text;
        button.addEventListener("click", onClick);
        return container.appendChild(button);
      };
    }
    return document.addFloatButton(text, onClick);
  },
};

// Auto login
requestIdleCallback(() => document.querySelector(".login_btn")?.click());

// Fix JUST P.E.
setTimeout(() => {
  if (document.title === "江苏科大体育综合管理系统") {
    document
      .querySelector("#leftFrame")
      .contentDocument.querySelectorAll("[onclick]")
      .forEach((el) => {
        el.setAttribute(
          "onclick",
          el.getAttribute("onclick").replace("href(", "href=(")
        );
      });
  }
}, 1500);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址