}
}
- nodes = document.querySelectorAll('[data-type]');
-
- for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
- cbi_validate_field(node, node.getAttribute('data-optional') === 'true',
- node.getAttribute('data-type'));
- }
-
nodes = document.querySelectorAll('[data-choices]');
for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
cbi_dynlist_init(node, choices[2], choices[3], options);
}
+ nodes = document.querySelectorAll('[data-type]');
+
+ for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
+ cbi_validate_field(node, node.getAttribute('data-optional') === 'true',
+ node.getAttribute('data-type'));
+ }
+
cbi_d_update();
}
var obj = document.getElementById(id)
var sel = document.createElement("select");
sel.id = selid;
+ sel.index = obj.index;
sel.className = obj.className.replace(/cbi-input-text/, 'cbi-input-select');
if (obj.nextSibling) {
input.value = '';
cbi_dynlist_keydown({
- target: se,
+ target: input,
keyCode: 8
});
}
else
{
cbi_dynlist_keydown({
- target: se,
+ target: input,
keyCode: 13
});
}
var quot_esc = [/"/g, '"', /'/g, '''];
function esc(s, r) {
+ if (typeof(s) !== 'string' && !(s instanceof String))
+ return '';
+
for( var i = 0; i < r.length; i += 2 )
s = s.replace(r[i], r[i+1]);
return s;
break;
case 'd':
- subst = (+param || 0);
+ subst = ~~(+param || 0);
break;
case 'u':
- subst = Math.abs(+param || 0);
+ subst = ~~Math.abs(+param || 0);
break;
case 'f':