Skip to content

Commit 9d6983b

Browse files
committed
Fixed time compare blocks
1 parent abee314 commit 9d6983b

28 files changed

+140
-111
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ And then call "npm run build".
3333
- ...
3434

3535
## Changelog
36-
### 4.6.9 (2020-05-16)
36+
### 4.6.10 (2020-05-16)
3737
* (bluefox) Fixed blockly blocks because of deprecated functions
3838
* (bluefox) Corrected schedule wizard
3939

admin/asset-manifest.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.ec63fb86.chunk.css",
4-
"main.js": "/static/js/main.ad79a777.chunk.js",
5-
"main.js.map": "/static/js/main.ad79a777.chunk.js.map",
6-
"runtime-main.js": "/static/js/runtime-main.e1c7c17a.js",
7-
"runtime-main.js.map": "/static/js/runtime-main.e1c7c17a.js.map",
8-
"static/css/2.35ed4a38.chunk.css": "/static/css/2.35ed4a38.chunk.css",
9-
"static/js/2.53daf34e.chunk.js": "/static/js/2.53daf34e.chunk.js",
10-
"static/js/2.53daf34e.chunk.js.map": "/static/js/2.53daf34e.chunk.js.map",
4+
"main.js": "/static/js/main.47e9cbcd.chunk.js",
5+
"main.js.map": "/static/js/main.47e9cbcd.chunk.js.map",
6+
"runtime-main.js": "/static/js/runtime-main.a500de04.js",
7+
"runtime-main.js.map": "/static/js/runtime-main.a500de04.js.map",
8+
"static/css/2.93e5c0a0.chunk.css": "/static/css/2.93e5c0a0.chunk.css",
9+
"static/js/2.38f4fe4b.chunk.js": "/static/js/2.38f4fe4b.chunk.js",
10+
"static/js/2.38f4fe4b.chunk.js.map": "/static/js/2.38f4fe4b.chunk.js.map",
1111
"index.html": "/index.html",
12-
"precache-manifest.04d91cdf49cbe81e8357a287213194ff.js": "/precache-manifest.04d91cdf49cbe81e8357a287213194ff.js",
12+
"precache-manifest.2600356e7ffda69984a313e9a7649f71.js": "/precache-manifest.2600356e7ffda69984a313e9a7649f71.js",
1313
"service-worker.js": "/service-worker.js",
14-
"static/css/2.35ed4a38.chunk.css.map": "/static/css/2.35ed4a38.chunk.css.map",
14+
"static/css/2.93e5c0a0.chunk.css.map": "/static/css/2.93e5c0a0.chunk.css.map",
1515
"static/css/main.ec63fb86.chunk.css.map": "/static/css/main.ec63fb86.chunk.css.map",
16-
"static/js/2.53daf34e.chunk.js.LICENSE.txt": "/static/js/2.53daf34e.chunk.js.LICENSE.txt",
17-
"static/js/main.ad79a777.chunk.js.LICENSE.txt": "/static/js/main.ad79a777.chunk.js.LICENSE.txt",
16+
"static/js/2.38f4fe4b.chunk.js.LICENSE.txt": "/static/js/2.38f4fe4b.chunk.js.LICENSE.txt",
17+
"static/js/main.47e9cbcd.chunk.js.LICENSE.txt": "/static/js/main.47e9cbcd.chunk.js.LICENSE.txt",
1818
"static/media/copy-content.svg": "/static/media/copy-content.6fe0b363.svg"
1919
},
2020
"entrypoints": [
21-
"static/js/runtime-main.e1c7c17a.js",
22-
"static/css/2.35ed4a38.chunk.css",
23-
"static/js/2.53daf34e.chunk.js",
21+
"static/js/runtime-main.a500de04.js",
22+
"static/css/2.93e5c0a0.chunk.css",
23+
"static/js/2.38f4fe4b.chunk.js",
2424
"static/css/main.ec63fb86.chunk.css",
25-
"static/js/main.ad79a777.chunk.js"
25+
"static/js/main.47e9cbcd.chunk.js"
2626
]
2727
}

