Skip to content

Commit

Permalink
Initial development using element-boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno Rocha committed Apr 16, 2014
0 parents commit 0cbd7e1
Show file tree
Hide file tree
Showing 30 changed files with 1,204 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
30 changes: 30 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,30 @@
module.exports = function(grunt) {

grunt.initConfig({
connect: {
demo: {
options: {
open: true,
keepalive: true
}
}
},
replace: {
example: {
src: ['src/*'],
dest: 'dist/',
replacements: [{
from: 'bower_components',
to: '..'
}]
}
}
});

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-text-replace');

grunt.registerTask('default', ['connect']);
grunt.registerTask('build', ['replace']);

};
94 changes: 94 additions & 0 deletions README.md
@@ -0,0 +1,94 @@
# <voice> ![Bower Version](https://badge.fury.io/bo/voice-element.svg)

> [Web Speech API](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html) wrapper that allows you to do voice recognition (speech to text) and speech synthesis (text to speech) using [Polymer](http://www.polymer-project.org/).
## Demo

[Check it live!](http://zenorocha.github.io/voice-element)

## Usage

1. Install the component using [Bower](http://bower.io/):

```sh
$ bower install voice-element --save
```

2. Import Web Components' polyfill:

```html
<script src="bower_components/platform/platform.js"></script>
```

3. Import Custom Element:

```html
<link rel="import" href="bower_components/voice-element/dist/voice-element.html">
```

4. Start using it!

```html
<voice-element></voice-element>
```

## Options

Attribute | Options | Default | Description
--- | --- | --- | ---
`autoplay` | *boolean* | `false` | Specifies if the audio should play when page loads.
`text` | *string* | `You are awesome` | Specifies the text to be synthesized and spoken.
`pitch` | *int* | `1` | Specifies the speaking pitch for the utterance. It ranges between `0` and `2`.
`rate` | *int* | `1` | Specifies the speaking rate for the utterance. `1` corresponds to a normal speaking rate. `2` is twice as fast, `0.5` is half as fast, and so on.
`volume` | *int* | `1` | Specifies the speaking volume for the utterance. It ranges between `0` and `1`.

## Methods

Method | Parameters | Returns | Description
--- | --- | --- | ---
`play()` | None. | Nothing. | Triggers the audio to be played.

## Development

In order to run it locally you'll need to fetch some dependencies and a basic server setup.

1. Install [Bower](http://bower.io/) & [Grunt](http://gruntjs.com/):

```sh
$ [sudo] npm install -g bower grunt-cli
```

2. Install local dependencies:

```sh
$ bower install && npm install
```

3. To test your project, start the development server and open `http://localhost:8000`.

```sh
$ grunt
```

4. Once you finish developing it, build the distribution files and publish it on Bower.

```sh
$ grunt build
$ bower register voice-element https://github.com/you/voice-element
```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## History

For detailed changelog, check [Releases](https://github.com/zenorocha/voice-element/releases).

## License

[MIT License](http://opensource.org/licenses/MIT)
29 changes: 29 additions & 0 deletions bower.json
@@ -0,0 +1,29 @@
{
"name": "voice-element",
"version": "0.0.0",
"description": "Web Speech API wrapper that allows you to do voice recognition (speech to text) and speech synthesis (text to speech) using Polymer.",
"authors": [
"Zeno Rocha <hi@zenorocha.com>"
],
"license": "MIT",
"main": "dist/voice-player.html",
"keywords": [
"polymer",
"speech",
"speech-synthesis",
"voice",
"voice-player",
"voice-recognition",
"web-speech",
"web-components"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"platform": "Polymer/platform#~0.2.0",
"polymer": "Polymer/polymer#~0.2.0"
}
}
26 changes: 26 additions & 0 deletions bower_components/platform/.bower.json
@@ -0,0 +1,26 @@
{
"name": "platform",
"main": "platform.js",
"homepage": "https://github.com/Polymer/platform",
"authors": [
"The Polymer Authors"
],
"description": "Integrate platform polyfills: load, build, test",
"keywords": [
"polymer",
"web",
"components"
],
"license": "BSD",
"private": true,
"version": "0.2.1",
"_release": "0.2.1",
"_resolution": {
"type": "version",
"tag": "0.2.1",
"commit": "961d6f68848b9479d4d778466c37c0835837bc1c"
},
"_source": "git://github.com/Polymer/platform.git",
"_target": "~0.2.0",
"_originalSource": "Polymer/platform"
}
9 changes: 9 additions & 0 deletions bower_components/platform/AUTHORS
@@ -0,0 +1,9 @@
# Names should be added to this file with this pattern:
#
# For individuals:
# Name <email address>
#
# For organizations:
# Organization <fnmatch pattern>
#
Google Inc. <*@google.com>
73 changes: 73 additions & 0 deletions bower_components/platform/CONTRIBUTING.md
@@ -0,0 +1,73 @@
# Contributing

Want to contribute to Polymer? Great!

We are more than happy to accept external contributions to the project in the form of [feedback](https://groups.google.com/forum/?fromgroups=#!forum/polymer-dev), [bug reports](../../issues), and pull requests.

## Contributor License Agreement

Before we can accept patches, there's a quick web form you need to fill out.

- If you're contributing as an individual (e.g. you own the intellectual property), fill out [this form](http://code.google.com/legal/individual-cla-v1.0.html).
- If you're contributing under a company, fill out [this form](http://code.google.com/legal/corporate-cla-v1.0.html) instead.

This CLA asserts that contributions are owned by you and that we can license all work under our [license](LICENSE).

Other projects require a similar agreement: jQuery, Firefox, Apache, Node, and many more.

[More about CLAs](https://www.google.com/search?q=Contributor%20License%20Agreement)

## Initial setup

Here's an easy guide that should get you up and running:

1. Setup Grunt: `sudo npm install -g grunt-cli`
1. Fork the project on github and pull down your copy.
> replace the {{ username }} with your username and {{ repository }} with the repository name
git clone git@github.com:{{ username }}/{{ repository }}.git --recursive

Note the `--recursive`. This is necessary for submodules to initialize properly. If you don't do a recursive clone, you'll have to init them manually:

git submodule init
git submodule update

Download and run the `pull-all.sh` script to install the sibling dependencies.

git clone git://github.com/Polymer/tools.git && tools/bin/pull-all.sh

1. Test your change
> in the repo you've made changes to, run the tests:
cd $REPO
npm install
grunt test

1. Commit your code and make a pull request.

That's it for the one time setup. Now you're ready to make a change.

## Submitting a pull request

We iterate fast! To avoid potential merge conflicts, it's a good idea to pull from the main project before making a change and submitting a pull request. The easiest way to do this is setup a remote called `upstream` and do a pull before working on a change:

git remote add upstream git://github.com/Polymer/{{ repository }}.git

Then before making a change, do a pull from the upstream `master` branch:

git pull upstream master

To make life easier, add a "pull upstream" alias in your `.gitconfig`:

[alias]
pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"

That will pull in changes from your forked repo, the main (upstream) repo, and merge the two. Then it's just a matter of running `git pu` before a change and pushing to your repo:

git checkout master
git pu
# make change
git commit -a -m 'Awesome things.'
git push

Lastly, don't forget to submit the pull request.
27 changes: 27 additions & 0 deletions bower_components/platform/LICENSE
@@ -0,0 +1,27 @@
// Copyright (c) 2012 The Polymer Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 23 additions & 0 deletions bower_components/platform/PATENTS
@@ -0,0 +1,23 @@
Additional IP Rights Grant (Patents)

"This implementation" means the copyrightable works distributed by
Google as part of the Polymer project.

Google hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section)
patent license to make, have made, use, offer to sell, sell, import,
transfer and otherwise run, modify and propagate the contents of this
implementation of Polymer, where such license applies only to those
patent claims, both currently owned or controlled by Google and acquired
in the future, licensable by Google that are necessarily infringed by
this implementation of Polymer. This grant does not include claims
that would be infringed only as a consequence of further modification of
this implementation. If you or your agent or exclusive licensee
institute or order or agree to the institution of patent litigation
against any entity (including a cross-claim or counterclaim in a
lawsuit) alleging that this implementation of Polymer or any code
incorporated within this implementation of Polymer constitutes
direct or contributory patent infringement, or inducement of patent
infringement, then any patent rights granted to you under this License
for this implementation of Polymer shall terminate as of the date
such litigation is filed.
6 changes: 6 additions & 0 deletions bower_components/platform/README.md
@@ -0,0 +1,6 @@
Platform
========

Aggregated polyfills the Polymer platform.

[![Analytics](https://ga-beacon.appspot.com/UA-39334307-2/Polymer/platform/README)](https://github.com/igrigorik/ga-beacon)
17 changes: 17 additions & 0 deletions bower_components/platform/bower.json
@@ -0,0 +1,17 @@
{
"name": "platform",
"main": "platform.js",
"homepage": "https://github.com/Polymer/platform",
"authors": [
"The Polymer Authors"
],
"description": "Integrate platform polyfills: load, build, test",
"keywords": [
"polymer",
"web",
"components"
],
"license": "BSD",
"private": true,
"version": "0.2.1"
}

0 comments on commit 0cbd7e1

Please sign in to comment.