Commit cabac92b authored by Jennie Yoder's avatar Jennie Yoder

added undo/redo icons. Made roboto the default font in the text block.

Removed the "refresh work area" button.
parent f26ff665
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -71,7 +71,7 @@ Blockly.Blocks['cylinder'] = {
.appendField(new Blockly.FieldDropdown([['not centered', 'false'], ['centered', 'true']]), 'CENTERDROPDOWN');
this.setInputsInline(true);
this.setPreviousStatement(true, 'CSG');
this.setTooltip('Creates a with a specified bottom radius, top radius, and height. Primitive may optionally be centered at the origin.');
this.setTooltip('Creates a cylinder with a specified bottom radius, top radius, and height. Primitive may optionally be centered at the origin.');
},
onchange: function() {
if (!this.workspace) {
......
......@@ -149,10 +149,10 @@ Blockly.Blocks.$fn={init:function(){this.category="TRANSFORM";this.setHelpUrl("h
this.plusCount_=0},mutationToDom:function(){if(!this.plusCount_)return null;var a=document.createElement("mutation");this.plusCount_&&a.setAttribute("plus",this.plusCount_);return a},domToMutation:function(a){this.plusCount_=parseInt(a.getAttribute("plus"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.plusCount_;b++)this.appendStatementInput("PLUS"+b).setCheck(a);1<=this.plusCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},updateShape_:function(a){1==a?(this.plusCount_++,
a=this.getInput("A").connection.check_,this.appendStatementInput("PLUS"+this.plusCount_).setCheck(a)):-1==a&&(this.removeInput("PLUS"+this.plusCount_),this.plusCount_--);1<=this.plusCount_?1==this.plusCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())},setType:function(a){if(this.workspace){this.previousConnection.setCheck(a);this.getInput("A").connection.setCheck(a);for(var b=1;b<=this.plusCount_;b++)this.getInput("PLUS"+
b).connection.setCheck(a)}}};
Blockly.Blocks.linearextrude={init:function(){this.category="EXTRUDE";this.setHelpUrl("http://www.example.com/");this.setColourHex(Blockscad.Toolbox.HEX_TRANSFORM);this.appendDummyInput().appendField("Linear Extrude ");this.appendValueInput("HEIGHT").setCheck("Number").appendField("height").setAlign(Blockly.ALIGN_RIGHT);this.appendValueInput("TWIST").setCheck("Number").appendField("twist").setAlign(Blockly.ALIGN_RIGHT);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["is not centered","false"],
["is centered","true"]]),"CENTERDROPDOWN").setAlign(Blockly.ALIGN_RIGHT);this.appendDummyInput().appendField("scale: ").setAlign(Blockly.ALIGN_RIGHT);this.appendValueInput("XSCALE").setCheck("Number").appendField("x").setAlign(Blockly.ALIGN_RIGHT);this.appendValueInput("YSCALE").setCheck("Number").appendField("y").setAlign(Blockly.ALIGN_RIGHT);this.appendStatementInput("A").setCheck("CAG");this.setInputsInline(!0);this.setPreviousStatement(!0,"CSG");this.setTooltip("Extrudes one or more 2-dimensional objects by a specified height with a specified twist. Resulting extrusion may optionally be centered around the origin.");
this.setMutatorPlus(new Blockly.MutatorPlus(this));this.plusCount_=0},mutationToDom:function(){if(!this.plusCount_)return null;var a=document.createElement("mutation");this.plusCount_&&a.setAttribute("plus",this.plusCount_);return a},domToMutation:function(a){this.plusCount_=parseInt(a.getAttribute("plus"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.plusCount_;b++)this.appendStatementInput("PLUS"+b).setCheck(a);1<=this.plusCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},
updateShape_:function(a){1==a?(this.plusCount_++,a=this.getInput("A").connection.check_,this.appendStatementInput("PLUS"+this.plusCount_).setCheck(a)):-1==a&&(this.removeInput("PLUS"+this.plusCount_),this.plusCount_--);1<=this.plusCount_?1==this.plusCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())}};
Blockly.Blocks.linearextrude={init:function(){this.category="EXTRUDE";this.setHelpUrl("http://www.example.com/");this.setColourHex(Blockscad.Toolbox.HEX_TRANSFORM);this.appendDummyInput().appendField("Linear Extrude ");this.appendValueInput("HEIGHT").setCheck("Number").appendField("height").setAlign(Blockly.ALIGN_RIGHT);this.appendValueInput("TWIST").setCheck("Number").appendField("twist").setAlign(Blockly.ALIGN_RIGHT);this.appendValueInput("XSCALE").setCheck("Number").appendField("scale: x").setAlign(Blockly.ALIGN_RIGHT);this.appendValueInput("YSCALE").setCheck("Number").appendField("y").setAlign(Blockly.ALIGN_RIGHT);
this.appendDummyInput().appendField(new Blockly.FieldDropdown([["is not centered","false"],["is centered","true"]]),"CENTERDROPDOWN").setAlign(Blockly.ALIGN_RIGHT);this.appendStatementInput("A").setCheck("CAG");this.setInputsInline(!0);this.setPreviousStatement(!0,"CSG");this.setTooltip("Extrudes one or more 2-dimensional objects by a specified height with a specified twist. Shape can be scaled as it extrudes in both x and y. Resulting extrusion may optionally be centered around the origin.");this.setMutatorPlus(new Blockly.MutatorPlus(this));
this.plusCount_=0},mutationToDom:function(){if(!this.plusCount_)return null;var a=document.createElement("mutation");this.plusCount_&&a.setAttribute("plus",this.plusCount_);return a},domToMutation:function(a){this.plusCount_=parseInt(a.getAttribute("plus"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.plusCount_;b++)this.appendStatementInput("PLUS"+b).setCheck(a);1<=this.plusCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},updateShape_:function(a){1==a?(this.plusCount_++,
a=this.getInput("A").connection.check_,this.appendStatementInput("PLUS"+this.plusCount_).setCheck(a)):-1==a&&(this.removeInput("PLUS"+this.plusCount_),this.plusCount_--);1<=this.plusCount_?1==this.plusCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())}};
Blockly.Blocks.rotateextrude={init:function(){this.category="EXTRUDE";this.setHelpUrl("http://www.example.com/");this.setColourHex(Blockscad.Toolbox.HEX_TRANSFORM);this.appendDummyInput().appendField("Rotate Extrude ");this.appendValueInput("FACES").setCheck("Number").appendField("sides").setAlign(Blockly.ALIGN_RIGHT);this.appendStatementInput("A").setCheck("CAG");this.setInputsInline(!0);this.setPreviousStatement(!0,"CSG");this.setTooltip("Rotate extrudes one or more 2-dimensional objects around the Z axis with a specified number of sides.");
this.setMutatorPlus(new Blockly.MutatorPlus(this));this.plusCount_=0},mutationToDom:function(){if(!this.plusCount_)return null;var a=document.createElement("mutation");this.plusCount_&&a.setAttribute("plus",this.plusCount_);return a},domToMutation:function(a){this.plusCount_=parseInt(a.getAttribute("plus"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.plusCount_;b++)this.appendStatementInput("PLUS"+b).setCheck(a);1<=this.plusCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},
updateShape_:function(a){1==a?(this.plusCount_++,a=this.getInput("A").connection.check_,this.appendStatementInput("PLUS"+this.plusCount_).setCheck(a)):-1==a&&(this.removeInput("PLUS"+this.plusCount_),this.plusCount_--);1<=this.plusCount_?1==this.plusCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())}};
......
......@@ -187,7 +187,7 @@ Blockscad.init = function() {
// I think the render button should start out disabled.
$('#renderButton').prop('disabled', true);
// $('#renderButton').prop('disabled', true);
// set up the delete-confirm button's function.
$('#throw-it-away').click(function() {
......@@ -357,7 +357,7 @@ Blockscad.init = function() {
// switch us back to the blocks tab in case we were on the code tab.
$('#displayBlocks').click();
// enable the render button.
$('#renderButton').prop('disabled', false);
// $('#renderButton').prop('disabled', false);
} else {
alert("Failed to load file");
......@@ -730,30 +730,30 @@ Blockscad.doRender = function() {
// Clear the previously rendered model
gProcessor.clearViewer();
// check to see if the code mixes 2D and 3D shapes to give a good error message
var mixes = Blockscad.mixes2and3D();
if (mixes[1] === 0) { // doesn't have any CSG or CAG shapes at all!
$( '#error-message' ).html("Error: Nothing to Render");
$( '#error-message' ).addClass("has-error");
// enable the render button.
$('#renderButton').prop('disabled', false);
// HACK: file load is too slow - if user tries to render during file load
// they get the "no objects to render" message. Enable the render button.
//$('#renderButton').prop('disabled', false);
return;
}
if (mixes[0]) { // has both 2D and 3D shapes
$( '#error-message' ).html("Error: both 2D and 3D objects are present. There can be only one.");
$( '#error-message' ).addClass("has-error");
// enable the render button.
$('#renderButton').prop('disabled', false);
return;
}
// check for missing fields and illegal values in blocks. Highlight them for the user
// and give an error message.
Blockscad.missingFields = [];
Blockscad.illegalValue = [];
var code = Blockly.OpenSCAD.workspaceToCode(Blockscad.workspace);
......@@ -805,6 +805,8 @@ Blockscad.doRender = function() {
$( '#error-message' ).html(errText);
$( '#error-message' ).addClass("has-error");
// enable the render button.
$('#renderButton').prop('disabled', false);
return;
}
Blockscad.loadTheseFonts = Blockscad.whichFonts(code);
......
......@@ -28,8 +28,8 @@ Blockscad.fonts = {};
// List and location of fonts to load into BlocksCAD
Blockscad.fontList = ['/fonts/liberation/LiberationSerif-Bold.ttf',
'/fonts/Roboto/Roboto-Bold.ttf',
Blockscad.fontList = ['/fonts/Roboto/Roboto-Bold.ttf',
'/fonts/liberation/LiberationSerif-Bold.ttf',
'/fonts/nimbus/nimbus-sans-l_bold.ttf',
'/fonts/AverageMono/AverageMonoSimp.ttf',
'/fonts/Open_Sans/OpenSans-ExtraBold.ttf',
......@@ -37,8 +37,8 @@ Blockscad.fontList = ['/fonts/liberation/LiberationSerif-Bold.ttf',
'/fonts/bangers/Bangers.ttf'];
// display names for fonts, used in font block (also used to key fonts object)
Blockscad.fontName = ['Liberation Serif',
'Roboto',
Blockscad.fontName = ['Roboto',
'Liberation Serif',
'Nimbus Sans',
'Average Mono',
'Open Sans',
......
......@@ -1129,6 +1129,7 @@ Blockscad.Processor.prototype = {
this.clearViewer();
this.processing = true;
$( '#renderButton' ).html("Render");
$( '#renderButton' ).prop('disabled', false);
//this.statusspan.innerHTML = "Rendering code <img id=busy src='imgs/busy.gif'>";
this.enableItems();
var that = this;
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="320"
height="256"
viewBox="0 0 320 256"
enable-background="new 0 0 512 512"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="redo.svg"><metadata
id="metadata9"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs7" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="846"
inkscape:window-height="633"
id="namedview5"
showgrid="false"
inkscape:zoom="0.87145996"
inkscape:cx="159.844"
inkscape:cy="45.406291"
inkscape:window-x="118"
inkscape:window-y="63"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" /><path
d="m 320,128 -128,128 0,-64 C 192,192 64,160 0,256 0,149.969 85.969,64 192,64 l 0,-64 z"
id="path3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" /></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="281.20117"
height="290.31836"
viewBox="0 0 281.20117 290.31836"
enable-background="new 0 0 512 512"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="refresh.svg"><metadata
id="metadata9"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs7" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="706"
id="namedview5"
showgrid="false"
inkscape:zoom="1.0028992"
inkscape:cx="17.226402"
inkscape:cy="85.568401"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-object-midpoints="true"
inkscape:object-nodes="true"
inkscape:snap-intersection-paths="false"
inkscape:object-paths="true"
inkscape:snap-global="false" /><g
id="g3359"
transform="matrix(-1,0,0,1,300.67578,-5.84375)"><path
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path3337"
d="M 160.07617,5.84375 C 93.656658,5.9038834 35.750543,51.037159 19.474609,115.43164 c 16.021123,17.12067 30.417968,14.74999 43.783203,0 14.903464,-40.621354 53.549378,-67.645664 96.818358,-67.703124 43.2883,0.03537 81.96096,27.063657 96.8711,67.703124 l 43.67578,0 C 284.35213,51.056887 226.4753,5.9288844 160.07617,5.84375 Z M 19.529297,186.57617 c 16.271671,64.37398 74.148312,109.50103 140.546873,109.58594 66.41822,-0.0608 124.3231,-45.19294 140.59961,-109.58594 -15.10766,-1.95457 -31.02912,-0.63175 -43.7832,0 -14.90386,40.61992 -53.54865,67.6432 -96.81641,67.70117 -43.2878,-0.0351 -81.96031,-27.06248 -96.871092,-67.70117 z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
inkscape:connector-curvature="0"
id="path3351"
d="m 203.90345,115.43164 96.7196,-96.7196 0,96.7196 -96.7196,0"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 19.529297,283.29577 96.719603,-96.7196 -96.719603,0 0,96.7196"
id="path3353"
inkscape:connector-curvature="0" /><ellipse
ry="19.443628"
rx="21.437847"
cy="114.90903"
cx="41.380039"
id="path3355"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><ellipse
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="ellipse3357"
cx="278.67044"
cy="188.58179"
rx="21.437847"
ry="19.443628" /></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="320"
height="256"
viewBox="0 0 320 256"
enable-background="new 0 0 512 512"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="undo.svg"><metadata
id="metadata9"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs7" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="846"
inkscape:window-height="633"
id="namedview5"
showgrid="false"
inkscape:zoom="0.87145996"
inkscape:cx="159.844"
inkscape:cy="45.406291"
inkscape:window-x="118"
inkscape:window-y="63"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" /><path
d="m 0,128 128,128 0,-64 c 0,0 128,-32 192,64 C 320,149.969 234.031,64 128,64 l 0,-64 z"
id="path3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" /></svg>
\ No newline at end of file
......@@ -169,10 +169,10 @@
<input type="text" id="project-name" class="form-control proj-input" value="Untitled" maxlength="28" style="width: 300px;">
</div>
<div class="btn-over-blockly" style="margin-left: 20px">
<button id="redrawBlocksButton" class="btn btn-default notext" type="button"
<!-- <button id="redrawBlocksButton" class="btn btn-default notext" type="button"
title="Redraw all blocks in workspace." style="margin-right:20px">
<img src='imgs/refresh.svg' width='19px' height='19px'>
</button>
</button> -->
<div class="btn-group navbar-btn" role="group" aria-label="...">
<div style="display: inline-block" title="Undo" style="margin-right:-5px">
<button type="button" class="btn btn-default" id="undoButton" style="margin-right: -5px">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment