Skip to content

Commit fe86a03

Browse files
author
Arthur Evans
committed
Update tutorial sample files.
1 parent 166ec48 commit fe86a03

11 files changed

Lines changed: 83 additions & 140 deletions

File tree

samples/tutorial/api/posts.json

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"uid": 1,
4-
"text" : "Have you heard about the Web Components revolution?.",
4+
"text" : "Have you heard about the Web Components revolution?",
55
"username" : "Eric",
66
"avatar" : "../images/avatar-01.svg",
77
"favorite": false
@@ -15,51 +15,44 @@
1515
},
1616
{
1717
"uid": 3,
18-
"text" : "So last year.",
19-
"username" : "Dmitri",
18+
"text" : "So last year...",
19+
"username" : "Dimitri",
2020
"avatar" : "../images/avatar-03.svg",
2121
"favorite": false
2222
},
23-
{
23+
{
2424
"uid": 4,
25-
"text" : "In the Pines",
26-
"username" : "John Doe",
27-
"avatar" : "../images/avatar-04.svg",
25+
"text" : "Pretty sure I came up with that first.",
26+
"username" : "Ada",
27+
"avatar" : "../images/avatar-07.svg",
2828
"favorite": false
2929
},
30-
{
30+
{
3131
"uid": 5,
32-
"text" : "Banks of the Ohio",
33-
"username" : "John Doe",
34-
"avatar" : "../images/avatar-05.svg",
32+
"text" : "Yo, I heard you like components, so I put a component in your component.",
33+
"username" : "Grace",
34+
"avatar" : "../images/avatar-08.svg",
3535
"favorite": false
3636
},
3737
{
3838
"uid": 6,
39-
"text" : "Something really profound about code.",
40-
"username" : "A. Developer",
41-
"avatar" : "../images/avatar-06.svg",
39+
"text" : "Centralize, centrailize.",
40+
"username" : "John",
41+
"avatar" : "../images/avatar-04.svg",
4242
"favorite": false
4343
},
4444
{
4545
"uid": 7,
46-
"text" : "Blue Night",
47-
"username" : "John Doe",
48-
"avatar" : "../images/avatar-07.svg",
46+
"text" : "Has anyone seen my cat?",
47+
"username" : "Zelda",
48+
"avatar" : "../images/avatar-06.svg",
4949
"favorite": false
5050
},
5151
{
5252
"uid": 8,
53-
"text" : "Foggy Mountain Top",
54-
"username" : "John Doe",
55-
"avatar" : "../images/avatar-08.svg",
56-
"favorite": false
57-
},
58-
{
59-
"uid": 9,
60-
"text" : "Blackberry Blossom",
61-
"username" : "John Doe",
62-
"avatar" : "../images/avatar-09.svg",
53+
"text" : "Decentralize!",
54+
"username" : "Norbert",
55+
"avatar" : "../images/avatar-05.svg",
6356
"favorite": false
6457
}
6558
]

samples/tutorial/finished/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>unquote</title>
66
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
77
<script src="../components/platform/platform.js"></script>
8-
<link rel="import" href="../components/font-roboto2/roboto2.html">
8+
<link rel="import" href="../components/font-roboto/roboto.html">
99
<link rel="import"
1010
href="../components/core-header-panel/core-header-panel.html">
1111
<link rel="import"
@@ -18,7 +18,7 @@
1818
height: 100%;
1919
margin: 0;
2020
background-color: #E5E5E5;
21-
font-family: 'Roboto2', sans-serif;
21+
font-family: 'RobotoDraft', sans-serif;
2222
}
2323
core-header-panel {
2424
height: 100%;

samples/tutorial/finished/post-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<link rel="import" href="../components/polymer/polymer.html">
2-
<link rel="import" href="post-service.html">
2+
<link rel="import" href="../post-service/post-service.html">
33
<link rel="import" href="post-card.html">
44

55
<polymer-element name="post-list" attributes="show">
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
5+
<script src="../components/platform/platform.js"></script>
6+
<link rel="import" href="../components/polymer/polymer.html">
7+
<link rel="import" href="../components/core-component-page/core-component-page.html">
8+
9+
</head>
10+
<body unresolved>
11+
12+
<core-component-page></core-component-page>
13+
14+
</body>
15+
</html>

samples/tutorial/finished/post-service.html renamed to samples/tutorial/post-service/post-service.html

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
11
<link rel="import" href="../components/polymer/polymer.html">
22
<link rel="import" href="../components/core-ajax/core-ajax.html">
33
<!--
4-
post-list provides an API for a fake service --
5-
unquote, the read-only social networking service!
4+
`<post-service>` provides an API for a fake service --
5+
_unquote_, the read-only social networking service!
66
7-
Provides a very simple API --
7+
Provides a very simple API: `posts` returns the list of posts.
8+
`setFavorite` pretends to persist a user's favorite choice.
89
910
@element post-service
10-
11+
@demo
12+
@homepage http://www.polymer-project.org/docs/start/tutorial.html
13+
-->
14+
15+
<!--
1116
An array of post objects, with the following format:
1217
13-
| `uid` | Number | Unique ID for this post. |
14-
| `username` | String | Poster's username. |
15-
| `avatar` | String | URL for the user's avatar. |
16-
| `text` | String | Post text |
17-
| `favorite` | Boolean | True if the current user favorited this post. |
18+
<table border="0">
19+
<tr>
20+
<td><code>uid</code></td>
21+
<td>Number</td>
22+
<td>Unique ID for this post.</td>
23+
</tr>
24+
<tr>
25+
<td><code>username</code></td>
26+
<td>String</td>
27+
<td>Poster's username.</td>
28+
</tr>
29+
<tr>
30+
<td><code>avatar</code></td>
31+
<td>String</td>
32+
<td>URL for the user's avatar.</td>
33+
</tr>
34+
<tr>
35+
<td><code>text</code></td>
36+
<td>String</td>
37+
<td>Post text.</td>
38+
</tr>
39+
<tr>
40+
<td><code>favorite</code></td>
41+
<td>Boolean</td>
42+
<td>True if the current user favorited this post.</td>
43+
</tr>
44+
</table>
1845
1946
@attribute posts
20-
@type array
47+
@type Array
2148
@default []
2249
-->
2350
<polymer-element name="post-service" attributes="posts">
@@ -46,8 +73,8 @@
4673
/**
4774
* Update the service with the current favorite value.
4875
* (Two-way data binding updates the favorite value
49-
* stored locally.) If this was a real service, the
50-
* change would need to be persisted to the service here.
76+
* stored locally.) If this was a real service, this
77+
* method would do something useful.
5178
*
5279
* @method setFavorite
5380
* @param uid {Number} Unique ID for post.
@@ -59,5 +86,4 @@
5986
}
6087
});
6188
</script>
62-
6389
</polymer-element>

samples/tutorial/step-1/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>unquote</title>
66
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
77
<script src="../components/platform/platform.js"></script>
8-
<link rel="import" href="../components/font-roboto2/roboto2.html">
8+
<link rel="import" href="../components/font-roboto/roboto.html">
99
<link rel="import"
1010
href="../components/core-header-panel/core-header-panel.html">
1111
<link rel="import"
@@ -18,7 +18,7 @@
1818
height: 100%;
1919
margin: 0;
2020
background-color: #E5E5E5;
21-
font-family: 'Roboto2', sans-serif;
21+
font-family: 'RobotoDraft', sans-serif;
2222
}
2323
core-header-panel {
2424
height: 100%;

samples/tutorial/step-1/post-card.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

samples/tutorial/step-2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>unquote</title>
66
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
77
<script src="../components/platform/platform.js"></script>
8-
<link rel="import" href="../components/font-roboto2/roboto2.html">
8+
<link rel="import" href="../components/font-roboto/roboto.html">
99
<link rel="import"
1010
href="../components/core-header-panel/core-header-panel.html">
1111
<link rel="import"

samples/tutorial/step-3/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>unquote</title>
66
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
77
<script src="../components/platform/platform.js"></script>
8-
<link rel="import" href="../components/font-roboto2/roboto2.html">
8+
<link rel="import" href="../components/font-roboto/roboto.html">
99
<link rel="import"
1010
href="../components/core-header-panel/core-header-panel.html">
1111
<link rel="import"
@@ -18,7 +18,7 @@
1818
height: 100%;
1919
margin: 0;
2020
background-color: #E5E5E5;
21-
font-family: 'Roboto2', sans-serif;
21+
font-family: 'RobotoDraft', sans-serif;
2222
}
2323
core-header-panel {
2424
height: 100%;

samples/tutorial/step-3/post-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<link rel="import" href="../components/polymer/polymer.html">
2-
<link rel="import" href="post-service.html">
2+
<link rel="import" href="../post-service/post-service.html">
33
<link rel="import" href="post-card.html">
44

55
<polymer-element name="post-list" attributes="show">

0 commit comments

Comments
 (0)