Commit Graph

130 Commits

Author SHA1 Message Date
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
Neil Fraser
6ce31942e0 Some goog.dom removal (#1991) 2018-08-01 15:47:28 -07:00
Neil Fraser
8f7674ea08 Correct requires for goog.events 2018-07-11 12:20:02 -07:00
Neil Fraser
67a18036d0 Fix Travis errors 2018-07-11 12:20:02 -07:00
Neil Fraser
60cce6cd0c Remove goog.math angle functions. 2018-07-11 12:20:02 -07:00
Neil Fraser
06d90c9b34 Remove goog.array 2018-07-11 12:20:02 -07:00
Neil Fraser
03bf9f5e71 Remove goog.string 2018-07-11 12:20:02 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Neil Fraser
4cb4b42f8d Use named properties on Msg. 2018-04-27 11:50:51 -07:00
Andrew n marshall
42e229fb4c Removing Blockly.utils.getScale_() and usage. (#1821)
The function only returns 1 for the two cases it was used on,
making the scale multiplication a no-op.
2018-04-24 10:24:03 -07:00
Rachel Fenichel
90a3730424 Fix more compiler warnings 2018-03-14 17:05:19 -07:00
Rachel Fenichel
9a53e96d53 More lint fixes 2018-01-23 18:22:53 -08:00
Neil Fraser
870f7b7f8a Fix document detection.
Andrew LGTMs in person.
2018-01-08 15:10:14 -08:00
Neil Fraser
4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Andrew n marshall
f992ea0f9c Fix #1369: resource loading order constraints, interpolation tokens in message expansion (PR #1383)
This fixes race condition in #1369 by using message references instead of explicit string lookups. This required fixing a bug the token interpolation parser that was breaking on the inner '"%1"' for these tooltips.
2017-10-24 13:02:14 -07:00
Rachel Fenichel
078b4fceb3 Revert some whitespace changes to appease eslint (#1370) 2017-10-19 16:08:54 -07:00
Neil Fraser
5c00256e96 Style improvements. No functional changes. (#1367) 2017-10-17 15:19:50 -07:00