From 6fcfb7c04d32e1c8b26a312295bf7ac3ec2d2ad7 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 13 Jul 2018 19:06:45 +0200 Subject: Fixed many permissions and began admin interface --- .../bower_components/select2/src/js/banner.end.js | 6 + .../select2/src/js/banner.start.js | 6 + .../select2/src/js/jquery.mousewheel.shim.js | 6 + .../select2/src/js/jquery.select2.js | 57 ++ .../bower_components/select2/src/js/jquery.shim.js | 14 + .../select2/src/js/select2/compat/containerCss.js | 56 ++ .../select2/src/js/select2/compat/dropdownCss.js | 56 ++ .../select2/src/js/select2/compat/initSelection.js | 42 + .../select2/src/js/select2/compat/inputData.js | 127 +++ .../select2/src/js/select2/compat/matcher.js | 42 + .../select2/src/js/select2/compat/query.js | 26 + .../select2/src/js/select2/compat/utils.js | 43 ++ .../select2/src/js/select2/core.js | 612 +++++++++++++++ .../select2/src/js/select2/data/ajax.js | 109 +++ .../select2/src/js/select2/data/array.js | 79 ++ .../select2/src/js/select2/data/base.js | 40 + .../src/js/select2/data/maximumInputLength.js | 31 + .../src/js/select2/data/maximumSelectionLength.js | 31 + .../src/js/select2/data/minimumInputLength.js | 30 + .../select2/src/js/select2/data/select.js | 285 +++++++ .../select2/src/js/select2/data/tags.js | 128 ++++ .../select2/src/js/select2/data/tokenizer.js | 116 +++ .../select2/src/js/select2/defaults.js | 396 ++++++++++ .../select2/src/js/select2/diacritics.js | 847 +++++++++++++++++++++ .../select2/src/js/select2/dropdown.js | 42 + .../select2/src/js/select2/dropdown/attachBody.js | 222 ++++++ .../src/js/select2/dropdown/attachContainer.js | 18 + .../src/js/select2/dropdown/closeOnSelect.js | 35 + .../src/js/select2/dropdown/hidePlaceholder.js | 42 + .../src/js/select2/dropdown/infiniteScroll.js | 89 +++ .../js/select2/dropdown/minimumResultsForSearch.js | 39 + .../select2/src/js/select2/dropdown/search.js | 101 +++ .../src/js/select2/dropdown/selectOnClose.js | 50 ++ .../src/js/select2/dropdown/stopPropagation.js | 38 + .../select2/src/js/select2/i18n/af.js | 44 ++ .../select2/src/js/select2/i18n/ar.js | 30 + .../select2/src/js/select2/i18n/az.js | 27 + .../select2/src/js/select2/i18n/bg.js | 47 ++ .../select2/src/js/select2/i18n/bs.js | 55 ++ .../select2/src/js/select2/i18n/ca.js | 52 ++ .../select2/src/js/select2/i18n/cs.js | 61 ++ .../select2/src/js/select2/i18n/da.js | 36 + .../select2/src/js/select2/i18n/de.js | 40 + .../select2/src/js/select2/i18n/dsb.js | 48 ++ .../select2/src/js/select2/i18n/el.js | 52 ++ .../select2/src/js/select2/i18n/en.js | 44 ++ .../select2/src/js/select2/i18n/es.js | 52 ++ .../select2/src/js/select2/i18n/et.js | 53 ++ .../select2/src/js/select2/i18n/eu.js | 51 ++ .../select2/src/js/select2/i18n/fa.js | 38 + .../select2/src/js/select2/i18n/fi.js | 30 + .../select2/src/js/select2/i18n/fr.js | 33 + .../select2/src/js/select2/i18n/gl.js | 39 + .../select2/src/js/select2/i18n/he.js | 56 ++ .../select2/src/js/select2/i18n/hi.js | 39 + .../select2/src/js/select2/i18n/hr.js | 44 ++ .../select2/src/js/select2/i18n/hsb.js | 48 ++ .../select2/src/js/select2/i18n/hu.js | 30 + .../select2/src/js/select2/i18n/hy.js | 38 + .../select2/src/js/select2/i18n/id.js | 30 + .../select2/src/js/select2/i18n/is.js | 41 + .../select2/src/js/select2/i18n/it.js | 48 ++ .../select2/src/js/select2/i18n/ja.js | 36 + .../select2/src/js/select2/i18n/km.js | 36 + .../select2/src/js/select2/i18n/ko.js | 36 + .../select2/src/js/select2/i18n/lt.js | 52 ++ .../select2/src/js/select2/i18n/lv.js | 51 ++ .../select2/src/js/select2/i18n/mk.js | 47 ++ .../select2/src/js/select2/i18n/ms.js | 30 + .../select2/src/js/select2/i18n/nb.js | 32 + .../select2/src/js/select2/i18n/nl.js | 43 ++ .../select2/src/js/select2/i18n/pl.js | 45 ++ .../select2/src/js/select2/i18n/ps.js | 45 ++ .../select2/src/js/select2/i18n/pt-BR.js | 46 ++ .../select2/src/js/select2/i18n/pt.js | 40 + .../select2/src/js/select2/i18n/ro.js | 46 ++ .../select2/src/js/select2/i18n/ru.js | 58 ++ .../select2/src/js/select2/i18n/sk.js | 59 ++ .../select2/src/js/select2/i18n/sl.js | 54 ++ .../select2/src/js/select2/i18n/sr-Cyrl.js | 55 ++ .../select2/src/js/select2/i18n/sr.js | 55 ++ .../select2/src/js/select2/i18n/sv.js | 37 + .../select2/src/js/select2/i18n/th.js | 36 + .../select2/src/js/select2/i18n/tr.js | 36 + .../select2/src/js/select2/i18n/uk.js | 43 ++ .../select2/src/js/select2/i18n/vi.js | 37 + .../select2/src/js/select2/i18n/zh-CN.js | 36 + .../select2/src/js/select2/i18n/zh-TW.js | 33 + .../select2/src/js/select2/keys.js | 25 + .../select2/src/js/select2/options.js | 122 +++ .../select2/src/js/select2/results.js | 523 +++++++++++++ .../select2/src/js/select2/selection/allowClear.js | 97 +++ .../select2/src/js/select2/selection/base.js | 158 ++++ .../select2/src/js/select2/selection/clickMask.js | 29 + .../select2/src/js/select2/selection/eventRelay.js | 45 ++ .../select2/src/js/select2/selection/multiple.js | 109 +++ .../src/js/select2/selection/placeholder.js | 49 ++ .../select2/src/js/select2/selection/search.js | 222 ++++++ .../select2/src/js/select2/selection/single.js | 99 +++ .../src/js/select2/selection/stopPropagation.js | 38 + .../select2/src/js/select2/translation.js | 36 + .../select2/src/js/select2/utils.js | 276 +++++++ .../bower_components/select2/src/js/wrapper.end.js | 12 + .../select2/src/js/wrapper.start.js | 38 + 104 files changed, 8069 insertions(+) create mode 100644 public/bower_components/select2/src/js/banner.end.js create mode 100644 public/bower_components/select2/src/js/banner.start.js create mode 100644 public/bower_components/select2/src/js/jquery.mousewheel.shim.js create mode 100644 public/bower_components/select2/src/js/jquery.select2.js create mode 100644 public/bower_components/select2/src/js/jquery.shim.js create mode 100644 public/bower_components/select2/src/js/select2/compat/containerCss.js create mode 100644 public/bower_components/select2/src/js/select2/compat/dropdownCss.js create mode 100644 public/bower_components/select2/src/js/select2/compat/initSelection.js create mode 100644 public/bower_components/select2/src/js/select2/compat/inputData.js create mode 100644 public/bower_components/select2/src/js/select2/compat/matcher.js create mode 100644 public/bower_components/select2/src/js/select2/compat/query.js create mode 100644 public/bower_components/select2/src/js/select2/compat/utils.js create mode 100644 public/bower_components/select2/src/js/select2/core.js create mode 100644 public/bower_components/select2/src/js/select2/data/ajax.js create mode 100644 public/bower_components/select2/src/js/select2/data/array.js create mode 100644 public/bower_components/select2/src/js/select2/data/base.js create mode 100644 public/bower_components/select2/src/js/select2/data/maximumInputLength.js create mode 100644 public/bower_components/select2/src/js/select2/data/maximumSelectionLength.js create mode 100644 public/bower_components/select2/src/js/select2/data/minimumInputLength.js create mode 100644 public/bower_components/select2/src/js/select2/data/select.js create mode 100644 public/bower_components/select2/src/js/select2/data/tags.js create mode 100644 public/bower_components/select2/src/js/select2/data/tokenizer.js create mode 100644 public/bower_components/select2/src/js/select2/defaults.js create mode 100644 public/bower_components/select2/src/js/select2/diacritics.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/attachBody.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/attachContainer.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/closeOnSelect.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/hidePlaceholder.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/infiniteScroll.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/minimumResultsForSearch.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/search.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/selectOnClose.js create mode 100644 public/bower_components/select2/src/js/select2/dropdown/stopPropagation.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/af.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ar.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/az.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/bg.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/bs.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ca.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/cs.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/da.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/de.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/dsb.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/el.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/en.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/es.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/et.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/eu.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/fa.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/fi.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/fr.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/gl.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/he.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/hi.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/hr.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/hsb.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/hu.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/hy.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/id.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/is.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/it.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ja.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/km.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ko.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/lt.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/lv.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/mk.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ms.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/nb.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/nl.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/pl.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ps.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/pt-BR.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/pt.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ro.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/ru.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/sk.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/sl.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/sr-Cyrl.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/sr.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/sv.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/th.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/tr.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/uk.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/vi.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/zh-CN.js create mode 100644 public/bower_components/select2/src/js/select2/i18n/zh-TW.js create mode 100644 public/bower_components/select2/src/js/select2/keys.js create mode 100644 public/bower_components/select2/src/js/select2/options.js create mode 100644 public/bower_components/select2/src/js/select2/results.js create mode 100644 public/bower_components/select2/src/js/select2/selection/allowClear.js create mode 100644 public/bower_components/select2/src/js/select2/selection/base.js create mode 100644 public/bower_components/select2/src/js/select2/selection/clickMask.js create mode 100644 public/bower_components/select2/src/js/select2/selection/eventRelay.js create mode 100644 public/bower_components/select2/src/js/select2/selection/multiple.js create mode 100644 public/bower_components/select2/src/js/select2/selection/placeholder.js create mode 100644 public/bower_components/select2/src/js/select2/selection/search.js create mode 100644 public/bower_components/select2/src/js/select2/selection/single.js create mode 100644 public/bower_components/select2/src/js/select2/selection/stopPropagation.js create mode 100644 public/bower_components/select2/src/js/select2/translation.js create mode 100644 public/bower_components/select2/src/js/select2/utils.js create mode 100644 public/bower_components/select2/src/js/wrapper.end.js create mode 100644 public/bower_components/select2/src/js/wrapper.start.js (limited to 'public/bower_components/select2/src/js') diff --git a/public/bower_components/select2/src/js/banner.end.js b/public/bower_components/select2/src/js/banner.end.js new file mode 100644 index 0000000..ea00a03 --- /dev/null +++ b/public/bower_components/select2/src/js/banner.end.js @@ -0,0 +1,6 @@ + // Return the AMD loader configuration so it can be used outside of this file + return { + define: S2.define, + require: S2.require + }; +}()); diff --git a/public/bower_components/select2/src/js/banner.start.js b/public/bower_components/select2/src/js/banner.start.js new file mode 100644 index 0000000..78fe8b0 --- /dev/null +++ b/public/bower_components/select2/src/js/banner.start.js @@ -0,0 +1,6 @@ +(function () { + // Restore the Select2 AMD loader so it can be used + // Needed mostly in the language files, where the loader is not inserted + if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { + var S2 = jQuery.fn.select2.amd; + } diff --git a/public/bower_components/select2/src/js/jquery.mousewheel.shim.js b/public/bower_components/select2/src/js/jquery.mousewheel.shim.js new file mode 100644 index 0000000..a27fda0 --- /dev/null +++ b/public/bower_components/select2/src/js/jquery.mousewheel.shim.js @@ -0,0 +1,6 @@ +define([ + 'jquery' +], function ($) { + // Used to shim jQuery.mousewheel for non-full builds. + return $; +}); diff --git a/public/bower_components/select2/src/js/jquery.select2.js b/public/bower_components/select2/src/js/jquery.select2.js new file mode 100644 index 0000000..a3f8eff --- /dev/null +++ b/public/bower_components/select2/src/js/jquery.select2.js @@ -0,0 +1,57 @@ +define([ + 'jquery', + 'jquery-mousewheel', + + './select2/core', + './select2/defaults' +], function ($, _, Select2, Defaults) { + if ($.fn.select2 == null) { + // All methods that should return the element + var thisMethods = ['open', 'close', 'destroy']; + + $.fn.select2 = function (options) { + options = options || {}; + + if (typeof options === 'object') { + this.each(function () { + var instanceOptions = $.extend(true, {}, options); + + var instance = new Select2($(this), instanceOptions); + }); + + return this; + } else if (typeof options === 'string') { + var ret; + var args = Array.prototype.slice.call(arguments, 1); + + this.each(function () { + var instance = $(this).data('select2'); + + if (instance == null && window.console && console.error) { + console.error( + 'The select2(\'' + options + '\') method was called on an ' + + 'element that is not using Select2.' + ); + } + + ret = instance[options].apply(instance, args); + }); + + // Check if we should be returning `this` + if ($.inArray(options, thisMethods) > -1) { + return this; + } + + return ret; + } else { + throw new Error('Invalid arguments for Select2: ' + options); + } + }; + } + + if ($.fn.select2.defaults == null) { + $.fn.select2.defaults = Defaults; + } + + return Select2; +}); diff --git a/public/bower_components/select2/src/js/jquery.shim.js b/public/bower_components/select2/src/js/jquery.shim.js new file mode 100644 index 0000000..880993a --- /dev/null +++ b/public/bower_components/select2/src/js/jquery.shim.js @@ -0,0 +1,14 @@ +/* global jQuery:false, $:false */ +define(function () { + var _$ = jQuery || $; + + if (_$ == null && 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.' + ); + } + + return _$; +}); diff --git a/public/bower_components/select2/src/js/select2/compat/containerCss.js b/public/bower_components/select2/src/js/select2/compat/containerCss.js new file mode 100644 index 0000000..45703ac --- /dev/null +++ b/public/bower_components/select2/src/js/select2/compat/containerCss.js @@ -0,0 +1,56 @@ +define([ + 'jquery', + './utils' +], function ($, CompatUtils) { + // No-op CSS adapter that discards all classes by default + function _containerAdapter (clazz) { + return null; + } + + function ContainerCSS () { } + + ContainerCSS.prototype.render = function (decorated) { + var $container = decorated.call(this); + + var containerCssClass = this.options.get('containerCssClass') || ''; + + if ($.isFunction(containerCssClass)) { + containerCssClass = containerCssClass(this.$element); + } + + var containerCssAdapter = this.options.get('adaptContainerCssClass'); + containerCssAdapter = containerCssAdapter || _containerAdapter; + + if (containerCssClass.indexOf(':all:') !== -1) { + containerCssClass = containerCssClass.replace(':all:', ''); + + var _cssAdapter = containerCssAdapter; + + containerCssAdapter = function (clazz) { + var adapted = _cssAdapter(clazz); + + if (adapted != null) { + // Append the old one along with the adapted one + return adapted + ' ' + clazz; + } + + return clazz; + }; + } + + var containerCss = this.options.get('containerCss') || {}; + + if ($.isFunction(containerCss)) { + containerCss = containerCss(this.$element); + } + + CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); + + $container.css(containerCss); + $container.addClass(containerCssClass); + + return $container; + }; + + return ContainerCSS; +}); diff --git a/public/bower_components/select2/src/js/select2/compat/dropdownCss.js b/public/bower_components/select2/src/js/select2/compat/dropdownCss.js new file mode 100644 index 0000000..02f5582 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/compat/dropdownCss.js @@ -0,0 +1,56 @@ +define([ + 'jquery', + './utils' +], function ($, CompatUtils) { + // No-op CSS adapter that discards all classes by default + function _dropdownAdapter (clazz) { + return null; + } + + function DropdownCSS () { } + + DropdownCSS.prototype.render = function (decorated) { + var $dropdown = decorated.call(this); + + var dropdownCssClass = this.options.get('dropdownCssClass') || ''; + + if ($.isFunction(dropdownCssClass)) { + dropdownCssClass = dropdownCssClass(this.$element); + } + + var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); + dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; + + if (dropdownCssClass.indexOf(':all:') !== -1) { + dropdownCssClass = dropdownCssClass.replace(':all:', ''); + + var _cssAdapter = dropdownCssAdapter; + + dropdownCssAdapter = function (clazz) { + var adapted = _cssAdapter(clazz); + + if (adapted != null) { + // Append the old one along with the adapted one + return adapted + ' ' + clazz; + } + + return clazz; + }; + } + + var dropdownCss = this.options.get('dropdownCss') || {}; + + if ($.isFunction(dropdownCss)) { + dropdownCss = dropdownCss(this.$element); + } + + CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); + + $dropdown.css(dropdownCss); + $dropdown.addClass(dropdownCssClass); + + return $dropdown; + }; + + return DropdownCSS; +}); diff --git a/public/bower_components/select2/src/js/select2/compat/initSelection.js b/public/bower_components/select2/src/js/select2/compat/initSelection.js new file mode 100644 index 0000000..71ee29d --- /dev/null +++ b/public/bower_components/select2/src/js/select2/compat/initSelection.js @@ -0,0 +1,42 @@ +define([ + 'jquery' +], function ($) { + function InitSelection (decorated, $element, options) { + if (options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `initSelection` option has been deprecated in favor' + + ' of a custom data adapter that overrides the `current` method. ' + + 'This method is now called multiple times instead of a single ' + + 'time when the instance is initialized. Support will be removed ' + + 'for the `initSelection` option in future versions of Select2' + ); + } + + this.initSelection = options.get('initSelection'); + this._isInitialized = false; + + decorated.call(this, $element, options); + } + + InitSelection.prototype.current = function (decorated, callback) { + var self = this; + + if (this._isInitialized) { + decorated.call(this, callback); + + return; + } + + this.initSelection.call(null, this.$element, function (data) { + self._isInitialized = true; + + if (!$.isArray(data)) { + data = [data]; + } + + callback(data); + }); + }; + + return InitSelection; +}); diff --git a/public/bower_components/select2/src/js/select2/compat/inputData.js b/public/bower_components/select2/src/js/select2/compat/inputData.js new file mode 100644 index 0000000..a338bf1 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/compat/inputData.js @@ -0,0 +1,127 @@ +define([ + 'jquery' +], function ($) { + function InputData (decorated, $element, options) { + this._currentData = []; + this._valueSeparator = options.get('valueSeparator') || ','; + + if ($element.prop('type') === 'hidden') { + if (options.get('debug') && console && console.warn) { + console.warn( + 'Select2: Using a hidden input with Select2 is no longer ' + + 'supported and may stop working in the future. It is recommended ' + + 'to use a `' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + $rendered.prepend($search); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + this.$search.on('keydown', function (evt) { + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + }); + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$search.on('input', function (evt) { + // Unbind the duplicated `keyup` event + $(this).off('keyup'); + }); + + this.$search.on('keyup input', function (evt) { + self.handleSearch(evt); + }); + + container.on('open', function () { + self.$search.attr('tabindex', 0); + + self.$search.focus(); + + window.setTimeout(function () { + self.$search.focus(); + }, 0); + }); + + container.on('close', function () { + self.$search.attr('tabindex', -1); + + self.$search.val(''); + }); + + container.on('focus', function () { + if (!container.isOpen()) { + self.$search.focus(); + } + }); + + container.on('results:all', function (params) { + if (params.query.term == null || params.query.term === '') { + var showSearch = self.showSearch(params); + + if (showSearch) { + self.$searchContainer.removeClass('select2-search--hide'); + } else { + self.$searchContainer.addClass('select2-search--hide'); + } + } + }); + }; + + Search.prototype.handleSearch = function (evt) { + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.showSearch = function (_, params) { + return true; + }; + + return Search; +}); diff --git a/public/bower_components/select2/src/js/select2/dropdown/selectOnClose.js b/public/bower_components/select2/src/js/select2/dropdown/selectOnClose.js new file mode 100644 index 0000000..430c032 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/dropdown/selectOnClose.js @@ -0,0 +1,50 @@ +define([ + +], function () { + function SelectOnClose () { } + + SelectOnClose.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('close', function (params) { + self._handleSelectOnClose(params); + }); + }; + + SelectOnClose.prototype._handleSelectOnClose = function (_, params) { + if (params && params.originalSelect2Event != null) { + var event = params.originalSelect2Event; + + // Don't select an item if the close event was triggered from a select or + // unselect event + if (event._type === 'select' || event._type === 'unselect') { + return; + } + } + + var $highlightedResults = this.getHighlightedResults(); + + // Only select highlighted results + if ($highlightedResults.length < 1) { + return; + } + + var data = $highlightedResults.data('data'); + + // Don't re-select already selected resulte + if ( + (data.element != null && data.element.selected) || + (data.element == null && data.selected) + ) { + return; + } + + this.trigger('select', { + data: data + }); + }; + + return SelectOnClose; +}); diff --git a/public/bower_components/select2/src/js/select2/dropdown/stopPropagation.js b/public/bower_components/select2/src/js/select2/dropdown/stopPropagation.js new file mode 100644 index 0000000..4f64182 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/dropdown/stopPropagation.js @@ -0,0 +1,38 @@ +define([ + +], function () { + function StopPropagation () { } + + StopPropagation.prototype.bind = function (decorated, container, $container) { + decorated.call(this, container, $container); + + var stoppedEvents = [ + 'blur', + 'change', + 'click', + 'dblclick', + 'focus', + 'focusin', + 'focusout', + 'input', + 'keydown', + 'keyup', + 'keypress', + 'mousedown', + 'mouseenter', + 'mouseleave', + 'mousemove', + 'mouseover', + 'mouseup', + 'search', + 'touchend', + 'touchstart' + ]; + + this.$dropdown.on(stoppedEvents.join(' '), function (evt) { + evt.stopPropagation(); + }); + }; + + return StopPropagation; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/af.js b/public/bower_components/select2/src/js/select2/i18n/af.js new file mode 100644 index 0000000..2651930 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/af.js @@ -0,0 +1,44 @@ +define(function () { + // English + return { + errorLoading: function () { + return 'Die resultate kon nie gelaai word nie.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Verwyders asseblief ' + overChars + ' character'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Voer asseblief ' + remainingChars + ' of meer karakters'; + + return message; + }, + loadingMore: function () { + return 'Meer resultate word gelaai…'; + }, + maximumSelected: function (args) { + var message = 'Kies asseblief net ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'Geen resultate gevind'; + }, + searching: function () { + return 'Besig…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ar.js b/public/bower_components/select2/src/js/select2/i18n/ar.js new file mode 100644 index 0000000..be9ea68 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ar.js @@ -0,0 +1,30 @@ +define(function () { + // Arabic + return { + errorLoading: function () { + return 'لا يمكن تحميل النتائج'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'الرجاء حذف ' + overChars + ' عناصر'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'الرجاء إضافة ' + remainingChars + ' عناصر'; + }, + loadingMore: function () { + return 'جاري تحميل نتائج إضافية...'; + }, + maximumSelected: function (args) { + return 'تستطيع إختيار ' + args.maximum + ' بنود فقط'; + }, + noResults: function () { + return 'لم يتم العثور على أي نتائج'; + }, + searching: function () { + return 'جاري البحث…'; + } + }; +}); \ No newline at end of file diff --git a/public/bower_components/select2/src/js/select2/i18n/az.js b/public/bower_components/select2/src/js/select2/i18n/az.js new file mode 100644 index 0000000..0d9bda4 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/az.js @@ -0,0 +1,27 @@ +define(function () { + // Azerbaijani + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return overChars + ' simvol silin'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return remainingChars + ' simvol daxil edin'; + }, + loadingMore: function () { + return 'Daha çox nəticə yüklənir…'; + }, + maximumSelected: function (args) { + return 'Sadəcə ' + args.maximum + ' element seçə bilərsiniz'; + }, + noResults: function () { + return 'Nəticə tapılmadı'; + }, + searching: function () { + return 'Axtarılır…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/bg.js b/public/bower_components/select2/src/js/select2/i18n/bg.js new file mode 100644 index 0000000..909b4e5 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/bg.js @@ -0,0 +1,47 @@ +define(function () { + // Bulgarian + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Моля въведете с ' + overChars + ' по-малко символ'; + + if (overChars > 1) { + message += 'a'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Моля въведете още ' + remainingChars + ' символ'; + + if (remainingChars > 1) { + message += 'a'; + } + + return message; + }, + loadingMore: function () { + return 'Зареждат се още…'; + }, + maximumSelected: function (args) { + var message = 'Можете да направите до ' + args.maximum + ' '; + + if (args.maximum > 1) { + message += 'избора'; + } else { + message += 'избор'; + } + + return message; + }, + noResults: function () { + return 'Няма намерени съвпадения'; + }, + searching: function () { + return 'Търсене…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/bs.js b/public/bower_components/select2/src/js/select2/i18n/bs.js new file mode 100644 index 0000000..4446a0e --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/bs.js @@ -0,0 +1,55 @@ +define(function () { + // Bosnian + function ending (count, one, some, many) { + if (count % 10 == 1 && count % 100 != 11) { + return one; + } + + if (count % 10 >= 2 && count % 10 <= 4 && + (count % 100 < 12 || count % 100 > 14)) { + return some; + } + + return many; + } + + return { + errorLoading: function () { + return 'Preuzimanje nije uspijelo.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Obrišite ' + overChars + ' simbol'; + + message += ending(overChars, '', 'a', 'a'); + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Ukucajte bar još ' + remainingChars + ' simbol'; + + message += ending(remainingChars, '', 'a', 'a'); + + return message; + }, + loadingMore: function () { + return 'Preuzimanje još rezultata…'; + }, + maximumSelected: function (args) { + var message = 'Možete izabrati samo ' + args.maximum + ' stavk'; + + message += ending(args.maximum, 'u', 'e', 'i'); + + return message; + }, + noResults: function () { + return 'Ništa nije pronađeno'; + }, + searching: function () { + return 'Pretraga…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ca.js b/public/bower_components/select2/src/js/select2/i18n/ca.js new file mode 100644 index 0000000..7aa8cc6 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ca.js @@ -0,0 +1,52 @@ +define(function () { + // Catalan + return { + errorLoading: function () { + return 'La càrrega ha fallat'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Si us plau, elimina ' + overChars + ' car'; + + if (overChars == 1) { + message += 'àcter'; + } else { + message += 'àcters'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Si us plau, introdueix ' + remainingChars + ' car'; + + if (remainingChars == 1) { + message += 'àcter'; + } else { + message += 'àcters'; + } + + return message; + }, + loadingMore: function () { + return 'Carregant més resultats…'; + }, + maximumSelected: function (args) { + var message = 'Només es pot seleccionar ' + args.maximum + ' element'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No s\'han trobat resultats'; + }, + searching: function () { + return 'Cercant…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/cs.js b/public/bower_components/select2/src/js/select2/i18n/cs.js new file mode 100644 index 0000000..6d8a193 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/cs.js @@ -0,0 +1,61 @@ +define(function () { + // Czech + function small (count, masc) { + switch(count) { + case 2: + return masc ? 'dva' : 'dvě'; + case 3: + return 'tři'; + case 4: + return 'čtyři'; + } + return ''; + } + return { + errorLoading: function () { + return 'Výsledky nemohly být načteny.'; + }, + inputTooLong: function (args) { + var n = args.input.length - args.maximum; + + if (n == 1) { + return 'Prosím, zadejte o jeden znak méně.'; + } else if (n <= 4) { + return 'Prosím, zadejte o ' + small(n, true) + ' znaky méně.'; + } else { + return 'Prosím, zadejte o ' + n + ' znaků méně.'; + } + }, + inputTooShort: function (args) { + var n = args.minimum - args.input.length; + + if (n == 1) { + return 'Prosím, zadejte ještě jeden znak.'; + } else if (n <= 4) { + return 'Prosím, zadejte ještě další ' + small(n, true) + ' znaky.'; + } else { + return 'Prosím, zadejte ještě dalších ' + n + ' znaků.'; + } + }, + loadingMore: function () { + return 'Načítají se další výsledky…'; + }, + maximumSelected: function (args) { + var n = args.maximum; + + if (n == 1) { + return 'Můžete zvolit jen jednu položku.'; + } else if (n <= 4) { + return 'Můžete zvolit maximálně ' + small(n, false) + ' položky.'; + } else { + return 'Můžete zvolit maximálně ' + n + ' položek.'; + } + }, + noResults: function () { + return 'Nenalezeny žádné položky.'; + }, + searching: function () { + return 'Vyhledávání…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/da.js b/public/bower_components/select2/src/js/select2/i18n/da.js new file mode 100644 index 0000000..2ce169f --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/da.js @@ -0,0 +1,36 @@ +define(function () { + // Danish + return { + errorLoading: function () { + return 'Resultaterne kunne ikke indlæses.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Angiv venligst ' + overChars + ' tegn mindre'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Angiv venligst ' + remainingChars + ' tegn mere'; + }, + loadingMore: function () { + return 'Indlæser flere resultater…'; + }, + maximumSelected: function (args) { + var message = 'Du kan kun vælge ' + args.maximum + ' emne'; + + if (args.maximum != 1) { + message += 'r'; + } + + return message; + }, + noResults: function () { + return 'Ingen resultater fundet'; + }, + searching: function () { + return 'Søger…'; + } + }; +}); \ No newline at end of file diff --git a/public/bower_components/select2/src/js/select2/i18n/de.js b/public/bower_components/select2/src/js/select2/i18n/de.js new file mode 100644 index 0000000..c804fed --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/de.js @@ -0,0 +1,40 @@ +define(function () { + // German + return { + errorLoading: function () { + return 'Die Ergebnisse konnten nicht geladen werden.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Bitte ' + overChars + ' Zeichen weniger eingeben'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Bitte ' + remainingChars + ' Zeichen mehr eingeben'; + }, + loadingMore: function () { + return 'Lade mehr Ergebnisse…'; + }, + maximumSelected: function (args) { + var message = 'Sie können nur ' + args.maximum + ' Eintr'; + + if (args.maximum === 1) { + message += 'ag'; + } else { + message += 'äge'; + } + + message += ' auswählen'; + + return message; + }, + noResults: function () { + return 'Keine Übereinstimmungen gefunden'; + }, + searching: function () { + return 'Suche…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/dsb.js b/public/bower_components/select2/src/js/select2/i18n/dsb.js new file mode 100644 index 0000000..8180b21 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/dsb.js @@ -0,0 +1,48 @@ +define(function () { + // Lower Sorbian + var charsWords = ['znamuško', 'znamušce', 'znamuška','znamuškow']; + var itemsWords = ['zapisk', 'zapiska', 'zapiski','zapiskow']; + + var pluralWord = function pluralWord(numberOfChars, words) { + if (numberOfChars === 1) { + return words[0]; + } else if (numberOfChars === 2) { + return words[1]; + } else if (numberOfChars > 2 && numberOfChars <= 4) { + return words[2]; + } else if (numberOfChars >= 5) { + return words[3]; + } + }; + + return { + errorLoading: function () { + return 'Wuslědki njejsu se dali zacytaś.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Pšosym lašuj ' + overChars + ' ' + + pluralWord(overChars, charsWords); + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Pšosym zapódaj nanejmjenjej ' + remainingChars + ' ' + + pluralWord(remainingChars, charsWords); + }, + loadingMore: function () { + return 'Dalšne wuslědki se zacytaju…'; + }, + maximumSelected: function (args) { + return 'Móžoš jano ' + args.maximum + ' ' + + pluralWord(args.maximum, itemsWords) + 'wubraś.'; + }, + noResults: function () { + return 'Žedne wuslědki namakane'; + }, + searching: function () { + return 'Pyta se…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/el.js b/public/bower_components/select2/src/js/select2/i18n/el.js new file mode 100644 index 0000000..9cf8ee4 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/el.js @@ -0,0 +1,52 @@ +define(function () { + // Greek (el) + return { + errorLoading: function () { + return 'Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Παρακαλώ διαγράψτε ' + overChars + ' χαρακτήρ'; + + if (overChars == 1) { + message += 'α'; + } + if (overChars != 1) { + message += 'ες'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Παρακαλώ συμπληρώστε ' + remainingChars + + ' ή περισσότερους χαρακτήρες'; + + return message; + }, + loadingMore: function () { + return 'Φόρτωση περισσότερων αποτελεσμάτων…'; + }, + maximumSelected: function (args) { + var message = 'Μπορείτε να επιλέξετε μόνο ' + args.maximum + ' επιλογ'; + + if (args.maximum == 1) { + message += 'ή'; + } + + if (args.maximum != 1) { + message += 'ές'; + } + + return message; + }, + noResults: function () { + return 'Δεν βρέθηκαν αποτελέσματα'; + }, + searching: function () { + return 'Αναζήτηση…'; + } + }; +}); \ No newline at end of file diff --git a/public/bower_components/select2/src/js/select2/i18n/en.js b/public/bower_components/select2/src/js/select2/i18n/en.js new file mode 100644 index 0000000..f226f2c --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/en.js @@ -0,0 +1,44 @@ +define(function () { + // English + return { + errorLoading: function () { + return 'The results could not be loaded.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Please delete ' + overChars + ' character'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Please enter ' + remainingChars + ' or more characters'; + + return message; + }, + loadingMore: function () { + return 'Loading more results…'; + }, + maximumSelected: function (args) { + var message = 'You can only select ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No results found'; + }, + searching: function () { + return 'Searching…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/es.js b/public/bower_components/select2/src/js/select2/i18n/es.js new file mode 100644 index 0000000..10884bd --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/es.js @@ -0,0 +1,52 @@ +define(function () { + // Spanish + return { + errorLoading: function () { + return 'No se pudieron cargar los resultados'; + }, + inputTooLong: function (args) { + var remainingChars = args.input.length - args.maximum; + + var message = 'Por favor, elimine ' + remainingChars + ' car'; + + if (remainingChars == 1) { + message += 'ácter'; + } else { + message += 'acteres'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Por favor, introduzca ' + remainingChars + ' car'; + + if (remainingChars == 1) { + message += 'ácter'; + } else { + message += 'acteres'; + } + + return message; + }, + loadingMore: function () { + return 'Cargando más resultados…'; + }, + maximumSelected: function (args) { + var message = 'Sólo puede seleccionar ' + args.maximum + ' elemento'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No se encontraron resultados'; + }, + searching: function () { + return 'Buscando…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/et.js b/public/bower_components/select2/src/js/select2/i18n/et.js new file mode 100644 index 0000000..d546ade --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/et.js @@ -0,0 +1,53 @@ +define(function () { + // Estonian + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Sisesta ' + overChars + ' täht'; + + if (overChars != 1) { + message += 'e'; + } + + message += ' vähem'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Sisesta ' + remainingChars + ' täht'; + + if (remainingChars != 1) { + message += 'e'; + } + + message += ' rohkem'; + + return message; + }, + loadingMore: function () { + return 'Laen tulemusi…'; + }, + maximumSelected: function (args) { + var message = 'Saad vaid ' + args.maximum + ' tulemus'; + + if (args.maximum == 1) { + message += 'e'; + } else { + message += 't'; + } + + message += ' valida'; + + return message; + }, + noResults: function () { + return 'Tulemused puuduvad'; + }, + searching: function () { + return 'Otsin…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/eu.js b/public/bower_components/select2/src/js/select2/i18n/eu.js new file mode 100644 index 0000000..4a1f894 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/eu.js @@ -0,0 +1,51 @@ +define(function () { + // Basque + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Idatzi '; + + if (overChars == 1) { + message += 'karaktere bat'; + } else { + message += overChars + ' karaktere'; + } + + message += ' gutxiago'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Idatzi '; + + if (remainingChars == 1) { + message += 'karaktere bat'; + } else { + message += remainingChars + ' karaktere'; + } + + message += ' gehiago'; + + return message; + }, + loadingMore: function () { + return 'Emaitza gehiago kargatzen…'; + }, + maximumSelected: function (args) { + if (args.maximum === 1) { + return 'Elementu bakarra hauta dezakezu'; + } else { + return args.maximum + ' elementu hauta ditzakezu soilik'; + } + }, + noResults: function () { + return 'Ez da bat datorrenik aurkitu'; + }, + searching: function () { + return 'Bilatzen…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/fa.js b/public/bower_components/select2/src/js/select2/i18n/fa.js new file mode 100644 index 0000000..64ce1a5 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/fa.js @@ -0,0 +1,38 @@ +/* jshint -W100 */ +/* jslint maxlen: 86 */ +define(function () { + // Farsi (Persian) + return { + errorLoading: function () { + return 'امکان بارگذاری نتایج وجود ندارد.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'لطفاً ' + overChars + ' کاراکتر را حذف نمایید'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'لطفاً تعداد ' + remainingChars + ' کاراکتر یا بیشتر وارد نمایید'; + + return message; + }, + loadingMore: function () { + return 'در حال بارگذاری نتایج بیشتر...'; + }, + maximumSelected: function (args) { + var message = 'شما تنها می‌توانید ' + args.maximum + ' آیتم را انتخاب نمایید'; + + return message; + }, + noResults: function () { + return 'هیچ نتیجه‌ای یافت نشد'; + }, + searching: function () { + return 'در حال جستجو...'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/fi.js b/public/bower_components/select2/src/js/select2/i18n/fi.js new file mode 100644 index 0000000..cf33a43 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/fi.js @@ -0,0 +1,30 @@ +define(function () { + // Finnish + return { + errorLoading: function () { + return 'Tuloksia ei saatu ladattua.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Ole hyvä ja anna ' + overChars + ' merkkiä vähemmän'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Ole hyvä ja anna ' + remainingChars + ' merkkiä lisää'; + }, + loadingMore: function () { + return 'Ladataan lisää tuloksia…'; + }, + maximumSelected: function (args) { + return 'Voit valita ainoastaan ' + args.maximum + ' kpl'; + }, + noResults: function () { + return 'Ei tuloksia'; + }, + searching: function () { + return 'Haetaan…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/fr.js b/public/bower_components/select2/src/js/select2/i18n/fr.js new file mode 100644 index 0000000..4f0cba1 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/fr.js @@ -0,0 +1,33 @@ +define(function () { + // French + return { + errorLoading: function () { + return 'Les résultats ne peuvent pas être chargés.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Supprimez ' + overChars + ' caractère' + + (overChars > 1) ? 's' : ''; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Saisissez au moins ' + remainingChars + ' caractère' + + (remainingChars > 1) ? 's' : ''; + }, + loadingMore: function () { + return 'Chargement de résultats supplémentaires…'; + }, + maximumSelected: function (args) { + return 'Vous pouvez seulement sélectionner ' + args.maximum + + ' élément' + (args.maximum > 1) ? 's' : ''; + }, + noResults: function () { + return 'Aucun résultat trouvé'; + }, + searching: function () { + return 'Recherche en cours…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/gl.js b/public/bower_components/select2/src/js/select2/i18n/gl.js new file mode 100644 index 0000000..3a9ffe3 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/gl.js @@ -0,0 +1,39 @@ +define(function () { + // Galician + return { + errorLoading: function () { + return 'Non foi posíbel cargar os resultados.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + if (overChars === 1) { + return 'Elimine un carácter'; + } + return 'Elimine ' + overChars + ' caracteres'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + if (remainingChars === 1) { + return 'Engada un carácter'; + } + return 'Engada ' + remainingChars + ' caracteres'; + }, + loadingMore: function () { + return 'Cargando máis resultados…'; + }, + maximumSelected: function (args) { + if (args.maximum === 1) { + return 'Só pode seleccionar un elemento'; + } + return 'Só pode seleccionar ' + args.maximum + ' elementos'; + }, + noResults: function () { + return 'Non se atoparon resultados'; + }, + searching: function () { + return 'Buscando…'; + } + }; +}); \ No newline at end of file diff --git a/public/bower_components/select2/src/js/select2/i18n/he.js b/public/bower_components/select2/src/js/select2/i18n/he.js new file mode 100644 index 0000000..5a27f81 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/he.js @@ -0,0 +1,56 @@ +define(function () { + // Hebrew + return { + errorLoading: function () { + return 'שגיאה בטעינת התוצאות'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'נא למחוק '; + + if (overChars === 1) { + message += 'תו אחד'; + } else { + message += overChars + ' תווים'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'נא להכניס '; + + if (remainingChars === 1) { + message += 'תו אחד'; + } else { + message += remainingChars + ' תווים'; + } + + message += ' או יותר'; + + return message; + }, + loadingMore: function () { + return 'טוען תוצאות נוספות…'; + }, + maximumSelected: function (args) { + var message = 'באפשרותך לבחור עד '; + + if (args.maximum === 1) { + message += 'פריט אחד'; + } else { + message += args.maximum + ' פריטים'; + } + + return message; + }, + noResults: function () { + return 'לא נמצאו תוצאות'; + }, + searching: function () { + return 'מחפש…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/hi.js b/public/bower_components/select2/src/js/select2/i18n/hi.js new file mode 100644 index 0000000..e8ee153 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/hi.js @@ -0,0 +1,39 @@ +define(function () { + // Hindi + return { + errorLoading: function () { + return 'परिणामों को लोड नहीं किया जा सका।'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = overChars + ' अक्षर को हटा दें'; + + if (overChars > 1) { + message = overChars + ' अक्षरों को हटा दें '; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'कृपया ' + remainingChars + ' या अधिक अक्षर दर्ज करें'; + + return message; + }, + loadingMore: function () { + return 'अधिक परिणाम लोड हो रहे है...'; + }, + maximumSelected: function (args) { + var message = 'आप केवल ' + args.maximum + ' आइटम का चयन कर सकते हैं'; + return message; + }, + noResults: function () { + return 'कोई परिणाम नहीं मिला'; + }, + searching: function () { + return 'खोज रहा है...'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/hr.js b/public/bower_components/select2/src/js/select2/i18n/hr.js new file mode 100644 index 0000000..81462a5 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/hr.js @@ -0,0 +1,44 @@ +define(function () { + // Croatian + function character (n) { + var message = ' ' + n + ' znak'; + + if (n % 10 < 5 && n % 10 > 0 && (n % 100 < 5 || n % 100 > 19)) { + if (n % 10 > 1) { + message += 'a'; + } + } else { + message += 'ova'; + } + + return message; + } + + return { + errorLoading: function () { + return 'Preuzimanje nije uspjelo.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Unesite ' + character(overChars); + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Unesite još ' + character(remainingChars); + }, + loadingMore: function () { + return 'Učitavanje rezultata…'; + }, + maximumSelected: function (args) { + return 'Maksimalan broj odabranih stavki je ' + args.maximum; + }, + noResults: function () { + return 'Nema rezultata'; + }, + searching: function () { + return 'Pretraga…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/hsb.js b/public/bower_components/select2/src/js/select2/i18n/hsb.js new file mode 100644 index 0000000..14b1eda --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/hsb.js @@ -0,0 +1,48 @@ +define(function () { + // Upper Sorbian + var charsWords = ['znamješko', 'znamješce', 'znamješka','znamješkow']; + var itemsWords = ['zapisk', 'zapiskaj', 'zapiski','zapiskow']; + + var pluralWord = function pluralWord(numberOfChars, words) { + if (numberOfChars === 1) { + return words[0]; + } else if (numberOfChars === 2) { + return words[1]; + } else if (numberOfChars > 2 && numberOfChars <= 4) { + return words[2]; + } else if (numberOfChars >= 5) { + return words[3]; + } + }; + + return { + errorLoading: function () { + return 'Wuslědki njedachu so začitać.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Prošu zhašej ' + overChars + ' ' + + pluralWord(overChars, charsWords); + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Prošu zapodaj znajmjeńša ' + remainingChars + ' ' + + pluralWord(remainingChars, charsWords); + }, + loadingMore: function () { + return 'Dalše wuslědki so začitaja…'; + }, + maximumSelected: function (args) { + return 'Móžeš jenož ' + args.maximum + ' ' + + pluralWord(args.maximum, itemsWords) + 'wubrać'; + }, + noResults: function () { + return 'Žane wuslědki namakane'; + }, + searching: function () { + return 'Pyta so…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/hu.js b/public/bower_components/select2/src/js/select2/i18n/hu.js new file mode 100644 index 0000000..fbe1d77 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/hu.js @@ -0,0 +1,30 @@ +define(function () { + // Hungarian + return { + errorLoading: function () { + return 'Az eredmények betöltése nem sikerült.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Túl hosszú. ' + overChars + ' karakterrel több, mint kellene.'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Túl rövid. Még ' + remainingChars + ' karakter hiányzik.'; + }, + loadingMore: function () { + return 'Töltés…'; + }, + maximumSelected: function (args) { + return 'Csak ' + args.maximum + ' elemet lehet kiválasztani.'; + }, + noResults: function () { + return 'Nincs találat.'; + }, + searching: function () { + return 'Keresés…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/hy.js b/public/bower_components/select2/src/js/select2/i18n/hy.js new file mode 100644 index 0000000..098c350 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/hy.js @@ -0,0 +1,38 @@ +define(function () { + // Armenian + return { + errorLoading: function () { + return 'Արդյունքները հնարավոր չէ բեռնել։'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Խնդրում ենք հեռացնել ' + overChars + ' նշան'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Խնդրում ենք մուտքագրել ' + remainingChars + + ' կամ ավել նշաններ'; + + return message; + }, + loadingMore: function () { + return 'Բեռնվում են նոր արդյունքներ․․․'; + }, + maximumSelected: function (args) { + var message = 'Դուք կարող եք ընտրել առավելագույնը ' + args.maximum + + ' կետ'; + + return message; + }, + noResults: function () { + return 'Արդյունքներ չեն գտնվել'; + }, + searching: function () { + return 'Որոնում․․․'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/id.js b/public/bower_components/select2/src/js/select2/i18n/id.js new file mode 100644 index 0000000..43b632e --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/id.js @@ -0,0 +1,30 @@ +define(function () { + // Indonesian + return { + errorLoading: function () { + return 'Data tidak boleh diambil.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Hapuskan ' + overChars + ' huruf'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Masukkan ' + remainingChars + ' huruf lagi'; + }, + loadingMore: function () { + return 'Mengambil data…'; + }, + maximumSelected: function (args) { + return 'Anda hanya dapat memilih ' + args.maximum + ' pilihan'; + }, + noResults: function () { + return 'Tidak ada data yang sesuai'; + }, + searching: function () { + return 'Mencari…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/is.js b/public/bower_components/select2/src/js/select2/i18n/is.js new file mode 100644 index 0000000..7a835f5 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/is.js @@ -0,0 +1,41 @@ +define(function () { + // Icelandic + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Vinsamlegast styttið texta um ' + overChars + ' staf'; + + if (overChars <= 1) { + return message; + } + + return message + 'i'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Vinsamlegast skrifið ' + remainingChars + ' staf'; + + if (remainingChars > 1) { + message += 'i'; + } + + message += ' í viðbót'; + + return message; + }, + loadingMore: function () { + return 'Sæki fleiri niðurstöður…'; + }, + maximumSelected: function (args) { + return 'Þú getur aðeins valið ' + args.maximum + ' atriði'; + }, + noResults: function () { + return 'Ekkert fannst'; + }, + searching: function () { + return 'Leita…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/it.js b/public/bower_components/select2/src/js/select2/i18n/it.js new file mode 100644 index 0000000..76c2e4b --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/it.js @@ -0,0 +1,48 @@ +define(function () { + // Italian + return { + errorLoading: function () { + return 'I risultati non possono essere caricati.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Per favore cancella ' + overChars + ' caratter'; + + if (overChars !== 1) { + message += 'i'; + } else { + message += 'e'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Per favore inserisci ' +remainingChars+ ' o più caratteri'; + + return message; + }, + loadingMore: function () { + return 'Caricando più risultati…'; + }, + maximumSelected: function (args) { + var message = 'Puoi selezionare solo ' + args.maximum + ' element'; + + if (args.maximum !== 1) { + message += 'i'; + } else { + message += 'o'; + } + + return message; + }, + noResults: function () { + return 'Nessun risultato trovato'; + }, + searching: function () { + return 'Sto cercando…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ja.js b/public/bower_components/select2/src/js/select2/i18n/ja.js new file mode 100644 index 0000000..c954c4f --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ja.js @@ -0,0 +1,36 @@ +define(function () { + // Japanese + return { + errorLoading: function () { + return '結果が読み込まれませんでした'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = overChars + ' 文字を削除してください'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = '少なくとも ' + remainingChars + ' 文字を入力してください'; + + return message; + }, + loadingMore: function () { + return '読み込み中…'; + }, + maximumSelected: function (args) { + var message = args.maximum + ' 件しか選択できません'; + + return message; + }, + noResults: function () { + return '対象が見つかりません'; + }, + searching: function () { + return '検索しています…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/km.js b/public/bower_components/select2/src/js/select2/i18n/km.js new file mode 100644 index 0000000..10e3d7e --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/km.js @@ -0,0 +1,36 @@ +define(function () { + // Khmer + return { + errorLoading: function () { + return 'មិនអាចទាញយកទិន្នន័យ'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'សូមលុបចេញ ' + overChars + ' អក្សរ'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'សូមបញ្ចូល' + remainingChars + ' អក្សរ រឺ ច្រើនជាងនេះ'; + + return message; + }, + loadingMore: function () { + return 'កំពុងទាញយកទិន្នន័យបន្ថែម...'; + }, + maximumSelected: function (args) { + var message = 'អ្នកអាចជ្រើសរើសបានតែ ' + args.maximum + ' ជម្រើសប៉ុណ្ណោះ'; + + return message; + }, + noResults: function () { + return 'មិនមានលទ្ធផល'; + }, + searching: function () { + return 'កំពុងស្វែងរក...'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ko.js b/public/bower_components/select2/src/js/select2/i18n/ko.js new file mode 100644 index 0000000..9a2de10 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ko.js @@ -0,0 +1,36 @@ +define(function () { + // Korean + return { + errorLoading: function () { + return '결과를 불러올 수 없습니다.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = '너무 깁니다. ' + overChars + ' 글자 지워주세요.'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = '너무 짧습니다. ' + remainingChars + ' 글자 더 입력해주세요.'; + + return message; + }, + loadingMore: function () { + return '불러오는 중…'; + }, + maximumSelected: function (args) { + var message = '최대 ' + args.maximum + '개까지만 선택 가능합니다.'; + + return message; + }, + noResults: function () { + return '결과가 없습니다.'; + }, + searching: function () { + return '검색 중…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/lt.js b/public/bower_components/select2/src/js/select2/i18n/lt.js new file mode 100644 index 0000000..500a519 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/lt.js @@ -0,0 +1,52 @@ +define(function () { + // rules from + // http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#lt + function ending(count, one, few, other) { + if (count % 10 === 1 && (count % 100 < 11 || count % 100 > 19)) { + return one; + } else if ( + (count % 10 >= 2 && count % 10 <= 9) && + (count % 100 < 11 || count % 100 > 19)) { + return few; + } else { + return other; + } + } + + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Pašalinkite ' + overChars + ' simbol'; + + message += ending(overChars, 'į', 'ius', 'ių'); + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Įrašykite dar ' + remainingChars + ' simbol'; + + message += ending(remainingChars, 'į', 'ius', 'ių'); + + return message; + }, + loadingMore: function () { + return 'Kraunama daugiau rezultatų…'; + }, + maximumSelected: function (args) { + var message = 'Jūs galite pasirinkti tik ' + args.maximum + ' element'; + + message += ending(args.maximum, 'ą', 'us', 'ų'); + + return message; + }, + noResults: function () { + return 'Atitikmenų nerasta'; + }, + searching: function () { + return 'Ieškoma…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/lv.js b/public/bower_components/select2/src/js/select2/i18n/lv.js new file mode 100644 index 0000000..560cab0 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/lv.js @@ -0,0 +1,51 @@ +define(function () { + // Latvian + function ending (count, eleven, singular, other) { + if (count === 11) { + return eleven; + } + + if (count % 10 === 1) { + return singular; + } + + return other; + } + + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Lūdzu ievadiet par ' + overChars; + + message += ' simbol' + ending(overChars, 'iem', 'u', 'iem'); + + return message + ' mazāk'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Lūdzu ievadiet vēl ' + remainingChars; + + message += ' simbol' + ending(remainingChars, 'us', 'u', 'us'); + + return message; + }, + loadingMore: function () { + return 'Datu ielāde…'; + }, + maximumSelected: function (args) { + var message = 'Jūs varat izvēlēties ne vairāk kā ' + args.maximum; + + message += ' element' + ending(args.maximum, 'us', 'u', 'us'); + + return message; + }, + noResults: function () { + return 'Sakritību nav'; + }, + searching: function () { + return 'Meklēšana…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/mk.js b/public/bower_components/select2/src/js/select2/i18n/mk.js new file mode 100644 index 0000000..a27f0e8 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/mk.js @@ -0,0 +1,47 @@ +define(function () { + // Macedonian + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Ве молиме внесете ' + args.maximum + ' помалку карактер'; + + if (args.maximum !== 1) { + message += 'и'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Ве молиме внесете уште ' + args.maximum + ' карактер'; + + if (args.maximum !== 1) { + message += 'и'; + } + + return message; + }, + loadingMore: function () { + return 'Вчитување резултати…'; + }, + maximumSelected: function (args) { + var message = 'Можете да изберете само ' + args.maximum + ' ставк'; + + if (args.maximum === 1) { + message += 'а'; + } else { + message += 'и'; + } + + return message; + }, + noResults: function () { + return 'Нема пронајдено совпаѓања'; + }, + searching: function () { + return 'Пребарување…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ms.js b/public/bower_components/select2/src/js/select2/i18n/ms.js new file mode 100644 index 0000000..3c11562 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ms.js @@ -0,0 +1,30 @@ +define(function () { + // Malay + return { + errorLoading: function () { + return 'Keputusan tidak berjaya dimuatkan.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Sila hapuskan ' + overChars + ' aksara'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Sila masukkan ' + remainingChars + ' atau lebih aksara'; + }, + loadingMore: function () { + return 'Sedang memuatkan keputusan…'; + }, + maximumSelected: function (args) { + return 'Anda hanya boleh memilih ' + args.maximum + ' pilihan'; + }, + noResults: function () { + return 'Tiada padanan yang ditemui'; + }, + searching: function () { + return 'Mencari…'; + } + }; +}); \ No newline at end of file diff --git a/public/bower_components/select2/src/js/select2/i18n/nb.js b/public/bower_components/select2/src/js/select2/i18n/nb.js new file mode 100644 index 0000000..d42fb7d --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/nb.js @@ -0,0 +1,32 @@ +define(function () { + // Norwegian (Bokmål) + return { + errorLoading: function () { + return 'Kunne ikke hente resultater.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Vennligst fjern ' + overChars + ' tegn'; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Vennligst skriv inn ' + remainingChars + ' tegn til'; + + return message + ' tegn til'; + }, + loadingMore: function () { + return 'Laster flere resultater…'; + }, + maximumSelected: function (args) { + return 'Du kan velge maks ' + args.maximum + ' elementer'; + }, + noResults: function () { + return 'Ingen treff'; + }, + searching: function () { + return 'Søker…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/nl.js b/public/bower_components/select2/src/js/select2/i18n/nl.js new file mode 100644 index 0000000..e8c016a --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/nl.js @@ -0,0 +1,43 @@ +define(function () { + // Dutch + return { + errorLoading: function () { + return 'De resultaten konden niet worden geladen.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Gelieve ' + overChars + ' karakters te verwijderen'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Gelieve ' + remainingChars + + ' of meer karakters in te voeren'; + + return message; + }, + loadingMore: function () { + return 'Meer resultaten laden…'; + }, + maximumSelected: function (args) { + var verb = args.maximum == 1 ? 'kan' : 'kunnen'; + var message = 'Er ' + verb + ' maar ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + message += ' worden geselecteerd'; + + return message; + }, + noResults: function () { + return 'Geen resultaten gevonden…'; + }, + searching: function () { + return 'Zoeken…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/pl.js b/public/bower_components/select2/src/js/select2/i18n/pl.js new file mode 100644 index 0000000..030a4dd --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/pl.js @@ -0,0 +1,45 @@ +define(function () { + // Polish + var charsWords = ['znak', 'znaki', 'znaków']; + var itemsWords = ['element', 'elementy', 'elementów']; + + var pluralWord = function pluralWord(numberOfChars, words) { + if (numberOfChars === 1) { + return words[0]; + } else if (numberOfChars > 1 && numberOfChars <= 4) { + return words[1]; + } else if (numberOfChars >= 5) { + return words[2]; + } + }; + + return { + errorLoading: function () { + return 'Nie można załadować wyników.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Usuń ' + overChars + ' ' + pluralWord(overChars, charsWords); + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Podaj przynajmniej ' + remainingChars + ' ' + + pluralWord(remainingChars, charsWords); + }, + loadingMore: function () { + return 'Trwa ładowanie…'; + }, + maximumSelected: function (args) { + return 'Możesz zaznaczyć tylko ' + args.maximum + ' ' + + pluralWord(args.maximum, itemsWords); + }, + noResults: function () { + return 'Brak wyników'; + }, + searching: function () { + return 'Trwa wyszukiwanie…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ps.js b/public/bower_components/select2/src/js/select2/i18n/ps.js new file mode 100644 index 0000000..9c70af9 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ps.js @@ -0,0 +1,45 @@ +/* jslint maxlen: 87 */ +define(function () { + // Pashto (پښتو) + return { + errorLoading: function () { + return 'پايلي نه سي ترلاسه کېدای'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'د مهربانۍ لمخي ' + overChars + ' توری ړنګ کړئ'; + + if (overChars != 1) { + message = message.replace('توری', 'توري'); + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'لږ تر لږه ' + remainingChars + ' يا ډېر توري وليکئ'; + + return message; + }, + loadingMore: function () { + return 'نوري پايلي ترلاسه کيږي...'; + }, + maximumSelected: function (args) { + var message = 'تاسو يوازي ' + args.maximum + ' قلم په نښه کولای سی'; + + if (args.maximum != 1) { + message = message.replace('قلم', 'قلمونه'); + } + + return message; + }, + noResults: function () { + return 'پايلي و نه موندل سوې'; + }, + searching: function () { + return 'لټول کيږي...'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/pt-BR.js b/public/bower_components/select2/src/js/select2/i18n/pt-BR.js new file mode 100644 index 0000000..7f769b6 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/pt-BR.js @@ -0,0 +1,46 @@ +define(function () { + // Brazilian Portuguese + return { + errorLoading: function () { + return 'Os resultados não puderam ser carregados.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Apague ' + overChars + ' caracter'; + + if (overChars != 1) { + message += 'es'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Digite ' + remainingChars + ' ou mais caracteres'; + + return message; + }, + loadingMore: function () { + return 'Carregando mais resultados…'; + }, + maximumSelected: function (args) { + var message = 'Você só pode selecionar ' + args.maximum + ' ite'; + + if (args.maximum == 1) { + message += 'm'; + } else { + message += 'ns'; + } + + return message; + }, + noResults: function () { + return 'Nenhum resultado encontrado'; + }, + searching: function () { + return 'Buscando…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/pt.js b/public/bower_components/select2/src/js/select2/i18n/pt.js new file mode 100644 index 0000000..e66a8a2 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/pt.js @@ -0,0 +1,40 @@ +define(function () { + // European Portuguese + return { + errorLoading: function () { + return 'Os resultados não puderam ser carregados.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Por favor apague ' + overChars + ' '; + + message += overChars != 1 ? 'caracteres' : 'caractere'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Introduza ' + remainingChars + ' ou mais caracteres'; + + return message; + }, + loadingMore: function () { + return 'A carregar mais resultados…'; + }, + maximumSelected: function (args) { + var message = 'Apenas pode seleccionar ' + args.maximum + ' '; + + message += args.maximum != 1 ? 'itens' : 'item'; + + return message; + }, + noResults: function () { + return 'Sem resultados'; + }, + searching: function () { + return 'A procurar…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ro.js b/public/bower_components/select2/src/js/select2/i18n/ro.js new file mode 100644 index 0000000..3faa7a7 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ro.js @@ -0,0 +1,46 @@ +define(function () { + // Romanian + return { + errorLoading: function () { + return 'Rezultatele nu au putut fi incărcate.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Vă rugăm să ștergeți' + overChars + ' caracter'; + + if (overChars !== 1) { + message += 'e'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Vă rugăm să introduceți ' + remainingChars + + ' sau mai multe caractere'; + + return message; + }, + loadingMore: function () { + return 'Se încarcă mai multe rezultate…'; + }, + maximumSelected: function (args) { + var message = 'Aveți voie să selectați cel mult ' + args.maximum; + message += ' element'; + + if (args.maximum !== 1) { + message += 'e'; + } + + return message; + }, + noResults: function () { + return 'Nu au fost găsite rezultate'; + }, + searching: function () { + return 'Căutare…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/ru.js b/public/bower_components/select2/src/js/select2/i18n/ru.js new file mode 100644 index 0000000..2ac11ec --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/ru.js @@ -0,0 +1,58 @@ +define(function () { + // Russian + function ending (count, one, couple, more) { + if (count % 10 < 5 && count % 10 > 0 && + count % 100 < 5 || count % 100 > 20) { + if (count % 10 > 1) { + return couple; + } + } else { + return more; + } + + return one; + } + + return { + errorLoading: function () { + return 'Невозможно загрузить результаты'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Пожалуйста, введите на ' + overChars + ' символ'; + + message += ending(overChars, '', 'a', 'ов'); + + message += ' меньше'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Пожалуйста, введите еще хотя бы ' + remainingChars + + ' символ'; + + message += ending(remainingChars, '', 'a', 'ов'); + + return message; + }, + loadingMore: function () { + return 'Загрузка данных…'; + }, + maximumSelected: function (args) { + var message = 'Вы можете выбрать не более ' + args.maximum + ' элемент'; + + message += ending(args.maximum, '', 'a', 'ов'); + + return message; + }, + noResults: function () { + return 'Совпадений не найдено'; + }, + searching: function () { + return 'Поиск…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/sk.js b/public/bower_components/select2/src/js/select2/i18n/sk.js new file mode 100644 index 0000000..7c9bfb9 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/sk.js @@ -0,0 +1,59 @@ +define(function () { + // Slovak + + // use text for the numbers 2 through 4 + var smallNumbers = { + 2: function (masc) { return (masc ? 'dva' : 'dve'); }, + 3: function () { return 'tri'; }, + 4: function () { return 'štyri'; } + }; + + return { + errorLoading: function () { + return 'Výsledky sa nepodarilo načítať.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + if (overChars == 1) { + return 'Prosím, zadajte o jeden znak menej'; + } else if (overChars >= 2 && overChars <= 4) { + return 'Prosím, zadajte o ' + smallNumbers[overChars](true) + + ' znaky menej'; + } else { + return 'Prosím, zadajte o ' + overChars + ' znakov menej'; + } + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + if (remainingChars == 1) { + return 'Prosím, zadajte ešte jeden znak'; + } else if (remainingChars <= 4) { + return 'Prosím, zadajte ešte ďalšie ' + + smallNumbers[remainingChars](true) + ' znaky'; + } else { + return 'Prosím, zadajte ešte ďalších ' + remainingChars + ' znakov'; + } + }, + loadingMore: function () { + return 'Načítanie ďalších výsledkov…'; + }, + maximumSelected: function (args) { + if (args.maximum == 1) { + return 'Môžete zvoliť len jednu položku'; + } else if (args.maximum >= 2 && args.maximum <= 4) { + return 'Môžete zvoliť najviac ' + smallNumbers[args.maximum](false) + + ' položky'; + } else { + return 'Môžete zvoliť najviac ' + args.maximum + ' položiek'; + } + }, + noResults: function () { + return 'Nenašli sa žiadne položky'; + }, + searching: function () { + return 'Vyhľadávanie…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/sl.js b/public/bower_components/select2/src/js/select2/i18n/sl.js new file mode 100644 index 0000000..a164044 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/sl.js @@ -0,0 +1,54 @@ +define(function () { + // Slovene + return { + errorLoading: function () { + return 'Zadetkov iskanja ni bilo mogoče naložiti.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Prosim zbrišite ' + overChars + ' znak'; + + if (overChars == 2) { + message += 'a'; + } else if (overChars != 1) { + message += 'e'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Prosim vpišite še ' + remainingChars + ' znak'; + + if (remainingChars == 2) { + message += 'a'; + } else if (remainingChars != 1) { + message += 'e'; + } + + return message; + }, + loadingMore: function () { + return 'Nalagam več zadetkov…'; + }, + maximumSelected: function (args) { + var message = 'Označite lahko največ ' + args.maximum + ' predmet'; + + if (args.maximum == 2) { + message += 'a'; + } else if (args.maximum != 1) { + message += 'e'; + } + + return message; + }, + noResults: function () { + return 'Ni zadetkov.'; + }, + searching: function () { + return 'Iščem…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/sr-Cyrl.js b/public/bower_components/select2/src/js/select2/i18n/sr-Cyrl.js new file mode 100644 index 0000000..c61184e --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/sr-Cyrl.js @@ -0,0 +1,55 @@ +define(function () { + // Serbian Cyrilic + function ending (count, one, some, many) { + if (count % 10 == 1 && count % 100 != 11) { + return one; + } + + if (count % 10 >= 2 && count % 10 <= 4 && + (count % 100 < 12 || count % 100 > 14)) { + return some; + } + + return many; + } + + return { + errorLoading: function () { + return 'Преузимање није успело.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Обришите ' + overChars + ' симбол'; + + message += ending(overChars, '', 'а', 'а'); + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Укуцајте бар још ' + remainingChars + ' симбол'; + + message += ending(remainingChars, '', 'а', 'а'); + + return message; + }, + loadingMore: function () { + return 'Преузимање још резултата…'; + }, + maximumSelected: function (args) { + var message = 'Можете изабрати само ' + args.maximum + ' ставк'; + + message += ending(args.maximum, 'у', 'е', 'и'); + + return message; + }, + noResults: function () { + return 'Ништа није пронађено'; + }, + searching: function () { + return 'Претрага…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/sr.js b/public/bower_components/select2/src/js/select2/i18n/sr.js new file mode 100644 index 0000000..7821b2b --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/sr.js @@ -0,0 +1,55 @@ +define(function () { + // Serbian + function ending (count, one, some, many) { + if (count % 10 == 1 && count % 100 != 11) { + return one; + } + + if (count % 10 >= 2 && count % 10 <= 4 && + (count % 100 < 12 || count % 100 > 14)) { + return some; + } + + return many; + } + + return { + errorLoading: function () { + return 'Preuzimanje nije uspelo.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Obrišite ' + overChars + ' simbol'; + + message += ending(overChars, '', 'a', 'a'); + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Ukucajte bar još ' + remainingChars + ' simbol'; + + message += ending(remainingChars, '', 'a', 'a'); + + return message; + }, + loadingMore: function () { + return 'Preuzimanje još rezultata…'; + }, + maximumSelected: function (args) { + var message = 'Možete izabrati samo ' + args.maximum + ' stavk'; + + message += ending(args.maximum, 'u', 'e', 'i'); + + return message; + }, + noResults: function () { + return 'Ništa nije pronađeno'; + }, + searching: function () { + return 'Pretraga…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/sv.js b/public/bower_components/select2/src/js/select2/i18n/sv.js new file mode 100644 index 0000000..42bed7e --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/sv.js @@ -0,0 +1,37 @@ +define(function () { + // Swedish + return { + errorLoading: function () { + return 'Resultat kunde inte laddas.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Vänligen sudda ut ' + overChars + ' tecken'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Vänligen skriv in ' + remainingChars + + ' eller fler tecken'; + + return message; + }, + loadingMore: function () { + return 'Laddar fler resultat…'; + }, + maximumSelected: function (args) { + var message = 'Du kan max välja ' + args.maximum + ' element'; + + return message; + }, + noResults: function () { + return 'Inga träffar'; + }, + searching: function () { + return 'Söker…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/th.js b/public/bower_components/select2/src/js/select2/i18n/th.js new file mode 100644 index 0000000..a7921ee --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/th.js @@ -0,0 +1,36 @@ +define(function () { + // Thai + return { + errorLoading: function () { + return 'ไม่สามารถค้นข้อมูลได้'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'โปรดลบออก ' + overChars + ' ตัวอักษร'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'โปรดพิมพ์เพิ่มอีก ' + remainingChars + ' ตัวอักษร'; + + return message; + }, + loadingMore: function () { + return 'กำลังค้นข้อมูลเพิ่ม…'; + }, + maximumSelected: function (args) { + var message = 'คุณสามารถเลือกได้ไม่เกิน ' + args.maximum + ' รายการ'; + + return message; + }, + noResults: function () { + return 'ไม่พบข้อมูล'; + }, + searching: function () { + return 'กำลังค้นข้อมูล…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/tr.js b/public/bower_components/select2/src/js/select2/i18n/tr.js new file mode 100644 index 0000000..fd8ffd3 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/tr.js @@ -0,0 +1,36 @@ +define(function () { + // Turkish + return { + errorLoading: function (){ + return 'Sonuç yüklenemedi'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = overChars + ' karakter daha girmelisiniz'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'En az ' + remainingChars + ' karakter daha girmelisiniz'; + + return message; + }, + loadingMore: function () { + return 'Daha fazla…'; + }, + maximumSelected: function (args) { + var message = 'Sadece ' + args.maximum + ' seçim yapabilirsiniz'; + + return message; + }, + noResults: function () { + return 'Sonuç bulunamadı'; + }, + searching: function () { + return 'Aranıyor…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/uk.js b/public/bower_components/select2/src/js/select2/i18n/uk.js new file mode 100644 index 0000000..72067c9 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/uk.js @@ -0,0 +1,43 @@ +define(function () { + // Ukranian + function ending (count, one, couple, more) { + if (count % 100 > 10 && count % 100 < 15) { + return more; + } + if (count % 10 === 1) { + return one; + } + if (count % 10 > 1 && count % 10 < 5) { + return couple; + } + return more; + } + + return { + errorLoading: function () { + return 'Неможливо завантажити результати'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + return 'Будь ласка, видаліть ' + overChars + ' ' + + ending(args.maximum, 'літеру', 'літери', 'літер'); + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + return 'Будь ласка, введіть ' + remainingChars + ' або більше літер'; + }, + loadingMore: function () { + return 'Завантаження інших результатів…'; + }, + maximumSelected: function (args) { + return 'Ви можете вибрати лише ' + args.maximum + ' ' + + ending(args.maximum, 'пункт', 'пункти', 'пунктів'); + }, + noResults: function () { + return 'Нічого не знайдено'; + }, + searching: function () { + return 'Пошук…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/vi.js b/public/bower_components/select2/src/js/select2/i18n/vi.js new file mode 100644 index 0000000..3d4b50e --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/vi.js @@ -0,0 +1,37 @@ +define(function () { + // Vietnamese + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Vui lòng nhập ít hơn ' + overChars + ' ký tự'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Vui lòng nhập nhiều hơn ' + remainingChars + ' ký tự'; + + return message; + }, + loadingMore: function () { + return 'Đang lấy thêm kết quả…'; + }, + maximumSelected: function (args) { + var message = 'Chỉ có thể chọn được ' + args.maximum + ' lựa chọn'; + + return message; + }, + noResults: function () { + return 'Không tìm thấy kết quả'; + }, + searching: function () { + return 'Đang tìm…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/zh-CN.js b/public/bower_components/select2/src/js/select2/i18n/zh-CN.js new file mode 100644 index 0000000..4aaec39 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/zh-CN.js @@ -0,0 +1,36 @@ +define(function () { + // Chinese (Simplified) + return { + errorLoading: function () { + return '无法载入结果。'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = '请删除' + overChars + '个字符'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = '请再输入至少' + remainingChars + '个字符'; + + return message; + }, + loadingMore: function () { + return '载入更多结果…'; + }, + maximumSelected: function (args) { + var message = '最多只能选择' + args.maximum + '个项目'; + + return message; + }, + noResults: function () { + return '未找到结果'; + }, + searching: function () { + return '搜索中…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/i18n/zh-TW.js b/public/bower_components/select2/src/js/select2/i18n/zh-TW.js new file mode 100644 index 0000000..80624f1 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/i18n/zh-TW.js @@ -0,0 +1,33 @@ +define(function () { + // Chinese (Traditional) + return { + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = '請刪掉' + overChars + '個字元'; + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = '請再輸入' + remainingChars + '個字元'; + + return message; + }, + loadingMore: function () { + return '載入中…'; + }, + maximumSelected: function (args) { + var message = '你只能選擇最多' + args.maximum + '項'; + + return message; + }, + noResults: function () { + return '沒有找到相符的項目'; + }, + searching: function () { + return '搜尋中…'; + } + }; +}); diff --git a/public/bower_components/select2/src/js/select2/keys.js b/public/bower_components/select2/src/js/select2/keys.js new file mode 100644 index 0000000..f449ba4 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/keys.js @@ -0,0 +1,25 @@ +define([ + +], function () { + var KEYS = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 + }; + + return KEYS; +}); diff --git a/public/bower_components/select2/src/js/select2/options.js b/public/bower_components/select2/src/js/select2/options.js new file mode 100644 index 0000000..3e48dee --- /dev/null +++ b/public/bower_components/select2/src/js/select2/options.js @@ -0,0 +1,122 @@ +define([ + 'require', + 'jquery', + './defaults', + './utils' +], function (require, $, Defaults, Utils) { + function Options (options, $element) { + this.options = options; + + if ($element != null) { + this.fromElement($element); + } + + this.options = Defaults.apply(this.options); + + if ($element && $element.is('input')) { + var InputCompat = require(this.get('amdBase') + 'compat/inputData'); + + this.options.dataAdapter = Utils.Decorate( + this.options.dataAdapter, + InputCompat + ); + } + } + + Options.prototype.fromElement = function ($e) { + var excludedData = ['select2']; + + if (this.options.multiple == null) { + this.options.multiple = $e.prop('multiple'); + } + + if (this.options.disabled == null) { + this.options.disabled = $e.prop('disabled'); + } + + if (this.options.language == null) { + if ($e.prop('lang')) { + this.options.language = $e.prop('lang').toLowerCase(); + } else if ($e.closest('[lang]').prop('lang')) { + this.options.language = $e.closest('[lang]').prop('lang'); + } + } + + if (this.options.dir == null) { + if ($e.prop('dir')) { + this.options.dir = $e.prop('dir'); + } else if ($e.closest('[dir]').prop('dir')) { + this.options.dir = $e.closest('[dir]').prop('dir'); + } else { + this.options.dir = 'ltr'; + } + } + + $e.prop('disabled', this.options.disabled); + $e.prop('multiple', this.options.multiple); + + if ($e.data('select2Tags')) { + if (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.' + ); + } + + $e.data('data', $e.data('select2Tags')); + $e.data('tags', true); + } + + if ($e.data('ajaxUrl')) { + if (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.' + ); + } + + $e.attr('ajax--url', $e.data('ajaxUrl')); + $e.data('ajax--url', $e.data('ajaxUrl')); + } + + var dataset = {}; + + // Prefer the element's `dataset` attribute if it exists + // jQuery 1.x does not correctly handle data attributes with multiple dashes + if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { + dataset = $.extend(true, {}, $e[0].dataset, $e.data()); + } else { + dataset = $e.data(); + } + + var data = $.extend(true, {}, dataset); + + data = Utils._convertData(data); + + for (var key in data) { + if ($.inArray(key, excludedData) > -1) { + continue; + } + + if ($.isPlainObject(this.options[key])) { + $.extend(this.options[key], data[key]); + } else { + this.options[key] = data[key]; + } + } + + return this; + }; + + Options.prototype.get = function (key) { + return this.options[key]; + }; + + Options.prototype.set = function (key, val) { + this.options[key] = val; + }; + + return Options; +}); diff --git a/public/bower_components/select2/src/js/select2/results.js b/public/bower_components/select2/src/js/select2/results.js new file mode 100644 index 0000000..a16b65f --- /dev/null +++ b/public/bower_components/select2/src/js/select2/results.js @@ -0,0 +1,523 @@ +define([ + 'jquery', + './utils' +], function ($, Utils) { + function Results ($element, options, dataAdapter) { + this.$element = $element; + this.data = dataAdapter; + this.options = options; + + Results.__super__.constructor.call(this); + } + + Utils.Extend(Results, Utils.Observable); + + Results.prototype.render = function () { + var $results = $( + '' + ); + + if (this.options.get('multiple')) { + $results.attr('aria-multiselectable', 'true'); + } + + this.$results = $results; + + return $results; + }; + + Results.prototype.clear = function () { + this.$results.empty(); + }; + + Results.prototype.displayMessage = function (params) { + var escapeMarkup = this.options.get('escapeMarkup'); + + this.clear(); + this.hideLoading(); + + var $message = $( + '
  • ' + ); + + var message = this.options.get('translations').get(params.message); + + $message.append( + escapeMarkup( + message(params.args) + ) + ); + + $message[0].className += ' select2-results__message'; + + this.$results.append($message); + }; + + Results.prototype.hideMessages = function () { + this.$results.find('.select2-results__message').remove(); + }; + + Results.prototype.append = function (data) { + this.hideLoading(); + + var $options = []; + + if (data.results == null || data.results.length === 0) { + if (this.$results.children().length === 0) { + this.trigger('results:message', { + message: 'noResults' + }); + } + + return; + } + + data.results = this.sort(data.results); + + for (var d = 0; d < data.results.length; d++) { + var item = data.results[d]; + + var $option = this.option(item); + + $options.push($option); + } + + this.$results.append($options); + }; + + Results.prototype.position = function ($results, $dropdown) { + var $resultsContainer = $dropdown.find('.select2-results'); + $resultsContainer.append($results); + }; + + Results.prototype.sort = function (data) { + var sorter = this.options.get('sorter'); + + return sorter(data); + }; + + Results.prototype.highlightFirstItem = function () { + var $options = this.$results + .find('.select2-results__option[aria-selected]'); + + var $selected = $options.filter('[aria-selected=true]'); + + // Check if there are any selected options + if ($selected.length > 0) { + // If there are selected options, highlight the first + $selected.first().trigger('mouseenter'); + } else { + // If there are no selected options, highlight the first option + // in the dropdown + $options.first().trigger('mouseenter'); + } + + this.ensureHighlightVisible(); + }; + + Results.prototype.setClasses = function () { + var self = this; + + this.data.current(function (selected) { + var selectedIds = $.map(selected, function (s) { + return s.id.toString(); + }); + + var $options = self.$results + .find('.select2-results__option[aria-selected]'); + + $options.each(function () { + var $option = $(this); + + var item = $.data(this, 'data'); + + // id needs to be converted to a string when comparing + var id = '' + item.id; + + if ((item.element != null && item.element.selected) || + (item.element == null && $.inArray(id, selectedIds) > -1)) { + $option.attr('aria-selected', 'true'); + } else { + $option.attr('aria-selected', 'false'); + } + }); + + }); + }; + + Results.prototype.showLoading = function (params) { + this.hideLoading(); + + var loadingMore = this.options.get('translations').get('searching'); + + var loading = { + disabled: true, + loading: true, + text: loadingMore(params) + }; + var $loading = this.option(loading); + $loading.className += ' loading-results'; + + this.$results.prepend($loading); + }; + + Results.prototype.hideLoading = function () { + this.$results.find('.loading-results').remove(); + }; + + Results.prototype.option = function (data) { + var option = document.createElement('li'); + option.className = 'select2-results__option'; + + var attrs = { + 'role': 'treeitem', + 'aria-selected': 'false' + }; + + if (data.disabled) { + delete attrs['aria-selected']; + attrs['aria-disabled'] = 'true'; + } + + if (data.id == null) { + delete attrs['aria-selected']; + } + + if (data._resultId != null) { + option.id = data._resultId; + } + + if (data.title) { + option.title = data.title; + } + + if (data.children) { + attrs.role = 'group'; + attrs['aria-label'] = data.text; + delete attrs['aria-selected']; + } + + for (var attr in attrs) { + var val = attrs[attr]; + + option.setAttribute(attr, val); + } + + if (data.children) { + var $option = $(option); + + var label = document.createElement('strong'); + label.className = 'select2-results__group'; + + var $label = $(label); + this.template(data, label); + + var $children = []; + + for (var c = 0; c < data.children.length; c++) { + var child = data.children[c]; + + var $child = this.option(child); + + $children.push($child); + } + + var $childrenContainer = $('', { + 'class': 'select2-results__options select2-results__options--nested' + }); + + $childrenContainer.append($children); + + $option.append(label); + $option.append($childrenContainer); + } else { + this.template(data, option); + } + + $.data(option, 'data', data); + + return option; + }; + + Results.prototype.bind = function (container, $container) { + var self = this; + + var id = container.id + '-results'; + + this.$results.attr('id', id); + + container.on('results:all', function (params) { + self.clear(); + self.append(params.data); + + if (container.isOpen()) { + self.setClasses(); + self.highlightFirstItem(); + } + }); + + container.on('results:append', function (params) { + self.append(params.data); + + if (container.isOpen()) { + self.setClasses(); + } + }); + + container.on('query', function (params) { + self.hideMessages(); + self.showLoading(params); + }); + + container.on('select', function () { + if (!container.isOpen()) { + return; + } + + self.setClasses(); + self.highlightFirstItem(); + }); + + container.on('unselect', function () { + if (!container.isOpen()) { + return; + } + + self.setClasses(); + self.highlightFirstItem(); + }); + + container.on('open', function () { + // When the dropdown is open, aria-expended="true" + self.$results.attr('aria-expanded', 'true'); + self.$results.attr('aria-hidden', 'false'); + + self.setClasses(); + self.ensureHighlightVisible(); + }); + + container.on('close', function () { + // When the dropdown is closed, aria-expended="false" + self.$results.attr('aria-expanded', 'false'); + self.$results.attr('aria-hidden', 'true'); + self.$results.removeAttr('aria-activedescendant'); + }); + + container.on('results:toggle', function () { + var $highlighted = self.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + $highlighted.trigger('mouseup'); + }); + + container.on('results:select', function () { + var $highlighted = self.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + var data = $highlighted.data('data'); + + if ($highlighted.attr('aria-selected') == 'true') { + self.trigger('close', {}); + } else { + self.trigger('select', { + data: data + }); + } + }); + + container.on('results:previous', function () { + var $highlighted = self.getHighlightedResults(); + + var $options = self.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + // If we are already at te top, don't move further + if (currentIndex === 0) { + return; + } + + var nextIndex = currentIndex - 1; + + // If none are highlighted, highlight the first + if ($highlighted.length === 0) { + nextIndex = 0; + } + + var $next = $options.eq(nextIndex); + + $next.trigger('mouseenter'); + + var currentOffset = self.$results.offset().top; + var nextTop = $next.offset().top; + var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); + + if (nextIndex === 0) { + self.$results.scrollTop(0); + } else if (nextTop - currentOffset < 0) { + self.$results.scrollTop(nextOffset); + } + }); + + container.on('results:next', function () { + var $highlighted = self.getHighlightedResults(); + + var $options = self.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + var nextIndex = currentIndex + 1; + + // If we are at the last option, stay there + if (nextIndex >= $options.length) { + return; + } + + var $next = $options.eq(nextIndex); + + $next.trigger('mouseenter'); + + var currentOffset = self.$results.offset().top + + self.$results.outerHeight(false); + var nextBottom = $next.offset().top + $next.outerHeight(false); + var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; + + if (nextIndex === 0) { + self.$results.scrollTop(0); + } else if (nextBottom > currentOffset) { + self.$results.scrollTop(nextOffset); + } + }); + + container.on('results:focus', function (params) { + params.element.addClass('select2-results__option--highlighted'); + }); + + container.on('results:message', function (params) { + self.displayMessage(params); + }); + + if ($.fn.mousewheel) { + this.$results.on('mousewheel', function (e) { + var top = self.$results.scrollTop(); + + var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; + + var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; + var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); + + if (isAtTop) { + self.$results.scrollTop(0); + + e.preventDefault(); + e.stopPropagation(); + } else if (isAtBottom) { + self.$results.scrollTop( + self.$results.get(0).scrollHeight - self.$results.height() + ); + + e.preventDefault(); + e.stopPropagation(); + } + }); + } + + this.$results.on('mouseup', '.select2-results__option[aria-selected]', + function (evt) { + var $this = $(this); + + var data = $this.data('data'); + + if ($this.attr('aria-selected') === 'true') { + if (self.options.get('multiple')) { + self.trigger('unselect', { + originalEvent: evt, + data: data + }); + } else { + self.trigger('close', {}); + } + + return; + } + + self.trigger('select', { + originalEvent: evt, + data: data + }); + }); + + this.$results.on('mouseenter', '.select2-results__option[aria-selected]', + function (evt) { + var data = $(this).data('data'); + + self.getHighlightedResults() + .removeClass('select2-results__option--highlighted'); + + self.trigger('results:focus', { + data: data, + element: $(this) + }); + }); + }; + + Results.prototype.getHighlightedResults = function () { + var $highlighted = this.$results + .find('.select2-results__option--highlighted'); + + return $highlighted; + }; + + Results.prototype.destroy = function () { + this.$results.remove(); + }; + + Results.prototype.ensureHighlightVisible = function () { + var $highlighted = this.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + var $options = this.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + var currentOffset = this.$results.offset().top; + var nextTop = $highlighted.offset().top; + var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); + + var offsetDelta = nextTop - currentOffset; + nextOffset -= $highlighted.outerHeight(false) * 2; + + if (currentIndex <= 2) { + this.$results.scrollTop(0); + } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { + this.$results.scrollTop(nextOffset); + } + }; + + Results.prototype.template = function (result, container) { + var template = this.options.get('templateResult'); + var escapeMarkup = this.options.get('escapeMarkup'); + + var content = template(result, container); + + if (content == null) { + container.style.display = 'none'; + } else if (typeof content === 'string') { + container.innerHTML = escapeMarkup(content); + } else { + $(container).append(content); + } + }; + + return Results; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/allowClear.js b/public/bower_components/select2/src/js/select2/selection/allowClear.js new file mode 100644 index 0000000..d350206 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/allowClear.js @@ -0,0 +1,97 @@ +define([ + 'jquery', + '../keys' +], function ($, KEYS) { + function AllowClear () { } + + AllowClear.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + if (this.placeholder == null) { + if (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 (evt) { + self._handleClear(evt); + }); + + container.on('keypress', function (evt) { + self._handleKeyboardClear(evt, container); + }); + }; + + AllowClear.prototype._handleClear = function (_, evt) { + // Ignore the event if it is disabled + if (this.options.get('disabled')) { + return; + } + + var $clear = this.$selection.find('.select2-selection__clear'); + + // Ignore the event if nothing has been selected + if ($clear.length === 0) { + return; + } + + evt.stopPropagation(); + + var data = $clear.data('data'); + + for (var d = 0; d < data.length; d++) { + var unselectData = { + data: data[d] + }; + + // Trigger the `unselect` event, so people can prevent it from being + // cleared. + this.trigger('unselect', unselectData); + + // If the event was prevented, don't clear it out. + if (unselectData.prevented) { + return; + } + } + + this.$element.val(this.placeholder.id).trigger('change'); + + this.trigger('toggle', {}); + }; + + AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { + if (container.isOpen()) { + return; + } + + if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { + this._handleClear(evt); + } + }; + + AllowClear.prototype.update = function (decorated, data) { + decorated.call(this, data); + + if (this.$selection.find('.select2-selection__placeholder').length > 0 || + data.length === 0) { + return; + } + + var $remove = $( + '' + + '×' + + '' + ); + $remove.data('data', data); + + this.$selection.find('.select2-selection__rendered').prepend($remove); + }; + + return AllowClear; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/base.js b/public/bower_components/select2/src/js/select2/selection/base.js new file mode 100644 index 0000000..cd3aafd --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/base.js @@ -0,0 +1,158 @@ +define([ + 'jquery', + '../utils', + '../keys' +], function ($, Utils, KEYS) { + function BaseSelection ($element, options) { + this.$element = $element; + this.options = options; + + BaseSelection.__super__.constructor.call(this); + } + + Utils.Extend(BaseSelection, Utils.Observable); + + BaseSelection.prototype.render = function () { + var $selection = $( + '' + ); + + this._tabindex = 0; + + if (this.$element.data('old-tabindex') != null) { + this._tabindex = this.$element.data('old-tabindex'); + } else if (this.$element.attr('tabindex') != null) { + this._tabindex = this.$element.attr('tabindex'); + } + + $selection.attr('title', this.$element.attr('title')); + $selection.attr('tabindex', this._tabindex); + + this.$selection = $selection; + + return $selection; + }; + + BaseSelection.prototype.bind = function (container, $container) { + var self = this; + + var id = container.id + '-container'; + var resultsId = container.id + '-results'; + + this.container = container; + + this.$selection.on('focus', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('blur', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', function (evt) { + self.trigger('keypress', evt); + + if (evt.which === KEYS.SPACE) { + evt.preventDefault(); + } + }); + + container.on('results:focus', function (params) { + self.$selection.attr('aria-activedescendant', params.data._resultId); + }); + + container.on('selection:update', function (params) { + self.update(params.data); + }); + + container.on('open', function () { + // When the dropdown is open, aria-expanded="true" + self.$selection.attr('aria-expanded', 'true'); + self.$selection.attr('aria-owns', resultsId); + + self._attachCloseHandler(container); + }); + + container.on('close', function () { + // When the dropdown is closed, aria-expanded="false" + self.$selection.attr('aria-expanded', 'false'); + self.$selection.removeAttr('aria-activedescendant'); + self.$selection.removeAttr('aria-owns'); + + self.$selection.focus(); + + self._detachCloseHandler(container); + }); + + container.on('enable', function () { + self.$selection.attr('tabindex', self._tabindex); + }); + + container.on('disable', function () { + self.$selection.attr('tabindex', '-1'); + }); + }; + + BaseSelection.prototype._handleBlur = function (evt) { + var self = this; + + // This needs to be delayed as the active element is the body when the tab + // key is pressed, possibly along with others. + window.setTimeout(function () { + // Don't trigger `blur` if the focus is still in the selection + if ( + (document.activeElement == self.$selection[0]) || + ($.contains(self.$selection[0], document.activeElement)) + ) { + return; + } + + self.trigger('blur', evt); + }, 1); + }; + + BaseSelection.prototype._attachCloseHandler = function (container) { + var self = this; + + $(document.body).on('mousedown.select2.' + container.id, function (e) { + var $target = $(e.target); + + var $select = $target.closest('.select2'); + + var $all = $('.select2.select2-container--open'); + + $all.each(function () { + var $this = $(this); + + if (this == $select[0]) { + return; + } + + var $element = $this.data('element'); + + $element.select2('close'); + }); + }); + }; + + BaseSelection.prototype._detachCloseHandler = function (container) { + $(document.body).off('mousedown.select2.' + container.id); + }; + + BaseSelection.prototype.position = function ($selection, $container) { + var $selectionContainer = $container.find('.selection'); + $selectionContainer.append($selection); + }; + + BaseSelection.prototype.destroy = function () { + this._detachCloseHandler(this.container); + }; + + BaseSelection.prototype.update = function (data) { + throw new Error('The `update` method must be defined in child classes.'); + }; + + return BaseSelection; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/clickMask.js b/public/bower_components/select2/src/js/select2/selection/clickMask.js new file mode 100644 index 0000000..2b4ac30 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/clickMask.js @@ -0,0 +1,29 @@ +define([ + 'jquery' +], function ($) { + function ClickMask () { } + + ClickMask.prototype.bind = function (decorate, $container, container) { + var self = this; + + decorate.call(this, $container, container); + + this.$mask = $( + '
    ' + ); + + this.$mask.on('mousedown touchstart click', function () { + self.trigger('close', {}); + }); + }; + + ClickMask.prototype._attachCloseHandler = function (decorate, container) { + $(document.body).append(this.$mask); + }; + + ClickMask.prototype._detachCloseHandler = function (deocrate, container) { + this.$mask.detach(); + }; + + return ClickMask; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/eventRelay.js b/public/bower_components/select2/src/js/select2/selection/eventRelay.js new file mode 100644 index 0000000..a91e9c5 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/eventRelay.js @@ -0,0 +1,45 @@ +define([ + 'jquery' +], function ($) { + function EventRelay () { } + + EventRelay.prototype.bind = function (decorated, container, $container) { + var self = this; + var relayEvents = [ + 'open', 'opening', + 'close', 'closing', + 'select', 'selecting', + 'unselect', 'unselecting' + ]; + + var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; + + decorated.call(this, container, $container); + + container.on('*', function (name, params) { + // Ignore events that should not be relayed + if ($.inArray(name, relayEvents) === -1) { + return; + } + + // The parameters should always be an object + params = params || {}; + + // Generate the jQuery event for the Select2 event + var evt = $.Event('select2:' + name, { + params: params + }); + + self.$element.trigger(evt); + + // Only handle preventable events if it was one + if ($.inArray(name, preventableEvents) === -1) { + return; + } + + params.prevented = evt.isDefaultPrevented(); + }); + }; + + return EventRelay; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/multiple.js b/public/bower_components/select2/src/js/select2/selection/multiple.js new file mode 100644 index 0000000..ae0f7cc --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/multiple.js @@ -0,0 +1,109 @@ +define([ + 'jquery', + './base', + '../utils' +], function ($, BaseSelection, Utils) { + function MultipleSelection ($element, options) { + MultipleSelection.__super__.constructor.apply(this, arguments); + } + + Utils.Extend(MultipleSelection, BaseSelection); + + MultipleSelection.prototype.render = function () { + var $selection = MultipleSelection.__super__.render.call(this); + + $selection.addClass('select2-selection--multiple'); + + $selection.html( + '' + ); + + return $selection; + }; + + MultipleSelection.prototype.bind = function (container, $container) { + var self = this; + + MultipleSelection.__super__.bind.apply(this, arguments); + + this.$selection.on('click', function (evt) { + self.trigger('toggle', { + originalEvent: evt + }); + }); + + this.$selection.on( + 'click', + '.select2-selection__choice__remove', + function (evt) { + // Ignore the event if it is disabled + if (self.options.get('disabled')) { + return; + } + + var $remove = $(this); + var $selection = $remove.parent(); + + var data = $selection.data('data'); + + self.trigger('unselect', { + originalEvent: evt, + data: data + }); + } + ); + }; + + MultipleSelection.prototype.clear = function () { + this.$selection.find('.select2-selection__rendered').empty(); + }; + + MultipleSelection.prototype.display = function (data, container) { + var template = this.options.get('templateSelection'); + var escapeMarkup = this.options.get('escapeMarkup'); + + return escapeMarkup(template(data, container)); + }; + + MultipleSelection.prototype.selectionContainer = function () { + var $container = $( + '
  • ' + + '' + + '×' + + '' + + '
  • ' + ); + + return $container; + }; + + MultipleSelection.prototype.update = function (data) { + this.clear(); + + if (data.length === 0) { + return; + } + + var $selections = []; + + for (var d = 0; d < data.length; d++) { + var selection = data[d]; + + var $selection = this.selectionContainer(); + var formatted = this.display(selection, $selection); + + $selection.append(formatted); + $selection.prop('title', selection.title || selection.text); + + $selection.data('data', selection); + + $selections.push($selection); + } + + var $rendered = this.$selection.find('.select2-selection__rendered'); + + Utils.appendMany($rendered, $selections); + }; + + return MultipleSelection; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/placeholder.js b/public/bower_components/select2/src/js/select2/selection/placeholder.js new file mode 100644 index 0000000..87fbeda --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/placeholder.js @@ -0,0 +1,49 @@ +define([ + '../utils' +], function (Utils) { + function Placeholder (decorated, $element, options) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options); + } + + Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { + var $placeholder = this.selectionContainer(); + + $placeholder.html(this.display(placeholder)); + $placeholder.addClass('select2-selection__placeholder') + .removeClass('select2-selection__choice'); + + return $placeholder; + }; + + Placeholder.prototype.update = function (decorated, data) { + var singlePlaceholder = ( + data.length == 1 && data[0].id != this.placeholder.id + ); + var multipleSelections = data.length > 1; + + if (multipleSelections || singlePlaceholder) { + return decorated.call(this, data); + } + + this.clear(); + + var $placeholder = this.createPlaceholder(this.placeholder); + + this.$selection.find('.select2-selection__rendered').append($placeholder); + }; + + return Placeholder; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/search.js b/public/bower_components/select2/src/js/select2/selection/search.js new file mode 100644 index 0000000..1bc4b09 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/search.js @@ -0,0 +1,222 @@ +define([ + 'jquery', + '../utils', + '../keys' +], function ($, Utils, KEYS) { + function Search (decorated, $element, options) { + decorated.call(this, $element, options); + } + + Search.prototype.render = function (decorated) { + var $search = $( + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + var $rendered = decorated.call(this); + + this._transferTabIndex(); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('open', function () { + self.$search.trigger('focus'); + }); + + container.on('close', function () { + self.$search.val(''); + self.$search.removeAttr('aria-activedescendant'); + self.$search.trigger('focus'); + }); + + container.on('enable', function () { + self.$search.prop('disabled', false); + + self._transferTabIndex(); + }); + + container.on('disable', function () { + self.$search.prop('disabled', true); + }); + + container.on('focus', function (evt) { + self.$search.trigger('focus'); + }); + + container.on('results:focus', function (params) { + self.$search.attr('aria-activedescendant', params.id); + }); + + this.$selection.on('focusin', '.select2-search--inline', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('focusout', '.select2-search--inline', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', '.select2-search--inline', function (evt) { + evt.stopPropagation(); + + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + + var key = evt.which; + + if (key === KEYS.BACKSPACE && self.$search.val() === '') { + var $previousChoice = self.$searchContainer + .prev('.select2-selection__choice'); + + if ($previousChoice.length > 0) { + var item = $previousChoice.data('data'); + + self.searchRemoveChoice(item); + + evt.preventDefault(); + } + } + }); + + // Try to detect the IE version should the `documentMode` property that + // is stored on the document. This is only implemented in IE and is + // slightly cleaner than doing a user agent check. + // This property is not available in Edge, but Edge also doesn't have + // this bug. + var msie = document.documentMode; + var disableInputEvents = msie && msie <= 11; + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$selection.on( + 'input.searchcheck', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents) { + self.$selection.off('input.search input.searchcheck'); + return; + } + + // Unbind the duplicated `keyup` event + self.$selection.off('keyup.search'); + } + ); + + this.$selection.on( + 'keyup.search input.search', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents && evt.type === 'input') { + self.$selection.off('input.search input.searchcheck'); + return; + } + + var key = evt.which; + + // We can freely ignore events from modifier keys + if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { + return; + } + + // Tabbing will be handled during the `keydown` phase + if (key == KEYS.TAB) { + return; + } + + self.handleSearch(evt); + } + ); + }; + + /** + * This method will transfer the tabindex attribute from the rendered + * selection to the search box. This allows for the search box to be used as + * the primary focus instead of the selection container. + * + * @private + */ + Search.prototype._transferTabIndex = function (decorated) { + this.$search.attr('tabindex', this.$selection.attr('tabindex')); + this.$selection.attr('tabindex', '-1'); + }; + + Search.prototype.createPlaceholder = function (decorated, placeholder) { + this.$search.attr('placeholder', placeholder.text); + }; + + Search.prototype.update = function (decorated, data) { + var searchHadFocus = this.$search[0] == document.activeElement; + + this.$search.attr('placeholder', ''); + + decorated.call(this, data); + + this.$selection.find('.select2-selection__rendered') + .append(this.$searchContainer); + + this.resizeSearch(); + if (searchHadFocus) { + this.$search.focus(); + } + }; + + Search.prototype.handleSearch = function () { + this.resizeSearch(); + + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.searchRemoveChoice = function (decorated, item) { + this.trigger('unselect', { + data: item + }); + + this.$search.val(item.text); + this.handleSearch(); + }; + + Search.prototype.resizeSearch = function () { + this.$search.css('width', '25px'); + + var width = ''; + + if (this.$search.attr('placeholder') !== '') { + width = this.$selection.find('.select2-selection__rendered').innerWidth(); + } else { + var minimumWidth = this.$search.val().length + 1; + + width = (minimumWidth * 0.75) + 'em'; + } + + this.$search.css('width', width); + }; + + return Search; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/single.js b/public/bower_components/select2/src/js/select2/selection/single.js new file mode 100644 index 0000000..89c21db --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/single.js @@ -0,0 +1,99 @@ +define([ + 'jquery', + './base', + '../utils', + '../keys' +], function ($, BaseSelection, Utils, KEYS) { + function SingleSelection () { + SingleSelection.__super__.constructor.apply(this, arguments); + } + + Utils.Extend(SingleSelection, BaseSelection); + + SingleSelection.prototype.render = function () { + var $selection = SingleSelection.__super__.render.call(this); + + $selection.addClass('select2-selection--single'); + + $selection.html( + '' + + '' + + '' + + '' + ); + + return $selection; + }; + + SingleSelection.prototype.bind = function (container, $container) { + var self = this; + + SingleSelection.__super__.bind.apply(this, arguments); + + var id = container.id + '-container'; + + this.$selection.find('.select2-selection__rendered').attr('id', id); + this.$selection.attr('aria-labelledby', id); + + this.$selection.on('mousedown', function (evt) { + // Only respond to left clicks + if (evt.which !== 1) { + return; + } + + self.trigger('toggle', { + originalEvent: evt + }); + }); + + this.$selection.on('focus', function (evt) { + // User focuses on the container + }); + + this.$selection.on('blur', function (evt) { + // User exits the container + }); + + container.on('focus', function (evt) { + if (!container.isOpen()) { + self.$selection.focus(); + } + }); + + container.on('selection:update', function (params) { + self.update(params.data); + }); + }; + + SingleSelection.prototype.clear = function () { + this.$selection.find('.select2-selection__rendered').empty(); + }; + + SingleSelection.prototype.display = function (data, container) { + var template = this.options.get('templateSelection'); + var escapeMarkup = this.options.get('escapeMarkup'); + + return escapeMarkup(template(data, container)); + }; + + SingleSelection.prototype.selectionContainer = function () { + return $(''); + }; + + SingleSelection.prototype.update = function (data) { + if (data.length === 0) { + this.clear(); + return; + } + + var selection = data[0]; + + var $rendered = this.$selection.find('.select2-selection__rendered'); + var formatted = this.display(selection, $rendered); + + $rendered.empty().append(formatted); + $rendered.prop('title', selection.title || selection.text); + }; + + return SingleSelection; +}); diff --git a/public/bower_components/select2/src/js/select2/selection/stopPropagation.js b/public/bower_components/select2/src/js/select2/selection/stopPropagation.js new file mode 100644 index 0000000..382f1e7 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/selection/stopPropagation.js @@ -0,0 +1,38 @@ +define([ + +], function () { + function StopPropagation () { } + + StopPropagation.prototype.bind = function (decorated, container, $container) { + decorated.call(this, container, $container); + + var stoppedEvents = [ + 'blur', + 'change', + 'click', + 'dblclick', + 'focus', + 'focusin', + 'focusout', + 'input', + 'keydown', + 'keyup', + 'keypress', + 'mousedown', + 'mouseenter', + 'mouseleave', + 'mousemove', + 'mouseover', + 'mouseup', + 'search', + 'touchend', + 'touchstart' + ]; + + this.$selection.on(stoppedEvents.join(' '), function (evt) { + evt.stopPropagation(); + }); + }; + + return StopPropagation; +}); diff --git a/public/bower_components/select2/src/js/select2/translation.js b/public/bower_components/select2/src/js/select2/translation.js new file mode 100644 index 0000000..5394c18 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/translation.js @@ -0,0 +1,36 @@ +define([ + 'jquery', + 'require' +], function ($, require) { + function Translation (dict) { + this.dict = dict || {}; + } + + Translation.prototype.all = function () { + return this.dict; + }; + + Translation.prototype.get = function (key) { + return this.dict[key]; + }; + + Translation.prototype.extend = function (translation) { + this.dict = $.extend({}, translation.all(), this.dict); + }; + + // Static functions + + Translation._cache = {}; + + Translation.loadPath = function (path) { + if (!(path in Translation._cache)) { + var translations = require(path); + + Translation._cache[path] = translations; + } + + return new Translation(Translation._cache[path]); + }; + + return Translation; +}); diff --git a/public/bower_components/select2/src/js/select2/utils.js b/public/bower_components/select2/src/js/select2/utils.js new file mode 100644 index 0000000..d1a23d2 --- /dev/null +++ b/public/bower_components/select2/src/js/select2/utils.js @@ -0,0 +1,276 @@ +define([ + 'jquery' +], function ($) { + var Utils = {}; + + Utils.Extend = function (ChildClass, SuperClass) { + var __hasProp = {}.hasOwnProperty; + + function BaseConstructor () { + this.constructor = ChildClass; + } + + for (var key in SuperClass) { + if (__hasProp.call(SuperClass, key)) { + ChildClass[key] = SuperClass[key]; + } + } + + BaseConstructor.prototype = SuperClass.prototype; + ChildClass.prototype = new BaseConstructor(); + ChildClass.__super__ = SuperClass.prototype; + + return ChildClass; + }; + + function getMethods (theClass) { + var proto = theClass.prototype; + + var methods = []; + + for (var methodName in proto) { + var m = proto[methodName]; + + if (typeof m !== 'function') { + continue; + } + + if (methodName === 'constructor') { + continue; + } + + methods.push(methodName); + } + + return methods; + } + + Utils.Decorate = function (SuperClass, DecoratorClass) { + var decoratedMethods = getMethods(DecoratorClass); + var superMethods = getMethods(SuperClass); + + function DecoratedClass () { + var unshift = Array.prototype.unshift; + + var argCount = DecoratorClass.prototype.constructor.length; + + var calledConstructor = SuperClass.prototype.constructor; + + if (argCount > 0) { + unshift.call(arguments, SuperClass.prototype.constructor); + + calledConstructor = DecoratorClass.prototype.constructor; + } + + calledConstructor.apply(this, arguments); + } + + DecoratorClass.displayName = SuperClass.displayName; + + function ctr () { + this.constructor = DecoratedClass; + } + + DecoratedClass.prototype = new ctr(); + + for (var m = 0; m < superMethods.length; m++) { + var superMethod = superMethods[m]; + + DecoratedClass.prototype[superMethod] = + SuperClass.prototype[superMethod]; + } + + var calledMethod = function (methodName) { + // Stub out the original method if it's not decorating an actual method + var originalMethod = function () {}; + + if (methodName in DecoratedClass.prototype) { + originalMethod = DecoratedClass.prototype[methodName]; + } + + var decoratedMethod = DecoratorClass.prototype[methodName]; + + return function () { + var unshift = Array.prototype.unshift; + + unshift.call(arguments, originalMethod); + + return decoratedMethod.apply(this, arguments); + }; + }; + + for (var d = 0; d < decoratedMethods.length; d++) { + var decoratedMethod = decoratedMethods[d]; + + DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); + } + + return DecoratedClass; + }; + + var Observable = function () { + this.listeners = {}; + }; + + Observable.prototype.on = function (event, callback) { + this.listeners = this.listeners || {}; + + if (event in this.listeners) { + this.listeners[event].push(callback); + } else { + this.listeners[event] = [callback]; + } + }; + + Observable.prototype.trigger = function (event) { + var slice = Array.prototype.slice; + var params = slice.call(arguments, 1); + + this.listeners = this.listeners || {}; + + // Params should always come in as an array + if (params == null) { + params = []; + } + + // If there are no arguments to the event, use a temporary object + if (params.length === 0) { + params.push({}); + } + + // Set the `_type` of the first object to the event + params[0]._type = event; + + if (event in this.listeners) { + this.invoke(this.listeners[event], slice.call(arguments, 1)); + } + + if ('*' in this.listeners) { + this.invoke(this.listeners['*'], arguments); + } + }; + + Observable.prototype.invoke = function (listeners, params) { + for (var i = 0, len = listeners.length; i < len; i++) { + listeners[i].apply(this, params); + } + }; + + Utils.Observable = Observable; + + Utils.generateChars = function (length) { + var chars = ''; + + for (var i = 0; i < length; i++) { + var randomChar = Math.floor(Math.random() * 36); + chars += randomChar.toString(36); + } + + return chars; + }; + + Utils.bind = function (func, context) { + return function () { + func.apply(context, arguments); + }; + }; + + Utils._convertData = function (data) { + for (var originalKey in data) { + var keys = originalKey.split('-'); + + var dataLevel = data; + + if (keys.length === 1) { + continue; + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + + // Lowercase the first letter + // By default, dash-separated becomes camelCase + key = key.substring(0, 1).toLowerCase() + key.substring(1); + + if (!(key in dataLevel)) { + dataLevel[key] = {}; + } + + if (k == keys.length - 1) { + dataLevel[key] = data[originalKey]; + } + + dataLevel = dataLevel[key]; + } + + delete data[originalKey]; + } + + return data; + }; + + Utils.hasScroll = function (index, el) { + // Adapted from the function created by @ShadowScripter + // and adapted by @BillBarry on the Stack Exchange Code Review website. + // The original code can be found at + // http://codereview.stackexchange.com/q/13338 + // and was designed to be used with the Sizzle selector engine. + + var $el = $(el); + var overflowX = el.style.overflowX; + var overflowY = el.style.overflowY; + + //Check both x and y declarations + if (overflowX === overflowY && + (overflowY === 'hidden' || overflowY === 'visible')) { + return false; + } + + if (overflowX === 'scroll' || overflowY === 'scroll') { + return true; + } + + return ($el.innerHeight() < el.scrollHeight || + $el.innerWidth() < el.scrollWidth); + }; + + Utils.escapeMarkup = function (markup) { + var replaceMap = { + '\\': '\', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '/': '/' + }; + + // Do not try to escape the markup if it's not a string + if (typeof markup !== 'string') { + return markup; + } + + return String(markup).replace(/[&<>"'\/\\]/g, function (match) { + return replaceMap[match]; + }); + }; + + // Append an array of jQuery nodes to a given element. + Utils.appendMany = function ($element, $nodes) { + // jQuery 1.7.x does not support $.fn.append() with an array + // Fall back to a jQuery object collection using $.fn.add() + if ($.fn.jquery.substr(0, 3) === '1.7') { + var $jqNodes = $(); + + $.map($nodes, function (node) { + $jqNodes = $jqNodes.add(node); + }); + + $nodes = $jqNodes; + } + + $element.append($nodes); + }; + + return Utils; +}); diff --git a/public/bower_components/select2/src/js/wrapper.end.js b/public/bower_components/select2/src/js/wrapper.end.js new file mode 100644 index 0000000..4367829 --- /dev/null +++ b/public/bower_components/select2/src/js/wrapper.end.js @@ -0,0 +1,12 @@ + // Autoload the jQuery bindings + // We know that all of the modules exist above this, so we're safe + var select2 = S2.require('jquery.select2'); + + // Hold the AMD module references on the jQuery function that was just loaded + // This allows Select2 to use the internal loader outside of this file, such + // as in the language files. + jQuery.fn.select2.amd = S2; + + // Return the Select2 instance for anyone who is importing it. + return select2; +})); diff --git a/public/bower_components/select2/src/js/wrapper.start.js b/public/bower_components/select2/src/js/wrapper.start.js new file mode 100644 index 0000000..4df0e05 --- /dev/null +++ b/public/bower_components/select2/src/js/wrapper.start.js @@ -0,0 +1,38 @@ +/*! + * Select2 <%= package.version %> + * https://select2.github.io + * + * Released under the MIT license + * https://github.com/select2/select2/blob/master/LICENSE.md + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = function (root, jQuery) { + if (jQuery === undefined) { + // require('jQuery') returns a factory that requires window to + // build a jQuery instance, we normalize how we use modules + // that require this pattern but the window provided is a noop + // if it's defined (how jquery works) + if (typeof window !== 'undefined') { + jQuery = require('jquery'); + } + else { + jQuery = require('jquery')(root); + } + } + factory(jQuery); + return jQuery; + }; + } else { + // Browser globals + factory(jQuery); + } +} (function (jQuery) { + // This is needed so we can catch the AMD loader configuration and use it + // The inner file should be wrapped (by `banner.start.js`) in a function that + // returns the AMD loader references. + var S2 = \ No newline at end of file -- cgit v1.2.3