Sha256: 0bd2381081a2b2f83c4ba23818962ef2228dc8251045fefbe3507f6d32ca4ba7
Contents?: true
Size: 1.09 KB
Versions: 32
Compression:
Stored size: 1.09 KB
Contents
# Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ (($) -> window.crm ||= {} crm.textarea_user_autocomplete = (el_id) -> unless $("#areacomplete_" + el_id)[0] $("#" + el_id).areacomplete wordCount: 1 mode: "outter" on: query: (text, cb) -> # Only autocomplete if search term starts with '@' return [] unless text.indexOf("@") is 0 words = [] i = 0 while i < _ffcrm_users.length name_query = text.replace("@", "").toLowerCase() words.push _ffcrm_users[i] unless _ffcrm_users[i].toLowerCase().indexOf(name_query) is -1 i++ cb words, text.replace("@", "") selected: (text, data) -> username_regEx = new RegExp("\\((@[^)]+)\\)") text.match(username_regEx)[1] ) jQuery
Version data entries
32 entries across 32 versions & 2 rubygems