Merge branch 'static_path_to_ajax_gif' of https://github.com/mig5/onionshare into mig5-static_path_to_ajax_gif

This commit is contained in:
Micah Lee 2020-06-29 11:35:19 -07:00
commit 11d44eab50
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,9 @@ $(function(){
$('#flashes').append($('<li>').addClass(category).text(message));
};
var scriptSrc = document.getElementById('receive-script').src;
var staticImgPath = scriptSrc.substr(0, scriptSrc.lastIndexOf( '/' )+1).replace('js', 'img');
// Intercept submitting the form
$('#send').submit(function(event){
event.preventDefault();
@ -38,7 +41,7 @@ $(function(){
// and update the status
if(event.loaded == event.total) {
$('.cancel', ajax.$upload_div).remove();
$('.upload-status', ajax.$upload_div).html('<img src="/static/img/ajax.gif" alt="" /> Waiting for data to finish traversing Tor network ...');
$('.upload-status', ajax.$upload_div).html('<img src="' + staticImgPath + '/ajax.gif" alt="" /> Waiting for data to finish traversing Tor network ...');
}
}, false);

View File

@ -39,6 +39,6 @@
</div>
<script src="{{ static_url_path }}/js/jquery-3.5.1.min.js"></script>
<script async src="{{ static_url_path }}/js/receive.js"></script>
<script async src="{{ static_url_path }}/js/receive.js" id="receive-script"></script>
</body>
</html>