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

Unified Diff: src/site/samples/indexeddb_todo/example/todo.dart

Issue 27267004: Re-configured samples page. (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/indexeddb_todo/example/todo.dart
diff --git a/src/site/samples/indexeddb_todo/example/todo.dart b/src/site/samples/indexeddb_todo/example/todo.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fe7d063ca6eab35ca5ba3b97c70f5d827eecdbbb
--- /dev/null
+++ b/src/site/samples/indexeddb_todo/example/todo.dart
@@ -0,0 +1 @@
+import "dart:html" as l;import "dart:indexed_db" as m;import "dart:async" as n;class t{static const u="Chrome";static const v="Firefox";static const AB="Internet Explorer";static const BB="Safari";final q;final minimumVersion;const t(this.q,[this.minimumVersion]);}class CB{const CB();}class DB{final name;const DB(this.name);}class EB{const EB();}class FB{const FB();}class GB{static final o="todo";static final i="todos";var HB;var IB=2;var JB;var KB;GB(){KB=l.query('#todo-items');JB=l.query('#todo');l.query('input#submit').onClick.listen((g)=>LB());} open(){return l.window.indexedDB.open(o,version:IB,onUpgradeNeeded:MB).then(NB).catchError(OB);} OB(g){l.window.alert('Oh no! Something went wrong. See the console for details.');l.window.console.log('An error occurred: {${g}}');} NB( g){HB=g;PB();} MB( h){var g=(h.target as m.OpenDBRequest).result;if(!g.objectStoreNames.contains(i)){g.createObjectStore(i,keyPath:'timeStamp');}} LB(){var g=JB.value.trim();if(g.length>0){QB(g);}JB.value='';} QB( j){var g=HB.transaction(i,'readwrite');var h=g.objectStore(i);return h.put({'text':j,'timeStamp':new DateTime.now().millisecondsSinceEpoch.toString()}).then((RB)=>PB()).catchError((k)=>OB);} SB( k){var g=HB.transaction(i,'readwrite');var j=g.objectStore(i);var h=j.delete(k);h.then((s)=>PB(),onError:OB);} PB(){KB.nodes.clear();var g=HB.transaction(i,'readwrite');var h=g.objectStore(i);var k=h.openCursor(autoAdvance:true).listen((j){TB(j.value);},onError:OB);} TB( k){var j=new l.Element.tag('span');j.text=k['text'];var h=new l.Element.tag('a');h.text='[Delete]';h.onClick.listen((s)=>SB(k['timeStamp']));var g=new l.Element.tag('li');g.nodes.add(j);g.nodes.add(h);KB.nodes.add(g);}} main(){new GB().open();}

Powered by Google App Engine
This is Rietveld 408576698