Initial commit — 16 posts converted from dasBlog XML, media assets
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 526 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 177 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
@@ -0,0 +1,94 @@
|
||||
function convertXvalToValidateOptions(xRulesConfig) {
|
||||
// this is adapted from xVal.jquery.validate.js so that it can generate
|
||||
// the rule/message set rather than binding rules directly to DOM elements
|
||||
var vRules = {};
|
||||
var vMessages = {};
|
||||
|
||||
// returns true only if object is empty
|
||||
function isEmpty(obj) {
|
||||
for (var i in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
for (var i = 0; i < xRulesConfig.Fields.length; i++) {
|
||||
var xFieldName = xRulesConfig.Fields[i].FieldName;
|
||||
var xFieldRules = xRulesConfig.Fields[i].FieldRules;
|
||||
|
||||
var vFieldRules = {};
|
||||
var vFieldMessages = {};
|
||||
|
||||
for (var j = 0; j < xFieldRules.length; j++) {
|
||||
var xRule = xFieldRules[j];
|
||||
if (xRule != null) {
|
||||
var ruleName = xRule.RuleName;
|
||||
var ruleParams = xRule.RuleParameters;
|
||||
var errorText = (typeof (xRule.Message) == 'undefined' ? null : xRule.Message);
|
||||
|
||||
switch (ruleName) {
|
||||
case "Required":
|
||||
vFieldRules.required = true;
|
||||
if (errorText)
|
||||
vFieldMessages.required = errorText;
|
||||
break;
|
||||
case "Range":
|
||||
// NOTE: If DataAnnotations could be sending different types for string and DateTime,
|
||||
// implement the checks here if needed
|
||||
if (typeof (ruleParams.Min) == 'undefined') {
|
||||
vFieldRules.max = ruleParams.Max;
|
||||
if (errorText)
|
||||
vFieldMessages.max = errorText;
|
||||
}
|
||||
else if (typeof (ruleParams.Max) == 'undefined') {
|
||||
vFieldRules.min = ruleParams.Min;
|
||||
if (errorText)
|
||||
vFieldMessages.min = errorText;
|
||||
}
|
||||
else {
|
||||
vFieldRules.range = [ruleParams.Min, ruleParams.Max];
|
||||
if (errorText)
|
||||
vFieldMessages.range = errorText;
|
||||
}
|
||||
break;
|
||||
case "StringLength":
|
||||
// NOTE: the StringLengthAttribute only takes a max length parameter
|
||||
vFieldRules.maxlength = ruleParams.MaxLength;
|
||||
if (errorText)
|
||||
vFieldMessages.maxlength = errorText;
|
||||
break;
|
||||
case "DataType":
|
||||
switch (ruleParams.Type) {
|
||||
case "EmailAddress":
|
||||
vFieldRules.email = true;
|
||||
if (errorText)
|
||||
vFieldMessages.email = errorText;
|
||||
break;
|
||||
case "Integer":
|
||||
vFieldRules.digits = true;
|
||||
if (errorText)
|
||||
vFieldMessages.digits = errorText;
|
||||
break;
|
||||
case "Decimal":
|
||||
vFieldRules.number = true;
|
||||
if (errorText)
|
||||
vFieldMessages.number = errorText;
|
||||
break;
|
||||
case "Date":
|
||||
vFieldRules.date = true;
|
||||
if (errorText)
|
||||
vFieldMessages.date = errorText;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isEmpty(vFieldRules))
|
||||
vRules[xFieldName] = vFieldRules;
|
||||
if (!isEmpty(vFieldMessages))
|
||||
vMessages[xFieldName] = vFieldMessages;
|
||||
}
|
||||
}
|
||||
removeNumberRuleForCurrency(vRules);
|
||||
return { rules: vRules, messages: vMessages };
|
||||
}
|
||||