Skip to content

AndreasKlein/user-targeting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

User-Targeting

Target user names in chat rooms with @[username].

Installation

$ component install AndreasKlein/user-targeting

Usage

<input type="text" id="input">

Initialize:

var $input = $('#input'),
getUserNames = function() { return ["John Doe", "Max Mustermann"]; },
dropdownView = UserTargeting.initDropdown($input, getUserNames);

Use targeting api:

var targeting = UserTargeting.targeting();

message = "Hi @John Doe and @Max Mustermann"
message = targeting.wrapUserNames(message, getUserNames(), "Max Mustermann");

if (targeting.referencesName(message, "John Doe")) {
	//do something hip
}

You can also use targeting.referencesEveryone or targeting.referencesNameOrEveryone

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published