Skip to content

Commit

Permalink
Add post-download donate invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
bertfrees committed Nov 12, 2024
1 parent 6bb48dd commit a8d1a3e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Download.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ layout: default
---
# Download

<script src="{{site.baseurl}}/js/post-download-donate-message.js"></script>

For installation instructions see
[Installation]({{site.baseurl}}/Get-Help/User-Guide/Installation/).

Expand Down
2 changes: 1 addition & 1 deletion src/_includes/download-link
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="{{include.file.url}}">
<a href="{{include.file.url}}" class="download">
For
{% case include.file.platform %}
{% when 'windows' %} Windows
Expand Down
11 changes: 11 additions & 0 deletions src/_wiki/Support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Support our work

<p id="downloading"></p>
<script>
if (new URLSearchParams(window.location.search).get("post-download") == "true") {
document.getElementById("downloading").textContent = "Your download should be starting...";
}
</script>

If you find DAISY Pipeline useful, please help us by donating to support its
ongoing maintenance. [Support out work](https://daisy.org/pipelineAppSponsor).
3 changes: 2 additions & 1 deletion src/_wiki/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* [[Troubleshooting Desktop Application|https://github.com/daisy/pipeline-ui/wiki/Troubleshooting]]
* [[Forum|https://github.com/daisy/pipeline/discussions]]
* [[Contact|mailto:[email protected]]]
* [[Contribute|Contribute]]
* [[Contribute|Contribute]]
* [[Source Code|https://github.com/daisy/pipeline]]
* [[Developer Guide|Developer-Guide]]
* [[Source Code|Sources]]
Expand All @@ -64,4 +64,5 @@
* [[Debugging|Debugging]]
* [[Release Management|Releasing]]
* [[Easy Hacks|http://daisy.github.io/pipeline/Contribute/Easy-Hacks.html]]
* [[Support​|Support]]
* [[DAISY Home|http://www.daisy.org]]
12 changes: 12 additions & 0 deletions src/js/post-download-donate-message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
---
window.addEventListener("load", function() {
let links = document.getElementsByClassName("download");
for (let i = 0; i < links.length; i++) {
links[i].addEventListener("click", function(event) {
setTimeout(function() {
window.location.href = "{{site.baseurl}}/Support.html?post-download=true";
}, 1000);
});
}
}

0 comments on commit a8d1a3e

Please sign in to comment.