Loading src/unified-search-encryption-message.js +12 −7 Original line number Diff line number Diff line document.addEventListener('DOMContentLoaded', function() { const searchHelpText = t('core', 'Due to encryption the search is only done on files\' name.') const attr = '#header-menu-unified-search .empty-content:after, #header-menu-unified-search ul.unified-search__results.unified-search__results-files:after' const style = '{ content: "' + searchHelpText.replace("'", '\'') + '" }' const newStyle = document.createElement('style') newStyle.innerHTML = attr + style document.querySelector('.header-menu__content').appendChild(newStyle) }) const headerElement = document.querySelector('#header'); if (headerElement) { const searchHelpText = t('core', 'Due to encryption the search is only done on files\' name.'); const attr = '#unified-search .empty-content:after, #unified-search .unified-search-modal__results:after'; const style = `{ content: "${searchHelpText.replace(/'/g, '\\\'')}" }`; // Correctly escape single quotes const newStyle = document.createElement('style'); newStyle.innerHTML = attr + style; headerElement.appendChild(newStyle); } else { console.error('Element with ID "header" not found.'); } }); No newline at end of file Loading
src/unified-search-encryption-message.js +12 −7 Original line number Diff line number Diff line document.addEventListener('DOMContentLoaded', function() { const searchHelpText = t('core', 'Due to encryption the search is only done on files\' name.') const attr = '#header-menu-unified-search .empty-content:after, #header-menu-unified-search ul.unified-search__results.unified-search__results-files:after' const style = '{ content: "' + searchHelpText.replace("'", '\'') + '" }' const newStyle = document.createElement('style') newStyle.innerHTML = attr + style document.querySelector('.header-menu__content').appendChild(newStyle) }) const headerElement = document.querySelector('#header'); if (headerElement) { const searchHelpText = t('core', 'Due to encryption the search is only done on files\' name.'); const attr = '#unified-search .empty-content:after, #unified-search .unified-search-modal__results:after'; const style = `{ content: "${searchHelpText.replace(/'/g, '\\\'')}" }`; // Correctly escape single quotes const newStyle = document.createElement('style'); newStyle.innerHTML = attr + style; headerElement.appendChild(newStyle); } else { console.error('Element with ID "header" not found.'); } }); No newline at end of file