Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,583 changes: 6,583 additions & 0 deletions data/quran_devnagri_urdu_maududi.html

Large diffs are not rendered by default.

53 changes: 34 additions & 19 deletions docs/001.html

Large diffs are not rendered by default.

328 changes: 311 additions & 17 deletions docs/002.html

Large diffs are not rendered by default.

242 changes: 225 additions & 17 deletions docs/003.html

Large diffs are not rendered by default.

218 changes: 201 additions & 17 deletions docs/004.html

Large diffs are not rendered by default.

162 changes: 145 additions & 17 deletions docs/005.html

Large diffs are not rendered by default.

207 changes: 190 additions & 17 deletions docs/006.html

Large diffs are not rendered by default.

248 changes: 231 additions & 17 deletions docs/007.html

Large diffs are not rendered by default.

117 changes: 100 additions & 17 deletions docs/008.html

Large diffs are not rendered by default.

171 changes: 154 additions & 17 deletions docs/009.html

Large diffs are not rendered by default.

151 changes: 134 additions & 17 deletions docs/010.html

Large diffs are not rendered by default.

165 changes: 148 additions & 17 deletions docs/011.html

Large diffs are not rendered by default.

153 changes: 136 additions & 17 deletions docs/012.html

Large diffs are not rendered by default.

85 changes: 68 additions & 17 deletions docs/013.html

Large diffs are not rendered by default.

94 changes: 77 additions & 17 deletions docs/014.html

Large diffs are not rendered by default.

141 changes: 124 additions & 17 deletions docs/015.html

Large diffs are not rendered by default.

170 changes: 153 additions & 17 deletions docs/016.html

Large diffs are not rendered by default.

153 changes: 136 additions & 17 deletions docs/017.html

Large diffs are not rendered by default.

152 changes: 135 additions & 17 deletions docs/018.html

Large diffs are not rendered by default.

140 changes: 123 additions & 17 deletions docs/019.html

Large diffs are not rendered by default.

177 changes: 160 additions & 17 deletions docs/020.html

Large diffs are not rendered by default.

154 changes: 137 additions & 17 deletions docs/021.html

Large diffs are not rendered by default.

120 changes: 103 additions & 17 deletions docs/022.html

Large diffs are not rendered by default.

160 changes: 143 additions & 17 deletions docs/023.html

Large diffs are not rendered by default.

106 changes: 89 additions & 17 deletions docs/024.html

Large diffs are not rendered by default.

119 changes: 102 additions & 17 deletions docs/025.html

Large diffs are not rendered by default.

269 changes: 252 additions & 17 deletions docs/026.html

Large diffs are not rendered by default.

135 changes: 118 additions & 17 deletions docs/027.html

Large diffs are not rendered by default.

130 changes: 113 additions & 17 deletions docs/028.html

Large diffs are not rendered by default.

111 changes: 94 additions & 17 deletions docs/029.html

Large diffs are not rendered by default.

102 changes: 85 additions & 17 deletions docs/030.html

Large diffs are not rendered by default.

76 changes: 59 additions & 17 deletions docs/031.html

Large diffs are not rendered by default.

72 changes: 55 additions & 17 deletions docs/032.html

Large diffs are not rendered by default.

115 changes: 98 additions & 17 deletions docs/033.html

Large diffs are not rendered by default.

96 changes: 79 additions & 17 deletions docs/034.html

Large diffs are not rendered by default.

87 changes: 70 additions & 17 deletions docs/035.html

Large diffs are not rendered by default.

125 changes: 108 additions & 17 deletions docs/036.html

Large diffs are not rendered by default.

224 changes: 207 additions & 17 deletions docs/037.html

Large diffs are not rendered by default.

130 changes: 113 additions & 17 deletions docs/038.html

Large diffs are not rendered by default.

117 changes: 100 additions & 17 deletions docs/039.html

Large diffs are not rendered by default.

127 changes: 110 additions & 17 deletions docs/040.html

Large diffs are not rendered by default.

96 changes: 79 additions & 17 deletions docs/041.html

