OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 Google Inc. 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 | |
5 // Initialize the page. | |
6 function init() { | |
7 // Load internationalized strings. | |
8 var all = document.getElementsByTagName('*'); | |
ojan
2016/09/15 19:07:15
document.querySelectorAll('[i18n]') should be fast
| |
9 for (var i = 0; i < all.length; ++i) { | |
10 var i18n = all[i].getAttribute('i18n'); | |
11 if (i18n) | |
12 all[i].textContent = chrome.i18n.getMessage(i18n); | |
13 } | |
14 | |
15 document.getElementById('report_page').onclick = function() { | |
16 reportPage(); | |
17 }; | |
18 | |
19 document.getElementById('open_options').onclick = function() { | |
20 chrome.runtime.openOptionsPage(); | |
21 }; | |
22 | |
23 } | |
24 | |
25 window.addEventListener('load', init, false); | |
OLD | NEW |