-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: switch from angular/AJAX+Boostrap to HTMX+PicoCSS #345
Open
berezovskyi
wants to merge
3
commits into
master
Choose a base branch
from
b-htmx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/server-rm/src/main/webapp/co/oslc/refimpl/rm/gen/requirementselector-results.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<%-- | ||
Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
|
||
See the NOTICE file(s) distributed with this work for additional | ||
information regarding copyright ownership. | ||
|
||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Distribution License 1.0 which is available at | ||
http://www.eclipse.org/org/documents/edl-v10.php. | ||
|
||
SPDX-License-Identifier: BSD-3-Simple | ||
|
||
This file is generated by Lyo Designer (https://www.eclipse.org/lyo/) | ||
--%> | ||
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | ||
<%@page import="org.eclipse.lyo.oslc.domains.rm.Requirement"%> | ||
|
||
<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %> | ||
|
||
<aside> | ||
<nav> | ||
<ul> | ||
<c:forEach var="requirement" items="${resources}"> | ||
<li> | ||
<a href="${requirement.about}" | ||
onclick="sendOslcSelectionPostMessage(this, event)" | ||
>${requirement.title}</a> | ||
</li> | ||
</c:forEach> | ||
</ul> | ||
</nav> | ||
</aside> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<%--To avoid the overriding of any manual code changes upon subsequent code generations, disable "Generate JSP Files" option in the Adaptor model.--%> | ||
<!DOCTYPE html> | ||
<%-- | ||
Copyright (c) 2020 Contributors to the Eclipse Foundation | ||
Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
|
||
See the NOTICE file(s) distributed with this work for additional | ||
information regarding copyright ownership. | ||
|
@@ -27,38 +27,55 @@ | |
|
||
<% | ||
String selectionUri = (String) request.getAttribute("selectionUri"); | ||
|
||
%> | ||
|
||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>RequirementSD</title> | ||
<script src="<c:url value="/static/js/delegated-ui.js"/>"></script> | ||
</head> | ||
<body style="padding: 10px;"> | ||
<div id="selector-body"> | ||
<p id="searchMessage">Find a specific resource through a free-text search.</p> | ||
|
||
<p id="loadingMessage" style="display: none;">Pondering your search. Please stand by ...</p> | ||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css"> | ||
<script src="https://unpkg.com/[email protected]" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script> | ||
</head> | ||
<body> | ||
<main class="container"> | ||
<p id="searchMessage">Find a specific OSLC resource through a free-text search.</p> | ||
<div> | ||
<input type="search" style="width: 335px" id="searchTerms" placeholder="Enter search terms" autofocus> | ||
<button type="button" onclick="search( '<%= selectionUri %>' )">Search</button> | ||
<input type="search" id="searchTerms" name="terms" placeholder="Begin typing to search" | ||
autofocus autocomplete="off" | ||
hx-trigger="input changed delay:120ms, keyup[key=='Enter'], load" | ||
hx-get="<%= selectionUri %>" hx-target="#search-results" | ||
hx-ext="aria-busy"> | ||
</div> | ||
<div id="search-results" class="grid"></div> | ||
</main> | ||
|
||
<div style="margin-top: 5px;"> | ||
<select id="results" size="10" style="width: 400px" multiple="multiple"></select> | ||
</div> | ||
|
||
<div style="width: 400px; margin-top: 5px;"> | ||
<button style="float: right;" type="button" | ||
onclick="javascript: cancel()">Cancel</button> | ||
<button style="float: right;" type="button" | ||
onclick="javascript: select();">OK</button> | ||
</div> | ||
<div style="clear: both;"></div> | ||
</div> | ||
<script> | ||
function sendOslcSelectionPostMessage(target, event) { | ||
const message = { | ||
"oslc:results": [ | ||
{ | ||
"oslc:label": target.text, | ||
"rdf:resource": target.href | ||
} | ||
] | ||
} | ||
window.parent.postMessage("oslc-response:" + JSON.stringify(message), '*') | ||
event.preventDefault() | ||
} | ||
|
||
// use accessible busy indicators | ||
htmx.defineExtension('aria-busy', { | ||
onEvent : function(name, evt) { | ||
var elt = evt.detail.elt; | ||
if(name === "htmx:beforeRequest") { | ||
elt.setAttribute("aria-busy", "true") | ||
} else if(name === "htmx:afterRequest" ) { | ||
elt.removeAttribute("aria-busy") | ||
} | ||
} | ||
}) | ||
</script> | ||
</body> | ||
</html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this tiny bit of HTML is what gets rendered every time HTMX makes a search request and it dynamically replaces the contents of the
#search-results
div with this content returned by the server. Simple and easy.