The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How can I add Admin/Mod color button on sceditor?

View previous topic View next topic Go down

Solved How can I add Admin/Mod color button on sceditor?

Post by Van-Helsing on November 2nd 2015, 10:40 pm

Hello,
How can I add Admin/Mod color button on sceditor?

Van-Helsing
Hyperactive

Male Posts : 2197
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add Admin/Mod color button on sceditor?

Post by Ange Tuteur on November 3rd 2015, 12:27 am

Hi @Black-Shadow,

Go to Administration Panel > Modules > JavaScript codes management > New script

Title : SCEditor Mod color
Placement : In all the pages
Code:
$(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';
});

At the top you'll see a "mods" object with id:color pairs. To the right of the colon is the ID of the member, and to the left is their color. Edit these so that they correspond to the user's ID and their color of choice. Wink

As for the image of the button, add the following CSS to your stylesheet.
Display > Colors > CSS
Code:
.sceditor-button-modcolor div {
  background-image:url(http://i56.servimg.com/u/f56/18/45/41/65/mcolo10.png) !important;
}

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How can I add Admin/Mod color button on sceditor?

Post by Van-Helsing on November 3rd 2015, 1:06 am

Thank you very much @Ange Tuteur it is working amazing.
~1~
Its Solved.

Van-Helsing
Hyperactive

Male Posts : 2197
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add Admin/Mod color button on sceditor?

Post by Ange Tuteur on November 3rd 2015, 1:06 am

You're welcome ^^

Topic archived

Have a good day. Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum