diff --git a/bower.json b/bower.json index 1a3712e4..7f772b7e 100644 --- a/bower.json +++ b/bower.json @@ -12,7 +12,6 @@ "bootstrap": "~3.3.0", "mustache": "~0.8.2", "qrcode": "git://github.com/davidshimjs/qrcodejs.git#1c78ccd71", - "bootstrap-tagsinput": "~0.4.2", "cryptojs": "svn+http://crypto-js.googlecode.com/svn/#~3.1.2", "libphonenumber-api": "git://github.com/codedust/libphonenumber-api", "backbone.localstorage": "liliakai/Backbone.localStorage#master", @@ -60,10 +59,6 @@ "bootstrap": [ "dist/css/bootstrap.css" ], - "bootstrap-tagsinput": [ - "dist/bootstrap-tagsinput.js", - "dist/bootstrap-tagsinput.css" - ], "cryptojs": [ "src/core.js", "src/sha256.js", diff --git a/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css b/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css deleted file mode 100644 index 55f7c09d..00000000 --- a/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css +++ /dev/null @@ -1,46 +0,0 @@ -.bootstrap-tagsinput { - background-color: #fff; - border: 1px solid #ccc; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - display: inline-block; - padding: 4px 6px; - margin-bottom: 10px; - color: #555; - vertical-align: middle; - border-radius: 4px; - max-width: 100%; - line-height: 22px; - cursor: text; -} -.bootstrap-tagsinput input { - border: none; - box-shadow: none; - outline: none; - background-color: transparent; - padding: 0; - margin: 0; - width: auto !important; - max-width: inherit; -} -.bootstrap-tagsinput input:focus { - border: none; - box-shadow: none; -} -.bootstrap-tagsinput .tag { - margin-right: 2px; - color: white; -} -.bootstrap-tagsinput .tag [data-role="remove"] { - margin-left: 8px; - cursor: pointer; -} -.bootstrap-tagsinput .tag [data-role="remove"]:after { - content: "x"; - padding: 0px 2px; -} -.bootstrap-tagsinput .tag [data-role="remove"]:hover { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} -.bootstrap-tagsinput .tag [data-role="remove"]:hover:active { - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); -} diff --git a/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js b/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js deleted file mode 100644 index 515ac37f..00000000 --- a/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js +++ /dev/null @@ -1,617 +0,0 @@ -(function ($) { - "use strict"; - - var defaultOptions = { - tagClass: function(item) { - return 'label label-info'; - }, - itemValue: function(item) { - return item ? item.toString() : item; - }, - itemText: function(item) { - return this.itemValue(item); - }, - freeInput: true, - addOnBlur: true, - maxTags: undefined, - maxChars: undefined, - confirmKeys: [13, 44], - onTagExists: function(item, $tag) { - $tag.hide().fadeIn(); - }, - trimValue: false, - allowDuplicates: false - }; - - /** - * Constructor function - */ - function TagsInput(element, options) { - this.itemsArray = []; - - this.$element = $(element); - this.$element.hide(); - - this.isSelect = (element.tagName === 'SELECT'); - this.multiple = (this.isSelect && element.hasAttribute('multiple')); - this.objectItems = options && options.itemValue; - this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : ''; - this.inputSize = Math.max(1, this.placeholderText.length); - - this.$container = $('
'); - this.$input = $('').appendTo(this.$container); - - this.$element.after(this.$container); - - var inputWidth = (this.inputSize < 3 ? 3 : this.inputSize) + "em"; - this.$input.get(0).style.cssText = "width: " + inputWidth + " !important;"; - this.build(options); - } - - 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) { - 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 items = item.split(','); - if (items.length > 1) { - for (var i = 0; i < items.length; i++) { - this.add(items[i], true); - } - - if (!dontPushVal) - self.pushVal(); - return; - } - } - - var itemValue = self.options.itemValue(item), - itemText = self.options.itemText(item), - tagClass = self.options.tagClass(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 }); - 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(' '); - - // add