پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
بدون خلاصۀ ویرایش
برچسب: واگردانی دستی
خط ۲۸: خط ۲۸:
             line-height: 1.6;
             line-height: 1.6;
             background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.05"><path fill="%238B4513" d="M20,20 L80,20 L80,80 L20,80 Z" stroke="%238B4513" stroke-width="2"/></svg>');
             background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.05"><path fill="%238B4513" d="M20,20 L80,20 L80,80 L20,80 Z" stroke="%238B4513" stroke-width="2"/></svg>');
             padding: 10px;
             padding: 0;
            margin: 0;
        }
       
        /* مخفی کردن هدرهای اضافی ویکی */
        body > header:first-child,
        .wiki-header,
        .mw-header,
        #mw-header,
        #header,
        .header {
            display: none !important;
         }
         }
          
          
خط ۳۴: خط ۴۵:
             max-width: 1200px;
             max-width: 1200px;
             margin: 0 auto;
             margin: 0 auto;
            padding: 5px 15px;
         }
         }
          
          
خط ۳۹: خط ۵۱:
             text-align: center;
             text-align: center;
             margin-bottom: 20px;
             margin-bottom: 20px;
             padding: 15px;
             padding: 15px 20px;
             border-bottom: 2px solid var(--border-color);
             border-bottom: 2px solid var(--border-color);
             background: linear-gradient(to bottom, #f9f6f2, #f0e6d6);
             background: linear-gradient(to bottom, #f9f6f2, #f0e6d6);
             border-radius: 8px;
             border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            position: relative;
        }
       
        .breadcrumb {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            font-size: 1.1rem;
            color: var(--dark-color);
            direction: rtl;
        }
       
        .breadcrumb-home {
            color: var(--accent-color);
            text-decoration: none;
            transition: color 0.3s;
            font-weight: 500;
        }
       
        .breadcrumb-home:hover {
            color: var(--primary-color);
            text-decoration: underline;
        }
       
        .breadcrumb-separator {
            color: var(--border-color);
            font-weight: 300;
        }
       
        .breadcrumb-current {
            color: var(--primary-color);
            font-weight: bold;
         }
         }
          
          
         .app-header h1 {
         .app-header h1 {
             color: var(--primary-color);
             color: var(--primary-color);
             margin-bottom: 5px;
             margin-bottom: 8px;
             font-size: 1.8rem;
             font-size: 1.8rem;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
            font-weight: 700;
            text-align: center;
         }
         }
          
          
         .description {
         .description {
             color:#808080;
             color:#808080;
             font-size:1.1rem;
             font-size:1.2rem;
             font-style: italic;
             font-style: italic;
            margin-top: 5px;
            text-align: center;
         }
         }
          
          
خط ۶۵: خط ۱۱۷:
             padding: 15px;
             padding: 15px;
             border-radius: 8px;
             border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.08);
             border: 1px solid var(--border-color);
             border: 1px solid var(--border-color);
            direction: rtl;
            text-align: right;
         }
         }
          
          
