Bug 26450: (QA follow-up) Replace tabs with spaces
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / select2.inc
1 [% USE raw %]
2 [% USE Asset %]
3 [% Asset.js("lib/select2/js/select2.min.js") | $raw %]
4 [% Asset.css("lib/select2/css/select2.min.css") | $raw %]
5 [% Asset.css("css/select2.css") | $raw %]
6 <!-- select2.inc -->
7 <script>
8   jQuery.extend($.fn.select2.defaults, {
9     allowClear: true,
10     width: function() {
11       var width = this.element.outerWidth();
12
13       // 18 is the width of .select2-arrow
14       width -= 18;
15
16       if (this.allowClear) {
17         // 42 is the margin-right of .select2-chosen when allowClear is true
18         width += 42;
19       } else {
20         // 26 is the margin-right of .select2-chosen when allowClear is false
21         width += 26;
22       }
23
24       return width;
25     },
26
27     // Internationalization
28     formatMatches: function (matches) {
29       if (matches === 1) {
30         return _("One result is available, press enter to select it.");
31       }
32       return _("%s results are available, use up and down arrow keys to navigate.").format(matches);
33     },
34     formatNoMatches: function () {
35       return _("No matches found");
36     },
37     formatInputTooShort: function (input, min) {
38       var n = min - input.length;
39       return _("Please enter %n or more characters").format(n);
40     },
41     formatInputTooLong: function (input, max) {
42       var n = input.length - max;
43       return _("Please delete %d character(s)").format(n);
44     },
45     formatSelectionTooBig: function (limit) {
46       return _("You can only select %s item(s)").format(limit);
47     },
48     formatLoadMore: function (pageNumber) {
49       return _("Loading more results…");
50     },
51     formatSearching: function () {
52       return _("Searching…");
53     }
54   });
55 </script>
56 <!-- / select2.inc -->