summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/ssl/roadblock.js
blob: f9c58608e267cfe02977f507d9332c8e5ec3f434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// UI modifications and event listeners that take place after load.
function setupEvents() {
  $('proceed-button').hidden = false;
  $('proceed-button').addEventListener('click', function() {
    sendCommand(CMD_PROCEED);
  });

  var details = document.querySelector('details.more');
  if ($('more-info-title').textContent == '') {
    details.hidden = true;
  } else {
    details.addEventListener('toggle', function handleToggle() {
      if (!details.open)
        return;
      sendCommand(CMD_MORE);
      details.removeEventListener('toggle', handleToggle);
    }, false);
  }

  $('exit-button').addEventListener('click', function() {
    sendCommand(CMD_DONT_PROCEED);
  });
}

document.addEventListener('DOMContentLoaded', setupEvents);