mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
chore: fix more lint (#5676)
* chore: fix assorted lint * chore: clang-format * chore: clang-format
This commit is contained in:
@@ -515,7 +515,6 @@ Blockly.Extensions.registerMutator('controls_if_mutator',
|
||||
* @package
|
||||
*/
|
||||
Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION = function() {
|
||||
|
||||
this.setTooltip(function() {
|
||||
if (!this.elseifCount_ && !this.elseCount_) {
|
||||
return Blockly.Msg['CONTROLS_IF_TOOLTIP_1'];
|
||||
|
||||
@@ -75,7 +75,6 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateParams_: function() {
|
||||
|
||||
// Merge the arguments into a human-readable list.
|
||||
let paramString = '';
|
||||
if (this.arguments_.length) {
|
||||
|
||||
@@ -63,7 +63,8 @@ Blockly.defineBlocksWithJsonArray([
|
||||
"width": 12,
|
||||
"height": 17,
|
||||
"alt": '\u00B6',
|
||||
},{
|
||||
},
|
||||
{
|
||||
"type": "field_multilinetext",
|
||||
"name": "TEXT",
|
||||
"text": "",
|
||||
@@ -200,7 +201,7 @@ Blockly.defineBlocksWithJsonArray([
|
||||
"message0": "%{BKY_TEXT_CHARAT_TITLE}", // "in text %1 %2"
|
||||
"args0": [
|
||||
{
|
||||
"type":"input_value",
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
"check": "String",
|
||||
},
|
||||
|
||||
@@ -82,14 +82,14 @@ Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN = {
|
||||
*/
|
||||
customContextMenu: function(options) {
|
||||
if (!this.isInFlyout) {
|
||||
let opposite_type;
|
||||
let oppositeType;
|
||||
let contextMenuMsg;
|
||||
// Getter blocks have the option to create a setter block, and vice versa.
|
||||
if (this.type === 'variables_get') {
|
||||
opposite_type = 'variables_set';
|
||||
oppositeType = 'variables_set';
|
||||
contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
|
||||
} else {
|
||||
opposite_type = 'variables_get';
|
||||
oppositeType = 'variables_get';
|
||||
contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN = {
|
||||
xmlField.setAttribute('name', 'VAR');
|
||||
xmlField.appendChild(Blockly.utils.xml.createTextNode(name));
|
||||
const xmlBlock = Blockly.utils.xml.createElement('block');
|
||||
xmlBlock.setAttribute('type', opposite_type);
|
||||
xmlBlock.setAttribute('type', oppositeType);
|
||||
xmlBlock.appendChild(xmlField);
|
||||
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
|
||||
options.push(option);
|
||||
|
||||
@@ -80,16 +80,16 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
|
||||
customContextMenu: function(options) {
|
||||
// Getter blocks have the option to create a setter block, and vice versa.
|
||||
if (!this.isInFlyout) {
|
||||
let opposite_type;
|
||||
let oppositeType;
|
||||
let contextMenuMsg;
|
||||
const id = this.getFieldValue('VAR');
|
||||
const variableModel = this.workspace.getVariableById(id);
|
||||
const varType = variableModel.type;
|
||||
if (this.type === 'variables_get_dynamic') {
|
||||
opposite_type = 'variables_set_dynamic';
|
||||
oppositeType = 'variables_set_dynamic';
|
||||
contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
|
||||
} else {
|
||||
opposite_type = 'variables_get_dynamic';
|
||||
oppositeType = 'variables_get_dynamic';
|
||||
contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
|
||||
xmlField.setAttribute('variabletype', varType);
|
||||
xmlField.appendChild(Blockly.utils.xml.createTextNode(name));
|
||||
const xmlBlock = Blockly.utils.xml.createElement('block');
|
||||
xmlBlock.setAttribute('type', opposite_type);
|
||||
xmlBlock.setAttribute('type', oppositeType);
|
||||
xmlBlock.appendChild(xmlField);
|
||||
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
|
||||
options.push(option);
|
||||
|
||||
Reference in New Issue
Block a user