mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-07-09 13:27:45 +00:00
refacto: devWeb - remove println and console.log
This commit is contained in:
@@ -135,8 +135,6 @@ public class ForgottenPasswordBean implements Serializable {
|
|||||||
String contentTemplate = this.translator.translate("forgotten_email_content");
|
String contentTemplate = this.translator.translate("forgotten_email_content");
|
||||||
String content = MessageFormat.format(contentTemplate, requestPath, token);
|
String content = MessageFormat.format(contentTemplate, requestPath, token);
|
||||||
message.setText(content);
|
message.setText(content);
|
||||||
System.out.println(contentTemplate);
|
|
||||||
System.out.println(content);
|
|
||||||
// Envoi du message
|
// Envoi du message
|
||||||
Transport.send(message);
|
Transport.send(message);
|
||||||
|
|
||||||
|
|||||||
@@ -109,10 +109,7 @@ public class ProfileServlet extends HttpServlet {
|
|||||||
simplePlayers[i] = new SimplePlayer(players[i], translator);
|
simplePlayers[i] = new SimplePlayer(players[i], translator);
|
||||||
}
|
}
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
System.out.println("players");
|
|
||||||
String jsonPlayers = gson.toJson(simplePlayers);
|
String jsonPlayers = gson.toJson(simplePlayers);
|
||||||
System.out.println("players");
|
|
||||||
System.out.println("json: "+jsonPlayers);
|
|
||||||
|
|
||||||
// Configurer la réponse
|
// Configurer la réponse
|
||||||
response.setContentType("application/json");
|
response.setContentType("application/json");
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ public class TranslationServlet extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void doPut(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
public void doPut(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||||
System.out.println("\n ok \n");
|
|
||||||
if (request.getParameter("language") != null) {
|
if (request.getParameter("language") != null) {
|
||||||
String language = request.getParameter("language");
|
String language = request.getParameter("language");
|
||||||
request.getSession().setAttribute("language", language);
|
request.getSession().setAttribute("language", language);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<script defer type="text/javascript">
|
<script defer type="text/javascript">
|
||||||
let contextPath = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
|
let contextPath = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
|
||||||
console.log(contextPath);
|
|
||||||
window.location.href = contextPath + "index";
|
window.location.href = contextPath + "index";
|
||||||
</script></head>
|
</script></head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ function onSubmit(event) {
|
|||||||
}
|
}
|
||||||
url.searchParams.append("username", username.value);
|
url.searchParams.append("username", username.value);
|
||||||
|
|
||||||
url.searchParams.forEach((value, key) => console.log(key, value));
|
|
||||||
fetch(url, {headers: {"Content-Type": "application/json"}, method})
|
fetch(url, {headers: {"Content-Type": "application/json"}, method})
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ function onSubmit(event) {
|
|||||||
const url = new URL(action);
|
const url = new URL(action);
|
||||||
const contextPath = url.href.substring(0, url.href.lastIndexOf("/") + 1);
|
const contextPath = url.href.substring(0, url.href.lastIndexOf("/") + 1);
|
||||||
inputs.forEach(input => url.searchParams.append(input.name, input.value));
|
inputs.forEach(input => url.searchParams.append(input.name, input.value));
|
||||||
console.log(url.href);
|
|
||||||
|
|
||||||
fetch(url, {headers: {"Content-Type": "application/json"}, method})
|
fetch(url, {headers: {"Content-Type": "application/json"}, method})
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ function onSubmit(event) {
|
|||||||
})
|
})
|
||||||
.then(() => window.location.href = contextPath+"login?success=reset-password")
|
.then(() => window.location.href = contextPath+"login?success=reset-password")
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(inputs);
|
|
||||||
onError(error, inputs);
|
onError(error, inputs);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ let languageSelector = document.getElementById('language-select');
|
|||||||
languageSelector.addEventListener('change', function() {
|
languageSelector.addEventListener('change', function() {
|
||||||
const contextPath = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
|
const contextPath = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
|
||||||
const action = contextPath + "/translate";
|
const action = contextPath + "/translate";
|
||||||
console.log(action);
|
|
||||||
const method = "PUT";
|
const method = "PUT";
|
||||||
const pagination = document.querySelector('#current-page');
|
const pagination = document.querySelector('#current-page');
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export function onError(error, inputs = []) {
|
|||||||
|
|
||||||
const notificationMessage = document.createElement("p");
|
const notificationMessage = document.createElement("p");
|
||||||
notificationMessage.classList.add("subtitle", "is-6");
|
notificationMessage.classList.add("subtitle", "is-6");
|
||||||
console.log(error.message)
|
|
||||||
notificationMessage.innerHTML = error.message;
|
notificationMessage.innerHTML = error.message;
|
||||||
|
|
||||||
notificationTitle.appendChild(notificationIcon);
|
notificationTitle.appendChild(notificationIcon);
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ export function onInvite(from, contextPath, game_id) {
|
|||||||
let inviteMsg;
|
let inviteMsg;
|
||||||
let acceptButtonLabel;
|
let acceptButtonLabel;
|
||||||
let declineButtonLabel;
|
let declineButtonLabel;
|
||||||
console.log(from)
|
|
||||||
if (languageSelector.value === "EN") {
|
if (languageSelector.value === "EN") {
|
||||||
inviteTitle = "Invitation from " + from + " !";
|
inviteTitle = "Invitation from " + from + " !";
|
||||||
inviteMsg = from + " invited you to join his game";
|
inviteMsg = from + " invited you to join his game";
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ const contextPath = url.pathname.substring(0, url.pathname.indexOf("/", 1) + 1)
|
|||||||
const languageSelector = document.getElementById('language-select');
|
const languageSelector = document.getElementById('language-select');
|
||||||
const currentPage = document.querySelector('input#current-page');
|
const currentPage = document.querySelector('input#current-page');
|
||||||
const nbPages = document.querySelector('#nb-pages');
|
const nbPages = document.querySelector('#nb-pages');
|
||||||
console.log("nbPages:" + nbPages.value);
|
|
||||||
let showLabel;
|
let showLabel;
|
||||||
if (languageSelector.value === 'EN') {
|
if (languageSelector.value === 'EN') {
|
||||||
showLabel = 'Show';
|
showLabel = 'Show';
|
||||||
@@ -64,26 +63,20 @@ function updatePagination(pageNumber) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateButtons(oldPageNumber,newPageNumber) {
|
function updateButtons(oldPageNumber,newPageNumber) {
|
||||||
console.log("old: " + oldPageNumber +", new: " + newPageNumber)
|
|
||||||
|
|
||||||
if (oldPageNumber === "1") {
|
if (oldPageNumber === "1") {
|
||||||
console.log("previous - not disable")
|
|
||||||
paginationPrevious.classList.remove('is-disable');
|
paginationPrevious.classList.remove('is-disable');
|
||||||
}
|
}
|
||||||
if (newPageNumber === "1") {
|
if (newPageNumber === "1") {
|
||||||
console.log("previous - disable")
|
|
||||||
paginationPrevious.classList.add('is-disable');
|
paginationPrevious.classList.add('is-disable');
|
||||||
}
|
}
|
||||||
if (oldPageNumber === nbPages.value.toString()) {
|
if (oldPageNumber === nbPages.value.toString()) {
|
||||||
console.log("next - not disable")
|
|
||||||
paginationNext.classList.remove('is-disable');
|
paginationNext.classList.remove('is-disable');
|
||||||
}
|
}
|
||||||
if (newPageNumber === nbPages.value.toString()) {
|
if (newPageNumber === nbPages.value.toString()) {
|
||||||
console.log("next - disable")
|
|
||||||
paginationNext.classList.add('is-disable');
|
paginationNext.classList.add('is-disable');
|
||||||
}
|
}
|
||||||
paginationCurrent.textContent = `${newPageNumber}`;
|
paginationCurrent.textContent = `${newPageNumber}`;
|
||||||
console.log(paginationCurrent)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ function updateUrl(url) {
|
|||||||
history.replaceState(null, null, url);
|
history.replaceState(null, null, url);
|
||||||
}
|
}
|
||||||
let contextPath = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
|
let contextPath = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
|
||||||
console.log(contextPath);
|
|
||||||
|
|
||||||
// Mettre à jour l'URL initiale au chargement de la page
|
// Mettre à jour l'URL initiale au chargement de la page
|
||||||
updateUrl(contextPath);
|
updateUrl(contextPath);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ const game = document.querySelector('#game-id');
|
|||||||
const from_id = document.querySelector('#user-id');
|
const from_id = document.querySelector('#user-id');
|
||||||
const from_username = document.querySelector('#user-username');
|
const from_username = document.querySelector('#user-username');
|
||||||
|
|
||||||
console.log(game.value)
|
|
||||||
function updateUsers(users) {
|
function updateUsers(users) {
|
||||||
const $tbody = document.querySelector('#user-list-modal tbody');
|
const $tbody = document.querySelector('#user-list-modal tbody');
|
||||||
$tbody.innerHTML = '';
|
$tbody.innerHTML = '';
|
||||||
@@ -93,7 +92,6 @@ ws.onMessage("removeUser", (data) => {
|
|||||||
});
|
});
|
||||||
ws.onMessage("invite", (data) => {
|
ws.onMessage("invite", (data) => {
|
||||||
const {from, to, game} = data;
|
const {from, to, game} = data;
|
||||||
console.log("User " + from.username + " invited " + to.username + " to play " + game.name);
|
|
||||||
})
|
})
|
||||||
ws.onError((error) => console.error(error));
|
ws.onError((error) => console.error(error));
|
||||||
ws.onClose(() => console.log("Disconnected from the server"));
|
ws.onClose(() => console.log("Disconnected from the server"));
|
||||||
|
|||||||
Reference in New Issue
Block a user