{I" class:ETI"BundledAsset; FI"logical_path; TI"jquery.taglist.js; FI" pathname; TI"q/usr/local/rvm/gems/ruby-2.1.2/bundler/gems/browsercms-a0b88590276e/app/assets/javascripts/jquery.taglist.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+æTI"length; TiÁI"digest; TI"%bc5e8b3062d52a6aa217066633cc7b71; FI"source; TI"Á/* jQuery taglist plugin Defines a widget for allowing users to selecting tags in BrowserCMS. This is part of the BrowserCMS core project. Please see the accompanying LICENSE.txt for licensing information. */ (function($){ $.fn.tagList = function(tags) { var tagListInput = this; var tagSeparator = " "; var getTagList = function() { return $('#'+$(tagListInput).attr('id')+'-tag-list'); } var getCurrentTag = function() { var value = $(tagListInput).val(); if(value == "" || value.match(/\s$/)) { return "" } else { var tags = value.split(tagSeparator) return tags[tags.length-1] } } var getSelectedTag = function() { return getTagList().find('li.selected') } var getFirstTag = function() { return getTagList().find('li:first') } var positionAndSizeTagList = function() { getTagList().css('top', $(tagListInput).offset().top+$(tagListInput).outerHeight()) .css('left', $(tagListInput).offset().left) .css('width', $(tagListInput).outerWidth()) } var createEmptyTagList = function() { var id = $(tagListInput).attr('id') + '-tag-list'; $(tagListInput).after('
') positionAndSizeTagList() } var matchesInputValue = function(tag, value) { return tag && value && (tag.toLowerCase().indexOf(value.toLowerCase()) == 0); } var showTagList = function(value) { var html = [] $.each(tags, function(i, tag){ if(matchesInputValue(tag, value)) { html.push('