Skip to content
Browse files

Add polymer and paper elements

  • Loading branch information...
1 parent 783c4d9 commit 39b977562fcd760750eeee1fb05c8d9a7ccfeeb1 Penn Su committed
Showing with 15,515 additions and 1 deletion.
  1. +4 −1 bower.json
  2. +3 −0 www/index.html
  3. +16 −0 www/lib/context-free-parser/.bower.json
  4. +4 −0 www/lib/context-free-parser/README.md
  5. +5 −0 www/lib/context-free-parser/bower.json
  6. +40 −0 www/lib/context-free-parser/context-free-parser.html
  7. +105 −0 www/lib/context-free-parser/context-free-parser.js
  8. +25 −0 www/lib/context-free-parser/demo.html
  9. +23 −0 www/lib/context-free-parser/index.html
  10. +18 −0 www/lib/core-ajax/.bower.json
  11. +4 −0 www/lib/core-ajax/README.md
  12. +7 −0 www/lib/core-ajax/bower.json
  13. +320 −0 www/lib/core-ajax/core-ajax.html
  14. +115 −0 www/lib/core-ajax/core-xhr.html
  15. +43 −0 www/lib/core-ajax/demo.html
  16. +23 −0 www/lib/core-ajax/index.html
  17. +18 −0 www/lib/core-collapse/.bower.json
  18. +4 −0 www/lib/core-collapse/README.md
  19. +7 −0 www/lib/core-collapse/bower.json
  20. +16 −0 www/lib/core-collapse/core-collapse.css
  21. +243 −0 www/lib/core-collapse/core-collapse.html
  22. +79 −0 www/lib/core-collapse/demo.html
  23. +23 −0 www/lib/core-collapse/index.html
  24. +19 −0 www/lib/core-component-page/.bower.json
  25. +6 −0 www/lib/core-component-page/README.md
  26. BIN www/lib/core-component-page/bowager-logo.png
  27. +8 −0 www/lib/core-component-page/bower.json
  28. +5,797 −0 www/lib/core-component-page/core-component-page.html
  29. +23 −0 www/lib/core-component-page/demo.html
  30. +23 −0 www/lib/core-component-page/index.html
  31. +28 −0 www/lib/core-doc-viewer/.bower.json
  32. +4 −0 www/lib/core-doc-viewer/README.md
  33. +17 −0 www/lib/core-doc-viewer/bower.json
  34. +178 −0 www/lib/core-doc-viewer/core-doc-viewer.html
  35. +37 −0 www/lib/core-doc-viewer/demo.html
  36. +182 −0 www/lib/core-doc-viewer/elements/core-doc-page.css
  37. +157 −0 www/lib/core-doc-viewer/elements/core-doc-page.html
  38. +17 −0 www/lib/core-doc-viewer/elements/core-doc-toc.css
  39. +59 −0 www/lib/core-doc-viewer/elements/core-doc-toc.html
  40. +23 −0 www/lib/core-doc-viewer/index.html
  41. +18 −0 www/lib/core-docs/.bower.json
  42. +4 −0 www/lib/core-docs/README.md
  43. +7 −0 www/lib/core-docs/bower.json
  44. +71 −0 www/lib/core-docs/index.html
  45. +14 −0 www/lib/core-drag-drop/.bower.json
  46. +111 −0 www/lib/core-drag-drop/core-drag-drop.html
  47. +93 −0 www/lib/core-drag-drop/demo.html
  48. +23 −0 www/lib/core-drag-drop/index.html
  49. +19 −0 www/lib/core-drawer-panel/.bower.json
  50. +4 −0 www/lib/core-drawer-panel/README.md
  51. +8 −0 www/lib/core-drawer-panel/bower.json
  52. +162 −0 www/lib/core-drawer-panel/core-drawer-panel.css
  53. +143 −0 www/lib/core-drawer-panel/core-drawer-panel.html
  54. +68 −0 www/lib/core-drawer-panel/demo.html
  55. +23 −0 www/lib/core-drawer-panel/index.html
  56. +28 −0 www/lib/core-drawer-panel/metadata.html
  57. +54 −0 www/lib/core-elements/.bower.json
  58. +4 −0 www/lib/core-elements/README.md
  59. +42 −0 www/lib/core-elements/bower.json
  60. BIN www/lib/core-elements/code.png
  61. +53 −0 www/lib/core-elements/core-elements.html
  62. +85 −0 www/lib/core-elements/demo.html
  63. +112 −0 www/lib/core-elements/demos/core-drawer-panel.html
  64. +23 −0 www/lib/core-elements/index.html
  65. +20 −0 www/lib/core-elements/metadata.html
  66. +18 −0 www/lib/core-field/.bower.json
  67. +4 −0 www/lib/core-field/README.md
  68. +7 −0 www/lib/core-field/bower.json
  69. +38 −0 www/lib/core-field/core-field.css
  70. +35 −0 www/lib/core-field/core-field.html
  71. +58 −0 www/lib/core-field/demo.html
  72. +23 −0 www/lib/core-field/index.html
  73. +17 −0 www/lib/core-field/metadata.html
  74. +18 −0 www/lib/core-header-panel/.bower.json
  75. +4 −0 www/lib/core-header-panel/README.md
  76. +7 −0 www/lib/core-header-panel/bower.json
  77. +75 −0 www/lib/core-header-panel/core-header-panel.css
  78. +173 −0 www/lib/core-header-panel/core-header-panel.html
  79. +100 −0 www/lib/core-header-panel/demo.html
  80. +23 −0 www/lib/core-header-panel/index.html
  81. +28 −0 www/lib/core-header-panel/metadata.html
  82. +18 −0 www/lib/core-icon-button/.bower.json
  83. +4 −0 www/lib/core-icon-button/README.md
  84. +7 −0 www/lib/core-icon-button/bower.json
  85. +70 −0 www/lib/core-icon-button/core-icon-button.css
  86. +85 −0 www/lib/core-icon-button/core-icon-button.html
  87. +51 −0 www/lib/core-icon-button/demo.html
  88. +23 −0 www/lib/core-icon-button/index.html
  89. +11 −0 www/lib/core-icon-button/metadata.html
  90. +19 −0 www/lib/core-icon/.bower.json
  91. +4 −0 www/lib/core-icon/README.md
  92. +8 −0 www/lib/core-icon/bower.json
  93. +24 −0 www/lib/core-icon/core-icon.css
  94. +125 −0 www/lib/core-icon/core-icon.html
  95. +44 −0 www/lib/core-icon/demo.html
  96. +23 −0 www/lib/core-icon/index.html
  97. +12 −0 www/lib/core-icon/metadata.html
  98. +20 −0 www/lib/core-icons/.bower.json
  99. +4 −0 www/lib/core-icons/README.md
  100. +9 −0 www/lib/core-icons/bower.json
  101. +14 −0 www/lib/core-icons/core-icons.html
  102. +91 −0 www/lib/core-icons/demo.html
  103. +45 −0 www/lib/core-icons/iconsets/av-icons.html
  104. +38 −0 www/lib/core-icons/iconsets/communication-icons.html
  105. +54 −0 www/lib/core-icons/iconsets/device-icons.html
  106. +45 −0 www/lib/core-icons/iconsets/hardware-icons.html
  107. +192 −0 www/lib/core-icons/iconsets/icons.html
  108. +51 −0 www/lib/core-icons/iconsets/image-icons.html
  109. +33 −0 www/lib/core-icons/iconsets/maps-icons.html
  110. +53 −0 www/lib/core-icons/iconsets/notification-icons.html
  111. +18 −0 www/lib/core-icons/iconsets/png-icons.html
  112. +50 −0 www/lib/core-icons/iconsets/social-icons.html
  113. +22 −0 www/lib/core-icons/index.html
  114. +19 −0 www/lib/core-iconset-svg/.bower.json
  115. +4 −0 www/lib/core-iconset-svg/README.md
  116. +8 −0 www/lib/core-iconset-svg/bower.json
  117. +170 −0 www/lib/core-iconset-svg/core-iconset-svg.html
  118. +108 −0 www/lib/core-iconset-svg/demo.html
  119. +22 −0 www/lib/core-iconset-svg/index.html
  120. +67 −0 www/lib/core-iconset-svg/svg-sample-icons.html
  121. +19 −0 www/lib/core-iconset/.bower.json
  122. +4 −0 www/lib/core-iconset/README.md
  123. +8 −0 www/lib/core-iconset/bower.json
  124. +236 −0 www/lib/core-iconset/core-iconset.html
  125. +95 −0 www/lib/core-iconset/demo.html
  126. +23 −0 www/lib/core-iconset/index.html
  127. BIN www/lib/core-iconset/my-icons.png
  128. +17 −0 www/lib/core-input/.bower.json
  129. +2 −0 www/lib/core-input/README.md
  130. +6 −0 www/lib/core-input/bower.json
  131. +35 −0 www/lib/core-input/core-input.css
  132. +256 −0 www/lib/core-input/core-input.html
  133. +89 −0 www/lib/core-input/demo.html
  134. +22 −0 www/lib/core-input/index.html
  135. +11 −0 www/lib/core-input/metadata.html
  136. +19 −0 www/lib/core-item/.bower.json
  137. +4 −0 www/lib/core-item/README.md
  138. +8 −0 www/lib/core-item/bower.json
  139. +31 −0 www/lib/core-item/core-item.css
  140. +72 −0 www/lib/core-item/core-item.html
  141. +60 −0 www/lib/core-item/demo.html
  142. +23 −0 www/lib/core-item/index.html
  143. +15 −0 www/lib/core-item/metadata.html
  144. +18 −0 www/lib/core-layout-grid/.bower.json
  145. +4 −0 www/lib/core-layout-grid/README.md
  146. +7 −0 www/lib/core-layout-grid/bower.json
  147. +350 −0 www/lib/core-layout-grid/core-layout-grid.html
  148. +107 −0 www/lib/core-layout-grid/demo.html
  149. +23 −0 www/lib/core-layout-grid/index.html
  150. +13 −0 www/lib/core-layout-grid/metadata.html
  151. +18 −0 www/lib/core-layout-trbl/.bower.json
  152. +4 −0 www/lib/core-layout-trbl/README.md
  153. +7 −0 www/lib/core-layout-trbl/bower.json
  154. +269 −0 www/lib/core-layout-trbl/core-layout-trbl.html
  155. +181 −0 www/lib/core-layout-trbl/core-slide.html
  156. +58 −0 www/lib/core-layout-trbl/demo.html
  157. +23 −0 www/lib/core-layout-trbl/index.html
  158. +18 −0 www/lib/core-layout/.bower.json
  159. +4 −0 www/lib/core-layout/README.md
  160. +8 −0 www/lib/core-layout/bower.json
  161. +106 −0 www/lib/core-layout/core-layout-host.css
  162. +216 −0 www/lib/core-layout/core-layout.css
  163. +288 −0 www/lib/core-layout/core-layout.html
  164. +31 −0 www/lib/core-layout/demo-body.html
  165. +83 −0 www/lib/core-layout/demo-css.html
  166. +87 −0 www/lib/core-layout/demo-parent.html
  167. +82 −0 www/lib/core-layout/demo.html
  168. +23 −0 www/lib/core-layout/index.html
  169. +15 −0 www/lib/core-layout/metadata.html
  170. +19 −0 www/lib/core-list/.bower.json
  171. +4 −0 www/lib/core-list/README.md
  172. +8 −0 www/lib/core-list/bower.json
  173. +20 −0 www/lib/core-list/core-list.css
  174. +403 −0 www/lib/core-list/core-list.html
  175. +178 −0 www/lib/core-list/demo-divider.html
  176. +154 −0 www/lib/core-list/demo.html
  177. BIN www/lib/core-list/images/0.png
  178. BIN www/lib/core-list/images/1.png
  179. BIN www/lib/core-list/images/2.png
  180. BIN www/lib/core-list/images/3.png
  181. +22 −0 www/lib/core-list/index.html
  182. +18 −0 www/lib/core-localstorage/.bower.json
  183. +4 −0 www/lib/core-localstorage/README.md
  184. +7 −0 www/lib/core-localstorage/bower.json
  185. +128 −0 www/lib/core-localstorage/core-localstorage.html
  186. +41 −0 www/lib/core-localstorage/demo.html
  187. +23 −0 www/lib/core-localstorage/index.html
  188. +18 −0 www/lib/core-media-query/.bower.json
  189. +4 −0 www/lib/core-media-query/README.md
  190. +7 −0 www/lib/core-media-query/bower.json
  191. +87 −0 www/lib/core-media-query/core-media-query.html
  192. +44 −0 www/lib/core-media-query/demo.html
  193. +23 −0 www/lib/core-media-query/index.html
