پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
 
(۲۲ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۱: خط ۱:
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<html lang="fa" dir="rtl">
<head>
<head>
خط ۲۱: خط ۲۰:
          
          
         .container {
         .container {
             max-width: 100%;
             max-width: 1200px;
             margin: 0;
             margin: 0 auto;
             background: white;
             background: white;
            padding: 0;
         }
         }
          
          
خط ۳۱: خط ۲۹:
             color: white;
             color: white;
             padding: 20px 15px;
             padding: 20px 15px;
            margin-bottom: 15px;
             text-align: center;
             text-align: center;
         }
         }
خط ۴۵: خط ۴۲:
             font-size: 13px;
             font-size: 13px;
             margin-top: 8px;
             margin-top: 8px;
            line-height: 1.5;
         }
         }
          
          
خط ۶۶: خط ۶۲:
             text-align: justify;
             text-align: justify;
             font-size: 14px;
             font-size: 14px;
            line-height: 1.8;
         }
         }
          
          
خط ۹۲: خط ۸۷:
             font-size: 13px;
             font-size: 13px;
             color: #666;
             color: #666;
            margin: 0;
         }
         }
          
          
خط ۱۰۵: خط ۹۹:
             display: flex;
             display: flex;
             gap: 10px;
             gap: 10px;
            margin-bottom: 0;
         }
         }
          
          
         .form-group {
         .form-group {
             flex: 1;
             flex: 1;
            position: relative;
         }
         }
          
          
خط ۱۲۰: خط ۱۱۴:
         }
         }
          
          
         select, input {
         select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ced4da;
            border-radius: 6px;
            font-size: 13px;
            background: white;
            cursor: pointer;
        }
       
        .searchable-select {
            position: relative;
        }
       
        .select-display {
             width: 100%;
             width: 100%;
             padding: 10px 12px;
             padding: 10px 12px;
خط ۱۲۸: خط ۱۳۶:
             background: white;
             background: white;
             cursor: pointer;
             cursor: pointer;
             transition: all 0.3s ease;
             text-align: right;
             border: 1px solid #e9ecef;
            position: relative;
        }
       
        .select-display:after {
            content: "▼";
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 10px;
            color: #6c757d;
        }
       
        .options-list {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ced4da;
            border-radius: 6px;
            max-height: 400px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
       
        .search-box {
            padding: 10px;
             border-bottom: 1px solid #e9ecef;
            background: #f8f9fa;
            position: sticky;
            top: 0;
        }
       
        .search-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-size: 13px;
        }
       
        .options-container {
            max-height: 300px;
            overflow-y: auto;
        }
       
        .option-item {
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid #f1f1f1;
            font-size: 13px;
        }
       
        .option-item:hover {
            background: #f0f8f0;
         }
         }
          
          
         select:focus, input:focus {
         .highlight {
             outline: none;
             background: #fff3cd;
             border-color: #3e6f73;
             font-weight: bold;
             box-shadow: 0 0 0 2px rgba(62, 111, 115, 0.1);
            padding: 1px 2px;
             border-radius: 2px;
         }
         }
          
          
         select:disabled {
         .no-results {
            background-color: #f8f9fa;
             color: #6c757d;
             color: #6c757d;
             cursor: not-allowed;
             font-style: italic;
             border-color: #dee2e6;
            text-align: center;
             padding: 15px;
         }
         }
          
          
خط ۱۴۸: خط ۲۱۴:
             margin: 0 15px;
             margin: 0 15px;
             border: 1px solid #dee2e6;
             border: 1px solid #dee2e6;
            border-radius: 0;
             overflow: hidden;
             overflow: hidden;
             background: white;
             background: white;
             height: calc(100vh - 250px);
             height: 500px;
            min-height: 400px;
         }
         }
       
 
         .content-header {
         .content-header {
             padding: 12px 15px;
             padding: 12px 15px;
خط ۱۸۲: خط ۲۴۶:
             cursor: pointer;
             cursor: pointer;
             font-size: 12px;
             font-size: 12px;
            transition: all 0.3s ease;
             display: flex;
             display: flex;
             align-items: center;
             align-items: center;
             gap: 4px;
             gap: 4px;
            font-weight: 600;
            color: #495057;
        }
       
        .control-btn:hover {
            background: #3e6f73;
            color: white;
            border-color: #3e6f73;
         }
         }
          
          
