پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
 
(۲۰ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۶: خط ۶:
     <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;
خط ۲۱: خط ۲۰:
          
          
         .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%;
             width: 100%;
             padding: 10px 12px;
             padding: 10px 12px;
خط ۱۲۸: خط ۱۲۲:
             background: white;
             background: white;
             cursor: pointer;
             cursor: pointer;
            transition: all 0.3s ease;
            border: 1px solid #e9ecef;
         }
         }
          
          
         select:focus, input:focus {
         .searchable-select {
             outline: none;
            position: relative;
             border-color: #3e6f73;
        }
             box-shadow: 0 0 0 2px rgba(62, 111, 115, 0.1);
       
        .select-display {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ced4da;
            border-radius: 6px;
            font-size: 13px;
            background: white;
            cursor: pointer;
            text-align: right;
            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;
        }
       
        .highlight {
            background: #fff3cd;
            font-weight: bold;
            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: #e9f7ef;
            padding: 15px;
            margin: 0 15px 15px;
            border: 1px solid #c8e6d1;
            border-radius: 8px;
            border-right: 4px solid #4a7c59;
        }
       
        .admin-panel h3 {
            color: #2d6a4f;
            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;
        }
       
        .custom-content-section {
            background: #f8f9fa;
            padding: 15px;
            margin: 0 15px 15px;
            border: 1px solid #dee2e6;
            border-radius: 8px;
        }
       
        .custom-content-section h3 {
            color: #3e6f73;
            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>
            <p style="font-size: 12px; color: #666; margin-bottom: 15px;">
                شما به عنوان مدیر وارد شده‌اید. می‌توانید محتوای جدید به کتابخانه اضافه کنید.
            </p>
            <div class="admin-controls">
                <button class="admin-btn" id="addContentBtn">
                    <i class="fas fa-plus"></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 defaultBooksData = {
         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 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 = [];
        let booksData = { ...defaultBooksData };


         // نمایش اعلان
         // وقتی دسته‌بندی تغییر کرد
         function showNotification(message, isError = false) {
         categorySelect.addEventListener('change', function() {
             notification.textContent = message;
             const selectedCategory = this.value;
            notification.className = 'notification' + (isError ? ' error' : '');
            notification.style.display = 'block';
              
              
             setTimeout(() => {
             if (!selectedCategory) {
                 notification.style.display = 'none';
                 selectDisplay.textContent = 'لطفاً دسته‌بندی انتخاب کنید';
            }, 3000);
                 selectDisplay.style.color = '#6c757d';
        }
                 selectedContentValue.value = '';
 
                 optionsList.style.display = 'none';
        // بررسی وضعیت مدیر در مدیاویکی
                 resetContent();
        async function checkMediaWikiAdminStatus() {
                 return;
            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('=');
            selectDisplay.textContent = 'برای مشاهده محتوا کلیک کنید';
                if (name === 'MediaWikiUser' || name === 'mwuser') {
            selectDisplay.style.color = '#333';
                    mediaWikiUser = decodeURIComponent(value);
            selectedContentValue.value = '';
                    break;
            currentItems = booksData[selectedCategory];
                }
            }
              
              
             // اگر کاربر وارد شده باشد و نام کاربری مشخص باشد، احتمالاً مدیر است
             resetContent();
            if (mediaWikiUser && mediaWikiUser !== 'Anonymous') {
        });
                // اینجا می‌توانید لیست مدیران را چک کنید
                const adminUsers = ['مدیر', 'admin', 'administrator']; // نام‌های مدیران
                if (adminUsers.some(admin => mediaWikiUser.toLowerCase().includes(admin.toLowerCase()))) {
                    enableAdminFeatures();
                }
            }
        }


         // بررسی از طریق المنت‌های صفحه مدیاویکی
         // وقتی روی نمایش کلیک می‌شود
         function checkAdminByPageElements() {
         selectDisplay.addEventListener('click', function() {
            // بررسی وجود لینک‌های مدیریتی
             if (!categorySelect.value) {
            const adminElements = document.querySelectorAll(
                 alert('لطفاً ابتدا یک دسته‌بندی انتخاب کنید');
                '#pt-administration, #ca-protect, .mw-group-admin, a[href*="Special:"]'
                categorySelect.focus();
            );
           
            if (adminElements.length > 0) {
                enableAdminFeatures();
            }
        }
 
        // فعال‌سازی ویژگی‌های مدیر
        function enableAdminFeatures() {
            isMediaWikiAdmin = true;
            adminPanel.style.display = 'block';
            customContentSection.style.display = 'block';
            console.log('ویژگی‌های مدیریتی برای مدیر مدیاویکی فعال شد');
        }
 
        // افزودن محتوای سفارشی
        addCustomContent.addEventListener('click', function() {
             if (!isMediaWikiAdmin) {
                 showNotification('شما دسترسی لازم برای این عمل را ندارید', true);
                 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 = '';
           
            // ذخیره در localStorage
            saveCustomContent();
           
            // به‌روزرسانی لیست در صورت انتخاب دسته‌بندی مربوطه
            if (categorySelect.value === category) {
                 updateContentList(category);
             }
             }
         });
         });


         // افزودن محتوای جدید
         // وقتی کاربر در فیلد جستجو تایپ می‌کند
         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();
         });
         });


         // تابع تبدیل عنوان به فرمت URL
         // پر کردن لیست گزینه‌ها - این تابع اکنون به درستی فراخوانی می‌شود
         function convertToUrlFormat(title) {
         function populateOptions(itemsList, searchTerm = '') {
             let url = title.trim();
             console.log('populateOptions فراخوانی شد با', itemsList.length, 'آیتم');
            url = url.replace(/\s+/g, '_');
            url = url.replace(/[^\w\u0600-\u06FF_]/g, '');
            return url;
        }
 
        // ذخیره محتوای سفارشی در localStorage
        function saveCustomContent() {
            const customContent = {};
              
              
             Object.keys(booksData).forEach(category => {
             optionsContainer.innerHTML = '';
                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));
             if (itemsList.length === 0) {
        }
                const noResult = document.createElement('div');
 
                 noResult.className = 'no-results';
        // بارگذاری محتوای سفارشی از localStorage
                noResult.textContent = 'نتیجه‌ای یافت نشد';
        function loadCustomContent() {
                optionsContainer.appendChild(noResult);
            const saved = localStorage.getItem('pediabible_custom_content');
                 return;
            if (saved) {
                 try {
                    const customContent = JSON.parse(saved);
                   
                    Object.keys(customContent).forEach(category => {
                        if (!booksData[category]) {
                            booksData[category] = [];
                        }
                        booksData[category] = [
                            ...(defaultBooksData[category] || []),
                            ...customContent[category]
                        ];
                    });
                 } catch (e) {
                    console.error('خطا در بارگذاری محتوای سفارشی:', e);
                }
             }
             }
        }
        // به‌روزرسانی لیست محتواها
        function updateContentList(category) {
            contentSelect.innerHTML = '<option value="">لطفاً محتوا انتخاب کنید</option>';
              
              
             if (booksData[category]) {
             itemsList.forEach(item => {
                booksData[category].forEach(item => {
                const option = document.createElement('div');
                    const option = document.createElement('option');
                option.className = 'option-item';
                     option.value = item.value;
               
                if (searchTerm) {
                    // هایلایت کردن متن جستجو شده
                    const regex = new RegExp(`(${searchTerm})`, 'gi');
                    const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>');
                     option.innerHTML = highlightedText;
                } else {
                     option.textContent = item.text;
                     option.textContent = item.text;
                     contentSelect.appendChild(option);
                }
               
                option.addEventListener('click', function() {
                    selectDisplay.textContent = item.text;
                    selectDisplay.style.color = '#333';
                    selectedContentValue.value = item.value;
                     optionsList.style.display = 'none';
                   
                    // نمایش محتوا
                    currentContent = item.value;
                    showContent(item.value, item.text);
                 });
                 });
             }
               
                optionsContainer.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);
        });


         // نمایش محتوا
         // نمایش محتوا
خط ۸۱۵: خط ۶۰۶:
             contentTitle.textContent = bookText;
             contentTitle.textContent = bookText;
              
              
            // نمایش loading
             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('click', function(event) {
             loadCustomContent();
             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>

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

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

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

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

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

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

کتاب‌ها

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

مقالات

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

فروشگاه کتاب

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

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

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