Large diffs are not rendered by default.

95 changes: 78 additions & 17 deletions docs/042.html

Large diffs are not rendered by default.

131 changes: 114 additions & 17 deletions docs/043.html

Large diffs are not rendered by default.

101 changes: 84 additions & 17 deletions docs/044.html

Large diffs are not rendered by default.

79 changes: 62 additions & 17 deletions docs/045.html

Large diffs are not rendered by default.

77 changes: 60 additions & 17 deletions docs/046.html

Large diffs are not rendered by default.

80 changes: 63 additions & 17 deletions docs/047.html

Large diffs are not rendered by default.

71 changes: 54 additions & 17 deletions docs/048.html

Large diffs are not rendered by default.

60 changes: 43 additions & 17 deletions docs/049.html

Large diffs are not rendered by default.

87 changes: 70 additions & 17 deletions docs/050.html

Large diffs are not rendered by default.

102 changes: 85 additions & 17 deletions docs/051.html

Large diffs are not rendered by default.

91 changes: 74 additions & 17 deletions docs/052.html

Large diffs are not rendered by default.

104 changes: 87 additions & 17 deletions docs/053.html

Large diffs are not rendered by default.

97 changes: 80 additions & 17 deletions docs/054.html

Large diffs are not rendered by default.

120 changes: 103 additions & 17 deletions docs/055.html

Large diffs are not rendered by default.

138 changes: 121 additions & 17 deletions docs/056.html

Large diffs are not rendered by default.

71 changes: 54 additions & 17 deletions docs/057.html

Large diffs are not rendered by default.

64 changes: 47 additions & 17 deletions docs/058.html

Large diffs are not rendered by default.

66 changes: 49 additions & 17 deletions docs/059.html

Large diffs are not rendered by default.

55 changes: 38 additions & 17 deletions docs/060.html

Large diffs are not rendered by default.

56 changes: 39 additions & 17 deletions docs/061.html

Large diffs are not rendered by default.

53 changes: 36 additions & 17 deletions docs/062.html

Large diffs are not rendered by default.

53 changes: 36 additions & 17 deletions docs/063.html

Large diffs are not rendered by default.

60 changes: 43 additions & 17 deletions docs/064.html

Large diffs are not rendered by default.

54 changes: 37 additions & 17 deletions docs/065.html

Large diffs are not rendered by default.

54 changes: 37 additions & 17 deletions docs/066.html

Large diffs are not rendered by default.

72 changes: 55 additions & 17 deletions docs/067.html

Large diffs are not rendered by default.

94 changes: 77 additions & 17 deletions docs/068.html

Large diffs are not rendered by default.

94 changes: 77 additions & 17 deletions docs/069.html

Large diffs are not rendered by default.

86 changes: 69 additions & 17 deletions docs/070.html

Large diffs are not rendered by default.

70 changes: 53 additions & 17 deletions docs/071.html

Large diffs are not rendered by default.

70 changes: 53 additions & 17 deletions docs/072.html

Large diffs are not rendered by default.

62 changes: 45 additions & 17 deletions docs/073.html

Large diffs are not rendered by default.

98 changes: 81 additions & 17 deletions docs/074.html

Large diffs are not rendered by default.

82 changes: 65 additions & 17 deletions docs/075.html

Large diffs are not rendered by default.

73 changes: 56 additions & 17 deletions docs/076.html

Large diffs are not rendered by default.

92 changes: 75 additions & 17 deletions docs/077.html

Large diffs are not rendered by default.

82 changes: 65 additions & 17 deletions docs/078.html

Large diffs are not rendered by default.

88 changes: 71 additions & 17 deletions docs/079.html

Large diffs are not rendered by default.

84 changes: 67 additions & 17 deletions docs/080.html

Large diffs are not rendered by default.

71 changes: 54 additions & 17 deletions docs/081.html

Large diffs are not rendered by default.

61 changes: 44 additions & 17 deletions docs/082.html

Large diffs are not rendered by default.

