User editor, baseURL change, remove octopart autofill

This commit is contained in:
2022-11-28 21:32:02 +01:00
committed by marek
parent 8bb2a9d318
commit a549c16548
7 changed files with 78 additions and 26 deletions
View File
Regular → Executable
+11 -1
View File
@@ -213,6 +213,7 @@ function show_part_info(partID) {
}).fail(function() {
console.log( "Fetching part info failed" );
});
// update URL and history
var query = $('.search-bar').val();
window.history.pushState('searching', '', 'parts?q=' + query + '&p=' + partID)
@@ -248,7 +249,7 @@ function perform_query() {
$('#no-results').animate({opacity:1},2000);
console.log( "Query failed" );
});
// update URL and history
window.history.pushState('searching', '', 'parts?q=' + query)
}
@@ -306,6 +307,15 @@ $(document).ready(function() {
show_part_info(search_params.get('p'));
}
//For linking to a search query or specific part
const search_params = new URLSearchParams(window.location.search);
if(search_params.has('q')){
$('.search-bar').val(search_params.get('q')); perform_query();
}
if(search_params.has('p')){
show_part_info(search_params.get('p'));
}
// $('#partno-input').bind('blur',function() {
// if($('#partno-input').val().length > 0){
// octopartFetch();
Regular → Executable
View File
Regular → Executable
View File