date.now block
This commit is contained in:
parent
4883b7fe63
commit
fd00f851d8
2 changed files with 13 additions and 0 deletions
|
|
@ -24,6 +24,8 @@
|
|||
<block type="sensing_alert" />
|
||||
<block type="sensing_prompt" />
|
||||
<block type="sensing_confirm" />
|
||||
<sep gap="48"></sep>
|
||||
<block type="sensing_time" />
|
||||
</category>
|
||||
<category name="Literals" colour="#59C08E">
|
||||
<block type="literals_true" />
|
||||
|
|
|
|||
|
|
@ -90,6 +90,17 @@ function register() {
|
|||
const ALERT = javascriptGenerator.valueToCode(block, 'ALERT', javascriptGenerator.ORDER_ATOMIC);
|
||||
return [`prompt(${ALERT || '""'})`, javascriptGenerator.ORDER_ATOMIC];
|
||||
})
|
||||
|
||||
// time
|
||||
registerBlock(`${categoryPrefix}time`, {
|
||||
message0: 'time (ms) since 1970',
|
||||
args0: [],
|
||||
output: "Number",
|
||||
inputsInline: true,
|
||||
colour: categoryColor
|
||||
}, (block) => {
|
||||
return [`Date.now()`, javascriptGenerator.ORDER_ATOMIC];
|
||||
})
|
||||
}
|
||||
|
||||
Blockly.Extensions.register('single_character_validation', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue