تست: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۱۵۶: | خط ۱۵۶: | ||
height: 100%; | height: 100%; | ||
border: none; | border: none; | ||
background: white; | |||
} | |||
.iframe-placeholder { | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
height: 100%; | |||
color: #6c757d; | |||
font-size: 18px; | |||
text-align: center; | |||
padding: 20px; | |||
} | } | ||
.action-buttons { | .action-buttons { | ||
خط ۲۵۹: | خط ۲۷۰: | ||
<div class="content-frame"> | <div class="content-frame"> | ||
<iframe id="contentFrame" class="clean-frame" src="about:blank"></iframe> | <div id="iframeContainer"> | ||
<div class="iframe-placeholder" id="iframePlaceholder"> | |||
📖 لطفاً یک کتاب یا مقاله از لیست انتخاب کنید | |||
</div> | |||
<iframe id="contentFrame" class="clean-frame" src="about:blank" style="display: none;"></iframe> | |||
</div> | |||
<div class="action-buttons"> | <div class="action-buttons"> | ||
<a href="https://www.pediabible.com" class="home-link" target="_blank"> | <a href="https://www.pediabible.com" class="home-link" target="_blank"> | ||
خط ۲۸۰: | خط ۲۹۶: | ||
const optionsContainer = document.getElementById('optionsContainer'); | const optionsContainer = document.getElementById('optionsContainer'); | ||
const contentFrame = document.getElementById('contentFrame'); | const contentFrame = document.getElementById('contentFrame'); | ||
const iframePlaceholder = document.getElementById('iframePlaceholder'); | |||
const wikiLink = document.getElementById('wikiLink'); | const wikiLink = document.getElementById('wikiLink'); | ||
خط ۳۸۱: | خط ۳۹۸: | ||
function showBook(bookValue, bookText) { | function showBook(bookValue, bookText) { | ||
if (!bookValue) { | if (!bookValue) { | ||
contentFrame. | contentFrame.style.display = 'none'; | ||
iframePlaceholder.style.display = 'flex'; | |||
iframePlaceholder.textContent = '📖 لطفاً یک کتاب یا مقاله از لیست انتخاب کنید'; | |||
wikiLink.style.display = 'none'; | wikiLink.style.display = 'none'; | ||
return; | return; | ||
} | } | ||
// استفاده از action=render برای محتوای تمیز | |||
const cleanContentUrl = `https://www.pediabible.com/index.php/${bookValue}?action=render`; | const cleanContentUrl = `https://www.pediabible.com/index.php/${bookValue}?action=render`; | ||
const wikiPageUrl = `https://www.pediabible.com/index.php/${bookValue}`; | const wikiPageUrl = `https://www.pediabible.com/index.php/${bookValue}`; | ||
console.log('در حال بارگذاری:', cleanContentUrl); | |||
// نمایش حالت لودینگ | |||
contentFrame.style.display = 'none'; | |||
iframePlaceholder.style.display = 'flex'; | |||
iframePlaceholder.textContent = '📖 در حال بارگذاری محتوا...'; | |||
// تنظیم iframe | |||
contentFrame.src = cleanContentUrl; | contentFrame.src = cleanContentUrl; | ||
// وقتی iframe لود شد | |||
contentFrame.onload = function() { | |||
contentFrame.style.display = 'block'; | |||
iframePlaceholder.style.display = 'none'; | |||
console.log('محتوای iframe با موفقیت لود شد'); | |||
}; | |||
// اگر iframe خطا داد | |||
contentFrame.onerror = function() { | |||
iframePlaceholder.style.display = 'flex'; | |||
iframePlaceholder.textContent = '❌ خطا در بارگذاری محتوا. لطفاً دوباره تلاش کنید.'; | |||
contentFrame.style.display = 'none'; | |||
console.error('خطا در بارگذاری iframe'); | |||
}; | |||
// بهروزرسانی لینک ویکی | |||
wikiLink.href = wikiPageUrl; | wikiLink.href = wikiPageUrl; | ||
wikiLink.textContent = `📖 مشاهده صفحه کامل "${bookText}"`; | wikiLink.textContent = `📖 مشاهده صفحه کامل "${bookText}"`; | ||
خط ۳۹۸: | خط ۴۴۲: | ||
// بارگذاری اولیه | // بارگذاری اولیه | ||
populateDropdownOptions(); | populateDropdownOptions(); | ||
// نمایش اولین مورد به صورت پیشفرض | |||
setTimeout(() => { | |||
if (allBooks.length > 0) { | |||
const firstBook = allBooks[0]; | |||
bookSelect.value = firstBook.value; | |||
customSelect.textContent = firstBook.text; | |||
showBook(firstBook.value, firstBook.text); | |||
} | |||
}, 500); | |||
}); | }); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۲ اکتبر ۲۰۲۵، ساعت ۱۹:۰۲
کتابخانه پدیا بایبل
در این بخش میتوانید کتابها و مقالات مختلف را مطالعه کنید.
برای شروع، دستهبندی و سپس مورد مورد نظر خود را انتخاب نمایید.
📖 لطفاً یک کتاب یا مقاله از لیست انتخاب کنید