OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 /** | 9 /** |
10 * FontSettings class | 10 * FontSettings class |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 $('sans-serif-font-family'), $('fixed-font-family'), | 50 $('sans-serif-font-family'), $('fixed-font-family'), |
51 $('font-encoding')]; | 51 $('font-encoding')]; |
52 elements.forEach(function(el) { | 52 elements.forEach(function(el) { |
53 el.appendChild(new Option(placeholder)); | 53 el.appendChild(new Option(placeholder)); |
54 el.setDisabled('noFontsAvailable', true); | 54 el.setDisabled('noFontsAvailable', true); |
55 }); | 55 }); |
56 | 56 |
57 $('font-settings-confirm').onclick = function() { | 57 $('font-settings-confirm').onclick = function() { |
58 OptionsPage.closeOverlay(); | 58 OptionsPage.closeOverlay(); |
59 }; | 59 }; |
60 | |
61 $('advanced-font-settings-options').onclick = function() { | |
62 chrome.send('openAdvancedFontSettingsOptions'); | |
63 }; | |
60 }, | 64 }, |
61 | 65 |
62 /** | 66 /** |
63 * Called by the options page when this page has been shown. | 67 * Called by the options page when this page has been shown. |
64 */ | 68 */ |
65 didShowPage: function() { | 69 didShowPage: function() { |
66 // The fonts list may be large so we only load it when this page is | 70 // The fonts list may be large so we only load it when this page is |
67 // loaded for the first time. This makes opening the options window | 71 // loaded for the first time. This makes opening the options window |
68 // faster and consume less memory if the user never opens the fonts | 72 // faster and consume less memory if the user never opens the fonts |
69 // dialog. | 73 // dialog. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 }; | 230 }; |
227 | 231 |
228 FontSettings.setUpMinimumFontSample = function(size) { | 232 FontSettings.setUpMinimumFontSample = function(size) { |
229 // If size is less than 6, represent it as six in the sample to account | 233 // If size is less than 6, represent it as six in the sample to account |
230 // for the minimum logical font size. | 234 // for the minimum logical font size. |
231 if (size < 6) | 235 if (size < 6) |
232 size = 6; | 236 size = 6; |
233 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, | 237 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, |
234 null, true); | 238 null, true); |
235 }; | 239 }; |
236 | 240 |
Dan Beam
2013/10/23 18:04:00
/**
* A doc comment goes here.
* @param {boolean
| |
241 FontSettings.notifyAdvancedFontSettingsAvailability = function(available) { | |
Dan Beam
2013/10/23 18:04:00
$('advanced-font-settings-install').hidden = avail
falken
2013/10/24 12:09:41
Oops, of course. Done.
| |
242 if (available) { | |
243 $('advanced-font-settings-install').hidden = true; | |
244 $('advanced-font-settings-options').hidden = false; | |
245 } else { | |
246 $('advanced-font-settings-install').hidden = false; | |
247 $('advanced-font-settings-options').hidden = true; | |
248 } | |
249 } | |
Dan Beam
2013/10/23 18:04:00
};
falken
2013/10/24 12:09:41
Done.
| |
250 | |
237 // Export | 251 // Export |
238 return { | 252 return { |
239 FontSettings: FontSettings | 253 FontSettings: FontSettings |
240 }; | 254 }; |
241 }); | 255 }); |
242 | 256 |
OLD | NEW |