Commit Graph

192 Commits

Author SHA1 Message Date
Rachel Fenichel
c381808120 Tests for widget div math. (#1338)
* New widget div functions, used in context menu code

* Make all widget div positioning functions use the same argument order

* Use new widget div functions for fields

* share code for measuring menu size

* Get rid of positionMenu

* Update copyright date

* Rebuild blockly_uncompressed because there's a new require in town

* Test for widget div math
2017-09-22 16:10:47 -07:00
picklesrus
5518873389 Revert "Remove all all instances calling setValue on variable fields with the name instead of the id" (#1296)
* Revert "Create WorkspaceViewport class (#1291)"

This reverts commit 6c00d77c9e.

* Revert "Remove all all instances calling setValue with name. (#1254)"

This reverts commit 8e8b6b27af.
2017-08-28 16:55:44 -07:00
marisaleung
8e8b6b27af Remove all all instances calling setValue with name. (#1254) 2017-08-24 14:34:01 -07:00
Evan W. Patton
e1e94271c4 Implement Blockly.Events.filter in linear time (#1205)
* Implement Blockly.Events.filter in linear time

For large App Inventor projects (order 1k+ blocks, 100+ top-level
blocks), the O(n^2) behavior of Blockly.Event.filter was causing
performance issues when rearranging blocks or pasting from the
backpack. This commit provides a linear merge implementation using a
key that uniquely identifies a block so that multiple events targeting
the same block are merged. This change benefits from O(1) amortized
lookup using an object as a key-value store.

* Add event filter unit tests and fix logic bugs

* Update Blockly.Events.filter unit tests
2017-08-18 14:18:47 -07:00
marisaleung
f3fa660c41 Merge pull request #1236 from marisaleung/develop_changeWorkspaceToPlaygroundWorkspace
Change workspace name to playgroundWorkspace.
2017-08-02 17:16:26 -07:00
marisaleung
103c10eddb Change workspace name to playgroundWorkspace. 2017-08-02 17:03:22 -07:00
Tony Lian
bfa45f136c Change the Lua interpreter (#1246)
Change the Lua interpreter to another one with version 5.3 so that it
would support goto statement which Blockly uses currently
2017-08-01 14:29:55 -07:00
marisaleung
234c53157f Fix Blockly.Procedures.isNameUsed return values.
Add tests for Procedures.isNameUsed() so this bug never happens again.
2017-07-28 12:02:14 -07:00
marisaleung
733d869f8e Add VariableType checks. 2017-07-20 16:47:37 -07:00
marisaleung
15d47840b1 Fire field variable change event with variable value, not name. 2017-06-29 11:24:25 -07:00
marisaleung
3c8e0ebbeb Dropdown Create does not create a missing variable twice. 2017-06-27 16:51:19 -07:00
marisaleung
4a2c95fd1b Revamping mostly gesture tests. 2017-06-22 16:56:28 -07:00
marisaleung
5b1a0ae284 Test Delete Variable Twice. 2017-06-09 16:32:16 -07:00
marisaleung
d852a2b116 In DropdownCreate check for Msg.DELETE_VARIABLE. 2017-06-09 16:22:25 -07:00
marisaleung
c58553b7ba Create utility function for checking variable values. 2017-06-09 15:24:31 -07:00
marisaleung
833c2d0c40 Fire VAR events and test. 2017-06-09 14:42:14 -07:00
marisaleung
e9a480c51f Add VAR events. 2017-06-08 15:15:17 -07:00
marisaleung
0040ff636c Field Variable setValue() looks up variable. 2017-06-06 15:29:28 -07:00
marisaleung
ccf3ad1473 Add BLOCK events and constructor tests. 2017-06-01 12:38:38 -07:00
marisaleung
cd0487e816 Clean up and create test utilities file. 2017-06-01 10:36:01 -07:00
marisaleung
a6f85cec53 Appease eslint: semicolons and such. 2017-05-25 13:44:06 -07:00
marisaleung
dc06872a37 Deserialization variables at top. 2017-05-24 15:29:46 -07:00
marisaleung
ce4a84b3cf Include variables at top of serialization. 2017-05-24 10:53:44 -07:00
marisaleung
e84121690b Merge pull request #1113 from marisaleung/SmallFix
Small fix
2017-05-23 11:40:39 -07:00
marisaleung
1cd8e1fcc1 Add type, id, and info to the generated xml.
Add xml tests for fieldToDom.
Update workspace tests to pass with new changes.
2017-05-19 15:47:39 -07:00
marisaleung
cd5bb0d888 Changed parameter name in workspace for clarity. 2017-05-18 14:14:17 -07:00
shirletan
7a2c01e1cf Work around timing issue with travis osx issue (#1092)
* add more wait time for test setup

* increase selenium wait time

* add more wait
2017-05-09 16:39:39 -07:00
Rachel Fenichel
98914fcf6b Dragging changes, rebased on develop (#1078)
* Add block drag surface translateSurfaceBy

* Add dragged connection manager

* Add gesture.js

* Add GestureHandler

* Implemented gesture skeleton

* Most basic workspace dragging

* Add dragged connection manager

* cleanup

* doc

* more cleanup

* Add gesture handler

* Add translateSurfaceInternal

* core/block_dragger.js

* cleanup

* Pull in changes to dragged connection manager

* Pull in changes to dragged connection manager

* comments

* more annotations

* Add workspace dragger

* Add coordinate annotations

* Start on block dragging

* Limit number of concurrent gestures

* Add some TODOs

* start using dragged connection manager

* Set origin correctly for dragging blocks

* Connect or delete at the end of a block drag.

* cleanup

* handle field clicks and block + workspace right-clicks

* move code into BlockDragger class, but still reach into Gesture internals a lot

* Clean up block dragger

* Call blockDragger constructor with correct arguments

* Enable block dragging in a mutator workspace

* Add workspace dragger

* click todos

* Drag flyout with background

* more dragging from flyout

* nit

* fix dragging from flyouts

* Remove unused code and rename gestureHandler to gestureDB

* Rename gesture handler

* Added some jsdoc in gesture.js

* Update some docs

* Move some code to block_svg and clean up code

* Lots of coordinate annotations

* Fix block dragging when zoomed.

* Remove built files from branch

* More dragging work (#1026)

-- Drag bubbles while dragging blocks
-- Use bindEventWithChecks to work in touch on Android. Not tested anywhere else yet.
-- Handle dragging blocks while zoomed
-- Handle dragging blocks in mutators
-- Handle right-clicks (I hope)
-- Removed lots of unused code

* More dragging work (#1048)

- Removed gestureDB
- Removing uses of terminateDrag
- Cleaned up disposal code

* Dragging bugfixes (#1058)

- Get rid of flyout.dragMode_ and blockly.dragMode_
- Make drags from the flyout start from the top block in the group
- Block tooltips from being scheduled or shown during gestures
- Don't resize mutator bubbles mid-drag

* Fix events in new dragging (#1060)

* rebuild for testing

* unbuild

* Fix events

* rebuild

* Fix up cursors

* Use language files from develop

* Remove handled TODOS

* attempt to fix IE rerendering bug, and recalculate workspace positions on scroll

* Rebuild all the things

* Comment cleanup; annotations; delete unused variables.
2017-05-05 12:42:53 -07:00
marisaleung
0e0b1a3ebd Merge branch 'develop' into develop 2017-05-04 12:38:15 -07:00
marisaleung
12ea998155 Created separate file for VariableMap 2017-05-03 17:04:15 -07:00
marisaleung
2b1fe1c4e3 Merge pull request #1071 from marisaleung/develop
VariableMap and functions added.
2017-05-03 13:20:05 -07:00
marisaleung
d903b5e86b VariableMap and functions added. 2017-05-03 10:51:24 -07:00
marisaleung
b159c7c3b5 Create separate file for VariableMap and its functions. 2017-05-02 15:06:12 -07:00
marisaleung
2994805e6a VariableMap and functions added. 2017-05-02 10:07:46 -07:00
marisaleung
54178c65ae Merge pull request #1055 from marisaleung/develop
Create a variable model with name, id, and type.
2017-04-20 13:31:22 -07:00
marisaleung
9577e5ddc4 Created a variable model with name, id, and type.
Created a jsunit test file for variable model.
2017-04-20 13:19:53 -07:00
RoboErikG
a8da16036e Enable google/blockly with continuous build on travis ci (#1023) (#1035)
* create .travis for ci job

* initial checkin for blocky-web travis ci job

* rename file to .travis.yaml for typo

* remove after_script

* added cache

* rename .travis.yaml to .travis.yml

* Update .travis.yml

* include build script

* fix yaml file format issue

* debug install part

* debug build issue

* Update .travis.yml

* remove cache for now

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* more debug info

* Update .travis.yml

* Update .travis.yml

* fix typo

* installing chrome browser

* remove chrome setting config

* run build.py as part of npm install

* Update .travis.yml

* update karma dependency

* use karma as test runner

* fix typo

* remove karma test for now

* Update .travis.yml

* Update package.json

* add npm test target

* add browserstack-runner depdendency

* update browser support

* fix typo for test target

* fix chrome typo

* added closure dependency

* add google-closure-library

* include blockly_uncompressed.js and core.js dependency

* uncomment out core/*.js files

* add kama job as part of install

* remove browserstack add on for now

* fix karma config typo

* add karma-closure

* add os support

* remove typo config

* include more closure files

* change os back to linux

* use closure-library from node_modules

* change log level back to INFO

* change npm test target to use open browser command instead of karma

* change travis test target to use open command instead of karma

* list current directory

* find what's in current dir

* typo command

* Update .travis.yml

* typo again

* open right index.html

* use right path for index.html

* xdg-open to open default browser on travis

* exit browser after 5s wait

* change timeout to 1 min

* exit after opening up browser

* use browser only

* use karma

* remove un-needed dependency

* clean up script section

* fix typo

* update build status on readme

* initial commit for selenium integration tests

* update selenium jar path

* fix test_runner.js typo

* add more debug info

* check java version

* add && instead of 9288

* fix java path

* add logic to check if selenium is running or not

* add some deugging info

* initial commit to get chromedriver

* add chromedriver flag

* add get_chromedriver.sh to package.json and .travel

* change browser to chrome for now

* fix path issue

* update chromdriver path

* fix path issue again

* more debugging

* add debug msg

* fix typo

* minor fix for getting chromedriver

* install latest chrome browser

* clean up pakcage.json

* use npm target for test run

* remove removing trailing comma

* fix another trailing comma

* updated travis test target

* clean up scripts

* not sure nmp run preinstall

* redirect selenium log to tmp file

* revert writing console log to file

* update test summary

* more clean up

* minor clean up before pull request

* resolved closure-library conflict

1. add closure-library to dependencies instead of devDependencies.
2. add lint back in scripts block

* fix typo (adding comma) in script section
2017-04-11 13:38:11 -07:00
CoryDCode
6cc6848961 Added the variable modal and component and implemented basic renaming functionality. (#991) 2017-03-23 13:47:26 -07:00
Rachel Fenichel
a6a70a647c set background color to lilac if opening the playground from file: 2017-03-13 14:37:27 -07:00
Andrew n marshall
6313b202f7 unction to function corrects #962 (#970) 2017-03-08 07:47:48 -08:00
Andrew n marshall
6e1ffe09c2 Adding Blockly.Xml.appendDomToWorkspace() (#962)
This is a copy (with additional comments) of PR #822 (and also #961) by @qnoirhomme with unrelated files removed. See #822 for full review.
2017-03-03 08:40:00 -08:00
Rachel Fenichel
c30928a177 Make some functions private and add tests 2017-02-24 15:51:59 -08:00
Andrew n marshall
802c03b4c0 Adding tests for logic_ternary block in a new jsunit test framework. 2017-02-13 16:28:43 -08:00
Andrew n marshall
6b692a0802 Initial text block, with a mixin to generate quote image fields. (#923)
Text block now uses the extension "text_quotes", supported by Blockly.Constants.Text.QUOTE_IMAGE_MIXIN.quoteField_(fieldName), so that each platform can use the best platform appropriate image (size, density, etc.) for the quotes.
2017-02-13 15:00:02 -08:00
Andrew n marshall
a4cfd5cbc8 Porting Loop blocks to JSON (#919)
* Improved documentation on `Blockly.Extensions.buildTooltipForDropdown`
 * Replaced incorrect uses of `@mixes` JSDoc annotation (on mixin extensions) with `@augments Blockly.Block`.
 * Added Blockly.Extensions.buildTooltipWithFieldValue() extension helper.
2017-02-08 11:36:38 -08:00
Rachel Fenichel
5a40208138 Separate tests 2017-02-06 15:25:59 -08:00
Rachel Fenichel
630863d9db Add isEditable to field, and add tests 2017-02-06 14:47:45 -08:00
Rachel Fenichel
81eb35fde9 Merge pull request #905 from rachel-fenichel/tests/feb
Add skeleton for tests on rendered workspaces
2017-02-06 11:34:59 -08:00
Andrew n marshall
15827c5d30 Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin(). (#907)
Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin().
This adds support for a common use pattern in extensions, and adds
error checking to avoid future incompatibilities.
2017-02-06 10:00:08 -08:00
Rachel Fenichel
1881b0c3fa Add skeleton for tests on rendered workspaces 2017-02-02 16:08:03 -08:00