Skip to content

Commit

Permalink
fix for css in fat jar
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrthomas committed May 7, 2017
1 parent b156730 commit 98f3582
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 5 deletions.
5 changes: 1 addition & 4 deletions karate-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/webapp</directory>
</resource>
</resource>
</resources>
<testResources>
<testResource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<title>Karate</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel="stylesheet" href="karate.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
package com.intuit.karate.web.wicket;

import org.apache.wicket.markup.head.CssContentHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;

Expand All @@ -39,5 +41,10 @@ public BasePage() {
add(new HeaderPanel(HEADER_ID));
add(new Label(CONTENT_ID, ""));
}

@Override
public void renderHead(IHeaderResponse response) {
response.render(CssContentHeaderItem.forReference(KarateCssResourceReference.INSTANCE));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public void pushJsonWebSocketMessage(String json) {

@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = "Wicket.Event.subscribe(\"/websocket/message\", function(jqEvent, message) {\n"
+ " message = JSON.parse(message);\n"
+ " if (message.type == 'step') updateStep(message); else { Karate.Ajax.DebugWindow.logInfo(message.text); }\n"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* The MIT License
*
* Copyright 2017 Intuit Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.intuit.karate.web.wicket;

import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

/**
*
* @author pthomas3
*/
public class KarateCssResourceReference extends CssResourceReference {

public static final KarateCssResourceReference INSTANCE = new KarateCssResourceReference();

private KarateCssResourceReference() {
super(KarateCssResourceReference.class, "karate.css");
}

}
File renamed without changes.

0 comments on commit 98f3582

Please sign in to comment.