test: localStorage test

This commit is contained in:
Aliberk Sandıkçı 2023-11-28 16:16:23 +03:00
parent 242a76511c
commit ef39a4966d
Signed by: asandikci
GPG key ID: 25C67A03B5666BC1

View file

@ -189,10 +189,33 @@
<!-- NON-INTERACTIVE DECORATION AREA --> <!-- NON-INTERACTIVE DECORATION AREA -->
<section id="bottom"> <section id="bottom">
<hr> <hr>
<p id="debug-area"></p>
<form>
<button id="localtest" type="button" onmouseover="Localtest(0)" onclick="Localtest(0)">TEST</button>
<button id="yazdir" type="button" onmouseover="Localtest(1)" onclick="Localtest(1)">Yazdır</button>
</form>
<div id="DEV" style="font-size: x-small;"></div> <div id="DEV" style="font-size: x-small;"></div>
<div id="rainbow"></div> <div id="rainbow"></div>
</section> </section>
<script>
function Localtest(a) {
if (a == 0) {
var nowdate = new Date;
localStorage.setItem("localtest", nowdate);
}
if (a == 1) {
if (localStorage.getItem("localtest") == null) {
document.getElementById("debug-area").innerHTML = "ÇALIŞMIYOR :(";
}
else {
document.getElementById("debug-area").innerHTML = localStorage.getItem("localtest");
}
}
}
</script>
<script src="./assets/js/utils.js"></script> <script src="./assets/js/utils.js"></script>
<script src="./assets/js/updates.js"></script> <script src="./assets/js/updates.js"></script>
@ -201,8 +224,6 @@
<script src="./assets/js/initialize.js"></script> <script src="./assets/js/initialize.js"></script>
<script src="./assets/js/timers.js"></script> <script src="./assets/js/timers.js"></script>
</body> </body>
</html> </html>