Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
YUI.add('datatable-paginator-templates', function (Y, NAME) {
2
 
3
var engine = new Y.Template(),
4
 
5
/*
6
{
7
    wrapperClass,
8
    numOfCols
9
}
10
*/
11
rowWrapper = '<tr><td class="<%= this.wrapperClass %>" colspan="' +
12
             '<%= this.numOfCols %>"/></tr>',
13
 
14
/*
15
{
16
    classNames: {}
17
}
18
*/
19
content = '<%= buttons %><%= this.classNames.gotoPage %>' +
20
          '<%= this.classNames.perPage %>',
21
 
22
/*
23
{
24
    classNames: {},
25
    type,
26
    label
27
}
28
*/
29
button = '<button class="<%= this.classNames.control %> ' +
30
         '<%= this.classNames.control %>-<%= this.type %>" ' +
31
         'data-type="<%= this.type %>"><%= this.label %></button>',
32
 
33
/*
34
{
35
    classNames,
36
    buttons: [
37
        { type, label }
38
    ]
39
}
40
*/
41
buttons = '<div class="<%= this.classNames.controls %> <%= this.classNames.group %>">' +
42
            '<%== this.buttons %>' +
43
        '</div>',
44
 
45
/*
46
{
47
    classNames,
48
    strings,
49
    page
50
}
51
*/
52
gotoPage = '<form action="#" class="<%= this.classNames.group %>">' +
53
                '<label><%= this.strings.goToLabel %>' +
54
                '<input type="text" value="<%= this.page %>">' +
55
                '<button><%= this.strings.goToAction %></button>' +
56
                '</label>' +
57
            '</form>',
58
 
59
/*
60
{
61
    classNames,
62
    strings,
63
    options
64
}
65
*/
66
perPage = '<div class="<%= this.classNames.group %> <%= this.classNames.perPage %>">' +
67
                '<label><%= this.strings.perPage %> <select>' +
68
                '<% Y.Array.each(this.options, function (option, i) { %>' +
69
                    '<option value="<%= option.value %>" <%= option.selected %>>' +
70
                    '<%= option.label %></option>'+
71
                '<% }); %>' +
72
            '</select></label></div>';
73
 
74
 
75
 
76
 
77
Y.namespace('DataTable.Templates').Paginator = {
78
    rowWrapper: engine.compile(rowWrapper),
79
    button: engine.compile(button),
80
    content: engine.compile(content),
81
    buttons: engine.compile(buttons),
82
    gotoPage: engine.compile(gotoPage),
83
    perPage: engine.compile(perPage)
84
};
85
 
86
 
87
}, '3.18.1', {"requires": ["template"]});