Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Commit

Permalink
more blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
McSam authored and McSam committed Jul 17, 2019
1 parent d146606 commit b457e0d
Show file tree
Hide file tree
Showing 102 changed files with 398 additions and 142 deletions.
Binary file added .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Blockly.Blocks.procedures_callnoreturn = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Function with no return value tooltip'),
category : 'functions',
category : Blockly.Categories.Functions,
};
},
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Blockly.Blocks.procedures_callreturn = {
colourSecondary: Blockly.Colours.BinaryProcedures.colourSecondary,
colourTertiary : Blockly.Colours.BinaryProcedures.colourTertiary,
tooltip : translate('Function with return value'),
category : translate('functions'),
category : Blockly.Categories.Functions,
};
},
meta(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Blockly.Blocks.procedures_defnoreturn = {
colourSecondary: Blockly.Colours.BinaryProcedures.colourSecondary,
colourTertiary : Blockly.Colours.BinaryProcedures.colourTertiary,
tooltip : translate('function with no return tooltip'),
category : translate('functions'),
category : Blockly.Categories.Functions,
};
},
meta() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Blockly.Blocks.procedures_defreturn = {
colourSecondary: Blockly.Colours.BinaryProcedures.colourSecondary,
colourTertiary : Blockly.Colours.BinaryProcedures.colourTertiary,
tooltip : translate('Function def with return value'),
category : translate('functions'),
category : Blockly.Categories.Functions,
};
},
meta(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Blockly.Blocks.procedures_ifreturn = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Function If Else'),
category : 'functions',
category : Blockly.Categories.Functions,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_create_with.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Blockly.Blocks.lists_create_with = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Create List with'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_indexOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Blockly.Blocks.lists_indexOf = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Index of List Tooltip'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_isEmpty.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Blockly.Blocks.lists_isEmpty = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('List is Empty Tooltip'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_length.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Blockly.Blocks.lists_length = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('List Length Tooltip'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Blockly.Blocks.lists_repeat = {
previousStatement: null,
nextStatement : null,
tooltip : translate('List Repeat Tooltip'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Blockly.Blocks.lists_sort = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('List Sort Tooltip'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/List/lists_statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Blockly.Blocks.lists_statement = {
previousStatement: null,
nextStatement : null,
tooltip : translate('List Statement Tooltip'),
category : 'list',
category : Blockly.Categories.List,
};
},
meta(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Blockly.Blocks.controls_flow_statements = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Control Statement Tooltip'),
category : 'loop',
category : Blockly.Categories.Loop,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Loops/controls_for.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Blockly.Blocks.controls_for = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Control For Tooltip'),
category : 'loop',
category : Blockly.Categories.Loop,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Loops/controls_forEach.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Blockly.Blocks.controls_forEach = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Control Foreach Tooltip'),
category : 'loop',
category : Blockly.Categories.Loop,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Loops/controls_repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Blockly.Blocks.controls_repeat = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Control Repeat Tooltip'),
category : 'loop',
category : Blockly.Categories.Loop,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Loops/controls_repeat_ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Blockly.Blocks.controls_repeat_ext = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Control Repeat Tooltip'),
category : 'loop',
category : Blockly.Categories.Loop,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Loops/controls_whileUntil.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Blockly.Blocks.controls_whileUntil = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Control While Tooltip'),
category : 'loop',
category : Blockly.Categories.Loop,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Variable/variables_get.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blockly.Blocks.variables_get = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Get Variable Tooltip'),
category : translate('variables'),
category : Blockly.Categories.Variables,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Advanced/Variable/variables_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Blockly.Blocks.variables_set = {
previousStatement: null,
nextStatement : null,
tooltip : translate('Set Variable Tooltip'),
category : 'variables',
category : Blockly.Categories.Variables,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/After Purchase/after_purchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Blockly.Blocks.after_purchase = {
tooltip : translate(
'Get the previous trade information and result, then trade again (Runs on trade finish)'
),
category: 'after-purchase',
category: Blockly.Categories.After_Purchase,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/After Purchase/check_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blockly.Blocks.contract_check_result = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('True if the result matches the selection'),
category : translate('after-purchase'),
category : Blockly.Categories.After_Purchase,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/After Purchase/read_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Blockly.Blocks.read_details = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Reads a selected option from contract details list'),
category : translate('after-purchase'),
category : Blockly.Categories.After_Purchase,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/After Purchase/trade_again.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Blockly.Blocks.trade_again = {
colourTertiary : Blockly.Colours.Binary.colourTertiary,
previousStatement: null,
tooltip : translate('Runs the trade block again'),
category : 'after-purchase',
category : Blockly.Categories.After_Purchase,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/Before Purchase/ask_price.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blockly.Blocks.ask_price = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Ask Price for selected proposal'),
category : translate('before-purchase'),
category : Blockly.Categories.Before_Purchase,
};
},
meta(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Blockly.Blocks.before_purchase = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Watch the tick stream and purchase the desired contract (Runs on tick update)'),
category : translate('before-purchase'),
category : Blockly.Categories.Before_Purchase,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/Before Purchase/payout.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blockly.Blocks.payout = {
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Payout for selected proposal'),
category : translate('before-purchase'),
category : Blockly.Categories.Before_Purchase,
};
},
meta(){
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/Before Purchase/purchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Blockly.Blocks.purchase = {
colourSecondary : Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Payout for selected proposal'),
category : 'before-purchase',
category : Blockly.Categories.Before_Purchase,
};
},
meta(){
Expand Down
14 changes: 12 additions & 2 deletions src/scratch/blocks/Binary/During Purchase/check_sell.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@ import { translate } from '../../../../utils/lang/i18n';

Blockly.Blocks.check_sell = {
init() {
this.jsonInit({
this.jsonInit(this.definition());
},
definition(){
return {
message0 : translate('Sell is available'),
output : 'Boolean',
outputShape : Blockly.OUTPUT_SHAPE_HEXAGONAL,
colour : Blockly.Colours.Binary.colour,
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('True if sell at market is available'),
});
category : Blockly.Categories.During_Purchase,
};
},
meta(){
return {
'display_name': translate('Check Sell'),
'description' : translate('Check Sell Description'),
};
},
onchange(event) {
if (!this.workspace || this.isInFlyout || this.workspace.isDragging()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Blockly.Blocks.during_purchase = {
tooltip : translate(
'Watch the purchased contract info and sell at market if available (Runs on contract update)'
),
category: 'during-purchase',
category: Blockly.Categories.During_Purchase,
};
},
meta(){
Expand Down
14 changes: 12 additions & 2 deletions src/scratch/blocks/Binary/During Purchase/sell_at_market.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@ import { translate } from '../../../../utils/lang/i18n';

Blockly.Blocks.sell_at_market = {
init() {
this.jsonInit({
this.jsonInit(this.definition());
},
definition(){
return {
message0 : translate('Sell at market'),
colour : Blockly.Colours.Binary.colour,
colourSecondary : Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
previousStatement: null,
nextStatement : null,
tooltip : translate('Sell at market'),
});
category : Blockly.Categories.During_Purchase,
};
},
meta(){
return {
'display_name': translate('Sell at market'),
'description' : translate('Sell at market description'),
};
},
onchange(event) {
if (!this.workspace || this.isInFlyout || this.workspace.isDragging()) {
Expand Down
14 changes: 12 additions & 2 deletions src/scratch/blocks/Binary/During Purchase/sell_price.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@ import { translate } from '../../../../utils/lang/i18n';

Blockly.Blocks.sell_price = {
init() {
this.jsonInit({
this.jsonInit(this.definition());
},
definition(){
return {
message0 : translate('Sell profit/loss'),
output : 'Number',
outputShape : Blockly.OUTPUT_SHAPE_ROUND,
colour : Blockly.Colours.Binary.colour,
colourSecondary: Blockly.Colours.Binary.colourSecondary,
colourTertiary : Blockly.Colours.Binary.colourTertiary,
tooltip : translate('Returns the profit for sell at market.'),
});
category : Blockly.Categories.During_Purchase,
};
},
meta(){
return {
'display_name': translate('Sell price'),
'description' : translate('Sell price description'),
};
},
onchange(event) {
if (!this.workspace || this.isInFlyout || this.workspace.isDragging()) {
Expand Down
2 changes: 1 addition & 1 deletion src/scratch/blocks/Binary/Indicators/bb_statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Blockly.Blocks.bb_statement = {
tooltip : translate('Calculates Bollinger Bands (BB) from a list with a period'),
previousStatement: null,
nextStatement : null,
category : 'indicators',
category : Blockly.Categories.Indicators,
};
},
meta(){
Expand Down
14 changes: 12 additions & 2 deletions src/scratch/blocks/Binary/Indicators/bba_statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { translate } from '../../../../utils/lang/i18n';

Blockly.Blocks.bba_statement = {
init() {
this.jsonInit({
this.jsonInit(this.definition());
},
definition(){
return {
message0: translate('set %1 to Bollinger Bands Array %2 %3'),
message1: '%1',
args0 : [
Expand Down Expand Up @@ -35,7 +38,14 @@ Blockly.Blocks.bba_statement = {
tooltip : translate('Calculates Bollinger Bands (BB) list from a list with a period'),
previousStatement: null,
nextStatement : null,
});
category : Blockly.Categories.Indicators,
};
},
meta(){
return {
'display_name': translate('Bollinger Bands Statement'),
'description' : translate('Bollinger Bands Description'),
};
},
onchange : Blockly.Blocks.bb_statement.onchange,
requiredParamBlocks: ['input_list', 'period', 'std_dev_multiplier_up', 'std_dev_multiplier_down'],
Expand Down
Loading

0 comments on commit b457e0d

Please sign in to comment.