Commit Graph

340 Commits

Author SHA1 Message Date
Neil Fraser
68e134b073 No keyboard access to quarks during drag.
Same issue as zooming with the mouse wheel.
2019-03-29 15:24:37 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
alschmiedt
bf45c85bf1 Add private annotation 2019-03-22 10:14:43 -07:00
alschmiedt
b6b7ab0091 Refactor setTheme 2019-03-22 09:54:52 -07:00
alschmiedt
5c18e102ca Fixed setTheme so it doesn't error when no workspace is created 2019-03-21 15:32:18 -07:00
Rachel Fenichel
763a06a7ac Use dropdown div for colour field 2019-02-21 13:41:45 -08:00
alschmiedt
99f4f48321 Fix event description for theme 2019-02-05 13:43:54 -08:00
alschmiedt
9bfb30bcf2 Fixing review comments 2019-01-10 09:13:02 -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
alschmiedt
40a1ae752b Adds support for category styles 2019-01-09 11:18:44 -08:00
alschmiedt
f480b1ff79 Changes Blockly style to be Blockly theme. 2019-01-08 11:40:57 -08:00
alschmiedt
bca5fd36d3 Fix failing test 2019-01-03 13:20:28 -08:00
alschmiedt
bfc55ada27 Fixes refresh on simple toolbox withno categories 2019-01-03 12:56:19 -08:00
alschmiedt
d3a603ffd9 Update the style on blocks in the mutator 2018-12-21 09:00:55 -08:00
alschmiedt
f125065a17 Merge branch 'develop' of https://github.com/alschmiedt/blockly into blockly_colours 2018-12-19 10:39:10 -08:00
alschmiedt
9afe497b7e Fixes jsdocs 2018-12-19 08:45:20 -08:00
alschmiedt
2481274406 Small cleanup 2018-12-18 13:36:23 -08:00
alschmiedt
be78838335 Allows user to define style name using variables in json 2018-12-18 10:50:49 -08:00
alschmiedt
56c2e5fc31 Initial commit for adding a style 2018-12-11 13:22:25 -08:00
Beka Westberg
15b34f7e73 Added flyout to trashcan to "get back" deleted blocks.` 2018-12-07 10:44:24 -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
Neil Fraser
dddb94aedd Fix circular dependency. 2018-10-16 11:34:10 -07:00
Rachel Fenichel
6092e4c517 Calls to getAllBlocks should pass a value for _ordered_ 2018-09-13 16:06:19 -07:00
DD
4a34663d49 Fix lint 2018-08-08 21:10:02 -04:00
DD
8d3dea4c74 Add issue to todo and getter for isVisible on workspace 2018-08-08 20:44:23 -04:00
DD
e06807155d Add todo per code review 2018-08-07 18:04:04 -04:00
Rachel Fenichel
2eeee8b9af Stop handling keypresses when the workspace is hidden. 2018-08-07 18:03:23 -04:00
Rachel Fenichel
5b1e249adc Fix lint 2018-06-25 12:12:24 -07:00
Andrew n marshall
9ab746e143 Another attempt at testing for PointerEvent. (#1870)
Advanced compilation error introduced in #1856.
Now bypassing window altogether, by testing goog.global.PointerEvent directly.
2018-05-15 17:12:53 -07:00
Andrew n marshall
1b9af8771f Revised references to window to solve Node issues. (#1856) 2018-05-15 14:44:15 -07:00
Andrew n marshall
1687275cb2 Replace raw window references with goog.global.window. (#1818)
This should be safer when run within Node.
2018-05-01 13:35:51 -07:00
Andrew n marshall
42e0439aa3 Adding JsDoc @this for closure in jsonInitFactory(). (#1833) 2018-05-01 11:05:35 -07:00
Rachel Fenichel
ee6f2ea097 Comments v3 (#1817)
* Add skeleton for workspace comments

* XML parsing and encoding of workspace comments.

* Minor fix: piping the height and width from xml to newWorkspaceComment

* Move height and width into workspace_comment_svg

* rename newWorkspaceComment to newComment

* minor refactoring. PR changes

* Functions for managing the comment's lifecycle

* Add initial tests

* Add another test

* Add basic rendering of a comment.

* Cleanup remaining highlighting steps from render

* Fix lint

* Fix aslant

* Add basic comment translate

* Simplify render code into one setPath method

* Move steps to setPath_

* Remove svg elements when disposing of a comment; some code cleanup

* Add a workspace comment on context menu click and position it where the initial context menu was clicked.

* Minor rendering changes, fixes RTL. Fix positioning of new (context menu) comments while workspace is scaled.

* PR feedback

* Gesture code for dragging comments

* Add comment (block drag) surface methods

* minor comment fix

* Comment fixes

* Add comment dragger

* Making rendered private

* Require CommentDragger

* Make basic comment dragging work

* Increase the border around the comment to make a bigger drag handle

* Remove typo

* Allow comments to be selected. Highlight selected comment. Only edit comment on click. Updated comment rendering.

* minor refactor: remove commented out code

* PR comments

* lint and rebuild

* Fix renamed function call

* Fix workspace getMetrics by storing comment size as a number, not a string

* Enable comment deletion when dragging over the toolbox or trash can

* Give issue references to some todos

* Create a helper function for workspace comment creation

* Integrate sam's workspace comments, using the bubble dragger

* Remove comment_dragger references

* Remove comment dragger.js

* Remove pointer handling

* Fix lint

* Move comment XML functions into the comment files.

* Fix tests

* Fix type annotations

* Fix comments on comments

* Fix compiler errors related to visibility.

* Fix merge issues and add an issue number to a TODO

* Add a new message for default text on workspace comments, and rebuild

* Add support for a context menu on workspace comment showing delete and duplication options.
Add copy and paste support.

* PR comment feedback

* Show a delete icon on the comment when selected. Delete icon deletes the comment. Comment can be deleted if dragged onto the toolbox or the trash icon. A normal bubble cannot be deleted that way.

* use isDeletable instead

* Support drag of the comment during editing mode using the top handle.

* Add skeletons for all workspace comment events

* Rebuild with new comments

* Get rid of confused TODO

* JSDoc on a function

* Fix broken tests

* More PR feedback

* Fix lint

* Delete comment on mouse out, highlight on mouse down.

* Fix lint.

* Show delete hand cursor when dragging a comment to delete over the toolbox

* Focus textarea on select

* Add delete events

* Remove workspace comment create event, and add TODO placeholder

* Provide default values if comment height and width are missing in XML

* Set comment handle fill to none by default

* Rebuild

* Comment de/serialization should include location.

* Add comment move events, with undo and redo

* Add comment change events

* Move files up to core

* Add package/private annotations wherever possible

* Move the workspace comment events up to core and into a single file

* Mark things package or private where possible

* Get rid of unnecessary changes to messge files

* Fix lint

* Fix some review feedback

* Make changes to the comment db happen in addTopComment and removeTopComment

* Add css classes for toggling comment focus

* Clean up css for comment focus

* Rebuild
2018-04-27 15:18:59 -07:00
Neil Fraser
4cb4b42f8d Use named properties on Msg. 2018-04-27 11:50:51 -07:00
Andrew n marshall
1a37bebd89 Refactor of checkBlockColourConstant_() (#1798)
Rewrote Blockly.checkBlockColourConstant_(..).
 * Last argument is now the expected value of the constant (replacing
   the `removed` argument). The prevents warnings when a Msg colour
   constant is overridden (the correct way).
 * If a value for the constant is not found, do not warn (#1790).
2018-04-18 08:40:45 -07:00
Neil Fraser
1d385f8d69 Require goog.userAgent in the correct files. 2018-04-11 16:59:35 -07:00
Andrew n marshall
ecc41372d7 Fixing issue 1760: nulls in JSON array for block definitions. (#1768)
JSON array with null or undefined value will now skip the offending item, and proceed to load following items. Added tests for null and undefined array elements.

* Testing handling null and undefined id in block definition.
* Adding test utility function to capture console warnings.
* Test assumption that creating a simple block will not cause a warning. This is assumed when later checking warning counts.
2018-04-11 10:22:30 -07:00
Andrew n marshall
e9d8e00a55 Making all blocks use the MSG colour values. (#1749)
* Making all blocks use the MSG colour values.
 * Deprecating Blockly.Constants.Lists.HUE and similar constants.
 * Removing deprecated Blockly.Blocks.lists.HUE constants.
 * Allowing message references in the Block.setColour() parameter.
 * Adding checking of older constants, ensuring they are not overwritten.
2018-04-09 17:37:47 -07:00
Rachel Fenichel
2c7520a9db Make bind/unbindEvent_ public 2018-03-22 12:14:58 -07:00
Sam El-Husseini
fda7122b86 Fix lint 2018-03-02 16:00:30 -08:00
Sam El-Husseini
8d9dad8898 Remove unnecessary code, better styling. 2018-03-02 15:33:44 -08:00
Sam El-Husseini
b32dbcdb94 Pointer Event fixes ensuring they replace all mouse events, and fix comment focusing issue. 2018-03-02 15:01:58 -08:00
Rachel Fenichel
7ea0e1b8c3 Merge pull request #1680 from google/rachel-fenichel-patch-1
Mark bindEvent_ and bindEventWithChecks_ package instead of private
2018-03-02 13:51:21 -08:00
Rachel Fenichel
a5db01559f Mark unbindEvent_ package instead of private
Fixes ~20 compiler warnings.
2018-03-01 18:15:37 -08:00
Rachel Fenichel
5920e6aa39 Mark bindEvent_ and bindEventWithChecks_ package instead of private
Fixes 50 compiler warnings.
2018-03-01 17:56:49 -08:00
Rachel Fenichel
8c8412af74 Just check whether the window exists, instead of using goog.events.BroswerFeature 2018-02-16 15:01:13 -08:00
Rachel Fenichel
e5a2ef30f2 Switch to goog.events.BrowserFeature.POINTER_EVENTS 2018-02-15 11:26:06 -08:00