خط ۲۳۸: خط ۲۹۳:
             padding: 10px 15px;
             padding: 10px 15px;
             border-radius: 4px;
             border-radius: 4px;
            border: none;
            cursor: pointer;
             font-size: 13px;
             font-size: 13px;
             text-align: center;
             text-align: center;
خط ۲۴۷: خط ۳۰۰:
             justify-content: center;
             justify-content: center;
             gap: 6px;
             gap: 6px;
            transition: all 0.3s ease;
         }
         }
          
          
خط ۲۵۶: خط ۳۰۸:
         .view-link {
         .view-link {
             background: #4a7c59;
             background: #4a7c59;
        }
       
        .wiki-link:hover, .site-link:hover, .view-link:hover {
            opacity: 0.9;
            transform: translateY(-1px);
         }
         }
          
          
خط ۲۷۱: خط ۳۱۸:
             top: 0;
             top: 0;
             right: 0;
             right: 0;
        }
       
        .admin-panel {
            background: #f8f9fa;
            padding: 15px;
            margin: 0 15px 15px;
            border: 1px solid #dee2e6;
            border-radius: 8px;
        }
       
        .admin-panel h3 {
            color: #3e6f73;
            margin-bottom: 15px;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
       
        .admin-panel h3 i {
            color: #4a7c59;
        }
       
        .admin-controls {
            display: flex;
            gap: 10px;
        }
       
        .admin-btn {
            background: #4a7c59;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 8px 15px;
            cursor: pointer;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.3s ease;
        }
       
        .admin-btn:hover {
            background: #3e6f73;
        }
       
        .admin-btn.secondary {
            background: #6c757d;
        }
       
        .admin-btn.secondary:hover {
            background: #5a6268;
        }
       
        .custom-content-section {
            background: #e9f7ef;
            padding: 15px;
            margin: 0 15px 15px;
            border: 1px solid #c8e6d1;
            border-radius: 8px;
        }
       
        .custom-content-section h3 {
            color: #2d6a4f;
            margin-bottom: 10px;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
       
        .custom-input-group {
            display: flex;
            gap: 10px;
        }
       
        .custom-input-group input {
            flex: 1;
        }
       
        .custom-input-group select {
            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;
         }
         }
          
          
خط ۳۷۹: خط ۳۲۶:
              
              
             .content-frame {
             .content-frame {
                 height: calc(100vh - 280px);
                 height: 400px;
                min-height: 350px;
             }
             }
              
              
خط ۴۰۰: خط ۳۴۶:
                 width: 100%;
                 width: 100%;
                 justify-content: space-between;
                 justify-content: space-between;
            }
           
            .header {
                padding: 15px 10px;
            }
           
            h1 {
                font-size: 20px;
            }
           
            .description {
                font-size: 12px;
            }
           
            .content-list {
                grid-template-columns: 1fr;
            }
           
            .admin-controls {
                flex-direction: column;
            }
           
            .custom-input-group {
                flex-direction: column;
            }
           
            .custom-input-group select {
                width: 100%;
             }
             }
         }
         }
