diff --git a/.gitignore b/.gitignore index 33f0a93..c32beda 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,7 @@ term.js/example/ term.js/index.js term.js/lib/ term.js/.npmignore + +# Bootstrap-tags excludes +bootstrap-tags/Guardfile +bootstrap-tags/sass/*.scss diff --git a/bootstrap-tags/.bower.json b/bootstrap-tags/.bower.json new file mode 100644 index 0000000..152d8fd --- /dev/null +++ b/bootstrap-tags/.bower.json @@ -0,0 +1,45 @@ +{ + "name": "bootstrap-tags", + "version": "1.1.5", + "homepage": "http://github.com/maxwells/bootstrap-tags", + "bugs": "https://github.com/maxwells/bootstrap-tags/issues", + "authors": [ + "Max Lahey " + ], + "description": "Boostrap-themed jquery tag interface", + "main": [ + "dist/js/bootstrap-tags.js", + "dist/css/bootstrap-tags.css" + ], + "keywords": [ + "jquery", + "bootstrap", + "bootstrap3", + "tagging", + "tags", + "typeahead", + "autocomplete" + ], + "license": "MIT", + "ignore": [ + "src", + "spec", + "*.html" + ], + "dependencies": { + "jquery": ">=1.9.0", + "bootstrap": ">=2.3.2" + }, + "scripts": { + "test": "grunt jasmine" + }, + "_release": "1.1.5", + "_resolution": { + "type": "version", + "tag": "1.1.5", + "commit": "893dd88dcc0d2c9fb1ee72b882830085ef748e7c" + }, + "_source": "git://github.com/maxwells/bootstrap-tags.git", + "_target": "~1.1", + "_originalSource": "bootstrap-tags" +} \ No newline at end of file diff --git a/bootstrap-tags/LICENSE b/bootstrap-tags/LICENSE new file mode 100644 index 0000000..ca1f3e9 --- /dev/null +++ b/bootstrap-tags/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2014 Max Lahey + +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/bootstrap-tags/README.md b/bootstrap-tags/README.md new file mode 100644 index 0000000..159e517 --- /dev/null +++ b/bootstrap-tags/README.md @@ -0,0 +1,147 @@ +# Bootstrap Tags + +Bootstrap Tags is a jQuery plugin meant to extend Twitter Bootstrap to include tagging functionality. It supports Bootstrap 2.3.2 and ≥ 3.0. + +[![Build Status](https://travis-ci.org/maxwells/bootstrap-tags.png?branch=master)](https://travis-ci.org/maxwells/bootstrap-tags) + +## Demo +[http://maxwells.github.com/bootstrap-tags.html](http://maxwells.github.com/bootstrap-tags.html) + +## Installation + + $ bower install bootstrap-tags + +or + + $ git clone https://github.com/maxwells/bootstrap-tags.git + --> js files are located in dist/js, CSS in dist/css + +## Features +- Support for Bootstrap 2.3.2 and 3+ +- Autosuggest (for typing or activated by pressing the down key when empty) +- Bootstrap Popovers (for extended information on a tag) +- Exclusions (denial of a specified list) +- Filters (allowance of only a specified list) +- Placeholder prompts +- Uses bootstrap button-[type] class styling (customizing your bootstrap will change tag styles accordingly) +- Extensible with custom functions (eg, before/after tag addition/deletion, key presses, exclusions) + +## Usage + + + + + +
+ + +## Documentation + +### Settings + +The following options are supported. Pass them as a javascript object to the `tags` jQuery function: + +```javascript +$('selector').tags({ + readOnly: true, + tagData: ["a", "prepopulated", "list", "of", tags], + beforeAddingTag: function(tag){ console.log(tag); } +}); +``` + +option | type | description | default +-------|------|-------------|--------- +`bootstrapVersion` | `String` | specify which version of bootstrap to format generated HTML for. Acceptable values are "2", "3" | `3` +`tagData` | `Array` | a list of tags to initialize the tagging interace with | `[]` +`tagSize` | `String` | describes what size input to use. Acceptable values are "lg", "md", or "sm" | `md` +`readOnly` | `boolean` | whether or not to disable user input | `false` +`suggestions` | `Array` | a list of terms that will populate the autosuggest feature when a user types in the first character. | `[]` +`caseInsensitive` | `Boolean` | whether or not autosuggest should ignore case sensitivity | `false` +`restrictTo` | `Array` | a list of allowed tags (will be combined with suggestions, if provided). User inputted tags that aren't included in this list will be ignored | `[]` +`exclude` | `Array` | a list of case insensitive disallowed tags. Supports wildcarding (eg. `['*offensive*']` will ignore any word that has `offensive` in it) | `[]` +`popoverData` | `Array` | a list of popover data. The index of each element should match the index of corresponding tag in `tagData` array | `null` +`popovers` | `Boolean` | whether or not to enable bootstrap popovers on tag mouseover | whether `popoverData` was provided +`popoverTrigger` | `String` | indicates how popovers should be triggered. Acceptable values are 'click', 'hover', 'hoverShowClickHide' | `hover` +`tagClass` | `String` | which class the tag div will have for styling | `btn-info` +`promptText` | `String` | placeholder string when there are no tags and nothing typed in | `Enter tags…` +`maxNumTags` | `Integer` | Maximum number of allowable (user-added) tags. All tags that are initialized in the tagData property are retained. If set, then input is disabled when the number of tags exceeds this value. | `-1` (no limit) +`readOnlyEmptyMessage` | `String` | text to be displayed if there are no tags in readonly mode. Can be HTML | `No tags to display...` +`beforeAddingTag` | `function(String tag)` | anything external you'd like to do with the tag before adding it. Returning false will stop tag from being added | `null` +`afterAddingTag` | `function(String tag)` | anything external you'd like to do with the tag after adding it | `null` +`beforeDeletingTag` | `function(String tag)` | find out which tag is about to be deleted. Returning false will stop tag from being deleted | `null` +`afterDeletingTag` | `function(String tag)` | find out which tag was removed by either pressing delete key or clicking the (x) | `null` +`definePopover` | `function(String tag)` | must return the popover content for the tag that is being added. (eg "Content for [tag]") | `null` +`excludes` | `function(String tag)` | return true if you want the tag to be excluded, false if allowed | `null` + +### Controlling tags +Some functions are chainable (returns a `Tagger` object), and can be used to move the data around outside of the plugin. + +function | return type | description +---------|-------------|------------- +`hasTag(tag:string)` | `Boolean` | whether tag is in tag list +`getTags()` | `Array` | a list of tags currently in the interface +`getTagsWithContent()` | `Array` | a list of javascript objects with a `tag` property and `content` property +`getTag(tag:string)` | `String` | returns tag as string +`getTagWithContent(tag:string)` | `Object` | returns object with `tag` and `content` property (popover) +`addTag(tag:string)` | `Tagger` | add a tag +`renameTag(tag:string, newTag:string)` | `Tagger` | rename one tag to another value +`removeLastTag()` | `Tagger` | removes last tag if it exists +`removeTag(tag:string)` | `Tagger` | removes tag specified by string if it exists +`addTagWithContent(tag:string, popoverContent:string)` | `Tagger` | Add a tag with associated popover content +`setPopover(tag:string, popoverContent:string)` | `Tagger` | update a tag's associated popover content, if that tag exists + +Example: + +```javascript +var tags = $('#one').tags( { + suggestions : ["here", "are", "some", "suggestions"], + popoverData : ["What a wonderful day", "to make some stuff", "up so that I", "can show it works"], + tagData: ["tag a", "tag b", "tag c", "tag d"], + excludeList : ["excuse", "my", "vulgarity"], +} ); +tags.addTag("tag e!!").removeTag("tag b").setPopover("tag c", "Changed popover content"); +console.log(tags.getTags()); +``` + +To reference a tags instance that you've already attached to a selector, (eg. $(selector).tags(options)) you can use $(selector).tags() or $(selector).tags(index) + +### Building + +For a one off: + + $ grunt build + +_To build continously_: + + $ grunt watch + +### Testing + + $ grunt test + +### Contributing + +If you spot a bug, experience browser incompatibility, or have feature requests, please submit them [here](https://github.com/maxwells/bootstrap-tags/issues). + +If you want to hack away to provide a new feature/bug-fix, please follow these guidelines: + +- Make changes to the coffeescript and sass files, not js/css. This is to ensure that the next person who comes in and edits upstream from js/css will not overwrite your changes. +- Create a pull request for your feature branch, updating README documentation if necessary + +### License + +This project rocks and uses the MIT-LICENSE. + +### Author + +Max Lahey diff --git a/bootstrap-tags/bower.json b/bootstrap-tags/bower.json new file mode 100644 index 0000000..e9e633a --- /dev/null +++ b/bootstrap-tags/bower.json @@ -0,0 +1,36 @@ +{ + "name": "bootstrap-tags", + "version": "1.1.3", + "homepage": "http://github.com/maxwells/bootstrap-tags", + "bugs": "https://github.com/maxwells/bootstrap-tags/issues", + "authors": [ + "Max Lahey " + ], + "description": "Boostrap-themed jquery tag interface", + "main": [ + "dist/js/bootstrap-tags.js", + "dist/css/bootstrap-tags.css" + ], + "keywords": [ + "jquery", + "bootstrap", + "bootstrap3", + "tagging", + "tags", + "typeahead", + "autocomplete" + ], + "license": "MIT", + "ignore": [ + "src", + "spec", + "*.html" + ], + "dependencies": { + "jquery": ">=1.9.0", + "bootstrap": ">=2.3.2" + }, + "scripts": { + "test": "grunt jasmine" + } +} \ No newline at end of file diff --git a/bootstrap-tags/dist/css/bootstrap-tags.css b/bootstrap-tags/dist/css/bootstrap-tags.css new file mode 100644 index 0000000..c3269b6 --- /dev/null +++ b/bootstrap-tags/dist/css/bootstrap-tags.css @@ -0,0 +1,78 @@ +/* bootstrap-tags styles */ +.bootstrap-tags.bootstrap-3 .tag a { + margin: 0 0 0 .3em; } +.bootstrap-tags.bootstrap-3 .glyphicon-white { + color: #fff; } + +.bootstrap-tags.bootstrap-2 .tag.md { + padding: .3em .4em .4em; } +.bootstrap-tags.bootstrap-2 .tag.lg { + padding: .4em .4em .5em; } + +.bootstrap-tags { + position: relative; } + .bootstrap-tags .tags { + width: inherit; + height: 0; + position: absolute; + padding: 0; + margin: 0; } + .bootstrap-tags .tag-data { + display: none; } + .bootstrap-tags .tags-input { + width: 100%; + margin: 0; + padding: 0; + height: 1.7em; + box-sizing: content-box; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; } + .bootstrap-tags .tag-list { + width: 280px; + height: auto; + min-height: 26px; + left: 2px; + top: 2px; + position: relative; } + .bootstrap-tags .tag { + padding: .4em .4em .4em; + margin: 0 .1em; + float: left; } + .bootstrap-tags .tag.sm { + padding: .4em .4em .5em; + font-size: 12px; } + .bootstrap-tags .tag.md { + font-size: 14px; } + .bootstrap-tags .tag.lg { + font-size: 18px; + padding: .4em .4em .4em; + margin: 0 .2em .2em 0; } + .bootstrap-tags .tag a { + color: #bbb; + cursor: pointer; + opacity: .5; } + .bootstrap-tags .tag .remove { + vertical-align: bottom; + top: 0; } + .bootstrap-tags ul.tags-suggestion-list { + width: 300px; + height: auto; + list-style: none; + margin: 0; + z-index: 2; + max-height: 160px; + overflow: scroll; } + .bootstrap-tags ul.tags-suggestion-list li.tags-suggestion { + padding: 3px 20px; + height: auto; } + .bootstrap-tags ul.tags-suggestion-list li.tags-suggestion-highlighted { + color: white; + text-decoration: none; + background-color: #0081C2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); } diff --git a/bootstrap-tags/dist/js/bootstrap-tags.js b/bootstrap-tags/dist/js/bootstrap-tags.js new file mode 100644 index 0000000..d13ad03 --- /dev/null +++ b/bootstrap-tags/dist/js/bootstrap-tags.js @@ -0,0 +1,622 @@ +/*! + * bootstrap-tags 1.1.0 + * https://github.com/maxwells/bootstrap-tags + * Copyright 2013 Max Lahey; Licensed MIT + */ + +(function($) { + (function() { + window.Tags || (window.Tags = {}); + jQuery(function() { + $.tags = function(element, options) { + var key, tag, tagData, value, _i, _len, _ref, _this = this; + if (options == null) { + options = {}; + } + for (key in options) { + value = options[key]; + this[key] = value; + } + this.bootstrapVersion || (this.bootstrapVersion = "3"); + this.readOnly || (this.readOnly = false); + this.suggestOnClick || (this.suggestOnClick = false); + this.suggestions || (this.suggestions = []); + this.restrictTo = options.restrictTo != null ? options.restrictTo.concat(this.suggestions) : false; + this.exclude || (this.exclude = false); + this.displayPopovers = options.popovers != null ? true : options.popoverData != null; + this.popoverTrigger || (this.popoverTrigger = "hover"); + this.tagClass || (this.tagClass = "btn-info"); + this.tagSize || (this.tagSize = "md"); + this.promptText || (this.promptText = "Enter tags..."); + this.caseInsensitive || (this.caseInsensitive = false); + this.readOnlyEmptyMessage || (this.readOnlyEmptyMessage = "No tags to display..."); + this.maxNumTags || (this.maxNumTags = -1); + this.beforeAddingTag || (this.beforeAddingTag = function(tag) {}); + this.afterAddingTag || (this.afterAddingTag = function(tag) {}); + this.beforeDeletingTag || (this.beforeDeletingTag = function(tag) {}); + this.afterDeletingTag || (this.afterDeletingTag = function(tag) {}); + this.definePopover || (this.definePopover = function(tag) { + return 'associated content for "' + tag + '"'; + }); + this.excludes || (this.excludes = function() { + return false; + }); + this.tagRemoved || (this.tagRemoved = function(tag) {}); + this.pressedReturn || (this.pressedReturn = function(e) {}); + this.pressedDelete || (this.pressedDelete = function(e) {}); + this.pressedDown || (this.pressedDown = function(e) {}); + this.pressedUp || (this.pressedUp = function(e) {}); + this.$element = $(element); + if (options.tagData != null) { + this.tagsArray = options.tagData; + } else { + tagData = $(".tag-data", this.$element).html(); + this.tagsArray = tagData != null ? tagData.split(",") : []; + } + if (options.popoverData) { + this.popoverArray = options.popoverData; + } else { + this.popoverArray = []; + _ref = this.tagsArray; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + tag = _ref[_i]; + this.popoverArray.push(null); + } + } + this.getTags = function() { + return _this.tagsArray; + }; + this.getTagsContent = function() { + return _this.popoverArray; + }; + this.getTagsWithContent = function() { + var combined, i, _j, _ref1; + combined = []; + for (i = _j = 0, _ref1 = _this.tagsArray.length - 1; 0 <= _ref1 ? _j <= _ref1 : _j >= _ref1; i = 0 <= _ref1 ? ++_j : --_j) { + combined.push({ + tag: _this.tagsArray[i], + content: _this.popoverArray[i] + }); + } + return combined; + }; + this.getTag = function(tag) { + var index; + index = _this.tagsArray.indexOf(tag); + if (index > -1) { + return _this.tagsArray[index]; + } else { + return null; + } + }; + this.getTagWithContent = function(tag) { + var index; + index = _this.tagsArray.indexOf(tag); + return { + tag: _this.tagsArray[index], + content: _this.popoverArray[index] + }; + }; + this.hasTag = function(tag) { + return _this.tagsArray.indexOf(tag) > -1; + }; + this.removeTagClicked = function(e) { + if (e.currentTarget.tagName === "A") { + _this.removeTag($("span", e.currentTarget.parentElement).html()); + $(e.currentTarget.parentNode).remove(); + } + return _this; + }; + this.removeLastTag = function() { + if (_this.tagsArray.length > 0) { + _this.removeTag(_this.tagsArray[_this.tagsArray.length - 1]); + if (_this.canAddByMaxNum()) { + _this.enableInput(); + } + } + return _this; + }; + this.removeTag = function(tag) { + if (_this.tagsArray.indexOf(tag) > -1) { + if (_this.beforeDeletingTag(tag) === false) { + return; + } + _this.popoverArray.splice(_this.tagsArray.indexOf(tag), 1); + _this.tagsArray.splice(_this.tagsArray.indexOf(tag), 1); + _this.renderTags(); + _this.afterDeletingTag(tag); + if (_this.canAddByMaxNum()) { + _this.enableInput(); + } + } + return _this; + }; + this.canAddByRestriction = function(tag) { + return this.restrictTo === false || this.restrictTo.indexOf(tag) !== -1; + }; + this.canAddByExclusion = function(tag) { + return (this.exclude === false || this.exclude.indexOf(tag) === -1) && !this.excludes(tag); + }; + this.canAddByMaxNum = function() { + return this.maxNumTags === -1 || this.tagsArray.length < this.maxNumTags; + }; + this.addTag = function(tag) { + var associatedContent; + if (_this.canAddByRestriction(tag) && !_this.hasTag(tag) && tag.length > 0 && _this.canAddByExclusion(tag) && _this.canAddByMaxNum()) { + if (_this.beforeAddingTag(tag) === false) { + return; + } + associatedContent = _this.definePopover(tag); + _this.popoverArray.push(associatedContent || null); + _this.tagsArray.push(tag); + _this.afterAddingTag(tag); + _this.renderTags(); + if (!_this.canAddByMaxNum()) { + _this.disableInput(); + } + } + return _this; + }; + this.addTagWithContent = function(tag, content) { + if (_this.canAddByRestriction(tag) && !_this.hasTag(tag) && tag.length > 0) { + if (_this.beforeAddingTag(tag) === false) { + return; + } + _this.tagsArray.push(tag); + _this.popoverArray.push(content); + _this.afterAddingTag(tag); + _this.renderTags(); + } + return _this; + }; + this.renameTag = function(name, newName) { + _this.tagsArray[_this.tagsArray.indexOf(name)] = newName; + _this.renderTags(); + return _this; + }; + this.setPopover = function(tag, popoverContent) { + _this.popoverArray[_this.tagsArray.indexOf(tag)] = popoverContent; + _this.renderTags(); + return _this; + }; + this.clickHandler = function(e) { + return _this.makeSuggestions(e, true); + }; + this.keyDownHandler = function(e) { + var k, numSuggestions; + k = e.keyCode != null ? e.keyCode : e.which; + switch (k) { + case 13: + e.preventDefault(); + _this.pressedReturn(e); + tag = e.target.value; + if (_this.suggestedIndex !== -1) { + tag = _this.suggestionList[_this.suggestedIndex]; + } + _this.addTag(tag); + e.target.value = ""; + _this.renderTags(); + return _this.hideSuggestions(); + + case 46: + case 8: + _this.pressedDelete(e); + if (e.target.value === "") { + _this.removeLastTag(); + } + if (e.target.value.length === 1) { + return _this.hideSuggestions(); + } + break; + + case 40: + _this.pressedDown(e); + if (_this.input.val() === "" && (_this.suggestedIndex === -1 || _this.suggestedIndex == null)) { + _this.makeSuggestions(e, true); + } + numSuggestions = _this.suggestionList.length; + _this.suggestedIndex = _this.suggestedIndex < numSuggestions - 1 ? _this.suggestedIndex + 1 : numSuggestions - 1; + _this.selectSuggested(_this.suggestedIndex); + if (_this.suggestedIndex >= 0) { + return _this.scrollSuggested(_this.suggestedIndex); + } + break; + + case 38: + _this.pressedUp(e); + _this.suggestedIndex = _this.suggestedIndex > 0 ? _this.suggestedIndex - 1 : 0; + _this.selectSuggested(_this.suggestedIndex); + if (_this.suggestedIndex >= 0) { + return _this.scrollSuggested(_this.suggestedIndex); + } + break; + + case 9: + case 27: + _this.hideSuggestions(); + return _this.suggestedIndex = -1; + } + }; + this.keyUpHandler = function(e) { + var k; + k = e.keyCode != null ? e.keyCode : e.which; + if (k !== 40 && k !== 38 && k !== 27) { + return _this.makeSuggestions(e, false); + } + }; + this.getSuggestions = function(str, overrideLengthCheck) { + var _this = this; + this.suggestionList = []; + if (this.caseInsensitive) { + str = str.toLowerCase(); + } + $.each(this.suggestions, function(i, suggestion) { + var suggestionVal; + suggestionVal = _this.caseInsensitive ? suggestion.substring(0, str.length).toLowerCase() : suggestion.substring(0, str.length); + if (_this.tagsArray.indexOf(suggestion) < 0 && suggestionVal === str && (str.length > 0 || overrideLengthCheck)) { + return _this.suggestionList.push(suggestion); + } + }); + return this.suggestionList; + }; + this.makeSuggestions = function(e, overrideLengthCheck, val) { + if (val == null) { + val = e.target.value != null ? e.target.value : e.target.textContent; + } + _this.suggestedIndex = -1; + _this.$suggestionList.html(""); + $.each(_this.getSuggestions(val, overrideLengthCheck), function(i, suggestion) { + return _this.$suggestionList.append(_this.template("tags_suggestion", { + suggestion: suggestion + })); + }); + _this.$(".tags-suggestion").mouseover(_this.selectSuggestedMouseOver); + _this.$(".tags-suggestion").click(_this.suggestedClicked); + if (_this.suggestionList.length > 0) { + return _this.showSuggestions(); + } else { + return _this.hideSuggestions(); + } + }; + this.suggestedClicked = function(e) { + tag = e.target.textContent; + if (_this.suggestedIndex !== -1) { + tag = _this.suggestionList[_this.suggestedIndex]; + } + _this.addTag(tag); + _this.input.val(""); + _this.makeSuggestions(e, false, ""); + _this.input.focus(); + return _this.hideSuggestions(); + }; + this.hideSuggestions = function() { + return _this.$(".tags-suggestion-list").css({ + display: "none" + }); + }; + this.showSuggestions = function() { + return _this.$(".tags-suggestion-list").css({ + display: "block" + }); + }; + this.selectSuggestedMouseOver = function(e) { + $(".tags-suggestion").removeClass("tags-suggestion-highlighted"); + $(e.target).addClass("tags-suggestion-highlighted"); + $(e.target).mouseout(_this.selectSuggestedMousedOut); + return _this.suggestedIndex = _this.$(".tags-suggestion").index($(e.target)); + }; + this.selectSuggestedMousedOut = function(e) { + return $(e.target).removeClass("tags-suggestion-highlighted"); + }; + this.selectSuggested = function(i) { + var tagElement; + $(".tags-suggestion").removeClass("tags-suggestion-highlighted"); + tagElement = _this.$(".tags-suggestion").eq(i); + return tagElement.addClass("tags-suggestion-highlighted"); + }; + this.scrollSuggested = function(i) { + var pos, tagElement, topElement, topPos; + tagElement = _this.$(".tags-suggestion").eq(i); + topElement = _this.$(".tags-suggestion").eq(0); + pos = tagElement.position(); + topPos = topElement.position(); + if (pos != null) { + return _this.$(".tags-suggestion-list").scrollTop(pos.top - topPos.top); + } + }; + this.adjustInputPosition = function() { + var pBottom, pLeft, pTop, pWidth, tagElement, tagPosition; + tagElement = _this.$(".tag").last(); + tagPosition = tagElement.position(); + pLeft = tagPosition != null ? tagPosition.left + tagElement.outerWidth(true) : 0; + pTop = tagPosition != null ? tagPosition.top : 0; + pWidth = _this.$element.width() - pLeft; + $(".tags-input", _this.$element).css({ + paddingLeft: Math.max(pLeft, 0), + paddingTop: Math.max(pTop, 0), + width: pWidth + }); + pBottom = tagPosition != null ? tagPosition.top + tagElement.outerHeight(true) : 22; + return _this.$element.css({ + paddingBottom: pBottom - _this.$element.height() + }); + }; + this.renderTags = function() { + var tagList; + tagList = _this.$(".tags"); + tagList.html(""); + _this.input.attr("placeholder", _this.tagsArray.length === 0 ? _this.promptText : ""); + $.each(_this.tagsArray, function(i, tag) { + tag = $(_this.formatTag(i, tag)); + $("a", tag).click(_this.removeTagClicked); + $("a", tag).mouseover(_this.toggleCloseColor); + $("a", tag).mouseout(_this.toggleCloseColor); + if (_this.displayPopovers) { + _this.initializePopoverFor(tag, _this.tagsArray[i], _this.popoverArray[i]); + } + return tagList.append(tag); + }); + return _this.adjustInputPosition(); + }; + this.renderReadOnly = function() { + var tagList; + tagList = _this.$(".tags"); + tagList.html(_this.tagsArray.length === 0 ? _this.readOnlyEmptyMessage : ""); + return $.each(_this.tagsArray, function(i, tag) { + tag = $(_this.formatTag(i, tag, true)); + if (_this.displayPopovers) { + _this.initializePopoverFor(tag, _this.tagsArray[i], _this.popoverArray[i]); + } + return tagList.append(tag); + }); + }; + this.disableInput = function() { + return this.$("input").prop("disabled", true); + }; + this.enableInput = function() { + return this.$("input").prop("disabled", false); + }; + this.initializePopoverFor = function(tag, title, content) { + options = { + title: title, + content: content, + placement: "bottom" + }; + if (_this.popoverTrigger === "hoverShowClickHide") { + $(tag).mouseover(function() { + $(tag).popover("show"); + return $(".tag").not(tag).popover("hide"); + }); + $(document).click(function() { + return $(tag).popover("hide"); + }); + } else { + options.trigger = _this.popoverTrigger; + } + return $(tag).popover(options); + }; + this.toggleCloseColor = function(e) { + var opacity, tagAnchor; + tagAnchor = $(e.currentTarget); + opacity = tagAnchor.css("opacity"); + opacity = opacity < .8 ? 1 : .6; + return tagAnchor.css({ + opacity: opacity + }); + }; + this.formatTag = function(i, tag, isReadOnly) { + var escapedTag; + if (isReadOnly == null) { + isReadOnly = false; + } + escapedTag = tag.replace("<", "<").replace(">", ">"); + return _this.template("tag", { + tag: escapedTag, + tagClass: _this.tagClass, + isPopover: _this.displayPopovers, + isReadOnly: isReadOnly, + tagSize: _this.tagSize + }); + }; + this.addDocumentListeners = function() { + return $(document).mouseup(function(e) { + var container; + container = _this.$(".tags-suggestion-list"); + if (container.has(e.target).length === 0) { + return _this.hideSuggestions(); + } + }); + }; + this.template = function(name, options) { + return Tags.Templates.Template(this.getBootstrapVersion(), name, options); + }; + this.$ = function(selector) { + return $(selector, this.$element); + }; + this.getBootstrapVersion = function() { + return Tags.bootstrapVersion || this.bootstrapVersion; + }; + this.initializeDom = function() { + return this.$element.append(this.template("tags_container")); + }; + this.init = function() { + this.$element.addClass("bootstrap-tags").addClass("bootstrap-" + this.getBootstrapVersion()); + this.initializeDom(); + if (this.readOnly) { + this.renderReadOnly(); + this.removeTag = function() {}; + this.removeTagClicked = function() {}; + this.removeLastTag = function() {}; + this.addTag = function() {}; + this.addTagWithContent = function() {}; + this.renameTag = function() {}; + return this.setPopover = function() {}; + } else { + this.input = $(this.template("input", { + tagSize: this.tagSize + })); + if (this.suggestOnClick) { + this.input.click(this.clickHandler); + } + this.input.keydown(this.keyDownHandler); + this.input.keyup(this.keyUpHandler); + this.$element.append(this.input); + this.$suggestionList = $(this.template("suggestion_list")); + this.$element.append(this.$suggestionList); + this.renderTags(); + if (!this.canAddByMaxNum()) { + this.disableInput(); + } + return this.addDocumentListeners(); + } + }; + this.init(); + return this; + }; + return $.fn.tags = function(options) { + var stopOn, tagsObject; + tagsObject = {}; + stopOn = typeof options === "number" ? options : -1; + this.each(function(i, el) { + var $el; + $el = $(el); + if ($el.data("tags") == null) { + $el.data("tags", new $.tags(this, options)); + } + if (stopOn === i || i === 0) { + return tagsObject = $el.data("tags"); + } + }); + return tagsObject; + }; + }); + }).call(this); + (function() { + window.Tags || (window.Tags = {}); + Tags.Helpers || (Tags.Helpers = {}); + Tags.Helpers.addPadding = function(string, amount, doPadding) { + if (amount == null) { + amount = 1; + } + if (doPadding == null) { + doPadding = true; + } + if (!doPadding) { + return string; + } + if (amount === 0) { + return string; + } + return Tags.Helpers.addPadding(" " + string + " ", amount - 1); + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates)["2"] || (_base["2"] = {}); + Tags.Templates["2"].input = function(options) { + var tagSize; + if (options == null) { + options = {}; + } + tagSize = function() { + switch (options.tagSize) { + case "sm": + return "small"; + + case "md": + return "medium"; + + case "lg": + return "large"; + } + }(); + return ""; + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates)["2"] || (_base["2"] = {}); + Tags.Templates["2"].tag = function(options) { + if (options == null) { + options = {}; + } + return "
" + Tags.Helpers.addPadding(options.tag, 2, options.isReadOnly) + " " + (options.isReadOnly ? "" : "") + "
"; + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates)["3"] || (_base["3"] = {}); + Tags.Templates["3"].input = function(options) { + if (options == null) { + options = {}; + } + return ""; + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates)["3"] || (_base["3"] = {}); + Tags.Templates["3"].tag = function(options) { + if (options == null) { + options = {}; + } + return "
" + Tags.Helpers.addPadding(options.tag, 2, options.isReadOnly) + " " + (options.isReadOnly ? "" : "") + "
"; + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates).shared || (_base.shared = {}); + Tags.Templates.shared.suggestion_list = function(options) { + if (options == null) { + options = {}; + } + return ''; + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates).shared || (_base.shared = {}); + Tags.Templates.shared.tags_container = function(options) { + if (options == null) { + options = {}; + } + return '
'; + }; + }).call(this); + (function() { + var _base; + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + (_base = Tags.Templates).shared || (_base.shared = {}); + Tags.Templates.shared.tags_suggestion = function(options) { + if (options == null) { + options = {}; + } + return "
  • " + options.suggestion + "
  • "; + }; + }).call(this); + (function() { + window.Tags || (window.Tags = {}); + Tags.Templates || (Tags.Templates = {}); + Tags.Templates.Template = function(version, templateName, options) { + if (Tags.Templates[version] != null) { + if (Tags.Templates[version][templateName] != null) { + return Tags.Templates[version][templateName](options); + } + } + return Tags.Templates.shared[templateName](options); + }; + }).call(this); +})(window.jQuery); \ No newline at end of file diff --git a/bootstrap-tags/dist/js/bootstrap-tags.min.js b/bootstrap-tags/dist/js/bootstrap-tags.min.js new file mode 100644 index 0000000..2fb1e2f --- /dev/null +++ b/bootstrap-tags/dist/js/bootstrap-tags.min.js @@ -0,0 +1,7 @@ +/*! + * bootstrap-tags 1.1.0 + * https://github.com/maxwells/bootstrap-tags + * Copyright 2013 Max Lahey; Licensed MIT + */ + +!function(a){!function(){window.Tags||(window.Tags={}),jQuery(function(){return a.tags=function(b,c){var d,e,f,g,h,i,j,k=this;null==c&&(c={});for(d in c)g=c[d],this[d]=g;if(this.bootstrapVersion||(this.bootstrapVersion="3"),this.readOnly||(this.readOnly=!1),this.suggestOnClick||(this.suggestOnClick=!1),this.suggestions||(this.suggestions=[]),this.restrictTo=null!=c.restrictTo?c.restrictTo.concat(this.suggestions):!1,this.exclude||(this.exclude=!1),this.displayPopovers=null!=c.popovers?!0:null!=c.popoverData,this.popoverTrigger||(this.popoverTrigger="hover"),this.tagClass||(this.tagClass="btn-info"),this.tagSize||(this.tagSize="md"),this.promptText||(this.promptText="Enter tags..."),this.caseInsensitive||(this.caseInsensitive=!1),this.readOnlyEmptyMessage||(this.readOnlyEmptyMessage="No tags to display..."),this.maxNumTags||(this.maxNumTags=-1),this.beforeAddingTag||(this.beforeAddingTag=function(){}),this.afterAddingTag||(this.afterAddingTag=function(){}),this.beforeDeletingTag||(this.beforeDeletingTag=function(){}),this.afterDeletingTag||(this.afterDeletingTag=function(){}),this.definePopover||(this.definePopover=function(a){return'associated content for "'+a+'"'}),this.excludes||(this.excludes=function(){return!1}),this.tagRemoved||(this.tagRemoved=function(){}),this.pressedReturn||(this.pressedReturn=function(){}),this.pressedDelete||(this.pressedDelete=function(){}),this.pressedDown||(this.pressedDown=function(){}),this.pressedUp||(this.pressedUp=function(){}),this.$element=a(b),null!=c.tagData?this.tagsArray=c.tagData:(f=a(".tag-data",this.$element).html(),this.tagsArray=null!=f?f.split(","):[]),c.popoverData)this.popoverArray=c.popoverData;else for(this.popoverArray=[],j=this.tagsArray,h=0,i=j.length;i>h;h++)e=j[h],this.popoverArray.push(null);return this.getTags=function(){return k.tagsArray},this.getTagsContent=function(){return k.popoverArray},this.getTagsWithContent=function(){var a,b,c,d;for(a=[],b=c=0,d=k.tagsArray.length-1;d>=0?d>=c:c>=d;b=d>=0?++c:--c)a.push({tag:k.tagsArray[b],content:k.popoverArray[b]});return a},this.getTag=function(a){var b;return b=k.tagsArray.indexOf(a),b>-1?k.tagsArray[b]:null},this.getTagWithContent=function(a){var b;return b=k.tagsArray.indexOf(a),{tag:k.tagsArray[b],content:k.popoverArray[b]}},this.hasTag=function(a){return k.tagsArray.indexOf(a)>-1},this.removeTagClicked=function(b){return"A"===b.currentTarget.tagName&&(k.removeTag(a("span",b.currentTarget.parentElement).html()),a(b.currentTarget.parentNode).remove()),k},this.removeLastTag=function(){return k.tagsArray.length>0&&(k.removeTag(k.tagsArray[k.tagsArray.length-1]),k.canAddByMaxNum()&&k.enableInput()),k},this.removeTag=function(a){if(k.tagsArray.indexOf(a)>-1){if(k.beforeDeletingTag(a)===!1)return;k.popoverArray.splice(k.tagsArray.indexOf(a),1),k.tagsArray.splice(k.tagsArray.indexOf(a),1),k.renderTags(),k.afterDeletingTag(a),k.canAddByMaxNum()&&k.enableInput()}return k},this.canAddByRestriction=function(a){return this.restrictTo===!1||-1!==this.restrictTo.indexOf(a)},this.canAddByExclusion=function(a){return(this.exclude===!1||-1===this.exclude.indexOf(a))&&!this.excludes(a)},this.canAddByMaxNum=function(){return-1===this.maxNumTags||this.tagsArray.length0&&k.canAddByExclusion(a)&&k.canAddByMaxNum()){if(k.beforeAddingTag(a)===!1)return;b=k.definePopover(a),k.popoverArray.push(b||null),k.tagsArray.push(a),k.afterAddingTag(a),k.renderTags(),k.canAddByMaxNum()||k.disableInput()}return k},this.addTagWithContent=function(a,b){if(k.canAddByRestriction(a)&&!k.hasTag(a)&&a.length>0){if(k.beforeAddingTag(a)===!1)return;k.tagsArray.push(a),k.popoverArray.push(b),k.afterAddingTag(a),k.renderTags()}return k},this.renameTag=function(a,b){return k.tagsArray[k.tagsArray.indexOf(a)]=b,k.renderTags(),k},this.setPopover=function(a,b){return k.popoverArray[k.tagsArray.indexOf(a)]=b,k.renderTags(),k},this.clickHandler=function(a){return k.makeSuggestions(a,!0)},this.keyDownHandler=function(a){var b,c;switch(b=null!=a.keyCode?a.keyCode:a.which){case 13:return a.preventDefault(),k.pressedReturn(a),e=a.target.value,-1!==k.suggestedIndex&&(e=k.suggestionList[k.suggestedIndex]),k.addTag(e),a.target.value="",k.renderTags(),k.hideSuggestions();case 46:case 8:if(k.pressedDelete(a),""===a.target.value&&k.removeLastTag(),1===a.target.value.length)return k.hideSuggestions();break;case 40:if(k.pressedDown(a),""!==k.input.val()||-1!==k.suggestedIndex&&null!=k.suggestedIndex||k.makeSuggestions(a,!0),c=k.suggestionList.length,k.suggestedIndex=k.suggestedIndex=0)return k.scrollSuggested(k.suggestedIndex);break;case 38:if(k.pressedUp(a),k.suggestedIndex=k.suggestedIndex>0?k.suggestedIndex-1:0,k.selectSuggested(k.suggestedIndex),k.suggestedIndex>=0)return k.scrollSuggested(k.suggestedIndex);break;case 9:case 27:return k.hideSuggestions(),k.suggestedIndex=-1}},this.keyUpHandler=function(a){var b;return b=null!=a.keyCode?a.keyCode:a.which,40!==b&&38!==b&&27!==b?k.makeSuggestions(a,!1):void 0},this.getSuggestions=function(b,c){var d=this;return this.suggestionList=[],this.caseInsensitive&&(b=b.toLowerCase()),a.each(this.suggestions,function(a,e){var f;return f=d.caseInsensitive?e.substring(0,b.length).toLowerCase():e.substring(0,b.length),d.tagsArray.indexOf(e)<0&&f===b&&(b.length>0||c)?d.suggestionList.push(e):void 0}),this.suggestionList},this.makeSuggestions=function(b,c,d){return null==d&&(d=null!=b.target.value?b.target.value:b.target.textContent),k.suggestedIndex=-1,k.$suggestionList.html(""),a.each(k.getSuggestions(d,c),function(a,b){return k.$suggestionList.append(k.template("tags_suggestion",{suggestion:b}))}),k.$(".tags-suggestion").mouseover(k.selectSuggestedMouseOver),k.$(".tags-suggestion").click(k.suggestedClicked),k.suggestionList.length>0?k.showSuggestions():k.hideSuggestions()},this.suggestedClicked=function(a){return e=a.target.textContent,-1!==k.suggestedIndex&&(e=k.suggestionList[k.suggestedIndex]),k.addTag(e),k.input.val(""),k.makeSuggestions(a,!1,""),k.input.focus(),k.hideSuggestions()},this.hideSuggestions=function(){return k.$(".tags-suggestion-list").css({display:"none"})},this.showSuggestions=function(){return k.$(".tags-suggestion-list").css({display:"block"})},this.selectSuggestedMouseOver=function(b){return a(".tags-suggestion").removeClass("tags-suggestion-highlighted"),a(b.target).addClass("tags-suggestion-highlighted"),a(b.target).mouseout(k.selectSuggestedMousedOut),k.suggestedIndex=k.$(".tags-suggestion").index(a(b.target))},this.selectSuggestedMousedOut=function(b){return a(b.target).removeClass("tags-suggestion-highlighted")},this.selectSuggested=function(b){var c;return a(".tags-suggestion").removeClass("tags-suggestion-highlighted"),c=k.$(".tags-suggestion").eq(b),c.addClass("tags-suggestion-highlighted")},this.scrollSuggested=function(a){var b,c,d,e;return c=k.$(".tags-suggestion").eq(a),d=k.$(".tags-suggestion").eq(0),b=c.position(),e=d.position(),null!=b?k.$(".tags-suggestion-list").scrollTop(b.top-e.top):void 0},this.adjustInputPosition=function(){var b,c,d,e,f,g;return f=k.$(".tag").last(),g=f.position(),c=null!=g?g.left+f.outerWidth(!0):0,d=null!=g?g.top:0,e=k.$element.width()-c,a(".tags-input",k.$element).css({paddingLeft:Math.max(c,0),paddingTop:Math.max(d,0),width:e}),b=null!=g?g.top+f.outerHeight(!0):22,k.$element.css({paddingBottom:b-k.$element.height()})},this.renderTags=function(){var b;return b=k.$(".tags"),b.html(""),k.input.attr("placeholder",0===k.tagsArray.length?k.promptText:""),a.each(k.tagsArray,function(c,d){return d=a(k.formatTag(c,d)),a("a",d).click(k.removeTagClicked),a("a",d).mouseover(k.toggleCloseColor),a("a",d).mouseout(k.toggleCloseColor),k.displayPopovers&&k.initializePopoverFor(d,k.tagsArray[c],k.popoverArray[c]),b.append(d)}),k.adjustInputPosition()},this.renderReadOnly=function(){var b;return b=k.$(".tags"),b.html(0===k.tagsArray.length?k.readOnlyEmptyMessage:""),a.each(k.tagsArray,function(c,d){return d=a(k.formatTag(c,d,!0)),k.displayPopovers&&k.initializePopoverFor(d,k.tagsArray[c],k.popoverArray[c]),b.append(d)})},this.disableInput=function(){return this.$("input").prop("disabled",!0)},this.enableInput=function(){return this.$("input").prop("disabled",!1)},this.initializePopoverFor=function(b,d,e){return c={title:d,content:e,placement:"bottom"},"hoverShowClickHide"===k.popoverTrigger?(a(b).mouseover(function(){return a(b).popover("show"),a(".tag").not(b).popover("hide")}),a(document).click(function(){return a(b).popover("hide")})):c.trigger=k.popoverTrigger,a(b).popover(c)},this.toggleCloseColor=function(b){var c,d;return d=a(b.currentTarget),c=d.css("opacity"),c=.8>c?1:.6,d.css({opacity:c})},this.formatTag=function(a,b,c){var d;return null==c&&(c=!1),d=b.replace("<","<").replace(">",">"),k.template("tag",{tag:d,tagClass:k.tagClass,isPopover:k.displayPopovers,isReadOnly:c,tagSize:k.tagSize})},this.addDocumentListeners=function(){return a(document).mouseup(function(a){var b;return b=k.$(".tags-suggestion-list"),0===b.has(a.target).length?k.hideSuggestions():void 0})},this.template=function(a,b){return Tags.Templates.Template(this.getBootstrapVersion(),a,b)},this.$=function(b){return a(b,this.$element)},this.getBootstrapVersion=function(){return Tags.bootstrapVersion||this.bootstrapVersion},this.initializeDom=function(){return this.$element.append(this.template("tags_container"))},this.init=function(){return this.$element.addClass("bootstrap-tags").addClass("bootstrap-"+this.getBootstrapVersion()),this.initializeDom(),this.readOnly?(this.renderReadOnly(),this.removeTag=function(){},this.removeTagClicked=function(){},this.removeLastTag=function(){},this.addTag=function(){},this.addTagWithContent=function(){},this.renameTag=function(){},this.setPopover=function(){}):(this.input=a(this.template("input",{tagSize:this.tagSize})),this.suggestOnClick&&this.input.click(this.clickHandler),this.input.keydown(this.keyDownHandler),this.input.keyup(this.keyUpHandler),this.$element.append(this.input),this.$suggestionList=a(this.template("suggestion_list")),this.$element.append(this.$suggestionList),this.renderTags(),this.canAddByMaxNum()||this.disableInput(),this.addDocumentListeners())},this.init(),this},a.fn.tags=function(b){var c,d;return d={},c="number"==typeof b?b:-1,this.each(function(e,f){var g;return g=a(f),null==g.data("tags")&&g.data("tags",new a.tags(this,b)),c===e||0===e?d=g.data("tags"):void 0}),d}})}.call(this),function(){window.Tags||(window.Tags={}),Tags.Helpers||(Tags.Helpers={}),Tags.Helpers.addPadding=function(a,b,c){return null==b&&(b=1),null==c&&(c=!0),c?0===b?a:Tags.Helpers.addPadding(" "+a+" ",b-1):a}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates)["2"]||(a["2"]={}),Tags.Templates["2"].input=function(a){var b;return null==a&&(a={}),b=function(){switch(a.tagSize){case"sm":return"small";case"md":return"medium";case"lg":return"large"}}(),""}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates)["2"]||(a["2"]={}),Tags.Templates["2"].tag=function(a){return null==a&&(a={}),"
    "+Tags.Helpers.addPadding(a.tag,2,a.isReadOnly)+" "+(a.isReadOnly?"":"")+"
    "}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates)["3"]||(a["3"]={}),Tags.Templates["3"].input=function(a){return null==a&&(a={}),""}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates)["3"]||(a["3"]={}),Tags.Templates["3"].tag=function(a){return null==a&&(a={}),"
    "+Tags.Helpers.addPadding(a.tag,2,a.isReadOnly)+" "+(a.isReadOnly?"":"")+"
    "}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates).shared||(a.shared={}),Tags.Templates.shared.suggestion_list=function(a){return null==a&&(a={}),''}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates).shared||(a.shared={}),Tags.Templates.shared.tags_container=function(a){return null==a&&(a={}),'
    '}}.call(this),function(){var a;window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),(a=Tags.Templates).shared||(a.shared={}),Tags.Templates.shared.tags_suggestion=function(a){return null==a&&(a={}),"
  • "+a.suggestion+"
  • "}}.call(this),function(){window.Tags||(window.Tags={}),Tags.Templates||(Tags.Templates={}),Tags.Templates.Template=function(a,b,c){return null!=Tags.Templates[a]&&null!=Tags.Templates[a][b]?Tags.Templates[a][b](c):Tags.Templates.shared[b](c)}}.call(this)}(window.jQuery); \ No newline at end of file diff --git a/bower.json b/bower.json index 0f50322..6df171b 100644 --- a/bower.json +++ b/bower.json @@ -4,6 +4,7 @@ "dependencies": { "backbone": "components/backbone#~1.1", "bootstrap": "components/bootstrap#~3.1", + "bootstrap-tags": "1.1", "bootstrap-tour": "0.9.0", "codemirror": "~4.6.0", "font-awesome": "components/font-awesome#~4.2.0",