Fix "download" buttons

parent 5a5ab47e
Pipeline #1451 passed with stage
in 36 seconds
......@@ -74,6 +74,9 @@ app.get('/generate.png', function (req, res) {
else if (req.query.target === 'randomize') {
req = randomize(req);
}
else if (req.query.target === 'download') {
res.set("Content-Disposition", "attachment;filename=lqdn_slogan.png");
}
let bgColor = req.query['bg-color'] || '#f54358';
let fgColor = req.query['fg-color'] || '#ffd201';
let fillText = req.query.text ? req.query.text.trim() : 'démocratie';
......
......@@ -227,8 +227,7 @@
<input type="text" id="signature" name="signature" />
<div class="navButtons">
<a href="#step4" class="white-button">&lsaquo;</a>
<input type="submit" class="blue-button" value="GÉNÉRER" />
</div>
<button type="submit" name="target" value="download" formtarget="_self" class="blue-button">GÉNÉRER</button>
</div>
</aside>
<main>
......@@ -238,7 +237,7 @@
<button type="submit" name="target" value="randomize" class="randomize white-button"><a>CHOISIR AU HASARD <span class="fa fa-random"></span></a></button>
<button type="submit" id="tweet-button" name="target" value="twitter" class="blue-button" target="_blank"><a><span class="text">Tweet </span><span class="fa fa-twitter"></span></a></button>
<button type="submit" id="fb-button" name="target" value="facebook" class="blue-button" target="_blank"><a><span class="text">Partager </span><span class="fa fa-facebook-square"></span></a></button>
<button type="submit" id="save-image" class="white-button" download="lqdn-slogan.png"><span class="text">Enregistrer </span><span class="fa fa-save"></span></a>
<button type="submit" name="target" value="download" formtarget="_self" id="save-image" class="white-button" download="lqdn-slogan.png"><span class="text">Enregistrer </span><span class="fa fa-save"></span></a>
</div>
<div id="credits">
<p><strong>Site hébergé par <a href="https://laquadrature.net">La Quadrature du Net</a></strong></p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment