پرش به محتوا

کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخه‌ها

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۲۱۰: خط ۲۱۰:
             text-align: center;
             text-align: center;
             padding: 15px;
             padding: 15px;
        }
       
        .pagination {
            display: flex;
            justify-content: center;
            padding: 10px;
            border-top: 1px solid #e9ecef;
            background: #f8f9fa;
            gap: 5px;
        }
       
        .pagination button {
            padding: 5px 10px;
            border: 1px solid #dee2e6;
            background: white;
            cursor: pointer;
            border-radius: 4px;
            font-size: 12px;
        }
       
        .pagination button.active {
            background: #3e6f73;
            color: white;
        }
       
        .page-info {
            font-size: 12px;
            color: #6c757d;
            margin: 0 10px;
            display: flex;
            align-items: center;
         }
         }
          
          
خط ۴۳۰: خط ۳۹۹:
                             </div>
                             </div>
                             <div class="options-container" id="optionsContainer">
                             <div class="options-container" id="optionsContainer">
                                 <div class="no-results">لطفاً در کادر بالا جستجو کنید</div>
                                 <div class="no-results">لطفاً ابتدا یک دسته‌بندی انتخاب کنید</div>
                             </div>
                             </div>
                            <div class="pagination" id="paginationContainer" style="display: none;"></div>
                         </div>
                         </div>
                     </div>
                     </div>
خط ۴۷۷: خط ۴۴۵:


     <script>
     <script>
         const ITEMS_PER_PAGE = 20;
         // داده‌های واقعی برای تست
         let currentPage = 1;
         const booksData = {
        let totalPages = 1;
            'کتاب': [
        let currentItems = [];
                { value: 'کتاب_مسیحیت_در_ایران_تا_صدر_اسلام', text: 'کتاب مسیحیت در ایران تا صدر اسلام' },
        let currentCategory = '';
                { value: 'کتاب_انجیل_متی', text: 'کتاب انجیل متی - مطالعه تفسیری' },
        let currentSearchTerm = '';
                { value: 'کتاب_مزامیر_داوود', text: 'کتاب مزامیر داوود' },
        let searchTimeout = null;
                { value: 'کتاب_پیدایش_و_تفسیر', text: 'کتاب پیدایش و تفسیر آن' },
 
                { value: 'کتاب_رساله_رومیان', text: 'کتاب رساله به رومیان' },
        function generateLargeDataset() {
                { value: 'کتاب_مکاشفه_یوحنا', text: 'کتاب مکاشفه یوحنا' },
            const categories = {
                 { value: 'کتاب_عیسی_در_قرآن', text: 'کتاب عیسی مسیح در قرآن' },
                 'کتاب': [],
                { value: 'کتاب_تاریخ_کلیسا', text: 'کتاب تاریخ کلیسای ایران' },
                 'مقاله': [],
                 { value: 'کتاب_الهیات', text: 'کتاب الهیات سیستماتیک' },
                 'فروشگاه کتاب': []
                 { value: 'کتاب_دعاهای_مسیحی', text: 'کتاب دعاهای مسیحی' }
             };
             ],
              
             'مقاله': [
            for (let i = 1; i <= 450; i++) {
                { value: 'مقاله_۸_تفاوت_کلیدی_بین_کاتولیک‌ها_و_پروتستان‌ها', text: 'مقاله: ۸ تفاوت کلیدی بین کاتولیک‌ها و پروتستان‌ها' },
                 categories['کتاب'].push({
                 { value: 'مقاله_برادران_ما_تحلیلگران_سیاسی_نیستیم', text: 'مقاله: برادران، ما تحلیل‌گران سیاسی نیستیم' },
                    value: `کتاب_${i}`,
                { value: 'مقاله_گناه_آدمی_را_نادان_می‌کند', text: 'مقاله: گناه آدمی را نادان می‌کند' },
                    text: `کتاب مسیحی شماره ${i}`
                { value: 'مقاله_۴_دلیل_تراجنسیتی', text: 'مقاله: ۴ دلیل که چرا کتاب مقدس از تراجنسیتی بودن حمایت نمی‌کند' },
                 });
                 { value: 'مقاله_۱۰_معنای_یهوه', text: 'مقاله: ۱۰ معنای یهوه' },
            }
                { value: 'مقاله_تدریس_آموزش_مطالعه', text: 'مقاله: تدریس، آموزش و مطالعه' },
           
                { value: 'مقاله_خدمت_به_خدا', text: 'مقاله: خدمت به خدا یعنی چه' },
            for (let i = 1; i <= 680; i++) {
                 { value: 'مقاله_روح_القدس', text: 'مقاله: هدیه روح القدس' },
                 categories['مقاله'].push({
                { value: 'مقاله_نجات', text: 'مقاله: راه نجات در مسیحیت' },
                    value: `مقاله_${i}`,
                 { value: 'مقاله_تثلیث', text: 'مقاله: درک مفهوم تثلیث' }
                    text: `مقاله مسیحی شماره ${i}`
             ],
                 });
             'فروشگاه کتاب': [
             }
                { value: 'فروشگاه_کتاب_مسیحیت_ایران', text: 'فروشگاه: کتاب مسیحیت در ایران تا صدر اسلام' },
              
                { value: 'فروشگاه_کتاب_انجیل_متی', text: 'فروشگاه: کتاب انجیل متی (مطالعه تفسیری)' },
            for (let i = 1; i <= 120; i++) {
                { value: 'فروشگاه_کتاب_مزامیر', text: 'فروشگاه: کتاب مزامیر داوود' },
                 categories['فروشگاه کتاب'].push({
                 { value: 'فروشگاه_کتاب_پیدایش', text: 'فروشگاه: کتاب پیدایش و تفسیر آن' },
                    value: `فروشگاه_${i}`,
                { value: 'فروشگاه_کتاب_دعا', text: 'فروشگاه: کتاب دعاهای مسیحی' },
                    text: `کتاب قابل خرید شماره ${i}`
                { value: 'فروشگاه_کتاب_الهیات', text: 'فروشگاه: کتاب الهیات سیستماتیک' },
                 });
                 { value: 'فروشگاه_کتاب_تاریخ', text: 'فروشگاه: کتاب تاریخ کلیسای ایران' },
            }
                { value: 'فروشگاه_کتاب_رساله', text: 'فروشگاه: کتاب رساله به رومیان' }
              
             ]
            return categories;
         };
         }
 
        const largeBooksData = generateLargeDataset();


        // عناصر DOM
         const categorySelect = document.getElementById('categorySelect');
         const categorySelect = document.getElementById('categorySelect');
         const selectDisplay = document.getElementById('selectDisplay');
         const selectDisplay = document.getElementById('selectDisplay');
