xmoj-script 1.2.14 → 1.2.15

Sign up to get free protection for your applications and to get access to all the features.
package/Update.json CHANGED
@@ -1848,6 +1848,17 @@
1848
1848
  }
1849
1849
  ],
1850
1850
  "Notes": "No release notes were provided for this release."
1851
+ },
1852
+ "1.2.15": {
1853
+ "UpdateDate": 1722472465539,
1854
+ "Prerelease": true,
1855
+ "UpdateContents": [
1856
+ {
1857
+ "PR": 581,
1858
+ "Description": "fix copymd"
1859
+ }
1860
+ ],
1861
+ "Notes": "No release notes were provided for this release."
1851
1862
  }
1852
1863
  }
1853
1864
  }
package/XMOJ.user.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ==UserScript==
2
2
  // @name XMOJ
3
- // @version 1.2.14
3
+ // @version 1.2.15
4
4
  // @description XMOJ增强脚本
5
5
  // @author @XMOJ-Script-dev, @langningchen and the community
6
6
  // @namespace https://github/langningchen
@@ -1295,17 +1295,19 @@ async function main() {
1295
1295
  return Response.text();
1296
1296
  }).then((Response) => {
1297
1297
  let ParsedDocument = new DOMParser().parseFromString(Response, "text/html");
1298
- let Temp = ParsedDocument.querySelectorAll(".cnt-row");
1298
+ let Temp = ParsedDocument.querySelectorAll(".cnt-row-body");
1299
+ if (UtilityEnabled("DebugMode"))
1300
+ console.log(Temp);
1299
1301
  for (let i = 0; i < Temp.length; i++) {
1300
- if (Temp[i].children[1].children[0].className == "content") {
1302
+ if (Temp[i].children[0].className === "content lang_cn") {
1301
1303
  let CopyMDButton = document.createElement("button");
1302
1304
  CopyMDButton.className = "btn btn-sm btn-outline-secondary copy-btn";
1303
1305
  CopyMDButton.innerText = "复制";
1304
1306
  CopyMDButton.style.marginLeft = "10px";
1305
1307
  CopyMDButton.type = "button";
1306
- document.querySelectorAll(".cnt-row")[i].children[0].appendChild(CopyMDButton);
1308
+ document.querySelectorAll(".cnt-row-head.title")[i].appendChild(CopyMDButton);
1307
1309
  CopyMDButton.addEventListener("click", () => {
1308
- GM_setClipboard(Temp[i].children[1].children[0].innerText.trim().replaceAll("\n\t", "\n").replaceAll("\n\n", "\n").replaceAll("\n\n", "\n"));
1310
+ GM_setClipboard(Temp[i].children[0].innerText.trim().replaceAll("\n\t", "\n").replaceAll("\n\n", "\n"));
1309
1311
  CopyMDButton.innerText = "复制成功";
1310
1312
  setTimeout(() => {
1311
1313
  CopyMDButton.innerText = "复制";
@@ -3541,7 +3543,7 @@ int main()
3541
3543
  CopyMDButton.type = "button";
3542
3544
  document.querySelector("body > div > div.mt-3 > center > h2").appendChild(CopyMDButton);
3543
3545
  CopyMDButton.addEventListener("click", () => {
3544
- GM_setClipboard(ParsedDocument.querySelector("body > div > div > div").innerText.trim().replaceAll("\n\t", "\n").replaceAll("\n\n", "\n").replaceAll("\n\n", "\n"));
3546
+ GM_setClipboard(ParsedDocument.querySelector("body > div > div > div").innerText.trim().replaceAll("\n\t", "\n").replaceAll("\n\n", "\n"));
3545
3547
  CopyMDButton.innerText = "复制成功";
3546
3548
  setTimeout(() => {
3547
3549
  CopyMDButton.innerText = "复制";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmoj-script",
3
- "version": "1.2.14",
3
+ "version": "1.2.15",
4
4
  "description": "an improvement script for xmoj.tech",
5
5
  "main": "AddonScript.js",
6
6
  "scripts": {