Skip to content

Commit 55ed067

Browse files
authored
Merge pull request #34 from iskepr/main
اصلاح اخطاء واضافة الوزر العودة الى المستندات
2 parents 72ee0fd + 778e8bd commit 55ed067

File tree

4 files changed

+42
-9
lines changed

4 files changed

+42
-9
lines changed

Docs/WhatsNew/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,31 @@
6767
</section>
6868

6969
<section class="container content-section release">
70+
<div class="docsHeader" style="width: 90%;">
71+
<div class="but" id="showDocs" onclick="openWindow()">
72+
<svg width="20" height="14" viewBox="0 0 20 14" xmlns="http://www.w3.org/2000/svg">
73+
<path d="M19 6H5C4.4 6 4 5.6 4 5C4 4.4 4.4 4 5 4H19C19.6 4 20 4.4 20 5C20 5.6 19.6 6 19 6Z">
74+
</path>
75+
<path d="M19 2H1C0.4 2 0 1.6 0 1C0 0.4 0.4 0 1 0H19C19.6 0 20 0.4 20 1C20 1.6 19.6 2 19 2Z">
76+
</path>
77+
<path d="M19 10H1C0.4 10 0 9.6 0 9C0 8.4 0.4 8 1 8H19C19.6 8 20 8.4 20 9C20 9.6 19.6 10 19 10Z">
78+
</path>
79+
<path
80+
d="M19 14H5C4.4 14 4 13.6 4 13C4 12.4 4.4 12 5 12H19C19.6 12 20 12.4 20 13C20 13.6 19.6 14 19 14Z">
81+
</path>
82+
</svg>
83+
<p>المستندات</p>
84+
</div>
85+
</div>
86+
<div class="winBack">
87+
<div id="window" class="winDocs">
88+
<h2>المزيد من المستندات</h2>
89+
<a href="../"><button data-doc-type="إرشادات استعمال ألف"> - إرشادات لغة الف</button></a>
90+
<a href="../#قواعد_مطابق_ألف"><button data-doc-type="قواعد مطابق ألف"> - قواعد مطابق ألف</button></a>
91+
<a href="./"> - ما الجديد في ألف</a>
92+
</div>
93+
</div>
94+
7095
<div class="top">
7196
<h2>ما الجديد في لغة ألف نـ5</h2>
7297
<p>جميع التحديثات والتغيرات في لغة برمجة ألف

Docs/WhatsNew/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
font-size: 13px;
6363
}
6464

65+
li {
66+
margin-top: 2rem;
67+
}
68+
6569
pre {
6670
padding: 10px;
6771
margin: 10px 0;

Docs/docs-script.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ async function showDocs(docType) {
1616
"https://raw.githubusercontent.com/alifcommunity/Alif/refs/heads/Alif5.0/documents/إرشادات إستعمال ألف.md";
1717
const cacheKey = "doc-" + docType;
1818
let markdown = localStorage.getItem(cacheKey);
19-
if (!markdown) {
19+
let date = localStorage.getItem(cacheKey + "date");
20+
if (
21+
!markdown ||
22+
new Date().getTime() - date > 7 * 24 * 60 * 60 * 1000
23+
) {
2024
const res = await fetch(url);
2125
markdown = await res.text();
2226
localStorage.setItem(cacheKey, markdown);
27+
localStorage.setItem(cacheKey + "date", new Date().getTime());
2328
}
2429

2530
GramDiv.style.display = "none";
@@ -90,18 +95,17 @@ async function showDocs(docType) {
9095
}
9196
} else if (docType === "قواعد مطابق ألف") {
9297
try {
93-
const res = await fetch(
94-
"https://raw.githubusercontent.com/alifcommunity/Alif/refs/heads/Alif5.0/documents/قواعد مطابق ألف.md"
95-
);
96-
if (!res.ok) throw new Error("الملف غير موجود");
97-
const docs = await res.text();
98-
9998
GramDiv.style.display = "block";
10099
CatDiv.style.display = "none";
101100
headingsDiv.style.display = "none";
102101
heads.innerHTML = "";
103102
openHeadsButton.style.display = "none";
104103

104+
// const res = await fetch(
105+
// "https://raw.githubusercontent.com/alifcommunity/Alif/refs/heads/Alif5.0/documents/قواعد مطابق ألف.md"
106+
// );
107+
// if (!res.ok) throw new Error("الملف غير موجود");
108+
// const docs = await res.text();
105109
// GramDiv.innerHTML = highlightAlif(
106110
// docs.replaceAll(/\[\^\d+\]/g, "")
107111
// ).replaceAll(

Docs/docs-style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,13 @@ hr {
284284
right: 5px;
285285
}
286286
.headBack {
287-
position: absolute;
287+
position: fixed;
288288
display: none;
289289
height: 100vh;
290290
top: 0;
291291
left: 0;
292292
width: 100%;
293-
z-index: 100;
293+
z-index: 10;
294294
}
295295
#toggleHeadings:checked ~ .headings {
296296
transform: translateX(0px);

0 commit comments

Comments
 (0)