Skip to content

Preview of theming does not work anymore #5975

@MorrisJobke

Description

@MorrisJobke
  • change a value in the theming app
  • wait for it to be saved
  • then the "Loading preview" will show up
  • actual: it loads endlessly and if you look at the network it will show you a 404 on css/core/server.css
  • expected: the server.css is properly loaded and the loading spinner goes away

Problem: The server.css is in my instance for example served under css/core/72408cbdff8901cd16b886aeabcc367c-server.css - I guess the reloadStylesheets() method needs an adjustment to fetch the current name of this an reload that css.

var reloadStylesheets = function(cssFile) {
var queryString = '?reload=' + new Date().getTime();
var url = OC.generateUrl(cssFile) + queryString;
var old = $('link[href*="' + cssFile.replace("/","\/") + '"]');
var stylesheet = $("<link/>", {
rel: "stylesheet",
type: "text/css",
href: url
});
stylesheet.load(function () {
$(old).remove();
stylesheetsLoaded--;
if(stylesheetsLoaded === 0) {
$('#theming_settings_loading').hide();
var response = { status: 'success', data: {message: t('theming', 'Saved')}};
OC.msg.finishedSaving('#theming_settings_msg', response);
}
});
stylesheet.appendTo("head");
};
reloadStylesheets('/css/core/server.css');

cc @danxuliu @juliushaertl @nextcloud/theming

Valid for at least master.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions