Commit graph

1611 commits

Author SHA1 Message Date
Tim Mickel
069cc81871 Feature/colors july 15 (#537)
* Colours July 15, based on updated spec

* Recompile July 15
2016-07-15 11:42:52 -04:00
rachel-fenichel
98d73d1b4c Remove to javascript button from playgrounds (#534) 2016-07-14 16:30:14 -04:00
Tim Mickel
32fd019e08 Recompile July 14 (#517) 2016-07-14 11:20:51 -04:00
joaoh1
b9b8284c5d Make Red the Color Placeholder (#516) 2016-07-14 11:16:23 -04:00
Tim Mickel
eb1ddddbb0 Fix angleValidator reference and lint @this (#515) 2016-07-13 14:25:32 -04:00
rachel-fenichel
e25456edb4 Merge pull request #514 from rachel-fenichel/bugfix/merge_problems
Fix connection disposal and get rid of startFlyout_
2016-07-13 10:51:16 -07:00
Rachel Fenichel
df1b765384 Create block differently from autoclosing flyout 2016-07-12 15:34:20 -07:00
Rachel Fenichel
3202fcbd0c Fix connection disposal and get rid of startFlyout_ 2016-07-12 15:15:35 -07:00
Tim Mickel
b7c7cbd20f Add math_integer block and use it in go back _ layers (#513) 2016-07-12 14:33:26 -04:00
Tim Mickel
d3ea97cecc Flip vertical toolbox XML category order (#511) 2016-07-12 11:25:24 -04:00
rachel-fenichel
52244856c6 Merge pull request #510 from rachel-fenichel/feature/pull_google/7_11
Merge from upstream
2016-07-11 16:13:49 -07:00
Rachel Fenichel
8e652db9fe Merge branch 'develop' of https://github.com/google/blockly into feature/pull_google/7_11 2016-07-11 15:53:14 -07:00
Tim Mickel
d80b588a4a Fix angle picker: use drop-down div, Scratch-style direction (#493)
* Scratch-style FieldAngle, use DropDownDiv

* Use FieldAngle for pointindirection

* Fix FieldNumber JSON args

* Convert all math blocks to JSON

* Line length in field_angle

* Remove automatic injection of angleValidator
2016-07-11 16:57:04 -04:00
Tim Mickel
c92504fd98 Update block usages in simple flyout demo (#507) 2016-07-11 14:55:12 -04:00
Tim Mickel
30880a085c Browser consistency for keycode special events (#506)
* Browser consistency for keycode special events

* Fix whitelisting max

* Update comments and charCode=127
2016-07-11 14:46:02 -04:00
Tim Mickel
37dcd9b045 Blocks lint and licenses (#505) 2016-07-11 11:00:33 -04:00
Neil Fraser
efc2ca3d82 Add field_number to Block Factory. 2016-07-10 22:54:57 -07:00
joaoh1
76c4819c0a Add all Remaining Looks Blocks (#501)
* Add more Looks Blocks

* Update Playground

* Add Backdrop Exclusive Blocks
2016-07-10 10:58:15 -04:00
Airhogs777
b494a0365e make blocklyDropDownArrow inherit background-color and border-color (#502) 2016-07-10 10:56:47 -04:00
Neil Fraser
e1ad58f2e9 Fix highlight being eclipsed by other blocks. 2016-07-09 11:46:54 -07:00
Neil Fraser
5ea49cdf4e Change tooltips on get/set list blocks to be 0/1 index aware. All languages. 2016-07-09 04:23:01 -07:00
Neil Fraser
b324efaa86 Change tooltip on text/list indexOf blocks to be 0/1 index aware. All languages.
Delete ta:TEXT_INDEXOF_TOOLTIP since that text does not appear to make
sense.
2016-07-08 18:58:28 -07:00
Neil Fraser
b51547826d Remove AUTH, CHAT, ME messages in all languages. 2016-07-08 17:26:13 -07:00
Neil Fraser
7ed413d4d3 Merge branch 'master' into develop 2016-07-08 17:08:10 -07:00
zgtm
f6532059ba Complete revision of German translation (#421)
* Provide sensible and consistent German translation

* Decapitalise beginning of blocks in German, according to https://developers.google.com/blockly/guides/modify-blockly/contributing

* Rename German variable default name

* Remove 'true' and 'false' in German translation

* Replace 'Wert' with 'Zahl' for 'number' in German translation

* Make tooltips consistent in German translation

* More fine-tuning on tooltips in German translation

* Small details in German translation

* Changes from https://github.com/google/blockly/pull/421#issuecomment-226649183 / https://reviewable.io/reviews/google/blockly/421#- , rename Block as Baustein everywhere in German translation

* German translation: Change "wenn" to "falls" for do-conditions

* German translation: Change "wenn" to "falls" for value-conditions

* German translation: Update de.js from de.json
2016-07-08 17:00:37 -07:00
Neil Fraser
471f620c29 Routine recompile. 2016-07-08 16:53:42 -07:00
Neil Fraser
e849c93db9 Merge branch 'master' into develop 2016-07-08 16:52:18 -07:00
Neil Fraser
57390fd744 Stop new 'do procedure' defs from renaming existing callers. 2016-07-08 16:41:06 -07:00
Neil Fraser
2dab19c015 Ensure that if a procedure call exists, so does its definition.
Specifically, if a call is copied, then the def is deleted, then the
call is pasted, the def should be created.
2016-07-08 15:50:09 -07:00
Monica Kozbial
2b191e897e Adding indexing settings, tests and fixing bugs (#464)
* Add indexing setting for JavaScript Generation

Adding setting to allow for switching between zero and one based indexing for Blockly Blocks such that the generated code will use this flag to determine whether one based or zero based indexing should be used. One based indexing is enabled by default.

* Updating js lists to do zero and one based index

Updated generated JavaScript to change depending on whether one based indexing is enabled or not.

* Updating js text to do zero and one based index

Change so that JavaScript generated for text blocks either assumes blocks use zero or one based index based on setting.

* Start of python indexing

Start of work on allowing one and zero indexing for generated python for lists.

* Fixing bug and lint fixed

Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing

* Converting from if to switch statements

Comverting if statements to switch statements when appropriate and adding spacing.

* Modified sublist JavaScript generation

Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create).

* Stripping unecessary ids

Removing ids from xml file.

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

* Fix typo in flyout.js (#403)

* Fix typo in flyout.js (#402)

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

* Add indexing setting for JavaScript Generation

Adding setting to allow for switching between zero and one based indexing for Blockly Blocks such that the generated code will use this flag to determine whether one based or zero based indexing should be used. One based indexing is enabled by default.

* Updating js lists to do zero and one based index

Updated generated JavaScript to change depending on whether one based indexing is enabled or not.

* Updating js text to do zero and one based index

Change so that JavaScript generated for text blocks either assumes blocks use zero or one based index based on setting.

* Fixing bug and lint fixed

Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing

* Converting from if to switch statements

Comverting if statements to switch statements when appropriate and adding spacing.

* Modified sublist JavaScript generation

Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create).

* Stripping unecessary ids

Removing ids from xml file.

* Updating generator test

Modifying sublist test and re-formatting spacing between blocks.

* Updating js lists to do zero and one based index

Updated generated JavaScript to change depending on whether one based indexing is enabled or not.

* Updating js text to do zero and one based index

Change so that JavaScript generated for text blocks either assumes blocks use zero or one based index based on setting.

* Fixing bug and lint fixed

Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing

* Converting from if to switch statements

Comverting if statements to switch statements when appropriate and adding spacing.

* Modified sublist JavaScript generation

Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create).

* Stripping unecessary ids

Removing ids from xml file.

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

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

* Updating js lists to do zero and one based index

Updated generated JavaScript to change depending on whether one based indexing is enabled or not.

* Fixing bug and lint fixed

Fixing bug caused by not setting the return of concat when concatenating lines for sublist and substring functions. Also renamed these functions to be getSubsequece. Fixed lint errors with spacing

* Modified sublist JavaScript generation

Added case so that helper function is not generated if not necessary. Helper function is not generated if list length is not needed or if list is a simple block (such as a variable, as oppossed to a function call or list create).

* Stripping unecessary ids

Removing ids from xml file.

* Updating generator test

Modifying sublist test and re-formatting spacing between blocks.

* Adding tests for indexing and extra cases

Adding tests for indexing with custom block to adjust number based on what indexing is being generated.

* Adding tests and renaming tests

Adding tests for sublist and renaming tests.

* Fixes for order for sublists

Fixes so that parenthesis are generated properly for index for sublist

* Cleaning up test generated code

Changing order returned for unit test adjust index function to generate less unecessary parenthesis.

* Adding tests for order

Adding tests for order, relevant for methods that use index from start (because 1 is added)

* Fixing JS order for getIndex and setIndex

Changing to the correct order type when calling valueToCode in JS generation for getIndex and setIndex.

* Fixed unittest adjustIndex

Fixed uninttest adjustindex to also check whether the ONE_BASED_INDEXING variable has been defined to ensure proper behaviour.

* Fixing lint and formatting for JS/lists

Making line fixes and changing an if/elseif to case statement.

* Tests added to include case for bug found

Added tests with sublist combinations of different where's for the two indices after bug for this found in python.

* Adding and renaming tests

Adding test case for creating a sublist that encompasses the whole list but uses # and #-end instead of first last (applicable for python). Also, renaming tests.

* Adding contant and fixing python lists bugs

Adding contant for ONE_BASED_INDEXING and fixing bugs in python for lists.

* Fixing test get random

Fixing test get random to take into account indexing for return value.

* Adding indexing checkbox to test page

Adding checkbos on test page so that code can be generated for one and zero based indexing. Languages that are generated with zero based indexing that do not have it implemented will fail tests as expected.

* Fixing unittest getremove random

Fixing unittest getremove random to take into account the return value based on indexing.

* Change comparison for getremove random test

Fixed comparison to equal for the return value for getremove random.

* Fixing bugs with lists zero-indexing

Fixing getIndex and getSublist methods to pass for zero-indexed tests.

* Adding test cases and formatting

Adding test cases to text tests, reordering a couple list test, and formatting block spacing.

* Fixing unittest expected value

Fixing expected value fore unit tests for sublist.

* Cleanup

Removing obvious comments, formatting fixes, and naming in generated code in JS.

* Helper function for Python lists

Adding helper function for casting to int for indices.

* Expanding helper to reduce duplicated code

Expanding helper method to also get the property with the correct order and check indexing to reduce duplicated code.

* Cleaning up JS indexing with helper function

Adding helper function for indexing and used it in lists and text.

* Moving helper function and formatting fixes

Moving helper function, formatting fixes, and changing some generated code variable names.

* Fixing python generation for text

Fixing all failinng tests for python and using new helper method.

* Lint fixes and order in indexOf

Making lint fixes and correcting returned order in indexOf.

* Python variable renaming

Renaming a few generated variables.

* Fixing comment and order

Fixing comment to list Blockly.Block type and fixing order because it could be higher.

* Switching back to if

Switching switch back to if statements because there weren't enough cases to warrant for a switch.

* Adding order and fixing lists for Dart

Adding if null operator to operator precedence for Dart. Also, fixing lists implementation to pass unit tests and adding zero-indexing functionality.

* Formatting and lint fixes

Formatting and lint fixes

* Dart text fixed

Fixing Dart text generation to pass unit tests.

* Changing back  to variable

Changing switch condition back to variable.

* Fixing ORDER_OVERRIDES

Inner and outer order was switched .

* Adding bug with order caused by generator change

Flooring order before comparision because of how the order constants were modified.

* Adding list tests

Adding tests for additional cases for lists/

* Adding comment for dart order

Adding comment for Dart ORDER_IF_NULL operator.

* Formatting fixes

Formatting fixes for line indentation.

* Fixing PHP order and lists generation

Fixing PHP order constants and fixing lists so that they pass unit tests.

* Fixing tests

Removing duplicate unit test

* Adding text tests

Adding tests for text.

* Renaming variable and removing unused variable

Renaming variables from exceptionIndex to errorIndex and removing unused at variable.

* Adding missing function call to test

Adding missing funciton call to test that was causing tests to fail when they shouldn't.

* Fixing PHP text generation

Fixing PHP text code generation so it passes unit tests.

* Formatting fixes

Cleaning up code, renamiing a variable.

* Fixing failing subsequence tests

Fixing JS code that failed for sublist/substring tests.

* Fixing intentation

Fixing indentation.

* Fixing Dart sublist/substring

Fixing sublist/substring to include condiiton where FROM_START  (and not throw error by mistake) when zero-indexed.

* Adding order subtraction test

Adding test for checking order for subtraction x- (y - z) x  - (y + z).

* Updating to new PHP power operator

Updating from pow function to ** operator to clean up code.

* Updating to new removeWhere

Updating removeMatching to removeWhere because new version of Dart now use removeWhere.

* Fix for lua rounding assertequals

Adding check for number in equlity check for comparing number for floats.

* Adding test for copy of list

Adding test that checks the list is copied when a sublist is made first-last.

* Formatting and order fixes

Fixing formatting such as indentation and order fixes.

* Adding comment for clarity

Adding comment about how Lua code generation is not supporting zero indexing.

* Changed variable names in code

Changed variable names to follow style guide and changed for loop variable from n to i as is typical.

* Reducing unecessarily generated functions and renaming variables

Reducing number of generated functions using gensym_ by adding parameters to provided function. Renaming variables to make functions more readble.

* Fixing sublist order and sort variable

Fixing order used for valueToCode for sublist and renaming list variable in sort to match rest of code..

* Fixing order constant order

Removing operator () that was incorrect and addiung ~,

* Fixing order and indentation

Fixing order return fro create lists blocks and fixing indentationn for string array.

* Fixing order and renaming variables

Fixing order to be the correct strength and renaming variables to be more readable/

* Changing assert blocks for unit tests

Changing assert blocks to have a value input instead of a field so there is more flexibility in writing tests.

* Cleaning up and adding missing order tests

Adding tests for order for paramters for list blocks that weren't being tested to uncover bugs. Test were also cleaned up/reorganized/renamed to be more readable and shorter vertically (but lines  wider horizontally).

* Compile error fix and order in Dart generation.

Fixing compile error in generated code and incorrect order in get sublist for Dart.

* Fixing typo in getIndex and invalid parameter name

Fixing type in getIndex where list code should have been appended but instead an undefined variable was added. The parameter in lists_sort was changed to my_list because list is a reserved word in python.

* Fixing order, parenthesis bug, and variable declaration in Lua

Fixing incorrect order in Lua. Fixing bug caused by missing parenthesis around ternary operator in code. Variable code was declared with JavaScript syntax, this was fixed to be valid in Lua.

* Adding tests and formatting tests

Adding missing test for order in text/lists. Changing spacing/order of tests and updating comments.

* Fixing error in code

Changing to correct function call in empy tests and changing test name that was duplicated to be more clear.

* Renamed test helper function

* Fixing order and renaming variable in JS generator

Fixing order for charAt and renaming variable in code list_sort from listCode to list to be consistent with rest of code.

* Fixing order for dart text

Fixing roder for dart charAt

* Cleaning up generated code for Dart getIndex

Cleaning up generated code for Dart getIndex so that helper functions aren't generated unecessarily and adding comments.

* Fixing Dart remove random error

Fixing error caused by remove random implementation in Dart. index should have been x but instead was length - x.

* Fixing unit test blocks

Fixing Lua unit test block that should have just returned the number and removing unecessary checks in other blocks because the constant was defined.

* Fixing Lua assert equals block

string.format was throwing an error if one of the values happened to be a boolean.

* Adding tests for create text with number

Adding test for create text with numbers as parameters

* Fixing lua unit test block

Lua unit test block should have added 1

* Removing indexing setting for Lua tests

Removing setting index setting for Lua generation because it is always one-indexed.

* Fixing order and create text

Fixing failing test caused by improper order and fixed create text to properly convert to string when there is one element.

* Running linter on generator code

Running linter on generator code and fixing spacing/indentation problems.

* Editing comments and removing uneeded parenthesis

Editing and adding comments and removing uneeded parenthesis around ternary operator condition.

* Fixing order and changing variable names

Fixing orders that were incorrect and changing variable names to be more descriptive and consistent across code.

* Adding comment about list support and fixes for PHP

Adding comment about how lists are not fully supported for PHP. Adding missing order to PHP and fixing order errors throughout. Fixing regex for variable matching in lists. Cleaning up variable names to be more readable and consistent with other parts of code.

* Reducing complexity for getremove/remove in JS

Reducing complexity in generated code for getremove/remove in JavaScript by replacing unecessary helper function.

* Fixing spacing before inline comments

Ensuring there are two spaces before inline comments.

* Changing JS list copy for clarity

Changing JavaScript list copy to use slice(0) instead of concat for clarity and to use the same pattern as the other sublist methods.

* Changing generated variable name tmp_x

Changing tmp_x to tmpX to follow closer to the correct style for JavaScript.

* Prefixing empy lines between comment text

Prior to this change, comments with an empty line between text did not have a comment prefix before it, resulting in comment blocks that seemed disjoined although they were for the same block. This change affects how the prefix line function works so that those lines will have the prefix (if applicable) while still taking into account the trailing newline character.

* Changing for loops variable names

Changing most for loops to use i as the variable name (or j if applicable) or changing name to be more readable.

* Simplifying provided subsequence function

Simplifying subsequence function to generate a simpler function depending on where combination instead of a larger complex function that works for all where combinations.

* Style fixes

Fixing indentation, comments, and other formatting-type changes based on pull request comments.

* Fixing indentation

Fixing indentation and removing an extra newline.

* Fixing PHP mode implementation

Fixing PHP mode implementation to properlyu return multiple modes if applicable.

* Fixing line too long

Wrapping lines in php/math.js with lines longer than 80 characters.

* Wrapping long lines

Wrapping lines that are too long.

* Changing boolean casing

Changing boolean casing to be lowercase.
2016-07-08 11:43:48 -07:00
joaoh1
6059460a60 Add the remaining Event blocks (#499)
* Complete Event Category

* Fix id
2016-07-08 08:48:01 -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
Tim Mickel
0269873d38 Remove block-clicking hack put in for Google I/O demo (#494) 2016-07-07 18:35:24 -04:00
Tim Mickel
e8de0c46bf Only use "grabby" cursors when dragging (#498) 2016-07-07 15:53:50 -04:00
joaoh1
5bf6358ff7 Added Variable Blocks (#496)
* Added Variables

* Fixed somethings

* Fixed More things

* Fixed again -_-
2016-07-07 15:49:25 -04:00
rachel-fenichel
603477d188 Merge pull request #417 from drigz/bugfix/flyout-clicks
Revise handling of mouse events on flyout blocks
2016-07-07 11:22:01 -07:00
Tim Mickel
dd7f338c40 Temporary fix for page-breaking drop-downs (#495) 2016-07-07 13:48:37 -04:00
rachel-fenichel
91a5f3182b Merge pull request #348 from drigz/bugfix/events-after-exception
Re-enable events even when an exception is thrown
2016-07-07 10:44:26 -07:00
Tim Mickel
8f35b67ba1 Use random colour from Blockly generator (#491) 2016-07-07 11:45:34 -04:00
Tim Mickel
320cc21434 Set default colour for colour picker to random (#490) 2016-07-07 11:43:20 -04:00
Tim Mickel
b299a90178 Set FieldColour's color on the source block (#489) 2016-07-07 11:25:25 -04:00
Tim Mickel
c51241f38f Use multiple messages in control JSON instead of explicit dummys (#488) 2016-07-07 11:14:53 -04:00
Tim Mickel
2ebf725f1e A few style fixes for sensing blocks (#487)
* Add question marks to some sensing messages

* Trailing comma in sensing.js

* Indentation of some sensing blocks in playground
2016-07-07 11:06:42 -04:00
Tim Mickel
1b3686e1b4 BUMP_DELAY = 0 (#481) 2016-07-07 10:57:43 -04:00
joaoh1
33a4ad88a4 Added Sensing Blocks (#486) 2016-07-07 10:53:28 -04:00
Niklas Laxström
8fa98030ff Localisation updates from https://translatewiki.net. 2016-07-07 07:42:16 +02:00
Tim Mickel
30180f893e Recompile July 7 (#485) 2016-07-06 21:07:13 -04:00
Tim Mickel
64831db2ae Tiny fixups on toolbox and blocks (#484)
* Block lints and names

* Add "set pen color to color"

* Remove extra color blocks

* Consistent tabbing for toolbox XML

* Order playground categories like 2.0

* Add category colours
2016-07-06 21:04:11 -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
joaoh1
13d730cc14 Add Pen Blocks and Sound Blocks (#475)
* Add Pen Blocks

It excludes "set pen block to [color]" Block

* Include Pen Blocks at Vertical Playground

* Fixed a little thing

* Added Sound Blocks and fixed Fake Drags

* Fixed again the same problem

Accidentaly added again

* Update vertical_playground.html

* Fixed Pen Order

* Update sound.js

* Update sound.js
2016-07-06 19:50:49 -04:00