Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

7/11 master -> stable #10

Merged
merged 47 commits into from
Jul 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f0a6034
polymer-selector: filter template nodes in items and add
frankiefu Jun 17, 2013
23d0651
workbench files for polymer-elements
frankiefu Jun 18, 2013
946fcc0
workbench files for polymer-elements
frankiefu Jun 18, 2013
54a560b
polymer-collapse; minor api doc updates
frankiefu Jun 19, 2013
3210b41
update flex-layout, meta, selection, selector for polymer-element
Jun 19, 2013
ecf0843
migrate flex-layout out of layout folder
Jun 19, 2013
dbf66fb
unroll findDistributedTarget directly into selector ... seems no othe…
Jun 19, 2013
6d0e2d4
use new array() api on NodeList
Jun 19, 2013
73a97a5
update ajax, jsapi, jsonp localstorage, page for polymer-element; merge
frankiefu Jun 20, 2013
c604eda
update sample
frankiefu Jun 20, 2013
b9fccc0
add match media element
dfreedm Jun 20, 2013
f86192d
Allow users to set responseType
ebidel Jun 20, 2013
f43ca62
Merge pull request #6 from ebidel/master
Jun 20, 2013
cfd4c49
add polymer-animation elements
Jun 21, 2013
2cd0641
add updateSelectModel so menu can call it to update the model
frankiefu Jun 25, 2013
c3efc79
update api doc
frankiefu Jun 25, 2013
8c6cc6f
add more tests
frankiefu Jun 25, 2013
647c76b
more tests
frankiefu Jun 26, 2013
0db09bd
Merge branch 'master' into polymer-element
sorvell Jun 26, 2013
cae327b
update syntax in animation elements.
sorvell Jun 26, 2013
0af4e72
update syntax in media-query element.
sorvell Jun 26, 2013
1e4fc1c
remove transition after the transition is completed
frankiefu Jun 26, 2013
ff082b0
Merge pull request #7 from Polymer/polymer-element
dfreedm Jun 26, 2013
ba57c18
get the original size in the prepare state
frankiefu Jun 28, 2013
f8cbee9
flex-layout as a container
frankiefu Jun 28, 2013
f7dfffa
remove workbench since examples are now in the element folder
frankiefu Jun 28, 2013
2dbfc15
polymer-media-query matches -> queryMatches
dfreedm Jun 28, 2013
f4eadc6
mediachange event -> polymer-mediachange
dfreedm Jun 28, 2013
fe4b0fc
add copyright and set display: none since it's non-visual
frankiefu Jun 28, 2013
8b207f3
Allow polymer-view-source-link to be configurable
ebidel Jun 29, 2013
afb5f7a
Adding polymer-file for working with File APIs
ebidel Jun 29, 2013
c0fff7e
Correcting/updating examples
ebidel Jun 29, 2013
15612a0
Simple test
ebidel Jun 30, 2013
63c81ac
Merge pull request #8 from ebidel/master
frankiefu Jul 1, 2013
d2c46e5
Merge pull request #9 from ebidel/polymer-file
frankiefu Jul 1, 2013
6a8ff62
api docs for polymer-collapse
frankiefu Jul 2, 2013
c6a13cc
api docs
frankiefu Jul 3, 2013
f785b19
polymer-collapse: add overflow: hidden to target element
frankiefu Jul 3, 2013
9f1b187
polymer-key-helper component
Jul 9, 2013
d3f92ce
polymer-overlay: move from toolkit-ui
Jul 9, 2013
93f86d7
polymer-overlay: g- -> polymer-
Jul 9, 2013
0788d22
polymer-overlay: add docs
Jul 9, 2013
c639e92
polymer-overlay: add event handlers
Jul 9, 2013
ae8afeb
add using justify and align in the example
frankiefu Jul 9, 2013
5212a69
Merge branch 'master' of github.com:Polymer/polymer-elements
frankiefu Jul 9, 2013
1297a41
update selectedModel when selectedItem is changed
frankiefu Jul 9, 2013
a385ebf
polymer-overlay: refactor (no animations yet)
Jul 9, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions polymer-ajax/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>polymer-ajax</title>
<script src="../../polymer/polymer.js"></script>
<link rel="import" href="polymer-ajax.html">
</head>
<body>
<polymer-ajax auto url="http://gdata.youtube.com/feeds/api/videos/"
params='{"alt":"json", "q":"chrome"}'
handleAs="json"></polymer-ajax>

<template repeat="{{response.feed.entry}}">
<div>{{title.$t}}</div>
</template>

