diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index ed8ca510..00000000 --- a/.coveragerc +++ /dev/null @@ -1,12 +0,0 @@ -[run] -source = - activity - member - note -omit = - activity/tests/*.py - activity/migrations/*.py - member/tests/*.py - member/migrations/*.py - note/tests/*.py - note/migrations/*.py \ No newline at end of file diff --git a/.env_example b/.env_example index 5aba0d14..d903b724 100644 --- a/.env_example +++ b/.env_example @@ -1,13 +1,13 @@ -DJANGO_APP_STAGE="dev" +DJANGO_APP_STAGE=dev # Only used in dev mode, change to "postgresql" if you want to use PostgreSQL in dev -DJANGO_DEV_STORE_METHOD="sqllite" -DJANGO_DB_HOST="localhost" -DJANGO_DB_NAME="note_db" -DJANGO_DB_USER="note" -DJANGO_DB_PASSWORD="CHANGE_ME" -DJANGO_DB_PORT="" -DJANGO_SECRET_KEY="CHANGE_ME" -DJANGO_SETTINGS_MODULE="note_kfet.settings" -DOMAIN="localhost" -CONTACT_EMAIL="tresorerie.bde@localhost" -NOTE_URL="localhost" +DJANGO_DEV_STORE_METHOD=sqllite +DJANGO_DB_HOST=localhost +DJANGO_DB_NAME=note_db +DJANGO_DB_USER=note +DJANGO_DB_PASSWORD=CHANGE_ME +DJANGO_DB_PORT= +DJANGO_SECRET_KEY=CHANGE_ME +DJANGO_SETTINGS_MODULE=note_kfet.settings +DOMAIN=localhost +CONTACT_EMAIL=tresorerie.bde@localhost +NOTE_URL=localhost diff --git a/Dockerfile b/Dockerfile index dfc49d04..80f2c773 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,6 @@ COPY . /code/ # Comment what is not needed RUN pip install -r requirements/base.txt -RUN pip install -r requirements/api.txt RUN pip install -r requirements/cas.txt RUN pip install -r requirements/production.txt diff --git a/README.md b/README.md index 9b0c927e..0c0cfb2e 100644 --- a/README.md +++ b/README.md @@ -106,18 +106,18 @@ On supposera pour la suite que vous utilisez Debian/Ubuntu sur un serveur tout n On copie le fichier `.env_example` vers le fichier `.env` à la racine du projet et on renseigne des secrets et des paramètres : - DJANGO_APP_STAGE="dev" # ou "prod" - DJANGO_DEV_STORE_METHOD="sqllite" # ou "postgres" - DJANGO_DB_HOST="localhost" - DJANGO_DB_NAME="note_db" - DJANGO_DB_USER="note" - DJANGO_DB_PASSWORD="CHANGE_ME" - DJANGO_DB_PORT="" - DJANGO_SECRET_KEY="CHANGE_ME" - DJANGO_SETTINGS_MODULE="note_kfet.settings" - DOMAIN="localhost" # note.example.com - CONTACT_EMAIL="tresorerie.bde@localhost" - NOTE_URL="localhost" # serveur cas note.example.com si auto-hébergé. + DJANGO_APP_STAGE=dev # ou "prod" + DJANGO_DEV_STORE_METHOD=sqllite # ou "postgres" + DJANGO_DB_HOST=localhost + DJANGO_DB_NAME=note_db + DJANGO_DB_USER=note + DJANGO_DB_PASSWORD=CHANGE_ME + DJANGO_DB_PORT= + DJANGO_SECRET_KEY=CHANGE_ME + DJANGO_SETTINGS_MODULE="note_kfet.settings + DOMAIN=localhost # note.example.com + CONTACT_EMAIL=tresorerie.bde@localhost + NOTE_URL=localhost # serveur cas note.example.com si auto-hébergé. Ensuite on (re)bascule dans l'environement virtuel et on lance les migrations diff --git a/static/vendor/select2/Gruntfile.js b/static/vendor/select2/Gruntfile.js deleted file mode 100644 index b4c4508a..00000000 --- a/static/vendor/select2/Gruntfile.js +++ /dev/null @@ -1,262 +0,0 @@ -const sass = require('node-sass'); - -module.exports = function (grunt) { - // Full list of files that must be included by RequireJS - includes = [ - 'jquery.select2', - 'almond', - - 'jquery-mousewheel' // shimmed for non-full builds - ]; - - fullIncludes = [ - 'jquery', - - 'select2/compat/containerCss', - 'select2/compat/dropdownCss', - - 'select2/compat/initSelection', - 'select2/compat/inputData', - 'select2/compat/matcher', - 'select2/compat/query', - - 'select2/dropdown/attachContainer', - 'select2/dropdown/stopPropagation', - - 'select2/selection/stopPropagation' - ].concat(includes); - - var i18nModules = []; - var i18nPaths = {}; - - var i18nFiles = grunt.file.expand({ - cwd: 'src/js' - }, 'select2/i18n/*.js'); - - var testFiles = grunt.file.expand('tests/**/*.html'); - var testUrls = testFiles.map(function (filePath) { - return 'http://localhost:9999/' + filePath; - }); - - var testBuildNumber = "unknown"; - - if (process.env.TRAVIS_JOB_ID) { - testBuildNumber = "travis-" + process.env.TRAVIS_JOB_ID; - } else { - var currentTime = new Date(); - - testBuildNumber = "manual-" + currentTime.getTime(); - } - - for (var i = 0; i < i18nFiles.length; i++) { - var file = i18nFiles[i]; - var name = file.split('.')[0]; - - i18nModules.push({ - name: name - }); - - i18nPaths[name] = '../../' + name; - } - - var minifiedBanner = '/*! Select2 <%= package.version %> | https://github.com/select2/select2/blob/master/LICENSE.md */'; - - grunt.initConfig({ - package: grunt.file.readJSON('package.json'), - - concat: { - 'dist': { - options: { - banner: grunt.file.read('src/js/wrapper.start.js'), - }, - src: [ - 'dist/js/select2.js', - 'src/js/wrapper.end.js' - ], - dest: 'dist/js/select2.js' - }, - 'dist.full': { - options: { - banner: grunt.file.read('src/js/wrapper.start.js'), - }, - src: [ - 'dist/js/select2.full.js', - 'src/js/wrapper.end.js' - ], - dest: 'dist/js/select2.full.js' - } - }, - - connect: { - tests: { - options: { - base: '.', - hostname: '127.0.0.1', - port: 9999 - } - } - }, - - uglify: { - 'dist': { - src: 'dist/js/select2.js', - dest: 'dist/js/select2.min.js', - options: { - banner: minifiedBanner - } - }, - 'dist.full': { - src: 'dist/js/select2.full.js', - dest: 'dist/js/select2.full.min.js', - options: { - banner: minifiedBanner - } - } - }, - - qunit: { - all: { - options: { - urls: testUrls - } - } - }, - - jshint: { - options: { - jshintrc: true, - reporterOutput: '' - }, - code: { - src: ['src/js/**/*.js'] - }, - tests: { - src: ['tests/**/*.js'] - } - }, - - sass: { - dist: { - options: { - implementation: sass, - outputStyle: 'compressed' - }, - files: { - 'dist/css/select2.min.css': [ - 'src/scss/core.scss', - 'src/scss/theme/default/layout.css' - ] - } - }, - dev: { - options: { - implementation: sass, - outputStyle: 'nested' - }, - files: { - 'dist/css/select2.css': [ - 'src/scss/core.scss', - 'src/scss/theme/default/layout.css' - ] - } - } - }, - - requirejs: { - 'dist': { - options: { - baseUrl: 'src/js', - optimize: 'none', - name: 'select2/core', - out: 'dist/js/select2.js', - include: includes, - namespace: 'S2', - paths: { - 'almond': require.resolve('almond').slice(0, -3), - 'jquery': 'jquery.shim', - 'jquery-mousewheel': 'jquery.mousewheel.shim' - }, - wrap: { - startFile: 'src/js/banner.start.js', - endFile: 'src/js/banner.end.js' - } - } - }, - 'dist.full': { - options: { - baseUrl: 'src/js', - optimize: 'none', - name: 'select2/core', - out: 'dist/js/select2.full.js', - include: fullIncludes, - namespace: 'S2', - paths: { - 'almond': require.resolve('almond').slice(0, -3), - 'jquery': 'jquery.shim', - 'jquery-mousewheel': require.resolve('jquery-mousewheel').slice(0, -3) - }, - wrap: { - startFile: 'src/js/banner.start.js', - endFile: 'src/js/banner.end.js' - } - } - }, - 'i18n': { - options: { - baseUrl: 'src/js/select2/i18n', - dir: 'dist/js/i18n', - paths: i18nPaths, - modules: i18nModules, - namespace: 'S2', - wrap: { - start: minifiedBanner + grunt.file.read('src/js/banner.start.js'), - end: grunt.file.read('src/js/banner.end.js') - } - } - } - }, - - watch: { - js: { - files: [ - 'src/js/select2/**/*.js', - 'tests/**/*.js' - ], - tasks: [ - 'compile', - 'test', - 'minify' - ] - }, - css: { - files: [ - 'src/scss/**/*.scss' - ], - tasks: [ - 'compile', - 'minify' - ] - } - } - }); - - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-qunit'); - grunt.loadNpmTasks('grunt-contrib-requirejs'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.loadNpmTasks('grunt-sass'); - - grunt.registerTask('default', ['compile', 'test', 'minify']); - - grunt.registerTask('compile', [ - 'requirejs:dist', 'requirejs:dist.full', 'requirejs:i18n', - 'concat:dist', 'concat:dist.full', - 'sass:dev' - ]); - grunt.registerTask('minify', ['uglify', 'sass:dist']); - grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']); -}; diff --git a/static/vendor/select2/bower.json b/static/vendor/select2/bower.json deleted file mode 100644 index 681600b5..00000000 --- a/static/vendor/select2/bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "select2", - "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", - "main": [ - "dist/js/select2.js", - "src/scss/core.scss" - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git@github.com:select2/select2.git" - } -} diff --git a/static/vendor/select2/component.json b/static/vendor/select2/component.json deleted file mode 100644 index 75e19f1e..00000000 --- a/static/vendor/select2/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "select2", - "repo": "select/select2", - "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", - "version": "4.0.7", - "demo": "https://select2.org/", - "keywords": [ - "jquery" - ], - "main": "dist/js/select2.js", - "styles": [ - "dist/css/select2.css" - ], - "scripts": [ - "dist/js/select2.js", - "dist/js/i18n/*.js" - ], - "license": "MIT" -} diff --git a/static/vendor/select2/composer.json b/static/vendor/select2/composer.json deleted file mode 100644 index 5ef2db2b..00000000 --- a/static/vendor/select2/composer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "select2/select2", - "description": "Select2 is a jQuery based replacement for select boxes.", - "type": "component", - "homepage": "https://select2.org/", - "license": "MIT", - "extra": { - "component": { - "scripts": [ - "dist/js/select2.js" - ], - "styles": [ - "dist/css/select2.css" - ], - "files": [ - "dist/js/select2.js", - "dist/js/i18n/*.js", - "dist/css/select2.css" - ] - } - } -} diff --git a/static/vendor/select2/docs/announcements-4.0.html b/static/vendor/select2/docs/announcements-4.0.html deleted file mode 100644 index bc85b4c1..00000000 --- a/static/vendor/select2/docs/announcements-4.0.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - select2 - - - - - \ No newline at end of file diff --git a/static/vendor/select2/docs/community.html b/static/vendor/select2/docs/community.html deleted file mode 100644 index ffe8f83f..00000000 --- a/static/vendor/select2/docs/community.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - select2 - - - - - \ No newline at end of file diff --git a/static/vendor/select2/docs/examples.html b/static/vendor/select2/docs/examples.html deleted file mode 100644 index a463e84a..00000000 --- a/static/vendor/select2/docs/examples.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - select2 - - - - - \ No newline at end of file diff --git a/static/vendor/select2/docs/index.html b/static/vendor/select2/docs/index.html deleted file mode 100644 index ea8214d6..00000000 --- a/static/vendor/select2/docs/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - select2 - - - - - \ No newline at end of file diff --git a/static/vendor/select2/docs/options-old.html b/static/vendor/select2/docs/options-old.html deleted file mode 100644 index 4920b76b..00000000 --- a/static/vendor/select2/docs/options-old.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - select2 - - - - - \ No newline at end of file diff --git a/static/vendor/select2/docs/options.html b/static/vendor/select2/docs/options.html deleted file mode 100644 index 4920b76b..00000000 --- a/static/vendor/select2/docs/options.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - select2 - - - - - \ No newline at end of file diff --git a/static/vendor/select2/package.json b/static/vendor/select2/package.json deleted file mode 100644 index 231473b5..00000000 --- a/static/vendor/select2/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "select2", - "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", - "homepage": "https://select2.org", - "author": { - "name": "Kevin Brown", - "url": "https://github.com/kevin-brown" - }, - "contributors": [ - { - "name": "Igor Vaynberg", - "url": "https://github.com/ivaynberg" - }, - { - "name": "Alex Weissman", - "url": "https://github.com/alexweissman" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/select2/select2.git" - }, - "bugs": { - "url": "https://github.com/select2/select2/issues" - }, - "keywords": [ - "select", - "autocomplete", - "typeahead", - "dropdown", - "multiselect", - "tag", - "tagging" - ], - "license": "MIT", - "main": "dist/js/select2.js", - "style": "dist/css/select2.css", - "files": [ - "src", - "dist" - ], - "version": "4.0.7", - "jspm": { - "main": "js/select2", - "directories": { - "lib": "dist" - } - }, - "devDependencies": { - "almond": "~0.3.1", - "grunt": "^0.4.5", - "grunt-cli": "^1.3.2", - "grunt-contrib-concat": "^1.0.1", - "grunt-contrib-connect": "^2.0.0", - "grunt-contrib-jshint": "^1.1.0", - "grunt-contrib-qunit": "^1.3.0", - "grunt-contrib-requirejs": "^1.0.0", - "grunt-contrib-uglify": "~4.0.1", - "grunt-contrib-watch": "~1.1.0", - "grunt-sass": "^2.1.0", - "jquery-mousewheel": "~3.1.13", - "node-sass": "^4.12.0" - }, - "dependencies": {} -} diff --git a/static/vendor/select2/src/js/banner.end.js b/static/vendor/select2/src/js/banner.end.js deleted file mode 100644 index ea00a036..00000000 --- a/static/vendor/select2/src/js/banner.end.js +++ /dev/null @@ -1,6 +0,0 @@ - // Return the AMD loader configuration so it can be used outside of this file - return { - define: S2.define, - require: S2.require - }; -}()); diff --git a/static/vendor/select2/src/js/banner.start.js b/static/vendor/select2/src/js/banner.start.js deleted file mode 100644 index 78fe8b02..00000000 --- a/static/vendor/select2/src/js/banner.start.js +++ /dev/null @@ -1,6 +0,0 @@ -(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/static/vendor/select2/src/js/jquery.mousewheel.shim.js b/static/vendor/select2/src/js/jquery.mousewheel.shim.js deleted file mode 100644 index a27fda0e..00000000 --- a/static/vendor/select2/src/js/jquery.mousewheel.shim.js +++ /dev/null @@ -1,6 +0,0 @@ -define([ - 'jquery' -], function ($) { - // Used to shim jQuery.mousewheel for non-full builds. - return $; -}); diff --git a/static/vendor/select2/src/js/jquery.select2.js b/static/vendor/select2/src/js/jquery.select2.js deleted file mode 100644 index 9136ff78..00000000 --- a/static/vendor/select2/src/js/jquery.select2.js +++ /dev/null @@ -1,58 +0,0 @@ -define([ - 'jquery', - 'jquery-mousewheel', - - './select2/core', - './select2/defaults', - './select2/utils' -], function ($, _, Select2, Defaults, Utils) { - 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 = Utils.GetData(this, '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/static/vendor/select2/src/js/jquery.shim.js b/static/vendor/select2/src/js/jquery.shim.js deleted file mode 100644 index 880993af..00000000 --- a/static/vendor/select2/src/js/jquery.shim.js +++ /dev/null @@ -1,14 +0,0 @@ -/* 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/static/vendor/select2/src/js/select2/compat/containerCss.js b/static/vendor/select2/src/js/select2/compat/containerCss.js deleted file mode 100644 index 45703ac8..00000000 --- a/static/vendor/select2/src/js/select2/compat/containerCss.js +++ /dev/null @@ -1,56 +0,0 @@ -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/static/vendor/select2/src/js/select2/compat/dropdownCss.js b/static/vendor/select2/src/js/select2/compat/dropdownCss.js deleted file mode 100644 index 02f55820..00000000 --- a/static/vendor/select2/src/js/select2/compat/dropdownCss.js +++ /dev/null @@ -1,56 +0,0 @@ -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/static/vendor/select2/src/js/select2/compat/initSelection.js b/static/vendor/select2/src/js/select2/compat/initSelection.js deleted file mode 100644 index 71ee29d1..00000000 --- a/static/vendor/select2/src/js/select2/compat/initSelection.js +++ /dev/null @@ -1,42 +0,0 @@ -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/static/vendor/select2/src/js/select2/compat/inputData.js b/static/vendor/select2/src/js/select2/compat/inputData.js deleted file mode 100644 index 6e1dee26..00000000 --- a/static/vendor/select2/src/js/select2/compat/inputData.js +++ /dev/null @@ -1,128 +0,0 @@ -define([ - 'jquery', - '../utils' -], function ($, Utils) { - 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(''); - self.$search.blur(); - }); - - 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/static/vendor/select2/src/js/select2/dropdown/selectOnClose.js b/static/vendor/select2/src/js/select2/dropdown/selectOnClose.js deleted file mode 100644 index 8c633356..00000000 --- a/static/vendor/select2/src/js/select2/dropdown/selectOnClose.js +++ /dev/null @@ -1,50 +0,0 @@ -define([ - '../utils' -], function (Utils) { - 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 = Utils.GetData($highlightedResults[0], '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/static/vendor/select2/src/js/select2/dropdown/stopPropagation.js b/static/vendor/select2/src/js/select2/dropdown/stopPropagation.js deleted file mode 100644 index 4f641827..00000000 --- a/static/vendor/select2/src/js/select2/dropdown/stopPropagation.js +++ /dev/null @@ -1,38 +0,0 @@ -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/static/vendor/select2/src/js/select2/i18n/af.js b/static/vendor/select2/src/js/select2/i18n/af.js deleted file mode 100644 index b2a70c97..00000000 --- a/static/vendor/select2/src/js/select2/i18n/af.js +++ /dev/null @@ -1,47 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Verwyder alle items'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ar.js b/static/vendor/select2/src/js/select2/i18n/ar.js deleted file mode 100644 index 11f2c9e1..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ar.js +++ /dev/null @@ -1,33 +0,0 @@ -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 'جاري البحث…'; - }, - removeAllItems: function () { - return 'قم بإزالة كل العناصر'; - } - }; -}); \ No newline at end of file diff --git a/static/vendor/select2/src/js/select2/i18n/az.js b/static/vendor/select2/src/js/select2/i18n/az.js deleted file mode 100644 index 8dae8749..00000000 --- a/static/vendor/select2/src/js/select2/i18n/az.js +++ /dev/null @@ -1,30 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Bütün elementləri sil'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/bg.js b/static/vendor/select2/src/js/select2/i18n/bg.js deleted file mode 100644 index e70af155..00000000 --- a/static/vendor/select2/src/js/select2/i18n/bg.js +++ /dev/null @@ -1,50 +0,0 @@ -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 'Търсене…'; - }, - removeAllItems: function () { - return 'Премахнете всички елементи'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/bn.js b/static/vendor/select2/src/js/select2/i18n/bn.js deleted file mode 100644 index b28fdd79..00000000 --- a/static/vendor/select2/src/js/select2/i18n/bn.js +++ /dev/null @@ -1,45 +0,0 @@ -define(function () { - // Bangla - 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 + ' টি আইটেম নির্বাচন করতে পারবেন।'; - - if (args.maximum != 1) { - message = args.maximum + ' টি আইটেম নির্বাচন করতে পারবেন।'; - } - - return message; - }, - noResults: function () { - return 'কোন ফলাফল পাওয়া যায়নি।'; - }, - searching: function () { - return 'অনুসন্ধান করা হচ্ছে ...'; - } - }; - }); - \ No newline at end of file diff --git a/static/vendor/select2/src/js/select2/i18n/bs.js b/static/vendor/select2/src/js/select2/i18n/bs.js deleted file mode 100644 index f94b12cd..00000000 --- a/static/vendor/select2/src/js/select2/i18n/bs.js +++ /dev/null @@ -1,58 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Uklonite sve stavke'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ca.js b/static/vendor/select2/src/js/select2/i18n/ca.js deleted file mode 100644 index d8b98557..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ca.js +++ /dev/null @@ -1,55 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Treu tots els elements'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/cs.js b/static/vendor/select2/src/js/select2/i18n/cs.js deleted file mode 100644 index 9b3bce59..00000000 --- a/static/vendor/select2/src/js/select2/i18n/cs.js +++ /dev/null @@ -1,64 +0,0 @@ -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í…'; - }, - removeAllItems: function () { - return 'Odstraňte všechny položky'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/da.js b/static/vendor/select2/src/js/select2/i18n/da.js deleted file mode 100644 index fdf5ebe8..00000000 --- a/static/vendor/select2/src/js/select2/i18n/da.js +++ /dev/null @@ -1,39 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Fjern alle elementer'; - } - }; -}); \ No newline at end of file diff --git a/static/vendor/select2/src/js/select2/i18n/de.js b/static/vendor/select2/src/js/select2/i18n/de.js deleted file mode 100644 index f8277c3b..00000000 --- a/static/vendor/select2/src/js/select2/i18n/de.js +++ /dev/null @@ -1,43 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Entferne alle Gegenstände'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/dsb.js b/static/vendor/select2/src/js/select2/i18n/dsb.js deleted file mode 100644 index af3ec46f..00000000 --- a/static/vendor/select2/src/js/select2/i18n/dsb.js +++ /dev/null @@ -1,52 +0,0 @@ -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…'; - }, - removeAllItems: function () { - // To DO : in Lower Sorbian. - return 'Remove all items'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/el.js b/static/vendor/select2/src/js/select2/i18n/el.js deleted file mode 100644 index 49922292..00000000 --- a/static/vendor/select2/src/js/select2/i18n/el.js +++ /dev/null @@ -1,55 +0,0 @@ -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 'Αναζήτηση…'; - }, - removeAllItems: function () { - return 'Καταργήστε όλα τα στοιχεία'; - } - }; -}); \ No newline at end of file diff --git a/static/vendor/select2/src/js/select2/i18n/en.js b/static/vendor/select2/src/js/select2/i18n/en.js deleted file mode 100644 index 960a84e8..00000000 --- a/static/vendor/select2/src/js/select2/i18n/en.js +++ /dev/null @@ -1,47 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Remove all items'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/es.js b/static/vendor/select2/src/js/select2/i18n/es.js deleted file mode 100644 index d95f303f..00000000 --- a/static/vendor/select2/src/js/select2/i18n/es.js +++ /dev/null @@ -1,55 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Eliminar todos los elementos'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/et.js b/static/vendor/select2/src/js/select2/i18n/et.js deleted file mode 100644 index 589e4e7b..00000000 --- a/static/vendor/select2/src/js/select2/i18n/et.js +++ /dev/null @@ -1,56 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Eemalda kõik esemed'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/eu.js b/static/vendor/select2/src/js/select2/i18n/eu.js deleted file mode 100644 index 362745a2..00000000 --- a/static/vendor/select2/src/js/select2/i18n/eu.js +++ /dev/null @@ -1,54 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Kendu elementu guztiak'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/fa.js b/static/vendor/select2/src/js/select2/i18n/fa.js deleted file mode 100644 index 4b92d0e4..00000000 --- a/static/vendor/select2/src/js/select2/i18n/fa.js +++ /dev/null @@ -1,41 +0,0 @@ -/* 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 'در حال جستجو...'; - }, - removeAllItems: function () { - return 'همه موارد را حذف کنید'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/fi.js b/static/vendor/select2/src/js/select2/i18n/fi.js deleted file mode 100644 index cc062d61..00000000 --- a/static/vendor/select2/src/js/select2/i18n/fi.js +++ /dev/null @@ -1,33 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Poista kaikki kohteet'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/fr.js b/static/vendor/select2/src/js/select2/i18n/fr.js deleted file mode 100644 index 02c4d928..00000000 --- a/static/vendor/select2/src/js/select2/i18n/fr.js +++ /dev/null @@ -1,36 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Supprimer tous les éléments'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/gl.js b/static/vendor/select2/src/js/select2/i18n/gl.js deleted file mode 100644 index a92d6a5a..00000000 --- a/static/vendor/select2/src/js/select2/i18n/gl.js +++ /dev/null @@ -1,42 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Elimina todos os elementos'; - } - }; -}); \ No newline at end of file diff --git a/static/vendor/select2/src/js/select2/i18n/he.js b/static/vendor/select2/src/js/select2/i18n/he.js deleted file mode 100644 index 5192d866..00000000 --- a/static/vendor/select2/src/js/select2/i18n/he.js +++ /dev/null @@ -1,59 +0,0 @@ -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 'מחפש…'; - }, - removeAllItems: function () { - return 'הסר את כל הפריטים'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/hi.js b/static/vendor/select2/src/js/select2/i18n/hi.js deleted file mode 100644 index 234a5926..00000000 --- a/static/vendor/select2/src/js/select2/i18n/hi.js +++ /dev/null @@ -1,42 +0,0 @@ -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 'खोज रहा है...'; - }, - removeAllItems: function () { - return 'सभी वस्तुओं को हटा दें'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/hr.js b/static/vendor/select2/src/js/select2/i18n/hr.js deleted file mode 100644 index 06223447..00000000 --- a/static/vendor/select2/src/js/select2/i18n/hr.js +++ /dev/null @@ -1,47 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Ukloni sve stavke'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/hsb.js b/static/vendor/select2/src/js/select2/i18n/hsb.js deleted file mode 100644 index a72417d4..00000000 --- a/static/vendor/select2/src/js/select2/i18n/hsb.js +++ /dev/null @@ -1,52 +0,0 @@ -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…'; - }, - removeAllItems: function () { - // To DO : in Upper Sorbian. - return 'Remove all items'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/hu.js b/static/vendor/select2/src/js/select2/i18n/hu.js deleted file mode 100644 index 9c62748c..00000000 --- a/static/vendor/select2/src/js/select2/i18n/hu.js +++ /dev/null @@ -1,33 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Távolítson el minden elemet'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/hy.js b/static/vendor/select2/src/js/select2/i18n/hy.js deleted file mode 100644 index 696e89dd..00000000 --- a/static/vendor/select2/src/js/select2/i18n/hy.js +++ /dev/null @@ -1,41 +0,0 @@ -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 'Որոնում․․․'; - }, - removeAllItems: function () { - return 'Հեռացնել բոլոր տարրերը'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/id.js b/static/vendor/select2/src/js/select2/i18n/id.js deleted file mode 100644 index ceb2c1bb..00000000 --- a/static/vendor/select2/src/js/select2/i18n/id.js +++ /dev/null @@ -1,33 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Hapus semua item'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/is.js b/static/vendor/select2/src/js/select2/i18n/is.js deleted file mode 100644 index f16283fa..00000000 --- a/static/vendor/select2/src/js/select2/i18n/is.js +++ /dev/null @@ -1,44 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Fjarlægðu öll atriði'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/it.js b/static/vendor/select2/src/js/select2/i18n/it.js deleted file mode 100644 index 2bedeb9b..00000000 --- a/static/vendor/select2/src/js/select2/i18n/it.js +++ /dev/null @@ -1,51 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Rimuovi tutti gli oggetti'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ja.js b/static/vendor/select2/src/js/select2/i18n/ja.js deleted file mode 100644 index 68568f32..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ja.js +++ /dev/null @@ -1,39 +0,0 @@ -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 '検索しています…'; - }, - removeAllItems: function () { - return 'すべてのアイテムを削除'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ka.js b/static/vendor/select2/src/js/select2/i18n/ka.js deleted file mode 100644 index 306ea90c..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ka.js +++ /dev/null @@ -1,40 +0,0 @@ -define(function () { - // Georgian - 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 'ძიება…'; - }, - removeAllItems: function () { - return 'ამოიღე ყველა ელემენტი'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/km.js b/static/vendor/select2/src/js/select2/i18n/km.js deleted file mode 100644 index 066d5230..00000000 --- a/static/vendor/select2/src/js/select2/i18n/km.js +++ /dev/null @@ -1,39 +0,0 @@ -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 'កំពុងស្វែងរក...'; - }, - removeAllItems: function () { - return 'លុបធាតុទាំងអស់'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ko.js b/static/vendor/select2/src/js/select2/i18n/ko.js deleted file mode 100644 index 03b5dc09..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ko.js +++ /dev/null @@ -1,39 +0,0 @@ -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 '검색 중…'; - }, - removeAllItems: function () { - return '모든 항목 삭제'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/lt.js b/static/vendor/select2/src/js/select2/i18n/lt.js deleted file mode 100644 index c6f8ad9e..00000000 --- a/static/vendor/select2/src/js/select2/i18n/lt.js +++ /dev/null @@ -1,55 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Pašalinti visus elementus'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/lv.js b/static/vendor/select2/src/js/select2/i18n/lv.js deleted file mode 100644 index 53324fd6..00000000 --- a/static/vendor/select2/src/js/select2/i18n/lv.js +++ /dev/null @@ -1,54 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Noņemt visus vienumus'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/mk.js b/static/vendor/select2/src/js/select2/i18n/mk.js deleted file mode 100644 index 60845112..00000000 --- a/static/vendor/select2/src/js/select2/i18n/mk.js +++ /dev/null @@ -1,50 +0,0 @@ -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 'Пребарување…'; - }, - removeAllItems: function () { - return 'Отстрани ги сите предмети'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ms.js b/static/vendor/select2/src/js/select2/i18n/ms.js deleted file mode 100644 index 3338c87e..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ms.js +++ /dev/null @@ -1,33 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Keluarkan semua item'; - } - }; -}); \ No newline at end of file diff --git a/static/vendor/select2/src/js/select2/i18n/nb.js b/static/vendor/select2/src/js/select2/i18n/nb.js deleted file mode 100644 index aee869be..00000000 --- a/static/vendor/select2/src/js/select2/i18n/nb.js +++ /dev/null @@ -1,33 +0,0 @@ -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; - - return 'Vennligst skriv inn ' + remainingChars + ' 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…'; - }, - removeAllItems: function () { - return 'Fjern alle elementer'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ne.js b/static/vendor/select2/src/js/select2/i18n/ne.js deleted file mode 100644 index 133af69b..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ne.js +++ /dev/null @@ -1,47 +0,0 @@ -define(function () { - // Nepali - 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 + - ' वस्तु मात्र छान्न पाउँनुहुन्छ।'; - - if (args.maximum != 1) { - message = 'तँपाई ' + args.maximum + - ' वस्तुहरु मात्र छान्न पाउँनुहुन्छ।'; - } - - return message; - }, - noResults: function () { - return 'कुनै पनि नतिजा भेटिएन।'; - }, - searching: function () { - return 'खोजि हुँदैछ…'; - } - }; - }); diff --git a/static/vendor/select2/src/js/select2/i18n/nl.js b/static/vendor/select2/src/js/select2/i18n/nl.js deleted file mode 100644 index 7e4a5fea..00000000 --- a/static/vendor/select2/src/js/select2/i18n/nl.js +++ /dev/null @@ -1,46 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Verwijder alle items'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/pl.js b/static/vendor/select2/src/js/select2/i18n/pl.js deleted file mode 100644 index 1a3d890a..00000000 --- a/static/vendor/select2/src/js/select2/i18n/pl.js +++ /dev/null @@ -1,48 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Usuń wszystkie przedmioty'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ps.js b/static/vendor/select2/src/js/select2/i18n/ps.js deleted file mode 100644 index cb5797a2..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ps.js +++ /dev/null @@ -1,48 +0,0 @@ -/* 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 'لټول کيږي...'; - }, - removeAllItems: function () { - return 'ټول توکي لرې کړئ'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/pt-BR.js b/static/vendor/select2/src/js/select2/i18n/pt-BR.js deleted file mode 100644 index 6e5beb0a..00000000 --- a/static/vendor/select2/src/js/select2/i18n/pt-BR.js +++ /dev/null @@ -1,49 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Remover todos os itens'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/pt.js b/static/vendor/select2/src/js/select2/i18n/pt.js deleted file mode 100644 index 27bb0293..00000000 --- a/static/vendor/select2/src/js/select2/i18n/pt.js +++ /dev/null @@ -1,43 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Remover todos os itens'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ro.js b/static/vendor/select2/src/js/select2/i18n/ro.js deleted file mode 100644 index 75d17815..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ro.js +++ /dev/null @@ -1,49 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Eliminați toate elementele'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/ru.js b/static/vendor/select2/src/js/select2/i18n/ru.js deleted file mode 100644 index 8bb24305..00000000 --- a/static/vendor/select2/src/js/select2/i18n/ru.js +++ /dev/null @@ -1,61 +0,0 @@ -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 'Поиск…'; - }, - removeAllItems: function () { - return 'Удалить все элементы'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/sk.js b/static/vendor/select2/src/js/select2/i18n/sk.js deleted file mode 100644 index f3e821d5..00000000 --- a/static/vendor/select2/src/js/select2/i18n/sk.js +++ /dev/null @@ -1,62 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Odstráňte všetky položky'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/sl.js b/static/vendor/select2/src/js/select2/i18n/sl.js deleted file mode 100644 index df12e402..00000000 --- a/static/vendor/select2/src/js/select2/i18n/sl.js +++ /dev/null @@ -1,57 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Odstranite vse elemente'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/sq.js b/static/vendor/select2/src/js/select2/i18n/sq.js deleted file mode 100644 index d3e1b8a5..00000000 --- a/static/vendor/select2/src/js/select2/i18n/sq.js +++ /dev/null @@ -1,48 +0,0 @@ -define(function () { - // Albanian - return { - errorLoading: function () { - return 'Rezultatet nuk mund të ngarkoheshin.'; - }, - inputTooLong: function (args) { - var overChars = args.input.length - args.maximum; - - var message = 'Të lutem fshi ' + overChars + ' karakter'; - - if (overChars != 1) { - message += 'e'; - } - - return message; - }, - inputTooShort: function (args) { - var remainingChars = args.minimum - args.input.length; - - var message = 'Të lutem shkruaj ' + remainingChars + - ' ose më shumë karaktere'; - - return message; - }, - loadingMore: function () { - return 'Duke ngarkuar më shumë rezultate…'; - }, - maximumSelected: function (args) { - var message = 'Mund të zgjedhësh vetëm ' + args.maximum + ' element'; - - if (args.maximum != 1) { - message += 'e'; - } - - return message; - }, - noResults: function () { - return 'Nuk u gjet asnjë rezultat'; - }, - searching: function () { - return 'Duke kërkuar…'; - }, - removeAllItems: function () { - return 'Hiq të gjitha sendet'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/sr-Cyrl.js b/static/vendor/select2/src/js/select2/i18n/sr-Cyrl.js deleted file mode 100644 index b8f8d41e..00000000 --- a/static/vendor/select2/src/js/select2/i18n/sr-Cyrl.js +++ /dev/null @@ -1,58 +0,0 @@ -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 'Претрага…'; - }, - removeAllItems: function () { - return 'Уклоните све ставке'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/sr.js b/static/vendor/select2/src/js/select2/i18n/sr.js deleted file mode 100644 index 96f1b723..00000000 --- a/static/vendor/select2/src/js/select2/i18n/sr.js +++ /dev/null @@ -1,58 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Уклоните све ставке'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/sv.js b/static/vendor/select2/src/js/select2/i18n/sv.js deleted file mode 100644 index e4e204f4..00000000 --- a/static/vendor/select2/src/js/select2/i18n/sv.js +++ /dev/null @@ -1,40 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Ta bort alla objekt'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/th.js b/static/vendor/select2/src/js/select2/i18n/th.js deleted file mode 100644 index 01fc554f..00000000 --- a/static/vendor/select2/src/js/select2/i18n/th.js +++ /dev/null @@ -1,39 +0,0 @@ -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 'กำลังค้นข้อมูล…'; - }, - removeAllItems: function () { - return 'ลบรายการทั้งหมด'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/tk.js b/static/vendor/select2/src/js/select2/i18n/tk.js deleted file mode 100644 index fb87b1d7..00000000 --- a/static/vendor/select2/src/js/select2/i18n/tk.js +++ /dev/null @@ -1,40 +0,0 @@ -define(function () { - // Turkmen - return { - errorLoading: function (){ - return 'Netije ýüklenmedi.'; - }, - inputTooLong: function (args) { - var overChars = args.input.length - args.maximum; - - var message = overChars + ' harp bozuň.'; - - return message; - }, - inputTooShort: function (args) { - var remainingChars = args.minimum - args.input.length; - - var message = 'Ýene-de iň az ' + remainingChars + ' harp ýazyň.'; - - return message; - }, - loadingMore: function () { - return 'Köpräk netije görkezilýär…'; - }, - maximumSelected: function (args) { - var message = 'Diňe ' + args.maximum + ' sanysyny saýlaň.'; - - return message; - }, - noResults: function () { - return 'Netije tapylmady.'; - }, - searching: function () { - return 'Gözlenýär…'; - }, - removeAllItems: function () { - // TO DO : add in turkmen, - return 'Remove all items'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/tr.js b/static/vendor/select2/src/js/select2/i18n/tr.js deleted file mode 100644 index 7fa1661d..00000000 --- a/static/vendor/select2/src/js/select2/i18n/tr.js +++ /dev/null @@ -1,39 +0,0 @@ -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…'; - }, - removeAllItems: function () { - return 'Tüm öğeleri kaldır'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/uk.js b/static/vendor/select2/src/js/select2/i18n/uk.js deleted file mode 100644 index 3471265e..00000000 --- a/static/vendor/select2/src/js/select2/i18n/uk.js +++ /dev/null @@ -1,46 +0,0 @@ -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 'Пошук…'; - }, - removeAllItems: function () { - return 'Видалити всі елементи'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/vi.js b/static/vendor/select2/src/js/select2/i18n/vi.js deleted file mode 100644 index 83312c77..00000000 --- a/static/vendor/select2/src/js/select2/i18n/vi.js +++ /dev/null @@ -1,37 +0,0 @@ -define(function () { - // Vietnamese - return { - inputTooLong: function (args) { - var overChars = args.input.length - args.maximum; - - var message = 'Vui lòng xóa bớt ' + overChars + ' ký tự'; - - return message; - }, - inputTooShort: function (args) { - var remainingChars = args.minimum - args.input.length; - - var message = 'Vui lòng nhập thêm từ ' + remainingChars + - ' ký tự trở lên'; - - 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…'; - }, - removeAllItems: function () { - return 'Xóa tất cả các mục'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/zh-CN.js b/static/vendor/select2/src/js/select2/i18n/zh-CN.js deleted file mode 100644 index 18ec5605..00000000 --- a/static/vendor/select2/src/js/select2/i18n/zh-CN.js +++ /dev/null @@ -1,39 +0,0 @@ -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 '搜索中…'; - }, - removeAllItems: function () { - return '删除所有项目'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/i18n/zh-TW.js b/static/vendor/select2/src/js/select2/i18n/zh-TW.js deleted file mode 100644 index f2bf0c4e..00000000 --- a/static/vendor/select2/src/js/select2/i18n/zh-TW.js +++ /dev/null @@ -1,36 +0,0 @@ -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 '搜尋中…'; - }, - removeAllItems: function () { - return '刪除所有項目'; - } - }; -}); diff --git a/static/vendor/select2/src/js/select2/keys.js b/static/vendor/select2/src/js/select2/keys.js deleted file mode 100644 index f449ba43..00000000 --- a/static/vendor/select2/src/js/select2/keys.js +++ /dev/null @@ -1,25 +0,0 @@ -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/static/vendor/select2/src/js/select2/options.js b/static/vendor/select2/src/js/select2/options.js deleted file mode 100644 index 8e0dc07e..00000000 --- a/static/vendor/select2/src/js/select2/options.js +++ /dev/null @@ -1,146 +0,0 @@ -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 (Utils.GetData($e[0], '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.' - ); - } - - Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); - Utils.StoreData($e[0], 'tags', true); - } - - if (Utils.GetData($e[0], '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', Utils.GetData($e[0], 'ajaxUrl')); - Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); - } - - var dataset = {}; - - function upperCaseLetter(_, letter) { - return letter.toUpperCase(); - } - - // Pre-load all of the attributes which are prefixed with `data-` - for (var attr = 0; attr < $e[0].attributes.length; attr++) { - var attributeName = $e[0].attributes[attr].name; - var prefix = 'data-'; - - if (attributeName.substr(0, prefix.length) == prefix) { - // Get the contents of the attribute after `data-` - var dataName = attributeName.substring(prefix.length); - - // Get the data contents from the consistent source - // This is more than likely the jQuery data helper - var dataValue = Utils.GetData($e[0], dataName); - - // camelCase the attribute name to match the spec - var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter); - - // Store the data attribute contents into the dataset since - dataset[camelDataName] = dataValue; - } - } - - // 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, dataset); - } - - // Prefer our internal data cache if it exists - var data = $.extend(true, {}, Utils.GetData($e[0]), 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/static/vendor/select2/src/js/select2/results.js b/static/vendor/select2/src/js/select2/results.js deleted file mode 100644 index b56f8d3b..00000000 --- a/static/vendor/select2/src/js/select2/results.js +++ /dev/null @@ -1,530 +0,0 @@ -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 = Utils.GetData(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); - } - - Utils.StoreData(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(); - - if (self.options.get('scrollAfterSelect')) { - self.highlightFirstItem(); - } - }); - - container.on('unselect', function () { - if (!container.isOpen()) { - return; - } - - self.setClasses(); - - if (self.options.get('scrollAfterSelect')) { - 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 = Utils.GetData($highlighted[0], '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 the top, don't move further - // If no options, currentIndex will be -1 - 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 = Utils.GetData(this, '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 = Utils.GetData(this, '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/static/vendor/select2/src/js/select2/selection/allowClear.js b/static/vendor/select2/src/js/select2/selection/allowClear.js deleted file mode 100644 index 0de5b9bb..00000000 --- a/static/vendor/select2/src/js/select2/selection/allowClear.js +++ /dev/null @@ -1,113 +0,0 @@ -define([ - 'jquery', - '../keys', - '../utils' -], function ($, KEYS, Utils) { - 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 = Utils.GetData($clear[0], 'data'); - - var previousVal = this.$element.val(); - this.$element.val(this.placeholder.id); - - var unselectData = { - data: data - }; - this.trigger('clear', unselectData); - if (unselectData.prevented) { - this.$element.val(previousVal); - return; - } - - for (var d = 0; d < data.length; d++) { - 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) { - this.$element.val(previousVal); - return; - } - } - - this.$element.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 removeAll = this.options.get('translations').get('removeAllItems'); - - var $remove = $( - '' + - '×' + - '' - ); - Utils.StoreData($remove[0], 'data', data); - - this.$selection.find('.select2-selection__rendered').prepend($remove); - }; - - return AllowClear; -}); diff --git a/static/vendor/select2/src/js/select2/selection/base.js b/static/vendor/select2/src/js/select2/selection/base.js deleted file mode 100644 index 6d373bd7..00000000 --- a/static/vendor/select2/src/js/select2/selection/base.js +++ /dev/null @@ -1,160 +0,0 @@ -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 (Utils.GetData(this.$element[0], 'old-tabindex') != null) { - this._tabindex = Utils.GetData(this.$element[0], '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'); - - window.setTimeout(function () { - self.$selection.focus(); - }, 0); - - 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 = Utils.GetData(this, '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/static/vendor/select2/src/js/select2/selection/clickMask.js b/static/vendor/select2/src/js/select2/selection/clickMask.js deleted file mode 100644 index 2b4ac307..00000000 --- a/static/vendor/select2/src/js/select2/selection/clickMask.js +++ /dev/null @@ -1,29 +0,0 @@ -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/static/vendor/select2/src/js/select2/selection/eventRelay.js b/static/vendor/select2/src/js/select2/selection/eventRelay.js deleted file mode 100644 index 0f59822b..00000000 --- a/static/vendor/select2/src/js/select2/selection/eventRelay.js +++ /dev/null @@ -1,48 +0,0 @@ -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', - 'clear', 'clearing' - ]; - - var preventableEvents = [ - 'opening', 'closing', 'selecting', 'unselecting', 'clearing' - ]; - - 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/static/vendor/select2/src/js/select2/selection/multiple.js b/static/vendor/select2/src/js/select2/selection/multiple.js deleted file mode 100644 index 6f106788..00000000 --- a/static/vendor/select2/src/js/select2/selection/multiple.js +++ /dev/null @@ -1,111 +0,0 @@ -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 = Utils.GetData($selection[0], 'data'); - - self.trigger('unselect', { - originalEvent: evt, - data: data - }); - } - ); - }; - - MultipleSelection.prototype.clear = function () { - var $rendered = this.$selection.find('.select2-selection__rendered'); - $rendered.empty(); - $rendered.removeAttr('title'); - }; - - 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.attr('title', selection.title || selection.text); - - Utils.StoreData($selection[0], 'data', selection); - - $selections.push($selection); - } - - var $rendered = this.$selection.find('.select2-selection__rendered'); - - Utils.appendMany($rendered, $selections); - }; - - return MultipleSelection; -}); diff --git a/static/vendor/select2/src/js/select2/selection/placeholder.js b/static/vendor/select2/src/js/select2/selection/placeholder.js deleted file mode 100644 index 87fbedac..00000000 --- a/static/vendor/select2/src/js/select2/selection/placeholder.js +++ /dev/null @@ -1,49 +0,0 @@ -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/static/vendor/select2/src/js/select2/selection/search.js b/static/vendor/select2/src/js/select2/selection/search.js deleted file mode 100644 index 3ff96f94..00000000 --- a/static/vendor/select2/src/js/select2/selection/search.js +++ /dev/null @@ -1,228 +0,0 @@ -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 = Utils.GetData($previousChoice[0], '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) { - var isTagInput = this.$element.find('[data-select2-tag]').length; - if (isTagInput) { - // fix IE11 bug where tag input lost focus - this.$element.focus(); - } else { - 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/static/vendor/select2/src/js/select2/selection/single.js b/static/vendor/select2/src/js/select2/selection/single.js deleted file mode 100644 index e9e99aa4..00000000 --- a/static/vendor/select2/src/js/select2/selection/single.js +++ /dev/null @@ -1,100 +0,0 @@ -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) - .attr('role', 'textbox') - .attr('aria-readonly', 'true'); - 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(); - } - }); - }; - - SingleSelection.prototype.clear = function () { - var $rendered = this.$selection.find('.select2-selection__rendered'); - $rendered.empty(); - $rendered.removeAttr('title'); // clear tooltip on 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.attr('title', selection.title || selection.text); - }; - - return SingleSelection; -}); diff --git a/static/vendor/select2/src/js/select2/selection/stopPropagation.js b/static/vendor/select2/src/js/select2/selection/stopPropagation.js deleted file mode 100644 index 382f1e72..00000000 --- a/static/vendor/select2/src/js/select2/selection/stopPropagation.js +++ /dev/null @@ -1,38 +0,0 @@ -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/static/vendor/select2/src/js/select2/translation.js b/static/vendor/select2/src/js/select2/translation.js deleted file mode 100644 index 5394c18b..00000000 --- a/static/vendor/select2/src/js/select2/translation.js +++ /dev/null @@ -1,36 +0,0 @@ -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/static/vendor/select2/src/js/select2/utils.js b/static/vendor/select2/src/js/select2/utils.js deleted file mode 100644 index 53d82f3d..00000000 --- a/static/vendor/select2/src/js/select2/utils.js +++ /dev/null @@ -1,338 +0,0 @@ -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); - }; - - // Cache objects in Utils.__cache instead of $.data (see #4346) - Utils.__cache = {}; - - var id = 0; - Utils.GetUniqueElementId = function (element) { - // Get a unique element Id. If element has no id, - // creates a new unique number, stores it in the id - // attribute and returns the new id. - // If an id already exists, it simply returns it. - - var select2Id = element.getAttribute('data-select2-id'); - if (select2Id == null) { - // If element has id, use it. - if (element.id) { - select2Id = element.id; - element.setAttribute('data-select2-id', select2Id); - } else { - element.setAttribute('data-select2-id', ++id); - select2Id = id.toString(); - } - } - return select2Id; - }; - - Utils.StoreData = function (element, name, value) { - // Stores an item in the cache for a specified element. - // name is the cache key. - var id = Utils.GetUniqueElementId(element); - if (!Utils.__cache[id]) { - Utils.__cache[id] = {}; - } - - Utils.__cache[id][name] = value; - }; - - Utils.GetData = function (element, name) { - // Retrieves a value from the cache by its key (name) - // name is optional. If no name specified, return - // all cache items for the specified element. - // and for a specified element. - var id = Utils.GetUniqueElementId(element); - if (name) { - if (Utils.__cache[id]) { - if (Utils.__cache[id][name] != null) { - return Utils.__cache[id][name]; - } - return $(element).data(name); // Fallback to HTML5 data attribs. - } - return $(element).data(name); // Fallback to HTML5 data attribs. - } else { - return Utils.__cache[id]; - } - }; - - Utils.RemoveData = function (element) { - // Removes all cached items for a specified element. - var id = Utils.GetUniqueElementId(element); - if (Utils.__cache[id] != null) { - delete Utils.__cache[id]; - } - }; - - return Utils; -}); diff --git a/static/vendor/select2/src/js/wrapper.end.js b/static/vendor/select2/src/js/wrapper.end.js deleted file mode 100644 index 43678296..00000000 --- a/static/vendor/select2/src/js/wrapper.end.js +++ /dev/null @@ -1,12 +0,0 @@ - // 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/static/vendor/select2/src/js/wrapper.start.js b/static/vendor/select2/src/js/wrapper.start.js deleted file mode 100644 index 1dfa51ea..00000000 --- a/static/vendor/select2/src/js/wrapper.start.js +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * 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 diff --git a/static/vendor/select2/tests/a11y/search-tests.js b/static/vendor/select2/tests/a11y/search-tests.js deleted file mode 100644 index 58e56492..00000000 --- a/static/vendor/select2/tests/a11y/search-tests.js +++ /dev/null @@ -1,51 +0,0 @@ -module('Accessibility - Search'); - -var MultipleSelection = require('select2/selection/multiple'); -var InlineSearch = require('select2/selection/search'); - -var $ = require('jquery'); - -var Utils = require('select2/utils'); -var Options = require('select2/options'); -var options = new Options({}); - -test('aria-autocomplete attribute is present', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch); - var selection = new CustomSelection($select, options); - var $selection = selection.render(); - - // Update the selection so the search is rendered - selection.update([]); - - assert.equal( - $selection.find('input').attr('aria-autocomplete'), - 'list', - 'The search box is marked as autocomplete' - ); -}); - -test('aria-activedescendant should be removed when closed', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch); - var selection = new CustomSelection($select, options); - var $selection = selection.render(); - - var container = new MockContainer(); - selection.bind(container, $('')); - - // Update the selection so the search is rendered - selection.update([]); - - var $search = $selection.find('input'); - $search.attr('aria-activedescendant', 'something'); - - container.trigger('close'); - - assert.ok( - !$search.attr('aria-activedescendant'), - 'There is no active descendant when the dropdown is closed' - ); -}); diff --git a/static/vendor/select2/tests/a11y/selection-tests.js b/static/vendor/select2/tests/a11y/selection-tests.js deleted file mode 100644 index e2c14602..00000000 --- a/static/vendor/select2/tests/a11y/selection-tests.js +++ /dev/null @@ -1,154 +0,0 @@ -module('Accessibility - All'); - -var BaseSelection = require('select2/selection/base'); -var SingleSelection = require('select2/selection/single'); -var MultipleSelection = require('select2/selection/multiple'); - -var $ = require('jquery'); - -var Options = require('select2/options'); -var options = new Options({}); - -test('title is carried over from original element', function (assert) { - var $select = $('#qunit-fixture .single'); - - var selection = new BaseSelection($select, options); - var $selection = selection.render(); - - assert.equal( - $selection.attr('title'), - $select.attr('title'), - 'The title should have been copied over from the original element' - ); -}); - -test('aria-expanded reflects the state of the container', function (assert) { - var $select = $('#qunit-fixture .single'); - - var selection = new BaseSelection($select, options); - var $selection = selection.render(); - - var container = new MockContainer(); - - selection.bind(container, $('')); - - assert.equal( - $selection.attr('aria-expanded'), - 'false', - 'The container should not be expanded when it is closed' - ); - - container.trigger('open'); - - assert.equal( - $selection.attr('aria-expanded'), - 'true', - 'The container should be expanded when it is opened' - ); -}); - -test('static aria attributes are present', function (assert) { - var $select = $('#qunit-fixture .single'); - - var selection = new BaseSelection($select, options); - var $selection = selection.render(); - - assert.equal( - $selection.attr('role'), - 'combobox', - 'The container should identify as a combobox' - ); - - assert.equal( - $selection.attr('aria-haspopup'), - 'true', - 'The dropdown is considered a popup of the container' - ); -}); - -test('the container should be in the tab order', function (assert) { - var $select = $('#qunit-fixture .single'); - - var selection = new BaseSelection($select, options); - var $selection = selection.render(); - - var container = new MockContainer(); - selection.bind(container, $('')); - - assert.equal( - $selection.attr('tabindex'), - '0', - 'The tab index should allow it to fit in the natural tab order' - ); - - container.trigger('disable'); - - assert.equal( - $selection.attr('tabindex'), - '-1', - 'The selection should be dropped out of the tab order when disabled' - ); - - container.trigger('enable'); - - assert.equal( - $selection.attr('tabindex'), - '0', - 'The tab index should be restored when re-enabled' - ); -}); - -test('a custom tabindex is copied', function (assert) { - var $select = $('#qunit-fixture .single'); - $select.attr('tabindex', '999'); - - var selection = new BaseSelection($select, options); - var $selection = selection.render(); - - var container = new MockContainer(); - selection.bind(container, $('')); - - assert.equal( - $selection.attr('tabindex'), - '999', - 'The tab index should match the original tab index' - ); - - container.trigger('disable'); - - assert.equal( - $selection.attr('tabindex'), - '-1', - 'The selection should be dropped out of the tab order when disabled' - ); - - container.trigger('enable'); - - assert.equal( - $selection.attr('tabindex'), - '999', - 'The tab index should be restored when re-enabled' - ); -}); - -module('Accessibility - Single'); - -test('aria-labelledby should match the rendered container', function (assert) { - var $select = $('#qunit-fixture .single'); - - var selection = new SingleSelection($select, options); - var $selection = selection.render(); - - var container = new MockContainer(); - selection.bind(container, $('')); - - var $rendered = $selection.find('.select2-selection__rendered'); - - assert.equal( - $selection.attr('aria-labelledby'), - $rendered.attr('id'), - 'The rendered selection should label the container' - ); -}); - -module('Accessibility - Multiple'); diff --git a/static/vendor/select2/tests/data/array-tests.js b/static/vendor/select2/tests/data/array-tests.js deleted file mode 100644 index d0dead68..00000000 --- a/static/vendor/select2/tests/data/array-tests.js +++ /dev/null @@ -1,332 +0,0 @@ -module('Data adapters - Array'); - -var ArrayData = require('select2/data/array'); -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var UserDefinedType = function (id, text) { - var self = this; - - self.id = id; - self.text = text; - - return self; -}; - -var arrayOptions = new Options({ - data: [ - { - id: 'default', - text: 'Default' - }, - { - id: '1', - text: 'One' - }, - { - id: '2', - text: '2' - }, - new UserDefinedType(1, 'aaaaaa') - ] -}); - -var extraOptions = new Options ({ - data: [ - { - id: 'default', - text: 'Default', - extra: true - }, - { - id: 'One', - text: 'One', - extra: true - } - ] -}); - -var nestedOptions = new Options({ - data: [ - { - text: 'Default', - children: [ - { - text: 'Next', - children: [ - { - id: 'a', - text: 'Option' - } - ] - } - ] - } - ] -}); - -test('current gets default for single', function (assert) { - var $select = $('#qunit-fixture .single-empty'); - - var data = new ArrayData($select, arrayOptions); - - data.current(function (val) { - assert.equal( - val.length, - 1, - 'There should always be a selected item for array data.' - ); - - var item = val[0]; - - assert.equal( - item.id, - 'default', - 'The first item should be selected' - ); - }); -}); - -test('current gets default for multiple', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new ArrayData($select, arrayOptions); - - data.current(function (val) { - assert.equal( - val.length, - 0, - 'There should be no default selection.' - ); - }); -}); - -test('current works with existing selections', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new ArrayData($select, arrayOptions); - - $select.val(['One']); - - data.current(function (val) { - assert.equal( - val.length, - 1, - 'There should only be one existing selection.' - ); - - var option = val[0]; - - assert.equal( - option.id, - 'One', - 'The id should be equal to the value of the option tag.' - ); - - assert.equal( - option.text, - 'One', - 'The text should be equal to the text of the option tag.' - ); - }); -}); - -test('current works with selected data', function (assert) { - var $select = $('#qunit-fixture .single-empty'); - - var data = new ArrayData($select, arrayOptions); - - data.select({ - id: '2', - text: '2' - }); - - data.current(function (val) { - assert.equal( - val.length, - 1, - 'There should only be one option selected.' - ); - - var option = val[0]; - - assert.equal( - option.id, - '2', - 'The id should match the original id from the array.' - ); - - assert.equal( - option.text, - '2', - 'The text should match the original text from the array.' - ); - }); -}); - -test('select works for single', function (assert) { - var $select = $('#qunit-fixture .single-empty'); - - var data = new ArrayData($select, arrayOptions); - - assert.equal( - $select.val(), - 'default', - 'There should already be a selection' - ); - - data.select({ - id: '1', - text: 'One' - }); - - assert.equal( - $select.val(), - '1', - 'The selected value should be the same as the selected id' - ); -}); - -test('multiple sets the value', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new ArrayData($select, arrayOptions); - - assert.ok( - $select.val() == null || $select.val().length == 0, - 'nothing should be selected' - ); - - data.select({ - id: 'default', - text: 'Default' - }); - - assert.deepEqual($select.val(), ['default']); -}); - -test('multiple adds to the old value', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new ArrayData($select, arrayOptions); - - $select.val(['One']); - - assert.deepEqual($select.val(), ['One']); - - data.select({ - id: 'default', - text: 'Default' - }); - - assert.deepEqual($select.val(), ['One', 'default']); -}); - -test('option tags are automatically generated', function (assert) { - var $select = $('#qunit-fixture .single-empty'); - - var data = new ArrayData($select, arrayOptions); - - assert.equal( - $select.find('option').length, - 4, - 'An element should be created for the two with children' - ); -}); - -test('optgroup tags have the right properties', function (assert) { - var $select = $('#qunit-fixture .single-empty'); - - var data = new ArrayData($select, nestedOptions); - - var $group = $select.children('optgroup'); - - assert.equal( - $group.prop('label'), - 'Default', - 'An `` label should match the text property' - ); - - assert.equal( - $group.children().length, - 1, - 'The should have one child under it' - ); -}); - -test('existing selections are respected on initialization', function (assert) { - var $select = $( - '' - ); - - var options = new Options({ - data: [ - { - id: 'Second', - text: 'Second' - }, - { - id: 'Third', - text: 'Third' - } - ] - }); - - assert.equal($select.val(), 'Second'); - - var data = new ArrayData($select, options); - - assert.equal($select.val(), 'Second'); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/data/base-tests.js b/static/vendor/select2/tests/data/base-tests.js deleted file mode 100644 index b90158f3..00000000 --- a/static/vendor/select2/tests/data/base-tests.js +++ /dev/null @@ -1,29 +0,0 @@ -module('Data adapters - Base'); - -var BaseData = require('select2/data/base'); -var $ = require('jquery'); -var Options = require('select2/options'); - -var options = new Options({}); - -test('current is required', function (assert) { - var data = new BaseData($('#qunit-fixture select'), options); - - assert.throws( - function () { - data.current(function () {}); - }, - 'current has no default implementation' - ); -}); - -test('query is required', function (assert) { - var data = new BaseData($('#qunit-fixture select'), options); - - assert.throws( - function () { - data.query({}, function () {}); - }, - 'query has no default implementation' - ); -}); diff --git a/static/vendor/select2/tests/data/inputData-tests.js b/static/vendor/select2/tests/data/inputData-tests.js deleted file mode 100644 index f2124efb..00000000 --- a/static/vendor/select2/tests/data/inputData-tests.js +++ /dev/null @@ -1,158 +0,0 @@ -module('Data adapters - compatibility'); - -var $ = require('jquery'); - -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var ArrayData = require('select2/data/array'); -var InputData = require('select2/compat/inputData'); - -var InputAdapter = Utils.Decorate(ArrayData, InputData); - -test('test that options can be selected', function (assert) { - var options = new Options({ - data: [ - { - id: 'test', - text: 'Test' - } - ] - }); - var $element = $(''); - - var adapter = new InputAdapter($element, options); - - adapter.select({ - id: 'test' - }); - - assert.equal( - $element.val(), - 'test', - 'The id of the item should be the value' - ); -}); - -test('unselect the single selected option clears the value', function (assert) { - var options = new Options({ - data: [ - { - id: 'test', - text: 'Test', - selected: true - } - ] - }); - var $element = $(''); - - var adapter = new InputAdapter($element, options); - - adapter.unselect({ - id: 'test' - }); - - assert.equal( - $element.val(), - '', - 'The id should no longer be in the value' - ); -}); - -test('options can be unselected individually', function (assert) { - var options = new Options({ - data: [ - { - id: 'test', - text: 'Test' - }, - { - id: 'test2', - text: 'Test2' - }, - { - id: 'test3', - text: 'Test3' - } - ] - }); - var $element = $(''); - $element.val('test,test2,test3'); - - var adapter = new InputAdapter($element, options); - - adapter.unselect({ - id: 'test2' - }); - - assert.equal( - $element.val(), - 'test,test3', - 'The value should contain all the still selected options' - ); -}); - -test('default values can be set', function (assert) { - assert.expect(4); - - var options = new Options({ - data: [ - { - id: 'test', - text: 'Test' - } - ] - }); - var $element = $(''); - - var adapter = new InputAdapter($element, options); - - adapter.current(function (data) { - assert.equal( - data.length, - 1, - 'There should only be a single selected option' - ); - - var item = data[0]; - - assert.equal(item.id, 'test'); - assert.equal(item.text, 'Test'); - }); - - assert.equal( - $element.val(), - 'test', - 'The value should not have been altered' - ); -}); - -test('no default value', function (assert) { - assert.expect(2); - - var options = new Options({ - data: [ - { - id: 'test', - text: 'Test' - } - ] - }); - var $element = $(''); - - var adapter = new InputAdapter($element, options); - - adapter.current(function (data) { - assert.equal( - data.length, - 0, - 'There should be no selected options' - ); - }); - - assert.equal( - $element.val(), - '', - 'The value should not have been altered' - ); -}); diff --git a/static/vendor/select2/tests/data/maximumInputLength-tests.js b/static/vendor/select2/tests/data/maximumInputLength-tests.js deleted file mode 100644 index e8557139..00000000 --- a/static/vendor/select2/tests/data/maximumInputLength-tests.js +++ /dev/null @@ -1,138 +0,0 @@ -module('Data adapters - Maximum input length'); - -var MaximumInputLength = require('select2/data/maximumInputLength'); -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -function MaximumInputStub () { - this.called = false; -} - -MaximumInputStub.prototype.query = function (params, callback) { - this.called = true; -}; - -var MaximumInputData = Utils.Decorate(MaximumInputStub, MaximumInputLength); - -test('0 never displays the notice', function (assert) { - var zeroOptions = new Options({ - maximumInputLength: 0 - }); - - var data = new MaximumInputData(null, zeroOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumInputData(null, zeroOptions); - - data.query({ - term: 'test' - }); - - assert.ok(data.called); -}); - -test('< 0 never displays the notice', function (assert) { - var negativeOptions = new Options({ - maximumInputLength: -1 - }); - - var data = new MaximumInputData(null, negativeOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumInputData(null, negativeOptions); - - data.query({ - term: 'test' - }); - - assert.ok(data.called); -}); - -test('triggers when input is too long', function (assert) { - var options = new Options({ - maximumInputLength: 1 - }); - - var data = new MaximumInputData(null, options); - - data.trigger = function () { - assert.ok(true, 'The event should be triggered.'); - }; - - data.query({ - term: 'no' - }); - - assert.ok(!data.called, 'The adapter should not be called'); -}); - -test('does not trigger when equal', function (assert) { - var options = new Options({ - maximumInputLength: 10 - }); - - var data = new MaximumInputData(null, options); - - data.trigger = function () { - assert.ok(false, 'The event should not be triggered.'); - }; - - data.query({ - term: '1234567890' - }); - - assert.ok(data.called); -}); - -test('does not trigger when less', function (assert) { - var options = new Options({ - maximumInputLength: 10 - }); - - var data = new MaximumInputData(null, options); - - data.trigger = function () { - assert.ok(false, 'The event should not be triggered.'); - }; - - data.query({ - term: '123' - }); - - assert.ok(data.called); -}); - -test('works with null term', function (assert) { - var options = new Options({ - maximumInputLength: 1 - }); - - var data = new MaximumInputData(null, options); - - data.trigger = function () { - assert.ok(false, 'The event should not be triggered'); - }; - - data.query({}); - - assert.ok(data.called); -}); diff --git a/static/vendor/select2/tests/data/maximumSelectionLength-tests.js b/static/vendor/select2/tests/data/maximumSelectionLength-tests.js deleted file mode 100644 index 89943b38..00000000 --- a/static/vendor/select2/tests/data/maximumSelectionLength-tests.js +++ /dev/null @@ -1,202 +0,0 @@ -module('Data adapters - Maximum selection length'); - -var MaximumSelectionLength = require('select2/data/maximumSelectionLength'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -function MaximumSelectionStub () { - this.called = false; - this.currentData = []; -} - -MaximumSelectionStub.prototype.current = function (callback) { - callback(this.currentData); -}; - -MaximumSelectionStub.prototype.val = function (val) { - this.currentData.push(val); -}; - -MaximumSelectionStub.prototype.query = function (params, callback) { - this.called = true; -}; - -var MaximumSelectionData = Utils.Decorate( - MaximumSelectionStub, - MaximumSelectionLength -); - -test('0 never displays the notice', function (assert) { - var zeroOptions = new Options({ - maximumSelectionLength: 0 - }); - - var data = new MaximumSelectionData(null, zeroOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, zeroOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.val('1'); - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, zeroOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.val('1'); - data.val('2'); - - data.query({ - term: '' - }); - - assert.ok(data.called); -}); - -test('< 0 never displays the notice', function (assert) { - var negativeOptions = new Options({ - maximumSelectionLength: -1 - }); - - var data = new MaximumSelectionData(null, negativeOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, negativeOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.val('1'); - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, negativeOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.val('1'); - data.val('2'); - - data.query({ - term: '' - }); - - assert.ok(data.called); -}); - -test('triggers when >= 1 selection' , function (assert) { - var maxOfOneOptions = new Options({ - maximumSelectionLength: 1 - }); - var data = new MaximumSelectionData(null, maxOfOneOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, maxOfOneOptions); - - data.trigger = function () { - assert.ok(true, 'The event should be triggered.'); - }; - - data.val('1'); - - data.query({ - term: '' - }); - - assert.ok(!data.called); - -}); - -test('triggers when >= 2 selections' , function (assert) { - var maxOfTwoOptions = new Options({ - maximumSelectionLength: 2 - }); - var data = new MaximumSelectionData(null, maxOfTwoOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, maxOfTwoOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.val('1'); - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MaximumSelectionData(null, maxOfTwoOptions); - - data.trigger = function () { - assert.ok(true, 'The event should be triggered.'); - }; - - data.val('1'); - data.val('2'); - - data.query({ - term: '' - }); - - assert.ok(!data.called); - -}); diff --git a/static/vendor/select2/tests/data/minimumInputLength-tests.js b/static/vendor/select2/tests/data/minimumInputLength-tests.js deleted file mode 100644 index a67db08d..00000000 --- a/static/vendor/select2/tests/data/minimumInputLength-tests.js +++ /dev/null @@ -1,138 +0,0 @@ -module('Data adapters - Minimum input length'); - -var MinimumInputLength = require('select2/data/minimumInputLength'); -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -function StubData () { - this.called = false; -} - -StubData.prototype.query = function (params, callback) { - this.called = true; -}; - -var MinimumData = Utils.Decorate(StubData, MinimumInputLength); - -test('0 never displays the notice', function (assert) { - var zeroOptions = new Options({ - minimumInputLength: 0 - }); - - var data = new MinimumData(null, zeroOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MinimumData(null, zeroOptions); - - data.query({ - term: 'test' - }); - - assert.ok(data.called); -}); - -test('< 0 never displays the notice', function (assert) { - var negativeOptions = new Options({ - minimumInputLength: -1 - }); - - var data = new MinimumData(null, negativeOptions); - - data.trigger = function () { - assert.ok(false, 'No events should be triggered'); - }; - - data.query({ - term: '' - }); - - assert.ok(data.called); - - data = new MinimumData(null, negativeOptions); - - data.query({ - term: 'test' - }); - - assert.ok(data.called); -}); - -test('triggers when input is not long enough', function (assert) { - var options = new Options({ - minimumInputLength: 10 - }); - - var data = new MinimumData(null, options); - - data.trigger = function () { - assert.ok(true, 'The event should be triggered.'); - }; - - data.query({ - term: 'no' - }); - - assert.ok(!data.called); -}); - -test('does not trigger when equal', function (assert) { - var options = new Options({ - minimumInputLength: 10 - }); - - var data = new MinimumData(null, options); - - data.trigger = function () { - assert.ok(false, 'The event should not be triggered.'); - }; - - data.query({ - term: '1234567890' - }); - - assert.ok(data.called); -}); - -test('does not trigger when greater', function (assert) { - var options = new Options({ - minimumInputLength: 10 - }); - - var data = new MinimumData(null, options); - - data.trigger = function () { - assert.ok(false, 'The event should not be triggered.'); - }; - - data.query({ - term: '12345678901' - }); - - assert.ok(data.called); -}); - -test('works with null term', function (assert) { - var options = new Options({ - minimumInputLength: 1 - }); - - var data = new MinimumData(null, options); - - data.trigger = function () { - assert.ok(true, 'The event should be triggered'); - }; - - data.query({}); - - assert.ok(!data.called); -}); diff --git a/static/vendor/select2/tests/data/select-tests.js b/static/vendor/select2/tests/data/select-tests.js deleted file mode 100644 index b59c6d4b..00000000 --- a/static/vendor/select2/tests/data/select-tests.js +++ /dev/null @@ -1,557 +0,0 @@ -module('Data adapters - Select - current'); - -var SelectData = require('select2/data/select'); -var $ = require('jquery'); -var Options = require('select2/options'); -var selectOptions = new Options({}); - -test('current gets default for single', function (assert) { - var $select = $('#qunit-fixture .single'); - - var data = new SelectData($select, selectOptions); - - data.current(function (data) { - assert.equal( - data.length, - 1, - 'There should only be one selected option' - ); - - var option = data[0]; - - assert.equal( - option.id, - 'One', - 'The value of the option tag should be the id' - ); - - assert.equal( - option.text, - 'One', - 'The text within the option tag should be the text' - ); - }); -}); - -test('current gets default for multiple', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new SelectData($select, selectOptions); - - data.current(function (data) { - assert.equal( - data.length, - 0, - 'Multiple selects have no default selection.' - ); - }); -}); - -test('current gets options with explicit value', function (assert) { - var $select = $('#qunit-fixture .single'); - - var $option = $(''); - $select.append($option); - - var data = new SelectData($select, selectOptions); - - $select.val('1'); - - data.current(function (data) { - assert.equal( - data.length, - 1, - 'There should be one selected option' - ); - - var option = data[0]; - - assert.equal( - option.id, - '1', - 'The option value should be the selected id' - ); - - assert.equal( - option.text, - 'One', - 'The text should match the text for the option tag' - ); - }); -}); - -test('current gets options with implicit value', function (assert) { - var $select = $('#qunit-fixture .single'); - - var data = new SelectData($select, selectOptions); - - $select.val('One'); - - data.current(function (val) { - assert.equal( - val.length, - 1, - 'There should only be one selected value' - ); - - var option = val[0]; - - assert.equal( - option.id, - 'One', - 'The id should be the same as the option text' - ); - - assert.equal( - option.text, - 'One', - 'The text should be the same as the option text' - ); - }); -}); - -test('select works for single', function (assert) { - var $select = $('#qunit-fixture .single-with-placeholder'); - - var data = new SelectData($select, selectOptions); - - assert.equal($select.val(), 'placeholder'); - - data.select({ - id: 'One', - text: 'One' - }); - - assert.equal($select.val(), 'One'); -}); - -test('multiple sets the value', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new SelectData($select, selectOptions); - - assert.ok( - $select.val() == null || $select.val().length == 0, - 'nothing should be selected' - ); - - data.select({ - id: 'Two', - text: 'Two' - }); - - assert.deepEqual($select.val(), ['Two']); -}); - -test('multiple adds to the old value', function (assert) { - var $select = $('#qunit-fixture .multiple'); - - var data = new SelectData($select, selectOptions); - - $select.val(['Two']); - - assert.deepEqual($select.val(), ['Two']); - - data.select({ - id: 'One', - text: 'One' - }); - - assert.deepEqual($select.val(), ['One', 'Two']); -}); - -test('duplicates - single - same id on select triggers change', - function (assert) { - var $select = $('#qunit-fixture .duplicates'); - - var data = new SelectData($select, data); - var second = $('#qunit-fixture .duplicates option')[2]; - - var changeTriggered = false; - - assert.equal($select.val(), 'one'); - - $select.on('change', function () { - changeTriggered = true; - }); - - data.select({ - id: 'one', - text: 'Uno', - element: second - }); - - assert.equal( - $select.val(), - 'one', - 'The value never changed' - ); - - assert.ok( - changeTriggered, - 'The change event should be triggered' - ); - - assert.ok( - second.selected, - 'The second duplicate is selected, not the first' - ); -}); - -test('duplicates - single - different id on select triggers change', - function (assert) { - var $select = $('#qunit-fixture .duplicates'); - - var data = new SelectData($select, data); - var second = $('#qunit-fixture .duplicates option')[2]; - - var changeTriggered = false; - - $select.val('two'); - - $select.on('change', function () { - changeTriggered = true; - }); - - data.select({ - id: 'one', - text: 'Uno', - element: second - }); - - assert.equal( - $select.val(), - 'one', - 'The value changed to the duplicate id' - ); - - assert.ok( - changeTriggered, - 'The change event should be triggered' - ); - - assert.ok( - second.selected, - 'The second duplicate is selected, not the first' - ); -}); - -test('duplicates - multiple - same id on select triggers change', -function (assert) { - var $select = $('#qunit-fixture .duplicates-multi'); - - var data = new SelectData($select, data); - var second = $('#qunit-fixture .duplicates-multi option')[2]; - - var changeTriggered = false; - - $select.val(['one']); - - $select.on('change', function () { - changeTriggered = true; - }); - - data.select({ - id: 'one', - text: 'Uno', - element: second - }); - - assert.deepEqual( - $select.val(), - ['one', 'one'], - 'The value now has duplicates' - ); - - assert.ok( - changeTriggered, - 'The change event should be triggered' - ); - - assert.ok( - second.selected, - 'The second duplicate is selected, not the first' - ); -}); - -test('duplicates - multiple - different id on select triggers change', -function (assert) { - var $select = $('#qunit-fixture .duplicates-multi'); - - var data = new SelectData($select, data); - var second = $('#qunit-fixture .duplicates-multi option')[2]; - - var changeTriggered = false; - - $select.val(['two']); - - $select.on('change', function () { - changeTriggered = true; - }); - - data.select({ - id: 'one', - text: 'Uno', - element: second - }); - - assert.deepEqual( - $select.val(), - ['two', 'one'], - 'The value has the new id' - ); - - assert.ok( - changeTriggered, - 'The change event should be triggered' - ); - - assert.ok( - second.selected, - 'The second duplicate is selected, not the first' - ); -}); - -module('Data adapter - Select - query'); - -test('all options are returned with no term', function (assert) { - var $select = $('#qunit-fixture .single'); - - var data = new SelectData($select, selectOptions); - - data.query({}, function (data) { - assert.equal( - data.results.length, - 1, - 'The number of items returned should be equal to the number of options' - ); - }); -}); - -test('the matcher checks the text', function (assert) { - var $select = $('#qunit-fixture .single'); - - var data = new SelectData($select, selectOptions); - - data.query({ - term: 'One' - }, function (data) { - assert.equal( - data.results.length, - 1, - 'Only the "One" option should be found' - ); - }); -}); - -test('the matcher ignores case', function (assert) { - var $select = $('#qunit-fixture .single'); - - var data = new SelectData($select, selectOptions); - - data.query({ - term: 'one' - }, function (data) { - assert.equal( - data.results.length, - 1, - 'The "One" option should still be found' - ); - }); -}); - -test('no options may be returned with no matches', function (assert) { - var $select = $('#qunit-fixture .single'); - - var data = new SelectData($select, selectOptions); - - data.query({ - term: 'qwerty' - }, function (data) { - assert.equal( - data.results.length, - 0, - 'Only matching items should be returned' - ); - }); -}); - -test('optgroup tags are marked with children', function (assert) { - var $select = $('#qunit-fixture .groups'); - - var data = new SelectData($select, selectOptions); - - data.query({}, function (data) { - assert.ok( - 'children' in data.results[0], - 'The optgroup element should have children when queried' - ); - }); -}); - -test('empty optgroups are still shown when queried', function (assert) { - var $select = $('#qunit-fixture .groups'); - - var data = new SelectData($select, selectOptions); - - data.query({}, function (data) { - assert.equal( - data.results.length, - 2, - 'The empty optgroup element should still be returned when queried' - ); - - var item = data.results[1]; - - assert.equal( - item.text, - 'Empty', - 'The text of the empty optgroup should match the label' - ); - - assert.equal( - item.children.length, - 0, - 'There should be no children in the empty opgroup' - ); - }); -}); - -test('multiple options with the same value are returned', function (assert) { - var $select = $('#qunit-fixture .duplicates'); - - var data = new SelectData($select, selectOptions); - - data.query({}, function (data) { - assert.equal( - data.results.length, - 3, - 'The duplicate option should still be returned when queried' - ); - - var first = data.results[0]; - var duplicate = data.results[2]; - - assert.equal( - first.id, - duplicate.id, - 'The duplicates should have the same id' - ); - - assert.notEqual( - first.text, - duplicate.text, - 'The duplicates do not have the same text' - ); - }); -}); - -test('data objects use the text of the option', function (assert) { - var $select = $('#qunit-fixture .duplicates'); - - var data = new SelectData($select, selectOptions); - - var $option = $(''); - - var item = data.item($option); - - assert.equal(item.id, '&'); - assert.equal(item.text, '&'); -}); - -test('select option construction accepts id=0 (zero) value', function (assert) { - var $select = $('#qunit-fixture .single'); - - var selectOptions = [{ id: 0, text: 'Zero Value'}]; - var data = new SelectData($select, selectOptions); - - var optionElem = data.option(selectOptions[0]); - - // If was "Zero Value"", then it ignored id property - assert.equal( - optionElem[0].value, - '0', - 'Built option value should be "0" (zero as a string).' - ); -}); - -test('select option construction accepts id="" (empty string) value', - function (assert) { - var $select = $('#qunit-fixture .single'); - - var selectOptions = [{ id: '', text: 'Empty String'}]; - var data = new SelectData($select, selectOptions); - - var optionElem = data.option(selectOptions[0]); - - assert.equal( - optionElem[0].value, - '', - 'Built option value should be an empty string.' - ); -}); - -test('user-defined types are normalized properly', function (assert) { - var $select = $('#qunit-fixture .user-defined'), - - UserDefinedType = function (id, text) { - var self = this; - - self.id = id; - self.text = text; - - return self; - }; - - var testData = [ - 'Test', - { - id: 4, - text: 'item' - }, - new UserDefinedType(1, 'aaaaaa') - ]; - - var data = new SelectData($select, selectOptions); - - var normalizedItem = data._normalizeItem(testData[0]); - var normalizedItem2 = data._normalizeItem(testData[1]); - var normalizedItem3 = data._normalizeItem(testData[2]); - - assert.equal( - testData[0], - normalizedItem.id, - 'id property should be equal to text after normalize' - ); - - assert.equal( - testData[0], - normalizedItem.text, - 'text property should be equal after normalize' - ); - - assert.equal( - testData[1].id, - normalizedItem2.id, - 'id property should be equal after normalize' - ); - - assert.equal( - testData[1].text, - normalizedItem2.text, - 'text property should be equal after normalize' - ); - - assert.equal( - testData[2].id, - normalizedItem3.id, - 'id property should be equal after normalize' - ); - - assert.equal( - testData[2].text, - normalizedItem3.text, - 'text property should be equal after normalize' - ); - -}); diff --git a/static/vendor/select2/tests/data/tags-tests.js b/static/vendor/select2/tests/data/tags-tests.js deleted file mode 100644 index 6af8d8a7..00000000 --- a/static/vendor/select2/tests/data/tags-tests.js +++ /dev/null @@ -1,276 +0,0 @@ -module('Data adapters - Tags'); - -var SelectData = require('select2/data/select'); -var Tags = require('select2/data/tags'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var SelectTags = Utils.Decorate(SelectData, Tags); -var options = new Options({ - tags: true -}); - -test('does not trigger on blank or null terms', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: '' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'One'); - assert.equal(item.text, 'One'); - }); - - data.query({ - term: null - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'One'); - assert.equal(item.text, 'One'); - }); -}); - -test('white space is trimmed by default', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: ' ' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'One'); - assert.equal(item.text, 'One'); - }); - - data.query({ - term: ' One ' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'One'); - assert.equal(item.text, 'One'); - }); -}); - -test('does not create option if text is same but lowercase', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: 'one' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'One'); - assert.equal(item.text, 'One'); - }); -}); - -test('does not trigger for additional pages', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - page: 2 - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'One'); - assert.equal(item.text, 'One'); - }); -}); - -test('creates tag at beginning', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: 'o' - }, function (data) { - assert.equal(data.results.length, 2); - - var first = data.results[0]; - - assert.equal(first.id, 'o'); - assert.equal(first.text, 'o'); - }); -}); - -test('tags can be the only result', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: 'test' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'test'); - assert.equal(item.text, 'test'); - }); -}); - -test('tags are injected as options', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: 'test' - }, function (data) { - assert.equal(data.results.length, 1); - - var $children = $('#qunit-fixture .single option'); - - assert.equal($children.length, 2); - - var $tag = $children.last(); - - assert.equal($tag.val(), 'test'); - assert.equal($tag.text(), 'test'); - }); -}); - -test('old tags are removed automatically', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: 'first' - }, function (data) { - assert.equal(data.results.length, 1); - - var $children = $('#qunit-fixture .single option'); - - assert.equal($children.length, 2); - }); - - data.query({ - term: 'second' - }, function (data) { - assert.equal(data.results.length, 1); - - var $children = $('#qunit-fixture .single option'); - - assert.equal($children.length, 2); - - var $tag = $children.last(); - - assert.equal($tag.val(), 'second'); - assert.equal($tag.text(), 'second'); - }); -}); - -test('insertTag controls the tag location', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.insertTag = function (data, tag) { - data.push(tag); - }; - - data.query({ - term: 'o' - }, function (data) { - assert.equal(data.results.length, 2); - - var item = data.results[1]; - - assert.equal(item.id, 'o'); - assert.equal(item.text, 'o'); - }); -}); - -test('insertTag can be controlled through the options', function (assert) { - var options = new Options({ - insertTag: function (data, tag) { - data.push(tag); - } - }); - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.query({ - term: 'o' - }, function (data) { - assert.equal(data.results.length, 2); - - var item = data.results[1]; - - assert.equal(item.id, 'o'); - assert.equal(item.text, 'o'); - }); -}); - -test('createTag controls the tag object', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.createTag = function (params) { - return { - id: 0, - text: params.term - }; - }; - - data.query({ - term: 'test' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 0); - assert.equal(item.text, 'test'); - }); -}); - -test('createTag returns null for no tag', function (assert) { - var data = new SelectTags($('#qunit-fixture .single'), options); - - data.createTag = function (params) { - return null; - }; - - data.query({ - term: 'o' - }, function (data) { - assert.equal(data.results.length, 1); - }); -}); - -test('the createTag options customizes the function', function (assert) { - var data = new SelectTags( - $('#qunit-fixture .single'), - new Options({ - tags: true, - createTag: function (params) { - return { - id: params.term, - text: params.term, - tag: true - }; - } - }) - ); - - data.query({ - term: 'test' - }, function (data) { - assert.equal(data.results.length, 1); - - var item = data.results[0]; - - assert.equal(item.id, 'test'); - assert.equal(item.text, 'test'); - assert.equal(item.tag, true); - }); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/data/tokenizer-tests.js b/static/vendor/select2/tests/data/tokenizer-tests.js deleted file mode 100644 index 2fa01211..00000000 --- a/static/vendor/select2/tests/data/tokenizer-tests.js +++ /dev/null @@ -1,219 +0,0 @@ -module('Data adaptor - Tokenizer'); - -test('triggers the select event', function (assert) { - assert.expect(2); - - var SelectData = require('select2/data/select'); - var Tokenizer = require('select2/data/tokenizer'); - var Tags = require('select2/data/tags'); - - var Options = require('select2/options'); - var Utils = require('select2/utils'); - - var $ = require('jquery'); - - var TokenizedSelect = Utils.Decorate( - Utils.Decorate(SelectData, Tags), - Tokenizer - ); - var $select = $('#qunit-fixture .single'); - - var options = new Options({ - tags: true, - tokenSeparators: [','] - }); - - var container = new MockContainer(); - container.dropdown = container.selection = {}; - - var $container = $('
    '); - - var data = new TokenizedSelect($select, options); - data.bind(container, $container); - - data.on('select', function () { - assert.ok(true, 'The select event should be triggered'); - }); - - data.query({ - term: 'first,second' - }, function () { - assert.ok(true, 'The callback should have succeeded'); - }); -}); - -test('createTag can return null', function (assert) { - assert.expect(3); - - var SelectData = require('select2/data/select'); - var Tokenizer = require('select2/data/tokenizer'); - var Tags = require('select2/data/tags'); - - var Options = require('select2/options'); - var Utils = require('select2/utils'); - - var $ = require('jquery'); - - var TokenizedSelect = Utils.Decorate( - Utils.Decorate(SelectData, Tags), - Tokenizer - ); - var $select = $('#qunit-fixture .single'); - - var options = new Options({ - tags: true, - tokenSeparators: [','], - createTag: function () { - assert.ok(true, 'createTag should have been called'); - - return null; - } - }); - - var container = new MockContainer(); - container.dropdown = container.selection = {}; - - var $container = $('
    '); - - var data = new TokenizedSelect($select, options); - data.bind(container, $container); - - data.on('select', function (params) { - if (params.data == null) { - assert.ok(false, 'Null data should never be selected'); - } - }); - - data.query({ - term: 'first,second' - }, function () { - assert.ok(true, 'The callback should have succeeded'); - }); -}); - -test('createTag returning null does not cut the term', function (assert) { - assert.expect(4); - - var SelectData = require('select2/data/select'); - var Tokenizer = require('select2/data/tokenizer'); - var Tags = require('select2/data/tags'); - - var Options = require('select2/options'); - var Utils = require('select2/utils'); - - var $ = require('jquery'); - - var TokenizedSelect = Utils.Decorate( - Utils.Decorate(SelectData, Tags), - Tokenizer - ); - var $select = $('#qunit-fixture .single'); - - var options = new Options({ - tags: true, - tokenSeparators: [',', '"'], - createTag: function (params) { - var term = params.term; - - // Ignore blanks - if (term.length === 0) { - return null; - } - - // Ignore the leading quote - if (term === '"') { - return null; - } - - // If there is a leading quote, check for a second one - if (term[0] === '"' && term[term.length - 1] !== '"') { - return null; - } - - var text = term.substr(1, term.length - 2); - - return { - id: term, - text: text - }; - } - }); - - var container = new MockContainer(); - container.dropdown = container.selection = {}; - - var $container = $('
    '); - - var data = new TokenizedSelect($select, options); - data.bind(container, $container); - - data.on('select', function (params) { - assert.ok(params.data, 'Data should not be null'); - - assert.equal( - params.data.id, - '"first, second"', - 'The id should have the quotes' - ); - - assert.equal( - params.data.text, - 'first, second', - 'The text should not have the quotes' - ); - }); - - data.query({ - term: '"first, second",abc' - }, function () { - assert.ok(true, 'The callback should have succeeded'); - }); -}); - -test('works with multiple tokens given', function (assert) { - assert.expect(4); - - var SelectData = require('select2/data/select'); - var Tokenizer = require('select2/data/tokenizer'); - var Tags = require('select2/data/tags'); - - var Options = require('select2/options'); - var Utils = require('select2/utils'); - - var $ = require('jquery'); - - var TokenizedSelect = Utils.Decorate( - Utils.Decorate(SelectData, Tags), - Tokenizer - ); - var $select = $('#qunit-fixture .multiple'); - - var options = new Options({ - tags: true, - tokenSeparators: [','] - }); - - var container = new MockContainer(); - container.dropdown = container.selection = {}; - - var $container = $('
    '); - - var data = new TokenizedSelect($select, options); - data.bind(container, $container); - - data.on('select', function () { - assert.ok(true, 'The select event should be triggered'); - }); - - data.query({ - term: 'first,second,third' - }, function () { - assert.ok(true, 'The callback should have succeeded'); - }); - - assert.equal( - $select.children('option').length, - 3, - 'The two new tags should have been created' - ); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/dropdown/dropdownCss-tests.js b/static/vendor/select2/tests/dropdown/dropdownCss-tests.js deleted file mode 100644 index 9969335e..00000000 --- a/static/vendor/select2/tests/dropdown/dropdownCss-tests.js +++ /dev/null @@ -1,104 +0,0 @@ -module('Dropdown - dropdownCssClass compatibility'); - -var $ = require('jquery'); -var Utils = require('select2/utils'); -var Options = require('select2/options'); - -var Dropdown = require('select2/dropdown'); -var DropdownCSS = Utils.Decorate( - Dropdown, - require('select2/compat/dropdownCss') -); - -test('all classes will be copied if :all: is used', function (assert) { - var $element = $(''); - var options = new Options({ - dropdownCssClass: ':all:' - }); - - var select = new DropdownCSS($element, options); - var $dropdown = select.render(); - - assert.ok($dropdown.hasClass('test')); - assert.ok($dropdown.hasClass('copy')); - assert.ok($dropdown.hasClass('works')); - assert.ok(!$dropdown.hasClass(':all:')); -}); - -test(':all: can be used with other classes', function (assert) { - var $element = $(''); - var options = new Options({ - dropdownCssClass: ':all: other' - }); - - var select = new DropdownCSS($element, options); - var $dropdown = select.render(); - - assert.ok($dropdown.hasClass('test')); - assert.ok($dropdown.hasClass('copy')); - assert.ok($dropdown.hasClass('works')); - assert.ok($dropdown.hasClass('other')); - assert.ok(!$dropdown.hasClass(':all:')); -}); - -test('classes can be passed in as a string', function (assert) { - var $element = $(''); - var options = new Options({ - dropdownCssClass: 'other' - }); - - var select = new DropdownCSS($element, options); - var $dropdown = select.render(); - - assert.ok($dropdown.hasClass('other')); -}); - -test('a function can be used based on the element', function (assert){ - var $element = $(''); - var options = new Options({ - dropdownCssClass: function ($element) { - return 'function'; - } - }); - - var select = new DropdownCSS($element, options); - var $dropdown = select.render(); - - assert.ok($dropdown.hasClass('function')); - assert.ok(!$dropdown.hasClass('test')); -}); - -test(':all: works around custom adapters', function (assert) { - var $element = $(''); - var options = new Options({ - dropdownCssClass: ':all: something', - adaptDropdownCssClass: function (clazz) { - return clazz + '-modified'; - } - }); - - var select = new DropdownCSS($element, options); - var $dropdown = select.render(); - - assert.ok($dropdown.hasClass('something')); - - assert.ok($dropdown.hasClass('test')); - assert.ok($dropdown.hasClass('test-modified')); -}); - -module('Dropdown - adaptDropdownCss compatibility'); - -test('only return when adapted', function (assert) { - var $element = $(''); - var options = new Options({ - adaptDropdownCssClass: function (clazz) { - return 'modified'; - } - }); - - var select = new DropdownCSS($element, options); - var $dropdown = select.render(); - - assert.ok(!$dropdown.hasClass('original')); - assert.ok($dropdown.hasClass('modified')); -}); diff --git a/static/vendor/select2/tests/dropdown/positioning-tests.js b/static/vendor/select2/tests/dropdown/positioning-tests.js deleted file mode 100644 index 2da68982..00000000 --- a/static/vendor/select2/tests/dropdown/positioning-tests.js +++ /dev/null @@ -1,177 +0,0 @@ -module('Dropdown - attachBody - positioning'); - -test('appends to the dropdown parent', function (assert) { - assert.expect(4); - - var $ = require('jquery'); - - var $select = $(''); - var $parent = $('
    '); - - var $container = $(''); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $select.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Dropdown = require('select2/dropdown'); - var AttachBody = require('select2/dropdown/attachBody'); - - var DropdownAdapter = Utils.Decorate(Dropdown, AttachBody); - - var dropdown = new DropdownAdapter($select, new Options({ - dropdownParent: $parent - })); - - assert.equal( - $parent.children().length, - 1, - 'Only the select should be in the container' - ); - - var $dropdown = dropdown.render(); - - dropdown.bind(container, $container); - - dropdown.position($dropdown, $container); - - assert.equal( - $parent.children().length, - 1, - 'The dropdown should not be placed until after it is opened' - ); - - dropdown._showDropdown(); - - assert.equal( - $parent.children().length, - 2, - 'The dropdown should now be in the container as well' - ); - - assert.ok( - $.contains($parent[0], $dropdown[0]), - 'The dropdown should be contained within the parent container' - ); -}); - -test('dropdown is positioned down with static margins', function (assert) { - var $ = require('jquery'); - var $select = $(''); - var $parent = $('
    '); - $parent.css({ - position: 'static', - marginTop: '5px', - marginLeft: '10px' - }); - - var $container = $('test'); - var container = new MockContainer(); - - $('#qunit-fixture').empty(); - - $parent.appendTo($('#qunit-fixture')); - $container.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Dropdown = require('select2/dropdown'); - var AttachBody = require('select2/dropdown/attachBody'); - - var DropdownAdapter = Utils.Decorate(Dropdown, AttachBody); - - var dropdown = new DropdownAdapter($select, new Options({ - dropdownParent: $parent - })); - - var $dropdown = dropdown.render(); - - assert.equal( - $dropdown[0].style.top, - 0, - 'The drodpown should not have any offset before it is displayed' - ); - - dropdown.bind(container, $container); - dropdown.position($dropdown, $container); - dropdown._showDropdown(); - - assert.ok( - dropdown.$dropdown.hasClass('select2-dropdown--below'), - 'The dropdown should be forced down' - ); - - assert.equal( - $dropdown.css('top').replace(/\D+/, ''), - $container.outerHeight() + 5, - 'The offset should be 5px at the top' - ); - - assert.equal( - $dropdown.css('left'), - '10px', - 'The offset should be 10px on the left' - ); -}); - -test('dropdown is positioned down with absolute offsets', function (assert) { - var $ = require('jquery'); - var $select = $(''); - var $parent = $('
    '); - $parent.css({ - position: 'absolute', - top: '10px', - left: '5px' - }); - - var $container = $('test'); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $container.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Dropdown = require('select2/dropdown'); - var AttachBody = require('select2/dropdown/attachBody'); - - var DropdownAdapter = Utils.Decorate(Dropdown, AttachBody); - - var dropdown = new DropdownAdapter($select, new Options({ - dropdownParent: $parent - })); - - var $dropdown = dropdown.render(); - - assert.equal( - $dropdown[0].style.top, - 0, - 'The drodpown should not have any offset before it is displayed' - ); - - dropdown.bind(container, $container); - dropdown.position($dropdown, $container); - dropdown._showDropdown(); - - assert.ok( - dropdown.$dropdown.hasClass('select2-dropdown--below'), - 'The dropdown should be forced down' - ); - - assert.equal( - $dropdown.css('top').replace(/\D+/, ''), - $container.outerHeight(), - 'There should not be an extra top offset' - ); - - assert.equal( - $dropdown.css('left'), - '0px', - 'There should not be an extra left offset' - ); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/dropdown/selectOnClose-tests.js b/static/vendor/select2/tests/dropdown/selectOnClose-tests.js deleted file mode 100644 index 3f1d1d41..00000000 --- a/static/vendor/select2/tests/dropdown/selectOnClose-tests.js +++ /dev/null @@ -1,137 +0,0 @@ -module('Dropdown - selectOnClose'); - -var $ = require('jquery'); - -var Utils = require('select2/utils'); -var Options = require('select2/options'); - -var SelectData = require('select2/data/select'); - -var Results = require('select2/results'); -var SelectOnClose = require('select2/dropdown/selectOnClose'); - -var ModifiedResults = Utils.Decorate(Results, SelectOnClose); - -var options = new Options({ - selectOnClose: true -}); - -test('will not trigger if no results were given', function (assert) { - assert.expect(0); - - var $element = $(''); - var select = new ModifiedResults($element, options, new SelectData($element)); - - var $dropdown = select.render(); - - var container = new MockContainer(); - select.bind(container, $('
    ')); - - select.on('select', function () { - assert.ok(false, 'The select event should not have been triggered'); - }); - - container.trigger('close'); -}); - -test('will not trigger if the results list is empty', function (assert) { - assert.expect(1); - - var $element = $(''); - var select = new ModifiedResults($element, options, new SelectData($element)); - - var $dropdown = select.render(); - - var container = new MockContainer(); - select.bind(container, $('
    ')); - - select.on('select', function () { - assert.ok(false, 'The select event should not have been triggered'); - }); - - select.append({ - results: [] - }); - - assert.equal( - $dropdown.find('li').length, - 0, - 'There should not be any results in the dropdown' - ); - - container.trigger('close'); -}); - -test('will not trigger if no results here highlighted', function (assert) { - assert.expect(2); - - var $element = $(''); - var select = new ModifiedResults($element, options, new SelectData($element)); - - var $dropdown = select.render(); - - var container = new MockContainer(); - select.bind(container, $('
    ')); - - select.on('select', function () { - assert.ok(false, 'The select event should not have been triggered'); - }); - - select.append({ - results: [ - { - id: '1', - text: 'Test' - } - ] - }); - - assert.equal( - $dropdown.find('li').length, - 1, - 'There should be one result in the dropdown' - ); - - assert.equal( - $.trim($dropdown.find('li').text()), - 'Test', - 'The result should be the same as the one we appended' - ); - - container.trigger('close'); -}); - -test('will trigger if there is a highlighted result', function (assert) { - assert.expect(2); - - var $element = $(''); - var select = new ModifiedResults($element, options, new SelectData($element)); - - var $dropdown = select.render(); - - var container = new MockContainer(); - select.bind(container, $('
    ')); - - select.on('select', function () { - assert.ok(true, 'The select event should have been triggered'); - }); - - select.append({ - results: [ - { - id: '1', - text: 'Test' - } - ] - }); - - assert.equal( - $dropdown.find('li').length, - 1, - 'There should be one result in the dropdown' - ); - - $dropdown.find('li').addClass('select2-results__option--highlighted'); - - container.trigger('close'); -}); diff --git a/static/vendor/select2/tests/dropdown/stopPropagation-tests.js b/static/vendor/select2/tests/dropdown/stopPropagation-tests.js deleted file mode 100644 index 240a3e66..00000000 --- a/static/vendor/select2/tests/dropdown/stopPropagation-tests.js +++ /dev/null @@ -1,33 +0,0 @@ -module('Dropdown - Stoping event propagation'); - -var Dropdown = require('select2/dropdown'); -var StopPropagation = require('select2/dropdown/stopPropagation'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var CustomDropdown = Utils.Decorate(Dropdown, StopPropagation); - -var options = new Options(); - -test('click event does not propagate', function (assert) { - assert.expect(1); - - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - - var dropdown = new CustomDropdown($('#qunit-fixture select'), options); - - var $dropdown = dropdown.render(); - dropdown.bind(container, $container); - - $container.append($dropdown); - $container.on('click', function () { - assert.ok(false, 'The click event should have been stopped'); - }); - - $dropdown.trigger('click'); - - assert.ok(true, 'Something went wrong if this failed'); -}); diff --git a/static/vendor/select2/tests/helpers.js b/static/vendor/select2/tests/helpers.js deleted file mode 100644 index 9409c8b6..00000000 --- a/static/vendor/select2/tests/helpers.js +++ /dev/null @@ -1,50 +0,0 @@ -// Restore the require/define -var require = $.fn.select2.amd.require; -var define = $.fn.select2.amd.define; - -// Disable jQuery's binding to $ -jQuery.noConflict(); - -var Utils = require('select2/utils'); - -function MockContainer () { - MockContainer.__super__.constructor.call(this); -} - -Utils.Extend(MockContainer, Utils.Observable); - -MockContainer.prototype.isOpen = function () { - return this.isOpen; -}; - -var log = []; -var testName; - -QUnit.done(function (test_results) { - var tests = []; - for(var i = 0, len = log.length; i < len; i++) { - var details = log[i]; - tests.push({ - name: details.name, - result: details.result, - expected: details.expected, - actual: details.actual, - source: details.source - }); - } - test_results.tests = tests; - - window.global_test_results = test_results; -}); -QUnit.testStart(function(testDetails){ - QUnit.log(function(details){ - if (!details.result) { - details.name = testDetails.name; - log.push(details); - } - }); -}); - -define('qunit', function () { - return QUnit; -}) \ No newline at end of file diff --git a/static/vendor/select2/tests/integration-jq1.html b/static/vendor/select2/tests/integration-jq1.html deleted file mode 100644 index d8d0ef55..00000000 --- a/static/vendor/select2/tests/integration-jq1.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - -
    -
    - - - - - - - - - - - - diff --git a/static/vendor/select2/tests/integration-jq2.html b/static/vendor/select2/tests/integration-jq2.html deleted file mode 100644 index 97f73828..00000000 --- a/static/vendor/select2/tests/integration-jq2.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - -
    -
    - - - - - - - - - - - - diff --git a/static/vendor/select2/tests/integration-jq3.html b/static/vendor/select2/tests/integration-jq3.html deleted file mode 100644 index 2f99fb5b..00000000 --- a/static/vendor/select2/tests/integration-jq3.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - -
    -
    - - - - - - - - - - - - diff --git a/static/vendor/select2/tests/integration/dom-changes.js b/static/vendor/select2/tests/integration/dom-changes.js deleted file mode 100644 index 2d89ae2a..00000000 --- a/static/vendor/select2/tests/integration/dom-changes.js +++ /dev/null @@ -1,257 +0,0 @@ -module('DOM integration'); - -test('adding a new unselected option changes nothing', function (assert) { - // Any browsers which support mutation observers will not trigger the event - var expected = 4; - if (window.MutationObserver) { - expected = 2; - } else if (!window.addEventListener) { - expected = 2; - } - - assert.expect(expected); - - var asyncDone = null; - var syncDone = assert.async(); - - if (expected != 2) { - asyncDone = assert.async(); - } - - var $ = require('jquery'); - var Options = require('select2/options'); - var Select2 = require('select2/core'); - - var $select = $( - '' - ); - - $('#qunit-fixture').append($select); - - var select = new Select2($select); - - select.on('selection:update', function (args) { - assert.equal( - args.data.length, - 1, - 'There was more than one selection' - ); - - assert.equal( - args.data[0].id, - 'One', - 'The selection changed to something other than One' - ); - - if (expected != 2) { - asyncDone(); - } - }); - - assert.equal( - $select.val(), - 'One' - ); - - var $option = $(''); - - $select.append($option); - - assert.equal( - $select.val(), - 'One' - ); - - syncDone(); -}); - -test('adding a new selected option changes the value', function (assert) { - // handle IE 8 not being supported - var expected = 4; - if (!window.MutationObserver && !window.addEventListener) { - expected = 2; - } - - assert.expect(expected); - - var asyncDone = null; - var syncDone = assert.async(); - - if (expected != 2) { - asyncDone = assert.async(); - } - - var $ = require('jquery'); - var Options = require('select2/options'); - var Select2 = require('select2/core'); - - var $select = $( - '' - ); - - $('#qunit-fixture').append($select); - - var select = new Select2($select); - - select.on('selection:update', function (args) { - assert.equal( - args.data.length, - 1, - 'There was more than one selection' - ); - - assert.equal( - args.data[0].id, - 'Three', - 'The selection did not change to Three' - ); - - if (expected != 2) { - asyncDone(); - } - }); - - assert.equal( - $select.val(), - 'One' - ); - - var $option = $(''); - - $select.append($option); - - assert.equal( - $select.val(), - 'Three' - ); - - syncDone(); -}); - -test('removing an unselected option changes nothing', function (assert) { - // Any browsers which support mutation observers will not trigger the event - var expected = 4; - if (!window.MutationObserver && !window.addEventListener) { - expected = 2; - } - - assert.expect(expected); - - var asyncDone = null; - var syncDone = assert.async(); - - if (expected != 2) { - asyncDone = assert.async(); - } - - var $ = require('jquery'); - var Options = require('select2/options'); - var Select2 = require('select2/core'); - - var $select = $( - '' - ); - - $('#qunit-fixture').append($select); - - var select = new Select2($select); - - select.on('selection:update', function (args) { - assert.equal( - args.data.length, - 1, - 'There was more than one selection' - ); - - assert.equal( - args.data[0].id, - 'One', - 'The selection changed to something other than One' - ); - - if (expected != 2) { - asyncDone(); - } - }); - - assert.equal( - $select.val(), - 'One' - ); - - $select.children().eq(1).remove(); - - assert.equal( - $select.val(), - 'One' - ); - - syncDone(); -}); - -test('removing a selected option changes the value', function (assert) { - // handle IE 8 not being supported - var expected = 3; - if (!window.MutationObserver && !window.addEventListener) { - expected = 2; - } - - assert.expect(expected); - - var asyncDone = null; - var syncDone = assert.async(); - - if (expected != 2) { - asyncDone = assert.async(); - } - - var $ = require('jquery'); - var Options = require('select2/options'); - var Select2 = require('select2/core'); - - var $select = $( - '' - ); - - $('#qunit-fixture').append($select); - - var select = new Select2($select); - - select.on('selection:update', function (args) { - assert.equal( - args.data.length, - 1, - 'There was more than one selection' - ); - - if (expected != 2) { - asyncDone(); - } - }); - - assert.equal( - $select.val(), - 'One' - ); - - $select.children().eq(0).remove(); - - assert.equal( - $select.val(), - 'Two' - ); - - syncDone(); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/integration/jquery-calls.js b/static/vendor/select2/tests/integration/jquery-calls.js deleted file mode 100644 index d7c3926f..00000000 --- a/static/vendor/select2/tests/integration/jquery-calls.js +++ /dev/null @@ -1,98 +0,0 @@ -module('select2(val)'); - -var Utils = require('select2/utils'); - -test('multiple elements with arguments works', function (assert) { - var $ = require('jquery'); - require('jquery.select2'); - - var $first = $( - '' - ); - var $second = $first.clone(); - - var $both = $first.add($second); - $both.select2(); - - $both.select2('val', '2'); - - assert.equal( - $first.val(), - '2', - 'The call should change the value on the first element' - ); - assert.equal( - $second.val(), - '2', - 'The call should also change the value on the second element' - ); -}); - -test('initializes when jQuery $.data contains' + - ' cyclic reference', function (assert) { - var $ = require('jquery'); - require('jquery.select2'); - - var $select = $( - '' - ); - - // Add a circular reference object using jQuery. - var recursiveObject = {}; - - recursiveObject.same = recursiveObject; - - $select.data('same', recursiveObject); - - $select.select2(); - - assert.equal( - $select.val(), - '3', - 'The option value should be pulled correctly' - ); -}); - -test('$element.data returns instance and options correctly', - function (assert) { - var $ = require('jquery'); - require('jquery.select2'); - - var $select = $( - '' - ); - - // Initialize. - $select.select2({maximumSelectionLength: 2, multiple: true}); - - assert.equal( - $select.val(), - '3', - 'Only 1 option should be pulled.' - ); - - // Try to resolve instance via .data('select2'). - var $instance = $select.data('select2'); - assert.ok($instance); - assert.ok($instance.options); - - // Ensure $select.data('select2') is the same instance - // created by .select2() - assert.equal($instance, Utils.GetData($instance.$element[0], - 'select2')); - - // Ensure initialized property matches. - assert.equal($instance.options.options.maximumSelectionLength, - 2); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/integration/select2-methods.js b/static/vendor/select2/tests/integration/select2-methods.js deleted file mode 100644 index b1e344a5..00000000 --- a/static/vendor/select2/tests/integration/select2-methods.js +++ /dev/null @@ -1,139 +0,0 @@ -module('select2(data)'); - -var $ = require('jquery'); -var Select2 = require('select2/core'); -var Options = require('select2/options'); - -test('single default selection returned', function (assert) { - var $select = $( - '' - ); - var options = new Options({}); - - var select = new Select2($select, options); - - var items = select.data(); - - assert.equal( - items.length, - 1, - 'The one selected item should be returned' - ); - - var first = items[0]; - - assert.equal( - first.id, - '3', - 'The first option was correct' - ); - - assert.equal( - first.text, - 'Three', - 'The first option was correct' - ); -}); - -test('multiple default selections returned', function (assert) { - var $select = $( - '' - ); - var options = new Options({}); - - var select = new Select2($select, options); - - var items = select.data(); - - assert.equal( - items.length, - 2, - 'The two selected items should be returned' - ); - - var first = items[0]; - - assert.equal( - first.id, - 'One', - 'The first option was correct' - ); - - var second = items[1]; - - assert.equal( - second.id, - '3', - 'The option value should be pulled correctly' - ); -}); - -module('select2(val)'); - -test('single value matches jquery value', function (assert) { - var $select = $( - '' - ); - var options = new Options({}); - - var select = new Select2($select, options); - - var value = select.val(); - - assert.equal( - value, - '3', - 'The value should match the option tag attribute' - ); - - assert.equal( - value, - $select.val(), - 'The value should match the jquery value' - ); -}); - -test('multiple value matches the jquery value', function (assert) { - var $select = $( - '' - ); - var options = new Options({}); - - var select = new Select2($select, options); - - var value = select.val(); - - assert.equal( - value.length, - 2, - 'Two options should be selected' - ); - - assert.deepEqual( - value, - ['One', '3'], - 'The values should match the option tag attribute' - ); - - assert.deepEqual( - value, - $select.val(), - 'The values should match the jquery values' - ); -}); diff --git a/static/vendor/select2/tests/options/ajax-tests.js b/static/vendor/select2/tests/options/ajax-tests.js deleted file mode 100644 index eb65e9ef..00000000 --- a/static/vendor/select2/tests/options/ajax-tests.js +++ /dev/null @@ -1,50 +0,0 @@ -module('Defaults - Ajax'); - -test('options are merged recursively with default options', function (assert) { - var defaults = require('select2/defaults'); - - var ajaxDelay = 250; - var ajaxUrl = 'http://www.test.com'; - - var mergedOptions; - - defaults.set('ajax--delay', ajaxDelay); - - mergedOptions = defaults.apply({ - ajax: { - url: ajaxUrl - } - }); - - assert.equal( - mergedOptions.ajax.delay, - ajaxDelay, - 'Ajax default options are present on the merged options' - ); - - assert.equal( - mergedOptions.ajax.url, - ajaxUrl, - 'Ajax provided options are present on the merged options' - ); - - defaults.reset(); -}); - -test('more than one default option can be changed via set()', function(assert) { - var defaults = require('select2/defaults'); - var ajaxDelay = 123; - var dataDataType = 'xml'; - defaults.set('ajax--delay', ajaxDelay); - defaults.set('ajax--data-type', dataDataType); - - assert.equal( - defaults.defaults.ajax.delay, - ajaxDelay, - 'Both ajax.delay and ajax.dataType present in defaults'); - assert.equal( - defaults.defaults.ajax.dataType, - dataDataType, - 'Both ajax.delay and ajax.dataType present in defaults'); - defaults.reset(); -}); diff --git a/static/vendor/select2/tests/options/data-tests.js b/static/vendor/select2/tests/options/data-tests.js deleted file mode 100644 index 107a2f0c..00000000 --- a/static/vendor/select2/tests/options/data-tests.js +++ /dev/null @@ -1,44 +0,0 @@ -module('Options - Attributes'); - -var $ = require('jquery'); - -var Options = require('select2/options'); - -test('no nesting', function (assert) { - var $test = $(''); - - var options = new Options({}, $test); - - assert.equal(options.get('test'), 'test'); -}); - -test('with nesting', function (assert) { - var $test = $(''); - - if ($test[0].dataset == null) { - assert.ok( - true, - 'We can not run this test with jQuery 1.x if dataset is not implemented' - ); - - return; - } - - var options = new Options({}, $test); - - assert.ok(!(options.get('first-Second'))); - assert.equal(options.get('first').second, 'test'); -}); - -test('overrides initialized data', function (assert) { - var $test = $(''); - - var options = new Options({ - options: 'yes', - override: 'no' - }, $test); - - assert.equal(options.get('options'), 'yes'); - assert.equal(options.get('override'), 'yes'); - assert.equal(options.get('data'), 'yes'); -}); diff --git a/static/vendor/select2/tests/options/deprecated-tests.js b/static/vendor/select2/tests/options/deprecated-tests.js deleted file mode 100644 index a51bba31..00000000 --- a/static/vendor/select2/tests/options/deprecated-tests.js +++ /dev/null @@ -1,250 +0,0 @@ -module('Options - Deprecated - initSelection'); - -var $ = require('jquery'); -var Options = require('select2/options'); - -test('converted into dataAdapter.current', function (assert) { - assert.expect(5); - - var $test = $(''); - var called = false; - - var options = new Options({ - initSelection: function ($element, callback) { - called = true; - - callback([{ - id: '1', - text: '2' - }]); - } - }, $test); - - assert.ok(!called, 'initSelection should not have been called'); - - var DataAdapter = options.get('dataAdapter'); - var data = new DataAdapter($test, options); - - data.current(function (data) { - assert.equal( - data.length, - 1, - 'There should have only been one object selected' - ); - - var item = data[0]; - - assert.equal( - item.id, - '1', - 'The id should have been set by initSelection' - ); - - assert.equal( - item.text, - '2', - 'The text should have been set by initSelection' - ); - }); - - assert.ok(called, 'initSelection should have been called'); -}); - -test('single option converted to array automatically', function (assert) { - assert.expect(2); - - var $test = $(''); - var called = false; - - var options = new Options({ - initSelection: function ($element, callback) { - called = true; - - callback({ - id: '1', - text: '2' - }); - } - }, $test); - - var DataAdapter = options.get('dataAdapter'); - var data = new DataAdapter($test, options); - - data.current(function (data) { - assert.ok( - $.isArray(data), - 'The data should have been converted to an array' - ); - }); - - assert.ok(called, 'initSelection should have been called'); -}); - -test('only called once', function (assert) { - assert.expect(8); - - var $test = $(''); - var called = 0; - - var options = new Options({ - initSelection: function ($element, callback) { - called++; - - callback([{ - id: '1', - text: '2' - }]); - } - }, $test); - - var DataAdapter = options.get('dataAdapter'); - var data = new DataAdapter($test, options); - - data.current(function (data) { - assert.equal( - data.length, - 1, - 'There should have only been a single option' - ); - - var item = data[0]; - - assert.equal( - item.id, - '1', - 'The id should match the one given by initSelection' - ); - - assert.equal( - item.text, - '2', - 'The text should match the one given by initSelection' - ); - }); - - assert.equal( - called, - 1, - 'initSelection should have been called' - ); - - data.current(function (data) { - assert.equal( - data.length, - 1, - 'There should have only been a single option' - ); - - var item = data[0]; - - assert.equal( - item.id, - '3', - 'The id should match the value given in the DOM' - ); - - assert.equal( - item.text, - '4', - 'The text should match the text given in the DOM' - ); - }); - - assert.equal( - called, - 1, - 'initSelection should have only been called once' - ); -}); - -module('Options - Deprecated - query'); - -test('converted into dataAdapter.query automatically', function (assert) { - assert.expect(6); - - var $test = $(''); - var called = false; - - var options = new Options({ - query: function (params) { - called = true; - - params.callback({ - results: [ - { - id: 'test', - text: params.term - } - ] - }); - } - }, $test); - - assert.ok(!called, 'The query option should not have been called'); - - var DataAdapter = options.get('dataAdapter'); - var data = new DataAdapter($test, options); - - data.query({ - term: 'term' - }, function (data) { - assert.ok( - 'results' in data, - 'It should have included the results key' - ); - - assert.equal( - data.results.length, - 1, - 'There should have only been a single result returned' - ); - - var item = data.results[0]; - - assert.equal( - item.id, - 'test', - 'The id should have been returned from the query function' - ); - - assert.equal( - item.text, - 'term', - 'The text should have matched the term that was passed in' - ); - }); - - assert.ok(called, 'The query function should have been called'); -}); - -module('Options - deprecated - data-ajax-url'); - -test('converted ajax-url to ajax--url automatically', function (assert) { - var $test = $(''); - var options = new Options({}, $test); - - assert.ok( - options.get('ajax'), - 'The `ajax` key was automatically created' - ); - assert.equal( - options.get('ajax').url, - 'test://url', - 'The `url` property for the `ajax` option was filled in correctly' - ); -}); - -test('converted select2-tags to data/tags automatically', function (assert) { - var $test = $(''); - var options = new Options({}, $test); - - assert.ok( - options.get('tags'), - 'The `tags` key is automatically set to true' - ); - assert.equal( - options.get('data'), - 'original data', - 'The `data` key is created with the original data' - ); -}); diff --git a/static/vendor/select2/tests/options/translation-tests.js b/static/vendor/select2/tests/options/translation-tests.js deleted file mode 100644 index ab433b61..00000000 --- a/static/vendor/select2/tests/options/translation-tests.js +++ /dev/null @@ -1,28 +0,0 @@ -module('Options - Translations'); - -var $ = require('jquery'); -var Options = require('select2/options'); - -test('partial dictionaries can be passed', function (assert) { - var options = new Options({ - language: { - searching: function () { - return 'Something'; - } - } - }); - - var translations = options.get('translations'); - - assert.equal( - translations.get('searching')(), - 'Something', - 'The partial dictionary still overrides translations' - ); - - assert.equal( - translations.get('noResults')(), - 'No results found', - 'You can still get English translations for keys not passed in' - ); -}); diff --git a/static/vendor/select2/tests/options/width-tests.js b/static/vendor/select2/tests/options/width-tests.js deleted file mode 100644 index e7240349..00000000 --- a/static/vendor/select2/tests/options/width-tests.js +++ /dev/null @@ -1,66 +0,0 @@ -module('Options - Width'); - -var $ = require('jquery'); - -var Select2 = require('select2/core'); -var select = new Select2($('')); - -test('string passed as width', function (assert) { - var $test = $(''); - - var width = select._resolveWidth($test, '80%'); - - assert.equal(width, '80%'); -}); - -test('width from style attribute', function (assert) { - var $test = $(''); - - var width = select._resolveWidth($test, 'style'); - - assert.equal(width, null); -}); - -test('width from computed element width', function (assert) { - var $style = $( - '' - ); - var $test = $(''); - - $('#qunit-fixture').append($style); - $('#qunit-fixture').append($test); - - var width = select._resolveWidth($test, 'element'); - - assert.equal(width, '500px'); -}); - -test('resolve gets the style if it is there', function (assert) { - var $test = $(''); - - $('#qunit-fixture').append($style); - $('#qunit-fixture').append($test); - - var width = select._resolveWidth($test, 'resolve'); - - assert.equal(width, '500px'); -}); diff --git a/static/vendor/select2/tests/results/focusing-tests.js b/static/vendor/select2/tests/results/focusing-tests.js deleted file mode 100644 index 08a2ef3c..00000000 --- a/static/vendor/select2/tests/results/focusing-tests.js +++ /dev/null @@ -1,241 +0,0 @@ -module('Results - highlighting results'); - -test('results:all with no data skips results:focus', function (assert) { - assert.expect(0); - - var $ = require('jquery'); - - var $select = $(''); - var $parent = $('
    '); - - var $container = $(''); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $select.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - - var results = new Results($select, new Options({})); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - results.render(); - - results.bind(container, $container); - - results.on('results:focus', function (params) { - assert.ok(false, 'The results:focus event was triggered'); - }); - - container.trigger('results:all', { - data: { - results: [] - } - }); -}); - -test('results:all triggers results:focus on the first item', function (assert) { - assert.expect(2); - - var $ = require('jquery'); - - var $select = $(''); - var $parent = $('
    '); - - var $container = $(''); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $select.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - - var results = new Results($select, new Options({})); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - results.render(); - - results.bind(container, $container); - - results.on('results:focus', function (params) { - assert.equal(params.data.id, 'test'); - assert.equal(params.data.text, 'Test'); - }); - - container.trigger('results:all', { - data: { - results: [ - { - id: 'test', - text: 'Test' - } - ] - } - }); -}); - -test('results:append does not trigger results:focus', function (assert) { - assert.expect(0); - - var $ = require('jquery'); - - var $select = $(''); - var $parent = $('
    '); - - var $container = $(''); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $select.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - - var results = new Results($select, new Options({})); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - results.render(); - - results.bind(container, $container); - - results.on('results:focus', function () { - assert.ok(false, 'The results:focus event was triggered'); - }); - - container.trigger('results:append', { - data: { - results: [ - { - id: 'test', - text: 'Test' - } - ] - } - }); -}); - -test('scrollAfterSelect triggers results:focus', function (assert) { - assert.expect(3); - - var $ = require('jquery'); - - var $select = $(''); - var $parent = $('
    '); - - var $container = $(''); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $select.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - - var options = new Options({ scrollAfterSelect: true }); - var results = new Results($select, options); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - results.render(); - - results.bind(container, $container); - - // check that default for scrollAfterSelect is true - assert.equal(options.get('scrollAfterSelect'), true); - - results.append({ - results: [ - { - id: 'test', - text: 'Test' - } - ] - }); - - results.on('results:focus', function (params) { - assert.equal(params.data.id, 'test'); - assert.equal(params.data.text, 'Test'); - }); - - container.trigger('select', {}); -}); - -test('!scrollAfterSelect does not trigger results:focus', function (assert) { - assert.expect(1); - - var $ = require('jquery'); - - var $select = $(''); - var $parent = $('
    '); - - var $container = $(''); - var container = new MockContainer(); - - $parent.appendTo($('#qunit-fixture')); - $select.appendTo($parent); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - - var options = new Options({ scrollAfterSelect: false }); - var results = new Results($select, options); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - results.render(); - - results.bind(container, $container); - - // check that default for scrollAfterSelect is false - assert.equal(options.get('scrollAfterSelect'), false); - - results.append({ - results: [ - { - id: 'test', - text: 'Test' - } - ] - }); - - results.on('results:focus', function () { - assert.ok(false, 'The results:focus event was triggered'); - }); - - container.trigger('select', {}); -}); diff --git a/static/vendor/select2/tests/selection/allowClear-tests.js b/static/vendor/select2/tests/selection/allowClear-tests.js deleted file mode 100644 index a7ca726d..00000000 --- a/static/vendor/select2/tests/selection/allowClear-tests.js +++ /dev/null @@ -1,330 +0,0 @@ -module('Selection containers - Placeholders - Allow clear'); - -var Placeholder = require('select2/selection/placeholder'); -var AllowClear = require('select2/selection/allowClear'); - -var SingleSelection = require('select2/selection/single'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var AllowClearPlaceholder = Utils.Decorate( - Utils.Decorate(SingleSelection, Placeholder), - AllowClear -); - -var allowClearOptions = new Options({ - placeholder: { - id: 'placeholder', - text: 'This is the placeholder' - }, - allowClear: true -}); - -test('clear is not displayed for single placeholder', function (assert) { - var selection = new AllowClearPlaceholder( - $('#qunit-fixture .single-with-placeholder'), - allowClearOptions - ); - - var $selection = selection.render(); - - selection.update([{ - id: 'placeholder' - }]); - - assert.equal( - $selection.find('.select2-selection__clear').length, - 0, - 'The clear icon should not be displayed' - ); -}); - -test('clear is not displayed for multiple placeholder', function (assert) { - var selection = new AllowClearPlaceholder( - $('#qunit-fixture .multiple'), - allowClearOptions - ); - - var $selection = selection.render(); - - selection.update([]); - - assert.equal( - $selection.find('.select2-selection__clear').length, - 0, - 'The clear icon should not be displayed' - ); -}); - - -test('clear is displayed for placeholder', function (assert) { - var selection = new AllowClearPlaceholder( - $('#qunit-fixture .single-with-placeholder'), - allowClearOptions - ); - - var $selection = selection.render(); - - selection.update([{ - id: 'one', - test: 'one' - }]); - - assert.equal( - $selection.find('.select2-selection__clear').length, - 1, - 'The clear icon should be displayed' - ); -}); - -test('clear icon should have title displayed', function (assert) { - var selection = new AllowClearPlaceholder( - $('#qunit-fixture .single-with-placeholder'), - allowClearOptions - ); - - var $selection = selection.render(); - - selection.update([{ - id: 'one', - test: 'one' - }]); - - assert.equal( - $selection.find('.select2-selection__clear').attr('title'), - 'Remove all items', - 'The clear icon should have title displayed' - ); -}); - -test('clicking clear will set the placeholder value', function (assert) { - var $element = $('#qunit-fixture .single-with-placeholder'); - - var selection = new AllowClearPlaceholder( - $element, - allowClearOptions - ); - var container = new MockContainer(); - - var $selection = selection.render(); - - selection.bind(container, $('
    ')); - - $element.val('One'); - selection.update([{ - id: 'One', - text: 'One' - }]); - - var $remove = $selection.find('.select2-selection__clear'); - $remove.trigger('mousedown'); - - assert.equal( - $element.val(), - 'placeholder', - 'The value should have been reset to the placeholder' - ); -}); - -test('clicking clear will trigger the unselect event', function (assert) { - assert.expect(4); - - var $element = $('#qunit-fixture .single-with-placeholder'); - - var selection = new AllowClearPlaceholder( - $element, - allowClearOptions - ); - var container = new MockContainer(); - - var $selection = selection.render(); - - selection.bind(container, $('
    ')); - - $element.val('One'); - selection.update([{ - id: 'One', - text: 'One' - }]); - - selection.on('unselect', function (ev) { - assert.ok( - 'data' in ev && ev.data, - 'The event should have been triggered with the data property' - ); - - assert.ok( - $.isPlainObject(ev.data), - 'The data should be an object' - ); - - assert.equal( - ev.data.id, - 'One', - 'The data should be the unselected object' - ); - - assert.equal( - $element.val(), - 'placeholder', - 'The previous value should be unselected' - ); - }); - - var $remove = $selection.find('.select2-selection__clear'); - $remove.trigger('mousedown'); -}); - -test('preventing the unselect event cancels the clearing', function (assert) { - var $element = $('#qunit-fixture .single-with-placeholder'); - - var selection = new AllowClearPlaceholder( - $element, - allowClearOptions - ); - var container = new MockContainer(); - - var $selection = selection.render(); - - selection.bind(container, $('
    ')); - - $element.val('One'); - selection.update([{ - id: 'One', - text: 'One' - }]); - - selection.on('unselect', function (ev) { - ev.prevented = true; - }); - - var $remove = $selection.find('.select2-selection__clear'); - $remove.trigger('mousedown'); - - assert.equal( - $element.val(), - 'One', - 'The placeholder should not have been set' - ); -}); - -test('clicking clear will trigger the clear event', function (assert) { - assert.expect(5); - - var $element = $('#qunit-fixture .single-with-placeholder'); - - var selection = new AllowClearPlaceholder( - $element, - allowClearOptions - ); - var container = new MockContainer(); - - var $selection = selection.render(); - - selection.bind(container, $('
    ')); - - $element.val('One'); - selection.update([{ - id: 'One', - text: 'One' - }]); - - selection.on('clear', function (ev) { - assert.ok( - 'data' in ev && ev.data, - 'The event should have been triggered with the data property' - ); - - assert.ok( - $.isArray(ev.data), - 'The data should be an array' - ); - - assert.equal( - ev.data.length, - 1, - 'The data should contain one item for each value' - ); - - assert.equal( - ev.data[0].id, - 'One', - 'The data should contain unselected objects' - ); - - assert.equal( - $element.val(), - 'placeholder', - 'The previous value should be unselected' - ); - }); - - var $remove = $selection.find('.select2-selection__clear'); - $remove.trigger('mousedown'); -}); - -test('preventing the clear event cancels the clearing', function (assert) { - var $element = $('#qunit-fixture .single-with-placeholder'); - - var selection = new AllowClearPlaceholder( - $element, - allowClearOptions - ); - var container = new MockContainer(); - - var $selection = selection.render(); - - selection.bind(container, $('
    ')); - - $element.val('One'); - selection.update([{ - id: 'One', - text: 'One' - }]); - - selection.on('clear', function (ev) { - ev.prevented = true; - }); - - var $remove = $selection.find('.select2-selection__clear'); - $remove.trigger('mousedown'); - - assert.equal( - $element.val(), - 'One', - 'The placeholder should not have been set' - ); -}); - -test('clear does not work when disabled', function (assert) { - var $element = $('#qunit-fixture .single-with-placeholder'); - - var selection = new AllowClearPlaceholder( - $element, - allowClearOptions - ); - var container = new MockContainer(); - - var $selection = selection.render(); - - selection.bind(container, $('
    ')); - - selection.update([{ - id: 'One', - text: 'One' - }]); - - $element.val('One'); - selection.options.set('disabled', true); - - var $remove = $selection.find('.select2-selection__clear'); - $remove.trigger('mousedown'); - - assert.equal( - $element.val(), - 'One', - 'The placeholder should not have been set' - ); -}); diff --git a/static/vendor/select2/tests/selection/containerCss-tests.js b/static/vendor/select2/tests/selection/containerCss-tests.js deleted file mode 100644 index 522703a2..00000000 --- a/static/vendor/select2/tests/selection/containerCss-tests.js +++ /dev/null @@ -1,104 +0,0 @@ -module('Dropdown - containerCssClass compatibility'); - -var $ = require('jquery'); -var Utils = require('select2/utils'); -var Options = require('select2/options'); - -var SingleSelection = require('select2/selection/single'); -var ContainerCSS = Utils.Decorate( - SingleSelection, - require('select2/compat/containerCss') -); - -test('all classes will be copied if :all: is used', function (assert) { - var $element = $(''); - var options = new Options({ - containerCssClass: ':all:' - }); - - var select = new ContainerCSS($element, options); - var $container = select.render(); - - assert.ok($container.hasClass('test')); - assert.ok($container.hasClass('copy')); - assert.ok($container.hasClass('works')); - assert.ok(!$container.hasClass(':all:')); -}); - -test(':all: can be used with other classes', function (assert) { - var $element = $(''); - var options = new Options({ - containerCssClass: ':all: other' - }); - - var select = new ContainerCSS($element, options); - var $container = select.render(); - - assert.ok($container.hasClass('test')); - assert.ok($container.hasClass('copy')); - assert.ok($container.hasClass('works')); - assert.ok($container.hasClass('other')); - assert.ok(!$container.hasClass(':all:')); -}); - -test('classes can be passed in as a string', function (assert) { - var $element = $(''); - var options = new Options({ - containerCssClass: 'other' - }); - - var select = new ContainerCSS($element, options); - var $container = select.render(); - - assert.ok($container.hasClass('other')); -}); - -test('a function can be used based on the element', function (assert){ - var $element = $(''); - var options = new Options({ - containerCssClass: function ($element) { - return 'function'; - } - }); - - var select = new ContainerCSS($element, options); - var $container = select.render(); - - assert.ok($container.hasClass('function')); - assert.ok(!$container.hasClass('test')); -}); - -test(':all: works around custom adapters', function (assert) { - var $element = $(''); - var options = new Options({ - containerCssClass: ':all: something', - adaptContainerCssClass: function (clazz) { - return clazz + '-modified'; - } - }); - - var select = new ContainerCSS($element, options); - var $container = select.render(); - - assert.ok($container.hasClass('something')); - - assert.ok($container.hasClass('test')); - assert.ok($container.hasClass('test-modified')); -}); - -module('Selection - adaptContainerCss compatibility'); - -test('only return when adapted', function (assert) { - var $element = $(''); - var options = new Options({ - adaptContainerCssClass: function (clazz) { - return 'modified'; - } - }); - - var select = new ContainerCSS($element, options); - var $container = select.render(); - - assert.ok(!$container.hasClass('original')); - assert.ok($container.hasClass('modified')); -}); diff --git a/static/vendor/select2/tests/selection/multiple-tests.js b/static/vendor/select2/tests/selection/multiple-tests.js deleted file mode 100644 index 5e996ea6..00000000 --- a/static/vendor/select2/tests/selection/multiple-tests.js +++ /dev/null @@ -1,151 +0,0 @@ -module('Selection containers - Multiple'); - -var MultipleSelection = require('select2/selection/multiple'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var options = new Options({}); - -test('display uses templateSelection', function (assert) { - var called = false; - - var templateOptions = new Options({ - templateSelection: function (data) { - called = true; - - return data.text; - } - }); - - var selection = new MultipleSelection( - $('#qunit-fixture .multiple'), - templateOptions - ); - - var out = selection.display({ - text: 'test' - }); - - assert.ok(called); - - assert.equal(out, 'test'); -}); - -test('templateSelection can addClass', function (assert) { - var called = false; - - var templateOptions = new Options({ - templateSelection: function (data, container) { - called = true; - container.addClass('testclass'); - return data.text; - } - }); - - var selection = new MultipleSelection( - $('#qunit-fixture .multiple'), - templateOptions - ); - - var $container = selection.selectionContainer(); - - var out = selection.display({ - text: 'test' - }, $container); - - assert.ok(called); - - assert.equal(out, 'test'); - - assert.ok($container.hasClass('testclass')); -}); - -test('empty update clears the selection', function (assert) { - var selection = new MultipleSelection( - $('#qunit-fixture .multiple'), - options - ); - - var $selection = selection.render(); - var $rendered = $selection.find('.select2-selection__rendered'); - - $rendered.text('testing'); - $rendered.attr('title', 'testing'); - - selection.update([]); - - assert.equal($rendered.text(), ''); - assert.equal($rendered.attr('title'), undefined); -}); - -test('escapeMarkup is being used', function (assert) { - var selection = new MultipleSelection( - $('#qunit-fixture .multiple'), - options - ); - - var $selection = selection.render(); - var $rendered = $selection.find('.select2-selection__rendered'); - - var unescapedText = ''; - - selection.update([{ - text: unescapedText - }]); - - assert.equal( - $rendered.text().substr(1), - unescapedText, - 'The text should be escaped by default to prevent injection' - ); -}); - -test('clear button respects the disabled state', function (assert) { - var options = new Options({ - disabled: true - }); - - var $select = $('#qunit-fixture .multiple'); - - var container = new MockContainer(); - var $container = $('
    '); - - var selection = new MultipleSelection( - $select, - options - ); - - var $selection = selection.render(); - $container.append($selection); - - selection.bind(container, $container); - - // Select an option - selection.update([{ - text: 'Test' - }]); - - var $rendered = $selection.find('.select2-selection__rendered'); - - var $pill = $rendered.find('.select2-selection__choice'); - - assert.equal($pill.length, 1, 'There should only be one selection'); - - var $remove = $pill.find('.select2-selection__choice__remove'); - - assert.equal( - $remove.length, - 1, - 'The remove icon is displayed for the selection' - ); - - // Set up the unselect handler - selection.on('unselect', function (params) { - assert.ok(false, 'The unselect handler should not be triggered'); - }); - - // Trigger the handler for the remove icon - $remove.trigger('click'); -}); diff --git a/static/vendor/select2/tests/selection/placeholder-tests.js b/static/vendor/select2/tests/selection/placeholder-tests.js deleted file mode 100644 index 8a436ff3..00000000 --- a/static/vendor/select2/tests/selection/placeholder-tests.js +++ /dev/null @@ -1,74 +0,0 @@ -module('Selection containers - Placeholders'); - -var Placeholder = require('select2/selection/placeholder'); -var SingleSelection = require('select2/selection/single'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var SinglePlaceholder = Utils.Decorate(SingleSelection, Placeholder); - -var placeholderOptions = new Options({ - placeholder: { - id: 'placeholder', - text: 'This is the placeholder' - } -}); - -test('normalizing placeholder ignores objects', function (assert) { - var selection = new SinglePlaceholder( - $('#qunit-fixture .single'), - placeholderOptions - ); - - var original = { - id: 'test', - text: 'testing' - }; - - var normalized = selection.normalizePlaceholder(original); - - assert.equal(original, normalized); -}); - -test('normalizing placeholder gives object for string', function (assert) { - var selection = new SinglePlaceholder( - $('#qunit-fixture .single'), - placeholderOptions - ); - - var normalized = selection.normalizePlaceholder('placeholder'); - - assert.equal(normalized.id, ''); - assert.equal(normalized.text, 'placeholder'); -}); - - -test('text is shown for placeholder option on single', function (assert) { - var selection = new SinglePlaceholder( - $('#qunit-fixture .single'), - placeholderOptions - ); - - var $selection = selection.render(); - - selection.update([{ - id: 'placeholder' - }]); - - assert.equal($selection.text(), 'This is the placeholder'); -}); - -test('placeholder is shown when no options are selected', function (assert) { - var selection = new SinglePlaceholder( - $('#qunit-fixture .multiple'), - placeholderOptions - ); - - var $selection = selection.render(); - - selection.update([]); - - assert.equal($selection.text(), 'This is the placeholder'); -}); diff --git a/static/vendor/select2/tests/selection/search-tests.js b/static/vendor/select2/tests/selection/search-tests.js deleted file mode 100644 index 43345d72..00000000 --- a/static/vendor/select2/tests/selection/search-tests.js +++ /dev/null @@ -1,191 +0,0 @@ -module('Selection containers - Inline search'); - -var MultipleSelection = require('select2/selection/multiple'); -var InlineSearch = require('select2/selection/search'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var options = new Options({}); - -test('backspace will remove a choice', function (assert) { - assert.expect(3); - - var KEYS = require('select2/keys'); - - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - - var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch); - - var $element = $('#qunit-fixture .multiple'); - var selection = new CustomSelection($element, options); - - var $selection = selection.render(); - selection.bind(container, $container); - - // The unselect event should be triggered at some point - selection.on('unselect', function () { - assert.ok(true, 'A choice was unselected'); - }); - - // Add some selections and render the search - selection.update([ - { - id: '1', - text: 'One' - } - ]); - - var $search = $selection.find('input'); - var $choices = $selection.find('.select2-selection__choice'); - - assert.equal($search.length, 1, 'The search was visible'); - assert.equal($choices.length, 1, 'The choice was rendered'); - - // Trigger the backspace on the search - var backspace = $.Event('keydown', { - which: KEYS.BACKSPACE - }); - $search.trigger(backspace); -}); - -test('backspace will set the search text', function (assert) { - assert.expect(3); - - var KEYS = require('select2/keys'); - - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - - var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch); - - var $element = $('#qunit-fixture .multiple'); - var selection = new CustomSelection($element, options); - - var $selection = selection.render(); - selection.bind(container, $container); - - // Add some selections and render the search - selection.update([ - { - id: '1', - text: 'One' - } - ]); - - var $search = $selection.find('input'); - var $choices = $selection.find('.select2-selection__choice'); - - assert.equal($search.length, 1, 'The search was visible'); - assert.equal($choices.length, 1, 'The choice was rendered'); - - // Trigger the backspace on the search - var backspace = $.Event('keydown', { - which: KEYS.BACKSPACE - }); - $search.trigger(backspace); - - assert.equal($search.val(), 'One', 'The search text was set'); -}); - -test('updating selection does not shift the focus', function (assert) { - // Check for IE 8, which triggers a false negative during testing - if (window.attachEvent && !window.addEventListener) { - // We must expect 0 assertions or the test will fail - assert.expect(0); - return; - } - - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - - var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch); - - var $element = $('#qunit-fixture .multiple'); - var selection = new CustomSelection($element, options); - - var $selection = selection.render(); - selection.bind(container, $container); - - // Update the selection so the search is rendered - selection.update([]); - - // Make it visible so the browser can place focus on the search - $container.append($selection); - - var $search = $selection.find('input'); - $search.trigger('focus'); - - assert.equal($search.length, 1, 'The search was not visible'); - - assert.equal( - document.activeElement, - $search[0], - 'The search did not have focus originally' - ); - - // Trigger an update, this should redraw the search box - selection.update([]); - - assert.equal($search.length, 1, 'The search box disappeared'); - - assert.equal( - document.activeElement, - $search[0], - 'The search did not have focus after the selection was updated' - ); -}); - -test('the focus event shifts the focus', function (assert) { - // Check for IE 8, which triggers a false negative during testing - if (window.attachEvent && !window.addEventListener) { - // We must expect 0 assertions or the test will fail - assert.expect(0); - return; - } - - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - - var CustomSelection = Utils.Decorate(MultipleSelection, InlineSearch); - - var $element = $('#qunit-fixture .multiple'); - var selection = new CustomSelection($element, options); - - var $selection = selection.render(); - selection.bind(container, $container); - - // Update the selection so the search is rendered - selection.update([]); - - // Make it visible so the browser can place focus on the search - $container.append($selection); - - // The search should not be automatically focused - - var $search = $selection.find('input'); - - assert.notEqual( - document.activeElement, - $search[0], - 'The search had focus originally' - ); - - assert.equal($search.length, 1, 'The search was not visible'); - - // Focus the container - - container.trigger('focus'); - - // Make sure it focuses the search - - assert.equal($search.length, 1, 'The search box disappeared'); - - assert.equal( - document.activeElement, - $search[0], - 'The search did not have focus originally' - ); -}); \ No newline at end of file diff --git a/static/vendor/select2/tests/selection/single-tests.js b/static/vendor/select2/tests/selection/single-tests.js deleted file mode 100644 index 9ab16367..00000000 --- a/static/vendor/select2/tests/selection/single-tests.js +++ /dev/null @@ -1,119 +0,0 @@ -module('Selection containers - Single'); - -var SingleSelection = require('select2/selection/single'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var options = new Options({}); - -test('display uses templateSelection', function (assert) { - var called = false; - - var templateOptions = new Options({ - templateSelection: function (data) { - called = true; - - return data.text; - } - }); - - var selection = new SingleSelection( - $('#qunit-fixture .single'), - templateOptions - ); - - var out = selection.display({ - text: 'test' - }); - - assert.ok(called); - - assert.equal(out, 'test'); -}); - -test('templateSelection can addClass', function (assert) { - var called = false; - - var templateOptions = new Options({ - templateSelection: function (data, container) { - called = true; - container.addClass('testclass'); - return data.text; - } - }); - - var selection = new SingleSelection( - $('#qunit-fixture .single'), - templateOptions - ); - - var $container = selection.selectionContainer(); - - var out = selection.display({ - text: 'test' - }, $container); - - assert.ok(called); - - assert.equal(out, 'test'); - - assert.ok($container.hasClass('testclass')); -}); - -test('empty update clears the selection', function (assert) { - var selection = new SingleSelection( - $('#qunit-fixture .single'), - options - ); - - var $selection = selection.render(); - var $rendered = $selection.find('.select2-selection__rendered'); - - $rendered.text('testing'); - $rendered.attr('title', 'testing'); - - selection.update([]); - - assert.equal($rendered.text(), ''); - assert.equal($rendered.attr('title'), undefined); -}); - -test('update renders the data text', function (assert) { - var selection = new SingleSelection( - $('#qunit-fixture .single'), - options - ); - - var $selection = selection.render(); - var $rendered = $selection.find('.select2-selection__rendered'); - - selection.update([{ - text: 'test' - }]); - - assert.equal($rendered.text(), 'test'); -}); - -test('escapeMarkup is being used', function (assert) { - var selection = new SingleSelection( - $('#qunit-fixture .single'), - options - ); - - var $selection = selection.render(); - var $rendered = $selection.find('.select2-selection__rendered'); - - var unescapedText = ''; - - selection.update([{ - text: unescapedText - }]); - - assert.equal( - $rendered.text(), - unescapedText, - 'The text should be escaped by default to prevent injection' - ); -}); diff --git a/static/vendor/select2/tests/selection/stopPropagation-tests.js b/static/vendor/select2/tests/selection/stopPropagation-tests.js deleted file mode 100644 index d8d8897b..00000000 --- a/static/vendor/select2/tests/selection/stopPropagation-tests.js +++ /dev/null @@ -1,33 +0,0 @@ -module('Selection containers - Stoping event propagation'); - -var SingleSelection = require('select2/selection/single'); -var StopPropagation = require('select2/selection/stopPropagation'); - -var $ = require('jquery'); -var Options = require('select2/options'); -var Utils = require('select2/utils'); - -var CutomSelection = Utils.Decorate(SingleSelection, StopPropagation); - -var options = new Options(); - -test('click event does not propagate', function (assert) { - assert.expect(1); - - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - - var selection = new CutomSelection($('#qunit-fixture select'), options); - - var $selection = selection.render(); - selection.bind(container, $container); - - $container.append($selection); - $container.on('click', function () { - assert.ok(false, 'The click event should have been stopped'); - }); - - $selection.trigger('click'); - - assert.ok(true, 'Something went wrong if this failed'); -}); diff --git a/static/vendor/select2/tests/unit-jq1.html b/static/vendor/select2/tests/unit-jq1.html deleted file mode 100644 index 7de1bfa2..00000000 --- a/static/vendor/select2/tests/unit-jq1.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - -
    -
    -
    - -
    - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/vendor/select2/tests/unit-jq2.html b/static/vendor/select2/tests/unit-jq2.html deleted file mode 100644 index eb7eb12d..00000000 --- a/static/vendor/select2/tests/unit-jq2.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - -
    -
    -
    - -
    - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/vendor/select2/tests/unit-jq3.html b/static/vendor/select2/tests/unit-jq3.html deleted file mode 100644 index a14fa9e6..00000000 --- a/static/vendor/select2/tests/unit-jq3.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - -
    -
    -
    - -
    - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/vendor/select2/tests/utils/decorator-tests.js b/static/vendor/select2/tests/utils/decorator-tests.js deleted file mode 100644 index 4888991f..00000000 --- a/static/vendor/select2/tests/utils/decorator-tests.js +++ /dev/null @@ -1,189 +0,0 @@ -module('Decorators'); - -var Utils = require('select2/utils'); - -test('overridden - method', function (assert) { - function BaseClass () {} - - BaseClass.prototype.hello = function () { - return 'A'; - }; - - function DecoratorClass () {} - - DecoratorClass.prototype.hello = function () { - return 'B'; - }; - - var DecoratedClass = Utils.Decorate(BaseClass, DecoratorClass); - - var inst = new DecoratedClass(); - - assert.strictEqual(inst.hello(), 'B'); -}); - -test('overridden - constructor', function (assert) { - function BaseClass () { - this.inherited = true; - } - - BaseClass.prototype.hello = function () { - return 'A'; - }; - - function DecoratorClass (decorated) { - this.called = true; - } - - DecoratorClass.prototype.other = function () { - return 'B'; - }; - - var DecoratedClass = Utils.Decorate(BaseClass, DecoratorClass); - - var inst = new DecoratedClass(); - - assert.ok(inst.called); - assert.ok(!inst.inherited); -}); - -test('not overridden - method', function (assert) { - function BaseClass () {} - - BaseClass.prototype.hello = function () { - return 'A'; - }; - - function DecoratorClass () {} - - DecoratorClass.prototype.other = function () { - return 'B'; - }; - - var DecoratedClass = Utils.Decorate(BaseClass, DecoratorClass); - - var inst = new DecoratedClass(); - - assert.strictEqual(inst.hello(), 'A'); -}); - -test('not overridden - constructor', function (assert) { - function BaseClass () { - this.called = true; - } - - BaseClass.prototype.hello = function () { - return 'A'; - }; - - function DecoratorClass () {} - - DecoratorClass.prototype.other = function () { - return 'B'; - }; - - var DecoratedClass = Utils.Decorate(BaseClass, DecoratorClass); - - var inst = new DecoratedClass(); - - assert.ok(inst.called); -}); - -test('inherited - method', function (assert) { - function BaseClass () {} - - BaseClass.prototype.hello = function () { - return 'A'; - }; - - function DecoratorClass (decorated) {} - - DecoratorClass.prototype.hello = function (decorated) { - return 'B' + decorated.call(this) + 'C'; - }; - - var DecoratedClass = Utils.Decorate(BaseClass, DecoratorClass); - - var inst = new DecoratedClass(); - - assert.strictEqual(inst.hello(), 'BAC'); -}); - -test('inherited - constructor', function (assert) { - function BaseClass () { - this.inherited = true; - } - - BaseClass.prototype.hello = function () { - return 'A'; - }; - - function DecoratorClass (decorated) { - this.called = true; - - decorated.call(this); - } - - DecoratorClass.prototype.other = function () { - return 'B'; - }; - - var DecoratedClass = Utils.Decorate(BaseClass, DecoratorClass); - - var inst = new DecoratedClass(); - - assert.ok(inst.called); - assert.ok(inst.inherited); -}); - -test('inherited - three levels', function (assert) { - function BaseClass (testArgument) { - this.baseCalled = true; - this.baseTestArgument = testArgument; - } - - BaseClass.prototype.test = function (a) { - return a + 'c'; - }; - - function MiddleClass (decorated, testArgument) { - this.middleCalled = true; - this.middleTestArgument = testArgument; - - decorated.call(this, testArgument); - } - - MiddleClass.prototype.test = function (decorated, a) { - return decorated.call(this, a + 'b'); - }; - - function DecoratorClass (decorated, testArgument) { - this.decoratorCalled = true; - this.decoratorTestArgument = testArgument; - - decorated.call(this, testArgument); - } - - DecoratorClass.prototype.test = function (decorated, a) { - return decorated.call(this, a + 'a'); - }; - - var DecoratedClass = Utils.Decorate( - Utils.Decorate(BaseClass, MiddleClass), - DecoratorClass - ); - - var inst = new DecoratedClass('test'); - - assert.ok(inst.baseCalled, 'The base class contructor was called'); - assert.ok(inst.middleCalled, 'The middle class constructor was called'); - assert.ok(inst.decoratorCalled, 'The decorator constructor was called'); - - assert.strictEqual(inst.baseTestArgument, 'test'); - assert.strictEqual(inst.middleTestArgument, 'test'); - assert.strictEqual(inst.decoratorTestArgument, 'test'); - - var out = inst.test('test'); - - assert.strictEqual(out, 'testabc'); -}); diff --git a/static/vendor/select2/tests/utils/escapeMarkup-tests.js b/static/vendor/select2/tests/utils/escapeMarkup-tests.js deleted file mode 100644 index 726f09de..00000000 --- a/static/vendor/select2/tests/utils/escapeMarkup-tests.js +++ /dev/null @@ -1,36 +0,0 @@ -module('Utils - escapeMarkup'); - -var Utils = require('select2/utils'); - -test('text passes through', function (assert) { - var text = 'testing this'; - var escaped = Utils.escapeMarkup(text); - - assert.equal(text, escaped); -}); - -test('html tags are escaped', function (assert) { - var text = ''; - var escaped = Utils.escapeMarkup(text); - - assert.notEqual(text, escaped); - assert.equal(escaped.indexOf('