ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / remoting / tools / javascript_key_tester / main.js
blob45387ac8d142be7da1a32d720d548c4404bafba5
1 /* Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
6 function onLoad() {
7 var pnaclLog = document.getElementById('pnacl-log');
8 var pnaclPlugin = document.getElementById('pnacl-plugin');
9 var pnaclListener = document.getElementById('pnacl-listener');
10 var textLog = document.getElementById('text-log');
11 var textLogContainer = document.getElementById('text-log-container');
13 var eventListeners = new EventListeners(pnaclLog, textLog,
14 pnaclPlugin, pnaclListener);
15 eventListeners.activate();
17 document.getElementById('clear-log').addEventListener(
18 'click',
19 function() {
20 pnaclLog.innerText = '';
21 textLog.innerText = '';
23 false);
24 document.getElementById('show-log').addEventListener(
25 'click',
26 function() {
27 eventListeners.deactivate();
28 textLogContainer.hidden = false;
30 var selection = window.getSelection();
31 var range = document.createRange();
32 range.selectNodeContents(textLog);
33 selection.removeAllRanges();
34 selection.addRange(range);
36 false);
37 document.getElementById('hide-log').addEventListener(
38 'click',
39 function() {
40 eventListeners.activate();
41 textLogContainer.hidden = true;
43 false);
46 window.addEventListener('load', onLoad, false);