Skip to content

Commit 3777479

Browse files
committed
fix: Correct issues related with citation dialog
1 parent cdae1b0 commit 3777479

File tree

7 files changed

+58
-44
lines changed

7 files changed

+58
-44
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ hide:
1313

1414
Measuring Power Consumption of your Applications.
1515

16-
[Geting started](getting_started){ .md-button .md-button--primary}
16+
[Geting started](getting_started.md){ .md-button .md-button--primary}
1717
[:fontawesome-brands-github: GitHub](https://github.com/powerapi-ng/){ .md-button}
1818

1919
</div>

docs/javascripts/extra.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
const dialog = document.querySelector("dialog");
22
const showButton = document.getElementById("export-button");
33
const closeButton = document.getElementById("close-citation-dialog-button");
4-
const copyButton = document.getElementById("copy-citation");
4+
const copyButton = document.getElementById("copy-citation-dialog-button");
55

66
function copyToClipboard(id)
77
{
8-
var r = document.createRange();
9-
r.selectNode(document.getElementById(id));
10-
window.getSelection().removeAllRanges();
11-
window.getSelection().addRange(r);
12-
document.execCommand('copy');
13-
window.getSelection().removeAllRanges();
8+
var r = document.createRange();
9+
r.selectNode(document.getElementById(id));
10+
window.getSelection().removeAllRanges();
11+
window.getSelection().addRange(r);
12+
document.execCommand('copy');
13+
window.getSelection().removeAllRanges();
1414
}
1515

1616
// "Show the dialog" button opens the dialog modally
@@ -26,3 +26,15 @@ closeButton.addEventListener("click", () => {
2626
copyButton.addEventListener("click", () => {
2727
copyToClipboard("citation");
2828
})
29+
30+
dialog.addEventListener("click", e => {
31+
const dialogDimensions = dialog.getBoundingClientRect()
32+
if (
33+
e.clientX < dialogDimensions.left ||
34+
e.clientX > dialogDimensions.right ||
35+
e.clientY < dialogDimensions.top ||
36+
e.clientY > dialogDimensions.bottom
37+
) {
38+
dialog.close();
39+
}
40+
})

docs/reference/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cluster of machine.
1717

1818
The Figure below depicts the global architecture of a software PowerMeter in PowerAPI.
1919

20-
![PowerAPI Architecture Overview](../../assets/images/reference/overview/global-architecture.jpg){ width="1000px"}
20+
![PowerAPI Architecture Overview](../assets/images/reference/overview/global-architecture.jpg){ width="1000px"}
2121

2222

2323
<!--img

docs/reference/sensors/hwpc-sensor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ and need to have **root access** to be used. If you are using version **1.2 or o
1313
**The sensor can not be used in a virtual machine**, it must have access (via Linux
1414
kernel API) to the real CPU register to read performance counter values.
1515

16-
The sensor provides raw values of performance counters as well as `RAPL` values in microjoules.
16+
The sensor provides raw values of performance counters as well as `RAPL` raw values in microjoules.
1717

1818
## Installation
1919

@@ -151,7 +151,7 @@ In order to run the Sensor without a configuration file, run HWPC Sensor using o
151151

152152

153153
???+ info "Reports' Storage"
154-
Your [`HWPCReports`](../reports/reports.md#hwpc-report) will be stored on MongoDB.
154+
Your [`HWPCReports`](../reports/reports.md#hwpc-reports) will be stored on MongoDB.
155155

156156
???+ tip "CLI parameters' names"
157157
You can only use shortcuts.

docs/stylesheets/extra.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@
9898
background-color: transparent;
9999
color: salmon;
100100
box-shadow: 0 6px 6px rgba(0, 0, 0, 0.6);
101+
font-size: 20px;
102+
}
103+
104+
#copy-citation-dialog-button {
105+
cursor: pointer;
101106
}
102107

103108
#citation-dialog{
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
<dialog id="citation-dialog">
22

33
<header>
4-
<h2 class="dialog-header">Export Citation</h2>
4+
<h1 class="dialog-header">Export Citation</h1>
55
<div align="right">
6-
<button id="close-citation-dialog-button" class="close-button" autofocus>&#x2716</button>
6+
<button id="close-citation-dialog-button" class="close-button md-icon" autofocus>&#x2716</button>
77
</div>
88
</header>
9-
10-
<div id= "citation" class="highlight">
11-
9+
<div id= "citation" class="md-typeset">
1210
<pre>
1311
<code>
1412
{% raw %}
15-
@article{fieni-2024,
16-
TITLE = {{PowerAPI: A Python framework for building software-defined power meters}},
17-
AUTHOR = {Fieni, Guillaume and Acero, Daniel Romero and Rust, Pierre and Rouvoy, Romain},
18-
URL = {https://hal.science/hal-04601379},
19-
JOURNAL = {{Journal of Open Source Software}},
20-
PUBLISHER = {{Open Journals}},
21-
VOLUME = {9},
22-
NUMBER = {98},
23-
PAGES = {6670},
24-
YEAR = {2024},
25-
MONTH = Jun,
26-
DOI = {10.21105/joss.06670},
27-
KEYWORDS = {Power ; Energy ; Toolkit ; Measurement ; Framework},
28-
PDF = {https://hal.science/hal-04601379/file/10.21105.joss.06670-3.pdf},
29-
HAL_ID = {hal-04601379},
30-
HAL_VERSION = {v1},
31-
}
13+
@article{fieni-2024,
14+
TITLE = {{PowerAPI: A Python framework for building software-defined power meters}},
15+
AUTHOR = {Fieni, Guillaume and Acero, Daniel Romero and Rust, Pierre and Rouvoy, Romain},
16+
URL = {https://hal.science/hal-04601379},
17+
JOURNAL = {{Journal of Open Source Software}},
18+
PUBLISHER = {{Open Journals}},
19+
VOLUME = {9},
20+
NUMBER = {98},
21+
PAGES = {6670},
22+
YEAR = {2024},
23+
MONTH = Jun,
24+
DOI = {10.21105/joss.06670},
25+
KEYWORDS = {Power ; Energy ; Toolkit ; Measurement ; Framework},
26+
PDF = {https://hal.science/hal-04601379/file/10.21105.joss.06670-3.pdf},
27+
HAL_ID = {hal-04601379},
28+
HAL_VERSION = {v1},
29+
}
3230
{% endraw %}
33-
</code>
31+
</code>
32+
<div align="right">
33+
<a ref="#" id="copy-citation-dialog-button" title="Copy citation" class="md-icon">
34+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M208 0H332.1c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9V336c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V48c0-26.5 21.5-48 48-48zM48 128h80v64H64V448H256V416h64v48c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V176c0-26.5 21.5-48 48-48z"/></svg>
35+
</a>
36+
</div>
3437
</pre>
3538
</div>
36-
<button id="copy-citation" title="Copy citation">Copy citation</button>
39+
3740
</dialog>

overrides/partials/header.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,11 @@
5858
</div>
5959
{% endif %}
6060
<a ref="#" id="export-button" class="md-header__button md-icon" title="Export Citation">
61-
Citation
62-
{% include "partials/citation-dialog.html" %}
63-
{% include ".icons/" ~ icon ~ ".svg" %}
64-
{% set icon = config.theme.icon.search or "material/magnify" %}
61+
62+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M448 296c0 66.3-53.7 120-120 120h-8c-17.7 0-32-14.3-32-32s14.3-32 32-32h8c30.9 0 56-25.1 56-56v-8H320c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72zm-256 0c0 66.3-53.7 120-120 120H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h8c30.9 0 56-25.1 56-56v-8H64c-35.3 0-64-28.7-64-64V160c0-35.3 28.7-64 64-64h64c35.3 0 64 28.7 64 64v32 32 72z"/></svg>
6563
</a>
66-
{% block scripts %}
67-
<script type="text/javascript">
68-
{% include "../docs/javascripts/extra.js" %}
69-
</script>
70-
{% endblock %}
7164
</nav>
65+
{% include "partials/citation-dialog.html" %}
7266
{% if "navigation.tabs.sticky" in features %}
7367
{% if "navigation.tabs" in features %}
7468
{% include "partials/tabs.html" %}

0 commit comments

Comments
 (0)