OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 |
| 6 /** |
| 7 * @fileoverview Specifications for the NTP design, and an accessor to presets. |
| 8 */ |
| 9 |
| 10 |
| 11 /** |
| 12 * Specifications for an NTP design (not comprehensive). |
| 13 * |
| 14 * name: A unique identifier for the style. |
| 15 * appropriate CSS will take effect. |
| 16 * fontFamily: Font family to use for title and thumbnail <iframe>s. |
| 17 * fontSize: Font size to use for the <iframe>s, in px. |
| 18 * tileWidth: The width of each suggestion tile, in px. |
| 19 * tileMargin: Spacing between successive tiles, in px. |
| 20 * titleColor: The RRGGBB color of title text. |
| 21 * titleTextAlign: (Optional) The alignment of title text. If unspecified, the |
| 22 * default value is 'center'. |
| 23 * titleTextFade: (Optional) The number of pixels beyond which title |
| 24 * text begins to fade. This overrides the default ellipsis style. |
| 25 * thumbnailTextColor: The RRGGBB color that thumbnail <iframe> may use to |
| 26 * display text message in place of missing thumbnail. |
| 27 * |
| 28 * @typedef {{ |
| 29 * name: string, |
| 30 * fontFamily: string, |
| 31 * fontSize: number, |
| 32 * tileWidth: number, |
| 33 * tileMargin: number, |
| 34 * titleColor: string, |
| 35 * titleTextAlign: string|null|undefined, |
| 36 * titleTextFade: string|null|undefined, |
| 37 * thumbnailTextColor: string |
| 38 * }} |
| 39 */ |
| 40 var NtpDesign; |
| 41 |
| 42 /** |
| 43 * Returns an NTP design corresponding to the given name. |
| 44 * @param {string|undefined} opt_name The name of the design. If undefined, then |
| 45 * the default design is specified. |
| 46 * @return {NtpDesign} The NTP design corresponding to name. |
| 47 */ |
| 48 function getNtpDesign(opt_name) { |
| 49 // TODO(huangs): Add new style. |
| 50 return { |
| 51 name: 'classical', |
| 52 fontFamily: 'arial, sans-serif', |
| 53 fontSize: 11, |
| 54 tileWidth: 140, |
| 55 tileMargin: 20, |
| 56 titleColor: '777777', |
| 57 // No titleTextAlign: defaults to 'center'. |
| 58 // No titleTextFade: by default we have ellipsis. |
| 59 thumbnailTextColor: '777777' |
| 60 }; |
| 61 } |
OLD | NEW |