78 changes: 61 additions & 17 deletions docs/083.html

Large diffs are not rendered by default.

67 changes: 50 additions & 17 deletions docs/084.html

Large diffs are not rendered by default.

64 changes: 47 additions & 17 deletions docs/085.html

Large diffs are not rendered by default.

59 changes: 42 additions & 17 deletions docs/086.html

Large diffs are not rendered by default.

61 changes: 44 additions & 17 deletions docs/087.html

Large diffs are not rendered by default.

68 changes: 51 additions & 17 deletions docs/088.html

Large diffs are not rendered by default.

72 changes: 55 additions & 17 deletions docs/089.html

Large diffs are not rendered by default.

62 changes: 45 additions & 17 deletions docs/090.html

Large diffs are not rendered by default.

57 changes: 40 additions & 17 deletions docs/091.html

Large diffs are not rendered by default.

63 changes: 46 additions & 17 deletions docs/092.html

Large diffs are not rendered by default.

53 changes: 36 additions & 17 deletions docs/093.html

Large diffs are not rendered by default.

50 changes: 33 additions & 17 deletions docs/094.html

Large diffs are not rendered by default.

50 changes: 33 additions & 17 deletions docs/095.html

Large diffs are not rendered by default.

61 changes: 44 additions & 17 deletions docs/096.html

Large diffs are not rendered by default.

47 changes: 30 additions & 17 deletions docs/097.html

Large diffs are not rendered by default.

50 changes: 33 additions & 17 deletions docs/098.html

Large diffs are not rendered by default.

50 changes: 33 additions & 17 deletions docs/099.html

Large diffs are not rendered by default.

53 changes: 36 additions & 17 deletions docs/100.html

Large diffs are not rendered by default.

53 changes: 36 additions & 17 deletions docs/101.html

Large diffs are not rendered by default.

50 changes: 33 additions & 17 deletions docs/102.html

Large diffs are not rendered by default.

45 changes: 28 additions & 17 deletions docs/103.html

Large diffs are not rendered by default.

51 changes: 34 additions & 17 deletions docs/104.html

Large diffs are not rendered by default.

47 changes: 30 additions & 17 deletions docs/105.html

Large diffs are not rendered by default.

46 changes: 29 additions & 17 deletions docs/106.html

Large diffs are not rendered by default.

49 changes: 32 additions & 17 deletions docs/107.html

Large diffs are not rendered by default.

45 changes: 28 additions & 17 deletions docs/108.html

Large diffs are not rendered by default.

48 changes: 31 additions & 17 deletions docs/109.html

Large diffs are not rendered by default.

45 changes: 28 additions & 17 deletions docs/110.html

Large diffs are not rendered by default.

47 changes: 30 additions & 17 deletions docs/111.html

Large diffs are not rendered by default.

46 changes: 29 additions & 17 deletions docs/112.html

Large diffs are not rendered by default.

47 changes: 30 additions & 17 deletions docs/113.html

Large diffs are not rendered by default.

48 changes: 31 additions & 17 deletions docs/114.html

Large diffs are not rendered by default.

26 changes: 19 additions & 7 deletions docs/bookmarks.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down Expand Up @@ -319,18 +323,26 @@ <h1>&#128278; My Bookmarks</h1>
+'<a href="'+href+'">📖 '+suraName+', Ayah '+b.a+'</a>'
+'<div class="bm-item-meta">Bookmarked '+relTime(b.t)+'</div>'
+'</div>'
+'<button class="bm-item-del" onclick="deleteBm('+i+')" title="Delete this bookmark">&times; Remove</button>'
+'<button class="bm-item-del" data-key="'+b.s+':'+b.a+'" title="Delete this bookmark">&times; Remove</button>'
+'</li>';
}
listEl.innerHTML=html;
}

