QUOTE(hc br @ Nov 7 2023, 00:38)
HV論壇用裝備上色(漢化) (updata: 2023-11-20)
此插件只在論壇生效,HV中不會運作
This plugin only takes effect in the forum, it will not work in HV
ENG
HV_forums_Hightlight_Equipment__2023__ENG.user.js.txt ( 21.86k )
Number of downloads: 946繁中
HV_forums_Hightlight_Equipment__2023__CHT.user.js.txt ( 62.36k )
Number of downloads: 605簡中
HV_forums_Hightlight_Equipment__2023__CHN.user.js.txt ( 62.36k )
Number of downloads: 488 I added some small modifications to the ENG ver.
Found a major bug -> Probably solved
I changed more than 10 lines of code this time.
So, I won't put many details here.
Here is the script and summary and
In case you want the original color style,you can change on your own
Or, copy all function eq1 - eq5 from the original version and replace mine
HV_forums_Hightlight_Equipment__2023__ENG.user.js.txt ( 24.1k )
Number of downloads: 14Error reason:
The original script will replace all its matches with well-formatted HTML (only the equipment name).
But I previously changed the match regex. So, it might replace the whole line/post with 1 well-formatted equipment name, resulting in missing of content.
This time, I changed the replace method. Most changes are inside "function eqmthh(eminn)"
Only replace quality to well-formatted quality, prefix to well-formatted prefix and so on.
I thought this would be significantly terrible for the performance but it runs smoothly as butter.
Since JS is not my language, and I only test it on Abby/Noni's auction, feel free to point out any problem.
________________________________________
One more modification: I made it work for reasoning website, too
I know it's well-sorted and organized. But my eyes hurt by reading so many plain texts.
Sometimes it makes notify and bid button not working. FIXED!!!! A long time ago. But I forgot to edit this post
This is very customized code. So, add it on your own. Or use my txt if you don't mind
HV_forums_Hightlight_Equipment__2023__ENG.user.js.txt ( 26.51k )
Number of downloads: 6CODE
// @match *://reasoningtheory.net/itemlist*
Add to first a few lines.
After code
CODE
lklist = lklist.concat('Forge')
add this
CODE
lklist = lklist.concat('net/itemlist') //Reasoning13
After case 12, add case 13 code in this part
CODE
case 12: //鍛造
var torep = new Array();
var repby = new Array();
if(equipdiv= document.getElementById("upgrade_button"))equipdiv.style.cssText ="position:relative; top:20px; ";
equipdiv=document.querySelector("#item_pane");
equipdiv=eqmthh(equipdiv)
document.querySelector("#item_pane").innerHTML = equipdiv;
break;
case 13: //reasoningtheory
var torep = new Array();
var repby = new Array();
// equipdiv=document.getElementsByTagName('tr');
equipdiv=document.querySelectorAll('tr');
equipdiv.forEach(row => {
const newHTML = eqmthh(row);
// Parse the HTML to extract just the <a> tag contents
const parser = new DOMParser();
const doc = parser.parseFromString(newHTML, 'text/html');
const updatedLink = doc.querySelector('a');
const originalLink = row.querySelector('a');
if (originalLink && updatedLink) {
originalLink.innerHTML = '';
updatedLink.childNodes.forEach(child => {
originalLink.appendChild(child.cloneNode(true));
});
}
})
break;
This post has been edited by l13763824039: Nov 9 2024, 03:16