OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polym
er.github.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polym
er.github.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS
.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS
.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CO
NTRIBUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CO
NTRIBUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/P
ATENTS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/P
ATENTS.txt |
9 --> | 9 --> |
10 <link rel="import" href="../../core-icons/core-icons.html"> | 10 <link rel="import" href="../../core-icons/core-icons.html"> |
11 <link rel="import" href="../../core-icon-button/core-icon-button.html"> | 11 <link rel="import" href="../../core-icon-button/core-icon-button.html"> |
12 <link rel="import" href="../../core-toolbar/core-toolbar.html"> | 12 <link rel="import" href="../../core-toolbar/core-toolbar.html"> |
13 <link rel="import" href="../../core-header-panel/core-header-panel.html"> | 13 <link rel="import" href="../../core-header-panel/core-header-panel.html"> |
14 <link rel="import" href="../../marked-element/marked-element.html"> | 14 <link rel="import" href="../../marked-element/marked-element.html"> |
15 <link rel="import" href="../../prettify-element/prettify-import.html"> | 15 <link rel="import" href="../../prettify-element/prettify-import.html"> |
16 <link rel="import" href="../../context-free-parser/context-free-parser.html"> | 16 <link rel="import" href="../../context-free-parser/context-free-parser.html"> |
17 | 17 |
| 18 <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,500,700|Source
+Code+Pro' rel='stylesheet' type='text/css'> |
| 19 |
18 <!-- | 20 <!-- |
19 | 21 |
20 Displays formatted source documentation scraped from input urls. | 22 Displays formatted source documentation scraped from input urls. |
21 | 23 |
22 @element core-doc-page | 24 @element core-doc-page |
23 --> | 25 --> |
24 | 26 |
25 <polymer-element name="core-doc-page" attributes="data" relative> | 27 <polymer-element name="core-doc-page" attributes="data" relative> |
26 | 28 |
27 <template> | 29 <template> |
28 | 30 |
29 <link rel="stylesheet" href="core-doc-page.css"> | 31 <link rel="stylesheet" href="core-doc-page.css"> |
30 | 32 |
31 <core-header-panel id="panel" mode="waterfall" fit> | 33 <core-header-panel id="panel" mode="waterfall" fit> |
32 | 34 |
33 <!--<core-toolbar> | 35 <!--<core-toolbar> |
34 <span style="margin: 0 72px;">{{data.name}}</span> | 36 <span style="margin: 0 72px;">{{data.name}}</span> |
35 </core-toolbar>--> | 37 </core-toolbar>--> |
36 | 38 |
37 <div class="main" on-marked-js-highlight="{{hilight}}"> | 39 <div class="main" on-marked-js-highlight="{{hilight}}"> |
38 | 40 |
39 <h1>{{data.name}}</h1> | 41 <h1>{{data.name}}</h1> |
40 | 42 |
41 <p id="info" layout horizontal center> | 43 <p id="info" layout horizontal center> |
42 <span layout horizontal center><core-icon icon="home"></core-icon><a h
ref="{{data | homepageFilter}}">Home Page</a></span> | 44 <span layout horizontal center><core-icon icon="home"></core-icon><a h
ref="{{data | homepageFilter}}">Home Page</a></span> |
43 <span layout horizontal center hidden?="{{!data.version}}"><core-icon
icon="info-outline"></core-icon>Version: {{data.version}}</span> | 45 <span layout horizontal center hidden?="{{!data.version}}"><core-icon
icon="info-outline"></core-icon>Version: {{data.version}}</span> |
44 </p> | 46 </p> |
45 | 47 |
46 <template if="{{data.extends}}"> | 48 <template bind="{{data as data}}" if="{{data.extends || data.mixins}}"> |
47 <section class="top"> | 49 <div class="inheritance"> |
48 <h3 id="{{data.name}}.extends">Extends: <a href="#{{data.extends}}">
{{data.extends}}</a></h3> | 50 <template if="{{data.extends}}"> |
49 </section> | 51 <section class="top extends" layout horizontal center> |
| 52 <h3 id="{{data.name}}.extends">Extends:</h3> |
| 53 <template repeat="{{e, i in data.extends}}"> |
| 54 <div> |
| 55 <template if="{{e.url}}"> |
| 56 <a href="{{e.url}}">{{e.name}}</a> |
| 57 </template> |
| 58 <template if="{{!e.url}}"><a href="#{{e.name}}">{{e.name}}</
a></template> |
| 59 <span hidden?="{{i == data.extends.length - 1}}">,</span> |
| 60 </div> |
| 61 </template> |
| 62 </section> |
| 63 </template> |
| 64 |
| 65 <template if="{{data.mixins}}"> |
| 66 <section class="top mixins" layout horizontal center> |
| 67 <h3 id="{{data.name}}.mixins">Mixins:</h3> |
| 68 <template repeat="{{e, i in data.mixins}}"> |
| 69 <div> |
| 70 <template if="{{e.url}}"> |
| 71 <a href="{{e.url ? e.url : e.name}}">{{e.name}}</a> |
| 72 </template> |
| 73 <template if="{{!e.url}}"><span>{{e.name}}</span></template> |
| 74 <span hidden?="{{i == data.mixins.length - 1}}">,</span> |
| 75 </div> |
| 76 </template> |
| 77 </section> |
| 78 </template> |
| 79 </div> |
50 </template> | 80 </template> |
51 | 81 |
52 <template if="{{data.description}}"> | 82 <template if="{{data.description}}"> |
53 <section class="box top"> | 83 <section class="box top"> |
54 <h3 id="{{data.name}}.summary">Summary</h3> | 84 <h3 id="{{data.name}}.summary">Summary</h3> |
55 <marked-element text="{{data.description}}"></marked-element> | 85 <marked-element text="{{data.description}}"></marked-element> |
56 </section> | 86 </section> |
57 </template> | 87 </template> |
58 | 88 |
59 <template if="{{data.attributes.length}}"> | 89 <template if="{{data.attributes.length}}"> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 }, | 200 }, |
171 | 201 |
172 dataChanged: function() { | 202 dataChanged: function() { |
173 // Wrap in async() to delay execution until the next animation frame, | 203 // Wrap in async() to delay execution until the next animation frame, |
174 // since the <template> contents won't be stamped at the time this is ex
ecuted. | 204 // since the <template> contents won't be stamped at the time this is ex
ecuted. |
175 this.async(function() { | 205 this.async(function() { |
176 var elementToFocus = this.shadowRoot.getElementById(window.location.ha
sh.slice(1)); | 206 var elementToFocus = this.shadowRoot.getElementById(window.location.ha
sh.slice(1)); |
177 if (elementToFocus) { | 207 if (elementToFocus) { |
178 elementToFocus.scrollIntoView(); | 208 elementToFocus.scrollIntoView(); |
179 } | 209 } |
| 210 else { |
| 211 var viewer = this.$.panel.scroller; |
| 212 viewer.scrollTop = 0; |
| 213 viewer.scrollLeft = 0; |
| 214 } |
180 }); | 215 }); |
181 } | 216 } |
182 | 217 |
183 }); | 218 }); |
184 | 219 |
185 </script> | 220 </script> |
186 | 221 |
187 </polymer-element> | 222 </polymer-element> |
OLD | NEW |