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

Unified Diff: samples/third_party/todomvc_performance/js_todomvc/elements/td-model.html

Issue 1576153002: Remove the Dromaeo and TodoMVC samples. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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: samples/third_party/todomvc_performance/js_todomvc/elements/td-model.html
diff --git a/samples/third_party/todomvc_performance/js_todomvc/elements/td-model.html b/samples/third_party/todomvc_performance/js_todomvc/elements/td-model.html
deleted file mode 100755
index 19f3d2204332eca9d0136ae222d137f1fa87567a..0000000000000000000000000000000000000000
--- a/samples/third_party/todomvc_performance/js_todomvc/elements/td-model.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<link rel="import" href="../components/polymer/polymer.html">
-
-<polymer-element name="td-model" attributes="filter items storageId">
- <script>
- Polymer('td-model', {
- filtered: null,
- completedCount: 0,
- activeCount: 0,
- allCompleted: false,
- ready: function() {
- this.asyncMethod(function() {
- this.items = this.items || [];
- });
- },
- filterChanged: function() {
- this.filterItems();
- },
- itemsChanged: function() {
- this.completedCount =
- this.items.filter(this.filters.completed).length;
- this.activeCount = this.items.length - this.completedCount;
- this.allCompleted = this.completedCount && !this.activeCount;
- this.filterItems();
- if (this.storage) {
- this.storage.value = this.items;
- this.storage.save();
- }
- },
- storageIdChanged: function() {
- this.storage = document.querySelector('#' + this.storageId);
- this.storage && (this.items = this.storage.value);
- },
- filterItems: function() {
- var fn = this.filters[this.filter];
- this.filtered = fn ? this.items.filter(fn) : this.items;
- },
- newItem: function(title) {
- title = String(title).trim();
- if (title) {
- var item = {
- title: title,
- completed: false
- };
- this.items.push(item);
- this.itemsChanged();
- }
- },
- destroyItem: function(item) {
- var i = this.items.indexOf(item);
- if (i >= 0) {
- this.items.splice(i, 1);
- }
- this.itemsChanged();
- },
- clearItems: function(){
- this.items = this.items.filter(this.filters.active);
- },
- setItemsCompleted: function(completed) {
- this.items.forEach(function(item) {
- item.completed = completed;
- });
- this.itemsChanged();
- },
- filters: {
- active: function(item) {
- return !item.completed;
- },
- completed: function(item) {
- return item.completed;
- }
- }
- });
- </script>
-</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698