mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-05 02:43:37 +00:00
d0326cda7e
Change to improve webserve code Add logout menu item with confirmation Add 404 error page
130 lines
No EOL
3.4 KiB
JavaScript
130 lines
No EOL
3.4 KiB
JavaScript
$(document).ready(function () {
|
|
$('a.logout').bind('click',function(e) {
|
|
e.preventDefault();
|
|
var target = $( this ).attr('href');
|
|
$.confirm({
|
|
'title' : 'Logout',
|
|
'message' : 'Are you sure you want to Logout from SickGear ?',
|
|
'buttons' : {
|
|
'Yes' : {
|
|
'class' : 'green',
|
|
'action': function(){
|
|
location.href = target;
|
|
}
|
|
},
|
|
'No' : {
|
|
'class' : 'red',
|
|
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$('a.shutdown').bind('click',function(e) {
|
|
e.preventDefault();
|
|
var target = $( this ).attr('href');
|
|
$.confirm({
|
|
'title' : 'Shutdown',
|
|
'message' : 'Are you sure you want to shutdown SickGear ?',
|
|
'buttons' : {
|
|
'Yes' : {
|
|
'class' : 'green',
|
|
'action': function(){
|
|
location.href = target;
|
|
}
|
|
},
|
|
'No' : {
|
|
'class' : 'red',
|
|
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$('a.restart').bind('click',function(e) {
|
|
e.preventDefault();
|
|
var target = $( this ).attr('href');
|
|
$.confirm({
|
|
'title' : 'Restart',
|
|
'message' : 'Are you sure you want to restart SickGear ?',
|
|
'buttons' : {
|
|
'Yes' : {
|
|
'class' : 'green',
|
|
'action': function(){
|
|
location.href = target;
|
|
}
|
|
},
|
|
'No' : {
|
|
'class' : 'red',
|
|
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$('a.remove').bind('click',function(e) {
|
|
e.preventDefault();
|
|
var target = $( this ).attr('href');
|
|
var showname = document.getElementById('showtitle').getAttribute('data-showname');
|
|
$.confirm({
|
|
'title' : 'Remove Show',
|
|
'message' : 'Are you sure you want to remove <span class="footerhighlight">' + showname + '</span> from the database ?<br /><br /><input type="checkbox" id="deleteFiles"> <span class="red-text">Check to delete files as well. IRREVERSIBLE</span></input>',
|
|
'buttons' : {
|
|
'Yes' : {
|
|
'class' : 'green',
|
|
'action': function(){
|
|
location.href = target + (document.getElementById('deleteFiles').checked ? '&full=1' : '');
|
|
// If checkbox is ticked, remove show and delete files. Else just remove show.
|
|
}
|
|
},
|
|
'No' : {
|
|
'class' : 'red',
|
|
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$('a.clearhistory').bind('click',function(e) {
|
|
e.preventDefault();
|
|
var target = $( this ).attr('href');
|
|
$.confirm({
|
|
'title' : 'Clear History',
|
|
'message' : 'Are you sure you want to clear all download history ?',
|
|
'buttons' : {
|
|
'Yes' : {
|
|
'class' : 'green',
|
|
'action': function(){
|
|
location.href = target;
|
|
}
|
|
},
|
|
'No' : {
|
|
'class' : 'red',
|
|
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$('a.trimhistory').bind('click',function(e) {
|
|
e.preventDefault();
|
|
var target = $( this ).attr('href');
|
|
$.confirm({
|
|
'title' : 'Trim History',
|
|
'message' : 'Are you sure you want to trim all download history older than 30 days ?',
|
|
'buttons' : {
|
|
'Yes' : {
|
|
'class' : 'green',
|
|
'action': function(){
|
|
location.href = target;
|
|
}
|
|
},
|
|
'No' : {
|
|
'class' : 'red',
|
|
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
}); |