پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
بدون خلاصۀ ویرایش
 
(۴۶ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۳۲: خط ۳۲:
         }
         }
          
          
// نمایش فصل با iframe - فقط محتوای اصلی
function displayChapterWithIframe() {
    const bookIndex = parseInt(currentBook);
    const bookData = bibleBooks[currentTestament][bookIndex];
    const bookName = bookData.name;
    const bookDisplayName = bookData.displayName;
    const translationName = translations[currentTranslation].name;
   
    chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
   
    // استفاده از الگوی مناسب برای هر ترجمه
    const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
   
    // استفاده از action=render برای نمایش فقط محتوای اصلی
    const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
   
    versesContainer.innerHTML = `
        <iframe
            id="content-iframe"
            src="${contentUrl}"
            class="content-display"
            frameborder="0"
            loading="lazy"
            allowfullscreen>
        </iframe>
    `;
   
    // اضافه کردن event listener کلیک به iframe
    setTimeout(() => {
        const iframe = document.getElementById('content-iframe');
        if (iframe) {
            iframe.addEventListener('load', function() {
                try {
                    // اضافه کردن event listener برای کلیک روی iframe
                    iframe.contentWindow.document.addEventListener('click', function(e) {
                        if (e.target.tagName === 'A' && e.target.href && e.target.href.includes('pediabible.com')) {
                            e.preventDefault();
                            window.open(e.target.href, '_blank');
                        }
                    });
                } catch (error) {
                    console.log('امکان دسترسی به iframe وجود ندارد:', error);
                    // اگر دسترسی مستقیم ممکن نبود، از postMessage استفاده کنیم
                    iframe.contentWindow.postMessage('enableLinkHandling', '*');
                }
            });
        }
    }, 1000);
   
    // لینک صفحه کامل برای باز کردن در تب جدید
    wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
    wikiPageLink.style.display = 'flex';
    updateNavigationButtons();
}
// اضافه کردن event listener برای پیام‌های iframe
window.addEventListener('message', function(e) {
    if (e.data && e.data.type === 'linkClick' && e.data.url) {
        window.open(e.data.url, '_blank');
    }
});
         /* مخفی کردن هدرهای اضافی ویکی */
         /* مخفی کردن هدرهای اضافی ویکی */
         body > header:first-child,
         body > header:first-child,
خط ۱۲۶: خط ۶۵:
             gap: 8px;
             gap: 8px;
             margin-bottom: 12px;
             margin-bottom: 12px;
             font-size: 0.9rem;
             font-size: 1.1rem;
             color: var(--dark-color);
             color: var(--dark-color);
             direction: rtl;
             direction: rtl;
خط ۱۶۳: خط ۱۰۲:
          
          
         .description {
         .description {
             color: var(--accent-color);
             color:#808080;
             font-size: 1rem;
             font-size:1rem;
             font-style: italic;
             font-style: italic;
             margin-top: 5px;
             margin-top: 5px;
خط ۲۹۵: خط ۲۳۴:
             gap: 8px;
             gap: 8px;
             padding: 12px 20px;
             padding: 12px 20px;
             background-color: var(--accent-color);
             background-color: #87CEEB;
             color: white;
             color: #000000;
             text-decoration: none;
             text-decoration: none;
             border-radius: 6px;
             border-radius: 6px;
خط ۳۳۶: خط ۲۷۵:
             margin-bottom: 15px;
             margin-bottom: 15px;
             font-size: 1.5rem;
             font-size: 1.5rem;
        }
        .info-message {
            text-align: center;
            padding: 10px;
            background: #e7f3ff;
            border-radius: 5px;
            margin-top: 10px;
            font-size: 0.9rem;
            color: #0066cc;
         }
         }


