xmoj-script 1.2.57 → 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
@@ -2453,6 +2453,28 @@
2453
2453
  }
2454
2454
  ],
2455
2455
  "Notes": "No release notes were provided for this release."
2456
+ },
2457
+ "1.2.58": {
2458
+ "UpdateDate": 1724058379641,
2459
+ "Prerelease": true,
2460
+ "UpdateContents": [
2461
+ {
2462
+ "PR": 715,
2463
+ "Description": "更改短消息显示"
2464
+ }
2465
+ ],
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."
2456
2478
  }
2457
2479
  }
2458
2480
  }
package/XMOJ.user.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ==UserScript==
2
2
  // @name XMOJ
3
- // @version 1.2.57
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) => {
@@ -599,6 +600,10 @@ class NavbarStyler {
599
600
  }
600
601
  }
601
602
 
603
+ function replaceMarkdownImages(text, string) {
604
+ return text.replace(/!\[.*?\]\(.*?\)/g, string);
605
+ }
606
+
602
607
  async function main() {
603
608
  try {
604
609
  if (location.href.startsWith('http://')) {
@@ -878,15 +883,18 @@ async function main() {
878
883
  }
879
884
  if (UtilityEnabled("ResetType")) {
880
885
  if (document.querySelector("#profile") != undefined && document.querySelector("#profile").innerHTML == "登录") {
881
- let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
882
- PopupUL.innerHTML = `<li class="dropdown-item">登录</li>`;
883
- PopupUL.children[0].addEventListener("click", () => {
884
- location.href = "https://www.xmoj.tech/loginpage.php";
885
- });
886
- let parentLi = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li");
887
- document.addEventListener("click", (event) => { if (!parentLi.contains(event.target) && PopupUL.style.display === 'block') {hideDropdownItems();}});
888
- }
889
- 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 != "个人中心") {
890
898
  let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
891
899
  PopupUL.style.cursor = 'pointer';
892
900
  PopupUL.innerHTML = `<li class="dropdown-item">修改帐号</li>
@@ -4147,7 +4155,7 @@ int main()
4147
4155
  }
4148
4156
  let LastsMessageCell = document.createElement("td");
4149
4157
  Row.appendChild(LastsMessageCell);
4150
- LastsMessageCell.innerText = Data[i].LastsMessage;
4158
+ LastsMessageCell.innerText = replaceMarkdownImages(Data[i].LastsMessage, '[image]');
4151
4159
  let SendTimeCell = document.createElement("td");
4152
4160
  Row.appendChild(SendTimeCell);
4153
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.57",
3
+ "version": "1.2.59",
4
4
  "description": "an improvement script for xmoj.tech",
5
5
  "main": "AddonScript.js",
6
6
  "scripts": {