خط ۴۳۳: خط ۳۵۱:
</head>
</head>
<body>
<body>
    <div class="notification" id="notification"></div>
     <div class="container">
     <div class="container">
         <header class="header">
         <header class="header">
             <h1>کتابخانه پدیا بایبل</h1>
             <h1>کتابخانه دانشنامه کتاب مقدس</h1>
             <p class="description">مطالعه آنلاین کتاب‌ها و مقالات مذهبی شامل کتاب‌های مقدس و مقالات تخصصی</p>
             <p class="description">مطالعه آنلاین کتاب‌ها و مقالات مسیحی</p>
         </header>
         </header>


        <!-- محتوای سئو -->
         <section class="seo-content">
         <section class="seo-content">
             <h2>کتابخانه جامع منابع مذهبی</h2>
             <h2>کتابخانه جامع منابع مسیحی</h2>
             <p>کتابخانه پدیا بایبل مرجع کامل و تخصصی برای مطالعه آنلاین کتاب‌های مقدس و مقالات مذهبی است. در این کتابخانه می‌توانید به منابع معتبر و جامعی از متون دینی دسترسی داشته باشید.</p>
             <p>کتابخانهٔ دانشنامهٔ کتاب مقدس مرجع کامل و تخصصی برای مطالعهٔ آنلاین کتاب‌ها و مقالات مسیحی است.</p>
              
              
             <div class="content-list">
             <div class="content-list">
                 <div class="content-item">
                 <div class="content-item">
                     <h3>کتاب‌های مقدس</h3>
                     <h3>کتاب‌ها</h3>
                     <p>مطالعه کتاب‌های مقدس از جمله عیسی، انجیل متی، مزامیر، پیدایش و دیگر متون مذهبی با ترجمه‌های معتبر</p>
                    <p>انتشار همهٔ کتاب‌ها در دانشنامه با اجازهٔ رسمی نویسندگان یا ناشران انجام شده است، و برای برخی آثار، مجوز چاپ مجدد نیز دریافت گردیده است. تمامی حقوق برای انتشارات دانشنامهٔ کتاب مقدس محفوظ است.
نویسندگان و ناشران مسیحی می‌توانند برای همکاری و انتشار آثار خود با ما در ارتباط باشند.</p>
                </div>
                <div class="content-item">
                    <h3>مقالات</h3>
                     <p>مقالات دانشنامه با اجازهٔ نویسندگان یا بر اساس منابع عمومی و بدون حق کپی‌رایت منتشر می‌شوند. در همهٔ موارد، اصول امانت‌داری و احترام به منبع اصلی رعایت شده است.
پژوهشگران و نویسندگان مسیحی می‌توانند برای انتشار مقالات خود با ما همکاری کنند</p>
                 </div>
                 </div>
                 <div class="content-item">
                 <div class="content-item">
                     <h3>مقالات تخصصی</h3>
                     <h3>فروشگاه کتاب</h3>
                     <p>مقالات متعدد درباره موضوعات مذهبی مانند مسیح، تثلیث، نجات، روح القدس و دیگر مفاهیم دینی</p>
                     <p>در فروشگاه کتاب دانشنامه، امکان خرید کتاب‌های چاپی و الکترونیکی فراهم شده است.</p>
                 </div>
                 </div>
             </div>
             </div>
         </section>
         </section>


        <!-- پنل مدیریت (فقط برای مدیران مدیاویکی) -->
         <section class="filter-section">
        <section class="admin-panel" id="adminPanel" style="display: none;">
            <h3><i class="fas fa-user-shield"></i> پنل مدیریت</h3>
            <div class="admin-controls">
                <button class="admin-btn" id="addContentBtn">
                    <i class="fas fa-plus"></i> افزودن محتوای جدید
                </button>
                <button class="admin-btn secondary" id="editCurrentBtn">
                    <i class="fas fa-edit"></i> ویرایش این صفحه
                </button>
            </div>
        </section>
 
        <!-- بخش محتوای سفارشی (فقط برای مدیران مدیاویکی) -->
        <section class="custom-content-section" id="customContentSection" style="display: none;">
            <h3><i class="fas fa-edit"></i> افزودن محتوای سفارشی</h3>
            <div class="custom-input-group">
                <input type="text" id="customTitle" placeholder="عنوان محتوا (مثال: ۱۰ معنای یهوه)">
                <select id="customCategory">
                    <option value="کتاب">کتاب</option>
                    <option value="مقاله">مقاله</option>
                </select>
                <button class="admin-btn" id="addCustomContent">
                    <i class="fas fa-plus"></i> افزودن
                </button>
            </div>
            <p style="font-size: 12px; color: #666; margin-top: 10px;">
                توجه: این محتوا فقط در این جلسه مرورگر شما ذخیره می‌شود. برای ذخیره دائمی، باید صفحه جدیدی در مدیاویکی ایجاد کنید.
            </p>
        </section>
 
         <section class="filter-section" aria-label="فیلترهای جستجو">
             <div class="filter-row">
             <div class="filter-row">
                 <div class="form-group">
                 <div class="form-group">
