کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخهها
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۲۷۳: | خط ۲۷۳: | ||
} | } | ||
/* استایل برای | /* استایل برای لیست کشویی با قابلیت جستجو */ | ||
.searchable-select { | .searchable-select { | ||
position: relative; | position: relative; | ||
} | } | ||
. | .search-input { | ||
width: 100%; | |||
padding: 10px 12px; | |||
border: 1px solid #ced4da; | |||
border-radius: 6px; | |||
font-size: 13px; | |||
background: white; | |||
transition: all 0.3s ease; | |||
border: 1px solid #e9ecef; | |||
margin-bottom: 5px; | |||
} | |||
.search-input:focus { | |||
outline: none; | |||
border-color: #3e6f73; | |||
box-shadow: 0 0 0 2px rgba(62, 111, 115, 0.1); | |||
} | |||
.search-input:disabled { | |||
background-color: #f8f9fa; | |||
color: #6c757d; | |||
cursor: not-allowed; | |||
border-color: #dee2e6; | |||
} | |||
.options-list { | |||
position: absolute; | position: absolute; | ||
left: | top: 100%; | ||
left: 0; | |||
right: 0; | |||
z-index: 1; | background: white; | ||
color: # | border: 1px solid #ced4da; | ||
font- | border-radius: 6px; | ||
max-height: 200px; | |||
overflow-y: auto; | |||
z-index: 1000; | |||
display: none; | |||
box-shadow: 0 4px 12px rgba(0,0,0,0.1); | |||
} | |||
.option-item { | |||
padding: 10px 12px; | |||
cursor: pointer; | |||
border-bottom: 1px solid #f1f1f1; | |||
font-size: 13px; | |||
transition: background-color 0.2s ease; | |||
} | |||
.option-item:hover { | |||
background: #f0f8f0; | |||
} | |||
.option-item:last-child { | |||
border-bottom: none; | |||
} | |||
.highlight { | |||
background: #fff3cd; | |||
font-weight: bold; | |||
padding: 1px 2px; | |||
border-radius: 2px; | |||
} | } | ||
. | .no-results { | ||
color: #6c757d; | |||
font-style: italic; | |||
} | } | ||
خط ۵۲۷: | خط ۵۸۰: | ||
<div class="form-group"> | <div class="form-group"> | ||
<label for=" | <label for="contentSearch"><i class="fas fa-book-open"></i> انتخاب محتوا:</label> | ||
<div class="searchable-select"> | <div class="searchable-select"> | ||
< | <input type="text" id="contentSearch" class="search-input" placeholder="جستجو در محتواها..." disabled> | ||
<div class="options-list" id="optionsList"> | |||
</ | <!-- گزینهها اینجا نمایش داده میشوند --> | ||
</div> | |||
</div> | </div> | ||
< | <input type="hidden" id="selectedContentValue"> | ||
</div> | </div> | ||
</div> | </div> | ||
خط ۵۷۷: | خط ۶۳۱: | ||
// دادههای ساده | // دادههای ساده | ||
const booksData = { | const booksData = { | ||
'کتاب': [ | |||
{ value: 'کتاب آغاز مسیحیت در ایران', text: 'آغاز مسیحیت در ایران' }, | |||
{ value: 'انجیل_متی', text: 'انجیل متی' }, | |||
{ value: 'مزامیر', text: 'مزامیر' }, | |||
{ value: 'پیدایش', text: 'پیدایش' } | |||
], | |||
'مقاله': [ | |||
{ value: 'مقاله_۸_تفاوت_کلیدی_بین_کاتولیکها_و_پروتستانها_نویسنده', text: '۸ تفاوت کلیدی بین کاتولیکها و پروتستانها' }, | |||
{ value: 'مقاله_برادران،_ما_تحلیل%E2%80%8Cگران_سیاسی_نیستیم', text: 'برادران، ما تحلیلگران سیاسی نیستیم' }, | |||
{ value: 'مقاله_گناه_آدمی_را_نادان_میکند', text: 'گناه آدمی را نادان میکند' }, | |||
{ value: 'مقاله_۴_دلیل_که_چرا_کتاب_مقدس_از_تراجنسیتی_بودن_حمایت_نمی%E2%80%8Cکند', text: '۴ دلیل که چرا کتاب مقدس از تراجنسیتی بودن حمایت نمیکند' }, | |||
{ value: '۱۰_معنای_یهوه', text: '۱۰ معنای یهوه' }, | |||
{ value: 'تدریس،_آموزش_و_مطالعه', text: 'تدریس، آموزش و مطالعه' }, | |||
{ value: 'خدمت_به_خدا_یعنی_چه', text: 'خدمت به خدا یعنی چه' } | |||
] | |||
}; | }; | ||
// عناصر | // عناصر | ||
const categorySelect = document.getElementById('categorySelect'); | const categorySelect = document.getElementById('categorySelect'); | ||
const | const contentSearch = document.getElementById('contentSearch'); | ||
const | const optionsList = document.getElementById('optionsList'); | ||
const selectedContentValue = document.getElementById('selectedContentValue'); | |||
const contentFrame = document.getElementById('contentFrame'); | const contentFrame = document.getElementById('contentFrame'); | ||
const iframePlaceholder = document.getElementById('iframePlaceholder'); | const iframePlaceholder = document.getElementById('iframePlaceholder'); | ||
خط ۶۱۱: | خط ۶۶۶: | ||
let currentZoom = 100; | let currentZoom = 100; | ||
let currentContent = ''; | let currentContent = ''; | ||
let currentItems = []; | |||
// وقتی دستهبندی تغییر کرد | // وقتی دستهبندی تغییر کرد | ||
خط ۶۱۷: | خط ۶۷۳: | ||
if (!selectedCategory) { | if (!selectedCategory) { | ||
contentSearch.disabled = true; | |||
contentSearch.value = ''; | |||
selectedContentValue.value = ''; | |||
optionsList.innerHTML = ''; | |||
resetContent(); | resetContent(); | ||
return; | return; | ||
} | } | ||
// | // فعال کردن فیلد جستجو | ||
contentSearch.disabled = false; | |||
contentSearch.value = ''; | |||
selectedContentValue.value = ''; | |||
currentItems = booksData[selectedCategory]; | |||
// | // پر کردن لیست اولیه | ||
populateOptions(currentItems); | |||
resetContent(); | resetContent(); | ||
}); | }); | ||
// وقتی | // وقتی کاربر در فیلد جستجو تایپ میکند | ||
contentSearch.addEventListener('input', function() { | |||
const | const searchTerm = this.value.toLowerCase(); | ||
const | const filteredItems = currentItems.filter(item => | ||
item.text.toLowerCase().includes(searchTerm) | |||
); | |||
populateOptions(filteredItems, searchTerm); | |||
}); | |||
// وقتی کاربر روی فیلد جستجو کلیک میکند | |||
contentSearch.addEventListener('focus', function() { | |||
optionsList.style.display = 'block'; | |||
if (this.value === '') { | |||
populateOptions(currentItems); | |||
} | |||
}); | |||
// وقتی کاربر از فیلد جستجو خارج میشود | |||
contentSearch.addEventListener('blur', function() { | |||
// کمی تاخیر برای اجازه دادن به کلیک روی گزینهها | |||
setTimeout(() => { | |||
optionsList.style.display = 'none'; | |||
}, 200); | |||
}); | |||
// پر کردن لیست گزینهها | |||
function populateOptions(itemsList, searchTerm = '') { | |||
optionsList.innerHTML = ''; | |||
if ( | if (itemsList.length === 0) { | ||
const noResult = document.createElement('div'); | |||
noResult.className = 'option-item no-results'; | |||
noResult.textContent = 'نتیجهای یافت نشد'; | |||
optionsList.appendChild(noResult); | |||
return; | return; | ||
} | } | ||
currentContent = | itemsList.forEach(item => { | ||
const option = document.createElement('div'); | |||
option.className = 'option-item'; | |||
if (searchTerm) { | |||
// هایلایت کردن متن جستجو شده | |||
const regex = new RegExp(`(${searchTerm})`, 'gi'); | |||
const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>'); | |||
option.innerHTML = highlightedText; | |||
} else { | |||
option.textContent = item.text; | |||
} | |||
option.addEventListener('click', function() { | |||
contentSearch.value = item.text; | |||
selectedContentValue.value = item.value; | |||
optionsList.style.display = 'none'; | |||
// نمایش محتوا | |||
currentContent = item.value; | |||
showContent(item.value, item.text); | |||
}); | |||
optionsList.appendChild(option); | |||
}); | |||
} | |||
// نمایش محتوا | // نمایش محتوا | ||
خط ۷۷۰: | خط ۸۶۶: | ||
loadingBar.style.width = '0%'; | loadingBar.style.width = '0%'; | ||
} | } | ||
// بستن لیست وقتی کاربر در جای دیگری کلیک میکند | |||
document.addEventListener('click', function(event) { | |||
if (!event.target.closest('.searchable-select')) { | |||
optionsList.style.display = 'none'; | |||
} | |||
}); | |||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۶ اکتبر ۲۰۲۵، ساعت ۰۰:۲۱
کتابخانه دانشنامه کتاب مقدس
مطالعه آنلاین کتابها و مقالات مسیحی دارای اجازه پخش در دانشنامه کتاب مقدس
کتابخانه جامع منابع مسیحی
کتابخانهٔ دانشنامهٔ کتاب مقدس مرجع کامل و تخصصی برای مطالعهٔ آنلاین کتابها و مقالات مسیحی است، همهٔ مطالب با کسب اجازه از ناشران یا نویسندگان منتشر شدهاند و حقوق آنها برای انتشارات دانشنامهٔ کتاب مقدس محفوظ است. در صورت نبود حق کپیرایت، انتشار با رعایت اصول امانت و احترام به منبع انجام گرفته است.
کتابها
انتشار همهٔ کتابها در دانشنامه با اجازهٔ رسمی نویسندگان یا ناشران انجام شده است، و برای برخی آثار، مجوز چاپ مجدد نیز دریافت گردیده است. تمامی حقوق برای انتشارات دانشنامهٔ کتاب مقدس محفوظ است. نویسندگان و ناشران مسیحی میتوانند برای همکاری و انتشار آثار خود با ما در ارتباط باشند.
مقالات
مقالات دانشنامه با اجازهٔ نویسندگان یا بر اساس منابع عمومی و بدون حق کپیرایت منتشر میشوند. در همهٔ موارد، اصول امانتداری و احترام به منبع اصلی رعایت شده است. پژوهشگران و نویسندگان مسیحی میتوانند برای انتشار مقالات خود با ما همکاری کنند
لطفاً یک کتاب یا مقاله از لیست انتخاب کنید