~bjornt/lazr-js/prefetch-yui-3.5

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/dataschema/dataschema-json.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-01-14 23:32:29 UTC
  • mfrom: (197.1.7 yui-3.3.0)
  • Revision ID: launchpad@pqm.canonical.com-20110114233229-r6i4cazdiiw18o7p
Upgrade to YUI 3.3.0 [r=mars]

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.2.0
6
 
build: 2676
 
5
version: 3.3.0
 
6
build: 3167
7
7
*/
8
8
YUI.add('dataschema-json', function(Y) {
9
9
 
204
204
            var results = [],
205
205
                len = fields.length,
206
206
                i, j,
207
 
                field, key, path, parser,
 
207
                field, key, locator, path, parser,
208
208
                simplePaths = [], complexPaths = [], fieldParsers = [],
209
209
                result, record;
210
210
 
212
212
            for (i=0; i<len; i++) {
213
213
                field = fields[i]; // A field can be a simple string or a hash
214
214
                key = field.key || field; // Find the key
 
215
                locator = field.locator || key; // Find the locator
215
216
 
216
217
                // Validate and store locators for later
217
 
                path = SchemaJSON.getPath(key);
 
218
                path = SchemaJSON.getPath(locator);
218
219
                if (path) {
219
220
                    if (path.length === 1) {
220
221
                        simplePaths[simplePaths.length] = {key:key, path:path[0]};
302
303
 
303
304
 
304
305
 
305
 
}, '3.2.0' ,{requires:['json', 'dataschema-base']});
 
306
}, '3.3.0' ,{requires:['dataschema-base','json']});