diff --git a/ChangeLog b/ChangeLog index b3e2aaca9..de9437bd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2010-08-27 Wolfgang Sourdeau + + * 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 * SoObjects/SOGo/NSString+Utilities.m (-asQPSubjectString:): we diff --git a/UI/WebServerResources/UIxFilterEditor.js b/UI/WebServerResources/UIxFilterEditor.js index b53e617ac..8df0d2b4d 100644 --- a/UI/WebServerResources/UIxFilterEditor.js +++ b/UI/WebServerResources/UIxFilterEditor.js @@ -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(); diff --git a/UI/WebServerResources/UIxPreferences.js b/UI/WebServerResources/UIxPreferences.js index b43571c77..58d9e7297 100644 --- a/UI/WebServerResources/UIxPreferences.js +++ b/UI/WebServerResources/UIxPreferences.js @@ -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")) {