Compare commits

..

4 Commits

Author SHA1 Message Date
jetsparrow
dd9215ec9f Add binary files attributes 2025-09-17 22:44:52 +03:00
jetsparrow
08f9d1b0bf coerce record fields to string in sanitize 2025-09-16 01:39:25 +03:00
jetsparrow
9716f2c5b1 style output textarea as class 2025-09-16 01:35:49 +03:00
jetsparrow
ccc440c0d1 move script files 2025-09-16 01:35:28 +03:00
6 changed files with 45 additions and 15 deletions

29
.gitattributes vendored Normal file
View File

@ -0,0 +1,29 @@
# Default behavior: if Git thinks a file is text (as opposed to binary), it
# will normalize line endings to LF in the repository, but convert to your
# platform's native line endings on checkout (e.g., CRLF for Windows).
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout. E.g.,
# *.txt text
# Declare files that will always have CRLF line endings on checkout. E.g.,
#*.sln text eol=crlf
# Declare files that will always have LF line endings on checkout. E.g.,
*.sh text eol=lf
*.json text eol=lf
# Denote all files that should not have line endings normalized, should not be
# merged, and should not show in a textual diff.
*.docm binary
*.docx binary
*.odf binary
*.xlsx binary
*.ico binary
*.lib binary
*.png binary
*.pptx binary
*.snk binary
*.vsdx binary
*.xps binary

View File

@ -4,9 +4,9 @@
<title>ЖСК Мечта - генерация бюллетеней</title>
<link rel="stylesheet" href="style.css"/>
<script src="dist/csv.js"></script>
<script src="dist/jszip.min.js"></script>
<script src="create-ballots.js" type="module"></script>
<script src="scripts/lib/csv.js"></script>
<script src="scripts/lib/jszip.min.js"></script>
<script src="scripts/create-ballots.js" type="module"></script>
</head>
<body>
@ -32,5 +32,5 @@
<progress class="hidden" id="progressbar"> </progress>
<br>
<textarea readonly id="output_text"> </textarea>
<textarea readonly class="output" id="output_text"> </textarea>
</body>

View File

@ -41,13 +41,13 @@ function sanitizeRecord(record)
const noData="нет данных";
for (var i = 0; i < record.length; ++i)
{
if ((""+record[i]).trim().toLowerCase() == noData)
if (!record[i] || (""+record[i]).trim().toLowerCase() == noData)
{
record[i] = "";
}
else if(!record[i])
else
{
record[i] = "";
record[i] = ""+record[i];
}
}
return record;
@ -69,23 +69,23 @@ async function populateBallot(template, record){
patches: {
APT_NUM: {
type: PatchType.PARAGRAPH,
children: [ new TextRun(""+record[2])],
children: [ new TextRun(record[2])],
},
FIO: {
type: PatchType.PARAGRAPH,
children: [ new TextRun(""+record[3])],
children: [ new TextRun(record[3])],
},
APT_AREA: {
type: PatchType.PARAGRAPH,
children: [ new TextRun(""+record[5])],
children: [ new TextRun(record[5])],
},
SHARE: {
type: PatchType.PARAGRAPH,
children: [ new TextRun(""+record[6])],
children: [ new TextRun(record[6])],
},
DOCUMENT_NUM: {
type: PatchType.PARAGRAPH,
children: [ new TextRun(""+record[8])],
children: [ new TextRun(record[8])],
},
DOCUMENT_DATE: {
type: PatchType.PARAGRAPH,
@ -93,7 +93,7 @@ async function populateBallot(template, record){
},
SNILS: {
type: PatchType.PARAGRAPH,
children: [ new TextRun(""+record[10])],
children: [ new TextRun(record[10])],
}
},
});

View File

@ -15,9 +15,10 @@ input[type="file"]{
field-sizing: content;
}
textarea#output_text
textarea.output
{
width: 400px;
height: 400px;
overflow-y: scroll;
resize: none;
}