git @ Cat's Eye Technologies Lexeduct / 003092c
Add identity filter. Make UI slightly more functional. Chris Pressey 6 years ago
2 changed file(s) with 19 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2828
2929 var transformerNames = [["identity", "---"]];
3030 for (var key in makeTransformer) {
31 if (makeTransformer.hasOwnProperty(key)) {
31 if (key !== 'identity' && makeTransformer.hasOwnProperty(key)) {
3232 transformerNames.push([key, key]);
3333 }
3434 }
3535
3636 var MAX_TRANSFORMERS = 8; // TODO dynamic
37 var transformers = new Array(MAX_TRANSFORMERS);
37 var transformerSelects = [];
3838
3939 for (var i = 0; i < MAX_TRANSFORMERS; i++) {
40 yoob.makeSelect(transformersPanel, "Transformer " + (i+1), transformerNames);
40 var select = yoob.makeSelect(
41 transformersPanel, "Transformer " + (i+1), transformerNames
42 );
43 transformerSelects.push(select);
4144 yoob.makeLineBreak(transformersPanel);
4245 yoob.makeTextInput(transformersPanel, 24);
4346 yoob.makeLineBreak(transformersPanel);
4447 }
4548
4649 processButton = yoob.makeButton(transformersPanel, "Process", function() {
50 var z = "";
51 for (var i = 0; i < transformerSelects.length; i++) {
52 var select = transformerSelects[i];
53 z += select.options[select.selectedIndex].value +','
54 }
55 alert(z);
4756 var t = makeTransformer['upper']({});
4857 output.value = t(input.value);
4958 });
0 module.exports = {
1 makeTransformer: function(cfg) {
2 return function(str, state) {
3 return str;
4 };
5 }
6 };