template: move js session refresh to single file ; use fetch API
This commit is contained in:
parent
2b460105dc
commit
3b312c7d9e
@ -5,14 +5,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
<script>
|
<script>
|
||||||
function refreshSession()
|
{qswiki:include:js_session_refresh}
|
||||||
{
|
|
||||||
var req = new XMLHttpRequest();
|
|
||||||
req.open("GET", "{qswiki:config:refreshsessionurl}");
|
|
||||||
req.send();
|
|
||||||
setTimeout(refreshSession, 60*2*1000);
|
|
||||||
}
|
|
||||||
setTimeout(refreshSession, 60*2*1000);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
5
template/quitesimple/js_session_refresh
Normal file
5
template/quitesimple/js_session_refresh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
function refreshSession()
|
||||||
|
{
|
||||||
|
fetch(new Request("{qswiki:config:refreshsessionurl}"));
|
||||||
|
}
|
||||||
|
setInterval(refreshSession, 60*2*1000);
|
@ -7,14 +7,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
<script>
|
<script>
|
||||||
function refreshSession()
|
{qswiki:include:js_session_refresh}
|
||||||
{
|
|
||||||
var req = new XMLHttpRequest();
|
|
||||||
req.open("GET", "{qswiki:config:refreshsessionurl}");
|
|
||||||
req.send();
|
|
||||||
setTimeout(refreshSession, 60*2*1000);
|
|
||||||
}
|
|
||||||
setTimeout(refreshSession, 60*2*1000);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user