change reload link, make so you can't submit when empty
This commit is contained in:
parent
d9987124c7
commit
d50372b246
1 changed files with 13 additions and 7 deletions
20
index.php
20
index.php
|
@ -38,7 +38,7 @@
|
|||
width: calc(100% - 140px);
|
||||
}
|
||||
|
||||
input[type=submit] {
|
||||
#submit-input {
|
||||
width: 100%; /* so that it's not so close to clear, might think of a better solution later */
|
||||
float: right;
|
||||
background: var(--accent);
|
||||
|
@ -150,7 +150,7 @@
|
|||
<input id="image-bits" type="text" name="image-bits">
|
||||
|
||||
Signature (optional): <input id="signature-input" onchange="logSignature();" type="text" name="signature">
|
||||
<input type="submit" value="Farp it">
|
||||
<input id="submit-input" type="submit" value="Farp it">
|
||||
</form>
|
||||
|
||||
<span style="font-size: 12px; color: grey;">Privacy Policy: The only data collected by furpsocial server-side is the contents of your posts (drawing and signature). This information is stored in our secure databases which are wiped of all post data every week. This data is only used to accomodate furpsocial as an oekaki-sharing platform. Client-side, furpsocial stores your most recently used signature as a cookie, which persists for one day before expiring.</span>
|
||||
|
@ -161,6 +161,8 @@
|
|||
const bits = document.getElementById("image-bits");
|
||||
const ctx = canvas.getContext("2d");
|
||||
|
||||
const submit = document.getElementById("submit-input");
|
||||
|
||||
// tools
|
||||
var currentTool;
|
||||
|
||||
|
@ -176,10 +178,13 @@
|
|||
}
|
||||
const eraserButton = document.getElementById("eraser-button");
|
||||
|
||||
var drawing = false;
|
||||
canvas.onmousedown = function() { drawing = true; }
|
||||
var isDrawing = false;
|
||||
canvas.onmousedown = function() {
|
||||
submit.disabled = false;
|
||||
isDrawing = true;
|
||||
}
|
||||
document.onmouseup = function() {
|
||||
drawing = false;
|
||||
isDrawing = false;
|
||||
// write image-bits for posting
|
||||
let canvasData = ctx.getImageData(0, 0, 128, 64);
|
||||
bits.value = "";
|
||||
|
@ -195,7 +200,7 @@
|
|||
}
|
||||
|
||||
canvas.onmousemove = function() {
|
||||
if (drawing) {
|
||||
if (isDrawing) {
|
||||
draw(window.event);
|
||||
}
|
||||
};
|
||||
|
@ -223,6 +228,7 @@
|
|||
|
||||
function clearCanvas() {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
submit.disabled = true;
|
||||
}
|
||||
|
||||
setPen();
|
||||
|
@ -257,7 +263,7 @@
|
|||
|
||||
<!-- feed display -->
|
||||
<h1 class="feed-header">Global Feed</h1>
|
||||
<span class="post" id="refresh" onclick="window.location.href = 'index.php'">refresh feed</span>
|
||||
<span class="post" id="refresh" onclick="window.location.href = 'https://furp.colean.cc'">refresh feed</span>
|
||||
|
||||
<?php
|
||||
// ensure the file exists before attempting to read from it
|
||||
|
|
Reference in a new issue