Skip to content

Commit

Permalink
Removed upload from frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvVajpeyi committed Jul 26, 2021
1 parent 3d4f4d9 commit 01b9efe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
26 changes: 0 additions & 26 deletions client/assets/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ $('#submit-query').click(function() {
getPhotos();
});

$('#submit-upload').click(function() {
$('#error').hide();
uploadPhoto();
});

$('#record').click(function() {
$('#record').hide()
$('#error').hide();
Expand Down Expand Up @@ -79,27 +74,6 @@ function getPhotos() {
});
}

function uploadPhoto() {
$('#upload-icon').removeClass("fa-upload");
$('#upload-icon').addClass("fa-spinner");
const reader = new FileReader();
var filename = $('#upload-img').val().split('\\').pop();
var imgFiles = $('#upload-img').prop('files');
if(imgFiles.length > 0) {
let imgFile=imgFiles[0];
reader.onload = function(e) {
let img_bin = e.target.result.replace(/^data:image\/(png|jpg|jpeg);base64,/, '');
sdk.uploadKeyPut({'key': filename, 'Content-Type': 'application/json'}, img_bin, {})
.then((response)=>{
$('#upload-icon').removeClass("fa-spinner");
$('#upload-icon').addClass("fa-upload");
});
$('#upload-img').val('');
};
reader.readAsDataURL(imgFile);
}
}

function stream_audio(stream) {
var inputSampleRate;
micStream = new mic();
Expand Down
4 changes: 0 additions & 4 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
<button type="submit" id="stop-record" hidden><i class="fa fa-microphone-slash"></i></button>
<button type="submit" id="submit-query"><i class="fa fa-search" id="search-icon"></i></button>
</div>
<div class="upload-container">
<input type="file" id="upload-img" accept="image/png, image/jpeg, image/jpg">
<button type="submit" id="submit-upload"><i class="fa fa-upload" id="upload-icon"></i></button>
</div>
<div id="error" class="isa_error" hidden></div>
</div>
<div class="gallery"></div>
Expand Down

0 comments on commit 01b9efe

Please sign in to comment.