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

@@ -344,9 +344,9 @@ suite('Utils', function() {
const p = document.createElement('p');
p.className = ' one three two three ';
Blockly.utils.dom.removeClass(p, 'two');
chai.assert.equal(p.className, 'one three three', 'Removing "two"');
chai.assert.equal(p.className, 'one three', 'Removing "two"');
Blockly.utils.dom.removeClass(p, 'four');
chai.assert.equal(p.className, 'one three three', 'Removing "four"');
chai.assert.equal(p.className, 'one three', 'Removing "four"');
Blockly.utils.dom.removeClass(p, 'three');
chai.assert.equal(p.className, 'one', 'Removing "three"');
Blockly.utils.dom.removeClass(p, 'ne');