` return li } async function updateResultsList (documents, searchIndex) { results.classList.remove('hidden') ul.innerHTML = '' message.innerHTML = `Searching for ‘${input.value}’...` const searchResults = await searchIndex.search( input.value, { boost: { title: 2 } } ) for (const result of searchResults.slice(0, 5)) { const doc = documents.filter(doc => doc.id === result.id)[0] ul.appendChild(makeResultListItem(doc)) } if (ul.children.length === 0) { const li = makeListItem() li.innerHTML = `\

No results

` ul.appendChild(li) } } function hideDropdown() { message.innerHTML = '' ul.innerHTML = '' results.classList.add('hidden') } function hideSearch() { hideDropdown() input.value = '' event.currentTarget.blur() } function handleKeyup (event, documents, searchIndex) { switch (event.key) { case 'Escape': hideSearch() break default: if (input.value.length < 2) { hideDropdown() break } else { updateResultsList(documents, searchIndex) } } } function addEventListeners (documents, searchIndex) { // User types something in search bar input.addEventListener('keyup', event => { debounce(handleKeyup(event, documents, searchIndex)) }) // User clicks the X in the search bar cancelSearch.addEventListener('click', event => hideSearch()) // Key pressed on search results results.addEventListener('keyup', event => { if (event.key === 'Escape') hideSearch() }) } if (docsUrl) { const { documents, searchIndex } = await getData() addEventListeners(documents, searchIndex) } else { input.setAttribute('hidden', true) cancelSearch.setAttribute('hidden', true) } })
  • Account
  • How to Declare Competing Interests

    The Open Library of Humanities (OLH) follows a standard format in all articles for the declaration of competing interests (see OLH's 'Publication Ethics and Malpractice Statement' for further information on what constitutes a competing interest).

    The following formats must be adhered to when making a declaration.

    For Authors

    Please place the competing interests section at the end of the manuscript, immediately before the reference list. The author's initials should be used to denote differing competing interests. For example:

    'TW completed paid consultancy work from [company name] as part of the data acquisition for this study. BH has minority shares in [company name], which part funded the research grant for this project. SM is a member of the editorial board for [journal name], which is on a voluntary basis. All other authors have no competing interests.'

    If there are no competing interests, please add the below statement:

    'The authors declare that they have no competing interests.'

    For Reviewers

    If you have any competing interests, please list them in the text box available on your reviewer page. For example:

    'I was previously employed by the laboratory that collected this data.'

     If you do not have competing interests, please add the below statement:

    'I have no competing interests to declare.'