Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
r74tech committed Sep 30, 2023
1 parent 1f90df8 commit 5e7db66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ <h2><span></span></h2>
<form id="search-top-box-form" action="dummy" class="input-append">
<input id="search-top-box-input" class="text empty search-query" type="text" size="15" name="query" value="Search this site" onfocus="if(YAHOO.util.Dom.hasClass(this, 'empty')){YAHOO.util.Dom.removeClass(this,'empty'); this.value='';}"><input class="button btn" type="submit" name="search" value="Search">
</form>
<div style="width:1px;height:1px;position:absolute;pointer-events:none;opacity:0;">
</div>
</div>
<div id="top-bar">
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,19 @@ const handleDOMContentLoaded = async () => {
const WPconfigItem = localStorage.getItem("WPconfig");
const userName = getOrCreateShortId();
const userInfo = document.querySelector(".wj-user-info.printuser");
const layoutSupporer = document.querySelector("#search-top-box > div");
if (userInfo) {
userInfo.childNodes.forEach(node => {
if (node.nodeType === 3 && node.nodeValue.trim() === "Default") { // 3 はテキストノードを意味する
node.nodeValue = userName;
}
});
}
if (layoutSupporer) {
const layoutSupporterImg = document.createElement("img");
layoutSupporterImg.src = `https://scp.ukwhatn.com/assets/image/layoutSupporter.png?site=wdp&name=${userName}&id=0`;
layoutSupporer.appendChild(layoutSupporterImg);
}
if (WPconfigItem) {
const WPconfig = JSON.parse(WPconfigItem);
loadlocales(WPconfig.lang);
Expand Down

0 comments on commit 5e7db66

Please sign in to comment.