OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function addToPage(html) { | 5 function addToPage(html) { |
6 var div = document.createElement('div'); | 6 var div = document.createElement('div'); |
7 div.innerHTML = html; | 7 div.innerHTML = html; |
8 document.getElementById('content').appendChild(div); | 8 document.getElementById('content').appendChild(div); |
9 } | 9 } |
10 | 10 |
11 function showLoadingIndicator(isLastPage) { | 11 function showLoadingIndicator(isLastPage) { |
12 document.getElementById('loadingIndicator').className = | 12 document.getElementById('loadingIndicator').className = |
13 isLastPage ? 'hidden' : 'visible'; | 13 isLastPage ? 'hidden' : 'visible'; |
14 } | 14 } |
| 15 |
| 16 // Maps JS theme to CSS class and then changes body class name. |
| 17 // CSS classes must agree with distilledpage.css. |
| 18 function useTheme(theme) { |
| 19 var cssClass; |
| 20 if (theme == "sepia") { |
| 21 cssClass = "sepia"; |
| 22 } else if (theme == "dark") { |
| 23 cssClass = "dark"; |
| 24 } else { |
| 25 cssClass = "light"; |
| 26 } |
| 27 document.body.className = cssClass; |
| 28 } |
OLD | NEW |