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" />
5 jQuery.extend($.fn.select2.defaults, {
8 var width = this.element.outerWidth();
10 // 18 is the width of .select2-arrow
13 if (this.allowClear) {
14 // 42 is the margin-right of .select2-chosen when allowClear is true
17 // 26 is the margin-right of .select2-chosen when allowClear is false
24 // Internationalization
25 formatMatches: function (matches) {
27 return _("One result is available, press enter to select it.");
29 return _("%s results are available, use up and down arrow keys to navigate.").format(matches);
31 formatNoMatches: function () {
32 return _("No matches found");
34 formatInputTooShort: function (input, min) {
35 var n = min - input.length;
36 return _("Please enter %n or more characters").format(n);
38 formatInputTooLong: function (input, max) {
39 var n = input.length - max;
40 return _("Please delete %d character(s)").format(n);
42 formatSelectionTooBig: function (limit) {
43 return _("You can only select %s item(s)").format(limit);
45 formatLoadMore: function (pageNumber) {
46 return _("Loading more results…");
48 formatSearching: function () {
49 return _("Searching…");