Ikram Hawramani (QuranicNames.com Staff)

Copyright 2011-2025 QuranicNames.com. All Rights Reserved | About | Contact | Privacy Policy | Terms of Use
jQuery(document).ready(function($){ function fitTextToParent(span) { const parent = span.parentElement; let fontSize = parseFloat(window.getComputedStyle(span).fontSize); // Reset font size to a high value before starting span.style.fontSize = fontSize + 'px'; // Reduce font size until it fits while (span.scrollWidth > parent.clientWidth && fontSize > 5) { fontSize -= 1; span.style.fontSize = fontSize + 'px'; } } const spans = document.querySelectorAll('.entry-title-area .entry-title'); spans.forEach(fitTextToParent); // BLOCK: CODE FOR EXPAND/COLLAPSE LINK LISTS IN HEADER /* const container = document.querySelector('.headercats'); const anchors = container.querySelectorAll('.headercats .lettercat'); const maxVisible = ; if(!anchors.length > maxVisible) { return; } if (anchors.length > maxVisible) { // Hide everything after the 5th for (let i = maxVisible; i < anchors.length; i++) { anchors[i].style.display = 'none'; } // Create "Show more" link const showMore = document.createElement('a'); showMore.href = '#'; showMore.className = 'show-more-link'; showMore.innerHTML = '» Show more'; //showMore.style.marginLeft = '10px'; // Insert after 5th anchor anchors[maxVisible - 1].insertAdjacentElement('afterend', showMore); // Reveal hidden anchors on click showMore.addEventListener('click', function (e) { e.preventDefault(); for (let i = maxVisible; i < anchors.length; i++) { anchors[i].style.display = 'inline-block'; } showMore.remove(); // optionally remove the link }); } // END BLOCK */ /* const anchors = container.querySelectorAll('.level-2-hide, .level-1-hide'); const showMore = container.querySelectorAll('.show-more-link.level-1'); for (const button of showMore) { button.addEventListener('click', function (e) { e.preventDefault(); anchors.forEach(anchor => { anchor.classList.remove('level-2-hide, level-1-hide'); anchor.addEventListener('click', (event) => { event.preventDefault(); // Example: prevent default link behavior button.remove(); }); }); }); } */ const container = document.querySelectorAll('.headercats')[0];    if (!container) { console.error('Container element not found!'); return; } const anchors = container.querySelectorAll('.level-2-hide, .level-1-hide'); const showMoreButtons = container.querySelectorAll('.show-more-link'); // 1. Add click listener to each "show more" button showMoreButtons.forEach(button => { button.addEventListener('click', function (e) { e.preventDefault(); // Stop the link from navigating if it's an /* hide both show more links once either is pressed since either one fully expands * the container and there's nothing for the other to do */ container.querySelectorAll('.show-more-link').forEach(show_more_anchor =>{ show_more_anchor.classList.add('already-pressed'); }); // Reveal the hidden anchors by removing their hide classes anchors.forEach(anchor => { // Correctly remove classes without the leading dot anchor.classList.add('important-display-inline-block'); // Optional: If you want these anchors to stay visible and remove the expand button // only when they are clicked, you might keep the anchor listeners as below, // but consider if this is the right place to add them (see comments below). }); // Hide the clicked "show more" button // You need to remove the specific button that was clicked, not the NodeList button.style.display = 'none'; // Or button.remove(); if you want to remove it permanently from DOM // Alternatively, you could add a class to hide it, e.g., button.classList.add('hidden'); }); }); $("#paidsection") .appendTo("#forum-104427 .bbp-breadcrumb-current"); /* $('#bbpress-forums').on('click','.forumclick', function() { $("#new-topic-0").appendTo(".bbp-breadcrumb"); $('.forumclick').remove(); $('#bbp-newest-questions-title').remove(); $('#rules').remove(); });*/ // Check if the body tag has the class "forum" if (document.body.classList.contains('forum')) { // Find the h1.entry-title element const entryTitle = document.querySelector('h1.entry-title'); const rulesInsertionPoint = document.querySelector('.bbp-form'); if (rulesInsertionPoint) { // Create a new anchor element const newQuestionLink = document.createElement('a'); // Set its attributes and text content newQuestionLink.href = '#new-topic-0'; newQuestionLink.textContent = 'Write a New Question'; newQuestionLink.classList.add('forum-link'); const announcement = document.createElement('div'); announcement.classList.add('announcement'); announcement.innerHTML = '
Announcement
' + '
As of July 19, 2025 we have re-opened our forum and our staff ' + 'will be answering questions again inshaAllah.
'; const rulesDiv = document.createElement('div'); rulesDiv.classList.add('rules-div'); rulesDiv.innerHTML = '
Please Note
' + '' + '
'; // Insert the new anchor element immediately after the h1.entry-title entryTitle.parentNode.insertBefore(newQuestionLink, entryTitle.nextSibling); entryTitle.parentNode.prepend(announcement); rulesInsertionPoint.insertBefore(rulesDiv, rulesInsertionPoint.firstChild); newQuestionLink.addEventListener('click', function(event) { event.preventDefault(); // Prevent default jump behavior const targetId = this.getAttribute('href').substring(1); const targetElement = document.getElementById(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' // Scroll to the top of the element }); } }); } } $('#bbpress-forums a').each(function() { var current_href = $(this).attr('href'); var new_href = current_href + '?t=' + (new Date).getTime(); $(this).attr("href", new_href); }); var extra_links_are_showing = false; var extras_are_being_hovered = false; var more_link_is_being_hovered = false; $('#moreextras').css("display","none"); var moreover_in = function() { $('#moreextras').css("display","block"); extra_links_are_showing = true; more_link_is_being_hovered = true; $('#toppromo').css("display","none"); }; var hide_extra_links = function() { setTimeout(function(){ if(more_link_is_being_hovered === false && extras_are_being_hovered === false) { $('#moreextras').css("display","none"); extra_links_are_showing = false; $('#toppromo').css("display","block"); } } ,500); } var moreover_out = function() { more_link_is_being_hovered = false; if(extras_are_being_hovered) { // do nothing } else { hide_extra_links(); } }; $('#moreover').mouseenter( moreover_in ).mouseleave( moreover_out ); $('#moreextras').mouseenter( function(){ extras_are_being_hovered = true; } ).mouseleave( function() { extras_are_being_hovered = false; hide_extra_links(); } ); $('.single-letter-div').hover( function() { $(this).children('a').addClass('active-letter'); } ); $('.single-letter-div').mouseleave( function() { $(this).children('a').removeClass('active-letter'); } ); $('#boys').hover( function() { $(this).children('.name-type-anchor').addClass('active-letter'); } ); $('#boys').mouseleave( function() { $(this).children('.name-type-anchor').removeClass('active-letter'); } ); $('#girls').hover( function() { $(this).children('.name-type-anchor').addClass('active-letter'); } ); $('#girls').mouseleave( function() { $(this).children('.name-type-anchor').removeClass('active-letter'); } ); $('.meaningdiv').hover( function() { $(this).children('.letter-header').addClass('active'); } ); $('.meaningdiv').mouseleave( function() { $(this).children('.letter-header').removeClass('active'); } ); //$('#commentform .form-submit').append('
Characters: 0
'); /* $('#commentform #submit').click(function(e) { if($('#commentform #comment').val().length < 50) { $('#form-section-comment label').css('background','#c00').css('padding','5px').css('color','#fff').text('Your comment is too short. Comments must be longer than 100 characters.'); e.preventDefault(); } }); $('#commentform #comment').keyup(function() { $('#comment-char-count').text($('#commentform #comment').val().length); }); */ /* setTimeout(function() { if($('#div-gpt-ad-1411368939926-2').height() > 10) { $('#div-gpt-ad-1411368939926-2-text').css("display", "block"); } if($('#div-gpt-ad-1411368939926-0').height() > 10) { $('#div-gpt-ad-1411368939926-0-text').css("display", "block"); } if($('#div-gpt-ad-1411368939926-00').height() > 10) { $('#div-gpt-ad-1411368939926-00-text').css("display", "block"); } if($('#div-gpt-ad-1411368939926-1').height() > 10) { $('#div-gpt-ad-1411368939926-1-text').css("display", "block"); $('#div-gpt-ad-1411368939926-1-text').closest('.mad-ad-container').css('border-bottom', '1px solid #ccc'); } }, 2000); */ $('#s').click(function(){ (function(){ if($('.dwls_search_results').css('display') != 'none') { $('#text-10').css('margin-bottom', $('.dwls_search_results').height() + 'px'); console.log($('.dwls_search_results').height()); } else { $('#text-10').css('margin-bottom', '0px'); } if($('#s').is(":focus")) { setTimeout(arguments.callee, 1000); } })(); }); $('#s').click(function(){ (function(){ if($('.dwls_search_results').css('display') != 'none') { $('#text-10').css('margin-bottom', $('.dwls_search_results').height() + 'px'); console.log($('.dwls_search_results').height()); } else { $('#text-10').css('margin-bottom', '0px'); } if($('#s').is(":focus")) { setTimeout(arguments.callee, 1000); } })(); $("body").click( function(e) { if(e.target.id !== "#s") { $('#text-10').css('margin-bottom', '0px'); } } ); }); window.perform_ask_form_activation = function() { // $('#ask-overlay').css('display','none'); $('#qa-overlay').css('display','none'); // $('#ask-anchor').css('display','block'); // $('#sidebar-gplusbutton').css('top', '311px'); } //console.log($.cookie('plusonestate')); if($.cookie('plusonestate') == 'on') { //console.log('here'); window.perform_ask_form_activation(); } window.enable_ask_form = function(databall) { if(databall.state === 'on') { $.removeCookie("plusonestate"); $.cookie('plusonestate', 'on', { expires: 365, path: '/'}); perform_ask_form_activation(); } if(databall.state === 'off') { $('#qa-overlay').css('display','block'); $.removeCookie("plusonestate"); $.cookie('plusonestate', 'off', { expires: 365, path: '/' }); } } /* $('.mobile-nav .nav-more-button').click(function() { if($(this).parent().find('.more-nav-links-container').hasClass('hidden')) { $(this).parent().find('.more-nav-links-container').removeClass('hidden'); $(this).text('More ▲'); $('#header').addClass('expanded'); } else { $(this).parent().find('.more-nav-links-container').addClass('hidden'); $(this).text('More ▼'); $('#header').removeClass('expanded'); } }); */ /* $('.mini-nav-more-button').click(function() { if($('.mini-mobile-nav').find('.more-nav-links-container').hasClass('hidden')) { $('.mini-mobile-nav').find('.more-nav-links-container').removeClass('hidden'); $('#header').addClass('mini-expanded'); } else { $('.mini-mobile-nav').find('.more-nav-links-container').addClass('hidden'); $('#header').removeClass('mini-expanded'); } }); */ }); // jquery i.e. dom content loaded document.addEventListener('DOMContentLoaded', function () { const miniNavMoreButton = document.querySelector('.mini-nav-more-button'); const moreNavLinksContainer = document.querySelector('.mini-mobile-nav .more-nav-links-container'); const header = document.getElementById('header'); const miniMobileSearchForm = document.querySelector('#mini-mobile-search-form'); miniNavMoreButton.addEventListener('click', function() { if (moreNavLinksContainer.classList.contains('hidden')) { // Expand header moreNavLinksContainer.classList.remove('hidden'); header.classList.add('mini-expanded'); // Show search form smoothly miniMobileSearchForm.style.transition = 'opacity 0.3s ease-in-out'; // Add transition miniMobileSearchForm.style.opacity = '1'; miniMobileSearchForm.style.display = 'block'; // Ensure it's block for layout // Scroll to the search form after a short delay to allow it to render // (or you can use a Promise/requestAnimationFrame for more precise timing) setTimeout(() => { miniMobileSearchForm.scrollIntoView({ behavior: 'smooth', block: 'start' // Scrolls to the top of the element }); }, 50); // Small delay, adjust if needed } else { // Collapse header moreNavLinksContainer.classList.add('hidden'); header.classList.remove('mini-expanded'); // Hide search form smoothly miniMobileSearchForm.style.transition = 'opacity 0.3s ease-in-out'; // Add transition miniMobileSearchForm.style.opacity = '0'; // Use a timeout to set display: none AFTER the transition completes setTimeout(() => { miniMobileSearchForm.style.display = 'none'; }, 300); // Matches the transition duration (0.3s = 300ms) } }); /* BLOCK: for styling unpaged pages */ // Select all elements with the class 'bbp-pagination-links' const paginationLinks = document.querySelector('.bbp-pagination-links'); if(paginationLinks) { // If no elements with that class are found if (paginationLinks.innerHTML.length === 0) { // Add the class 'unpaged' to the element document.body.classList.add('unpaged'); } } /* END BLOCK */ });