@ -33,9 +33,8 @@ window.addEvent('load', function(){
var saveColumnSizes = function ( ) {
var saveColumnSizes = function ( ) {
var filters _width = $ ( 'Filters' ) . getSize ( ) . x ;
var filters _width = $ ( 'Filters' ) . getSize ( ) . x ;
var properties _height = $ ( 'propertiesPanel' ) . getSize ( ) . y ;
var properties _height = $ ( 'propertiesPanel' ) . getSize ( ) . y ;
// Save it in a cookie
localStorage . setItem ( 'filters_width' , filters _width ) ;
Cookie . write ( 'filters_width' , filters _width ) ;
localStorage . setItem ( 'properties_height' , properties _height ) ;
Cookie . write ( 'properties_height' , properties _height ) ;
}
}
/ * M o c h a U I . D e s k t o p = n e w M o c h a U I . D e s k t o p ( ) ;
/ * M o c h a U I . D e s k t o p = n e w M o c h a U I . D e s k t o p ( ) ;
@ -45,7 +44,7 @@ window.addEvent('load', function(){
} ) ; * /
} ) ; * /
MochaUI . Desktop . initialize ( ) ;
MochaUI . Desktop . initialize ( ) ;
var filt _w = Cookie . read ( 'filters_width' ) ;
var filt _w = localStorage . getItem ( 'filters_width' ) ;
if ( $defined ( filt _w ) )
if ( $defined ( filt _w ) )
filt _w = filt _w . toInt ( ) ;
filt _w = filt _w . toInt ( ) ;
else
else
@ -112,11 +111,10 @@ window.addEvent('load', function(){
. replace ( "%2" , friendlyUnit ( info . dl _info _data , false ) ) ) ;
. replace ( "%2" , friendlyUnit ( info . dl _info _data , false ) ) ) ;
$ ( "UpInfos" ) . set ( 'html' , "_(U: %1 - T: %2)" . replace ( "%1" , friendlyUnit ( info . up _info _speed , true ) )
$ ( "UpInfos" ) . set ( 'html' , "_(U: %1 - T: %2)" . replace ( "%1" , friendlyUnit ( info . up _info _speed , true ) )
. replace ( "%2" , friendlyUnit ( info . up _info _data , false ) ) ) ;
. replace ( "%2" , friendlyUnit ( info . up _info _data , false ) ) ) ;
if ( info . show _speed _in _title ) {
if ( localStorage . getItem ( 'speed_in_browser_title_bar' ) == 'true' )
document . title = "_(D:%1 U:%2)" . replace ( "%1" , friendlyUnit ( info . dl _info _speed , true ) ) . replace ( "%2" , friendlyUnit ( info . up _info _speed , true ) ) ;
document . title = "_(D:%1 U:%2)" . replace ( "%1" , friendlyUnit ( info . dl _info _speed , true ) ) . replace ( "%2" , friendlyUnit ( info . up _info _speed , true ) ) ;
} else {
else
document . title = "_(qBittorrent web User Interface)" ;
document . title = "_(qBittorrent web User Interface)" ;
}
waitingTrInfo = false ;
waitingTrInfo = false ;
loadTransferInfo . delay ( 3000 ) ;
loadTransferInfo . delay ( 3000 ) ;
}
}
@ -227,7 +225,7 @@ window.addEvent('load', function(){
onResize : saveColumnSizes ,
onResize : saveColumnSizes ,
height : null
height : null
} ) ;
} ) ;
var prop _h = Cookie . read ( 'properties_height' ) ;
var prop _h = localStorage . getItem ( 'properties_height' ) ;
if ( $defined ( prop _h ) )
if ( $defined ( prop _h ) )
prop _h = prop _h . toInt ( ) ;
prop _h = prop _h . toInt ( ) ;
else
else
@ -253,14 +251,13 @@ window.addEvent('load', function(){
$ ( "all_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "all_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "downloading_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "downloading_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "completed_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "completed_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "paused_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "paused_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "active_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "active_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "inactive_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( "inactive_filter" ) . removeClass ( "selectedFilter" ) ;
$ ( f + "_filter" ) . addClass ( "selectedFilter" ) ;
$ ( f + "_filter" ) . addClass ( "selectedFilter" ) ;
myTable . setFilter ( f ) ;
myTable . setFilter ( f ) ;
ajaxfn ( ) ;
ajaxfn ( ) ;
// Remember this via Cookie
localStorage . setItem ( 'selected_filter' , f ) ;
Cookie . write ( 'selected_filter' , f ) ;
}
}
} ) ;
} ) ;