~ubuntu-branches/ubuntu/precise/maas/precise-security

« back to all changes in this revision

Viewing changes to debian/extras/jslibs/yui/dataschema-base/dataschema-base-debug.js

Tags: 1.2+bzr1373+dfsg-0ubuntu1~12.04.4
* SECURITY UPDATE: failure to authenticate downloaded content (LP: #1039513)
  - debian/patches/CVE-2013-1058.patch: Authenticate downloaded files with
    GnuPG and MD5SUM files. Thanks to Julian Edwards.
  - CVE-2013-1058
* SECURITY UPDATE: configuration options may be loaded from current working
  directory (LP: #1158425)
  - debian/patches/CVE-2013-1057-1-2.patch: Do not load configuration
    options from the current working directory. Thanks to Julian Edwards.
  - CVE-2013-1057

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.5.1 (build 22)
 
3
Copyright 2012 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
YUI.add('dataschema-base', function(Y) {
 
8
 
 
9
/**
 
10
 * The DataSchema utility provides a common configurable interface for widgets to
 
11
 * apply a given schema to a variety of data.
 
12
 *
 
13
 * @module dataschema
 
14
 * @main dataschema
 
15
 */
 
16
 
 
17
/**
 
18
 * Provides the base DataSchema implementation, which can be extended to 
 
19
 * create DataSchemas for specific data formats, such XML, JSON, text and
 
20
 * arrays.
 
21
 *
 
22
 * @module dataschema
 
23
 * @submodule dataschema-base
 
24
 */
 
25
 
 
26
var LANG = Y.Lang,
 
27
/**
 
28
 * Base class for the YUI DataSchema Utility.
 
29
 * @class DataSchema.Base
 
30
 * @static
 
31
 */
 
32
    SchemaBase = {
 
33
    /**
 
34
     * Overridable method returns data as-is.
 
35
     *
 
36
     * @method apply
 
37
     * @param schema {Object} Schema to apply.
 
38
     * @param data {Object} Data.
 
39
     * @return {Object} Schema-parsed data.
 
40
     * @static
 
41
     */
 
42
    apply: function(schema, data) {
 
43
        return data;
 
44
    },
 
45
    
 
46
    /**
 
47
     * Applies field parser, if defined
 
48
     *
 
49
     * @method parse
 
50
     * @param value {Object} Original value.
 
51
     * @param field {Object} Field.
 
52
     * @return {Object} Type-converted value.
 
53
     */
 
54
    parse: function(value, field) {
 
55
        if(field.parser) {
 
56
            var parser = (LANG.isFunction(field.parser)) ?
 
57
            field.parser : Y.Parsers[field.parser+''];
 
58
            if(parser) {
 
59
                value = parser.call(this, value);
 
60
            }
 
61
            else {
 
62
                Y.log("Could not find parser for field " + Y.dump(field), "warn", "dataschema-json");
 
63
            }
 
64
        }
 
65
        return value;
 
66
    }
 
67
};
 
68
 
 
69
Y.namespace("DataSchema").Base = SchemaBase;
 
70
Y.namespace("Parsers");
 
71
 
 
72
 
 
73
}, '3.5.1' ,{requires:['base']});