Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions microbit-led-scrolling-text/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# How to become a contributor and submit your own code

## Contributor License Agreements

We'd love to accept your sample apps and patches! Before we can take them, we
have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement
(CLA).

* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual CLA]
(https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA]
(https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.

## Contributing A Patch

1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
1. If your proposed change is accepted, and you haven't already done so, sign a
Contributor License Agreement (see details above).
1. Fork the desired repo, develop and test your code changes.
1. Ensure that your code adheres to the existing style in the sample to which
you are contributing. Refer to the
[Google Cloud Platform Samples Style Guide]
(https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the
recommended coding standards for this organization.
1. Ensure that your code has an appropriate set of unit tests which all pass.
1. Submit a pull request.

647 changes: 647 additions & 0 deletions microbit-led-scrolling-text/LICENSE

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions microbit-led-scrolling-text/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Web Bluetooth Printer

Available at https://webbluetoothcg.github.io/demos/microbit-led-scrolling-text/

<img src="/microbit-led-scolling-text/microbit.jpg">

This web app demonstrates the use of the Web Bluetooth API to send text to the standard `MicroBitLEDService` service

## Dependencies
* micro:bit: https://thepihut.com/products/micro-bit
* ChromeOS 48 with Web Bluetooth API enabled: https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web?hl=en
* Bower: http://bower.io/

## Setup Instructions
* Run the following command to install the packages listed in bower.json to the bower_components folder: bower install
* Host the app on your web server.
* Confirm the Web Bluetooth implementation status: https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md
* Load the web app in a Chrome browser.
* Power up the microbit with the LED Service found [here](https://github.com/nimbleape/microbit-led-service)
* Enter a message on the web app.
* Click on the "Send" button to send the message to the microbit- the message will scroll on the LED display.

## References and How to report bugs
* Web Bluetooth API: https://webbluetoothcg.github.io/web-bluetooth/
* If you find any issues, please open a bug here on GitHub

## How to make contributions?
Please read and follow the steps in the CONTRIBUTING.md

## License
See LICENSE

## Google+
Web Bluetooth Community on Google+: https://plus.google.com/communities/108953318610326025178
27 changes: 27 additions & 0 deletions microbit-led-scrolling-text/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "Microbit LED Scrolling Text",
"version": "0.0.0",
"authors": [
"Google",
"Nimble Ape Ltd"
],
"main": "index.html",
"license": "Apache License 2.0",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"paper-button": "PolymerElements/paper-button#^1.0.3",
"paper-card": "PolymerElements/paper-card#^1.0.3",
"paper-dialog": "PolymerElements/paper-dialog#^1.0.1",
"paper-input": "PolymerElements/paper-input#^1.0.18",
"paper-progress": "PolymerElements/paper-progress#^1.0.2",
"paper-slider": "PolymerElements/paper-slider#^1.0.4",
"paper-styles": "PolymerElements/paper-styles#^1.0.11",
"polymer": "Polymer/polymer#^1.1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "font-roboto",
"version": "1.0.1",
"description": "An HTML import for Roboto",
"authors": [
"The Polymer Authors"
],
"keywords": [
"font",
"roboto"
],
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/font-roboto.git"
},
"main": "roboto.html",
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/font-roboto/",
"ignore": [
"/.*"
],
"_release": "1.0.1",
"_resolution": {
"type": "version",
"tag": "v1.0.1",
"commit": "21ce9b51a417fa9995cf6606e886aba0728f70a1"
},
"_source": "git://github.com/PolymerElements/font-roboto.git",
"_target": "^1.0.1",
"_originalSource": "PolymerElements/font-roboto"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# font-roboto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "font-roboto",
"version": "1.0.1",
"description": "An HTML import for Roboto",
"authors": [
"The Polymer Authors"
],
"keywords": [
"font",
"roboto"
],
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/font-roboto.git"
},
"main": "roboto.html",
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/font-roboto/",
"ignore": [
"/.*"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
@license
Copyright (c) 2015 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
-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700">
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "iron-a11y-keys-behavior",
"version": "1.0.8",
"description": "A behavior that enables keybindings for greater a11y.",
"keywords": [
"web-components",
"web-component",
"polymer",
"a11y",
"input"
],
"authors": [
"The Polymer Authors"
],
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git"
},
"main": "iron-a11y-keys-behavior.html",
"license": "http://polymer.github.io/LICENSE.txt",
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "df29a9edcff3b4693707f1e3eebce5a1dc46e946"
},
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-a11y-keys-behavior"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bower_components
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
iron-a11y-keys-behavior
=======================

`Polymer.IronA11yKeysBehavior` provides a normalized interface for processing
keyboard commands that pertain to [WAI-ARIA best practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).
The element takes care of browser differences with respect to Keyboard events
and uses an expressive syntax to filter key presses.

Use the `keyBindings` prototype property to express what combination of keys
will trigger the event to fire.

Use the `key-event-target` attribute to set up event handlers on a specific
node.
The `keys-pressed` event will fire when one of the key combinations set with the
`keys` property is pressed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "iron-a11y-keys-behavior",
"version": "1.0.8",
"description": "A behavior that enables keybindings for greater a11y.",
"keywords": [
"web-components",
"web-component",
"polymer",
"a11y",
"input"
],
"authors": [
"The Polymer Authors"
],
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git"
},
"main": "iron-a11y-keys-behavior.html",
"license": "http://polymer.github.io/LICENSE.txt",
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 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>
<meta charset="UTF-8">
<title>Iron A11y Keys Behavior demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="x-key-aware.html">
<link rel="import" href="../../paper-styles/demo-pages.html">
</head>
<body>
<div class="vertical-section vertical-section-container centered">
<x-key-aware></x-key-aware>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!--
@license
Copyright (c) 2015 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
-->

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../paper-styles/paper-styles.html">
<link rel="import" href="../iron-a11y-keys-behavior.html">

<dom-module id="x-key-aware">
<style>
:host {
display: block;
position: relative;
}

pre {
color: var(--google-blue-700);
}

.keys {
line-height: 25px;
}

.keys span {
cursor: default;
background-color: var(--google-grey-100);
border: 1px solid var(--google-grey-300);
padding: 1px 5px;
border-radius: 5px;
}
</style>
<template>
<h4>Press any of these keys</h4>
<p class="keys">
<template is="dom-repeat" items="[[boundKeys]]">
<span>{{item}}</span>
</template>
</p>
<pre>[[pressed]]</pre>
</template>
</dom-module>

<script>
Polymer({
is: 'x-key-aware',

behaviors: [
Polymer.IronA11yKeysBehavior
],

properties: {
pressed: {
type: String,
readOnly: true,
value: ''
},

boundKeys: {
type: Array,
value: function() {
return Object.keys(this.keyBindings).join(' ').split(' ');
}
},

keyEventTarget: {
type: Object,
value: function() {
return document.body;
}
}
},

keyBindings: {
'* pageup pagedown left right down up shift+a alt+a home end space enter': '_updatePressed'
},

_updatePressed: function(event) {
console.log(event.detail);

this._setPressed(
this.pressed + event.detail.combo + ' pressed!\n'
);
}
});
</script>
Loading