une image sera prise toutes les 0 jours 0 heures 0 minutes
diff --git a/index.html b/index.html
index f12874b..5132b68 100644
--- a/index.html
+++ b/index.html
@@ -40,7 +40,6 @@
-
Caméra Timelapse
Caméra Timelapse
diff --git a/js/index.js b/js/index.js
index 70df028..19ce055 100644
--- a/js/index.js
+++ b/js/index.js
@@ -164,7 +164,7 @@ function handleResize() {
window.addEventListener('resize', handleResize);
function isMobileDevice() {
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera);
+ return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera ) || document.documentElement.clientWidth / document.documentElement.clientHeight < 1;
}
window.addEventListener('DOMContentLoaded', (event) => {
@@ -178,7 +178,7 @@ window.addEventListener('DOMContentLoaded', (event) => {
});
const newH1 = document.createElement('h1');
newH1.textContent = "Caméra Timelapse sur mobile, utilisez l'app !!!";
- newH1.classList.add('global_title');
+ newH1.classList.add('global_title_h1');
body.appendChild(newH1);
}
});
@@ -195,7 +195,6 @@ function change_title_style() {
titlePlaceHolder.classList.add('container-title');
ball.style.display = 'block';
xyz.style.display = 'block';
- h1_title.style.display = 'none';
} else {
titleIsReadable = true;
titlePlaceHolder.classList.remove('container-title');
diff --git a/js/utilities/jquery.js b/js/utilities/jquery.js
index f840c67..04dc2fc 100644
--- a/js/utilities/jquery.js
+++ b/js/utilities/jquery.js
@@ -4889,7 +4889,6 @@
try {
(h = !1), c.send(a, l);
} catch (e) {
- if (h) throw e;
l(-1, e);
}
} else l(-1, "No Transport");
@@ -5173,11 +5172,13 @@
});
}),
(o = o("abort"));
- try {
- r.send((i.hasContent && i.data) || null);
- } catch (e) {
- if (o) throw e;
- }
+ try {
+ r.send((i.hasContent && i.data) || null);
+ } catch (e) {
+ // Do nothing or handle the error silently
+ // Remove or comment out the console.log statement
+ // if (o) console.log('error');
+ }
},
abort: function () {
o && o();
diff --git a/js/utilities/routes.js b/js/utilities/routes.js
index abf9219..0a50fe6 100644
--- a/js/utilities/routes.js
+++ b/js/utilities/routes.js
@@ -39,16 +39,18 @@ function getSingleProject(id) {
});
}
-function getDataMetrics(projectId){
- return $.ajax({
- url: api_url.concat(`/projects/${projectId}/measurements`),
- method: "GET",
- dataType: "json",
- }).then((data) => {
- // If the request is successful, store the data in the cache and return it
- localStorage.setItem("project_list", JSON.stringify(data));
- return data;
- });
+async function getDataMetrics(projectId){
+ try {
+ const response = await $.ajax({
+ url: api_url.concat(`/projects/${projectId}/measurements`),
+ method: "GET",
+ dataType: "json",
+ });
+ return response;
+ } catch (error) {
+ console.log("no data for this project")
+ return error.status;
+ }
}
@@ -62,8 +64,7 @@ async function getDataProjectVideosFromApi(id) {
// If the request is successful, store the data in the cache and return it
return response;
} catch (error) {
- alert("Error fetching data:", error);
- throw error; // Re-throw the error to handle it outside the function if needed
+ return(error.status)
}
}
@@ -181,15 +182,15 @@ async function renderVideo(id){
}
}
-async function start_timelapse(id,frequency){
+async function start_timelapse(id,frequency,nbimages){
try {
const mydata = JSON.stringify({
projectId: id,
- interval: frequency
-
+ interval: frequency,
+ nb_images: nbimages
});
const response = await $.ajax({
- url: api_url.concat(`/procedure/start/`),
+ url: api_url.concat(`/procedure/start`),
method: "POST",
dataType: "json",
contentType: "application/json",
@@ -198,7 +199,6 @@ async function start_timelapse(id,frequency){
alert("data retrieval started:", response);
} catch (error) {
- alert("Error starting the retrieval:", error);
throw error;
}
}