Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d2dc7b43ca | ||
|
eb53d24e23 |
51
repliq.html
Executable file → Normal file
51
repliq.html
Executable file → Normal file
|
@ -18,7 +18,7 @@
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: auto;
|
width: auto;
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
text-align: center;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.output-container {
|
.output-container {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
@ -46,10 +46,10 @@
|
||||||
<body>
|
<body>
|
||||||
<h2>RépliQ - Générateur de bannière e-mail</h2>
|
<h2>RépliQ - Générateur de bannière e-mail</h2>
|
||||||
<label for="action">Demander une :</label>
|
<label for="action">Demander une :</label>
|
||||||
<select id="action" onchange="toggleConvenienceOption()">
|
<select id="action" onchange="toggleOptions()">
|
||||||
|
<option value="Réponse">Réponse</option>
|
||||||
<option value="Action">Action</option>
|
<option value="Action">Action</option>
|
||||||
<option value="Lecture">Lecture</option>
|
<option value="Lecture">Lecture</option>
|
||||||
<option value="Réponse">Réponse</option>
|
|
||||||
</select>
|
</select>
|
||||||
<br><br>
|
<br><br>
|
||||||
<label for="date">Date limite :</label>
|
<label for="date">Date limite :</label>
|
||||||
|
@ -58,6 +58,9 @@
|
||||||
<div id="convenienceOption" style="display: none;">
|
<div id="convenienceOption" style="display: none;">
|
||||||
<input type="checkbox" id="convenience"> À votre convenance
|
<input type="checkbox" id="convenience"> À votre convenance
|
||||||
</div>
|
</div>
|
||||||
|
<div id="requiredOption" style="display: none;">
|
||||||
|
<input type="checkbox" id="required"> Requise (au lieu de "souhaitée")
|
||||||
|
</div>
|
||||||
<br><br>
|
<br><br>
|
||||||
<button onclick="generateBanner()">Générer</button>
|
<button onclick="generateBanner()">Générer</button>
|
||||||
<button onclick="setASAP()">ASAP</button>
|
<button onclick="setASAP()">ASAP</button>
|
||||||
|
@ -70,29 +73,24 @@
|
||||||
<div id="hiddenContainer"></div>
|
<div id="hiddenContainer"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function toggleConvenienceOption() {
|
function toggleOptions() {
|
||||||
const action = document.getElementById("action").value;
|
const action = document.getElementById("action").value;
|
||||||
const convenienceOption = document.getElementById("convenienceOption");
|
document.getElementById("convenienceOption").style.display = action === "Lecture" ? "block" : "none";
|
||||||
const dateInput = document.getElementById("date");
|
document.getElementById("requiredOption").style.display = action === "Action" ? "block" : "none";
|
||||||
const convenienceCheckbox = document.getElementById("convenience");
|
document.getElementById("convenience").checked = false;
|
||||||
|
document.getElementById("required").checked = false;
|
||||||
if (action === "Lecture") {
|
|
||||||
convenienceOption.style.display = "block";
|
|
||||||
} else {
|
|
||||||
convenienceOption.style.display = "none";
|
|
||||||
convenienceCheckbox.checked = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateBanner() {
|
function generateBanner() {
|
||||||
const action = document.getElementById("action").value;
|
const action = document.getElementById("action").value;
|
||||||
const dateInput = document.getElementById("date").value;
|
const dateInput = document.getElementById("date").value;
|
||||||
|
const convenienceChecked = document.getElementById("convenience").checked;
|
||||||
|
const requiredChecked = document.getElementById("required").checked;
|
||||||
const resultDiv = document.getElementById("result");
|
const resultDiv = document.getElementById("result");
|
||||||
const copyButton = document.getElementById("copyButton");
|
const copyButton = document.getElementById("copyButton");
|
||||||
const hiddenContainer = document.getElementById("hiddenContainer");
|
const hiddenContainer = document.getElementById("hiddenContainer");
|
||||||
const convenienceCheckbox = document.getElementById("convenience").checked;
|
|
||||||
|
|
||||||
if (!dateInput && !convenienceCheckbox) {
|
if (!dateInput && !convenienceChecked) {
|
||||||
alert("Veuillez sélectionner une date ou cocher 'À votre convenance'.");
|
alert("Veuillez sélectionner une date ou cocher 'À votre convenance'.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -101,8 +99,8 @@
|
||||||
let bgColor = "#A8E6A3";
|
let bgColor = "#A8E6A3";
|
||||||
let textColor = "#206A1E";
|
let textColor = "#206A1E";
|
||||||
|
|
||||||
if (convenienceCheckbox) {
|
if (convenienceChecked) {
|
||||||
message = "Lecture à votre convenance.";
|
message = "Lecture à votre convenance. Aucune réponse requise.";
|
||||||
} else {
|
} else {
|
||||||
const selectedDate = new Date(dateInput);
|
const selectedDate = new Date(dateInput);
|
||||||
const formattedDate = selectedDate.toLocaleDateString("fr-FR");
|
const formattedDate = selectedDate.toLocaleDateString("fr-FR");
|
||||||
|
@ -110,15 +108,17 @@
|
||||||
const diffTime = selectedDate - today;
|
const diffTime = selectedDate - today;
|
||||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||||
|
|
||||||
message = `${action} souhaitée avant le ${formattedDate}.`;
|
let verb = requiredChecked ? "requise" : "souhaitée";
|
||||||
|
message = `${action} ${verb} avant le ${formattedDate}.`;
|
||||||
|
|
||||||
if (diffDays <= 3) {
|
if (diffDays <= 3) {
|
||||||
bgColor = "#FFD580";
|
bgColor = "#FFD580";
|
||||||
textColor = "#A65E00";
|
textColor = "#A65E00";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action === "Lecture") {
|
if (action === "Lecture" && !convenienceChecked) {
|
||||||
message += " Inutile de répondre.";
|
message += " Aucune réponse requise.";
|
||||||
}
|
}
|
||||||
|
|
||||||
resultDiv.style.backgroundColor = bgColor;
|
resultDiv.style.backgroundColor = bgColor;
|
||||||
|
@ -127,22 +127,25 @@
|
||||||
resultDiv.style.display = "block";
|
resultDiv.style.display = "block";
|
||||||
copyButton.style.display = "inline-block";
|
copyButton.style.display = "inline-block";
|
||||||
|
|
||||||
hiddenContainer.innerHTML = `<div style='background-color: ${bgColor}; color: ${textColor}; padding: 10px; font-weight: bold; border-radius: 5px; display: inline-block; text-align: left;'>${message.replace("\n", "<br>")}</div>`;
|
hiddenContainer.innerHTML = `<div style='background-color: ${bgColor}; color: ${textColor}; padding: 10px; font-weight: bold; border-radius: 5px; display: inline-block; text-align: left;'>${message}</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setASAP() {
|
function setASAP() {
|
||||||
const action = document.getElementById("action").value;
|
const action = document.getElementById("action").value;
|
||||||
|
const requiredChecked = document.getElementById("required").checked;
|
||||||
|
const verb = requiredChecked ? "requise" : "souhaitée";
|
||||||
|
|
||||||
const resultDiv = document.getElementById("result");
|
const resultDiv = document.getElementById("result");
|
||||||
const copyButton = document.getElementById("copyButton");
|
const copyButton = document.getElementById("copyButton");
|
||||||
const hiddenContainer = document.getElementById("hiddenContainer");
|
const hiddenContainer = document.getElementById("hiddenContainer");
|
||||||
|
|
||||||
resultDiv.style.backgroundColor = "#FFA8A8";
|
resultDiv.style.backgroundColor = "#FFA8A8";
|
||||||
resultDiv.style.color = "#8B0000";
|
resultDiv.style.color = "#8B0000";
|
||||||
resultDiv.textContent = `${action} souhaitée dès que possible`;
|
resultDiv.textContent = `${action} ${verb} dès que possible`;
|
||||||
resultDiv.style.display = "block";
|
resultDiv.style.display = "block";
|
||||||
copyButton.style.display = "inline-block";
|
copyButton.style.display = "inline-block";
|
||||||
|
|
||||||
hiddenContainer.innerHTML = `<div style='background-color: #FFA8A8; color: #8B0000; padding: 10px; font-weight: bold; border-radius: 5px; display: inline-block; text-align: left;'>${action} souhaitée dès que possible</div>`;
|
hiddenContainer.innerHTML = `<div style='background-color: #FFA8A8; color: #8B0000; padding: 10px; font-weight: bold; border-radius: 5px; display: inline-block; text-align: left;'>${action} ${verb} dès que possible</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyFormattedBanner() {
|
function copyFormattedBanner() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user