小整理

This commit is contained in:
harukin-OneMix4 2023-06-19 13:58:54 +09:00
parent 4ef5a13dc3
commit 1aac1e40df

View File

@ -19,6 +19,8 @@ export const injectJavascriptData = (
document.querySelector('#main').style.paddingTop = '0px';
document.querySelector('#headerStr').style.display = 'none';
`;
// 何これ
const bootData =
topMenu +
`
@ -33,17 +35,16 @@ export const injectJavascriptData = (
}
setReload();
`;
// 左か右かを判定してアイコンを設置する
const trainIconMaker = `
const setStationIcon = (行き先アイコン,img) =>{
let newItem = document.createElement("div");
if(行き先アイコン.getAttribute("style").includes("left")){
行き先アイコン.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:left;height:20px;'>");
const setStationIcon = (setIconElem,img) =>{
if(setIconElem.getAttribute("style").includes("left")){
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:left;height:20px;'>");
}
else{
行き先アイコン.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:right;height:20px;'>");
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:right;height:20px;'>");
}
行き先アイコン.remove();
setIconElem.remove();
}
`;
@ -471,9 +472,7 @@ default:
const JRF_icon =
iconSetting == "true"
? `
JRF || setStationIcon(element.querySelector("img"),'http://www.trainfrontview.net/f/ef210a.png');
`
? `JRF || setStationIcon(element.querySelector("img"),'http://www.trainfrontview.net/f/ef210a.png');`
: ``;
const normal_train_name = `
if(new RegExp(/^4[1-9]\\d\\d[DM]$/).test(列番データ) || new RegExp(/^5[1-7]\\d\\d[DM]$/).test(列番データ)){
@ -678,8 +677,6 @@ document.querySelectorAll('#disp div')[0].style.width = '100vw';
document.getElementById('disp').style.width = '100vw';
document.getElementById('disp').style.overflowX = 'hidden';
}catch(e){
alert("にゃーん");
}