added auto refresh to circle ui

This commit is contained in:
Kevin Froman 2019-07-28 23:07:29 -05:00
parent 9933cd1b82
commit 0fee4eb390
3 changed files with 22 additions and 1 deletions

View File

@ -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)

View 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}

View File

@ -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">