appCss/appTheme are now loaded as external CSS files instead of inline styles

This commit is contained in:
zadam
2019-01-27 17:01:37 +01:00
parent 840a0b5f64
commit 2c1580ea65
6 changed files with 34 additions and 28 deletions

View File

@@ -22,22 +22,13 @@ async function index(req, res) {
sourceId: await sourceIdService.generateSourceId(),
maxSyncIdAtLoad: await sql.getValue("SELECT MAX(id) FROM sync"),
instanceName: config.General ? config.General.instanceName : null,
appCss: await getAppCss()
appCssNoteIds: await getAppCssNoteIds()
});
}
async function getAppCss() {
let css = '';
const notes = attributeService.getNotesWithLabel('appCss');
for (const note of await notes) {
css += `/* ${note.noteId} */
${note.content}
`;
}
return css;
async function getAppCssNoteIds() {
return (await attributeService.getNotesWithLabels(['appCss', 'appTheme']))
.map(note => note.noteId);
}
module.exports = {