Skip to content

Commit

Permalink
Revert "Merge branch 'release/v0.7' into develop"
Browse files Browse the repository at this point in the history
This reverts commit 9722692, reversing
changes made to 693df57.
  • Loading branch information
Siyu Chen authored and Siyu Chen committed Jun 13, 2021
1 parent 9722692 commit 458eea4
Show file tree
Hide file tree
Showing 15 changed files with 9,334 additions and 9,066 deletions.
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"react-dom": "^16.13.1",
"react-papaparse": "^3.7.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1"
"react-scripts": "3.4.1",
"yarn": "^1.22.10"
},
"scripts": {
"start": "craco start",
Expand Down
29 changes: 29 additions & 0 deletions client/public/lib/arduino_compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -1204,4 +1204,33 @@ Blockly.Arduino.variables_set = function(a) {
Blockly.Arduino.variables_set_type = function(a) {
var b = Blockly.Arduino.valueToCode(a, "VARIABLE_SETTYPE_INPUT", Blockly.Arduino.ORDER_ASSIGNMENT) || "0";
return ["(" + Blockly.Arduino.getArduinoType_(Blockly.Types[a.getFieldValue("VARIABLE_SETTYPE_TYPE")]) + ")(" + b + ")", Blockly.Arduino.ORDER_ATOMIC]
};

//inline comment
Blockly.Arduino.insert_comment = function(a) {
var b;
var x;
if (0 == a.itemCount_) return "// \n";
if (1 == a.itemCount_) {
x = (Blockly.Arduino.valueToCode(a, "ADD0", Blockly.Arduino.ORDER_UNARY_POSTFIX) || '');
x = x.slice(0,-1);
x = x.substring(1);
return "// " + x + "\n";
}
var c;
b = [];
for (var d = 0; d < a.itemCount_; d++){
c = Blockly.Arduino.valueToCode(a, "ADD" + d, Blockly.Arduino.ORDER_NONE);
c = c.slice(0,-1);
c = c.substring(1);
b[d] = "" == c ? '' : "// " + c + "\n";
}
b = b.join("");
return b;
};

//block comment
Blockly.Arduino.block_comment = function(a) {
var b = Blockly.Arduino.statementToCode(a, 'comment');
return "/* " + a.getFieldValue("comment_input") + "\n" + b + "*/\n";
};
129 changes: 128 additions & 1 deletion client/public/lib/blocks_compressed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions client/public/lib/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,12 @@ Blockly.Msg.NEW_INSTANCE = "New instance...";
Blockly.Msg.NEW_INSTANCE_TITLE = "New instance name:";
Blockly.Msg.RENAME_INSTANCE = "Rename instance...";
Blockly.Msg.RENAME_INSTANCE_TITLE = "Rename all '%1' instances to:";
Blockly.Msg.COMMENT_TIP = "Put comment in the same line";
Blockly.Msg.BLOCK_COMMENT_TIP = "Put multiple line comment";
Blockly.Msg.COMMENT_HELPURL = "https://www.arduino.cc/reference/en/language/structure/further-syntax/singlelinecomment/";
Blockly.Msg.COMMENT_JOIN_ITEM_TOOLTIP = "Add one line of comment.";
Blockly.Msg.COMMENT_CREATE_JOIN_TOOLTIP = "Add, remove, or reorder sections to reconfigure this comment block.";
Blockly.Msg.COMMENT_CREATEWITH = "comments";



Original file line number Diff line number Diff line change
Expand Up @@ -279,92 +279,7 @@ export default function BlocklyCanvasPanel(props) {
return (

<div id='horizontal-container' className="flex flex-column">
<Spin tip="Compiling Code Please Wait..." className="compilePop" spinning={selectedCompile}>
<div id='top-container' className="flex flex-column vertical-container">
<div id='description-container' className="flex flex-row space-between card">
<div className='flex flex-row'>
{homePath ? <Link id='link' to={homePath} className="flex flex-column">
<i className="fa fa-home"/>
</Link> : null}
{handleGoBack ? <button onClick={handleGoBack} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-arrow-left"/>
</button> : null}
</div>
<div>
{isStudent && lastSavedTime ?
`Last changes saved ${lastSavedTime}`
: null
}
</div>
<div className='flex flex-row'>
{isStudent ?
<div className='flex flex-row'>
<VersionHistoryModal
saves={saves}
lastAutoSave={lastAutoSave}
defaultTemplate={day}
getFormattedDate={getFormattedDate}
loadSave={loadSave}
/>
<button onClick={handleManualSave} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-save"/>
</button>
</div>
: null
}
{isContentCreator ?
<div className='flex flex-row'>
<button onClick={handleCreatorSave} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-save"/>
</button>
</div>
: null}
<div className='flex flex-row'>
<button onClick={handleUndo} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-undo-alt"
style={workspaceRef.current ?
workspaceRef.current.undoStack_.length < 1 ?
{ color: 'grey', cursor: 'default' } : null
: null}
/>
</button>
<button onClick={handleRedo} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-redo-alt"
style={workspaceRef.current ?
workspaceRef.current.redoStack_.length < 1 ?
{ color: 'grey', cursor: 'default' } : null
: null}
/>
</button>
</div>
</div>
<div style={{ "width": "10%" }}>
<div id='action-btn-container' className="flex space-between">
{!isStudent ?
<CodeModal
title={'XML'}
workspaceRef={workspaceRef.current}
setHover={setHoverXml}
hover={hoverXml}
/>
: null}
<CodeModal
title={'Arduino Code'}
workspaceRef={workspaceRef.current}
setHover={setHoverArduino}
hover={hoverArduino}
/>
<i onClick={() => compileArduinoCode(workspaceRef.current, setSelectedCompile, day, isStudent)}
className="fas fa-upload hvr-info"
onMouseEnter={() => setHoverCompile(true)}
onMouseLeave={() => setHoverCompile(false)}/>

{hoverCompile && <div className="popup ModalCompile">Upload to Arduino</div>}
</div>
</div>
</div>
</div>
</Spin>

<div className='flex flex-row'>
<div id='bottom-container' className="flex flex-column vertical-container overflow-visible">
<Row>
Expand Down Expand Up @@ -481,6 +396,7 @@ export default function BlocklyCanvasPanel(props) {
{isContentCreator ?
<div id='side-container'>
Current Student Toolbox Selection

<Input
placeholder="Search Block"
prefix={<i className="fa fa-search" />}
Expand Down
24 changes: 21 additions & 3 deletions client/src/components/DayPanels/BlocklyCanvasPanel/CodeModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Modal, Button, Typography} from 'antd';
import React, {useState} from "react";
import {getArduino, getXml} from "../helpers";
import icon from "./textIcon.json";

export default function CodeModal(props) {
const [visible, setVisible] = useState(false);
Expand All @@ -21,9 +22,26 @@ export default function CodeModal(props) {

return (
<div id='code-modal'>
<i onClick={showModal} className={title === 'XML' ? "fa fa-code hvr-info" : "fa fa-font hvr-info"}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}/>
{
title === 'XML' ?
<i onClick={showModal} id='link' className="fa fa-code hvr-info"
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}/>
:
<svg xmlns="http://www.w3.org/2000/svg"
className="hvr-info"
viewBox="0 0 172 172"
onClick={showModal}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
>
<g>
<path d={icon.path}></path>
</g>
</svg>
}


{hover &&
(title === 'XML' ?
<div className="popup ModalCompile2">Shows XML</div> :
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path" : "M85.83203,22.77656c-0.54801,0.01312 -1.09438,0.06551 -1.63489,0.15677h-44.0638h-5.73333c-3.1648,0 -5.73333,2.56853 -5.73333,5.73333v17.2c0,3.1648 2.56853,5.73333 5.73333,5.73333h5.73333c3.1648,0 5.73333,-2.56853 5.73333,-5.73333v-5.73333h28.66667v91.73333h-5.73333c-3.1648,0 -5.73333,2.56853 -5.73333,5.73333v5.73333c0,3.1648 2.56853,5.73333 5.73333,5.73333h15.34114c1.23099,0.20221 2.48672,0.20221 3.71771,0h15.34114c3.1648,0 5.73333,-2.56853 5.73333,-5.73333v-5.73333c0,-3.1648 -2.56853,-5.73333 -5.73333,-5.73333h-5.73333v-91.73333h28.66667v5.73333c0, 3.1648 2.56853,5.73333 5.73333,5.73333h5.73333c3.1648,0 5.73333,-2.56853 5.73333,-5.73333v-17.2c0,-3.1648 -2.56853,-5.73333 -5.73333, -5.73333h-5.73333h-44.03021c-0.66226,-0.11084 -1.33298,-0.1633 -2.00442,-0.15677z"
}
1 change: 1 addition & 0 deletions client/src/components/DayPanels/DayInfoPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PlaceHolderImg1 from "../../assets/science.png";
import PlaceHolderImg2 from "../../assets/arduino.png";
import PlaceHolderImg3 from "../../assets/maker.png";

// THIS PAGE IS NO LONGER IN USE, SOME OF THE STYLING MAY NO LONGER APPLY
export default function DayInfoPanel(props) {
const {day} = props;

Expand Down
Loading

0 comments on commit 458eea4

Please sign in to comment.