This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Polymer/master
6/17 master -> stable
- Loading branch information
Showing
27 changed files
with
479 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
<!doctype html> | ||
<!-- | ||
Copyright 2013 The Polymer Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style | ||
license that can be found in the LICENSE file. | ||
--> | ||
<html> | ||
<head> | ||
<title>polymer-ui-ratings</title> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<!-- load toolkit --> | ||
<script src="../../polymer/polymer.js"></script> | ||
<!-- import elements--> | ||
<link rel="import" href="polymer-ui-ratings.html"> | ||
</head> | ||
<body> | ||
<polymer-ui-ratings value="3"></polymer-ui-ratings> | ||
<br><br> | ||
<polymer-ui-ratings value="5" count="10"></polymer-ui-ratings> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copyright 2013 The Polymer Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style | ||
license that can be found in the LICENSE file. | ||
*/ | ||
|
||
@host { | ||
* { | ||
display: inline-block; | ||
white-space: nowrap; | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
} | ||
} | ||
|
||
#star { | ||
display: inline-block; | ||
vertical-align: middle; | ||
width: 24px; | ||
height: 24px; | ||
margin: 0 5px; | ||
background-size: 100% 100%; | ||
background-image: url('star_blank.png'); | ||
cursor: pointer; | ||
} | ||
|
||
#star.full { | ||
background-image: url('star_full.png'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!-- | ||
Copyright 2013 The Polymer Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style | ||
license that can be found in the LICENSE file. | ||
--> | ||
<!-- | ||
/** | ||
* @module Polymer UI Elements | ||
*/ | ||
/** | ||
* polymer-ratings allows users to rate items. | ||
* | ||
* Example: | ||
* | ||
* <polymer-ratings value="3"></polymer-ratings> | ||
* | ||
* By default g-ratings shows 5 stars but can be configured using "count" attribute: | ||
* | ||
* <polymer-ratings value="3" count="10"></polymer-ratings> | ||
* | ||
* @class g-ratings | ||
*/ | ||
--> | ||
<element name="polymer-ui-ratings" attributes="count value"> | ||
<link rel="stylesheet" href="polymer-ui-ratings.css"> | ||
<template> | ||
<template repeat="{{stars}}"> | ||
<span id="star" index="{{index}}" class="{{starClass}}" touch-action="none" on-tap="updateValue"></span> | ||
</template> | ||
</template> | ||
<script> | ||
Polymer.register(this, { | ||
/** | ||
* Number of stars to display. | ||
* | ||
* @attribute count | ||
* @type number | ||
* @default 5 | ||
*/ | ||
count: 5, | ||
/** | ||
* Number of selected stars. | ||
* | ||
* @attribute value | ||
* @type number | ||
* @default 0 | ||
*/ | ||
value: 0, | ||
ready: function() { | ||
this.countChanged(); | ||
}, | ||
countChanged: function() { | ||
this.stars = []; | ||
for (var i = 0; i < this.count; i++) { | ||
this.stars.push({index: i}); | ||
} | ||
this.valueChanged(); | ||
}, | ||
valueChanged: function() { | ||
this.stars && this.stars.forEach(function(s, i) { | ||
s.starClass = i < this.value ? 'full' : ''; | ||
}.bind(this)); | ||
}, | ||
updateValue: function(event, detail, sender) { | ||
var s = sender.templateInstance.model; | ||
this.value = s.index + (s.starClass ? 0 : 1); | ||
} | ||
}); | ||
</script> | ||
</element> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.