Commit Graph

96 Commits

Author SHA1 Message Date
alschmiedt
8f880d55c3 Revert "Adds type to FieldNumber editor" 2019-07-18 13:02:53 -07:00
alschmiedt
45387faab7 Adds type to FieldNumber editor 2019-07-02 10:53:45 -07:00
Neil Fraser
1535f35ff2 Remove unused CSS image fetch
This default Closure image was always being overridden and was never fetched.  But it takes some research to determine that this is not in effect a potential monitoring point.
2019-06-10 13:20:33 -07:00
Neil Fraser
6134337568 Reduce memory footprint
Blockly.Css.CONTENT isn’t needed after its first use.
There also is no longer a need to store a reference to the stylesheet, just a boolean.
2019-06-10 11:40:41 -07:00
RoboErikG
5056e23389 Fix margins/checkbox in RTL dropdown menus (#2356)
Fixes #2337 by adding in correct positioning for RTL selected states
and fixing an incorrect margin value.
2019-04-05 15:55:00 -07:00
RoboErikG
1a2cf96a5a Update selected menu sizing to fix #2351 (#2353) 2019-04-01 12:43:19 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Rachel Fenichel
dfc74b8c4f Use dropdownDiv for the angle field as well 2019-02-26 14:54:21 -08:00
Rachel Fenichel
58027b9668 css cleanup 2019-02-26 11:10:55 -08:00
Rachel Fenichel
c426aad387 Use dropdown div for dropdowns 2019-02-21 13:41:45 -08:00
Rachel Fenichel
763a06a7ac Use dropdown div for colour field 2019-02-21 13:41:45 -08:00
Rachel Fenichel
91408a3238 Add dropdowndiv file 2019-02-21 13:41:45 -08:00
Ashwin Ramaswami
2cc3a8b3d9 Scroll very long context menus 2018-12-18 08:41:14 -05:00
Mehdi Yeganeh
56d5f166de #172, Fixed [Edge, IE] Zoom control mouseover is not clipped 2018-12-08 16:16:59 +03:30
Rachel Fenichel
9aa54ac487 Make replaceable child blocks opaque 2018-11-14 11:19:17 -08:00
Rachel Fenichel
4c133e9ecd Highlight and unhilight the closest connection 2018-11-14 11:19:17 -08:00
Rachel Fenichel
7d775908b9 Add insertion markers. 2018-11-14 11:18:32 -08:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Rachel Fenichel
aae8277513 Merge pull request #2022 from rachel-fenichel/feature/canvas_transition
Add support for transitioning the workspace block and bubble canvases on scrollCenter
2018-08-27 11:31:06 -07:00
Rachel Fenichel
48dac195f7 CSS style 2018-08-27 11:23:24 -07:00
Neil Fraser
cb3ea2f56e Remove goog.ui.ColorPicker (#2020)
Adds the ability to set the tooltip titles for each colour.

Note that Closure’s colour picker in Blockly used to have keyboard controls (as of > 3 years ago); but no longer seems to.  This replacement does not currently have keyboard controls either.
2018-08-24 12:14:42 -07:00
Rachel Fenichel
8f675fd82e Add support for transitioning the workspace block and bubble canvases on scrollCenter 2018-08-24 11:55:55 -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
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
Sam El-Husseini
dc2ab1bbed Update css.js 2018-03-09 15:41:50 -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
1d78d7be45 Merge pull request #1483 from DubeySandeep/ScrollableDropdowns
Added scrollable functionality to dropdown menu
2017-12-04 10:39:43 -08:00
picklesrus
d1886572d0 Fix #1487 and only add the delete cursor if the block is not deletabl… (#1491)
* Fix #1487 and only add the delete cursor if the block is not deletable. Also add a grab cursor when it is not deletable so the cursor keeps the grab hand when over the toolbox.  This changes the toolbox api slightly, but the methods it touches are @package so it should be okay.
2017-12-04 10:36:47 -08:00
Sandeep Dubey
2dd8c1f669 Made the changes asked by the reviewer 2017-12-03 02:40:11 +05:30
Neil Fraser
eb796b71de Prevent selection of toolbox categories. 2017-11-13 15:30:33 -08:00
Rachel Fenichel
8a4d45f8fd Fix iOS toolbox flashing on tap (#1351) 2017-10-04 10:16:32 -07:00
picklesrus
859d63633e Fix #1275 by adding a more specific rule for overflow:visible on the … (#1280)
* Fix #1275 by adding a more specific rule for overflow:visible on the drag surface svg.  This wins out over a common bootstrap rule that says: svg:not(:root) {overflow:hidden} and helps avoid a difficult problem for Blockly users to diagnose.

* Update css.js
2017-08-15 13:20:51 -07:00
picklesrus
48a5270072 Fix #1077 by adding a rule to cover the toolbox labels too. (#1099) 2017-05-12 11:29:52 -07:00
Rachel Fenichel
98914fcf6b Dragging changes, rebased on develop (#1078)
* Add block drag surface translateSurfaceBy

* Add dragged connection manager

* Add gesture.js

* Add GestureHandler

* Implemented gesture skeleton

* Most basic workspace dragging

* Add dragged connection manager

* cleanup

* doc

* more cleanup

* Add gesture handler

* Add translateSurfaceInternal

* core/block_dragger.js

* cleanup

* Pull in changes to dragged connection manager

* Pull in changes to dragged connection manager

* comments

* more annotations

* Add workspace dragger

* Add coordinate annotations

* Start on block dragging

* Limit number of concurrent gestures

* Add some TODOs

* start using dragged connection manager

* Set origin correctly for dragging blocks

* Connect or delete at the end of a block drag.

* cleanup

* handle field clicks and block + workspace right-clicks

* move code into BlockDragger class, but still reach into Gesture internals a lot

* Clean up block dragger

* Call blockDragger constructor with correct arguments

* Enable block dragging in a mutator workspace

* Add workspace dragger

* click todos

* Drag flyout with background

* more dragging from flyout

* nit

* fix dragging from flyouts

* Remove unused code and rename gestureHandler to gestureDB

* Rename gesture handler

* Added some jsdoc in gesture.js

* Update some docs

* Move some code to block_svg and clean up code

* Lots of coordinate annotations

* Fix block dragging when zoomed.

* Remove built files from branch

* More dragging work (#1026)

-- Drag bubbles while dragging blocks
-- Use bindEventWithChecks to work in touch on Android. Not tested anywhere else yet.
-- Handle dragging blocks while zoomed
-- Handle dragging blocks in mutators
-- Handle right-clicks (I hope)
-- Removed lots of unused code

* More dragging work (#1048)

- Removed gestureDB
- Removing uses of terminateDrag
- Cleaned up disposal code

* Dragging bugfixes (#1058)

- Get rid of flyout.dragMode_ and blockly.dragMode_
- Make drags from the flyout start from the top block in the group
- Block tooltips from being scheduled or shown during gestures
- Don't resize mutator bubbles mid-drag

* Fix events in new dragging (#1060)

* rebuild for testing

* unbuild

* Fix events

* rebuild

* Fix up cursors

* Use language files from develop

* Remove handled TODOS

* attempt to fix IE rerendering bug, and recalculate workspace positions on scroll

* Rebuild all the things

* Comment cleanup; annotations; delete unused variables.
2017-05-05 12:42:53 -07:00
picklesrus
52f76013b5 Change how blockly handles cursors. The old way was quite slow becau… (#1057)
* Change how blockly handles cursors.  The old way was quite slow because it changed the stylesheet directly.  See issue #981 for more details on implementation and tradeoffs.  This changes makes the following high level changes: deprecate Blockly.Css.setCursor, use built in open and closed hand cursor instead of custom .cur files, add css to draggable objects to set the open and closed hand cursors.
2017-04-21 14:57:54 -07:00
Karan Purohit
4a81623f8d Code correction from previous commit. Moved style to css.js and set ROUNDING=15; 2017-02-15 14:33:20 +05:30
Andrew n marshall
e95991cba8 Adding @namespace annotations for JSDoc. (#900) 2017-02-01 09:10:35 -08:00
picklesrus
8aa8b1b3ba Add ability to add a class to a scrollbar so that different types of … (#837)
* Add ability to add a class to a scrollbar so that different types of scrollbars can
be distinguished from each other. You used to be able to do this by looking at the parent
element but now all the scrollbars are siblings in the dom.

Also, use this new class to fix #816 so that layering of the flyout and workspace scrollbars
are done correctly.
2017-01-18 13:02:08 -08:00
picklesrus
25ed815320 Make cursor stay as a closed hand when dragging blocks around in the drag surface. Do this by applying the same style to text elements in the drag surface that we do in the main svg. (#805) 2017-01-05 15:39:06 -08:00
picklesrus
e1cd21842a Add a workspace drag surface that blocks and bubble get moved to duri… (#778)
* Add a workspace drag surface that blocks and bubble get moved to during a workspace drag.
The surface is translated using translate3d instead of svg's translate attribute so that
the browser does not have to repaint the entire workspace on every mouse move.
This is very similar to the block drag surface.

* Address code review comments

* add back hasClass_ utility removed in #748 and stop using contains since it is not supported in IE
2016-12-15 11:02:49 -08:00
picklesrus
a82bd49d7e Split the scrollbar and flyout out into their own SVG elements. They (#771)
* Split the scrollbar and flyout out into their own SVG elements. They
are siblings of the workpsace SVG.  This paves the way to make performance
improvements to workspace dragging.
2016-12-09 16:19:19 -08:00
Rachel Fenichel
ff87c76557 Don't make labels clickable 2016-12-02 14:03:49 -08:00
Rachel Fenichel
effc1d5f1c Add ability to specify a css class for labels and buttons 2016-12-02 14:01:36 -08:00
picklesrus
7f02c19bfe Improve performance of block dragging. This is a backport of the blo… (#732)
Improve performance of block dragging.  This is a backport of the block drag surface from scratch-blocks.  At the beginning of a block drag, blocks get moved to a drag surface which then translates using translate3d to avoid repainting the entire svg on every mouse move.  At the end of the drag, the blocks are dropped back in the svg in their new position.
2016-11-15 13:19:49 -08:00
Rachel Fenichel
34a6d5e6e4 simplification 2016-11-09 13:12:18 -08:00
Rachel Fenichel
d91ba9e2f9 Move injected css to start of head 2016-11-08 16:54:35 -08:00
Rachel Fenichel
afca4264ca Add option to style flyout buttons as labels 2016-10-31 15:20:16 -07:00
Neil Fraser
5cdb843f3e Update demo to latest interpreter. 2016-09-20 12:52:22 -07:00
Neil Fraser
bc2bfbd53d Add shadow to flyout buttons. 2016-09-15 18:39:50 -07:00
Rachel Fenichel
350e1ff2cc Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop 2016-08-08 16:58:51 -07:00