Copiando o repositório do Alexandre

This commit is contained in:
fls committed 2026-09-17 17:37:20 -03:00
1 parent a3e604697b
commit 0ab8836265
363 files changed
+27249

No files matched your search

@@ -0,0 +1,51 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.button",
"language": "javascript",
"extension": "webaudio",
"help": "Button",
"label": "Button",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar block_$id$_value = $prop[value]$;\nvar $port[click]$ = [];\n"
},
{
"name": "execution",
"code": "\nfunction click$id$(){\n value = document.getElementById(\"block_$id$\").value;\n for (var i = 0; i < $port[click]$.length ; i++){\n $port[click]$[i](value);\n }\n};\n"
},
{
"name": "html",
"code": "\n<button type=\"button\" value=\"$prop[value]$\" onClick=\"click$id$();\"\nid=\"block_$id$\">$prop[label]$</button><br>\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 1
},
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
}
],
"ports": [
{
"conn_type": "output",
"name": "click",
"label": "Click",
"type": "javascript.float"
}
]
}
@@ -0,0 +1,54 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.check",
"language": "javascript",
"extension": "webaudio",
"help": "Check",
"label": "Check",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar $port[value]$ = [];\n\nvar $port[invalue]$ = function(value){\n if (value)\n document.getElementById(\"block_$id$\").checked = true;\n else\n document.getElementById(\"block_$id$\").checked = false;\n return true;\n };\n\n"
},
{
"name": "execution",
"code": "\nfunction change_value$id$(e){\n value = document.getElementById(\"block_$id$\").checked;\n for (var i = 0; i < $port[value]$.length ; i++){\n if (value)\n $port[value]$[i](1);\n else\n $port[value]$[i](0);\n }\n};\n"
},
{
"name": "html",
"code": "\n<input type=\"checkbox\" onchange=\"change_value$id$(event);\" id=\"block_$id$\"> $prop[label]$ <br>\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "Float",
"value": "0"
},
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
}
],
"ports": [
{
"conn_type": "output",
"name": "value",
"label": "Value",
"type": "javascript.float"
},
{
"conn_type": "input",
"name": "invalue",
"label": "Value",
"type": "javascript.float"
}
]
}
@@ -0,0 +1,54 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.color",
"language": "javascript",
"extension": "webaudio",
"help": "Color",
"label": "Color",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar $port[value]$ = [];\n\nvar $port[invalue]$ = function(value){\n document.getElementById(\"block_$id$\").value = value;\n return true;\n };\n\n"
},
{
"name": "execution",
"code": "\nfunction enter_value$id$(e){\n value = document.getElementById(\"block_$id$\").value;\n for (var i = 0; i < $port[value]$.length ; i++){\n $port[value]$[i](value);\n }\n};\n"
},
{
"name": "html",
"code": "\n$prop[label]$ <input type=\"color\" value=\"$prop[value]$\" oninput=\"enter_value$id$(event);\" id=\"block_$id$\"><br>\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "Color",
"value": "#FFFFFF"
},
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
}
],
"ports": [
{
"conn_type": "output",
"name": "value",
"label": "Value",
"type": "javascript.color"
},
{
"conn_type": "input",
"name": "invalue",
"label": "Value",
"type": "javascript.color"
}
]
}
@@ -0,0 +1,72 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.number",
"language": "javascript",
"extension": "webaudio",
"help": "Number",
"label": "Number",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar $port[value]$ = [];\n\nvar $port[invalue]$ = function(value){\n document.getElementById(\"block_$id$\").value = value;\n return true;\n };\n\n"
},
{
"name": "execution",
"code": "\nfunction change_value$id$(e){\n value = document.getElementById(\"block_$id$\").value;\n for (var i = 0; i < $port[value]$.length ; i++){\n $port[value]$[i](value);\n }\n};\n"
},
{
"name": "html",
"code": "\n$prop[label]$ <input type=\"number\" min=\"$prop[min]$\" max=\"$prop[max]$\" onchange=\"change_value$id$(event);\" id=\"block_$id$\"><br>\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "Float",
"value": "0"
},
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
},
{
"name": "min",
"label": "Min",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 0
},
{
"name": "max",
"label": "Max",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 100
}
],
"ports": [
{
"conn_type": "output",
"name": "value",
"label": "Value",
"type": "javascript.float"
},
{
"conn_type": "input",
"name": "invalue",
"label": "Value",
"type": "javascript.float"
}
]
}
@@ -0,0 +1,72 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.range",
"language": "javascript",
"extension": "webaudio",
"help": "Range",
"label": "Range",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar $port[value]$ = [];\n\nvar $port[invalue]$ = function(value){\n document.getElementById(\"block_$id$\").value = value;\n change_value$id$(value);\n return true;\n };\n\n"
},
{
"name": "execution",
"code": "\nfunction change_value$id$(e){\n value = document.getElementById(\"block_$id$\").value;\n for (var i = 0; i < $port[value]$.length ; i++){\n $port[value]$[i](value);\n }\n};\n"
},
{
"name": "html",
"code": "\n$prop[label]$ <input type=\"range\" min=\"$prop[min]$\" max=\"$prop[max]$\" onchange=\"change_value$id$(event);\" id=\"block_$id$\"><br>\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "Float",
"value": "0"
},
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
},
{
"name": "min",
"label": "Min",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 0
},
{
"name": "max",
"label": "Max",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 100
}
],
"ports": [
{
"conn_type": "output",
"name": "value",
"label": "Value",
"type": "javascript.float"
},
{
"conn_type": "input",
"name": "invalue",
"label": "Value",
"type": "javascript.float"
}
]
}
@@ -0,0 +1,62 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.select",
"language": "javascript",
"extension": "webaudio",
"help": "Select",
"label": "Select",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar $port[str_value]$ = [];\nvar $port[float_value]$ = [];\n"
},
{
"name": "function",
"code": "\nfunction populateCombo(combo, text_values){\n var values = text_values.split(',');\n for (var i = 0 ; i < values.length ; i++){\n var c = document.createElement(\"option\");\n c.text = values[i];\n combo.options.add(c, combo.options.length);\n }\n }\n"
},
{
"name": "onload",
"code": "populateCombo(document.getElementById('block_$id$'), '$prop[values]$');"
},
{
"name": "execution",
"code": "\nfunction change$id$(){\n el = document.getElementById(\"block_$id$\");\n value = el.options[el.selectedIndex].value;\n for (var i = 0; i < $port[str_value]$.length ; i++){\n $port[str_value]$[i](value);\n }\n for (var i = 0; i < $port[float_value]$.length ; i++){\n $port[float_value]$[i](el.selectedIndex);\n }\n};\n"
},
{
"name": "html",
"code": "\n$prop[label]$ <select onchange=\"change$id$();\" id=\"block_$id$\"></select><br>\n"
}
],
"properties": [
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
},
{
"name": "values",
"label": "Values",
"type": "String",
"value": "values"
}
],
"ports": [
{
"conn_type": "output",
"name": "str_value",
"label": "String Value",
"type": "javascript.string"
},
{
"conn_type": "output",
"name": "float_value",
"label": "Float Value",
"type": "javascript.float"
}
]
}
@@ -0,0 +1,54 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.text",
"language": "javascript",
"extension": "webaudio",
"help": "Text",
"label": "Text",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar $port[value]$ = [];\n\nvar $port[invalue]$ = function(value){\n document.getElementById(\"block_$id$\").value = value;\n return true;\n };\n\n"
},
{
"name": "execution",
"code": "\nfunction enter_value$id$(e){\n e = e || window.event;\n if (e.keyCode != 13) //Ignore if it is not enter\n return;\n value = document.getElementById(\"block_$id$\").value;\n for (var i = 0; i < $port[value]$.length ; i++){\n $port[value]$[i](value);\n }\n};\n"
},
{
"name": "html",
"code": "\n$prop[label]$ <input type=\"text\" value=\"$prop[value]$\" onkeypress=\"enter_value$id$(event);\"\nid=\"block_$id$\"><br>\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "String",
"value": ""
},
{
"name": "label",
"label": "Label",
"type": "String",
"value": "Label"
}
],
"ports": [
{
"conn_type": "output",
"name": "value",
"label": "Value",
"type": "javascript.string"
},
{
"conn_type": "input",
"name": "invalue",
"label": "Value",
"type": "javascript.string"
}
]
}
@@ -0,0 +1,38 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.form.title",
"language": "javascript",
"extension": "webaudio",
"help": "Window Title",
"label": "Title",
"color": "#F92317",
"group": "Form",
"codes": [
{
"name": "declaration",
"code": "\nvar $port[title]$ = function(value){\n window.document.title = value;\n return 1;\n}\n"
},
{
"name": "onload",
"code": "\n$port[title]$('$prop[title]$');\n\n "
}
],
"properties": [
{
"name": "title",
"label": "Value",
"type": "String",
"value": "Mosaicode - Document Title"
}
],
"ports": [
{
"conn_type": "input",
"name": "title",
"label": "Value",
"type": "javascript.string"
}
]
}