Skip to content

Commit

Permalink
toilets
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Aug 30, 2024
1 parent 553592c commit 2eb45f0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 105 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
build/*
webpage-uploader.sh
22 changes: 0 additions & 22 deletions application/assets/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,6 @@ const helper = (() => {
}, time);
};

//get location by ip
let geoip = function (callback, key) {
const url = "https://api.ipbase.com/v2/info?apikey=" + key;
let xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.responseType = "json";
xhr.send();
xhr.error = function (err) {
helper.side_toaster(err, 3000);
};

xhr.onload = function () {
let responseObj = xhr.response;
let latlng = [
responseObj.data.location.latitude,
responseObj.data.location.longitude,
];
callback(latlng);
};
};

//delete file
let deleteFile = function (filename) {
let sdcard = "";
Expand Down Expand Up @@ -411,7 +390,6 @@ const helper = (() => {
add_script,
deleteFile,
isOnline,
geoip,
side_toaster,
renameFile,
downloadFile,
Expand Down
26 changes: 0 additions & 26 deletions application/assets/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,32 +761,6 @@ const module = (() => {
function calculateGainAndLoss(altitudes) {
let gain = 0;
let loss = 0;
/*
let previousValidAltitude = null;
for (let i = 0; i < altitudes.length; i++) {
const currentAltitude = altitudes[i];
// Skip null or inaccurate altitude values
if (currentAltitude === null || isNaN(currentAltitude)) {
continue;
}
if (previousValidAltitude !== null) {
const altitudeDifference = currentAltitude - previousValidAltitude;
if (Math.abs(altitudeDifference) <= threshold) {
if (altitudeDifference > 0) {
gain += altitudeDifference;
} else {
loss += Math.abs(altitudeDifference);
}
}
}
previousValidAltitude = currentAltitude;
}
*/

const highestAltitude = Math.max(...altitudes);
const lowestAltitude = Math.min(...altitudes);
Expand Down
5 changes: 1 addition & 4 deletions application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@

</div>
</div>
<div id="olc"></div>

<div id="user-input" class="width-100 flex justify-content-spacearound">
<div id="user-input-description"></div>
Expand Down Expand Up @@ -466,9 +465,7 @@ <h2>Export</h2>
<button class="item" id="load_settings_from_file">
load settings
</button>
<!--<button tabindex="12" class="item" id="load_map_data">
import map data
</button>-->

</div>

<div class="panel menu-box" name="Device position" id="coordinations">
Expand Down
12 changes: 7 additions & 5 deletions application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ document.addEventListener("DOMContentLoaded", function () {
'<div class="item" data-type="overpass" data-url="amenity=bar">Bar</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
"afterend",
'<div class="item" data-type="overpass" data-url="amenity=toilets">Toilets</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
Expand Down Expand Up @@ -2301,7 +2308,6 @@ document.addEventListener("DOMContentLoaded", function () {
if (status.windowOpen == "scan") {
qr.stop_scan();
open_finder();
//windowOpen = "finder";
}

if (
Expand All @@ -2313,8 +2319,6 @@ document.addEventListener("DOMContentLoaded", function () {
if (status.windowOpen == "files-option") {
document.getElementById("files-option").style.display = "none";
open_finder();
// windowOpen = "finder";

break;
}

Expand Down Expand Up @@ -2773,8 +2777,6 @@ document.addEventListener("DOMContentLoaded", function () {
break;

case "5":
// maps.export_db();
//maps.import_db();
if (status.tracking_running) {
document.getElementById("tracking-view").style.display =
status.windowOpen === "trackingView" ? "none" : "flex";
Expand Down
22 changes: 0 additions & 22 deletions docs/assets/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,6 @@ const helper = (() => {
}, time);
};

//get location by ip
let geoip = function (callback, key) {
const url = "https://api.ipbase.com/v2/info?apikey=" + key;
let xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.responseType = "json";
xhr.send();
xhr.error = function (err) {
helper.side_toaster(err, 3000);
};

xhr.onload = function () {
let responseObj = xhr.response;
let latlng = [
responseObj.data.location.latitude,
responseObj.data.location.longitude,
];
callback(latlng);
};
};

//delete file
let deleteFile = function (filename) {
let sdcard = "";
Expand Down Expand Up @@ -411,7 +390,6 @@ const helper = (() => {
add_script,
deleteFile,
isOnline,
geoip,
side_toaster,
renameFile,
downloadFile,
Expand Down
26 changes: 0 additions & 26 deletions docs/assets/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,32 +761,6 @@ const module = (() => {
function calculateGainAndLoss(altitudes) {
let gain = 0;
let loss = 0;
/*
let previousValidAltitude = null;
for (let i = 0; i < altitudes.length; i++) {
const currentAltitude = altitudes[i];
// Skip null or inaccurate altitude values
if (currentAltitude === null || isNaN(currentAltitude)) {
continue;
}
if (previousValidAltitude !== null) {
const altitudeDifference = currentAltitude - previousValidAltitude;
if (Math.abs(altitudeDifference) <= threshold) {
if (altitudeDifference > 0) {
gain += altitudeDifference;
} else {
loss += Math.abs(altitudeDifference);
}
}
}
previousValidAltitude = currentAltitude;
}
*/

const highestAltitude = Math.max(...altitudes);
const lowestAltitude = Math.min(...altitudes);
Expand Down
7 changes: 7 additions & 0 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ document.addEventListener("DOMContentLoaded", function () {
'<div class="item" data-type="overpass" data-url="amenity=bar">Bar</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
"afterend",
'<div class="item" data-type="overpass" data-url="amenity=toilets">Toilets</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
Expand Down

0 comments on commit 2eb45f0

Please sign in to comment.