Skip to content

Commit

Permalink
chore: release v7.9.2
Browse files Browse the repository at this point in the history
* (klein0r) Added new block for http response
  • Loading branch information
klein0r committed Mar 18, 2024
1 parent 4323528 commit ba89c73
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG_OLD.md
@@ -1,4 +1,8 @@
The newest change log is in README.md
## 7.6.3 (2024-01-11)

* (klein0r) Fixed bug in formatTimeDiff Blockly

## 7.6.2 (2024-01-02)

* (klein0r) Added missing console.info()
Expand Down
6 changes: 1 addition & 5 deletions README.md
Expand Up @@ -46,7 +46,7 @@ Since v5.5.0 of the JavaScript adapter the following locations (relative to the
<!--
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
### 7.9.2 (2024-03-18)

* (klein0r) Added new block for http response

Expand Down Expand Up @@ -74,10 +74,6 @@ Since v5.5.0 of the JavaScript adapter the following locations (relative to the

* (klein0r) Added block for multiple and conditions

### 7.6.3 (2024-01-11)

* (klein0r) Fixed bug in formatTimeDiff Blockly

## License
The MIT License (MIT)

Expand Down
10 changes: 5 additions & 5 deletions admin/asset-manifest.json
@@ -1,8 +1,8 @@
{
"files": {
"main.js": "/static/js/main.3fb899c6.js",
"main.js": "/static/js/main.7cef0c28.js",
"static/css/864.42bfc5f3.chunk.css": "/static/css/864.42bfc5f3.chunk.css",
"static/js/864.475570a4.chunk.js": "/static/js/864.475570a4.chunk.js",
"static/js/864.d2336593.chunk.js": "/static/js/864.d2336593.chunk.js",
"static/js/805.7c367e53.chunk.js": "/static/js/805.7c367e53.chunk.js",
"static/js/431.a62490cf.chunk.js": "/static/js/431.a62490cf.chunk.js",
"static/js/702.1692c400.chunk.js": "/static/js/702.1692c400.chunk.js",
Expand Down Expand Up @@ -160,9 +160,9 @@
"static/media/Garage Doors.svg": "/static/media/Garage Doors.0c2a1cfca7ad1ea59625.svg",
"static/media/Outdoor Blinds.svg": "/static/media/Outdoor Blinds.37b85a9c060a4af48da9.svg",
"static/media/Upstairs.svg": "/static/media/Upstairs.441813e54e0daca0882d.svg",
"main.3fb899c6.js.map": "/static/js/main.3fb899c6.js.map",
"main.7cef0c28.js.map": "/static/js/main.7cef0c28.js.map",
"864.42bfc5f3.chunk.css.map": "/static/css/864.42bfc5f3.chunk.css.map",
"864.475570a4.chunk.js.map": "/static/js/864.475570a4.chunk.js.map",
"864.d2336593.chunk.js.map": "/static/js/864.d2336593.chunk.js.map",
"805.7c367e53.chunk.js.map": "/static/js/805.7c367e53.chunk.js.map",
"431.a62490cf.chunk.js.map": "/static/js/431.a62490cf.chunk.js.map",
"702.1692c400.chunk.js.map": "/static/js/702.1692c400.chunk.js.map",
Expand Down Expand Up @@ -195,6 +195,6 @@
"96.fe9915d5.chunk.js.map": "/static/js/96.fe9915d5.chunk.js.map"
},
"entrypoints": [
"static/js/main.3fb899c6.js"
"static/js/main.7cef0c28.js"
]
}
65 changes: 65 additions & 0 deletions admin/google-blockly/own/blocks_action.js
Expand Up @@ -212,6 +212,71 @@ Blockly.JavaScript['http_post'] = function(block) {
'});\n';
};

// --- get info about event -----------------------------------------------------------
Blockly.Action.blocks['http_response'] =
'<block type="http_response">'
+ ' <value name="ATTR">'
+ ' </value>'
+ '</block>';

Blockly.Blocks['http_response'] = {
/**
* Block for conditionally returning a value from a procedure.
* @this Blockly.Block
*/
init: function() {
this.appendDummyInput()
.appendField('🌐');

this.appendDummyInput('ATTR')
.appendField(new Blockly.FieldDropdown([
[Blockly.Translate('http_response_data'), 'response.data'],
[Blockly.Translate('http_response_statuscode'), 'response.statusCode'],
]), 'ATTR');

this.setInputsInline(true);
this.setOutput(true);
this.setColour(Blockly.Trigger.HUE);
this.setTooltip(Blockly.Translate('http_response_tooltip'));
//this.setHelpUrl(getHelp('http_response'));
},
/**
* Called whenever anything on the workspace changes.
* Add warning if this flow block is not nested inside a loop.
* @param {!Blockly.Events.Abstract} e Change event.
* @this Blockly.Block
*/
onchange: function(e) {
let legal = false;
// Is the block nested in a trigger?
let block = this;
do {
if (this.FUNCTION_TYPES.includes(block.type)) {
legal = true;
break;
}
block = block.getSurroundParent();
} while (block);

if (legal) {
this.setWarningText(null, this.id);
} else {
this.setWarningText(Blockly.Translate('http_response_warning'), this.id);
}
},
/**
* List of block types that are functions and thus do not need warnings.
* To add a new function type add this to your code:
* Blockly.Blocks['procedures_ifreturn'].FUNCTION_TYPES.push('custom_func');
*/
FUNCTION_TYPES: ['http_get', 'http_post'],
};
Blockly.JavaScript['http_response'] = function(block) {
const attr = block.getFieldValue('ATTR');

return [attr, Blockly.JavaScript.ORDER_ATOMIC];
};

// --- action request --------------------------------------------------
Blockly.Action.blocks['request'] =
'<block type="request">'
Expand Down
7 changes: 7 additions & 0 deletions admin/google-blockly/own/blocks_words.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit ba89c73

Please sign in to comment.