#1123 Load the ajax.gif in receive.js via relative directory, now that static path is not... static

This commit is contained in:
Miguel Jacq 2020-05-28 15:06:06 +10:00
parent 4f0958f143
commit ce73138890
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -4,6 +4,11 @@ $(function(){
$('#flashes').append($('<li>').addClass(category).text(message));
};
var scriptEls = document.getElementsByTagName( 'script' );
var thisScriptEl = scriptEls[scriptEls.length - 1];
var scriptPath = thisScriptEl.src;
var scriptFolder = scriptPath.substr(0, scriptPath.lastIndexOf( '/' )+1 );
// Intercept submitting the form
$('#send').submit(function(event){
event.preventDefault();
@ -38,7 +43,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="' + scriptFolder + '../img/ajax.gif" alt="" /> Waiting for data to finish traversing Tor network ...');
}
}, false);