Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: chrome/third_party/jstemplate/jstemplate_compiled.js

Issue 71005: Merge 13114 - Make the font family and the font size used in dom UI localizab... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/third_party/jstemplate/jstemplate.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/third_party/jstemplate/jstemplate_compiled.js
===================================================================
--- chrome/third_party/jstemplate/jstemplate_compiled.js (revision 13559)
+++ chrome/third_party/jstemplate/jstemplate_compiled.js (working copy)
@@ -1105,8 +1105,17 @@
context.setVariable(label, value);
} else if (label.charAt(0) == '.') {
- template[label.substr(1)] = value;
-
+ var nameSpaceLabel = label.substr(1).split('.');
+ var nameSpaceObject = template;
+ var nameSpaceDepth = jsLength(nameSpaceLabel);
+ for (var j = 0, J = nameSpaceDepth - 1; j < J; ++j) {
+ var jLabel = nameSpaceLabel[j];
+ if (!nameSpaceObject[jLabel]) {
+ nameSpaceObject[jLabel] = {};
+ }
+ nameSpaceObject = nameSpaceObject[jLabel];
+ }
+ nameSpaceObject[nameSpaceLabel[nameSpaceDepth - 1]] = value;
} else if (label) {
if (typeof value == 'boolean') {
if (value) {
« no previous file with comments | « chrome/third_party/jstemplate/jstemplate.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698