diff --git a/static/bootstrap/css/bootstrap-tagsinput-typeahead.css b/static/bootstrap/css/bootstrap-tagsinput-typeahead.css deleted file mode 100644 index 917246b..0000000 --- a/static/bootstrap/css/bootstrap-tagsinput-typeahead.css +++ /dev/null @@ -1,49 +0,0 @@ -.twitter-typeahead .tt-query, -.twitter-typeahead .tt-hint { - margin-bottom: 0; -} - -.twitter-typeahead .tt-hint -{ - display: none; -} - -.tt-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - list-style: none; - font-size: 14px; - background-color: #ffffff; - border: 1px solid #cccccc; - border: 1px solid rgba(0, 0, 0, 0.15); - border-radius: 4px; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - background-clip: padding-box; - cursor: pointer; -} - -.tt-suggestion { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 1.428571429; - color: #333333; - white-space: nowrap; -} - -.tt-suggestion:hover, -.tt-suggestion:focus { - color: #ffffff; - text-decoration: none; - outline: 0; - background-color: #428bca; -} diff --git a/static/bootstrap/js/bootstrap-tagsinput-angular.js b/static/bootstrap/js/bootstrap-tagsinput-angular.js deleted file mode 100644 index adcaccb..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-angular.js +++ /dev/null @@ -1,87 +0,0 @@ -angular.module('bootstrap-tagsinput', []) -.directive('bootstrapTagsinput', [function() { - - function getItemProperty(scope, property) { - if (!property) - return undefined; - - if (angular.isFunction(scope.$parent[property])) - return scope.$parent[property]; - - return function(item) { - return item[property]; - }; - } - - return { - restrict: 'EA', - scope: { - model: '=ngModel' - }, - template: '', - replace: false, - link: function(scope, element, attrs) { - $(function() { - if (!angular.isArray(scope.model)) - scope.model = []; - - var select = $('select', element); - var typeaheadSourceArray = attrs.typeaheadSource ? attrs.typeaheadSource.split('.') : null; - var typeaheadSource = typeaheadSourceArray ? - (typeaheadSourceArray.length > 1 ? - scope.$parent[typeaheadSourceArray[0]][typeaheadSourceArray[1]] - : scope.$parent[typeaheadSourceArray[0]]) - : null; - - select.tagsinput(scope.$parent[attrs.options || ''] || { - typeahead : { - source : angular.isFunction(typeaheadSource) ? typeaheadSource : null - }, - itemValue: getItemProperty(scope, attrs.itemvalue), - itemText : getItemProperty(scope, attrs.itemtext), - confirmKeys : getItemProperty(scope, attrs.confirmkeys) ? JSON.parse(attrs.confirmkeys) : [13], - tagClass : angular.isFunction(scope.$parent[attrs.tagclass]) ? scope.$parent[attrs.tagclass] : function(item) { return attrs.tagclass; } - }); - - for (var i = 0; i < scope.model.length; i++) { - select.tagsinput('add', scope.model[i]); - } - - select.on('itemAdded', function(event) { - if (scope.model.indexOf(event.item) === -1) - scope.model.push(event.item); - }); - - select.on('itemRemoved', function(event) { - var idx = scope.model.indexOf(event.item); - if (idx !== -1) - scope.model.splice(idx, 1); - }); - - // create a shallow copy of model's current state, needed to determine - // diff when model changes - var prev = scope.model.slice(); - scope.$watch("model", function() { - var added = scope.model.filter(function(i) {return prev.indexOf(i) === -1;}), - removed = prev.filter(function(i) {return scope.model.indexOf(i) === -1;}), - i; - - prev = scope.model.slice(); - - // Remove tags no longer in binded model - for (i = 0; i < removed.length; i++) { - select.tagsinput('remove', removed[i]); - } - - // Refresh remaining tags - select.tagsinput('refresh'); - - // Add new items in model as tags - for (i = 0; i < added.length; i++) { - select.tagsinput('add', added[i]); - } - }, true); - }); - } - }; -}]); diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/.gitignore b/static/bootstrap/js/bootstrap-tagsinput-master/.gitignore deleted file mode 100644 index d06f964..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -bower_components/ -versioned -lib/* diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/.travis.yml b/static/bootstrap/js/bootstrap-tagsinput-master/.travis.yml deleted file mode 100644 index 555e156..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - 0.10 - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - npm install - - ./node_modules/.bin/grunt install - -script: - - ./node_modules/.bin/grunt test diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/Gruntfile.js b/static/bootstrap/js/bootstrap-tagsinput-master/Gruntfile.js deleted file mode 100644 index a88d912..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/Gruntfile.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = function(grunt) { - - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-karma'); - grunt.loadNpmTasks('grunt-zip'); - grunt.loadNpmTasks('grunt-jquerymanifest'); - grunt.loadNpmTasks('grunt-bower-task'); - grunt.loadNpmTasks('grunt-banner'); - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - bower: { - install: { - options: { - targetDir: './lib', - layout: 'byType', - install: true, - verbose: true, - cleanTargetDir: false, - cleanBowerDir: true, - bowerOptions: { - forceLatest: true - } - } - } - }, - copy: { - versioned: { - files: [ - { expand: true, flatten: true, src: ['src/*.*'], dest: 'versioned/', filter: 'isFile' } - ] - }, - build: { - files: [ - { expand: true, flatten: true, src: ['versioned/*.*'], dest: 'dist/', filter: 'isFile' } - ] - } - }, - uglify: { - options: { - banner: '<%= pkg.banner %>', - sourceMap: 'dist/<%= pkg.name %>.min.js.map', - sourceMappingURL: '<%= pkg.name %>.min.js.map' - }, - build: { - files: { - 'dist/<%= pkg.name %>.min.js': 'src/<%= pkg.name %>.js', - 'dist/<%= pkg.name %>-angular.min.js': 'src/<%= pkg.name %>-angular.js' - } - } - }, - karma: { - unit: { - configFile: 'karma.conf.js', - runnerPort: 9999, - singleRun: true, - autoWatch: false, - browsers: ['PhantomJS'] - } - }, - zip: { - delpoy: { - // cwd: 'dist/', - src: [ - 'dist/bootstrap-tagsinput*.js', - 'dist/bootstrap-tagsinput*.css', - 'dist/bootstrap-tagsinput*.less', - 'dist/bootstrap-tagsinput*.map' - ], - dest: 'dist/<%= pkg.name %>.zip' - } - }, - jquerymanifest: { - options: { - source: grunt.file.readJSON('package.json'), - overrides: { - title: '<%= pkg.title %>' - } - } - }, - usebanner: { - taskName: { - options: { - position: 'top', - banner: '<%= pkg.banner %>', - linebreak: true - }, - files: { - src: [ 'versioned/*.*' ] - } - } - } - }); - - grunt.registerTask('install', ['bower']); - grunt.registerTask('compile', ['copy:versioned', 'usebanner', 'uglify', 'copy:build']); - grunt.registerTask('test', ['compile', 'karma']); - grunt.registerTask('build', ['test', 'jquerymanifest', 'zip']); -}; diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/LICENSE b/static/bootstrap/js/bootstrap-tagsinput-master/LICENSE deleted file mode 100644 index 58bc985..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Tim Schlechter - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/README.md b/static/bootstrap/js/bootstrap-tagsinput-master/README.md deleted file mode 100644 index c67a1c3..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# Bootstrap Tags Input [![Build Status](https://travis-ci.org/bootstrap-tagsinput/bootstrap-tagsinput.svg?branch=master)](https://travis-ci.org/bootstrap-tagsinput/bootstrap-tagsinput) -Bootstrap Tags Input is a jQuery plugin providing a Twitter Bootstrap user interface for managing tags. - -Current stable version: **v0.8.0** - -## Usage -Examples can be found [here](http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/). - -## Features -* Objects as tags -* True multi value -* Typeahead -* Designed for Bootstrap 2.3.2 and 3 - -### Objects as tags -Not just support for using strings! This means you can use different values -for a tag's label and value. Each tag also holds a reference to the object -by which it was created, so by calling tagsinput('items') an -array of the original items is returned. - -### True multi value support -Other implementations just concatenate the values to a comma separated string. -This results in val() returning just this string, and when -submitting the form, only one big, concatenated value is sent in the request. - -Bootstrap Tags Input provides true multivalue support. Just use a -<select multiple /> as your input element, and -val() will return an array of the tag values. When submitting the -form, an array of values will be sent with the request. - -### Typeahead support -Integrates with Twitter Bootstraps' 2.3.2 typeahead, or use custom typeahead when using Bootstrap 3. - -## Development -Install dependencies: -
-npm install
-grunt install
-
-Test: -
-grunt test
-
-Build: -
-grunt build
-
-Current Library Versions: - -- Bootstrap: 3.3.5 -- jQuery: 2.1.4 -- Typeahead: 0.11.1 - -Libraries for testing go in the **/lib** directory. - -## History -- 0.8.0 - - [Add possibility skip "change" event after "add", "remove", "removeAll"](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/429) - - [Please add version to header of non-minified version.](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/438) -- 0.7.1 - - [allowDuplicates not working](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/419) - - [tag text appears when typeahead input looses focus](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/386) - - [Remove duplicate method `removeAll` in manual](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/427) -- 0.7.0 - - [.tt-menu etc. styles should be included in bootstrap-tagsinput.css by default](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/426) - - [Comma character carried over to new tag input when used as separator](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/422) - - [Emails in multi select are being duplicated](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/399) - - [The 'itemAdded' Event run on Load the Page!](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/369) -- 0.6.1 - - [Source maps fix](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/371) -- 0.6.0 - - [Allow form submissions when pressing enter if field is empty. Controlled by option](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/368) - - [Ability to set different or multiple delimiters](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/397) - - [No longer triggering itemRemoved when the field is already empty](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/405) -- 0.5 - - [Added an optional 3rd parameter to the "add" and "remove" methods](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/298) -- 0.4 - - [Fix typeahead when using Bootstrap 3](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/73) -- 0.3.13 - - [#5: Trigger events on original input/select](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/5) - - Loads of fixes merged with help of @janvt, @rlidwka and @kuraga: thanks for helping me out! -- 0.3.9 - - [#48: Type ahead stops when entering second character](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/48) -- 0.3.8 - - [#43: Add support for placeholder](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/43) - - [#46: ie 8 compatibility, replace indexOf method](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/46) -- 0.3.7 - - [#39: flash when duplicate is entered](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/39) -- 0.3.6 - - [#34: Error in ReloadPage](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/34) -- 0.3.5 - - [#10: confirmKeys option](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/10) -- 0.3.4 - - [#24: Add bsTagsInput angular directive & example for bootstrap3 with typeahea...](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/24) - - [#28: Limit number of tags, enable/disable input](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/28) - - [#33: Avoid conflict with other selects when checking for value presence](https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/pull/33) - -## License -This project is licensed under [MIT](https://raw.github.com/bootstrap-tagsinput/bootstrap-tagsinput/master/LICENSE "Read more about the MIT license"). diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/bootstrap-tagsinput.jquery.json b/static/bootstrap/js/bootstrap-tagsinput-master/bootstrap-tagsinput.jquery.json deleted file mode 100644 index ac64c17..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/bootstrap-tagsinput.jquery.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "bootstrap-tagsinput", - "version": "0.8.0", - "title": "Bootstrap Tags Input", - "author": { - "name": "Tim Schlechter" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://opensource.org/licenses/MIT" - } - ], - "dependencies": { - "jquery": "*" - }, - "description": "jQuery plugin providing a Twitter Bootstrap user interface for managing tags.", - "keywords": [ - "tags", - "bootstrap", - "input", - "select", - "form" - ], - "download": "http://timschlechter.github.io/bootstrap-tagsinput/build/bootstrap-tagsinput.zip", - "homepage": "http://timschlechter.github.io/bootstrap-tagsinput/examples/" -} \ No newline at end of file diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/bower.json b/static/bootstrap/js/bootstrap-tagsinput-master/bower.json deleted file mode 100644 index e44273c..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/bower.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "bootstrap-tagsinput", - "version": "0.5.0", - "homepage": "https://github.com/TimSchlechter/bootstrap-tagsinput", - "authors": [ - "Tim Schlechter", - "Luckner Jr Jean-Baptiste" - ], - "description": "jQuery plugin providing a Twitter Bootstrap user interface for managing tags.", - "main": [ - "dist/bootstrap-tagsinput.js", - "dist/bootstrap-tagsinput.css" - ], - "keywords": [ - "tags", - "bootstrap", - "input", - "select", - "form" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "lib", - "test" - ], - "dependencies": { - "jquery": "~2.1.1" - }, - "devDependencies": { - "bootstrap-3": "bootstrap#~3.2.0", - "bootstrap-2.3.2": "bootstrap#~2.3.2", - "angular": "~1.2.21", - "typeahead.js": "~0.10.4", - "jasmine": "~2.0.1" - }, - "resolutions": { - "jquery": ">= 1.9.0" - } -} diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/dist/bootstrap-tagsinput-angular.js b/static/bootstrap/js/bootstrap-tagsinput-master/dist/bootstrap-tagsinput-angular.js deleted file mode 100644 index b849848..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/dist/bootstrap-tagsinput-angular.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * bootstrap-tagsinput v0.8.0 - * - */ - -angular.module('bootstrap-tagsinput', []) -.directive('bootstrapTagsinput', [function() { - - function getItemProperty(scope, property) { - if (!property) - return undefined; - - if (angular.isFunction(scope.$parent[property])) - return scope.$parent[property]; - - return function(item) { - return item[property]; - }; - } - - return { - restrict: 'EA', - scope: { - model: '=ngModel' - }, - template: '', - replace: false, - link: function(scope, element, attrs) { - $(function() { - if (!angular.isArray(scope.model)) - scope.model = []; - - var select = $('select', element); - var typeaheadSourceArray = attrs.typeaheadSource ? attrs.typeaheadSource.split('.') : null; - var typeaheadSource = typeaheadSourceArray ? - (typeaheadSourceArray.length > 1 ? - scope.$parent[typeaheadSourceArray[0]][typeaheadSourceArray[1]] - : scope.$parent[typeaheadSourceArray[0]]) - : null; - - select.tagsinput(scope.$parent[attrs.options || ''] || { - typeahead : { - source : angular.isFunction(typeaheadSource) ? typeaheadSource : null - }, - itemValue: getItemProperty(scope, attrs.itemvalue), - itemText : getItemProperty(scope, attrs.itemtext), - confirmKeys : getItemProperty(scope, attrs.confirmkeys) ? JSON.parse(attrs.confirmkeys) : [13], - tagClass : angular.isFunction(scope.$parent[attrs.tagclass]) ? scope.$parent[attrs.tagclass] : function(item) { return attrs.tagclass; } - }); - - for (var i = 0; i < scope.model.length; i++) { - select.tagsinput('add', scope.model[i]); - } - - select.on('itemAdded', function(event) { - if (scope.model.indexOf(event.item) === -1) - scope.model.push(event.item); - }); - - select.on('itemRemoved', function(event) { - var idx = scope.model.indexOf(event.item); - if (idx !== -1) - scope.model.splice(idx, 1); - }); - - // create a shallow copy of model's current state, needed to determine - // diff when model changes - var prev = scope.model.slice(); - scope.$watch("model", function() { - var added = scope.model.filter(function(i) {return prev.indexOf(i) === -1;}), - removed = prev.filter(function(i) {return scope.model.indexOf(i) === -1;}), - i; - - prev = scope.model.slice(); - - // Remove tags no longer in binded model - for (i = 0; i < removed.length; i++) { - select.tagsinput('remove', removed[i]); - } - - // Refresh remaining tags - select.tagsinput('refresh'); - - // Add new items in model as tags - for (i = 0; i < added.length; i++) { - select.tagsinput('add', added[i]); - } - }, true); - }); - } - }; -}]); diff --git a/static/bootstrap/js/bootstrap-tagsinput-master/dist/bootstrap-tagsinput-angular.min.js b/static/bootstrap/js/bootstrap-tagsinput-master/dist/bootstrap-tagsinput-angular.min.js deleted file mode 100644 index a1aecbc..0000000 --- a/static/bootstrap/js/bootstrap-tagsinput-master/dist/bootstrap-tagsinput-angular.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * bootstrap-tagsinput v0.8.0 - * - */ - -angular.module("bootstrap-tagsinput",[]).directive("bootstrapTagsinput",[function(){function a(a,b){if(b)return angular.isFunction(a.$parent[b])?a.$parent[b]:function(a){return a[b]}}return{restrict:"EA",scope:{model:"=ngModel"},template:"",replace:!1,link:function(b,c,d){$(function(){angular.isArray(b.model)||(b.model=[]);var e=$("select",c),f=d.typeaheadSource?d.typeaheadSource.split("."):null,g=f?f.length>1?b.$parent[f[0]][f[1]]:b.$parent[f[0]]:null;e.tagsinput(b.$parent[d.options||""]||{typeahead:{source:angular.isFunction(g)?g:null},itemValue:a(b,d.itemvalue),itemText:a(b,d.itemtext),confirmKeys:a(b,d.confirmkeys)?JSON.parse(d.confirmkeys):[13],tagClass:angular.isFunction(b.$parent[d.tagclass])?b.$parent[d.tagclass]:function(a){return d.tagclass}});for(var h=0;h'); - this.$input = $('').appendTo(this.$container); - - this.$element.before(this.$container); - - this.build(options); - this.isInit = false; - } - - TagsInput.prototype = { - constructor: TagsInput, - - /** - * Adds the given item as a new tag. Pass true to dontPushVal to prevent - * updating the elements val() - */ - add: function(item, dontPushVal, options) { - var self = this; - - if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags) - return; - - // Ignore falsey values, except false - if (item !== false && !item) - return; - - // Trim value - if (typeof item === "string" && self.options.trimValue) { - item = $.trim(item); - } - - // Throw an error when trying to add an object while the itemValue option was not set - if (typeof item === "object" && !self.objectItems) - throw("Can't add objects when itemValue option is not set"); - - // Ignore strings only containg whitespace - if (item.toString().match(/^\s*$/)) - return; - - // If SELECT but not multiple, remove current tag - if (self.isSelect && !self.multiple && self.itemsArray.length > 0) - self.remove(self.itemsArray[0]); - - if (typeof item === "string" && this.$element[0].tagName === 'INPUT') { - var delimiter = (self.options.delimiterRegex) ? self.options.delimiterRegex : self.options.delimiter; - var items = item.split(delimiter); - if (items.length > 1) { - for (var i = 0; i < items.length; i++) { - this.add(items[i], true); - } - - if (!dontPushVal) - self.pushVal(self.options.triggerChange); - return; - } - } - - var itemValue = self.options.itemValue(item), - itemText = self.options.itemText(item), - tagClass = self.options.tagClass(item), - itemTitle = self.options.itemTitle(item); - - // Ignore items allready added - var existing = $.grep(self.itemsArray, function(item) { return self.options.itemValue(item) === itemValue; } )[0]; - if (existing && !self.options.allowDuplicates) { - // Invoke onTagExists - if (self.options.onTagExists) { - var $existingTag = $(".tag", self.$container).filter(function() { return $(this).data("item") === existing; }); - self.options.onTagExists(item, $existingTag); - } - return; - } - - // if length greater than limit - if (self.items().toString().length + item.length + 1 > self.options.maxInputLength) - return; - - // raise beforeItemAdd arg - var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false, options: options}); - self.$element.trigger(beforeItemAddEvent); - if (beforeItemAddEvent.cancel) - return; - - // register item in internal array and map - self.itemsArray.push(item); - - // add a tag element - - var $tag = $('' + htmlEncode(itemText) + ''); - $tag.data('item', item); - self.findInputWrapper().before($tag); - $tag.after(' '); - - // Check to see if the tag exists in its raw or uri-encoded form - var optionExists = ( - $('option[value="' + encodeURIComponent(itemValue) + '"]', self.$element).length || - $('option[value="' + htmlEncode(itemValue) + '"]', self.$element).length - ); - - // add