diff --git a/src/pages/settings.html b/src/pages/settings.html
index a1e8d3f..9e78201 100644
--- a/src/pages/settings.html
+++ b/src/pages/settings.html
@@ -138,7 +138,7 @@
- أدخِل المنطقة الزمنية (بالإنجليزية: Time zone) الخاص بدولتك
+ أدخِل المنطقة الزمنية (بالإنجليزية: Time zone) الخاص بدولتك
@@ -158,7 +158,7 @@
- أدخِل طريقة حساب أوقات الصلاة (ام القرى , رابطة العالم الإسلامي ,الهيئة المصرية العامة للمساحة الخ ...)
+ أدخِل طريقة حساب أوقات الصلاة (ام القرى, رابطة العالم الإسلامي, الخ ...)
@@ -182,6 +182,44 @@
diff --git a/src/preload/audio_window.js b/src/preload/audio_window.js
index b7445ba..9f33767 100644
--- a/src/preload/audio_window.js
+++ b/src/preload/audio_window.js
@@ -6,11 +6,9 @@ const adhanModule = require('../modules/adhan.js')
window.addEventListener('DOMContentLoaded', async (e) => {
e.preventDefault();
-
+
let App_Path = await ipcRenderer?.invoke('App_Path3');
- let location = fs.readJsonSync(path.join(App_Path, './data/location.json'));
let settings = fs.readJsonSync(path.join(App_Path, './data/settings.json'));
- let audioJson = fs.readJsonSync(path.join(App_Path, './data/audio_window.json'));
let variables_css = document.getElementById("variables_css");
let icon_closed_window = document.getElementById("icon_closed_window");
@@ -38,12 +36,15 @@ window.addEventListener('DOMContentLoaded', async (e) => {
while (true) {
- await new Promise(resolve => setTimeout(resolve, 60000));
-
+ await new Promise(resolve => setTimeout(resolve, 30000));
+ let audioJson = fs.readJsonSync(path.join(App_Path, './data/audio_window.json'));
+ let location = fs.readJsonSync(path.join(App_Path, './data/location.json'));
+ let settings = fs.readJsonSync(path.join(App_Path, './data/settings.json'));
let data = adhanModule(path, fs, App_Path, location);
- let time_now = moment().tz(location?.timezone).format('LT');
+ let time_now_adhan = moment().tz(location?.timezone).format('LT');
+ let time_now_adhkar = moment().tz(location?.timezone).format('HH:mm');
- if (time_now === data.fajr && audioJson?.start === false && settings?.notifications_adhan) {
+ if (time_now_adhan === data.fajr && audioJson?.start === false && settings?.notifications_adhan) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'حان الان وقت صلاة الفجر'
@@ -55,7 +56,7 @@ window.addEventListener('DOMContentLoaded', async (e) => {
}, 600000);
}
- else if (time_now === data.dhuhr && audioJson?.start === false && settings?.notifications_adhan) {
+ else if (time_now_adhan === data.dhuhr && audioJson?.start === false && settings?.notifications_adhan) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'حان الان وقت صلاة الظهر'
@@ -67,7 +68,7 @@ window.addEventListener('DOMContentLoaded', async (e) => {
}, 600000);
}
- else if (time_now === data.asr && audioJson?.start === false && settings?.notifications_adhan) {
+ else if (time_now_adhan === data.asr && audioJson?.start === false && settings?.notifications_adhan) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'حان الان وقت صلاة العصر'
@@ -79,7 +80,7 @@ window.addEventListener('DOMContentLoaded', async (e) => {
}, 600000);
}
- else if (time_now === data.maghrib && audioJson?.start === false && settings?.notifications_adhan) {
+ else if (time_now_adhan === data.maghrib && audioJson?.start === false && settings?.notifications_adhan) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'حان الان وقت صلاة المغرب'
@@ -91,7 +92,7 @@ window.addEventListener('DOMContentLoaded', async (e) => {
}, 600000);
}
- else if (time_now === data.isha && audioJson?.start === false && settings?.notifications_adhan) {
+ else if (time_now_adhan === data.isha && audioJson?.start === false && settings?.notifications_adhan) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'حان الان وقت صلاة العشاء'
@@ -103,7 +104,7 @@ window.addEventListener('DOMContentLoaded', async (e) => {
}, 600000);
}
- else if (time_now === '7:40 AM' && audioJson?.start === false && settings?.notifications_adhkar) {
+ else if (time_now_adhkar === settings?.morning_adhkar_time && audioJson?.start === false && settings?.notifications_adhkar) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'أذكار الصباح ☀️ | بصوت إدريس أبكر 🔊';
@@ -115,7 +116,7 @@ window.addEventListener('DOMContentLoaded', async (e) => {
}, 600000);
}
- else if (time_now === '7:40 PM' && audioJson?.start === false && settings?.notifications_adhkar) {
+ else if (time_now_adhkar === settings?.evening_adhkar_time && audioJson?.start === false && settings?.notifications_adhkar) {
audioBoolean(App_Path, true);
ipcRenderer.send('show3');
document.getElementById('text').innerText = 'أذكار المساء 🌑 | بصوت فيصل بن جذيان 🔊';
diff --git a/src/preload/preload_modules/settings.js b/src/preload/preload_modules/settings.js
index 3e4aa85..ed0e549 100644
--- a/src/preload/preload_modules/settings.js
+++ b/src/preload/preload_modules/settings.js
@@ -13,7 +13,8 @@ module.exports = function settings(fs, path, App_Path, settings, ipcRenderer) {
let minimizeToPanel = document.getElementById('minimizeToPanel');
let dark_mode = document.getElementById('dark_mode');
let selected = document.getElementById(settings?.Calculation);
-
+ let morning_adhkar_time = document.getElementById("morning_adhkar_time");
+ let evening_adhkar_time = document.getElementById("evening_adhkar_time");
let save = document.getElementById('save');
let alrt = document.getElementById('alrt');
@@ -25,6 +26,8 @@ module.exports = function settings(fs, path, App_Path, settings, ipcRenderer) {
autostart.checked = settings?.autostart || false
startHidden.checked = settings?.startHidden || false
minimizeToPanel.checked = settings?.minimizeToPanel || false
+ morning_adhkar_time.value = settings?.morning_adhkar_time || ""
+ evening_adhkar_time.value = settings?.evening_adhkar_time || ""
dark_mode.checked = settings?.dark_mode ? true : false
selected.selected = "selected"
@@ -96,17 +99,18 @@ module.exports = function settings(fs, path, App_Path, settings, ipcRenderer) {
minimizeToPanel: minimizeToPanel.checked,
dark_mode: dark_mode.checked,
Calculation: Calculation.value,
+ morning_adhkar_time: morning_adhkar_time.value,
+ evening_adhkar_time: evening_adhkar_time.value,
notifications_adhan: notifications_adhan.checked,
notifications_adhkar: notifications_adhkar.checked,
volume: volumeRange.value / 100,
adhanVolume: adhanVolumeRange.value / 100
}, { spaces: '\t' });
-
alrt.style.display = 'inline-flex';
setTimeout(() => {
alrt.style.display = 'none';
- window.location.href = "./settings.html";
+ //window.location.href = "./settings.html";
}, 1000);
})
diff --git a/src/public/css/settings.css b/src/public/css/settings.css
index ef0167c..4ddfb80 100644
--- a/src/public/css/settings.css
+++ b/src/public/css/settings.css
@@ -18,7 +18,9 @@
#latitude,
#longitude,
-#timezone {
+#timezone,
+#morning_adhkar_time,
+#evening_adhkar_time {
width: 300px;
height: 35px;
text-align: center;