Commit Graph

4898 Commits

Author SHA1 Message Date
translatewiki.net
b809ae50b2 Localisation updates from https://translatewiki.net. 2020-05-07 17:06:55 +02:00
Neil Fraser
a65afdc189 Simplify Closure-sourced code for menus (#3880)
* Remove cargo-culted bloat from CSS

The `goog-menuitem-icon` and `goog-menuitem-noicon` classes are not present in Blockly.  Blockly doesn’t support the CSS compiler, so #noflip has no effect.  Shorten uncompressible warning string.

Also remove the “Copied from Closure” notes.  These were intended so that the CSS could be easily updated as the Closure Library evolved.  We are no longer linked to the Closure Library.

* Fix bug (in prod) where menu highlighting is lost

Previously, open playground.  Right-click on workspace.  Mouse-over “Add comment” (it highlights).  Mouse over “Download screenshot” (disabled option).  Mouse over “Add comment” (highlighting is lost).

Also remove `canHighlightItem` helper function.  In theory this helps abstract the concept of non-highlightable options.  But in practice it was only called in one of the several places that it should have been.  This was a false abstraction.

* Add support for Space/PgUp/PgDn/Home/End to menus

* Eliminate calls to clearHighlighted

The JSDoc for `setHighlightedIndex` specifically states, “If another item was previously highlighted, it is un-highlighted.”  This is not what was implemented, but it should be.  This commit adds the un-highlighting, and removes all the calls previously required to correct this bug.

* Stop wrapping at top or bottom of menu.

Real OS menus don’t wrap when one cursors off the top or bottom.

Also, replace the overly complicated helper function with a simple 1/-1 step value.

* Remove unused menu code

* Simplify menu roles

Remove unneeded sets to RTL on Menu (only MenuItem cares).

* Fix lack of disposal for context menus.

Context menus only disposed properly when an option was clicked.  If they were dismissed by clicking outside the menu there was no disposal.  This might result in a memory leak.
Also un-extract (inject?) several now trivial functions.

* Remove Component dependency from Menu & MenuItem

Component is now only used by the category tree.

* Remove unused functions in Component

These were used by Menu/MenuItem.

* Fix dependencies.

* Record highlighted menu item by object, not index

Less code, simpler.

* Rename CSS classes goog-menu* to blocklyMenu*

Old classes remain in DOM and are deprecated so that any custom CSS will continue to function.

* Remove unused focus tracker in tree.

* Add support for space/enter to toggle tree cats

* Delete unsettable .isUserCollapsible_ from tree

* Change visibility tags throughout menus.

The previous tags were inherited from Closure and don’t reflect current usage in the Blockly codebase.

The core/components/tree files are non-compliant in this regard, but I’m not going to update them since they need to be replaced and there’s no need to create an interim API change.

* Remove property on DOM element linking to JS obj

Performance is slower (O(n) rather than (O(1)), but ’n’ is the number of entries on the menu, so shouldn’t be more than a dozen or so.

* Fixes a compile error (node != element)

Usually we avoid parentElement in Blockly.  That’s because it has very spotty behaviour with SVG.  But in this case we are in pure HTML.
2020-05-06 23:55:17 -04:00
Monica Kozbial
abd6a53ac2 Add missing cleanup for block types. (#3890)
* Add missing cleanup for block types.

* Add missing dispose and remove unecessary delete.
2020-05-06 17:49:22 -07:00
Sam El-Husseini
888e348c69 Clean out the date field (#3876) 2020-05-06 09:42:24 -07:00
Sam El-Husseini
1e251e812b Hide the dropdown div when the flyout toolbox is scrolled (#3884) 2020-05-06 09:41:58 -07:00
Rachel Fenichel
3b6d364d07 Merge pull request #3874 from BeksOmega/fix/insertion-gen
Add ignoring insertion markers in code/xml gen
2020-05-04 10:43:08 -07:00
translatewiki.net
38cf18863b Localisation updates from https://translatewiki.net. 2020-05-04 15:49:20 +02:00
Beka Westberg
498ca3cba1 Improve renameVariable jsdoc (#3879) 2020-05-03 11:15:51 -07:00
Beka Westberg
1c08d93937 Add blockIds to insertion code gen tests 2020-05-02 08:00:19 -07:00
Beka Westberg
65bb33635d Add ignoring insertion markers in code gen 2020-05-02 07:37:58 -07:00
Maribeth Bottorff
be50de6650 Procedure (#3875)
* Use getBlocksByType to speed up allProcedures generation

* Add tests for allProcedures

* Add error messages for some tests
2020-05-01 11:44:26 -07:00
Sam El-Husseini
43c2a0e85c Add sourcemaps (#3872)
* Update build scripts to produce source maps
2020-05-01 10:10:23 -07:00
Neil Fraser
f4fc455f83 Add Ctrl-y (redo) support.
Does not trigger on Command-y since this is a Windows-only shortcut.
2020-04-30 16:28:19 -04:00
translatewiki.net
84cd83e568 Localisation updates from https://translatewiki.net. 2020-04-30 16:46:40 +02:00
Monica Kozbial
6e2c8089c5 Cleanup unused jsunit files. (#3871) 2020-04-29 13:56:24 -07:00
Monica Kozbial
e3d82fa3af Converting procedure svg tests to mocha. (#3867)
* Converting procedure svg tests to mocha.

* Removing unused function.

* cleanup
2020-04-29 11:33:11 -07:00
Monica Kozbial
e606b872c2 Converting logic_ternary block tests to mocha (#3868)
* Convert logic_ternary block tests to mocha.
2020-04-29 11:30:23 -07:00
Monica Kozbial
c35793bf9c Convert event svg tests to mocha. (#3864) 2020-04-29 11:16:45 -07:00
Monica Kozbial
e516a08430 Workspace svg tests (#3857)
* Converting workspace svg tests to mocha and calling workspace tests.

* Removing jsunit style test for workspace_svg.

* Fix eslint error.
2020-04-27 16:32:52 -07:00
translatewiki.net
8e0db23202 Localisation updates from https://translatewiki.net. 2020-04-27 16:42:54 +02:00
Monica Kozbial
bbc13cfd57 Add wait for xml test case. (#3855) 2020-04-24 15:07:57 -07:00
Monica Kozbial
b3d4932d49 Enabling workspace comments test. (#3856) 2020-04-24 15:07:44 -07:00
Monica Kozbial
b574490072 Convert workspace redo undo tests to mocha. (#3847)
* Convert workspace redo undo tests to mocha.

* Adding details to asserts and test case names.

* Adding additional checks for undo/redo tests.

* Bumping timeout and addressing comments.
2020-04-22 16:24:02 -07:00
Sam El-Husseini
33cb4d6feb Fix defineTheme startHats (#3842)
typeof null === "object", go figure..
2020-04-22 15:38:50 -07:00
Maribeth Bottorff
ba682040b1 Procedures.allProcedures only searches top blocks because procedures can only be top-level blocks. (#3854) 2020-04-22 14:51:24 -07:00
Monica Kozbial
2f33a37fa4 Convert workspace comment tests to mocha. (#3850) 2020-04-22 14:49:42 -07:00
alschmiedt
3fa6ffa2c6 Fix toolbox tests (#3852)
* Fix toolbox tests
2020-04-22 14:11:02 -07:00
alschmiedt
16e6735748 Cleanup (#3848)
* General Toolbox Cleanup
2020-04-22 09:57:19 -07:00
alschmiedt
10444d76ec Toolbox tests (#3846)
* Add tests for toolbox
2020-04-22 08:47:08 -07:00
Monica Kozbial
b934fdc93c Converting generator tests to mocha. (#3845) 2020-04-21 17:38:26 -07:00
Monica Kozbial
61c60019fd Converting widget div tests to mocha. (#3844) 2020-04-21 14:03:32 -07:00
Monica Kozbial
bb3b20443b Convert remaining tests in workspace_test. (#3841) 2020-04-20 16:52:56 -07:00
alschmiedt
9513473c74 Make variable method public (#3840)
* Make nameUsedWithAnyType public
2020-04-20 11:25:35 -07:00
translatewiki.net
7c3fbad360 Localisation updates from https://translatewiki.net. 2020-04-20 16:50:02 +02:00
Maribeth Bottorff
781dbd974d Make block.removeInput return a boolean. (#3832)
Make block.removeInput return a boolean.
2020-04-17 17:47:58 -07:00
Monica Kozbial
17eade1017 Partial conversion of workspace tests to mocha. (#3838) 2020-04-17 16:31:12 -07:00
Monica Kozbial
0adf7efd5f Converting jsunit asserts to chai. (#3831)
* Converting jsunit asserts to chai.

* Move jsunit functions to test_utilities.

* Adding eslint exception for helper method.
2020-04-17 16:08:46 -07:00
Sam El-Husseini
cfa198c6a0 Fix bug with dropdown divs in mutator dialogs. (#3835) 2020-04-17 13:19:40 -07:00
mmathrani
13093933b3 Update the alert for demo storage. (#3830) 2020-04-17 08:19:28 -07:00
Sam El-Husseini
4b20383831 Add Selectable interface (#3823)
* Add I Selectable interface
2020-04-16 18:22:32 -07:00
Monica Kozbial
a74cd0898c Converting variable map tests to mocha. (#3827)
* Converting variable map tests to mocha.

* Removing TODO updating chai syntax.
2020-04-16 17:47:17 -07:00
Monica Kozbial
e838027629 Convert variable model tests to mocha. (#3829)
* Convert variable model tests to mocha.

* Delete old jsunit test.

* Updating to use chai syntax.
2020-04-16 17:39:38 -07:00
Monica Kozbial
9c400f2bf0 Converting variable tests to mocha. (#3828) 2020-04-16 14:18:12 -07:00
Beka Westberg
9e98df9949 Fix collapsed blocks not updating when modified (#3806)
* Stop recursive render calls

* Fix visibility bugs.

* Make toString ignore collapsed input.

* Add automatic collapse rendering handling

* Fix insertion markers with collapsed

* Add tests

* Fix build?

* PR comments

* Add missing jsdoc
2020-04-16 13:02:05 -07:00
Sam El-Husseini
0230a4c192 Update IPathObject to include properties (#3822)
* Update IPathObject to include properties

* Fix ipathobject svgpath
2020-04-15 19:46:11 -07:00
Sam El-Husseini
12c8a50a0f Update the options object to reflect its properties, update the public option interface to include keymap and other little things (#3826) 2020-04-15 17:51:57 -07:00
Monica Kozbial
d61f3c6f38 Converting extensions_test to mocha. (#3820)
* Converting extensions_test to mocha.

* Add spacing between test cases.

* Fix cleanup for block type.

* Add cleanup for event state.
2020-04-15 15:55:49 -07:00
Sam El-Husseini
493c89869e Rename dom Node enum (#3824)
* Rename Node enum to NodeType to avoid conflict with type Node
2020-04-15 15:54:36 -07:00
Sam El-Husseini
a4a390ba6d Add user agent types so they appear in dts (#3825) 2020-04-15 15:46:42 -07:00
Monica Kozbial
ab5f7d8a00 Converting event tests to mocha. (#3811)
* Convert remaining jsunit tests for events to mocha.

* Fix eslint.
2020-04-15 11:29:17 -07:00