Skip to content
This repository was archived by the owner on Dec 19, 2017. It is now read-only.

Commit 7f24965

Browse files
committed
add bower files and script to remove all but demo.html files
1 parent 5727cb4 commit 7f24965

File tree

136 files changed

+282956
-3
lines changed

Some content is hidden

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

136 files changed

+282956
-3
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "js_src"
3+
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,16 @@ To create a deployable build of one or more demos:
4040

4141
**Note:** Building the demos might take a few minutes.
4242

43+
## Updating demos
44+
45+
These demos are all ports of corresponding javascript demos. To upgrade to a new
46+
version, follow these steps:
47+
48+
1. Update the `bower.json` file dependencies to the new version.
49+
50+
2. Run `bower update`, this will pull in the new versions to the `js_src` dir.
51+
These files are only used as a reference for diffing between versions.
52+
53+
3. Run `dart tool/cleanup.dart` to remove all but the `demo.html` files.
54+
55+
4. Look at the diff, and port those changes.

bower.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "polymer-core-and-paper-examples",
3+
"version": "0.0.0",
4+
"homepage": "https://github.com/dart-lang/polymer-core-and-paper-examples",
5+
"authors": [
6+
"Polymer.dart Authors <[email protected]>"
7+
],
8+
"private": true,
9+
"dependencies": {
10+
"polymer": "polymer/polymer#0.5.1",
11+
"core-elements": "polymer/core-elements#0.5.1",
12+
"core-scroll-threshold": "polymer/core-scroll-threshold#0.5.1",
13+
"paper-elements": "Polymer/paper-elements#0.5.1"
14+
}
15+
}

codereview.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CODE_REVIEW_SERVER: http://codereview.chromium.org/
2+
VIEW_VC: https://github.com/dart-lang/polymer-core-and-paper-examples/commit/
3+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
@license
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://polymer.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
9+
-->
10+
<!doctype html>
11+
<html>
12+
<head>
13+
14+
<title>context-free-parser</title>
15+
16+
<script src="../webcomponentsjs/webcomponents.js"></script>
17+
18+
<link rel="import" href="context-free-parser.html">
19+
20+
</head>
21+
22+
<body unresolved>
23+
24+
<context-free-parser url="../core-ajax/core-ajax.html"></context-free-parser>
25+
26+
<script>
27+
addEventListener('data-ready', function(event) {
28+
console.dir(event.target.data);
29+
});
30+
</script>
31+
32+
</body>
33+
34+
</html>

js_src/core-a11y-keys/demo.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!--
2+
@license
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://polymer.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
9+
-->
10+
<!DOCTYPE html>
11+
<html lang="en">
12+
<head>
13+
<meta charset="UTF-8">
14+
<title>Core A11y Keys demo</title>
15+
<script src="../webcomponentsjs/webcomponents.js"></script>
16+
<link rel="import" href="core-a11y-keys.html">
17+
<style>
18+
div {
19+
height: 100px;
20+
width: 100px;
21+
background: gray;
22+
}
23+
</style>
24+
</head>
25+
<body>
26+
<template is="auto-binding">
27+
<span>Press any of these keys: {{keys}}</span>
28+
<core-a11y-keys id="a11y" keys="{{keys}}" on-keys-pressed="{{print}}"></core-a11y-keys>
29+
<pre id="output"></pre>
30+
</template>
31+
<script>
32+
addEventListener('template-bound', function(ev) {
33+
ev.target.keys = "* pageup pagedown left right down up shift+a alt+a home end space enter"
34+
ev.target.print = function(ev) {
35+
console.log(ev.detail);
36+
this.$.output.textContent += ev.detail.key + ' pressed!\n';
37+
}
38+
});
39+
</script>
40+
</body>
41+
</html>