خط ۴۹۷: خط ۳۸۷:
                         <option value="کتاب">کتاب</option>
                         <option value="کتاب">کتاب</option>
                         <option value="مقاله">مقاله</option>
                         <option value="مقاله">مقاله</option>
                        <option value="فروشگاه کتاب">فروشگاه کتاب</option>
                     </select>
                     </select>
                 </div>
                 </div>
خط ۵۰۲: خط ۳۹۳:
                 <div class="form-group">
                 <div class="form-group">
                     <label for="contentSelect"><i class="fas fa-book-open"></i> انتخاب محتوا:</label>
                     <label for="contentSelect"><i class="fas fa-book-open"></i> انتخاب محتوا:</label>
                     <select id="contentSelect" disabled>
                     <div class="searchable-select">
                         <option value="">ابتدا دسته‌بندی را انتخاب کنید</option>
                        <div class="select-display" id="selectDisplay">لطفاً دسته‌بندی انتخاب کنید</div>
                     </select>
                         <div class="options-list" id="optionsList">
                            <div class="search-box">
                                <input type="text" class="search-input" id="searchInput" placeholder="جستجو در محتواها...">
                            </div>
                            <div class="options-container" id="optionsContainer">
                                <div class="no-results">لطفاً ابتدا یک دسته‌بندی انتخاب کنید</div>
                            </div>
                        </div>
                     </div>
                    <input type="hidden" id="selectedContentValue">
                 </div>
                 </div>
             </div>
             </div>
         </section>
         </section>
          
          
         <section class="content-frame" aria-label="محتوای مطالعه">
         <section class="content-frame">
             <div class="content-header">
             <div class="content-header">
                 <div class="content-title" id="contentTitle">هیچ محتوایی انتخاب نشده است</div>
                 <div class="content-title" id="contentTitle">هیچ محتوایی انتخاب نشده است</div>
