<classpathentry kind="lib" path="ext/platform-3.4.0.jar" sourcepath="ext/src/platform-3.4.0.jar"/>
<classpathentry kind="lib" path="ext/mockito-core-1.10.19.jar" sourcepath="ext/src/mockito-core-1.10.19.jar"/>
<classpathentry kind="lib" path="ext/objenesis-2.1.jar" sourcepath="ext/src/objenesis-2.1.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
\r
import java.text.MessageFormat;\r
import java.util.HashMap;\r
+import java.util.List;\r
import java.util.Map;\r
\r
import org.apache.wicket.Component;\r
import org.apache.wicket.behavior.Behavior;\r
+import org.apache.wicket.markup.head.HeaderItem;\r
import org.apache.wicket.markup.head.IHeaderResponse;\r
import org.apache.wicket.markup.head.JavaScriptHeaderItem;\r
import org.apache.wicket.request.resource.PackageResourceReference;\r
+import org.apache.wicket.resource.JQueryResourceReference;\r
\r
import com.google.gson.Gson;\r
import com.google.gson.GsonBuilder;\r
@Override\r
public void renderHead(Component component, IHeaderResponse response) {\r
// add Google AngularJS reference\r
- response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(NgController.class, "angular.js")));\r
+ response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(NgController.class, "angular.js"){\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ @Override\r
+ public List<HeaderItem> getDependencies() {\r
+ List<HeaderItem> deps = super.getDependencies();\r
+ deps.add(JavaScriptHeaderItem.forReference(JQueryResourceReference.get()));\r
+ return deps;\r
+ }\r
+ }));\r
\r
Gson gson = new GsonBuilder().create();\r
\r
}\r
line(sb, "}");\r
\r
- response.render(JavaScriptHeaderItem.forScript(sb.toString(), "angularController"));\r
+ response.render(JavaScriptHeaderItem.forScript(sb.toString(), "angularController-"+name));\r
}\r
\r
private void line(StringBuilder sb, String line) {\r
<meta name="viewport" content="width=device-width, initial-scale=1.0" />\r
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />\r
<title wicket:id="title">[page title]</title>\r
+ \r
<link rel="icon" href="gitblt-favicon.png" type="image/png" />\r
<link rel="stylesheet" href="bootstrap/css/bootstrap.css"/>\r
<link rel="stylesheet" href="bootstrap/css/iconic.css"/>\r
</style>\r
\r
<!-- Include scripts at end for faster page loading -->\r
-<!-- <script type="text/javascript" src="bootstrap/js/jquery.js"></script> -->\r
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script> \r
<wicket:container wicket:id="bottomScripts"></wicket:container>\r
</body>\r
import org.apache.wicket.request.mapper.parameter.PageParameters;\r
import org.apache.wicket.request.resource.ContextRelativeResourceReference;\r
import org.apache.wicket.request.resource.JavaScriptResourceReference;\r
+import org.apache.wicket.resource.JQueryResourceReference;\r
import org.apache.wicket.markup.head.CssHeaderItem;\r
import org.apache.wicket.markup.head.IHeaderResponse;\r
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.ExternalLink;\r
import org.apache.wicket.markup.html.panel.FeedbackPanel;\r
import com.gitblit.wicket.GitBlitWebApp;\r
import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.resources.bootstrap.Bootstrap;\r
\r
public abstract class BasePage extends SessionPage {\r
\r
@Override\r
public void renderHead(IHeaderResponse response) {\r
super.renderHead(response);\r
+ response.render(JavaScriptHeaderItem.forReference(JQueryResourceReference.get()));\r
+ \r
if (app().settings().getBoolean(Keys.web.useResponsiveLayout, true)) {\r
- response.render(CssHeaderItem.forReference(\r
- new ContextRelativeResourceReference("/bootstrap/css/bootstrap-responsive.css", false)));\r
+ response.render(CssHeaderItem.forReference(Application.get().getSharedResources().get(Bootstrap.BOOTSTRAP_RESPONSIVE_CSS_RESOURCE)));\r
}\r
if (app().settings().getBoolean(Keys.web.hideHeader, false)) {\r
response.render(CssHeaderItem.forReference(new ContextRelativeResourceReference("/hideheader.css", false)));\r
package com.gitblit.wicket.resources.bootstrap;
+import java.util.List;
+
+import org.apache.wicket.markup.head.HeaderItem;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.CssPackageResource;
+import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.request.resource.PackageResourceReference;
+import org.apache.wicket.request.resource.SharedResourceReference;
+import org.apache.wicket.resource.JQueryResourceReference;
public class Bootstrap {
+
+ public static final String BOOTSTRAP_RESPONSIVE_CSS_RESOURCE = "bootstrap:responsiveCss";
public static void install(WebApplication app) {
app.mountResource("/bootstrap/css/bootstrap.css", new PackageResourceReference(Bootstrap.class, "css/bootstrap.css"));
- app.mountResource("/bootstrap/css/bootstrap-responsive.css", new PackageResourceReference(Bootstrap.class, "css/bootstrap-responsive.css"));
+
+ app.getSharedResources().add(BOOTSTRAP_RESPONSIVE_CSS_RESOURCE, new CssPackageResource(Bootstrap.class, "css/bootstrap-responsive.css", null, null, null));
+ app.mountResource("/bootstrap/css/bootstrap-responsive.css", app.getSharedResources().get(BOOTSTRAP_RESPONSIVE_CSS_RESOURCE));
+
app.mountResource("/bootstrap/css/iconic.css", new PackageResourceReference(Bootstrap.class, "css/iconic.css"));
app.mountResource("/bootstrap/font/iconic_fill.afm", new PackageResourceReference(Bootstrap.class, "font/iconic_fill.afm"));
app.mountResource("/bootstrap/img/glyphicons-halflings-white.png", new PackageResourceReference(Bootstrap.class, "img/glyphicons-halflings-white.png"));
app.mountResource("/bootstrap/img/glyphicons-halflings.png", new PackageResourceReference(Bootstrap.class, "img/glyphicons-halflings.png"));
- app.mountResource("/bootstrap/js/bootstrap.js", new PackageResourceReference(Bootstrap.class, "js/bootstrap.js"));
+ app.mountResource("/bootstrap/js/bootstrap.js", new PackageResourceReference(Bootstrap.class, "js/bootstrap.js"){
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public List<HeaderItem> getDependencies() {
+ List<HeaderItem> deps = super.getDependencies();
+ deps.add(JavaScriptHeaderItem.forReference(JQueryResourceReference.get()));
+ return deps;
+ }
+ });
}
}