کتاب مقدس آنلاین: تفاوت میان نسخهها
ظاهر
	
	
| بدون خلاصۀ ویرایش | بدون خلاصۀ ویرایش | ||
| خط ۳۸: | خط ۳۸: | ||
|          #mw-header, |          #mw-header, | ||
|          #header, |          #header, | ||
|          .header { |          .header, | ||
|         #mw-navigation, | |||
|         #mw-panel, | |||
|         #footer, | |||
|         .mw-footer { | |||
|              display: none !important; |              display: none !important; | ||
|          } |          } | ||
| خط ۴۵۵: | خط ۴۵۹: | ||
|                  try { |                  try { | ||
|                      const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |                      const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; | ||
|                     // مخفی کردن هدرها و فوترها در داخل iframe | |||
|                     const elementsToHide = iframeDoc.querySelectorAll( | |||
|                         '#mw-navigation, #mw-panel, #footer, .mw-footer, .mw-header, header, .header' | |||
|                     ); | |||
|                     elementsToHide.forEach(el => { | |||
|                         el.style.display = 'none'; | |||
|                     }); | |||
|                     // اضافه کردن target="_blank" به تمام لینکها | |||
|                      const links = iframeDoc.querySelectorAll('a'); |                      const links = iframeDoc.querySelectorAll('a'); | ||
|                      links.forEach(link => { |                      links.forEach(link => { | ||
|                          if (link.href &&   |                          if (link.href &&   | ||
|                              !link.href.startsWith('javascript:') &&   |                              !link.href.startsWith('javascript:') &&   | ||
|                              !link.href.startsWith('#')) { |                              !link.href.startsWith('#')) { | ||
|                              link.setAttribute('target', '_blank'); |                              link.setAttribute('target', '_blank'); | ||
|                              link.setAttribute('rel', 'noopener noreferrer'); |                              link.setAttribute('rel', 'noopener noreferrer'); | ||
| خط ۴۷۰: | خط ۴۸۲: | ||
|                  } catch (error) { |                  } catch (error) { | ||
|                      console.log('⚠️ امکان دسترسی به محتوای iframe وجود ندارد (محدودیت CORS)'); |                      console.log('⚠️ امکان دسترسی به محتوای iframe وجود ندارد (محدودیت CORS)'); | ||
|                  } |                  } | ||
|              }); |              }); | ||
| خط ۶۶۰: | خط ۶۵۳: | ||
|                      name: 'ترجمه قدیم', |                      name: 'ترجمه قدیم', | ||
|                      baseUrl: 'https://www.pediabible.com/index.php?title=', |                      baseUrl: 'https://www.pediabible.com/index.php?title=', | ||
|                      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=', | ||
|                      getPageTitle: function(bookDisplayName, chapter) { |                      getPageTitle: function(bookDisplayName, chapter) { | ||
|                          return `${bookDisplayName} هزاره نو فصل ${chapter}`; |                          return `${bookDisplayName} هزاره نو فصل ${chapter}`; | ||
| خط ۷۸۹: | خط ۷۸۰: | ||
|              }); |              }); | ||
|              // نمایش فصل با iframe  |              // نمایش فصل با iframe | ||
|              function displayChapterWithIframe() { |              function displayChapterWithIframe() { | ||
|                  const bookIndex = parseInt(currentBook); |                  const bookIndex = parseInt(currentBook); | ||
| خط ۸۰۲: | خط ۷۹۳: | ||
|                  const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter); |                  const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter); | ||
|                  //  |                  // ساخت URL بدون action=render | ||
|                  const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)} |                  const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`; | ||
|                  versesContainer.innerHTML = ` |                  versesContainer.innerHTML = ` | ||
| خط ۸۱۷: | خط ۸۰۸: | ||
|                  // لینک صفحه کامل برای باز کردن در تب جدید |                  // لینک صفحه کامل برای باز کردن در تب جدید | ||
|                  wikiPageLink.href =  |                  wikiPageLink.href = contentUrl; | ||
|                  wikiPageLink.style.display = 'flex'; |                  wikiPageLink.style.display = 'flex'; | ||