پرش به محتوا

تست: تفاوت میان نسخه‌ها

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۷: خط ۷:
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
     <style>
     <style>
        :root {
            --primary-color: #2c3e50;
            --secondary-color: #3e6f73;
            --accent-color: #A52A2A;
            --light-color: #f8f5f2;
            --dark-color: #3E2723;
            --border-color: #D2B48C;
        }
       
         * {
         * {
             margin: 0;
             margin: 0;
خط ۶۰: خط ۵۱:
             font-size: 16px;
             font-size: 16px;
             margin-top: 10px;
             margin-top: 10px;
            line-height: 1.6;
         }
         }
          
          
خط ۸۴: خط ۷۴:
         }
         }
          
          
        /* استایل برای select با جستجو */
         .custom-select-container {
         .custom-select-container {
             position: relative;
             position: relative;
خط ۱۳۹: خط ۱۲۸:
             cursor: pointer;
             cursor: pointer;
             border-bottom: 1px solid #f0f0f0;
             border-bottom: 1px solid #f0f0f0;
            transition: background-color 0.2s;
         }
         }
          
          
         .option-item:hover {
         .option-item:hover {
             background-color: #e9ecef;
             background-color: #e9ecef;
        }
       
        .option-item:last-child {
            border-bottom: none;
         }
         }
          
          
خط ۲۰۸: خط ۱۹۲:
         .wiki-link {
         .wiki-link {
             background-color: #3e6f73;
             background-color: #3e6f73;
             color: white !important;
             color: white;
             text-decoration: none;
             text-decoration: none;
             font-weight: bold;
             font-weight: bold;
             padding: 10px 20px;
             padding: 10px 20px;
            border: 1px solid #3e6f73;
             border-radius: 4px;
             border-radius: 4px;
             transition: all 0.3s;
             border: none;
        }
             cursor: pointer;
       
        .wiki-link:hover {
            background-color: #2d5257;
             color: white !important;
         }
         }
          
          
خط ۲۵۹: خط ۲۳۸:
                             ابتدا دسته‌بندی را انتخاب کنید
                             ابتدا دسته‌بندی را انتخاب کنید
                         </div>
                         </div>
                        <select id="bookSelect" style="display: none;">
                            <option value="">ابتدا دسته‌بندی را انتخاب کنید</option>
                        </select>
                          
                          
                         <div class="custom-select-dropdown" id="customDropdown">
                         <div class="custom-select-dropdown" id="customDropdown">
خط ۲۶۸: خط ۲۴۴:
                             </div>
                             </div>
                             <div class="options-container" id="optionsContainer">
                             <div class="options-container" id="optionsContainer">
                                <!-- options here will be populated by JavaScript -->
                             </div>
                             </div>
                         </div>
                         </div>
خط ۲۹۵: خط ۲۷۰:


     <script>
     <script>
        // داده‌های کتاب‌ها و مقالات
         const booksData = {
         const booksData = {
             'کتاب': [
             'کتاب': [
خط ۳۱۱: خط ۲۸۵:
         };
         };


        // عناصر DOM
         const categorySelect = document.getElementById('categorySelect');
         const categorySelect = document.getElementById('categorySelect');
        const bookSelect = document.getElementById('bookSelect');
         const customSelectDisplay = document.getElementById('customSelectDisplay');
         const customSelectDisplay = document.getElementById('customSelectDisplay');
         const customDropdown = document.getElementById('customDropdown');
         const customDropdown = document.getElementById('customDropdown');
خط ۳۲۶: خط ۲۹۸:
         let currentSelection = { value: '', text: '' };
         let currentSelection = { value: '', text: '' };


        // پر کردن لیست کتاب‌ها بر اساس دسته‌بندی
         function updateBookList() {
         function updateBookList() {
             const selectedCategory = categorySelect.value;
             const selectedCategory = categorySelect.value;
خط ۳۳۲: خط ۳۰۳:
              
              
             if (!selectedCategory) {
             if (!selectedCategory) {
                // اگر دسته‌بندی انتخاب نشده
                 customSelectDisplay.textContent = 'ابتدا دسته‌بندی را انتخاب کنید';
                 customSelectDisplay.textContent = 'ابتدا دسته‌بندی را انتخاب کنید';
                 customSelectDisplay.style.color = '#6c757d';
                 customSelectDisplay.style.color = '#6c757d';
خط ۳۳۹: خط ۳۰۹:
             }
             }
              
              
            const books = booksData[selectedCategory];
             customSelectDisplay.textContent = 'لطفاً محتوا انتخاب کنید';
             customSelectDisplay.textContent = 'لطفاً محتوا انتخاب کنید';
             customSelectDisplay.style.color = '#333';
             customSelectDisplay.style.color = '#333';
خط ۳۴۵: خط ۳۱۴:
         }
         }


        // باز کردن/بستن dropdown
         customSelectDisplay.addEventListener('click', function(e) {
         customSelectDisplay.addEventListener('click', function(e) {
             if (!currentCategory) return;
             if (!currentCategory) return;
خط ۳۶۰: خط ۳۲۸:
         });
         });


        // بستن dropdown وقتی کلیک خارج شود
         document.addEventListener('click', function() {
         document.addEventListener('click', function() {
             isDropdownOpen = false;
             isDropdownOpen = false;
خط ۳۶۶: خط ۳۳۳:
         });
         });


        // جلوگیری از بستن وقتی روی dropdown کلیک شود
         customDropdown.addEventListener('click', function(e) {
         customDropdown.addEventListener('click', function(e) {
             e.stopPropagation();
             e.stopPropagation();
         });
         });


        // پر کردن options در dropdown
         function populateDropdownOptions(searchTerm = '') {
         function populateDropdownOptions(searchTerm = '') {
             if (!currentCategory) return;
             if (!currentCategory) return;
خط ۴۱۷: خط ۳۸۲:
                 noResult.textContent = 'نتیجه‌ای یافت نشد';
                 noResult.textContent = 'نتیجه‌ای یافت نشد';
                 noResult.style.color = '#999';
                 noResult.style.color = '#999';
                noResult.style.cursor = 'default';
                 optionsContainer.appendChild(noResult);
                 optionsContainer.appendChild(noResult);
             }
             }
         }
         }


        // جستجو در dropdown
         dropdownSearch.addEventListener('input', function() {
         dropdownSearch.addEventListener('input', function() {
             populateDropdownOptions(this.value);
             populateDropdownOptions(this.value);
         });
         });


        // نمایش محتوا در iframe
         function showContent(bookValue, bookText) {
         function showContent(bookValue, bookText) {
            console.log('نمایش محتوا:', bookValue, bookText);
           
             if (!bookValue) {
             if (!bookValue) {
                 resetContent();
                 resetContent();
خط ۴۳۹: خط ۳۹۹:
             const wikiUrl = `https://www.pediabible.com/index.php/${bookValue}`;
             const wikiUrl = `https://www.pediabible.com/index.php/${bookValue}`;
              
              
            console.log('URL محتوا:', contentUrl);
           
            // نمایش حالت لودینگ
             contentFrame.style.display = 'none';
             contentFrame.style.display = 'none';
             iframePlaceholder.style.display = 'flex';
             iframePlaceholder.style.display = 'flex';
خط ۴۵۱: خط ۴۰۸:
             `;
             `;
              
              
            // تنظیم iframe
             contentFrame.src = contentUrl;
             contentFrame.src = contentUrl;
              
              
            // وقتی iframe لود شد
             contentFrame.onload = function() {
             contentFrame.onload = function() {
                console.log('محتوای iframe لود شد');
                 contentFrame.style.display = 'block';
                 contentFrame.style.display = 'block';
                 iframePlaceholder.style.display = 'none';
                 iframePlaceholder.style.display = 'none';
             };
             };
              
              
            // اگر iframe خطا داد
             contentFrame.onerror = function() {
             contentFrame.onerror = function() {
                console.error('خطا در لود iframe');
                 iframePlaceholder.style.display = 'flex';
                 iframePlaceholder.style.display = 'flex';
                 iframePlaceholder.innerHTML = `
                 iframePlaceholder.innerHTML = `
خط ۴۷۴: خط ۴۲۶:
             };
             };
              
              
            // به‌روزرسانی لینک ویکی
             wikiLink.href = wikiUrl;
             wikiLink.href = wikiUrl;
             wikiLink.textContent = `مشاهده صفحه کامل "${bookText}"`;
             wikiLink.textContent = `مشاهده صفحه کامل "${bookText}"`;
خط ۴۸۰: خط ۴۳۱:
         }
         }


        // بازنشانی محتوا
         function resetContent() {
         function resetContent() {
             currentSelection = { value: '', text: '' };
             currentSelection = { value: '', text: '' };
خط ۴۹۵: خط ۴۴۵:
         }
         }


        // رویداد تغییر دسته‌بندی
         categorySelect.addEventListener('change', updateBookList);
         categorySelect.addEventListener('change', updateBookList);


        // بارگذاری اولیه - هیچ چیزی انتخاب نشده
         updateBookList();
         updateBookList();
     </script>
     </script>
</body>
</body>
</html>
</html>

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

<!DOCTYPE html> کتابخانه پدیا بایبل - مطالعه کتاب‌ها و مقالات

کتابخانه پدیا بایبل

در این بخش می‌توانید کتاب‌ها و مقالات مختلف را مطالعه کنید. برای شروع، دسته‌بندی و سپس مورد مورد نظر خود را انتخاب نمایید.
ابتدا دسته‌بندی را انتخاب کنید

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