diff --git a/js/imgur.js b/js/imgur.js index 877ef0a..f743bc3 100644 --- a/js/imgur.js +++ b/js/imgur.js @@ -104,10 +104,8 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting }; if( "upload" in xhttp ) { - // Set progress xhttp.upload.onprogress = function (event) { - // Check if we can compute progress if (event.lengthComputable) { // Complete in percent @@ -117,12 +115,9 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting currentProgressBar.style.width = complete + '%'; } }; - } - // Send request with form data xhttp.send(fd); - }; // Delete an image from imgur with the deletion link @@ -156,22 +151,16 @@ weechat.factory('imgur', ['$rootScope', 'settings', function($rootScope, setting // Handler for response xhttp.onload = function() { - // Check state and response status if(xhttp.status === 200) { - callback(); - } else { showErrorMsg(); } - }; - - + // Send request with form data xhttp.send(null); - }; var showErrorMsg = function() {