mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-12 18:33:18 +00:00
See ChangeLog.
Monotone-Parent: 2c40f25dddacc34d66befa0a7c8e6c93868a9a92 Monotone-Revision: da4e71f9c5deca84b2df4c90effe9c90f66eb04c Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-01-02T19:02:43
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2012-01-02 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxFilterEditor.js (ensureFieldValidity):
|
||||
a field value is always considered invalid when empty.
|
||||
|
||||
2011-12-29 Ludovic Marcotte <lmarcotte@inverse.ca.>
|
||||
|
||||
* SoObjects/SOGo/SOGoSQLUserProfile.m (_sqlJsonRepresentation:):
|
||||
|
||||
@@ -443,11 +443,10 @@ function ensureValueInputRepresentation(container, valueSpan) {
|
||||
}
|
||||
|
||||
function ensureFieldValidity(input) {
|
||||
var valid = true;
|
||||
if (input.rule.field == "size") {
|
||||
var valid = ensureFieldIsNotEmpty(input);
|
||||
if (valid && input.rule.field == "size") {
|
||||
valid = ensureFieldIsNumerical(input);
|
||||
} else
|
||||
input.removeClassName("_invalid");
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
@@ -456,7 +455,7 @@ function onValueInputChange(event) {
|
||||
if (ensureFieldValidity(this))
|
||||
this.rule.value = this.value;
|
||||
else
|
||||
this.rule.value = "0";
|
||||
this.rule.value = "";
|
||||
}
|
||||
|
||||
function ensureFieldIsNumerical(input) {
|
||||
@@ -470,6 +469,17 @@ function ensureFieldIsNumerical(input) {
|
||||
return valid;
|
||||
}
|
||||
|
||||
function ensureFieldIsNotEmpty(input) {
|
||||
var valid = !input.value.blank();
|
||||
if (valid) {
|
||||
input.removeClassName("_invalid");
|
||||
} else {
|
||||
input.addClassName("_invalid");
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
function appendAction(container, action) {
|
||||
var actionDiv = createElement("div", null, "action",
|
||||
{ action: action }, null,
|
||||
@@ -773,11 +783,20 @@ function onActionDeleteClick(event) {
|
||||
}
|
||||
|
||||
function savePreferences() {
|
||||
if (window.opener) {
|
||||
window.opener.updateFilterFromEditor(filterId, Object.toJSON(filter));
|
||||
}
|
||||
window.close();
|
||||
var inputs = $$("DIV#filterRules input");
|
||||
var valid = true;
|
||||
inputs.each(function(input) {
|
||||
if (input.hasClassName("_invalid"))
|
||||
valid = false;
|
||||
});
|
||||
|
||||
if (valid) {
|
||||
if (window.opener) {
|
||||
window.opener.updateFilterFromEditor(filterId, Object.toJSON(filter));
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user