کتاب مقدس آنلاین: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۱: | خط ۱: | ||
<!DOCTYPE html> | |||
<html lang="fa" dir="rtl"> | <html lang="fa" dir="rtl"> | ||
<head> | <head> | ||
خط ۷۲: | خط ۷۳: | ||
} | } | ||
. | .translation-selector { | ||
flex: 1; | flex: 1; | ||
min-width: | min-width: 200px; | ||
} | } | ||
. | .testament-selector { | ||
flex: 1; | flex: 1; | ||
min-width: | min-width: 200px; | ||
} | } | ||
خط ۲۷۵: | خط ۲۷۶: | ||
} | } | ||
. | .translation-selector, .testament-selector { | ||
width: 100%; | width: 100%; | ||
} | } | ||
خط ۳۶۵: | خط ۳۶۶: | ||
direction: rtl; | direction: rtl; | ||
text-align: right; | text-align: right; | ||
} | } | ||
</style> | </style> | ||
خط ۳۸۲: | خط ۳۷۶: | ||
</div> | </div> | ||
<h1>کتاب مقدس - مطالعه آنلاین</h1> | <h1>کتاب مقدس - مطالعه آنلاین</h1> | ||
<p class="description">مطالعه کتاب مقدس با ترجمههای مختلف | <p class="description">مطالعه کتاب مقدس با ترجمههای مختلف</p> | ||
</header> | </header> | ||
خط ۳۹۵: | خط ۳۸۹: | ||
'pediabible.com', | 'pediabible.com', | ||
'www.pediabible.com', | 'www.pediabible.com', | ||
'localhost', | 'localhost', // برای توسعه | ||
'127.0.0.1' | '127.0.0.1' // برای توسعه | ||
]; | ]; | ||
خط ۴۰۷: | خط ۴۰۱: | ||
); | ); | ||
console.log('🔍 بررسی دامنه:', { | |||
دامنه_جاری: currentDomain, | |||
} | مجاز: isAllowed, | ||
دامنه_های_مجاز: ALLOWED_DOMAINS | |||
}); | |||
return isAllowed; | return isAllowed; | ||
خط ۴۴۵: | خط ۴۴۱: | ||
wrapper.innerHTML = ` | wrapper.innerHTML = ` | ||
<div class="selector-container"> | <div class="selector-container"> | ||
<div class="translation-selector selector-box"> | |||
<h3 class="selector-title">ترجمه</h3> | |||
<select id="translation-select"> | |||
<option value="">انتخاب ترجمه</option> | |||
<option value="farsi">ترجمه فارسی</option> | |||
<option value="hejre_nou">هزاره نو</option> | |||
<option value="old">ترجمه قدیم</option> | |||
</select> | |||
</div> | |||
<div class="testament-selector selector-box"> | <div class="testament-selector selector-box"> | ||
<h3 class="selector-title">عهد</h3> | <h3 class="selector-title">عهد</h3> | ||
<select id="testament-select"> | <select id="testament-select" disabled> | ||
<option value="">انتخاب عهد</option> | <option value="">انتخاب عهد</option> | ||
<option value="old">عهد قدیم</option> | <option value="old">عهد قدیم</option> | ||
<option value="new">عهد جدید</option> | <option value="new">عهد جدید</option> | ||
</select> | </select> | ||
</div> | </div> | ||
خط ۴۸۱: | خط ۴۷۸: | ||
<div class="bible-content"> | <div class="bible-content"> | ||
<h2 class="chapter-title" id="chapter-title">لطفاً کتاب و فصل مورد نظر را انتخاب کنید</h2> | <h2 class="chapter-title" id="chapter-title">لطفاً ترجمه، کتاب و فصل مورد نظر را انتخاب کنید</h2> | ||
<div id="verses-container"> | <div id="verses-container"> | ||
خط ۴۸۷: | خط ۴۸۴: | ||
<div class="placeholder"> | <div class="placeholder"> | ||
<i class="fas fa-book-open"></i> | <i class="fas fa-book-open"></i> | ||
<p>برای مطالعه کتاب مقدس، لطفاً ابتدا | <p>برای مطالعه کتاب مقدس، لطفاً ابتدا ترجمه، سپس عهد، کتاب و فصل مورد نظر خود را انتخاب کنید.</p> | ||
</div> | </div> | ||
</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 | const translations = { | ||
old: [ | 'farsi': { | ||
name: 'ترجمه فارسی', | |||
baseUrl: 'https://www.pediabible.com/index.php?title=', | |||
bookNames: { | |||
old: [ | |||
{ name: "پیدایش", chapters: 50, displayName: "پیدایش" }, | |||
{ name: "خروج", chapters: 40, displayName: "خروج" }, | |||
{ name: "لاویان", chapters: 27, displayName: "لاویان" }, | |||
{ name: "اعداد", chapters: 36, displayName: "اعداد" }, | |||
{ name: "تثنیه", chapters: 34, displayName: "تثنیه" }, | |||
{ name: "یوشع", chapters: 24, displayName: "یوشع" }, | |||
{ name: "داوران", chapters: 21, displayName: "داوران" }, | |||
{ name: "روت", chapters: 4, displayName: "روت" }, | |||
{ name: "اول سموئیل", chapters: 31, displayName: "اول سموئیل" }, | |||
{ name: "دوم سموئیل", chapters: 24, displayName: "دوم سموئیل" } | |||
], | |||
new: [ | |||
{ name: "متی", chapters: 28, displayName: "انجیل متی" }, | |||
{ name: "مرقس", chapters: 16, displayName: "انجیل مرقس" }, | |||
{ name: "لوقا", chapters: 24, displayName: "انجیل لوقا" }, | |||
{ name: "یوحنا", chapters: 21, displayName: "انجیل یوحنا" }, | |||
{ name: "اعمال رسولان", chapters: 28, displayName: "اعمال رسولان" } | |||
] | |||
} | |||
}, | |||
'hejre_nou': { | |||
name: 'هزاره نو', | |||
baseUrl: 'https://www.pediabible.com/index.php?title=', | |||
bookNames: { | |||
old: [ | |||
{ name: "پیدایش (هزاره نو)", chapters: 50, displayName: "پیدایش هزاره نو" }, | |||
{ name: "خروج (هزاره نو)", chapters: 40, displayName: "خروج هزاره نو" }, | |||
{ name: "لاویان (هزاره نو)", chapters: 27, displayName: "لاویان هزاره نو" }, | |||
{ name: "اعداد (هزاره نو)", chapters: 36, displayName: "اعداد هزاره نو" }, | |||
{ name: "تثنیه (هزاره نو)", chapters: 34, displayName: "تثنیه هزاره نو" }, | |||
{ name: "یوشع (هزاره نو)", chapters: 24, displayName: "یوشع هزاره نو" }, | |||
{ name: "داوران (هزاره نو)", chapters: 21, displayName: "داوران هزاره نو" }, | |||
{ name: "روت (هزاره نو)", chapters: 4, displayName: "روت هزاره نو" }, | |||
{ name: "اول سموئیل (هزاره نو)", chapters: 31, displayName: "اول سموئیل هزاره نو" }, | |||
{ name: "دوم سموئیل (هزاره نو)", chapters: 24, displayName: "دوم سموئیل هزاره نو" } | |||
], | |||
new: [ | |||
{ name: "متی (هزاره نو)", chapters: 28, displayName: "انجیل متی هزاره نو" }, | |||
{ name: "مرقس (هزاره نو)", chapters: 16, displayName: "انجیل مرقس هزاره نو" }, | |||
{ name: "لوقا (هزاره نو)", chapters: 24, displayName: "انجیل لوقا هزاره نو" }, | |||
{ name: "یوحنا (هزاره نو)", chapters: 21, displayName: "انجیل یوحنا هزاره نو" }, | |||
{ name: "اعمال رسولان (هزاره نو)", chapters: 28, displayName: "اعمال رسولان هزاره نو" } | |||
] | |||
} | |||
}, | |||
'old': { | |||
name: 'ترجمه قدیم', | |||
{ | baseUrl: 'https://www.pediabible.com/index.php?title=', | ||
bookNames: { | |||
old: [ | |||
{ name: "پیدایش (قدیم)", chapters: 50, displayName: "پیدایش ترجمه قدیم" }, | |||
{ name: "خروج (قدیم)", chapters: 40, displayName: "خروج ترجمه قدیم" }, | |||
{ name: "لاویان (قدیم)", chapters: 27, displayName: "لاویان ترجمه قدیم" }, | |||
{ name: "اعداد (قدیم)", chapters: 36, displayName: "اعداد ترجمه قدیم" }, | |||
{ name: "تثنیه (قدیم)", chapters: 34, displayName: "تثنیه ترجمه قدیم" }, | |||
{ name: "یوشع (قدیم)", chapters: 24, displayName: "یوشع ترجمه قدیم" }, | |||
{ name: "داوران (قدیم)", chapters: 21, displayName: "داوران ترجمه قدیم" }, | |||
{ name: "روت (قدیم)", chapters: 4, displayName: "روت ترجمه قدیم" }, | |||
{ name: "اول سموئیل (قدیم)", chapters: 31, displayName: "اول سموئیل ترجمه قدیم" }, | |||
{ name: "دوم سموئیل (قدیم)", chapters: 24, displayName: "دوم سموئیل ترجمه قدیم" } | |||
], | |||
new: [ | |||
{ name: "متی (قدیم)", chapters: 28, displayName: "انجیل متی ترجمه قدیم" }, | |||
{ name: "مرقس (قدیم)", chapters: 16, displayName: "انجیل مرقس ترجمه قدیم" }, | |||
{ name: "لوقا (قدیم)", chapters: 24, displayName: "انجیل لوقا ترجمه قدیم" }, | |||
{ name: "یوحنا (قدیم)", chapters: 21, displayName: "انجیل یوحنا ترجمه قدیم" }, | |||
{ name: "اعمال رسولان (قدیم)", chapters: 28, displayName: "اعمال رسولان ترجمه قدیم" } | |||
] | |||
} | |||
} | |||
}; | }; | ||
// عناصر DOM | // عناصر DOM | ||
const translationSelect = document.getElementById('translation-select'); | |||
const testamentSelect = document.getElementById('testament-select'); | const testamentSelect = document.getElementById('testament-select'); | ||
const bookSelect = document.getElementById('book-select'); | const bookSelect = document.getElementById('book-select'); | ||
const chapterSelect = document.getElementById('chapter-select'); | const chapterSelect = document.getElementById('chapter-select'); | ||
خط ۶۱۱: | خط ۵۹۹: | ||
// متغیرهای وضعیت فعلی | // متغیرهای وضعیت فعلی | ||
let currentTranslation = ''; | |||
let currentTestament = ''; | let currentTestament = ''; | ||
let currentBook = ''; | let currentBook = ''; | ||
let currentChapter = 1; | let currentChapter = 1; | ||
// رویداد تغییر ترجمه | |||
translationSelect.addEventListener('change', function() { | |||
currentTranslation = this.value; | |||
if (currentTranslation) { | |||
testamentSelect.disabled = false; | |||
testamentSelect.value = ''; | |||
bookSelect.disabled = true; | |||
bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>'; | |||
chapterSelect.disabled = true; | |||
chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>'; | |||
resetContent(); | |||
} else { | |||
resetAll(); | |||
} | |||
}); | |||
// رویداد تغییر عهد | // رویداد تغییر عهد | ||
خط ۶۲۴: | خط ۶۲۹: | ||
bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>'; | bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>'; | ||
translations[currentTranslation].bookNames[currentTestament].forEach((book, index) => { | |||
const option = document.createElement('option'); | const option = document.createElement('option'); | ||
option.value = index; | option.value = index; | ||
خط ۶۳۵: | خط ۶۴۰: | ||
resetContent(); | resetContent(); | ||
} else { | } else { | ||
bookSelect.disabled = true; | |||
bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>'; | |||
chapterSelect.disabled = true; | |||
chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>'; | |||
resetContent(); | |||
} | } | ||
}); | }); | ||
خط ۶۵۶: | خط ۶۵۷: | ||
const bookIndex = parseInt(currentBook); | const bookIndex = parseInt(currentBook); | ||
const chaptersCount = | const chaptersCount = translations[currentTranslation].bookNames[currentTestament][bookIndex].chapters; | ||
for (let i = 1; i <= chaptersCount; i++) { | for (let i = 1; i <= chaptersCount; i++) { | ||
خط ۶۸۰: | خط ۶۸۱: | ||
if (currentChapter) { | if (currentChapter) { | ||
displayChapterWithIframe(); | |||
} else { | } else { | ||
resetContent(); | resetContent(); | ||
خط ۶۸۶: | خط ۶۸۷: | ||
}); | }); | ||
// نمایش محتوای | // نمایش فصل با iframe - فقط محتوای اصلی | ||
function | function displayChapterWithIframe() { | ||
const bookIndex = parseInt(currentBook); | const bookIndex = parseInt(currentBook); | ||
const bookData = | const bookData = translations[currentTranslation].bookNames[currentTestament][bookIndex]; | ||
const bookName = bookData.name; | const bookName = bookData.name; | ||
const bookDisplayName = bookData.displayName; | const bookDisplayName = bookData.displayName; | ||
const translationName = translations[currentTranslation].name; | |||
chapterTitle.textContent = `${bookName} - فصل ${currentChapter} | chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`; | ||
// | const pageTitle = `${bookDisplayName} فصل ${currentChapter}`; | ||
const | // استفاده از action=render برای نمایش فقط محتوای اصلی | ||
const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`; | |||
versesContainer.innerHTML = ` | versesContainer.innerHTML = ` | ||
< | <iframe | ||
id="content-iframe" | |||
src="${contentUrl}" | |||
class="content-display" | |||
frameborder="0" | |||
loading="lazy" | |||
allowfullscreen> | |||
</iframe> | |||
</ | |||
`; | `; | ||
// لینک | // لینک صفحه کامل برای باز کردن در تب جدید | ||
wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`; | |||
wikiPageLink.href = `${baseUrl}${encodeURIComponent(pageTitle)}`; | |||
wikiPageLink.style.display = 'flex'; | wikiPageLink.style.display = 'flex'; | ||
updateNavigationButtons(); | updateNavigationButtons(); | ||
} | } | ||
function updateNavigationButtons() { | function updateNavigationButtons() { | ||
const bookIndex = parseInt(currentBook); | const bookIndex = parseInt(currentBook); | ||
const chaptersCount = | const chaptersCount = translations[currentTranslation].bookNames[currentTestament][bookIndex].chapters; | ||
prevChapterBtn.disabled = currentChapter <= 1; | prevChapterBtn.disabled = currentChapter <= 1; | ||
خط ۷۷۶: | خط ۷۳۰: | ||
currentChapter--; | currentChapter--; | ||
chapterSelect.value = currentChapter; | chapterSelect.value = currentChapter; | ||
displayChapterWithIframe(); | |||
} | } | ||
}); | }); | ||
خط ۷۸۲: | خط ۷۳۶: | ||
nextChapterBtn.addEventListener('click', function() { | nextChapterBtn.addEventListener('click', function() { | ||
const bookIndex = parseInt(currentBook); | const bookIndex = parseInt(currentBook); | ||
const chaptersCount = | const chaptersCount = translations[currentTranslation].bookNames[currentTestament][bookIndex].chapters; | ||
if (currentChapter < chaptersCount) { | if (currentChapter < chaptersCount) { | ||
currentChapter++; | currentChapter++; | ||
chapterSelect.value = currentChapter; | chapterSelect.value = currentChapter; | ||
displayChapterWithIframe(); | |||
} | } | ||
}); | }); | ||
function resetContent() { | function resetContent() { | ||
chapterTitle.textContent = 'لطفاً کتاب و فصل مورد نظر را انتخاب کنید'; | chapterTitle.textContent = 'لطفاً ترجمه، کتاب و فصل مورد نظر را انتخاب کنید'; | ||
versesContainer.innerHTML = ` | versesContainer.innerHTML = ` | ||
<div class="instructions"> | <div class="instructions"> | ||
<div class="placeholder"> | <div class="placeholder"> | ||
<i class="fas fa-book-open"></i> | <i class="fas fa-book-open"></i> | ||
<p>برای مطالعه کتاب مقدس، لطفاً ابتدا | <p>برای مطالعه کتاب مقدس، لطفاً ابتدا ترجمه، سپس عهد، کتاب و فصل مورد نظر خود را انتخاب کنید.</p> | ||
</div> | </div> | ||
</div> | </div> | ||
خط ۸۰۷: | خط ۷۶۱: | ||
function resetAll() { | function resetAll() { | ||
testamentSelect.disabled = true; | |||
testamentSelect.innerHTML = '<option value="">انتخاب عهد</option>'; | |||
bookSelect.disabled = true; | bookSelect.disabled = true; | ||
bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>'; | bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>'; | ||
خط ۸۱۴: | خط ۷۷۰: | ||
} | } | ||
console.log('✅ برنامه کتاب مقدس | console.log('✅ برنامه کتاب مقدس روی دامنه مجاز بارگذاری شد'); | ||
} | } | ||
خط ۸۲۴: | خط ۷۸۰: | ||
// 🔒 جلوگیری از دسترسی به توابع از کنسول | // 🔒 جلوگیری از دسترسی به توابع از کنسول | ||
Object.defineProperty(window, ' | Object.defineProperty(window, 'translations', { | ||
value: null, | value: null, | ||
writable: false, | writable: false, |
نسخهٔ ۸ اکتبر ۲۰۲۵، ساعت ۰۳:۵۸
<!DOCTYPE html>
کتاب مقدس - مطالعه آنلاین
مطالعه کتاب مقدس با ترجمههای مختلف