45 lines
1.5 KiB
JSON
45 lines
1.5 KiB
JSON
{
|
|
"source": "JSON",
|
|
"data": "BLOCK",
|
|
"version": "0.0.1",
|
|
"type": "javascript.input devices.date",
|
|
"language": "javascript",
|
|
"extension": "webaudio",
|
|
"help": "Date",
|
|
"label": "Date",
|
|
"color": "#4283FA",
|
|
"group": "Input Device",
|
|
"codes": [
|
|
{
|
|
"name": "declaration",
|
|
"code": "\n// block_$id$ = $label$\nvar $port[day]$ = [];\nvar $port[month]$ = [];\nvar $port[year]$ = [];\n\nvar $port[generate]$ = function(value){\n var d = new Date();\n for (var i = 0; i < $port[day]$.length ; i++){\n $port[day]$[i](d.getDate());\n }\n for (var i = 0; i < $port[month]$.length ; i++){\n $port[month]$[i](d.getMonth());\n }\n for (var i = 0; i < $port[year]$.length ; i++){\n $port[year]$[i](d.getFullYear());\n }\n return true;\n };\n\n"
|
|
}
|
|
],
|
|
"properties": [],
|
|
"ports": [
|
|
{
|
|
"conn_type": "output",
|
|
"name": "day",
|
|
"label": "Day",
|
|
"type": "javascript.float"
|
|
},
|
|
{
|
|
"conn_type": "output",
|
|
"name": "month",
|
|
"label": "Month",
|
|
"type": "javascript.float"
|
|
},
|
|
{
|
|
"conn_type": "output",
|
|
"name": "year",
|
|
"label": "Year",
|
|
"type": "javascript.float"
|
|
},
|
|
{
|
|
"conn_type": "input",
|
|
"name": "generate",
|
|
"label": "Generate",
|
|
"type": "javascript.float"
|
|
}
|
|
]
|
|
} |