diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..45570f86 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: Qodana +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + - dev + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2024.1 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/Update.json b/Update.json index f01e7aed..cd6a1061 100644 --- a/Update.json +++ b/Update.json @@ -2464,6 +2464,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.2.59": { + "UpdateDate": 1724836147641, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 718, + "Description": "Prevent caching" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 667a0e14..a2b65222 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.2.58 +// @version 1.2.59 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen @@ -416,7 +416,8 @@ let RequestAPI = (Action, Data, CallBack) => { method: "POST", url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.me/") + Action, headers: { - "Content-Type": "application/json" + "Content-Type": "application/json", + "Cache-Control": "no-cache" }, data: DataString, onload: (Response) => { @@ -598,9 +599,11 @@ class NavbarStyler { } } } -function replaceMarkdownImages(text,string) { - return text.replace(/!\[.*?\]\(.*?\)/g,string); + +function replaceMarkdownImages(text, string) { + return text.replace(/!\[.*?\]\(.*?\)/g, string); } + async function main() { try { if (location.href.startsWith('http://')) { @@ -880,15 +883,18 @@ async function main() { } if (UtilityEnabled("ResetType")) { if (document.querySelector("#profile") != undefined && document.querySelector("#profile").innerHTML == "登录") { - let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul"); - PopupUL.innerHTML = ``; - PopupUL.children[0].addEventListener("click", () => { - location.href = "https://www.xmoj.tech/loginpage.php"; - }); - let parentLi = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li"); - document.addEventListener("click", (event) => { if (!parentLi.contains(event.target) && PopupUL.style.display === 'block') {hideDropdownItems();}}); - } - 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 != "个人中心") { + let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul"); + PopupUL.innerHTML = ``; + PopupUL.children[0].addEventListener("click", () => { + location.href = "https://www.xmoj.tech/loginpage.php"; + }); + let parentLi = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li"); + document.addEventListener("click", (event) => { + if (!parentLi.contains(event.target) && PopupUL.style.display === 'block') { + hideDropdownItems(); + } + }); + } 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 != "个人中心") { let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul"); PopupUL.style.cursor = 'pointer'; PopupUL.innerHTML = ` @@ -4149,7 +4155,7 @@ int main() } let LastsMessageCell = document.createElement("td"); Row.appendChild(LastsMessageCell); - LastsMessageCell.innerText = replaceMarkdownImages(Data[i].LastsMessage,'[image]'); + LastsMessageCell.innerText = replaceMarkdownImages(Data[i].LastsMessage, '[image]'); let SendTimeCell = document.createElement("td"); Row.appendChild(SendTimeCell); SendTimeCell.innerHTML = GetRelativeTime(Data[i].SendTime); diff --git a/package.json b/package.json index 8db9e4c6..480d5f9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.2.58", + "version": "1.2.59", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": {