Commit graph

16 commits

Author SHA1 Message Date
Andy O'Neill
ffcd546474 feat: add quaternary color for selected dropdowns 2023-03-02 13:46:07 -05:00
Rachel Fenichel
fc0da3e070 All remaining lint in core 2018-05-02 15:32:28 -07:00
Rachel Fenichel
413faaa778 Switch to Blockly.Field.fromJson 2018-04-17 14:15:18 -07:00
Rachel Fenichel
ed072e258c Return early from field init if the field has already been initialized. 2017-11-16 14:27:31 -08:00
Andrew Sliwinski
be9d5fefed Merge from Upstream Blockly ()
* WIP merge from upstream google/blockly

* fixing some merging bugs. Getting the drag surface to work, updating some function calls, etc.

* make the trash can lid animate again and fix the cursor to show an x when things will be removed.

* Fix text rendering logic in fields

* Hand apply some more changes from blockly flyout.js to flyout_base.js.

Also revert 08efd1381c
in scratch-blocks since it breaks variables and there is more work fenichel is planning
to do here.

* Fix drop-down field rendering

* Resolve issue with text input field widths on init

* Remove unused blockly (built) files

* Remove unused language files

* Resolve lint issues and rebuild

* Add blockly build targets to cleanup script

* Return 0 if 'this.arrow_' does not exist in a dropdown field

* Remove unused / irrelevant comments
2017-02-02 14:17:43 -05:00
Airhogs777
3bafc2e2fb Switch from Replacing argType to Appending To It ()
* switch from replacing argType to appending to it

* switch argType to array, rename function to addArgType
2016-10-05 13:28:44 -04:00
Airhogs777
d00c2942e4 Dropdown menu categories ()
* add getter for category

* set dropdown's data-category to parent block's category

* remove unused parameter
2016-10-03 08:17:45 -04:00
Airhogs777
bac07dc65a Add attribute for argument type (take 2) ()
* a more robust way to add an attribute to arguments

* always run superclass constructor before setting argtype
2016-10-02 13:36:32 -04:00
Tim Mickel
25e80c2d09 Straw-man implementation of text drop-downs ()
* Refactor drop-down positioning to encapsulate block positioning

Moves block-positioning logic to the DropDownDiv class. Since icon menus use a special offset for the secondary mode, add an option for that.

* Swap out field_dropdown's use of WidgetDiv with DropDownDiv

* Update CSS for goog-menus in DropDownDivs

* Fix hiding behavior when showEditor_ is called again
2016-06-14 17:08:14 -04:00
Rodrigo Queiro
8dfb3d8141 Use bindEvent_ for dropdown buttons ()
This matches the style of the rest of Blockly, and means that the
dropdowns can be tested with Chrome's Device Mode, which was not
possible before due to this bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=133915

This also adds listeners for mousedown/mouseup - this should be better
on PCs with touchscreens (), although we'll need a further change to
open the numpad on touch events.
2016-06-09 11:33:09 -04:00
Tim Mickel
e3b3390159 Add check for iconmenu's parentBlock_ 2016-05-12 22:05:20 -04:00
Tim Mickel
50ff6e4654 Implement field_number stub and num-pad on mobile ()
* Implement basic field_number type

* Add whole number and positive number

* Remove bad arguments for showEditor_

* Basic implementation and styling of num-pad

* Remove virtual keyboards; add selection and read-only

* Add editing for the number pad

* Add backspace button to number pad

* Fix text padding for font-weight and extra magic

* Don't show decimal point for integers

* Re-update default WeDo numbers

* Refactor and improve documentation of field_number
2016-04-26 21:32:29 -04:00
Tim Mickel
99a2d9a549 Implement all WeDo blocks, new icons and assets
* Update all assets from Carl

* Update when-broadcast-received and dropdown sizes

* Update icon menu sizing

* Update padding on drop-down div

* Update WeDo and event blocks; defaults

* Update multi_playground and vertical_playground

* Recompile with CSS updates

* Updating default icon reference for wedo_motorspeed
2016-04-26 10:49:52 -04:00
Tim Mickel
0ca0b26037 Drop-down and field bug fixes ()
* Only reset icon menu field colour if block still exists

* Hide drop-downs and WidgetDiv on block creation
2016-04-25 15:38:10 -04:00
Rodrigo Queiro
0ea1a4152d Add Apache 2.0 license header to new files
Files that were forked off Blockly (eg block_render_svg_horizontal.js)
remain marked as Copyright Google, whereas new files are Copyright MIT.
2016-04-25 15:34:22 +02:00
Tim Mickel
cf6725ba4c Implement drop-down menus and icon picker field ()
* Icon menu and drop-down stubs

* Recompile 4/15

* Fix stubs to draw shadow block for drop-down

* Fix rendering of shadow for icon menu

* Add arrow to dropdown button

* Add drop-down buttons to rest of examples

* Implementation of drop-down div including positioning

* Drop-downs take colours from the blocks

* Fix scaled secondary position of drop-downs

* Fix arrow positioning for RTL

* Use SVG parentNode for sizing dropdown

* Use transform for drop-down positioning

* Add basic DropDownDiv hide

* Add animation-in to dropdown

* More subtle drop-down animation and shadow

* Add icon menu example

* Use options style of Blockly FieldImage for drop-down

* Add default value for iconmenu

* Add example hover, active states for iconmenu buttons

* Update dropdown_icon example

* Implement icon-menu value handling and default value

* Add updating the parent block image field to dropdown

* Drop-down animates out; add hooks to hide for various Blockly happenings

* Add pointer cursor for drop-down icons

* Improve documentation for drop-downs and minor refactor

* Factor out getSrcForValue in iconmenu

* Blocks take on the icon of their icon-menu

* Add basic accessibility properties, similar to closure

* Remove extra drop-down example; update playgrounds

* Remove unnecessary colour overrides

* Add onHide, colour changing, fix references in dropdowndiv

* Flip arrow when the drop-down is rendered above

* Hide the icon menu drop-down on second tap of button

* Add preventDefault to button ontouchstart

* Updates to drop-down from Carl

* Add icon-menu placeholders and a crazy demo

* Fix naming to normalize (drop-down, DropDown)

* Add license header
2016-04-21 15:33:28 -04:00