Commit 846eec2b authored by Sven Franck's avatar Sven Franck

app: adding TODOs and small optimizations

parent a2240e9b
...@@ -2418,9 +2418,9 @@ ...@@ -2418,9 +2418,9 @@
for (section in config) { for (section in config) {
if (config.hasOwnProperty(section)) { if (config.hasOwnProperty(section)) {
arr = config[section]; arr = config[section];
if (typeof arr === "object" && arr !== null) { if (typeof arr === "object" && arr !== null) {
len = arr.length; for (k = 0, len = arr.length; k < len; k += 1) {
for (k = 0; k < len; k += 1) {
block = arr[k]; block = arr[k];
content = factory.util.generateContentElement( content = factory.util.generateContentElement(
block.type, block.type,
...@@ -2438,6 +2438,7 @@ ...@@ -2438,6 +2438,7 @@
} }
} }
} }
// TODO: return an object...
return [fragment, appendix, class_string]; return [fragment, appendix, class_string];
}; };
...@@ -3440,6 +3441,7 @@ ...@@ -3440,6 +3441,7 @@
// TODO: action_menu input + form? // TODO: action_menu input + form?
// TODO: how to handle translations of record texts? // TODO: how to handle translations of record texts?
// TODO: subordinate handling // TODO: subordinate handling
// TODO: pick translations from field_dict for header!
map.tableItem = function (spec) { map.tableItem = function (spec) {
var j, k, segment, row, cell, id, quirk_dict, record, new_item, item; var j, k, segment, row, cell, id, quirk_dict, record, new_item, item;
...@@ -3543,7 +3545,7 @@ ...@@ -3543,7 +3545,7 @@
// loop scheme fields // loop scheme fields
for (k = 0; k < section.field_list.length; k += 1) { for (k = 0; k < section.field_list.length; k += 1) {
field = section.field_list[k]; field = section.field_list[k];
key = field.value || field.field; key = field.value || field.field || "";
relation = key.split("subordinate_"); relation = key.split("subordinate_");
pass = { pass = {
"record": record, "record": record,
...@@ -3624,23 +3626,25 @@ ...@@ -3624,23 +3626,25 @@
// TODO: remove this crap or make it generic... // TODO: remove this crap or make it generic...
// set = setter_list ... JSLINT // set = setter_list ... JSLINT
setValue = function (setter) { setValue = function (setter) {
var n, len, set_value, set_flux, set, val, set_reference; var n, len, set_value, set_flux, set, val, set_reference, logic,
selection, split;
if (setter.logic) { logic = setter.logic;
set_reference = setter.logic.setReference; if (logic) {
set_value = setter.logic.setValue; set_reference = logic.setReference;
val = setter.logic.lookupValue; set_value = logic.setValue;
set = setter.logic.setters; val = logic.lookupValue;
set_flux = setter.logic.setFlux; set = logic.setters;
set_flux = logic.setFlux;
if (set) { if (set) {
len = set.length; len = set.length;
for (n = 0; n < len; n += 1) { for (n = 0; n < len; n += 1) {
if (val) { if (val) {
// FU§$%&/NG HAL // FU§$%&/NG HAL
setter.logic[set[n]] = item.doc[val[n][0]][val[n][1]][val[n][2]]; logic[set[n]] = item.doc[val[n][0]][val[n][1]][val[n][2]];
} else { } else {
setter.logic[set[n]] = item.doc[set_value]; logic[set[n]] = item.doc[set_value];
} }
} }
} else if (set_value) { } else if (set_value) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment