Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Help Required: Custom hardcoded text colors #183

@websterz

Description

@websterz

Hello,
I just started plugin development, and my first plugin is very simple which just replaces all the text messages according to roles, like for admins it will be red and for moderators it will be orange, and for normal users it will be black.

I have following code which adds simple text to the message but i am not able to get the roles of the users who sent message.

I tried different techniques but failed to get roles.

Here is my code, can any body suggest how do i get roles:

var CandyShop = (function(self) { return self; }(CandyShop || {}));

CandyShop.Roles = (function(self, Candy, $) {
	self.init = function init() {			
		$(Candy).on('candy:view.message.before-show', function(e, args) {			
			args.message = args.message+ ' - admin';// + self.Role();			
		});
	};
	return self;
}(CandyShop.Roles || {}, Candy, jQuery));

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions