mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk web) web ui fixes from kjg
This commit is contained in:
parent
3cc43a7d03
commit
b293474ae4
1 changed files with 10 additions and 8 deletions
|
@ -41,22 +41,24 @@ TransmissionRemote.prototype =
|
||||||
* Display an error if an ajax request fails, and stop sending requests
|
* Display an error if an ajax request fails, and stop sending requests
|
||||||
*/
|
*/
|
||||||
ajaxError: function(request, error_string, exception) {
|
ajaxError: function(request, error_string, exception) {
|
||||||
this._error = request.responseText
|
remote = this;
|
||||||
? request.responseText.trim().replace(/(<([^>]+)>)/ig,"")
|
remote._error = request.responseText
|
||||||
: "";
|
? request.responseText.trim().replace(/(<([^>]+)>)/ig,"")
|
||||||
if( !this._error.length )
|
: "";
|
||||||
this._error = 'Server not responding';
|
if( !remote._error.length )
|
||||||
|
remote._error = 'Server not responding';
|
||||||
|
|
||||||
dialog.confirm('Connection Failed',
|
dialog.confirm('Connection Failed',
|
||||||
'Could not connect to the server. You may need to reload the page to reconnect.',
|
'Could not connect to the server. You may need to reload the page to reconnect.',
|
||||||
'Details',
|
'Details',
|
||||||
'alert(transmission.remote._error);',
|
'alert(remote._error);',
|
||||||
null,
|
null,
|
||||||
'Dismiss');
|
'Dismiss');
|
||||||
transmission.togglePeriodicRefresh(false);
|
remote._controller.togglePeriodicRefresh(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
sendRequest: function( data, success ) {
|
sendRequest: function( data, success ) {
|
||||||
|
remote = this;
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
url: RPC._Root,
|
url: RPC._Root,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -64,7 +66,7 @@ TransmissionRemote.prototype =
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
cache: false,
|
cache: false,
|
||||||
data: $.toJSON(data),
|
data: $.toJSON(data),
|
||||||
error: this.ajaxError,
|
error: function(request, error_string, exception){ remote.ajaxError(request, error_string, exception) },
|
||||||
success: success
|
success: success
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue