diff --git "a/index.html" "b/index.html" --- "a/index.html" +++ "b/index.html" @@ -1,5 +1,5 @@ -
+اختر الصفحات التي تريد معالجتها (انقر للتحديد)
- +اضغط "التالي" للبدء في استعراض الاختلافات
صحح اختلافات المعنى لضمان دقة الترجمة.
`; } - + // توصية عامة recommendationsContainer.innerHTML += `استخدم وضع العرض المقسم للتعديل الدقيق.
`; } - + // تعيين أحداث النقر لأزرار التنقل document.getElementById('prevDiff').addEventListener('click', showPreviousDifference); document.getElementById('nextDiff').addEventListener('click', showNextDifference); - + // إعداد الاختلاف الأول if (allDifferences.length > 0) { currentDiffIndex = 0; @@ -4470,7 +4891,7 @@ document.getElementById('prevDiff').disabled = true; document.getElementById('nextDiff').disabled = true; } - + // إضافة توضيحات للعرض التفاعلي document.getElementById('interactiveViewExplanation').innerHTML = generateInteractiveViewExplanation(); } @@ -4482,11 +4903,11 @@ function getContextAroundMatch(text, match, contextSize) { const index = text.indexOf(match); if (index === -1) return ""; - + // الحصول على جملة كاملة تحتوي على النص المطابق const start = Math.max(0, text.lastIndexOf('.', index) + 1); const end = Math.min(text.length, text.indexOf('.', index + match.length) + 1); - + // إذا لم نتمكن من العثور على جملة كاملة، نستخدم عدد الأحرف let context; if (end - start < 10) { @@ -4496,20 +4917,20 @@ } else { context = text.substring(start, end); } - + // تمييز النص المطابق const highlightedContext = context.replace( new RegExp(`(${escapeRegExp(match)})`, 'g'), - `$1` + `\$1` ); - + return highlightedContext; } // عرض الاختلاف السابق function showPreviousDifference() { if (allDifferences.length === 0) return; - + currentDiffIndex = (currentDiffIndex - 1 + allDifferences.length) % allDifferences.length; displayCurrentDifference(); } @@ -4517,7 +4938,7 @@ // عرض الاختلاف التالي function showNextDifference() { if (allDifferences.length === 0) return; - + currentDiffIndex = (currentDiffIndex + 1) % allDifferences.length; displayCurrentDifference(); } @@ -4532,14 +4953,14 @@ document.getElementById('diffReference').classList.add('hidden'); return; } - + const diff = allDifferences[currentDiffIndex]; const segment = analysisSegments[diff.segmentIndex]; - + let typeLabel = ''; let typeClass = ''; let icon = ''; - + if (diff.type === 'number') { typeLabel = 'اختلاف رقمي'; typeClass = 'bg-yellow-100 text-yellow-800'; @@ -4553,9 +4974,9 @@ typeClass = 'bg-red-100 text-red-800'; icon = 'fas fa-exclamation-circle'; } - + let highlightedContext = diff.context; - + // إضافة رقم المقطع ونوع الخطأ وعرض السياق document.getElementById('currentDiffDisplay').innerHTML = `النصوص متطابقة تماماً ولا توجد فروقات تحتاج للتنبيه.
-تهانينا! الترجمة دقيقة ومكتملة.
-