Commit graph

115 commits

Author SHA1 Message Date
Andrew Sliwinski
be9d5fefed Merge from Upstream Blockly (#776)
* 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
Tim Mickel
1578d3ab10
Add default font family in toolbox 2016-11-14 13:05:48 -05:00
Rachel Fenichel
844b7771e2 Merge branch 'develop' of https://github.com/google/blockly into feature/merge_nov_1 2016-11-01 18:00:26 -07:00
Rachel Fenichel
afca4264ca Add option to style flyout buttons as labels 2016-10-31 15:20:16 -07:00
Tim Mickel
1a3ec368e6 Tweaks to Scratch-style toolbox styling (#669)
* Minor style tweaks to toolbox

* Category ordering to match Blockly XML
2016-10-07 15:36:21 -04:00
Rachel Fenichel
2402ca4563 Merge pull request #667 from rachel-fenichel/feature/multitouch_and_toolbox
Scratch-style toolbox WIP
2016-10-07 10:18:49 -07:00
Tim Mickel
d65c274652 Text+drop-downs and number+drop-downs (#662)
* Don't force text-centering around FIELD_WIDTH if arrow present

* Add dark arrow asset

* Refactor FieldNumber restrictor generator to be static

* Allow disabling of FieldDropDown colour changing

* Add FieldTextDropDown and FieldNumberDropDown

* Add number drop-downs to list blocks

* Add docs

* Update `setArgType` -> `addArgType`

* Ensure arrow only created once

* Update list index min

* Refactor shared components of num restriction

* Line breaks

* Clear touch identifier

* Clear touch identifier when text drop-down closed

* Inheritance simplification
2016-10-05 17:14:33 -04:00
Tim Mickel
2029a0c12a Tweaks to bring drop-downs rendering to spec (#659)
* Render drop-downs with graphical arrow

* Darken menus on click
2016-10-04 17:42:21 -04:00
Rachel Fenichel
aea601960d Merge branch 'feature/scratch-toolbox' into feature/multitouch_and_toolbox 2016-10-04 14:40:10 -07:00
Tim Mickel
b14a80738f Set checkboxes in drop-downs to scroll with menu (#632)
* Set checkboxes in drop-downs to scroll with menu

* Fix RTL support
2016-09-30 13:33:20 -04:00
Tim Mickel
a6f34ae519 Merge google/develop, recompile (#617)
* Check result of window.confirm before deleting variables.

* Create CONTRIBUTING.md

* Localisation updates from https://translatewiki.net.

* Cherrypick fixes made directly to master back into develop (#619)

* Check result of window.confirm before deleting variables.

* Create CONTRIBUTING.md

* rebuild

* Localisation updates from https://translatewiki.net.

* Minor wording change.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Simplify the handling of the active desc for a toolbox without categories.

* Remove tables from the HTML. Move the toolbar buttons to the end so that they don't impede switching between the toolbox and workspace.

* When cutting or copying a block, do not include blocks joined to it.

* Add shadow to flyout buttons.

* Move 'create new group' button to the bottom of each toolbox block, and remove other buttons if there is nothing in the workspace.

* Add keyboard shortcuts for cut, copy and paste operations.

* Remove clipboard buttons to simplify UI.

* Prevent setting a number value to NaN. Select the field value on entry to an input field. State the contents of the input field when describing the field.

* Add aria-level and aria-selected attrs to dropdowns.

* routine recompile

* Update demo to latest interpreter.

* Move 'move to marked spot' button to the top of the block options list.

* Fix incorrect aria-levels in toolbox tree component.

* Add new fields to toolbarButtonConfig.

* Recompile

* Remove CONTRIBUTING
2016-09-22 16:39:52 -04:00
Neil Fraser
5cdb843f3e Update demo to latest interpreter. 2016-09-20 12:52:22 -07:00
Tim Mickel
b2c84cb802 Import procedures from Blockly (#595)
* Import procedures from Blockly

* Give mutators the dragSurface

* Draw a box behind non-shadow text fields

* ifreturn -> report

* Non-reporting proc -> next; reporting -> statement. Remove mutator for statement.

* Remove align_right in call

* Lints

* procedures_defnoreturn outputShape

* Revert rect CSS for event blocks
2016-09-16 18:29:15 -04:00
Neil Fraser
bc2bfbd53d Add shadow to flyout buttons. 2016-09-15 18:39:50 -07:00
Rachel Fenichel
5232f8f1bf Get rid of reflow since scratch-style toolboxes are fixed size. 2016-09-08 16:54:10 -07:00
Rachel Fenichel
79013d14fb First pass at scratch-style category menu 2016-08-26 18:29:34 -07:00
rachel-fenichel
1f9a92ff9f Merge pull request #570 from rachel-fenichel/feature/variable_management
Merge from google develop plus variable features.
2016-08-16 14:54:08 -07:00
Tim Mickel
340818dd4b Use sans-serif fonts in valueReportBox (#568) 2016-08-15 10:32:58 -04:00
Rachel Fenichel
4b5d4d4c26 Merge branch 'feature/variable_management' of https://github.com/google/blockly into feature/variable_management 2016-08-12 15:52:48 -07:00
Rachel Fenichel
c6ff049c92 Merge branch 'develop' into feature/variable_management 2016-08-12 14:39:32 -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
Jean-Michel DECORET
927cabe992 Develop - Modals support (#512)
* * apply bootstrap3 integration fixes

* Injection subcontainer

Include svg and div into a master container, which allow css better
positioning (overflow scrolling problem)

* * Fix toolbox positioning (rtl and ltr). Because toolbox if relative to injection div, only adjust it to left (ltr) or right (rtl) edge

* * fix style (thanks to @NeilFraser)

* * revert msg files
2016-07-30 20:36:35 -07:00
Tim Mickel
b4826b4065 Draw squares for non-droppable dropdown fields (#551) 2016-07-27 16:29:02 -04:00
Tim Mickel
3f3862a5a8 Various tweaks to shape and size (#544)
* Align text by consistent baseline

* Helvetica

* CORNER_RADIUS in grid units

* Separate MIN_BLOCK_X for reporters from single-field shadows

* Update Blockly.BlockSvg.FIELD_WIDTH

* Remove padding on htmlInput

* Also apply border-radius to htmlInput_ to avoid weird edge effect in Chrome

* Update MIN_BLOCK_X to spec

* Fix horizontal sizing of blocks to include right corner.

* Add EDITABLE_FIELD_PADDING

This gives extra width to editable text fields.

* Add correct height for reporters

* Fix INLINE_PADDING_Y and reporter sizing to spec

* Remove unused case for input.renderWidth

* Instrument vertical rendering with right/left row padding.

* Revert renderWidth change

* Fix calculation of input shape widths

* Output padding to spec, fixing #376

* Update horizontal FIELD_TOP_PADDING for new dominant baseline

* Update padding language to be LTR/RTL neutral

* Remove broken RTL SEP_SPACE_X from input shape drawing
2016-07-26 11:52:05 -04:00
Tim Mickel
76e42b1690 Also inherit border-color on .arrowTop and .arrowBottom (#538) 2016-07-15 11:51:42 -04:00
Rachel Fenichel
18be9d1de8 Merge branch 'feature/variable_management' of https://github.com/google/blockly into feature/variable_management 2016-07-13 14:36:35 -07:00
Airhogs777
b494a0365e make blocklyDropDownArrow inherit background-color and border-color (#502) 2016-07-10 10:56:47 -04:00
Tim Mickel
51f38c0c95 Add basic value reporting that uses drop-down (#492)
* Add basic value reporting that uses drop-down

* Encode HTML entities for value reporting
2016-07-07 18:35:41 -04:00
Rachel Fenichel
cb3bef8f32 Flyout button with click handler 2016-07-07 14:37:12 -07:00
Tim Mickel
e8de0c46bf Only use "grabby" cursors when dragging (#498) 2016-07-07 15:53:50 -04:00
Tim Mickel
dd7f338c40 Temporary fix for page-breaking drop-downs (#495) 2016-07-07 13:48:37 -04:00
Tim Mickel
179b75da59 Basic fixes for FieldColour (#482)
* Fix field_colour's borderRect_ problem

* Use actual width and height instead of NBSPs

* Get corner radius from BlockSvg

* Improve colour picker CSS to not have borders
2016-07-06 20:38:05 -04:00
Tim Mickel
6b972ae7c8 Fix disabled menu style #474 (#477)
There was a missing comma in CSS
2016-07-06 15:56:39 -04:00
Rachel Fenichel
6539a634b6 Fix lots of small things in flyout.js 2016-06-24 14:32:58 -07:00
Rachel Fenichel
9fa9fd93c6 Merge branch 'develop' into feature/checkboxes_in_flyout 2016-06-23 16:14:41 -07:00
Tim Mickel
051921e1a0 Fix up vertical text field editor (#415)
* Move animated FONTSIZE properties to horizontal/vertical-specific rendering

* Set FIELD_WIDTH_MAX_EDIT in vertical until we fix truncation problem

* Conditional animation/truncation of field_textinputs

* Tinker with constants to get things in the right position

* Adjust FIELD_WIDTH_MAX_EDIT

* Prefix FONTSIZE_INITIAL and FONTSIZE_FINAL

* Fix no-op
2016-06-15 18:08:32 -04:00
Tim Mickel
25e80c2d09 Straw-man implementation of text drop-downs (#407)
* 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
Tim Mickel
85578d8c7c Color fixes for text drop-down menus (#403)
* Add class for drop-down text colour; remove arrow special case

* Use secondary colours in drop-down blocks

* Add comment about updateTextNode_ resetting the class
2016-06-13 19:06:12 -04:00
Rachel Fenichel
4139656a7a first pass at checkboxes in the flyout 2016-06-09 14:00:40 -07:00
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 (#303) 2016-04-27 13:22:07 -04:00
Tim Mickel
357ae3f7f2 Remove extra touch-callout and user-select from blocklyText (#296)
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 (#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