detached 5ac253f

fix: Toggle on Add image button behavior

commit
5ac253fac1564be4cf59e4f2832923ba1cd29d5d
author
bnema · · 2023-09-27 12:27 UTC
parent
80e64ff
signature
unsigned
3 files · +2 -4
M internal/gotemplate/models/html/fragments/editcontainer.gohtml +0 -2
@@ -8,8 +8,6 @@
88 rows="20"
99 >{{.ContainerInfo}}</textarea
1010 >
11- <!-- Close the textarea tag here -->
12-
1311 <input
1412 type="submit"
1513 value="Save"
@@ -8,8 +8,6 @@
8 rows="20"8 rows="20"
9 >{{.ContainerInfo}}</textarea9 >{{.ContainerInfo}}</textarea
10 >10 >
11- <!-- Close the textarea tag here -->
12-
13 <input11 <input
14 type="submit"12 type="submit"
15 value="Save"13 value="Save"
M internal/httpserve/handler/createcontainer.go +1 -0
@@ -73,6 +73,7 @@ func CreateContainerGET(c echo.Context, a *app.App) error {
7373 func CreateContainerPOST(c echo.Context, a *app.App) error {
7474 // Retreive the ShortID of the image from the URL
7575 ShortID := c.Param("ID")
76+ fmt.Println(ShortID)
7677
7778 // Convert the ShortID to a full image ID
7879 imageID, err := FromShortIDToImageID(ShortID)
@@ -73,6 +73,7 @@ func CreateContainerGET(c echo.Context, a *app.App) error {
73 func CreateContainerPOST(c echo.Context, a *app.App) error {73 func CreateContainerPOST(c echo.Context, a *app.App) error {
74 // Retreive the ShortID of the image from the URL74 // Retreive the ShortID of the image from the URL
75 ShortID := c.Param("ID")75 ShortID := c.Param("ID")
76+ fmt.Println(ShortID)
76 77
77 // Convert the ShortID to a full image ID78 // Convert the ShortID to a full image ID
78 imageID, err := FromShortIDToImageID(ShortID)79 imageID, err := FromShortIDToImageID(ShortID)
M internal/webui/public/assets/js/custom.js +1 -2
@@ -36,10 +36,9 @@ function toggleButtonState(event) {
3636 }
3737 }
3838
39-
4039 // Attach event listeners to buttons
4140 document.body.addEventListener("htmx:afterSwap", function (event) {
42- const buttons = document.querySelectorAll('[id^="start-button-"], [id^="stop-button-"], [id^="edit-button-"], [id^="remove-button-img-"]');
41+ const buttons = document.querySelectorAll('[id^="start-button-"], [id^="stop-button-"], [id^="edit-button-"], [id^="remove-button-img-"], [id^="add-button-img-"]');
4342 buttons.forEach(button => {
4443 console.log("button: ", button);
4544 button.addEventListener('click', toggleButtonState);
@@ -36,10 +36,9 @@ function toggleButtonState(event) {
36 }36 }
37 }37 }
38 38
39-
40 // Attach event listeners to buttons39 // Attach event listeners to buttons
41 document.body.addEventListener("htmx:afterSwap", function (event) {40 document.body.addEventListener("htmx:afterSwap", function (event) {
42- const buttons = document.querySelectorAll('[id^="start-button-"], [id^="stop-button-"], [id^="edit-button-"], [id^="remove-button-img-"]');41+ const buttons = document.querySelectorAll('[id^="start-button-"], [id^="stop-button-"], [id^="edit-button-"], [id^="remove-button-img-"], [id^="add-button-img-"]');
43 buttons.forEach(button => {42 buttons.forEach(button => {
44 console.log("button: ", button);43 console.log("button: ", button);
45 button.addEventListener('click', toggleButtonState);44 button.addEventListener('click', toggleButtonState);

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close