Spaces:
Running
Running
Update registry_app.js
Browse files- registry_app.js +17 -4
registry_app.js
CHANGED
|
@@ -103,8 +103,19 @@ const RegistryApp = (() => {
|
|
| 103 |
[...new Set(ruleIds)].map(rule).filter(Boolean).forEach(r=>$('adaptivePopupBody').appendChild(button(ui.related+' — '+ruleTitle(r),()=>detail(kind,'worship',r,returnView))));
|
| 104 |
[...new Set(timeIds)].map(boundary).filter(Boolean).forEach(b=>$('adaptivePopupBody').appendChild(button(ui.related+' — '+title(b),()=>detail(kind,'time',b,returnView))));
|
| 105 |
}
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
let text=x.display?.text||x.content?.text||x.text||x.summary_ar||x.note||'';
|
| 109 |
if(group==='time'){boundaryInfo(x,null,returnView||(()=>list(kind,group)));return;}
|
| 110 |
if(group==='worship')text=ruleText(x);
|
|
@@ -567,7 +578,7 @@ const RegistryApp = (() => {
|
|
| 567 |
if(t<start||t>=end||seenNotices.has(key)||!eventEnabled(event)||event.display?.timeline===false)continue;
|
| 568 |
seenNotices.add(key);
|
| 569 |
const symbol=icon(visual.event_action_mapping[event.action]);
|
| 570 |
-
const entry=button((symbol?symbol+' ':'')+(notice.trigger.popup?.title||notice.trigger.title||title(event))+' '+timeText(t),()=>detail(eventScreen(event),'events',event));
|
| 571 |
entry.dataset.eventId=event.id;entry.dataset.t0=String(t);entry.dataset.t1=String(t);entry.dataset.label=(notice.trigger.popup?.title||notice.trigger.title||title(event))+' — '+timeText(t);entry.dataset.time=String(t);entry.dataset.timelineTime=String(t);entry.className='event-marker';controls.push(entry);
|
| 572 |
}
|
| 573 |
controls.sort((a,b)=>Number(a.dataset.timelineTime)-Number(b.dataset.timelineTime)).forEach(x=>cell.appendChild(x));
|
|
@@ -724,7 +735,8 @@ const RegistryApp = (() => {
|
|
| 724 |
const kind=eventScreen(due.event),noticeTitle=popup.title||due.trigger.title||title(due.event),noticeText=popup.text||due.trigger.popup_text||due.event.display?.text||'';
|
| 725 |
if(due.sound!==false)playReminderSound();notifySystem(noticeTitle,noticeText,{kind,eventId:due.event.id});
|
| 726 |
if(!document.hidden&&$('adaptivePopup').hidden!==false)show(kind,{title:noticeTitle,text:noticeText,media:icon(visual.event_action_mapping[due.event.action])},()=>{
|
| 727 |
-
|
|
|
|
| 728 |
});
|
| 729 |
}
|
| 730 |
|
|
@@ -933,6 +945,7 @@ const RegistryApp = (() => {
|
|
| 933 |
show(notificationKind||'worship',{title:registry('user_time_markers').marker_types[x.type].label_ar,text:x.text+'\n\n'+reminderSummary(x),media:icon(registry('user_time_markers').marker_types[x.type].icon_id)},()=>{
|
| 934 |
if(Number.isFinite(timelineAt))para(ru().when+' — '+reminderDate(timelineAt));
|
| 935 |
$('adaptivePopupActions').appendChild(button(ru().showOnTimeline,()=>{close();viewReminderOnTimeline(x,timelineAt);}));
|
|
|
|
| 936 |
const quranAction=x.openQuran||(x.type==='quran'?'wird':'');
|
| 937 |
if(quranAction&&window.MuslimClockKhatma)$('adaptivePopupActions').appendChild(button(ru().openQuran||(quranAction==='wird'?'فتح ورد اليوم':'متابعة القراءة'),()=>{close();window.MuslimClockKhatma.openReminder(x,{back:()=>reminderDetail(id,selectedHour,notificationKind,timelineAt)});}));
|
| 938 |
if(personal.tracksStreak(x))para(ru().streak+': '+x.streak+' '+ru().occurrences);
|
|
|
|
| 103 |
[...new Set(ruleIds)].map(rule).filter(Boolean).forEach(r=>$('adaptivePopupBody').appendChild(button(ui.related+' — '+ruleTitle(r),()=>detail(kind,'worship',r,returnView))));
|
| 104 |
[...new Set(timeIds)].map(boundary).filter(Boolean).forEach(b=>$('adaptivePopupBody').appendChild(button(ui.related+' — '+title(b),()=>detail(kind,'time',b,returnView))));
|
| 105 |
}
|
| 106 |
+
// Pressing an adhkar icon: read the matching group (morning / evening / sleep) or open this reminder's settings.
|
| 107 |
+
function adhkarEventPanel(event,at,returnView){
|
| 108 |
+
const reader=window.MuslimClockAdhkarReader;
|
| 109 |
+
if(!reader){adhkarSettings(event.id);return;}
|
| 110 |
+
const info={id:event.id,title:title(event),at:at||Date.now()};
|
| 111 |
+
show('worship',{title:title(event),text:event.display?.text||'',media:icon(event.icon_id||event.id)||icon(visual.event_action_mapping[event.action])},()=>{
|
| 112 |
+
reader.mountReadButton($('adaptivePopupBody'),info,()=>adhkarEventPanel(event,at,returnView));
|
| 113 |
+
$('adaptivePopupBody').appendChild(button(ui.adhkar.reminderSettings||'إعدادات تذكير هذا الذكر',()=>adhkarSettings(event.id)));
|
| 114 |
+
back(returnView||close);
|
| 115 |
+
});
|
| 116 |
+
}
|
| 117 |
+
function detail(kind,group,x,returnView,at){
|
| 118 |
+
if(group==='events'&&isAdhkar(x)){adhkarEventPanel(x,at,returnView);return;}
|
| 119 |
let text=x.display?.text||x.content?.text||x.text||x.summary_ar||x.note||'';
|
| 120 |
if(group==='time'){boundaryInfo(x,null,returnView||(()=>list(kind,group)));return;}
|
| 121 |
if(group==='worship')text=ruleText(x);
|
|
|
|
| 578 |
if(t<start||t>=end||seenNotices.has(key)||!eventEnabled(event)||event.display?.timeline===false)continue;
|
| 579 |
seenNotices.add(key);
|
| 580 |
const symbol=icon(visual.event_action_mapping[event.action]);
|
| 581 |
+
const entry=button((symbol?symbol+' ':'')+(notice.trigger.popup?.title||notice.trigger.title||title(event))+' '+timeText(t),()=>detail(eventScreen(event),'events',event,undefined,t));
|
| 582 |
entry.dataset.eventId=event.id;entry.dataset.t0=String(t);entry.dataset.t1=String(t);entry.dataset.label=(notice.trigger.popup?.title||notice.trigger.title||title(event))+' — '+timeText(t);entry.dataset.time=String(t);entry.dataset.timelineTime=String(t);entry.className='event-marker';controls.push(entry);
|
| 583 |
}
|
| 584 |
controls.sort((a,b)=>Number(a.dataset.timelineTime)-Number(b.dataset.timelineTime)).forEach(x=>cell.appendChild(x));
|
|
|
|
| 735 |
const kind=eventScreen(due.event),noticeTitle=popup.title||due.trigger.title||title(due.event),noticeText=popup.text||due.trigger.popup_text||due.event.display?.text||'';
|
| 736 |
if(due.sound!==false)playReminderSound();notifySystem(noticeTitle,noticeText,{kind,eventId:due.event.id});
|
| 737 |
if(!document.hidden&&$('adaptivePopup').hidden!==false)show(kind,{title:noticeTitle,text:noticeText,media:icon(visual.event_action_mapping[due.event.action])},()=>{
|
| 738 |
+
if(isAdhkar(due.event))window.MuslimClockAdhkarReader?.mountReadButton($('adaptivePopupBody'),{id:due.event.id,title:title(due.event),at:due.at},()=>detail(kind,'events',due.event,undefined,due.at));
|
| 739 |
+
back(()=>detail(kind,'events',due.event,undefined,due.at));
|
| 740 |
});
|
| 741 |
}
|
| 742 |
|
|
|
|
| 945 |
show(notificationKind||'worship',{title:registry('user_time_markers').marker_types[x.type].label_ar,text:x.text+'\n\n'+reminderSummary(x),media:icon(registry('user_time_markers').marker_types[x.type].icon_id)},()=>{
|
| 946 |
if(Number.isFinite(timelineAt))para(ru().when+' — '+reminderDate(timelineAt));
|
| 947 |
$('adaptivePopupActions').appendChild(button(ru().showOnTimeline,()=>{close();viewReminderOnTimeline(x,timelineAt);}));
|
| 948 |
+
if(x.type==='adhkar')window.MuslimClockAdhkarReader?.mountReadButton($('adaptivePopupActions'),{id:x.id,title:x.text,at:timelineAt||x.startAt||Date.now()},()=>reminderDetail(id,selectedHour,notificationKind,timelineAt));
|
| 949 |
const quranAction=x.openQuran||(x.type==='quran'?'wird':'');
|
| 950 |
if(quranAction&&window.MuslimClockKhatma)$('adaptivePopupActions').appendChild(button(ru().openQuran||(quranAction==='wird'?'فتح ورد اليوم':'متابعة القراءة'),()=>{close();window.MuslimClockKhatma.openReminder(x,{back:()=>reminderDetail(id,selectedHour,notificationKind,timelineAt)});}));
|
| 951 |
if(personal.tracksStreak(x))para(ru().streak+': '+x.streak+' '+ru().occurrences);
|