駅名標をAndroidで表示できなくなっていた問題を修正

This commit is contained in:
harukin-OneMix4 2023-07-01 11:59:53 +09:00
parent 84efa42e57
commit 0ff05f911c

View File

@ -721,11 +721,46 @@ modal_observer.observe(modal_content, {
//trainMenu == "true"
true
? `
function ShowTrainTimeInfo(trainNum,limited){
window.ReactNativeWebView.postMessage(JSON.stringify({type:"ShowTrainTimeInfo",trainNum,limited}));
};
//駅メニューダイアログの配置
const setStationMenuDialog = () =>{
const data =[];
document.querySelectorAll('#disp div div').forEach(d=>d.id.indexOf("st")!= -1 && data.push(d));
for(let d of data ){
if(!d.offclick){
d.offclick = d.onclick.toString();
}
d.onclick = () =>{
//const s = d.offclick.replace('function onclick(event)','').replace('ShowTrainTimeInfo(','').replace(')','').split('(')[1].split(',')
// これの中身抽出ShowTrainTimeInfo("1228M","normal")
const s = d.offclick.replace('(event)','').replaceAll("'", "").split('(')[1].split(')')[0].split(',');
// これの中身抽出 PopUpMenu(event,'2','端岡','http://www.jr-shikoku.co.jp/01_trainbus/jikoku/pdf/hashioka.pdf','https://www.google.co.jp/maps/place/34.305027,133.967643','','1')
window.ReactNativeWebView.postMessage(JSON.stringify({type:"PopUpMenu",event:s[0],id:s[1],name:s[2],pdf:s[3],map:s[4],url:s[5],chk:s[6]}));
}
}
}
const observer3 = new MutationObserver( (mutations) => {
// observer3.disconnect(); // 監視を終了
setStationMenuDialog();
});
// 監視を開始
observer3.observe(target, {
attributes: true, // 属性変化の監視
//attributeOldValue: true, // 変化前の属性値を matation.oldValue に格納する
//characterData: true, // テキストノードの変化を監視
//characterDataOldValue: true, // 変化前のテキストを matation.oldValue に格納する
childList: true, // 子ノードの変化を監視
//subtree: true // 子孫ノードも監視対象に含める
});
`
: ``;
: // `
// function ShowTrainTimeInfo(trainNum,limited){
// window.ReactNativeWebView.postMessage(JSON.stringify({type:"ShowTrainTimeInfo",trainNum,limited}));
// };
// `
``;
return (
bootData +
makeTrainView +