mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 04:18:39 +00:00
(trunk web) #2157: web ui should support turtle mode
This commit is contained in:
@@ -121,6 +121,7 @@ Transmission.prototype =
|
||||
this.initializeAllTorrents();
|
||||
|
||||
this.togglePeriodicRefresh( true );
|
||||
this.togglePeriodicSessionRefresh( true );
|
||||
},
|
||||
|
||||
loadDaemonPrefs: function( async ){
|
||||
@@ -739,7 +740,7 @@ Transmission.prototype =
|
||||
},
|
||||
|
||||
/*
|
||||
* Turn the periodic ajax-refresh on & off
|
||||
* Turn the periodic ajax torrents refresh on & off
|
||||
*/
|
||||
togglePeriodicRefresh: function(state) {
|
||||
var tr = this;
|
||||
@@ -755,6 +756,25 @@ Transmission.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Turn the periodic ajax session refresh on & off
|
||||
*/
|
||||
togglePeriodicSessionRefresh: function(state) {
|
||||
var tr = this;
|
||||
if (state && this._periodic_session_refresh == null) {
|
||||
// sanity check
|
||||
if( !this[Prefs._SessionRefreshRate] )
|
||||
this[Prefs._SessionRefreshRate] = 5;
|
||||
remote = this.remote;
|
||||
this._periodic_session_refresh = setInterval(
|
||||
function(){ tr.loadDaemonPrefs(); }, this[Prefs._SessionRefreshRate] * 1000
|
||||
);
|
||||
} else {
|
||||
clearInterval(this._periodic_session_refresh);
|
||||
this._periodic_session_refresh = null;
|
||||
}
|
||||
},
|
||||
|
||||
toggleTurtleClicked: function() {
|
||||
// Toggle the value
|
||||
this[Prefs._TurtleState] = !this[Prefs._TurtleState];
|
||||
@@ -787,6 +807,7 @@ Transmission.prototype =
|
||||
if( Safari3 )
|
||||
setTimeout("$('div#prefs_container div.dialog_window').css('top', '0px');",10);
|
||||
this.updateButtonStates( );
|
||||
this.togglePeriodicSessionRefresh(false);
|
||||
},
|
||||
|
||||
hidePrefsDialog: function( )
|
||||
@@ -802,6 +823,7 @@ Transmission.prototype =
|
||||
$('#prefs_container').hide();
|
||||
}
|
||||
this.updateButtonStates( );
|
||||
this.togglePeriodicSessionRefresh(true);
|
||||
},
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user