summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 22:17:21 +0000
committerarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 22:17:21 +0000
commitee5b263d49886f4fffb92af9a79fc227927027fc (patch)
tree7ebcd66e8a6ff95c22e7dfbf71af37bc9d936815 /chrome
parent07fd407c339c5d0469da916f22c718dbbf2f6746 (diff)
downloadchromium_src-ee5b263d49886f4fffb92af9a79fc227927027fc.zip
chromium_src-ee5b263d49886f4fffb92af9a79fc227927027fc.tar.gz
chromium_src-ee5b263d49886f4fffb92af9a79fc227927027fc.tar.bz2
Old NTP: Make sure we do not try to load "undefined" for the p13n
iframe. Also, override some styles that gets set in the theme css which is written for the new new tab page. BUG=None TEST=Start chrome with --old-new-tab-page Review URL: http://codereview.chromium.org/160290 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/i18n_template.js34
-rw-r--r--chrome/browser/resources/new_tab.html9
2 files changed, 28 insertions, 15 deletions
diff --git a/chrome/browser/resources/i18n_template.js b/chrome/browser/resources/i18n_template.js
index 00289028..8166ddc 100644
--- a/chrome/browser/resources/i18n_template.js
+++ b/chrome/browser/resources/i18n_template.js
@@ -47,23 +47,29 @@ var i18nTemplate = (function() {
if (a) {
var propName = a[1];
var propExpr = a[2];
- var value = obj[propExpr];
- if (propName.charAt(0) == '.') {
- var path = propName.slice(1).split('.');
- var object = element;
- while (object && path.length > 1) {
- object = object[path.shift()];
- }
- if (object) {
- object[path] = value;
- // In case we set innerHTML (ignoring others) we need to
- // recursively check the content
- if (path == 'innerHTML') {
- process(element, obj);
+
+ // Ignore missing properties
+ if (propExpr in obj) {
+ var value = obj[propExpr];
+ if (propName.charAt(0) == '.') {
+ var path = propName.slice(1).split('.');
+ var object = element;
+ while (object && path.length > 1) {
+ object = object[path.shift()];
+ }
+ if (object) {
+ object[path] = value;
+ // In case we set innerHTML (ignoring others) we need to
+ // recursively check the content
+ if (path == 'innerHTML') {
+ process(element, obj);
+ }
}
+ } else {
+ element.setAttribute(propName, value);
}
} else {
- element.setAttribute(propName, value);
+ console.warn('i18n-values: Missing value for "' + propExpr + '"');
}
}
}
diff --git a/chrome/browser/resources/new_tab.html b/chrome/browser/resources/new_tab.html
index 50f8c1d..80bbcd6 100644
--- a/chrome/browser/resources/new_tab.html
+++ b/chrome/browser/resources/new_tab.html
@@ -435,7 +435,7 @@ document.addEventListener('DOMContentLoaded', handleDOMContentLoaded);
<td valign="top" width="230">
<div align="right">
<img src="../../app/theme/%DISTRIBUTION%/product_logo.png"
- width="145" height="52" style="padding-bottom:8px;" />
+ height="52" style="padding-bottom:8px;" />
</div>
<!-- This iframe gets shown in resizeP13N -->
<iframe id="p13n" frameborder="0" width="100%" scrolling="no" height="0"
@@ -1029,6 +1029,13 @@ html[dir='rtl'] .recent-window-container {
background-position: right;
padding-right: 22px;
}
+/* override style set in theme.css which is designed for the NNTP */
+#main {
+ background-image: none;
+}
+.section {
+ border: 0;
+}
</style>
</html>