Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ <h5 id="sizeFeedback">Size: 100%</h5>
</div>

<div class="download-container">
<a href="#" class="downloadBtn" >Download</a>
<a href="#" id="downloadBtn" class="downloadBtn" >Download</a>
</div>

<div class="download-container">
<a href="#" id="design_btn" class="downloadBtn" >Design Request</a>
</div>
<a href="http://bit.ly/1N2YWHh" target="_blank">
<button class="download-container">
Expand Down
22 changes: 20 additions & 2 deletions js/src/limbforge-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ var specs = {
name: "",
directory: ""
}
},
},
designRequestURL = "make4all.org",
designs = [],
hl;

$(document).ready(function(){
// Fetch the manifest so it's available everywhere!
$.get('designs.json').then(function(data){
// store reference to designRequestURL so that the designRequest button works.
designRequestURL = data["requestURL"];

// store reference to full list of designs so they can be shown in a drop down.
designs = data["designs"];

Expand Down Expand Up @@ -72,12 +76,18 @@ $(document).ready(function(){
});

// Download Button
$('.downloadBtn').click(function(e){
$('#downloadBtn').click(function(e){
e.preventDefault();
downloadHand();
});


//Request New Design Help Button
$('#designBtn').click(function(e){
e.preventDefault();
openDesignRequestURL();
});

function zipFileName(specs){
return "LimbForge_" + specs.hand + "_" + specs.size + ".zip";
}
Expand Down Expand Up @@ -149,4 +159,12 @@ $(document).ready(function(){
});
}

// this is called when the user presses the 'Request Design Help' button
function openDesignRequestURL() {
// load the url at designRequestURL (found in designs.json) into a new window
// and focus the browser on that window
var win = window.open(designRequestURL, '_blank');
win.focus();
}

});