youssefreda9 commited on
Commit
afba67e
·
1 Parent(s): afcf829

audit: Fix 15+ issues across entire website - BUGS: Fix copySummary event.target crash, viewbox→viewBox SVGs - HERO: Replace fake stats (10M/99%/50K) with real features (3 types/instant/free) - HERO: 'شاهد العرض التوضيحي'→'استكشف الميزات' with onclick - HERO: Fix mock editor hardcoded light colors→CSS variables - HERO: animate-pulse→animate-fade-in on floating card - PRICING: All 3 buttons now have onclick (go to editor) - FOOTER: Replace dead #links with working page navigation - EDITOR: Confirm dialog before clearing content - CODE: Remove empty style tag and old comments

Browse files
Files changed (2) hide show
  1. src/index.html +40 -50
  2. src/js/editor.js +5 -0
src/index.html CHANGED
@@ -13,9 +13,7 @@
13
  <link rel="stylesheet" href="/css/tokens.css">
14
  <link rel="stylesheet" href="/css/base.css">
15
  <link rel="stylesheet" href="/css/components.css">
16
- <style>
17
- /* Marketing page inline overrides — core styles in /css/ */
18
- </style>
19
  <style>@view-transition { navigation: auto; }</style>
20
  <script src="/js/vendor/supabase.min.js"></script>
21
  <script src="/js/auth/config.js"></script>
@@ -165,19 +163,11 @@
165
  </div>
166
  <h1 id="hero-headline" class="text-5xl lg:text-7xl font-bold leading-tight mb-6" style="line-height: 1.3;">اكتب العربية<br><span class="text-gradient">بثقة واحتراف</span></h1>
167
  <p id="hero-subheadline" class="text-xl lg:text-2xl leading-relaxed mb-10" style="color: var(--text-secondary); line-height: 1.9;">مساعد ذكي يصحح الإملاء والنحو وعلامات الترقيم ويُلخّص النصوص العربية بدقة عالية.</p>
168
- <div class="flex flex-col sm:flex-row gap-4 justify-center lg:justify-start mb-12"><button id="hero-cta-primary" onclick="showPage('editor')" class="px-8 py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl"> ابدأ الكتابة الآن </button> <button class="px-8 py-4 rounded-2xl text-lg font-bold transition-all hover:scale-105 border-2" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> شاهد العرض التوضيحي </button>
169
  </div><!-- Stats -->
170
  <div class="flex items-center gap-8 justify-center lg:justify-start">
171
  <div class="text-center">
172
  <div class="text-3xl font-bold text-gradient">
173
- +١٠ مليون
174
- </div>
175
- <div class="text-sm mt-1" style="color: var(--text-secondary);">
176
- كلمة تم تصحيحها
177
- </div>
178
- </div>
179
- <div class="w-px h-12" style="background: rgba(255, 255, 255, 0.2);"></div>
180
- <div class="text-center">
181
  <div class="text-3xl font-bold text-gradient">
182
  ٩٩٪
183
  </div>
@@ -206,7 +196,7 @@
206
  </div><span class="text-sm" style="color: var(--text-secondary);">محرر بيان</span>
207
  <div class="w-20"></div>
208
  </div><!-- Mock Editor Content -->
209
- <div class="p-8 editor-content text-right text-lg" dir="rtl" style="background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%); color: #1a202c; min-height: 300px;">
210
  <p class="mb-4">مرحباً بكم في <span class="spelling-error">محرر بيان</span> للكتابة العربية<span class="punctuation-suggestion">.</span></p>
211
  <p class="mb-4">نحن <span class="grammar-error">نساعدك</span> على كتابة نصوص عربية صحيحة وواضحة بفضل الذكاء الاصطناعي المتقدم<span class="punctuation-suggestion">.</span></p>
212
  <p>جرّب المحرر الآن وشاهد كيف يمكن أن تصبح كتابتك أفضل!</p>
@@ -227,7 +217,7 @@
227
  </div>
228
  </div>
229
  </div><!-- Floating Suggestion Card -->
230
- <div class="absolute -bottom-6 -left-6 p-4 rounded-2xl shadow-xl animate-pulse" style="background: var(--surface-color); border: 1px solid rgba(34, 197, 94, 0.3); max-width: 280px;">
231
  <div class="flex items-start gap-3">
232
  <div class="w-10 h-10 rounded-xl flex items-center justify-center" style="background: rgba(34, 197, 94, 0.15);"><span style="color: #22c55e; font-size: 20px;">✓</span>
233
  </div>
@@ -433,7 +423,7 @@
433
  مقالة طويلة تتحدث عن أهمية التكنولوجيا في العصر الحديث وتأثيرها على المجتمع...
