1. 首先需要下載select2的插件, 將其放入到對應的js目錄下和css目錄下
select2.min.js

1 /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 !function (a) { 3 "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof module && module.exports ? module.exports = function (b, c) { 4 return void 0 === c && (c = "undefined" != typeof window ? require("jquery") : require("jquery")(b)), a(c), c 5 } : a(jQuery) 6 }(function (a) { 7 var b = function () { 8 if (a && a.fn && a.fn.select2 && a.fn.select2.amd) var b = a.fn.select2.amd; 9 var b; 10 return function () { 11 if (!b || !b.requirejs) { 12 b ? c = b : b = {}; 13 var a, c, d; 14 !function (b) { 15 function e(a, b) { 16 return v.call(a, b) 17 } 18 19 function f(a, b) { 20 var c, d, e, f, g, h, i, j, k, l, m, n, o = b && b.split("/"), p = t.map, q = p && p["*"] || {}; 21 if (a) { 22 for (a = a.split("/"), g = a.length - 1, t.nodeIdCompat && x.test(a[g]) && (a[g] = a[g].replace(x, "")), "." === a[0].charAt(0) && o && (n = o.slice(0, o.length - 1), a = n.concat(a)), k = 0; k < a.length; k++) if ("." === (m = a[k])) a.splice(k, 1), k -= 1; else if (".." === m) { 23 if (0 === k || 1 === k && ".." === a[2] || ".." === a[k - 1]) continue; 24 k > 0 && (a.splice(k - 1, 2), k -= 2) 25 } 26 a = a.join("/") 27 } 28 if ((o || q) && p) { 29 for (c = a.split("/"), k = c.length; k > 0; k -= 1) { 30 if (d = c.slice(0, k).join("/"), o) for (l = o.length; l > 0; l -= 1) if ((e = p[o.slice(0, l).join("/")]) && (e = e[d])) { 31 f = e, h = k; 32 break 33 } 34 if (f) break; 35 !i && q && q[d] && (i = q[d], j = k) 36 } 37 !f && i && (f = i, h = j), f && (c.splice(0, h, f), a = c.join("/")) 38 } 39 return a 40 } 41 42 function g(a, c) { 43 return function () { 44 var d = w.call(arguments, 0); 45 return "string" != typeof d[0] && 1 === d.length && d.push(null), o.apply(b, d.concat([a, c])) 46 } 47 } 48 49 function h(a) { 50 return function (b) { 51 return f(b, a) 52 } 53 } 54 55 function i(a) { 56 return function (b) { 57 r[a] = b 58 } 59 } 60 61 function j(a) { 62 if (e(s, a)) { 63 var c = s[a]; 64 delete s[a], u[a] = !0, n.apply(b, c) 65 } 66 if (!e(r, a) && !e(u, a)) throw new Error("No " + a); 67 return r[a] 68 } 69 70 function k(a) { 71 var b, c = a ? a.indexOf("!") : -1; 72 return c > -1 && (b = a.substring(0, c), a = a.substring(c + 1, a.length)), [b, a] 73 } 74 75 function l(a) { 76 return a ? k(a) : [] 77 } 78 79 function m(a) { 80 return function () { 81 return t && t.config && t.config[a] || {} 82 } 83 } 84 85 var n, o, p, q, r = {}, s = {}, t = {}, u = {}, v = Object.prototype.hasOwnProperty, w = [].slice, 86 x = /\.js$/; 87 p = function (a, b) { 88 var c, d = k(a), e = d[0], g = b[1]; 89 return a = d[1], e && (e = f(e, g), c = j(e)), e ? a = c && c.normalize ? c.normalize(a, h(g)) : f(a, g) : (a = f(a, g), d = k(a), e = d[0], a = d[1], e && (c = j(e))), { 90 f: e ? e + "!" + a : a, 91 n: a, 92 pr: e, 93 p: c 94 } 95 }, q = { 96 require: function (a) { 97 return g(a) 98 }, exports: function (a) { 99 var b = r[a]; 100 return void 0 !== b ? b : r[a] = {} 101 }, module: function (a) { 102 return {id: a, uri: "", exports: r[a], config: m(a)} 103 } 104 }, n = function (a, c, d, f) { 105 var h, k, m, n, o, t, v, w = [], x = typeof d; 106 if (f = f || a, t = l(f), "undefined" === x || "function" === x) { 107 for (c = !c.length && d.length ? ["require", "exports", "module"] : c, o = 0; o < c.length; o += 1) if (n = p(c[o], t), "require" === (k = n.f)) w[o] = q.require(a); else if ("exports" === k) w[o] = q.exports(a), v = !0; else if ("module" === k) h = w[o] = q.module(a); else if (e(r, k) || e(s, k) || e(u, k)) w[o] = j(k); else { 108 if (!n.p) throw new Error(a + " missing " + k); 109 n.p.load(n.n, g(f, !0), i(k), {}), w[o] = r[k] 110 } 111 m = d ? d.apply(r[a], w) : void 0, a && (h && h.exports !== b && h.exports !== r[a] ? r[a] = h.exports : m === b && v || (r[a] = m)) 112 } else a && (r[a] = d) 113 }, a = c = o = function (a, c, d, e, f) { 114 if ("string" == typeof a) return q[a] ? q[a](c) : j(p(a, l(c)).f); 115 if (!a.splice) { 116 if (t = a, t.deps && o(t.deps, t.callback), !c) return; 117 c.splice ? (a = c, c = d, d = null) : a = b 118 } 119 return c = c || function () { 120 }, "function" == typeof d && (d = e, e = f), e ? n(b, a, c, d) : setTimeout(function () { 121 n(b, a, c, d) 122 }, 4), o 123 }, o.config = function (a) { 124 return o(a) 125 }, a._defined = r, d = function (a, b, c) { 126 if ("string" != typeof a) throw new Error("See almond README: incorrect module build, no module name"); 127 b.splice || (c = b, b = []), e(r, a) || e(s, a) || (s[a] = [a, b, c]) 128 }, d.amd = {jQuery: !0} 129 }(), b.requirejs = a, b.require = c, b.define = d 130 } 131 }(), b.define("almond", function () { 132 }), b.define("jquery", [], function () { 133 var b = a || $; 134 return null == b && console && console.error && console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."), b 135 }), b.define("select2/utils", ["jquery"], function (a) { 136 function b(a) { 137 var b = a.prototype, c = []; 138 for (var d in b) { 139 "function" == typeof b[d] && ("constructor" !== d && c.push(d)) 140 } 141 return c 142 } 143 144 var c = {}; 145 c.Extend = function (a, b) { 146 function c() { 147 this.constructor = a 148 } 149 150 var d = {}.hasOwnProperty; 151 for (var e in b) d.call(b, e) && (a[e] = b[e]); 152 return c.prototype = b.prototype, a.prototype = new c, a.__super__ = b.prototype, a 153 }, c.Decorate = function (a, c) { 154 function d() { 155 var b = Array.prototype.unshift, d = c.prototype.constructor.length, e = a.prototype.constructor; 156 d > 0 && (b.call(arguments, a.prototype.constructor), e = c.prototype.constructor), e.apply(this, arguments) 157 } 158 159 function e() { 160 this.constructor = d 161 } 162 163 var f = b(c), g = b(a); 164 c.displayName = a.displayName, d.prototype = new e; 165 for (var h = 0; h < g.length; h++) { 166 var i = g[h]; 167 d.prototype[i] = a.prototype[i] 168 } 169 for (var j = (function (a) { 170 var b = function () { 171 }; 172 a in d.prototype && (b = d.prototype[a]); 173 var e = c.prototype[a]; 174 return function () { 175 return Array.prototype.unshift.call(arguments, b), e.apply(this, arguments) 176 } 177 }), k = 0; k < f.length; k++) { 178 var l = f[k]; 179 d.prototype[l] = j(l) 180 } 181 return d 182 }; 183 var d = function () { 184 this.listeners = {} 185 }; 186 d.prototype.on = function (a, b) { 187 this.listeners = this.listeners || {}, a in this.listeners ? this.listeners[a].push(b) : this.listeners[a] = [b] 188 }, d.prototype.trigger = function (a) { 189 var b = Array.prototype.slice, c = b.call(arguments, 1); 190 this.listeners = this.listeners || {}, null == c && (c = []), 0 === c.length && c.push({}), c[0]._type = a, a in this.listeners && this.invoke(this.listeners[a], b.call(arguments, 1)), "*" in this.listeners && this.invoke(this.listeners["*"], arguments) 191 }, d.prototype.invoke = function (a, b) { 192 for (var c = 0, d = a.length; c < d; c++) a[c].apply(this, b) 193 }, c.Observable = d, c.generateChars = function (a) { 194 for (var b = "", c = 0; c < a; c++) { 195 b += Math.floor(36 * Math.random()).toString(36) 196 } 197 return b 198 }, c.bind = function (a, b) { 199 return function () { 200 a.apply(b, arguments) 201 } 202 }, c._convertData = function (a) { 203 for (var b in a) { 204 var c = b.split("-"), d = a; 205 if (1 !== c.length) { 206 for (var e = 0; e < c.length; e++) { 207 var f = c[e]; 208 f = f.substring(0, 1).toLowerCase() + f.substring(1), f in d || (d[f] = {}), e == c.length - 1 && (d[f] = a[b]), d = d[f] 209 } 210 delete a[b] 211 } 212 } 213 return a 214 }, c.hasScroll = function (b, c) { 215 var d = a(c), e = c.style.overflowX, f = c.style.overflowY; 216 return (e !== f || "hidden" !== f && "visible" !== f) && ("scroll" === e || "scroll" === f || (d.innerHeight() < c.scrollHeight || d.innerWidth() < c.scrollWidth)) 217 }, c.escapeMarkup = function (a) { 218 var b = { 219 "\\": "\", 220 "&": "&", 221 "<": "<", 222 ">": ">", 223 '"': """, 224 "'": "'", 225 "/": "/" 226 }; 227 return "string" != typeof a ? a : String(a).replace(/[&<>"'\/\\]/g, function (a) { 228 return b[a] 229 }) 230 }, c.appendMany = function (b, c) { 231 if ("1.7" === a.fn.jquery.substr(0, 3)) { 232 var d = a(); 233 a.map(c, function (a) { 234 d = d.add(a) 235 }), c = d 236 } 237 b.append(c) 238 }, c.__cache = {}; 239 var e = 0; 240 return c.GetUniqueElementId = function (a) { 241 var b = a.getAttribute("data-select2-id"); 242 return null == b && (a.id ? (b = a.id, a.setAttribute("data-select2-id", b)) : (a.setAttribute("data-select2-id", ++e), b = e.toString())), b 243 }, c.StoreData = function (a, b, d) { 244 var e = c.GetUniqueElementId(a); 245 c.__cache[e] || (c.__cache[e] = {}), c.__cache[e][b] = d 246 }, c.GetData = function (b, d) { 247 var e = c.GetUniqueElementId(b); 248 return d ? c.__cache[e] && null != c.__cache[e][d] ? c.__cache[e][d] : a(b).data(d) : c.__cache[e] 249 }, c.RemoveData = function (a) { 250 var b = c.GetUniqueElementId(a); 251 null != c.__cache[b] && delete c.__cache[b] 252 }, c 253 }), b.define("select2/results", ["jquery", "./utils"], function (a, b) { 254 function c(a, b, d) { 255 this.$element = a, this.data = d, this.options = b, c.__super__.constructor.call(this) 256 } 257 258 return b.Extend(c, b.Observable), c.prototype.render = function () { 259 var b = a('<ul class="select2-results__options" role="tree"></ul>'); 260 return this.options.get("multiple") && b.attr("aria-multiselectable", "true"), this.$results = b, b 261 }, c.prototype.clear = function () { 262 this.$results.empty() 263 }, c.prototype.displayMessage = function (b) { 264 var c = this.options.get("escapeMarkup"); 265 this.clear(), this.hideLoading(); 266 var d = a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'), 267 e = this.options.get("translations").get(b.message); 268 d.append(c(e(b.args))), d[0].className += " select2-results__message", this.$results.append(d) 269 }, c.prototype.hideMessages = function () { 270 this.$results.find(".select2-results__message").remove() 271 }, c.prototype.append = function (a) { 272 this.hideLoading(); 273 var b = []; 274 if (null == a.results || 0 === a.results.length) return void(0 === this.$results.children().length && this.trigger("results:message", {message: "noResults"})); 275 a.results = this.sort(a.results); 276 for (var c = 0; c < a.results.length; c++) { 277 var d = a.results[c], e = this.option(d); 278 b.push(e) 279 } 280 this.$results.append(b) 281 }, c.prototype.position = function (a, b) { 282 b.find(".select2-results").append(a) 283 }, c.prototype.sort = function (a) { 284 return this.options.get("sorter")(a) 285 }, c.prototype.highlightFirstItem = function () { 286 var a = this.$results.find(".select2-results__option[aria-selected]"), 287 b = a.filter("[aria-selected=true]"); 288 b.length > 0 ? b.first().trigger("mouseenter") : a.first().trigger("mouseenter"), this.ensureHighlightVisible() 289 }, c.prototype.setClasses = function () { 290 var c = this; 291 this.data.current(function (d) { 292 var e = a.map(d, function (a) { 293 return a.id.toString() 294 }); 295 c.$results.find(".select2-results__option[aria-selected]").each(function () { 296 var c = a(this), d = b.GetData(this, "data"), f = "" + d.id; 297 null != d.element && d.element.selected || null == d.element && a.inArray(f, e) > -1 ? c.attr("aria-selected", "true") : c.attr("aria-selected", "false") 298 }) 299 }) 300 }, c.prototype.showLoading = function (a) { 301 this.hideLoading(); 302 var b = this.options.get("translations").get("searching"), c = {disabled: !0, loading: !0, text: b(a)}, 303 d = this.option(c); 304 d.className += " loading-results", this.$results.prepend(d) 305 }, c.prototype.hideLoading = function () { 306 this.$results.find(".loading-results").remove() 307 }, c.prototype.option = function (c) { 308 var d = document.createElement("li"); 309 d.className = "select2-results__option"; 310 var e = {role: "treeitem", "aria-selected": "false"}; 311 c.disabled && (delete e["aria-selected"], e["aria-disabled"] = "true"), null == c.id && delete e["aria-selected"], null != c._resultId && (d.id = c._resultId), c.title && (d.title = c.title), c.children && (e.role = "group", e["aria-label"] = c.text, delete e["aria-selected"]); 312 for (var f in e) { 313 var g = e[f]; 314 d.setAttribute(f, g) 315 } 316 if (c.children) { 317 var h = a(d), i = document.createElement("strong"); 318 i.className = "select2-results__group"; 319 a(i); 320 this.template(c, i); 321 for (var j = [], k = 0; k < c.children.length; k++) { 322 var l = c.children[k], m = this.option(l); 323 j.push(m) 324 } 325 var n = a("<ul></ul>", {class: "select2-results__options select2-results__options--nested"}); 326 n.append(j), h.append(i), h.append(n) 327 } else this.template(c, d); 328 return b.StoreData(d, "data", c), d 329 }, c.prototype.bind = function (c, d) { 330 var e = this, f = c.id + "-results"; 331 this.$results.attr("id", f), c.on("results:all", function (a) { 332 e.clear(), e.append(a.data), c.isOpen() && (e.setClasses(), e.highlightFirstItem()) 333 }), c.on("results:append", function (a) { 334 e.append(a.data), c.isOpen() && e.setClasses() 335 }), c.on("query", function (a) { 336 e.hideMessages(), e.showLoading(a) 337 }), c.on("select", function () { 338 c.isOpen() && (e.setClasses(), e.options.get("scrollAfterSelect") && e.highlightFirstItem()) 339 }), c.on("unselect", function () { 340 c.isOpen() && (e.setClasses(), e.options.get("scrollAfterSelect") && e.highlightFirstItem()) 341 }), c.on("open", function () { 342 e.$results.attr("aria-expanded", "true"), e.$results.attr("aria-hidden", "false"), e.setClasses(), e.ensureHighlightVisible() 343 }), c.on("close", function () { 344 e.$results.attr("aria-expanded", "false"), e.$results.attr("aria-hidden", "true"), e.$results.removeAttr("aria-activedescendant") 345 }), c.on("results:toggle", function () { 346 var a = e.getHighlightedResults(); 347 0 !== a.length && a.trigger("mouseup") 348 }), c.on("results:select", function () { 349 var a = e.getHighlightedResults(); 350 if (0 !== a.length) { 351 var c = b.GetData(a[0], "data"); 352 "true" == a.attr("aria-selected") ? e.trigger("close", {}) : e.trigger("select", {data: c}) 353 } 354 }), c.on("results:previous", function () { 355 var a = e.getHighlightedResults(), b = e.$results.find("[aria-selected]"), c = b.index(a); 356 if (!(c <= 0)) { 357 var d = c - 1; 358 0 === a.length && (d = 0); 359 var f = b.eq(d); 360 f.trigger("mouseenter"); 361 var g = e.$results.offset().top, h = f.offset().top, i = e.$results.scrollTop() + (h - g); 362 0 === d ? e.$results.scrollTop(0) : h - g < 0 && e.$results.scrollTop(i) 363 } 364 }), c.on("results:next", function () { 365 var a = e.getHighlightedResults(), b = e.$results.find("[aria-selected]"), c = b.index(a), 366 d = c + 1; 367 if (!(d >= b.length)) { 368 var f = b.eq(d); 369 f.trigger("mouseenter"); 370 var g = e.$results.offset().top + e.$results.outerHeight(!1), 371 h = f.offset().top + f.outerHeight(!1), i = e.$results.scrollTop() + h - g; 372 0 === d ? e.$results.scrollTop(0) : h > g && e.$results.scrollTop(i) 373 } 374 }), c.on("results:focus", function (a) { 375 a.element.addClass("select2-results__option--highlighted") 376 }), c.on("results:message", function (a) { 377 e.displayMessage(a) 378 }), a.fn.mousewheel && this.$results.on("mousewheel", function (a) { 379 var b = e.$results.scrollTop(), c = e.$results.get(0).scrollHeight - b + a.deltaY, 380 d = a.deltaY > 0 && b - a.deltaY <= 0, f = a.deltaY < 0 && c <= e.$results.height(); 381 d ? (e.$results.scrollTop(0), a.preventDefault(), a.stopPropagation()) : f && (e.$results.scrollTop(e.$results.get(0).scrollHeight - e.$results.height()), a.preventDefault(), a.stopPropagation()) 382 }), this.$results.on("mouseup", ".select2-results__option[aria-selected]", function (c) { 383 var d = a(this), f = b.GetData(this, "data"); 384 if ("true" === d.attr("aria-selected")) return void(e.options.get("multiple") ? e.trigger("unselect", { 385 originalEvent: c, 386 data: f 387 }) : e.trigger("close", {})); 388 e.trigger("select", {originalEvent: c, data: f}) 389 }), this.$results.on("mouseenter", ".select2-results__option[aria-selected]", function (c) { 390 var d = b.GetData(this, "data"); 391 e.getHighlightedResults().removeClass("select2-results__option--highlighted"), e.trigger("results:focus", { 392 data: d, 393 element: a(this) 394 }) 395 }) 396 }, c.prototype.getHighlightedResults = function () { 397 return this.$results.find(".select2-results__option--highlighted") 398 }, c.prototype.destroy = function () { 399 this.$results.remove() 400 }, c.prototype.ensureHighlightVisible = function () { 401 var a = this.getHighlightedResults(); 402 if (0 !== a.length) { 403 var b = this.$results.find("[aria-selected]"), c = b.index(a), d = this.$results.offset().top, 404 e = a.offset().top, f = this.$results.scrollTop() + (e - d), g = e - d; 405 f -= 2 * a.outerHeight(!1), c <= 2 ? this.$results.scrollTop(0) : (g > this.$results.outerHeight() || g < 0) && this.$results.scrollTop(f) 406 } 407 }, c.prototype.template = function (b, c) { 408 var d = this.options.get("templateResult"), e = this.options.get("escapeMarkup"), f = d(b, c); 409 null == f ? c.style.display = "none" : "string" == typeof f ? c.innerHTML = e(f) : a(c).append(f) 410 }, c 411 }), b.define("select2/keys", [], function () { 412 return { 413 BACKSPACE: 8, 414 TAB: 9, 415 ENTER: 13, 416 SHIFT: 16, 417 CTRL: 17, 418 ALT: 18, 419 ESC: 27, 420 SPACE: 32, 421 PAGE_UP: 33, 422 PAGE_DOWN: 34, 423 END: 35, 424 HOME: 36, 425 LEFT: 37, 426 UP: 38, 427 RIGHT: 39, 428 DOWN: 40, 429 DELETE: 46 430 } 431 }), b.define("select2/selection/base", ["jquery", "../utils", "../keys"], function (a, b, c) { 432 function d(a, b) { 433 this.$element = a, this.options = b, d.__super__.constructor.call(this) 434 } 435 436 return b.Extend(d, b.Observable), d.prototype.render = function () { 437 var c = a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>'); 438 return this._tabindex = 0, null != b.GetData(this.$element[0], "old-tabindex") ? this._tabindex = b.GetData(this.$element[0], "old-tabindex") : null != this.$element.attr("tabindex") && (this._tabindex = this.$element.attr("tabindex")), c.attr("title", this.$element.attr("title")), c.attr("tabindex", this._tabindex), this.$selection = c, c 439 }, d.prototype.bind = function (a, b) { 440 var d = this, e = (a.id, a.id + "-results"); 441 this.container = a, this.$selection.on("focus", function (a) { 442 d.trigger("focus", a) 443 }), this.$selection.on("blur", function (a) { 444 d._handleBlur(a) 445 }), this.$selection.on("keydown", function (a) { 446 d.trigger("keypress", a), a.which === c.SPACE && a.preventDefault() 447 }), a.on("results:focus", function (a) { 448 d.$selection.attr("aria-activedescendant", a.data._resultId) 449 }), a.on("selection:update", function (a) { 450 d.update(a.data) 451 }), a.on("open", function () { 452 d.$selection.attr("aria-expanded", "true"), d.$selection.attr("aria-owns", e), d._attachCloseHandler(a) 453 }), a.on("close", function () { 454 d.$selection.attr("aria-expanded", "false"), d.$selection.removeAttr("aria-activedescendant"), d.$selection.removeAttr("aria-owns"), window.setTimeout(function () { 455 d.$selection.focus() 456 }, 0), d._detachCloseHandler(a) 457 }), a.on("enable", function () { 458 d.$selection.attr("tabindex", d._tabindex) 459 }), a.on("disable", function () { 460 d.$selection.attr("tabindex", "-1") 461 }) 462 }, d.prototype._handleBlur = function (b) { 463 var c = this; 464 window.setTimeout(function () { 465 document.activeElement == c.$selection[0] || a.contains(c.$selection[0], document.activeElement) || c.trigger("blur", b) 466 }, 1) 467 }, d.prototype._attachCloseHandler = function (c) { 468 a(document.body).on("mousedown.select2." + c.id, function (c) { 469 var d = a(c.target), e = d.closest(".select2"); 470 a(".select2.select2-container--open").each(function () { 471 a(this), this != e[0] && b.GetData(this, "element").select2("close") 472 }) 473 }) 474 }, d.prototype._detachCloseHandler = function (b) { 475 a(document.body).off("mousedown.select2." + b.id) 476 }, d.prototype.position = function (a, b) { 477 b.find(".selection").append(a) 478 }, d.prototype.destroy = function () { 479 this._detachCloseHandler(this.container) 480 }, d.prototype.update = function (a) { 481 throw new Error("The `update` method must be defined in child classes.") 482 }, d 483 }), b.define("select2/selection/single", ["jquery", "./base", "../utils", "../keys"], function (a, b, c, d) { 484 function e() { 485 e.__super__.constructor.apply(this, arguments) 486 } 487 488 return c.Extend(e, b), e.prototype.render = function () { 489 var a = e.__super__.render.call(this); 490 return a.addClass("select2-selection--single"), a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'), a 491 }, e.prototype.bind = function (a, b) { 492 var c = this; 493 e.__super__.bind.apply(this, arguments); 494 var d = a.id + "-container"; 495 this.$selection.find(".select2-selection__rendered").attr("id", d).attr("role", "textbox").attr("aria-readonly", "true"), this.$selection.attr("aria-labelledby", d), this.$selection.on("mousedown", function (a) { 496 1 === a.which && c.trigger("toggle", {originalEvent: a}) 497 }), this.$selection.on("focus", function (a) { 498 }), this.$selection.on("blur", function (a) { 499 }), a.on("focus", function (b) { 500 a.isOpen() || c.$selection.focus() 501 }) 502 }, e.prototype.clear = function () { 503 var a = this.$selection.find(".select2-selection__rendered"); 504 a.empty(), a.removeAttr("title") 505 }, e.prototype.display = function (a, b) { 506 var c = this.options.get("templateSelection"); 507 return this.options.get("escapeMarkup")(c(a, b)) 508 }, e.prototype.selectionContainer = function () { 509 return a("<span></span>") 510 }, e.prototype.update = function (a) { 511 if (0 === a.length) return void this.clear(); 512 var b = a[0], c = this.$selection.find(".select2-selection__rendered"), d = this.display(b, c); 513 c.empty().append(d), c.attr("title", b.title || b.text) 514 }, e 515 }), b.define("select2/selection/multiple", ["jquery", "./base", "../utils"], function (a, b, c) { 516 function d(a, b) { 517 d.__super__.constructor.apply(this, arguments) 518 } 519 520 return c.Extend(d, b), d.prototype.render = function () { 521 var a = d.__super__.render.call(this); 522 return a.addClass("select2-selection--multiple"), a.html('<ul class="select2-selection__rendered"></ul>'), a 523 }, d.prototype.bind = function (b, e) { 524 var f = this; 525 d.__super__.bind.apply(this, arguments), this.$selection.on("click", function (a) { 526 f.trigger("toggle", {originalEvent: a}) 527 }), this.$selection.on("click", ".select2-selection__choice__remove", function (b) { 528 if (!f.options.get("disabled")) { 529 var d = a(this), e = d.parent(), g = c.GetData(e[0], "data"); 530 f.trigger("unselect", {originalEvent: b, data: g}) 531 } 532 }) 533 }, d.prototype.clear = function () { 534 var a = this.$selection.find(".select2-selection__rendered"); 535 a.empty(), a.removeAttr("title") 536 }, d.prototype.display = function (a, b) { 537 var c = this.options.get("templateSelection"); 538 return this.options.get("escapeMarkup")(c(a, b)) 539 }, d.prototype.selectionContainer = function () { 540 return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>') 541 }, d.prototype.update = function (a) { 542 if (this.clear(), 0 !== a.length) { 543 for (var b = [], d = 0; d < a.length; d++) { 544 var e = a[d], f = this.selectionContainer(), g = this.display(e, f); 545 f.append(g), f.attr("title", e.title || e.text), c.StoreData(f[0], "data", e), b.push(f) 546 } 547 var h = this.$selection.find(".select2-selection__rendered"); 548 c.appendMany(h, b) 549 } 550 }, d 551 }), b.define("select2/selection/placeholder", ["../utils"], function (a) { 552 function b(a, b, c) { 553 this.placeholder = this.normalizePlaceholder(c.get("placeholder")), a.call(this, b, c) 554 } 555 556 return b.prototype.normalizePlaceholder = function (a, b) { 557 return "string" == typeof b && (b = {id: "", text: b}), b 558 }, b.prototype.createPlaceholder = function (a, b) { 559 var c = this.selectionContainer(); 560 return c.html(this.display(b)), c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"), c 561 }, b.prototype.update = function (a, b) { 562 var c = 1 == b.length && b[0].id != this.placeholder.id; 563 if (b.length > 1 || c) return a.call(this, b); 564 this.clear(); 565 var d = this.createPlaceholder(this.placeholder); 566 this.$selection.find(".select2-selection__rendered").append(d) 567 }, b 568 }), b.define("select2/selection/allowClear", ["jquery", "../keys", "../utils"], function (a, b, c) { 569 function d() { 570 } 571 572 return d.prototype.bind = function (a, b, c) { 573 var d = this; 574 a.call(this, b, c), null == this.placeholder && this.options.get("debug") && window.console && console.error && console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."), this.$selection.on("mousedown", ".select2-selection__clear", function (a) { 575 d._handleClear(a) 576 }), b.on("keypress", function (a) { 577 d._handleKeyboardClear(a, b) 578 }) 579 }, d.prototype._handleClear = function (a, b) { 580 if (!this.options.get("disabled")) { 581 var d = this.$selection.find(".select2-selection__clear"); 582 if (0 !== d.length) { 583 b.stopPropagation(); 584 var e = c.GetData(d[0], "data"), f = this.$element.val(); 585 this.$element.val(this.placeholder.id); 586 var g = {data: e}; 587 if (this.trigger("clear", g), g.prevented) return void this.$element.val(f); 588 for (var h = 0; h < e.length; h++) if (g = {data: e[h]}, this.trigger("unselect", g), g.prevented) return void this.$element.val(f); 589 this.$element.trigger("change"), this.trigger("toggle", {}) 590 } 591 } 592 }, d.prototype._handleKeyboardClear = function (a, c, d) { 593 d.isOpen() || c.which != b.DELETE && c.which != b.BACKSPACE || this._handleClear(c) 594 }, d.prototype.update = function (b, d) { 595 if (b.call(this, d), !(this.$selection.find(".select2-selection__placeholder").length > 0 || 0 === d.length)) { 596 var e = this.options.get("translations").get("removeAllItems"), 597 f = a('<span class="select2-selection__clear" title="' + e() + '">×</span>'); 598 c.StoreData(f[0], "data", d), this.$selection.find(".select2-selection__rendered").prepend(f) 599 } 600 }, d 601 }), b.define("select2/selection/search", ["jquery", "../utils", "../keys"], function (a, b, c) { 602 function d(a, b, c) { 603 a.call(this, b, c) 604 } 605 606 return d.prototype.render = function (b) { 607 var c = a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>'); 608 this.$searchContainer = c, this.$search = c.find("input"); 609 var d = b.call(this); 610 return this._transferTabIndex(), d 611 }, d.prototype.bind = function (a, d, e) { 612 var f = this; 613 a.call(this, d, e), d.on("open", function () { 614 f.$search.trigger("focus") 615 }), d.on("close", function () { 616 f.$search.val(""), f.$search.removeAttr("aria-activedescendant"), f.$search.trigger("focus") 617 }), d.on("enable", function () { 618 f.$search.prop("disabled", !1), f._transferTabIndex() 619 }), d.on("disable", function () { 620 f.$search.prop("disabled", !0) 621 }), d.on("focus", function (a) { 622 f.$search.trigger("focus") 623 }), d.on("results:focus", function (a) { 624 f.$search.attr("aria-activedescendant", a.id) 625 }), this.$selection.on("focusin", ".select2-search--inline", function (a) { 626 f.trigger("focus", a) 627 }), this.$selection.on("focusout", ".select2-search--inline", function (a) { 628 f._handleBlur(a) 629 }), this.$selection.on("keydown", ".select2-search--inline", function (a) { 630 if (a.stopPropagation(), f.trigger("keypress", a), f._keyUpPrevented = a.isDefaultPrevented(), a.which === c.BACKSPACE && "" === f.$search.val()) { 631 var d = f.$searchContainer.prev(".select2-selection__choice"); 632 if (d.length > 0) { 633 var e = b.GetData(d[0], "data"); 634 f.searchRemoveChoice(e), a.preventDefault() 635 } 636 } 637 }); 638 var g = document.documentMode, h = g && g <= 11; 639 this.$selection.on("input.searchcheck", ".select2-search--inline", function (a) { 640 if (h) return void f.$selection.off("input.search input.searchcheck"); 641 f.$selection.off("keyup.search") 642 }), this.$selection.on("keyup.search input.search", ".select2-search--inline", function (a) { 643 if (h && "input" === a.type) return void f.$selection.off("input.search input.searchcheck"); 644 var b = a.which; 645 b != c.SHIFT && b != c.CTRL && b != c.ALT && b != c.TAB && f.handleSearch(a) 646 }) 647 }, d.prototype._transferTabIndex = function (a) { 648 this.$search.attr("tabindex", this.$selection.attr("tabindex")), this.$selection.attr("tabindex", "-1") 649 }, d.prototype.createPlaceholder = function (a, b) { 650 this.$search.attr("placeholder", b.text) 651 }, d.prototype.update = function (a, b) { 652 var c = this.$search[0] == document.activeElement; 653 if (this.$search.attr("placeholder", ""), a.call(this, b), this.$selection.find(".select2-selection__rendered").append(this.$searchContainer), this.resizeSearch(), c) { 654 this.$element.find("[data-select2-tag]").length ? this.$element.focus() : this.$search.focus() 655 } 656 }, d.prototype.handleSearch = function () { 657 if (this.resizeSearch(), !this._keyUpPrevented) { 658 var a = this.$search.val(); 659 this.trigger("query", {term: a}) 660 } 661 this._keyUpPrevented = !1 662 }, d.prototype.searchRemoveChoice = function (a, b) { 663 this.trigger("unselect", {data: b}), this.$search.val(b.text), this.handleSearch() 664 }, d.prototype.resizeSearch = function () { 665 this.$search.css("width", "25px"); 666 var a = ""; 667 if ("" !== this.$search.attr("placeholder")) a = this.$selection.find(".select2-selection__rendered").innerWidth(); else { 668 a = .75 * (this.$search.val().length + 1) + "em" 669 } 670 this.$search.css("width", a) 671 }, d 672 }), b.define("select2/selection/eventRelay", ["jquery"], function (a) { 673 function b() { 674 } 675 676 return b.prototype.bind = function (b, c, d) { 677 var e = this, 678 f = ["open", "opening", "close", "closing", "select", "selecting", "unselect", "unselecting", "clear", "clearing"], 679 g = ["opening", "closing", "selecting", "unselecting", "clearing"]; 680 b.call(this, c, d), c.on("*", function (b, c) { 681 if (-1 !== a.inArray(b, f)) { 682 c = c || {}; 683 var d = a.Event("select2:" + b, {params: c}); 684 e.$element.trigger(d), -1 !== a.inArray(b, g) && (c.prevented = d.isDefaultPrevented()) 685 } 686 }) 687 }, b 688 }), b.define("select2/translation", ["jquery", "require"], function (a, b) { 689 function c(a) { 690 this.dict = a || {} 691 } 692 693 return c.prototype.all = function () { 694 return this.dict 695 }, c.prototype.get = function (a) { 696 return this.dict[a] 697 }, c.prototype.extend = function (b) { 698 this.dict = a.extend({}, b.all(), this.dict) 699 }, c._cache = {}, c.loadPath = function (a) { 700 if (!(a in c._cache)) { 701 var d = b(a); 702 c._cache[a] = d 703 } 704 return new c(c._cache[a]) 705 }, c 706 }), b.define("select2/diacritics", [], function () { 707 return { 708 "Ⓐ": "A", 709 "A": "A", 710 "À": "A", 711 "Á": "A", 712 "Â": "A", 713 "Ầ": "A", 714 "Ấ": "A", 715 "Ẫ": "A", 716 "Ẩ": "A", 717 "Ã": "A", 718 "Ā": "A", 719 "Ă": "A", 720 "Ằ": "A", 721 "Ắ": "A", 722 "Ẵ": "A", 723 "Ẳ": "A", 724 "Ȧ": "A", 725 "Ǡ": "A", 726 "Ä": "A", 727 "Ǟ": "A", 728 "Ả": "A", 729 "Å": "A", 730 "Ǻ": "A", 731 "Ǎ": "A", 732 "Ȁ": "A", 733 "Ȃ": "A", 734 "Ạ": "A", 735 "Ậ": "A", 736 "Ặ": "A", 737 "Ḁ": "A", 738 "Ą": "A", 739 "Ⱥ": "A", 740 "Ɐ": "A", 741 "Ꜳ": "AA", 742 "Æ": "AE", 743 "Ǽ": "AE", 744 "Ǣ": "AE", 745 "Ꜵ": "AO", 746 "Ꜷ": "AU", 747 "Ꜹ": "AV", 748 "Ꜻ": "AV", 749 "Ꜽ": "AY", 750 "Ⓑ": "B", 751 "B": "B", 752 "Ḃ": "B", 753 "Ḅ": "B", 754 "Ḇ": "B", 755 "Ƀ": "B", 756 "Ƃ": "B", 757 "Ɓ": "B", 758 "Ⓒ": "C", 759 "C": "C", 760 "Ć": "C", 761 "Ĉ": "C", 762 "Ċ": "C", 763 "Č": "C", 764 "Ç": "C", 765 "Ḉ": "C", 766 "Ƈ": "C", 767 "Ȼ": "C", 768 "Ꜿ": "C", 769 "Ⓓ": "D", 770 "D": "D", 771 "Ḋ": "D", 772 "Ď": "D", 773 "Ḍ": "D", 774 "Ḑ": "D", 775 "Ḓ": "D", 776 "Ḏ": "D", 777 "Đ": "D", 778 "Ƌ": "D", 779 "Ɗ": "D", 780 "Ɖ": "D", 781 "Ꝺ": "D", 782 "DZ": "DZ", 783 "DŽ": "DZ", 784 "Dz": "Dz", 785 "Dž": "Dz", 786 "Ⓔ": "E", 787 "E": "E", 788 "È": "E", 789 "É": "E", 790 "Ê": "E", 791 "Ề": "E", 792 "Ế": "E", 793 "Ễ": "E", 794 "Ể": "E", 795 "Ẽ": "E", 796 "Ē": "E", 797 "Ḕ": "E", 798 "Ḗ": "E", 799 "Ĕ": "E", 800 "Ė": "E", 801 "Ë": "E", 802 "Ẻ": "E", 803 "Ě": "E", 804 "Ȅ": "E", 805 "Ȇ": "E", 806 "Ẹ": "E", 807 "Ệ": "E", 808 "Ȩ": "E", 809 "Ḝ": "E", 810 "Ę": "E", 811 "Ḙ": "E", 812 "Ḛ": "E", 813 "Ɛ": "E", 814 "Ǝ": "E", 815 "Ⓕ": "F", 816 "F": "F", 817 "Ḟ": "F", 818 "Ƒ": "F", 819 "Ꝼ": "F", 820 "Ⓖ": "G", 821 "G": "G", 822 "Ǵ": "G", 823 "Ĝ": "G", 824 "Ḡ": "G", 825 "Ğ": "G", 826 "Ġ": "G", 827 "Ǧ": "G", 828 "Ģ": "G", 829 "Ǥ": "G", 830 "Ɠ": "G", 831 "Ꞡ": "G", 832 "Ᵹ": "G", 833 "Ꝿ": "G", 834 "Ⓗ": "H", 835 "H": "H", 836 "Ĥ": "H", 837 "Ḣ": "H", 838 "Ḧ": "H", 839 "Ȟ": "H", 840 "Ḥ": "H", 841 "Ḩ": "H", 842 "Ḫ": "H", 843 "Ħ": "H", 844 "Ⱨ": "H", 845 "Ⱶ": "H", 846 "Ɥ": "H", 847 "Ⓘ": "I", 848 "I": "I", 849 "Ì": "I", 850 "Í": "I", 851 "Î": "I", 852 "Ĩ": "I", 853 "Ī": "I", 854 "Ĭ": "I", 855 "İ": "I", 856 "Ï": "I", 857 "Ḯ": "I", 858 "Ỉ": "I", 859 "Ǐ": "I", 860 "Ȉ": "I", 861 "Ȋ": "I", 862 "Ị": "I", 863 "Į": "I", 864 "Ḭ": "I", 865 "Ɨ": "I", 866 "Ⓙ": "J", 867 "J": "J", 868 "Ĵ": "J", 869 "Ɉ": "J", 870 "Ⓚ": "K", 871 "K": "K", 872 "Ḱ": "K", 873 "Ǩ": "K", 874 "Ḳ": "K", 875 "Ķ": "K", 876 "Ḵ": "K", 877 "Ƙ": "K", 878 "Ⱪ": "K", 879 "Ꝁ": "K", 880 "Ꝃ": "K", 881 "Ꝅ": "K", 882 "Ꞣ": "K", 883 "Ⓛ": "L", 884 "L": "L", 885 "Ŀ": "L", 886 "Ĺ": "L", 887 "Ľ": "L", 888 "Ḷ": "L", 889 "Ḹ": "L", 890 "Ļ": "L", 891 "Ḽ": "L", 892 "Ḻ": "L", 893 "Ł": "L", 894 "Ƚ": "L", 895 "Ɫ": "L", 896 "Ⱡ": "L", 897 "Ꝉ": "L", 898 "Ꝇ": "L", 899 "Ꞁ": "L", 900 "LJ": "LJ", 901 "Lj": "Lj", 902 "Ⓜ": "M", 903 "M": "M", 904 "Ḿ": "M", 905 "Ṁ": "M", 906 "Ṃ": "M", 907 "Ɱ": "M", 908 "Ɯ": "M", 909 "Ⓝ": "N", 910 "N": "N", 911 "Ǹ": "N", 912 "Ń": "N", 913 "Ñ": "N", 914 "Ṅ": "N", 915 "Ň": "N", 916 "Ṇ": "N", 917 "Ņ": "N", 918 "Ṋ": "N", 919 "Ṉ": "N", 920 "Ƞ": "N", 921 "Ɲ": "N", 922 "Ꞑ": "N", 923 "Ꞥ": "N", 924 "NJ": "NJ", 925 "Nj": "Nj", 926 "Ⓞ": "O", 927 "O": "O", 928 "Ò": "O", 929 "Ó": "O", 930 "Ô": "O", 931 "Ồ": "O", 932 "Ố": "O", 933 "Ỗ": "O", 934 "Ổ": "O", 935 "Õ": "O", 936 "Ṍ": "O", 937 "Ȭ": "O", 938 "Ṏ": "O", 939 "Ō": "O", 940 "Ṑ": "O", 941 "Ṓ": "O", 942 "Ŏ": "O", 943 "Ȯ": "O", 944 "Ȱ": "O", 945 "Ö": "O", 946 "Ȫ": "O", 947 "Ỏ": "O", 948 "Ő": "O", 949 "Ǒ": "O", 950 "Ȍ": "O", 951 "Ȏ": "O", 952 "Ơ": "O", 953 "Ờ": "O", 954 "Ớ": "O", 955 "Ỡ": "O", 956 "Ở": "O", 957 "Ợ": "O", 958 "Ọ": "O", 959 "Ộ": "O", 960 "Ǫ": "O", 961 "Ǭ": "O", 962 "Ø": "O", 963 "Ǿ": "O", 964 "Ɔ": "O", 965 "Ɵ": "O", 966 "Ꝋ": "O", 967 "Ꝍ": "O", 968 "Œ": "OE", 969 "Ƣ": "OI", 970 "Ꝏ": "OO", 971 "Ȣ": "OU", 972 "Ⓟ": "P", 973 "P": "P", 974 "Ṕ": "P", 975 "Ṗ": "P", 976 "Ƥ": "P", 977 "Ᵽ": "P", 978 "Ꝑ": "P", 979 "Ꝓ": "P", 980 "Ꝕ": "P", 981 "Ⓠ": "Q", 982 "Q": "Q", 983 "Ꝗ": "Q", 984 "Ꝙ": "Q", 985 "Ɋ": "Q", 986 "Ⓡ": "R", 987 "R": "R", 988 "Ŕ": "R", 989 "Ṙ": "R", 990 "Ř": "R", 991 "Ȑ": "R", 992 "Ȓ": "R", 993 "Ṛ": "R", 994 "Ṝ": "R", 995 "Ŗ": "R", 996 "Ṟ": "R", 997 "Ɍ": "R", 998 "Ɽ": "R", 999 "Ꝛ": "R", 1000 "Ꞧ": "R", 1001 "Ꞃ": "R", 1002 "Ⓢ": "S", 1003 "S": "S", 1004 "ẞ": "S", 1005 "Ś": "S", 1006 "Ṥ": "S", 1007 "Ŝ": "S", 1008 "Ṡ": "S", 1009 "Š": "S", 1010 "Ṧ": "S", 1011 "Ṣ": "S", 1012 "Ṩ": "S", 1013 "Ș": "S", 1014 "Ş": "S", 1015 "Ȿ": "S", 1016 "Ꞩ": "S", 1017 "Ꞅ": "S", 1018 "Ⓣ": "T", 1019 "T": "T", 1020 "Ṫ": "T", 1021 "Ť": "T", 1022 "Ṭ": "T", 1023 "Ț": "T", 1024 "Ţ": "T", 1025 "Ṱ": "T", 1026 "Ṯ": "T", 1027 "Ŧ": "T", 1028 "Ƭ": "T", 1029 "Ʈ": "T", 1030 "Ⱦ": "T", 1031 "Ꞇ": "T", 1032 "Ꜩ": "TZ", 1033 "Ⓤ": "U", 1034 "U": "U", 1035 "Ù": "U", 1036 "Ú": "U", 1037 "Û": "U", 1038 "Ũ": "U", 1039 "Ṹ": "U", 1040 "Ū": "U", 1041 "Ṻ": "U", 1042 "Ŭ": "U", 1043 "Ü": "U", 1044 "Ǜ": "U", 1045 "Ǘ": "U", 1046 "Ǖ": "U", 1047 "Ǚ": "U", 1048 "Ủ": "U", 1049 "Ů": "U", 1050 "Ű": "U", 1051 "Ǔ": "U", 1052 "Ȕ": "U", 1053 "Ȗ": "U", 1054 "Ư": "U", 1055 "Ừ": "U", 1056 "Ứ": "U", 1057 "Ữ": "U", 1058 "Ử": "U", 1059 "Ự": "U", 1060 "Ụ": "U", 1061 "Ṳ": "U", 1062 "Ų": "U", 1063 "Ṷ": "U", 1064 "Ṵ": "U", 1065 "Ʉ": "U", 1066 "Ⓥ": "V", 1067 "V": "V", 1068 "Ṽ": "V", 1069 "Ṿ": "V", 1070 "Ʋ": "V", 1071 "Ꝟ": "V", 1072 "Ʌ": "V", 1073 "Ꝡ": "VY", 1074 "Ⓦ": "W", 1075 "W": "W", 1076 "Ẁ": "W", 1077 "Ẃ": "W", 1078 "Ŵ": "W", 1079 "Ẇ": "W", 1080 "Ẅ": "W", 1081 "Ẉ": "W", 1082 "Ⱳ": "W", 1083 "Ⓧ": "X", 1084 "X": "X", 1085 "Ẋ": "X", 1086 "Ẍ": "X", 1087 "Ⓨ": "Y", 1088 "Y": "Y", 1089 "Ỳ": "Y", 1090 "Ý": "Y", 1091 "Ŷ": "Y", 1092 "Ỹ": "Y", 1093 "Ȳ": "Y", 1094 "Ẏ": "Y", 1095 "Ÿ": "Y", 1096 "Ỷ": "Y", 1097 "Ỵ": "Y", 1098 "Ƴ": "Y", 1099 "Ɏ": "Y", 1100 "Ỿ": "Y", 1101 "Ⓩ": "Z", 1102 "Z": "Z", 1103 "Ź": "Z", 1104 "Ẑ": "Z", 1105 "Ż": "Z", 1106 "Ž": "Z", 1107 "Ẓ": "Z", 1108 "Ẕ": "Z", 1109 "Ƶ": "Z", 1110 "Ȥ": "Z", 1111 "Ɀ": "Z", 1112 "Ⱬ": "Z", 1113 "Ꝣ": "Z", 1114 "ⓐ": "a", 1115 "a": "a", 1116 "ẚ": "a", 1117 "à": "a", 1118 "á": "a", 1119 "â": "a", 1120 "ầ": "a", 1121 "ấ": "a", 1122 "ẫ": "a", 1123 "ẩ": "a", 1124 "ã": "a", 1125 "ā": "a", 1126 "ă": "a", 1127 "ằ": "a", 1128 "ắ": "a", 1129 "ẵ": "a", 1130 "ẳ": "a", 1131 "ȧ": "a", 1132 "ǡ": "a", 1133 "ä": "a", 1134 "ǟ": "a", 1135 "ả": "a", 1136 "å": "a", 1137 "ǻ": "a", 1138 "ǎ": "a", 1139 "ȁ": "a", 1140 "ȃ": "a", 1141 "ạ": "a", 1142 "ậ": "a", 1143 "ặ": "a", 1144 "ḁ": "a", 1145 "ą": "a", 1146 "ⱥ": "a", 1147 "ɐ": "a", 1148 "ꜳ": "aa", 1149 "æ": "ae", 1150 "ǽ": "ae", 1151 "ǣ": "ae", 1152 "ꜵ": "ao", 1153 "ꜷ": "au", 1154 "ꜹ": "av", 1155 "ꜻ": "av", 1156 "ꜽ": "ay", 1157 "ⓑ": "b", 1158 "b": "b", 1159 "ḃ": "b", 1160 "ḅ": "b", 1161 "ḇ": "b", 1162 "ƀ": "b", 1163 "ƃ": "b", 1164 "ɓ": "b", 1165 "ⓒ": "c", 1166 "c": "c", 1167 "ć": "c", 1168 "ĉ": "c", 1169 "ċ": "c", 1170 "č": "c", 1171 "ç": "c", 1172 "ḉ": "c", 1173 "ƈ": "c", 1174 "ȼ": "c", 1175 "ꜿ": "c", 1176 "ↄ": "c", 1177 "ⓓ": "d", 1178 "d": "d", 1179 "ḋ": "d", 1180 "ď": "d", 1181 "ḍ": "d", 1182 "ḑ": "d", 1183 "ḓ": "d", 1184 "ḏ": "d", 1185 "đ": "d", 1186 "ƌ": "d", 1187 "ɖ": "d", 1188 "ɗ": "d", 1189 "ꝺ": "d", 1190 "dz": "dz", 1191 "dž": "dz", 1192 "ⓔ": "e", 1193 "e": "e", 1194 "è": "e", 1195 "é": "e", 1196 "ê": "e", 1197 "ề": "e", 1198 "ế": "e", 1199 "ễ": "e", 1200 "ể": "e", 1201 "ẽ": "e", 1202 "ē": "e", 1203 "ḕ": "e", 1204 "ḗ": "e", 1205 "ĕ": "e", 1206 "ė": "e", 1207 "ë": "e", 1208 "ẻ": "e", 1209 "ě": "e", 1210 "ȅ": "e", 1211 "ȇ": "e", 1212 "ẹ": "e", 1213 "ệ": "e", 1214 "ȩ": "e", 1215 "ḝ": "e", 1216 "ę": "e", 1217 "ḙ": "e", 1218 "ḛ": "e", 1219 "ɇ": "e", 1220 "ɛ": "e", 1221 "ǝ": "e", 1222 "ⓕ": "f", 1223 "f": "f", 1224 "ḟ": "f", 1225 "ƒ": "f", 1226 "ꝼ": "f", 1227 "ⓖ": "g", 1228 "g": "g", 1229 "ǵ": "g", 1230 "ĝ": "g", 1231 "ḡ": "g", 1232 "ğ": "g", 1233 "ġ": "g", 1234 "ǧ": "g", 1235 "ģ": "g", 1236 "ǥ": "g", 1237 "ɠ": "g", 1238 "ꞡ": "g", 1239 "ᵹ": "g", 1240 "ꝿ": "g", 1241 "ⓗ": "h", 1242 "h": "h", 1243 "ĥ": "h", 1244 "ḣ": "h", 1245 "ḧ": "h", 1246 "ȟ": "h", 1247 "ḥ": "h", 1248 "ḩ": "h", 1249 "ḫ": "h", 1250 "ẖ": "h", 1251 "ħ": "h", 1252 "ⱨ": "h", 1253 "ⱶ": "h", 1254 "ɥ": "h", 1255 "ƕ": "hv", 1256 "ⓘ": "i", 1257 "i": "i", 1258 "ì": "i", 1259 "í": "i", 1260 "î": "i", 1261 "ĩ": "i", 1262 "ī": "i", 1263 "ĭ": "i", 1264 "ï": "i", 1265 "ḯ": "i", 1266 "ỉ": "i", 1267 "ǐ": "i", 1268 "ȉ": "i", 1269 "ȋ": "i", 1270 "ị": "i", 1271 "į": "i", 1272 "ḭ": "i", 1273 "ɨ": "i", 1274 "ı": "i", 1275 "ⓙ": "j", 1276 "j": "j", 1277 "ĵ": "j", 1278 "ǰ": "j", 1279 "ɉ": "j", 1280 "ⓚ": "k", 1281 "k": "k", 1282 "ḱ": "k", 1283 "ǩ": "k", 1284 "ḳ": "k", 1285 "ķ": "k", 1286 "ḵ": "k", 1287 "ƙ": "k", 1288 "ⱪ": "k", 1289 "ꝁ": "k", 1290 "ꝃ": "k", 1291 "ꝅ": "k", 1292 "ꞣ": "k", 1293 "ⓛ": "l", 1294 "l": "l", 1295 "ŀ": "l", 1296 "ĺ": "l", 1297 "ľ": "l", 1298 "ḷ": "l", 1299 "ḹ": "l", 1300 "ļ": "l", 1301 "ḽ": "l", 1302 "ḻ": "l", 1303 "ſ": "l", 1304 "ł": "l", 1305 "ƚ": "l", 1306 "ɫ": "l", 1307 "ⱡ": "l", 1308 "ꝉ": "l", 1309 "ꞁ": "l", 1310 "ꝇ": "l", 1311 "lj": "lj", 1312 "ⓜ": "m", 1313 "m": "m", 1314 "ḿ": "m", 1315 "ṁ": "m", 1316 "ṃ": "m", 1317 "ɱ": "m", 1318 "ɯ": "m", 1319 "ⓝ": "n", 1320 "n": "n", 1321 "ǹ": "n", 1322 "ń": "n", 1323 "ñ": "n", 1324 "ṅ": "n", 1325 "ň": "n", 1326 "ṇ": "n", 1327 "ņ": "n", 1328 "ṋ": "n", 1329 "ṉ": "n", 1330 "ƞ": "n", 1331 "ɲ": "n", 1332 "ʼn": "n", 1333 "ꞑ": "n", 1334 "ꞥ": "n", 1335 "nj": "nj", 1336 "ⓞ": "o", 1337 "o": "o", 1338 "ò": "o", 1339 "ó": "o", 1340 "ô": "o", 1341 "ồ": "o", 1342 "ố": "o", 1343 "ỗ": "o", 1344 "ổ": "o", 1345 "õ": "o", 1346 "ṍ": "o", 1347 "ȭ": "o", 1348 "ṏ": "o", 1349 "ō": "o", 1350 "ṑ": "o", 1351 "ṓ": "o", 1352 "ŏ": "o", 1353 "ȯ": "o", 1354 "ȱ": "o", 1355 "ö": "o", 1356 "ȫ": "o", 1357 "ỏ": "o", 1358 "ő": "o", 1359 "ǒ": "o", 1360 "ȍ": "o", 1361 "ȏ": "o", 1362 "ơ": "o", 1363 "ờ": "o", 1364 "ớ": "o", 1365 "ỡ": "o", 1366 "ở": "o", 1367 "ợ": "o", 1368 "ọ": "o", 1369 "ộ": "o", 1370 "ǫ": "o", 1371 "ǭ": "o", 1372 "ø": "o", 1373 "ǿ": "o", 1374 "ɔ": "o", 1375 "ꝋ": "o", 1376 "ꝍ": "o", 1377 "ɵ": "o", 1378 "œ": "oe", 1379 "ƣ": "oi", 1380 "ȣ": "ou", 1381 "ꝏ": "oo", 1382 "ⓟ": "p", 1383 "p": "p", 1384 "ṕ": "p", 1385 "ṗ": "p", 1386 "ƥ": "p", 1387 "ᵽ": "p", 1388 "ꝑ": "p", 1389 "ꝓ": "p", 1390 "ꝕ": "p", 1391 "ⓠ": "q", 1392 "q": "q", 1393 "ɋ": "q", 1394 "ꝗ": "q", 1395 "ꝙ": "q", 1396 "ⓡ": "r", 1397 "r": "r", 1398 "ŕ": "r", 1399 "ṙ": "r", 1400 "ř": "r", 1401 "ȑ": "r", 1402 "ȓ": "r", 1403 "ṛ": "r", 1404 "ṝ": "r", 1405 "ŗ": "r", 1406 "ṟ": "r", 1407 "ɍ": "r", 1408 "ɽ": "r", 1409 "ꝛ": "r", 1410 "ꞧ": "r", 1411 "ꞃ": "r", 1412 "ⓢ": "s", 1413 "s": "s", 1414 "ß": "s", 1415 "ś": "s", 1416 "ṥ": "s", 1417 "ŝ": "s", 1418 "ṡ": "s", 1419 "š": "s", 1420 "ṧ": "s", 1421 "ṣ": "s", 1422 "ṩ": "s", 1423 "ș": "s", 1424 "ş": "s", 1425 "ȿ": "s", 1426 "ꞩ": "s", 1427 "ꞅ": "s", 1428 "ẛ": "s", 1429 "ⓣ": "t", 1430 "t": "t", 1431 "ṫ": "t", 1432 "ẗ": "t", 1433 "ť": "t", 1434 "ṭ": "t", 1435 "ț": "t", 1436 "ţ": "t", 1437 "ṱ": "t", 1438 "ṯ": "t", 1439 "ŧ": "t", 1440 "ƭ": "t", 1441 "ʈ": "t", 1442 "ⱦ": "t", 1443 "ꞇ": "t", 1444 "ꜩ": "tz", 1445 "ⓤ": "u", 1446 "u": "u", 1447 "ù": "u", 1448 "ú": "u", 1449 "û": "u", 1450 "ũ": "u", 1451 "ṹ": "u", 1452 "ū": "u", 1453 "ṻ": "u", 1454 "ŭ": "u", 1455 "ü": "u", 1456 "ǜ": "u", 1457 "ǘ": "u", 1458 "ǖ": "u", 1459 "ǚ": "u", 1460 "ủ": "u", 1461 "ů": "u", 1462 "ű": "u", 1463 "ǔ": "u", 1464 "ȕ": "u", 1465 "ȗ": "u", 1466 "ư": "u", 1467 "ừ": "u", 1468 "ứ": "u", 1469 "ữ": "u", 1470 "ử": "u", 1471 "ự": "u", 1472 "ụ": "u", 1473 "ṳ": "u", 1474 "ų": "u", 1475 "ṷ": "u", 1476 "ṵ": "u", 1477 "ʉ": "u", 1478 "ⓥ": "v", 1479 "v": "v", 1480 "ṽ": "v", 1481 "ṿ": "v", 1482 "ʋ": "v", 1483 "ꝟ": "v", 1484 "ʌ": "v", 1485 "ꝡ": "vy", 1486 "ⓦ": "w", 1487 "w": "w", 1488 "ẁ": "w", 1489 "ẃ": "w", 1490 "ŵ": "w", 1491 "ẇ": "w", 1492 "ẅ": "w", 1493 "ẘ": "w", 1494 "ẉ": "w", 1495 "ⱳ": "w", 1496 "ⓧ": "x", 1497 "x": "x", 1498 "ẋ": "x", 1499 "ẍ": "x", 1500 "ⓨ": "y", 1501 "y": "y", 1502 "ỳ": "y", 1503 "ý": "y", 1504 "ŷ": "y", 1505 "ỹ": "y", 1506 "ȳ": "y", 1507 "ẏ": "y", 1508 "ÿ": "y", 1509 "ỷ": "y", 1510 "ẙ": "y", 1511 "ỵ": "y", 1512 "ƴ": "y", 1513 "ɏ": "y", 1514 "ỿ": "y", 1515 "ⓩ": "z", 1516 "z": "z", 1517 "ź": "z", 1518 "ẑ": "z", 1519 "ż": "z", 1520 "ž": "z", 1521 "ẓ": "z", 1522 "ẕ": "z", 1523 "ƶ": "z", 1524 "ȥ": "z", 1525 "ɀ": "z", 1526 "ⱬ": "z", 1527 "ꝣ": "z", 1528 "Ά": "Α", 1529 "Έ": "Ε", 1530 "Ή": "Η", 1531 "Ί": "Ι", 1532 "Ϊ": "Ι", 1533 "Ό": "Ο", 1534 "Ύ": "Υ", 1535 "Ϋ": "Υ", 1536 "Ώ": "Ω", 1537 "ά": "α", 1538 "έ": "ε", 1539 "ή": "η", 1540 "ί": "ι", 1541 "ϊ": "ι", 1542 "ΐ": "ι", 1543 "ό": "ο", 1544 "ύ": "υ", 1545 "ϋ": "υ", 1546 "ΰ": "υ", 1547 "ώ": "ω", 1548 "ς": "σ", 1549 "’": "'" 1550 } 1551 }), b.define("select2/data/base", ["../utils"], function (a) { 1552 function b(a, c) { 1553 b.__super__.constructor.call(this) 1554 } 1555 1556 return a.Extend(b, a.Observable), b.prototype.current = function (a) { 1557 throw new Error("The `current` method must be defined in child classes.") 1558 }, b.prototype.query = function (a, b) { 1559 throw new Error("The `query` method must be defined in child classes.") 1560 }, b.prototype.bind = function (a, b) { 1561 }, b.prototype.destroy = function () { 1562 }, b.prototype.generateResultId = function (b, c) { 1563 var d = b.id + "-result-"; 1564 return d += a.generateChars(4), null != c.id ? d += "-" + c.id.toString() : d += "-" + a.generateChars(4), d 1565 }, b 1566 }), b.define("select2/data/select", ["./base", "../utils", "jquery"], function (a, b, c) { 1567 function d(a, b) { 1568 this.$element = a, this.options = b, d.__super__.constructor.call(this) 1569 } 1570 1571 return b.Extend(d, a), d.prototype.current = function (a) { 1572 var b = [], d = this; 1573 this.$element.find(":selected").each(function () { 1574 var a = c(this), e = d.item(a); 1575 b.push(e) 1576 }), a(b) 1577 }, d.prototype.select = function (a) { 1578 var b = this; 1579 if (a.selected = !0, c(a.element).is("option")) return a.element.selected = !0, void this.$element.trigger("change"); 1580 if (this.$element.prop("multiple")) this.current(function (d) { 1581 var e = []; 1582 a = [a], a.push.apply(a, d); 1583 for (var f = 0; f < a.length; f++) { 1584 var g = a[f].id; 1585 -1 === c.inArray(g, e) && e.push(g) 1586 } 1587 b.$element.val(e), b.$element.trigger("change") 1588 }); else { 1589 var d = a.id; 1590 this.$element.val(d), this.$element.trigger("change") 1591 } 1592 }, d.prototype.unselect = function (a) { 1593 var b = this; 1594 if (this.$element.prop("multiple")) { 1595 if (a.selected = !1, c(a.element).is("option")) return a.element.selected = !1, void this.$element.trigger("change"); 1596 this.current(function (d) { 1597 for (var e = [], f = 0; f < d.length; f++) { 1598 var g = d[f].id; 1599 g !== a.id && -1 === c.inArray(g, e) && e.push(g) 1600 } 1601 b.$element.val(e), b.$element.trigger("change") 1602 }) 1603 } 1604 }, d.prototype.bind = function (a, b) { 1605 var c = this; 1606 this.container = a, a.on("select", function (a) { 1607 c.select(a.data) 1608 }), a.on("unselect", function (a) { 1609 c.unselect(a.data) 1610 }) 1611 }, d.prototype.destroy = function () { 1612 this.$element.find("*").each(function () { 1613 b.RemoveData(this) 1614 }) 1615 }, d.prototype.query = function (a, b) { 1616 var d = [], e = this; 1617 this.$element.children().each(function () { 1618 var b = c(this); 1619 if (b.is("option") || b.is("optgroup")) { 1620 var f = e.item(b), g = e.matches(a, f); 1621 null !== g && d.push(g) 1622 } 1623 }), b({results: d}) 1624 }, d.prototype.addOptions = function (a) { 1625 b.appendMany(this.$element, a) 1626 }, d.prototype.option = function (a) { 1627 var d; 1628 a.children ? (d = document.createElement("optgroup"), d.label = a.text) : (d = document.createElement("option"), void 0 !== d.textContent ? d.textContent = a.text : d.innerText = a.text), void 0 !== a.id && (d.value = a.id), a.disabled && (d.disabled = !0), a.selected && (d.selected = !0), a.title && (d.title = a.title); 1629 var e = c(d), f = this._normalizeItem(a); 1630 return f.element = d, b.StoreData(d, "data", f), e 1631 }, d.prototype.item = function (a) { 1632 var d = {}; 1633 if (null != (d = b.GetData(a[0], "data"))) return d; 1634 if (a.is("option")) d = { 1635 id: a.val(), 1636 text: a.text(), 1637 disabled: a.prop("disabled"), 1638 selected: a.prop("selected"), 1639 title: a.prop("title") 1640 }; else if (a.is("optgroup")) { 1641 d = {text: a.prop("label"), children: [], title: a.prop("title")}; 1642 for (var e = a.children("option"), f = [], g = 0; g < e.length; g++) { 1643 var h = c(e[g]), i = this.item(h); 1644 f.push(i) 1645 } 1646 d.children = f 1647 } 1648 return d = this._normalizeItem(d), d.element = a[0], b.StoreData(a[0], "data", d), d 1649 }, d.prototype._normalizeItem = function (a) { 1650 a !== Object(a) && (a = {id: a, text: a}), a = c.extend({}, {text: ""}, a); 1651 var b = {selected: !1, disabled: !1}; 1652 return null != a.id && (a.id = a.id.toString()), null != a.text && (a.text = a.text.toString()), null == a._resultId && a.id && null != this.container && (a._resultId = this.generateResultId(this.container, a)), c.extend({}, b, a) 1653 }, d.prototype.matches = function (a, b) { 1654 return this.options.get("matcher")(a, b) 1655 }, d 1656 }), b.define("select2/data/array", ["./select", "../utils", "jquery"], function (a, b, c) { 1657 function d(a, b) { 1658 var c = b.get("data") || []; 1659 d.__super__.constructor.call(this, a, b), this.addOptions(this.convertToOptions(c)) 1660 } 1661 1662 return b.Extend(d, a), d.prototype.select = function (a) { 1663 var b = this.$element.find("option").filter(function (b, c) { 1664 return c.value == a.id.toString() 1665 }); 1666 0 === b.length && (b = this.option(a), this.addOptions(b)), d.__super__.select.call(this, a) 1667 }, d.prototype.convertToOptions = function (a) { 1668 function d(a) { 1669 return function () { 1670 return c(this).val() == a.id 1671 } 1672 } 1673 1674 for (var e = this, f = this.$element.find("option"), g = f.map(function () { 1675 return e.item(c(this)).id 1676 }).get(), h = [], i = 0; i < a.length; i++) { 1677 var j = this._normalizeItem(a[i]); 1678 if (c.inArray(j.id, g) >= 0) { 1679 var k = f.filter(d(j)), l = this.item(k), m = c.extend(!0, {}, j, l), n = this.option(m); 1680 k.replaceWith(n) 1681 } else { 1682 var o = this.option(j); 1683 if (j.children) { 1684 var p = this.convertToOptions(j.children); 1685 b.appendMany(o, p) 1686 } 1687 h.push(o) 1688 } 1689 } 1690 return h 1691 }, d 1692 }), b.define("select2/data/ajax", ["./array", "../utils", "jquery"], function (a, b, c) { 1693 function d(a, b) { 1694 this.ajaxOptions = this._applyDefaults(b.get("ajax")), null != this.ajaxOptions.processResults && (this.processResults = this.ajaxOptions.processResults), d.__super__.constructor.call(this, a, b) 1695 } 1696 1697 return b.Extend(d, a), d.prototype._applyDefaults = function (a) { 1698 var b = { 1699 data: function (a) { 1700 return c.extend({}, a, {q: a.term}) 1701 }, transport: function (a, b, d) { 1702 var e = c.ajax(a); 1703 return e.then(b), e.fail(d), e 1704 } 1705 }; 1706 return c.extend({}, b, a, !0) 1707 }, d.prototype.processResults = function (a) { 1708 return a 1709 }, d.prototype.query = function (a, b) { 1710 function d() { 1711 var d = f.transport(f, function (d) { 1712 var f = e.processResults(d, a); 1713 e.options.get("debug") && window.console && console.error && (f && f.results && c.isArray(f.results) || console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")), b(f) 1714 }, function () { 1715 "status" in d && (0 === d.status || "0" === d.status) || e.trigger("results:message", {message: "errorLoading"}) 1716 }); 1717 e._request = d 1718 } 1719 1720 var e = this; 1721 null != this._request && (c.isFunction(this._request.abort) && this._request.abort(), this._request = null); 1722 var f = c.extend({type: "GET"}, this.ajaxOptions); 1723 "function" == typeof f.url && (f.url = f.url.call(this.$element, a)), "function" == typeof f.data && (f.data = f.data.call(this.$element, a)), this.ajaxOptions.delay && null != a.term ? (this._queryTimeout && window.clearTimeout(this._queryTimeout), this._queryTimeout = window.setTimeout(d, this.ajaxOptions.delay)) : d() 1724 }, d 1725 }), b.define("select2/data/tags", ["jquery"], function (a) { 1726 function b(b, c, d) { 1727 var e = d.get("tags"), f = d.get("createTag"); 1728 void 0 !== f && (this.createTag = f); 1729 var g = d.get("insertTag"); 1730 if (void 0 !== g && (this.insertTag = g), b.call(this, c, d), a.isArray(e)) for (var h = 0; h < e.length; h++) { 1731 var i = e[h], j = this._normalizeItem(i), k = this.option(j); 1732 this.$element.append(k) 1733 } 1734 } 1735 1736 return b.prototype.query = function (a, b, c) { 1737 function d(a, f) { 1738 for (var g = a.results, h = 0; h < g.length; h++) { 1739 var i = g[h], j = null != i.children && !d({results: i.children}, !0); 1740 if ((i.text || "").toUpperCase() === (b.term || "").toUpperCase() || j) return !f && (a.data = g, void c(a)) 1741 } 1742 if (f) return !0; 1743 var k = e.createTag(b); 1744 if (null != k) { 1745 var l = e.option(k); 1746 l.attr("data-select2-tag", !0), e.addOptions([l]), e.insertTag(g, k) 1747 } 1748 a.results = g, c(a) 1749 } 1750 1751 var e = this; 1752 if (this._removeOldTags(), null == b.term || null != b.page) return void a.call(this, b, c); 1753 a.call(this, b, d) 1754 }, b.prototype.createTag = function (b, c) { 1755 var d = a.trim(c.term); 1756 return "" === d ? null : {id: d, text: d} 1757 }, b.prototype.insertTag = function (a, b, c) { 1758 b.unshift(c) 1759 }, b.prototype._removeOldTags = function (b) { 1760 this._lastTag; 1761 this.$element.find("option[data-select2-tag]").each(function () { 1762 this.selected || a(this).remove() 1763 }) 1764 }, b 1765 }), b.define("select2/data/tokenizer", ["jquery"], function (a) { 1766 function b(a, b, c) { 1767 var d = c.get("tokenizer"); 1768 void 0 !== d && (this.tokenizer = d), a.call(this, b, c) 1769 } 1770 1771 return b.prototype.bind = function (a, b, c) { 1772 a.call(this, b, c), this.$search = b.dropdown.$search || b.selection.$search || c.find(".select2-search__field") 1773 }, b.prototype.query = function (b, c, d) { 1774 function e(b) { 1775 var c = g._normalizeItem(b); 1776 if (!g.$element.find("option").filter(function () { 1777 return a(this).val() === c.id 1778 }).length) { 1779 var d = g.option(c); 1780 d.attr("data-select2-tag", !0), g._removeOldTags(), g.addOptions([d]) 1781 } 1782 f(c) 1783 } 1784 1785 function f(a) { 1786 g.trigger("select", {data: a}) 1787 } 1788 1789 var g = this; 1790 c.term = c.term || ""; 1791 var h = this.tokenizer(c, this.options, e); 1792 h.term !== c.term && (this.$search.length && (this.$search.val(h.term), this.$search.focus()), c.term = h.term), b.call(this, c, d) 1793 }, b.prototype.tokenizer = function (b, c, d, e) { 1794 for (var f = d.get("tokenSeparators") || [], g = c.term, h = 0, i = this.createTag || function (a) { 1795 return {id: a.term, text: a.term} 1796 }; h < g.length;) { 1797 var j = g[h]; 1798 if (-1 !== a.inArray(j, f)) { 1799 var k = g.substr(0, h), l = a.extend({}, c, {term: k}), m = i(l); 1800 null != m ? (e(m), g = g.substr(h + 1) || "", h = 0) : h++ 1801 } else h++ 1802 } 1803 return {term: g} 1804 }, b 1805 }), b.define("select2/data/minimumInputLength", [], function () { 1806 function a(a, b, c) { 1807 this.minimumInputLength = c.get("minimumInputLength"), a.call(this, b, c) 1808 } 1809 1810 return a.prototype.query = function (a, b, c) { 1811 if (b.term = b.term || "", b.term.length < this.minimumInputLength) return void this.trigger("results:message", { 1812 message: "inputTooShort", 1813 args: {minimum: this.minimumInputLength, input: b.term, params: b} 1814 }); 1815 a.call(this, b, c) 1816 }, a 1817 }), b.define("select2/data/maximumInputLength", [], function () { 1818 function a(a, b, c) { 1819 this.maximumInputLength = c.get("maximumInputLength"), a.call(this, b, c) 1820 } 1821 1822 return a.prototype.query = function (a, b, c) { 1823 if (b.term = b.term || "", this.maximumInputLength > 0 && b.term.length > this.maximumInputLength) return void this.trigger("results:message", { 1824 message: "inputTooLong", 1825 args: {maximum: this.maximumInputLength, input: b.term, params: b} 1826 }); 1827 a.call(this, b, c) 1828 }, a 1829 }), b.define("select2/data/maximumSelectionLength", [], function () { 1830 function a(a, b, c) { 1831 this.maximumSelectionLength = c.get("maximumSelectionLength"), a.call(this, b, c) 1832 } 1833 1834 return a.prototype.query = function (a, b, c) { 1835 var d = this; 1836 this.current(function (e) { 1837 var f = null != e ? e.length : 0; 1838 if (d.maximumSelectionLength > 0 && f >= d.maximumSelectionLength) return void d.trigger("results:message", { 1839 message: "maximumSelected", 1840 args: {maximum: d.maximumSelectionLength} 1841 }); 1842 a.call(d, b, c) 1843 }) 1844 }, a 1845 }), b.define("select2/dropdown", ["jquery", "./utils"], function (a, b) { 1846 function c(a, b) { 1847 this.$element = a, this.options = b, c.__super__.constructor.call(this) 1848 } 1849 1850 return b.Extend(c, b.Observable), c.prototype.render = function () { 1851 var b = a('<span class="select2-dropdown"><span class="select2-results"></span></span>'); 1852 return b.attr("dir", this.options.get("dir")), this.$dropdown = b, b 1853 }, c.prototype.bind = function () { 1854 }, c.prototype.position = function (a, b) { 1855 }, c.prototype.destroy = function () { 1856 this.$dropdown.remove() 1857 }, c 1858 }), b.define("select2/dropdown/search", ["jquery", "../utils"], function (a, b) { 1859 function c() { 1860 } 1861 1862 return c.prototype.render = function (b) { 1863 var c = b.call(this), 1864 d = a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>'); 1865 return this.$searchContainer = d, this.$search = d.find("input"), c.prepend(d), c 1866 }, c.prototype.bind = function (b, c, d) { 1867 var e = this; 1868 b.call(this, c, d), this.$search.on("keydown", function (a) { 1869 e.trigger("keypress", a), e._keyUpPrevented = a.isDefaultPrevented() 1870 }), this.$search.on("input", function (b) { 1871 a(this).off("keyup") 1872 }), this.$search.on("keyup input", function (a) { 1873 e.handleSearch(a) 1874 }), c.on("open", function () { 1875 e.$search.attr("tabindex", 0), e.$search.focus(), window.setTimeout(function () { 1876 e.$search.focus() 1877 }, 0) 1878 }), c.on("close", function () { 1879 e.$search.attr("tabindex", -1), e.$search.val(""), e.$search.blur() 1880 }), c.on("focus", function () { 1881 c.isOpen() || e.$search.focus() 1882 }), c.on("results:all", function (a) { 1883 if (null == a.query.term || "" === a.query.term) { 1884 e.showSearch(a) ? e.$searchContainer.removeClass("select2-search--hide") : e.$searchContainer.addClass("select2-search--hide") 1885 } 1886 }) 1887 }, c.prototype.handleSearch = function (a) { 1888 if (!this._keyUpPrevented) { 1889 var b = this.$search.val(); 1890 this.trigger("query", {term: b}) 1891 } 1892 this._keyUpPrevented = !1 1893 }, c.prototype.showSearch = function (a, b) { 1894 return !0 1895 }, c 1896 }), b.define("select2/dropdown/hidePlaceholder", [], function () { 1897 function a(a, b, c, d) { 1898 this.placeholder = this.normalizePlaceholder(c.get("placeholder")), a.call(this, b, c, d) 1899 } 1900 1901 return a.prototype.append = function (a, b) { 1902 b.results = this.removePlaceholder(b.results), a.call(this, b) 1903 }, a.prototype.normalizePlaceholder = function (a, b) { 1904 return "string" == typeof b && (b = {id: "", text: b}), b 1905 }, a.prototype.removePlaceholder = function (a, b) { 1906 for (var c = b.slice(0), d = b.length - 1; d >= 0; d--) { 1907 var e = b[d]; 1908 this.placeholder.id === e.id && c.splice(d, 1) 1909 } 1910 return c 1911 }, a 1912 }), b.define("select2/dropdown/infiniteScroll", ["jquery"], function (a) { 1913 function b(a, b, c, d) { 1914 this.lastParams = {}, a.call(this, b, c, d), this.$loadingMore = this.createLoadingMore(), this.loading = !1 1915 } 1916 1917 return b.prototype.append = function (a, b) { 1918 this.$loadingMore.remove(), this.loading = !1, a.call(this, b), this.showLoadingMore(b) && this.$results.append(this.$loadingMore) 1919 }, b.prototype.bind = function (b, c, d) { 1920 var e = this; 1921 b.call(this, c, d), c.on("query", function (a) { 1922 e.lastParams = a, e.loading = !0 1923 }), c.on("query:append", function (a) { 1924 e.lastParams = a, e.loading = !0 1925 }), this.$results.on("scroll", function () { 1926 var b = a.contains(document.documentElement, e.$loadingMore[0]); 1927 if (!e.loading && b) { 1928 e.$results.offset().top + e.$results.outerHeight(!1) + 50 >= e.$loadingMore.offset().top + e.$loadingMore.outerHeight(!1) && e.loadMore() 1929 } 1930 }) 1931 }, b.prototype.loadMore = function () { 1932 this.loading = !0; 1933 var b = a.extend({}, {page: 1}, this.lastParams); 1934 b.page++, this.trigger("query:append", b) 1935 }, b.prototype.showLoadingMore = function (a, b) { 1936 return b.pagination && b.pagination.more 1937 }, b.prototype.createLoadingMore = function () { 1938 var b = a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'), 1939 c = this.options.get("translations").get("loadingMore"); 1940 return b.html(c(this.lastParams)), b 1941 }, b 1942 }), b.define("select2/dropdown/attachBody", ["jquery", "../utils"], function (a, b) { 1943 function c(b, c, d) { 1944 this.$dropdownParent = d.get("dropdownParent") || a(document.body), b.call(this, c, d) 1945 } 1946 1947 return c.prototype.bind = function (a, b, c) { 1948 var d = this, e = !1; 1949 a.call(this, b, c), b.on("open", function () { 1950 d._showDropdown(), d._attachPositioningHandler(b), e || (e = !0, b.on("results:all", function () { 1951 d._positionDropdown(), d._resizeDropdown() 1952 }), b.on("results:append", function () { 1953 d._positionDropdown(), d._resizeDropdown() 1954 })) 1955 }), b.on("close", function () { 1956 d._hideDropdown(), d._detachPositioningHandler(b) 1957 }), this.$dropdownContainer.on("mousedown", function (a) { 1958 a.stopPropagation() 1959 }) 1960 }, c.prototype.destroy = function (a) { 1961 a.call(this), this.$dropdownContainer.remove() 1962 }, c.prototype.position = function (a, b, c) { 1963 b.attr("class", c.attr("class")), b.removeClass("select2"), b.addClass("select2-container--open"), b.css({ 1964 position: "absolute", 1965 top: -999999 1966 }), this.$container = c 1967 }, c.prototype.render = function (b) { 1968 var c = a("<span></span>"), d = b.call(this); 1969 return c.append(d), this.$dropdownContainer = c, c 1970 }, c.prototype._hideDropdown = function (a) { 1971 this.$dropdownContainer.detach() 1972 }, c.prototype._attachPositioningHandler = function (c, d) { 1973 var e = this, f = "scroll.select2." + d.id, g = "resize.select2." + d.id, 1974 h = "orientationchange.select2." + d.id, i = this.$container.parents().filter(b.hasScroll); 1975 i.each(function () { 1976 b.StoreData(this, "select2-scroll-position", {x: a(this).scrollLeft(), y: a(this).scrollTop()}) 1977 }), i.on(f, function (c) { 1978 var d = b.GetData(this, "select2-scroll-position"); 1979 a(this).scrollTop(d.y) 1980 }), a(window).on(f + " " + g + " " + h, function (a) { 1981 e._positionDropdown(), e._resizeDropdown() 1982 }) 1983 }, c.prototype._detachPositioningHandler = function (c, d) { 1984 var e = "scroll.select2." + d.id, f = "resize.select2." + d.id, g = "orientationchange.select2." + d.id; 1985 this.$container.parents().filter(b.hasScroll).off(e), a(window).off(e + " " + f + " " + g) 1986 }, c.prototype._positionDropdown = function () { 1987 var b = a(window), c = this.$dropdown.hasClass("select2-dropdown--above"), 1988 d = this.$dropdown.hasClass("select2-dropdown--below"), e = null, f = this.$container.offset(); 1989 f.bottom = f.top + this.$container.outerHeight(!1); 1990 var g = {height: this.$container.outerHeight(!1)}; 1991 g.top = f.top, g.bottom = f.top + g.height; 1992 var h = {height: this.$dropdown.outerHeight(!1)}, 1993 i = {top: b.scrollTop(), bottom: b.scrollTop() + b.height()}, j = i.top < f.top - h.height, 1994 k = i.bottom > f.bottom + h.height, l = {left: f.left, top: g.bottom}, m = this.$dropdownParent; 1995 "static" === m.css("position") && (m = m.offsetParent()); 1996 var n = m.offset(); 1997 l.top -= n.top, l.left -= n.left, c || d || (e = "below"), k || !j || c ? !j && k && c && (e = "below") : e = "above", ("above" == e || c && "below" !== e) && (l.top = g.top - n.top - h.height), null != e && (this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--" + e), this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--" + e)), this.$dropdownContainer.css(l) 1998 }, c.prototype._resizeDropdown = function () { 1999 var a = {width: this.$container.outerWidth(!1) + "px"}; 2000 this.options.get("dropdownAutoWidth") && (a.minWidth = a.width, a.position = "relative", a.width = "auto"), this.$dropdown.css(a) 2001 }, c.prototype._showDropdown = function (a) { 2002 this.$dropdownContainer.appendTo(this.$dropdownParent), this._positionDropdown(), this._resizeDropdown() 2003 }, c 2004 }), b.define("select2/dropdown/minimumResultsForSearch", [], function () { 2005 function a(b) { 2006 for (var c = 0, d = 0; d < b.length; d++) { 2007 var e = b[d]; 2008 e.children ? c += a(e.children) : c++ 2009 } 2010 return c 2011 } 2012 2013 function b(a, b, c, d) { 2014 this.minimumResultsForSearch = c.get("minimumResultsForSearch"), this.minimumResultsForSearch < 0 && (this.minimumResultsForSearch = 1 / 0), a.call(this, b, c, d) 2015 } 2016 2017 return b.prototype.showSearch = function (b, c) { 2018 return !(a(c.data.results) < this.minimumResultsForSearch) && b.call(this, c) 2019 }, b 2020 }), b.define("select2/dropdown/selectOnClose", ["../utils"], function (a) { 2021 function b() { 2022 } 2023 2024 return b.prototype.bind = function (a, b, c) { 2025 var d = this; 2026 a.call(this, b, c), b.on("close", function (a) { 2027 d._handleSelectOnClose(a) 2028 }) 2029 }, b.prototype._handleSelectOnClose = function (b, c) { 2030 if (c && null != c.originalSelect2Event) { 2031 var d = c.originalSelect2Event; 2032 if ("select" === d._type || "unselect" === d._type) return 2033 } 2034 var e = this.getHighlightedResults(); 2035 if (!(e.length < 1)) { 2036 var f = a.GetData(e[0], "data"); 2037 null != f.element && f.element.selected || null == f.element && f.selected || this.trigger("select", {data: f}) 2038 } 2039 }, b 2040 }), b.define("select2/dropdown/closeOnSelect", [], function () { 2041 function a() { 2042 } 2043 2044 return a.prototype.bind = function (a, b, c) { 2045 var d = this; 2046 a.call(this, b, c), b.on("select", function (a) { 2047 d._selectTriggered(a) 2048 }), b.on("unselect", function (a) { 2049 d._selectTriggered(a) 2050 }) 2051 }, a.prototype._selectTriggered = function (a, b) { 2052 var c = b.originalEvent; 2053 c && (c.ctrlKey || c.metaKey) || this.trigger("close", {originalEvent: c, originalSelect2Event: b}) 2054 }, a 2055 }), b.define("select2/i18n/en", [], function () { 2056 return { 2057 errorLoading: function () { 2058 return "The results could not be loaded." 2059 }, inputTooLong: function (a) { 2060 var b = a.input.length - a.maximum, c = "Please delete " + b + " character"; 2061 return 1 != b && (c += "s"), c 2062 }, inputTooShort: function (a) { 2063 return "Please enter " + (a.minimum - a.input.length) + " or more characters" 2064 }, loadingMore: function () { 2065 return "Loading more results…" 2066 }, maximumSelected: function (a) { 2067 var b = "You can only select " + a.maximum + " item"; 2068 return 1 != a.maximum && (b += "s"), b 2069 }, noResults: function () { 2070 return "No results found" 2071 }, searching: function () { 2072 return "Searching…" 2073 }, removeAllItems: function () { 2074 return "Remove all items" 2075 } 2076 } 2077 }), b.define("select2/defaults", ["jquery", "require", "./results", "./selection/single", "./selection/multiple", "./selection/placeholder", "./selection/allowClear", "./selection/search", "./selection/eventRelay", "./utils", "./translation", "./diacritics", "./data/select", "./data/array", "./data/ajax", "./data/tags", "./data/tokenizer", "./data/minimumInputLength", "./data/maximumInputLength", "./data/maximumSelectionLength", "./dropdown", "./dropdown/search", "./dropdown/hidePlaceholder", "./dropdown/infiniteScroll", "./dropdown/attachBody", "./dropdown/minimumResultsForSearch", "./dropdown/selectOnClose", "./dropdown/closeOnSelect", "./i18n/en"], function (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C) { 2078 function D() { 2079 this.reset() 2080 } 2081 2082 return D.prototype.apply = function (l) { 2083 if (l = a.extend(!0, {}, this.defaults, l), null == l.dataAdapter) { 2084 if (null != l.ajax ? l.dataAdapter = o : null != l.data ? l.dataAdapter = n : l.dataAdapter = m, l.minimumInputLength > 0 && (l.dataAdapter = j.Decorate(l.dataAdapter, r)), l.maximumInputLength > 0 && (l.dataAdapter = j.Decorate(l.dataAdapter, s)), l.maximumSelectionLength > 0 && (l.dataAdapter = j.Decorate(l.dataAdapter, t)), l.tags && (l.dataAdapter = j.Decorate(l.dataAdapter, p)), null == l.tokenSeparators && null == l.tokenizer || (l.dataAdapter = j.Decorate(l.dataAdapter, q)), null != l.query) { 2085 var C = b(l.amdBase + "compat/query"); 2086 l.dataAdapter = j.Decorate(l.dataAdapter, C) 2087 } 2088 if (null != l.initSelection) { 2089 var D = b(l.amdBase + "compat/initSelection"); 2090 l.dataAdapter = j.Decorate(l.dataAdapter, D) 2091 } 2092 } 2093 if (null == l.resultsAdapter && (l.resultsAdapter = c, null != l.ajax && (l.resultsAdapter = j.Decorate(l.resultsAdapter, x)), null != l.placeholder && (l.resultsAdapter = j.Decorate(l.resultsAdapter, w)), l.selectOnClose && (l.resultsAdapter = j.Decorate(l.resultsAdapter, A))), null == l.dropdownAdapter) { 2094 if (l.multiple) l.dropdownAdapter = u; else { 2095 var E = j.Decorate(u, v); 2096 l.dropdownAdapter = E 2097 } 2098 if (0 !== l.minimumResultsForSearch && (l.dropdownAdapter = j.Decorate(l.dropdownAdapter, z)), l.closeOnSelect && (l.dropdownAdapter = j.Decorate(l.dropdownAdapter, B)), null != l.dropdownCssClass || null != l.dropdownCss || null != l.adaptDropdownCssClass) { 2099 var F = b(l.amdBase + "compat/dropdownCss"); 2100 l.dropdownAdapter = j.Decorate(l.dropdownAdapter, F) 2101 } 2102 l.dropdownAdapter = j.Decorate(l.dropdownAdapter, y) 2103 } 2104 if (null == l.selectionAdapter) { 2105 if (l.multiple ? l.selectionAdapter = e : l.selectionAdapter = d, null != l.placeholder && (l.selectionAdapter = j.Decorate(l.selectionAdapter, f)), l.allowClear && (l.selectionAdapter = j.Decorate(l.selectionAdapter, g)), l.multiple && (l.selectionAdapter = j.Decorate(l.selectionAdapter, h)), null != l.containerCssClass || null != l.containerCss || null != l.adaptContainerCssClass) { 2106 var G = b(l.amdBase + "compat/containerCss"); 2107 l.selectionAdapter = j.Decorate(l.selectionAdapter, G) 2108 } 2109 l.selectionAdapter = j.Decorate(l.selectionAdapter, i) 2110 } 2111 if ("string" == typeof l.language) if (l.language.indexOf("-") > 0) { 2112 var H = l.language.split("-"), I = H[0]; 2113 l.language = [l.language, I] 2114 } else l.language = [l.language]; 2115 if (a.isArray(l.language)) { 2116 var J = new k; 2117 l.language.push("en"); 2118 for (var K = l.language, L = 0; L < K.length; L++) { 2119 var M = K[L], N = {}; 2120 try { 2121 N = k.loadPath(M) 2122 } catch (a) { 2123 try { 2124 M = this.defaults.amdLanguageBase + M, N = k.loadPath(M) 2125 } catch (a) { 2126 l.debug && window.console && console.warn && console.warn('Select2: The language file for "' + M + '" could not be automatically loaded. A fallback will be used instead.'); 2127 continue 2128 } 2129 } 2130 J.extend(N) 2131 } 2132 l.translations = J 2133 } else { 2134 var O = k.loadPath(this.defaults.amdLanguageBase + "en"), P = new k(l.language); 2135 P.extend(O), l.translations = P 2136 } 2137 return l 2138 }, D.prototype.reset = function () { 2139 function b(a) { 2140 function b(a) { 2141 return l[a] || a 2142 } 2143 2144 return a.replace(/[^\u0000-\u007E]/g, b) 2145 } 2146 2147 function c(d, e) { 2148 if ("" === a.trim(d.term)) return e; 2149 if (e.children && e.children.length > 0) { 2150 for (var f = a.extend(!0, {}, e), g = e.children.length - 1; g >= 0; g--) { 2151 null == c(d, e.children[g]) && f.children.splice(g, 1) 2152 } 2153 return f.children.length > 0 ? f : c(d, f) 2154 } 2155 var h = b(e.text).toUpperCase(), i = b(d.term).toUpperCase(); 2156 return h.indexOf(i) > -1 ? e : null 2157 } 2158 2159 this.defaults = { 2160 amdBase: "./", 2161 amdLanguageBase: "./i18n/", 2162 closeOnSelect: !0, 2163 debug: !1, 2164 dropdownAutoWidth: !1, 2165 escapeMarkup: j.escapeMarkup, 2166 language: C, 2167 matcher: c, 2168 minimumInputLength: 0, 2169 maximumInputLength: 0, 2170 maximumSelectionLength: 0, 2171 minimumResultsForSearch: 0, 2172 selectOnClose: !1, 2173 scrollAfterSelect: !1, 2174 sorter: function (a) { 2175 return a 2176 }, 2177 templateResult: function (a) { 2178 return a.text 2179 }, 2180 templateSelection: function (a) { 2181 return a.text 2182 }, 2183 theme: "default", 2184 width: "resolve" 2185 } 2186 }, D.prototype.set = function (b, c) { 2187 var d = a.camelCase(b), e = {}; 2188 e[d] = c; 2189 var f = j._convertData(e); 2190 a.extend(!0, this.defaults, f) 2191 }, new D 2192 }), b.define("select2/options", ["require", "jquery", "./defaults", "./utils"], function (a, b, c, d) { 2193 function e(b, e) { 2194 if (this.options = b, null != e && this.fromElement(e), this.options = c.apply(this.options), e && e.is("input")) { 2195 var f = a(this.get("amdBase") + "compat/inputData"); 2196 this.options.dataAdapter = d.Decorate(this.options.dataAdapter, f) 2197 } 2198 } 2199 2200 return e.prototype.fromElement = function (a) { 2201 function c(a, b) { 2202 return b.toUpperCase() 2203 } 2204 2205 var e = ["select2"]; 2206 null == this.options.multiple && (this.options.multiple = a.prop("multiple")), null == this.options.disabled && (this.options.disabled = a.prop("disabled")), null == this.options.language && (a.prop("lang") ? this.options.language = a.prop("lang").toLowerCase() : a.closest("[lang]").prop("lang") && (this.options.language = a.closest("[lang]").prop("lang"))), null == this.options.dir && (a.prop("dir") ? this.options.dir = a.prop("dir") : a.closest("[dir]").prop("dir") ? this.options.dir = a.closest("[dir]").prop("dir") : this.options.dir = "ltr"), a.prop("disabled", this.options.disabled), a.prop("multiple", this.options.multiple), d.GetData(a[0], "select2Tags") && (this.options.debug && window.console && console.warn && console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'), d.StoreData(a[0], "data", d.GetData(a[0], "select2Tags")), d.StoreData(a[0], "tags", !0)), d.GetData(a[0], "ajaxUrl") && (this.options.debug && window.console && console.warn && console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."), a.attr("ajax--url", d.GetData(a[0], "ajaxUrl")), d.StoreData(a[0], "ajax-Url", d.GetData(a[0], "ajaxUrl"))); 2207 for (var f = {}, g = 0; g < a[0].attributes.length; g++) { 2208 var h = a[0].attributes[g].name, i = "data-"; 2209 if (h.substr(0, i.length) == i) { 2210 var j = h.substring(i.length), k = d.GetData(a[0], j); 2211 f[j.replace(/-([a-z])/g, c)] = k 2212 } 2213 } 2214 b.fn.jquery && "1." == b.fn.jquery.substr(0, 2) && a[0].dataset && (f = b.extend(!0, {}, a[0].dataset, f)); 2215 var l = b.extend(!0, {}, d.GetData(a[0]), f); 2216 l = d._convertData(l); 2217 for (var m in l) b.inArray(m, e) > -1 || (b.isPlainObject(this.options[m]) ? b.extend(this.options[m], l[m]) : this.options[m] = l[m]); 2218 return this 2219 }, e.prototype.get = function (a) { 2220 return this.options[a] 2221 }, e.prototype.set = function (a, b) { 2222 this.options[a] = b 2223 }, e 2224 }), b.define("select2/core", ["jquery", "./options", "./utils", "./keys"], function (a, b, c, d) { 2225 var e = function (a, d) { 2226 null != c.GetData(a[0], "select2") && c.GetData(a[0], "select2").destroy(), this.$element = a, this.id = this._generateId(a), d = d || {}, this.options = new b(d, a), e.__super__.constructor.call(this); 2227 var f = a.attr("tabindex") || 0; 2228 c.StoreData(a[0], "old-tabindex", f), a.attr("tabindex", "-1"); 2229 var g = this.options.get("dataAdapter"); 2230 this.dataAdapter = new g(a, this.options); 2231 var h = this.render(); 2232 this._placeContainer(h); 2233 var i = this.options.get("selectionAdapter"); 2234 this.selection = new i(a, this.options), this.$selection = this.selection.render(), this.selection.position(this.$selection, h); 2235 var j = this.options.get("dropdownAdapter"); 2236 this.dropdown = new j(a, this.options), this.$dropdown = this.dropdown.render(), this.dropdown.position(this.$dropdown, h); 2237 var k = this.options.get("resultsAdapter"); 2238 this.results = new k(a, this.options, this.dataAdapter), this.$results = this.results.render(), this.results.position(this.$results, this.$dropdown); 2239 var l = this; 2240 this._bindAdapters(), this._registerDomEvents(), this._registerDataEvents(), this._registerSelectionEvents(), this._registerDropdownEvents(), this._registerResultsEvents(), this._registerEvents(), this.dataAdapter.current(function (a) { 2241 l.trigger("selection:update", {data: a}) 2242 }), a.addClass("select2-hidden-accessible"), a.attr("aria-hidden", "true"), this._syncAttributes(), c.StoreData(a[0], "select2", this), a.data("select2", this) 2243 }; 2244 return c.Extend(e, c.Observable), e.prototype._generateId = function (a) { 2245 var b = ""; 2246 return b = null != a.attr("id") ? a.attr("id") : null != a.attr("name") ? a.attr("name") + "-" + c.generateChars(2) : c.generateChars(4), b = b.replace(/(:|\.|\[|\]|,)/g, ""), b = "select2-" + b 2247 }, e.prototype._placeContainer = function (a) { 2248 a.insertAfter(this.$element); 2249 var b = this._resolveWidth(this.$element, this.options.get("width")); 2250 null != b && a.css("width", b) 2251 }, e.prototype._resolveWidth = function (a, b) { 2252 var c = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; 2253 if ("resolve" == b) { 2254 var d = this._resolveWidth(a, "style"); 2255 return null != d ? d : this._resolveWidth(a, "element") 2256 } 2257 if ("element" == b) { 2258 var e = a.outerWidth(!1); 2259 return e <= 0 ? "auto" : e + "px" 2260 } 2261 if ("style" == b) { 2262 var f = a.attr("style"); 2263 if ("string" != typeof f) return null; 2264 for (var g = f.split(";"), h = 0, i = g.length; h < i; h += 1) { 2265 var j = g[h].replace(/\s/g, ""), k = j.match(c); 2266 if (null !== k && k.length >= 1) return k[1] 2267 } 2268 return null 2269 } 2270 return b 2271 }, e.prototype._bindAdapters = function () { 2272 this.dataAdapter.bind(this, this.$container), this.selection.bind(this, this.$container), this.dropdown.bind(this, this.$container), this.results.bind(this, this.$container) 2273 }, e.prototype._registerDomEvents = function () { 2274 var b = this; 2275 this.$element.on("change.select2", function () { 2276 b.dataAdapter.current(function (a) { 2277 b.trigger("selection:update", {data: a}) 2278 }) 2279 }), this.$element.on("focus.select2", function (a) { 2280 b.trigger("focus", a) 2281 }), this._syncA = c.bind(this._syncAttributes, this), this._syncS = c.bind(this._syncSubtree, this), this.$element[0].attachEvent && this.$element[0].attachEvent("onpropertychange", this._syncA); 2282 var d = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 2283 null != d ? (this._observer = new d(function (c) { 2284 a.each(c, b._syncA), a.each(c, b._syncS) 2285 }), this._observer.observe(this.$element[0], { 2286 attributes: !0, 2287 childList: !0, 2288 subtree: !1 2289 })) : this.$element[0].addEventListener && (this.$element[0].addEventListener("DOMAttrModified", b._syncA, !1), this.$element[0].addEventListener("DOMNodeInserted", b._syncS, !1), this.$element[0].addEventListener("DOMNodeRemoved", b._syncS, !1)) 2290 }, e.prototype._registerDataEvents = function () { 2291 var a = this; 2292 this.dataAdapter.on("*", function (b, c) { 2293 a.trigger(b, c) 2294 }) 2295 }, e.prototype._registerSelectionEvents = function () { 2296 var b = this, c = ["toggle", "focus"]; 2297 this.selection.on("toggle", function () { 2298 b.toggleDropdown() 2299 }), this.selection.on("focus", function (a) { 2300 b.focus(a) 2301 }), this.selection.on("*", function (d, e) { 2302 -1 === a.inArray(d, c) && b.trigger(d, e) 2303 }) 2304 }, e.prototype._registerDropdownEvents = function () { 2305 var a = this; 2306 this.dropdown.on("*", function (b, c) { 2307 a.trigger(b, c) 2308 }) 2309 }, e.prototype._registerResultsEvents = function () { 2310 var a = this; 2311 this.results.on("*", function (b, c) { 2312 a.trigger(b, c) 2313 }) 2314 }, e.prototype._registerEvents = function () { 2315 var a = this; 2316 this.on("open", function () { 2317 a.$container.addClass("select2-container--open") 2318 }), this.on("close", function () { 2319 a.$container.removeClass("select2-container--open") 2320 }), this.on("enable", function () { 2321 a.$container.removeClass("select2-container--disabled") 2322 }), this.on("disable", function () { 2323 a.$container.addClass("select2-container--disabled") 2324 }), this.on("blur", function () { 2325 a.$container.removeClass("select2-container--focus") 2326 }), this.on("query", function (b) { 2327 a.isOpen() || a.trigger("open", {}), this.dataAdapter.query(b, function (c) { 2328 a.trigger("results:all", {data: c, query: b}) 2329 }) 2330 }), this.on("query:append", function (b) { 2331 this.dataAdapter.query(b, function (c) { 2332 a.trigger("results:append", {data: c, query: b}) 2333 }) 2334 }), this.on("keypress", function (b) { 2335 var c = b.which; 2336 a.isOpen() ? c === d.ESC || c === d.TAB || c === d.UP && b.altKey ? (a.close(), b.preventDefault()) : c === d.ENTER ? (a.trigger("results:select", {}), b.preventDefault()) : c === d.SPACE && b.ctrlKey ? (a.trigger("results:toggle", {}), b.preventDefault()) : c === d.UP ? (a.trigger("results:previous", {}), b.preventDefault()) : c === d.DOWN && (a.trigger("results:next", {}), b.preventDefault()) : (c === d.ENTER || c === d.SPACE || c === d.DOWN && b.altKey) && (a.open(), b.preventDefault()) 2337 }) 2338 }, e.prototype._syncAttributes = function () { 2339 this.options.set("disabled", this.$element.prop("disabled")), this.options.get("disabled") ? (this.isOpen() && this.close(), this.trigger("disable", {})) : this.trigger("enable", {}) 2340 }, e.prototype._syncSubtree = function (a, b) { 2341 var c = !1, d = this; 2342 if (!a || !a.target || "OPTION" === a.target.nodeName || "OPTGROUP" === a.target.nodeName) { 2343 if (b) if (b.addedNodes && b.addedNodes.length > 0) for (var e = 0; e < b.addedNodes.length; e++) { 2344 var f = b.addedNodes[e]; 2345 f.selected && (c = !0) 2346 } else b.removedNodes && b.removedNodes.length > 0 && (c = !0); else c = !0; 2347 c && this.dataAdapter.current(function (a) { 2348 d.trigger("selection:update", {data: a}) 2349 }) 2350 } 2351 }, e.prototype.trigger = function (a, b) { 2352 var c = e.__super__.trigger, d = { 2353 open: "opening", 2354 close: "closing", 2355 select: "selecting", 2356 unselect: "unselecting", 2357 clear: "clearing" 2358 }; 2359 if (void 0 === b && (b = {}), a in d) { 2360 var f = d[a], g = {prevented: !1, name: a, args: b}; 2361 if (c.call(this, f, g), g.prevented) return void(b.prevented = !0) 2362 } 2363 c.call(this, a, b) 2364 }, e.prototype.toggleDropdown = function () { 2365 this.options.get("disabled") || (this.isOpen() ? this.close() : this.open()) 2366 }, e.prototype.open = function () { 2367 this.isOpen() || this.trigger("query", {}) 2368 }, e.prototype.close = function () { 2369 this.isOpen() && this.trigger("close", {}) 2370 }, e.prototype.isOpen = function () { 2371 return this.$container.hasClass("select2-container--open") 2372 }, e.prototype.hasFocus = function () { 2373 return this.$container.hasClass("select2-container--focus") 2374 }, e.prototype.focus = function (a) { 2375 this.hasFocus() || (this.$container.addClass("select2-container--focus"), this.trigger("focus", {})) 2376 }, e.prototype.enable = function (a) { 2377 this.options.get("debug") && window.console && console.warn && console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'), null != a && 0 !== a.length || (a = [!0]); 2378 var b = !a[0]; 2379 this.$element.prop("disabled", b) 2380 }, e.prototype.data = function () { 2381 this.options.get("debug") && arguments.length > 0 && window.console && console.warn && console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.'); 2382 var a = []; 2383 return this.dataAdapter.current(function (b) { 2384 a = b 2385 }), a 2386 }, e.prototype.val = function (b) { 2387 if (this.options.get("debug") && window.console && console.warn && console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'), null == b || 0 === b.length) return this.$element.val(); 2388 var c = b[0]; 2389 a.isArray(c) && (c = a.map(c, function (a) { 2390 return a.toString() 2391 })), this.$element.val(c).trigger("change") 2392 }, e.prototype.destroy = function () { 2393 this.$container.remove(), this.$element[0].detachEvent && this.$element[0].detachEvent("onpropertychange", this._syncA), null != this._observer ? (this._observer.disconnect(), this._observer = null) : this.$element[0].removeEventListener && (this.$element[0].removeEventListener("DOMAttrModified", this._syncA, !1), this.$element[0].removeEventListener("DOMNodeInserted", this._syncS, !1), this.$element[0].removeEventListener("DOMNodeRemoved", this._syncS, !1)), this._syncA = null, this._syncS = null, this.$element.off(".select2"), this.$element.attr("tabindex", c.GetData(this.$element[0], "old-tabindex")), this.$element.removeClass("select2-hidden-accessible"), this.$element.attr("aria-hidden", "false"), c.RemoveData(this.$element[0]), this.$element.removeData("select2"), this.dataAdapter.destroy(), this.selection.destroy(), this.dropdown.destroy(), this.results.destroy(), this.dataAdapter = null, this.selection = null, this.dropdown = null, this.results = null 2394 }, e.prototype.render = function () { 2395 var b = a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>'); 2396 return b.attr("dir", this.options.get("dir")), this.$container = b, this.$container.addClass("select2-container--" + this.options.get("theme")), c.StoreData(b[0], "element", this.$element), b 2397 }, e 2398 }), b.define("jquery-mousewheel", ["jquery"], function (a) { 2399 return a 2400 }), b.define("jquery.select2", ["jquery", "jquery-mousewheel", "./select2/core", "./select2/defaults", "./select2/utils"], function (a, b, c, d, e) { 2401 if (null == a.fn.select2) { 2402 var f = ["open", "close", "destroy"]; 2403 a.fn.select2 = function (b) { 2404 if ("object" == typeof(b = b || {})) return this.each(function () { 2405 var d = a.extend(!0, {}, b); 2406 new c(a(this), d) 2407 }), this; 2408 if ("string" == typeof b) { 2409 var d, g = Array.prototype.slice.call(arguments, 1); 2410 return this.each(function () { 2411 var a = e.GetData(this, "select2"); 2412 null == a && window.console && console.error && console.error("The select2('" + b + "') method was called on an element that is not using Select2."), d = a[b].apply(a, g) 2413 }), a.inArray(b, f) > -1 ? this : d 2414 } 2415 throw new Error("Invalid arguments for Select2: " + b) 2416 } 2417 } 2418 return null == a.fn.select2.defaults && (a.fn.select2.defaults = d), c 2419 }), {define: b.define, require: b.require} 2420 }(), c = b.require("jquery.select2"); 2421 return a.fn.select2.amd = b, c 2422 });
select2.min.css

1 .select2-container { 2 box-sizing: border-box; 3 display: inline-block; 4 margin: 0; 5 position: relative; 6 vertical-align: middle 7 } 8 9 .select2-container .select2-selection--single { 10 box-sizing: border-box; 11 cursor: pointer; 12 display: block; 13 height: 28px; 14 user-select: none; 15 -webkit-user-select: none 16 } 17 18 .select2-container .select2-selection--single .select2-selection__rendered { 19 display: block; 20 padding-left: 8px; 21 padding-right: 20px; 22 overflow: hidden; 23 text-overflow: ellipsis; 24 white-space: nowrap 25 } 26 27 .select2-container .select2-selection--single .select2-selection__clear { 28 position: relative 29 } 30 31 .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { 32 padding-right: 8px; 33 padding-left: 20px 34 } 35 36 .select2-container .select2-selection--multiple { 37 box-sizing: border-box; 38 cursor: pointer; 39 display: block; 40 min-height: 32px; 41 user-select: none; 42 -webkit-user-select: none 43 } 44 45 .select2-container .select2-selection--multiple .select2-selection__rendered { 46 display: inline-block; 47 overflow: hidden; 48 padding-left: 8px; 49 text-overflow: ellipsis; 50 white-space: nowrap 51 } 52 53 .select2-container .select2-search--inline { 54 float: left 55 } 56 57 .select2-container .select2-search--inline .select2-search__field { 58 box-sizing: border-box; 59 border: none; 60 font-size: 100%; 61 margin-top: 5px; 62 padding: 0 63 } 64 65 .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { 66 -webkit-appearance: none 67 } 68 69 .select2-dropdown { 70 background-color: white; 71 border: 1px solid #aaa; 72 border-radius: 4px; 73 box-sizing: border-box; 74 display: block; 75 position: absolute; 76 left: -100000px; 77 width: 100%; 78 z-index: 1051 79 } 80 81 .select2-results { 82 display: block 83 } 84 85 .select2-results__options { 86 list-style: none; 87 margin: 0; 88 padding: 0 89 } 90 91 .select2-results__option { 92 padding: 6px; 93 user-select: none; 94 -webkit-user-select: none 95 } 96 97 .select2-results__option[aria-selected] { 98 cursor: pointer 99 } 100 101 .select2-container--open .select2-dropdown { 102 left: 0 103 } 104 105 .select2-container--open .select2-dropdown--above { 106 border-bottom: none; 107 border-bottom-left-radius: 0; 108 border-bottom-right-radius: 0 109 } 110 111 .select2-container--open .select2-dropdown--below { 112 border-top: none; 113 border-top-left-radius: 0; 114 border-top-right-radius: 0 115 } 116 117 .select2-search--dropdown { 118 display: block; 119 padding: 4px 120 } 121 122 .select2-search--dropdown .select2-search__field { 123 padding: 4px; 124 width: 100%; 125 box-sizing: border-box 126 } 127 128 .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { 129 -webkit-appearance: none 130 } 131 132 .select2-search--dropdown.select2-search--hide { 133 display: none 134 } 135 136 .select2-close-mask { 137 border: 0; 138 margin: 0; 139 padding: 0; 140 display: block; 141 position: fixed; 142 left: 0; 143 top: 0; 144 min-height: 100%; 145 min-width: 100%; 146 height: auto; 147 width: auto; 148 opacity: 0; 149 z-index: 99; 150 background-color: #fff; 151 filter: alpha(opacity=0) 152 } 153 154 .select2-hidden-accessible { 155 border: 0 !important; 156 clip: rect(0 0 0 0) !important; 157 -webkit-clip-path: inset(50%) !important; 158 clip-path: inset(50%) !important; 159 height: 1px !important; 160 overflow: hidden !important; 161 padding: 0 !important; 162 position: absolute !important; 163 width: 1px !important; 164 white-space: nowrap !important 165 } 166 167 .select2-container--default .select2-selection--single { 168 background-color: #fff; 169 border: 1px solid #aaa; 170 border-radius: 4px 171 } 172 173 .select2-container--default .select2-selection--single .select2-selection__rendered { 174 color: #444; 175 line-height: 28px 176 } 177 178 .select2-container--default .select2-selection--single .select2-selection__clear { 179 cursor: pointer; 180 float: right; 181 font-weight: bold 182 } 183 184 .select2-container--default .select2-selection--single .select2-selection__placeholder { 185 color: #999 186 } 187 188 .select2-container--default .select2-selection--single .select2-selection__arrow { 189 height: 26px; 190 position: absolute; 191 top: 1px; 192 right: 1px; 193 width: 20px 194 } 195 196 .select2-container--default .select2-selection--single .select2-selection__arrow b { 197 border-color: #888 transparent transparent transparent; 198 border-style: solid; 199 border-width: 5px 4px 0 4px; 200 height: 0; 201 left: 50%; 202 margin-left: -4px; 203 margin-top: -2px; 204 position: absolute; 205 top: 50%; 206 width: 0 207 } 208 209 .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { 210 float: left 211 } 212 213 .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { 214 left: 1px; 215 right: auto 216 } 217 218 .select2-container--default.select2-container--disabled .select2-selection--single { 219 background-color: #eee; 220 cursor: default 221 } 222 223 .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { 224 display: none 225 } 226 227 .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { 228 border-color: transparent transparent #888 transparent; 229 border-width: 0 4px 5px 4px 230 } 231 232 .select2-container--default .select2-selection--multiple { 233 background-color: white; 234 border: 1px solid #aaa; 235 border-radius: 4px; 236 cursor: text 237 } 238 239 .select2-container--default .select2-selection--multiple .select2-selection__rendered { 240 box-sizing: border-box; 241 list-style: none; 242 margin: 0; 243 padding: 0 5px; 244 width: 100% 245 } 246 247 .select2-container--default .select2-selection--multiple .select2-selection__rendered li { 248 list-style: none 249 } 250 251 .select2-container--default .select2-selection--multiple .select2-selection__placeholder { 252 color: #999; 253 margin-top: 5px; 254 float: left 255 } 256 257 .select2-container--default .select2-selection--multiple .select2-selection__clear { 258 cursor: pointer; 259 float: right; 260 font-weight: bold; 261 margin-top: 5px; 262 margin-right: 10px 263 } 264 265 .select2-container--default .select2-selection--multiple .select2-selection__choice { 266 background-color: #e4e4e4; 267 border: 1px solid #aaa; 268 border-radius: 4px; 269 cursor: default; 270 float: left; 271 margin-right: 5px; 272 margin-top: 5px; 273 padding: 0 5px 274 } 275 276 .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { 277 color: #999; 278 cursor: pointer; 279 display: inline-block; 280 font-weight: bold; 281 margin-right: 2px 282 } 283 284 .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { 285 color: #333 286 } 287 288 .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { 289 float: right 290 } 291 292 .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { 293 margin-left: 5px; 294 margin-right: auto 295 } 296 297 .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { 298 margin-left: 2px; 299 margin-right: auto 300 } 301 302 .select2-container--default.select2-container--focus .select2-selection--multiple { 303 border: solid black 1px; 304 outline: 0 305 } 306 307 .select2-container--default.select2-container--disabled .select2-selection--multiple { 308 background-color: #eee; 309 cursor: default 310 } 311 312 .select2-container--default.select2-container--disabled .select2-selection__choice__remove { 313 display: none 314 } 315 316 .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { 317 border-top-left-radius: 0; 318 border-top-right-radius: 0 319 } 320 321 .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { 322 border-bottom-left-radius: 0; 323 border-bottom-right-radius: 0 324 } 325 326 .select2-container--default .select2-search--dropdown .select2-search__field { 327 border: 1px solid #aaa 328 } 329 330 .select2-container--default .select2-search--inline .select2-search__field { 331 background: transparent; 332 border: none; 333 outline: 0; 334 box-shadow: none; 335 -webkit-appearance: textfield 336 } 337 338 .select2-container--default .select2-results > .select2-results__options { 339 max-height: 200px; 340 overflow-y: auto 341 } 342 343 .select2-container--default .select2-results__option[role=group] { 344 padding: 0 345 } 346 347 .select2-container--default .select2-results__option[aria-disabled=true] { 348 color: #999 349 } 350 351 .select2-container--default .select2-results__option[aria-selected=true] { 352 background-color: #ddd 353 } 354 355 .select2-container--default .select2-results__option .select2-results__option { 356 padding-left: 1em 357 } 358 359 .select2-container--default .select2-results__option .select2-results__option .select2-results__group { 360 padding-left: 0 361 } 362 363 .select2-container--default .select2-results__option .select2-results__option .select2-results__option { 364 margin-left: -1em; 365 padding-left: 2em 366 } 367 368 .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { 369 margin-left: -2em; 370 padding-left: 3em 371 } 372 373 .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { 374 margin-left: -3em; 375 padding-left: 4em 376 } 377 378 .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { 379 margin-left: -4em; 380 padding-left: 5em 381 } 382 383 .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { 384 margin-left: -5em; 385 padding-left: 6em 386 } 387 388 .select2-container--default .select2-results__option--highlighted[aria-selected] { 389 background-color: #5897fb; 390 color: white 391 } 392 393 .select2-container--default .select2-results__group { 394 cursor: default; 395 display: block; 396 padding: 6px 397 } 398 399 .select2-container--classic .select2-selection--single { 400 background-color: #f7f7f7; 401 border: 1px solid #aaa; 402 border-radius: 4px; 403 outline: 0; 404 background-image: -webkit-linear-gradient(top, #fff 50%, #eee 100%); 405 background-image: -o-linear-gradient(top, #fff 50%, #eee 100%); 406 background-image: linear-gradient(to bottom, #fff 50%, #eee 100%); 407 background-repeat: repeat-x; 408 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0) 409 } 410 411 .select2-container--classic .select2-selection--single:focus { 412 border: 1px solid #5897fb 413 } 414 415 .select2-container--classic .select2-selection--single .select2-selection__rendered { 416 color: #444; 417 line-height: 28px 418 } 419 420 .select2-container--classic .select2-selection--single .select2-selection__clear { 421 cursor: pointer; 422 float: right; 423 font-weight: bold; 424 margin-right: 10px 425 } 426 427 .select2-container--classic .select2-selection--single .select2-selection__placeholder { 428 color: #999 429 } 430 431 .select2-container--classic .select2-selection--single .select2-selection__arrow { 432 background-color: #ddd; 433 border: none; 434 border-left: 1px solid #aaa; 435 border-top-right-radius: 4px; 436 border-bottom-right-radius: 4px; 437 height: 26px; 438 position: absolute; 439 top: 1px; 440 right: 1px; 441 width: 20px; 442 background-image: -webkit-linear-gradient(top, #eee 50%, #ccc 100%); 443 background-image: -o-linear-gradient(top, #eee 50%, #ccc 100%); 444 background-image: linear-gradient(to bottom, #eee 50%, #ccc 100%); 445 background-repeat: repeat-x; 446 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0) 447 } 448 449 .select2-container--classic .select2-selection--single .select2-selection__arrow b { 450 border-color: #888 transparent transparent transparent; 451 border-style: solid; 452 border-width: 5px 4px 0 4px; 453 height: 0; 454 left: 50%; 455 margin-left: -4px; 456 margin-top: -2px; 457 position: absolute; 458 top: 50%; 459 width: 0 460 } 461 462 .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { 463 float: left 464 } 465 466 .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { 467 border: none; 468 border-right: 1px solid #aaa; 469 border-radius: 0; 470 border-top-left-radius: 4px; 471 border-bottom-left-radius: 4px; 472 left: 1px; 473 right: auto 474 } 475 476 .select2-container--classic.select2-container--open .select2-selection--single { 477 border: 1px solid #5897fb 478 } 479 480 .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { 481 background: transparent; 482 border: none 483 } 484 485 .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { 486 border-color: transparent transparent #888 transparent; 487 border-width: 0 4px 5px 4px 488 } 489 490 .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { 491 border-top: none; 492 border-top-left-radius: 0; 493 border-top-right-radius: 0; 494 background-image: -webkit-linear-gradient(top, #fff 0%, #eee 50%); 495 background-image: -o-linear-gradient(top, #fff 0%, #eee 50%); 496 background-image: linear-gradient(to bottom, #fff 0%, #eee 50%); 497 background-repeat: repeat-x; 498 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0) 499 } 500 501 .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { 502 border-bottom: none; 503 border-bottom-left-radius: 0; 504 border-bottom-right-radius: 0; 505 background-image: -webkit-linear-gradient(top, #eee 50%, #fff 100%); 506 background-image: -o-linear-gradient(top, #eee 50%, #fff 100%); 507 background-image: linear-gradient(to bottom, #eee 50%, #fff 100%); 508 background-repeat: repeat-x; 509 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0) 510 } 511 512 .select2-container--classic .select2-selection--multiple { 513 background-color: white; 514 border: 1px solid #aaa; 515 border-radius: 4px; 516 cursor: text; 517 outline: 0 518 } 519 520 .select2-container--classic .select2-selection--multiple:focus { 521 border: 1px solid #5897fb 522 } 523 524 .select2-container--classic .select2-selection--multiple .select2-selection__rendered { 525 list-style: none; 526 margin: 0; 527 padding: 0 5px 528 } 529 530 .select2-container--classic .select2-selection--multiple .select2-selection__clear { 531 display: none 532 } 533 534 .select2-container--classic .select2-selection--multiple .select2-selection__choice { 535 background-color: #e4e4e4; 536 border: 1px solid #aaa; 537 border-radius: 4px; 538 cursor: default; 539 float: left; 540 margin-right: 5px; 541 margin-top: 5px; 542 padding: 0 5px 543 } 544 545 .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { 546 color: #888; 547 cursor: pointer; 548 display: inline-block; 549 font-weight: bold; 550 margin-right: 2px 551 } 552 553 .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { 554 color: #555 555 } 556 557 .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { 558 float: right; 559 margin-left: 5px; 560 margin-right: auto 561 } 562 563 .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { 564 margin-left: 2px; 565 margin-right: auto 566 } 567 568 .select2-container--classic.select2-container--open .select2-selection--multiple { 569 border: 1px solid #5897fb 570 } 571 572 .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { 573 border-top: none; 574 border-top-left-radius: 0; 575 border-top-right-radius: 0 576 } 577 578 .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { 579 border-bottom: none; 580 border-bottom-left-radius: 0; 581 border-bottom-right-radius: 0 582 } 583 584 .select2-container--classic .select2-search--dropdown .select2-search__field { 585 border: 1px solid #aaa; 586 outline: 0 587 } 588 589 .select2-container--classic .select2-search--inline .select2-search__field { 590 outline: 0; 591 box-shadow: none 592 } 593 594 .select2-container--classic .select2-dropdown { 595 background-color: #fff; 596 border: 1px solid transparent 597 } 598 599 .select2-container--classic .select2-dropdown--above { 600 border-bottom: none 601 } 602 603 .select2-container--classic .select2-dropdown--below { 604 border-top: none 605 } 606 607 .select2-container--classic .select2-results > .select2-results__options { 608 max-height: 200px; 609 overflow-y: auto 610 } 611 612 .select2-container--classic .select2-results__option[role=group] { 613 padding: 0 614 } 615 616 .select2-container--classic .select2-results__option[aria-disabled=true] { 617 color: grey 618 } 619 620 .select2-container--classic .select2-results__option--highlighted[aria-selected] { 621 background-color: #3875d7; 622 color: #fff 623 } 624 625 .select2-container--classic .select2-results__group { 626 cursor: default; 627 display: block; 628 padding: 6px 629 } 630 631 .select2-container--classic.select2-container--open .select2-dropdown { 632 border-color: #5897fb 633 }
2. 在需要下拉框的html或者ftl文件中引入上述文件
<link href="/html/css/common/select2.min.css" rel="stylesheet"/> <script src="/html/js/common/select2.min.js"></script>
3. 繼續在html或者ftl文件中加入一段script代碼, 其中course指的是下拉框的id
<script type="text/javascript"> $(document).ready(function () { $('#course').select2(); }); </script>
這是選擇下拉框的html寫法:
<div class="col-sm-4">
<select class="form-control" id="course">
</select>
</div>
結果如下所示:下拉框返回的結果可通過服務端ajax返回