Commit graph

66 commits

Author SHA1 Message Date
Tim Mickel
50ff6e4654 Implement field_number stub and num-pad on mobile (#293)
* 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
cf6725ba4c Implement drop-down menus and icon picker field (#233)
* 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
Tim Mickel
33a71b112f Implement number and string field specs (#230)
* Animate the font-size of text fields

* Allow WidgetDiv to hide immediately, no animation

And add calls to this where the div animation may become out of sync with the field itself.

* Fix CSS colour substitution to replace all

* Add box-shadow to text field

* Fix padding on blocklyHtmlInput

* Add utility for measuring text using canvas

* Grow the input textbox based on the text size

* Fix the text field width to a maximum depending on render mode

* Fix text input field height for scaling

* Position text input field based width

* Animate out width, height, margin of text input

* Fix scale of marginLeft and extra 1px

* Fix height, padding, font-weight on text input field

* Make input field text smaller on truncation per spec

* Re-apply change to Blockly.WidgetDiv.disposeAnimationTimer_

* Add comment to Blockly.Field.maxDisplayLength
2016-04-15 16:44:30 -04:00
Tim Mickel
62509d41ad Slight refactor of colour handling; add additional properties (#218)
* Add and render opacity of blocks

* Add insertion marker colour and opacity

* Add goog.require for Colours in block.js

* Add color of text field during editing

* Add colour overriding upon injection

* Add colours to CSS at run-time injection

* Expand colour variables to include toolbox, flyout, scrollbars

* Example of dark mode in horizontal_playground

* Fix loop style for colours
2016-04-14 18:04:17 -04:00
Tim Mickel
0336aa0347 Remove width/height from blocklyDragSurface (#214)
This was causing issue on iOS Safari when the SVG was exceeding the size of the window
2016-04-13 17:22:41 -04:00
Tim Mickel
0408c9f695 Bugfix/no cursors on touch (#212)
* Don't switch mouse cursor on mobile

* Add goog.userAgent to require
2016-04-13 16:38:44 -04:00
Tim Mickel
003083ac80 Add width and height to drag layer (#195)
Requiring overflow was causing unnecessary repaints.
2016-04-11 16:16:27 -04:00
Tim Mickel
fa9b710c5a Add !important to blocklyDragSurface overflow
normalize.css in our demo was resetting this property.
2016-04-08 16:10:12 -04:00
Tim Mickel
15ed57e7aa Merge branch 'develop' into feature/drag-surface
# Conflicts:
#	core/block_svg.js
2016-04-08 14:41:45 -04:00
Tim Mickel
382a1f4f82 Keep text-input widget div options to CSS class 2016-04-06 21:01:55 -04:00
Tim Mickel
2fc35e5797 Add comments and CSS style for field refactor 2016-04-05 20:43:54 -04:00
Tim Mickel
154d4e1851 Draw text fields entirely using CSS during edit 2016-04-05 18:36:02 -04:00
Tim Mickel
bc75b84aa8 Resize drag surface using only CSS 2016-04-02 16:24:47 -04:00
Tim Mickel
e8c0346378 Fix positioning of drag surface using relative container 2016-04-01 17:32:01 -04:00
Tim Mickel
081c62f6a1 Add DragSurfaceSvg and associated CSS 2016-04-01 16:32:38 -04:00
Tim Mickel
a65109f423 Merge remote-tracking branch 'Google/master' into google-master-april-1
# Conflicts:
#	blockly_compressed_horizontal.js
#	blockly_uncompressed_vertical.js
#	blocks_compressed.js
#	core/block.js
#	core/block_svg.js
#	core/blockly.js
#	core/connection.js
#	core/field_textinput.js
#	core/workspace_svg.js
#	generators/lua/lists.js
#	generators/lua/text.js
#	msg/js/he.js
#	msg/js/id.js
#	msg/js/sr.js
#	msg/js/zh-hant.js
#	msg/json/en.json
2016-04-01 14:44:46 -04:00
Katelyn Mann
b11bd4fb71 Remove Blockly.removeAllRanges and replace it with calls to add/remove
css to mark text as unselectable instead.  I can't prove this is
significantly faster with numbers since the call to setup the time out
costs ~.1ms and the call when the timer fires is ~.05.  This happens on almost
every mouse event though.  Plus, it seems to remove a flicker of highlighting when
frames are skipped and keeps scrolling via the scrollbar from highlighting.
2016-03-28 10:06:43 -07:00
Tim Mickel
bc41c61022 Text colour to spec 2016-03-01 15:31:00 -05:00
Tim Mickel
a5d563e03e Add workspace colour from spec 2016-03-01 15:31:00 -05:00
Tim Mickel
e6cf4451aa Implement block shapes to latest spec
-Convert most constants in the code to use multiplications of GRID_UNIT (4px). This lets us be consistent with Carl's specs and helps explain the numbers a little better.
-Implement notches using cubic curves instead of arcs. This version matches the spec pretty much exactly. As part of this, remove NOTCH_BASE_HEIGHT which is no longer relevant.
-Slight simplification of renderCompute_ (which calculates metrics).
-Fixed SEP_SPACE_X and SEP_SPACE_Y to be the correct number of grid units. Our blocks before were slightly too small, now they are the right size.
-Implement the correct corner radius, hat/end hat radius.
-Add fixed ICON_WIDTH and ICON_HEIGHT, i.e., always size the icons to 40x40px as according to the spec.
-Add fixed STATEMENT_BLOCK_SPACE to represent the size of the bar above forever/repeat/pants blocks. Previously the code was assuming this was SEP_SPACE_Y, when in fact the spec has it as larger (4 units).
-Add accurate MIN_BLOCK_X and MIN_BLOCK_Y for simpler calculation of minimum bay size.
-Remove some unused SVG paths (INNER_TOP_LEFT_CORNER, INNER_BOTTOM_LEFT_CORNER).
-Remove extra code in getHeightWidth which caused a bug in rendering forever-in-repeat.
-Fix stroke width around the blocks to be 1px, according to spec.

I've checked that everything lines up with Carl's spec images at 8x zoom.

This should implement #69, #70, #71, #72, #74, and #75 (not 73 as we haven't done that input yet).
2016-03-01 15:27:52 -05:00
Tim Mickel
c0974717fb Fully remove .blocklyDragging CSS properties 2016-02-29 17:23:30 -05:00
Tim Mickel
9cfe992b5a Remove block transparency during drag 2016-02-29 16:20:19 -05:00
Ray Schamp
9d82e79e9c Update inputs to match spec 2016-02-23 16:59:53 -05:00
Rachel Fenichel
8f23434703 render toolbox and flyout at start/end in horizontal mode 2016-02-17 11:02:26 -08:00
Ray Schamp
a8d3ca7df3 Merge pull request #46 from thisandagain/feature/rendering
WIP - Horizontal block rendering
2016-02-09 12:07:57 -05:00
Andrew Sliwinski
d4a364e2b5 WIP horizontal block rendering 2016-01-28 20:30:35 -05:00
Rachel Fenichel
1672e28f12 Horizontal toolbox layout and option to enable it. 2016-01-26 12:35:50 -08:00
Andrew Sliwinski
6a708da899 Initial SVG rendering modifications. 2016-01-26 14:57:43 -05:00
Neil Fraser
19263bdd5b Vectorize icons. 2015-12-13 11:06:15 +01:00
Neil Fraser
00ba0acf40 Clean up build file from previous PR. 2015-11-13 21:11:24 -08:00
Neil Fraser
3d2e9b3a17 Move category colours to be on left. 2015-10-14 14:02:09 -07:00
Neil Fraser
59cadcb2d7 Add optional colour tabs on toolbox categories. 2015-10-12 17:30:41 -07:00
Neil Fraser
349146743b Remove dependency on goog.cssom. 2015-09-29 15:40:19 -07:00
Neil Fraser
5b7fec7092 Add zooming feature.
By carloslfu.
2015-08-19 17:21:05 -07:00
Allison Lamm
6070b9473d Update type annotation for Blockly cursor 2015-08-10 14:17:11 -05:00
carlosperate
3cc4c4e141 Contain the height of the field dropdown to the window viewport height. 2015-07-16 22:08:50 +01:00
Neil Fraser
f2c9c89dd3 Darken the flyout scrollbars. 2015-07-15 14:09:19 -07:00
Neil Fraser
6291e98473 Remove scrollbar background UI. 2015-07-14 17:22:35 -07:00
Neil Fraser
e0f90e6e33 Adding more type documentation. 2015-07-13 15:03:22 -07:00
Neil Fraser
b37fb2bf8c Move datepicker CSS out of main codebase. 2015-06-13 16:29:21 -07:00
Neil Fraser
af056f9028 Reduce highlight width by a pixel. 2015-06-03 23:04:28 -07:00
Neil Fraser
6fdab711b2 Fix several RTL bugs. 2015-05-19 12:02:49 -07:00
Neil Fraser
17961f7f58 Support multiple Blockly instances. 2015-04-28 13:51:25 -07:00
Neil Fraser
6d1df4dfb5 Revert "De-singleton Blockly. Part 1."
This reverts commit 3122c8a93f.
2015-04-07 21:01:37 -07:00
Neil Fraser
29976c4c4d Remove outside border from Blockly (issue 92). 2015-04-07 20:27:26 -07:00
Neil Fraser
3122c8a93f De-singleton Blockly. Part 1. 2015-04-06 18:36:53 -07:00
Neil Fraser
e2af14c32f Replace drawn icons with images (issue 45). 2015-03-25 23:58:58 -07:00
Neil Fraser
612b190ef4 Add background grid for snapping. 2015-03-08 12:48:42 -07:00
Paul Kendall
b3b9ef8ce3 Add a new FieldDate input type 2015-02-05 07:29:48 +13:00