434
  </div>
435
  <div class="flex items-center justify-center my-4">
436
- <svg class="w-8 h-8" style="color: var(--secondary-color);" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3" />
437
  </svg>
438
  </div>
439
  <div class="text-lg p-4 rounded-xl editor-content" style="background: rgba(139, 92, 246, 0.1); border-right: 4px solid #8b5cf6; line-height: 2;">
@@ -769,21 +759,21 @@
769
  </div>
770
  <ul class="space-y-4 mb-8">
771
  <li class="flex items-center gap-3">
772
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
773
  </svg><span class="text-base">تدقيق إملائي أساسي</span></li>
774
  <li class="flex items-center gap-3">
775
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
776
  </svg><span class="text-base">٥٠٠ كلمة يوميًا</span></li>
777
  <li class="flex items-center gap-3">
778
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
779
  </svg><span class="text-base">محرر ويب</span></li>
780
  <li class="flex items-center gap-3">
781
- <svg class="w-5 h-5" style="color: rgba(241, 245, 249, 0.2);" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
782
  </svg><span class="text-base" style="color: var(--text-secondary);">اقتراحات نحوية</span></li>
783
  <li class="flex items-center gap-3">
784
- <svg class="w-5 h-5" style="color: rgba(241, 245, 249, 0.2);" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
785
  </svg><span class="text-base" style="color: var(--text-secondary);">تلخيص النصوص</span></li>
786
- </ul><button class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> ابدأ مجانًا </button>
787
  </div><!-- Pro Plan (Most Popular) -->
788
  <div class="p-8 rounded-3xl transition-all hover:scale-105 relative shadow-2xl" style="background: linear-gradient(165deg, var(--surface-color) 0%, rgba(59, 130, 246, 0.1) 100%); border: 2px solid var(--primary-color);">
789
  <div class="pricing-badge gradient-accent text-white">
@@ -805,21 +795,21 @@
805
  </div>
806
  <ul class="space-y-4 mb-8">
807
  <li class="flex items-center gap-3">
808
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
809
  </svg><span class="text-base">تدقيق إملائي ونحوي متقدم</span></li>
810
  <li class="flex items-center gap-3">
811
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
812
  </svg><span class="text-base">كلمات غي�� محدودة</span></li>
813
  <li class="flex items-center gap-3">
814
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
815
  </svg><span class="text-base">تصحيح علامات الترقيم</span></li>
816
  <li class="flex items-center gap-3">
817
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
818
  </svg><span class="text-base">تلخيص النصوص بالذكاء الاصطناعي</span></li>
819
  <li class="flex items-center gap-3">
820
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
821
  </svg><span class="text-base">إضافة المتصفح</span></li>
822
- </ul><button class="w-full py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl"> الترقية للاحترافي </button>
823
  </div><!-- Enterprise Plan -->
824
  <div class="p-8 rounded-3xl transition-all hover:scale-105" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
825
  <div class="text-center mb-8">
@@ -838,19 +828,19 @@
838
  </div>
839
  <ul class="space-y-4 mb-8">
840
  <li class="flex items-center gap-3">
841
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
842
  </svg><span class="text-base">كل ميزات الاحترافي</span></li>
843
  <li class="flex items-center gap-3">
844
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
845
  </svg><span class="text-base">إدارة الفرق</span></li>
846
  <li class="flex items-center gap-3">
847
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
848
  </svg><span class="text-base">واجهة برمجية (API)</span></li>
849
  <li class="flex items-center gap-3">
850
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
851
  </svg><span class="text-base">تكامل مخصص</span></li>
852
  <li class="flex items-center gap-3">
853
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
854
  </svg><span class="text-base">دعم فني ذو أولوية</span></li>
855
  </ul><button class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> تواصل مع المبيعات </button>
856
  </div>
@@ -927,12 +917,7 @@
927
  }
928
  }
929
 
930
- // OLD FUNCTIONS REMOVED - Now in editor.js with offset-based rendering
931
- // - analyzeText() - moved to editor.js
932
- // - updateSuggestions() - replaced with offset-based render()
933
- // - resetSuggestions() - replaced with renderWithoutSuggestions()
934
- // - clearEditor() - moved to editor.js
935
- // - copyText() - moved to editor.js
936
 
937
  // Summarization functions
938
  function updateSummaryLength() {
@@ -1037,18 +1022,23 @@
1037
  }
1038
 
