feat: Update version to 3.0.2 and add default footer elements for portal settings
This commit is contained in:
@@ -184,16 +184,35 @@
|
||||
|
||||
function normalize(raw) {
|
||||
raw = raw && typeof raw === 'object' ? raw : {};
|
||||
var configuredBottom = raw.placeholderbottom && Array.isArray(raw.placeholderbottom.elements)
|
||||
? raw.placeholderbottom.elements
|
||||
: [];
|
||||
return {
|
||||
enabled: raw.enabled !== false,
|
||||
debug: raw.debug === true,
|
||||
allowedCssHosts: normalizeHosts(raw.allowedCssHosts),
|
||||
cssfiles: Array.isArray(raw.cssfiles) ? raw.cssfiles : [],
|
||||
top: raw.placeholdertop && Array.isArray(raw.placeholdertop.elements) ? raw.placeholdertop.elements : (Array.isArray(raw.elements) ? raw.elements : []),
|
||||
bottom: raw.placeholderbottom && Array.isArray(raw.placeholderbottom.elements) ? raw.placeholderbottom.elements : []
|
||||
bottom: configuredBottom.length > 0 ? configuredBottom : defaultFooterElements()
|
||||
};
|
||||
}
|
||||
|
||||
function defaultFooterElements() {
|
||||
return [{
|
||||
type: 'div',
|
||||
attributes: { role: 'contentinfo', 'aria-label': 'Portalverwaltung' },
|
||||
styles: {
|
||||
'background-color': '#323130', color: '#ffffff', padding: '12px 16px',
|
||||
'text-align': 'center', width: '100%', 'box-sizing': 'border-box'
|
||||
},
|
||||
children: [{
|
||||
type: 'a', content: 'Portal Settings',
|
||||
attributes: { href: '~sitecollection/SitePages/PortalSettings.aspx' },
|
||||
styles: { color: '#ffffff', 'text-decoration': 'underline' }
|
||||
}]
|
||||
}];
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
for (var i = 0; i < state.hosts.length; i++) {
|
||||
if (state.hosts[i].parentNode) { state.hosts[i].parentNode.removeChild(state.hosts[i]); }
|
||||
|
||||
Reference in New Issue
Block a user