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

Unified Diff: src/site/samples/dndfiles/example/monitoring.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
« no previous file with comments | « src/site/samples/dndfiles/example/index.html ('k') | src/site/samples/dndfiles/example/monitoring.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/site/samples/dndfiles/example/monitoring.dart
diff --git a/src/site/samples/dndfiles/example/monitoring.dart b/src/site/samples/dndfiles/example/monitoring.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0e32881ce084ece8031510fc81b8e3aaffeb489f
--- /dev/null
+++ b/src/site/samples/dndfiles/example/monitoring.dart
@@ -0,0 +1 @@
+import "dart:async" as AB;import "dart:html" as i;import "dart:math" as k;class l{static const m="Chrome";static const n="Firefox";static const o="Internet Explorer";static const q="Safari";final j;final minimumVersion;const l(this.j,[this.minimumVersion]);}class s{const s();}class t{final name;const t(this.name);}class u{const u();}class v{var BB;var CB;var DB;v(){CB=i.query('#progress-bar');BB=i.document.query('#files');BB.onChange.listen((g)=>EB());var h=i.query('#cancel-read');h.onClick.listen((g)=>FB());} GB( g){g=k.min(100,k.max(0,g));CB.style.width='${g}%';CB.text='${g}%';if(g==0||g==100){new AB.Timer(const Duration(milliseconds:2000),()=>CB.classes.remove('loading'));}} EB(){GB(0);CB.classes.remove('loading');var h=BB.files[0];DB=new i.FileReader();DB.onError.listen((g)=>HB());DB.onProgress.listen(IB);DB.onAbort.listen((g)=>i.window.alert('File read cancelled.'));DB.onLoadStart.listen((g)=>CB.classes.add('loading'));DB.onLoad.listen((g)=>GB(100));DB.readAsBinaryString(h);} FB(){if(DB!=null){DB.abort();}} IB( g){if(g.lengthComputable){var h=(100*g.loaded/g.total).round().toInt();GB(h);}} HB(){switch (DB.error.code){case i.FileError.NOT_FOUND_ERR:i.window.alert('File not found!');break;case i.FileError.NOT_READABLE_ERR:i.window.alert('File is not readable.');break;case i.FileError.ABORT_ERR:break;default:i.window.alert('An error occurred reading this file.');break;}}} main(){new v();}
« no previous file with comments | « src/site/samples/dndfiles/example/index.html ('k') | src/site/samples/dndfiles/example/monitoring.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698