Skip to content

Commit

Permalink
إضافة حصن المسلم (صوت) + بعض التحسينات
Browse files Browse the repository at this point in the history
  • Loading branch information
islamiaat committed Dec 26, 2022
1 parent 6d7768f commit aff7528
Show file tree
Hide file tree
Showing 30 changed files with 3,387 additions and 2,484 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
- تغير طريقة حساب أوقات الصلاة (**ام القرى , رابطة العالم الإسلامي ,الهيئة المصرية العامة للمساحة الخ ...**)
- إشعار صوتي (**أذان**) بدخول وقت الصلاة
- إشعار صوتي بـ أذكار الصباح والمساء
- بدء تشغيل التطبيق مع بدء تشغيل النظام (**ويندوز فقط**)
- حصن المسلم (صوت)
- بدء تشغيل التطبيق مع بدء تشغيل النظام - ويندوز - لينكس
- إيقاف وتشغيل الإشعارات
- نافذة شريط القوائم (**منطقة الإعلامات**) تبين الساعة + الصلاة القادمة

Expand Down
49 changes: 46 additions & 3 deletions Window/home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const fs = require('fs-extra');
const path = require('path');
const createFile = require('../module/createFile.js');
const tray_window = require('./tray_window.js')
const location = require('../module/location.js');
Expand Down Expand Up @@ -45,6 +46,13 @@ module.exports = async function homeWindow(BrowserWindow, ipcMain, app, Tray, Me
win?.on('closed', (event) => {

event?.preventDefault();
let App_Path = path.join(app?.getPath("appData"), '/altaqwaa');
let soundJson = fs.readJsonSync(path.join(App_Path, './data/sound.json'));
let audioJson = fs.readJsonSync(path.join(App_Path, './data/audio_window.json'));
audioJson.start = false
soundJson.sound = true
fs.writeJsonSync(path.join(App_Path, './data/sound.json'), soundJson);
fs.writeJsonSync(path.join(App_Path, './data/audio_window.json'), audioJson);
// tray?.destroy();
tray = null
contextMenu = null
Expand Down Expand Up @@ -87,14 +95,49 @@ module.exports = async function homeWindow(BrowserWindow, ipcMain, app, Tray, Me
tray?.setContextMenu(contextMenu);
tray?.setToolTip("التقوى");

tray_window(tray, win, ipcMain, app);

if (process.argv.includes('--hidden')) {

win?.hide()

}

else if (process.platform === 'win32' || process.platform === "win64") {

tray_window(tray, win, ipcMain, app);
}

else if (process.platform === 'linux') {

let homePath = app?.getPath('home');
let desktop = fs.existsSync(`${homePath}/.config/autostart/Altaqwaa.desktop`);

tray.on('click', () => {

if (win?.isVisible()) {
win?.hide();
}
else {
win?.show();
}
});

if (desktop === false) {

let data = '[Desktop Entry]\n'
data += 'Name=Altaqwaa\n'
data += 'Icon=org.altaqwaa.rn0x\n'
data += 'Exec=altaqwaa\n'
data += 'Terminal=false\n'
data += 'Type=Application\n'
data += 'Comment=Altaqwaa-Islamic-Desktop-Application\n'
data += 'Categories=Education'

fs.writeFileSync(`${homePath}/.config/autostart/Altaqwaa.desktop`, data);

}

}

globalShortcut?.register('Ctrl+shift+T', () => {

if (win?.isVisible()) {
Expand Down
13 changes: 9 additions & 4 deletions Window/tray_window.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@ module.exports = function tray_window(tray, win, ipcMain, app) {

});


adhkar.on('ready', () => {

adhkar.tray.on('click', () => {

win?.hide();
adhkar?.showWindow();
})
if (win?.isVisible()) {
win?.hide();
adhkar?.showWindow();
}
else {
win?.show();
adhkar?.hideWindow()
}
});

});

Expand Down
2,927 changes: 2,927 additions & 0 deletions data/hisnmuslim.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const audio_window = require('./Window/audio_window.js');
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.

app.on('ready', (e) => {

e.preventDefault();
Expand Down
26 changes: 16 additions & 10 deletions module/createFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ module.exports = function createFile(App_Path) {
if (fs.existsSync(path.join(App_Path, './data')) === false) {

fs.mkdirsSync(path.join(App_Path, '/data'), { recursive: true });

}



if (fs.existsSync(path.join(App_Path, './data/Now.json')) === false) {

fs.writeJsonSync(path.join(App_Path, './data/Now.json'), {"id":"surah_number_1"}, { spaces: '\t' });

fs.writeJsonSync(path.join(App_Path, './data/Now.json'), { "id": "surah_number_1" }, { spaces: '\t' });

}

if (fs.existsSync(path.join(App_Path, './data/audio_window.json')) === false) {

fs.writeJsonSync(path.join(App_Path, './data/audio_window.json'), { "start": false }, { spaces: '\t' });

}

if (fs.existsSync(path.join(App_Path, './data/settings.json')) === false) {
Expand All @@ -24,15 +30,15 @@ module.exports = function createFile(App_Path) {
"notifications_adhan": true,
"notifications_adhkar": true
}

fs.writeJsonSync(path.join(App_Path, './data/settings.json'), settings, { spaces: '\t' });

}

if (fs.existsSync(path.join(App_Path, './data/sound.json')) === false) {

fs.writeJsonSync(path.join(App_Path, './data/sound.json'), {"sound":false}, { spaces: '\t' });
fs.writeJsonSync(path.join(App_Path, './data/sound.json'), { "sound": true }, { spaces: '\t' });

}

}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altaqwaa",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "https://www.altaqwaa.org",
"description": "Altaqwaa - Islamic Desktop Application",
"main": "index.js",
Expand All @@ -21,19 +21,19 @@
},
"dependencies": {
"adhan": "^4.4.3",
"fs-extra": "^10.1.0",
"menubar": "^9.2.1",
"fs-extra": "^11.1.0",
"menubar": "^9.2.3",
"moment-duration-format": "^2.3.2",
"moment-hijri": "^2.1.2",
"moment-timezone": "^0.5.34",
"moment-timezone": "^0.5.40",
"node-fetch": "^2.6.7",
"request": "^2.88.2",
"v8-compile-cache": "^2.3.0"
},
"devDependencies": {
"electron": "19.0.11",
"electron-builder": "^23.3.3",
"nodemon": "^2.0.19"
"electron": "21.0.0",
"electron-builder": "^23.6.0",
"nodemon": "^2.0.20"
},
"build": {
"directories": {
Expand Down
10 changes: 7 additions & 3 deletions pages/adhkar.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content">

Expand All @@ -60,6 +60,10 @@
<img src="../public/icon/open-hands.png" class="icon_menu" id="icon_adhkar">
</a>

<a href="./hisnmuslim.html">
<img src="../public/icon/castle.png" class="icon_menu" id="icon_hisnmuslim">
</a>

<a href="./prayer_time.html">
<img src="../public/icon/azan.png" class="icon_menu" id="icon_prayer_time">
</a>
Expand All @@ -76,7 +80,7 @@
</div>

<div id="adhkar" onmousedown='return false;' onselectstart='return false;'>

<div id="title">

<p id="text_top">أذكار عشوائية</p>
Expand Down
4 changes: 2 additions & 2 deletions pages/adhkar/evening.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content" onmousedown='return false;' onselectstart='return false;'>

Expand Down
4 changes: 2 additions & 2 deletions pages/adhkar/food.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content" onmousedown='return false;' onselectstart='return false;'>

Expand Down
4 changes: 2 additions & 2 deletions pages/adhkar/morning.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content" onmousedown='return false;' onselectstart='return false;'>

Expand Down
4 changes: 2 additions & 2 deletions pages/adhkar/prayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content" onmousedown='return false;' onselectstart='return false;'>

Expand Down
4 changes: 2 additions & 2 deletions pages/adhkar/sleeping.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content" onmousedown='return false;' onselectstart='return false;'>

Expand Down
4 changes: 2 additions & 2 deletions pages/adhkar/tasbih.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

</header>

<dir id="alrt" onmousedown='return false;' onselectstart='return false;'>
<div id="alrt" onmousedown='return false;' onselectstart='return false;'>

<div id="blackout"></div>
<div class="alert" role="alert">تم النسخ</div>

</dir>
</div>

<div id="Content" onmousedown='return false;' onselectstart='return false;'>

Expand Down
Loading

0 comments on commit aff7528

Please sign in to comment.