2011-07-05 18:38:42 +00:00
function refresh _files ( )
{
2014-04-14 22:54:01 +00:00
$ ( '#backup_files' ) . load ( 'files.jim' , function ( ) {
2011-07-05 18:38:42 +00:00
$ ( 'input.restore' ) . change ( function ( ) {
$ ( '#restore_button' ) . removeAttr ( 'disabled' )
. button ( 'option' , 'disabled' , false ) ;
$ ( '#delete_button' ) . removeAttr ( 'disabled' )
. button ( 'option' , 'disabled' , false ) ;
2012-09-21 20:56:53 +00:00
$ ( '#view_button' ) . removeAttr ( 'disabled' )
. button ( 'option' , 'disabled' , false ) ;
2011-07-05 18:38:42 +00:00
} ) ;
} ) ;
}
$ ( document ) . ready ( function ( ) {
$ ( 'button' ) . button ( ) ;
refresh _files ( ) ;
$ ( '#backup_button' ) . click ( function ( ) {
$ ( '#backup_working' ) . slideDown ( ) ;
2014-04-14 22:54:01 +00:00
$ ( '#results' ) . load ( 'backup.jim?' +
2011-07-05 18:38:42 +00:00
$ ( '#backup_name' ) . serialize ( ) , function ( ) {
$ ( '#results' ) . slideDown ( function ( ) {
$ ( '#backup_working' ) . slideUp ( ) ;
refresh _files ( ) ;
} ) ;
} ) ;
} ) ;
$ ( '#delete_button' ) . click ( function ( ) {
2011-10-03 09:37:24 +00:00
var backup = $ ( 'input.restore:checked' ) . val ( ) ;
2011-07-05 18:38:42 +00:00
if ( confirm ( 'Confirm deletion of ' + backup ) )
{
2014-04-14 22:54:01 +00:00
$ ( '#results' ) . load ( 'delete.jim?' +
2011-07-05 18:38:42 +00:00
$ ( 'input.restore' ) . serialize ( ) , function ( ) {
$ ( '#results' ) . slideDown ( function ( ) {
refresh _files ( ) ;
} ) ;
} ) ;
}
} ) ;
2012-09-21 20:56:53 +00:00
$ ( '#view_button' ) . click ( function ( ) {
var backup = $ ( 'input.restore:checked' ) . val ( ) ;
2014-04-14 22:54:01 +00:00
$ ( '#results' ) . load ( 'view.jim?' +
2012-09-21 20:56:53 +00:00
$ ( 'input.restore' ) . serialize ( ) , function ( ) {
$ ( '#results' ) . slideDown ( function ( ) {
refresh _files ( ) ;
} ) ;
} ) ;
} ) ;
2011-07-05 18:38:42 +00:00
$ ( '#restore_button' ) . click ( function ( ) {
2011-10-03 09:37:24 +00:00
var backup = $ ( 'input.restore:checked' ) . val ( ) ;
2011-07-07 22:33:19 +00:00
if ( confirm ( '!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE CONFIRM !!!!!!!!!!!!!!!!!!!!!!!!!\n\nAre you sure you wish to erase all scheduled recordings and favourite channels and then restore them from\n' + backup + '?' ) )
2011-07-05 22:59:34 +00:00
{
2011-07-06 23:16:20 +00:00
$ ( '#restore_working' ) . slideDown ( ) ;
2014-04-14 22:54:01 +00:00
$ ( '#results' ) . load ( 'restore.jim?' +
2011-07-05 22:59:34 +00:00
$ ( 'input.restore' ) . serialize ( ) , function ( ) {
$ ( '#results' ) . slideDown ( function ( ) {
$ ( '#restore_working' ) . slideUp ( ) ;
refresh _files ( ) ;
2011-07-08 20:39:57 +00:00
$ ( '#restore_warning' ) . slideDown ( ) ;
$ ( '#restart_block' ) . load (
'/cgi-bin/restartblock.jim' ) ;
2011-07-05 22:59:34 +00:00
} ) ;
} ) ;
}
2011-07-05 18:38:42 +00:00
} ) ;
} ) ;