NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / datatable-paginator-templates / datatable-paginator-templates.js
blob5b61bbfcf1d5bc4a2935078b1d12e73d7a74a285
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('datatable-paginator-templates', function (Y, NAME) {
10 var engine = new Y.Template(),
14     wrapperClass,
15     numOfCols
18 rowWrapper = '<tr><td class="<%= this.wrapperClass %>" colspan="' +
19              '<%= this.numOfCols %>"/></tr>',
23     classNames: {}
26 content = '<%= buttons %><%= this.classNames.gotoPage %>' +
27           '<%= this.classNames.perPage %>',
31     classNames: {},
32     type,
33     label
36 button = '<button class="<%= this.classNames.control %> ' +
37          '<%= this.classNames.control %>-<%= this.type %>" ' +
38          'data-type="<%= this.type %>"><%= this.label %></button>',
42     classNames,
43     buttons: [
44         { type, label }
45     ]
48 buttons = '<div class="<%= this.classNames.controls %> <%= this.classNames.group %>">' +
49             '<%== this.buttons %>' +
50         '</div>',
54     classNames,
55     strings,
56     page
59 gotoPage = '<form action="#" class="<%= this.classNames.group %>">' +
60                 '<label><%= this.strings.goToLabel %>' +
61                 '<input type="text" value="<%= this.page %>">' +
62                 '<button><%= this.strings.goToAction %></button>' +
63                 '</label>' +
64             '</form>',
68     classNames,
69     strings,
70     options
73 perPage = '<div class="<%= this.classNames.group %> <%= this.classNames.perPage %>">' +
74                 '<label><%= this.strings.perPage %> <select>' +
75                 '<% Y.Array.each(this.options, function (option, i) { %>' +
76                     '<option value="<%= option.value %>" <%= option.selected %>>' +
77                     '<%= option.label %></option>'+
78                 '<% }); %>' +
79             '</select></label></div>';
84 Y.namespace('DataTable.Templates').Paginator = {
85     rowWrapper: engine.compile(rowWrapper),
86     button: engine.compile(button),
87     content: engine.compile(content),
88     buttons: engine.compile(buttons),
89     gotoPage: engine.compile(gotoPage),
90     perPage: engine.compile(perPage)
94 }, '3.13.0', {"requires": ["template"]});