GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: readd the motion blocks (#20) · scratchfoundation/scratch-blocks@79398c2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • blocks_vertical
    • motion.js
  • src
    • index.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎blocks_vertical/motion.js‎

Copy file name to clipboardExpand all lines: blocks_vertical/motion.js
+30-48Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@
1818
* limitations under the License.
1919
*/
2020

21-
'use strict';
22-
23-
goog.provide('Blockly.Blocks.motion');
24-
25-
goog.require('Blockly.Blocks');
26-
goog.require('Blockly.Colours');
27-
goog.require('Blockly.constants');
28-
goog.require('Blockly.ScratchBlocks.VerticalExtensions');
21+
import * as Blockly from 'blockly/core';
22+
import {Categories} from '../src/categories.js';
2923

3024

3125
Blockly.Blocks['motion_movesteps'] = {
@@ -42,7 +36,7 @@ Blockly.Blocks['motion_movesteps'] = {
4236
"name": "STEPS"
4337
}
4438
],
45-
"category": Blockly.Categories.motion,
39+
"category": Categories.motion,
4640
"extensions": ["colours_motion", "shape_statement"]
4741
});
4842
}
@@ -59,7 +53,7 @@ Blockly.Blocks['motion_turnright'] = {
5953
"args0": [
6054
{
6155
"type": "field_image",
62-
"src": Blockly.mainWorkspace.options.pathToMedia + "rotate-right.svg",
56+
"src": Blockly.getMainWorkspace().options.pathToMedia + "rotate-right.svg",
6357
"width": 24,
6458
"height": 24
6559
},
@@ -68,7 +62,7 @@ Blockly.Blocks['motion_turnright'] = {
6862
"name": "DEGREES"
6963
}
7064
],
71-
"category": Blockly.Categories.motion,
65+
"category": Categories.motion,
7266
"extensions": ["colours_motion", "shape_statement"]
7367
});
7468
}
@@ -85,7 +79,7 @@ Blockly.Blocks['motion_turnleft'] = {
8579
"args0": [
8680
{
8781
"type": "field_image",
88-
"src": Blockly.mainWorkspace.options.pathToMedia + "rotate-left.svg",
82+
"src": Blockly.getMainWorkspace().options.pathToMedia + "rotate-left.svg",
8983
"width": 24,
9084
"height": 24
9185
},
@@ -94,7 +88,7 @@ Blockly.Blocks['motion_turnleft'] = {
9488
"name": "DEGREES"
9589
}
9690
],
97-
"category": Blockly.Categories.motion,
91+
"category": Categories.motion,
9892
"extensions": ["colours_motion", "shape_statement"]
9993
});
10094
}
@@ -114,7 +108,7 @@ Blockly.Blocks['motion_pointindirection'] = {
114108
"name": "DIRECTION"
115109
}
116110
],
117-
"category": Blockly.Categories.motion,
111+
"category": Categories.motion,
118112
"extensions": ["colours_motion", "shape_statement"]
119113
});
120114
}
@@ -138,11 +132,7 @@ Blockly.Blocks['motion_pointtowards_menu'] = {
138132
]
139133
}
140134
],
141-
"colour": Blockly.Colours.motion.secondary,
142-
"colourSecondary": Blockly.Colours.motion.secondary,
143-
"colourTertiary": Blockly.Colours.motion.tertiary,
144-
"colourQuaternary": Blockly.Colours.motion.quaternary,
145-
"extensions": ["output_string"]
135+
"extensions": ["colours_motion", "output_string"]
146136
});
147137
}
148138
};
@@ -161,7 +151,7 @@ Blockly.Blocks['motion_pointtowards'] = {
161151
"name": "TOWARDS"
162152
}
163153
],
164-
"category": Blockly.Categories.motion,
154+
"category": Categories.motion,
165155
"extensions": ["colours_motion", "shape_statement"]
166156
});
167157
}
@@ -185,11 +175,7 @@ Blockly.Blocks['motion_goto_menu'] = {
185175
]
186176
}
187177
],
188-
"colour": Blockly.Colours.motion.secondary,
189-
"colourSecondary": Blockly.Colours.motion.secondary,
190-
"colourTertiary": Blockly.Colours.motion.tertiary,
191-
"colourQuaternary": Blockly.Colours.motion.quaternary,
192-
"extensions": ["output_string"]
178+
"extensions": ["colours_motion", "output_string"]
193179
});
194180
}
195181
};
@@ -212,7 +198,7 @@ Blockly.Blocks['motion_gotoxy'] = {
212198
"name": "Y"
213199
}
214200
],
215-
"category": Blockly.Categories.motion,
201+
"category": Categories.motion,
216202
"extensions": ["colours_motion", "shape_statement"]
217203
});
218204
}
@@ -232,7 +218,7 @@ Blockly.Blocks['motion_goto'] = {
232218
"name": "TO"
233219
}
234220
],
235-
"category": Blockly.Categories.motion,
221+
"category": Categories.motion,
236222
"extensions": ["colours_motion", "shape_statement"]
237223
});
238224
}
@@ -260,7 +246,7 @@ Blockly.Blocks['motion_glidesecstoxy'] = {
260246
"name": "Y"
261247
}
262248
],
263-
"category": Blockly.Categories.motion,
249+
"category": Categories.motion,
264250
"extensions": ["colours_motion", "shape_statement"]
265251
});
266252
}
@@ -284,11 +270,7 @@ Blockly.Blocks['motion_glideto_menu'] = {
284270
]
285271
}
286272
],
287-
"colour": Blockly.Colours.motion.secondary,
288-
"colourSecondary": Blockly.Colours.motion.secondary,
289-
"colourTertiary": Blockly.Colours.motion.tertiary,
290-
"colourQuaternary": Blockly.Colours.motion.quaternary,
291-
"extensions": ["output_string"]
273+
"extensions": ["colours_motion", "output_string"]
292274
});
293275
}
294276
};
@@ -311,7 +293,7 @@ Blockly.Blocks['motion_glideto'] = {
311293
"name": "TO"
312294
}
313295
],
314-
"category": Blockly.Categories.motion,
296+
"category": Categories.motion,
315297
"extensions": ["colours_motion", "shape_statement"]
316298
});
317299
}
@@ -331,7 +313,7 @@ Blockly.Blocks['motion_changexby'] = {
331313
"name": "DX"
332314
}
333315
],
334-
"category": Blockly.Categories.motion,
316+
"category": Categories.motion,
335317
"extensions": ["colours_motion", "shape_statement"]
336318
});
337319
}
@@ -351,7 +333,7 @@ Blockly.Blocks['motion_setx'] = {
351333
"name": "X"
352334
}
353335
],
354-
"category": Blockly.Categories.motion,
336+
"category": Categories.motion,
355337
"extensions": ["colours_motion", "shape_statement"]
356338
});
357339
}
@@ -371,7 +353,7 @@ Blockly.Blocks['motion_changeyby'] = {
371353
"name": "DY"
372354
}
373355
],
374-
"category": Blockly.Categories.motion,
356+
"category": Categories.motion,
375357
"extensions": ["colours_motion", "shape_statement"]
376358
});
377359
}
@@ -391,7 +373,7 @@ Blockly.Blocks['motion_sety'] = {
391373
"name": "Y"
392374
}
393375
],
394-
"category": Blockly.Categories.motion,
376+
"category": Categories.motion,
395377
"extensions": ["colours_motion", "shape_statement"]
396378
});
397379
}
@@ -405,7 +387,7 @@ Blockly.Blocks['motion_ifonedgebounce'] = {
405387
init: function() {
406388
this.jsonInit({
407389
"message0": Blockly.Msg.MOTION_IFONEDGEBOUNCE,
408-
"category": Blockly.Categories.motion,
390+
"category": Categories.motion,
409391
"extensions": ["colours_motion", "shape_statement"]
410392
});
411393
}
@@ -430,7 +412,7 @@ Blockly.Blocks['motion_setrotationstyle'] = {
430412
]
431413
}
432414
],
433-
"category": Blockly.Categories.motion,
415+
"category": Categories.motion,
434416
"extensions": ["colours_motion", "shape_statement"]
435417
});
436418
}
@@ -444,7 +426,7 @@ Blockly.Blocks['motion_xposition'] = {
444426
init: function() {
445427
this.jsonInit({
446428
"message0": Blockly.Msg.MOTION_XPOSITION,
447-
"category": Blockly.Categories.motion,
429+
"category": Categories.motion,
448430
"checkboxInFlyout": true,
449431
"extensions": ["colours_motion", "output_number"]
450432
});
@@ -459,7 +441,7 @@ Blockly.Blocks['motion_yposition'] = {
459441
init: function() {
460442
this.jsonInit({
461443
"message0": Blockly.Msg.MOTION_YPOSITION,
462-
"category": Blockly.Categories.motion,
444+
"category": Categories.motion,
463445
"checkboxInFlyout": true,
464446
"extensions": ["colours_motion", "output_number"]
465447
});
@@ -474,7 +456,7 @@ Blockly.Blocks['motion_direction'] = {
474456
init: function() {
475457
this.jsonInit({
476458
"message0": Blockly.Msg.MOTION_DIRECTION,
477-
"category": Blockly.Categories.motion,
459+
"category": Categories.motion,
478460
"checkboxInFlyout": true,
479461
"extensions": ["colours_motion", "output_number"]
480462
});
@@ -497,7 +479,7 @@ Blockly.Blocks['motion_scroll_right'] = {
497479
"name": "DISTANCE"
498480
}
499481
],
500-
"category": Blockly.Categories.motion,
482+
"category": Categories.motion,
501483
"extensions": ["colours_motion", "shape_statement"]
502484
});
503485
}
@@ -519,7 +501,7 @@ Blockly.Blocks['motion_scroll_up'] = {
519501
"name": "DISTANCE"
520502
}
521503
],
522-
"category": Blockly.Categories.motion,
504+
"category": Categories.motion,
523505
"extensions": ["colours_motion", "shape_statement"]
524506
});
525507
}
@@ -548,7 +530,7 @@ Blockly.Blocks['motion_align_scene'] = {
548530
]
549531
}
550532
],
551-
"category": Blockly.Categories.motion,
533+
"category": Categories.motion,
552534
"extensions": ["colours_motion", "shape_statement"]
553535
});
554536
}
@@ -564,7 +546,7 @@ Blockly.Blocks['motion_xscroll'] = {
564546
init: function() {
565547
this.jsonInit({
566548
"message0": Blockly.Msg.MOTION_XSCROLL,
567-
"category": Blockly.Categories.motion,
549+
"category": Categories.motion,
568550
"extensions": ["colours_motion", "output_number"]
569551
});
570552
}
@@ -580,7 +562,7 @@ Blockly.Blocks['motion_yscroll'] = {
580562
init: function() {
581563
this.jsonInit({
582564
"message0": Blockly.Msg.MOTION_YSCROLL,
583-
"category": Blockly.Categories.motion,
565+
"category": Categories.motion,
584566
"extensions": ["colours_motion", "output_number"]
585567
});
586568
}
Collapse file

‎src/index.js‎

Copy file name to clipboardExpand all lines: src/index.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import '../blocks_common/math.js';
88
import '../blocks_vertical/vertical_extensions.js';
9+
import '../blocks_vertical/motion.js';
910
import '../blocks_vertical/operators.js';
1011

1112
export * from 'blockly';

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.