1039
  function copySummary() {
1040
- const summaryText = document.getElementById('summary-text').innerText;
1041
- const tempTextarea = document.createElement('textarea');
1042
- tempTextarea.value = summaryText;
1043
- document.body.appendChild(tempTextarea);
1044
- tempTextarea.select();
1045
- document.execCommand('copy');
1046
- document.body.removeChild(tempTextarea);
1047
-
1048
- const btn = event.target;
1049
- const originalText = btn.textContent;
1050
- btn.textContent = 'تم النسخ!';
1051
- setTimeout(() => btn.textContent = originalText, 2000);
 
 
 
 
 
1052
  }
1053
 
1054
  // Element SDK Integration
 
13
  <link rel="stylesheet" href="/css/tokens.css">
14
  <link rel="stylesheet" href="/css/base.css">
15
  <link rel="stylesheet" href="/css/components.css">
16
+
 
 
17
  <style>@view-transition { navigation: auto; }</style>
18
  <script src="/js/vendor/supabase.min.js"></script>
19
  <script src="/js/auth/config.js"></script>
 
163
  </div>
164
  <h1 id="hero-headline" class="text-5xl lg:text-7xl font-bold leading-tight mb-6" style="line-height: 1.3;">اكتب العربية<br><span class="text-gradient">بثقة واحتراف</span></h1>
165
  <p id="hero-subheadline" class="text-xl lg:text-2xl leading-relaxed mb-10" style="color: var(--text-secondary); line-height: 1.9;">مساعد ذكي يصحح الإملاء والنحو وعلامات الترقيم ويُلخّص النصوص العربية بدقة عالية.</p>
166
+ <div class="flex flex-col sm:flex-row gap-4 justify-center lg:justify-start mb-12"><button id="hero-cta-primary" onclick="showPage('editor')" class="px-8 py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl"> جربه الآن مجاناً </button> <button onclick="showPage('features')" class="px-8 py-4 rounded-2xl text-lg font-bold transition-all hover:scale-105 border-2" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> استكشف الميزات </button>
167
  </div><!-- Stats -->
168
  <div class="flex items-center gap-8 justify-center lg:justify-start">
169
  <div class="text-center">
170
  <div class="text-3xl font-bold text-gradient">
 
 
 
 
 
 
 
 
171
  <div class="text-3xl font-bold text-gradient">
172
  ٩٩٪
173
  </div>
 
196
  </div><span class="text-sm" style="color: var(--text-secondary);">محرر بيان</span>
197
  <div class="w-20"></div>
198
  </div><!-- Mock Editor Content -->
199
+ <div class="p-8 editor-content text-right text-lg" dir="rtl" style="background: var(--surface-color); color: var(--text-color); min-height: 300px;">
200
  <p class="mb-4">مرحباً بكم في <span class="spelling-error">محرر بيان</span> للكتابة العربية<span class="punctuation-suggestion">.</span></p>
201
  <p class="mb-4">نحن <span class="grammar-error">نساعدك</span> على كتابة نصوص عربية صحيحة وواضحة بفضل الذكاء الاصطناعي المتقدم<span class="punctuation-suggestion">.</span></p>
202
  <p>جرّب المحرر الآن وشاهد كيف يمكن أن تصبح كتابتك أفضل!</p>
 
217
  </div>
218
  </div>
219
  </div><!-- Floating Suggestion Card -->
220
+ <div class="absolute -bottom-6 -left-6 p-4 rounded-2xl shadow-xl animate-fade-in" style="background: var(--surface-color); border: 1px solid rgba(34, 197, 94, 0.3); max-width: 280px;">
221
  <div class="flex items-start gap-3">
222
  <div class="w-10 h-10 rounded-xl flex items-center justify-center" style="background: rgba(34, 197, 94, 0.15);"><span style="color: #22c55e; font-size: 20px;">✓</span>
223
  </div>
 
423
  مقالة طويلة تتحدث عن أهمية التكنولوجيا في العصر الحديث وتأثيرها على المجتمع...
424
  </div>
425
  <div class="flex items-center justify-center my-4">
426
+ <svg class="w-8 h-8" style="color: var(--secondary-color);" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3" />
427
  </svg>
428
  </div>
429
  <div class="text-lg p-4 rounded-xl editor-content" style="background: rgba(139, 92, 246, 0.1); border-right: 4px solid #8b5cf6; line-height: 2;">
 
759
  </div>
760
  <ul class="space-y-4 mb-8">
761
  <li class="flex items-center gap-3">
762
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
763
  </svg><span class="text-base">تدقيق إملائي أساسي</span></li>
764
  <li class="flex items-center gap-3">
765
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
766
  </svg><span class="text-base">٥٠٠ كلمة يوميًا</span></li>
767
  <li class="flex items-center gap-3">
768
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
769
  </svg><span class="text-base">محرر ويب</span></li>
