// Comment tagging // Detect the first couple of characters during tagging and pass it to the TaggingLookup function, which will provide // some suggestions to the user. var TaggingLastResult=""; // Store the last suggested result set and only update the UI when the response changes. function TaggingProcess(object) { // Look for the @ sign var atsign=object.value.lastIndexOf('@'); var lastspace=object.value.lastIndexOf(' '); if (atsign>-1 && lastspace=2) {TaggingLookup(object,taggingname);} else {TaggingStop(object);} } else { // No longer tagging, cancel any tagging hints TaggingStop(object); } } // Search for taggingname in the users function TaggingLookup(object,taggingname) { // Call API to get a list of matching users and call TaggingSuggest on each returned matching user record to suggest them. api('get_users',{"find":taggingname},function(response) { var s = JSON.stringify(response); if (s!=TaggingLastResult) // The results have changed. Update! { TaggingStop(object); for (var n=0;n