کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۱: | خط ۱: | ||
<html lang="fa" dir="rtl"> | <html lang="fa" dir="rtl"> | ||
<head> | <head> | ||
خط ۲۷۴: | خط ۲۷۳: | ||
.admin-panel { | .admin-panel { | ||
background: # | background: #e9f7ef; | ||
padding: 15px; | padding: 15px; | ||
margin: 0 15px 15px; | margin: 0 15px 15px; | ||
border: 1px solid # | border: 1px solid #c8e6d1; | ||
border-radius: 8px; | border-radius: 8px; | ||
border-right: 4px solid #4a7c59; | |||
} | } | ||
.admin-panel h3 { | .admin-panel h3 { | ||
color: # | color: #2d6a4f; | ||
margin-bottom: 15px; | margin-bottom: 15px; | ||
font-size: 16px; | font-size: 16px; | ||
خط ۳۱۵: | خط ۳۱۵: | ||
.admin-btn:hover { | .admin-btn:hover { | ||
background: #3e6f73; | background: #3e6f73; | ||
} | } | ||
.custom-content-section { | .custom-content-section { | ||
background: # | background: #f8f9fa; | ||
padding: 15px; | padding: 15px; | ||
margin: 0 15px 15px; | margin: 0 15px 15px; | ||
border: 1px solid # | border: 1px solid #dee2e6; | ||
border-radius: 8px; | border-radius: 8px; | ||
} | } | ||
.custom-content-section h3 { | .custom-content-section h3 { | ||
color: # | color: #3e6f73; | ||
margin-bottom: 10px; | margin-bottom: 10px; | ||
font-size: 16px; | font-size: 16px; | ||
خط ۳۷۱: | خط ۳۶۳: | ||
.notification.error { | .notification.error { | ||
background: #dc3545; | background: #dc3545; | ||
} | |||
.admin-toggle { | |||
position: fixed; | |||
top: 10px; | |||
left: 10px; | |||
background: #4a7c59; | |||
color: white; | |||
border: none; | |||
border-radius: 50%; | |||
width: 40px; | |||
height: 40px; | |||
cursor: pointer; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
z-index: 1001; | |||
box-shadow: 0 2px 8px rgba(0,0,0,0.2); | |||
} | } | ||
خط ۴۳۴: | خط ۴۴۴: | ||
<body> | <body> | ||
<div class="notification" id="notification"></div> | <div class="notification" id="notification"></div> | ||
<!-- دکمه مخفی برای فعالسازی حالت مدیر --> | |||
<button class="admin-toggle" id="adminToggle" title="فعالسازی حالت مدیر"> | |||
<i class="fas fa-user-shield"></i> | |||
</button> | |||
<div class="container"> | <div class="container"> | ||
خط ۴۵۸: | خط ۴۷۳: | ||
</section> | </section> | ||
<!-- پنل مدیریت | <!-- پنل مدیریت --> | ||
<section class="admin-panel" id="adminPanel" style="display: none;"> | <section class="admin-panel" id="adminPanel" style="display: none;"> | ||
<h3><i class="fas fa-user-shield"></i> پنل مدیریت</h3> | <h3><i class="fas fa-user-shield"></i> پنل مدیریت</h3> | ||
<p style="font-size: 12px; color: #666; margin-bottom: 15px;"> | |||
حالت مدیریت فعال است. میتوانید محتوای جدید به کتابخانه اضافه کنید. | |||
</p> | |||
<div class="admin-controls"> | <div class="admin-controls"> | ||
<button class="admin-btn" id="addContentBtn"> | <button class="admin-btn" id="addContentBtn"> | ||
<i class="fas fa-plus"></i> افزودن محتوای جدید | <i class="fas fa-plus"></i> افزودن محتوای جدید | ||
</button> | </button> | ||
<button class="admin-btn | <button class="admin-btn" id="disableAdminBtn"> | ||
<i class="fas fa- | <i class="fas fa-times"></i> غیرفعال کردن حالت مدیر | ||
</button> | </button> | ||
</div> | </div> | ||
</section> | </section> | ||
<!-- بخش محتوای سفارشی | <!-- بخش محتوای سفارشی --> | ||
<section class="custom-content-section" id="customContentSection" style="display: none;"> | <section class="custom-content-section" id="customContentSection" style="display: none;"> | ||
<h3><i class="fas fa-edit"></i> افزودن محتوای سفارشی</h3> | <h3><i class="fas fa-edit"></i> افزودن محتوای سفارشی</h3> | ||
خط ۴۸۵: | خط ۵۰۳: | ||
</div> | </div> | ||
<p style="font-size: 12px; color: #666; margin-top: 10px;"> | <p style="font-size: 12px; color: #666; margin-top: 10px;"> | ||
توجه: این محتوا فقط در این جلسه مرورگر شما ذخیره میشود | توجه: این محتوا فقط در این جلسه مرورگر شما ذخیره میشود. | ||
</p> | </p> | ||
</section> | </section> | ||
خط ۵۴۶: | خط ۵۶۴: | ||
<script> | <script> | ||
// دادههای | // دادههای اصلی | ||
const | const defaultBooksData = { | ||
'کتاب': [ | 'کتاب': [ | ||
{ value: 'عیسی', text: 'عیسی' }, | { value: 'عیسی', text: 'عیسی' }, | ||
خط ۵۸۱: | خط ۵۹۹: | ||
const customContentSection = document.getElementById('customContentSection'); | const customContentSection = document.getElementById('customContentSection'); | ||
const addContentBtn = document.getElementById('addContentBtn'); | const addContentBtn = document.getElementById('addContentBtn'); | ||
const | const disableAdminBtn = document.getElementById('disableAdminBtn'); | ||
const customTitle = document.getElementById('customTitle'); | const customTitle = document.getElementById('customTitle'); | ||
const customCategory = document.getElementById('customCategory'); | const customCategory = document.getElementById('customCategory'); | ||
const addCustomContent = document.getElementById('addCustomContent'); | const addCustomContent = document.getElementById('addCustomContent'); | ||
const notification = document.getElementById('notification'); | const notification = document.getElementById('notification'); | ||
const adminToggle = document.getElementById('adminToggle'); | |||
let currentZoom = 100; | let currentZoom = 100; | ||
let currentContent = ''; | let currentContent = ''; | ||
let | let isAdminMode = false; | ||
let booksData = { ...defaultBooksData }; | |||
// | // نمایش اعلان | ||
function | function showNotification(message, isError = false) { | ||
notification.textContent = message; | |||
notification.className = 'notification' + (isError ? ' error' : ''); | |||
notification.style.display = 'block'; | |||
setTimeout(() => { | |||
notification.style.display = 'none'; | |||
}, 3000); | |||
} | } | ||
// | // فعالسازی حالت مدیر | ||
function | function enableAdminMode() { | ||
isAdminMode = true; | |||
adminPanel.style.display = 'block'; | |||
customContentSection.style.display = 'block'; | |||
adminToggle.style.display = 'none'; | |||
showNotification('حالت مدیریت فعال شد'); | |||
// ذخیره در localStorage | |||
localStorage.setItem('adminModeEnabled', 'true'); | |||
} | } | ||
// | // غیرفعالسازی حالت مدیر | ||
function | function disableAdminMode() { | ||
isAdminMode = false; | |||
adminPanel.style.display = 'none'; | |||
customContentSection.style.display = 'none'; | |||
adminToggle.style.display = 'flex'; | |||
showNotification('حالت مدیریت غیرفعال شد'); | |||
// حذف از localStorage | |||
localStorage.removeItem('adminModeEnabled'); | |||
} | } | ||
// بررسی | // بررسی وضعیت در localStorage | ||
function | function checkAdminStatus() { | ||
const adminEnabled = localStorage.getItem('adminModeEnabled'); | |||
const | if (adminEnabled === 'true') { | ||
enableAdminMode(); | |||
} | } | ||
} | } | ||
// افزودن محتوای سفارشی | // افزودن محتوای سفارشی | ||
addCustomContent.addEventListener('click', function() { | addCustomContent.addEventListener('click', function() { | ||
if (! | if (!isAdminMode) { | ||
showNotification(' | showNotification('لطفاً ابتدا حالت مدیریت را فعال کنید', true); | ||
return; | return; | ||
} | } | ||
خط ۷۱۳: | خط ۶۸۲: | ||
showNotification(`محتوای "${title}" با موفقیت اضافه شد`); | showNotification(`محتوای "${title}" با موفقیت اضافه شد`); | ||
customTitle.value = ''; | customTitle.value = ''; | ||
// ذخیره در localStorage | |||
saveCustomContent(); | |||
// بهروزرسانی لیست در صورت انتخاب دستهبندی مربوطه | // بهروزرسانی لیست در صورت انتخاب دستهبندی مربوطه | ||
خط ۷۱۸: | خط ۶۹۰: | ||
updateContentList(category); | updateContentList(category); | ||
} | } | ||
}); | }); | ||
// افزودن محتوای جدید | // افزودن محتوای جدید | ||
addContentBtn.addEventListener('click', function() { | addContentBtn.addEventListener('click', function() { | ||
if (! | if (!isAdminMode) { | ||
showNotification(' | showNotification('لطفاً ابتدا حالت مدیریت را فعال کنید', true); | ||
return; | return; | ||
} | } | ||
خط ۷۳۵: | خط ۷۰۴: | ||
}); | }); | ||
// | // غیرفعال کردن حالت مدیر | ||
disableAdminBtn.addEventListener('click', function() { | |||
disableAdminMode(); | |||
}); | |||
// فعال کردن حالت مدیر با دکمه مخفی | |||
adminToggle.addEventListener('click', function() { | |||
enableAdminMode(); | |||
}); | }); | ||
خط ۷۵۵: | خط ۷۲۲: | ||
} | } | ||
// ذخیره در localStorage | // ذخیره محتوای سفارشی در localStorage | ||
function | function saveCustomContent() { | ||
localStorage.setItem('pediabible_custom_content', JSON.stringify( | // فقط محتوای سفارشی را ذخیره میکنیم (بدون محتوای پیشفرض) | ||
const customContent = {}; | |||
Object.keys(booksData).forEach(category => { | |||
const defaultItems = defaultBooksData[category] || []; | |||
const allItems = booksData[category] || []; | |||
// فقط آیتمهایی که در پیشفرض نیستند را ذخیره میکنیم | |||
customContent[category] = allItems.filter(item => | |||
!defaultItems.some(defaultItem => defaultItem.value === item.value) | |||
); | |||
}); | |||
localStorage.setItem('pediabible_custom_content', JSON.stringify(customContent)); | |||
} | } | ||
// بارگذاری از localStorage | // بارگذاری محتوای سفارشی از localStorage | ||
function | function loadCustomContent() { | ||
const saved = localStorage.getItem('pediabible_custom_content'); | const saved = localStorage.getItem('pediabible_custom_content'); | ||
if (saved) { | if (saved) { | ||
const | try { | ||
const customContent = JSON.parse(saved); | |||
// ترکیب محتوای پیشفرض با محتوای سفارشی | |||
Object.keys(customContent).forEach(category => { | |||
if (!booksData[category]) { | |||
}); | booksData[category] = []; | ||
} | |||
booksData[category] = [ | |||
...(defaultBooksData[category] || []), | |||
...customContent[category] | |||
]; | |||
}); | |||
} catch (e) { | |||
console.error('خطا در بارگذاری محتوای سفارشی:', e); | |||
} | |||
} | } | ||
} | } | ||
خط ۷۷۸: | خط ۷۶۷: | ||
contentSelect.innerHTML = '<option value="">لطفاً محتوا انتخاب کنید</option>'; | contentSelect.innerHTML = '<option value="">لطفاً محتوا انتخاب کنید</option>'; | ||
booksData[category].forEach(item => { | if (booksData[category]) { | ||
booksData[category].forEach(item => { | |||
const option = document.createElement('option'); | |||
option.value = item.value; | |||
option.textContent = item.text; | |||
contentSelect.appendChild(option); | |||
}); | |||
} | |||
} | } | ||
خط ۹۲۸: | خط ۹۱۹: | ||
} | } | ||
// | // بارگذاری اولیه | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
loadCustomContent(); | |||
checkAdminStatus(); | |||
}); | }); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۳ اکتبر ۲۰۲۵، ساعت ۰۱:۲۲
کتابخانه پدیا بایبل
مطالعه آنلاین کتابها و مقالات مذهبی شامل کتابهای مقدس و مقالات تخصصی
کتابخانه جامع منابع مذهبی
کتابخانه پدیا بایبل مرجع کامل و تخصصی برای مطالعه آنلاین کتابهای مقدس و مقالات مذهبی است. در این کتابخانه میتوانید به منابع معتبر و جامعی از متون دینی دسترسی داشته باشید.
کتابهای مقدس
مطالعه کتابهای مقدس از جمله عیسی، انجیل متی، مزامیر، پیدایش و دیگر متون مذهبی با ترجمههای معتبر
مقالات تخصصی
مقالات متعدد درباره موضوعات مذهبی مانند مسیح، تثلیث، نجات، روح القدس و دیگر مفاهیم دینی
هیچ محتوایی انتخاب نشده است
لطفاً یک کتاب یا مقاله از لیست انتخاب کنید