پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۳۲۳: خط ۳۲۳:
         .admin-btn.secondary:hover {
         .admin-btn.secondary:hover {
             background: #5a6268;
             background: #5a6268;
        }
       
        .login-form {
            background: white;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #dee2e6;
            margin: 20px auto;
            max-width: 400px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
       
        .login-form h3 {
            color: #3e6f73;
            margin-bottom: 15px;
            text-align: center;
        }
       
        .login-form input {
            margin-bottom: 15px;
        }
       
        .login-btn {
            width: 100%;
            background: #4a7c59;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 10px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
        }
       
        .login-btn:hover {
            background: #3e6f73;
        }
       
        .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;
         }
         }
          
          
خط ۴۰۸: خط ۳۵۳:
         .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="manageContentBtn">
                 <button class="admin-btn secondary" id="editCurrentBtn">
                     <i class="fas fa-cog"></i> مدیریت محتواها
                     <i class="fas fa-edit"></i> ویرایش این صفحه
                </button>
                <button class="admin-btn secondary" id="logoutBtn">
                    <i class="fas fa-sign-out-alt"></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>
        </section>
             <p style="font-size: 12px; color: #666; margin-top: 10px;">
 
                 توجه: این محتوا فقط در این جلسه مرورگر شما ذخیره می‌شود. برای ذخیره دائمی، باید صفحه جدیدی در مدیاویکی ایجاد کنید.
        <!-- فرم ورود مدیران -->
             </p>
        <section class="login-form" id="loginForm">
             <h3>ورود مدیران</h3>
            <input type="text" id="adminUsername" placeholder="نام کاربری">
            <input type="password" id="adminPassword" placeholder="رمز عبور">
            <button class="login-btn" id="loginBtn">ورود به سیستم</button>
            <div style="text-align: center; margin-top: 15px; font-size: 12px; color: #6c757d;">
                 برای تست: admin / admin123
             </div>
         </section>
         </section>


خط ۶۲۸: خط ۵۸۰:
         const adminPanel = document.getElementById('adminPanel');
         const adminPanel = document.getElementById('adminPanel');
         const customContentSection = document.getElementById('customContentSection');
         const customContentSection = document.getElementById('customContentSection');
        const loginForm = document.getElementById('loginForm');
        const adminUsername = document.getElementById('adminUsername');
        const adminPassword = document.getElementById('adminPassword');
        const loginBtn = document.getElementById('loginBtn');
         const addContentBtn = document.getElementById('addContentBtn');
         const addContentBtn = document.getElementById('addContentBtn');
         const manageContentBtn = document.getElementById('manageContentBtn');
         const editCurrentBtn = document.getElementById('editCurrentBtn');
        const logoutBtn = document.getElementById('logoutBtn');
         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 isAdmin = false;
         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 checkAdminStatus() {
         function checkPageElements() {
             const adminStatus = localStorage.getItem('adminLoggedIn');
            // بررسی وجود لینک ویرایش (معمولاً فقط برای مدیران نمایش داده می‌شود)
            if (adminStatus === 'true') {
             const editLinks = document.querySelectorAll('a[href*="action=edit"], a[href*="Special:"]');
                isAdmin = true;
            const adminElements = document.querySelectorAll('#pt-administration, #ca-protect, .mw-group-admin');
                adminPanel.style.display = 'block';
              
                customContentSection.style.display = 'block';
            if (editLinks.length > 0 || adminElements.length > 0) {
                loginForm.style.display = 'none';
                 enableAdminFeatures();
                showNotification('شما به عنوان مدیر وارد شده‌اید');
             } else {
                isAdmin = false;
                adminPanel.style.display = 'none';
                 customContentSection.style.display = 'none';
                loginForm.style.display = 'block';
             }
             }
        }
        // بررسی ساده‌تر از طریق 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);
         }
         }
        // ورود مدیر
        loginBtn.addEventListener('click', function() {
            const username = adminUsername.value.trim();
            const password = adminPassword.value.trim();
           
            // در حالت واقعی، این اطلاعات باید از سرور دریافت شوند
            if (username === 'admin' && password === 'admin123') {
                localStorage.setItem('adminLoggedIn', 'true');
                checkAdminStatus();
            } else {
                showNotification('نام کاربری یا رمز عبور اشتباه است', true);
            }
        });
        // خروج مدیر
        logoutBtn.addEventListener('click', function() {
            localStorage.removeItem('adminLoggedIn');
            checkAdminStatus();
            showNotification('با موفقیت از حساب خارج شدید');
        });


         // افزودن محتوای سفارشی
         // افزودن محتوای سفارشی
         addCustomContent.addEventListener('click', function() {
         addCustomContent.addEventListener('click', function() {
             if (!isAdmin) {
             if (!isMediaWikiAdmin) {
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 return;
                 return;
خط ۷۲۶: خط ۷۱۸:
                 updateContentList(category);
                 updateContentList(category);
             }
             }
           
            // ذخیره در localStorage برای این جلسه
            saveToLocalStorage();
         });
         });


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


         // مدیریت محتواها (فقط برای مدیران)
         // ویرایش صفحه فعلی در مدیاویکی
         manageContentBtn.addEventListener('click', function() {
         editCurrentBtn.addEventListener('click', function() {
             if (!isAdmin) {
             if (!isMediaWikiAdmin) {
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 return;
                 return;
             }
             }
              
              
             showNotification('این قابلیت در نسخه بعدی اضافه خواهد شد');
             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() {
             checkAdminStatus();
             loadFromLocalStorage();
            checkMediaWikiAdminStatus();
         });
         });
     </script>
     </script>
</body>
</body>
</html>
</html>

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

<!DOCTYPE html> کتابخانه انتشارات دانشنامه کتاب مقدس

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

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

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

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

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

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

مقالات تخصصی

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

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

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