diff --git a/blocks/GUI/button.json b/blocks/GUI/button.json
index 2b6d33b..45dc2dc 100644
--- a/blocks/GUI/button.json
+++ b/blocks/GUI/button.json
@@ -10,8 +10,10 @@
"color": "50:150:250:150",
"group": "GUI",
"codes": {
- "declaration": "\n// block_$id$ = $label$\nvar block_$id$_value = $prop[value]$;\nvar $port[click]$ = [];\n",
- "execution": "\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",
+ "onload":"",
+ "execution": "",
+ "global": "\n// block_$id$ = $label$\nvar block_$id$_value = $prop[value]$;\nvar $port[click]$ = [];\n \n",
+ "function": "function 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",
"html": "\n
\n"
},
"properties": [
diff --git a/blocks/GUI/range.json b/blocks/GUI/range.json
index 2e89dde..f964b8b 100644
--- a/blocks/GUI/range.json
+++ b/blocks/GUI/range.json
@@ -11,7 +11,7 @@
"group": "GUI",
"codes": {
"declaration": "\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",
- "execution": "\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",
+ "function": "\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",
"html": "\n$prop[label]$
\n"
},
"properties": [
diff --git a/codetemplates/webaudio.json b/codetemplates/webaudio.json
index 85a5cef..354cb38 100644
--- a/codetemplates/webaudio.json
+++ b/codetemplates/webaudio.json
@@ -12,7 +12,8 @@
"function",
"declaration",
"execution",
- "html"
+ "html",
+ "global"
],
"properties": [
{
@@ -23,7 +24,7 @@
}
],
"codes": {
- "index.html": "\n
\n \n \n $prop[title]$\n \n \n \n \n\n \n
\n\n $code[html]$\n \n\n",
+ "index.html": "\n \n \n \n $prop[title]$\n \n \n \n \n\n \n
\n\n $code[html]$\n \n\n",
"theme.css": "/*\nDeveloped by: $author$\n*/\nhtml, body {\n background: #ffeead;\n color: #ff6f69;\n}\nh1, p {\n color: #ff6f69;\n}\n#navbar a {\n color: #ff6f69;\n}\n.item {\n background: #ffcc5c;\n}\nbutton {\n background: #ff6f69;\n color: #ffcc5c;\n}\n",
"functions.js": "/*\nDeveloped by: $author$\n*/\n$single_code[function]$\n"
}
diff --git a/ports/char.json b/ports/char.json
index 44a57de..07dc8e7 100644
--- a/ports/char.json
+++ b/ports/char.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.char",
"language": "javascript",
"hint": "CHAR",
- "color": "#000",
+ "color": "#0F0",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.push($input$);\n"
-}
\ No newline at end of file
+}
diff --git a/ports/color.json b/ports/color.json
index fc20406..10f4f94 100644
--- a/ports/color.json
+++ b/ports/color.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.color",
"language": "javascript",
"hint": "COLOR",
- "color": "#000",
+ "color": "#00F",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.push($input$);\n"
-}
\ No newline at end of file
+}
diff --git a/ports/float.json b/ports/float.json
index b8e0252..5aa7d4c 100644
--- a/ports/float.json
+++ b/ports/float.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
"language": "javascript",
"hint": "FLOAT",
- "color": "#000",
+ "color": "#FF0",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.push($input$);\n"
-}
\ No newline at end of file
+}
diff --git a/ports/midi.json b/ports/midi.json
index 16bc7f3..ecd25bf 100644
--- a/ports/midi.json
+++ b/ports/midi.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.midi",
"language": "javascript",
"hint": "MIDI",
- "color": "#000",
+ "color": "#0FF",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.push($input$);\n"
-}
\ No newline at end of file
+}
diff --git a/ports/point.json b/ports/point.json
index 87861da..3186d27 100644
--- a/ports/point.json
+++ b/ports/point.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.point",
"language": "javascript",
"hint": "POINT",
- "color": "#000",
+ "color": "#F0F",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.push($input$);\n"
-}
\ No newline at end of file
+}
diff --git a/ports/sound.json b/ports/sound.json
index 1f159e5..fa379e8 100644
--- a/ports/sound.json
+++ b/ports/sound.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.sound",
"language": "javascript",
"hint": "SOUND",
- "color": "#000",
+ "color": "#369",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.connect($input$);\n"
-}
\ No newline at end of file
+}
diff --git a/ports/string.json b/ports/string.json
index 3dcb247..cd3d411 100644
--- a/ports/string.json
+++ b/ports/string.json
@@ -5,8 +5,8 @@
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.string",
"language": "javascript",
"hint": "STRING",
- "color": "#000",
+ "color": "#963",
"multiple": true,
"var_name": "$block[label]$_$block[id]$_$port[name]$",
"code": "$output$.push($input$);\n"
-}
\ No newline at end of file
+}