خط ۵۲۳: خط ۴۸۹:
         const optionsList = document.getElementById('optionsList');
         const optionsList = document.getElementById('optionsList');
         const optionsContainer = document.getElementById('optionsContainer');
         const optionsContainer = document.getElementById('optionsContainer');
        const paginationContainer = document.getElementById('paginationContainer');
         const selectedContentValue = document.getElementById('selectedContentValue');
         const selectedContentValue = document.getElementById('selectedContentValue');
         const contentFrame = document.getElementById('contentFrame');
         const contentFrame = document.getElementById('contentFrame');
         const iframePlaceholder = document.getElementById('iframePlaceholder');
         const iframePlaceholder = document.getElementById('iframePlaceholder');
خط ۵۳۸: خط ۵۰۴:
         let currentZoom = 100;
         let currentZoom = 100;
         let currentContent = '';
         let currentContent = '';
        let currentItems = [];


        // وقتی دسته‌بندی تغییر کرد
         categorySelect.addEventListener('change', function() {
         categorySelect.addEventListener('change', function() {
             const selectedCategory = this.value;
             const selectedCategory = this.value;
خط ۵۵۱: خط ۵۱۹:
             }
             }
              
              
             currentCategory = selectedCategory;
             // فعال کردن نمایش
            currentItems = largeBooksData[selectedCategory];
             selectDisplay.textContent = 'برای مشاهده محتوا کلیک کنید';
            totalPages = Math.ceil(currentItems.length / ITEMS_PER_PAGE);
            currentPage = 1;
            currentSearchTerm = '';
           
             selectDisplay.textContent = `آماده برای جستجو`;
             selectDisplay.style.color = '#333';
             selectDisplay.style.color = '#333';
             selectedContentValue.value = '';
             selectedContentValue.value = '';
            currentItems = booksData[selectedCategory];
              
              
             resetContent();
             resetContent();
         });
         });


        // وقتی روی نمایش کلیک می‌شود
         selectDisplay.addEventListener('click', function() {
         selectDisplay.addEventListener('click', function() {
             if (!currentCategory) return;
             if (!categorySelect.value) {
                alert('لطفاً ابتدا یک دسته‌بندی انتخاب کنید');
                categorySelect.focus();
                return;
            }
              
              
             if (optionsList.style.display === 'block') {
             if (optionsList.style.display === 'block') {
خط ۵۷۲: خط ۵۴۱:
                 optionsList.style.display = 'block';
                 optionsList.style.display = 'block';
                 searchInput.value = '';
                 searchInput.value = '';
                 currentSearchTerm = '';
                  
                 showPage(1);
                 // در اینجا تابع populateOptions فراخوانی می‌شود
                populateOptions(currentItems);
               
                 setTimeout(() => {
                 setTimeout(() => {
                     searchInput.focus();
                     searchInput.focus();
خط ۵۸۰: خط ۵۵۱:
         });
         });


        // وقتی کاربر در فیلد جستجو تایپ می‌کند
         searchInput.addEventListener('input', function() {
         searchInput.addEventListener('input', function() {
             clearTimeout(searchTimeout);
             const searchTerm = this.value.toLowerCase();
            currentSearchTerm = this.value.toLowerCase();
             const filteredItems = currentItems.filter(item =>  
              
                 item.text.toLowerCase().includes(searchTerm)
            searchTimeout = setTimeout(() => {
            );
                 currentPage = 1;
             populateOptions(filteredItems, searchTerm);
                showPage(1);
             }, 300);
         });
         });


         function showPage(page) {
        // پر کردن لیست گزینه‌ها - این تابع اکنون به درستی فراخوانی می‌شود
             currentPage = page;
         function populateOptions(itemsList, searchTerm = '') {
           
             console.log('populateOptions فراخوانی شد با', itemsList.length, 'آیتم');
            let filteredItems = currentItems;
            if (currentSearchTerm) {
                filteredItems = currentItems.filter(item =>
                    item.text.toLowerCase().includes(currentSearchTerm)
                );
            }
              
              
            totalPages = Math.ceil(filteredItems.length / ITEMS_PER_PAGE);
            if (totalPages === 0) totalPages = 1;
           
            const startIndex = (page - 1) * ITEMS_PER_PAGE;
            const endIndex = Math.min(startIndex + ITEMS_PER_PAGE, filteredItems.length);
            const pageItems = filteredItems.slice(startIndex, endIndex);
           
            populateOptions(pageItems);
            showPagination(filteredItems.length);
        }
        function populateOptions(itemsList) {
             optionsContainer.innerHTML = '';
             optionsContainer.innerHTML = '';
              
              
خط ۶۲۱: خط ۵۷۳:
                 return;
                 return;
             }
             }
           
            const fragment = document.createDocumentFragment();
              
              
             itemsList.forEach(item => {
             itemsList.forEach(item => {
خط ۶۲۸: خط ۵۷۸:
                 option.className = 'option-item';
                 option.className = 'option-item';
                  
                  
                 if (currentSearchTerm) {
                 if (searchTerm) {
                     const regex = new RegExp(`(${currentSearchTerm})`, 'gi');
                    // هایلایت کردن متن جستجو شده
                     const regex = new RegExp(`(${searchTerm})`, 'gi');
                     const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>');
                     const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>');
                     option.innerHTML = highlightedText;
                     option.innerHTML = highlightedText;
خط ۶۴۲: خط ۵۹۳:
                     optionsList.style.display = 'none';
                     optionsList.style.display = 'none';
                      
                      
                    // نمایش محتوا
                     currentContent = item.value;
                     currentContent = item.value;
                     showContent(item.value, item.text);
                     showContent(item.value, item.text);
                 });
                 });
                  
                  
                 fragment.appendChild(option);
                 optionsContainer.appendChild(option);
             });
             });
           
            optionsContainer.appendChild(fragment);
        }
        function showPagination(totalItems) {
            paginationContainer.innerHTML = '';
           
            if (totalPages <= 1) {
                paginationContainer.style.display = 'none';
                return;
            }
           
            paginationContainer.style.display = 'flex';
           
            const prevButton = document.createElement('button');
            prevButton.innerHTML = '&laquo; قبلی';
            prevButton.disabled = currentPage === 1;
            prevButton.addEventListener('click', () => showPage(currentPage - 1));
            paginationContainer.appendChild(prevButton);
           
            const startPage = Math.max(1, currentPage - 2);
            const endPage = Math.min(totalPages, currentPage + 2);
           
            if (startPage > 1) {
                const firstButton = document.createElement('button');
                firstButton.textContent = '1';
                firstButton.addEventListener('click', () => showPage(1));
                paginationContainer.appendChild(firstButton);
            }
           
            for (let i = startPage; i <= endPage; i++) {
                const pageButton = document.createElement('button');
                pageButton.textContent = i;
                if (i === currentPage) {
                    pageButton.classList.add('active');
                }
                pageButton.addEventListener('click', () => showPage(i));
                paginationContainer.appendChild(pageButton);
            }
           
            if (endPage < totalPages) {
                const lastButton = document.createElement('button');
                lastButton.textContent = totalPages;
                lastButton.addEventListener('click', () => showPage(totalPages));
                paginationContainer.appendChild(lastButton);
            }
           
            const nextButton = document.createElement('button');
            nextButton.innerHTML = 'بعدی &raquo;';
            nextButton.disabled = currentPage === totalPages;
            nextButton.addEventListener('click', () => showPage(currentPage + 1));
            paginationContainer.appendChild(nextButton);
           
            const infoText = document.createElement('div');
            infoText.className = 'page-info';
            infoText.textContent = `صفحه ${currentPage} از ${totalPages}`;
            paginationContainer.appendChild(infoText);
         }
         }


        // نمایش محتوا
         function showContent(bookValue, bookText) {
         function showContent(bookValue, bookText) {
             const contentUrl = `https://www.pediabible.com/index.php/${bookValue}?action=render`;
             const contentUrl = `https://www.pediabible.com/index.php/${bookValue}?action=render`;
خط ۷۱۴: خط ۶۱۰:
             contentTitle.textContent = bookText;
             contentTitle.textContent = bookText;
              
              
            // نمایش loading
             contentFrame.style.display = 'none';
             contentFrame.style.display = 'none';
             iframePlaceholder.style.display = 'flex';
             iframePlaceholder.style.display = 'flex';
خط ۷۲۳: خط ۶۲۰:
             `;
             `;
              
              
            // نوار پیشرفت
             let progress = 0;
             let progress = 0;
             const progressInterval = setInterval(() => {
             const progressInterval = setInterval(() => {
                 progress += Math.random() * 10;
                 progress += Math.random() * 15;
                 if (progress > 80) progress = 80;
                 if (progress > 90) progress = 90;
                 loadingBar.style.width = `${progress}%`;
                 loadingBar.style.width = `${progress}%`;
             }, 200);
             }, 200);
              
              
             setTimeout(() => {
             // بارگذاری محتوا
            contentFrame.src = contentUrl;
           
            contentFrame.onload = function() {
                 clearInterval(progressInterval);
                 clearInterval(progressInterval);
                 loadingBar.style.width = '100%';
                 loadingBar.style.width = '100%';
خط ۷۴۰: خط ۶۴۱:
                 iframePlaceholder.style.display = 'none';
                 iframePlaceholder.style.display = 'none';
                 applyZoom();
                 applyZoom();
                  
            };
                 contentFrame.contentDocument.write(`
           
                    <html dir="rtl">
            contentFrame.onerror = function() {
                     <head><title>${bookText}</title></head>
                clearInterval(progressInterval);
                    <body style="padding: 20px; font-family: Tahoma;">
                 loadingBar.style.width = '0%';
                        <h1>${bookText}</h1>
                 iframePlaceholder.style.display = 'flex';
                         <p>این یک نمایش نمونه از محتوای "${bookText}" است.</p>
                iframePlaceholder.innerHTML = `
                     </body>
                     <div>
                    </html>
                        <i class="fas fa-exclamation-triangle" style="font-size: 1.5rem; color: #dc3545; margin-bottom: 10px;"></i>
                 `);
                         <p>خطا در بارگذاری "${bookText}". لطفاً دوباره تلاش کنید.</p>
                 contentFrame.contentDocument.close();
                     </div>
             }, 1500);
                 `;
                 contentFrame.style.display = 'none';
             };
              
              
            // به‌روزرسانی لینک‌ها
             wikiLink.href = wikiUrl;
             wikiLink.href = wikiUrl;
             wikiLink.style.display = 'flex';
             wikiLink.style.display = 'flex';
خط ۷۶۳: خط ۶۶۷:
         }
         }


        // مشاهده مستقیم
         directView.addEventListener('click', function() {
         directView.addEventListener('click', function() {
             if (currentContent) {
             if (currentContent) {
خط ۷۷۰: خط ۶۷۵:
         });
         });


        // کنترل بزرگ‌نمایی
         function applyZoom() {
         function applyZoom() {
             contentFrame.style.zoom = `${currentZoom}%`;
             contentFrame.style.zoom = `${currentZoom}%`;
خط ۸۰۶: خط ۷۱۲:
         }
         }


        // بستن لیست وقتی کاربر در جای دیگری کلیک می‌کند
         document.addEventListener('click', function(event) {
         document.addEventListener('click', function(event) {
             if (!event.target.closest('.searchable-select')) {
             if (!event.target.closest('.searchable-select')) {
خط ۸۱۲: خط ۷۱۹:
         });
         });


        // مدیریت کلیدهای کیبورد
         searchInput.addEventListener('keydown', function(event) {
         searchInput.addEventListener('keydown', function(event) {
             if (event.key === 'Escape') {
             if (event.key === 'Escape') {
خط ۸۱۷: خط ۷۲۵:
             }
             }
         });
         });
        // لاگ برای دیباگ
        console.log('سیستم بارگذاری شد. حالا می‌توانید تست کنید:');
        console.log('1. یک دسته‌بندی انتخاب کنید');
        console.log('2. روی "برای مشاهده محتوا کلیک کنید" کلیک کنید');
        console.log('3. لیست محتواها نمایش داده می‌شود');
     </script>
     </script>
</body>
</body>
</html>
</html>

نسخهٔ ‏۱۶ اکتبر ۲۰۲۵، ساعت ۰۳:۵۲

<!DOCTYPE html> کتابخانه انتشارات دانشنامه کتاب مقدس

کتابخانه دانشنامه کتاب مقدس

مطالعه آنلاین کتاب‌ها و مقالات مسیحی

کتابخانه جامع منابع مسیحی

کتابخانهٔ دانشنامهٔ کتاب مقدس مرجع کامل و تخصصی برای مطالعهٔ آنلاین کتاب‌ها و مقالات مسیحی است.

کتاب‌ها

انتشار همهٔ کتاب‌ها در دانشنامه با اجازهٔ رسمی نویسندگان یا ناشران انجام شده است.

مقالات

مقالات دانشنامه با اجازهٔ نویسندگان یا بر اساس منابع عمومی منتشر می‌شوند.

فروشگاه کتاب

در فروشگاه کتاب دانشنامه، امکان خرید کتاب‌های چاپی و الکترونیکی فراهم شده است.

لطفاً دسته‌بندی انتخاب کنید
لطفاً ابتدا یک دسته‌بندی انتخاب کنید
هیچ محتوایی انتخاب نشده است

لطفاً یک کتاب یا مقاله از لیست انتخاب کنید