Finished IBAN generator, Hotfixed standalone pages spacing, Imrpoved IBAN generator standalone appearance
Update commons.yml, iban-generator.yml, and 6 more files...
This commit is contained in:
@@ -85,6 +85,7 @@ file.drop.selected.multiple: "You selected <span class=\"np-file-drop-count\">??
|
||||
|
||||
license.mit.single: "MIT License"
|
||||
|
||||
format.download.as: "Download as"
|
||||
format.raw: "Raw"
|
||||
format.json: "JSON"
|
||||
format.yaml: "YAML"
|
||||
|
@@ -10,3 +10,9 @@ option.prefer.numbers: "Prefer numbers over letters"
|
||||
option.for.each: "Generate <i>X</i> for each country"
|
||||
option.sepa.enable: "Enable SEPA countries"
|
||||
option.non-sepa.enable: "Enable non-SEPA countries"
|
||||
|
||||
license.1: "The code for this project is released in the public domain."
|
||||
license.2: "The original source code can be found on <a href=\"https://github.com/aziascreations/Web-NibblePoker\">GitHub</a>."
|
||||
license.3: "Data from Swift's
|
||||
<a href=\"https://www.swift.com/standards/data-standards/iban-international-bank-account-number\">IBAN Registry</a>
|
||||
was also used and may be licensed under different terms."
|
||||
|
@@ -85,6 +85,7 @@ file.drop.selected.multiple: "Vous avez séléctionné <span class=\"np-file-dro
|
||||
|
||||
license.mit.single: "License MIT"
|
||||
|
||||
format.download.as: "Télécharger en"
|
||||
format.raw: "Brut"
|
||||
format.json: "JSON"
|
||||
format.yaml: "YAML"
|
||||
|
@@ -10,3 +10,9 @@ option.prefer.numbers: "Favoriser les nombres aux lettres"
|
||||
option.for.each: "Générer <i>X</i> pour chaque pays"
|
||||
option.sepa.enable: "Activer les pays SEPA"
|
||||
option.non-sepa.enable: "Activer les pays non-SEPA"
|
||||
|
||||
license.1: "Le code de ce projet est publié dans le domaine public."
|
||||
license.2: "Le code source original peut être trouvé sur <a href=\"https://github.com/aziascreations/Web-NibblePoker\">GitHub</a>."
|
||||
license.3: "Les données du
|
||||
<a href=\"https://www.swift.com/standards/data-standards/iban-international-bank-account-number\">Registre IBAN</a>
|
||||
de Swift ont également été utilisées et peuvent être soumises à des conditions de licence différentes."
|
||||
|
@@ -49,6 +49,30 @@ import {initCore} from "../../js/nibblepoker-core.mjs";
|
||||
|
||||
let lastIBANs = [];
|
||||
|
||||
function onExclusionRulesChanged() {
|
||||
let showSepa = eOptionEnableSepa.checked;
|
||||
let showNonSepa = eOptionEnableNonSepa.checked;
|
||||
|
||||
eOptionCountry.querySelectorAll("option").forEach(eOption => {
|
||||
/** @type {IbanSpecification} */
|
||||
let countrySpec = countriesSpecs[eOption.value];
|
||||
|
||||
if(countrySpec.isSepa) {
|
||||
eOption.disabled = !showSepa;
|
||||
} else {
|
||||
eOption.disabled = !showNonSepa;
|
||||
}
|
||||
});
|
||||
|
||||
if (eOptionCountry.options[eOptionCountry.selectedIndex]?.disabled) {
|
||||
const eFirstEnabled = Array.from(eOptionCountry.options)
|
||||
.find(option => !option.disabled);
|
||||
if (eFirstEnabled) {
|
||||
eFirstEnabled.selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {number} */
|
||||
function getDesiredCount() {
|
||||
return getInputCount(eOptionCount, 1, 1000);
|
||||
@@ -62,7 +86,19 @@ import {initCore} from "../../js/nibblepoker-core.mjs";
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
// FIXME: Handle the exclusions properly
|
||||
// Exclusion rules
|
||||
eOptionEnableSepa.addEventListener("change", function() {
|
||||
if(!eOptionEnableSepa.checked && !eOptionEnableNonSepa.checked) {
|
||||
eOptionEnableNonSepa.checked = true;
|
||||
}
|
||||
onExclusionRulesChanged();
|
||||
});
|
||||
eOptionEnableNonSepa.addEventListener("change", function() {
|
||||
if(!eOptionEnableSepa.checked && !eOptionEnableNonSepa.checked) {
|
||||
eOptionEnableSepa.checked = true;
|
||||
}
|
||||
onExclusionRulesChanged();
|
||||
});
|
||||
|
||||
// Generation
|
||||
eGenerateButton.addEventListener("click", function() {
|
||||
@@ -119,19 +155,19 @@ import {initCore} from "../../js/nibblepoker-core.mjs";
|
||||
if (lastIBANs.length <= 0) {
|
||||
return;
|
||||
}
|
||||
downloadStringAsFile(lastIBANs.join("\n"), "uuids.txt", "text/plain");
|
||||
downloadStringAsFile(lastIBANs.join("\n"), "ibans.txt", "text/plain");
|
||||
});
|
||||
eDownloadJsonButton.addEventListener("click", function() {
|
||||
if (lastIBANs.length <= 0) {
|
||||
return;
|
||||
}
|
||||
downloadStringAsFile(JSON.stringify(lastIBANs, null, 4), "uuids.json", "application/json");
|
||||
downloadStringAsFile(JSON.stringify(lastIBANs, null, 4), "ibans.json", "application/json");
|
||||
});
|
||||
eDownloadYamlButton.addEventListener("click", function() {
|
||||
if (lastIBANs.length <= 0) {
|
||||
return;
|
||||
}
|
||||
downloadStringAsFile("- \"" + lastIBANs.join("\"\n- \"") + "\"", "uuids.yaml", "text/yaml");
|
||||
downloadStringAsFile("- \"" + lastIBANs.join("\"\n- \"") + "\"", "ibans.yaml", "text/yaml");
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@@ -129,13 +129,23 @@
|
||||
<hr class="subtle">
|
||||
|
||||
<button id="iban-generator-generate" class="p-xs r-s border b-light success">
|
||||
<i class="fa-duotone fa-solid fa-gears mr-xs"></i>{{ l10n("action.generate", "commons", user_lang) }}
|
||||
{% if not is_standalone %}
|
||||
<i class="fa-duotone fa-solid fa-gears mr-xs"></i>
|
||||
{% endif %}
|
||||
{{ l10n("action.generate", "commons", user_lang) }}
|
||||
</button>
|
||||
|
||||
<button class="p-xs r-s border b-light primary rr-0 br-0">
|
||||
<i class="fa-duotone fa-solid fa-download"></i>
|
||||
</button>
|
||||
<button id="iban-generator-download-raw" class="p-xs r-s border b-light primary ml-0 r-0 br-0">
|
||||
|
||||
|
||||
{% if not is_standalone %}
|
||||
<button class="p-xs r-s border b-light primary rr-0 br-0">
|
||||
<i class="fa-duotone fa-solid fa-download"></i>
|
||||
</button>
|
||||
{% else %}
|
||||
<span class="t-w-500 ml-m mr-xxs">{{ l10n("format.download.as", "commons", user_lang) }} :</span>
|
||||
{% endif %}
|
||||
<button id="iban-generator-download-raw" class="p-xs r-s border b-light primary ml-0
|
||||
{% if not is_standalone %}r-0{% else %}rr-0{% endif %} br-0">
|
||||
{{ l10n("format.raw", "commons", user_lang) }}
|
||||
</button>
|
||||
<button id="iban-generator-download-json" class="p-xs r-s border b-light primary ml-0 r-0 br-0">
|
||||
@@ -145,7 +155,21 @@
|
||||
{{ l10n("format.yaml", "commons", user_lang) }}
|
||||
</button>
|
||||
|
||||
|
||||
<hr class="subtle">
|
||||
|
||||
<label for="iban-generator-preview" class="d-none">{{ l10n("preview.label", "iban-generator", user_lang) }}:</label>
|
||||
<textarea name="iban-generator-preview" id="iban-generator-preview" rows="16" class="w-full border r-s ta-resize-v"></textarea>
|
||||
|
||||
|
||||
{% if is_standalone %}
|
||||
<hr class="subtle">
|
||||
|
||||
<p class="t-muted">
|
||||
{{ l10n("license.1", "iban-generator", user_lang) }}<br>
|
||||
{{ l10n("license.2", "iban-generator", user_lang) }}
|
||||
</p>
|
||||
<p class="mt-xs t-muted">
|
||||
{{ l10n("license.3", "iban-generator", user_lang) }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
@@ -28,7 +28,7 @@
|
||||
</head>
|
||||
<body class="layout-generic">
|
||||
|
||||
<header class="w-full p-m pl-s">
|
||||
<header class="p-m pl-s">
|
||||
<h1 class="t-size-17 t-w-500">
|
||||
<i class="fad fa-home t-size-16 mr-s t-muted"></i>{% block header_title %}{% endblock %}
|
||||
</h1>
|
||||
@@ -38,7 +38,7 @@
|
||||
{% block main_content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="d-flex flex-align-center w-full p-s py-xs">
|
||||
<footer class="d-flex flex-align-center p-s py-xs">
|
||||
<a href="{{ l10n_url_abs('/', raw_lang) }}">
|
||||
<img id="logo-footer"
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjczIiBoZWlnaHQ9IjUxMiIgeG1sbnM6dj0iaHR0cHM6Ly92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S40NUw0OTcuMjYgNC4yMWM2LjE4LTIuMzEgOS4zNC44NSA3IDdMMzIwLjcxIDUwMC43NkMzMTguNCA1MDYuOTQgMzExLjEgNTEyIDMwNC41IDUxMnpNNzY4LjcxIDExLjI0Yy0yLjMxLTYuMTguODUtOS4zNCA3LTdsMTI2LjUgNDcuNGM2LjE4IDIuMzIgMTMuMTMgOS4yNyAxNS40NSAxNS40NWwxNjIuNjMgNDMzLjY3YzIuMzEgNi4xOC0xLjE5IDExLjI0LTcuNzkgMTEuMjRoLTEwNGMtNi42IDAtMTMuOS01LjA2LTE2LjIxLTExLjI0eiIgZmlsbD0iIzZiM2U3NSIvPjxwYXRoIGQ9Ik05OTIuMTMgOTVjLTIuMzItNi4xOC44NC05LjM0IDctN2wxMjYuNDggNDcuNDJjNi4xOCAyLjMyIDEzLjEzIDkuMjcgMTUuNDUgMTUuNDVsMTMxLjIzIDM0OS44OWMyLjMxIDYuMTgtMS4xOSAxMS4yNC03Ljc5IDExLjI0aC0xMDRjLTYuNiAwLTEzLjktNS4wNi0xNi4yMS0xMS4yNHoiIGZpbGw9IiM5MDVlYTkiLz48L3N2Zz4="
|
||||
|
@@ -12,19 +12,26 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
<i class="fad fa-briefcase t-size-16 mr-s t-muted"></i><a href="../" class="a-hidden">{{ l10n("header.root", "projects", user_lang) }}</a>
|
||||
<span class="mobile-hide"><span class="mx-s t-size-15">❱</span>{{ l10n(tool_data.metadata.general.title_key, tool_id, user_lang) }}</span>
|
||||
{% if not is_standalone %}
|
||||
<i class="fad fa-briefcase t-size-16 mr-s t-muted"></i><a href="../" class="a-hidden">{{ l10n("header.root", "projects", user_lang) }}</a>
|
||||
<span class="mobile-hide"><span class="mx-s t-size-15">❱</span>{{ l10n(tool_data.metadata.general.title_key, tool_id, user_lang) }}</span>
|
||||
{% else %}
|
||||
<span class="mobile-hide">NibblePoker<span class="mx-s t-size-15">❱</span></span>{{ l10n(tool_data.metadata.general.title_key, tool_id, user_lang) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block main_content %}
|
||||
{{ render_h1(
|
||||
'<i class="' + tool_data.metadata.general.icon + ' t-size-16 mr-s t-muted"></i>' +
|
||||
l10n(tool_data.metadata.general.title_key, tool_id, user_lang)
|
||||
) }}
|
||||
|
||||
<div class="px-xxs">
|
||||
{% if not is_standalone %}
|
||||
{{ render_h1(
|
||||
'<i class="' + tool_data.metadata.general.icon + ' t-size-16 mr-s t-muted"></i>' +
|
||||
l10n(tool_data.metadata.general.title_key, tool_id, user_lang)
|
||||
) }}
|
||||
<div class="p-s">
|
||||
{% include 'applets/'+applet_data.id+'.jinja' %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include 'applets/'+applet_data.id+'.jinja' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
|
Reference in New Issue
Block a user