swedbank-pay-design-guide-jekyll-theme 2.8.1 → 2.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_includes/code-example.html +1 -1
- data/_includes/copy-button.html +11 -0
- data/_layouts/default.html +7 -11
- data/_sass/code-view.scss +6 -0
- data/assets/js/enable-code-copy-in-table.js +40 -0
- data/lib/gem_version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 73c12f72d4d055a93ee0a31230c3d2d6a15ac118d716ed65c80655be4ad0a594
|
|
4
|
+
data.tar.gz: da99ecee1b960f6afde03e07a00c43794867693404e86a8394c30acb92cfd765
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dfe4d4a396b8a700f58a6d16aa4fa4bfcdb22326bee7555b94c25643bf3a32f45ca935f33a9ea54369d6be7b2d7ef7e4182fb50c0d68aa0ed8d321a0e62ecd39
|
|
7
|
+
data.tar.gz: 4bffd2489e69690385049f07c6061b4cee4d8736269ebc3cc78b73715f36bc5f27cbba1409f0f9c7e55d58d290cc2607a0804185fefa002ea47fdf0862d1bd59
|
data/_includes/code-example.html
CHANGED
|
@@ -8,7 +8,7 @@ json: json content
|
|
|
8
8
|
<p class="code-view-header">
|
|
9
9
|
{{ include.title}}
|
|
10
10
|
{% if include.json %}
|
|
11
|
-
|
|
11
|
+
{% include copy-button.html content=include.json label="Copy json to clipboard" tooltip="Copy json to clipboard" %}
|
|
12
12
|
{% endif %}
|
|
13
13
|
</p>
|
|
14
14
|
{% if include.header %}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
**Parameters
|
|
3
|
+
content: Content to copy to clipboard
|
|
4
|
+
label: Aria label text (optional, defaults to "Copy to clipboard")
|
|
5
|
+
tooltip: Tooltip text (optional, defaults to "Copy to clipboard")
|
|
6
|
+
{%- endcomment -%}
|
|
7
|
+
|
|
8
|
+
{%- assign buttonLabel = include.label | default: "Copy to clipboard" -%}
|
|
9
|
+
{%- assign buttonTooltip = include.tooltip | default: "Copy to clipboard" -%}
|
|
10
|
+
|
|
11
|
+
<button aria-describedby="tooltipCopy" class="code-view-copy tooltip" aria-label="{{ buttonLabel }}" value='{{include.content}}' onclick='javascript:navigator.clipboard.writeText(this.value)'><i class="at-clipboard small" aria-hidden="true"></i><div role="tooltip">{{ buttonTooltip }}</div></button>
|
data/_layouts/default.html
CHANGED
|
@@ -44,24 +44,19 @@
|
|
|
44
44
|
<title>{{ title }}</title>
|
|
45
45
|
<link rel="stylesheet" href="{{ design_guide_url }}/styles/swedbankpay.css" />
|
|
46
46
|
<link rel="stylesheet" href="{{ design_guide_url }}/styles/documentation-swedbankpay.css" />
|
|
47
|
-
<link rel="stylesheet" href="{{ "
|
|
48
|
-
<link rel="stylesheet" href="{{ "
|
|
47
|
+
<link rel="stylesheet" href="{{- "/assets/css/style.css" | relative_url -}}">
|
|
48
|
+
<link rel="stylesheet" href="{{- "/assets/css/pygments-autumn.css" | relative_url -}}">
|
|
49
49
|
<link rel="shortcut icon" href="{{ design_guide_url }}/icons/favicon.ico">
|
|
50
50
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ design_guide_url }}/icons/favicon-16x16.png">
|
|
51
51
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ design_guide_url }}/icons/favicon-32x32.png">
|
|
52
52
|
<link href="https://fonts.googleapis.com/css?family=Material+Icons+Outlined" rel="stylesheet">
|
|
53
|
-
{% if site.custom_head_scripts %}
|
|
54
|
-
{% for script in site.custom_head_scripts %}
|
|
55
|
-
<script src="{{ script | relative_url }}"></script>
|
|
56
|
-
{% endfor %}
|
|
57
|
-
{% endif %}
|
|
58
53
|
{%- include apple-mobile-headers.html design_guide_url=design_guide_url -%}
|
|
59
|
-
<script src="{{ '/assets/js/mermaid.min.js' | relative_url }}"></script>
|
|
54
|
+
<script src="{{- '/assets/js/mermaid.min.js' | relative_url -}}"></script>
|
|
60
55
|
{%- if site.search.enabled == true %}
|
|
61
56
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
|
62
|
-
<script src="{{ "
|
|
63
|
-
<script src="{{ "
|
|
64
|
-
<script src="{{ "
|
|
57
|
+
<script src="{{- "/assets/tipuesearch/tipuesearch_content.js" | relative_url -}}"></script>
|
|
58
|
+
<script src="{{- "/assets/tipuesearch/tipuesearch_set.js" | relative_url -}}"></script>
|
|
59
|
+
<script src="{{- "/assets/tipuesearch/tipuesearch.min.js" | relative_url -}}"></script>
|
|
65
60
|
{%- endif %}
|
|
66
61
|
</head>
|
|
67
62
|
|
|
@@ -120,6 +115,7 @@
|
|
|
120
115
|
<script src="{{ design_guide_url }}/scripts/dg.js" global="true" autoload="true"></script>
|
|
121
116
|
<script src="{{ '/assets/js/swedbank-pay-design-guide-theme.js' | relative_url }}"></script>
|
|
122
117
|
<script src="{{ '/assets/js/cookie-consent.js' | relative_url }}"></script>
|
|
118
|
+
<script src="{{ '/assets/js/enable-code-copy-in-table.js' | relative_url }}"></script>
|
|
123
119
|
{%- if site.google_analytics.tracking_id %}
|
|
124
120
|
{% include google_analytics.html %}
|
|
125
121
|
{%- endif %}
|
data/_sass/code-view.scss
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Automatically add copy buttons to tables with 'enable-copy' class
|
|
2
|
+
// Adds a copy button next to every <code> element in the table
|
|
3
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
4
|
+
// Find all tables with class enable-copy
|
|
5
|
+
document.querySelectorAll('table.enable-code-copy').forEach(table => {
|
|
6
|
+
// Find all <code> elements in the table
|
|
7
|
+
const codeElements = table.querySelectorAll('td code');
|
|
8
|
+
|
|
9
|
+
codeElements.forEach(codeElement => {
|
|
10
|
+
const value = codeElement.textContent.trim();
|
|
11
|
+
|
|
12
|
+
// Create copy button matching copy-button.html component
|
|
13
|
+
const button = document.createElement('button');
|
|
14
|
+
button.setAttribute('aria-describedby', 'tooltipCopy');
|
|
15
|
+
button.className = 'code-view-copy tooltip';
|
|
16
|
+
button.setAttribute('aria-label', 'Copy to clipboard');
|
|
17
|
+
button.value = value;
|
|
18
|
+
button.onclick = function() {
|
|
19
|
+
navigator.clipboard.writeText(this.value);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const icon = document.createElement('i');
|
|
23
|
+
icon.className = 'at-clipboard small';
|
|
24
|
+
icon.setAttribute('aria-hidden', 'true');
|
|
25
|
+
|
|
26
|
+
const tooltip = document.createElement('div');
|
|
27
|
+
tooltip.setAttribute('role', 'tooltip');
|
|
28
|
+
tooltip.textContent = 'Copy to clipboard';
|
|
29
|
+
|
|
30
|
+
button.appendChild(icon);
|
|
31
|
+
button.appendChild(tooltip);
|
|
32
|
+
|
|
33
|
+
// Add button after the code element
|
|
34
|
+
const cell = codeElement.parentElement;
|
|
35
|
+
cell.style.whiteSpace = 'nowrap';
|
|
36
|
+
cell.appendChild(document.createTextNode(' '));
|
|
37
|
+
cell.appendChild(button);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
data/lib/gem_version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: swedbank-pay-design-guide-jekyll-theme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Swedbank Pay
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -402,6 +402,7 @@ files:
|
|
|
402
402
|
- _includes/card-table.html
|
|
403
403
|
- _includes/card.html
|
|
404
404
|
- _includes/code-example.html
|
|
405
|
+
- _includes/copy-button.html
|
|
405
406
|
- _includes/doc-container.html
|
|
406
407
|
- _includes/example-1.md
|
|
407
408
|
- _includes/example-2.md
|
|
@@ -463,6 +464,7 @@ files:
|
|
|
463
464
|
- assets/img/flag-no.svg
|
|
464
465
|
- assets/img/flag-se.svg
|
|
465
466
|
- assets/js/cookie-consent.js
|
|
467
|
+
- assets/js/enable-code-copy-in-table.js
|
|
466
468
|
- assets/js/mermaid.min.js
|
|
467
469
|
- assets/js/swedbank-pay-design-guide-theme.js
|
|
468
470
|
- assets/puml-theme-swedbankpay.puml
|