js_src/core-ajax/demo.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!doctype html>
2+
<!--
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://polymer.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
9+
-->
10+
<html>
11+
<head>
12+
13+
<title>core-ajax</title>
14+
15+
<script src="../webcomponentsjs/webcomponents.js"></script>
16+
<link rel="import" href="core-ajax.html">
17+
18+
</head>
19+
<body>
20+
21+
<core-ajax auto url="//gdata.youtube.com/feeds/api/videos/"
22+
params='{"alt":"json", "q":"chrome"}'
23+
handleAs="json"></core-ajax>
24+
25+
<template repeat="{{response.feed.entry}}">
26+
<div>{{title.$t}}</div>
27+
</template>
28+
29+
<script>
30+
document.addEventListener('polymer-ready', function() {
31+
var ajax = document.querySelector("core-ajax");
32+
ajax.addEventListener("core-response",
33+
function(e) {
34+
document.querySelector('template').model = {
35+
response: e.detail.response
36+
};
37+
}
38+
);
39+
});
40+
</script>
41+
42+
</body>
43+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
@license
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://polymer.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
9+
-->
10+
<a href="demos/simple.html">pluggable transitions</a>
11+
<br>
12+
<a href="demos/news.html">icon to top bar</a>
13+
<br>
14+
<a href="demos/music.html">chip to card</a>
15+
<br>
16+
<a href="demos/list.html">list reorder</a>
17+
<br>
18+
<a href="demos/grid.html">grid to full screen</a>
19+
<br>
20+
<a href="demos/nested.html">nested core-animated-pages</a>
21+
<br>
22+
<a href="demos/quiz1.html">quiz: category to splash to question</a>
23+
<br>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!--
2+
@license
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://polymer.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
9+
-->
10+
<!doctype html>
11+
<html>
12+
<head>
13+
14+
<script src="../../webcomponentsjs/webcomponents.js"></script>
15+
16+
<link href="../../core-icons/core-icons.html" rel="import">
17+
<link href="../../core-icon-button/core-icon-button.html" rel="import">
18+
<link href="../../core-toolbar/core-toolbar.html" rel="import">
19+
<link href="../core-animated-pages.html" rel="import">
20+
21+
<style>
22+
body {
23+
font-family: sans-serif;
24+
}
25+
26+
.toolbar {
27+
background-color: steelblue;
28+
}
29+
30+
#container {
31+
overflow: auto;
32+
}
33+
34+
.card {
35+
position: relative;
36+
height: 150px;
37+
width: 150px;
38+
font-size: 50px;
39+
margin: 8px;
40+
background-color: tomato;
41+
border-radius: 4px;
42+
cursor: default;
43+
}
44+
45+
.view {
46+
font-size: 250px;
47+
background-color: tomato;
48+
}
49+
50+
</style>
51+
52+
</head>
53+
<body unresolved fullbleed vertical layout>
54+
<template is="auto-binding">
55+
<core-toolbar class="toolbar">
56+
<core-icon-button icon="{{$.pages.selected != 0 ? 'arrow-back' : 'menu'}}" on-tap="{{back}}"></core-icon-button>
57+
<div flex>Stuff</div>
58+
<core-icon-button icon="more-vert"></core-icon-button>
59+
</core-toolbar>
60+
<core-animated-pages id="pages" flex selected="0" on-core-animated-pages-transition-end="{{transitionend}}" transitions="cross-fade-all hero-transition">
61+
62+
<section vertical layout>
63+
64+
<div id="container" flex horizontal wrap around-justified layout hero-p>
65+
<template repeat="{{item in items}}">
66+
<div class="card" vertical center center-justified layout hero-id="item-{{item}}" hero?="{{$.pages.selected === item + 1 || lastSelected === item + 1}}" on-tap="{{selectView}}"><span cross-fade>{{item}}</span></div>
67+
</template>
68+
</div>
69+
70+
</section>
71+
72+
<template repeat="{{item in items}}">
73+
<section vertical layout>
74+
<div class="view" flex vertical center center-justified layout hero-id="item-{{item}}" hero?="{{$.pages.selected === item + 1 || $.pages.selected === 0}}"><span cross-fade>{{item}}</span></div>
75+
</section>
76+
</template>
77+
78+
</core-animated-pages>
79+
</template>
80+
81+
<script>
82+
83+
addEventListener('template-bound', function(e) {
84+
var scope = e.target;
85+
var items = [], count=50;
86+
for (var i=0; i < count; i++) {
87+
items.push(i);
88+
}
89+
90+
scope.items = items;
91+
92+
scope.selectView = function(e) {
93+
var i = e.target.templateInstance.model.item;
94+
this.$.pages.selected = i+1;
95+
}
96+
97+
scope.back = function() {
98+
this.lastSelected = this.$.pages.selected;
99+
console.log(this.lastSelected);
100+
this.$.pages.selected = 0;
101+
}
102+
103+
scope.transitionend = function() {
104+
if (this.lastSelected) {
105+
this.lastSelected = null;
106+
}
107+
}
108+
})
109+
110+
</script>
111+
112+
</body>
113+
</html>

0 commit comments

Comments
 (0)