Separate files for template code?

Hi,

I was looking at the h5p javascript libraries, and noticed some EJS markup in the JavaScript code. For example:

https://github.com/h5p/h5p-question-set/blob/master/js/questionset.js#L22

I think this would be more maintainable and more readable if it was in a separate files, like text.ejs and result.ejs. Would this change be easy to implement? Would the h5p developers be interested in a change like this?

falcon's picture

Hi,

Thank you for the feedback. I believe it was included in the js files for performance reasons. H5Ps js files are aggregated by Drupal for instance, and Drupal didn't support aggregating .ejs files along with the other js files iirc.

 

I see. There are CSS and font files being included by this plugin, e.g.: https://github.com/h5p/h5p-question-set/tree/master/css

It seems kind of arbitrary to not be able to load template files in Drupal.

falcon's picture

You may load them, just not aggregate them iirc.