Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#1919: Asset root path should be configurable #1933

Merged
merged 3 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,8 @@ Noel Kennedy
### Email: ###
nkennedy at rvc dot ac dot uk

### Name: ###
Henrik Härkönen

### Email: ###
heharkon@iki.fi
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object LazyLoad extends DispatchSnippet {
renderedTemplate
}
} openOr {
<div><img src="/images/ajax-loader.gif" alt="Loading"/></div>
<div><img src={s"${LiftRules.assetRootPath}images/ajax-loader.gif"} alt="Loading"/></div>
}
)
}
Expand Down
16 changes: 16 additions & 0 deletions web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,22 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
}
}

/**
* The root path for the assets folder.
*
* This applies also to the URL domain, appended after the deployed context path.
* In app developer's work area this folder resides under the 'webapp' folder.
*
* For example to store asset files under 'myassets' folder,
* use value '/myassets/'. Assets under this configurable path follow
* conventions, for example the default lazy loading spinner ('ajax-loader.gif')
* is under 'images' folder.
*
* Thus the URL to the assets folder would be:
* 'http://<domain name>/<context path>/myassets/'
*/
@volatile var assetRootPath: String = "/"

/**
* Contains the URI path under which all built-in Lift-handled requests are
* scoped. It does not include the context path and should not begin with a
Expand Down
2 changes: 1 addition & 1 deletion web/webkit/src/main/scala/net/liftweb/http/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ package object http {
// Actually complete the render once the future is fulfilled.
asyncResolveProvider.resolveAsync(concreteResolvable, resolvedResult => deferredRender(resolvedResult))

<div id={placeholderId}><img src="/images/ajax-loader.gif" alt="Loading..." /></div>
<div id={placeholderId}><img src={s"${LiftRules.assetRootPath}images/ajax-loader.gif"} alt="Loading" /></div>
} openOr {
Comment("FIX"+"ME: Asynchronous rendering failed for unknown reason.")
}
Expand Down