Skip to content

Commit 98f3582

Browse files
committed
fix for css in fat jar
1 parent b156730 commit 98f3582

File tree

6 files changed

+50
-5
lines changed

6 files changed

+50
-5
lines changed

karate-web/pom.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@
9191
<excludes>
9292
<exclude>**/*.java</exclude>
9393
</excludes>
94-
</resource>
95-
<resource>
96-
<directory>src/main/webapp</directory>
97-
</resource>
94+
</resource>
9895
</resources>
9996
<testResources>
10097
<testResource>

karate-web/src/main/java/com/intuit/karate/web/wicket/BasePage.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<title>Karate</title>
88
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
99
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
10-
<link rel="stylesheet" href="karate.css">
1110
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
1211
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
1312
</head>

karate-web/src/main/java/com/intuit/karate/web/wicket/BasePage.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
package com.intuit.karate.web.wicket;
2525

26+
import org.apache.wicket.markup.head.CssContentHeaderItem;
27+
import org.apache.wicket.markup.head.IHeaderResponse;
2628
import org.apache.wicket.markup.html.WebPage;
2729
import org.apache.wicket.markup.html.basic.Label;
2830

@@ -39,5 +41,10 @@ public BasePage() {
3941
add(new HeaderPanel(HEADER_ID));
4042
add(new Label(CONTENT_ID, ""));
4143
}
44+
45+
@Override
46+
public void renderHead(IHeaderResponse response) {
47+
response.render(CssContentHeaderItem.forReference(KarateCssResourceReference.INSTANCE));
48+
}
4249

4350
}

karate-web/src/main/java/com/intuit/karate/web/wicket/FeaturePage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public void pushJsonWebSocketMessage(String json) {
101101

102102
@Override
103103
public void renderHead(IHeaderResponse response) {
104+
super.renderHead(response);
104105
String script = "Wicket.Event.subscribe(\"/websocket/message\", function(jqEvent, message) {\n"
105106
+ " message = JSON.parse(message);\n"
106107
+ " if (message.type == 'step') updateStep(message); else { Karate.Ajax.DebugWindow.logInfo(message.text); }\n"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright 2017 Intuit Inc.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
package com.intuit.karate.web.wicket;
25+
26+
import org.apache.wicket.request.resource.CssResourceReference;
27+
import org.apache.wicket.request.resource.JavaScriptResourceReference;
28+
29+
/**
30+
*
31+
* @author pthomas3
32+
*/
33+
public class KarateCssResourceReference extends CssResourceReference {
34+
35+
public static final KarateCssResourceReference INSTANCE = new KarateCssResourceReference();
36+
37+
private KarateCssResourceReference() {
38+
super(KarateCssResourceReference.class, "karate.css");
39+
}
40+
41+
}

karate-web/src/main/webapp/karate.css renamed to karate-web/src/main/java/com/intuit/karate/web/wicket/karate.css

File renamed without changes.

0 commit comments

Comments
 (0)