Troubleshooting the Etherpad theme framework

I managed to get the theme framework working sort of..  To fix it I had to remove caching of CSS…

I replaced the function cssIncludes with this:

function cssIncludes() {
  if (!isProduction()) {
    var key = faststatic.getCompressedFilesKey('css', '/static/css', _hd().cssIncludes.asArray());
    return '<link href="/static/compressed/'+key+'" rel="stylesheet" type="text/css" />';
  } else {

  if (request.params._theme == undefined)
        {
    var ts = +(new Date);
    var r = [];
    _hd().cssIncludes.asArray().forEach(function(relpath) {
      r.push('<link href="/static/css/'+relpath+'?'+ts+'" rel="stylesheet" type="text/css" />');
    });
    return r.join('\n');
        }
else
        {
        var ts = +(new Date);
    var r = [];
    _hd().cssIncludes.asArray().forEach(function(relpath) {
    r.push('<link href="/static/css/nano/pad2_ejs.css" rel="stylesheet" type="text/css" />');
    });
    return r.join('\n');
        }
  }
}

This isn’t a perfect fix as it a) breaks css caching and b) breaks the nano theme.. But for now it works..

Leave a Reply

Your email address will not be published. Required fields are marked *