window.deleteBm=function(idx){
var bms=load();
bms.splice(idx,1);
save(bms);
render();
};
/* Event delegation for bookmark deletion — avoids per-item onclick with stale indices */
(function(){
var listEl=document.getElementById('bm-list');
if(listEl){
listEl.addEventListener('click',function(e){
var btn=e.target.closest('.bm-item-del');
if(!btn)return;
var key=btn.dataset.key;
var bms=load();
var idx=bms.findIndex(function(b){return b.s+':'+b.a===key;});
if(idx>=0){bms.splice(idx,1);save(bms);render();}
});
}
})();

window.clearAllBm=function(){
if(!confirm('Remove all '+load().length+' bookmark(s)?'))return;
Expand Down
5 changes: 5 additions & 0 deletions docs/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down Expand Up @@ -290,6 +294,7 @@ <h2 style="margin-top:0">Default Translation Visibility</h2>
<div class='cfg-row'><label class='cfg-switch'><input type='checkbox' data-key='hindi-omari'><span class='cfg-slider'></span></label><span class='cfg-label'>हिन्दी (Al-Omari)</span></div>
<div class='cfg-row'><label class='cfg-switch'><input type='checkbox' data-key='roman-urdu'><span class='cfg-slider'></span></label><span class='cfg-label'>Roman Urdu (Maududi)</span></div>
<div class='cfg-row'><label class='cfg-switch'><input type='checkbox' data-key='roman-urdu-junagarhi'><span class='cfg-slider'></span></label><span class='cfg-label'>Roman Urdu (Junagarhi)</span></div>
<div class='cfg-row'><label class='cfg-switch'><input type='checkbox' data-key='devnagri-urdu'><span class='cfg-slider'></span></label><span class='cfg-label'>Devnagri Urdu (Maududi)</span></div>
<div class="cfg-actions">
<button class="cfg-btn-reset" onclick="cfgReset()">Reset to Defaults</button>
<span class="cfg-saved" id="cfg-saved">&#10003; Saved</span>
Expand Down
3 changes: 2 additions & 1 deletion docs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ var QURAN_CONFIG={
"nepali":false,
"hindi-omari":false,
"roman-urdu":false,
"roman-urdu-junagarhi":false
"roman-urdu-junagarhi":false,
"devnagri-urdu":false
};
9 changes: 7 additions & 2 deletions docs/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down Expand Up @@ -288,6 +292,7 @@ <h2>&#9989; Select Translations</h2>
<label><input type='checkbox' value='hindi-omari'> हिन्दी (Al-Omari)</label>
<label><input type='checkbox' value='roman-urdu'> Roman Urdu (Maududi)</label>
<label><input type='checkbox' value='roman-urdu-junagarhi'> Roman Urdu (Junagarhi)</label>
<label><input type='checkbox' value='devnagri-urdu'> Devnagri Urdu (Maududi)</label>
</div>
<div style="margin-top:6px">
<button onclick="dlSelectAll()" style="padding:4px 12px;font-size:.85em;border:1px solid #ccd6e0;border-radius:4px;cursor:pointer;background:#f0f4f8">Select All</button>
Expand Down Expand Up @@ -356,8 +361,8 @@ <h2>&#128230; Additional Pages</h2>
document.querySelectorAll('#dl-extras input:checked').forEach(function(c){extras.push(c.value);});

var zip=new JSZip();
var allClasses=['arabic', 'audio', 'translit', 'translit-unicode', 'trans', 'trans-yusuf', 'trans-sahih', 'trans-qarai', 'trans-hilali', 'eng-abridged', 'hindi', 'hindi-suhail', 'hindi-mokhtasar', 'gujarati', 'nepali', 'hindi-omari', 'roman-urdu', 'roman-urdu-junagarhi'];
var hardcodedDefaults={"arabic": true, "audio": true, "translit": false, "translit-unicode": true, "trans": false, "trans-yusuf": true, "trans-sahih": false, "trans-qarai": false, "trans-hilali": false, "eng-abridged": false, "hindi": false, "hindi-suhail": true, "hindi-mokhtasar": true, "gujarati": false, "nepali": false, "hindi-omari": false, "roman-urdu": false, "roman-urdu-junagarhi": false};
var allClasses=['arabic', 'audio', 'translit', 'translit-unicode', 'trans', 'trans-yusuf', 'trans-sahih', 'trans-qarai', 'trans-hilali', 'eng-abridged', 'hindi', 'hindi-suhail', 'hindi-mokhtasar', 'gujarati', 'nepali', 'hindi-omari', 'roman-urdu', 'roman-urdu-junagarhi', 'devnagri-urdu'];
var hardcodedDefaults={"arabic": true, "audio": true, "translit": false, "translit-unicode": true, "trans": false, "trans-yusuf": true, "trans-sahih": false, "trans-qarai": false, "trans-hilali": false, "eng-abridged": false, "hindi": false, "hindi-suhail": true, "hindi-mokhtasar": true, "gujarati": false, "nepali": false, "hindi-omari": false, "roman-urdu": false, "roman-urdu-junagarhi": false, "devnagri-urdu": false};

/* Build list of files to fetch */
var files=[];
Expand Down
4 changes: 4 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down
4 changes: 4 additions & 0 deletions docs/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down
1 change: 1 addition & 0 deletions docs/sd/devnagri-urdu.json

Large diffs are not rendered by default.

46 changes: 30 additions & 16 deletions docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down Expand Up @@ -258,6 +262,7 @@
.result-field.hindi-omari{background:#fff0f5;font-family:'Noto Sans Devanagari',Arial,sans-serif;color:#880e30}
.result-field.roman-urdu{background:#f0f4c3;font-weight:500;color:#33691e}
.result-field.roman-urdu-junagarhi{background:#e8f5e9;font-weight:500;color:#1b5e20}
.result-field.devnagri-urdu{background:#e8eaf0;font-family:'Noto Sans Devanagari',Arial,sans-serif;font-weight:500;color:#1a237e}
.result-highlight{background:#fff176;border-radius:2px}
.pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:16px 0;justify-content:center}
.pagination button{padding:7px 14px;border:none;border-radius:4px;cursor:pointer;background:#1a3a5c;color:#fff;font-size:.9em;min-width:36px;min-height:40px}
Expand Down Expand Up @@ -323,7 +328,8 @@ <h1>&#128269; Search the Qur&#x2019;an</h1>
['nepali', 'Nepali (Ahl-al-Hadith)'],
['hindi-omari', 'हिन्दी (Al-Omari)'],
['roman-urdu', 'Roman Urdu (Maududi)'],
['roman-urdu-junagarhi', 'Roman Urdu (Junagarhi)']
['roman-urdu-junagarhi', 'Roman Urdu (Junagarhi)'],
['devnagri-urdu', 'Devnagri Urdu (Maududi)']
];

function getActiveFields(){
Expand Down Expand Up @@ -368,16 +374,23 @@ <h1>&#128269; Search the Qur&#x2019;an</h1>
/* Prefetch meta immediately so first search is fast */
loadMeta();

/* Pre-compiled highlight regexes — rebuilt once per search, reused across all results */
var _hlRegexes=[];
function buildHighlightRegexes(terms){
_hlRegexes=terms.filter(Boolean).map(function(term){
return new RegExp('('+term.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')+')', 'gi');
});
}

function escHtml(s){
return s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}

function highlight(text, terms){
var escaped = escHtml(text);
terms.forEach(function(term){
if(!term) return;
var re = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g,'\\$&') + ')', 'gi');
escaped = escaped.replace(re, '<mark class="result-highlight">$1</mark>');
function highlight(text){
var escaped=escHtml(text);
_hlRegexes.forEach(function(re){
re.lastIndex=0;
escaped=escaped.replace(re,'<mark class="result-highlight">$1</mark>');
});
return escaped;
}
Expand All @@ -393,17 +406,18 @@ <h1>&#128269; Search the Qur&#x2019;an</h1>
statusEl.textContent = 'Showing ' + (start+1) + '–' + end + ' of ' + total + ' result(s) for “' + input.value.trim() + '”';
var html = '';
var activeFields=getActiveFields();
/* Pre-fetch field arrays once before the render loop */
var renderFieldArrays=activeFields.map(function(f){return [f[0],fieldCache[f[0]]||[]];});
for(var i=start;i<end;i++){
var m=allMatches[i];
var href=String(m.s).padStart(3,'0')+'.html#ayah-'+m.a;
html+='<div class="result-card">'
+'<div class="result-header"><span>Surah '+m.s+':'+m.a+' &mdash; '+escHtml(m.n)+'</span>'
+'<a href="'+href+'">View verse &rarr;</a></div>';
activeFields.forEach(function(f){
var arr=fieldCache[f[0]]||[];
var val=arr[m.i]||'';
renderFieldArrays.forEach(function(fa){
var val=fa[1][m.i]||'';
if(!val)return;
html+='<div class="result-field '+f[0]+'">'+highlight(val,currentTerms)+'</div>';
html+='<div class="result-field '+fa[0]+'">'+highlight(val)+'</div>';
});
html+='</div>';
}
Expand Down Expand Up @@ -446,16 +460,15 @@ <h1>&#128269; Search the Qur&#x2019;an</h1>
paginEl.innerHTML='';
var fieldPromises = activeFields.map(function(f){return loadField(f[0]);});
Promise.all([loadMeta()].concat(fieldPromises)).then(function(){
/* Pre-cache field arrays once before the 6000+ row search loop */
var fieldArrays=activeFields.map(function(f){return fieldCache[f[0]]||[];});
allMatches = [];
for(var i=0;i<metaData.length;i++){
var row=metaData[i];
var parts=[row[2]];
activeFields.forEach(function(f){
var arr=fieldCache[f[0]]||[];
parts.push(arr[i]||'');
});
fieldArrays.forEach(function(arr){parts.push(arr[i]||'');});
var haystack=parts.join(' ').toLowerCase();
if(currentTerms.every(function(t){return haystack.indexOf(t)!==-1;})){
if(currentTerms.every(function(t){return haystack.includes(t);})){
allMatches.push({i:i,s:row[0],a:row[1],n:row[2]});
}
}
Expand All @@ -465,6 +478,7 @@ <h1>&#128269; Search the Qur&#x2019;an</h1>
paginEl.innerHTML='';
return;
}
buildHighlightRegexes(currentTerms);
renderPage(1);
}).catch(function(err){
statusEl.textContent='Error loading search data. Please try again.';
Expand Down
4 changes: 4 additions & 0 deletions docs/sources.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
.roman-urdu-text{font-style:normal;font-weight:500;color:#33691e}
.roman-urdu-junagarhi td{background:#e8f5e9}
.roman-urdu-junagarhi-text{font-style:normal;font-weight:500;color:#1b5e20}
.devnagri-urdu td{background:#e8eaf0}
.devnagri-urdu-text{font-family:'Noto Sans Devanagari',Arial,sans-serif;font-style:normal;font-weight:500;color:#1a237e}
.arabic td{background:#fff8e1}
.arabic-text{font-family:'Scheherazade New','Amiri','Traditional Arabic',serif;font-size:1.5em;direction:rtl;text-align:right;line-height:2}
nav.chapter-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
Expand Down Expand Up @@ -139,6 +141,7 @@
.hindi-omari td{background:#200010}
.roman-urdu td{background:#1a2000}
.roman-urdu-junagarhi td{background:#0a1a00}
.devnagri-urdu td{background:#0d0f2a}
.surah-grid a{background:#1e2a3a;border-color:#334;color:#90caf9}
.surah-grid a:hover{background:#263650}
.sg-meta{color:#aaa}
Expand All @@ -162,6 +165,7 @@
.trans-hilali-text{color:#ce93d8}
.nepali-text{color:#80cbc4}
.hindi-omari-text{color:#f48fb1}
.devnagri-urdu-text{color:#9fa8da}
}
@media(max-width:600px) and (prefers-color-scheme:dark){
.table-wrap .label{border-top-color:rgba(255,255,255,.08)}
Expand Down
Loading
Loading