文字列管理を分離

This commit is contained in:
harukin-expo-dev-env 2025-02-08 08:57:18 +00:00
parent 8e0f04c5b2
commit ea4fa46fe0

View File

@ -1067,6 +1067,7 @@ export const injectJavascriptData: InjectJavascriptData = (
`;
const normal_train_name = `
const nameReplace = (,,) =>{
if(.match("サンポート")){
const textBase = .split(":")[1];
.innerText = textBase+.innerText;
@ -1185,7 +1186,9 @@ const data = getJRF(列番データ);
}
}
.innerText = getThrew() || .innerText;
//列番付与
.innerText = .innerText++(JRF ? "":"レ");
}
`;
const textInsert =
@ -1205,12 +1208,8 @@ const setStrings = () =>{
var TrainType = undefined;
setTrainMenuDialog(element)
if(.innerText.includes())continue; //回避
` +
(iconSetting == "true" ? "setTrainIcon(列番データ,element);" : "") +
normal_train_name +
`
//列番付与
.innerText = .innerText++(JRF ? "":"レ");
${iconSetting == "true" ? "setTrainIcon(列番データ,element);" : ""}
nameReplace(,,);
}
try{
for(let d of document.getElementById('disp').childNodes){
@ -1309,23 +1308,22 @@ textInsert.observe(document.getElementById('disp'), {
// 列車メニュー表示の起動用スクリプト
const makeTrainView = `
const makeTrainView = new MutationObserver( (mutations) => {
const makeTrainView = new MutationObserver( (mutations) => {
for(let d of modal_content.getElementsByTagName("button") ){
const data = d.onclick.toString().split("\\"")[1];
d.onclick = () => window.ReactNativeWebView.postMessage(data)
}
});
// 監視を開始
makeTrainView.observe(document.getElementById('modal_content'), {
});
// 監視を開始
makeTrainView.observe(document.getElementById('modal_content'), {
//attributes: true, // 属性変化の監視
//attributeOldValue: true, // 変化前の属性値を matation.oldValue に格納する
//characterData: true, // テキストノードの変化を監視
//characterDataOldValue: true, // 変化前のテキストを matation.oldValue に格納する
childList: true, // 子ノードの変化を監視
//subtree: true // 子孫ノードも監視対象に含める
});
`;
});
`;
const makeTrainMenu =
trainMenu == "true"
? `
@ -1403,6 +1401,7 @@ setStationMenuDialog.observe(document.querySelector('#disp'), {
bootData +
topMenu +
trainIcon +
normal_train_name +
makeTrainView +
makeTrainMenu +
textInsert +