chore: Remove radix from parseInt, simplify Blockly.utils.dom methods, use Unicode characters. (#6441)

* chore: remove radix from parseInt

Previously any number starting with '0' would be parsed as octal if the radix was left blank.  But this was changed years ago.  It is no longer needed to specify a radix.

* chore: 'ID' is identification

'id' is a part of Freud's brain.

* Use Unicode characters instead of codes

This is in line with the current style guide.

* Simplify Blockly.utils.dom methods.

classList add/remove/has supports SVG elements in all browsers Blockly supports (i.e. not IE).
This commit is contained in:
Neil Fraser
2022-09-22 15:59:24 +02:00
committed by GitHub
parent c84febbe07
commit e5dcb766bd
24 changed files with 45 additions and 72 deletions

View File

@@ -42,7 +42,7 @@ export abstract class Abstract {
/** @alias Blockly.Events.Abstract */
constructor() {
/**
* The event group id for the group this event belongs to. Groups define
* The event group ID for the group this event belongs to. Groups define
* events that should be treated as an single action from the user's
* perspective, and should be undone together.
*/

View File

@@ -48,7 +48,7 @@ export class CommentBase extends AbstractEvent {
this.workspaceId = this.isBlank ? '' : opt_comment!.workspace.id;
/**
* The event group id for the group this event belongs to. Groups define
* The event group ID for the group this event belongs to. Groups define
* events that should be treated as an single action from the user's
* perspective, and should be undone together.
*/

View File

@@ -41,10 +41,10 @@ export class Selected extends UiBase {
opt_workspaceId?: string) {
super(opt_workspaceId);
/** The id of the last selected element. */
/** The ID of the last selected element. */
this.oldElementId = opt_oldElementId;
/** The id of the selected element. */
/** The ID of the selected element. */
this.newElementId = opt_newElementId;
/** Type of this event. */

View File

@@ -35,7 +35,7 @@ export class VarBase extends AbstractEvent {
super();
this.isBlank = typeof opt_variable === 'undefined';
/** The variable id for the variable this event pertains to. */
/** The variable ID for the variable this event pertains to. */
this.varId = this.isBlank ? '' : opt_variable!.getId();
/** The workspace identifier for this event. */