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:
Francis Lachapelle
2012-01-02 19:02:43 +00:00
parent fd3d125d20
commit 45e13c3e4d
2 changed files with 33 additions and 9 deletions
+5
View File
@@ -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:):
+28 -9
View File
@@ -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;
}