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

Side by Side Diff: src/site/samples/dndfiles/example/dndfiles.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 unified diff | Download patch
OLDNEW
(Empty)
1 import "dart:html" as h;class t{static const u="Chrome";static const v="Firefo x";static const AB="Internet Explorer";static const BB="Safari";final q;final minimumVersion;const t(this.q,[this.minimumVersion]);}class CB{const CB();}cla ss DB{final name;const DB(this.name);}class EB{const EB();}class FB{const FB(); }class GB{var IB;var JB;var KB;var LB;GB(){LB=h.document.query('#list');IB=h.doc ument.query('#read');JB=h.document.query('#files');JB.onChange.listen((g)=>MB()) ;KB=h.document.query('#drop-zone');KB.onDragOver.listen(NB);KB.onDragEnter.liste n((g)=>KB.classes.add('hover'));KB.onDragLeave.listen((g)=>KB.classes.remove('ho ver'));KB.onDrop.listen(OB);} NB( g){g.stopPropagation();g.preventDefault();g.da taTransfer.dropEffect='copy';} OB( g){g.stopPropagation();g.preventDefault();KB. classes.remove('hover');IB.reset();PB(g.dataTransfer.files);} MB(){PB(JB.files); } PB( s){LB.nodes.clear();var m=new h.Element.tag('ul');for(var g in s){var j=ne w h.Element.tag('li');if(g.type.startsWith('image')){var n=new h.Element.tag('sp an');var k=new h.FileReader();k.onLoad.listen((HB){var l=new h.ImageElement(src: k.result);l.classes.add('thumb');l.title=i(g.name);n.nodes.add(l);});k.readAsDat aUrl(g);j.nodes.add(n);}var o=new h.Element.tag('span');o.innerHtml=(new StringB uffer('<strong>')..write(i(g.name))..write('</strong> (')..write(g.type!=null?i( g.type):'n/a')..write(') ')..write(g.size)..write(' bytes')).toString();j.nodes. add(o);m.nodes.add(j);}LB.nodes.add(m);}} main(){new GB();} i( g){return g.repla ceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"', "&quot;").replaceAll("'","&apos;");}
OLDNEW
« no previous file with comments | « src/site/samples/dndfiles/example/dndfiles.css ('k') | src/site/samples/dndfiles/example/dndfiles.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698