Commit Graph

380 Commits

Author SHA1 Message Date
Neil Fraser
459961c3cb Replace Element constants with Node constants.
Element constants apparently don’t exist in IE or Edge.  Node constants apparently do.
2019-05-29 10:45:54 -07:00
Beka Westberg
06c6d83355 Changed colour field class validator to accept all documented values. 2019-05-24 16:14:49 -07:00
Neil Fraser
5c614d73c1 Add tests for XY regexs. 2019-05-24 15:45:05 -07:00
Beka Westberg
f16c9c0beb Refactored field validation. 2019-05-24 14:23:42 -07:00
Neil Fraser
5cf52c566a Fix a dozen compiler warnings. 2019-05-17 16:48:40 -07:00
Beka Westberg
acd96aa2c5 Added Field Value Tests (#2459)
* Added field value tests.

* Fixed field image src param.

* Fixed falsy values with label fields.

* Fixed falsy values with text input fields.

* Fixed some angle field tests.

* Fixed other text input when editing tests.

* Fixed colour tests.

* Cleaned up some number and variable field tests.

* Added angle field > 360 degrees tests.

* Fixed variable validator tests.

* Split setValue tests into sub-suites.

* Fixed angle >360 tests

* Changed var declarations to property declarations.
2019-05-17 15:19:14 -07:00
Beka Westberg
354d402c49 Refactored field.init into field.initView and field.initModel 2019-05-03 07:12:46 -07:00
Rachel Fenichel
12a769b9c4 Merge pull request #2426 from rachel-fenichel/testing/run_mocha_tests
Add mocha tests to npm test
2019-05-02 15:32:09 -07:00
Rachel Fenichel
9e7becc262 Update comments 2019-05-02 15:31:54 -07:00
Beka Westberg
3afcd23535 Removed explicitly setting variable type to two single quotes. 2019-05-01 14:31:20 -07:00
Rachel Fenichel
99dc9bb38f Fix test (matching fix in jsunit tests) 2019-05-01 14:19:55 -07:00
Rachel Fenichel
e77efa6c13 Add mocha tests + parsing to npm test 2019-05-01 13:43:19 -07:00
Rachel Fenichel
5983c3c4b7 Merge pull request #2424 from rachel-fenichel/testing/webdriverio_upgrade
Update to webdriverio v5; fix resulting test breakages
2019-05-01 10:55:40 -07:00
Rachel Fenichel
da2a89e177 Update to webdriverio v5; fix resulting test breakages 2019-04-30 14:38:33 -07:00
Beka Westberg
247aafae7e Added updateColour to field. 2019-04-29 16:53:59 -07:00
Beka Westberg
ce816b93bf Added field_label_serializable. (#2399) 2019-04-24 10:43:09 -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
148823146d Fixed lint errors 2019-04-22 10:55:36 -07:00
Beka Westberg
91b0e3d79a Changed mocha eslint config to extend root eslint config. 2019-04-22 10:45:35 -07:00
Beka Westberg
e8573bc0db Added isSerializable function and SERIALIZABLE property to fields. 2019-04-21 08:28:37 -07:00
Beka Westberg
0617cc7fea Added isDirty_ property to fields. 2019-04-15 16:37:11 -07:00
RoboErikG
ec78eeb39b Propagate the visible state when blocks connect (#2003)
* Propagate the visible state when blocks connect

This fixes #1967.

In rendered connections when connecting:
- If the superior connection is hidden this hides the newly connected block.
- If the superior connection isn't hidden it makes sure the block is visible.

In rendered connections when disconnecting:
- If the superior connection is hidden, make the disconnected block stack visible.

TODO before review:
 - write tests.
 - update collapsed message

* Add missing overrides

* Add tests for hidden connections and fix a bug while disposing
2019-04-15 16:23:19 -07:00
Beka Westberg
f88c704d69 Fixed visible floating point errors in number fields. (#2384) 2019-04-15 13:26:20 -07:00
Neil Fraser
9561ecffa6 Common prefix for test blocks
Fixes #2103.

This will break any saved XML involving the playground’s test blocks.  I don’t think any such XML exists on this planet.
2019-04-05 16:03:43 -07:00
alschmiedt
d3f8464876 Fixes test case for unplug 2019-04-02 16:45:43 -07:00
Neil Fraser
8254e2aa22 Failing unit tests no longer show useful info. 2019-03-29 15:24:37 -07:00
Rachel Fenichel
7ff27bcfc9 Add license; translate the group, not the start point of the path 2019-03-22 11:13:04 -07:00
Rachel Fenichel
74adb31961 Add a playgound for debugging SVG paths 2019-03-14 17:46:19 -07:00
amber-cd
a655e48841 Update playground.html 2019-03-05 08:42:31 -05:00
Rachel Fenichel
dfc74b8c4f Use dropdownDiv for the angle field as well 2019-02-26 14:54:21 -08:00
Beka Westberg
9dec2da5c5 Movement Updates (#2247)
This is a squash and merge of a large set of changes by @BeksOmega 

* Added functionality to scrolling, dragging, and zooming.

* Fixed incorrect changes to workspaceChanged function.

* Fixed comment.

* Fixed typo.

* Removed scrollbar.set calls from workspace_svg.

* Removed scrollbar.resize() call.

* Added move options to playground.

* Fixed scroll_ calls that replaced scrollbar.set calls.

* Removed this.scrollbar checks.

* Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again.

* Changed procedures so the Highlight definition option is only available if the workspace is moveable.

* Fixed scrollCenter so that it works with flyout toolboxes.

* Fixed zoomToFit so that it works with horizontal flyout toolboxes.

* Fixed Typo.

* Fixed bumping blocks when the workspace is not movable.

* Fixed bumping not working with left and top toolbox positions.

* Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case.

* Cleaned up formatting.

* Fixed bumping... again. Reformatted workspaceChanged a bit.

* Changed blocks to be completely bumped into the workspace.

* Reorganized metrics-getting for workspaceChanged.

* Added bumping workspace comments. Moved event checking.

* Renamed workspaceChanged to bumpObjects.

* Added a bumpObjects developer reminder.

* Added warning to zoomToFit.

* Cleaned up some text.

* Added better inline documentation.

* Fixed up inline docs.

* Cleaned up comments.

* Fixed zoomCenter not actually zooming towards the center.

* Fixed zoomControls error on unmovable bottom-toolbox workspaces

* Fixed programatically placing blocks in an unmovable workspace.

* Removed unnecessary translate call in inject.

* Reversed removal of translate. (apparently it was necessary)

* Cleaned up code in response to first round of reviews.

* Added unit comments to the zoom function.

* Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events.

* Changed getWorkspaceObjectMetrics call to getBoundingRectangle().

* Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled).

* Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg.

* Fixed centerOnBlock.

* Added unit docs to translate. Moved setting the grid position to the translate function.

* Added TODO's.
2019-02-18 15:28:51 -08:00
Andrew n marshall
f05eed64eb Check against healing child shadow blocks.
Fixes #2227, healing values.
Also applies to shadow next blocks.
Added a playground test block group with a shadow statement.
2019-02-07 13:15:41 -08:00
Andrew n marshall
b61ce94e8d Added a Test Block for a Dynamic Dropdown (PR#2252)
Merged from BeksOmega/tests/DynamicDropdown
2019-02-07 10:26:33 -08:00
Andrew n marshall
114171ada8 language-neutral text -> language-neutral id 2019-02-07 10:22:36 -08:00
alschmiedt
c7b748c4d1 Merge pull request #2270 from alschmiedt/changeStyleNames
Changes colour names
2019-02-06 15:35:59 -08:00
alschmiedt
58c365e377 Changes colour names 2019-02-06 14:24:41 -08:00
Beka Westberg
74e5c49e0d Fixed comments and defaults. 2019-02-05 14:32:40 -08:00
alschmiedt
99f4f48321 Fix event description for theme 2019-02-05 13:43:54 -08:00
Andrew n marshall
463e42e375 New label and title case 2019-02-05 09:13:53 -08:00
Rachel Fenichel
71e91534e8 Update connection_db_test 2019-02-04 08:59:55 -08:00
Beka Westberg
a47ddcb976 Added a test block for a dynamic dropdown. 2019-02-02 09:57:07 -08:00
Rachel Fenichel
a778ce0384 Merge pull request #2212 from rachel-fenichel/cleanup/remove_eslintrc
Remove old eslintrc and use .json for mocha eslintrc
2019-01-22 17:39:05 -08:00
alschmiedt
59e4d985aa Remove unnecessary scripts 2019-01-11 14:36:53 -08:00
alschmiedt
0d78f1dcd5 Fixing compiler error for blockly themes 2019-01-11 14:28:49 -08:00
Rachel Fenichel
c13833b6c5 Remove old eslintrc and use .json for mocha eslintrc 2019-01-11 12:30:34 -08:00
alschmiedt
7941651444 Merge pull request #2184 from alschmiedt/blockly_colours
Blockly Themes
2019-01-11 10:57:57 -08:00
Beka Westberg
969687ec34 Added flipRtl Support for FieldImages (#2203)
* Added flipRtl support for FieldImages. Added a flipRtl test block.

* Added blockfactory support.

* Fixed JSDoc.
2019-01-10 08:59:35 -08:00
alschmiedt
caf664db04 Small fixes 2019-01-09 15:38:30 -08:00
alschmiedt
55a46f8299 Fixes error thrown for style defined inline 2019-01-09 13:44:22 -08:00
Rachel Fenichel
089c30baa1 Add eslintrc to mocha directory 2019-01-09 13:31:07 -08:00