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>
</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">
<form action="history/retry_pp" method="post" enctype="multipart/form-data">
<input type="hidden" id="retry_modal_job" name="job" />
@ -120,12 +127,12 @@
</form>
</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_mode" />
<br/><br/><p class="center"><strong id="delete_nzb_modal_title">title</strong></p>
<br/><br/><p class="center"><input type="submit" id="delete_nzb_modal_remove_nzb" value="Remove NZB" class="juiButton" /></p>
<br/><br/><p class="center"><input type="submit" id="delete_nzb_modal_remove_files" value="Remove NZB &amp; Delete Files" class="juiButton" /></p>
<br/><br/><strong id="delete_nzb_modal_title">title</strong><br/><br/>
<input type="submit" id="delete_nzb_modal_remove_nzb" value="Remove NZB" class="juiButton" />
<input type="submit" id="delete_nzb_modal_remove_files" value="Remove NZB &amp; Delete Files" class="juiButton" />
</div>
#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_mode').val( 'queue' );
$.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;
});
// if (!$.plush.confirmDeleteQueue || confirm($.plush.Tconfirmation)){
/* delid = $(event.target).parent().parent().attr('id');
$('#'+delid).fadeTo('normal',0.25);
@ -756,15 +757,24 @@ jQuery(function($){
// Purge
$('#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({
type: "POST",
url: "tapi",
data: {mode:'history', name:'delete', value:'all', apikey: $.plush.apikey},
success: $.plush.RefreshHistory
});
data: {mode:'history', name:'delete', value:value, apikey: $.plush.apikey},
success: function(){
$.colorbox.close();
$.plush.modalOpen=false;
$.plush.RefreshHistory();
}
});
});
// refresh on mouseout after deletion
$('#history').hover( // $.mouseout was triggering too often
@ -826,7 +836,7 @@ jQuery(function($){
else
$('#delete_nzb_modal_remove_files').button('disable');
$.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;
});

Loading…
Cancel
Save