خط ۵۴۶: خط ۴۴۶:


     <script>
     <script>
         // داده‌های ساده
         // داده‌های واقعی
         const booksData = {
         const booksData = {
             'کتاب': [
             'کتاب': [
                 { value: 'عیسی', text: 'عیسی' },
                 { value: 'کتاب_مسیحیت_در_ایران_تا_صدر_اسلام', text: 'کتاب مسیحیت در ایران تا صدر اسلام' },
                 { value: 'انجیل_متی', text: 'انجیل متی' },
                 { value: '...', text: 'بزودی' },
                 { value: 'مزامیر', text: 'مزامیر' },
                 { value: '...', text: 'بزودی' }
                { value: 'پیدایش', text: 'پیدایش' }
             ],
             ],
             'مقاله': [
             'مقاله': [
                 { value: 'مقاله_۸_تفاوت_کلیدی_بین_کاتولیک‌ها_و_پروتستان‌ها_نویسنده', text: '۸ تفاوت کلیدی بین کاتولیک‌ها و پروتستان‌ها' },
                 { value: 'مقاله_۸_تفاوت_کلیدی_بین_کاتولیک‌ها_و_پروتستان‌ها_نویسنده', text: 'مقاله: ۸ تفاوت کلیدی بین کاتولیک‌ها و پروتستان‌ها' },
                 { value: 'مقاله_برادران،_ما_تحلیل%E2%80%8Cگران_سیاسی_نیستیم', text: 'برادران، ما تحلیل‌گران سیاسی نیستیم' },
                 { value: 'مقاله_برادران،_ما_تحلیل%E2%80%8Cگران_سیاسی_نیستیم', text: 'مقاله: برادران، ما تحلیل‌گران سیاسی نیستیم' },
                 { value: 'مقاله_گناه_آدمی_را_نادان_می‌کند', text: 'گناه آدمی را نادان می‌کند' },
                 { value: 'مقاله_گناه_آدمی_را_نادان_می‌کند', text: 'مقاله: گناه آدمی را نادان می‌کند' },
                 { value: 'مقاله_۴_دلیل_که_چرا_کتاب_مقدس_از_تراجنسیتی_بودن_حمایت_نمی%E2%80%8Cکند', text: '۴ دلیل که چرا کتاب مقدس از تراجنسیتی بودن حمایت نمی‌کند' },
                 { value: 'مقاله_۴_دلیل_که_چرا_کتاب_مقدس_از_تراجنسیتی_بودن_حمایت_نمی%E2%80%8Cکند', text: 'مقاله: ۴ دلیل که چرا کتاب مقدس از تراجنسیتی بودن حمایت نمی‌کند' },
                 { value: '۱۰_معنای_یهوه', text: '۱۰ معنای یهوه' },
                 { value: '۱۰_معنای_یهوه', text: 'مقاله: ۱۰ معنای یهوه' },
                 { value: 'تدریس،_آموزش_و_مطالعه', text: 'تدریس، آموزش و مطالعه' },
                 { value: 'تدریس،_آموزش_و_مطالعه', text: 'مقاله: تدریس، آموزش و مطالعه' },
                 { value: 'خدمت_به_خدا_یعنی_چه', text: 'خدمت به خدا یعنی چه' }
                 { value: 'خدمت_به_خدا_یعنی_چه', text: 'مقاله: خدمت به خدا یعنی چه' },
                { value: '...', text: 'بزودی' },
                { value: '...', text: 'بزودی' },
                { value: '...', text: 'بزودی' }
            ],
            'فروشگاه کتاب': [
                { value: 'کتاب_اسلحه_هایی_در_جنگ_علیه_نیروهای_شیطانی', text: 'اسلحه هایی در جنگ علیه نیروهای شیطانی' },
                { value: 'کتاب_شناخت_عطیه_های_روح_القدس_در_تعلیم_و_عمل', text: 'شناخت عطیه های روح القدس در تعلیم و عمل' },
                { value: 'کتاب_کشف_عطیه_های_روح_القدس_در_خود', text: 'کشف عطیه های روح القدس در خود' },
                { value: 'کتاب_اسلحه_هایی_در_جنگ_علیه_نیروهای_شیطانی', text: 'اسلحه هایی در جنگ علیه نیروهای شیطانی' },
                { value: 'کتاب_گشودن_وعده_های_ابراهیم', text: 'گشودن وعده های ابراهیم' },
                { value: 'کتاب_رهبری_روحانی', text: 'کتاب رهبری روحانی' },
                { value: 'کتاب_ژنرالهای_خدا', text: 'ژنرال های خدا' },
                { value: 'بزودی', text: 'بزودی' },
                { value: 'بزودی', text: 'بزودی' },
                { value: 'بزودی', text: 'بزودی' }
             ]
             ]
         };
         };


         // عناصر
         // عناصر DOM
         const categorySelect = document.getElementById('categorySelect');
         const categorySelect = document.getElementById('categorySelect');
         const contentSelect = document.getElementById('contentSelect');
         const selectDisplay = document.getElementById('selectDisplay');
        const searchInput = document.getElementById('searchInput');
        const optionsList = document.getElementById('optionsList');
        const optionsContainer = document.getElementById('optionsContainer');
        const selectedContentValue = document.getElementById('selectedContentValue');
 
         const contentFrame = document.getElementById('contentFrame');
         const contentFrame = document.getElementById('contentFrame');
         const iframePlaceholder = document.getElementById('iframePlaceholder');
         const iframePlaceholder = document.getElementById('iframePlaceholder');
