Skip to content

Commit 0fae4c2

Browse files
authored
Merge pull request #46 from webxdc/adb/improve-links-section2
improve links section, add punycode examples
2 parents 8a5c633 + 966f1b2 commit 0fae4c2

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

js/links.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
window.addEventListener("load", () => {
2-
let ul = h("ul");
3-
ul.append(
4-
h("li", {}, h("a", {target:"_blank", href: "https://delta.chat"}, "Normal link: https://delta.chat (should ask to open externally)")),
5-
h("li", {}, h("a", {href: "mailto:delta@example.org?body=test+message"}, "Mailto link")),
6-
h("li", {}, h("a", {href: "OPENPGP4FPR:571E6FDC22C1605512A1B0C8F7AC9331B82AFB5B#a=delta%40example.org&n=TestContact&i=pHMb3fRw-JV&s=VcWU-pQSEeB"}, "old openpgp4fpr: QR verification link")),
7-
h("li", {}, h("a", {target:"_blank", href: "https://i.delta.chat/#9AF055DB87EC48A1C009B6CA55E3712A6F7D346F&a=botsindex%40nine.testrun.org&n=Public%20Bots&i=QpBSronexvP&s=nAfQ0q_JomN"}, "New i.delta.chat invite link")),
8-
h("li", {}, h("a", {href: "geo:48.844,2.395"}, "geo-url link (geo:)")),
9-
h("li", {}, h("a", {href: "cabal://cabal.chat"}, "Custom scheme link")),
10-
h("li", {}, h("a", {href: "./page.html"}, "Link to an internal HTML page")),
11-
h("li", {}, h("a", {href: "chrome://crash"}, "chrome://crash")),
2+
let list = h("div", {class: "list"});
3+
list.append(
4+
h("div", {}, h("a", {target:"_blank", href: "https://delta.chat"}, "Normal link: https://delta.chat (should ask to open externally)")),
5+
h("div", {}, h("a", {target:"_blank", href: "https://wikipediа.org"}, "punycode link (should ask to open externally, this must not show wikipediа.org but xn--wikipedi-86g.org)")),
6+
h("div", {}, h("a", {target:"_blank", href: "https://xn--wikipedi-86g.org"}, "punycode link2 (should ask to open externally, this as well must not show wikipediа.org but xn--wikipedi-86g.org)")),
7+
h("div", {}, h("a", {href: "mailto:delta@example.org?body=test+message"}, "Mailto link")),
8+
h("div", {}, h("a", {href: "OPENPGP4FPR:571E6FDC22C1605512A1B0C8F7AC9331B82AFB5B#a=delta%40example.org&n=TestContact&i=pHMb3fRw-JV&s=VcWU-pQSEeB"}, "old openpgp4fpr: QR verification link")),
9+
h("div", {}, h("a", {target:"_blank", href: "https://i.delta.chat/#9AF055DB87EC48A1C009B6CA55E3712A6F7D346F&a=botsindex%40nine.testrun.org&n=Public%20Bots&i=QpBSronexvP&s=nAfQ0q_JomN"}, "New i.delta.chat invite link")),
10+
h("div", {}, h("a", {href: "geo:48.844,2.395"}, "geo-url link (geo:)")),
11+
h("div", {}, h("a", {href: "cabal://cabal.chat"}, "Custom scheme link")),
12+
h("div", {}, h("a", {href: "./page.html"}, "Link to an internal HTML page")),
13+
h("div", {}, h("a", {href: "chrome://crash"}, "chrome://crash")),
1214
);
1315

1416
document.getElementById("links-output").append(
15-
createHeader("Links"), h("div", {class: "container"}, ul)
17+
createHeader("Links"), h("div", {class: "container"}, list)
1618
);
1719
});

styles.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ header {
3434
margin-bottom: 15px;
3535
}
3636

37+
.list {
38+
display: flex;
39+
flex-direction: column;
40+
gap: 1em;
41+
}
42+
3743
button {
3844
padding: 0.5em;
3945
margin: 0.3em;
@@ -93,4 +99,4 @@ body {
9399

94100
.tab[aria-selected="true"] {
95101
background-color: lightgrey;
96-
}
102+
}

0 commit comments

Comments
 (0)