Add a test block with a dropdown containing both text and images (#1748)

This commit is contained in:
picklesrus
2018-03-29 13:15:20 -07:00
committed by GitHub
parent d13d303fa8
commit 063b5d880c
2 changed files with 28 additions and 0 deletions

View File

@@ -94,6 +94,33 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
}
]
},
{
"type": "example_dropdown_images_and_text",
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "FIELDNAME",
"options": [
["images and text", "IMAGES AND TEXT"],
[{"src": "../media/test_a.png", "width": 32, "height": 32, "alt": "A"}, "A"],
[{"src": "../media/test_b.png", "width": 32, "height": 32, "alt": "B"}, "B"],
[{"src": "../media/test_c.png", "width": 32, "height": 32, "alt": "C"}, "C"],
[{"src": "../media/test_d.png", "width": 32, "height": 32, "alt": "D"}, "D"],
[{"src": "../media/test_e.png", "width": 32, "height": 32, "alt": "E"}, "E"],
[{"src": "../media/test_f.png", "width": 32, "height": 32, "alt": "F"}, "F"],
[{"src": "../media/test_g.png", "width": 32, "height": 32, "alt": "G"}, "G"],
[{"src": "../media/test_h.png", "width": 32, "height": 32, "alt": "H"}, "H"],
["xyz", "LMNOP"],
[{"src": "../media/test_i.png", "width": 32, "height": 32, "alt": "I"}, "I"],
[{"src": "../media/test_j.png", "width": 32, "height": 32, "alt": "J"}, "J"],
[{"src": "../media/test_k.png", "width": 32, "height": 32, "alt": "K"}, "K"],
[{"src": "../media/test_l.png", "width": 32, "height": 32, "alt": "L"}, "L"],
[{"src": "../media/test_m.png", "width": 32, "height": 32, "alt": "M"}, "M"]
]
}
]
},
{
"type": "example_angle",
"message0": "angle: %1",

View File

@@ -1134,6 +1134,7 @@ h1 {
<label text="Drop-downs"></label>
<block type="example_dropdown_long"></block>
<block type="example_dropdown_images"></block>
<block type="example_dropdown_images_and_text"></block>
<label text="Others"></label>
<block type="example_angle"></block>
<block type="example_date"></block>