Coding-Spot

You are not connected. Please login or register

Go to page : 1, 2, 3  Next

 
 
 

how to add staff option

Message (Page 1 of 3)

#1

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 5:28 pm

 
http://prntscr.com/17jcxk

hello how to add staff option like in the quick reply?





#2

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 5:31 pm

 
This was an old tutorial of fmquery, but since they're close, the owner of the site posted it instead on avacweb.
Here: http://www.avacweb.com/t993-how-to-create-a-new-text-editor-button

Happy



https://coding-spot.darkbb.com


#3

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 10:11 pm

 
Code:
(function(){var f={add:function(c,d,b){$(function(){if(document.getElementById("html_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("new_buttons_area").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("new_buttons_area").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("html_edit")){var c=document.createElement("div");c.id="new_buttons_area";c.style.paddingTop="5px";document.getElementById("html_edit").parentNode.insertBefore(c,document.getElementById("html_edit").nextSibling)}})}}; window.buttons=f;f.init()})();
buttons.add('Image', '[img]', '[/img]');
buttons.list('Test List', {
'Code': '[code],[/code]',
'Bump': 'Bumping this topic!',
'Image': '[img],[/img]'
}, 'bbcode_list_1');
buttons.list('Test List', {
'Happy': ':)',
'Sad': ':(',
}, 'bbcode_list_2');

little bit confuse where can i add the bb codes? in 'bbcode_list_1' and bbcode_list_2'?





#4

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 10:16 pm

 
I can't explain it, i don't know how i can tell you in the way you'll get it.
Just try it on your test forum first, then you'll see the output, then try clicking the buttons so you can get how it'll work. Happy



https://coding-spot.darkbb.com


#5

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 10:19 pm

 
ok mark. on that code where can i put the button image?





#6

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 10:27 pm

 
What do you mean? Oh my



https://coding-spot.darkbb.com


#7

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 10:28 pm

 
Code:
buttons.add('Image', '[img]', '[/img]');
buttons.list('Test List', {
'Code': '[code],[/code]',
'Bump': 'Bumping this topic!',
'Image': '[img],[/img]'
}, 'bbcode_list_1');
buttons.list('Test List', {
'Happy': ':)',
'Sad': ':(',
}, 'bbcode_list_2');

on this code mark.. what part need to be edit and change?





#8

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 10:34 pm

 
Ok, i'll explain.

On the buttons.add part, the Image will be shown as the tab, then when you click it, the [ img ] tag will shown up.
On the buttons.list part, the Test List will be shown as the tab, when you click it, there will be sub-list, the Code, Bump and Image, when you click the Code, the [ code ] tag will shown up. When you click the Bump, the Bumping this topic! will shown up and so on.

Same goes to the 2nd buttos.list, the difference they have is the bbcode_list, it has the 1 and the 2, since there are 2 buttons list.



https://coding-spot.darkbb.com


#9

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 10:43 pm

 
mm mark .. i confuse.. i want like on your forum when click Staff Option>>Topic Solved>>

this message will automatically shown :
Code:
Since the problem is now solved i will locked this and move to archive section. [color=green][b]~Locked and Moved[/b][/color] :happy:

i want only to revise it. and change it on my own.. under the "staff option", "Approved and Information"
and when click the approved this BB codes will shown.

Code:
[table class="solved"][tr][td]Approved[/td][/tr][/table]





#10

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 10:48 pm

 
Here, use this one instead:
Code:
(function(){var f={add:function(c,d,b){$(function(){if(document.getElementById("html_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("new_buttons_area").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("new_buttons_area").appendChild(a);a=document.createElement("span");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("html_edit")){var c=document.createElement("span");c.id="new_buttons_area";c.style.paddingTop="5px";document.getElementById("html_edit").parentNode.insertBefore(c,document.getElementById("html_edit").nextSibling)}})}}; window.buttons=f;f.init()})();

buttons.list('Staffs Option', {
'Approved': '[table class=solved][tr][td]Approved[/td][/tr][/table]',
}, 'bbcode_list_1');



Last edited by Mark on May 31st 2013, 11:06 pm; edited 1 time in total



https://coding-spot.darkbb.com


#11

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 10:52 pm

 
doesnt work.. i cant see any staff button in quick reply
i add that code in JS





#12

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 10:53 pm

 
Did you check the 'In the topics?'



https://coding-spot.darkbb.com


#13

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 10:56 pm

 
only in the topics? in ava check all pages?





#14

Mark

Mark
 
Administrator
Administrator

Posted May 31st 2013, 11:06 pm

 
Well if you want to display it on the quick reply, check the In the Topics, but if you want to display it also on the full text editor, just check the All Pages.

Btw, i update the codes on post #10. Replace it with the new code.



https://coding-spot.darkbb.com


#15

BetterHax

BetterHax
 
Advance Member

Posted May 31st 2013, 11:10 pm

 
Mark wrote:Well if you want to display it on the quick reply, check the In the Topics, but if you want to display it also on the full text editor, just check the All Pages.

Btw, i update the codes on post #10. Replace it with the new code.

i used the code.. still not work.. no staff option button seen





#16

Sponsored content


 

Posted

 





Message (Page 1 of 3)

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

In total there is 0 user online :: 0 Registered, 0 Hidden and 0 Guests

Users browsing this forum: None