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.
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(
20 pnaclLog
.innerText
= '';
21 textLog
.innerText
= '';
24 document
.getElementById('show-log').addEventListener(
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
);
37 document
.getElementById('hide-log').addEventListener(
40 eventListeners
.activate();
41 textLogContainer
.hidden
= true;
46 window
.addEventListener('load', onLoad
, false);