git @ Cat's Eye Technologies Lexeduct / e980c5c
This optionsInput thing is taking its sweet time to disappear Chris Pressey 6 years ago
1 changed file(s) with 13 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
6060 var process = function() {
6161 var t = transformer['identity'].makeTransformer({});
6262 for (var i = 0; i < transformerSlots.length; i++) {
63 var select = transformerSlots[i].select;
64 var transformerName = select.options[select.selectedIndex].value;
65 var params = parseOptions(transformerSlots[i].optionsInput.value);
66 var t2 = transformer[transformerName].makeTransformer(params);
63 var transformerName = transformerSlots[i].name;
64 var selectedParams = transformerSlots[i].selectedParams;
65 var t2 = transformer[transformerName].makeTransformer(selectedParams);
6766 t = compose(t2, t);
6867 }
6968 var inLines = input.value.split('\n');
104103
105104 var makeTransformerSlot = function(container, index) {
106105 var select = yoob.makeSelect(
107 transformersPanel, "Transformer " + (i+1), transformerNames
106 transformersPanel, "Transformer " + (index+1), transformerNames
108107 );
109108 yoob.makeLineBreak(transformersPanel);
110109 var parametersPanel = yoob.makeDiv(transformersPanel);
110
111 var getSelectedParams = function(panel) {
112 // TODO FIXME
113 return parseOptions(transformerSlots[i].optionsInput.value);
114 };
115
111116 select.onchange = function(e) {
117 updateParametersPanel(parametersPanel);
118 transformerSlots[index].name = select.options[select.selectedIndex].value;
119 transformerSlots[index].selectedParams = getSelectedParams(parametersPanel);
112120 if (liveMode) {
113121 process();
114122 }
115 updateParametersPanel(parametersPanel);
116123 };
117124
118125 //------------ deprecated...