* Replaced jquery and jquery.atmosphere.js with original, unmodified versions * Added vaadinPush.js build target to ide.xml and push/build.xml * Uses yuicompressor to compress the resulting push javascript Change-Id: I59ba9c2bbf74e05d10325d38efdb106b638cd8e7tags/7.1.0.beta1
@@ -44,6 +44,8 @@ | |||
/WebContent/VAADIN/widgetsets | |||
/WebContent/VAADIN/gwt-unitCache* | |||
WebContent/VAADIN/vaadinPush.js | |||
# /WebContent/WEB-INF/ | |||
/WebContent/WEB-INF/classes | |||
@@ -9402,5 +9402,3 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { | |||
})( window ); | |||
window.jQueryVaadin = window.jQuery.noConflict(true); |
@@ -0,0 +1,8 @@ | |||
@jquery.js@ | |||
window.jQueryVaadin = window.jQuery.noConflict(true); | |||
(function(jQuery, undefined) { | |||
@jquery.atmosphere.js@ | |||
})(jQueryVaadin); | |||
if (console) { | |||
console.log("Vaadin push loaded"); | |||
} |
@@ -49,7 +49,7 @@ | |||
<path location="client/src" /> | |||
</path> | |||
<target name="theme-and-default-widgetset" depends="default-widgetset, themes"> | |||
<target name="theme-and-default-widgetset" depends="default-widgetset, themes, vaadinPush.js"> | |||
</target> | |||
<target name="themes"> | |||
<antcall target="compile-theme"> | |||
@@ -82,20 +82,20 @@ | |||
</java> | |||
</target> | |||
<target name="default-widgetset"> | |||
<antcall target="compile-widgetset"> | |||
<param name="widgetset" value="com.vaadin.DefaultWidgetSet" /> | |||
</antcall> | |||
</target> | |||
<target name="testing-widgetset"> | |||
<antcall target="compile-widgetset"> | |||
<param name="widgetset" value="com.vaadin.tests.widgetset.TestingWidgetSet" /> | |||
</antcall> | |||
</target> | |||
<target name="compile-widgetset"> | |||
<property name="module" value="${widgetset}" /> | |||
<property name="module.output.dir" location="WebContent/VAADIN/widgetsets" /> | |||
@@ -133,5 +133,20 @@ | |||
<jvmarg value="-Djava.awt.headless=true" /> | |||
<jvmarg value="-Dgwt.usearchives=false" /> | |||
</java> | |||
</target> | |||
</target> | |||
<target name="vaadinPush.js"> | |||
<property name="vaadinPush.js.output" location="WebContent/VAADIN/vaadinPush.js" /> | |||
<loadfile srcfile="WebContent/VAADIN/jquery-1.7.2.js" property="jquery.js.contents" /> | |||
<loadfile srcfile="WebContent/VAADIN/jquery.atmosphere.js" property="jquery.atmosphere.js.contents" /> | |||
<loadfile srcfile="WebContent/VAADIN/vaadinPush.js.tpl" property="vaadinPush.js.contents"> | |||
<filterchain> | |||
<replacetokens begintoken="@" endtoken="@"> | |||
<token key="jquery.js" value="${jquery.js.contents}" /> | |||
<token key="jquery.atmosphere.js" value="${jquery.atmosphere.js.contents}" /> | |||
</replacetokens> | |||
</filterchain> | |||
</loadfile> | |||
<echo file="${vaadinPush.js.output}">${vaadinPush.js.contents}</echo> | |||
</target> | |||
</project> |
@@ -1,6 +1,6 @@ | |||
<?xml version="1.0"?> | |||
<project name="vaadin-push" basedir="." default="publish-local"> | |||
<project name="vaadin-push" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant"> | |||
<description> | |||
Meta package which defines dependencies needed for push | |||
</description> | |||
@@ -10,16 +10,43 @@ | |||
<property name="module.name" value="vaadin-push" /> | |||
<property name="module.symbolic" value="com.vaadin.push" /> | |||
<property name="result.dir" location="result" /> | |||
<property name="vaadinPush.js" location="${result.dir}/js/VAADIN/vaadinPush.js" /> | |||
<path id="classpath.compile.custom" /> | |||
<union id="jar.includes"> | |||
<fileset dir="${vaadin.basedir}/WebContent"> | |||
<include name="VAADIN/jquery-1.7.2.rebased.js" /> | |||
<include name="VAADIN/jquery.atmosphere.rebased.js" /> | |||
<fileset dir="${result.dir}/js"> | |||
<include name="VAADIN/vaadinPush.js" /> | |||
</fileset> | |||
</union> | |||
<target name="jar"> | |||
<target name="vaadinPush.js"> | |||
<mkdir dir="${result.dir}/js/VAADIN" /> | |||
<property name="vaadinPush.js.output" location="${result.dir}/js/VAADIN/vaadinPush.js" /> | |||
<property name="vaadinPush.js.combined.output" location="${result.dir}/js/VAADIN/push.combined.js" /> | |||
<loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/jquery-1.7.2.js" property="jquery.js.contents" /> | |||
<loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/jquery.atmosphere.js" property="jquery.atmosphere.js.contents" /> | |||
<loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/vaadinPush.js.tpl" property="vaadinPush.js.contents"> | |||
<filterchain> | |||
<replacetokens begintoken="@" endtoken="@"> | |||
<token key="jquery.js" value="${jquery.js.contents}" /> | |||
<token key="jquery.atmosphere.js" value="${jquery.atmosphere.js.contents}" /> | |||
</replacetokens> | |||
</filterchain> | |||
</loadfile> | |||
<echo file="${vaadinPush.js.combined.output}">${vaadinPush.js.contents}</echo> | |||
<!-- Minify --> | |||
<ivy:retrieve organisation="com.yahoo.platform.yui" module="yuicompressor" revision="2.4.7" inline="true" type="jar" pattern="${result.dir}/compressor.jar" /> | |||
<java jar="${result.dir}/compressor.jar" fork="true"> | |||
<arg value="-v"/> | |||
<arg value="-o"/> | |||
<arg file="${vaadinPush.js.output}"/> | |||
<arg file="${vaadinPush.js.combined.output}"/> | |||
</java> | |||
</target> | |||
<target name="jar" depends="vaadinPush.js"> | |||
<property name="server.osgi.import" value="" /> | |||
<antcall target="common.jar"> | |||
<param name="require-bundle" value="" /> |
@@ -359,10 +359,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { | |||
// Load client-side dependencies for push support | |||
fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr( | |||
"type", "text/javascript").attr("src", | |||
vaadinLocation + "jquery-1.7.2.rebased.js")); | |||
fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr( | |||
"type", "text/javascript").attr("src", | |||
vaadinLocation + "jquery.atmosphere.rebased.js")); | |||
vaadinLocation + "vaadinPush.js")); | |||
} | |||
String bootstrapLocation = vaadinLocation + "vaadinBootstrap.js"; |
@@ -507,9 +507,8 @@ public class VaadinServlet extends HttpServlet implements Constants { | |||
private boolean serveStaticResources(HttpServletRequest request, | |||
HttpServletResponse response) throws IOException, ServletException { | |||
// FIXME What does 10 refer to? | |||
String pathInfo = request.getPathInfo(); | |||
if (pathInfo == null || pathInfo.length() <= 10) { | |||
if (pathInfo == null) { | |||
return false; | |||
} | |||
@@ -907,7 +906,7 @@ public class VaadinServlet extends HttpServlet implements Constants { | |||
protected boolean isStaticResourceRequest(HttpServletRequest request) { | |||
String pathInfo = request.getPathInfo(); | |||
if (pathInfo == null || pathInfo.length() <= 10) { | |||
if (pathInfo == null) { | |||
return false; | |||
} | |||