2011-07-05 18:38:42 +00:00
function refresh _files ( )
{
$ ( '#backup_files' ) . load ( '/cgi-bin/backup/files.jim' , function ( ) {
$ ( '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 ( ) ;
$ ( '#results' ) . load ( '/cgi-bin/backup/backup.jim?' +
$ ( '#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 ) )
{
$ ( '#results' ) . load ( '/cgi-bin/backup/delete.jim?' +
$ ( '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 ( ) ;
$ ( '#results' ) . load ( '/cgi-bin/backup/view.jim?' +
$ ( '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 ( ) ;
2011-07-05 22:59:34 +00:00
$ ( '#results' ) . load ( '/cgi-bin/backup/restore.jim?' +
$ ( '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
} ) ;
} ) ;