Lines 15-34
KOHA.AJAX = {
Link Here
|
15 |
KOHA.xhr = xhr; |
15 |
KOHA.xhr = xhr; |
16 |
if ( !xhr.getResponseHeader( 'content-type' ).match( 'application/json' ) ) { |
16 |
if ( !xhr.getResponseHeader( 'content-type' ).match( 'application/json' ) ) { |
17 |
// Something really failed |
17 |
// Something really failed |
18 |
humanMsg.displayAlert( _("Internal Server Error, please reload the page") ); |
18 |
humanMsg.displayAlert( MSG_INTERNAL_SERVER_ERROR ); |
19 |
return; |
19 |
return; |
20 |
} |
20 |
} |
21 |
|
21 |
|
22 |
var error = eval( '(' + xhr.responseText + ')' ); |
22 |
var error = eval( '(' + xhr.responseText + ')' ); |
23 |
|
23 |
|
24 |
if ( error.type == 'auth' ) { |
24 |
if ( error.type == 'auth' ) { |
25 |
humanMsg.displayMsg( _("You need to log in again, your session has timed out") ); |
25 |
humanMsg.displayMsg( MSG_SESSION_TIMED_OUT ); |
26 |
} |
26 |
} |
27 |
|
27 |
|
28 |
if ( callback ) { |
28 |
if ( callback ) { |
29 |
callback( error ); |
29 |
callback( error ); |
30 |
} else { |
30 |
} else { |
31 |
humanMsg.displayAlert( _("Error; your data might not have been saved") ); |
31 |
humanMsg.displayAlert( MSG_DATA_NOT_SAVED ); |
32 |
} |
32 |
} |
33 |
}, |
33 |
}, |
34 |
MarkRunning: function ( selector, text ) { |
34 |
MarkRunning: function ( selector, text ) { |
35 |
- |
|
|