mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-30 04:55:21 +00:00
share code between <l:ajax>
This commit is contained in:
1 parent
46d93c0e70
commit
8891c86af6
2 files changed
+18
-14
No files matched your search
@@ -161,10 +161,21 @@ public class Functions {
|
||||
|
||||
public static void initPageVariables(JellyContext context) {
|
||||
String rootURL = Stapler.getCurrentRequest().getContextPath();
|
||||
Functions h = new Functions();
|
||||
|
||||
context.setVariable("rootURL", rootURL);
|
||||
Functions h = new Functions();
|
||||
context.setVariable("h", h);
|
||||
|
||||
|
||||
// The path starts with a "/" character but does not end with a "/" character.
|
||||
context.setVariable("rootURL", rootURL);
|
||||
|
||||
/*
|
||||
load static resources from the path dedicated to a specific version.
|
||||
This "/static/VERSION/abc/def.ghi" path is interpreted by stapler to be
|
||||
the same thing as "/abc/def.ghi", but this avoids the stale cache
|
||||
problem when the user upgrades to new Jenkins. Stapler also sets a long
|
||||
future expiration dates for such static resources.
|
||||
*/
|
||||
context.setVariable("resURL",rootURL+getResourcePath());
|
||||
context.setVariable("imagesURL",rootURL+getResourcePath()+"/images");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user