{"id":13507393,"url":"https://github.com/maxwells/bootstrap-tags","last_synced_at":"2025-04-04T17:06:38.045Z","repository":{"id":5510497,"uuid":"6710916","full_name":"maxwells/bootstrap-tags","owner":"maxwells","description":"Bootstrap-themed jquery tag interface","archived":false,"fork":false,"pushed_at":"2017-04-27T09:58:11.000Z","size":465,"stargazers_count":546,"open_issues_count":23,"forks_count":132,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-03-28T16:06:02.384Z","etag":null,"topics":["unmaintained"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxwells.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-15T20:12:51.000Z","updated_at":"2025-02-25T18:32:00.000Z","dependencies_parsed_at":"2022-07-25T22:33:40.242Z","dependency_job_id":null,"html_url":"https://github.com/maxwells/bootstrap-tags","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxwells%2Fbootstrap-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxwells%2Fbootstrap-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxwells%2Fbootstrap-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxwells%2Fbootstrap-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxwells","download_url":"https://codeload.github.com/maxwells/bootstrap-tags/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217176,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["unmaintained"],"created_at":"2024-08-01T02:00:32.847Z","updated_at":"2025-04-04T17:06:38.021Z","avatar_url":"https://github.com/maxwells.png","language":"CoffeeScript","funding_links":[],"categories":["add-ons"],"sub_categories":["inputs"],"readme":"# Bootstrap Tags\n\nBootstrap Tags is a jQuery plugin meant to extend Twitter Bootstrap to include tagging functionality. It supports Bootstrap 2.3.2 and ≥ 3.0.\n\n[![Build Status](https://travis-ci.org/maxwells/bootstrap-tags.png?branch=master)](https://travis-ci.org/maxwells/bootstrap-tags)\n\n## Call for Maintainers\n\nIf you find this project useful and are interested in contributing or taking over, please add yourself to [https://github.com/maxwells/bootstrap-tags/issues/70](https://github.com/maxwells/bootstrap-tags/issues/70).\n\n## Demo\n[http://maxwells.github.com/bootstrap-tags.html](http://maxwells.github.com/bootstrap-tags.html)\n\n## Installation\n\n\t$ bower install bootstrap-tags\n\nor\n\n\t$ git clone https://github.com/maxwells/bootstrap-tags.git\n\t--\u003e js files are located in dist/js, CSS in dist/css\n\n## Features\n- Support for Bootstrap 2.3.2 and 3+\n- Autosuggest (for typing or activated by pressing the down key when empty)\n- Bootstrap Popovers (for extended information on a tag)\n- Exclusions (denial of a specified list)\n- Filters (allowance of only a specified list)\n- Placeholder prompts\n- Uses bootstrap button-[type] class styling (customizing your bootstrap will change tag styles accordingly)\n- Extensible with custom functions (eg, before/after tag addition/deletion, key presses, exclusions)\n\n## Usage\n\n\t\u003c!-- include bootstrap tags js, css files --\u003e\n\t\u003cscript src='path/to/bootstrap-tags/dist/js/bootstrap-tags.min.js'\u003e\u003c/script\u003e\n\t\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"path/to/bootstrap-tags/dist/css/bootstrap-tags.css\" /\u003e\n\n\t\u003cdiv id=\"my-tag-list\" class=\"tag-list\"\u003e\u003c/div\u003e\n\t\u003cscript\u003e\n\t\t$(function() {\n\t\t\t// If using Bootstrap 2, be sure to include:\n\t\t\t// Tags.bootstrapVersion = \"2\";\n\t\t\t$('#my-tag-list').tags({\n\t\t\t\ttagData:[\"boilerplate\", \"tags\"],\n\t\t\t\tsuggestions:[\"basic\", \"suggestions\"],\n\t\t\t\texcludeList:[\"not\", \"these\", \"words\"]\n\t\t\t});\n\t\t});\n\t\u003c/script\u003e\n\n## Documentation\n\n### Settings\n\nThe following options are supported. Pass them as a javascript object to the `tags` jQuery function:\n\n```javascript\n$('selector').tags({\n    readOnly: true,\n    tagData: [\"a\", \"prepopulated\", \"list\", \"of\", tags],\n    beforeAddingTag: function(tag){ console.log(tag); }\n});\n```\n\noption | type | description | default\n-------|------|-------------|---------\n`bootstrapVersion` | `String` | specify which version of bootstrap to format generated HTML for. Acceptable values are \"2\", \"3\" | `3`\n`tagData` | `Array` | a list of tags to initialize the tagging interface with | `[]`\n`tagSize` | `String` | describes what size input to use. Acceptable values are \"lg\", \"md\", or \"sm\" | `md`\n`readOnly` | `Boolean` | whether or not to disable user input | `false`\n`suggestions` | `Array` | a list of terms that will populate the autosuggest feature when a user types in the first character | `[]`\n`suggestOnClick` | `Boolean` | whether or not the autosuggest feature is triggered on click | `false`\n`caseInsensitive` | `Boolean` | whether or not autosuggest should ignore case sensitivity | `false`\n`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 | `[]`\n`exclude` | `Array` | a list of case insensitive disallowed tags. Supports wildcarding (eg. `['*offensive*']` will ignore any word that has `offensive` in it) | `[]`\n`popoverData` | `Array` | a list of popover data. The index of each element should match the index of corresponding tag in `tagData` array | `null`\n`popovers` | `Boolean` | whether or not to enable bootstrap popovers on tag mouseover | whether `popoverData` was provided\n`popoverTrigger` | `String` | indicates how popovers should be triggered. Acceptable values are 'click', 'hover', 'hoverShowClickHide' | `hover`\n`tagClass` | `String` | which class the tag div will have for styling | `btn-info`\n`promptText` | `String` | placeholder string when there are no tags and nothing typed in | `Enter tags…`\n`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)\n`readOnlyEmptyMessage` | `String` | text to be displayed if there are no tags in readonly mode. Can be HTML | `No tags to display...`\n`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`\n`afterAddingTag` | `function(String tag)` | anything external you'd like to do with the tag after adding it | `null`\n`beforeDeletingTag` | `function(String tag)` | find out which tag is about to be deleted. Returning false will stop tag from being deleted | `null`\n`afterDeletingTag` | `function(String tag)` | find out which tag was removed by either pressing delete key or clicking the (x) | `null`\n`definePopover` | `function(String tag)` | must return the popover content for the tag that is being added. (eg \"Content for [tag]\") | `null`\n`excludes` | `function(String tag)` | return true if you want the tag to be excluded, false if allowed | `null`\n\n### Controlling tags\nSome functions are chainable (returns a `Tagger` object), and can be used to move the data around outside of the plugin.\n\nfunction | return type | description\n---------|-------------|-------------\n`hasTag(tag:string)` | `Boolean` | whether tag is in tag list\n`getTags()` | `Array` | a list of tags currently in the interface\n`getTagsWithContent()` | `Array` | a list of javascript objects with a `tag` property and `content` property\n`getTag(tag:string)` | `String` | returns tag as string\n`getTagWithContent(tag:string)` | `Object` | returns object with `tag` and `content` property (popover)\n`addTag(tag:string)` | `Tagger` | add a tag\n`renameTag(tag:string, newTag:string)` | `Tagger` | rename one tag to another value\n`removeLastTag()` | `Tagger` | removes last tag if it exists\n`removeTag(tag:string)` | `Tagger` | removes tag specified by string if it exists\n`addTagWithContent(tag:string, popoverContent:string)` | `Tagger` | Add a tag with associated popover content\n`setPopover(tag:string, popoverContent:string)` | `Tagger` | update a tag's associated popover content, if that tag exists\n\nExample:\n\n```javascript\nvar tags = $('#one').tags( {\n\tsuggestions : [\"here\", \"are\", \"some\", \"suggestions\"],\n\tpopoverData : [\"What a wonderful day\", \"to make some stuff\", \"up so that I\", \"can show it works\"],\n\ttagData: [\"tag a\", \"tag b\", \"tag c\", \"tag d\"],\n\texcludeList : [\"excuse\", \"my\", \"vulgarity\"],\n} );\ntags.addTag(\"tag e!!\").removeTag(\"tag b\").setPopover(\"tag c\", \"Changed popover content\");\nconsole.log(tags.getTags());\n```\n\nTo 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)\n\n### Building\n\nFor a one off:\n\n\t$ grunt build\n\n_To build continuously_:\n\n\t$ grunt watch\n\n### Testing\n\n\t$ grunt test\n\n### Contributing\n\nIf you spot a bug, experience browser incompatibility, or have feature requests, please submit them [here](https://github.com/maxwells/bootstrap-tags/issues).\n\nIf you want to hack away to provide a new feature/bug-fix, please follow these guidelines:\n\n- 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.\n- Create a pull request for your feature branch, updating README documentation if necessary\n\n### License\n\nMIT.\n\n### Author\n\nMax Lahey\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxwells%2Fbootstrap-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxwells%2Fbootstrap-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxwells%2Fbootstrap-tags/lists"}