xmoj-script 1.2.11 → 1.2.12
Sign up to get free protection for your applications and to get access to all the features.
- package/Update.json +11 -0
- package/XMOJ.user.js +9 -29
- package/package.json +1 -1
package/Update.json
CHANGED
@@ -1803,6 +1803,17 @@
|
|
1803
1803
|
}
|
1804
1804
|
],
|
1805
1805
|
"Notes": "No release notes were provided for this release."
|
1806
|
+
},
|
1807
|
+
"1.2.12": {
|
1808
|
+
"UpdateDate": 1722433643071,
|
1809
|
+
"Prerelease": true,
|
1810
|
+
"UpdateContents": [
|
1811
|
+
{
|
1812
|
+
"PR": 576,
|
1813
|
+
"Description": "fix tidytable"
|
1814
|
+
}
|
1815
|
+
],
|
1816
|
+
"Notes": "No release notes were provided for this release."
|
1806
1817
|
}
|
1807
1818
|
}
|
1808
1819
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.2.
|
3
|
+
// @version 1.2.12
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -292,33 +292,9 @@ let TimeToStringTime = (Time) => {
|
|
292
292
|
* @param {HTMLElement} Table - The table element to be tidied up.
|
293
293
|
*/
|
294
294
|
let TidyTable = (Table) => {
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
// Table.querySelector("thead > tr").removeAttribute("align");
|
299
|
-
// Table.querySelector("thead > tr").innerHTML = Table.querySelector("thead > tr").innerHTML.replaceAll("td", "th");
|
300
|
-
// let Temp = Table.querySelector("thead > tr").children;
|
301
|
-
// for (let j = 0; j < Temp.length; j++) {
|
302
|
-
// let Width = Temp[j].style.width;
|
303
|
-
// Temp[j].removeAttribute("style");
|
304
|
-
// Temp[j].style.width = Width;
|
305
|
-
// Temp[j].removeAttribute("onclick");
|
306
|
-
// Temp[j].removeAttribute("align");
|
307
|
-
// }
|
308
|
-
// Table.querySelector("tbody").className = "table-group-divider";
|
309
|
-
// Temp = Table.querySelector("tbody").children;
|
310
|
-
// for (let j = 0; j < Temp.length; j++) {
|
311
|
-
// Temp[j].removeAttribute("align");
|
312
|
-
// let Temp2 = Temp[j].querySelectorAll("*");
|
313
|
-
// for (let k = 0; k < Temp2.length; k++) {
|
314
|
-
// Temp2[k].classList.remove("left");
|
315
|
-
// Temp2[k].classList.remove("center");
|
316
|
-
// if (Temp2[k].className == "") {
|
317
|
-
// Temp2[k].removeAttribute("class");
|
318
|
-
// }
|
319
|
-
// }
|
320
|
-
// }
|
321
|
-
// }
|
295
|
+
if (UtilityEnabled("NewBootstrap") && Table != null) {
|
296
|
+
Table.className = "table table-hover";
|
297
|
+
}
|
322
298
|
};
|
323
299
|
let UtilityEnabled = (Name) => {
|
324
300
|
if (localStorage.getItem("UserScript-Setting-" + Name) == null) {
|
@@ -1168,6 +1144,10 @@ async function main() {
|
|
1168
1144
|
<div class="cnt-row-head title">倒计时</div>
|
1169
1145
|
<div class="cnt-row-body">${CountDownData}</div>
|
1170
1146
|
</div>`;
|
1147
|
+
let Tables = document.getElementsByTagName("table");
|
1148
|
+
for (let i = 0; i < Tables.length; i++) {
|
1149
|
+
TidyTable(Tables[i]);
|
1150
|
+
}
|
1171
1151
|
document.querySelector("body > div > div.mt-3 > div > div.col-md-4").innerHTML += `<div class="cnt-row">
|
1172
1152
|
<div class="cnt-row-head title">公告</div>
|
1173
1153
|
<div class="cnt-row-body">加载中...</div>
|
@@ -1999,8 +1979,8 @@ async function main() {
|
|
1999
1979
|
})
|
2000
1980
|
.then(async (Response) => {
|
2001
1981
|
RankData = [];
|
2002
|
-
|
2003
1982
|
let Table = document.querySelector("#rank");
|
1983
|
+
Table.classList.add("table");
|
2004
1984
|
Table.innerHTML = "";
|
2005
1985
|
let StartPosition = Response.indexOf("var solutions=") + 14;
|
2006
1986
|
let EndPosition = Response.indexOf("}];", StartPosition) + 2;
|