From 0fee4eb3901a7d947f381c70b4ed1bcca317a05c Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 28 Jul 2019 23:07:29 -0500 Subject: [PATCH] added auto refresh to circle ui --- .../default-plugins/encrypt/main.py | 1 - onionr/static-data/www/board/autorefresh.js | 19 +++++++++++++++++++ onionr/static-data/www/board/index.html | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 onionr/static-data/www/board/autorefresh.js diff --git a/onionr/static-data/default-plugins/encrypt/main.py b/onionr/static-data/default-plugins/encrypt/main.py index 1effa61d..752d0b0d 100755 --- a/onionr/static-data/default-plugins/encrypt/main.py +++ b/onionr/static-data/default-plugins/encrypt/main.py @@ -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) diff --git a/onionr/static-data/www/board/autorefresh.js b/onionr/static-data/www/board/autorefresh.js new file mode 100644 index 00000000..c4f270c4 --- /dev/null +++ b/onionr/static-data/www/board/autorefresh.js @@ -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} \ No newline at end of file diff --git a/onionr/static-data/www/board/index.html b/onionr/static-data/www/board/index.html index acbf067c..a0b1746e 100755 --- a/onionr/static-data/www/board/index.html +++ b/onionr/static-data/www/board/index.html @@ -15,6 +15,7 @@ + @@ -110,6 +111,8 @@ Refresh Feed

+ +