Commit Graph

3778 Commits

Author SHA1 Message Date
Rachel Fenichel 48df04eb72 Merge pull request #800 from groklearning/add-allInputsFilled-methods
Adds `allInputsFilled` methods to Block and Workspace.
2017-01-16 15:33:21 -08:00
Tim Dawborn 69df716ef5 Fixes as per code review on PR. 2017-01-16 08:48:11 +11:00
Andrew n marshall 4fdd16b499 JSON support for message lookup in colour, tooltip, and help URL. (#825)
String replacement for the colour, tooltip text and help URL attributes of JSON defined blocks.
Demonstrated in logic_boolean.
2017-01-13 16:54:27 -08:00
Andrew n marshall ac3df2759c PR #818: Adding support for string table lookups in dropdown field labels
Adding support for string table lookups in dropdown field labels specified in JSON.

Adds Blockly.utils.replaceMessageReferences() method to handle string replacement without interpolation tokens.  Effectively uses the same old code, now moved into tokenizeInterpolation_(), which takes a parseInterpolationTokens option.

Replaces the direct JavaScript references (not pure JSON, and thus not portable).

Demonstrating this behavior in the logic_boolean dropdown.
2017-01-11 15:47:56 -08:00
Neil Fraser bea74dbbe3 Fix undo/redo for FieldCheckbox
Thanks to PR #813 by ademenev
2017-01-10 22:18:37 -08:00
Neil Fraser c68684dda6 Expand stack-drag modifier key to include alt and ctrl. 2017-01-09 22:55:17 -08:00
Rachel Fenichel 37a4e8ece2 Merge pull request #807 from rachel-fenichel/bugfix/connect_under_flyout
Don't connect to blocks under the flyout.
2017-01-09 14:21:36 -08:00
Neil Fraser c489ca1fc9 Option for moving one block from stack.
See thread in support group before merging.
2017-01-07 23:56:09 -08:00
Rachel Fenichel a0e6d4bbb5 Don't connect to blocks under the flyout. 2017-01-05 16:06:15 -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
Rachel Fenichel 3cd62050a2 Merge pull request #802 from rachel-fenichel/bugfix/field_undo
Fix two event bugs on fields
2017-01-05 13:14:20 -08:00
picklesrus 9f3e15cd82 Move createDom call into the constructor of block drag surface. (#790) 2017-01-04 17:02:06 -08:00
Rachel Fenichel 12ffc655b8 Merge pull request #803 from rachel-fenichel/bugfix/xml_function_rename
Init procedure blocks with empty name, and set default name in xml in…
2017-01-04 13:22:41 -08:00
Rachel Fenichel 158df44a94 Init procedure blocks with empty name, and set default name in xml in Blockly.Procedures.flyoutCategory 2017-01-03 18:41:28 -08:00
Rachel Fenichel 528ea86cbf Check if the text has changed before firing an event 2017-01-03 14:58:05 -08:00
Rachel Fenichel 056824593e Now that text input's setText skips setValue, it needs to explicitly create a change event 2017-01-03 14:51:28 -08:00
picklesrus eb64921da5 Fix #794 and make the workspace grid drag along with the workspace. (#801)
There was some IE specific code that also applies to Edge so just updated
a conditional to include Edge.
2017-01-03 14:36:31 -08:00
Rachel Fenichel 20cf6abb5f End event groups when you finish editing a field 2017-01-03 14:09:41 -08:00
picklesrus 91938c3fb8 Use the drag surface when scrolling using the scrollbars. #783 (#789) 2017-01-03 10:02:28 -08:00
Tim Dawborn f9e0552c11 Add an allInputsConnected method to Block and Workspace to test whether all trees in the block forest have their inputs filled. An optional argument controls whether or not shadow blocks are counted as being filled. Recommitting changes off develop instead of master as per discussion in PR #791. 2016-12-28 12:26:53 +11:00
picklesrus 6aee3ed2da Fixes #786 by checking if getComputedStyle is null in is3dSupported. We do not cache the value in this case and try again later. is3dSupported is only called while users are interacting with blockly which they cannot do while hidden so the performance implications of running the check again are minimal. (#787) 2016-12-16 09:52:19 -08:00
Rachel Fenichel 6b39c7d646 Merge pull request #782 from rachel-fenichel/feature/flyout_disable_resize
Disable workspace resizing while loading the flyout from XML
2016-12-15 11:15:39 -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
Rachel Fenichel f54f229bc2 Disable workspace resizing while loading the flyout from XML 2016-12-14 17:06:09 -08:00
picklesrus 5b6f1debeb Move the call to disable resize before placeNewBlock so that it is of… (#777)
* Move the call to disable resize before placeNewBlock so that it is off when workspace resizeContents
gets triggered by placeNewBlock.  This fixes a bug in rtl mode where the workspace was being resized
between when the block was added to the workspace and when it was moved to the proper location.
2016-12-14 14:57:32 -08:00
Rachel Fenichel 22b018321c update generator comments 2016-12-09 22:10:36 -08:00
Rachel Fenichel 33d6f72b29 Merge pull request #650 from trodi/generator-docs
Add Generator functions to prototype + JSDoc
2016-12-09 17:46:47 -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
Rodrigo Queiro 8384f8fe05 Make zoom speed independent of event granularity
Before, touchpads would give "smoother" scrolling by delivering lots of
mousewheel events with small distance changes. Because the code only
looked at the sign of deltaY, ten 5px scrolls would zoom 10x more than
one 50px scroll.

This change makes zooming with a touchpad more like zooming with a
mousewheel. On my laptop, a full-scale zoom (fully out to fully in) was
about a 5mm finger movement before, and is now about 3cm.

Fixes #758.
2016-12-09 11:12:28 +01:00
Rachel Fenichel 25ca1bccff Merge pull request #767 from rachel-fenichel/feature/register_button_callbacks_on_workspace
Associate flyout button callbacks directly with workspaces
2016-12-08 14:11:18 -08:00
Rachel Fenichel 086fd720b2 Associate flyout button callbacks directly with workspaces 2016-12-08 13:05:19 -08:00
Neil Fraser 5b86b9792d Don't get Toolbox element unless needed. 2016-12-07 00:22:46 -08:00
Rachel Fenichel 885490b835 Merge pull request #761 from rachel-fenichel/feature/label_classes_2
Add classes to labels with web-style attribute in xml
2016-12-05 15:16:57 -08:00
Rachel Fenichel 729c442c31 lint 2016-12-05 15:14:02 -08:00
Neil Fraser 97644fdf04 Improve comments. 2016-12-03 06:34:18 -08:00
Rachel Fenichel 7f4efe4ebe createSvgElement is now in utils. fix two calls. 2016-12-02 14:12:34 -08:00
Rachel Fenichel 7b783dc30a change 'class' to 'web-style' 2016-12-02 14:08:50 -08:00
Rachel Fenichel 1bac79791e console.log -> console.warn 2016-12-02 14:04:02 -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
Neil Fraser ac0105cb4d Set the text not the value when closing a text editor.
Also rename variables for clarity.
2016-11-24 10:39:13 -08:00
Neil Fraser 065e801a08 When user edits text in a field, set text, not value.
Existing text-editable fields don’t care (dropdown care, but are not
text-editable).  But a note picker needs to set its value to 60 if text
is set to ‘C4’.
2016-11-24 07:29:39 -08:00
Neil Fraser a66d274169 Fix broken highlighting when highlighted block is deleted. Issue 752. 2016-11-21 01:18:28 -08:00
Neil Fraser 4cda20dbbf Fix speling. 2016-11-19 02:40:11 -08:00
Neil Fraser fbd9276e9c Lint 2016-11-18 20:26:56 -08:00
Neil Fraser 0e9651ee88 Fix conflict between 'utils' and 'image dropdown' merges. 2016-11-16 17:56:25 -08:00
Neil Fraser 8fba5cd044 Fix selection border on blocks that have been highlighted. 2016-11-15 17:49:51 -08:00
Neil Fraser c27841f8df Fix compiler errors. 2016-11-15 16:41:11 -08:00
Andrew n marshall e5d25bb686 String reference in JSON string messages (#741)
* Adds message references to message string interpolation, in the form of %{BKY_STRING}.
 * Re-adding CONTROLS_IFELSE block using the new syntax, referencing to CONTROL_IF equivalents.
2016-11-15 15:51:51 -08:00
Neil Fraser f6aef459fc API-breaking cleanup. But doubtful anyone will be affected. (#748)
* Make add/removeClass return whether they did anything.
* Move more functions onto utils.
* Move bind functions to Blockly.
* Routine recompile.
2016-11-15 13:54:33 -08:00