Replace hard coded rich text hashed file path with registration system

This commit is contained in:
Alasdair Smith 2018-04-11 12:36:47 +01:00
parent a45dc69e4d
commit 3af10733cc
2 changed files with 9 additions and 2 deletions

View file

@ -15,6 +15,7 @@ htmlEncoder = new require("node-html-encoder").Encoder("numerical")
hashedFiles = {}
Path = require 'path'
Features = require "./Features"
Modules = require "./Modules"
jsPath =
if Settings.useMinifiedJs
@ -41,10 +42,9 @@ pathList = [
"#{jsPath}ide.js"
"#{jsPath}main.js"
"#{jsPath}libraries.js"
"#{jsPath}es/rich-text.js"
"/stylesheets/style.css"
"/stylesheets/ol-style.css"
]
].concat(Modules.moduleAssetFiles(jsPath))
if !Settings.useMinifiedJs
logger.log "not using minified JS, not hashing static files"

View file

@ -43,6 +43,13 @@ module.exports = Modules =
moduleIncludesAvailable: (view) ->
return (Modules.viewIncludes[view] or []).length > 0
moduleAssetFiles: (pathPrefix) ->
assetFiles = []
for module in @modules
for assetFile in module.assetFiles or []
assetFiles.push "#{pathPrefix}#{assetFile}"
return assetFiles
attachHooks: () ->
for module in @modules
if module.hooks?