خط ۵۷۸: خط ۴۹۷:
         const directView = document.getElementById('directView');
         const directView = document.getElementById('directView');
         const loadingBar = document.getElementById('loadingBar');
         const loadingBar = document.getElementById('loadingBar');
        const adminPanel = document.getElementById('adminPanel');
        const customContentSection = document.getElementById('customContentSection');
        const addContentBtn = document.getElementById('addContentBtn');
        const editCurrentBtn = document.getElementById('editCurrentBtn');
        const customTitle = document.getElementById('customTitle');
        const customCategory = document.getElementById('customCategory');
        const addCustomContent = document.getElementById('addCustomContent');
        const notification = document.getElementById('notification');


         let currentZoom = 100;
         let currentZoom = 100;
         let currentContent = '';
         let currentContent = '';
         let isMediaWikiAdmin = false;
         let currentItems = [];


         // تابع برای بررسی وضعیت مدیر در مدیاویکی
         // وقتی دسته‌بندی تغییر کرد
         function checkMediaWikiAdminStatus() {
         categorySelect.addEventListener('change', function() {
            // روش 1: بررسی از طریق کوکی‌های مدیاویکی
             const selectedCategory = this.value;
             const mediaWikiUser = getMediaWikiUser();
              
              
             // روش 2: بررسی از طریق API مدیاویکی
             if (!selectedCategory) {
            checkUserGroupsViaAPI();
                selectDisplay.textContent = 'لطفاً دسته‌بندی انتخاب کنید';
           
                 selectDisplay.style.color = '#6c757d';
            // روش 3: بررسی از طریق المنت‌های صفحه مدیاویکی
                 selectedContentValue.value = '';
            checkPageElements();
                optionsList.style.display = 'none';
        }
                resetContent();
 
                 return;
        // بررسی کاربر از طریق کوکی‌های مدیاویکی
        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())
            selectDisplay.textContent = 'برای مشاهده محتوا کلیک کنید';
                .then(data => {
            selectDisplay.style.color = '#333';
                    if (data.query && data.query.userinfo) {
            selectedContentValue.value = '';
                        const groups = data.query.userinfo.groups || [];
             currentItems = booksData[selectedCategory];
                        if (groups.includes('sysop') || groups.includes('bureaucrat') || groups.includes('admin')) {
                            enableAdminFeatures();
                        }
                    }
                })
                .catch(error => {
                    console.log('خطا در ارتباط با API مدیاویکی:', error);
                    // اگر API در دسترس نبود، از روش‌های دیگر استفاده می‌کنیم
                    checkAdminByPageElements();
                });
        }
 
        // بررسی از طریق المنت‌های صفحه
        function checkPageElements() {
             // بررسی وجود لینک ویرایش (معمولاً فقط برای مدیران نمایش داده می‌شود)
            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) {
             resetContent();
                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('ویژگی‌های مدیریتی فعال شدند');
        }
 
        // نمایش اعلان
        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() {
         selectDisplay.addEventListener('click', function() {
             if (!isMediaWikiAdmin) {
             if (!categorySelect.value) {
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 alert('لطفاً ابتدا یک دسته‌بندی انتخاب کنید');
                categorySelect.focus();
                 return;
                 return;
             }
             }
              
              
             const title = customTitle.value.trim();
             if (optionsList.style.display === 'block') {
             if (!title) {
                optionsList.style.display = 'none';
                 showNotification('لطفاً عنوان محتوا را وارد کنید', true);
             } else {
                 return;
                 optionsList.style.display = 'block';
            }
                 searchInput.value = '';
           
               
            const category = customCategory.value;
                // در اینجا تابع populateOptions فراخوانی می‌شود
            const urlValue = convertToUrlFormat(title);
                populateOptions(currentItems);
           
               
            // اضافه کردن به لیست محتواها
                setTimeout(() => {
            if (!booksData[category]) {
                    searchInput.focus();
                 booksData[category] = [];
                 }, 100);
             }
             }
           
            booksData[category].push({
                value: urlValue,
                text: title
            });
           
            showNotification(`محتوای "${title}" با موفقیت اضافه شد`);
            customTitle.value = '';
           
            // به‌روزرسانی لیست در صورت انتخاب دسته‌بندی مربوطه
            if (categorySelect.value === category) {
                updateContentList(category);
            }
           
            // ذخیره در localStorage برای این جلسه
            saveToLocalStorage();
         });
         });


         // افزودن محتوای جدید
         // وقتی کاربر در فیلد جستجو تایپ می‌کند
         addContentBtn.addEventListener('click', function() {
         searchInput.addEventListener('input', function() {
             if (!isMediaWikiAdmin) {
             const searchTerm = this.value.toLowerCase();
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
            const filteredItems = currentItems.filter(item =>
                return;
                 item.text.toLowerCase().includes(searchTerm)
            }
             );
           
             populateOptions(filteredItems, searchTerm);
            // اسکرول به بخش محتوای سفارشی
             customContentSection.scrollIntoView({ behavior: 'smooth' });
             customTitle.focus();
         });
         });


         // ویرایش صفحه فعلی در مدیاویکی
         // پر کردن لیست گزینه‌ها - این تابع اکنون به درستی فراخوانی می‌شود
         editCurrentBtn.addEventListener('click', function() {
         function populateOptions(itemsList, searchTerm = '') {
             if (!isMediaWikiAdmin) {
            console.log('populateOptions فراخوانی شد با', itemsList.length, 'آیتم');
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
           
            optionsContainer.innerHTML = '';
           
             if (itemsList.length === 0) {
                 const noResult = document.createElement('div');
                noResult.className = 'no-results';
                noResult.textContent = 'نتیجه‌ای یافت نشد';
                optionsContainer.appendChild(noResult);
                 return;
                 return;
             }
             }
              
              
             const currentPage = window.location.pathname.split('/').pop();
             itemsList.forEach(item => {
            const editUrl = `https://www.pediabible.com/index.php/${currentPage}?action=edit`;
                const option = document.createElement('div');
            window.open(editUrl, '_blank');
                option.className = 'option-item';
        });
               
 
                if (searchTerm) {
        // تابع تبدیل عنوان به فرمت URL
                    // هایلایت کردن متن جستجو شده
        function convertToUrlFormat(title) {
                    const regex = new RegExp(`(${searchTerm})`, 'gi');
            let url = title.trim();
                    const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>');
            url = url.replace(/\s+/g, '_');
                    option.innerHTML = highlightedText;
            url = url.replace(/[^\w\u0600-\u06FF_]/g, '');
                } else {
            return url;
                    option.textContent = item.text;
        }
                }
 
               
        // ذخیره در localStorage
                option.addEventListener('click', function() {
        function saveToLocalStorage() {
                    selectDisplay.textContent = item.text;
            localStorage.setItem('pediabible_custom_content', JSON.stringify(booksData));
                    selectDisplay.style.color = '#333';
        }
                    selectedContentValue.value = item.value;
 
                    optionsList.style.display = 'none';
        // بارگذاری از localStorage
                      
        function loadFromLocalStorage() {
                     // نمایش محتوا
            const saved = localStorage.getItem('pediabible_custom_content');
                     currentContent = item.value;
            if (saved) {
                    showContent(item.value, item.text);
                const parsed = JSON.parse(saved);
                Object.keys(parsed).forEach(category => {
                     if (!booksData[category]) {
                        booksData[category] = [];
                     }
                     booksData[category] = [...booksData[category], ...parsed[category]];
                 });
                 });
            }
                  
        }
                 optionsContainer.appendChild(option);
 
        // به‌روزرسانی لیست محتواها
        function updateContentList(category) {
            contentSelect.innerHTML = '<option value="">لطفاً محتوا انتخاب کنید</option>';
           
            booksData[category].forEach(item => {
                const option = document.createElement('option');
                option.value = item.value;
                 option.textContent = item.text;
                 contentSelect.appendChild(option);
             });
             });
         }
         }
        // وقتی دسته‌بندی تغییر کرد
        categorySelect.addEventListener('change', function() {
            const selectedCategory = this.value;
           
            if (!selectedCategory) {
                contentSelect.disabled = true;
                contentSelect.innerHTML = '<option value="">ابتدا دسته‌بندی را انتخاب کنید</option>';
                resetContent();
                return;
            }
           
            // پر کردن لیست محتواها
            contentSelect.disabled = false;
            updateContentList(selectedCategory);
           
            resetContent();
        });
        // وقتی محتوا تغییر کرد
        contentSelect.addEventListener('change', function() {
            const selectedValue = this.value;
            const selectedText = this.options[this.selectedIndex].text;
           
            if (!selectedValue) {
                resetContent();
                return;
            }
           
            currentContent = selectedValue;
            showContent(selectedValue, selectedText);
        });


         // نمایش محتوا
         // نمایش محتوا
