Commit Graph

146 Commits

Author SHA1 Message Date
Sam El-Husseini
f97730e83c Sort requires (#4658)
* Cleanup gulp method to sort requires
2021-02-25 17:17:42 -08:00
Rachel Fenichel
107181d6f5 Missing requires, r through v 2021-02-17 14:52:06 -08:00
Sam El-Husseini
3a3ca0b0eb Always access properties on Blockly.utils.global using quotes (#4574) 2021-01-08 14:48:17 -08:00
alschmiedt
897296dce8 Adds check for isTextInput (#4262)
Necessary for developers using custom elements
2020-09-10 09:07:46 -07:00
Monica Kozbial
0a36117885 Replace console "WARNING" log calls with warn call (#4171) 2020-08-13 10:53:04 -07:00
Sam El-Husseini
acfc335870 Type fixes for Dropdown / Widget divs (#3911)
* Stricter typechecks in dropdown and widget div
2020-05-28 08:42:26 -07:00
Monica Kozbial
a9223b0b22 Typo fixes. (#3769) 2020-03-25 15:47:27 -07:00
Neil Fraser
4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini
43224afbf7 Move parseBlockColour into Blockly.utils (#3399)
* Move parseBlockColour into utils and add missing require.
2019-11-04 22:39:18 -08:00
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
18fea2adb3 Fix 8 warnings related to utils. (#3294) 2019-10-22 14:28:17 -04:00
Neil Fraser
b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Sam El-Husseini
8ab51c8639 Remove closure base file dependency (#2976)
* Trim down closure's base dependency even further by removing the dependency on closure's base file.
2019-09-11 17:30:51 -07:00
Sam El-Husseini
8ce619e827 Renaming base util to global as that's all it's used for. (#2958)
* Renaming base util to global as that's all it's used for.
2019-09-04 10:09:56 -07:00
Sam El-Husseini
f34f2beac7 Remove all calls to goog.style (#2781)
* Remove dependency on goog.style
2019-08-06 14:54:13 -07:00
Neil Fraser
e77a9b7e81 Change parseFloat() to Number()
Number() is a bit less forgiving than parseFloat() and is more likely to generate NaN rather than some random number.  An audit of each case shows nowhere that parseFloat()’s features are needed.
2019-08-01 11:36:58 -07:00
Rachel Fenichel
b4109d7c43 Add no-multi-spaces rule 2019-07-31 09:33:54 -07:00
Sam El-Husseini
57868e7e83 Remove all calls to goog.math (#2739)
* Replace calls to goog.math.Size and goog.math.Coordinate with Blockly equivelants
2019-07-30 11:22:08 -07:00
Sam El-Husseini
5ce8c68833 Fix node build and add node tests (#2736)
* Fix node build and add node tests
2019-07-30 11:13:52 -07:00
Sam El-Husseini
4622c95629 Fix screenToWsCoordinates jsdoc (#2737)
Fix typos in jsdoc
2019-07-30 10:08:52 -07:00
Abby
3dd1973a5a Ran the rename script 2019-07-24 13:48:25 -07:00
Abby
1c26b6d79b Adds helper functions for keyboard nav 2019-07-24 11:42:37 -07:00
Neil Fraser
aca1a43ec8 Fix regular expressions.
1) Simplifications.
2) Enable toolbox category colours to be specified using the full range of CSS formats (not just hue or #rrggbb).
3) Fix bug where `Blockly.utils.checkMessageReferences('%{BKY_today}  %{BKY_xxx}')` returns true.
2019-06-10 11:03:22 -07:00
Neil Fraser
848d3a3509 Move setCssTransform & createSvgElement to dom.
Also move SVG_NS and HTML_NS properties.
2019-06-07 10:32:57 -07:00
Neil Fraser
3dfac9a2ba Alphabetize require statements.
Search and replace for userAgent didn’t take into account alphabetic ordering.
Also some line wraping.
2019-06-07 10:32:57 -07:00
Neil Fraser
566f182fa8 Move Blockly.userAgent to Blockly.utils.userAgent 2019-06-07 10:32:57 -07:00
Neil Fraser
d1a29739d8 Move utilities into own directory.
TODO: There are more functions which may be migrated into dom and string.
2019-06-07 10:32:57 -07:00
Neil Fraser
5bf7069a2f Remove goog.math.Coordinate 2019-06-07 10:32:57 -07:00
Neil Fraser
931cc85c83 Remove last goog.dom dependency. 2019-06-07 10:32:57 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
a4e0091d4e Fix style matching in Firefox 67 (#2485)
Chrome returns ‘transform: translate(107px, 0px);’ whereas Firefox now returns ‘transform: translate(107px);’ if the y value is 0.  This is consistent with existing behaviour in the translate SVG attribute.

The comment in our code specifically states:
// Accounts for same exceptions as XY_REGEX_
Yet that was not true at all.

This PR makes the y argument optional (as falsely described in the comment).  It also merges the 2D and 3D regeps together to simplify the code.

Resolves issue #2482.  Needs to be cherrypicked to Master and everything rebuilt and pushed.
2019-05-24 08:43:22 -07:00
Neil Fraser
4161ba0fa7 Move goog.global to Blockly.utils.global
Can’t use Blockly.global since that’s the last file to load.
2019-05-17 15:04:39 -07:00
Neil Fraser
25bc3e0268 Fix require statements.
Also throw error instead of string.
And stop using goog.asserts.
2019-05-17 15:04:39 -07:00
Neil Fraser
49954e0cec Remove calls to goog.dom.getViewportSize
document.documentElement.clientWidth/clientHeight seems to work everywhere Blockly works.  Closure’s functions are mind-numbingly complex due to IE5, old WebKit, Opera 8, and others.
2019-05-17 15:04:39 -07:00
Neil Fraser
28ad3a9bd3 Blockly.utils.userAgent moved to Blockly.userAgent 2019-05-10 16:56:26 -07:00
Neil Fraser
25ddecab50 Undo workaround for IE10.
Due to no longer supporting IE10, we don’t need the code added here: 92f3880008
2019-05-10 16:39:32 -07:00
Neil Fraser
fa8c7f3884 Lint fix. 2019-05-10 14:30:31 -07:00
Neil Fraser
4062030731 Remove goog.userAgent dependency. 2019-05-10 14:03:21 -07:00
Neil Fraser
f118d33855 Corrections to JSDoc comments 2019-03-29 15:24:37 -07:00
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Rachel Fenichel
47fff5cddb Merge pull request #2313 from rachel-fenichel/feature/dropdowndiv
Add dropdowndiv and use it for the colour picker and angle fields
2019-03-01 12:54:39 -08:00
Rachel Fenichel
0b1bd78674 Clarify some dropdown rendering code 2019-02-28 15:11:57 -08:00
Beka Westberg
4e7e712549 Added scroll delta mode constants. 2019-02-21 07:35:44 -08:00
BeksOmega
1c4ba38300 Added Max Instances Property to Workspace Options (#2130)
* Added Max Instances property to Blocks

* eslint cleanup

* eslint cleanup 2

* Moved maxInstances property from block to workspace (as a map of block type to max instances). isDuplicate() changed to correctly handle siblings/branches.

* eslint cleanup

* Changed checking types to map. Added hasBlockLimits. Fixed Nits.

* Added limit_instances test block. eslint fixes.

* fixup! Added limit_instances test block. eslint fixes.

* Changed sorting objects to a private static function of the workspace. Fixed nits. Undeleted .eslintrc

* Reverted .gitignore file.

* Added getBlockTypeCounts() to utils. Added isCapacityAvailable() to workspace. Changed clipboard to save typeCountsMap rather than object.
2018-11-27 16:34:21 -08:00
Neil Fraser
db0dbc69ee Update todos and requires. 2018-10-16 11:34:10 -07:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Neil Fraser
dddb94aedd Fix circular dependency. 2018-10-16 11:34:10 -07:00
Andrew n marshall
411ec9724e Replacing node.parentNode.removeChild(node)
...with Blockly.utils.removeNode(..), which includes
a null/undefined check on parentNode before continuing.
2018-09-04 13:31:53 -07:00
Neil Fraser
c6afb08c4b Add unit tests and code cleanup to utils (#1993)
* Add unit tests for new util functions
* Utils functions shouldn’t be package, not private.
* Use existing utility function for insertAfter
2018-08-03 14:31:50 -07:00