* 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
/WebContent/VAADIN/widgetsets | /WebContent/VAADIN/widgetsets | ||||
/WebContent/VAADIN/gwt-unitCache* | /WebContent/VAADIN/gwt-unitCache* | ||||
WebContent/VAADIN/vaadinPush.js | |||||
# /WebContent/WEB-INF/ | # /WebContent/WEB-INF/ | ||||
/WebContent/WEB-INF/classes | /WebContent/WEB-INF/classes | ||||
})( window ); | })( window ); | ||||
window.jQueryVaadin = window.jQuery.noConflict(true); |
@jquery.js@ | |||||
window.jQueryVaadin = window.jQuery.noConflict(true); | |||||
(function(jQuery, undefined) { | |||||
@jquery.atmosphere.js@ | |||||
})(jQueryVaadin); | |||||
if (console) { | |||||
console.log("Vaadin push loaded"); | |||||
} |
<path location="client/src" /> | <path location="client/src" /> | ||||
</path> | </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> | ||||
<target name="themes"> | <target name="themes"> | ||||
<antcall target="compile-theme"> | <antcall target="compile-theme"> | ||||
</java> | </java> | ||||
</target> | </target> | ||||
<target name="default-widgetset"> | <target name="default-widgetset"> | ||||
<antcall target="compile-widgetset"> | <antcall target="compile-widgetset"> | ||||
<param name="widgetset" value="com.vaadin.DefaultWidgetSet" /> | <param name="widgetset" value="com.vaadin.DefaultWidgetSet" /> | ||||
</antcall> | </antcall> | ||||
</target> | </target> | ||||
<target name="testing-widgetset"> | <target name="testing-widgetset"> | ||||
<antcall target="compile-widgetset"> | <antcall target="compile-widgetset"> | ||||
<param name="widgetset" value="com.vaadin.tests.widgetset.TestingWidgetSet" /> | <param name="widgetset" value="com.vaadin.tests.widgetset.TestingWidgetSet" /> | ||||
</antcall> | </antcall> | ||||
</target> | </target> | ||||
<target name="compile-widgetset"> | <target name="compile-widgetset"> | ||||
<property name="module" value="${widgetset}" /> | <property name="module" value="${widgetset}" /> | ||||
<property name="module.output.dir" location="WebContent/VAADIN/widgetsets" /> | <property name="module.output.dir" location="WebContent/VAADIN/widgetsets" /> | ||||
<jvmarg value="-Djava.awt.headless=true" /> | <jvmarg value="-Djava.awt.headless=true" /> | ||||
<jvmarg value="-Dgwt.usearchives=false" /> | <jvmarg value="-Dgwt.usearchives=false" /> | ||||
</java> | </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> | </project> |
<?xml version="1.0"?> | <?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> | <description> | ||||
Meta package which defines dependencies needed for push | Meta package which defines dependencies needed for push | ||||
</description> | </description> | ||||
<property name="module.name" value="vaadin-push" /> | <property name="module.name" value="vaadin-push" /> | ||||
<property name="module.symbolic" value="com.vaadin.push" /> | <property name="module.symbolic" value="com.vaadin.push" /> | ||||
<property name="result.dir" location="result" /> | <property name="result.dir" location="result" /> | ||||
<property name="vaadinPush.js" location="${result.dir}/js/VAADIN/vaadinPush.js" /> | |||||
<path id="classpath.compile.custom" /> | <path id="classpath.compile.custom" /> | ||||
<union id="jar.includes"> | <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> | </fileset> | ||||
</union> | </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="" /> | <property name="server.osgi.import" value="" /> | ||||
<antcall target="common.jar"> | <antcall target="common.jar"> | ||||
<param name="require-bundle" value="" /> | <param name="require-bundle" value="" /> |
// Load client-side dependencies for push support | // Load client-side dependencies for push support | ||||
fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr( | fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr( | ||||
"type", "text/javascript").attr("src", | "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"; | String bootstrapLocation = vaadinLocation + "vaadinBootstrap.js"; |
private boolean serveStaticResources(HttpServletRequest request, | private boolean serveStaticResources(HttpServletRequest request, | ||||
HttpServletResponse response) throws IOException, ServletException { | HttpServletResponse response) throws IOException, ServletException { | ||||
// FIXME What does 10 refer to? | |||||
String pathInfo = request.getPathInfo(); | String pathInfo = request.getPathInfo(); | ||||
if (pathInfo == null || pathInfo.length() <= 10) { | |||||
if (pathInfo == null) { | |||||
return false; | return false; | ||||
} | } | ||||
protected boolean isStaticResourceRequest(HttpServletRequest request) { | protected boolean isStaticResourceRequest(HttpServletRequest request) { | ||||
String pathInfo = request.getPathInfo(); | String pathInfo = request.getPathInfo(); | ||||
if (pathInfo == null || pathInfo.length() <= 10) { | |||||
if (pathInfo == null) { | |||||
return false; | return false; | ||||
} | } | ||||