Index: chrome/browser/resources/options/font_settings.js |
diff --git a/chrome/browser/resources/options/font_settings.js b/chrome/browser/resources/options/font_settings.js |
index 74be53dfcca8ea341eac6370bc8d8de5477945b0..1f4802ad730baba963617b953a0379cc5ba71660 100644 |
--- a/chrome/browser/resources/options/font_settings.js |
+++ b/chrome/browser/resources/options/font_settings.js |
@@ -14,9 +14,9 @@ cr.define('options', function() { |
* @class |
*/ |
function FontSettings() { |
- Page.call(this, 'fonts', |
- loadTimeData.getString('fontSettingsPageTabTitle'), |
- 'font-settings'); |
+ Page.call( |
+ this, 'fonts', loadTimeData.getString('fontSettingsPageTabTitle'), |
+ 'font-settings'); |
} |
cr.addSingletonGetter(FontSettings); |
@@ -29,8 +29,10 @@ cr.define('options', function() { |
Page.prototype.initializePage.call(this); |
var standardFontRange = $('standard-font-size'); |
- standardFontRange.valueMap = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, |
- 22, 24, 26, 28, 30, 32, 34, 36, 40, 44, 48, 56, 64, 72]; |
+ standardFontRange.valueMap = [ |
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, |
+ 26, 28, 30, 32, 34, 36, 40, 44, 48, 56, 64, 72 |
+ ]; |
standardFontRange.addEventListener( |
'change', this.standardRangeChanged_.bind(this, standardFontRange)); |
standardFontRange.addEventListener( |
@@ -39,8 +41,8 @@ cr.define('options', function() { |
this.standardFontSizeChanged_.bind(standardFontRange); |
var minimumFontRange = $('minimum-font-size'); |
- minimumFontRange.valueMap = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, |
- 18, 20, 22, 24]; |
+ minimumFontRange.valueMap = |
+ [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24]; |
minimumFontRange.addEventListener( |
'change', this.minimumRangeChanged_.bind(this, minimumFontRange)); |
minimumFontRange.addEventListener( |
@@ -49,8 +51,10 @@ cr.define('options', function() { |
this.minimumFontSizeChanged_.bind(minimumFontRange); |
var placeholder = loadTimeData.getString('fontSettingsPlaceholder'); |
- var elements = [$('standard-font-family'), $('serif-font-family'), |
- $('sans-serif-font-family'), $('fixed-font-family')]; |
+ var elements = [ |
+ $('standard-font-family'), $('serif-font-family'), |
+ $('sans-serif-font-family'), $('fixed-font-family') |
+ ]; |
elements.forEach(function(el) { |
el.appendChild(new Option(placeholder)); |
el.setDisabled('noFontsAvailable', true); |
@@ -88,21 +92,21 @@ cr.define('options', function() { |
standardRangeChanged_: function(el, event) { |
var size = el.mapPositionToPref(el.value); |
var fontSampleEl = $('standard-font-sample'); |
- this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily, |
- true); |
+ this.setUpFontSample_( |
+ fontSampleEl, size, fontSampleEl.style.fontFamily, true); |
fontSampleEl = $('serif-font-sample'); |
- this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily, |
- true); |
+ this.setUpFontSample_( |
+ fontSampleEl, size, fontSampleEl.style.fontFamily, true); |
fontSampleEl = $('sans-serif-font-sample'); |
- this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily, |
- true); |
+ this.setUpFontSample_( |
+ fontSampleEl, size, fontSampleEl.style.fontFamily, true); |
fontSampleEl = $('fixed-font-sample'); |
- this.setUpFontSample_(fontSampleEl, |
- size - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, |
- fontSampleEl.style.fontFamily, false); |
+ this.setUpFontSample_( |
+ fontSampleEl, size - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, |
+ fontSampleEl.style.fontFamily, false); |
}, |
/** |
@@ -114,8 +118,8 @@ cr.define('options', function() { |
standardFontSizeChanged_: function(event) { |
var size = this.mapPositionToPref(this.value); |
Preferences.setIntegerPref( |
- 'webkit.webprefs.default_fixed_font_size', |
- size - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true); |
+ 'webkit.webprefs.default_fixed_font_size', |
+ size - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true); |
return false; |
}, |
@@ -130,8 +134,8 @@ cr.define('options', function() { |
minimumRangeChanged_: function(el, event) { |
var size = el.mapPositionToPref(el.value); |
var fontSampleEl = $('minimum-font-sample'); |
- this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily, |
- true); |
+ this.setUpFontSample_( |
+ fontSampleEl, size, fontSampleEl.style.fontFamily, true); |
}, |
/** |
@@ -143,7 +147,7 @@ cr.define('options', function() { |
minimumFontSizeChanged_: function(event) { |
var size = this.mapPositionToPref(this.value); |
Preferences.setIntegerPref( |
- 'webkit.webprefs.minimum_logical_font_size', size, true); |
+ 'webkit.webprefs.minimum_logical_font_size', size, true); |
return false; |
}, |
@@ -158,8 +162,8 @@ cr.define('options', function() { |
*/ |
setUpFontSample_: function(el, size, font, showSize) { |
var prefix = showSize ? (size + ': ') : ''; |
- el.textContent = prefix + |
- loadTimeData.getString('fontSettingsLoremIpsum'); |
+ el.textContent = |
+ prefix + loadTimeData.getString('fontSettingsLoremIpsum'); |
el.style.fontSize = size + 'px'; |
if (font) |
el.style.fontFamily = font; |
@@ -197,34 +201,34 @@ cr.define('options', function() { |
// Chrome callbacks |
FontSettings.setFontsData = function(fonts, selectedValues) { |
- FontSettings.getInstance().populateSelect_($('standard-font-family'), fonts, |
- selectedValues[0]); |
- FontSettings.getInstance().populateSelect_($('serif-font-family'), fonts, |
- selectedValues[1]); |
- FontSettings.getInstance().populateSelect_($('sans-serif-font-family'), |
- fonts, selectedValues[2]); |
- FontSettings.getInstance().populateSelect_($('fixed-font-family'), fonts, |
- selectedValues[3]); |
+ FontSettings.getInstance().populateSelect_( |
+ $('standard-font-family'), fonts, selectedValues[0]); |
+ FontSettings.getInstance().populateSelect_( |
+ $('serif-font-family'), fonts, selectedValues[1]); |
+ FontSettings.getInstance().populateSelect_( |
+ $('sans-serif-font-family'), fonts, selectedValues[2]); |
+ FontSettings.getInstance().populateSelect_( |
+ $('fixed-font-family'), fonts, selectedValues[3]); |
}; |
FontSettings.setUpStandardFontSample = function(font, size) { |
- FontSettings.getInstance().setUpFontSample_($('standard-font-sample'), size, |
- font, true); |
+ FontSettings.getInstance().setUpFontSample_( |
+ $('standard-font-sample'), size, font, true); |
}; |
FontSettings.setUpSerifFontSample = function(font, size) { |
- FontSettings.getInstance().setUpFontSample_($('serif-font-sample'), size, |
- font, true); |
+ FontSettings.getInstance().setUpFontSample_( |
+ $('serif-font-sample'), size, font, true); |
}; |
FontSettings.setUpSansSerifFontSample = function(font, size) { |
- FontSettings.getInstance().setUpFontSample_($('sans-serif-font-sample'), |
- size, font, true); |
+ FontSettings.getInstance().setUpFontSample_( |
+ $('sans-serif-font-sample'), size, font, true); |
}; |
FontSettings.setUpFixedFontSample = function(font, size) { |
- FontSettings.getInstance().setUpFontSample_($('fixed-font-sample'), |
- size, font, false); |
+ FontSettings.getInstance().setUpFontSample_( |
+ $('fixed-font-sample'), size, font, false); |
}; |
FontSettings.setUpMinimumFontSample = function(size) { |
@@ -232,8 +236,8 @@ cr.define('options', function() { |
// for the minimum logical font size. |
if (size < 6) |
size = 6; |
- FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, |
- null, true); |
+ FontSettings.getInstance().setUpFontSample_( |
+ $('minimum-font-sample'), size, null, true); |
}; |
/** |
@@ -246,7 +250,5 @@ cr.define('options', function() { |
}; |
// Export |
- return { |
- FontSettings: FontSettings |
- }; |
+ return {FontSettings: FontSettings}; |
}); |