Verified Commit 9f01135e authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Rewrite URL on canvas edition

parent de1a21c2
......@@ -71,7 +71,7 @@ let draw = function() {
ctx.font = 'bold 12pt FiraSans';
ctx.fillText('La Quadrature du Net !', offset, height * 0.9);
//Draw picto
// Draw picto
getImage(icon, function(res) {
let img = new Image();
let imgXml = res.replace(/#FFD201/g, fgColor);
......@@ -91,6 +91,15 @@ let draw = function() {
document.querySelector('#save-image').href = canvas.toDataURL();
}, false);
});
// Edit URL
history.replaceState('', '', window.location.pathname + '?'
+ encodeURIComponent('bg-color=' + bgColor
+ '&fg-color=' + fgColor
+ '&text=' + fillText
+ '&font=' + font
+ '&signature=' + signature)
+ window.location.hash);
}
let bgColorElems = document.querySelectorAll('.colorpicker input[type="radio"], #step3 input[type="radio"], #step4 input[type="radio"]');
......
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