stat2025 commited on
Commit
45d6699
·
verified ·
1 Parent(s): abe46a1

Delete script.js

Browse files
Files changed (1) hide show
  1. script.js +0 -166
script.js DELETED
@@ -1,166 +0,0 @@
1
- const DATA = [{"name": "أروى سعيد بن عبدالله القحطاني", "url": "https://stat2025-map.static.hf.space/BCS/37.html"}, {"name": "أسماء درويش سالم الدوسري", "url": "https://stat2025-map.static.hf.space/BCS/15.html"}, {"name": "أمل احمد محمد مجرشي", "url": "https://stat2025-map.static.hf.space/BCS/28.html"}, {"name": "أمل بنت علي بن علي السماعيل", "url": "https://stat2025-map.static.hf.space/BCS/07.html"}, {"name": "أمل جعفر بن علي آل حماد", "url": "https://stat2025-map.static.hf.space/BCS/30.html"}, {"name": "أمل صالح بن احمد آل مزعل", "url": "https://stat2025-map.static.hf.space/BCS/47.html"}, {"name": "ابرار بنت يوسف بن علي آل حماد", "url": "https://stat2025-map.static.hf.space/BCS/44.html"}, {"name": "احلام صالح معيوض العصيمي", "url": "https://stat2025-map.static.hf.space/BCS/16.html"}, {"name": "اسعد بن ماجد بن احمد الهاشم", "url": "https://stat2025-map.static.hf.space/BCS/46.html"}, {"name": "اسماء بنت محمد بن حسين العدساني", "url": "https://stat2025-map.static.hf.space/BCS/09.html"}, {"name": "ايمان عبدالعزيز بن صالح الصالح", "url": "https://stat2025-map.static.hf.space/BCS/40.html"}, {"name": "باسمه احمد بن محمد القرني", "url": "https://stat2025-map.static.hf.space/BCS/21.html"}, {"name": "باقر عبدالله بن هاشم الهاشم", "url": "https://stat2025-map.static.hf.space/BCS/11.html"}, {"name": "تركي وحيد بن عيسى المحيفيظ", "url": "https://stat2025-map.static.hf.space/BCS/01.html"}, {"name": "حسن عادل بن حسين الوصيبعي", "url": "https://stat2025-map.static.hf.space/BCS/03.html"}, {"name": "زكي بن عيسى بن عبدالله القفاص", "url": "https://stat2025-map.static.hf.space/BCS/51.html"}, {"name": "زهراء بنت عايش بن علي الصاهود", "url": "https://stat2025-map.static.hf.space/BCS/33.html"}, {"name": "ساره خالد سليمان المحيسن", "url": "https://stat2025-map.static.hf.space/BCS/35.html"}, {"name": "ساره راشد عبدالله المديني", "url": "https://stat2025-map.static.hf.space/BCS/34.html"}, {"name": "ساره عبدالحميد بن حسين البوحمد", "url": "https://stat2025-map.static.hf.space/BCS/12.html"}, {"name": "سميه رياض بن عبدالله البراك", "url": "https://stat2025-map.static.hf.space/BCS/39.html"}, {"name": "سميه سامى بن احمد النعيم", "url": "https://stat2025-map.static.hf.space/BCS/05.html"}, {"name": "شريفه ابراهيم بن عبدالله العقيل", "url": "https://stat2025-map.static.hf.space/BCS/41.html"}, {"name": "شيماء عبدالرحمن بن دحباش سودي", "url": "https://stat2025-map.static.hf.space/BCS/19.html"}, {"name": "صالح دلي الشمري", "url": "https://stat2025-map.static.hf.space/BCS/48.html"}, {"name": "طيبه فالح بن عبدالله الرويشد", "url": "https://stat2025-map.static.hf.space/BCS/31.html"}, {"name": "عائشه سليمان بن نايف الحربي", "url": "https://stat2025-map.static.hf.space/BCS/13.html"}, {"name": "عبدالله خلف الجدعان", "url": "https://stat2025-map.static.hf.space/BCS/49.html"}, {"name": "عقيله محمدحسين بن علي الجباره", "url": "https://stat2025-map.static.hf.space/BCS/06.html"}, {"name": "علياء فيصل بن محمد الكثيري", "url": "https://stat2025-map.static.hf.space/BCS/36.html"}, {"name": "غدير عبدالعزيز بن سعد القاسم", "url": "https://stat2025-map.static.hf.space/BCS/38.html"}, {"name": "فارس ثاني الشمري", "url": "https://stat2025-map.static.hf.space/BCS/50.html"}, {"name": "فاطمه حسين بن ابراهيم القرقوش", "url": "https://stat2025-map.static.hf.space/BCS/45.html"}, {"name": "فايزه محمد مسعود الحازمي", "url": "https://stat2025-map.static.hf.space/BCS/32.html"}, {"name": "فيصل تركي فيصل القحطاني", "url": "https://stat2025-map.static.hf.space/BCS/18.html"}, {"name": "لطيفه صالح بن عبدالرحمن العبد القادر", "url": "https://stat2025-map.static.hf.space/BCS/25.html"}, {"name": "لطيفه علي بن حسين النعيم", "url": "https://stat2025-map.static.hf.space/BCS/29.html"}, {"name": "لين أحمد بن عبدالعزيز القصير", "url": "https://stat2025-map.static.hf.space/BCS/22.html"}, {"name": "محمد دبيان بن مفرج الشمري", "url": "https://stat2025-map.static.hf.space/BCS/27.html"}, {"name": "مرتضى عبدالجليل بن عيسى الحكيم", "url": "https://stat2025-map.static.hf.space/BCS/43.html"}, {"name": "مصطفى احمد بن جمعه الرمضان", "url": "https://stat2025-map.static.hf.space/BCS/10.html"}, {"name": "ممدوح مشعل ضيف الله الصخري", "url": "https://stat2025-map.static.hf.space/BCS/26.html"}, {"name": "منيره سعد بن احمد الجديدي", "url": "https://stat2025-map.static.hf.space/BCS/04.html"}, {"name": "منيره سعود بن عبدالعزيز القوز", "url": "https://stat2025-map.static.hf.space/BCS/42.html"}, {"name": "نبأ عادل بن عبدالكريم آل رضوان", "url": "https://stat2025-map.static.hf.space/BCS/23.html"}, {"name": "نجود عبدالعزيز بن عقيل العمري", "url": "https://stat2025-map.static.hf.space/BCS/20.html"}, {"name": "نوره عبدالله بن زهير الرزقي", "url": "https://stat2025-map.static.hf.space/BCS/24.html"}, {"name": "نوره عبدالله بن مانع الخالدي", "url": "https://stat2025-map.static.hf.space/BCS/02.html"}, {"name": "نوف صالح بن محمد السميح", "url": "https://stat2025-map.static.hf.space/BCS/08.html"}, {"name": "نيللي حسين عبدالله الجعص", "url": "https://stat2025-map.static.hf.space/BCS/17.html"}, {"name": "وضحه خالد بن مشرف الخالدي", "url": "https://stat2025-map.static.hf.space/BCS/14.html"}];
2
-
3
- function normalizeArabic(s) {
4
- if (!s) return "";
5
- return String(s)
6
- .trim()
7
- .toLowerCase()
8
- .replace(/[\u064B-\u065F\u0670\u06D6-\u06ED]/g, "")
9
- .replace(/\u0640/g, "")
10
- .replace(/[إأآٱ]/g, "ا")
11
- .replace(/ى/g, "ي")
12
- .replace(/ة/g, "ه")
13
- .replace(/\s+/g, " ");
14
- }
15
-
16
- function escapeHtml(str) {
17
- return String(str)
18
- .replaceAll("&", "&")
19
- .replaceAll("<", "&lt;")
20
- .replaceAll(">", "&gt;")
21
- .replaceAll('"', "&quot;")
22
- .replaceAll("'", "&#039;");
23
- }
24
-
25
- function highlightMatch(name, rawQuery) {
26
- if (!rawQuery) return escapeHtml(name);
27
- const tokens = rawQuery.trim().split(/\s+/).filter(Boolean);
28
- if (!tokens.length) return escapeHtml(name);
29
-
30
- const t = tokens[0];
31
- const idx = name.indexOf(t);
32
- if (idx === -1) return escapeHtml(name);
33
-
34
- const before = escapeHtml(name.slice(0, idx));
35
- const mid = escapeHtml(name.slice(idx, idx + t.length));
36
- const after = escapeHtml(name.slice(idx + t.length));
37
- return `${before}<mark>${mid}</mark>${after}`;
38
- }
39
-
40
- const elQ = document.getElementById("q");
41
- const elResults = document.getElementById("results");
42
- const elCount = document.getElementById("countPill");
43
- const elTotal = document.getElementById("totalChip");
44
- const toast = document.getElementById("toast");
45
-
46
- elTotal.innerHTML = `إجمالي: <b>${DATA.length}</b>`;
47
-
48
- function showToast() {
49
- toast.classList.add("show");
50
- clearTimeout(window.__toastT);
51
- window.__toastT = setTimeout(() => toast.classList.remove("show"), 1200);
52
- }
53
-
54
- async function copyLink(url) {
55
- try {
56
- await navigator.clipboard.writeText(url);
57
- showToast();
58
- } catch (e) {
59
- const ta = document.createElement("textarea");
60
- ta.value = url;
61
- document.body.appendChild(ta);
62
- ta.select();
63
- document.execCommand("copy");
64
- document.body.removeChild(ta);
65
- showToast();
66
- }
67
- }
68
-
69
- function renderResults(list, rawQuery) {
70
- elResults.innerHTML = "";
71
-
72
- if (!list.length) {
73
- elCount.textContent = "النتائج: 0";
74
- elResults.innerHTML = `<div class="empty">لا توجد نتائج</div>`;
75
- return;
76
- }
77
-
78
- elCount.textContent = `النتائج: ${list.length}`;
79
- const frag = document.createDocumentFragment();
80
-
81
- list.forEach(item => {
82
- const row = document.createElement("div");
83
- row.className = "result";
84
-
85
- const left = document.createElement("div");
86
- left.className = "left";
87
-
88
- const nm = document.createElement("div");
89
- nm.className = "name";
90
- nm.innerHTML = highlightMatch(item.name, rawQuery);
91
-
92
- left.appendChild(nm);
93
-
94
- const actions = document.createElement("div");
95
- actions.className = "actions";
96
-
97
- const open = document.createElement("a");
98
- open.className = "openBtn";
99
- open.href = item.url;
100
- open.target = "_blank";
101
- open.rel = "noopener";
102
- open.innerHTML = `فتح <span aria-hidden="true">↗</span>`;
103
-
104
- const copy = document.createElement("button");
105
- copy.className = "copyBtn";
106
- copy.type = "button";
107
- copy.innerHTML = `نسخ <span aria-hidden="true">⧉</span>`;
108
- copy.addEventListener("click", () => copyLink(item.url));
109
-
110
- actions.appendChild(open);
111
- actions.appendChild(copy);
112
-
113
- row.appendChild(left);
114
- row.appendChild(actions);
115
- frag.appendChild(row);
116
- });
117
-
118
- elResults.appendChild(frag);
119
- }
120
-
121
- function doSearch() {
122
- const raw = (elQ.value || "").trim();
123
- const q = normalizeArabic(raw);
124
-
125
- if (!q) {
126
- elCount.textContent = "النتائج: 0";
127
- elResults.innerHTML = "";
128
- return;
129
- }
130
-
131
- const tokens = q.split(" ").filter(Boolean);
132
-
133
- const matched = DATA.filter(d => {
134
- const nameNorm = normalizeArabic(d.name);
135
- return tokens.every(t => nameNorm.includes(t));
136
- });
137
-
138
- matched.sort((a, b) => {
139
- const al = (a.name || "").length;
140
- const bl = (b.name || "").length;
141
- if (al !== bl) return al - bl;
142
- return (a.name || "").localeCompare(b.name || "", "ar");
143
- });
144
-
145
- renderResults(matched, raw);
146
- }
147
-
148
- document.getElementById("btnSearch").addEventListener("click", doSearch);
149
- document.getElementById("btnClear").addEventListener("click", () => {
150
- elQ.value = "";
151
- elQ.focus();
152
- elResults.innerHTML = "";
153
- elCount.textContent = "النتائج: 0";
154
- });
155
-
156
- let t = null;
157
- elQ.addEventListener("input", () => {
158
- clearTimeout(t);
159
- t = setTimeout(doSearch, 140);
160
- });
161
-
162
- elQ.addEventListener("keydown", (e) => {
163
- if (e.key === "Enter") doSearch();
164
- });
165
-
166
- elCount.textContent = "النتائج: 0";