خط ۷۱: خط ۱۲۶:
             background: white;
             background: white;
             border-radius: 6px;
             border-radius: 6px;
             padding: 10px;
             padding: 12px;
            border: 1px solid var(--border-color);
         }
         }
          
          
         .selector-title {
         .selector-title {
             font-size: 0.9rem;
             font-size: 1rem;
             margin-bottom: 8px;
             margin-bottom: 8px;
             color: var(--primary-color);
             color: var(--primary-color);
خط ۸۵: خط ۱۴۱:
         select {
         select {
             width: 100%;
             width: 100%;
             padding: 8px;
             padding: 10px 12px;
             border: 1px solid var(--border-color);
             border: 1px solid var(--border-color);
             border-radius: 4px;
             border-radius: 4px;
             background-color: white;
             background-color: white;
             font-size: 0.9rem;
             font-size: 0.95rem;
            color: var(--dark-color);
            cursor: pointer;
            transition: all 0.3s;
            font-family: var(--font-family);
            text-align: right;
            direction: rtl;
        }
       
        select:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 2px rgba(165, 42, 42, 0.2);
         }
         }
          
          
خط ۹۵: خط ۱۶۳:
             background: white;
             background: white;
             border-radius: 8px;
             border-radius: 8px;
             padding: 20px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
             padding: 25px;
            min-height: 500px;
             border: 1px solid var(--border-color);
             border: 1px solid var(--border-color);
             margin-bottom: 20px;
             margin-bottom: 20px;
            direction: rtl;
            text-align: right;
         }
         }
          
          
         .chapter-title {
         .chapter-title {
             text-align: center;
             text-align: center;
             margin-bottom: 15px;
             margin-bottom: 20px;
             color: var(--primary-color);
             color: var(--primary-color);
             font-size: 1.3rem;
             font-size: 1.5rem;
             padding-bottom: 10px;
             padding-bottom: 10px;
             border-bottom: 2px solid var(--border-color);
             border-bottom: 2px solid var(--border-color);
خط ۱۱۱: خط ۱۸۳:
         .content-display {
         .content-display {
             width: 100%;
             width: 100%;
             height: 500px;
             height: 650px;
             border: 1px solid var(--border-color);
             border: 1px solid var(--border-color);
             border-radius: 6px;
             border-radius: 6px;
            background: white;
         }
         }
          
          
خط ۱۲۰: خط ۱۹۳:
             justify-content: space-between;
             justify-content: space-between;
             align-items: center;
             align-items: center;
             margin-top: 20px;
             margin-top: 25px;
            flex-wrap: wrap;
            gap: 10px;
            direction: rtl;
         }
         }
          
          
         .nav-btn {
         .nav-btn {
             padding: 10px 20px;
             padding: 12px 20px;
             background-color: var(--secondary-color);
             background-color: var(--secondary-color);
             color: white;
             color: white;
خط ۱۳۰: خط ۲۰۶:
             border-radius: 6px;
             border-radius: 6px;
             cursor: pointer;
             cursor: pointer;
            transition: all 0.3s;
            font-size: 1rem;
             display: flex;
             display: flex;
             align-items: center;
             align-items: center;
             gap: 8px;
             gap: 8px;
            font-family: var(--font-family);
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
       
        .nav-btn:hover {
            background-color: var(--accent-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
         }
         }
          
          
خط ۱۳۸: خط ۲۲۴:
             background-color: #b0a090;
             background-color: #b0a090;
             cursor: not-allowed;
             cursor: not-allowed;
            transform: none;
            box-shadow: none;
         }
         }


خط ۱۴۳: خط ۲۳۱:
             display: inline-flex;
             display: inline-flex;
             align-items: center;
             align-items: center;
            justify-content: center;
             gap: 8px;
             gap: 8px;
             padding: 10px 20px;
             padding: 12px 20px;
             background-color: #87CEEB;
             background-color: #87CEEB;
             color: #000000;
             color: #000000;
             text-decoration: none;
             text-decoration: none;
             border-radius: 6px;
             border-radius: 6px;
            transition: all 0.3s;
            font-size: 1rem;
            font-family: var(--font-family);
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
        .wiki-link:hover {
            background-color: #8B0000;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
         }
         }


