Added uppercase option to UUID generator
Update uuid-generator.yml, uuid-generator.yml, and 2 more files...
This commit is contained in:
@@ -10,6 +10,7 @@ type.uuid4: "UUID4 / GUID4"
|
||||
option.count: "UUID Count"
|
||||
option.hyphen: "Add hyphens"
|
||||
option.guid_brackets: "Add GUID brackets"
|
||||
option.uppercase: "Generate in uppercase"
|
||||
|
||||
generate: "Generate"
|
||||
|
||||
|
@@ -10,6 +10,7 @@ type.uuid4: "UUID4 / GUID4"
|
||||
option.count: "Nombre d'UUID/GUID"
|
||||
option.hyphen: "Ajouter trait d'union"
|
||||
option.guid_brackets: "Ajouter accolades pour GUID"
|
||||
option.uppercase: "Générer en majuscules"
|
||||
|
||||
generate: "Générer"
|
||||
|
||||
|
@@ -19,6 +19,8 @@ import {initCore} from "../../js/nibblepoker-core.mjs";
|
||||
const eOptionHyphenInput = document.querySelector("input#uuid-generator-option-hyphens");
|
||||
/** @type {HTMLInputElement} */
|
||||
const eOptionGuidBracketsInput = document.querySelector("input#uuid-generator-option-guid-brackets");
|
||||
/** @type {HTMLInputElement} */
|
||||
const eOptionUppercaseInput = document.querySelector("input#uuid-generator-option-uppercase");
|
||||
|
||||
/** @type {HTMLElement} */
|
||||
const eGenerateButton = document.querySelector("#uuid-generator-generate");
|
||||
@@ -57,10 +59,16 @@ import {initCore} from "../../js/nibblepoker-core.mjs";
|
||||
let addGuidBrackets = eOptionGuidBracketsInput.checked;
|
||||
|
||||
lastUUIDs = [];
|
||||
if (eOptionUppercaseInput.checked) {
|
||||
for (let i = 0; i < desiredCount; i++) {
|
||||
lastUUIDs.push(uuidGenerator(addHyphens, addGuidBrackets).toUpperCase());
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < desiredCount; i++) {
|
||||
lastUUIDs.push(uuidGenerator(addHyphens, addGuidBrackets));
|
||||
ePreviewTextArea.value += uuidGenerator(addHyphens, addGuidBrackets) + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
ePreviewTextArea.value = lastUUIDs.join("\n");
|
||||
});
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<label for="uuid-generator-option-count" class="mr-xs">{{ l10n("option.count", "uuid-generator", user_lang) }}:</label>
|
||||
<input id="uuid-generator-option-count" class="p-xxs border r-s" type="number" value="4" min="1" max="1000">
|
||||
|
||||
<br>
|
||||
<hr class="subtle">
|
||||
|
||||
<label for="uuid-generator-option-hyphens" class="mr-xxs">{{ l10n("option.hyphen", "uuid-generator", user_lang) }}:</label>
|
||||
<input id="uuid-generator-option-hyphens" class="r-m border cb-pretty" type="checkbox" checked>
|
||||
@@ -19,6 +19,11 @@
|
||||
<label for="uuid-generator-option-guid-brackets" class="mr-xxs">{{ l10n("option.guid_brackets", "uuid-generator", user_lang) }}:</label>
|
||||
<input id="uuid-generator-option-guid-brackets" class="r-m border cb-pretty" type="checkbox">
|
||||
|
||||
<br>
|
||||
|
||||
<label for="uuid-generator-option-uppercase" class="mr-xxs">{{ l10n("option.uppercase", "uuid-generator", user_lang) }}:</label>
|
||||
<input id="uuid-generator-option-uppercase" class="r-m border cb-pretty" type="checkbox">
|
||||
|
||||
<hr class="subtle">
|
||||
|
||||
<button id="uuid-generator-generate" class="p-xs r-s border b-light success">
|
||||
|
Reference in New Issue
Block a user