mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-01 12:03:55 +01:00
Simple hack to catch redirections after an ajax request. It is not a clean and perfect solution but it should address most cases.
fix #181
This commit is contained in:
@@ -691,6 +691,9 @@ def html2plaintext(content):
|
||||
return plaintext
|
||||
|
||||
def get_current_url(request):
|
||||
if not request.session.has_key("folder"):
|
||||
return ""
|
||||
|
||||
res = "%s?page=%s" % (request.session["folder"], request.session["page"])
|
||||
for p in ["criteria", "pattern", "order"]:
|
||||
if p in request.session.keys():
|
||||
|
||||
@@ -46,7 +46,7 @@ var FdMenu = new Class({
|
||||
if (!confirm(gettext("Delete folder?"))) {
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
new Request.JSON.mdb({
|
||||
url: evt.target.get("href"),
|
||||
method: "GET",
|
||||
onSuccess: function(resp) {
|
||||
|
||||
@@ -219,13 +219,17 @@ function refreshFolder() {
|
||||
profile : "gray",
|
||||
spinner : true
|
||||
});
|
||||
new Request.JSON({url: query, noCache : true, onSuccess: function(resp) {
|
||||
var callback = ($defined(resp.callback)) ? resp.callback : "default";
|
||||
new Request.JSON.mdb({
|
||||
url: query,
|
||||
noCache : true,
|
||||
onSuccess: function(resp) {
|
||||
var callback = ($defined(resp.callback)) ? resp.callback : "default";
|
||||
|
||||
current_anchor.get_callback(callback)(resp);
|
||||
infobox.info(gettext("Done"));
|
||||
infobox.hide(1);
|
||||
}}).get();
|
||||
current_anchor.get_callback(callback)(resp);
|
||||
infobox.info(gettext("Done"));
|
||||
infobox.hide(1);
|
||||
}
|
||||
}).get();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -240,7 +244,7 @@ function simple_request(url, params) {
|
||||
profile: "gray",
|
||||
spinner: true
|
||||
});
|
||||
new Request.JSON({
|
||||
new Request.JSON.mdb({
|
||||
url : url,
|
||||
onSuccess : function(response) {
|
||||
if (response.status == "ok") {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<script type="text/javascript">
|
||||
function del_attachment(evt) {
|
||||
evt.stop();
|
||||
new Request.JSON({
|
||||
new Request.JSON.mdb({
|
||||
url: this.get("href"),
|
||||
onSuccess: function(resp) {
|
||||
this.getParent().dispose();
|
||||
|
||||
Reference in New Issue
Block a user