Table of Contents
الهمزية النبوية — شرح وأبيات
وفمُّ الزمانِ تبسمٌ وثِناءُوعطَاؤُهُ للخلقِ خيرٌ وسناءُ٢
وُلِـدَ الـهُـدى فَـالكائِناتُ ضِياءُ
وَانفَتَحَتْ لِلمَخْلوقِ أَبوابُ الرَّجاءِ
[حاشية 1]
١
وَأَضاءَ النُّجومَ بَيْنَ السماءِحِينَ أَشرَقَ نورُهُ لِلبَرِّ والبحرِ٣
الهمزية النبوية — نص القصيدة (نسخة مفهرسة لمحركات البحث)
وُلِـدَ الـهُـدى فَـالكائِناتُ ضِياءُ
وفمُّ الزمانِ تبسمٌ وثِناءُ
وَأَضاءَ النُّجومَ بَيْنَ السماءِ
الحواشي التفسيرية
المفردة: الهُدى
// Map footnote IDs to content (you can inline more or generate dynamically) const footnotes = { 'fn1': { number: '1', title: 'المفردة: الهُدى', html: '
الهُدى: يقصد به النبي محمد صلى الله عليه وسلم، أي أن مولده أضاء الكون.
' } // add fn2, fn3 ... };
// Attach click listeners for links with data-footnote attribute Array.from(document.getElementsByClassName('footnote-popup-link')).forEach(a=>{ a.addEventListener('click', function(ev){ ev.preventDefault(); const id = this.getAttribute('data-footnote'); const fn = footnotes[id]; if(!fn) return; popupNumber.textContent = fn.number; popupContent.innerHTML = '
' + fn.html; overlay.style.display='block'; overlay.setAttribute('aria-hidden','false'); popup.style.display='block'; popup.setAttribute('aria-hidden','false'); }); });
function closePopup(){ overlay.style.display='none'; overlay.setAttribute('aria-hidden','true'); popup.style.display='none'; popup.setAttribute('aria-hidden','true'); } closeBtn.addEventListener('click', closePopup); overlay.addEventListener('click', closePopup);
copyBtn.addEventListener('click', function(){ const text = popupContent.innerText || popupContent.textContent; navigator.clipboard?.writeText(text).then(()=> { copyBtn.textContent = 'تم النسخ'; setTimeout(()=>copyBtn.textContent='نسخ',1200); }).catch(()=>{ /* ignore */ }); }); })();
/* ========= Client-side simple search (scrolls to the matching poem line) ========= */ (function(){ const input = document.getElementById('search-input'); const searchBtn = document.getElementById('search-btn'); const clearBtn = document.getElementById('clear-btn');
function normalize(s){ if(!s) return ''; return s.trim().replace(/\s+/g,' ').replace(/ـ/g,'').toLowerCase(); }
searchBtn.addEventListener('click', function(){ const q = normalize(input.value); if(!q) return; // Look in the SEO copy first (exact line match) const seoEls = Array.from(document.querySelectorAll('#seo-poem .seo-bayt')); for(const el of seoEls){ if(normalize(el.textContent).includes(q)){ el.scrollIntoView({behavior:'smooth',block:'center'}); el.style.background='#fff3e0'; setTimeout(()=>el.style.background='',1400); return; } } // fallback: search visible bayts const visibleEls = Array.from(document.querySelectorAll('.bayt')); for(const el of visibleEls){ if(normalize(el.textContent).includes(q)){ el.scrollIntoView({behavior:'smooth',block:'center'}); el.style.background='#fff3e0'; setTimeout(()=>el.style.background='',1400); return; } } alert('لا توجد نتيجة مطابقة داخل هذه الصفحة.'); });
clearBtn.addEventListener('click', function(){ input.value=''; });
// Enter key
input.addEventListener('keydown', function(e){
if(e.key === 'Enter') { e.preventDefault(); searchBtn.click(); }
});
})();