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

Unified Diff: third_party/polymer/components-chromium/core-meta/core-meta.html

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 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
Index: third_party/polymer/components-chromium/core-meta/core-meta.html
diff --git a/third_party/polymer/components-chromium/core-meta/core-meta.html b/third_party/polymer/components-chromium/core-meta/core-meta.html
new file mode 100644
index 0000000000000000000000000000000000000000..376f93e2276d2d86e64ed57eae820f550c7df9bd
--- /dev/null
+++ b/third_party/polymer/components-chromium/core-meta/core-meta.html
@@ -0,0 +1,63 @@
+<!--
+Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+
+<!--
+`core-meta` provides a method of constructing a self-organizing database.
+It is useful to collate element meta-data for things like catalogs and for
+designer.
+
+Example, an element folder has a `metadata.html` file in it, that contains a
+`core-meta`, something like this:
+
+ <core-meta id="my-element" label="My Element">
+ <property name="color" value="blue"></property>
+ </core-meta>
+
+An application can import as many of these files as it wants, and then use
+`core-meta` again to access the collected data.
+
+ <script>
+ var meta = document.createElement('core-meta');
+ console.log(meta.list); // dump a list of all meta-data elements that have been created
+ </script>
+
+Use `byId(id)` to retrive a specific core-meta.
+
+ <script>
+ var meta = document.createElement('core-meta');
+ console.log(meta.byId('my-element'));
+ </script>
+
+By default all meta-data are stored in a single databse. If your meta-data
+have different types and want them to be stored separately, use `type` to
+differentiate them.
+
+Example:
+
+ <core-meta id="x-foo" type="xElt"></core-meta>
+ <core-meta id="x-bar" type="xElt"></core-meta>
+ <core-meta id="y-bar" type="yElt"></core-meta>
+
+ <script>
+ var meta = document.createElement('core-meta');
+ meta.type = 'xElt';
+ console.log(meta.list);
+ </script>
+
+@group Polymer Core Elements
+@element core-meta
+@homepage github.io
+-->
+
+<link rel="import" href="../polymer/polymer.html">
+
+<polymer-element name="core-meta" attributes="label type" hidden assetpath="">
+
+</polymer-element>
+<script src="core-meta-extracted.js"></script>

Powered by Google App Engine
This is Rietveld 408576698