Skip to content

Commit 263e4b3

Browse files
committed
Merge branch '1-update-from-sitetheme-bahn-ng' into 'main'
Resolve "Update from sitetheme-bahn-ng" Closes #1 See merge request db-ui/github/community-themes!1
2 parents a6f00bd + 03a7b82 commit 263e4b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+25164
-99
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
.DS_Store
2+
.idea
3+
*.iml
4+

siteTheme-Bahn-ng/site/assets/css/bahn-ng-theme.css

+72-12
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
position: relative;
7272
margin-bottom: 55px;
7373
}
74-
.bahn.ng h2::after,
75-
.bahn.ng h1::after {
74+
.bahn.ng h1:not(.card-title)::after,
75+
.bahn.ng h2:not(.card-title)::after {
7676
position: absolute;
7777
bottom: -30px;
7878
width: 80px;
@@ -322,6 +322,8 @@ div.toc-menu {
322322
}
323323
.bahn.ng span.label {
324324
margin-left: 1em;
325+
padding-bottom: 0.5rem;
326+
padding-top: 0.5rem;
325327
}
326328
.bahn.ng ul > li.with-child a.td-sidebar-link.td-sidebar-link__section {
327329
padding-left: 1em !important;
@@ -334,11 +336,13 @@ div.toc-menu {
334336
overflow-wrap: break-word;
335337
}
336338
#td-section-nav {
337-
max-height: calc(100vh - 64px);
338339
position: sticky;
339340
top: 64px;
340341
}
341342
@media (min-width: 768px) {
343+
#td-section-nav {
344+
max-height: calc(100vh - 64px);
345+
}
342346
.td-sidebar-nav {
343347
max-height: 100%;
344348
overflow-y: auto;
@@ -474,8 +478,8 @@ div.toc-menu {
474478
.bahn.ng h3 {
475479
font-weight: 900;
476480
}
477-
.bahn.ng h1,
478-
.bahn.ng h2 {
481+
.bahn.ng h1:not(.card-title),
482+
.bahn.ng h2:not(.card-title) {
479483
margin-bottom: 3.5rem;
480484
}
481485
.bahn.ng h1 {
@@ -578,6 +582,10 @@ div.toc-menu {
578582
.bahn.ng main code {
579583
font-family: Consolas, Monaco, 'Andale Mono', monospace;
580584
}
585+
/* be sure color contrast is high enough */
586+
.bahn.ng main code .str {
587+
color: #0b810b;
588+
}
581589
.bahn.ng .td-content .highlight {
582590
margin-top: 0;
583591
}
@@ -642,7 +650,7 @@ div.toc-menu {
642650
.bahn.ng main .admonitionblock.warning > table .title {
643651
font-weight: bold;
644652
text-transform: uppercase;
645-
color: var(--color-yellow-700);
653+
color: var(--color-orange-800);
646654
}
647655
.bahn.ng main .admonitionblock.important > table .title {
648656
font-weight: bold;
@@ -657,7 +665,7 @@ div.toc-menu {
657665
.bahn.ng main .admonitionblock.note > table .title {
658666
font-weight: bold;
659667
text-transform: uppercase;
660-
color: var(--color-cyan-600);
668+
color: var(--color-cyan-700);
661669
}
662670

663671
/* Text anchor */
@@ -707,9 +715,9 @@ div.toc-menu {
707715

708716
/* fix footer base style */
709717
.bahn.ng #footnotes .footnote {
710-
padding: 0;
711-
margin-left: 0;
712-
text-indent: 0;
718+
padding: 0;
719+
margin-left: 0;
720+
text-indent: 0;
713721
}
714722

715723

@@ -843,9 +851,12 @@ div.toc-menu {
843851
}
844852
}
845853

846-
h2[id]:before, h3[id]:before, h4[id]:before, h5[id]:before {
854+
h2[id]:before,
855+
h3[id]:before,
856+
h4[id]:before,
857+
h5[id]:before {
847858
display: block;
848-
content: " ";
859+
content: ' ';
849860
visibility: hidden;
850861
}
851862
a[href^="//"]:after,
@@ -854,3 +865,52 @@ a[href^="https://"]:after {
854865
content: url(../images/ic-db_link-external_20.svg);
855866
margin: 0 0 0 0;
856867
}
868+
div.listingblock,
869+
table.tableblock {
870+
position: relative;
871+
}
872+
div.listingblock > copybutton,
873+
table.tableblock > copybutton {
874+
visibility: hidden;
875+
position: absolute;
876+
right: 0px;
877+
top: 2em;
878+
top: 0;
879+
z-index: 2;
880+
padding: 12px 12px;
881+
882+
background: url('../db-ui-icons/db_ic_copy_32.svg') left no-repeat;
883+
background-size: 22px 22px;
884+
}
885+
886+
/* Show the button on hover of the parent div */
887+
div.listingblock:hover > copybutton,
888+
table.tableblock:hover > copybutton {
889+
visibility: visible;
890+
cursor: pointer;
891+
}
892+
893+
.imageblock.lb-active {
894+
width: 100vw;
895+
position: fixed;
896+
z-index: 100000;
897+
top: 0;
898+
left: 0;
899+
background-color: rgba(0, 0, 0, 0.8);
900+
width: 100vw;
901+
height: 100vh;
902+
text-align: center;
903+
}
904+
.imageblock.lb-active img {
905+
display: block;
906+
height: 90vh;
907+
width: auto;
908+
margin-top: 65px;
909+
margin-left: auto;
910+
margin-right: auto;
911+
background-color: white;
912+
}
913+
914+
.openseadragon-container {
915+
border: 1px solid black !important;
916+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
document.addEventListener('DOMContentLoaded', function() {
2+
// Get all divs with the 'copy' class
3+
const copyDivs = document.querySelectorAll('div.listingblock');
4+
5+
copyDivs.forEach(listingblock => {
6+
// Create a button
7+
const btn = document.createElement('copybutton');
8+
btn.innerText = '';
9+
10+
// Add click event to the button
11+
btn.addEventListener('click', async function() {
12+
try {
13+
await copyCodeToClipboard(listingblock);
14+
alert('Code copied to clipboard!');
15+
} catch (err) {
16+
console.error('Failed to copy Code: ', err);
17+
}
18+
});
19+
20+
// Append the button to the div
21+
listingblock.appendChild(btn);
22+
});
23+
});
24+
25+
async function copyCodeToClipboard(listingblock) {
26+
const codeHtml = listingblock.querySelector('div.content').innerText;
27+
const blob = new Blob([codeHtml], { type: 'text/plain' });
28+
const data = [new ClipboardItem({ 'text/plain': blob })];
29+
await navigator.clipboard.write(data);
30+
}
31+
32+
document.addEventListener('DOMContentLoaded', function() {
33+
// Get all divs with the 'copy' class
34+
const copyDivs = document.querySelectorAll('table.copy');
35+
36+
copyDivs.forEach(table => {
37+
// Create a button
38+
const btn = document.createElement('copybutton');
39+
btn.innerText = '';
40+
41+
// Add click event to the button
42+
btn.addEventListener('click', async function() {
43+
try {
44+
await copyTableToClipboard(table);
45+
alert('Table copied to clipboard!');
46+
} catch (err) {
47+
console.error('Failed to copy table: ', err);
48+
}
49+
});
50+
51+
// Append the button to the div
52+
table.appendChild(btn);
53+
});
54+
});
55+
56+
async function copyTableToClipboard(table) {
57+
const tableHtml = table.outerHTML;
58+
const blob = new Blob([tableHtml], { type: 'text/html' });
59+
const data = [new ClipboardItem({ 'text/html': blob })];
60+
await navigator.clipboard.write(data);
61+
}

siteTheme-Bahn-ng/site/assets/js/lightbox.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
const elements = document.querySelectorAll(".imageblock")
2-
console.log (elements);
3-
console.log(elements.length)
1+
const elements = document.querySelectorAll(".imageblock:not(.zoomable)")
42
for (let i = 0; i < elements.length; i++){
5-
console.log(i);
63
elements[i].addEventListener("click",function() {
74
if (this.className.includes("lb-active")) {
85
this.className = this.className.replace("lb-active","");

siteTheme-Bahn-ng/site/assets/js/openseadragon-4.1.0/LICENSE.txt

Whitespace-only changes.

siteTheme-Bahn-ng/site/assets/js/openseadragon-4.1.0/changelog.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)