mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
IE compat. + bugfixes
This commit is contained in:
@@ -65,7 +65,8 @@ window.addEvent("domready", function() {
|
||||
if (p == "") {
|
||||
return;
|
||||
}
|
||||
new Request.JSON({url : url + "?" + p, onSuccess : getgraph_callback}).get();
|
||||
new Request.JSON({url : url + "?" + p, noCache: true,
|
||||
onSuccess : getgraph_callback}).get();
|
||||
}
|
||||
|
||||
{% if admin %}
|
||||
|
||||
@@ -277,8 +277,9 @@ class IMAPconnector(object):
|
||||
|
||||
def move(self, msgset, oldfolder, newfolder):
|
||||
self.m.select(self._encodefolder(oldfolder), True)
|
||||
self.m.copy(msgset, newfolder)
|
||||
self.m.store(msgset, "+FLAGS", "\\Deleted")
|
||||
status, data = self.m.copy(msgset, self._encodefolder(newfolder))
|
||||
if status == 'OK':
|
||||
self.m.store(msgset, "+FLAGS", "\\Deleted")
|
||||
|
||||
def push_mail(self, folder, msg):
|
||||
now = imaplib.Time2Internaldate(time.time())
|
||||
|
||||
@@ -67,7 +67,6 @@ tr.selected {
|
||||
|
||||
.box li.selected {
|
||||
background-color: #ffffcc;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.box a:link, .box a:visited {
|
||||
@@ -117,8 +116,8 @@ th.selected {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.dragging {
|
||||
background: #6AB0C5;
|
||||
.box li.dragging {
|
||||
background-color: #6AB0C5;
|
||||
}
|
||||
|
||||
ul.hidden {
|
||||
@@ -126,7 +125,7 @@ ul.hidden {
|
||||
}
|
||||
|
||||
ul.visible {
|
||||
background: white;
|
||||
background-color: white;
|
||||
display: block;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
@@ -105,19 +105,14 @@
|
||||
register_callback("forward", compose_callback);
|
||||
|
||||
loadFolder = function(event, obj) {
|
||||
event.stop();
|
||||
if (!$defined(obj)) {
|
||||
obj = $(event.target);
|
||||
}
|
||||
event.stop();
|
||||
// the following code prevents a bug under IE7
|
||||
// because fullpath is returned instead of a relative one.
|
||||
// (even if mootools uses getAttribute("href", 2), this is not working with AJAX requests)
|
||||
var url = obj.get("href");
|
||||
var baseurl = "http://" + location.host + location.pathname;
|
||||
url = url.replace(baseurl, "");
|
||||
current_anchor.parse_string(url, true).setparams(navparams);
|
||||
current_anchor.parse_string(gethref(obj), true).setparams(navparams);
|
||||
current_anchor.update();
|
||||
}
|
||||
|
||||
register_callback("folder", function(resp) {
|
||||
wm_updatelisting(resp);
|
||||
select($$("a[href=" + current_anchor.getbaseurl() + "]"));
|
||||
@@ -200,7 +195,7 @@
|
||||
return;
|
||||
}
|
||||
droppable.removeClass("dragging");
|
||||
dest = droppable.getFirst("a").get("href");
|
||||
dest = gethref(droppable.getFirst("a"));
|
||||
msgset = new Array();
|
||||
selectedRows.each(function(item, index) {
|
||||
msgset.include(item.get("id"));
|
||||
@@ -229,10 +224,10 @@
|
||||
$$("a[name=mark-unread]").addEvent("click", buildmarkrequest);
|
||||
|
||||
$$("a[name=fdaction]").addEvent("click", function(evt) {
|
||||
evt.stop();
|
||||
new Request.JSON({url : evt.target.get("href"),
|
||||
onSuccess : get_callback("folder")
|
||||
}).get();
|
||||
evt.stop();
|
||||
});
|
||||
|
||||
if ($("toggleselect")) {
|
||||
@@ -273,6 +268,7 @@
|
||||
select(event.target);
|
||||
loadFolder(event, event.target);
|
||||
}
|
||||
|
||||
{% endblock %}
|
||||
{% block middletitle %}{% trans "Webmail" %}{% endblock %}
|
||||
{% block leftcol %}
|
||||
|
||||
@@ -119,10 +119,6 @@ def print_folders(folders):
|
||||
result += "<a href='%s' class='%s' name='loadfolder'>%s</a>\n" \
|
||||
% (fd.has_key("path") and fd["path"] or fd["name"], cssclass, label)
|
||||
if fd.has_key("sub"):
|
||||
#result += "<img name='%s' class='clickable' src='/static/pics/%s' />\n" \
|
||||
# % (fd["path"], icon)
|
||||
result += "<ul name='%s' class='hidden'>" % (fd["path"]) + print_folders(fd["sub"]) + "</ul>\n"
|
||||
#else:
|
||||
# result += "<img src='/static/pics/%s' />\n" % icon
|
||||
result += "</li>\n"
|
||||
return result
|
||||
|
||||
@@ -8,7 +8,6 @@ from django.utils import simplejson
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.views.decorators.cache import cache_control, never_cache
|
||||
from mailng.admin.models import Mailbox
|
||||
from mailng.lib import parameters, _render, _render_error, getctx, is_not_localadmin
|
||||
from mailng.lib.email_listing import parse_search_parameters
|
||||
@@ -25,7 +24,6 @@ def __get_current_url(request):
|
||||
|
||||
@login_required
|
||||
@is_not_localadmin()
|
||||
@cache_control(must_revalidate=True, private=True, no_cache=True)
|
||||
def folder(request, name, updatenav=True):
|
||||
if not name:
|
||||
name = "INBOX"
|
||||
@@ -68,7 +66,6 @@ def folder(request, name, updatenav=True):
|
||||
|
||||
@login_required
|
||||
@is_not_localadmin()
|
||||
@cache_control(must_revalidate=True, private=True, no_cache=True)
|
||||
def index(request):
|
||||
#try:
|
||||
navp = request.session.has_key("navparams") \
|
||||
@@ -254,8 +251,6 @@ def send_mail(request, withctx=False, origmsg=None, posturl=None):
|
||||
|
||||
@login_required
|
||||
@is_not_localadmin()
|
||||
#@cache_control(no_cache=True, expires=-1)
|
||||
@never_cache
|
||||
def compose(request):
|
||||
if request.method == "POST":
|
||||
return send_mail(request, posturl=reverse(compose))
|
||||
|
||||
+13
-2
@@ -34,7 +34,7 @@ check_anchor = function() {
|
||||
query = current_anchor.serialized.substring(1);
|
||||
}
|
||||
infobox.show(gettext("Loading..."), "gray");
|
||||
new Request.JSON({url: query, onSuccess: function(resp) {
|
||||
new Request.JSON({url: query, noCache : true, onSuccess: function(resp) {
|
||||
callback = ($defined(resp.callback)) ? resp.callback : "default";
|
||||
callbacks[callback](resp);
|
||||
infobox.notice(gettext("Done"));
|
||||
@@ -110,7 +110,7 @@ function HashWrapper(deflocation) {
|
||||
};
|
||||
|
||||
this.update = function(force) {
|
||||
window.location.hash = this.serialize();
|
||||
location.hash = this.serialize();
|
||||
if ($defined(force)) {
|
||||
this.force = force;
|
||||
}
|
||||
@@ -321,3 +321,14 @@ searchbox_init = function() {
|
||||
});
|
||||
$("searchbox").setStyle("float", "left");
|
||||
}
|
||||
|
||||
// The following code prevents a bug under IE7 because fullpath is
|
||||
// returned instead of a relative one. (even if mootools uses
|
||||
// getAttribute("href", 2), this is not working with AJAX
|
||||
// requests)
|
||||
gethref = function(obj) {
|
||||
var url = obj.get("href");
|
||||
var baseurl = "http://" + location.host + location.pathname;
|
||||
|
||||
return url.replace(baseurl, "");
|
||||
}
|
||||
Reference in New Issue
Block a user