mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Running eslint on modified files.
This commit is contained in:
@@ -38,7 +38,7 @@ goog.require('Blockly.FieldCheckbox');
|
||||
goog.require('Blockly.FieldColour');
|
||||
// Date picker commented out since it increases footprint by 60%.
|
||||
// Add it only if you need it.
|
||||
//goog.require('Blockly.FieldDate');
|
||||
// goog.require('Blockly.FieldDate');
|
||||
goog.require('Blockly.FieldDropdown');
|
||||
goog.require('Blockly.FieldLabelSerializable');
|
||||
goog.require('Blockly.FieldImage');
|
||||
|
||||
@@ -151,7 +151,7 @@ Blockly.Bubble.unbindDragEvents_ = function() {
|
||||
* @param {!Event} e Mouse up event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Bubble.bubbleMouseUp_ = function(/*e*/) {
|
||||
Blockly.Bubble.bubbleMouseUp_ = function(/* e */) {
|
||||
Blockly.Touch.clearTouchIdentifier();
|
||||
Blockly.Bubble.unbindDragEvents_();
|
||||
};
|
||||
|
||||
@@ -245,7 +245,7 @@ Blockly.InsertionMarkerManager.prototype.update = function(dxy, deleteArea) {
|
||||
}
|
||||
};
|
||||
|
||||
/**** Begin initialization functions ****/
|
||||
/** ** Begin initialization functions *** */
|
||||
|
||||
/**
|
||||
* Create an insertion marker that represents the given block.
|
||||
@@ -310,7 +310,7 @@ Blockly.InsertionMarkerManager.prototype.initAvailableConnections_ = function()
|
||||
return available;
|
||||
};
|
||||
|
||||
/**** End initialization functions ****/
|
||||
/** ** End initialization functions *** */
|
||||
|
||||
|
||||
/**
|
||||
@@ -472,7 +472,7 @@ Blockly.InsertionMarkerManager.prototype.shouldDelete_ = function(candidate,
|
||||
return wouldDelete && !wouldConnect;
|
||||
};
|
||||
|
||||
/**** Begin preview visibility functions ****/
|
||||
/** ** Begin preview visibility functions *** */
|
||||
|
||||
/**
|
||||
* Show an insertion marker or replacement highlighting during a drag, if
|
||||
@@ -574,9 +574,9 @@ Blockly.InsertionMarkerManager.prototype.hidePreview_ = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/**** End preview visibility functions ****/
|
||||
/** ** End preview visibility functions *** */
|
||||
|
||||
/**** Begin block highlighting functions ****/
|
||||
/** ** Begin block highlighting functions *** */
|
||||
|
||||
/**
|
||||
* Add highlighting showing which block will be replaced.
|
||||
@@ -611,9 +611,9 @@ Blockly.InsertionMarkerManager.prototype.unhighlightBlock_ = function() {
|
||||
this.highlightingBlock_ = false;
|
||||
};
|
||||
|
||||
/**** End block highlighting functions ****/
|
||||
/** ** End block highlighting functions *** */
|
||||
|
||||
/**** Begin insertion marker display functions ****/
|
||||
/** ** Begin insertion marker display functions *** */
|
||||
|
||||
/**
|
||||
* Disconnect the insertion marker block in a manner that returns the stack to
|
||||
@@ -698,7 +698,7 @@ Blockly.InsertionMarkerManager.prototype.connectMarker_ = function() {
|
||||
this.markerConnection_ = imConn;
|
||||
};
|
||||
|
||||
/**** End insertion marker display functions ****/
|
||||
/** ** End insertion marker display functions *** */
|
||||
|
||||
/**
|
||||
* Get a list of the insertion markers that currently exist. Drags have 0, 1,
|
||||
|
||||
@@ -401,7 +401,7 @@ Blockly.ASTNode.prototype.findPrevForField_ = function() {
|
||||
}
|
||||
fieldIdx--;
|
||||
}
|
||||
//Reset the fieldIdx to the length of the field row of the previous input
|
||||
// Reset the fieldIdx to the length of the field row of the previous input
|
||||
if (i - 1 >= 0) {
|
||||
fieldIdx = block.inputList[i - 1].fieldRow.length - 1;
|
||||
}
|
||||
@@ -483,7 +483,7 @@ Blockly.ASTNode.prototype.getOutAstNodeForBlock_ = function(block) {
|
||||
return Blockly.ASTNode.createInputNode(
|
||||
topConnection.targetConnection.getParentInput());
|
||||
} else {
|
||||
//Go to stack level if you are not underneath an input
|
||||
// Go to stack level if you are not underneath an input
|
||||
return Blockly.ASTNode.createStackNode(topBlock);
|
||||
}
|
||||
};
|
||||
@@ -539,8 +539,8 @@ Blockly.ASTNode.prototype.findTopOfSubStack_ = function(sourceBlock) {
|
||||
Blockly.ASTNode.prototype.next = function() {
|
||||
switch (this.type_) {
|
||||
case Blockly.ASTNode.types.WORKSPACE:
|
||||
//TODO: Need to limit this. The view is bounded to half a screen beyond
|
||||
//the furthest block.
|
||||
// TODO: Need to limit this. The view is bounded to half a screen beyond
|
||||
// the furthest block.
|
||||
var newX = this.wsCoordinate_.x + Blockly.ASTNode.wsMove_;
|
||||
var newWsCoordinate = new Blockly.utils.Coordinate(newX, this.wsCoordinate_.y);
|
||||
var workspace = /** @type {Blockly.Workspace} */ (this.location_);
|
||||
@@ -672,7 +672,7 @@ Blockly.ASTNode.prototype.out = function() {
|
||||
switch (this.type_) {
|
||||
case Blockly.ASTNode.types.STACK:
|
||||
var blockPos = this.location_.getRelativeToSurfaceXY();
|
||||
//TODO: Make sure this is in the bounds of the workspace
|
||||
// TODO: Make sure this is in the bounds of the workspace
|
||||
var wsCoordinate = new Blockly.utils.Coordinate(
|
||||
blockPos.x, blockPos.y + Blockly.ASTNode.DEFAULT_OFFSET_Y);
|
||||
return Blockly.ASTNode.createWorkspaceNode(
|
||||
|
||||
@@ -152,9 +152,9 @@ Blockly.CursorSvg.prototype.setParent_ = function(newParent) {
|
||||
this.parent_ = newParent;
|
||||
};
|
||||
|
||||
/**************************/
|
||||
/**** Display ****/
|
||||
/**************************/
|
||||
/** *********************** */
|
||||
/** ** Display *** */
|
||||
/** *********************** */
|
||||
|
||||
/**
|
||||
* Show the cursor using coordinates.
|
||||
@@ -174,7 +174,7 @@ Blockly.CursorSvg.prototype.showWithCoordinates_ = function() {
|
||||
* @private
|
||||
*/
|
||||
Blockly.CursorSvg.prototype.showWithBlock_ = function() {
|
||||
//TODO: Change this from getLocation to something else
|
||||
// TODO: Change this from getLocation to something else
|
||||
var block = this.getCurNode().getLocation();
|
||||
|
||||
this.currentCursorSvg = this.cursorSvgRect_;
|
||||
@@ -274,9 +274,9 @@ Blockly.CursorSvg.prototype.showWithStack_ = function() {
|
||||
};
|
||||
|
||||
|
||||
/**************************/
|
||||
/**** Position ****/
|
||||
/**************************/
|
||||
/** *********************** */
|
||||
/** ** Position *** */
|
||||
/** *********************** */
|
||||
|
||||
/**
|
||||
* Move and show the cursor at the specified coordinate in workspace units.
|
||||
@@ -348,8 +348,8 @@ Blockly.CursorSvg.prototype.update_ = function() {
|
||||
var curNode = this.getCurNode();
|
||||
if (curNode.getType() === Blockly.ASTNode.types.BLOCK) {
|
||||
this.showWithBlock_();
|
||||
//This needs to be the location type because next connections can be input
|
||||
//type but they need to draw like they are a next statement
|
||||
// This needs to be the location type because next connections can be input
|
||||
// type but they need to draw like they are a next statement
|
||||
} else if (curNode.getLocation().type === Blockly.INPUT_VALUE ||
|
||||
curNode.getType() === Blockly.ASTNode.types.OUTPUT) {
|
||||
this.showWithInputOutput_();
|
||||
|
||||
@@ -129,9 +129,9 @@ Blockly.Navigation.removeMark = function() {
|
||||
Blockly.Navigation.marker_.hide();
|
||||
};
|
||||
|
||||
/************************/
|
||||
/** Toolbox Navigation **/
|
||||
/************************/
|
||||
/** ********************* */
|
||||
/** Toolbox Navigation * */
|
||||
/** ********************* */
|
||||
|
||||
/**
|
||||
* Set the state to the toolbox state and the current category as the first
|
||||
@@ -232,9 +232,9 @@ Blockly.Navigation.outCategory = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/***********************/
|
||||
/** Flyout Navigation **/
|
||||
/***********************/
|
||||
/** ******************** */
|
||||
/** Flyout Navigation * */
|
||||
/** ******************** */
|
||||
|
||||
/**
|
||||
* Change focus to the flyout.
|
||||
@@ -357,8 +357,8 @@ Blockly.Navigation.insertFromFlyout = function() {
|
||||
var prevConnection = newBlock.previousConnection;
|
||||
var outConnection = newBlock.outputConnection;
|
||||
var topConnection = prevConnection ? prevConnection : outConnection;
|
||||
//TODO: This will have to be fixed when we add in a block that does not have
|
||||
//a previous or output connection
|
||||
// TODO: This will have to be fixed when we add in a block that does not have
|
||||
// a previous or output connection
|
||||
var astNode = Blockly.ASTNode.createConnectionNode(topConnection);
|
||||
Blockly.Navigation.cursor_.setLocation(astNode);
|
||||
Blockly.Navigation.removeMark();
|
||||
@@ -377,9 +377,9 @@ Blockly.Navigation.resetFlyout = function(shouldHide) {
|
||||
}
|
||||
};
|
||||
|
||||
/************/
|
||||
/** Modify **/
|
||||
/************/
|
||||
/** ********* */
|
||||
/** Modify * */
|
||||
/** ********* */
|
||||
|
||||
/**
|
||||
* Handle the modifier key (currently I for Insert).
|
||||
@@ -587,9 +587,9 @@ Blockly.Navigation.disconnectBlocks = function() {
|
||||
Blockly.Navigation.cursor_.setLocation(connectionNode);
|
||||
};
|
||||
|
||||
/*************************/
|
||||
/** Keyboard Navigation **/
|
||||
/*************************/
|
||||
/** ********************** */
|
||||
/** Keyboard Navigation * */
|
||||
/** ********************** */
|
||||
|
||||
/**
|
||||
* Sets the cursor to the previous or output connection of the selected block
|
||||
@@ -606,8 +606,8 @@ Blockly.Navigation.focusWorkspace = function() {
|
||||
if (Blockly.selected) {
|
||||
var previousConnection = Blockly.selected.previousConnection;
|
||||
var outputConnection = Blockly.selected.outputConnection;
|
||||
//TODO: This still needs to work with blocks that have neither previous
|
||||
//or output connection.
|
||||
// TODO: This still needs to work with blocks that have neither previous
|
||||
// or output connection.
|
||||
var connection = previousConnection ? previousConnection : outputConnection;
|
||||
var newAstNode = Blockly.ASTNode.createConnectionNode(connection);
|
||||
cursor.setLocation(newAstNode);
|
||||
@@ -641,9 +641,9 @@ Blockly.Navigation.handleEnterForWS = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/**********************/
|
||||
/** Helper Functions **/
|
||||
/**********************/
|
||||
/** ******************* */
|
||||
/** Helper Functions * */
|
||||
/** ******************* */
|
||||
|
||||
|
||||
/**
|
||||
@@ -730,7 +730,7 @@ Blockly.Navigation.toolboxKeyHandler = function(e) {
|
||||
Blockly.Navigation.log('D: Toolbox : Go to flyout');
|
||||
return true;
|
||||
} else if (e.keyCode === goog.events.KeyCodes.ENTER) {
|
||||
//TODO: focus on flyout OR open if the category is nested
|
||||
// TODO: focus on flyout OR open if the category is nested
|
||||
return true;
|
||||
} else if (e.keyCode === goog.events.KeyCodes.E ||
|
||||
e.keyCode === goog.events.KeyCodes.ESC) {
|
||||
|
||||
@@ -103,8 +103,8 @@ Blockly.blockRendering.Drawer.prototype.drawOutline_ = function() {
|
||||
this.drawTop_();
|
||||
for (var r = 1; r < this.info_.rows.length - 1; r++) {
|
||||
var row = this.info_.rows[r];
|
||||
if (!row.isSpacer() && this.info_.isCollapsed) {
|
||||
this.drawJaggedEdge_(row)
|
||||
if (!row.isSpacer() && this.info_.isCollapsed) {
|
||||
this.drawJaggedEdge_(row);
|
||||
} else if (row.hasStatement) {
|
||||
this.drawStatementInput_(row);
|
||||
} else if (row.hasExternalInput) {
|
||||
|
||||
@@ -202,7 +202,7 @@ Blockly.blockRendering.constants.PUZZLE_TAB = (function() {
|
||||
var halfHeight = height / 2;
|
||||
var control1Y = halfHeight + overlap;
|
||||
var control2Y = halfHeight + 0.5;
|
||||
var control3Y = overlap; //2.5
|
||||
var control3Y = overlap; // 2.5
|
||||
|
||||
var endPoint1 = Blockly.utils.svgPaths.point(-width, forward * halfHeight);
|
||||
var endPoint2 = Blockly.utils.svgPaths.point(width, forward * halfHeight);
|
||||
|
||||
@@ -173,7 +173,7 @@ Blockly.Toolbox.prototype.init = function() {
|
||||
Blockly.hideChaff(true);
|
||||
}
|
||||
Blockly.Touch.clearTouchIdentifier(); // Don't block future drags.
|
||||
}, /*opt_noCaptureIdentifier*/ false, /*opt_noPreventDefault*/ true);
|
||||
}, /* opt_noCaptureIdentifier */ false, /* opt_noPreventDefault */ true);
|
||||
var workspaceOptions = {
|
||||
disabledPatternId: workspace.options.disabledPatternId,
|
||||
parentWorkspace: workspace,
|
||||
|
||||
@@ -127,13 +127,13 @@ Blockly.TouchGesture.prototype.doStart = function(e) {
|
||||
Blockly.TouchGesture.prototype.bindMouseEvents = function(e) {
|
||||
this.onStartWrapper_ = Blockly.bindEventWithChecks_(
|
||||
document, 'mousedown', null, this.handleStart.bind(this),
|
||||
/*opt_noCaptureIdentifier*/ true);
|
||||
/* opt_noCaptureIdentifier */ true);
|
||||
this.onMoveWrapper_ = Blockly.bindEventWithChecks_(
|
||||
document, 'mousemove', null, this.handleMove.bind(this),
|
||||
/*opt_noCaptureIdentifier*/ true);
|
||||
/* opt_noCaptureIdentifier */ true);
|
||||
this.onUpWrapper_ = Blockly.bindEventWithChecks_(
|
||||
document, 'mouseup', null, this.handleUp.bind(this),
|
||||
/*opt_noCaptureIdentifier*/ true);
|
||||
/* opt_noCaptureIdentifier */ true);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -257,7 +257,7 @@ Blockly.WorkspaceCommentSvg.prototype.addDeleteDom_ = function() {
|
||||
* @private
|
||||
*/
|
||||
Blockly.WorkspaceCommentSvg.prototype.resizeMouseDown_ = function(e) {
|
||||
//this.promote_();
|
||||
// this.promote_();
|
||||
this.unbindDragEvents_();
|
||||
if (Blockly.utils.isRightButton(e)) {
|
||||
// No right-click.
|
||||
@@ -335,7 +335,7 @@ Blockly.WorkspaceCommentSvg.prototype.unbindDragEvents_ = function() {
|
||||
* @param {!Event} e Mouse up event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.WorkspaceCommentSvg.prototype.resizeMouseUp_ = function(/*e*/) {
|
||||
Blockly.WorkspaceCommentSvg.prototype.resizeMouseUp_ = function(/* e */) {
|
||||
Blockly.Touch.clearTouchIdentifier();
|
||||
this.unbindDragEvents_();
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
goog.provide('Blockly.WorkspaceSvg');
|
||||
|
||||
// TODO(scr): Fix circular dependencies
|
||||
//goog.require('Blockly.BlockSvg');
|
||||
// goog.require('Blockly.BlockSvg');
|
||||
goog.require('Blockly.ConnectionDB');
|
||||
goog.require('Blockly.constants');
|
||||
goog.require('Blockly.CursorSvg');
|
||||
|
||||
Reference in New Issue
Block a user