(function () { if (!document.body.classList.contains('is-home')) return; var PRESET_AMOUNTS = [50, 100, 300, 500]; function buildDonationBox(productId) { var box = document.createElement('div'); box.className = 'anjiz-home-donation-box'; box.innerHTML = '
' + PRESET_AMOUNTS.map(function (amount, i) { return ''; }).join('') + '
' + ''; return box; } function wireDonationBox(box, button) { var radios = box.querySelectorAll('input[type="radio"]'); var customInput = box.querySelector('.anjiz-home-donation-custom-input'); function selectPreset() { customInput.value = ''; var checked = box.querySelector('input[type="radio"]:checked'); if (checked) button.setAttribute('donating-amount', checked.value); } function selectCustom() { if (customInput.value.trim() === '') { selectPreset(); return; } radios.forEach(function (r) { r.checked = false; }); button.setAttribute('donating-amount', parseFloat(customInput.value) || 0); } radios.forEach(function (r) { r.addEventListener('change', selectPreset); }); customInput.addEventListener('input', selectCustom); selectPreset(); } function processCard(card) { if (card.dataset.donationBoxAdded) return; var button = card.querySelector('salla-add-product-button[product-type="donating"]'); if (!button) return; var titleLink = card.querySelector('.anjiz-card__title-link'); if (!titleLink) return; var box = buildDonationBox(button.getAttribute('product-id')); titleLink.insertAdjacentElement('afterend', box); wireDonationBox(box, button); card.dataset.donationBoxAdded = 'true'; } function scan() { document.querySelectorAll('custom-salla-product-card, .s-product-card-entry').forEach(processCard); } scan(); new MutationObserver(scan).observe(document.body, { childList: true, subtree: true }); })(); (function () { function hideProgramsAndProjects() { document.querySelectorAll('li[id="1659939511"], li[id="1231282501"]').forEach(function (li) { li.style.display = 'none'; }); document.querySelectorAll('a[href*="c1659939511"], a[href*="c1231282501"]').forEach(function (a) { a.style.display = 'none'; }); document.querySelectorAll('.s-block__title h2, .s-block__title h3').forEach(function (h) { var text = h.textContent.trim(); if (text === 'البرامج' || text === 'المشاريع') { var box = h.closest('.s-block__title'); if (box) box.style.display = 'none'; } }); } hideProgramsAndProjects(); var tries = 0; var interval = setInterval(function () { hideProgramsAndProjects(); tries++; if (tries > 25) clearInterval(interval); }, 300); })(); (function () { var style = document.createElement('style'); style.textContent = '.anjiz-card .anjiz-card__cover{' + 'border-radius:19px 19px 0 0 !important;' + 'overflow:hidden !important;}'; document.head.appendChild(style); })(); document.head.insertAdjacentHTML('beforeend', ''); document.head.insertAdjacentHTML('beforeend', ''); document.head.insertAdjacentHTML('beforeend', ''); document.head.insertAdjacentHTML('beforeend', ''); (function () { var TITLES = ['قد تعجبك', 'اطلبها مجدد', 'شاهدت']; document.head.insertAdjacentHTML('beforeend', ''); function kill() { document.querySelectorAll('h1,h2,h3,h4').forEach(function (h) { var t = h.textContent.replace(/\s+/g, ' ').trim(); for (var i = 0; i < TITLES.length; i++) { if (t.indexOf(TITLES[i]) > -1) { var sec = h.closest('section, .s-block') || h.parentElement; sec.style.setProperty('display', 'none', 'important'); return; } } }); } kill(); new MutationObserver(kill).observe(document.documentElement, { childList: true, subtree: true }); })();