69f0cfdc54
* Get @mention in model * Add autocomplete logic * Get accounts to autocomplete from the server * Add autocomplete css * Check if we should show menu on account search * Add keyboard events * Update status with completed username * Trigger autocomplete when getting accounts back * Highlight choices on hover * Put focus on textarea after updating it * Fix clear draft * Hit the server only on non empty query * Lazzzzzzzzzzzzzzzzyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy * Add missing lazy * Add keyboard subscriptions * Add images and display name * Better menu visibility handling * Add lazy to notifications * Js formatting. * Improve styles. * Add unique keys to costly lists. * Fix tests. * Coding style nits. * Use the encodeUrl helper in ApiUrl. * Nanonit. * Improve autocomplete box styling. * CamelCase draft record * Move all autocomplete stuff to Draft * Send status to ports with the reply prefix. * Clear draft after posting a status. * Move ports setStatus call to a dedicated Command helper. * Naming. * Fix navigation with arrow keys in textarea * Always autoselect the first item of the menu
41 lines
1.5 KiB
HTML
41 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Tooty</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link href="//bootswatch.com/slate/bootstrap.min.css" media="all" rel="stylesheet" />
|
|
<link href="style.css" media="all" rel="stylesheet" />
|
|
<link rel="icon" type="image/png" sizes="192x192" href="images/favicon-192x192.png">
|
|
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon-96x96.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
|
|
<meta name="msapplication-TileColor" content="#272b30">
|
|
<meta name="theme-color" content="#272b30">
|
|
</head>
|
|
|
|
<body>
|
|
<script src="app.js"></script>
|
|
<script>
|
|
const app = Elm.Main.fullscreen({
|
|
client: JSON.parse(localStorage.getItem("tooty.client")),
|
|
registration: JSON.parse(localStorage.getItem("tooty.registration"))
|
|
});
|
|
app.ports.saveClient.subscribe(json => {
|
|
localStorage.setItem("tooty.client", json);
|
|
});
|
|
app.ports.saveRegistration.subscribe(json => {
|
|
localStorage.setItem("tooty.registration", json);
|
|
});
|
|
app.ports.setStatus.subscribe(function(data) {
|
|
var element = document.getElementById(data.id);
|
|
if (element) {
|
|
element.value = data.status;
|
|
// Reset cursor at the end
|
|
element.focus();
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|