Search in sources :

Example 1 with JavascriptResourceReference

use of org.apache.wicket.markup.html.resources.JavascriptResourceReference in project gitblit by gitblit.

the class BasePage method addBottomScript.

/**
	 * Adds a HTML script element loading the javascript designated by the given path.
	 *
	 * @param scriptPath
	 *            page-relative path to the Javascript resource; normally starts with "scripts/"
	 */
protected void addBottomScript(String scriptPath) {
    RepeatingView bottomScripts = getBottomScriptContainer();
    Label script = new Label(bottomScripts.newChildId(), "<script type='text/javascript' src='" + urlFor(new JavascriptResourceReference(this.getClass(), scriptPath)) + "'></script>\n");
    bottomScripts.add(script.setEscapeModelStrings(false).setRenderBodyOnly(true));
}
Also used : RepeatingView(org.apache.wicket.markup.repeater.RepeatingView) Label(org.apache.wicket.markup.html.basic.Label) JavascriptResourceReference(org.apache.wicket.markup.html.resources.JavascriptResourceReference)

Aggregations

Label (org.apache.wicket.markup.html.basic.Label)1 JavascriptResourceReference (org.apache.wicket.markup.html.resources.JavascriptResourceReference)1 RepeatingView (org.apache.wicket.markup.repeater.RepeatingView)1