Added Polymer

This commit is contained in:
Thaum
2014-11-26 10:18:35 +00:00
parent 5eea4714b2
commit 3408ba9e8d
1210 changed files with 394645 additions and 47 deletions

View File

@@ -0,0 +1,147 @@
/*
* @license
* 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
*/
:host {
display: block;
}
#info > * {
margin-right: 20px;
}
core-icon {
margin-right: 5px;
}
.main {
padding: 0 72px;
max-width: 832px;
margin: 0 auto;
}
marked-element {
display: block;
}
h1 {
color: #E91E63;
font-size: 52px;
line-height: 60px;
font-weight: inherit;
}
.box {
margin-bottom: 40px;
}
.box:not(.top) .details {
padding: 16px;
}
.box:not(.top) .details .params {
margin-top: 40px;
}
.box:not(.top) h3 {
padding: 16px;
color: white;
font-weight: inherit;
font-size: 20px;
line-height: 48px;
margin: 0;
}
.box:not(.top) pre {
padding: initial;
background-color: transparent;
margin: initial;
font-size: 12px;
}
.box code {
color: currentcolor;
font-weight: 500;
}
.top pre {
background-color: rgb(250, 250, 250);
padding: 16px;
}
pre {
max-width: 832px;
white-space: pre-wrap;
overflow: hidden;
border: none;
}
.attribute-box .details {
background-color: #ffcbbb;
border-bottom: 1px solid rgba(255, 86, 33, 0.5);
}
.attribute-box h3 {
background-color: #ff5621;
}
.property-box .details {
background-color: #fbe7b1;
border-bottom: 1px solid rgba(243, 179, 0, 0.5);
}
.property-box h3 {
background-color: #f3b300;
}
.method-box .details {
background-color: #a6ffea;
border-bottom: 1px solid rgba(0, 190, 164, 0.5);
}
.method-box h3 {
background-color: #00bea4;
}
.event-box .details {
background-color: #c5d9fb;
border-bottom: 1px solid rgba(65, 132, 243, 0.5);
}
.event-box h3 {
background-color: #4184f3;
}
.badge {
color: currentcolor;
}
code, pre {
color: #9f499b;
font-family: "Source Code Pro",Monaco,Menlo,Consolas,"Courier New",monospace;
}
pre .typ,pre .inline,.prettyprint .typ,.prettyprint .inline {
color: #6b499f
}
pre .pun,.prettyprint .pun {
color: #5c6bc0
}
pre .str,pre .string,.prettyprint .str,.prettyprint .string {
color: #ff4081
}
pre .pln,.prettyprint .pln {
color: #7986cb
}
pre .kwd,.prettyprint .kwd {
color: #d61a7f
}
pre .atn,pre .attribute-name,.prettyprint .atn,.prettyprint .attribute-name {
color: #6b499f
}
pre .atv,pre .attribute-value,.prettyprint .atv,.prettyprint .attribute-value {
color: #7986cb
}
pre .com,pre .comment,.prettyprint .com,.prettyprint .comment {
color: #8a8a8a
}

View File

