تست: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۱: | خط ۱: | ||
<html lang="fa" dir="rtl"> | <html lang="fa" dir="rtl"> | ||
<head> | <head> | ||
خط ۱۳۶: | خط ۱۳۵: | ||
const wikiLink = document.getElementById('wikiLink'); | const wikiLink = document.getElementById('wikiLink'); | ||
const originalOptions = Array.from(bookSelect.options); | const originalOptions = Array.from(bookSelect.options); | ||
function filterBooks() { | function filterBooks() { | ||
const category = categorySelect.value; | const category = categorySelect.value; | ||
bookSelect.innerHTML = ''; | bookSelect.innerHTML = ''; | ||
const firstOption = document.createElement('option'); | const firstOption = document.createElement('option'); | ||
firstOption.value = ""; | firstOption.value = ""; | ||
خط ۱۵۲: | خط ۱۴۷: | ||
bookSelect.appendChild(firstOption); | bookSelect.appendChild(firstOption); | ||
originalOptions.forEach(option => { | originalOptions.forEach(option => { | ||
if (option.value === "") return; | if (option.value === "") return; | ||
const itemCategory = option.getAttribute('data-category'); | const itemCategory = option.getAttribute('data-category'); | ||
خط ۱۶۳: | خط ۱۵۷: | ||
} | } | ||
function showBook(bookValue, bookText) { | function showBook(bookValue, bookText) { | ||
if (!bookValue) { | if (!bookValue) { | ||
خط ۱۷۱: | خط ۱۶۴: | ||
} | } | ||
// | // استفاده از action=render برای محتوای تمیز | ||
const cleanContentUrl = `https://www.pediabible.com/index.php/${bookValue}`; | 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); | console.log('در حال بارگذاری آدرس:', cleanContentUrl); | ||
// | // استفاده از iframe با action=render | ||
contentFrame.src = cleanContentUrl; | contentFrame.src = cleanContentUrl; | ||
wikiLink.href = wikiPageUrl; | wikiLink.href = wikiPageUrl; | ||
wikiLink.textContent = `📖 مطالعه کامل "${bookText}" در ویکی`; | wikiLink.textContent = `📖 مطالعه کامل "${bookText}" در ویکی`; | ||
خط ۱۸۶: | خط ۱۷۸: | ||
} | } | ||
categorySelect.addEventListener('change', filterBooks); | categorySelect.addEventListener('change', filterBooks); | ||
خط ۱۹۸: | خط ۱۸۹: | ||
}); | }); | ||
filterBooks(); | filterBooks(); | ||
setTimeout(() => { | setTimeout(() => { | ||
if (bookSelect.options.length > 1) { | if (bookSelect.options.length > 1) { |
نسخهٔ ۱۲ اکتبر ۲۰۲۵، ساعت ۱۸:۳۹