Commit Graph

191 Commits

Author SHA1 Message Date
alschmiedt
f480b1ff79 Changes Blockly style to be Blockly theme. 2019-01-08 11:40:57 -08:00
alschmiedt
1b3955d9d6 Fixing review comments 2018-12-21 07:52:50 -08:00
alschmiedt
8544491228 Small fixes 2018-12-19 09:53:54 -08:00
alschmiedt
75212a7413 Adds ability to choose different styles in playground 2018-12-18 10:03:55 -08:00
BeksOmega
1c4ba38300 Added Max Instances Property to Workspace Options (#2130)
* Added Max Instances property to Blocks

* eslint cleanup

* eslint cleanup 2

* Moved maxInstances property from block to workspace (as a map of block type to max instances). isDuplicate() changed to correctly handle siblings/branches.

* eslint cleanup

* Changed checking types to map. Added hasBlockLimits. Fixed Nits.

* Added limit_instances test block. eslint fixes.

* fixup! Added limit_instances test block. eslint fixes.

* Changed sorting objects to a private static function of the workspace. Fixed nits. Undeleted .eslintrc

* Reverted .gitignore file.

* Added getBlockTypeCounts() to utils. Added isCapacityAvailable() to workspace. Changed clipboard to save typeCountsMap rather than object.
2018-11-27 16:34:21 -08:00
Nadya Febiana Djojosantoso
d822efa322 Add math_atan2 block to demos and playgrounds 2018-10-11 14:56:13 -07:00
Neil Fraser
346b24aa74 Playground upgrades (#2063)
Adds two new blocks to the playground's test blocks.
Fixes dropdown which previously could not be set to 'Test Blocks' due to missing condition.
Simplifies detection of file:// url.
2018-09-25 13:59:26 -07:00
Andrew n marshall
eafc3cd099 Adding appropriate test values to number field test blocks (#1943) 2018-06-26 18:19:01 -07:00
Andrew n marshall
9ce9c6f7d9 Using %{BKY_} notation for toolbox category colours. (#1826) 2018-04-30 13:08:02 -07:00
Andrew n marshall
c0e220214c Rewrote LOGIC_COMPARE_ONCHANGE_MIXIN to fix #1408.
* Create prevBlock_ upon first call to onchange.
 * Revert state upon an incompatible combination, bumping the new incompatible
   block, instead of the old block. Thus, the shadow is never the bumped block.

Bug:
 * The undo stack get caught in a loop, and will never undo back to a state
   equivalent to the previous action.
2018-04-12 17:27:20 -07:00
Andrew n marshall
5c541c6f99 Setting the value of math_numnber toolbox blocks to 123. (#1773)
Using 123 as a better indicator to the user this block can represent any number,
and the user should replace this value with their own desired number.
2018-04-12 14:46:37 -07:00
picklesrus
063b5d880c Add a test block with a dropdown containing both text and images (#1748) 2018-03-29 13:15:20 -07:00
Andrew n marshall
2358fe6fd5 Adding test cases for Unicode in blocks. (#1646)
Adds test blocks to demonstrate capabilities. Stopped short of adding BiDi override characters.
I added to the toolbox category "Images". It isn't really images, but it didn't seem worth making a separate category at this stage.
2018-02-21 13:53:44 -08:00
Andrew n marshall
8fcdbf0eae Adding new playground test category "Drag" (#1643)
Edge cases to test involving dragging blocks from the toolbox.
2018-02-20 14:12:44 -08:00
Andrew n marshall
d9a7f84b98 Adding test blocks into the playground (#1629)
The new toolbox option includes a number of test blocks
largely pulled from the android project, testing various
configurations and edge cases.
2018-02-16 11:14:40 -08:00
Rachel Fenichel
2bd606c5e7 Fix comments 2018-02-13 10:41:57 -08:00
Rachel Fenichel
3a8fc92143 Indentation 2018-02-12 17:14:26 -08:00
Rachel Fenichel
744e70e4d2 Split playground toolbox XML into typed and untyped examples. 2018-02-12 17:12:52 -08:00
Rachel Fenichel
bce24fef6b Add generators for dynamic variable blocks. 2018-01-26 17:10:45 -08:00
Rachel Fenichel
5d6d7519cd Remove some TODOs; add a variable-referencing block to the simple playground flyout 2018-01-08 14:14:26 -08:00
Rachel Fenichel
0cb5dfc437 Merge pull request #1492 from Kenny2github/patch-1
Remove "fake some drags!"
2017-12-11 17:12:11 -08:00
Tianwei Du
492462e1d4 Develop (#1481)
* variables_dynamic

* make test , and i18n

* Issue #1470

* Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_MUTATION
to make sure setCheck before event trigger

* Update built files from develop.

* fix copyright ,quotes , comments ,  and optimize some flow.

* quotes,change UI , change category custom name

* single setter , remove mutator , colour typo , typed variables create button message

* undo the indent edits.
2017-12-08 08:53:24 -08:00
Ken
c53dec9786 Remove "fake some drags!"
Removed the button, the "fakeDrag" and "fakeManyDrags" and "fakeDragWrapper", and the "fakeDragStack" list.
2017-12-02 11:47:46 +08:00
Rachel Fenichel
98914fcf6b Dragging changes, rebased on develop (#1078)
* Add block drag surface translateSurfaceBy

* Add dragged connection manager

* Add gesture.js

* Add GestureHandler

* Implemented gesture skeleton

* Most basic workspace dragging

* Add dragged connection manager

* cleanup

* doc

* more cleanup

* Add gesture handler

* Add translateSurfaceInternal

* core/block_dragger.js

* cleanup

* Pull in changes to dragged connection manager

* Pull in changes to dragged connection manager

* comments

* more annotations

* Add workspace dragger

* Add coordinate annotations

* Start on block dragging

* Limit number of concurrent gestures

* Add some TODOs

* start using dragged connection manager

* Set origin correctly for dragging blocks

* Connect or delete at the end of a block drag.

* cleanup

* handle field clicks and block + workspace right-clicks

* move code into BlockDragger class, but still reach into Gesture internals a lot

* Clean up block dragger

* Call blockDragger constructor with correct arguments

* Enable block dragging in a mutator workspace

* Add workspace dragger

* click todos

* Drag flyout with background

* more dragging from flyout

* nit

* fix dragging from flyouts

* Remove unused code and rename gestureHandler to gestureDB

* Rename gesture handler

* Added some jsdoc in gesture.js

* Update some docs

* Move some code to block_svg and clean up code

* Lots of coordinate annotations

* Fix block dragging when zoomed.

* Remove built files from branch

* More dragging work (#1026)

-- Drag bubbles while dragging blocks
-- Use bindEventWithChecks to work in touch on Android. Not tested anywhere else yet.
-- Handle dragging blocks while zoomed
-- Handle dragging blocks in mutators
-- Handle right-clicks (I hope)
-- Removed lots of unused code

* More dragging work (#1048)

- Removed gestureDB
- Removing uses of terminateDrag
- Cleaned up disposal code

* Dragging bugfixes (#1058)

- Get rid of flyout.dragMode_ and blockly.dragMode_
- Make drags from the flyout start from the top block in the group
- Block tooltips from being scheduled or shown during gestures
- Don't resize mutator bubbles mid-drag

* Fix events in new dragging (#1060)

* rebuild for testing

* unbuild

* Fix events

* rebuild

* Fix up cursors

* Use language files from develop

* Remove handled TODOS

* attempt to fix IE rerendering bug, and recalculate workspace positions on scroll

* Rebuild all the things

* Comment cleanup; annotations; delete unused variables.
2017-05-05 12:42:53 -07:00
Rachel Fenichel
a6a70a647c set background color to lilac if opening the playground from file: 2017-03-13 14:37:27 -07:00
Tim Dawborn
46316c7cea Add a block to reverse a list (#844) 2017-01-21 10:48:42 -08:00
Tim Dawborn
34750bccd8 New blocks text_count, text_replace, and text_reverse (#830)
Includes generators for all languages and units tests on those generators.
2017-01-20 16:08:27 -08:00
Rachel Fenichel
729c442c31 lint 2016-12-05 15:14:02 -08:00
Rachel Fenichel
7b783dc30a change 'class' to 'web-style' 2016-12-02 14:08:50 -08:00
Rachel Fenichel
ff87c76557 Don't make labels clickable 2016-12-02 14:03:49 -08:00
Rachel Fenichel
effc1d5f1c Add ability to specify a css class for labels and buttons 2016-12-02 14:01:36 -08:00
Andrew n marshall
e5d25bb686 String reference in JSON string messages (#741)
* Adds message references to message string interpolation, in the form of %{BKY_STRING}.
 * Re-adding CONTROLS_IFELSE block using the new syntax, referencing to CONTROL_IF equivalents.
2016-11-15 15:51:51 -08:00
Rachel Fenichel
82261e3d68 Remove ifelse block and messages' 2016-11-11 17:21:29 -08:00
Rachel Fenichel
b5822e2925 Revert "Revert "Rebuild nov 3 16""
This reverts commit c8ca24a000.
2016-11-11 17:05:13 -08:00
Neil Fraser
c8ca24a000 Revert "Rebuild nov 3 16" 2016-11-08 16:46:00 -08:00
Andrew n marshall
72ff6d9ead Adding controls_ifelse block (#722)
Adding controls_ifelse, an if/else block that is loaded from JSON and does not use mutators. This gives "else" capability to Android & iOS implementations, which don't support JavaScript mutators.

Added this block to the playground simple toolbox and all generators.
2016-10-31 11:00:39 -07:00
Neil Fraser
4d65b606bd Set current workspace when clicking zoom controls. Issue #440 2016-10-23 06:38:04 -07:00
Rachel Fenichel
5418843c12 Move the change block to the variables category 2016-07-07 14:39:45 -07:00
picklesrus
e4900fc27c Fix airstrike by grabbing the correct toolbox element. (#411)
Probably broken in 266e2ffa9a.
2016-06-08 10:03:14 -07:00
Neil Fraser
f642fa80d5 Increase commonality between playgrounds. 2016-06-05 15:32:54 -07:00
Neil Fraser
266e2ffa9a Add toolbox location and toolbox mode options to playground. 2016-06-05 04:16:09 -07:00
Rachel Fenichel
1f2107ee08 add missing return in fake drag 2016-06-01 16:20:56 -07:00
Rachel Fenichel
53cf0be791 lint 2016-06-01 15:24:23 -07:00
Rachel Fenichel
dd205feda0 Add a button to randomly click and drag blocks in the playground. 2016-05-31 15:42:28 -07:00
Dan LaLiberte
c1cfec8dbd Add lists_sort block. 2016-05-04 17:03:24 -04:00
Neil Fraser
2d696aa731 Normalize order of languages. 2016-04-08 22:56:42 -07:00
Neil Fraser
99f332f749 Fix getBlockById unit test. Issue #323 2016-04-07 14:35:01 -07:00
Neil Fraser
4e42a1b78e Swap order of arguments on domToWorkspace. 2016-04-04 18:31:41 -07:00
Rodrigo Queiro
a5d3f340e5 Add a Lua code generator
This is based on the JS generator, with a lot of inspiration from Ellen
Spertus's blockly-lua: https://github.com/espertus/blockly-lua

All unit tests pass with Lua 5.3.2.
2016-03-10 10:24:25 +01:00
Neil Fraser
016d2e74d7 IE does not have sessionStorage on file:// URLs. 2016-03-02 16:38:58 -08:00