-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
628 lines (583 loc) · 40.8 KB
/
Copy pathindex.html
File metadata and controls
628 lines (583 loc) · 40.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>أدوات السحب للإشارات المرجعية</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cdefs%3E%3ClinearGradient id='g' gradientUnits='userSpaceOnUse' x1='300' y1='200' x2='300' y2='400'%3E%3Cstop offset='0%25' stop-color='rgb(255,255,153)'/%3E%3Cstop offset='100%25' style='stop-color:rgb(58.655%25 46.489%25 0%)'/%3E%3C/linearGradient%3E%3Cfilter id='glow'%3E%3CfeGaussianBlur stdDeviation='12' result='blur'/%3E%3CfeMerge%3E%3CfeMergeNode in='blur'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M344.328 55.54C355.646 64.589 364.715 76.554 366.953 91.228 367.83 100.373 342.887 146.626 344.953 141.228 347.498 152.581 478.995 154.617 482.133 156.618 482.692 157.232 451.532 242.594 451.891 279.853 451.898 281.216 492.906 276.915 506.57 282.911 520.272 290.481 540.89 341.663 531.117 359.775 525.12 369.363 152.807 295.672 158.31 289.136 170.129 272.624 157.36 233.634 149.953 226.228 137.105 224.562 94.412 234.665 91.141 228.103 79.193 198.879 112.621 107.83 121.953 95.228 128.607 95.733 209.971 126.579 255.395 127.634 257.243 126.202 244.006 83.056 248.918 68.638 253.515 57.935 323.851 40.818 344.328 55.54Z' fill='%23FE9500'/%3E%3Cpath d='M162.352 276.689C178.677 278.042 523.246 356.134 532.264 357.775 530.747 365.276 521.996 375.079 509.363 390.143 501.806 398.002 447.728 378.014 441.835 379.036 434.404 381.348 414.604 471.037 423.248 508.11 424.191 512.286 298.415 523.843 271.715 499.689 270.516 498.729 293.029 463.934 294.582 456.689 296.039 442.355 272.933 408.18 264.756 405.689 263.972 405.445 229.881 403.111 216.405 411.165 215.628 411.668 200.792 428.904 199.138 437.689 197.77 448.408 207.829 486.983 203.799 488.439 163.869 500.84 61.202 453.079 58.954 449.689 58.471 447.351 55.905 326.77 74.861 303.689 79.103 299.801 119.757 321.4 129.454 321.087 138.071 319.969 159.742 288.333 162.352 276.689Z' fill='%231F82BF'/%3E%3Cellipse cx='300' cy='300' rx='103' ry='100' transform='rotate(12 300 300)' fill='url(%23g)' style='mix-blend-mode:screen; opacity:0.95; filter:url(%23glow)'/%3E%3C/svg%3E">
<script>
document.addEventListener('DOMContentLoaded', () => {
// حفظ واستعادة الموقع الحالي
function saveCaretPosition(context) {
const sel = window.getSelection();
if (sel.rangeCount === 0) return null;
const range = sel.getRangeAt(0);
const preRange = range.cloneRange();
preRange.selectNodeContents(context);
preRange.setEnd(range.startContainer, range.startOffset);
return {
start: preRange.toString().length,
end: preRange.toString().length + range.toString().length
};
}
function restoreCaretPosition(context, pos) {
if(!pos)return;
const sel = window.getSelection();
const range = document.createRange();
let charIndex = 0;
let foundStart = false;
let nodeStack = [context];
let node;
while (!foundStart && (node = nodeStack.pop())) {
if (node.nodeType === Node.TEXT_NODE) {
const nextCharIndex = charIndex + node.length;
if (pos.start >= charIndex && pos.start <= nextCharIndex) {
range.setStart(node, pos.start - charIndex);
foundStart = true;
}
charIndex = nextCharIndex;
} else {
let i = node.childNodes.length;
while (i--) nodeStack.push(node.childNodes[i]);
}
}
charIndex = 0;
nodeStack = [context];
let foundEnd = false;
while (!foundEnd && (node = nodeStack.pop())) {
if (node.nodeType === Node.TEXT_NODE) {
const nextCharIndex = charIndex + node.length;
if (pos.end >= charIndex && pos.end <= nextCharIndex) {
range.setEnd(node, pos.end - charIndex);
foundEnd = true;
}
charIndex = nextCharIndex;
} else {
let i = node.childNodes.length;
while (i--) nodeStack.push(node.childNodes[i]);
}
}
sel.removeAllRanges();
sel.addRange(range);
}
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// تنسيق وتلوين الكود
const code = document.getElementById('custom-code');
const colors = ['highlight1', 'highlight2', 'highlight3', 'highlight4', 'highlight5', 'highlight6'];
function escapeHtml(text) {
const map = {'&': '&', '<': '<', '>': '>', '"': '"', "'": '''};
return text.replace(/[&<>"']/g, m => map[m]);
}
function fixHeight() {code.style.height = '', code.style.height = code.scrollHeight + 'px'}
function highlightText() {
const pos = saveCaretPosition(code);
const text = code.textContent;
let colorIndex = 0;
const html = text.replace(/(?<!\.)\*\/([\s\S]*?)\/\*/g, (match, content) => {
if (/^\s*$/.test(content)) return match;
const colorClass = colors[colorIndex % colors.length];
colorIndex++;
return `*/<span class="${colorClass}">${escapeHtml(content)}<br><span class="codeDelete-btn"></span></span>/*`;
}).replace(/\/\*[\s\S]*?\*\//g, (match) => match.endsWith('.*/') ? ' ' + match + ' ' :
'<hr style="border:none;margin:0;"><span class="comment-green" dir="auto"> ' + escapeHtml(match) + ' </span><br>'
);
code.innerHTML = html;
restoreCaretPosition(code, pos);
fixHeight();
}
code.addEventListener('input', highlightText);
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// وظائف التراجع والتقدم
const undoStack = [], redoStack = [];
let lastContent = '';
function Undo(){
if(!undoStack.length) return code.innerHTML = "";
const html = code.innerHTML, pos = saveCaretPosition(code);
redoStack.push({html, pos});
lastContent = code.textContent;
const previousState = undoStack.pop();
code.innerHTML = previousState.html;
restoreCaretPosition(code, previousState.pos);
}
function Redo(){
const html = code.innerHTML, pos = saveCaretPosition(code);
undoStack.push({html, pos});
lastContent = code.textContent;
const nextState = redoStack.pop();
code.innerHTML = nextState.html;
restoreCaretPosition(code, nextState.pos);
}
document.addEventListener('keydown', (e) => {
if (e.target !== code) return;
// التحقق من أن المستخدم يضغط Ctrl (Windows) أو Command (Mac)
const isModifierKey = e.ctrlKey || e.metaKey;
// Undo
if (isModifierKey && e.code === 'KeyZ' && !e.shiftKey) {
e.preventDefault(), Undo(), fixHeight();
}
// Redo
if (isModifierKey && e.code === 'KeyZ' && e.shiftKey && redoStack.length > 0) {
e.preventDefault(), Redo(), fixHeight();
}
});
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// حفظ الحالة قبل الإدخال
function saveState(){
if (code.textContent !== lastContent) {
const currentState = {html: code.innerHTML, pos: saveCaretPosition(code)};
undoStack.push(currentState);
lastContent = code.textContent;
redoStack.length = 0; // مسح مكدس الإعادة
}
}
code.addEventListener('beforeinput', (e) => {
// تجاهل الأحداث التي لا تغير المحتوى (مثل الأسهم)
if (e.inputType.startsWith('delete') || e.inputType === 'insertText') {
saveState()
}
});
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// عرض الرسالة العائمة
let messageTimeout;
function showFloatingMessage(msg) {
const floatingMsg = document.getElementById('floating-message');
floatingMsg.innerHTML = `${msg} <button class="undo-btn">تراجع</button>`;
const undoBtn = floatingMsg.querySelector('.undo-btn');
undoBtn.addEventListener('click', undoLastAction);
floatingMsg.style.display = 'block';
clearTimeout(messageTimeout);
messageTimeout = setTimeout(() => {
floatingMsg.style.display = 'none';
}, 2000);
}
// وظيفة التراجع في الرسالة العائمة
function undoLastAction() {
Undo(), fixHeight();
document.getElementById('floating-message').style.display = 'none';
clearTimeout(messageTimeout);
}
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// حذف القسم الملون
code.addEventListener('click', (e) => {
const deleteBtn = e.target.closest('.codeDelete-btn');
if (deleteBtn) {
saveState()
deleteBtn.parentElement.remove();
showFloatingMessage('تم حذف هذا القسم')
fixHeight();
}
});
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// معالجة النقر العادي والمزدوج علي الروابط
let clickTimer = null;
let lastClickTime = 0;
function handleClick(e) {
e.preventDefault();
e.stopImmediatePropagation();
const now = Date.now();
const isDoubleClick = (now - lastClickTime) < 300;
if (isDoubleClick) {
// معالجة النقر المزدوج
clearTimeout(clickTimer);
addTocode(e.target);
} else {
// بدء مؤقت للنقر العادي
clickTimer = setTimeout(() => {
executeCode(e.target);
}, 300);
}
lastClickTime = now;
}
// إضافة إلى code
function addTocode(target) {
const rawCode = ((code.textContent===''||code.textContent.endsWith(';'))?'':';') + target.getAttribute('href').replace('javascript:', '');
saveState()
const pos = saveCaretPosition(code);
code.textContent += rawCode;
restoreCaretPosition(code, pos);
highlightText()
showFloatingMessage('تم إضافة الكود إلى المحرر بالاسفل');
}
// تنفيذ الكود
function executeCode(target) {
try {
const rawCode = target.getAttribute('href').replace('javascript:', '');
new Function(rawCode)();
} catch(err) {
console.error('Error:', err);
}
}
// تهيئة النقر علي الروابط
document.querySelectorAll('.bookmarklet').forEach(link => {
link.addEventListener('click', handleClick);
});
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// النقر علي القوالب
// إضافة القالب إلى code
function addTemplate(e) {
e.preventDefault();
const template = e.target.getAttribute('template');
saveState()
code.focus()
const pos = saveCaretPosition(code);
code.textContent += template;
restoreCaretPosition(code, pos);
highlightText()
showFloatingMessage('تم إضافة القالب إلى المحرر');
}
document.querySelectorAll('.template').forEach(template => {
template.addEventListener('mousedown', addTemplate);
});
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// تخزين وإضافة الاكواد المخصصة
const customCodes = JSON.parse(localStorage.getItem('customCodes') || '[]');
const customList = document.getElementById('custom-list');
const renderCustomCodes = () => {
customList.innerHTML = '';
customCodes.forEach((customCode, index) => {
const btn = document.createElement('a');
btn.className = 'bookmarklet';
// btn.setAttribute('href', 'javascript:' + customCode.c);
btn.href = 'javascript:' + customCode.c;
btn.draggable = true;
btn.textContent = customCode.n;
btn.addEventListener('click', handleClick);
const deleteBtn = document.createElement('span');
deleteBtn.title = 'حذف';
deleteBtn.className = 'delete-btn';
deleteBtn.onclick = (e) => {
e.preventDefault();
customCodes.splice(index, 1);
localStorage.setItem('customCodes', JSON.stringify(customCodes));
renderCustomCodes();
};
const editBtn = document.createElement('span');
editBtn.title = 'تعديل';
editBtn.className = 'edit-btn';
editBtn.onclick = (e) => {
e.preventDefault();
const newName = prompt('اسم جديد للكود:', customCode.n);
const newCode = prompt('كود جديد:', customCode.c);
if (newName && newCode) {
customCodes[index] = {n: newName, c: newCode};
localStorage.setItem('customCodes', JSON.stringify(customCodes));
renderCustomCodes();
}
};
btn.appendChild(deleteBtn);
btn.appendChild(editBtn);
customList.appendChild(btn);
});
};
renderCustomCodes();
document.getElementById('add-btn').onclick = () => {
const n = document.getElementById('custom-name').value.trim(), c = code.textContent.trim();
if (!c) return alert('لا يمكن الإضافة بدون كود');
if (!n) return alert('يجب تسمية الكود');
customCodes.push({n, c});
localStorage.setItem('customCodes', JSON.stringify(customCodes));
renderCustomCodes();
document.getElementById('custom-name').value = '';
code.textContent = '';
undoStack.length = 0, redoStack.length = 0;
fixHeight();
};
/**//**//**//**//**//**//**//**//**//**//**//**//**//**/
// إتاحة توسيط الكود في المحرر
document.querySelectorAll('input[name="text-align"]').forEach(radio => {
radio.addEventListener('change', (e) => {
code.style.textAlign = e.target.value;
});
});
});
</script>
<style>
body {
background: #e5c4815f;
text-align: center;
padding-top: 50px;
}
h2 {
position: fixed;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
z-index: 999;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
h3, h2 {
padding: 0.5em;
background: #e3f2fd6e;
margin: auto;
margin-bottom: inherit;
box-shadow: 0 2px 8px rgba(0, 66, 153, 0.5);
border-radius: 10px;
}
h5 {
margin-top: 0.1em;
margin-bottom: 0.4em;
}
.section, .floating-msg {
background: rgba(0, 223, 255, 0.15);
backdrop-filter: blur(2px);
-webkit-backdrop-filter: blur(2px);
border-radius: 10px;
padding: 1em;
margin: 1em auto;
max-width: 600px;
box-shadow: 0 2px 8px rgba(0, 66, 153, 0.5);
border: 1px solid rgba(255, 255, 255, 0.2);
}
.bookmarklet {
display: inline-block;
padding-bottom: 0.2em;
padding-top: 0.2em;
padding-right: 0.8em;
padding-left: 0.8em;
margin: 0.5em;
border: 2px dashed #42a5f5;
border-radius: 10px;
background: #e3f2fd;
color: #0277bd;
text-decoration: none;
font-weight: bold;
position: relative;
cursor: grab;
box-shadow: 0 2.4px 5px rgba(0, 0, 0, 0.16);
}
.template {
/*user-select: none;
-webkit-user-select: none; /* سفاري *./
-moz-user-select: none; /* فايرفوكس *./
-ms-user-select: none; /* إنترنت إكسبلورر او إيدج القديم */
display: inline-block;
padding-bottom: 0.2em;
padding-top: 0.2em;
padding-right: 0.8em;
padding-left: 0.8em;
margin: 0.5em;
border: 1px solid #42a5f5;
box-shadow: 0 2px 8px rgba(0, 66, 153, 0.5);
border-radius: 10px;
background: #e3f2fd;
color: #0277bd;
text-decoration: none;
font-weight: bold;
position: relative;
cursor: pointer;
}
.bookmarklet:hover, .template:hover {
background: #bbdefb;
}
.delete-btn::before, .edit-btn::before {
position: absolute;
top: -8px;
font-size: 0.8em;
cursor: pointer;
padding: 0px;
width: 16px;
height: 16px;
text-align: center;
border-radius: 50%;
}
.delete-btn::before {
left: -4px;
background: #ffcdd2;
color: #b71c1c;
content: "×";
}
.edit-btn::before {
right: -4px;
background: #fdd309;
color: #1f2528;
content: "𝙸";
}
#custom-code {
min-height: 60px;
padding: 10px;
box-sizing: border-box;
font-family: monospace;
background-color: white !important;
color: #000000 !important;
border: 1px solid;
margin-bottom: 10px;
font-size: 1.1em;
text-align: left;
}
#custom-code:empty::before {
content: "اكتب الكود هنا";
font-family:inherit;
color: #999;
pointer-events: none;
font-weight: bold;
}
input[type="text"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
box-sizing: border-box;
text-align: center;
font-size: 1.1em;
border: 1px solid;
}
button, .add-btn {
padding: 5px 10px;
background: #42a5f5;
color: white;
border-radius: 8px;
cursor: pointer;
font-size: 1.2em;
margin-bottom: 10px;
box-shadow: 0 2px 8px rgba(0, 66, 153, 0.5);
border: 1px solid #0277bd;
}
.highlight1 {background-color: #ffcccc !important;}
.highlight2 {background-color: #ffffcc !important;}
.highlight3 {background-color: #ccccff !important;}
.highlight4 {background-color: #ccffcc !important;}
.highlight5 {background-color: #ffccff !important;}
.highlight6 {background-color: #ccffff !important;}
.highlight1, .highlight2, .highlight3, .highlight4, .highlight5, .highlight6 {
display: inline-block;
border-radius: 3px;
width: 100%;
color: #000000 !important;
border-bottom: solid;
border-right: solid;
border-left: solid rgba(0, 66, 153, 0.5);
/* text-align: center; */
}
/* @for $i from 1 through 6 {
.highlight#{$i} {
}
} */
/* [class^="highlight"] {
} */
/* [class*="highlight"] {
} */
.comment-green {
display: inline-block;
max-width: 100%;
margin-top: 1px;
background-color: #228B22 !important;
color: white !important;
}
.codeDelete-btn::before {
content: "حذف";
border-radius: 6px;
padding: 0 1%;
border: 1px solid #ccc;
background-color: #b71c1c;
color: white;
cursor: pointer;
}
.add-btn:hover {
background: #1e88e5;
}
.floating-msg {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
display: none;
z-index: 1000;
/* padding: 0.5em; */
}
.undo-btn {
border: none;
color: white;
padding: 5px 10px;
cursor: pointer;
background: #42a5f5;
border-radius: 8px;
font-size: 1em;
}
</style>
</head>
<body dir="rtl">
<svg xmlns="http://www.w3.org/2000/svg" style="position: fixed; top:0; left:0; width:100%; height:128%; z-index:-1; opacity: 0.9;" viewBox="50 50 490 600">
<defs><linearGradient gradientUnits="userSpaceOnUse" x1="300" y1="200" x2="300" y2="400" id="g"><stop offset="0" style="stop-color:rgb(99.608% 81.961% 0%)"/><stop offset="1" style="stop-color:rgb(58.655% 46.489% 0%)"/></linearGradient></defs>
<path d="M344.328 55.54C355.646 64.589 364.715 76.554 366.953 91.228 367.83 100.373 342.887 146.626 344.953 141.228 347.498 152.581 478.995 154.617 482.133 156.618 482.692 157.232 451.532 242.594 451.891 279.853 451.898 281.216 492.906 276.915 506.57 282.911 520.272 290.481 540.89 341.663 531.117 359.775 525.12 369.363 152.807 295.672 158.31 289.136 170.129 272.624 157.36 233.634 149.953 226.228 137.105 224.562 94.412 234.665 91.141 228.103 79.193 198.879 112.621 107.83 121.953 95.228 128.607 95.733 209.971 126.579 255.395 127.634 257.243 126.202 244.006 83.056 248.918 68.638 253.515 57.935 323.851 40.818 344.328 55.54Z" fill="#FE9500"/><path d="M162.352 276.689C178.677 278.042 523.246 356.134 532.264 357.775 530.747 365.276 521.996 375.079 509.363 390.143 501.806 398.002 447.728 378.014 441.835 379.036 434.404 381.348 414.604 471.037 423.248 508.11 424.191 512.286 298.415 523.843 271.715 499.689 270.516 498.729 293.029 463.934 294.582 456.689 296.039 442.355 272.933 408.18 264.756 405.689 263.972 405.445 229.881 403.111 216.405 411.165 215.628 411.668 200.792 428.904 199.138 437.689 197.77 448.408 207.829 486.983 203.799 488.439 163.869 500.84 61.202 453.079 58.954 449.689 58.471 447.351 55.905 326.77 74.861 303.689 79.103 299.801 119.757 321.4 129.454 321.087 138.071 319.969 159.742 288.333 162.352 276.689Z" fill="#1F82BF"/><ellipse cx="300" cy="300" rx="103" ry="100" transform="rotate(12 300 300)" style="fill: url(#g);mix-blend-mode: lighten;"/>
</svg>
<h2>برامج مصغره في المفضلة</h2>
<div class="section" style="position: relative; overflow: hidden; max-height: 66px; transition: max-height 0.5s;" data-expanded="false">
<h3>ما هو هذا الموقع؟ وكيف تستخدمه؟</h3>
<div class="toggle-content">
<h4>الهدف من الموقع</h4>
<div>أنشأت هذا الموقع بعد تجربة غير مرضية مع إضافات المتصفحات الشائعة، التي غالبًا ما تعاني من تسريب الذاكرة أو تتجسس على البيانات أو تؤدي وظائف غير ضرورية. لذلك بدأت بإنشاء إضافاتي الخاصة باستخدام إشارات مرجعية (Bookmarklets) بسيطة وآمنة. هذا الموقع يعرض تلك الإضافات، ويمكنك استعراض الكود بنفسك للتأكد من أنه يؤدي مهمة واحدة فقط، بوضوح وشفافية. كما يمكنك عرض كود أي إضافة بسهولة: فقط اضغط عليها ضغطتين متتاليتين، وسيظهر الكود تلقائيًا في المحرر بأسفل الصفحة.</div>
<hr><h4>طريقة الاستخدام</h4>
<ol style="text-align: justify;">
<li>اضغط على (Ctrl+Shift+B) أو (⌘+Shift+B) لإظهار شريط المفضلة.</li>
<li>اسحب الإضافة التي تريدها إلى شريط المفضلة.</li>
<li>عند زيارة أي موقع تريد استخدام الإضافة عليه، اضغط عليها من شريط المفضلة.</li>
<li>يمكنك عرض الكود الخاص بأي إضافة بالضغط عليها ضغطتين متتاليتين، وسيظهر في المحرر أسفل الصفحة.</li>
<li>في الموبايل، تأكد أولًا أن الإضافة متوافقة، ثم انسخ الكود واستبدل به صفحة "الصفحة الرئيسية" في المتصفح لتستخدمها بالضغط على زر الهوم.</li>
<li>يمكنك استخدام زر الهوم في اللابتوب أيضًا لتفعيل الإضافة بسرعة عبر Alt+Home في ويندوز أو ⌘+Shift+H في ماك. وأسهل طريقة لذلك هي سحب الإضافة إلى زر الهوم.</li>
</ol>
</div>
<div style="position: absolute; bottom: 0; left: 0; right: 0; text-align: center; background: linear-gradient(to top, white, transparent); font-size: 1.5em; font-weight: bold; cursor: pointer; padding: 5px;" onclick="
const section = this.parentElement;
const expanded = section.getAttribute('data-expanded') === 'true';
section.style.maxHeight = expanded ? '66px' : section.scrollHeight + 'px';
section.setAttribute('data-expanded', expanded ? 'false' : 'true');
this.textContent = expanded ? '∨' : '∧';
">∨</div>
</div>
<div class="section">
<h3>
<svg viewBox="529.8 336.3 29.2 21.1" width="29" height="20" style="vertical-align: middle;">
<path d="M556.8 355.6c2.6-2.8 2-15.4.2-17.3-2.7-1.9-22.3-1.8-24.9.2-2.3 2.2-2 14.9.1 17.0 1.9 2.2 21.1 1.5 24.6.1z" fill="#F03"></path>
<path d="m548.8 347-7.6-4.7v9.4z" fill="#FFF"></path>
</svg>
يوتيوب فقط
</h3>
<a href="javascript:window.cmb||(cmb=1,/*تخطي الإعلان تلقائيا*/(f=()=>document.querySelector('.ad-showing')?(movie_player.loadVideoByPlayerVars({videoId:movie_player.getVideoData().video_id,start:movie_player.getCurrentTime()}),console.log('تخطيناه')):console.log('لا إعلان'))(),new MutationObserver(f).observe(document.querySelector('#movie_player video.html5-main-video'),{attributes:true,attributeFilter:['src']}),/*تخطي الإعلان عن طريق الضغط علي انتر وإضهار زر التخطي قبل مرور المده (طبعا لكي يعمل يجب حذف التخطي التلقائي)*/(d=>{d.head.appendChild(d.createElement('style')).textContent='.ytp-skip-ad-button,.ytp-ad-skip-button-modern{display:flex!important;}';d.onkeydown=e=>e.key!=='Enter'||(d.querySelector('.ad-showing')&&(s=>(s?s.focus():(v=>(e.preventDefault(),v.currentTime=v.duration-0.1,v.play()))(d.querySelector('video[src]'))))(d.querySelector('.ytp-skip-ad-button,.ytp-ad-skip-button-modern')))})(document)/*.*/,addEventListener('yt-navigate-finish',async()=>{/*مزامنة سرعة الشورتس مع الفيديوهات العادية لمنع إعادة تعيينها عند التقل*/document.querySelector('#shorts-player')?.setPlaybackRate(movie_player.getPlaybackRate());/*إظهار الكلمات المفتاحية*/{(k=document.getElementById('kyw'))||(k=document.createElement('div'),k.id='kyw',k.style.cssText='font-size:16px;margin-top:8px;',t=document.querySelector('#above-the-fold #title'))&&t.parentElement.insertBefore(k,t.nextSibling);fetch('/watch?v='+movie_player.getVideoData().video_id).then(r=>r.text()).then(b=>k.textContent=JSON.parse(b.match(/ytInitialPlayerResponse\s*=\s*(\{.*?\});/s)[1]).videoDetails?.keywords?.join(' / ')||'لا يوجد كلمات مفتاحية')};/*إظهار عداد عدم الإعجاب*/fetch('https://returnyoutubedislikeapi.com/votes?videoId='+new URL(location).searchParams.get('v')).then(r=>r.json()).then(j=>{n=j.dislikes,b=document.querySelector('segmented-like-dislike-button-view-model').querySelectorAll('button')[1],setTimeout(()=>{(t=b.querySelector('#text'))||(t=document.createElement('span'),t.id='text',b.appendChild(t),b.style.width='auto');t.textContent=Intl.NumberFormat(...(window?.yt?.config_?.HL?[yt.config_.HL,{notation:'compact'}]:[])).format(n)},200)});/*.*/}));/*التبديل بين السرعة العادية وضغف السرعة*/movie_player.setPlaybackRate(movie_player.getPlaybackRate()===1?2:1)/*.*/,dispatchEvent(new Event('yt-navigate-finish'));" class="bookmarklet" draggable="true">مجمع يوتيوب (إظهار الكلمات المفتاحية والدسلايك وتخطي الإعلان وضغف السرعة)</a>
<h5>إضعط علي مجمع يوتيوب ضغطتين متتاليتين لرؤية برنامجه في المحرر بالاسفل ولتعديله فقط احذف القسم وقم بإنشاء مخصص</h5>
<a href="javascript:(()=>{(q=prompt('اختر رقم الجودة:\n1=144p\n2=240p\n3=360p\n4=480p\n5=720p\n6=1080p\n(يجب تعديل User-Agent إلى Safari Mac قبل التشغيل)',3))&&fetch('/watch?v='+new URL(location.href).searchParams.get('v')).then(r=>r.text()).then(t=>JSON.parse(t.match(/ytInitialPlayerResponse\s*=\s*(\{.*?\});/s)[1]).streamingData.hlsManifestUrl).then(u=>fetch(u).then(r=>r.text())).then(t=>{a=t.split('\n').filter(l=>l&&l[0]!='#'&&l.includes('.m3u8'));return a[((q.charCodeAt(0)&15)-1)%a.length]}).then(m=>fetch(m).then(r=>r.text())).then(t=>Promise.all(t.split('\n').filter(l=>l&&l[0]!='#').map(u=>fetch(u).then(r=>r.blob())))).then(b=>{a=document.createElement('a');a.href=URL.createObjectURL(new Blob(b,{type:'video/mp2t'}));a.download=movie_player.getVideoData().title+'.ts';a.click()}).catch(e=>alert('يرجى إعادة المحاولة'))})();" class="bookmarklet" draggable="true">التحميل من يوتيوب (للمتصفحات غير سفاري يجب ان User agent = Safari-Mac)</a>
<h5>لو كان متصفحك لا يحتوي علي سفاري ماك (وهذا نادر جدا) يمكنك إضافة عميل مخصص بهذه العبارة<br>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15</h5>
<a href="javascript:open(prompt('هذا رابط الفديو المعروض حاليا هل تريد فتحه؟','https://youtu.be/'+new URL(window.navigator.mediaSession.metadata.artwork[0].src).pathname.match(/\/vi\/([^/]{11})/)[1]));" class="bookmarklet" draggable="true">جلب رابط فيديو الإعلان الغير مدرج الذي يعرض حاليا</a>
<a href="javascript:(()=>{const a=Object.entries(window.ytcsi?.debug||{}).map(e=>e[1]?.info?.adVideoId).filter(i=>i&&i!=='empty_video'),t=a.map(i=>'https://youtu.be/'+i).join('\n'),l=a.at(-1);if(!a.length)return alert('🚫 لا يوجد إعلانات.');prompt('📺 عدد الإعلانات: '+a.length,t)&&open('https://youtu.be/'+l)})();" class="bookmarklet" draggable="true">جلب روابط جميع الإعلانات التي عرضت في هذه الصفحة</a>
<hr><h3>📚 ادوات القراءة</h3>
<a href="javascript:(()=>{(d=document.body.style).direction=d.direction=='rtl'?'ltr':'rtl'})();" class="bookmarklet" draggable="true">تبديل اتجاه النصوص لمشكلة اللغات المختلطة بالعربية</a>
<a href="javascript:(()=>{(selTxt=window.getSelection().toString().trim())?window.open(`https://translate.google.com/?sl=auto&tl=ar&text=${encodeURIComponent(selTxt)}&op=translate`, '_blank'):alert('حدد نصًا أولاً للترجمة')})();" class="bookmarklet" draggable="true">حدد اي نص ثم اضعط للترجمة</a>
<a href="javascript:(()=>{window.__scrollInterval=window.__scrollInterval?(clearInterval(window.__scrollInterval),window.__scrollInterval=null):setInterval(()=>window.scrollBy({top:window.innerHeight/ /*ده رقم سرعة التمرير لو هتعدله الرقم لازم إنجليزي مش عربي*/100/*.*/,behavior:'smooth'}),50)})()" class="bookmarklet" draggable="true">تشغيل/ إيقاف التمرير التلقائى</a>
<h5>إضعط علي التمرير التلقائى ضغطتين متتاليتين لتعديل رقم السرعة</h5>
<hr><h3>🌍🕸️ جميع مواقع الويب</h3>
<a href="javascript:(()=>{const existing = document.getElementById('__night_mode_css');if (existing) {existing.remove();} else {const css = `* { background-color: #111 !important; color: #eee !important; border-color: #444 !important; }/*الوضع الليلي للروابط*/a { color: #4da6ff !important; }/*جعل الصور والفيديو خافتين*/img, video { opacity: 0.8 !important; }/*الوضع الليلي للنص المحدد*/::selection { background: #555; color: white; }/*.*/`;const style = document.createElement('style');style.id = '__night_mode_css';style.innerHTML = css;document.head.appendChild(style);}})();" class="bookmarklet" draggable="true">تفعيل/إيقاف الوضع الليلي</a>
<a href="javascript:(()=>{navigator.clipboard.writeText(document.body.innerText)})()" class="bookmarklet" draggable="true">نسخ كل النصوص في الصفحة</a>
<!-- <a href="javascript:(v=document.querySelector('video[src]')).playbackRate=(v.playbackRate===1?2:1);" class="bookmarklet" draggable="true">التبديل بين السرعة = ٢ والعادية لاي موقع ليس يوتيوب فقط</a> -->
<a href="javascript:document.querySelector('video[src]').playbackRate=/*ده رقم السرعة لو هتعدله الرقم لازم إنجليزي مش عربي*/3/*.*/;" class="bookmarklet" draggable="true">السرعة = ٣ يعمل على الفيديو في اي المواقع</a>
<h5>إضعط علي السرعة = ٣ ضغطتين متتاليتين لتعديل ٣ وكتابة اي رقم تريد بدالها</h5>
<!-- <a href="" class="bookmarklet" draggable="true"></a> -->
<!-- <a href="" class="bookmarklet" draggable="true"></a> -->
</div>
<div class="section">
<h3>✏️ أضف كود مخصص</h3>
<input type="text" id="custom-name" placeholder="اسم الكود">
<div>تنسيق محرر الاكواد :
<input type="radio" name="text-align" value="left" checked>عادي
<input type="radio" name="text-align" value="center">منتصف
</div>
<div>إضافة قالب :
<span template="/*عنوان الفقره*/;/*نهاية.*/" class="template">فقره ليس بعدها فقره</span>
<span template="/*عنوان الفقره الاولى*/;/*الفقره التالية*/;/*.*/" class="template">فقره بعدها فقره</span>
<span template="/*عنوان الفقره*/" class="template">عنوان</span>
<span template="/*.*/" class="template">نهاية فقره</span>
</div>
<div id="custom-code" contenteditable="true" dir="ltr" spellcheck="false"></div>
<button id="add-btn" class="add-btn">➕ إضافة لأكوادك الخاصة </button>
<div>يجب الالتزام ب ; او , في نهاية الاوامر نظرا لطبيعة اكواد الروابط التي تتجاهل الاسطر كأن الكود سطر واحد .</div>
<hr><div>لاحظ انه يمكنك الاستغناء عن /*نهاية.*/ او /*.*/ في نهاية الفقره لو كان بعدها مباشرة عنوان فقره اخرى .</div>
<hr><div>لاحظ انه يمكنك كتابة /**/ او حذفه بشكل يدوي يعني مش لازم تستخدم القوالب لانها بتضيف نص عادي برضو وفي كل الاحوال بيتم التنسيق وتحديد الفقرات باستخدام دالة منفصلة .</div>
<hr><div>لاحظ انه يمكنك كتابة اي نص تريد داخل /*.*/ مثل النهاية بس بشرط النقطة (.) تكون في اخر الكلام .</div>
<hr><div>المحرر يدعم التراجع باستخدام (Ctrl+Z) او (⌘+Z) والتقدم باستخدام (Ctrl+Shift+Z) .</div>
</div>
<div class="section">
<h3>🛠️ أكوادك الخاصة</h3>
<div id="custom-list"></div>
</div>
<div id="floating-message" class="floating-msg"></div>
</body>
</html>