Commit c88b555d authored by Juan Blanco Segleau's avatar Juan Blanco Segleau

Implements threejs in the viewer, no touch controls implemented yet

parent d4904ed2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>BlocksCAD</title>
<!-- compressed javascript files for non-debug stuff -->
<script type="text/javascript" src="blockly/blockly_compressed.js"></script>
<script type="text/javascript" src="blockly/blocks_compressed.js"></script>
<script src="jquery/jquery-1.11.3.js"></script>
<script src="jquery/jquery-ui.min.js"></script>
<script src="jquery/jquery.hammer.js"></script>
<script src="jquery/jquery.ui.touch-punch.min.js"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="bootstrap/bootstrap-3.3.4-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="bootstrap/bootstrap-3.3.4-dist/css/bootstrap-theme.min.css">
<script src="bootstrap/bootstrap-3.3.4-dist/js/bootstrap.min.js"></script>
<!--
<script type="text/javascript" src="blockly/blockly_uncompressed.js"></script>
<script type="text/javascript" src="blockly/blocks/colour.js"></script>
<script type="text/javascript" src="blockly/blocks/geom_set_ops.js"></script>
<script type="text/javascript" src="blockly/blocks/lists.js"></script>
<script type="text/javascript" src="blockly/blocks/logic.js"></script>
<script type="text/javascript" src="blockly/blocks/loops.js"></script>
<script type="text/javascript" src="blockly/blocks/math.js"></script>
<script type="text/javascript" src="blockly/blocks/primitives.js"></script>
<script type="text/javascript" src="blockly/blocks/procedures.js"></script>
<script type="text/javascript" src="blockly/blocks/text.js"></script>
<script type="text/javascript" src="blockly/blocks/variables.js"></script>
-->
<script type="text/javascript" src="blockly/openscad_compressed.js"></script>
<!-- eventually, the generated stuff should go in a different file. But for now, lets include this: -->
<!--<script type="text/javascript" src="generated/en.js"></script>-->
<!--<script type"text/javascript" src="blockly/generators/openscad/extra.js"></script>-->
<!--
<script type="text/javascript" src="blockscad/utils.js"></script>
<script type="text/javascript" src="blockscad/storage.js"></script>
<script type="text/javascript" src="blockscad/FileSaver.js"></script>
<script type="text/javascript" src="blockscad/deflate.js"></script>
<script type="text/javascript" src="blockscad/blockscad.js"></script>
<script type="text/javascript" src="blockscad/stl.js"></script>
<script type="text/javascript" src="blockscad/toolbox.js"></script>
<script type="text/javascript" src="blockscad/text.js"></script>
<script src="blockscad/lightgl.js"></script>
-->
<script type="text/javascript" src="backend_compressed.js"></script>
<!-- viewer stuff -->
<script type="text/javascript" src="blockscad/viewer_compressed.js"></script>
<!-- <script type="text/javascript" src="blockscad/csg.js"></script>
<script type="text/javascript" src="blockscad/formats.js"></script>
<script type="text/javascript" src="blockscad/viewer.js"></script>
-->
<script src="blockscad/blockscad_compressed.js"></script>
<script src="blockscad/underscore.js"></script>
<script src="blockscad/openscad-openjscad-translator.js"></script>
<!-- end viewer stuff -->
<!-- font manip library -->
<script src="opentype/dist/opentype.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- blocksCAD's css -->
<link rel="stylesheet" href="blockscad/style.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="main">
<!-- start the html at the top: the navigation bar. -->
<nav class="navbar navbar-default" id="top-navigation-bar">
<div class="container-fluid">
<a class="navbar-brand" href="#">BlocksCAD</a>
<!-- Collect the nav links, forms, and other content for toggling -->
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Project<span class="caret"></span></a>
<ul id="file-menu" class="dropdown-menu" role="menu">
<li><a href="#" class="new-project">New</a></li>
<li class="divider"></li>
<li><a href="#" id="saveLocal">Save Blocks to your Computer</a></li>
<li>
<input type="file" accept=".xml" id="loadLocal" style="visibility: hidden; width: 1px; height: 1px" />
<a href="#" onclick="document.getElementById('loadLocal').click(); return false">Load Blocks from your Computer</a>
</li>
<li class="divider"></li>
<li>
<input type="file" accept=".xml" id="importLocal" style="visibility: hidden; width: 1px; height: 1px" />
<a href="#" onclick="document.getElementById('importLocal').click(); return false">Import Blocks into Current Project</a>
</li>
<li>
<input type="file" accept=".stl" id="importStl" style="visibility: hidden; width: 1px; height: 1px" />
<a href="#" onclick="document.getElementById('importStl').click(); return false">Import STL into Current Project</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Options<span class="caret"></span></a>
<ul id="options-menu" class="dropdown-menu" role="menu">
<li><a href="#" id="simpleToolbox">Simple Toolbox</a></li>
<li><a href="#" id="advancedToolbox">Advanced Toolbox</a></li>
<li>
<a class="trigger right-caret">Block Color Scheme</a>
<ul class="dropdown-menu sub-menu">
<li><a href="#" id="colors_one">Classic</a></li>
<li><a href="#" id="colors_two">Pale</a></li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span class="caret"></span></a>
<ul id="help-menu" class="dropdown-menu" role="menu">
<li><a href="/docs/" target="_blank">Documentation</a></li>
<li class="divider"></li>
<li><a href="#" data-toggle="modal" data-target="#about-modal">About</a></li>
</ul>
</li>
</ul>
<div id="login-area" class="navbar-right">
</div>
<select class="form-control navbar-form navbar-right" id="languageMenu">
</select>
</div> <!-- /.container-fluid -->
</nav>
<!-- after the navbar, I want a second row to contain the project name (if any), -->
<!-- undo/redo/discard_all, and the "Blocks/Code" tabs. I'll use a div for this. -->
<div id="editView">
<nav class="navbar navbar-default navbar-narrow"> <!-- second nav row -->
<ul class="nav nav-pills navbar-right">
<li class="active"><a href="#blocklyContainer" data-toggle="pill" id="displayBlocks">Blocks</a></li>
<li><a href='#openScadPre' data-toggle="pill" id="displayCode">Code</a></li>
</ul>
<div class="input-group">
<span class="input-group-addon" id="proj_name_label">Project Name</span>
<input type="text" id="project-name" class="form-control proj-input" value="Untitled" maxlength="24" style="width: 300px;">
</div>
<div class="btn-over-blockly">
<div class="btn-group navbar-btn" role="group" aria-label="...">
<button type="button" class="btn btn-default" id="undoButton">Undo</button>
<button type="button" class="btn btn-default" id="redoButton">Redo</button>
</div>
<button id="trashButton" class="btn btn-default notext">
<img src='blockly/media/1x1.gif' class="trash icon21">
</button>
</div> <!-- undo/redo/trash div -->
</nav> <!-- end second nav row -->
<!-- End of the header content -->
<!-- beginning of page content (blockly + viewer) -->
<div class="tab-content">
<div class="tab-pane active" id="blocklyContainer">
<div id="blocklyDiv">
<div class='resizableDiv'>
<div id="renderDiv">
<select id="viewMenu" class="vmenu">
<option value="diagonal">diagonal</option>
<option value="front">front</option>
<option value="top">top</option>
<option value="right">right</option>
<option value="left">left</option>
<option value="back">back</option>
<option value="bottom">bottom</option>
</select>
<button type="button" id="viewReset" class="vreset">
Reset View
</button>
<button type="button" id="axesButton" class="btn btn-default btn-pushed">
<img src="imgs/axes.png">
</button>
</div> <!--renderDiv -->
<div id="paneContainer">
<div id="renderPane">
<button type="button" class="btn btn-default btn-lg " id="renderButton">Render</button>
<button type="button" class="btn btn-default btn-lg btn-danger " id="abortButton">Abort!</button>
<div id="stl_buttons" class="pull-right" style="padding:5px 5px;">
<select id="render-type" style="padding:2px 4px;"></select>
<button type="button" class="btn btn-default btn-lg" id="stlButton">Export STL</button>
</div>
<div id="render-ongoing">Rendering <img id=busy src='imgs/busy2.gif'></div>
<div id="error-message"></div>
</div>
</div> <!-- paneContainer -->
</div> <!-- resizable div -->
</div> <!-- blocklyDiv -->
</div>
<!-- Blockly Container (tab pane)-->
<pre class="tab-pane content" id="openScadPre"></pre>
</div>
<!-- end tab content -->
</div> <!-- end of the #editView content -->
<div id="projectView" style="display:none">
<!-- first row - a "my projects" label, a "New" button on the right -->
<div style="width:100%; background-color:#bbbbff;">
<span class="proj-header">My Projects</span>
<button type="button" class="btn btn-default new-project vcenter">New Project</button>
</div>
<table class="table table-striped">
<colgroup>
<col class="col-md-4">
<col class="col-md-4">
<!-- this was the column for shared attribute <col class="col-md-2"> -->
<col class="col-md-4">
</colgroup>
<thead>
<tr>
<th>Project Name</th>
<th>Last Modified</th>
<!-- this is the shared column <th>Shared</th> -->
<th></th>
</tr>
</thead>
<tbody id="projList">
</tbody>
</table>
<button type="button" id="list-more" class="btn btn-default">More</button>
</div> <!-- end of projectView -->
</div> <!-- end of main -->
<!-- html for Popups -->
<!-- Popup login -->
<div id='login-user' class="modal">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<form id='login-form'>
<fieldset>
<div class="modal-header">
<a href="#" data-dismiss="modal" class="close">
</a>
<h3>Sign in</h3>
</div>
<div class="modal-body">
<div class="form-group">
<label class="control-label" for="username">Username</label>
<input class="username pull-right" id="login-username" type="text" autocomplete="off" name="username" maxlength="30" />
</div>
<div class="form-group">
<label class="control-label" for="password">Password</label>
<input type="password" name="password" id="login-password" autocomplete="off" class="password pull-right" maxlength="30"/>
</div>
</div>
<div class="modal-footer">
<div class="footer-error" id="login-error" style="margin-top:-5px; margin-bottom:12px; "></div>
<div>
<button class="button primary" type="submit" style="float: left;">Sign in</button>
<a href="#" id="forgot-password" style="float: right;">Forgot Password?</a>
</div>
</div>
</fieldset>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Login Popup -->
<!-- Popup change Password -->
<div id='change-password-modal' class="modal" data-backdrop="true">
<div class="modal-dialog">
<div class="modal-content">
<form id='password-settings-form' novalidate>
<fieldset>
<div class="modal-header">
<a href="#" data-dismiss="modal" data-target="#password-settings-modal" class="close">x
</a>
<h3>Change Password</h3>
<span>When you're done, BlocksCAD will prompt you to log in again.</span>
</div>
<div class="modal-body">
<div class="form-group">
<label class="control-label mycl" for="password">Old Password</label>
<input type="password" id="change-pw-old" name="old-password" autocomplete="off" class="password regform" maxlength="30"/>
<div class="form-error">
<span class="password-error"></span>
</div>
</div>
<div class="form-group">
<label class="control-label mycl" for="password">New Password</label>
<input type="password" id="change-pw-new" name="new-password" autocomplete="off" class="password regform" maxlength="30"/>
<div class="form-error">
<span class="password-error"></span>
</div>
</div>
<div class="form-group">
<label class="control-label mycl" for="pass2">Retype Password</label>
<input type="password" id="change-pw-2" autocomplete="off" class="password regform" maxlength="30"/>
<div class="form-error">
<span class="password-confirm-error"></span>
</div>
</div>
<div class="buttons-right">
<button class="button primary" type="submit">Submit</button>
</div>
</div>
<div class="modal-footer">
<span class="footer-error" id="pw-error"></span>
</div>
</fieldset>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- end change password popup -->
<!-- Popup change Email -->
<div id='change-email-modal' class="modal" data-backdrop="true">
<div class="modal-dialog">
<div class="modal-content">
<form id='email-settings-form' novalidate>
<fieldset>
<div class="modal-header">
<a href="#" data-dismiss="modal" data-target="#email-settings-modal" class="close">x
</a>
<h3>Change Email</h3>
</div>
<div class="modal-body">
<p id="current-email">Current Email is: </p>
<div class="form-group">
<label class="control-label mycl" for="email">New Email</label>
<input type="text" id="new-email" name="new-email" autocomplete="off" class="email regform" size="30"/>
<div class="form-error">
<span class="email-error"></span>
</div>
</div>
<div class="form-group">
<label class="control-label mycl" for="password">Password</label>
<input type="password" id="change-email-pw" name="password" autocomplete="off" class="password regform" maxlength="30"/>
</div>
<div class="buttons-right">
<button class="button primary" type="submit">Submit</button>
</div>
</div>
<div class="modal-footer">
<span class="footer-error" id="email-pw-error"></span>
</div>
</fieldset>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- end change password popup -->
<!-- Popup register user -->
<div id='register-user' class="modal">
<div class="modal-dialog">
<div class="modal-content modal-md">
<form id='register-form'>
<fieldset>
<div class="modal-header">
<a href="#" data-dismiss="modal" class="close">x
</a>
<h3>Register New User</h3>
</div>
<div class="modal-body">
<div class="form-group">
<label class="control-label mycl" for="username">Username</label>
<input class="username regform" id="register-username" type="text" autocomplete="off" name="username" maxlength="30" />
<div class="form-error">
<span id="username-error"></span>
</div>
</div>
<div class="form-group">
<label class="control-label mycl" for="password">Password</label>
<input type="password" id="register-password" name="password" autocomplete="off" class="password regform" maxlength="30"/>
<div class="form-error">
<span class="password-error"></span>
</div>
</div>
<div class="form-group">
<label class="control-label mycl" for="pass2">Retype Password</label>
<input type="password" id="pass2" autocomplete="off" class="password regform" maxlength="30"/>
<div class="form-error">
<span class="password-confirm-error"></span>
</div>
</div>
<div class="form-group">
<label class="control-label mycl" for="email">Email</label>
<input type="text" id="register-email" name="email" autocomplete="off" class="email regform"/>
<div class="form-error">
<span class="email-error"></span>
</div>
</div>
</div>
<div class="modal-footer">
<span class="error"></span>
<div class="buttons-right">
<button class="button primary" type="submit">Register</button>
</div>
</div>
</fieldset>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- end of registration popup -->
<!-- Popup password recovery-->
<div id='pw-recover' class="modal">
<div class="modal-dialog">
<div class="modal-content modal-md">
<form id='pw-recover-form'novalidate>
<fieldset>
<div class="modal-header">
<a href="#" data-dismiss="modal" class="close">x
</a>
<h3>Password Recovery</h3>
</div>
<div class="modal-body">
<p><b>Whoops, forget your password?</b></p>
<p>No problem, just enter your username OR the email address associated with your account and we'll send you an email with instructions to reset your password. </p>
<div class="form-group">
<label class="control-label mycl" for="username">Enter Username</label>
<input class="username regform" id="recover-username" type="text" autocomplete="off" name="username" maxlength="30" />
<div>
<span class="email-error" id="un-recover-error" style="color:#b04444;"></span>
</div>
</div><p>or</p>
<div class="form-group">
<label class="control-label mycl" for="email">Enter Email</label>
<input type="text" id="recover-email" name="email" autocomplete="off" class="email regform"/>
<div>
<span class="email-error" id="em-recover-error" style="color:#b04444;"></span>
</div>
</div>
</div>
<div class="modal-footer">
<div class="buttons-right">
<button class="button primary" type="submit">Send me a new password reset link!</button>
</div>
</div>
</fieldset>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal --> <!-- end of password recovery popup -->
<!-- password recovery email sent modal -->
<div id="recover-email-sent" class="modal">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h3>Password Recovery Email has been Sent</h3>
</div>
<div class="modal-body">
We've sent an email to the address associated with your account with a link to reset your password. If you don't see it, check your spam folder.
</div>
</div>
</div>
</div> <!-- end of password recovery email sent modal -->
<!-- delete confirm popup -->
<div id="delete-confirm" class="modal">
<div class="modal-dialog modal-sm" style="width:400px">
<div class="modal-content">
<div class="modal-header">
<h4 >Discard Contents of the Current Project?</h4>
</div>
<div class="modal-footer">
<button id="throw-it-away" class="button btn-lg btn-default primary pull-left" aria-label="Okay" style="margin-left:90px" type="button" data-dismiss="modal" data-target="#delete-confirm">Okay</button>
<button class="button btn-default btn-lg primary" style="margin-right:90px" type="button" aria-label="Cancel" data-dismiss="modal" data-target="#delete-confirm">Cancel</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div> <!-- end of delete-confirm popup -->
<!-- online delete confirm popup -->
<div id="online-delete-confirm" class="modal" data-backdrop="false">
<div class="modal-dialog modal-sm" style="width:400px">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Are you sure you want to delete this project?</h4>
</div>
<div class="modal-footer">
<button id="toss-it" class="button btn-lg btn-default primary pull-left" style="margin-left:90px" type="button" data-dismiss="modal" data-target="#online-delete-confirm">Sure</button>
<button id="whatthe" class="button btn-default btn-lg primary" style="margin-right:90px" type="button" data-dismiss="modal" data-target="#online-delete-confirm">Cancel</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div> <!-- end of online delete-confirm popup -->
<!-- delete account confirm popup -->
<div id="delete-account-confirm" class="modal">
<div class="modal-dialog modal-sm" style="width:600px">
<div class="modal-content">
<div class="modal-header">
<h4>Are you sure you want to delete your BlocksCAD account?</h4>
</div>
<div class="modal-footer">
<button id="delete-account-yes" class="button btn-lg btn-default primary pull-left" style="margin-left:10%" type="button" data-dismiss="modal" data-target="#delete-account-confirm">Yes - Next Step</button>
<button class="button btn-default btn-lg primary" style="margin-right:10%" type="button" data-dismiss="modal" data-target="#delete-account-confirm">Keep My Account</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- end of delete-confirm popup -->
<!-- delete account popup -->
<div id="delete-account-modal" class="modal">
<div class="modal-dialog modal-sm" style="width:600px">
<div class="modal-content">
<form id='delete-account-form' novalidate>
<fieldset>
<div class="modal-header">
<a href="#" data-dismiss="modal" data-target="#delete-account-modal" class="close">x
</a>
<h4>Delete My Account</h4>
<h3>In about 48 hours your account will be <b>permanently deleted.</b></h3>
<p>If you change your mind, just sign in to your account within the next 48 hours.</p>
</div>
<div class="modal-body">
<div class="form-group">
<label for="password">Enter password to confirm: </label>
<input type="password" id="del-acct-pw" name="password" autocomplete="off" class="password regform" maxlength="30"/>
<div class="form-error">
<span class="password-error"></span>
</div>
</div>
<div class="buttons-right">
<button class="button primary btn-default btn-lg" type="submit">Delete Account and Sign Out</button>
</div>
</div>
<div class="modal-footer">
<span class="footer-error" id="da-pw-error"></span>
</div>
</fieldset>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- end of delete account popup -->
<!-- delete reactivate popup -->
<div id="delete-reactivate" class="modal">
<div class="modal-dialog modal-sm" style="width:500px">
<div class="modal-content">
<div class="modal-header">
<a href="#" data-dismiss="modal" class="close">x
</a>
<h4><b>Your account will not be deleted</b></h4>
</div>
<div class="modal-body">
<p> Your account was scheduled for deletion but you logged in. Your account has been reactivated.
If you didn’t request for your account to be deleted, you should <a href="#" data-toggle="modal" data-target="#change-password-modal" data-dismiss="modal" data-target="#delete-reactivate">change your password</a> to make sure your account is secure.</p>
</div>
<div class="modal-footer">
<button class="button btn-default btn-lg primary" style="margin-right:10%" type="button" data-dismiss="modal" data-target="#delete-reactivate">Continue</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- end of delete reactivate popup -->
<!-- About popup -->
<div id='about-modal' class="modal fade" tabindex="-1" role="dialog" aria-labelledby="about-modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 class="modal-title">BlocksCAD
<small>Easy, Open-Source Solid CAD for Everyone!</small></h3>
</div>
<div class="modal-body">
<div>
<p>Version 1.1.0 (2015/09/18)</p>
<br>
<p>Want to help? <a href="https://github.com/EinsteinsWorkshop/BlocksCAD">Get involved!</a></p>
<p>Have feedback? <a href="mailto://blockscad@einsteinsworkshop.com">blockscad@einsteinsworkshop.com</a>
<p><small><small>Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA) and delivered to the U.S. Government with Unlimited Rights as defined in DFARS 252.227-7013.<br>Approved for Public Release, Distribution Unlimited.<br>Created by Katy Hamilton, J. Yoder, and Matthew Minuti. Copyright and Trademark 2014-2015 H3XL, Inc.</small></small>
</p>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-4">
<a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html" target="_blank">Licensed GPLv3 or later</a></div>
<div class="col-md-4">
<a href="TOS.html" target="_blank">Terms of Service</a></div>
<div class="col-md-4">
<a href="privacy.html" target="_blank">Privacy Policy</a></div>
</div>
</div>
</div>
</div>
</div>
<!-- end of popups -->
</body>
</html>
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