A code staff color
2 posters
Page 1 of 1
A code staff color
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
Member 1
Member 1
Member 1
To add on the script something like this
- Code:
[color=#000][b][/b][/color]
Re: A code staff color
css
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:
#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\("http://i38.servimg.com/u/f38/14/73/12/96/color-10.png"\); 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]');
});
}};
});
Re: A code staff color
Hi Twisted,
I tried the code but didn't work so are we missing something or...
I tried the code but didn't work so are we missing something or...
Re: A code staff color
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
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\("http://i38.servimg.com/u/f38/14/73/12/96/color-10.png"\); 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]');
});
};};
});
Re: A code staff color
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\("http://i38.servimg.com/u/f38/14/73/12/96/color-10.png"\); 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]');
});
};};
});});
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum