Commit 41cdff4e authored by Luc Didry's avatar Luc Didry
Browse files

Fix #3

parent 1d73de28
Pipeline #23864 passed with stage
in 16 seconds
......@@ -55,6 +55,31 @@ var domIsReady = (function(domIsReady) {
if (window.location.hash) {
document.querySelector('#porn').value = decodeURIComponent(window.location.hash.substr(1));
}
var url = new URL(window.location);
if (url.searchParams.get('w') !== null) {
document.getElementById('wemake').value = url.searchParams.get('w');
}
if (url.searchParams.get('wx') !== null) {
document.getElementById('wemake-x').value = url.searchParams.get('wx');
}
if (url.searchParams.get('wy') !== null) {
document.getElementById('wemake-y').value = url.searchParams.get('wy');
}
if (url.searchParams.get('ws') !== null) {
document.getElementById('wemake-size').value = url.searchParams.get('ws');
}
if (url.searchParams.get('p') !== null) {
document.getElementById('porn').value = url.searchParams.get('p');
}
if (url.searchParams.get('px') !== null) {
document.getElementById('porn-x').value = url.searchParams.get('px');
}
if (url.searchParams.get('py') !== null) {
document.getElementById('porn-y').value = url.searchParams.get('py');
}
if (url.searchParams.get('ps') !== null) {
document.getElementById('porn-size').value = url.searchParams.get('ps');
}
refreshText();
});
......@@ -94,8 +119,17 @@ function refreshText() {
var ctx = c.getContext('2d');
ctx.clearRect(0, 0, c.width, c.height);
// update URL fragment
window.location.hash = "#" + p.value;
// update URL
var url = new URL(window.location);
url.searchParams.set('w', w.value);
url.searchParams.set('wx', wx.value);
url.searchParams.set('wy', wy.value);
url.searchParams.set('ws', ws.value);
url.searchParams.set('p', p.value);
url.searchParams.set('px', px.value);
url.searchParams.set('py', py.value);
url.searchParams.set('ps', ps.value);
window.history.pushState("change", "WemaWema", url);
// background color
var radius = 20;
......
Supports Markdown
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