feat: Update version to 3.0.5 and enhance CustomBranding with new search form functionality and improved styling
This commit is contained in:
@@ -49,9 +49,9 @@ assert(customBottom.config.placeholderbottom.elements.length === 1 &&
|
||||
var legacy = normalize({ elements: [{ type: 'span', content: 'Alt' }] }, siteUrl);
|
||||
assert(legacy.config.placeholdertop.elements.length === 1, 'Das Legacy-Root-Array muss weiter funktionieren.');
|
||||
|
||||
['div', 'span', 'p', 'a', 'button', 'img', 'h1', 'h2', 'h3', 'strong', 'em', 'nav', 'section']
|
||||
['div', 'span', 'p', 'a', 'button', 'form', 'input', 'img', 'h1', 'h2', 'h3', 'strong', 'em', 'nav', 'section']
|
||||
.forEach(function (tag) {
|
||||
var attributes = tag === 'img' ? { alt: '' } : undefined;
|
||||
var attributes = tag === 'img' ? { alt: '' } : (tag === 'form' ? { action: '/search' } : undefined);
|
||||
var content = tag === 'a' || tag === 'button' ? tag : undefined;
|
||||
assert(!!element({ type: tag, content: content, attributes: attributes }), 'Erlaubter Tag fehlt: ' + tag);
|
||||
});
|
||||
@@ -83,6 +83,24 @@ assert(!element({ type: 'img', attributes: { src: '/logo.png' } }), 'Bilder ohne
|
||||
assert(!!element({ type: 'img', attributes: { src: '/logo.png', alt: '' } }), 'Dekorative Bilder mit leerem alt sind erlaubt.');
|
||||
assert(!element({ type: 'button' }), 'Leere Buttons muessen verworfen werden.');
|
||||
|
||||
var searchForm = element({
|
||||
type: 'form',
|
||||
attributes: { action: '~sitecollection/_layouts/15/search.aspx/siteall', method: 'post' },
|
||||
children: [
|
||||
{ type: 'input', attributes: { type: 'text', name: 'q', placeholder: 'Suchen', autocomplete: 'off' } },
|
||||
{ type: 'button', attributes: { type: 'submit', 'aria-label': 'Suchen' } }
|
||||
]
|
||||
});
|
||||
assert(searchForm.attributes.action === siteUrl + '/_layouts/15/search.aspx/siteall' && searchForm.attributes.method === 'get',
|
||||
'Suchformulare muessen eine sichere GET-Action verwenden.');
|
||||
assert(searchForm.children[0].attributes.type === 'search' && searchForm.children[0].attributes.name === 'q',
|
||||
'Suchfelder muessen auf type=search begrenzt sein.');
|
||||
assert(searchForm.children[1].attributes.type === 'submit', 'Submit-Buttons in Suchformularen muessen erhalten bleiben.');
|
||||
assert(!element({ type: 'form', attributes: { action: 'javascript:alert(1)' } }),
|
||||
'Formulare mit unsicherer Action muessen verworfen werden.');
|
||||
assert(!element({ type: 'form', attributes: { action: '//evil.example.org/search' } }),
|
||||
'Formulare mit protokollrelativer Action muessen verworfen werden.');
|
||||
|
||||
var css = normalize({
|
||||
allowedCssHosts: ['cdn.example.org'],
|
||||
cssfiles: [
|
||||
|
||||
Reference in New Issue
Block a user