Monotone-Parent: 748bc1fd6d5c867c7b2b4da7574602b322a35fa5

Monotone-Revision: 6731baba845a29cc3395d6e6d558a49a66e757ac

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-27T14:56:57
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-08-27 14:56:57 +00:00
parent c380057b28
commit ff00afd916
3 changed files with 30 additions and 9 deletions
+16
View File
@@ -1,3 +1,19 @@
2010-08-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/WebServerResources/UIxPreferences.js: (appendSieveFilterRow):
we bind the "click" event on the activation checkbox rather than
"change", because a certain obsolete browser simply ignores it.
(updateFilterFromEditor): the "filter" argument is replaced with a
JSON-encoded string representing the filter in question. On a
certain obsolete browser, object referencing is so messed up that
closing the "creator" window will suddenly invalidate the created
objects. This solves the voodoo error message "The callee (server
[not server application]) is not available and disappeared; all
connections are invalid." when saving and closing.
(setupMailboxesFromJSON): new method, created due the same issue
as above, that enables the creation of an array from the response
received by the filter editing window.
2010-08-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSString+Utilities.m (-asQPSubjectString:): we
+2 -7
View File
@@ -44,17 +44,12 @@ function loadMailboxes() {
function onLoadMailboxesCallback(http) {
if (http.readyState == 4) {
window.opener.userMailboxes = $([]);
// log("http.status: " + http.status);
if (http.status == 200) {
checkAjaxRequestsState();
if (http.responseText.length > 0) {
var jsonResponse = http.responseText.evalJSON(true);
var responseMboxes = jsonResponse.mailboxes;
for (var i = 0; i < responseMboxes.length; i++) {
var name = responseMboxes[i].path.substr(1);
window.opener.userMailboxes.push(name);
}
window.opener.setupMailboxesFromJSON(jsonResponse);
}
}
setupFilterViews();
@@ -779,7 +774,7 @@ function onActionDeleteClick(event) {
function savePreferences() {
if (window.opener) {
window.opener.updateFilterFromEditor(filterId, filter);
window.opener.updateFilterFromEditor(filterId, Object.toJSON(filter));
}
window.close();
+12 -2
View File
@@ -205,7 +205,7 @@ function appendSieveFilterRow(filterTable, number, filter) {
type: "checkbox" },
null, activeColumn);
var bound = onScriptActiveCheck.bindAsEventListener(cb);
cb.observe("change", bound);
cb.observe("click", bound);
row.appendChild(activeColumn);
filterTable.tBodies[0].appendChild(row);
@@ -350,7 +350,17 @@ function getFilterFromEditor(filterId) {
return copyFilter(filters[filterId]);
}
function updateFilterFromEditor(filterId, filter) {
function setupMailboxesFromJSON(jsonResponse) {
var responseMboxes = jsonResponse.mailboxes;
userMailboxes = $([]);
for (var i = 0; i < responseMboxes.length; i++) {
var name = responseMboxes[i].path.substr(1);
userMailboxes.push(name);
}
}
function updateFilterFromEditor(filterId, filterJSON) {
var filter = filterJSON.evalJSON();
var sanitized = {};
for (var k in filter) {
if (!(k == "rules" && filter.match == "allmessages")) {