/* jQuery Tags Input Revisited Plugin * * Copyright (c) Krzysztof Rusnarczyk * Licensed under the MIT license */ (function($) { var delimiter = []; var inputSettings = []; var callbacks = []; $.fn.addTag = function(value, options) { options = jQuery.extend({ focus: false, callback: true }, options); this.each(function() { var id = $(this).attr('id'); var tagslist = $(this).val().split(_getDelimiter(delimiter[id])); if (tagslist[0] === '') tagslist = []; value = jQuery.trim(value); if ((inputSettings[id].unique && $(this).tagExist(value)) || !_validateTag(value, inputSettings[id], tagslist, delimiter[id])) { $('#' + id + '_tag').addClass('error'); return false; } $('', {class: 'tag'}).append( $('', {class: 'tag-text'}).text(value), $('