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 ) ;
} ) ;
} ) ;
}
$ ( 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 ( ) {
var backup = $ ( 'input.restore' ) . val ( ) ;
if ( confirm ( 'Confirm deletion of ' + backup ) )
{
$ ( '#results' ) . load ( '/cgi-bin/backup/delete.jim?' +
$ ( 'input.restore' ) . serialize ( ) , function ( ) {
$ ( '#results' ) . slideDown ( function ( ) {
refresh _files ( ) ;
} ) ;
} ) ;
}
} ) ;
$ ( '#restore_button' ) . click ( function ( ) {
2011-07-05 22:59:34 +00:00
var backup = $ ( 'input.restore' ) . 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-07 22:33:19 +00:00
alert ( '!!!!!!!!!!!!!! PLEASE NOTE !!!!!!!!!!!!!!\n\nAfter a restore you must restart the box using the link at the top of the screen or via the remote control and then add at least one scheduled entry using the remote control (which you can then delete).' ) ;
window . location . reload ( true ) ;
2011-07-05 22:59:34 +00:00
} ) ;
} ) ;
}
2011-07-05 18:38:42 +00:00
} ) ;
} ) ;