diff options
Diffstat (limited to 'chromium/third_party/catapult/third_party/polymer2/bower_components/iron-a11y-announcer/demo/index.html')
-rw-r--r-- | chromium/third_party/catapult/third_party/polymer2/bower_components/iron-a11y-announcer/demo/index.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/chromium/third_party/catapult/third_party/polymer2/bower_components/iron-a11y-announcer/demo/index.html b/chromium/third_party/catapult/third_party/polymer2/bower_components/iron-a11y-announcer/demo/index.html new file mode 100644 index 00000000000..8d5aa4c45b6 --- /dev/null +++ b/chromium/third_party/catapult/third_party/polymer2/bower_components/iron-a11y-announcer/demo/index.html @@ -0,0 +1,75 @@ +<!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"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> + + <title>iron-a11y-announcer demo</title> + + <script src="../../webcomponentsjs/webcomponents-lite.js"></script> + <link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> + <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> + <link rel="import" href="../../paper-button/paper-button.html"> + <link rel="import" href="x-announces.html"> + <link rel="import" href="../iron-a11y-announcer.html"> + <custom-style> + <style is="custom-style" include="demo-pages-shared-styles"> + input { + margin-right: 20px; + } + </style> + </custom-style> +</head> +<body> + <div class="vertical-section-container centered"> + <p><b>Note</b>: in order to hear the announcements, be sure to turn on your favorite screen reader!</p> + + <h4>Announcer used directly on the main document</h4> + <demo-snippet> + <template> + <input id="input" value="Pizza is delicious"> + <paper-button raised onclick="_announce()">Announce</paper-button> + + <script> + window.addEventListener('WebComponentsReady', function() { + // Initialize the announcer. + Polymer.IronA11yAnnouncer.requestAvailability(); + + // Optional; for testing, set the mode to assertive to announce immediately. + Polymer.IronA11yAnnouncer.instance.mode = 'assertive'; + }); + + function _announce() { + Polymer.IronA11yAnnouncer.instance.fire('iron-announce', { + text: input.value.trim() + }, { + bubbles: true + }); + } + </script> + </template> + </demo-snippet> + + <h4>Announcer used inside a custom element</h4> + <demo-snippet> + <template> + <x-announces message="Hello, my name is Ava"></x-announces> + <x-announces message="This true sentence is false."></x-announces> + <x-announces message="Are you paying attention?"></x-announces> + </template> + </demo-snippet> + </div> +</body> +</html> |