admin/google-blockly/own/blocks_time.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Blockly.Blocks['time_compare_ex'] = {
8686
var container = document.createElement('mutation');
8787
var option = this.getFieldValue('OPTION');
8888
var use_actual_time = this.getFieldValue('USE_ACTUAL_TIME');
89-
container.setAttribute('end_time', (option === 'between' || option === 'not between') ? 'true' : 'false');
89+
container.setAttribute('end_time', option === 'between' || option === 'not between' ? 'true' : 'false');
9090
container.setAttribute('actual_time', use_actual_time === 'TRUE' || use_actual_time === 'true' || use_actual_time === true ? 'true' : 'false');
9191
return container;
9292
},
@@ -97,14 +97,15 @@ Blockly.Blocks['time_compare_ex'] = {
9797
},
9898
updateShape_: function(isBetween, useActualTime) {
9999
if (isBetween === undefined) {
100-
isBetween = (this.getFieldValue('OPTION') === 'between' || this.getFieldValue('OPTION') === 'not between');
100+
isBetween = this.getFieldValue('OPTION') === 'between' || this.getFieldValue('OPTION') === 'not between';
101101
}
102102
// Add or remove a delay Input.
103103
var inputExists = this.getInput('END_TIME');
104104

105105
if (isBetween) {
106106
if (!inputExists) {
107107
inputExists = this.getInput('CUSTOM_TIME');
108+
108109
if (inputExists) {
109110
this.removeInput('CUSTOM_TIME');
110111
this.removeInput('CUSTOM_TEXT');
@@ -114,20 +115,24 @@ Blockly.Blocks['time_compare_ex'] = {
114115
.appendField(Blockly.Translate('time_compare_and'));
115116

116117
var input = this.appendValueInput('END_TIME');
117-
var wp = this.workspace;
118-
setTimeout(function () {
119-
if (!input.connection.isConnected()) {
120-
var shadow = wp.newBlock('text');
121-
shadow.setShadow(true);
122-
shadow.setFieldValue('18:00', 'TEXT');
123-
124-
shadow.outputConnection.connect(input.connection);
125-
//input.connection.connect(shadow.outputConnection);
126-
127-
shadow.initSvg();
128-
shadow.render();
129-
}
130-
}, 100);
118+
119+
if (!window.scripts.loading) {
120+
var wp = this.workspace;
121+
122+
setTimeout(function () {
123+
if (!input.connection.isConnected()) {
124+
var shadow = wp.newBlock('text');
125+
shadow.setShadow(true);
126+
shadow.setFieldValue('18:00', 'TEXT');
127+
128+
shadow.outputConnection.connect(input.connection);
129+
// input.connection.connect(shadow.outputConnection);
130+
131+
shadow.initSvg();
132+
shadow.render();
133+
}
134+
}, 100);
135+
}
131136
}
132137
} else if (inputExists) {
133138
this.removeInput('END_TIME');

admin/google-blockly/own/blocks_timeout.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Blockly.Blocks['timeouts_settimeout'] = {
131131
},
132132
getVarModels: function () {
133133
var name = this.getFieldValue('NAME');
134-
return [{getId: function () {return name}, name: name}];
134+
return [{getId: function () {return name;}, type: 'timeout', name: name}];
135135
}
136136
};
137137

@@ -159,6 +159,16 @@ Blockly.Timeouts.getAllTimeouts = function (workspace) {
159159
result.push([blocks[i].getFieldValue('NAME'), blocks[i].getFieldValue('NAME')]);
160160
}
161161
}
162+
163+
// BF(2020.05.16) : for back compatibility. Remove it after 5 years
164+
if (window.scripts.loading) {
165+
var variables = workspace.getVariablesOfType('');
166+
variables.forEach(v => !result.find(it => it[0] === v.name) && result.push([v.name, v.name]));
167+
}
168+
169+
var variables1 = workspace.getVariablesOfType('timeout');
170+
variables1.forEach(v => !result.find(it => it[0] === v.name) && result.push([v.name, v.name]));
171+
162172
!result.length && result.push(['', '']);
163173

164174
return result;
@@ -175,7 +185,7 @@ Blockly.Blocks['timeouts_cleartimeout'] = {
175185
this.appendDummyInput('NAME')
176186
.appendField(Blockly.Translate('timeouts_cleartimeout'))
177187
.appendField(new Blockly.FieldDropdown(function () {
178-
return scripts.blocklyWorkspace ? Blockly.Timeouts.getAllTimeouts(scripts.blocklyWorkspace) : [];
188+
return window.scripts && window.scripts.blocklyWorkspace ? Blockly.Timeouts.getAllTimeouts(window.scripts.blocklyWorkspace) : [];
179189
}), 'NAME');
180190

181191
this.setPreviousStatement(true, null);
@@ -241,7 +251,7 @@ Blockly.Blocks['timeouts_setinterval'] = {
241251
},
242252
getVarModels: function () {
243253
var name = this.getFieldValue('NAME');
244-
return [{getId: function () {return name}, name: name}];
254+
return [{getId: function () {return name;}, type: 'interval', name: name}];
245255
}
246256
};
247257

@@ -277,7 +287,16 @@ Blockly.Timeouts.getAllIntervals = function (workspace) {
277287
}
278288
}
279289

280-
if (!result.length) result.push(['', '']);
290+
// BF(2020.05.16) : for back compatibility. Remove it after 5 years
291+
if (window.scripts.loading) {
292+
var variables = workspace.getVariablesOfType('');
293+
variables.forEach(v => !result.find(it => it[0] === v.name) && result.push([v.name, v.name]));
294+
}
295+
296+
var variables1 = workspace.getVariablesOfType('interval');
297+
variables1.forEach(v => !result.find(it => it[0] === v.name) && result.push([v.name, v.name]));
298+
299+
!result.length && result.push(['', '']);
281300

282301
return result;
283302
};
@@ -287,7 +306,7 @@ Blockly.Blocks['timeouts_clearinterval'] = {
287306
this.appendDummyInput("NAME")
288307
.appendField(Blockly.Translate('timeouts_clearinterval'))
289308
.appendField(new Blockly.FieldDropdown(function () {
290-
return scripts.blocklyWorkspace ? Blockly.Timeouts.getAllIntervals(scripts.blocklyWorkspace) : [];
309+
return window.scripts.blocklyWorkspace ? Blockly.Timeouts.getAllIntervals(window.scripts.blocklyWorkspace) : [];
291310
}), "NAME");
292311

293312
this.setPreviousStatement(true, null);

admin/precache-manifest.04d91cdf49cbe81e8357a287213194ff.js

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
self.__precacheManifest = (self.__precacheManifest || []).concat([
2+
{
3+
"revision": "9c0d42a0f60b98fdaf3a3e019519e97c",
4+
"url": "/index.html"
5+
},
6+
{
7+
"revision": "8d569d128bda24afefd5",
8+
"url": "/static/css/2.93e5c0a0.chunk.css"
9+
},
10+
{
11+
"revision": "2936587d0b16554b6c70",
12+
"url": "/static/css/main.ec63fb86.chunk.css"
13+
},
14+
{
15+
"revision": "8d569d128bda24afefd5",
16+
"url": "/static/js/2.38f4fe4b.chunk.js"
17+
},
18+
{
19+
"revision": "7e6b5dafaaa186e5bf274b74cf019bde",
20+
"url": "/static/js/2.38f4fe4b.chunk.js.LICENSE.txt"
21+
},
22+
{
23+
"revision": "2936587d0b16554b6c70",
24+
"url": "/static/js/main.47e9cbcd.chunk.js"
25+
},
26+
{
27+
"revision": "578fa69920ac4a551e6d340a37256bed",
28+
"url": "/static/js/main.47e9cbcd.chunk.js.LICENSE.txt"
29+
},
30+
{
31+
"revision": "b29e1786341933b579da",
32+
"url": "/static/js/runtime-main.a500de04.js"
33+
},
34+
{
35+
"revision": "6fe0b363151ad0e4318e8ebf01a40b07",
36+
"url": "/static/media/copy-content.6fe0b363.svg"
37+
}
38+
]);

admin/service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
1515

1616
importScripts(
17-
"/precache-manifest.04d91cdf49cbe81e8357a287213194ff.js"
17+
"/precache-manifest.2600356e7ffda69984a313e9a7649f71.js"
1818
);
1919

2020
self.addEventListener('message', (event) => {
@@ -35,5 +35,5 @@ workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
3535

3636
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), {
3737

38-
blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
38+
blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/],
3939
});

admin/static/css/2.35ed4a38.chunk.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)