خط ۹۲۸: خط ۷۰۸:
         }
         }


         // بررسی وضعیت مدیر در هنگام بارگذاری صفحه
         // بستن لیست وقتی کاربر در جای دیگری کلیک می‌کند
         document.addEventListener('DOMContentLoaded', function() {
         document.addEventListener('click', function(event) {
             loadFromLocalStorage();
             if (!event.target.closest('.searchable-select')) {
             checkMediaWikiAdminStatus();
                optionsList.style.display = 'none';
             }
         });
         });
        // مدیریت کلیدهای کیبورد
        searchInput.addEventListener('keydown', function(event) {
            if (event.key === 'Escape') {
                optionsList.style.display = 'none';
            }
        });
        // لاگ برای دیباگ
        console.log('سیستم بارگذاری شد. حالا می‌توانید تست کنید:');
        console.log('1. یک دسته‌بندی انتخاب کنید');
        console.log('2. روی "برای مشاهده محتوا کلیک کنید" کلیک کنید');
        console.log('3. لیست محتواها نمایش داده می‌شود');
     </script>
     </script>
</body>
</body>
</html>
</html>

نسخهٔ کنونی تا ‏۱۶ اکتبر ۲۰۲۵، ساعت ۱۷:۵۶

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

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

مطالعه آنلاین کتاب‌ها و مقالات مسیحی

کتابخانه جامع منابع مسیحی

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

کتاب‌ها

انتشار همهٔ کتاب‌ها در دانشنامه با اجازهٔ رسمی نویسندگان یا ناشران انجام شده است، و برای برخی آثار، مجوز چاپ مجدد نیز دریافت گردیده است. تمامی حقوق برای انتشارات دانشنامهٔ کتاب مقدس محفوظ است. نویسندگان و ناشران مسیحی می‌توانند برای همکاری و انتشار آثار خود با ما در ارتباط باشند.

مقالات

مقالات دانشنامه با اجازهٔ نویسندگان یا بر اساس منابع عمومی و بدون حق کپی‌رایت منتشر می‌شوند. در همهٔ موارد، اصول امانت‌داری و احترام به منبع اصلی رعایت شده است. پژوهشگران و نویسندگان مسیحی می‌توانند برای انتشار مقالات خود با ما همکاری کنند

فروشگاه کتاب

در فروشگاه کتاب دانشنامه، امکان خرید کتاب‌های چاپی و الکترونیکی فراهم شده است.

لطفاً دسته‌بندی انتخاب کنید
لطفاً ابتدا یک دسته‌بندی انتخاب کنید
هیچ محتوایی انتخاب نشده است

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