Skip to content

Commit e6abd3e

Browse files
committed
syriac script forcing added
1 parent 9848bd2 commit e6abd3e

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

‎dev-browse.html‎

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ <h2>Browse Manuscripts</h2>
301301
return periodFields.includes(key) ? val.join('. ') : val.join(', ');
302302
};
303303

304-
// Create content summary from all title fields
305-
const titleFields = ['titleStmt', 'msItemTitle', 'rubric', 'syrTitle'];
304+
// Create syriac content summary from all title fields
305+
const titleFields = ['syrTitle','rubric','incipit','explicit','finalRubric'];
306306
const allTitles = [];
307307
titleFields.forEach(field => {
308308
if (item[field]) {
@@ -316,24 +316,28 @@ <h2>Browse Manuscripts</h2>
316316
let contentSummary = allTitles.join(' ');
317317
// Strip HTML tags
318318
contentSummary = contentSummary.replace(/<[^>]*>/g, '');
319-
const truncated = contentSummary.length > 500;
320-
const displayContent = truncated ? contentSummary.substring(0, 500) : contentSummary;
319+
const truncated = contentSummary.length > 100;
320+
const displayContent = truncated ? contentSummary.substring(0, 100) : contentSummary;
321321

322322
const msUrl = item.id ? `${BASE_URL}/ms/${item.id.replace('ms-', '')}.html` : '#';
323323

324324
return `
325-
<div class="result-item">
326-
<strong>${item.displayTitleEnglish ? `<p>${formatValue(item.displayTitleEnglish, 'displayTitleEnglish')}</strong></p>` : ''}
327-
${contentSummary ? `<p><strong>Content:</strong> <span class="content-text" id="content-${index}">${displayContent}${truncated ? '' : ''}</span>${truncated ? ` <a href="#" class="show-more" data-index="${index}" data-full="${contentSummary.replace(/"/g, '&quot;')}">...</a>` : ''}</p>` : ''}
328-
<p><strong>Shelfmark:</strong> ${formatValue(item.shelfmark, 'shelfmark') || 'N/A'}</p>
329-
<p>URL: <a href="${msUrl}" target="_blank">${msUrl}</a></p>
330-
<small class="text-muted">
331-
${item.material ? `Material: ${formatValue(item.material, 'material')} | ` : ''}
332-
${item.script ? `Script: ${formatValue(item.scriptLanguage, 'script')} | ` : ''}
333-
${item.classification ? `Classification: ${formatValue(item.classification, 'classification')}` : ''}
334-
</small>
335-
</div>
336-
`}).join('');
325+
<div class="result-item" style="padding:15px; border:1px solid #ddd; margin-bottom:10px; border-radius:5px;">
326+
<p><strong></strong> ${formatValue(item.shelfmark, 'shelfmark') || ''}
327+
${item.wrightNum ? `[${formatValue(item.wrightNum, 'wrightNum')} ]` : ''}
328+
</p>
329+
<p>URI: <a href="${msUrl}" target="_blank">${msUrl}</a></p>
330+
<p>${item.origDate ? `${formatValue(item.origDate, 'origDate')}` : ''}${item.origPlace ? ` | ${formatValue(item.origPlace, 'origPlace')}` : ''}</p>
331+
<p class="text-muted">
332+
${item.scriptLanguage ? `Script: ${item.scriptLanguage} ` : ''}
333+
${item.material ? `| ${formatValue(item.material, 'material')} ` : ''}
334+
${item.form ? ` ${formatValue(item.form, 'material')} ` : ''}
335+
${item.extent ? `| ${formatValue(item.extent, 'extent')} ` : ''}
336+
</p>
337+
${item.classification ? `Classification: ${formatValue(item.classification, 'classification')}` : ''}
338+
<p id="content-${index}"><span class="syriac">${displayContent}</span>${truncated ? `... <a href="#" class="show-more" data-index="${index}" data-full="${contentSummary}">Show more</a>` : ''}</p>
339+
</div>
340+
`}).join('');
337341

338342
$('#results').html(resultsHtml || '<div class="alert alert-info">No results found</div>');
339343

@@ -342,7 +346,7 @@ <h2>Browse Manuscripts</h2>
342346
e.preventDefault();
343347
const index = $(this).data('index');
344348
const full = $(this).data('full');
345-
$(`#content-${index}`).text(full);
349+
$(`#content-${index}`).html(`<span class="syriac">${full}</span>`);
346350
$(this).remove();
347351
});
348352
}

0 commit comments

Comments
 (0)