پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۱: خط ۱:
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<html lang="fa" dir="rtl">
<head>
<head>
خط ۳۶۶: خط ۳۶۵:
             direction: rtl;
             direction: rtl;
             text-align: right;
             text-align: right;
        }
        .content-frame {
            width: 100%;
            height: 100%;
            border: none;
            background: white;
         }
         }
     </style>
     </style>
خط ۳۸۹: خط ۳۹۵:
             'pediabible.com',
             'pediabible.com',
             'www.pediabible.com',
             'www.pediabible.com',
             'localhost', // برای توسعه
             'localhost',
             '127.0.0.1' // برای توسعه
             '127.0.0.1'
         ];
         ];


خط ۴۰۱: خط ۴۰۷:
             );
             );
              
              
             console.log('🔍 بررسی دامنه:', {
             if (!isAllowed) {
                دامنه_جاری: currentDomain,
                console.log('⛔ دسترسی غیرمجاز به دامنه:', currentDomain);
                مجاز: isAllowed,
             }
                دامنه_های_مجاز: ALLOWED_DOMAINS
             });
              
              
             return isAllowed;
             return isAllowed;
خط ۴۵۵: خط ۴۵۹:
                             <option value="farsi">ترجمه فارسی</option>
                             <option value="farsi">ترجمه فارسی</option>
                             <option value="old_farsi">ترجمه قدیم فارسی</option>
                             <option value="old_farsi">ترجمه قدیم فارسی</option>
                            <option value="arabic">ترجمه عربی</option>
                             <option value="english">ترجمه انگلیسی</option>
                             <option value="english">ترجمه انگلیسی (KJV)</option>
                            <option value="french">ترجمه فرانسوی</option>
                         </select>
                         </select>
                     </div>
                     </div>
خط ۴۹۸: خط ۵۰۰:
                         <a href="#" class="wiki-link" id="wiki-page-link" target="_blank" style="display: none;">
                         <a href="#" class="wiki-link" id="wiki-page-link" target="_blank" style="display: none;">
                             <i class="fas fa-external-link-alt"></i>
                             <i class="fas fa-external-link-alt"></i>
                             صفحه کامل
                             مشاهده در ویکی
                         </a>
                         </a>
                          
                          
خط ۵۸۵: خط ۵۸۷:
             // پایگاه‌های داده برای ترجمه‌های مختلف
             // پایگاه‌های داده برای ترجمه‌های مختلف
             const translationBases = {
             const translationBases = {
                 'farsi': 'https://www.pediabible.com/index.php?title=',
                 'farsi': 'https://fa.wikipedia.org/wiki/',
                 'old_farsi': 'https://www.pediabible.com/index.php?title=',
                 'old_farsi': 'https://fa.wikipedia.org/wiki/',
                'arabic': 'https://ar.pediabible.com/index.php?title=',
                 'english': 'https://en.wikipedia.org/wiki/'
                 'english': 'https://en.pediabible.com/index.php?title=',
                'french': 'https://fr.pediabible.com/index.php?title='
             };
             };


             // الگوهای عنوان برای ترجمه‌های مختلف
             // الگوهای عنوان برای ترجمه‌های مختلف
             const translationPatterns = {
             const translationPatterns = {
                 'farsi': (bookDisplayName, chapter) => `${bookDisplayName} فصل ${chapter}`,
                 'farsi': (bookDisplayName, chapter) => `${bookDisplayName}_فصل_${chapter}`,
                 'old_farsi': (bookDisplayName, chapter) => `${bookDisplayName} فصل ${chapter} (قدیم)`,
                 'old_farsi': (bookDisplayName, chapter) => `${bookDisplayName}_فصل_${chapter}_(ترجمه_قدیم)`,
                'arabic': (bookDisplayName, chapter) => `${bookDisplayName} الاصحاح ${chapter}`,
                 'english': (bookDisplayName, chapter) => `${bookDisplayName}_Chapter_${chapter}`
                 'english': (bookDisplayName, chapter) => `${bookDisplayName} Chapter ${chapter}`,
                'french': (bookDisplayName, chapter) => `${bookDisplayName} Chapitre ${chapter}`
             };
             };


خط ۶۴۴: خط ۶۴۲:
             translationSelect.addEventListener('change', function() {
             translationSelect.addEventListener('change', function() {
                 currentTranslation = this.value;
                 currentTranslation = this.value;
                 if (currentBook && currentChapter) {
                 if (currentBook !== '' && currentChapter) {
                     displayChapterWithIframe();
                     displayChapterContent();
                 }
                 }
             });
             });
خط ۶۸۲: خط ۶۸۰:
                  
                  
                 if (currentChapter) {
                 if (currentChapter) {
                     displayChapterWithIframe();
                     displayChapterContent();
                 } else {
                 } else {
                     resetContent();
                     resetContent();
خط ۶۸۸: خط ۶۸۶:
             });
             });


             // نمایش فصل با iframe - با ترجمه انتخابی
             // نمایش محتوای فصل
             function displayChapterWithIframe() {
             function displayChapterContent() {
                 const bookIndex = parseInt(currentBook);
                 const bookIndex = parseInt(currentBook);
                 const bookData = bibleData[currentTestament][bookIndex];
                 const bookData = bibleData[currentTestament][bookIndex];
خط ۶۹۷: خط ۶۹۵:
                 chapterTitle.textContent = `${bookName} - فصل ${currentChapter} (${getTranslationName(currentTranslation)})`;
                 chapterTitle.textContent = `${bookName} - فصل ${currentChapter} (${getTranslationName(currentTranslation)})`;
                  
                  
                 // ساخت عنوان بر اساس ترجمه انتخابی
                 // محتوای نمونه برای نمایش
                 const pageTitle = translationPatterns[currentTranslation](bookDisplayName, currentChapter);
                 const sampleContent = generateSampleContent(bookName, currentChapter, currentTranslation);
                const baseUrl = translationBases[currentTranslation];
                // استفاده از action=render برای نمایش فقط محتوای اصلی
                const contentUrl = `${baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                  
                  
                 versesContainer.innerHTML = `
                 versesContainer.innerHTML = `
                     <iframe
                     <div class="content-display">
                        id="content-iframe"
                         <div style="padding: 20px; line-height: 2; font-size: 1.1rem; text-align: justify;">
                         src="${contentUrl}"  
                            <h3 style="text-align: center; color: var(--primary-color); margin-bottom: 20px;">
                        class="content-display"
                                ${bookName} - فصل ${currentChapter}
                        frameborder="0"
                            </h3>
                        loading="lazy"
                            <div style="direction: rtl; text-align: right;">
                         allowfullscreen>
                                ${sampleContent}
                     </iframe>
                            </div>
                            <div style="margin-top: 30px; padding: 15px; background: var(--light-color); border-radius: 5px; border-right: 4px solid var(--secondary-color);">
                                <strong>ترجمه:</strong> ${getTranslationName(currentTranslation)}<br>
                                <strong>کتاب:</strong> ${bookName}<br>
                                <strong>فصل:</strong> ${currentChapter}
                            </div>
                         </div>
                     </div>
                 `;
                 `;
                  
                  
                 // لینک صفحه کامل برای باز کردن در تب جدید
                 // لینک ویکی (نمونه)
                const pageTitle = translationPatterns[currentTranslation](bookDisplayName, currentChapter);
                const baseUrl = translationBases[currentTranslation];
                 wikiPageLink.href = `${baseUrl}${encodeURIComponent(pageTitle)}`;
                 wikiPageLink.href = `${baseUrl}${encodeURIComponent(pageTitle)}`;
                 wikiPageLink.style.display = 'flex';
                 wikiPageLink.style.display = 'flex';
                 updateNavigationButtons();
                 updateNavigationButtons();
            }
            // تولید محتوای نمونه
            function generateSampleContent(bookName, chapter, translation) {
                const samples = {
                    'farsi': [
                        `در ابتدا خدا آسمانها و زمین را آفرید. و زمین تهی و بایر بود، و تاریکی بر روی لجه. و روح خدا سطح آبها را فرو پوشانید.`,
                        `خدا گفت: «نور بشود» و نور شد. و خدا نور را دید که نیکوست، و خدا نور را از تاریکی جدا کرد.`,
                        `و خدا نور را روز نامید، و تاریکی را شب. و شام بود و صبح بود، روز اول.`
                    ],
                    'old_farsi': [
                        `در ابتدا خدا آسمان و زمین را بیافرید. و زمین ویران و تهی بود، و تاریکی بر روی لجه. و روح خدا بر روی آبها حرکت می‌کرد.`,
                        `و خدا گفت: «روشنی بشود» پس روشنی شد. و خدا روشنی را دید که نیکوست، و خدا روشنی را از تاریکی جدا ساخت.`,
                        `و خدا روشنی را روز خواند، و تاریکی را شب. پس شامگاه بود و بامداد بود، روز یکم.`
                    ],
                    'english': [
                        `In the beginning God created the heaven and the earth. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.`,
                        `And God said, Let there be light: and there was light. And God saw the light, that it was good: and God divided the light from the darkness.`,
                        `And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.`
                    ]
                };
               
                const content = samples[translation] || samples['farsi'];
                let html = '';
               
                content.forEach((verse, index) => {
                    html += `<p style="margin-bottom: 15px;"><strong>آیه ${index + 1}:</strong> ${verse}</p>`;
                });
               
                return html;
             }
             }


خط ۷۲۵: خط ۷۵۹:
                     'farsi': 'فارسی',
                     'farsi': 'فارسی',
                     'old_farsi': 'فارسی قدیم',
                     'old_farsi': 'فارسی قدیم',
                    'arabic': 'عربی',
                     'english': 'انگلیسی'
                     'english': 'انگلیسی',
                    'french': 'فرانسوی'
                 };
                 };
                 return translationNames[translationCode] || 'فارسی';
                 return translationNames[translationCode] || 'فارسی';
خط ۷۴۴: خط ۷۷۶:
                     currentChapter--;
                     currentChapter--;
                     chapterSelect.value = currentChapter;
                     chapterSelect.value = currentChapter;
                     displayChapterWithIframe();
                     displayChapterContent();
                 }
                 }
             });
             });
خط ۷۵۵: خط ۷۸۷:
                     currentChapter++;
                     currentChapter++;
                     chapterSelect.value = currentChapter;
                     chapterSelect.value = currentChapter;
                     displayChapterWithIframe();
                     displayChapterContent();
                 }
                 }
             });
             });

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

کتاب مقدس - مطالعه آنلاین

کتاب مقدس - مطالعه آنلاین

مطالعه کتاب مقدس با ترجمه‌های مختلف به زبان فارسی