v9: bugfix 11228 Blocklist stylesheet path includes wwwroot (#11298)

* Update blocklist.blockconfiguration.overlay.controller.js

* Removed obsolete property sets, and switched to staticfilePicker

Signed-off-by: Nikolaj Geisle <niko737@edu.ucl.dk>

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
This commit is contained in:
Nikolaj Geisle
2021-10-07 15:43:22 +02:00
committed by GitHub
parent bef1ccedca
commit 54eeaedc52

View File

@@ -109,7 +109,7 @@
}
]
};
editorService.contentTypePicker(settingsTypePicker);
});
@@ -179,7 +179,7 @@
},
close: () => editorService.close()
};
editorService.filePicker(filePicker);
});
@@ -206,26 +206,26 @@
};
vm.addStylesheetForBlock = function(block) {
localizationService.localize("blockEditor_headlineAddCustomStylesheet").then(localizedTitle => {
localizationService.localize("blockEditor_headlineAddCustomStylesheet").then(localizedTitle => {
const filePicker = {
title: localizedTitle,
isDialog: true,
filter: i => {
return !(i.name.indexOf(".css") !== -1);
},
filterCssClass: "not-allowed",
select: node => {
const filepath = decodeURIComponent(node.id.replace(/\+/g, " "));
block.stylesheet = "~/" + filepath;
editorService.close();
},
close: () => editorService.close()
};
const filePicker = {
title: localizedTitle,
isDialog: true,
filter: i => {
return !(i.name.indexOf(".css") !== -1);
},
filterCssClass: "not-allowed",
select: node => {
const filepath = decodeURIComponent(node.id.replace(/\+/g, " "));
block.stylesheet = "~/" + filepath.replace("wwwroot/", "");
editorService.close();
},
close: () => editorService.close()
};
editorService.filePicker(filePicker);
editorService.staticFilePicker(filePicker);
});
});
};
vm.requestRemoveStylesheetForBlock = function(block) {
@@ -251,7 +251,7 @@
vm.addThumbnailForBlock = function(block) {
localizationService.localize("blockEditor_headlineAddThumbnail").then(localizedTitle => {
let allowedFileExtensions = ['jpg', 'jpeg', 'png', 'svg', 'webp', 'gif'];
const thumbnailPicker = {
@@ -269,7 +269,7 @@
},
close: () => editorService.close()
};
editorService.staticFilePicker(thumbnailPicker);
});