commented out Octopart Magic autofill until we fix the API

pull/3/head
Marek Baczynski 1 year ago
parent 3edd0542b8
commit a9ee37f96e

@ -266,20 +266,20 @@ function container_onchange() {
} }
} }
function octopartFetch(){ // function octopartFetch(){
$('#magic-autofill-button').attr('disabled', 'disabled'); // $('#magic-autofill-button').attr('disabled', 'disabled');
$.getJSON(rootURL + 'fetchOctopartSnippet/' + $('#partno-input').val()).done(function(json){ // $.getJSON(rootURL + 'fetchOctopartSnippet/' + $('#partno-input').val()).done(function(json){
$('#magic-autofill-button').removeAttr('disabled'); // $('#magic-autofill-button').removeAttr('disabled');
if (json['result']=='ok'){ // if (json['result']=='ok'){
$('#description-input').val(json['snippet']); // $('#description-input').val(json['snippet']);
}else{ // }else{
$('#description-input').val(''); // $('#description-input').val('');
$('#description-input').attr('placeholder', json['result']); // $('#description-input').attr('placeholder', json['result']);
} // }
}).fail(function() { // }).fail(function() {
$('#magic-autofill-button').removeAttr('disabled'); // $('#magic-autofill-button').removeAttr('disabled');
}); // });
} // }
$(document).ready(function() { $(document).ready(function() {
$.ajaxSetup({ cache: false }); $.ajaxSetup({ cache: false });

@ -58,7 +58,7 @@
<tr id="partno" class="details-content"><td><p></p><input type="text" name="partno-input" placeholder="Part Number" class="pinfo-input" id="partno-input"/></td></tr> <tr id="partno" class="details-content"><td><p></p><input type="text" name="partno-input" placeholder="Part Number" class="pinfo-input" id="partno-input"/></td></tr>
<tr id="description-head" class="details-header"><td>DESCRIPTION</td></tr> <tr id="description-head" class="details-header"><td>DESCRIPTION</td></tr>
<tr id="description" class="details-content"><td><p></p><input type="text" name="description-input" placeholder="Description" class="pinfo-input" id="description-input"/></td></tr> <tr id="description" class="details-content"><td><p></p><input type="text" name="description-input" placeholder="Description" class="pinfo-input" id="description-input"/></td></tr>
<tr id="magical_autofill" style="display:none"><td><input type="button" id="magic-autofill-button" onclick="octopartFetch()" value="magical auto-fill" style="margin-bottom:6pt"/> powered by <a href="http://octopart.com" class="small_link">OctoPart™</a></td></tr> <!-- <tr id="magical_autofill" style="display:none"><td><input type="button" id="magic-autofill-button" onclick="octopartFetch()" value="magical auto-fill" style="margin-bottom:6pt"/> powered by <a href="http://octopart.com" class="small_link">OctoPart™</a></td></tr> -->
<tr id="datasheet-head" class="details-header"><td>DATASHEET: </td></tr> <tr id="datasheet-head" class="details-header"><td>DATASHEET: </td></tr>
<tr id="datasheet" style="display: none"><td><input type="file" accept=".pdf" class="pinfo-input" id="datasheet-finput"></td></tr> <tr id="datasheet" style="display: none"><td><input type="file" accept=".pdf" class="pinfo-input" id="datasheet-finput"></td></tr>
<tr id="datasheet" style="display: none"><td>OR: <input type="text" class="pinfo-input" name="datasheet-url-input" style="width:80%; margin-bottom: 6pt;" placeholder="Datasheet URL"></td></tr> <tr id="datasheet" style="display: none"><td>OR: <input type="text" class="pinfo-input" name="datasheet-url-input" style="width:80%; margin-bottom: 6pt;" placeholder="Datasheet URL"></td></tr>

Loading…
Cancel
Save