|
|
|
@ -26,7 +26,7 @@ $(document).ready(function() {
|
|
|
|
|
filter += 16;
|
|
|
|
|
if($('#notes').is(':checked'))
|
|
|
|
|
filter += 32;
|
|
|
|
|
$.getJSON('http://127.0.0.1:5000/query/' + filter + '/' + query, function(data) {
|
|
|
|
|
$.getJSON('https://www.elab.kth.se/parts/query/' + filter + '/' + query, function(data) {
|
|
|
|
|
var newResults = '<div class="results">';
|
|
|
|
|
for(var i = 0; i < data.length; i++) { // Create new view for results
|
|
|
|
|
newResults += '<div class="results-row" part-id="' + data[i].id + '">';
|
|
|
|
@ -60,7 +60,7 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
newResults += '<div class="results-datasheet">';
|
|
|
|
|
if (data[i].datasheet != null)
|
|
|
|
|
newResults += '<a href="http://127.0.0.1:5000/getfile/' + data[i].datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>';
|
|
|
|
|
newResults += '<a href="https://www.elab.kth.se/parts/getfile/' + data[i].datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>';
|
|
|
|
|
newResults += '</div>';
|
|
|
|
|
newResults += '</a>'
|
|
|
|
|
newResults += '</div>';
|
|
|
|
@ -74,7 +74,7 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
$('.results-row').on('click', function() {
|
|
|
|
|
var partID = $(this).attr('part-id');
|
|
|
|
|
$.getJSON('http://127.0.0.1:5000/getpartinfo/' + partID, function(data) {
|
|
|
|
|
$.getJSON('https://www.elab.kth.se/parts/getpartinfo/' + partID, function(data) {
|
|
|
|
|
// TODO: Fill stuff with the fetched info
|
|
|
|
|
}).fail(function() {
|
|
|
|
|
console.log( "Fetching part info failed" );
|
|
|
|
|