-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from jaguililla/develop
Develop
- Loading branch information
Showing
17 changed files
with
1,081 additions
and
13 deletions.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
///usr/bin/env java --enable-preview --source 21 -cp "*" "$0" "$@" ; exit $? | ||
|
||
import static java.util.Map.entry; | ||
|
||
import java.io.Console; | ||
import java.util.List; | ||
|
||
private Console console = System.console(); | ||
|
||
void main() { | ||
var options = List.of( | ||
entry("GitHub", prompt("Keep GitHub workflows and templates: (Yn)", "y")), | ||
entry("GitLab", prompt("Keep GitLab workflows and templates: (Yn)", "y")), | ||
entry("GitLab", prompt("Keep 'CODE_OF_CONDUCT.md' file: (Yn)", "y")), | ||
entry("GitLab", prompt("Keep 'CONTRIBUTING.md' file: (Yn)", "y")), | ||
entry("GitLab", prompt("Keep 'LICENSE.md' file: (Yn)", "y")), | ||
entry("GitLab", prompt("Keep this set up file 'set_up.java' file: (Yn)", "y")) | ||
); | ||
|
||
// Rename artifacts, groups or base package | ||
// Restart Git history (or delete it) | ||
} | ||
|
||
public String prompt(String message, String defaultValue) { | ||
console.printf(message); | ||
var v = console.readLine(); | ||
return v == null || v.isBlank() ? defaultValue : v; | ||
} |
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
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
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,57 @@ | ||
<!DOCTYPE html> | ||
|
||
<head> | ||
<meta lang="en"> | ||
<meta charset="UTF-8"> | ||
|
||
<title>Appointments</title> | ||
|
||
<link rel="stylesheet" href="simple.css"> | ||
<style> | ||
:root { | ||
--body-font-size: 1rem; | ||
--body-line-height: 1.2; | ||
} | ||
</style> | ||
</head> | ||
|
||
<header> | ||
<h1>Appointments</h1> | ||
<p>Example task application</p> | ||
|
||
<nav> | ||
<a href="/" class="current">Appointments</a> | ||
<a href="/">Users</a> | ||
</nav> | ||
</header> | ||
|
||
<h3>Open</h3> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Id</th> | ||
<th>Title</th> | ||
<th>Order</th> | ||
</tr> | ||
</thead> | ||
<tbody id="appointments"></tbody> | ||
</table> | ||
|
||
<h3>New</h3> | ||
<form> | ||
<label for="title">Title</label> | ||
<input id="title" type="text"> | ||
<label for="order">Order</label> | ||
<input id="order" type="number"> | ||
</form> | ||
<button onclick="add()">Add</button> | ||
|
||
<template id="appointmentRow"> | ||
<tr> | ||
<td>title</td> | ||
<td>0</td> | ||
<td><input type="checkbox" checked></td> | ||
</tr> | ||
</template> | ||
|
||
<script src="main.js"></script> |
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,62 @@ | ||
|
||
const http = new XMLHttpRequest(); | ||
|
||
const tbody = document.querySelector("tbody#appointments"); | ||
const template = document.querySelector("#appointmentRow"); | ||
const titleInput = document.querySelector("#title"); | ||
const orderInput = document.querySelector("#order"); | ||
|
||
function httpSend(method, url, body, callback) { | ||
http.open(method, url); | ||
http.setRequestHeader('Content-type', 'application/json'); | ||
http.send(JSON.stringify(body)); | ||
http.onload = callback; | ||
} | ||
|
||
function httpGet(url, body, callback) { | ||
httpSend('GET', url, body, callback); | ||
} | ||
|
||
function httpPost(url, body, callback) { | ||
httpSend('POST', url, body, callback); | ||
} | ||
|
||
function addTask(task) { | ||
const clone = template.content.cloneNode(true); | ||
const td = clone.querySelectorAll("td"); | ||
const input = clone.querySelectorAll("input"); | ||
td[0].textContent = task.title; | ||
td[1].textContent = task.order; | ||
input.checked = task.completed; | ||
tbody.appendChild(clone); | ||
} | ||
|
||
function add() { | ||
const body = { | ||
title: titleInput.value, | ||
order: orderInput.valueAsNumber | ||
}; | ||
|
||
httpPost('/appointments', body, () => { | ||
titleInput.value = ""; | ||
orderInput.value = 0; | ||
|
||
addTask(JSON.parse(http.responseText)); | ||
}); | ||
} | ||
|
||
function main() { | ||
|
||
httpGet('/appointments', null, () => { | ||
for (const tr of tbody.children) | ||
tr.remove(); | ||
|
||
const response = JSON.parse(http.responseText); | ||
for (const task of response) | ||
addTask(task); | ||
|
||
console.log(http.responseText); | ||
}); | ||
} | ||
|
||
document.body.onload = main; |
Oops, something went wrong.