Sorry, we could not display the entire diff because too many files (818) changed.
View
5 bower.json
@@ -8,7 +8,10 @@
"firebase": "~1.0.17",
"firebase-simple-login": "~1.6.1",
"angularfire": "~0.7.1",
- "moment": "~2.7.0"
+ "moment": "~2.7.0",
+ "polymer": "Polymer/polymer#~0.3.3",
+ "core-elements": "Polymer/core-elements#~0.3.3",
+ "paper-elements": "Polymer/paper-elements#~0.3.3"
},
"resolutions": {
"firebase-simple-login": "~1.6.1"
View
3 www/index.html
@@ -20,6 +20,9 @@
<script src="lib/firebase-simple-login/firebase-simple-login.js"></script>
<script src="lib/angularfire/angularfire.js"></script>
<script src="lib/moment/moment.js"></script>
+ <script src="lib/platform/platform.js"></script>
+
+ <link rel="import" href="lib/core-ajax/core-ajax.html">
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
View
16 www/lib/context-free-parser/.bower.json
@@ -0,0 +1,16 @@
+{
+ "name": "context-free-parser",
+ "private": true,
+ "dependencies": {},
+ "homepage": "https://github.com/Polymer/context-free-parser",
+ "version": "0.3.3",
+ "_release": "0.3.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "0.3.3",
+ "commit": "ed5593b5fcaebfe2205b7980674d872156b516c4"
+ },
+ "_source": "git://github.com/Polymer/context-free-parser.git",
+ "_target": ">=0.3.0 <1.0.0",
+ "_originalSource": "Polymer/context-free-parser"
+}
View
4 www/lib/context-free-parser/README.md
@@ -0,0 +1,4 @@
+context-free-parser
+===================
+
+See the [component landing page](http://polymer.github.io/context-free-parser) for more information.
View
5 www/lib/context-free-parser/bower.json
@@ -0,0 +1,5 @@
+{
+ "name": "context-free-parser",
+ "private": true,
+ "dependencies": {}
+}
View
40 www/lib/context-free-parser/context-free-parser.html
@@ -0,0 +1,40 @@
+<script src="context-free-parser.js"></script>
+<link rel="import" href="../core-ajax/core-ajax.html">
+
+<!--
+Scrapes source documentation data from input text or url.
+
+@class context-free-parser
+-->
+<polymer-element name="context-free-parser" attributes="url text data">
+<template>
+
+ <core-ajax url="{{url}}" response="{{text}}" auto></core-ajax>
+
+</template>
+<script>
+
+ Polymer('context-free-parser', {
+
+ text: null,
+
+ textChanged: function() {
+ if (this.text) {
+ var entities = ContextFreeParser.parse(this.text);
+ if (!entities || entities.length === 0) {
+ entities = [
+ {name: this.url.split('/').pop(), description: '**Undocumented**'}
+ ];
+ }
+ this.data = { classes: entities };
+ }
+ },
+
+ dataChanged: function() {
+ this.fire('data-ready');
+ }
+
+ });
+
+</script>
+</polymer-element>
View
105 www/lib/context-free-parser/context-free-parser.js
@@ -0,0 +1,105 @@
+(function(scope) {
+
+ var ContextFreeParser = {
+ parse: function(text) {
+ var top = {};
+ var entities = [];
+ var current = top;
+ var subCurrent = {};
+
+ var scriptDocCommentClause = '\\/\\*\\*([\\s\\S]*?)\\*\\/';
+ var htmlDocCommentClause = '<!--([\\s\\S]*?)-->';
+
+ // matches text between /** and */ inclusive and <!-- and --> inclusive
+ var docCommentRegex = new RegExp(scriptDocCommentClause + '|' + htmlDocCommentClause, 'g');
+
+ // acquire all script doc comments
+ var docComments = text.match(docCommentRegex) || [];
+
+ // each match represents a single block of doc comments
+ docComments.forEach(function(m) {
+ // unify line ends, remove all comment characters, split into individual lines
+ var lines = m.replace(/\r\n/g, '\n').replace(/^\s*\/\*\*|^\s*\*\/|^\s*\* ?|^\s*\<\!-\-|^s*\-\-\>/gm, '').split('\n');
+
+ // pragmas (@-rules) must occur on a line by themselves
+ var pragmas = [];
+ // filter lines whose first non-whitespace character is @ into the pragma list
+ // (and out of the `lines` array)
+ lines = lines.filter(function(l) {
+ var m = l.match(/\s*@([\w-]*) (.*)/);
+ if (!m) {
+ return true;
+ }
+ pragmas.push(m);
+ });
+
+ // collect all other text into a single block
+ var code = lines.join('\n');
+
+ // process pragmas
+ pragmas.forEach(function(m) {
+ var pragma = m[1], content = m[2];
+ switch (pragma) {
+
+ // currently all entities are either @class or @element
+ case 'class':
+ case 'element':
+ current = {
+ name: content,
+ description: code
+ };
+ entities.push(current);
+ break;
+
+ // an entity may have these describable sub-features
+ case 'attribute':
+ case 'property':
+ case 'method':
+ case 'event':
+ subCurrent = {
+ name: content,
+ description: code
+ };
+ var label = pragma == 'property' ? 'properties' : pragma + 's';
+ makePragma(current, label, subCurrent);
+ break;
+
+ // sub-feature pragmas
+ case 'default':
+ case 'type':
+ subCurrent[pragma] = content;
+ break;
+
+ // everything else
+ default:
+ current[pragma] = content;
+ break;
+ }
+ });
+
+ // utility function, yay hoisting
+ function makePragma(object, pragma, content) {
+ var p$ = object;
+ var p = p$[pragma];
+ if (!p) {
+ p$[pragma] = p = [];
+ }
+ p.push(content);
+ }
+
+ });
+
+ if (entities.length === 0) {
+ entities.push({name: 'Entity', description: '**Undocumented**'});
+ }
+ return entities;
+ }
+ };
+
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = ContextFreeParser;
+ } else {
+ scope.ContextFreeParser = ContextFreeParser;
+ }
+
+})(this);
View
25 www/lib/context-free-parser/demo.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+<head>
+
+ <title>context-free-parser</title>
+
+ <script src="../platform/platform.js"></script>
+
+ <link rel="import" href="context-free-parser.html">
+
+</head>
+
+<body unresolved>
+
+ <context-free-parser url="../core-ajax/core-ajax.html"></context-free-parser>
+
+ <script>
+ addEventListener('data-ready', function(event) {
+ console.dir(event.target.data);
+ });
+ </script>
+
+</body>
+
+</html>
View
23 www/lib/context-free-parser/index.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!--
+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
+The complete set of authors may be found at http://polymer.github.io/AUTHORS
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
+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
+-->
+<html>
+<head>
+
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="../polymer/polymer.html">
+ <link rel="import" href="../core-component-page/core-component-page.html">
+
+</head>
+<body unresolved>
+
+ <core-component-page></core-component-page>
+
+</body>
+</html>
View
18 www/lib/core-ajax/.bower.json
@@ -0,0 +1,18 @@
+{
+ "name": "core-ajax",
+ "private": true,
+ "dependencies": {
+ "polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
+ },
+ "homepage": "https://github.com/Polymer/core-ajax",
+ "version": "0.3.3",
+ "_release": "0.3.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "0.3.3",
+ "commit": "b9cb6d8e2a5b91cbe752bdb89f5c58cadf92fad6"
+ },
+ "_source": "git://github.com/Polymer/core-ajax.git",
+ "_target": ">=0.3.0 <1.0.0",
+ "_originalSource": "Polymer/core-ajax"
+}
View
4 www/lib/core-ajax/README.md
@@ -0,0 +1,4 @@
+core-ajax
+=========
+
+See the [component page](http://polymer.github.io/core-ajax) for more information.
View
7 www/lib/core-ajax/bower.json
@@ -0,0 +1,7 @@
+{
+ "name": "core-ajax",
+ "private": true,
+ "dependencies": {
+ "polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
+ }
+}
View
320 www/lib/core-ajax/core-ajax.html
@@ -0,0 +1,320 @@
+<!--
+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
+-->
+
+<!--
+@group Polymer Core Elements
+
+The `core-ajax` element exposes `XMLHttpRequest` functionality.
+
+ <core-ajax
+ auto
+ url="http://gdata.youtube.com/feeds/api/videos/"
+ params='{"alt":"json", "q":"chrome"}'
+ handleAs="json"
+ on-core-response="{{handleResponse}}"></core-ajax>
+
+With `auto` set to `true`, the element performs a request whenever
+its `url` or `params` properties are changed.
+
+Note: The `params` attribute must be double quoted JSON.
+
+You can trigger a request explicitly by calling `go` on the
+element.
+
+@element core-ajax
+@status beta
+@homepage github.io
+-->
+<link rel="import" href="core-xhr.html">
+<polymer-element name="core-ajax" attributes="url handleAs auto params response method headers body contentType withCredentials">
+<script>
+
+ Polymer('core-ajax', {
+ /**
+ * Fired when a response is received.
+ *
+ * @event core-response
+ */
+
+ /**
+ * Fired when an error is received.
+ *
+ * @event core-error
+ */
+
+ /**
+ * Fired whenever a response or an error is received.
+ *
+ * @event core-complete
+ */
+
+ /**
+ * The URL target of the request.
+ *
+ * @attribute url
+ * @type string
+ * @default ''
+ */
+ url: '',
+
+ /**
+ * Specifies what data to store in the `response` property, and
+ * to deliver as `event.response` in `response` events.
+ *
+ * One of:
+ *
+ * `text`: uses `XHR.responseText`.
+ *
+ * `xml`: uses `XHR.responseXML`.
+ *
+ * `json`: uses `XHR.responseText` parsed as JSON.
+ *
+ * `arraybuffer`: uses `XHR.response`.
+ *
+ * `blob`: uses `XHR.response`.
+ *
+ * `document`: uses `XHR.response`.
+ *
+ * @attribute handleAs
+ * @type string
+ * @default 'text'
+ */
+ handleAs: '',
+
+ /**
+ * If true, automatically performs an Ajax request when either `url` or `params` changes.
+ *
+ * @attribute auto
+ * @type boolean
+ * @default false
+ */
+ auto: false,
+
+ /**
+ * Parameters to send to the specified URL, as JSON.
+ *
+ * @attribute params
+ * @type string (JSON)
+ * @default ''
+ */
+ params: '',
+
+ /**
+ * Returns the response object.
+ *
+ * @attribute response
+ * @type Object
+ * @default null
+ */
+ response: null,
+
+ /**
+ * The HTTP method to use such as 'GET', 'POST', 'PUT', or 'DELETE'.
+ * Default is 'GET'.
+ *
+ * @attribute method
+ * @type string
+ * @default ''
+ */
+ method: '',
+
+ /**
+ * HTTP request headers to send.
+ *
+ * Example:
+ *
+ * <core-ajax
+ * auto
+ * url="http://somesite.com"
+ * headers='{"X-Requested-With": "XMLHttpRequest"}'
+ * handleAs="json"
+ * on-core-response="{{handleResponse}}"></core-ajax>
+ *
+ * @attribute headers
+ * @type Object
+ * @default null
+ */
+ headers: null,
+
+ /**
+ * Optional raw body content to send when method === "POST".
+ *
+ * Example:
+ *
+ * <core-ajax method="POST" auto url="http://somesite.com"
+ * body='{"foo":1, "bar":2}'>
+ * </core-ajax>
+ *
+ * @attribute body
+ * @type Object
+ * @default null
+ */
+ body: null,
+
+ /**
+ * Content type to use when sending data.
+ *
+ * @attribute contentType
+ * @type string
+ * @default 'application/x-www-form-urlencoded'
+ */
+ contentType: 'application/x-www-form-urlencoded',
+
+ /**
+ * Set the withCredentials flag on the request.
+ *
+ * @attribute withCredentials
+ * @type boolean
+ * @default false
+ */
+ withCredentials: false,
+
+ /**
+ * Additional properties to send to core-xhr.
+ *
+ * Can be set to an object containing default properties
+ * to send as arguments to the `core-xhr.request()` method
+ * which implements the low-level communication.
+ *
+ * @property xhrArgs
+ * @type Object
+ * @default null
+ */
+ xhrArgs: null,
+
+ ready: function() {
+ this.xhr = document.createElement('core-xhr');
+ },
+
+ receive: function(response, xhr) {
+ if (this.isSuccess(xhr)) {
+ this.processResponse(xhr);
+ } else {
+ this.error(xhr);
+ }
+ this.complete(xhr);
+ },
+
+ isSuccess: function(xhr) {
+ var status = xhr.status || 0;
+ return !status || (status >= 200 && status < 300);
+ },
+
+ processResponse: function(xhr) {
+ var response = this.evalResponse(xhr);
+ this.response = response;
+ this.fire('core-response', {response: response, xhr: xhr});
+ },
+
+ error: function(xhr) {
+ var response = xhr.status + ': ' + xhr.responseText;
+ this.fire('core-error', {response: response, xhr: xhr});
+ },
+
+ complete: function(xhr) {
+ this.fire('core-complete', {response: xhr.status, xhr: xhr});
+ },
+
+ evalResponse: function(xhr) {
+ return this[(this.handleAs || 'text') + 'Handler'](xhr);
+ },
+
+ xmlHandler: function(xhr) {
+ return xhr.responseXML;
+ },
+
+ textHandler: function(xhr) {
+ return xhr.responseText;
+ },
+
+ jsonHandler: function(xhr) {
+ var r = xhr.responseText;
+ try {
+ return JSON.parse(r);
+ } catch (x) {
+ return r;
+ }
+ },
+
+ documentHandler: function(xhr) {
+ return xhr.response;
+ },
+
+ blobHandler: function(xhr) {
+ return xhr.response;
+ },
+
+ arraybufferHandler: function(xhr) {
+ return xhr.response;
+ },
+
+ urlChanged: function() {
+ if (!this.handleAs) {
+ var ext = String(this.url).split('.').pop();
+ switch (ext) {
+ case 'json':
+ this.handleAs = 'json';
+ break;
+ }
+ }
+ this.autoGo();
+ },
+
+ paramsChanged: function() {
+ this.autoGo();
+ },
+
+ autoChanged: function() {
+ this.autoGo();
+ },
+
+ // TODO(sorvell): multiple side-effects could call autoGo
+ // during one micro-task, use a job to have only one action
+ // occur
+ autoGo: function() {
+ if (this.auto) {
+ this.goJob = this.job(this.goJob, this.go, 0);
+ }
+ },
+
+ /**
+ * Performs an Ajax request to the specified URL.
+ *
+ * @method go
+ */
+ go: function() {
+ var args = this.xhrArgs || {};
+ // TODO(sjmiles): we may want XHR to default to POST if body is set
+ args.body = this.body || args.body;
+ args.params = this.params || args.params;
+ if (args.params && typeof(args.params) == 'string') {
+ args.params = JSON.parse(args.params);
+ }
+ args.headers = this.headers || args.headers || {};
+ if (args.headers && typeof(args.headers) == 'string') {
+ args.headers = JSON.parse(args.headers);
+ }
+ if (this.contentType) {
+ args.headers['content-type'] = this.contentType;
+ }
+ if (this.handleAs === 'arraybuffer' || this.handleAs === 'blob' ||
+ this.handleAs === 'document') {
+ args.responseType = this.handleAs;
+ }
+ args.withCredentials = this.withCredentials;
+ args.callback = this.receive.bind(this);
+ args.url = this.url;
+ args.method = this.method;
+ return args.url && this.xhr.request(args);
+ }
+
+ });
+
+</script>
+</polymer-element>
View
115 www/lib/core-ajax/core-xhr.html
@@ -0,0 +1,115 @@
+<!--
+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
+-->
+<!--
+/**
+ * @group Polymer Core Elements
+ *
+ * core-xhr can be used to perform XMLHttpRequests.
+ *
+ * <core-xhr id="xhr"></core-xhr>
+ * ...
+ * this.$.xhr.request({url: url, params: params, callback: callback});
+ *
+ * @element core-xhr
+ */
+-->
+
+<link rel="import" href="../polymer/polymer.html">
+
+<polymer-element name="core-xhr" hidden>
+
+ <script>
+
+ Polymer('core-xhr', {
+
+ /**
+ * Sends a HTTP request to the server and returns the XHR object.
+ *
+ * @method request
+ * @param {Object} inOptions
+ * @param {String} inOptions.url The url to which the request is sent.
+ * @param {String} inOptions.method The HTTP method to use, default is GET.
+ * @param {boolean} inOptions.sync By default, all requests are sent asynchronously. To send synchronous requests, set to true.
+ * @param {Object} inOptions.params Data to be sent to the server.
+ * @param {Object} inOptions.body The content for the request body for POST method.
+ * @param {Object} inOptions.headers HTTP request headers.
+ * @param {String} inOptions.responseType The response type. Default is 'text'.
+ * @param {boolean} inOptions.withCredentials Whether or not to send credentials on the request. Default is false.
+ * @param {Object} inOptions.callback Called when request is completed.
+ * @returns {Object} XHR object.
+ */
+ request: function(options) {
+ var xhr = new XMLHttpRequest();
+ var url = options.url;
+ var method = options.method || 'GET';
+ var async = !options.sync;
+ //
+ var params = this.toQueryString(options.params);
+ if (params && method == 'GET') {
+ url += (url.indexOf('?') > 0 ? '&' : '?') + params;
+ }
+ var xhrParams = this.isBodyMethod(method) ? (options.body || params) : null;
+ //
+ xhr.open(method, url, async);
+ if (options.responseType) {
+ xhr.responseType = options.responseType;
+ }
+ if (options.withCredentials) {
+ xhr.withCredentials = true;
+ }
+ this.makeReadyStateHandler(xhr, options.callback);
+ this.setRequestHeaders(xhr, options.headers);
+ xhr.send(xhrParams);
+ if (!async) {
+ xhr.onreadystatechange(xhr);
+ }
+ return xhr;
+ },
+
+ toQueryString: function(params) {
+ var r = [];
+ for (var n in params) {
+ var v = params[n];
+ n = encodeURIComponent(n);
+ r.push(v == null ? n : (n + '=' + encodeURIComponent(v)));
+ }
+ return r.join('&');
+ },
+
+ isBodyMethod: function(method) {
+ return this.bodyMethods[(method || '').toUpperCase()];
+ },
+
+ bodyMethods: {
+ POST: 1,
+ PUT: 1,
+ DELETE: 1
+ },
+
+ makeReadyStateHandler: function(xhr, callback) {
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ callback && callback.call(null, xhr.response, xhr);
+ }
+ };
+ },
+
+ setRequestHeaders: function(xhr, headers) {
+ if (headers) {
+ for (var name in headers) {
+ xhr.setRequestHeader(name, headers[name]);
+ }
+ }
+ }
+
+ });
+
+ </script>
+
+</polymer-element>
View
43 www/lib/core-ajax/demo.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<!--
+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
+-->
+<html>
+<head>
+
+ <title>core-ajax</title>
+
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="core-ajax.html">
+
+</head>
+<body>
+
+ <core-ajax auto url="http://gdata.youtube.com/feeds/api/videos/"
+ params='{"alt":"json", "q":"chrome"}'
+ handleAs="json"></core-ajax>
+
+ <template repeat="{{response.feed.entry}}">
+ <div>{{title.$t}}</div>
+ </template>
+
+ <script>
+ document.addEventListener('polymer-ready', function() {
+ var ajax = document.querySelector("core-ajax");
+ ajax.addEventListener("core-response",
+ function(e) {
+ document.querySelector('template').model = {
+ response: e.detail.response
+ };
+ }
+ );
+ });
+ </script>
+
+</body>
+</html>
View
23 www/lib/core-ajax/index.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!--
+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
+The complete set of authors may be found at http://polymer.github.io/AUTHORS
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
+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
+-->
+<html>
+<head>
+
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="../polymer/polymer.html">
+ <link rel="import" href="../core-component-page/core-component-page.html">
+
+</head>
+<body unresolved>
+
+ <core-component-page></core-component-page>
+
+</body>
+</html>
View
18 www/lib/core-collapse/.bower.json
@@ -0,0 +1,18 @@
+{
+ "name": "core-collapse",
+ "private": true,
+ "dependencies": {
+ "polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
+ },
+ "homepage": "https://github.com/Polymer/core-collapse",
+ "version": "0.3.3",
+ "_release": "0.3.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "0.3.3",
+ "commit": "358ad316615bd7a5bd40fef2f078973d46d4e8ee"
+ },
+ "_source": "git://github.com/Polymer/core-collapse.git",
+ "_target": ">=0.3.0 <1.0.0",
+ "_originalSource": "Polymer/core-collapse"
+}
View
4 www/lib/core-collapse/README.md
@@ -0,0 +1,4 @@
+core-collapse
+=============
+
+See the [component page](http://polymer.github.io/core-collapse) for more information.
View
7 www/lib/core-collapse/bower.json
@@ -0,0 +1,7 @@
+{
+ "name": "core-collapse",
+ "private": true,
+ "dependencies": {
+ "polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
+ }
+}
View
16 www/lib/core-collapse/core-collapse.css
@@ -0,0 +1,16 @@
+/*
+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
+*/
+
+html /deep/ core-collapse {
+ display: block;
+}
+
+html /deep/ .core-collapse-closed {
+ display: none;
+}
View
243 www/lib/core-collapse/core-collapse.html
@@ -0,0 +1,243 @@
+<!--
+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-collapse` creates a collapsible block of content. By default, the content
+will be collapsed. Use `opened` to show/hide the content.
+
+ <button on-click="{{toggle}}">toggle collapse</button>
+
+ <core-collapse id="collapse"></core-collapse>
+ ...
+ </core-collapse>
+
+ ...
+
+ toggle: function() {
+ this.$.collapse.toggle();
+ }
+
+@group Polymer Core Elements
+@element core-collapse
+-->
+
+<link rel="import" href="../polymer/polymer.html">
+
+<link rel="stylesheet" href="core-collapse.css" shim-shadowdom>
+
+<polymer-element name="core-collapse" attributes="target horizontal opened duration fixedSize">
+<template>
+
+ <content></content>
+
+</template>
+<script>
+
+ Polymer('core-collapse', {
+
+ /**
+ * The target element.
+ *
+ * @attribute target
+ * @type object
+ * @default null
+ */
+ target: null,
+
+ /**
+ * If true, the orientation is horizontal; otherwise is vertical.
+ *
+ * @attribute horizontal
+ * @type boolean
+ * @default false
+ */
+ horizontal: false,
+
+ /**
+ * Set opened to true to show the collapse element and to false to hide it.
+ *
+ * @attribute opened
+ * @type boolean
+ * @default false
+ */
+ opened: false,
+
+ /**
+ * Collapsing/expanding animation duration in second.
+ *
+ * @attribute duration
+ * @type number
+ * @default 0.33
+ */
+ duration: 0.33,
+
+ /**
+ * If true, the size of the target element is fixed and is set
+ * on the element. Otherwise it will try to
+ * use auto to determine the natural size to use
+ * for collapsing/expanding.
+ *
+ * @attribute fixedSize
+ * @type boolean
+ * @default false
+ */
+ fixedSize: false,
+
+ created: function() {
+ this.transitionEndListener = this.transitionEnd.bind(this);
+ },
+
+ ready: function() {
+ this.target = this.target || this;
+ },
+
+ domReady: function() {
+ this.async(function() {
+ this.afterInitialUpdate = true;
+ });
+ },
+
+ detached: function() {
+ if (this.target) {
+ this.removeListeners(this.target);
+ }
+ },
+
+ targetChanged: function(old) {
+ if (old) {
+ this.removeListeners(old);
+ }
+ if (!this.target) {
+ return;
+ }
+ this.isTargetReady = !!this.target;
+ this.classList.toggle('core-collapse-closed', this.target !== this);
+ this.target.style.overflow = 'hidden';
+ this.horizontalChanged();
+ this.addListeners(this.target);
+ // set core-collapse-closed class initially to hide the target
+ this.toggleClosedClass(true);
+ this.update();
+ },
+
+ addListeners: function(node) {
+ node.addEventListener('transitionend', this.transitionEndListener);
+ },
+
+ removeListeners: function(node) {
+ node.removeEventListener('transitionend', this.transitionEndListener);
+ },
+
+ horizontalChanged: function() {
+ this.dimension = this.horizontal ? 'width' : 'height';
+ },
+
+ openedChanged: function() {
+ this.update();
+ },
+
+ /**
+ * Toggle the opened state.
+ *
+ * @method toggle
+ */
+ toggle: function() {
+ this.opened = !this.opened;
+ },
+
+ setTransitionDuration: function(duration) {
+ var s = this.target.style;
+ s.transition = duration ? (this.dimension + ' ' + duration + 's') : null;
+ if (duration === 0) {
+ this.async('transitionEnd');
+ }
+ },
+
+ transitionEnd: function() {
+ if (this.opened && !this.fixedSize) {
+ this.updateSize('auto', null);
+ }
+ this.setTransitionDuration(null);
+ this.toggleClosedClass(!this.opened);
+ },
+
+ toggleClosedClass: function(closed) {
+ this.hasClosedClass = closed;
+ this.target.classList.toggle('core-collapse-closed', closed);
+ },
+
+ updateSize: function(size, duration, forceEnd) {
+ this.setTransitionDuration(duration);
+ this.calcSize();
+ var s = this.target.style;
+ var nochange = s[this.dimension] === size;
+ s[this.dimension] = size;
+ // transitonEnd will not be called if the size has not changed
+ if (forceEnd && nochange) {
+ this.transitionEnd();
+ }
+ },
+
+ update: function() {
+ if (!this.target) {
+ return;
+ }
+ if (!this.isTargetReady) {
+ this.targetChanged();
+ }
+ this.horizontalChanged();
+ this[this.opened ? 'show' : 'hide']();
+ },
+
+ calcSize: function() {
+ return this.target.getBoundingClientRect()[this.dimension] + 'px';
+ },
+
+ getComputedSize: function() {
+ return getComputedStyle(this.target)[this.dimension];
+ },
+
+ show: function() {
+ this.toggleClosedClass(false);
+ // for initial update, skip the expanding animation to optimize
+ // performance e.g. skip calcSize
+ if (!this.afterInitialUpdate) {
+ this.transitionEnd();
+ return;
+ }
+ if (!this.fixedSize) {
+ this.updateSize('auto', null);
+ var s = this.calcSize();
+ this.updateSize(0, null);
+ }
+ this.async(function() {
+ this.updateSize(this.size || s, this.duration, true);
+ });
+ },
+
+ hide: function() {
+ // don't need to do anything if it's already hidden
+ if (this.hasClosedClass && !this.fixedSize) {
+ return;
+ }
+ if (this.fixedSize) {
+ // save the size before hiding it
+ this.size = this.getComputedSize();
+ } else {
+ this.updateSize(this.calcSize(), null);
+ }
+ this.async(function() {
+ this.updateSize(0, this.duration);
+ });
+ }
+
+ });
+
+</script>
+</polymer-element>
View
79 www/lib/core-collapse/demo.html
@@ -0,0 +1,79 @@
+<!doctype html>
+<html>
+<head>
+
+ <title>core-collapse</title>
+
+ <script src="../platform/platform.js"></script>
+
+ <link rel="import" href="core-collapse.html">
+
+ <style>
+
+ .box {
+ background: #eee;
+ }
+
+ .content {
+ margin: 10px;
+ }
+
+ section {
+ padding: 10px;
+ }
+
+ </style>
+
+</head>
+<body unresolved>
+
+ <section style="background: blue; width: 800px;">
+
+ <button onclick="document.querySelector('#collapse1').toggle()">toggle collapse</button>
+
+ <core-collapse id="collapse1" fixedSize class="box" style="height: 300px;">
+ <div class="content">Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem</div>
+ </core-collapse>
+
+ </section>
+
+ <section style="background: green; width: 800px;">
+
+ <button onclick="document.querySelector('#collapse2').toggle()">toggle collapse</button>
+
+ <core-collapse id="collapse2" class="box">
+
+ <div class="content">Coercuit iunctarum vix sic aberant spisso imagine litem cetera nubes ambitae tanta usu circumfuso fulminibus umentia rectumque iuga pluviaque meis semina regat ne campoque meis coeperunt nix cura iunctarum ligavit: secant ventos seductaque permisit sic iunctarum locoque his coeptis tum terras animalia recepta aethera cornua invasit tollere videre tonitrua humanas otia tuba alta dissociata sanctius adsiduis inclusum caesa ita onus sine pluviaque litem manebat fixo extendi ubi inposuit cum sublime membra undas orba forma deducite aethera turba coercuit retinebat obliquis bracchia nisi mentisque origine peregrinum manebat</div>
+
+ <section style="background: lightgreen;">
+
+ <button onclick="document.querySelector('#collapse3').toggle()">toggle collapse</button>
+
+ <core-collapse id="collapse3" class="box" opened>
+
+ <div class="content">Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem</div>
+
+ <section style="background: #00FF99;">
+
+ <button onclick="document.querySelector('#collapse4').toggle()">toggle collapse</button>
+
+ <core-collapse id="collapse4" class="box">
+
+ <div class="content">Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem</div>
+
+ </core-collapse>
+
+ </section>
+
+ </core-collapse>
+
+ </section>
+
+ <div class="content">Obstabatque cingebant nitidis rapidisque cepit moderantum discordia habentia frigore solidumque fert inter caecoque sine coeperunt corpore quarum fluminaque coercuit vultus animal austro quem os sectamque animus origo solidumque quoque melioris adspirate recepta utramque rapidisque caelumque orba unus pluviaque erant mutastis gravitate illic quisque alta calidis speciem mixtam ante contraria duae</div>
+
+ </core-collapse>
+
+ </section>
+
+</body>
+</html>
View
23 www/lib/core-collapse/index.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!--
+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
+The complete set of authors may be found at http://polymer.github.io/AUTHORS
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
+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
+-->
+<html>
+<head>
+
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="../polymer/polymer.html">
+ <link rel="import" href="../core-component-page/core-component-page.html">
+
+</head>
+<body unresolved>
+
+ <core-component-page></core-component-page>
+
+</body>
+</html>
View
19 www/lib/core-component-page/.bower.json
@@ -0,0 +1,19 @@
+{
+ "name": "core-component-page",
+ "private": true,
+ "dependencies": {
+ "platform": "Polymer/platform#>=0.3.0 <1.0.0",
+ "polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
+ },
+ "homepage": "https://github.com/Polymer/core-component-page",
+ "version": "0.3.3",
+ "_release": "0.3.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "0.3.3",
+ "commit": "31ff29fa197310d0d9e7e043c0dab8d0f9a511cf"
+ },
+ "_source": "git://github.com/Polymer/core-component-page.git",
+ "_target": ">=0.3.0 <1.0.0",
+ "_originalSource": "Polymer/core-component-page"
+}
View
6 www/lib/core-component-page/README.md
@@ -0,0 +1,6 @@
+core-component-page
+===================
+
+See the [component page](http://polymer.github.io/core-component-page) for more information.
+
+Note: this is the vulcanized version of [`core-component-page-dev`](https://github.com/Polymer/core-component-page-dev) (the source).
View
BIN www/lib/core-component-page/bowager-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 www/lib/core-component-page/bower.json
@@ -0,0 +1,8 @@
+{
+ "name": "core-component-page",
+ "private": true,
+ "dependencies": {
+ "platform": "Polymer/platform#>=0.3.0 <1.0.0",
+ "polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
+ }
+}
View
5,797 www/lib/core-component-page/core-component-page.html
5,797 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
23 www/lib/core-component-page/demo.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!--
+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
+The complete set of authors may be found at http://polymer.github.io/AUTHORS
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
+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
+-->
+<html>
+<head>
+
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="../polymer/polymer.html">
+ <link rel="import" href="core-component-page.html">
+
+</head>
+<body unresolved>
+
+ <core-component-page></core-component-page>
+
+</body>
+</html>
View
23 www/lib/core-component-page/index.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!--
+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
+The complete set of authors may be found at http://polymer.github.io/AUTHORS
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
+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
+-->
+<html>
+<head>
+
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="../polymer/polymer.html">
+ <link rel="import" href="../core-component-page/core-component-page.html">
+
+</head>
+<body unresolved>
+
+ <core-component-page></core-component-page>
+
+</body>
+</html>
View
28 www/lib/core-doc-viewer/.bower.json
@@ -0,0 +1,28 @@
+{
+ "name": "core-doc-viewer",
+ "private": true,
+ "dependencies": {
+ "core-ajax": "Polymer/core-ajax#>=0.3.0 <1.0.0",
+ "core-layout": "Polymer/core-layout#>=0.3.0 <1.0.0",
+ "core-menu": "Polymer/core-menu#>=0.3.0 <1.0.0",
+ "core-item": "Polymer/core-item#>=0.3.0 <1.0.0",
+ "core-toolbar": "Polymer/core-toolbar#>=0.3.0 <1.0.0",
+ "core-icons": "Polymer/core-icons#>=0.3.0 <1.0.0",
+ "core-icon-button": "Polymer/core-icon-button#>=0.3.0 <1.0.0",
+ "core-header-panel": "Polymer/core-header-panel#>=0.3.0 <1.0.0",
+ "context-free-parser": "Polymer/context-free-parser#>=0.3.0 <1.0.0",
+ "marked-element": "PolymerLabs/marked-element#>=0.3.0 <1.0.0",
+ "highlightjs-element": "PolymerLabs/highlightjs-element#>=0.3.0 <1.0.0"
+ },
+ "homepage": "https://github.com/Polymer/core-doc-viewer",
+ "version": "0.3.3",
+ "_release": "0.3.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "0.3.3",
+ "commit": "f93664d3dc5ed668b7fd0edbd5b16b4d407491e9"
+ },
+ "_source": "git://github.com/Polymer/core-doc-viewer.git",
+ "_target": ">=0.3.0 <1.0.0",
+ "_originalSource": "Polymer/core-doc-viewer"
+}
View
4 www/lib/core-doc-viewer/README.md
@@ -0,0 +1,4 @@
+core-doc-viewer
+================
+
+See the [component page](http://polymer.github.io/core-doc-viewer) for more information.
View
17 www/lib/core-doc-viewer/bower.json
@@ -0,0 +1,17 @@
+{
+ "name": "core-doc-viewer",
+ "private": true,
+ "dependencies": {
+ "core-ajax": "Polymer/core-ajax#>=0.3.0 <1.0.0",
+ "core-layout": "Polymer/core-layout#>=0.3.0 <1.0.0",
+ "core-menu": "Polymer/core-menu#>=0.3.0 <1.0.0",
+ "core-item": "Polymer/core-item#>=0.3.0 <1.0.0",
+ "core-toolbar": "Polymer/core-toolbar#>=0.3.0 <1.0.0",
+ "core-icons": "Polymer/core-icons#>=0.3.0 <1.0.0",
+ "core-icon-button": "Polymer/core-icon-button#>=0.3.0 <1.0.0",
+ "core-header-panel": "Polymer/core-header-panel#>=0.3.0 <1.0.0",
+ "context-free-parser": "Polymer/context-free-parser#>=0.3.0 <1.0.0",
+ "marked-element": "PolymerLabs/marked-element#>=0.3.0 <1.0.0",
+ "highlightjs-element": "PolymerLabs/highlightjs-element#>=0.3.0 <1.0.0"
+ }
+}
View
178 www/lib/core-doc-viewer/core-doc-viewer.html
@@ -0,0 +1,178 @@
+<link rel="import" href="elements/core-doc-page.html">
+<link rel="import" href="elements/core-doc-toc.html">
+<link rel="import" href="../core-icon/core-icon.html">
+
+<!--
+Displays formatted source documentation scraped from input urls.
+
+Documentation can be encoded into html comments (&lt;!-- ... --&gt;) or using JsDoc notation (/&#42;&#42; ... &#42;/).
+
+When using JsDoc notation, remember that the left-margin includes an asterisk and a single space.
+This is important for markdown constructs that count spaces. Code blocks for example, must be
+five spaces from the first asterisk.
+
+## Markdown
+
+Markdown format is supported.
+
+### Links
+
+Arbitrary links can be encoded using [standard markdown format](http://daringfireball.net/projects/markdown/syntax).
+[GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown) is also supported.
+
+Links to other topics can be made with hash-links [core-doc-viewer](#core-doc-viewer).
+
+### Code
+
+Example
+
+ Four space indents indicate code blocks.
+
+ <code>blocks are syntax highlighted</code>
+
+ <script>
+ while(true) {
+ javascript('is highlighted also');
+ }
+ </script>
+
+### Blockquote
+
+ > Blockquote is supported for long text that needs to wrap with a common left side indent.
+ > Blockquote is supported for long text that needs to wrap with a common left side indent.
+
+### Lists
+
+1. enumerated
+1. lists
+
+Use - or + for bullet points:
+
+- bullet
+- lists
+
+### Tables
+
+| First Header | Second Header |
+| ------------- | ------------- |
+| Content Cell | Content Cell |
+| Content Cell | Content Cell |
+
+### HTML
+
+Arbitrary HTML is also supported
+
+<input><button>Button</button><hr/>
+
+@class core-doc-viewer
+@homepage github.io
+-->
+
+<polymer-element name="core-doc-viewer" attributes="sources route url">
+
+ <template>
+
+ <style>
+
+ core-doc-toc {
+ display: none;
+ width: 332px;
+ overflow-x: hidden;
+ }
+
+ </style>
+
+ <context-free-parser url="{{url}}" on-data-ready="{{parserDataReady}}"></context-free-parser>
+
+ <template repeat="{{sources}}">
+ <context-free-parser url="{{}}" on-data-ready="{{parserDataReady}}"></context-free-parser>
+ </template>
+
+ <core-layout></core-layout>
+ <core-doc-toc id="toc" data="{{classes}}" selected="{{selected}}"></core-doc-toc>
+ <core-doc-page core-flex data="{{data}}"></core-doc-page>
+
+ </template>
+
+ <script>
+
+ Polymer('core-doc-viewer', {
+ /**
+ * A single file to parse for docs
+ *
+ * @attribute url
+ * @type String
+ * @default ''
+ */
+
+ /**
+ * Class documentation extracted from the parser
+ *
+ * @property classes
+ * @type Array
+ * @default []
+ */
+ classes: [],
+
+ /**
+ * Files to parse for docs
+ *
+ * @attribute sources
+ * @type Array
+ * @default []
+ */
+ sources: [],
+
+ ready: function() {
+ window.addEventListener('hashchange', this.parseLocationHash.bind(this));
+ this.parseLocationHash();
+ },
+
+ parseLocationHash: function() {
+ this.route = window.location.hash.slice(1);
+ },
+
+ routeChanged: function() {
+ this.validateRoute();
+ },
+
+ validateRoute: function() {
+ if (this.route) {
+ this.classes.some(function(c) {
+ if (c.name === this.route) {
+ this.data = c;
+ this.route = '';
+ return;
+ }
+ }, this);
+ }
+ },
+
+ selectedChanged: function() {
+ this.data = this.classes[this.selected];
+ },
+
+ parserDataReady: function(event) {
+ this.assimilateData(event.target.data);
+ },
+
+ assimilateData: function(data) {
+ this.classes = this.classes.concat(data.classes);
+ this.classes.sort(function(a, b) {
+ var na = a && a.name.toLowerCase(), nb = b && b.name.toLowerCase();
+ return (na < nb) ? -1 : (na == nb) ? 0 : 1;
+ });
+ if (!this.data && !this.route && this.classes.length) {
+ this.data = this.classes[0];
+ }
+ if (this.classes.length > 1) {
+ this.$.toc.style.display = 'block';
+ }
+ this.validateRoute();
+ }
+
+ });
+
+ </script>
+
+</polymer-element>
View
37 www/lib/core-doc-viewer/demo.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<html>
+<head>
+
+ <title>core-doc-viewer</title>
+
+ <script src="../platform/platform.js"></script>
+
+ <link rel="import" href="core-doc-viewer.html">
+
+ <style>
+
+ html, body {
+ font-family: Arial, sans-serif;
+ margin: 0;
+ }
+
+ core-doc-viewer {
+ height: 100vh;
+ }
+
+ </style>
+
+</head>
+
+<body unresolved>
+
+ <core-doc-viewer sources='[
+ "../core-doc-viewer/core-doc-viewer.html",
+ "../core-ajax/core-ajax.html",
+ "../core-ajax/core-xhr.html",
+ "../core-icon/core-icon.html"
+ ]'></core-doc-viewer>
+
+</body>
+
+</html>
View
182 www/lib/core-doc-viewer/elements/core-doc-page.css
@@ -0,0 +1,182 @@
+:host {
+ display: block;
+ position: relative;
+}
+
+#panel {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+}
+
+.main {
+ padding: 0 72px;
+ max-width: 832px;
+ margin: 0 auto;
+}
+
+markedjs-element {
+ display: block;
+}
+
+h1 {
+ font-size: 52px;
+ color: #E91E63
+}
+
+.element {
+ font-size: 21px;
+}
+
+.name {
+ /* typography */
+ color: white;
+ /* font-size: 14px; */
+ font-size: 12px;
+ font-weight: bold;
+ text-decoration: none;
+ /* colors / effects */
+ background-color: #999;
+ box-shadow: 0 1px 2px 0px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.1);
+ border-radius: 2px;
+ cursor: pointer;
+ /* metrics */
+ display: inline-block;
+ padding: 4px 12px 5px 12px;
+ margin: 4px 0;
+}
+
+.ntitle {
+ font-size: 26px;
+ padding-bottom: 4px;
+ border-bottom: 1px solid whitesmoke;
+}
+
+.box {
+ margin-bottom: 40px;
+}
+
+.top pre {
+ padding: 12px 13px;
+ background-color: #f8f8f8;
+}
+
+code {
+ font-family: Consolas, monospace;
+ border: 1px solid #ddd;
+ background-color: #f8f8f8;
+ border-radius: 3px;
+ padding: 0 3px;
+}
+
+pre code {
+ max-width: 832px;
+ white-space: pre-wrap;
+ overflow: hidden;
+ border: none;
+}
+
+/**/
+
+.details {
+ display: flex;
+}
+
+.details-name {
+ flex: 1;
+}
+
+.details-info {
+ flex: 2;
+}
+
+.attribute-box {
+}
+
+.attribute-box .details {
+ background-color: #FFF9C4;
+ padding: 8px 16px;
+ border-bottom: 1px solid #D1CCA1;
+}
+
+.attribute-box .ntitle {
+ padding: 24px 16px;
+}
+
+.attribute-box code {
+ color: #FFAB40;
+ border: none;
+ background-color: transparent;
+ border-radius: none;
+ padding: 0;
+ font-size: 1.2em;
+}
+
+.property-box .ntitle {
+ padding: 24px 16px;
+}
+
+.property-box code {
+ color: #4285F4;
+ border: none;
+ background-color: transparent;
+ border-radius: none;
+ padding: 0;
+ font-size: 1.2em;
+}
+
+.property-box .details {
+ background-color: lightblue;
+ padding: 8px 16px;
+ border-bottom: 1px solid #D1CCA1;
+}
+
+.method-box {
+}
+
+.method-box .details {
+ background-color: #F0F4C3;
+ padding: 8px 16px;
+ border-bottom: 1px solid #D1CCA1;
+}
+
+.method-box .ntitle {
+ background-color: #9E9D24;
+ padding: 24px 16px;
+}
+
+.method-box code {
+ color: #9E9D24;
+ border: none;
+ background-color: transparent;
+ border-radius: none;
+ padding: 0;
+ font-size: 1.2em;
+}
+
+.event-box {
+}
+
+.event-box .details {
+ background-color: #B2DFDB;
+ padding: 8px 16px;
+ border-bottom: 1px solid #92B7B3;
+}
+
+.event-box .ntitle {
+ background-color: #009688;
+ padding: 24px 16px;
+}
+
+.event-box code {
+ color: #009688;
+ border: none;
+ background-color: transparent;
+ border-radius: none;
+ padding: 0;
+ font-size: 1.2em;
+}
+
View
157 www/lib/core-doc-viewer/elements/core-doc-page.html
@@ -0,0 +1,157 @@
+<link rel="import" href="../../core-layout/core-layout.html">
+<link rel="import" href="../../core-icons/core-icons.html">
+<link rel="import" href="../../core-icon-button/core-icon-button.html">
+<link rel="import" href="../../core-toolbar/core-toolbar.html">
+<link rel="import" href="../../core-header-panel/core-header-panel.html">
+<link rel="import" href="../../marked-element/marked-element.html">
+<link rel="import" href="../../highlightjs-element/highlightjs-element.html">
+<link rel="import" href="../../context-free-parser/context-free-parser.html">
+
+<!--
+
+Displays formatted source documentation scraped from input urls.
+
+@element core-doc-page
+-->
+
+<polymer-element name="core-doc-page" attributes="data">
+
+<!--
+
+Set url to add documentation from that location to the view.
+
+@attribute url
+@type String
+-->
+
+ <template>
+
+ <link rel="stylesheet" href="../../highlightjs/styles/default.css">
+ <link rel="stylesheet" href="core-doc-page.css">
+
+ <core-header-panel id="panel" mode="waterfall">
+
+ <!--<core-toolbar>
+ <span style="margin: 0 72px;">{{data.name}}</span>
+ </core-toolbar>-->
+
+ <div class="main" on-marked-js-highlight="{{hilight}}">
+
+ <h1 style="font-size: 52px; color: #E91E63;">
+ {{data.name}}
+ </h1>
+
+ <p>
+ <core-icon icon="home"></core-icon>&nbsp;<a href="{{data | homepageFilter}}">Home Page</a>
+ </p>
+
+ <template if="{{data.extends}}">
+ <section class="box">
+ <div class="ntitle">Extends</div>
+ <p><a href="#{{data.extends}}">{{data.extends}}</a></p>
+ </section>
+ </template>
+
+ <template if="{{data.description}}">