mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-21 06:18:45 +02:00
Merge
This commit is contained in:
@@ -483,4 +483,10 @@ div.row label {
|
||||
|
||||
.element {
|
||||
margin: 10px 5px 10px 5px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Parameters or Preferences */
|
||||
#footer > #update {
|
||||
color: #000000;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
@@ -227,6 +227,9 @@ var AnchorNavigation = new Class({
|
||||
new Request.JSON({
|
||||
url: query,
|
||||
noCache : true,
|
||||
onComplete: function() {
|
||||
ajax_login_redirect();
|
||||
},
|
||||
onSuccess: function(resp) {
|
||||
if (!this.options.spin_disabled) {
|
||||
var target = this.options.spin_target ? this.options.spin_target
|
||||
|
||||
+1
-1
@@ -234,4 +234,4 @@ saveparams = function(id, message) {
|
||||
}
|
||||
}).send();
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Collection of functions that are accessible to every page.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Simple function that redirect ajax requests to the login page if
|
||||
* the status code received with a response is equal to 278.
|
||||
*/
|
||||
function ajax_login_redirect() {
|
||||
if (this.status != 278) {
|
||||
return;
|
||||
}
|
||||
var params = "?next=" + window.location.pathname;
|
||||
|
||||
window.location.href =
|
||||
this.xhr.getResponseHeader("Location").replace(/\?.*$/, params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Simple wrapper around Request.JSON. We just ensure that
|
||||
* redirections are correctly catched. (on session timeout for
|
||||
* example)
|
||||
*/
|
||||
Request.JSON.mdb = new Class({
|
||||
Extends: Request.JSON,
|
||||
|
||||
options: {
|
||||
onComplete: ajax_login_redirect
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user