forked from AUEB-BALab/blockly_unix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitDiffBlock.js
More file actions
30 lines (27 loc) · 927 Bytes
/
gitDiffBlock.js
File metadata and controls
30 lines (27 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var gitDiffBlock = {
type: 'git diff',
category: 'Git Version Control',
unix_description: [
{
printName: true,
// No arguments from fields, so this function returns an empty string.
// The command 'git diff' will be printed due to printName: true and block type.
message: () => {
return '';
}
}
],
message0: '%{BKY_GIT_DIFF}',
previousStatement: 'Action',
nextStatement: 'Action',
style: 'Git Version Control',
tooltip: '%{BKY_GIT_DIFF_TOOLTIP}',
helpUrl: '%{BKY_GIT_DIFF_HELPURL}'
};
// Register the block with Blockly
Blockly.defineBlocksWithJsonArray([gitDiffBlock]);
// Make the block definition findable on the window object because the type has a space
window['git diffBlock'] = gitDiffBlock;
// Register the generator for this block to use the 'sequence' connector
window.unixGenerator.forBlock['git diff'] =
window.unixGenerator.forBlock.sequence;