Change-Id: I28ba6a808fda7f018cd5f8c483b34aaf3d4b610ffeature/atmosphere-pure-javascript
@@ -191,10 +191,9 @@ public class ApplicationConfiguration implements EntryPoint { | |||
*/ | |||
private native String getAtmosphereJSVersion() | |||
/*-{ | |||
if ($wnd.jQueryVaadin != undefined){ | |||
return $wnd.jQueryVaadin.atmosphere.version; | |||
} | |||
else { | |||
if ($wnd.vaadinPush && $wnd.vaadinPush.atmosphere) { | |||
return $wnd.vaadinPush.atmosphere.version; | |||
} else { | |||
return null; | |||
} | |||
}-*/; |
@@ -556,7 +556,7 @@ public class AtmospherePushConnection implements PushConnection { | |||
self.@com.vaadin.client.communication.AtmospherePushConnection::onClientTimeout(*)(request); | |||
}); | |||
return $wnd.jQueryVaadin.atmosphere.subscribe(config); | |||
return $wnd.vaadinPush.atmosphere.subscribe(config); | |||
}-*/; | |||
private native void doPush(JavaScriptObject socket, String message) | |||
@@ -566,12 +566,12 @@ public class AtmospherePushConnection implements PushConnection { | |||
private static native void doDisconnect(String url) | |||
/*-{ | |||
$wnd.jQueryVaadin.atmosphere.unsubscribeUrl(url); | |||
$wnd.vaadinPush.atmosphere.unsubscribeUrl(url); | |||
}-*/; | |||
private static native boolean isAtmosphereLoaded() | |||
/*-{ | |||
return $wnd.jQueryVaadin != undefined; | |||
return $wnd.vaadinPush && $wnd.vaadinPush.atmosphere; | |||
}-*/; | |||
private void runWhenAtmosphereLoaded(final Command command) { |
@@ -42,7 +42,7 @@ | |||
<!-- Atmosphere versions --> | |||
<!-- Note that this should be kept in sync with the class Constants --> | |||
<atmosphere.runtime.version>2.2.9.vaadin2</atmosphere.runtime.version> | |||
<atmosphere.js.version>2.2.13.vaadin3</atmosphere.js.version> | |||
<atmosphere.js.version>2.2.13.vaadin5</atmosphere.js.version> | |||
<!-- Dependency unpack directory --> | |||
<dependency.unpack.directory>${project.build.directory}/dependency-unpack</dependency.unpack.directory> |
@@ -26,7 +26,7 @@ | |||
</dependency> | |||
<dependency> | |||
<groupId>com.vaadin.external.atmosphere.client</groupId> | |||
<artifactId>jquery</artifactId> | |||
<artifactId>javascript</artifactId> | |||
<version>${atmosphere.js.version}</version> | |||
<type>war</type> | |||
<scope>provided</scope> | |||
@@ -48,7 +48,7 @@ | |||
<!-- <inherited>false</inherited> --> | |||
<configuration> | |||
<target> | |||
<property name="jquery.unpack" location="${project.build.directory}/temp" /> | |||
<property name="javascript.unpack" location="${project.build.directory}/temp" /> | |||
<property name="vaadinPush.js" | |||
location="${project.build.outputDirectory}/VAADIN/vaadinPush.debug.js" /> | |||
<property name="templates.dir" | |||
@@ -56,24 +56,21 @@ | |||
<!-- Unzip to temp dir --> | |||
<unzip | |||
src="${maven.dependency.com.vaadin.external.atmosphere.client.jquery.war.path}" | |||
dest="${jquery.unpack}"> | |||
src="${maven.dependency.com.vaadin.external.atmosphere.client.javascript.war.path}" | |||
dest="${javascript.unpack}"> | |||
<patternset> | |||
<include name="**/jquery.atmosphere.js" /> | |||
<include name="**/atmosphere.js" /> | |||
</patternset> | |||
<mapper type="flatten" /> | |||
</unzip> | |||
<loadfile srcfile="${templates.dir}/jquery-1.11.0.js" | |||
property="jquery.js.contents" /> | |||
<loadfile srcfile="${jquery.unpack}/jquery.atmosphere.js" | |||
property="jquery.atmosphere.js.contents" /> | |||
<loadfile srcfile="${javascript.unpack}/atmosphere.js" | |||
property="atmosphere.js.contents" /> | |||
<loadfile srcfile="${templates.dir}/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}" /> | |||
<token key="atmosphere.js" value="${atmosphere.js.contents}" /> | |||
</replacetokens> | |||
</filterchain> | |||
</loadfile> |
@@ -1,10 +1,7 @@ | |||
window.vaadinPush = window.vaadinPush|| {}; | |||
(function(define) { | |||
@jquery.js@ | |||
window.jQueryVaadin = window.jQuery.noConflict(true); | |||
(function(jQuery, undefined) { | |||
@jquery.atmosphere.js@ | |||
})(jQueryVaadin); | |||
@atmosphere.js@ | |||
if (window.console) { | |||
window.console.log("Vaadin push loaded"); | |||
} | |||
})(); | |||
}).call(window.vaadinPush); |
@@ -25,7 +25,7 @@ import org.openqa.selenium.WebElement; | |||
import org.openqa.selenium.interactions.Actions; | |||
import com.vaadin.testbench.parallel.TestCategory; | |||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||
import com.vaadin.tests.tb3.SingleBrowserTest; | |||
/** | |||
* Test for PUSH version string in debug window. | |||
@@ -33,7 +33,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest; | |||
* @author Vaadin Ltd | |||
*/ | |||
@TestCategory("push") | |||
public class PushVersionInfoTest extends MultiBrowserTest { | |||
public class PushVersionInfoTest extends SingleBrowserTest { | |||
@Test | |||
public void testDisabledPush() { | |||
@@ -63,8 +63,8 @@ public class PushVersionInfoTest extends MultiBrowserTest { | |||
"Push client version doesn't contain 'vaadin' string", | |||
jsString.contains("vaadin")); | |||
Assert.assertTrue( | |||
"Push client version doesn't contain 'jquery' string", | |||
jsString.contains("jquery")); | |||
"Push client version doesn't contain 'javascript' string", | |||
jsString.contains("javascript")); | |||
} | |||
private void selectInfoTab() { |