1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-12 23:23:54 +00:00

(trunk web) #2157: web ui should support turtle mode

This commit is contained in:
Charles Kerr 2009-11-14 14:57:47 +00:00
parent 06004319d7
commit 7840d85a24
3 changed files with 25 additions and 1 deletions

View file

@ -286,6 +286,7 @@ Prefs.prototype = { };
Prefs._AutoStart = 'auto-start-torrents';
Prefs._RefreshRate = 'refresh_rate';
Prefs._SessionRefreshRate = 'session_refresh_rate';
Prefs._ShowFilter = 'show_filter';

View file

@ -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);
},
/*

View file

@ -73,6 +73,7 @@ TransmissionRemote.prototype =
null,
'Dismiss');
remote._controller.togglePeriodicRefresh(false);
remote._controller.togglePeriodicSessionRefresh(false);
},
appendSessionId: function(XHR) {