Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: src/site/samples/websockets/example/websocket_sample.dart

Issue 30853002: Added several more HTML5 samples (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/site/samples/websockets/example/websocket_sample.dart
diff --git a/src/site/samples/websockets/example/websocket_sample.dart b/src/site/samples/websockets/example/websocket_sample.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1b715be649df14303bfb158e64537264328f9777
--- /dev/null
+++ b/src/site/samples/websockets/example/websocket_sample.dart
@@ -0,0 +1 @@
+import "dart:html" as o;import "dart:async" as EB;class q{static const s="Chrome";static const t="Firefox";static const u="Internet Explorer";static const v="Safari";final n;final minimumVersion;const q(this.n,[this.minimumVersion]);}class AB{const AB();}class BB{final name;const BB(this.name);}class CB{const CB();}class DB{const DB();}var i;j( k){var h=o.query('#output');var g=k;if(!h.text.isEmpty){g="${h.text}\n${g}";}h.text=g;} l([ h=2]){var k=false;j("Connecting to websocket");i=new o.WebSocket('ws://echo.websocket.org'); m(){if(!k){new EB.Timer(new Duration(milliseconds:1000*h),()=>l(h*2));}k=true;}i.onOpen.listen((g){j('Connected');i.send('Hello from Dart!');});i.onClose.listen((g){j('Websocket closed, retrying in ${h} seconds');m();});i.onError.listen((g){j("Error connecting to ws");m();});i.onMessage.listen(( g){j('Received message: ${g.data}');});} main(){l();}

Powered by Google App Engine
This is Rietveld 408576698