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

Unified Diff: pkg/polymer/lib/elements/polymer-mock-data/polymer-mock-data.html

Issue 175443005: [polymer] import all elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated from bower Created 6 years, 10 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: pkg/polymer/lib/elements/polymer-mock-data/polymer-mock-data.html
diff --git a/pkg/polymer/lib/elements/polymer-mock-data/polymer-mock-data.html b/pkg/polymer/lib/elements/polymer-mock-data/polymer-mock-data.html
new file mode 100644
index 0000000000000000000000000000000000000000..142e72a2d72911be784b8e7088958c37ce2d817e
--- /dev/null
+++ b/pkg/polymer/lib/elements/polymer-mock-data/polymer-mock-data.html
@@ -0,0 +1,44 @@
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<link rel="import" href="../polymer/polymer.html">
+
+<polymer-element name="polymer-mock-data" attributes="count items">
+ <script>
+ Polymer('polymer-mock-data', {
+ count: 3000,
+ items: null,
+ ready: function() {
+ this.generateRecords();
+ },
+ countChanged: function() {
+ if (!this.items || this.items.length !== this.count) {
+ this.generateRecords();
+ }
+ },
+ generateRecords: function() {
+ this.items = [];
+ for (var i=0; i<this.count; i++) {
+ this.items.push(this.fakeRecord());
+ }
+ },
+ fakeRecord: function() {
+ var fields = [];
+ for (var j=0, c=Math.floor(Math.random()*4)+2; j<c; j++) {
+ for(var k=0, s=''; k<8; k++) { s += String.fromCharCode([Math.floor(Math.random()*26) + 65 + (k > 0 ? 32 : 0)]) };
+ fields.push({
+ icon: ['twitter', 'gplus', 'filter', 'contact'][Math.floor(Math.random()*4)],
+ label: String.fromCharCode(j%26 + 65) + Math.floor((Math.random() + 1) * 1000),
+ value: s
+ });
+ }
+ return {
+ name: String.fromCharCode(Math.floor(Math.random()*26) + 65) + Math.floor((Math.random() + 1) * 1000),
+ fields: fields
+ };
+ }
+ });
+ </script>
+</polymer-element>
« no previous file with comments | « pkg/polymer/lib/elements/polymer-mock-data/index.html ('k') | pkg/polymer/lib/elements/polymer-overlay/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698