A code staff color  Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    A code staff color

    Mati
    Mati
    Active Poster


    Posts : 1928
    Reputation : 331
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved A code staff color

    Post by Mati January 27th 2015, 3: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]
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


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

    Solved Re: A code staff color

    Post by _Twisted_Mods_ January 27th 2015, 5: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]');
    });   
       }};
    });
    Mati
    Mati
    Active Poster


    Posts : 1928
    Reputation : 331
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: A code staff color

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

    Hi Twisted,

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


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

    Solved Re: A code staff color

    Post by _Twisted_Mods_ January 27th 2015, 7: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]');
        }); 
          };};
        });
    Mati
    Mati
    Active Poster


    Posts : 1928
    Reputation : 331
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: A code staff color

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

    Nope no luck at all still doesn't work. blackeye
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


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

    Solved Re: A code staff color

    Post by _Twisted_Mods_ January 28th 2015, 12:22 am

    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 : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: A code staff color

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

    Topic solved and archived