added auto refresh to circle ui
This commit is contained in:
parent
9933cd1b82
commit
0fee4eb390
@ -114,7 +114,6 @@ def on_init(api, data = None):
|
||||
inputted is executed. Could be called when daemon is starting or when
|
||||
just the client is running.
|
||||
'''
|
||||
|
||||
pluginapi = api
|
||||
encrypt = PlainEncryption(pluginapi)
|
||||
api.commands.register(['encrypt'], encrypt.encrypt)
|
||||
|
19
onionr/static-data/www/board/autorefresh.js
Normal file
19
onionr/static-data/www/board/autorefresh.js
Normal file
@ -0,0 +1,19 @@
|
||||
var checkbox = document.getElementById('refreshCheckbox')
|
||||
function autoRefresh(){
|
||||
if (! checkbox.checked){return}
|
||||
getBlocks()
|
||||
}
|
||||
|
||||
function setupInterval(){
|
||||
if (checkbox.checked){
|
||||
refreshInterval = setInterval(autoRefresh, 10000)
|
||||
autoRefresh()
|
||||
return
|
||||
}
|
||||
clearInterval(refreshInterval)
|
||||
}
|
||||
|
||||
var refreshInterval = setInterval(autoRefresh, 10000)
|
||||
setupInterval()
|
||||
|
||||
checkbox.onchange = function(){setupInterval}
|
@ -15,6 +15,7 @@
|
||||
<script defer src='/shared/navbar.js'></script>
|
||||
<script defer src='/shared/misc.js'></script>
|
||||
<script defer src='board.js'></script>
|
||||
<script defer src='autorefresh.js'></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -110,6 +111,8 @@
|
||||
<a class="button is-success" id='refreshFeed'>Refresh Feed</a>
|
||||
</p>
|
||||
</div>
|
||||
<input type="checkbox" class="checkbox" id="refreshCheckbox" >
|
||||
<label for="refreshCheckbox">Auto Refresh Feed</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
Loading…
Reference in New Issue
Block a user