پرش به محتوا

کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخه‌ها

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۱: خط ۱:
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<html lang="fa" dir="rtl">
<head>
<head>
خط ۲۷۴: خط ۲۷۳:
          
          
         .admin-panel {
         .admin-panel {
             background: #f8f9fa;
             background: #e9f7ef;
             padding: 15px;
             padding: 15px;
             margin: 0 15px 15px;
             margin: 0 15px 15px;
             border: 1px solid #dee2e6;
             border: 1px solid #c8e6d1;
             border-radius: 8px;
             border-radius: 8px;
            border-right: 4px solid #4a7c59;
         }
         }
          
          
         .admin-panel h3 {
         .admin-panel h3 {
             color: #3e6f73;
             color: #2d6a4f;
             margin-bottom: 15px;
             margin-bottom: 15px;
             font-size: 16px;
             font-size: 16px;
خط ۳۱۵: خط ۳۱۵:
         .admin-btn:hover {
         .admin-btn:hover {
             background: #3e6f73;
             background: #3e6f73;
        }
       
        .admin-btn.secondary {
            background: #6c757d;
        }
       
        .admin-btn.secondary:hover {
            background: #5a6268;
         }
         }
          
          
         .custom-content-section {
         .custom-content-section {
             background: #e9f7ef;
             background: #f8f9fa;
             padding: 15px;
             padding: 15px;
             margin: 0 15px 15px;
             margin: 0 15px 15px;
             border: 1px solid #c8e6d1;
             border: 1px solid #dee2e6;
             border-radius: 8px;
             border-radius: 8px;
         }
         }
          
          
         .custom-content-section h3 {
         .custom-content-section h3 {
             color: #2d6a4f;
             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 secondary" id="editCurrentBtn">
                 <button class="admin-btn" id="disableAdminBtn">
                     <i class="fas fa-edit"></i> ویرایش این صفحه
                     <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 booksData = {
         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 editCurrentBtn = document.getElementById('editCurrentBtn');
         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 isMediaWikiAdmin = false;
         let isAdminMode = false;
        let booksData = { ...defaultBooksData };


         // تابع برای بررسی وضعیت مدیر در مدیاویکی
         // نمایش اعلان
         function checkMediaWikiAdminStatus() {
         function showNotification(message, isError = false) {
             // روش 1: بررسی از طریق کوکی‌های مدیاویکی
             notification.textContent = message;
             const mediaWikiUser = getMediaWikiUser();
             notification.className = 'notification' + (isError ? ' error' : '');
            notification.style.display = 'block';
              
              
             // روش 2: بررسی از طریق API مدیاویکی
             setTimeout(() => {
            checkUserGroupsViaAPI();
                notification.style.display = 'none';
              
             }, 3000);
            // روش 3: بررسی از طریق المنت‌های صفحه مدیاویکی
            checkPageElements();
         }
         }


         // بررسی کاربر از طریق کوکی‌های مدیاویکی
         // فعال‌سازی حالت مدیر
         function getMediaWikiUser() {
         function enableAdminMode() {
             const cookies = document.cookie.split(';');
             isAdminMode = true;
             for (let cookie of cookies) {
            adminPanel.style.display = 'block';
                const [name, value] = cookie.trim().split('=');
             customContentSection.style.display = 'block';
                if (name === 'MediaWikiUser' || name === 'mwuser') {
            adminToggle.style.display = 'none';
                    return decodeURIComponent(value);
             showNotification('حالت مدیریت فعال شد');
                }
            }
             return null;
        }
 
        // بررسی گروه‌های کاربر از طریق API مدیاویکی
        function checkUserGroupsViaAPI() {
            // این آدرس باید با آدرس مدیاویکی شما تطبیق داده شود
            const apiUrl = '/api.php?action=query&meta=userinfo&uiprop=groups&format=json';
              
              
             fetch(apiUrl)
             // ذخیره در localStorage
                .then(response => response.json())
            localStorage.setItem('adminModeEnabled', 'true');
                .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 checkPageElements() {
         function disableAdminMode() {
             // بررسی وجود لینک ویرایش (معمولاً فقط برای مدیران نمایش داده می‌شود)
             isAdminMode = false;
             const editLinks = document.querySelectorAll('a[href*="action=edit"], a[href*="Special:"]');
             adminPanel.style.display = 'none';
             const adminElements = document.querySelectorAll('#pt-administration, #ca-protect, .mw-group-admin');
            customContentSection.style.display = 'none';
            adminToggle.style.display = 'flex';
             showNotification('حالت مدیریت غیرفعال شد');
              
              
             if (editLinks.length > 0 || adminElements.length > 0) {
             // حذف از localStorage
                enableAdminFeatures();
            localStorage.removeItem('adminModeEnabled');
            }
         }
         }


         // بررسی ساده‌تر از طریق URL
         // بررسی وضعیت در localStorage
         function checkAdminByPageElements() {
         function checkAdminStatus() {
            // اگر کاربر بتواند به صفحات خاصی دسترسی داشته باشد، احتمالاً مدیر است
             const adminEnabled = localStorage.getItem('adminModeEnabled');
             const protectedPages = [
             if (adminEnabled === 'true') {
                'Special:',
                 enableAdminMode();
                '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('ویژگی‌های مدیریتی فعال شدند');
        }
        // نمایش اعلان
        function showNotification(message, isError = false) {
            notification.textContent = message;
            notification.className = 'notification' + (isError ? ' error' : '');
            notification.style.display = 'block';
           
            setTimeout(() => {
                notification.style.display = 'none';
            }, 3000);
         }
         }


         // افزودن محتوای سفارشی
         // افزودن محتوای سفارشی
         addCustomContent.addEventListener('click', function() {
         addCustomContent.addEventListener('click', function() {
             if (!isMediaWikiAdmin) {
             if (!isAdminMode) {
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 showNotification('لطفاً ابتدا حالت مدیریت را فعال کنید', true);
                 return;
                 return;
             }
             }
خط ۷۱۳: خط ۶۸۲:
             showNotification(`محتوای "${title}" با موفقیت اضافه شد`);
             showNotification(`محتوای "${title}" با موفقیت اضافه شد`);
             customTitle.value = '';
             customTitle.value = '';
           
            // ذخیره در localStorage
            saveCustomContent();
              
              
             // به‌روزرسانی لیست در صورت انتخاب دسته‌بندی مربوطه
             // به‌روزرسانی لیست در صورت انتخاب دسته‌بندی مربوطه
خط ۷۱۸: خط ۶۹۰:
                 updateContentList(category);
                 updateContentList(category);
             }
             }
           
            // ذخیره در localStorage برای این جلسه
            saveToLocalStorage();
         });
         });


         // افزودن محتوای جدید
         // افزودن محتوای جدید
         addContentBtn.addEventListener('click', function() {
         addContentBtn.addEventListener('click', function() {
             if (!isMediaWikiAdmin) {
             if (!isAdminMode) {
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 showNotification('لطفاً ابتدا حالت مدیریت را فعال کنید', true);
                 return;
                 return;
             }
             }
خط ۷۳۵: خط ۷۰۴:
         });
         });


         // ویرایش صفحه فعلی در مدیاویکی
         // غیرفعال کردن حالت مدیر
         editCurrentBtn.addEventListener('click', function() {
         disableAdminBtn.addEventListener('click', function() {
             if (!isMediaWikiAdmin) {
             disableAdminMode();
                showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
        });
                return;
 
            }
        // فعال کردن حالت مدیر با دکمه مخفی
           
        adminToggle.addEventListener('click', function() {
            const currentPage = window.location.pathname.split('/').pop();
             enableAdminMode();
            const editUrl = `https://www.pediabible.com/index.php/${currentPage}?action=edit`;
             window.open(editUrl, '_blank');
         });
         });


خط ۷۵۵: خط ۷۲۲:
         }
         }


         // ذخیره در localStorage
         // ذخیره محتوای سفارشی در localStorage
         function saveToLocalStorage() {
         function saveCustomContent() {
             localStorage.setItem('pediabible_custom_content', JSON.stringify(booksData));
            // فقط محتوای سفارشی را ذخیره می‌کنیم (بدون محتوای پیش‌فرض)
            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 loadFromLocalStorage() {
         function loadCustomContent() {
             const saved = localStorage.getItem('pediabible_custom_content');
             const saved = localStorage.getItem('pediabible_custom_content');
             if (saved) {
             if (saved) {
                 const parsed = JSON.parse(saved);
                 try {
                Object.keys(parsed).forEach(category => {
                    const customContent = JSON.parse(saved);
                    if (!booksData[category]) {
                   
                        booksData[category] = [];
                    // ترکیب محتوای پیش‌فرض با محتوای سفارشی
                    }
                    Object.keys(customContent).forEach(category => {
                    booksData[category] = [...booksData[category], ...parsed[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]) {
                const option = document.createElement('option');
                booksData[category].forEach(item => {
                option.value = item.value;
                    const option = document.createElement('option');
                option.textContent = item.text;
                    option.value = item.value;
                contentSelect.appendChild(option);
                    option.textContent = item.text;
            });
                    contentSelect.appendChild(option);
                });
            }
         }
         }


خط ۹۲۸: خط ۹۱۹:
         }
         }


         // بررسی وضعیت مدیر در هنگام بارگذاری صفحه
         // بارگذاری اولیه
         document.addEventListener('DOMContentLoaded', function() {
         document.addEventListener('DOMContentLoaded', function() {
             loadFromLocalStorage();
             loadCustomContent();
             checkMediaWikiAdminStatus();
             checkAdminStatus();
         });
         });
     </script>
     </script>
</body>
</body>
</html>
</html>

نسخهٔ ‏۱۳ اکتبر ۲۰۲۵، ساعت ۰۱:۲۲

کتابخانه انتشارات دانشنامه کتاب مقدس

کتابخانه پدیا بایبل

مطالعه آنلاین کتاب‌ها و مقالات مذهبی شامل کتاب‌های مقدس و مقالات تخصصی

کتابخانه جامع منابع مذهبی

کتابخانه پدیا بایبل مرجع کامل و تخصصی برای مطالعه آنلاین کتاب‌های مقدس و مقالات مذهبی است. در این کتابخانه می‌توانید به منابع معتبر و جامعی از متون دینی دسترسی داشته باشید.

کتاب‌های مقدس

مطالعه کتاب‌های مقدس از جمله عیسی، انجیل متی، مزامیر، پیدایش و دیگر متون مذهبی با ترجمه‌های معتبر

مقالات تخصصی

مقالات متعدد درباره موضوعات مذهبی مانند مسیح، تثلیث، نجات، روح القدس و دیگر مفاهیم دینی

هیچ محتوایی انتخاب نشده است

لطفاً یک کتاب یا مقاله از لیست انتخاب کنید