@@ -0,0 +1,187 @@
<!--
@license
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
-->
<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="../../prettify-element/prettify-import.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" relative>
<template>
<link rel="stylesheet" href="core-doc-page.css">
<core-header-panel id="panel" mode="waterfall" fit>
<!--<core-toolbar>
<span style="margin: 0 72px;">{{data.name}}</span>
</core-toolbar>-->
<div class="main" on-marked-js-highlight="{{hilight}}">
<h1>{{data.name}}</h1>
<p id="info" layout horizontal center>
<span layout horizontal center><core-icon icon="home"></core-icon><a href="{{data | homepageFilter}}">Home Page</a></span>
<span layout horizontal center hidden?="{{!data.version}}"><core-icon icon="info-outline"></core-icon>Version: {{data.version}}</span>
</p>
<template if="{{data.extends}}">
<section class="top">
<h3 id="{{data.name}}.extends">Extends: <a href="#{{data.extends}}">{{data.extends}}</a></h3>
</section>
</template>
<template if="{{data.description}}">
<section class="box top">
<h3 id="{{data.name}}.summary">Summary</h3>
<marked-element text="{{data.description}}"></marked-element>
</section>
</template>
<template if="{{data.attributes.length}}">
<section class="box attribute-box">
<h3 id="{{data.name}}.attributes">Attributes</h3>
<template repeat="{{attribute in data.attributes}}">
<div class="details" horizontal layout>
<div class="details-name" flex id="{{data.name}}.attributes.{{attribute.name}}">
<p><code>{{attribute.name}}</code></p>
</div>
<div class="details-info" flex three>
<p layout horizontal center justified>
<code>&lt;<em>{{attribute.type}}</em>&gt;</code><span class="default" hidden?="{{!attribute.default}}">default: <code>{{attribute.default}}</code></span>
</p>
<marked-element text="{{attribute.description}}"></marked-element>
</div>
</div>
</template>
</section>
</template>
<template if="{{data.properties.length}}">
<section class="box property-box">
<h3 id="{{data.name}}.properties">Properties</h3>
<template repeat="{{property in data.properties}}">
<div class="details" horizontal layout>
<div class="details-name" flex id="{{data.name}}.properties.{{property.name}}">
<p><code>{{property.name}}</code></p>
</div>
<div class="details-info" flex three>
<p layout horizontal center justified>
<code>&lt;<em>{{property.type}}</em>&gt;</code><span class="default" hidden?="{{!property.default}}">default: <code>{{property.default}}</code></span>
</p>
<marked-element text="{{property.description}}"></marked-element>
</div>
</div>
</template>
</section>
</template>
<template if="{{data.events.length}}">
<section class="box event-box">
<h3 id="{{data.name}}.events">Events</h3>
<template repeat="{{event in data.events}}">
<div class="details" horizontal layout>
<div class="details-name" flex id="{{data.name}}.events.{{event.name}}">
<p><code>{{event.name}}</code></p>
</div>
<div class="details-info" flex three>
<marked-element text="{{event.description}}"></marked-element>
<template if="{{event.params.length}}">
<div class="params">
<p>Event details:</p>
<template repeat="{{param in event.params}}">
<p><code>&lt;<em>{{param.type}}</em>&gt; {{param.name}}</code></p>
<p><span>{{param.description}}</span></p>
</template>
</div>
</template>
</div>
</div>
</template>
</section>
</template>
<template if="{{data.methods.length}}">
<section class="box method-box">
<h3 id="{{data.name}}.methods">Methods</h3>
<template repeat="{{method in data.methods}}">
<div class="details" horizontal layout>
<div class="details-name" flex id="{{data.name}}.methods.{{method.name}}">
<p><code>{{method.name}}</code></p>
</div>
<div class="details-info" flex three>
<marked-element text="{{method.description}}"></marked-element>
<template if="{{method.params.length}}">
<div class="params">
<p>Method parameters:</p>
<template repeat="{{param in method.params}}">
<p><code>&lt;<em>{{param.type}}</em>&gt; {{param.name}}</code></p>
<p><span>{{param.description}}</span></p>
</template>
</div>
</template>
</div>
</div>
</template>
</section>
</template>
</div>
</core-header-panel>
</template>
<script>
Polymer('core-doc-page', {
hilight: function(event, detail, sender) {
detail.code = prettyPrintOne((detail.code || '').replace(/</g,'&lt;').replace(/>/g,'&gt;'));
},
homepageFilter: function(data) {
if (!data) {
return '';
}
if (!data.homepage || data.homepage === 'github.io') {
return '//polymer.github.io/' + data.name;
} else {
return data.homepage;
}
},
dataChanged: function() {
// Wrap in async() to delay execution until the next animation frame,
// since the <template> contents won't be stamped at the time this is executed.
this.async(function() {
var elementToFocus = this.shadowRoot.getElementById(window.location.hash.slice(1));
if (elementToFocus) {
elementToFocus.scrollIntoView();
}
});
}
});
</script>
</polymer-element>

View File

@@ -0,0 +1,27 @@
/*
* @license
* 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
*/
:host {
display: block;
position: relative;
border-right: 1px solid silver;
}
core-header-panel {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
core-toolbar {
background-color: #eeeeee;
}

View File

@@ -0,0 +1,67 @@
<!--
@license
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
-->
<link rel="import" href="../../core-toolbar/core-toolbar.html">
<link rel="import" href="../../core-header-panel/core-header-panel.html">
<link rel="import" href="../../core-icon-button/core-icon-button.html">
<link rel="import" href="../../core-menu/core-menu.html">
<link rel="import" href="../../core-item/core-item.html">
<!--
@class core-doc-toc
-->
<polymer-element name="core-doc-toc" attributes="data selected">
<template>
<link rel="stylesheet" href="core-doc-toc.css">
<core-header-panel mode="waterfall">
<!-- <core-toolbar theme="core-light-theme">
<core-icon-button icon="menu"></core-icon-button>
<span core-flex>Topics</span>
<core-icon-button icon="search" on-tap="{{searchAction}}"></core-icon-button>
</core-toolbar>
<core-toolbar id="searchBar" style="background-color: #C2185B; position: absolute; top: 0; left: 0; right: 0; opacity: 0; display: none;" class="seamed" theme="core-dark-theme">
<core-icon-button icon="search"></core-icon-button>
<core-icon-button icon="close" on-tap="{{closeSearchAction}}"></core-icon-button>
</core-toolbar>-->
<core-menu selected="{{selected}}">
<template repeat="{{data}}">
<core-item><a href="#{{name}}">{{name}}</a></core-item>
</template>
</core-menu>
</core-header-panel>
</template>
<script>
Polymer('core-doc-toc', {
searchAction: function() {
this.$.searchBar.style.opacity = 1;
this.$.searchBar.style.display = '';
},
closeSearchAction: function() {
this.$.searchBar.style.opacity = 0;
this.$.searchBar.style.display = 'none';
}
});
</script>
</polymer-element>