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