Commit Graph

61 Commits

Author SHA1 Message Date
Sam El-Husseini
e339ae26bc Move the rendering object to live on the workspace_svg (#3016)
* Move the rendering object onto the workspace allowing the various workspaces to have different renderers.
2019-09-13 14:20:34 -07:00
kozbial
a12a47e0f8 Fixing require ordering and bug in horizontal layout computation. 2019-09-12 11:05:30 -07:00
kozbial
b26f50ab8d Fixing x positioning of blocks with output connections in vertical flyout. 2019-09-12 11:05:30 -07:00
alschmiedt
ec07a36e44 Update cursor api (#3002)
* Move over to new implementation for cursor
2019-09-11 18:16:05 -07:00
Rachel Fenichel
797b8dae46 Include tab width in block width 2019-08-13 10:14:33 -07:00
Rachel Fenichel
ace1971795 Make hats have height! 2019-08-13 10:14:33 -07:00
Rachel Fenichel
b4109d7c43 Add no-multi-spaces rule 2019-07-31 09:33:54 -07:00
Neil Fraser
b8cbd9e7df Resolve 13 warnings
Reduce count from 632 to 619.
Eliminate copy-paste code duplication in Field.prototype.setValue
2019-06-12 10:59:33 -07:00
Neil Fraser
848d3a3509 Move setCssTransform & createSvgElement to dom.
Also move SVG_NS and HTML_NS properties.
2019-06-07 10:32:57 -07:00
Neil Fraser
a9fdf7844a Fix ordering of requires
Search and replace of a name strikes again.
2019-06-07 10:32:57 -07:00
Neil Fraser
d1a29739d8 Move utilities into own directory.
TODO: There are more functions which may be migrated into dom and string.
2019-06-07 10:32:57 -07:00
Neil Fraser
5bf7069a2f Remove goog.math.Coordinate 2019-06-07 10:32:57 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
5cf52c566a Fix a dozen compiler warnings. 2019-05-17 16:48:40 -07:00
Neil Fraser
25bc3e0268 Fix require statements.
Also throw error instead of string.
And stop using goog.asserts.
2019-05-17 15:04:39 -07:00
Neil Fraser
834fa64674 Use Element constants and ‘i’ variable.
I don’t care about whether we use the Element constants or the ubiquitously known 1 & 3 integers.  But we had a mix.
Also, ’x’ is usually used for horizontal location, ‘i’ is an iterator.
No functional change.
2019-05-02 09:56:37 -07:00
Neil Fraser
6f433d7521 Don’t preserve IDs during cut/copy/paste or flyout
Previously, if the XML of a toolbox contained a block ID, the first creation of this block would inherit this ID.  Thus two realtime collaborators could realistically end up with conflict.  Likewise, cut and paste could generate similar conflict.
2019-05-02 09:56:37 -07:00
Beka Westberg
79d75b9f3d Fixed buttons being rendered as labels if they come after a label. (#2410) 2019-04-25 18:21:42 -07:00
Jim Jiang
1b10d134a5 Add Block.setEnabled (#2386)
* Implement Block.setEnabled()

From issue #1593. This commit:
- add setEnabled
- deprecate setDisabled

* Update setDisabled calls to setEnabled

Add setEnabled and deprecate setDisabled in
- core/block_svg

Update calls in
- blocks/loops
- blocks/procedures
- core/block_events
- core/events
- core/flyout_base
- core/xml
- tests/workplace_svg/procedure_svg_test

* Implement changes from comments from RoboErikG

- Implement isEnabled()
- Make this.disabled @private
- Make setDisabled(disabled) call setEnabled(!disabled)
- Update setEnabled to use isEnabled()

* Utilize isEnabled() and fix typos

Fix missing parentheses
Implement isEnabled() more widely
Fix lint and parentheses errors

* Change prevDisabledState to prevEnabledState
2019-04-23 08:49:07 -07:00
Beka Westberg
9a9c6612f8 Changed buttons and labels to respect <sep> elements in toolbox. (#2395) 2019-04-22 12:23:04 -07:00
Beka Westberg
627c521c29 Fixed flyout scrollbars not being repositioned on window resize. 2019-02-09 20:30:21 -08:00
Beka Westberg
b015d67f24 Fixed next blocks not being disabled in flyout. (#2278) 2019-02-08 13:36:08 -08:00
Beka Westberg
999a204dbd Added the ability to drag disabled blocks out of the trashcan flyout. 2019-01-28 16:26:21 -08:00
Beka Westberg
8f81bbac25 Fixed Filter Capacity not Considering Child Blocks. (#2155) 2018-12-06 08:54:26 -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
Neil Fraser
db0dbc69ee Update todos and requires. 2018-10-16 11:34:10 -07:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Andrew n marshall
411ec9724e Replacing node.parentNode.removeChild(node)
...with Blockly.utils.removeNode(..), which includes
a null/undefined check on parentNode before continuing.
2018-09-04 13:31:53 -07:00
Neil Fraser
c51cf0b79c Remove goog.dom.removeNode 2018-07-11 12:20:02 -07:00
Neil Fraser
8f7674ea08 Correct requires for goog.events 2018-07-11 12:20:02 -07:00
Neil Fraser
284b79407e Require Blockly.utils where needed. 2018-07-11 12:20:02 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Sam El-Husseini
87ab88954d Fix RTL mutators in Edge and IE 2018-05-10 20:30:37 -07:00
Neil Fraser
662d79443f Add 'ordered' option to descendant getting functions. (#1786) 2018-04-17 11:41:03 -07:00
Johnny Yang
7dbe0bda66 mark properties @protected instead of @private so they can be used by Blockly.FlyoutVertical & Blockly.FlyoutHorizontal 2018-04-16 01:36:28 +10:00
Neil Fraser
1d385f8d69 Require goog.userAgent in the correct files. 2018-04-11 16:59:35 -07:00
Rachel Fenichel
6d83b9bc28 Add keyword-spacing rule to eslint 2018-03-19 13:10:29 -07:00
Rachel Fenichel
4c9b602523 Move event classes into separate files, and update requires accordingly 2018-02-27 17:47:33 -08:00
Rachel Fenichel
3e62ffc20a Split at higher level for multiline function calls 2018-01-24 11:26:41 -08:00
Rachel Fenichel
fb897d7786 Even more lint. 90 errors remaining. 2018-01-23 18:33:30 -08:00
Rachel Fenichel
b593d44379 Make the potential variable map null when not needed 2018-01-12 14:51:02 -08:00
Rachel Fenichel
db9a9f5182 Move code from the variable to the variable map. Fixes #1512. 2017-12-15 15:31:41 -08:00
Rachel Fenichel
66975c8f94 Rebase 2017-12-15 13:44:27 -08:00
Rachel Fenichel
f0b7190603 Clean up TODOs and move potential variable map to the flyout workspace 2017-12-13 11:50:08 -08:00
Rachel Fenichel
5047b00e27 Fix missing events for variable creation 2017-12-13 11:50:08 -08:00
Rachel Fenichel
1ce46ab88b Move getOrCreateVariable to variables.js 2017-12-13 11:50:07 -08:00
Rachel Fenichel
3ae7ac1cd4 Make unique variable names in the flyout 2017-12-13 11:50:07 -08:00
Karishma Chadha
143d95222c Fixing type annotation. 2017-11-22 15:22:34 -05:00
Karishma Chadha
aae1b1bb74 Addressing PR comment. Moving functionality to get newly added variables into a helper function. 2017-11-22 14:51:11 -05:00
Karishma Chadha
ee142e92bb Fixing comment style. 2017-11-22 13:43:25 -05:00