Mercurial Hosting > linkmystyle
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cancel_edit_icons.js.luan Fri Jul 11 20:57:49 2025 -0600 @@ -0,0 +1,20 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Parsers = require "luan:Parsers.luan" +local json_string = Parsers.json_string or error() +local Io = require "luan:Io.luan" +local Http = require "luan:http/Http.luan" +local Shared = require "site:/lib/Shared.luan" +local show_user_icons = Shared.show_user_icons or error() +local User = require "site:/lib/User.luan" + + +return function() + local user = User.current() or error() + local html = ` show_user_icons(user) ` + Io.stdout = Http.response.text_writer() +%> + document.querySelector('div[icons]').innerHTML = <%= json_string(html) %>; + document.querySelector('h2[icons]').scrollIntoViewIfNeeded(false); +<% +end