Skip to content

Commit 2299fd4

Browse files
committed
1.0 landing page
1 parent eafad6f commit 2299fd4

File tree

88 files changed

+8533
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+8533
-13
lines changed

0.5/elements/common_elements.vulcanized.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0.5/elements/homepage_elements.vulcanized.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1.0/.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "components"
3+
}

1.0/bower.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "polymer-site",
3+
"version": "0.0.0",
4+
"homepage": "https://github.com/Polymer/docs",
5+
"authors": [
6+
"Eric Bidelman <[email protected]>"
7+
],
8+
"description": "Polymer website",
9+
"keywords": [
10+
"polymer",
11+
"web components",
12+
"documentation"
13+
],
14+
"license": "MIT",
15+
"private": true,
16+
"ignore": [
17+
"**/.*",
18+
"node_modules",
19+
"bower_components",
20+
"test",
21+
"tests"
22+
],
23+
"dependencies": {
24+
"smoothscroll": "^0.0.2",
25+
"x-tag-imports": "x-tag/x-tag-imports#latest",
26+
"marked": "*",
27+
"highlightjs": "*",
28+
"plunker-button": "robdodson/plunker-button#latest",
29+
"core-elements": "Polymer/core-elements#latest",
30+
"paper-elements": "Polymer/paper-elements#latest",
31+
"component-download-button": "Polymer/component-download-button#latest",
32+
"code-explainer": "Polymer/code-explainer#latest",
33+
"google-youtube": "GoogleWebComponents/google-youtube#latest",
34+
"google-map": "GoogleWebComponents/google-map#latest",
35+
"paper-calculator": "Polymer/paper-calculator#latest"
36+
},
37+
"resolutions": {
38+
"webcomponentsjs": "^0.6.0"
39+
}
40+
}

1.0/docs/api.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: default_1_0
3+
type: guide
4+
shortname: API Primer
5+
title: Polymer 0.8 API Primer
6+
subtitle: Primer
7+
---
8+
9+
{% include toc.html %}
10+
11+
STUFF

1.0/docs/devguide/behaviors.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
layout: default_1_0
3+
type: guide
4+
shortname: Docs
5+
title: Behaviors
6+
subtitle: Developer guide
7+
---
8+
9+
{% include toc.html %}
10+
11+
## Behaviors {#behaviors}
12+
13+
{{site.project_title}} supports extending custom element prototypes with
14+
shared code modules called _behaviors_.
15+
16+
A behavior is an object that looks similar to a typical
17+
{{site.project_title}} prototype. A behavior can define [lifecycle callbacks
18+
](registering-elements.html#basic-callbacks), [declared
19+
properties](properties.html), [default attributes](registering-elements.html#host-attributes),
20+
[`observers`](properties.html#observing-changes-to-multiple-properties) [`listeners`](events.html#event-listeners).
21+
22+
To add a behavior to a {{site.project_title}} element definition, include it in a
23+
`behaviors` array on the prototype.
24+
25+
Polymer({
26+
is: 'super-element',
27+
behaviors: [SuperBehavior]
28+
});
29+
30+
Lifecycle callbacks are called on the base prototype first, then for each
31+
behavior in the order given in the `behaviors` array.
32+
33+
Any non-lifecycle functions on the behavior object are mixed into
34+
the base prototype. These may be useful for adding APIs or implementing
35+
observer or event listener callbacks defined by the behavior. **A function
36+
defined on the prototype always takes precedence over a function defined
37+
by a behavior.** If multiple behaviors define the same function, the
38+
**last** behavior in the `behaviors` array takes precedence.
39+
40+
41+
42+
`highlight-behavior.html`:
43+
44+
HighlightBehavior = {
45+
46+
properties: {
47+
isHighlighted: {
48+
type: Boolean,
49+
value: false,
50+
notify: true,
51+
observer: '_highlightChanged'
52+
}
53+
},
54+
55+
listeners: {
56+
click: '_toggleHighlight'
57+
},
58+
59+
created: function() {
60+
console.log('Highlighting for ', this, + 'enabled!');
61+
},
62+
63+
_toggleHighlight: function() {
64+
this.isHighlighted = !this.isHighlighted;
65+
},
66+
67+
_highlightChanged: function(value) {
68+
this.toggleClass('highlighted', value);
69+
}
70+
71+
};
72+
73+
`my-element.html`:
74+
75+
<link rel="import" href="highlight-behavior.html">
76+
77+
<script>
78+
Polymer({
79+
is: 'my-element',
80+
behaviors: [HighlightBehavior]
81+
});
82+
</script>

0 commit comments

Comments
 (0)