diff --git a/app/css/main.css b/app/css/main.css index 09fbe04..738b570 100644 --- a/app/css/main.css +++ b/app/css/main.css @@ -416,6 +416,13 @@ input[type=checkbox]:checked:before { left: calc(50% - 240px); } +#upload-spin { + color: #ffffff; + font-size: 60px; + margin: 200px 490px; + position: fixed; +} + #modal-line { position: absolute; width: 480px; diff --git a/app/index.html b/app/index.html index 7128cd3..658f235 100644 --- a/app/index.html +++ b/app/index.html @@ -201,6 +201,8 @@
+
+
diff --git a/app/js/interface.js b/app/js/interface.js index bbc459b..ab30f78 100644 --- a/app/js/interface.js +++ b/app/js/interface.js @@ -326,6 +326,17 @@ var interface = { $('#modal-buttons .modal-'+btright).addClass('right').show(); $('#upload-popup').show().css('opacity', 1); }, + spinner: function (show) { + if (show) { + $('#upload-modal').hide(); + $('#upload-popup').show().css('opacity', 1); + $('#upload-spin').show(); + } else { + $('#upload-spin').hide(); + $('#upload-popup').css('opacity', 0).hide(); + $('#upload-modal').show(); + } + }, searchPopup: function () { console.debug('Opening IMDB search popup'); $(document).bind('mouseup', interface.leavePopup); diff --git a/app/js/os.js b/app/js/os.js index 709dd0b..24567de 100644 --- a/app/js/os.js +++ b/app/js/os.js @@ -226,8 +226,10 @@ var opensubtitles = { console.debug('Trying to upload subtitle...'); opensubtitles.isUploading = true; $('#button-upload i, #button-upload span').addClass('pulse'); + interface.spinner(true); OS.upload(obj_data).then(function (response) { opensubtitles.isUploading = false; + interface.spinner(false); $('#button-upload i, #button-upload span').removeClass('pulse'); if (response && response.status.match(/200/)) { //console.warn(response) @@ -253,6 +255,7 @@ var opensubtitles = { } }).catch(function(err) { opensubtitles.isUploading = false; + interface.spinner(false); $('#button-upload i, #button-upload span').removeClass('pulse'); console.error(err); var error;