Skip to content

Commit 096cd18

Browse files
Add warning when trying to download source code files
1 parent cc674d9 commit 096cd18

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

_includes/update/downloads.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ <h3>for Minecraft Snapshots</h3>
184184
function openDataHref(event, dataHref) {
185185
if(event.type === 'auxclick' && event.button !== 1)
186186
return;
187+
const warning = event.currentTarget.getAttribute('data-warning');
188+
if(warning && !window.confirm(warning)) {
189+
event.preventDefault();
190+
return;
191+
}
187192
window.open(dataHref, '_blank');
188193
}
189194
</script>

_includes/update/fabric-download.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
{%- assign srcfile = srclink | split: '/' | last -%}
112112
<a href="javascript:void(0)"
113113
data-href="{{ srclink }}"
114+
data-warning="This link downloads Wurst's source code, not the mod itself.&#10;&#10;If you want to install Wurst, click the big download button above instead. Putting this -sources.jar file into your mods folder will crash the game.&#10;&#10;Download the source code anyway?"
114115
data-analytics="Download Wurst"
115116
data-analytics-version="{{ page.wurst-version }}"
116117
data-analytics-mcversion="{{ mcversion }}"

0 commit comments

Comments
 (0)