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.

Widget button

Go down

Widget button Empty Widget button

Post by Azi March 7th 2013, 12:34 am

Yes, i have a new button i made in the JS module but i don't know how to set permissions, as in regular members not being able to see/use this button ive added to the quick reply bar.

I know you can write a <script> in the widget and make a button but i haven't been able to do that sucsessfully.

Code:
(function(){var f={add:function(c,d,b){$(function(){if(document.getElementById("text_edit")){void 0==b&&(b="");var a=document.createElement("span");a.innerHTML='<button class="button2" style="height: 22px; margin-right: 5px;" onClick="bbfontstyle(\''+d+"', '"+b+"'); return false;\">"+c+"</button>";document.getElementById("text_edit").appendChild(a)}})},list:function(c,d,b){$(function(){if(document.getElementById("text_edit")){var a=document.createElement("span");a.innerHTML='<input type="button" style="height: 22px; margin-right: 5px;" value="'+ c+'" onclick="selectWysiwyg(this, \''+b+'\');" class="button2">';document.getElementById("text_edit").appendChild(a);a=document.createElement("div");a.id=b;a.className="select";a.style.visibility="hidden";for(var e in d)a.innerHTML=/,/.test(d[e])?a.innerHTML+("<button onmouseout=\"this.className='';\" onmouseover=\"this.className='selectHover';\" onclick=\"bbfontstyle('"+d[e].replace(/(.*),.*/,"$1")+"', '"+d[e].replace(/.*,(.*)/,"$1")+"');selectWysiwyg(this, '"+b+"');return false;\">"+e+"</button><br>"): a.innerHTML+("<button onmouseout=\"this.className='';\" onmouseover=\"this.className='selectHover';\" onclick=\"bbfontstyle('"+d[e]+"', '');selectWysiwyg(this, '"+b+"');return false;\">"+e+"</button><br>");document.getElementById("text_editor_select_controls").appendChild(a)}})},init:function(){$(function(){if(document.getElementById("text_edit")){var c=document.createElement("div");c.id="html_edit";c.style.paddingTop="5px";document.getElementById("text_edit").parentNode.insertBefore(c,document.getElementById("text_edit").nextSibling)}})}}; window.buttons=f;f.init()})();
buttons.add('Award!', '[table class=award][tr][td][color=Gold][b]Awarded  &  Thread Locked![/b][/color]
[/td][/tr][/table]');
I need this in the widget, which i tried doing,

Code:
<script type="text/javascript">
buttons.add('Award', '<table class=award><tr><td align="left"><font color="CHANGEME"><strong>Awarded & Thread Locked!</strong></font></td></tr></table>');
</script>

but this code just breaks it, here(the one with the red text, the Award button to the left is the one correct one that i just can't set permissions to)
Azi
Azi
Forumember

Female Posts : 61
Reputation : 1
Language : English/Russian

Back to top Go down

Widget button Empty Re: Widget button

Post by Azi March 10th 2013, 6:50 am

bump
Azi
Azi
Forumember

Female Posts : 61
Reputation : 1
Language : English/Russian

Back to top Go down

Widget button Empty Re: Widget button

Post by Azi March 12th 2013, 5:55 pm

bump
Azi
Azi
Forumember

Female Posts : 61
Reputation : 1
Language : English/Russian

Back to top Go down

Back to top

- Similar topics

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