770
  <li class="flex items-center gap-3">
771
+ <svg class="w-5 h-5" style="color: rgba(241, 245, 249, 0.2);" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
772
  </svg><span class="text-base" style="color: var(--text-secondary);">اقتراحات نحوية</span></li>
773
  <li class="flex items-center gap-3">
774
+ <svg class="w-5 h-5" style="color: rgba(241, 245, 249, 0.2);" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
775
  </svg><span class="text-base" style="color: var(--text-secondary);">تلخيص النصوص</span></li>
776
+ </ul><button onclick="showPage('editor')" class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> ابدأ مجانًا </button>
777
  </div><!-- Pro Plan (Most Popular) -->
778
  <div class="p-8 rounded-3xl transition-all hover:scale-105 relative shadow-2xl" style="background: linear-gradient(165deg, var(--surface-color) 0%, rgba(59, 130, 246, 0.1) 100%); border: 2px solid var(--primary-color);">
779
  <div class="pricing-badge gradient-accent text-white">
 
795
  </div>
796
  <ul class="space-y-4 mb-8">
797
  <li class="flex items-center gap-3">
798
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
799
  </svg><span class="text-base">تدقيق إملائي ونحوي متقدم</span></li>
800
  <li class="flex items-center gap-3">
801
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
802
  </svg><span class="text-base">كلمات غي�� محدودة</span></li>
803
  <li class="flex items-center gap-3">
804
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
805
  </svg><span class="text-base">تصحيح علامات الترقيم</span></li>
806
  <li class="flex items-center gap-3">
807
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
808
  </svg><span class="text-base">تلخيص النصوص بالذكاء الاصطناعي</span></li>
809
  <li class="flex items-center gap-3">
810
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
811
  </svg><span class="text-base">إضافة المتصفح</span></li>
812
+ </ul><button onclick="showPage('editor')" class="w-full py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl"> الترقية للاحترافي </button>
813
  </div><!-- Enterprise Plan -->
814
  <div class="p-8 rounded-3xl transition-all hover:scale-105" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
815
  <div class="text-center mb-8">
 
828
  </div>
829
  <ul class="space-y-4 mb-8">
830
  <li class="flex items-center gap-3">
831
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
832
  </svg><span class="text-base">كل ميزات الاحترافي</span></li>
833
  <li class="flex items-center gap-3">
834
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
835
  </svg><span class="text-base">إدارة الفرق</span></li>
836
  <li class="flex items-center gap-3">
837
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
838
  </svg><span class="text-base">واجهة برمجية (API)</span></li>
839
  <li class="flex items-center gap-3">
840
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
841
  </svg><span class="text-base">تكامل مخصص</span></li>
842
  <li class="flex items-center gap-3">
843
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
844
  </svg><span class="text-base">دعم فني ذو أولوية</span></li>
845
  </ul><button class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> تواصل مع المبيعات </button>
846
  </div>
 
917
  }
918
  }
919
 
920
+
 
 
 
 
 
921
 
922
  // Summarization functions
923
  function updateSummaryLength() {
 
1022
  }
1023
 
1024
  function copySummary() {
1025
+ const text = document.getElementById('summary-text').innerText;
1026
+ navigator.clipboard.writeText(text).then(() => {
1027
+ const btn = document.querySelector('[onclick="copySummary()"]');
1028
+ if (btn) {
1029
+ const originalText = btn.textContent;
1030
+ btn.textContent = 'تم النسخ!';
1031
+ setTimeout(() => btn.textContent = originalText, 2000);
1032
+ }
1033
+ }).catch(() => {
1034
+ // Fallback for older browsers
1035
+ const ta = document.createElement('textarea');
1036
+ ta.value = text;
1037
+ document.body.appendChild(ta);
1038
+ ta.select();
1039
+ document.execCommand('copy');
1040
+ document.body.removeChild(ta);
1041
+ });
1042
  }
1043
 
1044
  // Element SDK Integration
src/js/editor.js CHANGED
@@ -457,6 +457,11 @@ function applyAllSuggestions() {
457
  }
458
 
459
  function clearEditor() {
 
 
 
 
 
460
  setEditorHTML('');
461
  window.currentSuggestions = [];
462
  updateSuggestionCounts(0, 0, 0);
 
457
  }
458
 
459
  function clearEditor() {
460
+ // Don't prompt if editor is already empty
461
+ const text = getEditorText();
462
+ if (text.trim().length > 0) {
463
+ if (!confirm('هل أنت متأكد من مسح كل المحتوى؟')) return;
464
+ }
465
  setEditorHTML('');
466
  window.currentSuggestions = [];
467
  updateSuggestionCounts(0, 0, 0);