Commit Graph

202 Commits

Author SHA1 Message Date
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
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
ed9330cf57 Move Blockly.hueToRgb to Blockly.utils.colour
Also adds support for ‘#f00’, ‘rgb(255, 0, 0)’ and ‘red’ for block colours, in addition to ‘#ff0000’ (and of course hue).
2019-06-05 16:41:04 -07:00
Neil Fraser
dce0b77424 Fix 19 warnings in theme-related code. (#2523)
* Fix 19 warnings in theme-related code.

Resolves #2414

* Remove suppressPrefixSuffix property definition

The mixin code throws an error if property exists on both objects.

* eslint has strange ideas about indentation.
2019-05-30 10:05:06 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
32631577a4 Defenestration 2019-05-17 15:04:39 -07:00
Neil Fraser
4161ba0fa7 Move goog.global to Blockly.utils.global
Can’t use Blockly.global since that’s the last file to load.
2019-05-17 15:04:39 -07:00
Neil Fraser
25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -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
ce816b93bf Added field_label_serializable. (#2399) 2019-04-24 10:43:09 -07:00
Neil Fraser
f118d33855 Corrections to JSDoc comments 2019-03-29 15:24:37 -07:00
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
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