diff --git a/client/src/blocks/index.js b/client/src/blocks/index.js new file mode 100644 index 0000000..901eefd --- /dev/null +++ b/client/src/blocks/index.js @@ -0,0 +1,4 @@ +module.exports = { + input: require("./input.js"), + output: require("./output.js") +} diff --git a/client/src/blocks/input.js b/client/src/blocks/input.js new file mode 100644 index 0000000..99a9e3d --- /dev/null +++ b/client/src/blocks/input.js @@ -0,0 +1,13 @@ +module.exports = { + name: "Input", + inputs: { + }, + output: true, + execute: function({}, block){ + block.find("input[name='input']").val(); + }, + pageBlock: { + html: "", + js: function(){} + } +} diff --git a/client/src/blocks/output.js b/client/src/blocks/output.js new file mode 100644 index 0000000..c860dff --- /dev/null +++ b/client/src/blocks/output.js @@ -0,0 +1,14 @@ +module.exports = { + name: "Output", + inputs: { + input: "Input" + }, + output: false, + execute: function({input}, block){ + $(elem).find("div.output").html(input1); + }, + pageBlock: { + html: "", + js: function(){} + } +} diff --git a/client/src/blocks/template.js b/client/src/blocks/template.js new file mode 100644 index 0000000..d99312c --- /dev/null +++ b/client/src/blocks/template.js @@ -0,0 +1,15 @@ +module.exports = { + name: "Example Block", + inputs: { + input1: "Input 1" + }, + output: true, + execute: function({input1}, elem){ + $(elem).find("div.input1").html(input1); + return (output = parseInt(input1) + 1).toString(); + }, + pageBlock: { + html: "
", + js: function(){} + } +} diff --git a/client/src/document.js b/client/src/document.js new file mode 100644 index 0000000..f053ebf --- /dev/null +++ b/client/src/document.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/client/src/index.html b/client/src/index.html index 8fda86b..781d609 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -7,38 +7,8 @@ Header will go here