1 // Copyright (c) 2010 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.
5 // Whether we can modify the list of readers.
6 var storageEnabled = window.localStorage != null;
9 * Returns the default list of feed readers.
11 function defaultReaderList() {
12 // This is the default list, unless replaced by what was saved previously.
14 { 'url': 'http://www.bloglines.com/login?r=/sub/%s',
15 'description': 'Bloglines'
17 { 'url': 'http://add.my.yahoo.com/rss?url=%s',
18 'description': 'My Yahoo'
24 * Check to see if the current item is set as default reader.
26 function isDefaultReader(url) {
27 defaultReader = window.localStorage.defaultReader ?
28 window.localStorage.defaultReader : "";
29 return url == defaultReader;
33 * Find an element with |id| and replace the text of it with i18n message with
36 function i18nReplaceImpl(id, msg, attribute) {
37 var element = document.getElementById(id);
40 element.setAttribute(attribute, chrome.i18n.getMessage(msg));
42 element.innerText = chrome.i18n.getMessage(msg);
47 * Same as i18nReplaceImpl but provided for convenience for elements that have
48 * the same id as the i18n message id.
50 function i18nReplace(msg) {
51 i18nReplaceImpl(msg, msg, '');