Browse Source

add modal for multiple history purge options

tags/0.6.0
pairofdimes 14 years ago
parent
commit
0a7bdea96b
  1. 15
      interfaces/Plush/templates/_inc_modals.tmpl
  2. 22
      interfaces/Plush/templates/static/javascripts/plush.js

15
interfaces/Plush/templates/_inc_modals.tmpl

@ -110,6 +110,13 @@
</form> </form>
</div> </div>
<div id="history_purge_modal" class="center">
<br/><br/><strong>Purge History</strong>
<br/><br/><input type="submit" name="all" value="Purge All NZBs" class="juiButton" />
<br/><br/><input type="submit" name="failed" value="Purge Failed NZBs" class="juiButton" />
<br/><br/><input type="submit" name="completed" value="Purge Completed NZBs" class="juiButton" />
</div>
<div id="retry_modal"> <div id="retry_modal">
<form action="history/retry_pp" method="post" enctype="multipart/form-data"> <form action="history/retry_pp" method="post" enctype="multipart/form-data">
<input type="hidden" id="retry_modal_job" name="job" /> <input type="hidden" id="retry_modal_job" name="job" />
@ -120,12 +127,12 @@
</form> </form>
</div> </div>
<div id="delete_nzb_modal"> <div id="delete_nzb_modal" class="center">
<input type="hidden" id="delete_nzb_modal_job" /> <input type="hidden" id="delete_nzb_modal_job" />
<input type="hidden" id="delete_nzb_modal_mode" /> <input type="hidden" id="delete_nzb_modal_mode" />
<br/><br/><p class="center"><strong id="delete_nzb_modal_title">title</strong></p> <br/><br/><strong id="delete_nzb_modal_title">title</strong><br/><br/>
<br/><br/><p class="center"><input type="submit" id="delete_nzb_modal_remove_nzb" value="Remove NZB" class="juiButton" /></p> <input type="submit" id="delete_nzb_modal_remove_nzb" value="Remove NZB" class="juiButton" />
<br/><br/><p class="center"><input type="submit" id="delete_nzb_modal_remove_files" value="Remove NZB &amp; Delete Files" class="juiButton" /></p> <input type="submit" id="delete_nzb_modal_remove_files" value="Remove NZB &amp; Delete Files" class="juiButton" />
</div> </div>
#end if# #end if#

22
interfaces/Plush/templates/static/javascripts/plush.js

@ -458,11 +458,12 @@ jQuery(function($){
$('#delete_nzb_modal_remove_files').button('enable'); $('#delete_nzb_modal_remove_files').button('enable');
$('#delete_nzb_modal_mode').val( 'queue' ); $('#delete_nzb_modal_mode').val( 'queue' );
$.colorbox({ inline:true, href:"#delete_nzb_modal", title:$(this).text(), $.colorbox({ inline:true, href:"#delete_nzb_modal", title:$(this).text(),
innerWidth:"375px", innerHeight:"350px", initialWidth:"375px", initialHeight:"350px", speed:0, opacity:0.7 innerWidth:"600px", innerHeight:"150px", initialWidth:"600px", initialHeight:"150px", speed:0, opacity:0.7
}); });
return false; return false;
}); });
// if (!$.plush.confirmDeleteQueue || confirm($.plush.Tconfirmation)){ // if (!$.plush.confirmDeleteQueue || confirm($.plush.Tconfirmation)){
/* delid = $(event.target).parent().parent().attr('id'); /* delid = $(event.target).parent().parent().attr('id');
$('#'+delid).fadeTo('normal',0.25); $('#'+delid).fadeTo('normal',0.25);
@ -756,15 +757,24 @@ jQuery(function($){
// Purge // Purge
$('#hist_purge').click(function(event) { $('#hist_purge').click(function(event) {
if (confirm( $.plush.TconfirmPurgeH )) { $.colorbox({ inline:true, href:"#history_purge_modal", title:$(this).text(),
innerWidth:"375px", innerHeight:"250px", initialWidth:"375px", initialHeight:"250px", speed:0, opacity:0.7
});
return false;
});
$('#history_purge_modal input:submit').click(function(){
var value = $(this).attr('name');
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "tapi", url: "tapi",
data: {mode:'history', name:'delete', value:'all', apikey: $.plush.apikey}, data: {mode:'history', name:'delete', value:value, apikey: $.plush.apikey},
success: $.plush.RefreshHistory success: function(){
}); $.colorbox.close();
$.plush.modalOpen=false;
$.plush.RefreshHistory();
} }
}); });
});
// refresh on mouseout after deletion // refresh on mouseout after deletion
$('#history').hover( // $.mouseout was triggering too often $('#history').hover( // $.mouseout was triggering too often
@ -826,7 +836,7 @@ jQuery(function($){
else else
$('#delete_nzb_modal_remove_files').button('disable'); $('#delete_nzb_modal_remove_files').button('disable');
$.colorbox({ inline:true, href:"#delete_nzb_modal", title:$(this).text(), $.colorbox({ inline:true, href:"#delete_nzb_modal", title:$(this).text(),
innerWidth:"375px", innerHeight:"350px", initialWidth:"375px", initialHeight:"350px", speed:0, opacity:0.7 innerWidth:"600px", innerHeight:"150px", initialWidth:"600px", initialHeight:"150px", speed:0, opacity:0.7
}); });
return false; return false;
}); });

Loading…
Cancel
Save