comparison src/cancel_edit_icons.js.luan @ 0:8f4df159f06b

start public repo
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 11 Jul 2025 20:57:49 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f4df159f06b
1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error
3 local Parsers = require "luan:Parsers.luan"
4 local json_string = Parsers.json_string or error()
5 local Io = require "luan:Io.luan"
6 local Http = require "luan:http/Http.luan"
7 local Shared = require "site:/lib/Shared.luan"
8 local show_user_icons = Shared.show_user_icons or error()
9 local User = require "site:/lib/User.luan"
10
11
12 return function()
13 local user = User.current() or error()
14 local html = ` show_user_icons(user) `
15 Io.stdout = Http.response.text_writer()
16 %>
17 document.querySelector('div[icons]').innerHTML = <%= json_string(html) %>;
18 document.querySelector('h2[icons]').scrollIntoViewIfNeeded(false);
19 <%
20 end