<script>
document.addEventListener('WebComponentsReady', function() {
var ajax = document.querySelector("polymer-ajax");
ajax.addEventListener("polymer-response",
function(e) {
document.querySelector('template').model = {
response: e.detail.response
};
}
);
});
</script>
</body>
</html>
13 changes: 7 additions & 6 deletions polymer-ajax/polymer-ajax.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@
/**
* Fired when a response is received.
*
* @event response
* @event polymer-response
*/
/**
* Fired when an error is received.
*
* @event error
* @event polymer-error
*/
/**
* Fired whenever a response or an error is received.
*
* @event complete
* @event polymer-complete
*/
-->
<link rel="import" href="polymer-xhr.html">
<element name="polymer-ajax" attributes="url handleAs auto params response">

<polymer-element name="polymer-ajax" attributes="url handleAs auto params response">
<script>
Polymer.register(this, {
Polymer('polymer-ajax', {
/**
* The URL target of the request.
*
Expand Down Expand Up @@ -175,4 +176,4 @@
}
});
</script>
</element>
</polymer-element>
12 changes: 8 additions & 4 deletions polymer-ajax/polymer-xhr.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @class polymer-xhr
*/
-->
<element name="polymer-xhr">
<polymer-element name="polymer-xhr">
<template>
<style>
@host {
Expand All @@ -30,11 +30,11 @@
</style>
</template>
<script>
Polymer.register(this, {
Polymer('polymer-xhr', {
makeReadyStateHandler: function(xhr, callback) {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
callback && callback.call(null, xhr.responseText, xhr);
callback && callback.call(null, xhr.response, xhr);
}
};
},
Expand Down Expand Up @@ -66,6 +66,7 @@
* @param {Object} inOptions.params Data to be sent to the server.
* @param {Object} inOptions.body The content for the request body for POST method.
* @param {Object} inOptions.headers HTTP request headers.
* @param {String} inOptions.responseType The response type. Default is 'text'.
* @param {Object} inOptions.callback Called when request is completed.
* @returns {Object} XHR object.
*/
Expand All @@ -78,6 +79,9 @@
if (params && method == 'GET') {
url += (url.indexOf('?') > 0 ? '&' : '?') + params;
}
if (options.responseType) {
xhr.responseType = options.responseType;
}
xhr.open(method, url, async);
this.makeReadyStateHandler(xhr, options.callback);
this.setRequestHeaders(options.headers);
Expand All @@ -89,4 +93,4 @@
}
});
</script>
</element>
</polymer-element>
86 changes: 86 additions & 0 deletions polymer-animation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<title>Polymer Animation Components</title>
<link rel="import" href="polymer-animation.html">
<link rel="import" href="polymer-animation-group.html">
<link rel="import" href="polymer-blink.html">
<link rel="import" href="polymer-bounce.html">
<link rel="import" href="polymer-fadein.html">
<link rel="import" href="polymer-fadeout.html">
<link rel="import" href="polymer-flip.html">
<link rel="import" href="polymer-shake.html">
<script src="../../polymer/polymer.js"></script>
<style>
body {
text-align: center;
font-family: Helvetica, sans-serif;
}
div#target {
display: inline-block;
background-color: dimgrey;
border-radius: 5px;
padding: 5px 10px;
margin: 50px;
font-size: 30px;
color: white;
}
div.animations > * {
display: inline-block;
background-color: darkgrey;
border-radius: 5px;
padding: 5px 10px;
margin: 5px;
color: white;
}
</style>
</head>
<body>
<div id="target">animated!</div>
<div class="animations">
<polymer-animation duration="1">
raw
<polymer-animation-prop name="opacity" easing="ease-in-out">
<polymer-animation-keyframe value="1"></polymer-animation-keyframe>
<polymer-animation-keyframe value="0.3"></polymer-animation-keyframe>
<polymer-animation-keyframe value="1"></polymer-animation-keyframe>
</polymer-animation-prop>
</polymer-animation>
<polymer-animation-group type="seq">
raw group
<polymer-animation duration="0.3">
<polymer-animation-prop name="opacity" easing="ease-in-out">
<polymer-animation-keyframe value="1"></polymer-animation-keyframe>
<polymer-animation-keyframe value="0.3"></polymer-animation-keyframe>
<polymer-animation-keyframe value="1"></polymer-animation-keyframe>
</polymer-animation-prop>
</polymer-animation>
<polymer-animation duration="0.3">
<polymer-animation-prop name="transform" easing="ease-in-out">
<polymer-animation-keyframe value="scale(1)"></polymer-animation-keyframe>
<polymer-animation-keyframe value="scale(1.2)"></polymer-animation-keyframe>
<polymer-animation-keyframe value="scale(1)"></polymer-animation-keyframe>
</polymer-animation-prop>
</polymer-animation>
</polymer-animation-group>
<polymer-bounce duration="1">bounce</polymer-bounce>
<polymer-shake>shake</polymer-shake>
<polymer-shake duration="Infinity">shake forever</polymer-shake>
<polymer-flip>flip X</polymer-flip>
<polymer-flip axis="y">flip Y</polymer-flip>
<polymer-blink>blink</polymer-blink>
<polymer-fadein>fade in</polymer-fadein>
<polymer-fadeout>fade out</polymer-fadeout>
</div>
<script>
document.addEventListener('WebComponentsReady', function() {
document.querySelector('.animations').addEventListener('click',
function(e) {
var animation = e.target;
animation.target = target;
animation.play();
});
});
</script>
</body>
</html>
100 changes: 100 additions & 0 deletions polymer-animation/polymer-animation-group.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<link rel="import" href="polymer-animation.html">
<polymer-element name="polymer-animation-group" extends="polymer-animation" on-animationchange="onAnimationChange">
<script>
(function() {
var ANIMATION_GROUPS = {
'par': ParGroup,
'seq': SeqGroup
};
/**
* @module Animation
*/
/**
* Component for a group of animations.
*
* A fade in and move animation in sequence:
*
* <polymer-animation-group type="seq">
* <polymer-animation>
* <polymer-animation-prop name="opacity">
* <polymer-animation-keyframe value="0.5" offset="0"></polymer-animation-keyframe>
* <polymer-animation-keyframe value="1" offset="1"></polymer-animation-keyframe>
* <polymer-animation-prop>
* </polymer-animation>
* <polymer-animation>
* <polymer-animation-prop name="transform">
* <polymer-animation-keyframe value="translateX(0)" offset="0"></polymer-animation-keyframe>
* <polymer-animation-keyframe value="translateX(100px)" offset="1"></polymer-animation-keyframe>
* <polymer-animation-prop>
* </polymer-animation>
* </polymer-animation-group>
* @class polymer-animation-group
*/
Polymer('polymer-animation-group', {
/**
* If specified the target will be assigned to all child animations.
* @property target
* @type HTMLElement|Node
* @optional
*/
publish: {
targetSelector: '',
target: null,
duration: null,
/**
* Group type. 'par' for parallel and 'seq' for sequence.
* @property type
* @type String
*/
type: 'par'
},
ready: function() {
// TODO: need to do this for now.
this.super();
},
makeAnimation: function() {
return new ANIMATION_GROUPS[this.type](this.childAnimations, this.timingProps);
},
completeApply: function() {
this.doOnChildren(function(c) {
c.completeApply();
});
Platform.flush();
this.super();
},
onAnimationChange: function(inEvent, inSender) {
if (inSender !== this) {
this.asyncApply();
}
},
typeChanged: function() {
this.asyncApply();
},
targetChanged: function() {
this.doOnChildren(function(c) {
c.target = this.target;
}.bind(this));
},
doOnChildren: function(inFn) {
var children = this.children;
if (!children.length) {
children = this.webkitShadowRoot ? this.webkitShadowRoot.childNodes : [];
}
Array.prototype.forEach.call(children, function(c) {
// TODO <template> in the way
c.apply && inFn(c);
}, this);
},
get childAnimations() {
var list = [];
this.doOnChildren(function(c) {
if (c.animation) {
list.push(c.animation);
}
});
return list;
}
});
})();
</script>
</polymer-element>
41 changes: 41 additions & 0 deletions polymer-animation/polymer-animation-keyframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<polymer-element name="polymer-animation-keyframe" attributes="offset value easing">
<script>
/**
* Defines the value at a keyframe for the containing `polymer-animation-prop`.
* @class polymer-animation-keyframe
*/
/**
* From 0 to 1.
* @property offset
* @type Number
* @required
*/
/**
* Property value at the animation offset.
* @property value
* @type String
* @required
*/
/**
* @property easing
* @type String
*/
Polymer('polymer-animation-keyframe', {
get properties() {
var props = {
// TODO bug in webanimations polyfill
value: String(this.value) || "",
};
var more = this.offset !== null || this.easing;
if (this.offset !== null) {
props.offset = this.offset;
}
if (this.easing) {
props.timingFunction = this.easing;
}
return more ? props : String(this.value);
}
});
</script>
</polymer-element>

25 changes: 25 additions & 0 deletions polymer-animation/polymer-animation-prop.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<link rel="import" href="polymer-animation-keyframe.html">
<polymer-element name="polymer-animation-prop" attributes="name">
<script>
/**
* An animated property. Its children should be `<polymer-animation-keyframe>`
* elements specifying the keyframe values.
*
* Declaring an property to move down and then right:
*
* <polymer-animation-prop name="transform">
* <polymer-animation-keyframe offset="0" value="translate(0,0)"></polymer-animation-keyframe>
* <polymer-animation-keyframe offset="0.5" value="translate(0,100px)"></polymer-animation-keyframe>
* <polymer-animation-keyframe offset="1" value="translate(100px,100px)"></polymer-animation-keyframe>
* </polymer-animation-prop>
* @class polymer-animation-prop
*/
/**
* CSS property name.
* @property name
* @type String
* @required
*/
Polymer('polymer-animation-prop');
</script>
</polymer-element>
Loading