mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
Added loading GIF when searching and fixed small display bug in modal
This commit is contained in:
parent
f475f18f06
commit
0174d46788
5 changed files with 13 additions and 4 deletions
|
@ -161,7 +161,7 @@ def getmoredata():
|
||||||
requested_path = request.args.get('paste', '')
|
requested_path = request.args.get('paste', '')
|
||||||
paste = Paste.Paste(requested_path)
|
paste = Paste.Paste(requested_path)
|
||||||
p_content = paste.get_p_content().decode('utf-8', 'ignore')
|
p_content = paste.get_p_content().decode('utf-8', 'ignore')
|
||||||
to_return = p_content[max_preview_modal:]
|
to_return = p_content[max_preview_modal-1:]
|
||||||
return to_return
|
return to_return
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
var/www/static/image/loading.gif
Normal file
BIN
var/www/static/image/loading.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
|
@ -70,6 +70,7 @@
|
||||||
<div id="mymodalcontent" class="modal-content">
|
<div id="mymodalcontent" class="modal-content">
|
||||||
<div id="mymodalbody" class="modal-body" max-width="850px">
|
<div id="mymodalbody" class="modal-body" max-width="850px">
|
||||||
<p>Loading paste information...</p>
|
<p>Loading paste information...</p>
|
||||||
|
<img id="loading-gif-modal" src="{{url_for('static', filename='image/loading.gif') }}" height="26" width="26" style="margin: 4px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a id="button_show_path" target="_blank" href=""><button type="button" class="btn btn-info">Show saved paste</button></a>
|
<a id="button_show_path" target="_blank" href=""><button type="button" class="btn btn-info">Show saved paste</button></a>
|
||||||
|
@ -160,6 +161,7 @@
|
||||||
|
|
||||||
$("#button_show_path").attr('href', $(modal).attr('data-url'));
|
$("#button_show_path").attr('href', $(modal).attr('data-url'));
|
||||||
$("#button_show_path").show('fast');
|
$("#button_show_path").show('fast');
|
||||||
|
$("#loading-gif-modal").css("visibility", "hidden"); // Hide the loading GIF
|
||||||
if ($("[data-initsize]").attr('data-initsize') < char_to_display) { // All the content is displayed
|
if ($("[data-initsize]").attr('data-initsize') < char_to_display) { // All the content is displayed
|
||||||
nothing_to_display();
|
nothing_to_display();
|
||||||
}
|
}
|
||||||
|
@ -180,6 +182,8 @@
|
||||||
// When the modal goes out, refresh it to normal content
|
// When the modal goes out, refresh it to normal content
|
||||||
$("#mymodal").on('hidden.bs.modal', function () {
|
$("#mymodal").on('hidden.bs.modal', function () {
|
||||||
$("#mymodalbody").html("<p>Loading paste information...</p>");
|
$("#mymodalbody").html("<p>Loading paste information...</p>");
|
||||||
|
var loading_gif = "<img id='loading-gif-modal' class='img-center' src=\"{{url_for('static', filename='image/loading.gif') }}\" height='26' width='26' style='margin: 4px;'>";
|
||||||
|
$("#mymodalbody").append(loading_gif); // Show the loading GIF
|
||||||
$("#button_show_path").attr('href', '');
|
$("#button_show_path").attr('href', '');
|
||||||
$("#button_show_path").hide();
|
$("#button_show_path").hide();
|
||||||
complete_paste = null;
|
complete_paste = null;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
<div class="input-group custom-search-form">
|
<div class="input-group custom-search-form">
|
||||||
<form action="/search" method=POST>
|
<form action="/search" id="form-search" method=POST>
|
||||||
<input type="text" name="query" class="form-control" placeholder="Search Paste">
|
<input type="text" name="query" class="form-control" placeholder="Search Paste">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-default" type="submit">
|
<button class="btn btn-default" type="submit">
|
||||||
<i class="fa fa-search"></i>
|
<i class="fa fa-search"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<img id="loading-gif" src="{{url_for('static', filename='image/loading2.gif') }}" height="26" width="26" style="margin: 4px; visibility: hidden;">
|
||||||
</form>
|
</form>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
$("#form-search").submit(function( event ) {
|
||||||
|
$("#loading-gif").css("visibility", "visible");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue