From e8396d06344393106a03f201d4937afbbbee9495 Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Wed, 12 May 2021 16:34:06 +0530 Subject: [PATCH] fixes --- static/index.html | 9 +++++++-- static/js/{camera.js => images.js} | 8 ++++---- static/js/onload.js | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) rename static/js/{camera.js => images.js} (89%) diff --git a/static/index.html b/static/index.html index e0c79a5..7a4a59c 100644 --- a/static/index.html +++ b/static/index.html @@ -197,7 +197,12 @@ @@ -254,7 +259,7 @@ - + diff --git a/static/js/camera.js b/static/js/images.js similarity index 89% rename from static/js/camera.js rename to static/js/images.js index bb15032..8aa1d65 100644 --- a/static/js/camera.js +++ b/static/js/images.js @@ -1,11 +1,11 @@ -let Camera = class { - static setupCamera() { +let Images = class { + static setupImages() { $('#file-input')[0].addEventListener('change', function(e) { const file = e.target.files[0]; if (!file) { return; } - Camera.compressImage(file, 0.1, 'image/webp'); + Images.compressImage(file, 0.1, 'image/webp'); }); } @@ -22,7 +22,7 @@ let Camera = class { if(base64data.length > 63488 && mime != 'image/jpeg') { base64data = null; result = null; - Camera.compressImage(file, 0.7, 'image/jpeg'); + Images.compressImage(file, 0.7, 'image/jpeg'); return; } else if(base64data.length > 63488 && mime == 'image/jpeg') { var prop = { diff --git a/static/js/onload.js b/static/js/onload.js index 733dfb0..e586ceb 100644 --- a/static/js/onload.js +++ b/static/js/onload.js @@ -45,5 +45,5 @@ $(document).ready(function() { send(); }); - Camera.setupCamera(); + Images.setupImages(); }); \ No newline at end of file