Skip to content

Commit 74c1355

Browse files
committed
production ready
improve demo, update doc, bower.json, todo list & noImageText attribute
1 parent b7b9687 commit 74c1355

File tree

4 files changed

+61
-72
lines changed

4 files changed

+61
-72
lines changed

README.md

+20-59
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,22 @@
11
# paper-input-image
22

3-
An element providing a starting point for your own reusable Polymer elements.
4-
5-
6-
## Dependencies
7-
8-
Element dependencies are managed via [Bower](http://bower.io/). You can
9-
install that via:
10-
11-
npm install -g bower
12-
13-
Then, go ahead and download the element's dependencies:
14-
15-
bower install
16-
17-
18-
## Playing With Your Element
19-
20-
If you wish to work on your element in isolation, we recommend that you use
21-
[Polyserve](https://github.com/PolymerLabs/polyserve) to keep your element's
22-
bower dependencies in line. You can install it via:
23-
24-
npm install -g polyserve
25-
26-
And you can run it via:
27-
28-
polyserve
29-
30-
Once running, you can preview your element at
31-
`http://localhost:8080/components/paper-input-image/`, where `paper-input-image` is the name of the directory containing it.
32-
33-
34-
## Testing Your Element
35-
36-
Simply navigate to the `/test` directory of your element to run its tests. If
37-
you are using Polyserve: `http://localhost:8080/components/paper-input-image/test/`
38-
39-
### web-component-tester
40-
41-
The tests are compatible with [web-component-tester](https://github.com/Polymer/web-component-tester).
42-
Install it via:
43-
44-
npm install -g web-component-tester
45-
46-
Then, you can run your tests on _all_ of your local browsers via:
47-
48-
wct
49-
50-
#### WCT Tips
51-
52-
`wct -l chrome` will only run tests in chrome.
53-
54-
`wct -p` will keep the browsers alive after test runs (refresh to re-run).
55-
56-
`wct test/some-file.html` will test only the files you specify.
57-
58-
59-
## Yeoman support
60-
61-
If you'd like to use Yeoman to scaffold your element that's possible. The official [`generator-polymer`](https://github.com/yeoman/generator-polymer) generator has a [`seed`](https://github.com/yeoman/generator-polymer#seed) subgenerator.
3+
A material input type image.
4+
5+
## [Demo & Doc](http://zecat.github.io/paper-input-image)
6+
7+
## Installation
8+
9+
```
10+
bower install --save Zecat/paper-input-image
11+
```
12+
13+
TODO :
14+
- paper-tile should provide placeholder image
15+
- paper-tile should provide loading spinner
16+
- remove dependency from paper-tile
17+
- add nameable attribute for rename feature using paper-input-rename
18+
- add event system
19+
- attr to convert the size unity on demande (iron-input-image's missing feature)
20+
- add tests
21+
- add responsive interaction (ripple)
22+
- add mixins & vars

bower.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
22
"name": "paper-input-image",
3-
"version": "1.0.3",
3+
"version": "1.0.0",
44
"authors": [
5-
"Anonymous <anonymous@example.com>"
5+
"Zecat <jullienfelix@gmail.com>"
66
],
7-
"description": "An element providing a solution to no problem in particular.",
7+
"description": "A material input type image",
88
"keywords": [
99
"web-component",
1010
"polymer",
1111
"seed"
1212
],
1313
"main": "paper-input-image.html",
1414
"license": "http://polymer.github.io/LICENSE.txt",
15-
"homepage": "https://github.com/<USERNAME>/seed-element/",
15+
"homepage": "https://github.com/zecat/paper-input-image/",
1616
"ignore": [
1717
"/.*",
1818
"/test/"
1919
],
2020
"dependencies": {
21-
"polymer": "Polymer/polymer#^1.1.0",
22-
"iron-input-image": "https://github.com/Zecat/iron-input-image.git#master",
23-
"paper-tile": "https://github.com/Zecat/paper-tile.git#master",
24-
"iron-icons": "PolymerElements/iron-icons#~1.0.5"
21+
"polymer": "Polymer/polymer#^1.2.0",
22+
"iron-input-image": "Zecat/iron-input-image#~1.0.0",
23+
"paper-tile": "Zecat/paper-tile#~1.0.1",
24+
"iron-icons": "PolymerElements/iron-icons#~1.1.1"
2525
},
2626
"devDependencies": {
2727
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",

demo/index.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<body unresolved>
2323

2424
<style is="custom-style" include="demo-pages-shared-styles">
25+
.vertical-section-container {
26+
max-width: 500px;
27+
}
2528
</style>
2629

2730
<div class="vertical-section-container centered">
@@ -33,7 +36,8 @@
3336
height: 300px;
3437
}
3538
</style>
36-
<paper-input-image></paper-input-image>
39+
<paper-input-image no-image-text="Click to select an image">
40+
</paper-input-image>
3741
</template>
3842
</demo-snippet>
3943
</div>

paper-input-image.html

+28-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
<paper-input-image></paper-input-image>
1313
14-
@group Seed Elements
14+
@group Paper Elements
1515
@element paper-input-image
1616
@demo demo/index.html
1717
@hero hero.svg
@@ -56,27 +56,51 @@
5656
is: 'paper-input-image',
5757

5858
properties: {
59-
title: {
59+
/**
60+
* The text displayed when no image is selected.
61+
*/
62+
noImageText: {
6063
type: String,
6164
value: 'No image selected'
6265
},
66+
/**
67+
* The image src.
68+
*/
6369
src: {
6470
type: String,
6571
value: ''
6672
},
73+
/**
74+
* The size of the selected image (ko).
75+
*/
6776
size: {
6877
type: Number,
6978
value: 0
79+
},
80+
/**
81+
* The text displayed. Equales to noImageText if no image is selected and
82+
* updates from the image file's title when a new one is selected.
83+
*/
84+
title: {
85+
type: String
7086
}
7187
},
7288

89+
attached: function() {
90+
this.title = this.noImageText;
91+
},
92+
/**
93+
* Choose a new image from the user disk.
94+
*/
7395
choose: function() {
7496
this.$.inputImage.choose();
7597
},
76-
98+
/**
99+
* Remove the selected image.
100+
*/
77101
clear: function() {
78102
this.$.inputImage.clear();
79-
this.title = 'No image selected';
103+
this.title = this.noImageText;
80104
},
81105

82106
_computeIcon: function(src) {

0 commit comments

Comments
 (0)