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

Commit

Permalink
modernize speech-mic
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Apr 23, 2014
1 parent a0a1d6a commit 6f9dbd7
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 228 deletions.
9 changes: 0 additions & 9 deletions AUTHORS

This file was deleted.

1 change: 0 additions & 1 deletion CONTRIBUTING.md

This file was deleted.

27 changes: 0 additions & 27 deletions LICENSE

This file was deleted.

23 changes: 0 additions & 23 deletions PATENTS

This file was deleted.

70 changes: 43 additions & 27 deletions demo.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
<!DOCTYPE html>
<!doctype html>
<!--
Copyright 2012 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.
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../platform/platform.js"></script>
<link rel="import" href="speech-mic.html">
<style>
input {
height: 40px;
width: 200px;
float: left;
font-size: 16px;
}
</style>
</head>
<body unresolved>
<input id="speechInput"/>
<speech-mic id="speechMic"></speech-mic>
<script>
speechMic.addEventListener('result', function(e) {
speechInput.value = e.detail.transcript;
})
</script>
</body>
<head>
<title>speech-mic</title>

<script src="../platform/platform.js"></script>
<link rel="import" href="speech-mic.html">

<style>

input {
height: 40px;
width: 200px;
float: left;
font-size: 16px;
}

</style>

</head>
<body unresolved>

<input id="speechInput">

<speech-mic id="speechMic"></speech-mic>

<script>

var speechInput = document.querySelector('#speechInput');
var speechMic = document.querySelector('#speechMic');

speechMic.addEventListener('speech-mic-result', function(e) {
speechInput.value = e.detail.transcript;
});

</script>

</body>
</html>
75 changes: 17 additions & 58 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,64 +1,23 @@
<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
The complete set of authors may be found at http://polymer.github.io/AUTHORS
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
-->
<html>
<head>
<title>polymer api</title>
<style>
html, body {
font-family: Arial, sans-serif;
white-space: nowrap;
overflow: hidden;
}
[noviewer] [ifnoviewer] {
display: block;
}
[detector], [ifnoviewer], [noviewer] [ifviewer] {
display: none;
}
[ifviewer], [ifnoviewer] {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
iframe {
border: none;
margin: 0;
width: 100%;
height: 100%;
}
#remote {
position: absolute;
top: 0;
right: 0;
}
</style>

<script src="../platform/platform.js"></script>
<link rel="import" href="../polymer-home-page/polymer-home-page.html">
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-component-page/core-component-page.html">

</head>
<body>
<img detector src="../polymer-home-page/bowager-logo.png" onerror="noviewer()">
<polymer-home-page ifviewer></polymer-home-page>
<div ifnoviewer>
<span id="remote">[remote]</span>
<iframe></iframe>
</div>
<!-- -->
<script>
var remoteDocs = 'http://turbogadgetry.com/bowertopia/components/';
// if no local info viewer, load it remotely
function noviewer() {
document.body.setAttribute('noviewer', '');
var path = location.pathname.split('/');
var module = path.pop() || path.pop();
document.querySelector('iframe').src = remoteDocs + module;
document.querySelector('title').textContent = module;
}
// for testing only
var opts = window.location.search;
if (opts.indexOf('noviewer') >= 0) {
noviewer();
}
</script>
<body unresolved>

<core-component-page></core-component-page>

</body>
</html>
</html>
11 changes: 11 additions & 0 deletions metadata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<x-meta id="speech-mic" label="Speech Mic">

<template>
<speech-mic></speech-mic>
</template>

<template id="imports">
<link rel="import" href="speech-mic.html">
</template>

</x-meta>
Loading

0 comments on commit 6f9dbd7

Please sign in to comment.