The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

A code staff color

2 posters

Go down

Solved A code staff color

Post by Mati January 27th 2015, 2:30 pm

I want a script for staff color to be seen and use by staff members only. I like to have an icon https://i.servimg.com/u/f38/14/73/12/96/color-10.png" alt="" /> to the sceditor group for example when you click on it a drop down shows with the members names.

Member 1
Member 1
Member 1

To add on the script something like this
Code:
[color=#000][b][/b][/color]
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ January 27th 2015, 4:41 pm

css

Code:

#memcolors {
    position: relative;
    display: block;
    height: initial;
    background-color: white;
    background-image: none;
    z-index: 9999;
    width: initial;
   border: 1px solid black;
   padding:4px
}
#colopt {
   
    color: black;
    font-size: 12px;
    line-height: initial;
    text-indent: 0;
    width: initial;
    background-image: none;
}

script
set to in all pages

var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0']; < title of list item and color seperated with :
var urlist = ['123','97664']; << list of user id#'s who you want to have access

Code:
$(function(){
var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0'];
   var urlist = ['123','97664'];
   var memcode ="";
for(var x= 0;x< urlist.length;x++){
   if(_userdata.user_id==urlist[x]){

$('.sceditor-button-fahide').after('<a class="sceditor-button sceditor-button-blah1"><div style="background-image: url\(&quot;http://i38.servimg.com/u/f38/14/73/12/96/color-10.png&quot;\); background-size: 100% 100%;" title="Member Color"></div></a>');

      for(var i=0;i<membrz.length;i++){
         var splmem = membrz[i].split(':');
      memcode = memcode + '<div id ="colopt" value="'+splmem[1]+'" >'+splmem[0]+'</div>'   ;
};                             
   $('.sceditor-button-blah1').append('<div id="memcolors" style="position:absolute;">'+memcode+'</div>');
$('#memcolors').css('display','none');
$('.sceditor-button-blah1').click(function(){
if($('#memcolors').css('display')=='block'){$('#memcolors').css('display','none');}else
{$('#memcolors').css('display','block');
}
})
$('#memcolors #colopt').click(function(){
$('#text_editor_textarea').sceditor('instance').insertText('[color='+$(this).attr('value')+'][b]','[/b][/color]');
});   
   }};
});
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: A code staff color

Post by Mati January 27th 2015, 5:43 pm

Hi Twisted,

I tried the code but didn't work so are we missing something or...
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ January 27th 2015, 6:23 pm

there was a error on my end but for some reason it still wont work for me and im not getting a error so idk maybe ange can take look when he gets a min

u can try this 1 maybe u have better luck then me

Code:

    $(function(){
    var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0'];
      var urlist = ['1','97664'];
      var memcode ="";
    for(var x= 0;x< urlist.length;x++){
      if(_userdata.user_id==urlist[x]){

    $('.sceditor-button-removeformat').after('<a class="sceditor-button sceditor-button-blah1"><div style="background-image: url\(&quot;http://i38.servimg.com/u/f38/14/73/12/96/color-10.png&quot;\); background-size: 100% 100%;" title="Member Color"></div></a>');

          for(var i=0;i<membrz.length;i++){
            var splmem = membrz[i].split(':');
          memcode = memcode + '<div id ="colopt" value="'+splmem[1]+'" >'+splmem[0]+'</div>';
    };                         
      $('.sceditor-button-blah1').append('<div id="memcolors" style="position:absolute;">'+memcode+'</div>');
    $('#memcolors').css('display','none');
    $('.sceditor-button-blah1').click(function(){
    if($('#memcolors').css('display')=='block'){$('#memcolors').css('display','none');}else
    {$('#memcolors').css('display','block');
    };
    });
    $('#memcolors #colopt').click(function(){
    $('#text_editor_textarea').sceditor('instance').insertText('[color='+$(this).attr('value')+'][b]','[/b][/color]');
    }); 
      };};
    });
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: A code staff color

Post by Mati January 27th 2015, 7:06 pm

Nope no luck at all still doesn't work. blackeye
Mati
Mati
Hyperactive

Posts : 2020
Reputation : 330
Language : HTML, CSS & JavaScript
Location : Forum Services

https://forumservice.forumotion.com/

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ January 27th 2015, 11:22 pm

ok so after overlooking some of my other code i realised this had to be put into a double function .. witch i reall have no idea y ill have to ask ange abt that 1 because it confuses mee but either way here u go .. it works.. dont forget css from above


Code:

$(function(){
$(function(){
        var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0'];
          var urlist = ['1','97664'];
          var memcode ="";
        for(var x= 0;x< urlist.length;x++){
          if(_userdata.user_id==urlist[x]){

      
  $('.sceditor-button-removeformat').after('<a class="sceditor-button sceditor-button-mcolor"><div style="background-image: url\(&quot;http://i38.servimg.com/u/f38/14/73/12/96/color-10.png&quot;\); background-size: 100% 100%;" title="Insert Widget Code"></div></a>');



              for(var i=0;i<membrz.length;i++){
                var splmem = membrz[i].split(':');
              memcode = memcode + '<div id ="colopt" value="'+splmem[1]+'" >'+splmem[0]+'</div>';
        };                       
         
$('.sceditor-button-mcolor').append('<div id="memcolors" style="position:absolute;">'+memcode+'</div>');

        $('#memcolors').css('display','none');
        $('.sceditor-button-mcolor').click(function(){
        if($('#memcolors').css('display')=='block'){$('#memcolors').css('display','none');}else
        {$('#memcolors').css('display','block');
        };
        });
        $('#memcolors #colopt').click(function(){
        $('#text_editor_textarea').sceditor('instance').insertText('[color='+$(this).attr('value')+'][b]','[/b][/color]');
        });
          };};
        });});


_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ February 13th 2015, 1:09 am

Topic solved and archived
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Back to top

- Similar topics

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