astro.js allow to document.getElementById(station).addEventListener(click, homeAstroportStation);
This commit is contained in:
parent
b4215a550a
commit
ad57993444
|
@ -30,17 +30,22 @@ TYPE=$WHAT
|
||||||
mkdir -p ~/.zen/tmp/${MOATS}/
|
mkdir -p ~/.zen/tmp/${MOATS}/
|
||||||
|
|
||||||
if [[ ${QRCODE} == "station" ]]; then
|
if [[ ${QRCODE} == "station" ]]; then
|
||||||
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
|
if [[ ! -s ~/.zen/tmp/WSTATION ]]; then
|
||||||
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
|
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
|
||||||
echo $ISTATION > ~/.zen/ISTATION ## STATION G1WALLET CAROUSEL
|
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
|
||||||
|
echo $ISTATION > ~/.zen/ISTATION ## STATION G1WALLET CAROUSEL
|
||||||
|
|
||||||
## SHOW G1PALPAY FRONT
|
## SHOW G1PALPAY FRONT
|
||||||
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../www/G1PalPay/index.html > ~/.zen/tmp/${MOATS}/index.htm
|
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../www/G1PalPay/index.html > ~/.zen/tmp/${MOATS}/index.htm
|
||||||
sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/${MOATS}/index.htm
|
sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/${MOATS}/index.htm
|
||||||
|
|
||||||
WSTATION="/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/index.htm)"
|
|
||||||
echo "NEW WSTATION ${myIPFS}${WSTATION}"
|
|
||||||
|
|
||||||
|
WSTATION="/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/index.htm)"
|
||||||
|
echo "NEW WSTATION ${myIPFS}${WSTATION}"
|
||||||
|
echo $WSTATION > ~/.zen/tmp/WSTATION
|
||||||
|
else
|
||||||
|
WSTATION=$(cat ~/.zen/tmp/WSTATION)
|
||||||
|
echo "WSTATION ${myIPFS}${WSTATION}"
|
||||||
|
fi
|
||||||
## SEND TO WSTATION PAGE
|
## SEND TO WSTATION PAGE
|
||||||
sed "s~_TWLINK_~${myIPFS}${WSTATION}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
|
sed "s~_TWLINK_~${myIPFS}${WSTATION}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
|
||||||
echo "url='"${myIPFS}${WSTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
|
echo "url='"${myIPFS}${WSTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- homeAstroportStation function API Twist -->
|
||||||
|
async function homeAstroportStation() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
let one = await fetch('http://127.0.0.1:1234/?qrcode=station'); // Gets a promise
|
||||||
|
var doc = await one.text();
|
||||||
|
var regex = /url='([^']+)/i; // Get response PORT
|
||||||
|
var redirectURL = doc.match(regex)[1]
|
||||||
|
|
||||||
|
console.log(redirectURL)
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
// let two = await fetch(redirectURL);
|
||||||
|
// document.mydiv.innerHTML = await two.text(); // Replaces body with response
|
||||||
|
window.location.href = redirectURL
|
||||||
|
// window.open( redirectURL, "AstroTab");
|
||||||
|
}, 15000);
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.log('Fetch error:' + err); // Error handling
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,16 +33,26 @@ header {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 33%;
|
top: 33%;
|
||||||
left: 66%;
|
left: 66%;
|
||||||
|
width: 18%;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!-- Typed text animation -->
|
<!-- Typed text animation -->
|
||||||
<script src="http://127.0.0.1:8080/ipfs/QmYyJmAT3cUbjk4vVWQG7LdpY3HkFH9phFD1VzzetHrgpa"></script>
|
<script src="http://127.0.0.1:8080/ipfs/QmYyJmAT3cUbjk4vVWQG7LdpY3HkFH9phFD1VzzetHrgpa"></script>
|
||||||
|
<script src="http://127.0.0.1:8080/ipfs/QmVQNVGEbhMjWp6Jur8B4HxfPSupPHR4KRDPn1z3nyq6ad/astro.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h6>
|
<h6>
|
||||||
/ipfs/<span>Station</span>(<a href="/?qrcode=station">♥</a>)
|
(<a href="javascript:homeAstroportStation()">♥</a>)<span>BOX</span>
|
||||||
|
|
||||||
|
<p id="station">Click me.</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById("station").addEventListener("click", homeAstroportStation);
|
||||||
|
</script>
|
||||||
|
|
||||||
</h6>
|
</h6>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ a {
|
||||||
// let two = await fetch(redirectURL);
|
// let two = await fetch(redirectURL);
|
||||||
// document.mydiv.innerHTML = await two.text(); // Replaces body with response
|
// document.mydiv.innerHTML = await two.text(); // Replaces body with response
|
||||||
window.open( redirectURL, "AstroTab");
|
window.open( redirectURL, "AstroTab");
|
||||||
}, 15000);
|
}, 15123);
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('Fetch error:' + err); // Error handling
|
console.log('Fetch error:' + err); // Error handling
|
||||||
|
@ -185,7 +185,7 @@ a {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="yellow" >
|
<div id="yellow" >
|
||||||
<iframe src="_STATION_" width="100%" height="220px"></iframe>
|
<iframe id="inframe" src="_STATION_" width="100%" height="250px"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Reference in New Issue