Hello,
How can I add Admin/Mod color button on sceditor?
How can I add Admin/Mod color button on sceditor?
$(function() {
if (!$.sceditor || !_userdata.user_level) return;
var mods = {
'u1' : '#FF6600',
'u2' : '#FF0000',
'u3' : '#FFFF00',
'u4' : '#00FF00'
},
c = '#000000', i, u = 'u' + _userdata.user_id;
for (i in mods) {
if (i == u) {
c = mods[i];
break;
}
}
$.sceditor.command.set('modcolor', {
exec : function() { this.insert('[color=' + c + '][b]','[/b][/color]') },
txtExec : function() { this.insert('[color=' + c + '][b]','[/b][/color]') },
tooltip : 'Insert mod color'
});
toolbar += '|modcolor';
});
.sceditor-button-modcolor div {
background-image:url(http://i56.servimg.com/u/f56/18/45/41/65/mcolo10.png) !important;
}