خط ۴۵۱: خط ۴۰۰:
                 <span class="breadcrumb-current">کتاب مقدس</span>
                 <span class="breadcrumb-current">کتاب مقدس</span>
             </nav>
             </nav>
             <h1>کتاب مقدس</h1>
             <h1>کتاب مقدس آنلاین</h1>
             <p class="description">مطالعه کتاب مقدس با ترجمه‌های مختلف</p>
             <p class="description">مطالعه ترجمه‌های مختلف بصورت کاربردی با واژه نامه تخصصی<br>
ترجمهٔ هزارهٔ نو و مژده هم‌اکنون قابل مطالعه‌اند و عهد جدید کامل شده است. واژه‌نامه‌ها به‌صورت روزانه و با دقت در حال اتصال و به‌روزرسانی هستند تا خدمتی ماندگار برای نسل حال و آیندگان در خداوند به‌جا بگذاریم.</p>
         </div>
         </div>
          
          
خط ۶۴۹: خط ۵۹۹:
                             </div>
                             </div>
                         </div>
                         </div>
                    </div>
                   
                    <div class="info-message">
                        <i class="fas fa-info-circle"></i>
                        واژه ها در همین پنجره نمایش داده می‌شوند. برای تجربه بهتر مطالعه واژه در تب جدید: راست کلیک → Open in new tab
                     </div>
                     </div>
                      
                      
خط ۶۷۵: خط ۶۳۰:
                     name: 'ترجمه قدیم',
                     name: 'ترجمه قدیم',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                    // برای ترجمه قدیم از الگوی ساده با displayName استفاده می‌کنیم
                     getPageTitle: function(bookDisplayName, chapter) {
                     getPageTitle: function(bookDisplayName, chapter) {
                         return `${bookDisplayName} فصل ${chapter}`;
                         return `${bookDisplayName} فصل ${chapter}`;
خط ۶۸۳: خط ۶۳۷:
                     name: 'هزاره نو',
                     name: 'هزاره نو',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                    // برای ترجمه‌های جدید از displayName + نام ترجمه استفاده می‌کنیم
                     getPageTitle: function(bookDisplayName, chapter) {
                     getPageTitle: function(bookDisplayName, chapter) {
                         return `${bookDisplayName} هزاره نو فصل ${chapter}`;
                         return `${bookDisplayName} هزاره نو فصل ${chapter}`;
خط ۸۱۴: خط ۷۶۷:
                 chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
                 chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
                  
                  
                // استفاده از الگوی مناسب برای هر ترجمه
                 const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
                 const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
               
                // استفاده از action=render برای نمایش فقط محتوای اصلی
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                  
                  
خط ۸۲۷: خط ۷۷۷:
                         frameborder="0"
                         frameborder="0"
                         loading="lazy"
                         loading="lazy"
                        sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
                         allowfullscreen>
                         allowfullscreen>
                     </iframe>
                     </iframe>
                 `;
                 `;
                 // بعد از اینکه محتوای فصل در صفحه قرار داده شد:
                  
function enableInternalLinksInNewTab(container) {
                // اضافه کردن sandbox به iframe برای امنیت بیشتر
  const links = container.querySelectorAll('a[href]');
                const iframe = document.getElementById('content-iframe');
  links.forEach(link => {
                  
    const href = link.getAttribute('href');
    if (href.startsWith('/wiki/') || href.startsWith('/index.php?title=')) {
      link.setAttribute('target', '_blank');
    }
  });
}
 
// نمونه: وقتی فصل بارگذاری می‌شود
fetch(chapterUrl)
  .then(response => response.text())
  .then(html => {
    const container = document.getElementById('chapter-content'); // یا هر id واقعی بخش فصل تو
    container.innerHTML = html;
    enableInternalLinksInNewTab(container); // این خط را اضافه کن
  });
 
                 // لینک صفحه کامل برای باز کردن در تب جدید
                 wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                 wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                 wikiPageLink.style.display = 'flex';
                 wikiPageLink.style.display = 'flex';

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

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

کتاب مقدس آنلاین

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