improvements

Former-commit-id: e648350a0c
This commit is contained in:
Henrique Dias
2017-06-25 09:11:25 +01:00
parent 61a9a30c0e
commit 048c69af22
35 changed files with 4335 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ import (
)
// AssetsURL is the url of the assets
const AssetsURL = "/_filemanagerinternal"
const AssetsURL = "/_internal"
// Serve provides the needed assets for the front-end
func serveAssets(w http.ResponseWriter, r *http.Request, m *FileManager) (int, error) {
@@ -27,8 +27,13 @@ func serveAssets(w http.ResponseWriter, r *http.Request, m *FileManager) (int, e
filename = strings.Replace(filename, "/js/", "", 1)
file, err = m.Assets.requiredJS.Bytes(filename)
case strings.HasPrefix(filename, "/vendor"):
filename = strings.Replace(filename, "/vendor/", "", 1)
file, err = m.Assets.JS.Bytes(filename)
if m.Assets.JS != nil {
filename = strings.Replace(filename, "/vendor/", "", 1)
file, err = m.Assets.JS.Bytes(filename)
break
}
fallthrough
default:
err = errors.New("not found")
}