Vectorize sad tab image.
[chromium-blink-merge.git] / chrome / browser / resources / about_credits.js
blob818ef5e77b2d33bc5845680bc93852515b27aa6f
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.
5 function $(id) { return document.getElementById(id); }
7 function toggle(o) {
8 var licence = o.nextSibling;
10 while (licence.className != 'licence') {
11 if (!licence) return false;
12 licence = licence.nextSibling;
15 if (licence.style && licence.style.display == 'block') {
16 licence.style.display = 'none';
17 o.textContent = 'show license';
18 } else {
19 licence.style.display = 'block';
20 o.textContent = 'hide license';
22 return false;
25 document.addEventListener('DOMContentLoaded', function() {
26 if (cr.isChromeOS) {
27 var keyboardUtils = document.createElement('script');
28 keyboardUtils.src = 'chrome://credits/keyboard_utils.js';
29 document.body.appendChild(keyboardUtils);
32 var links = document.querySelectorAll('a.show');
33 for (var i = 0; i < links.length; ++i) {
34 links[i].onclick = function() { return toggle(this); };
37 $('print-link').onclick = function() {
38 window.print();
39 return false;
41 });