Skip to content

Commit eef8f8f

Browse files
committed
bug fix
1 parent 6e048da commit eef8f8f

File tree

5 files changed

+68
-24
lines changed

5 files changed

+68
-24
lines changed

JS/metadata.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ document.getElementById('addManuscriptBtn').addEventListener('click', () => {
66
addManuscriptForm();
77
});
88

9-
function addManuscriptForm(data = {}) {
9+
function addManuscriptForm(data = {}, shouldScroll = true) {
1010
manuscriptCounter++;
1111
const id = `manuscript-${manuscriptCounter}`;
1212
const formId = `msForm-${manuscriptCounter}`;
@@ -315,7 +315,10 @@ function addManuscriptForm(data = {}) {
315315
`;
316316
container.appendChild(form);
317317

318-
form.scrollIntoView({ behavior: 'smooth', block: 'start' });
318+
// ✅ Scroll only if explicitly requested
319+
if (shouldScroll) {
320+
form.scrollIntoView({ behavior: 'smooth', block: 'start' });
321+
}
319322

320323
return form
321324
}
@@ -1252,7 +1255,7 @@ document.getElementById('fileUpload').addEventListener('change', function (e) {
12521255
reader.readAsText(file);
12531256
});
12541257

1255-
addManuscriptForm();
1258+
addManuscriptForm({}, false);
12561259

12571260

12581261
document.addEventListener('input', function (e) {

collection.html

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,25 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">&lt;MANO&gt;</h5>
6363
<h1 class="page-title">Metadata Collection</h1>
6464

6565
<div class="row my-4 align-items-end">
66-
<div class="col-md-6 d-flex justify-content-start">
67-
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#infoMetadataCollection">
68-
About Metadata Collection
69-
</button>
70-
</div>
71-
<div class="col-md-6 d-flex justify-content-end">
72-
<a href="https://github.com/mano-project/mano-metadata/tree/main/data" class="btn btn-primary" target="_blank" rel="noopener noreferrer">Contribute to the Collection
73-
<i class="fab fa-github fa-xl ms-2"></i></a>
74-
</div>
66+
<!-- Left column -->
67+
<div class="col-12 col-md-6 d-flex justify-content-start mb-2 mb-md-0">
68+
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#infoMetadataCollection">
69+
About Metadata Collection
70+
</button>
7571
</div>
7672

73+
<!-- Right column -->
74+
<div class="col-12 col-md-6 d-flex justify-content-start justify-content-md-end">
75+
<a href="https://github.com/mano-project/mano-metadata/tree/main/data"
76+
class="btn btn-primary"
77+
target="_blank"
78+
rel="noopener noreferrer">
79+
Contribute to the Collection <i class="fab fa-github fa-xl ms-2"></i>
80+
</a>
81+
</div>
82+
</div>
83+
84+
7785
<!-- About Metadata Editor Modal -->
7886
<div class="modal fade" id="infoMetadataCollection" tabindex="-1" aria-labelledby="infoMetadataCollectionLabel" aria-hidden="true">
7987
<div class="modal-dialog modal-lg">

editor.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,25 @@ <h1 class="page-title">Metadata Editor</h1>
6666

6767
<div class="container data-enter">
6868
<div class="row my-4 align-items-end">
69-
<div class="col-md-4 d-flex justify-content-start">
69+
<!-- Left column -->
70+
<div class="col-12 col-md-4 d-flex justify-content-start mb-2 mb-md-0">
7071
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#infoMetadataEditor">
7172
About Metadata Editor
7273
</button>
7374
</div>
7475

75-
<div class="col-md-4 text-center">
76+
<!-- Middle column -->
77+
<div class="col-12 col-md-4 text-start text-md-center mb-2 mb-md-0">
7678
<label for="fileUpload" class="form-label">Upload XML or JSON</label>
7779
<input type="file" id="fileUpload" class="form-control" accept=".xml,.json">
7880
</div>
7981

80-
<div class="col-md-4 d-flex justify-content-end">
82+
<!-- Right column -->
83+
<div class="col-12 col-md-4 d-flex justify-content-start justify-content-md-end">
8184
<button id="addManuscriptBtn" class="btn btn-primary">Add manuscript</button>
8285
</div>
8386
</div>
87+
8488
<div id="manuscriptFormsContainer"></div>
8589
<div class="text-center mt-5">
8690
<div class="dropdown">

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ <h3>Transcription Viewer</h3>
8989
<h2 class="text-center">What is &lt;MANO&gt;?</h2>
9090

9191
<p style="text-align: justify;"><span class="mano">&lt;MANO&gt;</span> is a digital platform designed to support the scholarly study, structured description, and transcription of manuscripts. Developed for academic research and teaching, <span class="mano">&lt;MANO&gt;</span> serves as a workspace where users can interact with sources through structured metadata entry, manuscripts metadata collections and transcription viewer. By combining a user-friendly interface with compliance to <a href="https://tei-c.org/release/doc/tei-p5-doc/en/html/MS.html" target="_blank">TEI P5 manuscript description guidelines</a>, the platform enables the creation of interoperable metadata, encoding of historical and codicological data, and export of information in widely used formats such as TEI-XML, JSON, RDF, and CSV. This ensures both compatibility with other digital humanities initiatives and long-term reusability of the data.</p>
92-
<p style="text-align: justify;">The <a href="editor.html">Metadata editor</a> facilitates detailed documentation of a manuscript's physical, historical, and codicological features - such as origin, provenance, script, dimensions, and more - while offering download options for further analysis or archival purposes. Once manuscript metadata is finalized, the resulting JSON files can be contributed to the <span class="mano">&lt;MANO&gt;</span> GitHub repository. All records automatically become part of the publicly accessible <a href="collection.html">Metadata Collection</a>, where manuscript descriptions contributed by the community can be explored, searched, and filtered.
92+
<p style="text-align: justify;">The <a href="editor.html">Metadata Editor</a> facilitates detailed documentation of a manuscript's physical, historical, and codicological features - such as origin, provenance, script, dimensions, and more - while offering download options for further analysis or archival purposes. Once manuscript metadata is finalized, the resulting JSON files can be contributed to the <span class="mano">&lt;MANO&gt;</span> GitHub repository. All records automatically become part of the publicly accessible <a href="collection.html">Metadata Collection</a>, where manuscript descriptions contributed by the community can be explored, searched, and filtered.
9393
The <a href="viewer.html">Transcription Viewer</a> supports TEI XML encoding and provides a visual interface where users can simultaneously view XML code, rendered transcription, and digitized facsimiles for a fully synchronized editing and reading experience.
9494

9595
In addition, the <a href="resources.html">Resources</a> section provides learning materials, guidelines, and references for manuscript studies, TEI encoding, and digital editing practices. This combination of structured metadata management, collaborative metadata sharing, transcription tools, and educational resources makes <span class="mano">&lt;MANO&gt;</span> a practical tool for teaching manuscript studies, experimenting with digital editing, and engaging in collaborative research. It empowers users not only to study manuscripts but to meaningfully contribute to the creation of digital scholarly resources.</p>

viewer.html

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">&lt;MANO&gt;</h5>
6969
<li class="nav-item"><a class="nav-link" href="resources.html">Resources</a></li>
7070
<li class="nav-item"><a class="nav-link" href="editor.html">Metadata Editor</a></li>
7171
<li class="nav-item"><a class="nav-link" href="collection.html">Metadata Collection</a></li>
72-
<li class="nav-item"><a class="nav-link editor" href="viewer.html">Transcription Viewer</a></li>
72+
<li class="nav-item"><a class="nav-link active" href="viewer.html">Transcription Viewer</a></li>
7373
<li class="nav-item"><a class="nav-link" href="contacts.html">Contacts</a></li>
7474
</ul>
7575
</div>
@@ -82,14 +82,43 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">&lt;MANO&gt;</h5>
8282
<button onclick="history.back()" class="btn btn-sm btn-outline-secondary">&larr; Back</button>
8383
</div>
8484
<h1 class="page-title">Transcription Viewer</h1>
85-
86-
87-
<div class="row mb-3">
88-
<div class="col">
89-
<label for="xmlFileInput" class="form-label">Upload TEI-XML</label>
90-
<input class="form-control" type="file" id="xmlFileInput" accept=".xml">
91-
</div>
85+
86+
<div class="row align-items-end my-4">
87+
<!-- Button column -->
88+
<div class="col-md-auto mb-3 mb-md-0">
89+
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#infoTranscriptionViewer">
90+
About Transcription Viewer
91+
</button>
92+
</div>
93+
94+
<!-- File input column -->
95+
<div class="col-md mb-3 mb-md-0">
96+
<label for="xmlFileInput" class="form-label">Upload TEI-XML</label>
97+
<input class="form-control" type="file" id="xmlFileInput" accept=".xml">
98+
</div>
99+
</div>
100+
101+
102+
<!-- About Metadata Editor Modal -->
103+
<div class="modal fade" id="infoTranscriptionViewer" tabindex="-1" aria-labelledby="infoTranscriptionViewerLabel" aria-hidden="true">
104+
<div class="modal-dialog modal-lg">
105+
<div class="modal-content">
106+
<div class="modal-header">
107+
<h5 class="modal-title" id="infoTranscriptionViewerLabel">About Metadata Editor</h5>
108+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
109+
</div>
110+
<div class="modal-body">
111+
<span>The Transcription Viewer allows the upload of manuscript transcriptions created with external tools in XML format. Once loaded, the transcription is displayed in three synchronized views: the <b>raw XML code</b>, a <b>rendered text</b> version with basic styling, and - when available - <b>digitized manuscript images</b> aligned with the transcription. This setup enables a combined view of structure, content, and original manuscript facsimiles.
112+
<br/>The XML can be modified directly within the editor panel. By clicking <b>Update Preview</b>, the visual rendering and image alignment are refreshed to reflect the changes. The updated transcription may then be downloaded as a new XML file for further use.
113+
</span>
114+
</div>
115+
<div class="modal-footer">
116+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
92117
</div>
118+
</div>
119+
</div>
120+
</div>
121+
93122

94123
<div id="pageNav" class="text-center mb-3">
95124
<button class="btn btn-outline-primary btn-sm" onclick="previousPage()">Previous Page</button>

0 commit comments

Comments
 (0)