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

Unified Diff: samples/webcomponents/contactifier/ContactsWidget.dart

Issue 10964030: A variety of cleanups to bring our samples up-to-date. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « samples/webcomponents/README ('k') | samples/webcomponents/contactifier/contactifier.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/webcomponents/contactifier/ContactsWidget.dart
===================================================================
--- samples/webcomponents/contactifier/ContactsWidget.dart (revision 12654)
+++ samples/webcomponents/contactifier/ContactsWidget.dart (working copy)
@@ -1,56 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/** A contacts widget demonstrating the Shadow DOM. */
-class ContactsWidget {
-
- // Statically populated for demo purposes.
- static const _contacts = const ['Gertrude Stein', 'Ezra Pound',
- 'T.S. Elliot', 'James Joyce',
- 'F. Scott Fitzgerald', 'Ernest Hemmingway'];
- static const _contactStyle =
- """
- <style scoped>
- ul {
- font-family: "Comic Sans MS", sans-serif;
- color: purple;
- list-style: none;
- }
-
- #userContent {
- text-align: right;
- margin: 20px;
- }
- </style>
- """;
-
- /**
- * User-supplied element in the external DOM that is the
- * Shadow host for the contacts widget.
- */
- final Element _shadowHost;
- final ShadowRoot _shadowRoot;
-
- ContactsWidget(shadowHost) :
- _shadowHost = shadowHost,
- _shadowRoot = new ShadowRoot(shadowHost) {
- _shadowRoot.nodes.add(new Element.html(_contactStyle));
- _shadowRoot.nodes.add(contactsDOM());
-
- var userContent = new DivElement();
- userContent.id = 'userContent';
- userContent.nodes.add(new Element.tag('content'));
- _shadowRoot.nodes.add(userContent);
- }
-
- /** Returns a DOM tree fragment containing a list of contacts. */
- Element contactsDOM() {
- var ul = new UListElement();
- // TODO(samhop): set class names in contact list DOM
- _contacts.forEach((contact) {
- ul.nodes.add(new Element.html('<li>$contact</li>'));
- });
- return ul;
- }
-}
« no previous file with comments | « samples/webcomponents/README ('k') | samples/webcomponents/contactifier/contactifier.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698