git @ Cat's Eye Technologies Lexeduct / 0a5d06e
Temporarily mess everything up as we try to make some progress. Chris Pressey 6 years ago
1 changed file(s) with 26 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
5757 return cfg;
5858 };
5959
60 var makeParametersPanel = function(container, parameters) {
61 var panel = yoob.makeDiv(container);
62 for (var key in parameters) {
63 if (parameters.hasOwnProperty(key)) {
64 var label = yoob.makeSpan(panel, key);
65 label.style.width = "50%";
66 var input = yoob.makeTextInput(panel, 24);
67 input.style.width = "50%";
68 // TODO: populate it with the default
69 yoob.makeLineBreak(panel);
70 }
71 }
72 return panel;
73 };
74
6075 var process = function() {
6176 var t = transformer['identity'].makeTransformer({});
6277 for (var i = 0; i < transformerSlots.length; i++) {
6378 var select = transformerSlots[i].select;
6479 var transformerName = select.options[select.selectedIndex].value;
65 var options = parseOptions(transformerSlots[i].optionsInput.value);
66 var t2 = transformer[transformerName].makeTransformer(options);
80 var params = parseOptions(transformerSlots[i].optionsInput.value);
81 var t2 = transformer[transformerName].makeTransformer(params);
6782 t = compose(t2, t);
6883 }
6984 var inLines = input.value.split('\n');
8398 yoob.makeLineBreak(transformersPanel);
8499
85100 for (var i = 0; i < MAX_TRANSFORMERS; i++) {
101 // XXX this now needs to be a closure to captur variables correctly
86102 var select = yoob.makeSelect(
87103 transformersPanel, "Transformer " + (i+1), transformerNames
88104 );
105 yoob.makeLineBreak(transformersPanel);
106 var panelContainer = yoob.makeDiv(transformersPanel);
89107 select.onchange = function(e) {
90108 if (liveMode) {
91109 process();
92110 }
111 makeParametersPanel(panelContainer);
93112 };
94 yoob.makeLineBreak(transformersPanel);
113
114 //------------ deprecated...
95115 var optionsInput = yoob.makeTextInput(transformersPanel, 24);
96116 optionsInput.onchange = function(e) {
97117 if (liveMode) {
100120 };
101121 optionsInput.title = "Options";
102122 yoob.makeLineBreak(transformersPanel);
123 //------------
124
125
103126 transformerSlots.push({
104127 select: select,
105128 optionsInput: optionsInput