کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۳۲۳: | خط ۳۲۳: | ||
.admin-btn.secondary:hover { | .admin-btn.secondary:hover { | ||
background: #5a6268; | background: #5a6268; | ||
} | } | ||
خط ۴۰۸: | خط ۳۵۳: | ||
.custom-input-group select { | .custom-input-group select { | ||
width: 150px; | width: 150px; | ||
} | |||
.notification { | |||
position: fixed; | |||
top: 20px; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
background: #4a7c59; | |||
color: white; | |||
padding: 12px 20px; | |||
border-radius: 4px; | |||
box-shadow: 0 4px 12px rgba(0,0,0,0.15); | |||
z-index: 1000; | |||
display: none; | |||
} | |||
.notification.error { | |||
background: #dc3545; | |||
} | } | ||
خط ۴۹۵: | خط ۴۵۸: | ||
</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> | ||
خط ۵۰۲: | خط ۴۶۵: | ||
<i class="fas fa-plus"></i> افزودن محتوای جدید | <i class="fas fa-plus"></i> افزودن محتوای جدید | ||
</button> | </button> | ||
<button class="admin-btn secondary" id=" | <button class="admin-btn secondary" id="editCurrentBtn"> | ||
<i class="fas fa- | <i class="fas fa-edit"></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> | ||
خط ۵۲۴: | خط ۴۸۴: | ||
</button> | </button> | ||
</div> | </div> | ||
<p style="font-size: 12px; color: #666; margin-top: 10px;"> | |||
توجه: این محتوا فقط در این جلسه مرورگر شما ذخیره میشود. برای ذخیره دائمی، باید صفحه جدیدی در مدیاویکی ایجاد کنید. | |||
</p> | |||
< | |||
برای | |||
</ | |||
</section> | </section> | ||
خط ۶۲۸: | خط ۵۸۰: | ||
const adminPanel = document.getElementById('adminPanel'); | const adminPanel = document.getElementById('adminPanel'); | ||
const customContentSection = document.getElementById('customContentSection'); | const customContentSection = document.getElementById('customContentSection'); | ||
const addContentBtn = document.getElementById('addContentBtn'); | const addContentBtn = document.getElementById('addContentBtn'); | ||
const | const editCurrentBtn = document.getElementById('editCurrentBtn'); | ||
const customTitle = document.getElementById('customTitle'); | const customTitle = document.getElementById('customTitle'); | ||
const customCategory = document.getElementById('customCategory'); | const customCategory = document.getElementById('customCategory'); | ||
خط ۶۴۲: | خط ۵۸۹: | ||
let currentZoom = 100; | let currentZoom = 100; | ||
let currentContent = ''; | let currentContent = ''; | ||
let | let isMediaWikiAdmin = false; | ||
// تابع برای بررسی وضعیت مدیر در مدیاویکی | |||
function checkMediaWikiAdminStatus() { | |||
// روش 1: بررسی از طریق کوکیهای مدیاویکی | |||
const mediaWikiUser = getMediaWikiUser(); | |||
// روش 2: بررسی از طریق API مدیاویکی | |||
checkUserGroupsViaAPI(); | |||
// روش 3: بررسی از طریق المنتهای صفحه مدیاویکی | |||
checkPageElements(); | |||
} | |||
// بررسی کاربر از طریق کوکیهای مدیاویکی | |||
function getMediaWikiUser() { | |||
const cookies = document.cookie.split(';'); | |||
for (let cookie of cookies) { | |||
const [name, value] = cookie.trim().split('='); | |||
if (name === 'MediaWikiUser' || name === 'mwuser') { | |||
return decodeURIComponent(value); | |||
} | |||
} | |||
return null; | |||
} | |||
// بررسی گروههای کاربر از طریق API مدیاویکی | |||
function checkUserGroupsViaAPI() { | |||
// این آدرس باید با آدرس مدیاویکی شما تطبیق داده شود | |||
const apiUrl = '/api.php?action=query&meta=userinfo&uiprop=groups&format=json'; | |||
fetch(apiUrl) | |||
.then(response => response.json()) | |||
.then(data => { | |||
if (data.query && data.query.userinfo) { | |||
const groups = data.query.userinfo.groups || []; | |||
if (groups.includes('sysop') || groups.includes('bureaucrat') || groups.includes('admin')) { | |||
enableAdminFeatures(); | |||
} | |||
} | |||
}) | |||
.catch(error => { | |||
console.log('خطا در ارتباط با API مدیاویکی:', error); | |||
// اگر API در دسترس نبود، از روشهای دیگر استفاده میکنیم | |||
checkAdminByPageElements(); | |||
}); | |||
} | |||
// بررسی | // بررسی از طریق المنتهای صفحه | ||
function | function checkPageElements() { | ||
const | // بررسی وجود لینک ویرایش (معمولاً فقط برای مدیران نمایش داده میشود) | ||
const editLinks = document.querySelectorAll('a[href*="action=edit"], a[href*="Special:"]'); | |||
const adminElements = document.querySelectorAll('#pt-administration, #ca-protect, .mw-group-admin'); | |||
if (editLinks.length > 0 || adminElements.length > 0) { | |||
enableAdminFeatures(); | |||
} | } | ||
} | |||
// بررسی سادهتر از طریق URL | |||
function checkAdminByPageElements() { | |||
// اگر کاربر بتواند به صفحات خاصی دسترسی داشته باشد، احتمالاً مدیر است | |||
const protectedPages = [ | |||
'Special:', | |||
'action=edit', | |||
'action=delete', | |||
'action=protect' | |||
]; | |||
const currentUrl = window.location.href; | |||
const hasAccess = protectedPages.some(page => currentUrl.includes(page)); | |||
if (hasAccess) { | |||
enableAdminFeatures(); | |||
} | |||
} | |||
// فعالسازی ویژگیهای مدیر | |||
function enableAdminFeatures() { | |||
isMediaWikiAdmin = true; | |||
adminPanel.style.display = 'block'; | |||
customContentSection.style.display = 'block'; | |||
showNotification('ویژگیهای مدیریتی فعال شدند'); | |||
} | } | ||
خط ۶۷۱: | خط ۶۸۴: | ||
}, 3000); | }, 3000); | ||
} | } | ||
// افزودن محتوای سفارشی | // افزودن محتوای سفارشی | ||
addCustomContent.addEventListener('click', function() { | addCustomContent.addEventListener('click', function() { | ||
if (! | if (!isMediaWikiAdmin) { | ||
showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | ||
return; | return; | ||
خط ۷۲۶: | خط ۷۱۸: | ||
updateContentList(category); | updateContentList(category); | ||
} | } | ||
// ذخیره در localStorage برای این جلسه | |||
saveToLocalStorage(); | |||
}); | }); | ||
// افزودن محتوای جدید | // افزودن محتوای جدید | ||
addContentBtn.addEventListener('click', function() { | addContentBtn.addEventListener('click', function() { | ||
if (! | if (!isMediaWikiAdmin) { | ||
showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | ||
return; | return; | ||
خط ۷۴۰: | خط ۷۳۵: | ||
}); | }); | ||
// | // ویرایش صفحه فعلی در مدیاویکی | ||
editCurrentBtn.addEventListener('click', function() { | |||
if (! | if (!isMediaWikiAdmin) { | ||
showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | showNotification('شما دسترسی لازم برای این عمل را ندارید', true); | ||
return; | return; | ||
} | } | ||
const currentPage = window.location.pathname.split('/').pop(); | |||
const editUrl = `https://www.pediabible.com/index.php/${currentPage}?action=edit`; | |||
window.open(editUrl, '_blank'); | |||
}); | }); | ||
خط ۷۵۶: | خط ۷۵۳: | ||
url = url.replace(/[^\w\u0600-\u06FF_]/g, ''); | url = url.replace(/[^\w\u0600-\u06FF_]/g, ''); | ||
return url; | return url; | ||
} | |||
// ذخیره در localStorage | |||
function saveToLocalStorage() { | |||
localStorage.setItem('pediabible_custom_content', JSON.stringify(booksData)); | |||
} | |||
// بارگذاری از localStorage | |||
function loadFromLocalStorage() { | |||
const saved = localStorage.getItem('pediabible_custom_content'); | |||
if (saved) { | |||
const parsed = JSON.parse(saved); | |||
Object.keys(parsed).forEach(category => { | |||
if (!booksData[category]) { | |||
booksData[category] = []; | |||
} | |||
booksData[category] = [...booksData[category], ...parsed[category]]; | |||
}); | |||
} | |||
} | } | ||
خط ۹۱۲: | خط ۹۲۸: | ||
} | } | ||
// بررسی وضعیت | // بررسی وضعیت مدیر در هنگام بارگذاری صفحه | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
loadFromLocalStorage(); | |||
checkMediaWikiAdminStatus(); | |||
}); | }); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۳ اکتبر ۲۰۲۵، ساعت ۰۱:۱۵
<!DOCTYPE html>
کتابخانه پدیا بایبل
مطالعه آنلاین کتابها و مقالات مذهبی شامل کتابهای مقدس و مقالات تخصصی
کتابخانه جامع منابع مذهبی
کتابخانه پدیا بایبل مرجع کامل و تخصصی برای مطالعه آنلاین کتابهای مقدس و مقالات مذهبی است. در این کتابخانه میتوانید به منابع معتبر و جامعی از متون دینی دسترسی داشته باشید.
کتابهای مقدس
مطالعه کتابهای مقدس از جمله عیسی، انجیل متی، مزامیر، پیدایش و دیگر متون مذهبی با ترجمههای معتبر
مقالات تخصصی
مقالات متعدد درباره موضوعات مذهبی مانند مسیح، تثلیث، نجات، روح القدس و دیگر مفاهیم دینی
هیچ محتوایی انتخاب نشده است
لطفاً یک کتاب یا مقاله از لیست انتخاب کنید