forEach(form.elements, function (control) { var scope = data; if ((control.type === 'submit') || (control.name.match(/\.time(\[.+|$)/) && (control.getAttribute('type') === 'time') || !control.name)) { return; } if ((value = getControlValue(control)) !== null) { name = control.name; if (contains(name, '[')) { names = name.split(/\[|\]\[|\]/); names.pop(); name = names.pop(); while ((tname = names.shift())) { if (endsWith(tname, '.date') && (control.getAttribute('type') === 'date')) { tname = tname.slice(0, -5); } scope = scope[tname] || (scope[tname] = {}); } } if (scope[name]) { if (!isArray(scope[name])) { scope[name] = [scope[name]]; } scope[name].push(value); } else if (endsWith(name, '.date') && (control.getAttribute('type') === 'date')) { scope[name.slice(0, -5)] = value; } else { scope[name] = value; } } });
readdir(settingsDir).all(function (name, index, list) { var tname; if (endsWith(name, '.default.js') && !contains(list, tname = name.slice(0, -('default.js'.length)) + 'js')) { console.log("Setup settings: " + tname); return copy(settingsDir + '/' + name, settingsDir + '/' + tname); } }));