annotate src/drag.html.luan @ 64:b91375e2a28a

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 16 Aug 2024 11:06:52 -0400
parents a04ef87cf4a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local Io = require "luan:Io.luan"
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 local Http = require "luan:http/Http.luan"
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 local Shared = require "site:/lib/Shared.luan"
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local head = Shared.head or error()
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 local needed_header = Shared.needed_header or error()
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 return function()
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 Io.stdout = Http.response.text_writer()
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 %>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 <!doctype html>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <html>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 <head>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 <% head() %>
29
a04ef87cf4a0 drag and drop
Franklin Schmidt <fschmidt@gmail.com>
parents: 27
diff changeset
17 <title>Reactionary Software - JavaScript Drag and Drop</title>
15
9694eff797bf fix html
Franklin Schmidt <fschmidt@gmail.com>
parents: 3
diff changeset
18 </head>
3
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 <body>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 <% needed_header() %>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 <div content>
29
a04ef87cf4a0 drag and drop
Franklin Schmidt <fschmidt@gmail.com>
parents: 27
diff changeset
22 <h1>JavaScript Drag and Drop</h1>
a04ef87cf4a0 drag and drop
Franklin Schmidt <fschmidt@gmail.com>
parents: 27
diff changeset
23
a04ef87cf4a0 drag and drop
Franklin Schmidt <fschmidt@gmail.com>
parents: 27
diff changeset
24 <p>The standard HTML drag and drop API is a disgusting mess, as one would expect from modern standards. But here modern programmers have managed to reach a new low. This API doesn't work at all on mobile, making it completely useless.</p>
3
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25
29
a04ef87cf4a0 drag and drop
Franklin Schmidt <fschmidt@gmail.com>
parents: 27
diff changeset
26 <p>There are a number of third party JavaScript drag and drop libraries like <a href="https://interactjs.io/">interact.js</a> and <a href="https://draggabilly.desandro.com/">Draggabilly</a>. Of course these don't work, since they are modern code. interact.js is the least bad of them, but its drop functionality breaks if you modify the DOM.</p>
3
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27
29
a04ef87cf4a0 drag and drop
Franklin Schmidt <fschmidt@gmail.com>
parents: 27
diff changeset
28 <p>Writing a decent JavaScript drag and drop library shouldn't be hard for a reactionary programmer. And I would use it for a number of projects.</p>
3
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 </div>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 </body>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 </html>
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 <%
a19e0f3a6203 add lucene
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 end