new: Waiting messages on scraping page.

pull/81/head
Raphaël Vinot 2020-08-07 17:06:25 +02:00
parent 8ebc071b71
commit ed8ad7b945
3 changed files with 9 additions and 1 deletions

View File

@ -62,7 +62,9 @@ app.jinja_env.globals.update(sizeof_fmt=sizeof_fmt)
def http_status_description(code: int): def http_status_description(code: int):
if code in http.client.responses:
return http.client.responses[code] return http.client.responses[code]
return f'Invalid code: {code}'
app.jinja_env.globals.update(http_status_description=http_status_description) app.jinja_env.globals.update(http_status_description=http_status_description)

View File

@ -27,4 +27,7 @@ $('select[name="browser"]').change(function(){
$('#btn-looking').click(function() { $('#btn-looking').click(function() {
$('#btn-looking').html('<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Looking...').addClass('disabled'); $('#btn-looking').html('<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Looking...').addClass('disabled');
$('#long').fadeOut(0).delay(9000).fadeIn(100);
$('#too-long').fadeOut(0).delay(19000).fadeIn(100);
$('#way-too-long').fadeOut(0).delay(27000).fadeIn(100);
}); });

View File

@ -98,6 +98,9 @@
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<center> <center>
<button type="submit" class="btn btn-primary" id="btn-looking">Start looking!</button> <button type="submit" class="btn btn-primary" id="btn-looking">Start looking!</button>
<div id="long" style="display:none">Please wait, it can take a while on big websites...</div>
<div id="too-long" style="display:none">... No, really, I mean it.</div>
<div id="way-too-long" style="display:none">Told ya!</div>
</center> </center>
</form> </form>
</div> </div>