This commit is contained in:
tonio
2012-01-11 10:38:32 +01:00
40 changed files with 1075 additions and 459 deletions
+7 -1
View File
@@ -483,4 +483,10 @@ div.row label {
.element {
margin: 10px 5px 10px 5px;
}
}
/* Parameters or Preferences */
#footer > #update {
color: #000000;
margin: 2px;
}
+3
View File
@@ -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
View File
@@ -234,4 +234,4 @@ saveparams = function(id, message) {
}
}).send();
});
};
};
+30
View File
@@ -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
}
});