xmoj-script 1.2.69 → 1.2.71

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,6 @@ const LabelList = [
13
13
  "dependency",
14
14
  "designing",
15
15
  "documentation",
16
- "docs",
17
16
  "duplicate",
18
17
  "discussing",
19
18
  "enhancement",
package/Update.json CHANGED
@@ -2625,6 +2625,36 @@
2625
2625
  }
2626
2626
  ],
2627
2627
  "Notes": "No release notes were provided for this release."
2628
+ },
2629
+ "1.2.70": {
2630
+ "UpdateDate": 1728784924115,
2631
+ "Prerelease": false,
2632
+ "UpdateContents": [
2633
+ {
2634
+ "PR": 741,
2635
+ "Description": "Fix Duplicate Names (warned by Qoanda)"
2636
+ },
2637
+ {
2638
+ "PR": 743,
2639
+ "Description": "feat: 优化等待状态的显示"
2640
+ },
2641
+ {
2642
+ "PR": 748,
2643
+ "Description": "变动cdn源"
2644
+ }
2645
+ ],
2646
+ "Notes": "No release notes were provided for this release."
2647
+ },
2648
+ "1.2.71": {
2649
+ "UpdateDate": 1732545478542,
2650
+ "Prerelease": true,
2651
+ "UpdateContents": [
2652
+ {
2653
+ "PR": 753,
2654
+ "Description": "fix: 修复代码长度单位换算错误"
2655
+ }
2656
+ ],
2657
+ "Notes": "No release notes were provided for this release."
2628
2658
  }
2629
2659
  }
2630
2660
  }
package/XMOJ.user.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ==UserScript==
2
2
  // @name XMOJ
3
- // @version 1.2.69
3
+ // @version 1.2.71
4
4
  // @description XMOJ增强脚本
5
5
  // @author @XMOJ-Script-dev, @langningchen and the community
6
6
  // @namespace https://github/langningchen
@@ -340,6 +340,28 @@ let SizeToStringSize = (Memory) => {
340
340
  }
341
341
  }
342
342
  };
343
+ let CodeSizeToStringSize = (Memory) => {
344
+ try {
345
+ if (UtilityEnabled("AddUnits")) {
346
+ if (Memory < 1024) {
347
+ return Memory + "B";
348
+ } else if (Memory < 1024 * 1024) {
349
+ return (Memory / 1024).toFixed(2) + "KB";
350
+ } else if (Memory < 1024 * 1024 * 1024) {
351
+ return (Memory / 1024 / 1024).toFixed(2) + "MB";
352
+ } else {
353
+ return (Memory / 1024 / 1024 / 1024).toFixed(2) + "GB";
354
+ }
355
+ } else {
356
+ return Memory;
357
+ }
358
+ } catch (e) {
359
+ console.error(e);
360
+ if (UtilityEnabled("DebugMode")) {
361
+ SmartAlert("XMOJ-Script internal error!\n\n" + e + "\n\n" + "If you see this message, please report it to the developer.\nDon't forget to include console logs and a way to reproduce the error!\n\nDon't want to see this message? Disable DebugMode.");
362
+ }
363
+ }
364
+ };
343
365
  /**
344
366
  * Converts a time value to a string representation.
345
367
  * @param {number} Time - The time value to convert.
@@ -1836,7 +1858,7 @@ async function main() {
1836
1858
  Temp[i].childNodes[3].childNodes[0].innerText = SizeToStringSize(Temp[i].childNodes[3].childNodes[0].innerText);
1837
1859
  Temp[i].childNodes[4].childNodes[0].innerText = TimeToStringTime(Temp[i].childNodes[4].childNodes[0].innerText);
1838
1860
  Temp[i].childNodes[5].innerText = Temp[i].childNodes[5].childNodes[0].innerText;
1839
- Temp[i].childNodes[6].innerText = SizeToStringSize(Temp[i].childNodes[6].innerText.substring(0, Temp[i].childNodes[6].innerText.length - 1));
1861
+ Temp[i].childNodes[6].innerText = CodeSizeToStringSize(Temp[i].childNodes[6].innerText.substring(0, Temp[i].childNodes[6].innerText.length - 1));
1840
1862
  Temp[i].childNodes[9].innerText = (Temp[i].childNodes[9].innerText == "" ? "否" : "是");
1841
1863
  }
1842
1864
  if (SearchParams.get("cid") === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmoj-script",
3
- "version": "1.2.69",
3
+ "version": "1.2.71",
4
4
  "description": "an improvement script for xmoj.tech",
5
5
  "main": "AddonScript.js",
6
6
  "scripts": {