Commit graph

176 commits

Author SHA1 Message Date
Rachel Fenichel
53d9c6b351 Merge branch 'develop' of https://github.com/google/blockly into feature/pull_upstream_6_01 2016-06-06 11:14:48 -07:00
Rachel Fenichel
06b9bb68e6 Rename knob to handle 2016-05-27 10:25:19 -07:00
Rachel Fenichel
59e065ae5b Merge branch 'develop' of https://github.com/google/blockly into feature/merge_upstream_horizontal_toolbox 2016-05-23 13:07:11 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -07:00
Katelyn Mann
ca16d1fefe An alternate (and less expensive) way to keep stuff outside of the blockly div
from getting selected. Use e.preventDefault instead of adding and removing
classes on mousedown and mouseup.  This keeps the browser from having to
potentially recacluate style on mousedown and mouseup events.
2016-05-04 19:12:38 -07:00
Tim Mickel
5dceb56127 Update padding on blocklyDropDownButton img () 2016-04-27 13:22:07 -04:00
Tim Mickel
357ae3f7f2 Remove extra touch-callout and user-select from blocklyText ()
These were intended for the htmlInput, not the SVG blocklyText. Adding these in was causing the blocklyText element to get selected sometimes in webkit browsers.
2016-04-27 11:56:18 -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
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
Tim Mickel
33a71b112f Implement number and string field specs ()
* 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 ()
* 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 ()
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 ()
* 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 ()
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
rachel-fenichel
a4bdede170 Fix scrollbar positioning and category ordering 2016-04-07 14:02:22 -07:00
rachel-fenichel
9d82bf3a18 lint 2016-04-07 14:02:22 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07: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 , , , , , and  (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 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