about_credits.js 744 B

123456789101112131415161718192021222324
  1. // Copyright (c) 2011 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. /* eslint-disable no-restricted-properties */
  5. function $(id) {
  6. return document.getElementById(id);
  7. }
  8. /* eslint-enable no-restricted-properties */
  9. document.addEventListener('DOMContentLoaded', function() {
  10. $('print-link').hidden = false;
  11. $('print-link').onclick = function() {
  12. window.print();
  13. return false;
  14. };
  15. document.addEventListener('keypress', function(e) {
  16. // Make the license show/hide toggle when the Enter is pressed.
  17. if (e.keyCode === 0x0d && e.target.tagName === 'LABEL') {
  18. e.target.previousElementSibling.click();
  19. }
  20. });
  21. });