mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
57ec9b0c4a
21 changed files with 377 additions and 41 deletions
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:34+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -492,6 +492,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2023-11-18 05:03+0000\n"
|
||||
"Last-Translator: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>\n"
|
||||
"Language-Team: Arabic <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -499,6 +499,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "النص الذي تودّ تعديله"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
|
|
@ -491,6 +491,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2025-06-08 19:07+0000\n"
|
||||
"Last-Translator: Ettore Atalan <atalanttore@googlemail.com>\n"
|
||||
"Language-Team: German <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -508,6 +508,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Zu ändernder Text"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2024-10-22 18:15+0000\n"
|
||||
"Last-Translator: gallegonovato <fran-carro@hotmail.es>\n"
|
||||
"Language-Team: Spanish <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -509,6 +509,21 @@ msgstr ""
|
|||
"\n"
|
||||
"Acabo de firmar el documento (%s) : %s"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Texto a modificar"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2025-06-25 23:02+0000\n"
|
||||
"Last-Translator: xabirequejo <xabi.rn@gmail.com>\n"
|
||||
"Language-Team: Basque <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -513,6 +513,21 @@ msgstr ""
|
|||
"\n"
|
||||
"Dokumentua (%s) sinatu berri dut: %s"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Moldatzeko testua"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2025-07-01 12:33+0000\n"
|
||||
"Last-Translator: 24ème <equipe@24eme.fr>\n"
|
||||
"Language-Team: French <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -511,6 +511,21 @@ msgstr ""
|
|||
"\n"
|
||||
"Je viens de signer le document (%s) : %s"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Texte à modifier"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2024-10-14 07:49+0000\n"
|
||||
"Last-Translator: 24ème <equipe@24eme.fr>\n"
|
||||
"Language-Team: Galician <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -506,6 +506,21 @@ msgstr ""
|
|||
"\n"
|
||||
"asinei o documento (%s): %s"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Texto a modificar"
|
||||
|
||||
|
|
|
|||
|
|
@ -558,6 +558,21 @@ msgstr "Organizza"
|
|||
msgid "Metadata"
|
||||
msgstr "Metadata"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "The PDF must not exceed "
|
||||
#~ msgstr "Il PDF non deve superare "
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2025-06-03 16:01+0000\n"
|
||||
"Last-Translator: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>\n"
|
||||
"Language-Team: Kabyle <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -506,6 +506,21 @@ msgstr ""
|
|||
"\n"
|
||||
"Tura kan i zemleɣ zzmam (%s): %s"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Aḍris ara yettuṣeggmen"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
|
|
@ -491,6 +491,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -560,6 +560,21 @@ msgstr "Organizar"
|
|||
msgid "Metadata"
|
||||
msgstr "Metadonadas"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "The PDF must not exceed "
|
||||
#~ msgstr "Lo PDF deu pas despassar "
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2025-06-02 13:01+0000\n"
|
||||
"Last-Translator: Armando Bastoni <weblate@sabato.anonaddy.com>\n"
|
||||
"Language-Team: Polish <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -496,6 +496,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2024-01-02 19:08+0000\n"
|
||||
"Last-Translator: Alexandru-Ionut Chiuta <chiuta@gmail.com>\n"
|
||||
"Language-Team: Romanian <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -505,6 +505,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Text de modificat"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2025-04-20 21:02+0000\n"
|
||||
"Last-Translator: தமிழ்நேரம் <anishprabu.t@gmail.com>\n"
|
||||
"Language-Team: Tamil <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -506,6 +506,21 @@ msgstr ""
|
|||
"\n"
|
||||
" நான் ஆவணத்தில் கையெழுத்திட்டேன் ( %s): %s"
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "மாற்ற உரை"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-07-01 14:31+0200\n"
|
||||
"POT-Creation-Date: 2025-07-04 15:24+0200\n"
|
||||
"PO-Revision-Date: 2023-12-06 14:10+0000\n"
|
||||
"Last-Translator: Metin Gür <gurmetin@gmail.com>\n"
|
||||
"Language-Team: Turkish <https://hosted.weblate.org/projects/signature-pdf/"
|
||||
|
|
@ -505,6 +505,21 @@ msgid ""
|
|||
"I just signed the document (%s) : %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the color of the selected element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate on each page"
|
||||
msgstr ""
|
||||
|
||||
msgid "Duplicate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete the element"
|
||||
msgstr ""
|
||||
|
||||
msgid "Text to modify"
|
||||
msgstr "Değiştirilecek metin"
|
||||
|
||||
|
|
|
|||
|
|
@ -74,8 +74,22 @@
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
#toolbox i {
|
||||
#toolbox div {
|
||||
cursor: pointer;
|
||||
padding: 1px;
|
||||
display: inline-block;
|
||||
padding-left: .25rem;
|
||||
padding-right: .25rem;
|
||||
}
|
||||
|
||||
#toolbox div + div {
|
||||
border-left: 1px solid #CCC;
|
||||
}
|
||||
|
||||
#toolbox .dropdown-menu {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.canvas-container .btn-drag, .canvas-container .btn-rotate, .canvas-container .btn-delete, .canvas-container .btn-select, .canvas-container .btn-download, .canvas-container .btn-restore, .canvas-container .btn-drag-here, .canvas-container .btn-drag-here_mobile, .canvas-container .btn-cancel {
|
||||
|
|
|
|||
|
|
@ -49,10 +49,15 @@ async function loadPDF(pdfBlob, filename, pdfIndex) {
|
|||
let pageIndex = pdfLetter + "_" + (page.pageNumber - 1);
|
||||
pages[pageIndex] = page;
|
||||
const viewportFormat = page.getViewport({ scale: 1 });
|
||||
const widthFormat = Math.round(viewportFormat.width * 25.4 / 72 * 10) / 10;
|
||||
const heightFormat = Math.round(viewportFormat.height * 25.4 / 72 * 10) / 10;
|
||||
formats[pageIndex] = widthFormat + " x " + heightFormat + " mm";
|
||||
let pageTitle = trad['Page'] + ' ' + page.pageNumber + ' - '+formats[pageIndex]+' - ' + filename;
|
||||
const widthFormat = Math.round(viewportFormat.width * 25.4 / 72);
|
||||
const heightFormat = Math.round(viewportFormat.height * 25.4 / 72);
|
||||
const format = [widthFormat,heightFormat].sort().join('x')
|
||||
|
||||
if(!formats[format]) {
|
||||
formats[format] = []
|
||||
}
|
||||
formats[format].push(pageIndex);
|
||||
let pageTitle = trad['Page'] + ' ' + page.pageNumber + ' - ' + widthFormat + ' x ' + heightFormat + ' mm - ' + filename;
|
||||
let pageHTML = '<div class="position-relative mt-0 ms-1 me-0 mb-1 canvas-container d-flex align-items-center justify-content-center bg-transparent bg-opacity-25 border border-2 border-transparent" id="canvas-container-' + pageIndex +'" draggable="true">';
|
||||
pageHTML += '<canvas class="canvas-pdf shadow-sm"></canvas>';
|
||||
pageHTML += '<div title="' + trad['Select this page'] + '" class="position-absolute top-0 start-50 translate-middle-x p-2 ps-3 pe-3 mt-2 rounded-circle btn-select d-none"><i class="bi bi-check-square"></i></div>';
|
||||
|
|
@ -251,6 +256,8 @@ async function pageRender(pageIndex) {
|
|||
canvasContext: context,
|
||||
viewport: viewport,
|
||||
});
|
||||
|
||||
updateFormats();
|
||||
}
|
||||
|
||||
function getFileIndex(page) {
|
||||
|
|
@ -305,6 +312,22 @@ function updateListePDF() {
|
|||
updateGlobalState();
|
||||
}
|
||||
|
||||
function updateFormats() {
|
||||
document.querySelector('#list_formats').innerHTML = "";
|
||||
for (let format in formats) {
|
||||
document.querySelector('#list_formats').insertAdjacentHTML('beforeend', '<li id="format_' + format + '" class="list-group-item ps-2 pe-5"><span class="ms-2">'+format+' mm : '+formats[format].length+' pages</span> <input class="form-check-input float-end position-absolute file-list-checkbox" type="checkbox" value="'+format+'" /></li>');
|
||||
document.querySelector('#format_' + format+ ' input[type=checkbox]').addEventListener('change', function(e) {
|
||||
for(numPage of formats[this.value]) {
|
||||
let page = document.getElementById('canvas-container-' + numPage);
|
||||
if(!isPageDeleted(page)) {
|
||||
selectPage(page, e.target.checked);
|
||||
}
|
||||
}
|
||||
updateGlobalState();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getPagesSelected() {
|
||||
let pages = [];
|
||||
document.querySelectorAll('.canvas-container .input-select:checked').forEach(function(item) {
|
||||
|
|
@ -474,6 +497,26 @@ function updateFilesState() {
|
|||
document.querySelector('#file_'+fileIndex+' span').classList.add('text-primary');
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelectorAll('#list_formats input[type=checkbox]').forEach(function(checkbox) {
|
||||
let format = checkbox.value;
|
||||
let numPages = formats[format];
|
||||
checkbox.checked = false;
|
||||
checkbox.indeterminate = false;
|
||||
document.querySelector('#format_'+format).classList.remove('text-primary');
|
||||
for(numPage of numPages) {
|
||||
let page = document.getElementById('canvas-container-' + numPage);
|
||||
if(isPageSelected(page)) {
|
||||
checkbox.checked = true;
|
||||
} else if(!isPageDeleted(page) && checkbox.checked) {
|
||||
checkbox.checked = false;
|
||||
checkbox.indeterminate = true;
|
||||
}
|
||||
}
|
||||
if(checkbox.checked || checkbox.indeterminate) {
|
||||
document.querySelector('#format_'+format).classList.add('text-primary');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateGlobalState() {
|
||||
|
|
|
|||
|
|
@ -1262,30 +1262,35 @@ function storePenColor(color) {
|
|||
}
|
||||
|
||||
const toolBox = (function () {
|
||||
const _coloricon = document.createElement('i')
|
||||
_coloricon.classList.add('bi', 'bi-droplet-fill', 'mx-1')
|
||||
|
||||
const _trashicon = document.createElement('i')
|
||||
_trashicon.classList.add('bi', 'bi-trash3', 'float-end', 'border-start', 'border-2', 'mx-1', 'ps-1')
|
||||
|
||||
const _copyicon = document.createElement('i')
|
||||
_copyicon.classList.add('bi', 'bi-copy', 'mx-1')
|
||||
|
||||
let _elSelected
|
||||
|
||||
const _elToolbox = document.createElement('div')
|
||||
_elToolbox.id = 'toolbox'
|
||||
_elToolbox.classList.add('position-absolute', 'border', 'p-1', 'bg-body-secondary', 'shadow-sm', 'ms-3', 'mt-3', 'd-none', 'd-md-block')
|
||||
_elToolbox.classList.add('position-absolute', 'border', 'p-1', 'bg-body-secondary', 'shadow-sm', 'ms-3', 'mt-3', 'd-none', 'd-md-block', 'user-select-none')
|
||||
_elToolbox.style['z-index'] = 1030
|
||||
_elToolbox.style.width = 'max-content'
|
||||
|
||||
_elToolbox.appendChild(_coloricon)
|
||||
_elToolbox.appendChild(_trashicon)
|
||||
_elToolbox.appendChild(_copyicon)
|
||||
const _elToolboxElements = document.querySelector("#toolbox-elements-template").content.cloneNode(true)
|
||||
_elToolbox.appendChild(_elToolboxElements)
|
||||
|
||||
_coloricon.addEventListener('click', _changeColor)
|
||||
_trashicon.addEventListener('click', _delete)
|
||||
_copyicon.addEventListener('click', _copy)
|
||||
_elToolbox.addEventListener('click', function (e) {
|
||||
e.preventDefault()
|
||||
target = e.target
|
||||
|
||||
el = target.closest("[data-action]")
|
||||
if (el) {
|
||||
switch (el.dataset.action) {
|
||||
case "changeColor":
|
||||
_changeColor(); break;
|
||||
case "delete":
|
||||
_delete(); break;
|
||||
case "copy":
|
||||
_copy(); break;
|
||||
case "duplicate":
|
||||
_duplicate(); break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function _changeColor() {
|
||||
const _colorpicker = document.createElement('input')
|
||||
|
|
@ -1305,6 +1310,14 @@ const toolBox = (function () {
|
|||
}
|
||||
|
||||
function _copy() {
|
||||
_elSelected.clone(function (clonedItem) {
|
||||
clonedItem.top -= 20;
|
||||
clonedItem.left += 20;
|
||||
addObjectInCanvas(_elSelected.canvas, clonedItem).setActiveObject(clonedItem)
|
||||
})
|
||||
}
|
||||
|
||||
function _duplicate() {
|
||||
canvasEditions.forEach(function (canvas) {
|
||||
if (_elSelected.canvas === canvas) {
|
||||
return
|
||||
|
|
@ -1331,16 +1344,23 @@ const toolBox = (function () {
|
|||
const container = document.getElementById('container-pages')
|
||||
container.appendChild(_elToolbox)
|
||||
|
||||
const xCoords = _elSelected.getCoords().map((c) => c.x)
|
||||
const yCoords = _elSelected.getCoords().map((c) => c.y)
|
||||
|
||||
_elToolbox.style.left = (
|
||||
_elSelected.getBoundingRect().left
|
||||
+ _elSelected.getScaledWidth() / 2
|
||||
- _elToolbox.offsetWidth / 2
|
||||
+ +window.getComputedStyle(_elToolbox).getPropertyValue("margin-left").replace('px', '')
|
||||
Math.min(...xCoords) // on sélectionne le coin le plus à gauche
|
||||
+ _elSelected.canvas._offset.left // décalage du canvas dans le viewport
|
||||
+ (
|
||||
Math.max(...xCoords) // on sélectionne le coin le plus à droite
|
||||
- Math.min(...xCoords) // on sélectionne le coin le plus à gauche
|
||||
) / 2 // pour calculer la largeur et avoir le centre
|
||||
- _elToolbox.offsetWidth / 2 // centre de la toolbox
|
||||
- +window.getComputedStyle(_elToolbox).getPropertyValue("margin-left").replace('px', '')
|
||||
) + 'px'
|
||||
_elToolbox.style.top = (
|
||||
Math.max(..._elSelected.getCoords().map((c) => c.y)) // on sélectionne le coin le plus bas
|
||||
Math.max(...yCoords) // on sélectionne le coin le plus bas
|
||||
+ _elSelected.canvas._offset.top // hauteur du canvas dans le viewport
|
||||
+ container.scrollTop // haut du container
|
||||
+ container.scrollTop // haut du container
|
||||
) + 'px'
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,14 @@
|
|||
<input id="input_pdf_upload_2" class="form-control d-none" type="file" accept=".pdf,application/pdf,image/png,image/jpeg" multiple="true">
|
||||
</div>
|
||||
<hr />
|
||||
<div id="list_format_container">
|
||||
<div class="card">
|
||||
<div class="card-header small">Formats des pages</div>
|
||||
<ul id="list_formats" class="list-group list-group-flush small" style="max-height: 130px; overflow: auto;">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="container_btn_select" class="opacity-50 card">
|
||||
<div class="card-header small text-center p-1"><?php echo sprintf(_("%s page(s) selected"), '<span>0</span>'); ?> <button id="btn_cancel_select" type="button" class="btn-close btn-close-white float-end" aria-label="Close"></button></div>
|
||||
<div class="card-body d-grid gap-2 p-2">
|
||||
|
|
|
|||
|
|
@ -288,6 +288,17 @@
|
|||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<template id="toolbox-elements-template">
|
||||
<div class="toolbox-action" data-action="changeColor" title="<?php echo _("Change the color of the selected element") ?>"><i class="bi bi-droplet-fill"></i></div>
|
||||
<div class="toolbox-action dropdown" title="<?php echo _("Duplicate the element") ?>">
|
||||
<span class="text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" data-bs-auto-close="inside"><i class="bi bi-copy mx-1"></i></span>
|
||||
<ul class="dropdown-menu shadow-sm bg-body-secondary">
|
||||
<li><a class="dropdown-item" data-action="duplicate"><?php echo _("Duplicate on each page") ?></a></li>
|
||||
<li><a class="dropdown-item" data-action="copy"><?php echo _("Duplicate") ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="toolbox-action" data-action="delete" title="<?php echo _("Delete the element") ?>"><i class="bi bi-trash3"></i></div>
|
||||
</template>
|
||||
<?php $loadJs = ['pdf.js' => true]; include('components/common.html.php'); ?>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/fabric.min.js?5.4.0"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/signature_pad.umd.min.js?5.0.3"></script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue