added auto refresh to circle ui
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
|
inputted is executed. Could be called when daemon is starting or when
|
||||||
just the client is running.
|
just the client is running.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
pluginapi = api
|
pluginapi = api
|
||||||
encrypt = PlainEncryption(pluginapi)
|
encrypt = PlainEncryption(pluginapi)
|
||||||
api.commands.register(['encrypt'], encrypt.encrypt)
|
api.commands.register(['encrypt'], encrypt.encrypt)
|
||||||
|
|
|
@ -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/navbar.js'></script>
|
||||||
<script defer src='/shared/misc.js'></script>
|
<script defer src='/shared/misc.js'></script>
|
||||||
<script defer src='board.js'></script>
|
<script defer src='board.js'></script>
|
||||||
|
<script defer src='autorefresh.js'></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -110,6 +111,8 @@
|
||||||
<a class="button is-success" id='refreshFeed'>Refresh Feed</a>
|
<a class="button is-success" id='refreshFeed'>Refresh Feed</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="checkbox" class="checkbox" id="refreshCheckbox" >
|
||||||
|
<label for="refreshCheckbox">Auto Refresh Feed</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
Loading…
Reference in New Issue