Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCanet committed May 21, 2020
1 parent 2b227b5 commit bfe207b
Show file tree
Hide file tree
Showing 61 changed files with 1,494 additions and 1,450 deletions.
178 changes: 89 additions & 89 deletions blockly/demos/keyboard_nav/line_cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @constructor
* @extends {Blockly.BasicCursor}
*/
Blockly.LineCursor = function() {
Blockly.LineCursor.superClass_.constructor.call(this);
Blockly.LineCursor = function () {
Blockly.LineCursor.superClass_.constructor.call(this);
};
Blockly.utils.object.inherits(Blockly.LineCursor, Blockly.BasicCursor);

Expand All @@ -34,23 +34,23 @@ Blockly.utils.object.inherits(Blockly.LineCursor, Blockly.BasicCursor);
* not set or there is no next value.
* @override
*/
Blockly.LineCursor.prototype.next = function() {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getNextNode_(curNode, this.validLineNode_);

// Skip the input or next value if there is a connected block.
if (newNode && (newNode.getType() == Blockly.ASTNode.types.INPUT ||
newNode.getType() == Blockly.ASTNode.types.NEXT) &&
newNode.getLocation().targetBlock()) {
newNode = this.getNextNode_(newNode, this.validLineNode_);
}
if (newNode) {
this.setCurNode(newNode);
}
return newNode;
Blockly.LineCursor.prototype.next = function () {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getNextNode_(curNode, this.validLineNode_);

// Skip the input or next value if there is a connected block.
if (newNode && (newNode.getType() == Blockly.ASTNode.types.INPUT ||
newNode.getType() == Blockly.ASTNode.types.NEXT) &&
newNode.getLocation().targetBlock()) {
newNode = this.getNextNode_(newNode, this.validLineNode_);
}
if (newNode) {
this.setCurNode(newNode);
}
return newNode;
};

/**
Expand All @@ -60,17 +60,17 @@ Blockly.LineCursor.prototype.next = function() {
* not set or there is no next value.
* @override
*/
Blockly.LineCursor.prototype.in = function() {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getNextNode_(curNode, this.validInLineNode_);

if (newNode) {
this.setCurNode(newNode);
}
return newNode;
Blockly.LineCursor.prototype.in = function () {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getNextNode_(curNode, this.validInLineNode_);

if (newNode) {
this.setCurNode(newNode);
}
return newNode;
};

/**
Expand All @@ -79,23 +79,23 @@ Blockly.LineCursor.prototype.in = function() {
* is not set or there is no previous value.
* @override
*/
Blockly.LineCursor.prototype.prev = function() {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getPreviousNode_(curNode, this.validLineNode_);
if (newNode && (newNode.getType() == Blockly.ASTNode.types.INPUT ||
newNode.getType() == Blockly.ASTNode.types.NEXT) &&
newNode.getLocation().targetBlock()) {
newNode = this.getPreviousNode_(newNode, this.validLineNode_);
}

if (newNode) {
this.setCurNode(newNode);
}
return newNode;
Blockly.LineCursor.prototype.prev = function () {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getPreviousNode_(curNode, this.validLineNode_);

if (newNode && (newNode.getType() == Blockly.ASTNode.types.INPUT ||
newNode.getType() == Blockly.ASTNode.types.NEXT) &&
newNode.getLocation().targetBlock()) {
newNode = this.getPreviousNode_(newNode, this.validLineNode_);
}

if (newNode) {
this.setCurNode(newNode);
}
return newNode;
};

/**
Expand All @@ -105,17 +105,17 @@ Blockly.LineCursor.prototype.prev = function() {
* not set or there is no previous value.
* @override
*/
Blockly.LineCursor.prototype.out = function() {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getPreviousNode_(curNode, this.validInLineNode_);

if (newNode) {
this.setCurNode(newNode);
}
return newNode;
Blockly.LineCursor.prototype.out = function () {
var curNode = this.getCurNode();
if (!curNode) {
return null;
}
var newNode = this.getPreviousNode_(curNode, this.validInLineNode_);

if (newNode) {
this.setCurNode(newNode);
}
return newNode;

};

Expand All @@ -126,24 +126,24 @@ Blockly.LineCursor.prototype.out = function() {
* @return {boolean} True if the node should be visited, false otherwise.
* @private
*/
Blockly.LineCursor.prototype.validLineNode_ = function(node) {
if (!node) {
return false;
}
var isValid = false;
var location = node.getLocation();
var type = node && node.getType();
if (type == Blockly.ASTNode.types.BLOCK) {
if (location.outputConnection === null) {
isValid = true;
Blockly.LineCursor.prototype.validLineNode_ = function (node) {
if (!node) {
return false;
}
var isValid = false;
var location = node.getLocation();
var type = node && node.getType();
if (type == Blockly.ASTNode.types.BLOCK) {
if (location.outputConnection === null) {
isValid = true;
}
} else if (type == Blockly.ASTNode.types.INPUT &&
location.type == Blockly.NEXT_STATEMENT) {
isValid = true;
} else if (type == Blockly.ASTNode.types.NEXT) {
isValid = true;
}
} else if (type == Blockly.ASTNode.types.INPUT &&
location.type == Blockly.NEXT_STATEMENT) {
isValid = true;
} else if (type == Blockly.ASTNode.types.NEXT) {
isValid = true;
}
return isValid;
return isValid;
};

/**
Expand All @@ -152,18 +152,18 @@ Blockly.LineCursor.prototype.validLineNode_ = function(node) {
* @return {boolean} True if the node should be visited, false otherwise.
* @private
*/
Blockly.LineCursor.prototype.validInLineNode_ = function(node) {
if (!node) {
return false;
}
var isValid = false;
var location = node.getLocation();
var type = node && node.getType();
if (type == Blockly.ASTNode.types.FIELD) {
isValid = true;
} else if (type == Blockly.ASTNode.types.INPUT &&
location.type == Blockly.INPUT_VALUE) {
isValid = true;
}
return isValid;
Blockly.LineCursor.prototype.validInLineNode_ = function (node) {
if (!node) {
return false;
}
var isValid = false;
var location = node.getLocation();
var type = node && node.getType();
if (type == Blockly.ASTNode.types.FIELD) {
isValid = true;
} else if (type == Blockly.ASTNode.types.INPUT &&
location.type == Blockly.INPUT_VALUE) {
isValid = true;
}
return isValid;
};
92 changes: 46 additions & 46 deletions blocklyduino/css/blocklyduino.css
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ td.tabMiddle {

/* Colours for the new code highlighting in code peek */
.new_code_highlight {
background-color: #FFF200; /* same color as blockly highlight */
background-color: #FFF200; /* same color as blockly highlight */
}

/* The boards list modal (background) */
/* The boards list modal (background) */
.modal {
position: fixed; /* Stay in place */
z-index: 200; /* Sit on top */
Expand All @@ -278,13 +278,13 @@ td.tabMiddle {
transition: top 0.5s, opacity 0.4s;
}
.overlay{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
background-color: rgba(0,0,0,0.5); /*dim the background*/
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
background-color: rgba(0,0,0,0.5); /*dim the background*/
}
.modal.show {
/* Firefox */
Expand Down Expand Up @@ -347,65 +347,65 @@ td.tabMiddle {
width: 200px;
}
#hideSelectScrollbar {
display: inline-block;
vertical-align: top;
overflow: hidden;
border: solid grey 1px;
display: inline-block;
vertical-align: top;
overflow: hidden;
border: solid grey 1px;
}
#hideSelectScrollbar > select {
padding: 10px;
margin: -5px -20px -5px -5px;
padding: 10px;
margin: -5px -20px -5px -5px;
}
#arduino_mini_picture_div {
position:absolute;
right:65px;
width:166px;
height:266px;
position:absolute;
right:65px;
width:166px;
height:266px;
}
#arduino_board_mini_picture {
text-align: center;
width:166px;
height:266px;
width:166px;
height:266px;
object-fit: contain;
}
.modalBoard_info {
left: 230px;
left: 380px;
position: absolute;
}
/* collapsible content inside div */
.collapsibleButton {
background-color: #006468;
color: #FFFFFF;
cursor: pointer;
padding: 10px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: large;
font-weight: bold;
background-color: #006468;
color: #FFFFFF;
cursor: pointer;
padding: 10px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: large;
font-weight: bold;
}
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.active, .collapsibleButton:hover {
background-color: #FFCC00;
color: #000000;
background-color: #FFCC00;
color: #000000;
}
/* Style the collapsible content. Note: hidden by default */
.collapsibleContent {
visibility: hidden;
padding: 0 18px;
background-color: white;
max-height: 0;
overflow: hidden;
transition: max-height 0.1s ease-out;
visibility: hidden;
padding: 0 18px;
background-color: white;
max-height: 0;
overflow: hidden;
transition: max-height 0.1s ease-out;
}
.collapsibleButton:after {
content: '\02795'; /* Unicode character for "plus" sign (+) */
float: left;
padding-right: 5px;
transition: 0.1s ease-out;
content: '\02795'; /* Unicode character for "plus" sign (+) */
float: left;
padding-right: 5px;
transition: 0.1s ease-out;
}
.active:after {
transform: rotateZ(45deg);
transition: 0.1s ease-out;
transform: rotateZ(45deg);
transition: 0.1s ease-out;
}
Loading

0 comments on commit bfe207b

Please sign in to comment.