From c47c3359f184fc6d9c252d0e4cb6c9ef67a7527d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 24 Feb 2019 23:05:58 -0500 Subject: [PATCH 1/2] Added spinning icon when tasks are running. --- views/episodes.tpl | 8 +++-- views/menu.tpl | 82 +++++++++++++++++++++++++++++++++++++----- views/movie.tpl | 12 ++++--- views/system.tpl | 9 +++-- views/wantedmovies.tpl | 8 +++-- views/wantedseries.tpl | 8 +++-- 6 files changed, 101 insertions(+), 26 deletions(-) diff --git a/views/episodes.tpl b/views/episodes.tpl index d129b5edd..42d4656a0 100644 --- a/views/episodes.tpl +++ b/views/episodes.tpl @@ -361,8 +361,10 @@ }); $('#search_missing_subtitles').on('click', function(){ - $('#loader_text').text("Searching for missing subtitles..."); - window.location = '{{base_url}}search_missing_subtitles/{{no}}'; + $(this).find('i:first').addClass('loading'); + $.ajax({ + url: '{{base_url}}search_missing_subtitles/{{no}}' + }) }); $('.remove_subtitles').on('click', function(){ @@ -418,7 +420,7 @@ }); }); - $('a:not(.manual_search), .menu .item, button:not(#config, .cancel)').on('click', function(){ + $('a:not(.manual_search), .menu .item, button:not(#config, .cancel, #search_missing_subtitles)').on('click', function(){ $('#loader').addClass('active'); }); diff --git a/views/menu.tpl b/views/menu.tpl index 10b6bec2b..9bea9b648 100644 --- a/views/menu.tpl +++ b/views/menu.tpl @@ -19,6 +19,8 @@ .searchicon { color: white !important; } + div.disabled { pointer-events: none; } + button.disabled { pointer-events: none; } @@ -222,13 +224,13 @@ + + + \ No newline at end of file diff --git a/views/movie.tpl b/views/movie.tpl index f43ef0a0b..1ca37c385 100644 --- a/views/movie.tpl +++ b/views/movie.tpl @@ -94,7 +94,7 @@
- + <% subs_languages = ast.literal_eval(str(details[7])) subs_languages_list = [] @@ -314,9 +314,11 @@ window.location = '{{base_url}}scan_disk_movie/{{no}}'; }); - $('#search_missing_subtitles').on('click', function(){ - $('#loader_text').text("Searching for missing subtitles..."); - window.location = '{{base_url}}search_missing_subtitles_movie/{{no}}'; + $('#search_missing_subtitles_movie').on('click', function(){ + $(this).find('i:first').addClass('loading'); + $.ajax({ + url: '{{base_url}}search_missing_subtitles_movie/{{no}}' + }) }); $('.remove_subtitles').on('click', function(){ @@ -371,7 +373,7 @@ }); }); - $('a, .menu .item, button:not(#config, .cancel, .manual_search)').on('click', function(){ + $('a, .menu .item, button:not(#config, .cancel, .manual_search, #search_missing_subtitles_movie)').on('click', function(){ $('#loader').addClass('active'); }); diff --git a/views/system.tpl b/views/system.tpl index 40c9482d2..eb4427375 100644 --- a/views/system.tpl +++ b/views/system.tpl @@ -62,7 +62,7 @@
- +
@@ -73,7 +73,7 @@ %for task in task_list: - + @@ -346,7 +346,10 @@ }); $('.execute').on('click', function(){ - window.location = '{{base_url}}execute/' + $(this).data("taskid"); + $(this).find('i:first').addClass('loading'); + $.ajax({ + url: '{{base_url}}execute/' + $(this).data("taskid") + }) }); $('a:not(.tabs), button:not(.cancel, #download_log), #restart').on('click', function(){ diff --git a/views/wantedmovies.tpl b/views/wantedmovies.tpl index df87d8edd..e4f4d7e2e 100644 --- a/views/wantedmovies.tpl +++ b/views/wantedmovies.tpl @@ -139,7 +139,7 @@
Name
{{task[0]}} {{task[1]}} {{task[2]}}