|
29 | 29 | String selectionUri = (String) request.getAttribute("selectionUri");
|
30 | 30 | %>
|
31 | 31 |
|
32 |
| -<html> |
33 |
| - <head> |
34 |
| - <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
| 32 | +<!DOCTYPE html> |
| 33 | +<html lang="en"> |
| 34 | +<head> |
| 35 | + <meta charset="UTF-8"> |
| 36 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
35 | 37 | <title>RequirementSD</title>
|
| 38 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css"> |
36 | 39 | < script src= "https://unpkg.com/[email protected]" integrity= "sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin= "anonymous"></ script>
|
37 |
| - </head> |
38 |
| - <body style="padding: 10px;"> |
39 |
| - <div id="selector-body"> |
| 40 | +</head> |
| 41 | +<body> |
| 42 | + <main class="container"> |
40 | 43 | <p id="searchMessage">Find a specific OSLC resource through a free-text search.</p>
|
41 |
| - |
42 | 44 | <div>
|
43 |
| - <input type="search" style="width: 335px" id="searchTerms" name="terms" placeholder="Begin typing to search" autofocus |
44 |
| - hx-trigger="keyup changed delay:180ms" hx-get="<%= selectionUri %>" hx-target="#search-results"> |
| 45 | + <input type="search" id="searchTerms" name="terms" placeholder="Begin typing to search" autofocus |
| 46 | + hx-trigger="input changed delay:120ms, keyup[key=='Enter'], load" |
| 47 | + hx-get="<%= selectionUri %>" hx-target="#search-results" |
| 48 | + hx-ext="aria-busy"> |
45 | 49 | </div>
|
46 |
| - |
47 |
| - <div id="search-results"></div> |
48 |
| - </div> |
| 50 | + <div id="search-results" class="grid"></div> |
| 51 | + </main> |
49 | 52 |
|
50 | 53 | <script>
|
51 | 54 | function sendOslcSelectionPostMessage(target, event) {
|
|
57 | 60 | }
|
58 | 61 | ]
|
59 | 62 | }
|
60 |
| - window.parent.postMessage("oslc-response:" + JSON.stringify(message), '*'); |
| 63 | + window.parent.postMessage("oslc-response:" + JSON.stringify(message), '*') |
61 | 64 | event.preventDefault()
|
62 | 65 | }
|
| 66 | +
|
| 67 | + // use accessible busy indicators |
| 68 | + htmx.defineExtension('aria-busy', { |
| 69 | + onEvent : function(name, evt) { |
| 70 | + var elt = evt.detail.elt; |
| 71 | + if(name === "htmx:beforeRequest") { |
| 72 | + elt.setAttribute("aria-busy", "true") |
| 73 | + } else if(name === "htmx:afterRequest" ) { |
| 74 | + elt.removeAttribute("aria-busy") |
| 75 | + } |
| 76 | + } |
| 77 | + }) |
63 | 78 | </script>
|
64 | 79 | </body>
|
65 | 80 | </html>
|
0 commit comments