You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
var currentDate = new Date('Feb 16, 2025 15:00:00');
|
|
var day = currentDate.getDate();
|
|
var month = currentDate.getMonth() + 1; // Months are zero-indexed, so add 1
|
|
var year = currentDate.getFullYear();
|
|
var formattedDate = day + '/' + month + '/' + year;
|
|
var currentVersion = 'v1.3.5 [' + formattedDate + ']';
|
|
|
|
getInitialSettings();
|
|
removeUrlParameters();
|
|
|
|
function getInitialSettings() {
|
|
$.ajax({
|
|
url: './static_data',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
|
|
['qthLatitude', 'qthLongitude', 'defaultTheme', 'bgImage', 'rdsMode'].forEach(key => {
|
|
if (data[key] !== undefined) {
|
|
localStorage.setItem(key, data[key]);
|
|
}
|
|
});
|
|
|
|
data.presets.forEach((preset, index) => {
|
|
localStorage.setItem(`preset${index + 1}`, preset);
|
|
});
|
|
},
|
|
error: function (error) {
|
|
console.error('Error:', error);
|
|
}
|
|
});
|
|
}
|
|
|
|
function removeUrlParameters() {
|
|
if (window.location.pathname === "/") {
|
|
var urlWithoutParams = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
|
window.history.replaceState({ path: urlWithoutParams }, '', urlWithoutParams);
|
|
}
|
|
}
|