xmoj-script 1.2.58 → 1.2.59

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ name: Qodana
2
+ on:
3
+ workflow_dispatch:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+ - dev
9
+
10
+ jobs:
11
+ qodana:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+ pull-requests: write
16
+ checks: write
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ with:
20
+ ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
21
+ fetch-depth: 0 # a full history is required for pull request analysis
22
+ - name: 'Qodana Scan'
23
+ uses: JetBrains/qodana-action@v2024.1
24
+ env:
25
+ QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
package/Update.json CHANGED
@@ -2464,6 +2464,17 @@
2464
2464
  }
2465
2465
  ],
2466
2466
  "Notes": "No release notes were provided for this release."
2467
+ },
2468
+ "1.2.59": {
2469
+ "UpdateDate": 1724836147641,
2470
+ "Prerelease": true,
2471
+ "UpdateContents": [
2472
+ {
2473
+ "PR": 718,
2474
+ "Description": "Prevent caching"
2475
+ }
2476
+ ],
2477
+ "Notes": "No release notes were provided for this release."
2467
2478
  }
2468
2479
  }
2469
2480
  }
package/XMOJ.user.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ==UserScript==
2
2
  // @name XMOJ
3
- // @version 1.2.58
3
+ // @version 1.2.59
4
4
  // @description XMOJ增强脚本
5
5
  // @author @XMOJ-Script-dev, @langningchen and the community
6
6
  // @namespace https://github/langningchen
@@ -416,7 +416,8 @@ let RequestAPI = (Action, Data, CallBack) => {
416
416
  method: "POST",
417
417
  url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.me/") + Action,
418
418
  headers: {
419
- "Content-Type": "application/json"
419
+ "Content-Type": "application/json",
420
+ "Cache-Control": "no-cache"
420
421
  },
421
422
  data: DataString,
422
423
  onload: (Response) => {
@@ -598,9 +599,11 @@ class NavbarStyler {
598
599
  }
599
600
  }
600
601
  }
601
- function replaceMarkdownImages(text,string) {
602
- return text.replace(/!\[.*?\]\(.*?\)/g,string);
602
+
603
+ function replaceMarkdownImages(text, string) {
604
+ return text.replace(/!\[.*?\]\(.*?\)/g, string);
603
605
  }
606
+
604
607
  async function main() {
605
608
  try {
606
609
  if (location.href.startsWith('http://')) {
@@ -880,15 +883,18 @@ async function main() {
880
883
  }
881
884
  if (UtilityEnabled("ResetType")) {
882
885
  if (document.querySelector("#profile") != undefined && document.querySelector("#profile").innerHTML == "登录") {
883
- let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
884
- PopupUL.innerHTML = `<li class="dropdown-item">登录</li>`;
885
- PopupUL.children[0].addEventListener("click", () => {
886
- location.href = "https://www.xmoj.tech/loginpage.php";
887
- });
888
- let parentLi = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li");
889
- document.addEventListener("click", (event) => { if (!parentLi.contains(event.target) && PopupUL.style.display === 'block') {hideDropdownItems();}});
890
- }
891
- else if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span") != undefined && document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span").innerText != "个人中心") {
886
+ let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
887
+ PopupUL.innerHTML = `<li class="dropdown-item">登录</li>`;
888
+ PopupUL.children[0].addEventListener("click", () => {
889
+ location.href = "https://www.xmoj.tech/loginpage.php";
890
+ });
891
+ let parentLi = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li");
892
+ document.addEventListener("click", (event) => {
893
+ if (!parentLi.contains(event.target) && PopupUL.style.display === 'block') {
894
+ hideDropdownItems();
895
+ }
896
+ });
897
+ } else if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span") != undefined && document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span").innerText != "个人中心") {
892
898
  let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
893
899
  PopupUL.style.cursor = 'pointer';
894
900
  PopupUL.innerHTML = `<li class="dropdown-item">修改帐号</li>
@@ -4149,7 +4155,7 @@ int main()
4149
4155
  }
4150
4156
  let LastsMessageCell = document.createElement("td");
4151
4157
  Row.appendChild(LastsMessageCell);
4152
- LastsMessageCell.innerText = replaceMarkdownImages(Data[i].LastsMessage,'[image]');
4158
+ LastsMessageCell.innerText = replaceMarkdownImages(Data[i].LastsMessage, '[image]');
4153
4159
  let SendTimeCell = document.createElement("td");
4154
4160
  Row.appendChild(SendTimeCell);
4155
4161
  SendTimeCell.innerHTML = GetRelativeTime(Data[i].SendTime);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmoj-script",
3
- "version": "1.2.58",
3
+ "version": "1.2.59",
4
4
  "description": "an improvement script for xmoj.tech",
5
5
  "main": "AddonScript.js",
6
6
  "scripts": {