Add function common.refresh.

This commit is contained in:
voussoir 2020-06-03 12:28:09 -07:00
parent 113a92fb5b
commit d0a0a87b43
3 changed files with 10 additions and 4 deletions

View file

@ -140,6 +140,12 @@ function init_atag_merge_params()
}); });
} }
common.refresh =
function refresh()
{
window.location.reload();
}
common.on_pageload = common.on_pageload =
function on_pageload() function on_pageload()
{ {

View file

@ -154,8 +154,8 @@ https://stackoverflow.com/a/35153397
{{header.make_header()}} {{header.make_header()}}
<div id="content_body"> <div id="content_body">
{% if channel is not none %} {% if channel is not none %}
<span><button class="refresh_button" onclick="refresh_channel('{{channel.id}}', false, function(){location.reload()})">Refresh new videos</button></span> <span><button class="refresh_button" onclick="refresh_channel('{{channel.id}}', false, common.refresh)">Refresh new videos</button></span>
<span><button class="refresh_button" onclick="refresh_channel('{{channel.id}}', true, function(){location.reload()})">Refresh everything</button></span> <span><button class="refresh_button" onclick="refresh_channel('{{channel.id}}', true, common.refresh)">Refresh everything</button></span>
<span><a class="merge_params" href="/channel/{{channel.id}}">All</a></span> <span><a class="merge_params" href="/channel/{{channel.id}}">All</a></span>
{% else %} {% else %}

View file

@ -48,8 +48,8 @@
<body> <body>
{{header.make_header()}} {{header.make_header()}}
<div id="content_body"> <div id="content_body">
<span><button class="refresh_button" onclick="refresh_all_channels(false, function(){location.reload()})">Refresh new videos</button></span> <span><button class="refresh_button" onclick="refresh_all_channels(false, common.refresh)">Refresh new videos</button></span>
<span><button class="refresh_button" onclick="refresh_all_channels(true, function(){location.reload()})">Refresh everything</button></span> <span><button class="refresh_button" onclick="refresh_all_channels(true, common.refresh)">Refresh everything</button></span>
<div> <div>
<input type="text" id="new_channel_textbox"> <input type="text" id="new_channel_textbox">
<button id="new_channel_button" onclick="add_channel_form(event)">Add new channel</button> <button id="new_channel_button" onclick="add_channel_form(event)">Add new channel</button>