کتاب مقدس آنلاین: تفاوت میان نسخهها
ظاهر
	
	
| بدون خلاصۀ ویرایش | بدون خلاصۀ ویرایش | ||
| خط ۳۰: | خط ۳۰: | ||
|              padding: 0; |              padding: 0; | ||
|              margin: 0; |              margin: 0; | ||
|          } |          } | ||
| خط ۱۸۷: | خط ۱۷۳: | ||
|          .content-display { |          .content-display { | ||
|              width: 100%; |              width: 100%; | ||
|              height: 650px; |              min-height: 650px; | ||
|              border: 1px solid var(--border-color); |              border: 1px solid var(--border-color); | ||
|              border-radius: 6px; |              border-radius: 6px; | ||
|              background: white; |              background: white; | ||
|             padding: 20px; | |||
|             overflow-y: auto; | |||
|             direction: rtl; | |||
|             text-align: right; | |||
|             line-height: 2; | |||
|         } | |||
|         .content-display table { | |||
|             width: 100%; | |||
|             border-collapse: collapse; | |||
|             margin: 15px 0; | |||
|             direction: rtl; | |||
|         } | |||
|         .content-display table,  | |||
|         .content-display th,  | |||
|         .content-display td { | |||
|             border: 1px solid var(--border-color); | |||
|         } | |||
|         .content-display th,  | |||
|         .content-display td { | |||
|             padding: 10px; | |||
|             text-align: right; | |||
|         } | |||
|         .content-display th { | |||
|             background-color: var(--light-color); | |||
|             font-weight: bold; | |||
|         } | |||
|         .content-display a { | |||
|             color: var(--accent-color); | |||
|             text-decoration: none; | |||
|             transition: color 0.3s; | |||
|         } | |||
|         .content-display a:hover { | |||
|             color: var(--primary-color); | |||
|             text-decoration: underline; | |||
|          } |          } | ||
| خط ۲۶۵: | خط ۲۹۱: | ||
|          } |          } | ||
|          . |          .loading { | ||
|              text-align: center; |              text-align: center; | ||
|              padding: 40px; |              padding: 40px; | ||
|              color: var(--primary-color); | |||
|          } |          } | ||
|          . |          .loading i { | ||
|              font-size: 2rem; | |||
|              margin-bottom: 15px; |              margin-bottom: 15px; | ||
|              color: var(--accent-color); | |||
|          } |          } | ||
| خط ۳۲۴: | خط ۳۴۶: | ||
|              .content-display { |              .content-display { | ||
|                  height: 500px; |                  min-height: 500px; | ||
|                 padding: 15px; | |||
|              } |              } | ||
| خط ۳۴۰: | خط ۳۶۳: | ||
|          @media (max-width: 480px) { |          @media (max-width: 480px) { | ||
|              .content-display { |              .content-display { | ||
|                  height: 450px; |                  min-height: 450px; | ||
|                 padding: 10px; | |||
|              } |              } | ||
| خط ۴۰۴: | خط ۴۲۸: | ||
|      <script> |      <script> | ||
|          // دادههای کامل کتابهای مقدس |          // دادههای کامل کتابهای مقدس | ||
|          const bibleBooks = { |          const bibleBooks = { | ||
| خط ۷۷۴: | خط ۷۰۱: | ||
|                  if (currentChapter) { |                  if (currentChapter) { | ||
|                      displayChapterContent(); | |||
|                  } else { |                  } else { | ||
|                      resetContent(); |                      resetContent(); | ||
| خط ۷۸۰: | خط ۷۰۷: | ||
|              }); |              }); | ||
|              // نمایش فصل  |              // نمایش محتوای فصل | ||
|              function  |              async function displayChapterContent() { | ||
|                  const bookIndex = parseInt(currentBook); |                  const bookIndex = parseInt(currentBook); | ||
|                  const bookData = bibleBooks[currentTestament][bookIndex]; |                  const bookData = bibleBooks[currentTestament][bookIndex]; | ||
| خط ۷۸۹: | خط ۷۱۶: | ||
|                  chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`; |                  chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`; | ||
|                 // نمایش حالت بارگذاری | |||
|                 versesContainer.innerHTML = ` | |||
|                     <div class="loading"> | |||
|                         <i class="fas fa-spinner fa-spin"></i> | |||
|                         <p>در حال بارگذاری محتوا...</p> | |||
|                     </div> | |||
|                 `; | |||
|                  // استفاده از الگوی مناسب برای هر ترجمه |                  // استفاده از الگوی مناسب برای هر ترجمه | ||
|                  const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter); |                  const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter); | ||
|                  // ساخت URL  |                  // ساخت URL | ||
|                  const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`; |                  const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`; | ||
|                  versesContainer.innerHTML = ` |                  try { | ||
|                     // استفاده از iframe ساده بدون محدودیتهای امنیتی | |||
|                     versesContainer.innerHTML = ` | |||
|                         <iframe   | |||
|                             src="${contentUrl}"   | |||
|                             class="content-display" | |||
|                             frameborder="0" | |||
|                             loading="lazy" | |||
|                             allowfullscreen | |||
|                  `; |                             onload="handleIframeLoad(this)"> | ||
|                         </iframe> | |||
|                     `; | |||
|                  } catch (error) { | |||
|                     console.error('خطا در بارگذاری محتوا:', error); | |||
|                     versesContainer.innerHTML = ` | |||
|                         <div class="instructions"> | |||
|                             <div class="placeholder"> | |||
|                                 <i class="fas fa-exclamation-triangle"></i> | |||
|                                 <p>خطا در بارگذاری محتوا. لطفاً دوباره تلاش کنید.</p> | |||
|                                 <p><small>${error.message}</small></p> | |||
|                             </div> | |||
|                         </div> | |||
|                     `; | |||
|                 } | |||
|                  // لینک صفحه کامل برای باز کردن در تب جدید |                  // لینک صفحه کامل برای باز کردن در تب جدید | ||
|                  wikiPageLink.href = contentUrl; |                  wikiPageLink.href = contentUrl; | ||
|                  wikiPageLink.style.display = 'flex'; |                  wikiPageLink.style.display = 'flex'; | ||
|                  updateNavigationButtons(); |                  updateNavigationButtons(); | ||
|             } | |||
|             // تابع برای مدیریت لینکهای داخل iframe | |||
|             function handleIframeLoad(iframe) { | |||
|                 try { | |||
|                     const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; | |||
|                     const links = iframeDoc.querySelectorAll('a'); | |||
|                     links.forEach(link => { | |||
|                         if (link.href &&  | |||
|                             !link.href.startsWith('javascript:') &&  | |||
|                             !link.href.startsWith('#')) { | |||
|                             link.setAttribute('target', '_blank'); | |||
|                             link.setAttribute('rel', 'noopener noreferrer'); | |||
|                         } | |||
|                     }); | |||
|                     console.log(`✅ ${links.length} لینک پردازش شد`); | |||
|                 } catch (error) { | |||
|                     console.log('⚠️ امکان دسترسی به محتوای iframe وجود ندارد'); | |||
|                 } | |||
|              } |              } | ||
| خط ۸۲۸: | خط ۷۹۶: | ||
|                      currentChapter--; |                      currentChapter--; | ||
|                      chapterSelect.value = currentChapter; |                      chapterSelect.value = currentChapter; | ||
|                      displayChapterContent(); | |||
|                  } |                  } | ||
|              }); |              }); | ||
| خط ۸۳۹: | خط ۸۰۷: | ||
|                      currentChapter++; |                      currentChapter++; | ||
|                      chapterSelect.value = currentChapter; |                      chapterSelect.value = currentChapter; | ||
|                      displayChapterContent(); | |||
|                  } |                  } | ||
|              }); |              }); | ||
| خط ۸۶۸: | خط ۸۳۶: | ||
|              } |              } | ||
|              console.log('✅ برنامه کتاب مقدس  |              console.log('✅ برنامه کتاب مقدس بارگذاری شد'); | ||
|          } |          } | ||
|          //  |          // شروع برنامه | ||
|          document.addEventListener('DOMContentLoaded', function() { |          document.addEventListener('DOMContentLoaded', function() { | ||
|              console.log('🚀 شروع بارگذاری  |              console.log('🚀 شروع بارگذاری برنامه...'); | ||
|              initializeBibleApp(); | |||
|          }); |          }); | ||
|      </script> |      </script> | ||
| </body> | </body> | ||
| </html> | </html> | ||