خط ۱۵۷: خط ۲۵۶:
             border: 2px dashed var(--border-color);
             border: 2px dashed var(--border-color);
             border-radius: 8px;
             border-radius: 8px;
            margin-top: 20px;
             font-size: 1.1rem;
             font-size: 1.1rem;
             background-color: var(--light-color);
             background-color: var(--light-color);
         }
         }


         .placeholder {
         .access-denied {
             display: flex;
             text-align: center;
             flex-direction: column;
            padding: 40px;
             align-items: center;
            background: #fee;
             justify-content: center;
             border-radius: 8px;
             height: 100%;
             border: 2px solid #f5c6cb;
             color: #721c24;
             margin-top: 20px;
         }
         }


         .placeholder i {
         .access-denied h3 {
             font-size: 3rem;
             color: #721c24;
             margin-bottom: 15px;
             margin-bottom: 15px;
             color: var(--border-color);
             font-size: 1.5rem;
        }
 
        .info-message {
            text-align: center;
            padding: 10px;
            background: #e7f3ff;
            border-radius: 5px;
            margin-top: 10px;
            font-size: 0.9rem;
            color: #0066cc;
         }
         }


        /* استایل‌های مخصوص موبایل */
         @media (max-width: 768px) {
         @media (max-width: 768px) {
            .container {
                padding: 8px 10px;
            }
           
            .app-header {
                margin-bottom: 15px;
                padding: 12px 15px;
            }
           
            .breadcrumb {
                font-size: 0.85rem;
                margin-bottom: 10px;
            }
           
            .app-header h1 {
                font-size: 1.5rem;
                margin-bottom: 6px;
            }
           
            .description {
                font-size: 0.9rem;
            }
           
             .selector-container {
             .selector-container {
                 grid-template-columns: 1fr;
                 grid-template-columns: 1fr;
                gap: 10px;
                margin-bottom: 20px;
                padding: 15px;
            }
           
            .bible-content {
                padding: 15px;
                min-height: 450px;
            }
           
            .chapter-title {
                font-size: 1.3rem;
                margin-bottom: 15px;
            }
           
            .content-display {
                height: 500px;
             }
             }
              
              
خط ۱۸۹: خط ۳۴۲:
                 justify-content: center;
                 justify-content: center;
             }
             }
        }
        @media (max-width: 480px) {
            .content-display {
                height: 450px;
            }
           
            .nav-btn, .wiki-link {
                padding: 10px 15px;
                font-size: 0.9rem;
            }
           
            .instructions {
                padding: 30px 15px;
                font-size: 1rem;
            }
           
            .app-header {
                padding: 10px 12px;
            }
           
            .app-header h1 {
                font-size: 1.3rem;
            }
        }
        /* استایل برای حالت انتخاب نشده */
        .placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: #7f8c8d;
            text-align: center;
        }
        .placeholder i {
            font-size: 3rem;
            margin-bottom: 15px;
            color: var(--border-color);
        }
        /* استایل برای راست‌چین کامل */
        option {
            direction: rtl;
            text-align: right;
         }
         }
     </style>
     </style>
خط ۱۹۵: خط ۳۹۵:
     <div class="container">
     <div class="container">
         <div class="app-header">
         <div class="app-header">
            <nav class="breadcrumb">
                <a href="https://www.pediabible.com" class="breadcrumb-home">خانه</a>
                <span class="breadcrumb-separator">/</span>
                <span class="breadcrumb-current">کتاب مقدس</span>
            </nav>
             <h1>کتاب مقدس آنلاین</h1>
             <h1>کتاب مقدس آنلاین</h1>
             <p class="description">مطالعه ترجمه‌های مختلف بصورت کاربردی با واژه نامه تخصصی</p>
             <p class="description">مطالعه ترجمه‌های مختلف بصورت کاربردی با واژه نامه تخصصی</p>
         </div>
         </div>
          
          
         <div class="selector-container">
         <div id="content-wrapper">
             <div class="selector-box">
             <!-- محتوا توسط JavaScript پر می‌شود -->
                <h3 class="selector-title">ترجمه</h3>
        </div>
                <select id="translation-select">
    </div>
                    <option value="">انتخاب ترجمه</option>
 
                    <option value="old">ترجمه قدیم</option>
    <script>
                    <option value="hejre_nou">هزاره نو</option>
        // 🔒 سیستم حفاظتی - بررسی دامنه مجاز
                    <option value="mozde">مژده</option>
        const ALLOWED_DOMAINS = [
                    <option value="daneshname">دانشنامه</option>
            'pediabible.com',
                </select>
            'www.pediabible.com',
             </div>
            'localhost',
            '127.0.0.1'
        ];
 
        // تابع بررسی مجاز بودن دامنه
        function isDomainAllowed() {
            const currentDomain = window.location.hostname;
             console.log('🔍 بررسی دامنه:', currentDomain);
              
              
             <div class="selector-box">
             // اگر روی فایل محلی هستیم، اجازه بده
                <h3 class="selector-title">عهد</h3>
            if (!currentDomain || currentDomain === '' || currentDomain === 'null') {
                <select id="testament-select" disabled>
                console.log('✅ فایل محلی - مجاز');
                    <option value="">انتخاب عهد</option>
                 return true;
                    <option value="old">عهد قدیم</option>
             }
                    <option value="new">عهد جدید</option>
                 </select>
             </div>
              
              
             <div class="selector-box">
             const isAllowed = ALLOWED_DOMAINS.some(domain => {
                 <h3 class="selector-title">کتاب</h3>
                 const match = currentDomain === domain || currentDomain.endsWith('.' + domain);
                 <select id="book-select" disabled>
                 if (match) {
                     <option value="">انتخاب کتاب</option>
                     console.log(`✅ دامنه ${currentDomain} مجاز است`);
                 </select>
                }
             </div>
                 return match;
             });
              
              
             <div class="selector-box">
             if (!isAllowed) {
                 <h3 class="selector-title">فصل</h3>
                 console.log(`❌ دامنه ${currentDomain} غیرمجاز است`);
                <select id="chapter-select" disabled>
             }
                    <option value="">انتخاب فصل</option>
                </select>
            </div>
        </div>
       
        <div class="bible-content">
             <h2 class="chapter-title" id="chapter-title">لطفاً ترجمه، کتاب و فصل مورد نظر را انتخاب کنید</h2>
              
              
             <div id="verses-container">
             return isAllowed;
                 <div class="instructions">
        }
                     <div class="placeholder">
 
                        <i class="fas fa-book-open"></i>
        // تابع نمایش پیام دسترسی غیرمجاز
                        <p>برای مطالعه کتاب مقدس، لطفاً ابتدا ترجمه، سپس عهد، کتاب و فصل مورد نظر خود را انتخاب کنید.</p>
        function showAccessDenied() {
                     </div>
            const wrapper = document.getElementById('content-wrapper');
            wrapper.innerHTML = `
                 <div class="access-denied">
                     <h3><i class="fas fa-ban"></i> دسترسی محدود شده</h3>
                    <p>این صفحه فقط بر روی دامنه <strong>pediabible.com</strong> قابل دسترسی است.</p>
                    <p>دامنه فعلی: <code>${window.location.hostname}</code></p>
                     <p>لطفاً از <a href="https://www.pediabible.com" style="color: #721c24; text-decoration: underline;">سایت اصلی</a> بازدید کنید.</p>
                 </div>
                 </div>
             </div>
             `;
        }
 
        // تابع اصلی بارگذاری برنامه
        function loadApplication() {
            console.log('🚀 شروع بارگذاری با بررسی امنیتی...');
              
              
             <div class="navigation">
             if (!isDomainAllowed()) {
                 <button class="nav-btn" id="prev-chapter" disabled>
                 console.log('❌ دسترسی غیرمجاز - نمایش پیام خطا');
                    <i class="fas fa-arrow-right"></i>
                 showAccessDenied();
                    فصل قبلی
                 return;
                </button>
            }
                  
 
                 <a href="#" class="wiki-link" id="wiki-page-link" target="_blank" style="display: none;">
            console.log('✅ دامنه مجاز - بارگذاری برنامه اصلی');
                    <i class="fas fa-external-link-alt"></i>
            // اگر دامنه مجاز باشد، برنامه اصلی بارگذاری می‌شود
                    صفحه کامل
             initializeBibleApp();
                </a>
         }
               
                <button class="nav-btn" id="next-chapter" disabled>
                    فصل بعدی
                    <i class="fas fa-arrow-left"></i>
                </button>
             </div>
         </div>
    </div>


    <script>
         // داده‌های کامل کتاب‌های مقدس
         // داده‌های کامل کتاب‌های مقدس
         const bibleBooks = {
         const bibleBooks = {
خط ۳۴۱: خط ۵۴۶:
         };
         };


         // داده‌های ترجمه‌های مختلف
         // 🔧 برنامه اصلی کتاب مقدس
        const translations = {
        function initializeBibleApp() {
            'old': {
            const wrapper = document.getElementById('content-wrapper');
                name: 'ترجمه قدیم',
           
                 baseUrl: 'https://www.pediabible.com/index.php?title=',
            // ایجاد ساختار HTML برنامه
                 getPageTitle: function(bookDisplayName, chapter) {
            wrapper.innerHTML = `
                     return `${bookDisplayName} فصل ${chapter}`;
                <div class="selector-container">
                    <div class="selector-box">
                        <h3 class="selector-title">ترجمه</h3>
                        <select id="translation-select">
                            <option value="">انتخاب ترجمه</option>
                            <option value="old">ترجمه قدیم</option>
                            <option value="hejre_nou">هزاره نو</option>
                            <option value="mozde">مژده</option>
                            <option value="daneshname">دانشنامه</option>
                        </select>
                    </div>
                   
                    <div class="selector-box">
                        <h3 class="selector-title">عهد</h3>
                        <select id="testament-select" disabled>
                            <option value="">انتخاب عهد</option>
                            <option value="old">عهد قدیم</option>
                            <option value="new">عهد جدید</option>
                        </select>
                    </div>
                   
                    <div class="selector-box">
                        <h3 class="selector-title">کتاب</h3>
                        <select id="book-select" disabled>
                            <option value="">انتخاب کتاب</option>
                        </select>
                    </div>
                   
                    <div class="selector-box">
                        <h3 class="selector-title">فصل</h3>
                        <select id="chapter-select" disabled>
                            <option value="">انتخاب فصل</option>
                        </select>
                    </div>
                </div>
               
                <div class="bible-content">
                    <h2 class="chapter-title" id="chapter-title">لطفاً ترجمه، کتاب و فصل مورد نظر را انتخاب کنید</h2>
                   
                    <div id="verses-container">
                        <div class="instructions">
                            <div class="placeholder">
                                <i class="fas fa-book-open"></i>
                                <p>برای مطالعه کتاب مقدس، لطفاً ابتدا ترجمه، سپس عهد، کتاب و فصل مورد نظر خود را انتخاب کنید.</p>
                            </div>
                        </div>
                    </div>
                   
                    <div class="info-message">
                        <i class="fas fa-info-circle"></i>
                        واژه ها در همین پنجره نمایش داده می‌شوند. برای تجربه بهتر مطالعه واژه در تب جدید: راست کلیک → Open in new tab
                    </div>
                   
                    <div class="navigation">
                        <button class="nav-btn" id="prev-chapter" disabled>
                            <i class="fas fa-arrow-right"></i>
                            فصل قبلی
                        </button>
                       
                        <a href="#" class="wiki-link" id="wiki-page-link" target="_blank" style="display: none;">
                            <i class="fas fa-external-link-alt"></i>
                            صفحه کامل
                        </a>
                       
                        <button class="nav-btn" id="next-chapter" disabled>
                            فصل بعدی
                            <i class="fas fa-arrow-left"></i>
                        </button>
                    </div>
                </div>
            `;
 
            // داده‌های ترجمه‌های مختلف
            const translations = {
                'old': {
                    name: 'ترجمه قدیم',
                    baseUrl: 'https://www.pediabible.com/index.php?title=',
                    getPageTitle: function(bookDisplayName, chapter) {
                        return `${bookDisplayName} فصل ${chapter}`;
                    }
                },
                 'hejre_nou': {
                    name: 'هزاره نو',
                    baseUrl: 'https://www.pediabible.com/index.php?title=',
                    getPageTitle: function(bookDisplayName, chapter) {
                        return `${bookDisplayName} هزاره نو فصل ${chapter}`;
                    }
                },
                 'mozde': {
                    name: 'مژده',
                    baseUrl: 'https://www.pediabible.com/index.php?title=',
                    getPageTitle: function(bookDisplayName, chapter) {
                        return `${bookDisplayName} مژده فصل ${chapter}`;
                    }
                },
                'daneshname': {
                     name: 'دانشنامه',
                    baseUrl: 'https://www.pediabible.com/index.php?title=',
                    getPageTitle: function(bookDisplayName, chapter) {
                        return `${bookDisplayName} دانشنامه فصل ${chapter}`;
                    }
                 }
                 }
             },
             };
             'hejre_nou': {
 
                name: 'هزاره نو',
            // عناصر DOM
                baseUrl: 'https://www.pediabible.com/index.php?title=',
            const translationSelect = document.getElementById('translation-select');
                 getPageTitle: function(bookDisplayName, chapter) {
            const testamentSelect = document.getElementById('testament-select');
                     return `${bookDisplayName} هزاره نو فصل ${chapter}`;
            const bookSelect = document.getElementById('book-select');
            const chapterSelect = document.getElementById('chapter-select');
            const chapterTitle = document.getElementById('chapter-title');
            const versesContainer = document.getElementById('verses-container');
             const prevChapterBtn = document.getElementById('prev-chapter');
            const nextChapterBtn = document.getElementById('next-chapter');
            const wikiPageLink = document.getElementById('wiki-page-link');
 
            // متغیرهای وضعیت فعلی
            let currentTranslation = '';
            let currentTestament = '';
            let currentBook = '';
            let currentChapter = 1;
 
            // رویداد تغییر ترجمه
            translationSelect.addEventListener('change', function() {
                 currentTranslation = this.value;
               
                if (currentTranslation) {
                     testamentSelect.disabled = false;
                    testamentSelect.value = '';
                    bookSelect.disabled = true;
                    bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
                    chapterSelect.disabled = true;
                    chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                    resetContent();
                } else {
                    resetAll();
                 }
                 }
             },
             });
             'mozde': {
 
                 name: 'مژده',
            // رویداد تغییر عهد
                baseUrl: 'https://www.pediabible.com/index.php?title=',
             testamentSelect.addEventListener('change', function() {
                getPageTitle: function(bookDisplayName, chapter) {
                 currentTestament = this.value;
                     return `${bookDisplayName} مژده فصل ${chapter}`;
               
                if (currentTestament) {
                    bookSelect.disabled = false;
                    bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
                   
                    bibleBooks[currentTestament].forEach((book, index) => {
                        const option = document.createElement('option');
                        option.value = index;
                        option.textContent = book.name;
                        bookSelect.appendChild(option);
                    });
                   
                    chapterSelect.disabled = true;
                    chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                    resetContent();
                } else {
                     bookSelect.disabled = true;
                    bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
                    chapterSelect.disabled = true;
                    chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                    resetContent();
                 }
                 }
             },
             });
             'daneshname': {
 
                 name: 'دانشنامه',
            // رویداد تغییر کتاب
                baseUrl: 'https://www.pediabible.com/index.php?title=',
             bookSelect.addEventListener('change', function() {
                getPageTitle: function(bookDisplayName, chapter) {
                 currentBook = this.value;
                    return `${bookDisplayName} دانشنامه فصل ${chapter}`;
               
                if (currentBook !== '') {
                    chapterSelect.disabled = false;
                    chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                   
                    const bookIndex = parseInt(currentBook);
                    const chaptersCount = bibleBooks[currentTestament][bookIndex].chapters;
                   
                    for (let i = 1; i <= chaptersCount; i++) {
                        const option = document.createElement('option');
                        option.value = i;
                        option.textContent = `فصل ${i}`;
                        chapterSelect.appendChild(option);
                    }
                   
                    prevChapterBtn.disabled = true;
                    nextChapterBtn.disabled = true;
                    wikiPageLink.style.display = 'none';
                } else {
                    chapterSelect.disabled = true;
                    chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                    resetContent();
                 }
                 }
             }
             });
        };


        // عناصر DOM
            // رویداد تغییر فصل
        const translationSelect = document.getElementById('translation-select');
            chapterSelect.addEventListener('change', function() {
        const testamentSelect = document.getElementById('testament-select');
                currentChapter = parseInt(this.value);
        const bookSelect = document.getElementById('book-select');
               
        const chapterSelect = document.getElementById('chapter-select');
                if (currentChapter) {
        const chapterTitle = document.getElementById('chapter-title');
                    displayChapterWithIframe();
        const versesContainer = document.getElementById('verses-container');
                } else {
        const prevChapterBtn = document.getElementById('prev-chapter');
                    resetContent();
        const nextChapterBtn = document.getElementById('next-chapter');
                }
        const wikiPageLink = document.getElementById('wiki-page-link');
            });


        // متغیرهای وضعیت فعلی
            // نمایش فصل با iframe - فقط محتوای اصلی
        let currentTranslation = '';
            function displayChapterWithIframe() {
        let currentTestament = '';
                const bookIndex = parseInt(currentBook);
        let currentBook = '';
                const bookData = bibleBooks[currentTestament][bookIndex];
        let currentChapter = 1;
                const bookName = bookData.name;
 
                const bookDisplayName = bookData.displayName;
        // رویداد تغییر ترجمه
                const translationName = translations[currentTranslation].name;
        translationSelect.addEventListener('change', function() {
               
            currentTranslation = this.value;
                 chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
           
                  
            if (currentTranslation) {
                const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
                 testamentSelect.disabled = false;
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                 testamentSelect.value = '';
                  
                 bookSelect.disabled = true;
                versesContainer.innerHTML = `
                 bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
                    <iframe
                chapterSelect.disabled = true;
                        id="content-iframe"
                chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                        src="${contentUrl}"
                 resetContent();
                        class="content-display"
            } else {
                        frameborder="0"
                 resetAll();
                        loading="lazy"
                        sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
                        allowfullscreen>
                    </iframe>
                `;
                  
                // اضافه کردن sandbox به iframe برای امنیت بیشتر
                const iframe = document.getElementById('content-iframe');
               
                wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                wikiPageLink.style.display = 'flex';
                 updateNavigationButtons();
             }
             }
        });


        // رویداد تغییر عهد
            function updateNavigationButtons() {
        testamentSelect.addEventListener('change', function() {
                const bookIndex = parseInt(currentBook);
            currentTestament = this.value;
                 const chaptersCount = bibleBooks[currentTestament][bookIndex].chapters;
           
            if (currentTestament) {
                bookSelect.disabled = false;
                 bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
               
                bibleBooks[currentTestament].forEach((book, index) => {
                    const option = document.createElement('option');
                    option.value = index;
                    option.textContent = book.name;
                    bookSelect.appendChild(option);
                });
                  
                  
                 chapterSelect.disabled = true;
                 prevChapterBtn.disabled = currentChapter <= 1;
                chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                 nextChapterBtn.disabled = currentChapter >= chaptersCount;
                resetContent();
            } else {
                 bookSelect.disabled = true;
                bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
                chapterSelect.disabled = true;
                chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                resetContent();
             }
             }
        });


        // رویداد تغییر کتاب
            prevChapterBtn.addEventListener('click', function() {
        bookSelect.addEventListener('change', function() {
                if (currentChapter > 1) {
            currentBook = this.value;
                    currentChapter--;
           
                    chapterSelect.value = currentChapter;
            if (currentBook !== '') {
                    displayChapterWithIframe();
                chapterSelect.disabled = false;
                 }
                 chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
            });
               
 
            nextChapterBtn.addEventListener('click', function() {
                 const bookIndex = parseInt(currentBook);
                 const bookIndex = parseInt(currentBook);
                 const chaptersCount = bibleBooks[currentTestament][bookIndex].chapters;
                 const chaptersCount = bibleBooks[currentTestament][bookIndex].chapters;
                  
                  
                 for (let i = 1; i <= chaptersCount; i++) {
                 if (currentChapter < chaptersCount) {
                     const option = document.createElement('option');
                     currentChapter++;
                     option.value = i;
                     chapterSelect.value = currentChapter;
                    option.textContent = `فصل ${i}`;
                     displayChapterWithIframe();
                     chapterSelect.appendChild(option);
                 }
                 }
                  
            });
 
            function resetContent() {
                 chapterTitle.textContent = 'لطفاً ترجمه، کتاب و فصل مورد نظر را انتخاب کنید';
                versesContainer.innerHTML = `
                    <div class="instructions">
                        <div class="placeholder">
                            <i class="fas fa-book-open"></i>
                            <p>برای مطالعه کتاب مقدس، لطفاً ابتدا ترجمه، سپس عهد، کتاب و فصل مورد نظر خود را انتخاب کنید.</p>
                        </div>
                    </div>
                `;
                 prevChapterBtn.disabled = true;
                 prevChapterBtn.disabled = true;
                 nextChapterBtn.disabled = true;
                 nextChapterBtn.disabled = true;
                 wikiPageLink.style.display = 'none';
                 wikiPageLink.style.display = 'none';
             } else {
             }
 
            function resetAll() {
                testamentSelect.disabled = true;
                testamentSelect.innerHTML = '<option value="">انتخاب عهد</option>';
                bookSelect.disabled = true;
                bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
                 chapterSelect.disabled = true;
                 chapterSelect.disabled = true;
                 chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                 chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
                 resetContent();
                 resetContent();
             }
             }
        });
        // رویداد تغییر فصل
        chapterSelect.addEventListener('change', function() {
            currentChapter = parseInt(this.value);
           
            if (currentChapter) {
                displayChapterWithIframe();
            } else {
                resetContent();
            }
        });


        // نمایش فصل با iframe
             console.log('✅ برنامه کتاب مقدس روی دامنه مجاز بارگذاری شد');
        function displayChapterWithIframe() {
            const bookIndex = parseInt(currentBook);
            const bookData = bibleBooks[currentTestament][bookIndex];
            const bookName = bookData.name;
            const bookDisplayName = bookData.displayName;
            const translationName = translations[currentTranslation].name;
           
            chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
           
             const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
            const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
           
            versesContainer.innerHTML = `
                <iframe
                    id="content-iframe"
                    src="${contentUrl}"
                    class="content-display"
                    frameborder="0"
                    loading="lazy">
                </iframe>
            `;
           
            wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
            wikiPageLink.style.display = 'flex';
            updateNavigationButtons();
         }
         }


         function updateNavigationButtons() {
         // 🔒 شروع برنامه با بررسی امنیتی
            const bookIndex = parseInt(currentBook);
         document.addEventListener('DOMContentLoaded', function() {
            const chaptersCount = bibleBooks[currentTestament][bookIndex].chapters;
             console.log('🚀 شروع بارگذاری با بررسی امنیتی...');
           
            loadApplication();
            prevChapterBtn.disabled = currentChapter <= 1;
            nextChapterBtn.disabled = currentChapter >= chaptersCount;
        }
 
         prevChapterBtn.addEventListener('click', function() {
             if (currentChapter > 1) {
                currentChapter--;
                chapterSelect.value = currentChapter;
                displayChapterWithIframe();
            }
         });
         });


         nextChapterBtn.addEventListener('click', function() {
         // 🔒 جلوگیری از دسترسی به توابع از کنسول
             const bookIndex = parseInt(currentBook);
        Object.defineProperty(window, 'translations', {
             const chaptersCount = bibleBooks[currentTestament][bookIndex].chapters;
             value: null,
           
             writable: false,
            if (currentChapter < chaptersCount) {
             configurable: false
                currentChapter++;
                chapterSelect.value = currentChapter;
                displayChapterWithIframe();
             }
         });
         });
        function resetContent() {
            chapterTitle.textContent = 'لطفاً ترجمه، کتاب و فصل مورد نظر را انتخاب کنید';
            versesContainer.innerHTML = `
                <div class="instructions">
                    <div class="placeholder">
                        <i class="fas fa-book-open"></i>
                        <p>برای مطالعه کتاب مقدس، لطفاً ابتدا ترجمه، سپس عهد، کتاب و فصل مورد نظر خود را انتخاب کنید.</p>
                    </div>
                </div>
            `;
            prevChapterBtn.disabled = true;
            nextChapterBtn.disabled = true;
            wikiPageLink.style.display = 'none';
        }
        function resetAll() {
            testamentSelect.disabled = true;
            testamentSelect.innerHTML = '<option value="">انتخاب عهد</option>';
            bookSelect.disabled = true;
            bookSelect.innerHTML = '<option value="">انتخاب کتاب</option>';
            chapterSelect.disabled = true;
            chapterSelect.innerHTML = '<option value="">انتخاب فصل</option>';
            resetContent();
        }
     </script>
     </script>
</body>
</body>
</html>
</html>

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

کتاب مقدس - مطالعه آنلاین

کتاب مقدس آنلاین

مطالعه ترجمه‌های مختلف بصورت کاربردی با واژه نامه تخصصی