کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۶: | خط ۶: | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | ||
<style> | <style> | ||
/* استایلها مانند قبل */ | |||
* { | * { | ||
margin: 0; | margin: 0; | ||
خط ۳۶۳: | خط ۳۶۴: | ||
.notification.error { | .notification.error { | ||
background: #dc3545; | background: #dc3545; | ||
} | } | ||
خط ۴۴۴: | خط ۴۲۷: | ||
<body> | <body> | ||
<div class="notification" id="notification"></div> | <div class="notification" id="notification"></div> | ||
<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 style="font-size: 12px; color: #666; margin-bottom: 15px;"> | ||
شما به عنوان مدیر وارد شدهاید. میتوانید محتوای جدید به کتابخانه اضافه کنید. | |||
</p> | </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> | ||
</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> | ||
خط ۵۹۹: | خط ۵۷۴: | ||
const customContentSection = document.getElementById('customContentSection'); | const customContentSection = document.getElementById('customContentSection'); | ||
const addContentBtn = document.getElementById('addContentBtn'); | const addContentBtn = document.getElementById('addContentBtn'); | ||
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'); | ||
let currentZoom = 100; | let currentZoom = 100; | ||
let currentContent = ''; | let currentContent = ''; | ||
let | let isMediaWikiAdmin = false; | ||
let booksData = { ...defaultBooksData }; | let booksData = { ...defaultBooksData }; | ||
خط ۶۲۲: | خط ۵۹۵: | ||
} | } | ||
// | // بررسی وضعیت مدیر در مدیاویکی | ||
function | async function checkMediaWikiAdminStatus() { | ||
try { | |||
// روش 1: استفاده از API مدیاویکی | |||
const apiUrl = window.location.origin + '/api.php?action=query&meta=userinfo&uiprop=groups&format=json'; | |||
const response = await fetch(apiUrl); | |||
const data = await response.json(); | |||
if (data.query && data.query.userinfo) { | |||
const groups = data.query.userinfo.groups || []; | |||
const isAdmin = groups.includes('sysop') || groups.includes('bureaucrat'); | |||
if (isAdmin) { | |||
enableAdminFeatures(); | |||
return; | |||
} | |||
} | |||
// روش 2: بررسی از طریق کوکیها | |||
checkAdminByCookies(); | |||
} catch (error) { | |||
console.log('خطا در بررسی وضعیت مدیر:', error); | |||
// روش 3: بررسی از طریق المنتهای صفحه | |||
checkAdminByPageElements(); | |||
} | |||
} | |||
// بررسی از طریق کوکیهای مدیاویکی | |||
function checkAdminByCookies() { | |||
const cookies = document.cookie.split(';'); | |||
let mediaWikiUser = null; | |||
for (let cookie of cookies) { | |||
const [name, value] = cookie.trim().split('='); | |||
if (name === 'MediaWikiUser' || name === 'mwuser') { | |||
mediaWikiUser = decodeURIComponent(value); | |||
break; | |||
} | |||
} | |||
// | // اگر کاربر وارد شده باشد و نام کاربری مشخص باشد، احتمالاً مدیر است | ||
if (mediaWikiUser && mediaWikiUser !== 'Anonymous') { | |||
// اینجا میتوانید لیست مدیران را چک کنید | |||
const adminUsers = ['مدیر', 'admin', 'administrator']; // نامهای مدیران | |||
if (adminUsers.some(admin => mediaWikiUser.toLowerCase().includes(admin.toLowerCase()))) { | |||
enableAdminFeatures(); | |||
} | |||
} | |||
} | } | ||
// | // بررسی از طریق المنتهای صفحه مدیاویکی | ||
function | function checkAdminByPageElements() { | ||
// بررسی وجود لینکهای مدیریتی | |||
const adminElements = document.querySelectorAll( | |||
'#pt-administration, #ca-protect, .mw-group-admin, a[href*="Special:"]' | |||
); | |||
if (adminElements.length > 0) { | |||
enableAdminFeatures(); | |||
} | |||
} | } | ||
// | // فعالسازی ویژگیهای مدیر | ||
function | function enableAdminFeatures() { | ||
isMediaWikiAdmin = true; | |||
adminPanel.style.display = 'block'; | |||
customContentSection.style.display = 'block'; | |||
console.log('ویژگیهای مدیریتی برای مدیر مدیاویکی فعال شد'); | |||
} | } | ||
// افزودن محتوای سفارشی | // افزودن محتوای سفارشی | ||
addCustomContent.addEventListener('click', function() { | addCustomContent.addEventListener('click', function() { | ||
if (! | if (!isMediaWikiAdmin) { | ||
showNotification(' | showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | ||
return; | return; | ||
} | } | ||
خط ۶۹۴: | خط ۷۰۷: | ||
// افزودن محتوای جدید | // افزودن محتوای جدید | ||
addContentBtn.addEventListener('click', function() { | addContentBtn.addEventListener('click', function() { | ||
if (! | if (!isMediaWikiAdmin) { | ||
showNotification(' | showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | ||
return; | return; | ||
} | } | ||
خط ۷۰۲: | خط ۷۱۵: | ||
customContentSection.scrollIntoView({ behavior: 'smooth' }); | customContentSection.scrollIntoView({ behavior: 'smooth' }); | ||
customTitle.focus(); | customTitle.focus(); | ||
}); | }); | ||
خط ۷۲۴: | خط ۷۲۷: | ||
// ذخیره محتوای سفارشی در localStorage | // ذخیره محتوای سفارشی در localStorage | ||
function saveCustomContent() { | function saveCustomContent() { | ||
const customContent = {}; | const customContent = {}; | ||
خط ۷۳۱: | خط ۷۳۳: | ||
const allItems = booksData[category] || []; | const allItems = booksData[category] || []; | ||
customContent[category] = allItems.filter(item => | customContent[category] = allItems.filter(item => | ||
!defaultItems.some(defaultItem => defaultItem.value === item.value) | !defaultItems.some(defaultItem => defaultItem.value === item.value) | ||
خط ۷۴۷: | خط ۷۴۸: | ||
const customContent = JSON.parse(saved); | const customContent = JSON.parse(saved); | ||
Object.keys(customContent).forEach(category => { | Object.keys(customContent).forEach(category => { | ||
if (!booksData[category]) { | if (!booksData[category]) { | ||
خط ۷۸۸: | خط ۷۸۸: | ||
} | } | ||
contentSelect.disabled = false; | contentSelect.disabled = false; | ||
updateContentList(selectedCategory); | updateContentList(selectedCategory); | ||
resetContent(); | resetContent(); | ||
}); | }); | ||
خط ۸۱۷: | خط ۸۱۵: | ||
contentTitle.textContent = bookText; | contentTitle.textContent = bookText; | ||
contentFrame.style.display = 'none'; | contentFrame.style.display = 'none'; | ||
iframePlaceholder.style.display = 'flex'; | iframePlaceholder.style.display = 'flex'; | ||
خط ۸۲۷: | خط ۸۲۴: | ||
`; | `; | ||
let progress = 0; | let progress = 0; | ||
const progressInterval = setInterval(() => { | const progressInterval = setInterval(() => { | ||
خط ۸۳۵: | خط ۸۳۱: | ||
}, 200); | }, 200); | ||
contentFrame.src = contentUrl; | contentFrame.src = contentUrl; | ||
خط ۸۶۳: | خط ۸۵۸: | ||
}; | }; | ||
wikiLink.href = wikiUrl; | wikiLink.href = wikiUrl; | ||
wikiLink.style.display = 'flex'; | wikiLink.style.display = 'flex'; | ||
خط ۹۲۲: | خط ۹۱۶: | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
loadCustomContent(); | loadCustomContent(); | ||
checkMediaWikiAdminStatus(); | |||
}); | }); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۳ اکتبر ۲۰۲۵، ساعت ۰۱:۳۴
کتابخانه پدیا بایبل
مطالعه آنلاین کتابها و مقالات مذهبی شامل کتابهای مقدس و مقالات تخصصی
کتابخانه جامع منابع مذهبی
کتابخانه پدیا بایبل مرجع کامل و تخصصی برای مطالعه آنلاین کتابهای مقدس و مقالات مذهبی است. در این کتابخانه میتوانید به منابع معتبر و جامعی از متون دینی دسترسی داشته باشید.
کتابهای مقدس
مطالعه کتابهای مقدس از جمله عیسی، انجیل متی، مزامیر، پیدایش و دیگر متون مذهبی با ترجمههای معتبر
مقالات تخصصی
مقالات متعدد درباره موضوعات مذهبی مانند مسیح، تثلیث، نجات، روح القدس و دیگر مفاهیم دینی
هیچ محتوایی انتخاب نشده است
لطفاً یک کتاب یا مقاله از لیست انتخاب کنید