Commit Graph

1300 Commits

Author SHA1 Message Date
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
Andrew n marshall
02dc7b1d1d Fixing JSDoc for the return type of Blockly.WorkspaceComment.parseAttributes (#1966) 2018-07-03 12:07:25 -07:00
Andrew n marshall
cf3f914be8 Moving TODOs out of jsdoc comments. (#1965) 2018-07-03 11:42:40 -07:00
Neil Fraser
13f7e75ffb Supress empty <variables> tag in XML. 2018-06-29 17:52:26 -07:00
Rachel Fenichel
caac6b8324 Merge pull request #1932 from rachel-fenichel/lint/infix_curly
Add curly and space-infix-ops rules
2018-06-25 17:12:44 -04:00
Rachel Fenichel
5b1e249adc Fix lint 2018-06-25 12:12:24 -07:00
Mark Gibson
709d31b729 Fix case of duplicate var (i) 2018-06-19 11:00:24 +01:00
Andrew n marshall
100d9f1a1c Support %{..} in flyout_button (#1927) (#1929)
Expand %{..} references in toolbox <button> and <label>
2018-06-18 11:45:36 -07:00
Neil Fraser
05fcdc3510 Remove goog.Timer 2018-06-12 14:06:10 -07:00
Andrew n marshall
7886d24130 Fixing xml.js: Always throw XML I/O errors; Support parsing in Node (#1911)
* Improved Blockly.XML comments.
 * Support JSDOM as an alternate parser under Node.js
 * Throw standard errors instead of goog.asserts.
 * Adding textToDomDocument_ and override in gulpfile.
2018-06-12 14:03:10 -07:00
Andrew n marshall
2c84161b4a Correct require goog.Timer statements. (#1906) 2018-06-06 15:57:53 -07:00
Rachel Fenichel
bae346963f Remove custom touch handling code for dropdown fields 2018-06-06 12:34:28 -07:00
Andrew n marshall
dc081e3677 Fixed typo (#1899)
Correct name in FieldButton member reference.
2018-06-06 10:42:19 -07:00
Andrew n marshall
e9aae34388 Adaptive popup size for FieldDropdowns (#1897)
Replace the fixed dropdown height with one responsive to the document's viewport.

This is adapted from Bohdan-Tereta's proposed solution:
https://github.com/google/blockly/pull/1483#issuecomment-381638639

It is sub-optimal, in that is does not adapt to field height (variable
due to workspace zoom), and it does not fully utilize the space above
or below the field if the block is near the top or the bottom.
2018-05-31 16:37:09 -07:00
Andrew n marshall
15817e78a1 Fix case where lack of colour attribute results in null. (#1894)
Fixes regression in #1893. Patch on change in #1831.
Verify typeof colour variable before passing through Number().
Missing attributes return null, and Number(null) === 0, resulting in a red hues category color.
2018-05-31 12:31:18 -07:00
Rachel Fenichel
c6b46d854a Fix comment in dragged_connection_manager.js 2018-05-25 10:34:04 -07:00
Rachel Fenichel
e6a875bb02 Make event filtering stricter for events 2018-05-24 17:12:00 -07:00
Rachel Fenichel
68f8639da1 Merge pull request #1888 from rachel-fenichel/cleanup/stepObject
Create and use a Blockly.BlockSvg.PathObject type
2018-05-23 15:44:59 -07:00
Rachel Fenichel
73e6cf1265 Fix undoing a drag to connect 2018-05-23 14:56:41 -07:00
Rachel Fenichel
c1df1c647a Create and use a Blockly.BlockSvg.PathObject type 2018-05-23 11:40:15 -07:00
Rachel Fenichel
206e22e88c Decompose some render functions so they'll be easier to work with 2018-05-22 14:06:51 -07:00
Rachel Fenichel
98f838c0c3 Merge pull request #1878 from rachel-fenichel/bugfix/1380
Fix #1380
2018-05-21 16:11:29 -07:00
Rachel Fenichel
178473e989 Merge pull request #1885 from rachel-fenichel/bugfix/ws_comment_enable_ie
Disable ws comments in IE
2018-05-21 16:11:20 -07:00
Isabelle Taylor
629763e8ff Add warning message for unrecognized toolbox colour value. (PR #1881)
Fixes #1831
2018-05-21 15:44:46 -07:00
Rachel Fenichel
efd55e5d4f Disable ws comments in IE 2018-05-21 15:12:09 -07:00
Rachel Fenichel
14e846f2b7 Fix 1380 2018-05-17 16:19:44 -07:00
Rachel Fenichel
3fea2a2eb4 Merge pull request #1875 from rachel-fenichel/fixes_from_scratch_blocks
Fixes from scratch blocks
2018-05-17 16:09:11 -07:00
Rachel Fenichel
85206993f6 Add a missing require and rebuild 2018-05-17 11:20:49 -07:00
Rachel Fenichel
df7f534ad6 Performance improvements for workspace clear and load 2018-05-17 11:05:18 -07:00
Rachel Fenichel
8ead7dabd8 Use .textContent setter for field text 2018-05-16 14:48:41 -07:00
Rachel Fenichel
f623004b3a Small changes 2018-05-16 12:52:12 -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
Rachel Fenichel
93eb340b23 Update gesture.js
Make the code match the annotation (and all other uses of the variable)
2018-05-15 14:37:24 -07:00
Sam El-Husseini
87ab88954d Fix RTL mutators in Edge and IE 2018-05-10 20:30:37 -07:00
Rachel Fenichel
14e926a364 Update comments in block_events.js
They were inverted.
2018-05-10 12:04:05 -07:00
Rachel Fenichel
cfab3cc9ae Merge pull request #1838 from rachel-fenichel/bugfix/ff_scrolling
Fix a problem with scrolling on firefox
2018-05-09 12:44:27 -07:00
Rachel Fenichel
7c7158625e Merge pull request #1841 from rachel-fenichel/bugfix/ui_events_null
Make ui events work when block is null; test
2018-05-07 14:22:03 -07:00
Rachel Fenichel
cc33296f04 Merge pull request #1844 from gnarf/delay-ctm
Delay getting inverse screen CTM until needed
2018-05-07 14:21:39 -07:00
Andrew n marshall
ea6438de3e Adding Blockly.FieldDropdown.validateOptions_() (#1840)
* Adding Blockly.FieldDropdown.validateOptions_()

Verifies the datastructure of dropdown option lists.
Catches errors early, such as:
  https://groups.google.com/forum/#!topic/blockly/ae9WrvEcOP0
2018-05-04 19:12:10 -07:00
Corey Frang
222e33eaa3 Do not nullify inverseScreenCTM if for some reason CTM is lost 2018-05-04 19:39:07 -04:00
Corey Frang
0dc32091c4 Delay getting inverse screen CTM until needed 2018-05-04 13:40:55 -04:00
Rachel Fenichel
02aada1e3d Make ui events work when block is null; test 2018-05-03 17:36:08 -07:00
Rachel Fenichel
c7a0721a18 Fix a problem with scrolling on firefox 2018-05-02 16:44:54 -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
b578647906 Merge pull request #1828 from rachel-fenichel/feature/zoom_control_decomp
Decompose some functions for creating zoom controls SVG
2018-04-30 13:07:00 -07:00
Rachel Fenichel
744bb9b6eb Add comments explaining unique IDs on clip paths 2018-04-30 13:01:04 -07:00
Rachel Fenichel
a572a15874 Merge pull request #1827 from rachel-fenichel/feature/references_variables
Add a referencesVariables function to field
2018-04-27 15:34:53 -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