EditWrx Knowledge Base Home
 Search       Login   Register   Members   Help   Home 
Search by username


additional buttons?
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
lcanter
Member
 

Joined: Sat Mar 25th, 2006
Location:  
Posts: 32
 Posted: Fri Aug 15th, 2008 12:38 am
 Quote  Reply 
Is it possible to add some custom buttons to the toolbar - by that, I mean one that I could program the action for (such as executing an external script).

Thanks.

 

 

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Fri Aug 15th, 2008 05:51 pm
 Quote  Reply 
Well.... yeah, it is possible. But like they say, you wouldn't eat sausage if you saw how it's made :-)

There are two way to do this - the easy way and the sausage way. So, let's see if the easy way will work for you. The easy way assumes a few things 1) that you want the button to be available for all users 2) that the button can go into the end of the top line of buttons or at the front or end of the bottom row of buttons.

Open /library/htm/toolbar.txt
Down at line 482 or 485 find the variables $BUTTONS_TOP and $BUTTONS_BOTTOM. Add the image tag either afer the $BUTTONS_TOP or before or after the $BUTTONS_BOTTOM.

The image tag of course is unique. Let's pretend the button calls a function doAthingy()


<img id=doAthingy_ onmouseover=up(this.id) onmouseup=out(this.id) onmouseout=out(this.id) class="button" onclick=doAthingy()src="$url_to_ikons/saveas.gif" width="16" height="16" border="0" align=absmiddle alt="Da A Thingy">

 
Notice that the id must be unique on the toolbar so I named it the same as the function and added a _ to the name.

You then add your custom function into the script area in that file.

lcanter
Member
 

Joined: Sat Mar 25th, 2006
Location:  
Posts: 32
 Posted: Fri Aug 15th, 2008 05:59 pm
 Quote  Reply 
Thanks so much - the "easy way" limitations are fine. Basically I want to access a mysql database, in case one was wondering why.

As for the 'sausage way' , after reading the Jungle back in my early school days, I passed on all unidentified processed meats for a number of years. I still am hesitant unless I know what body parts are in it!!!


Regards,

Larry

lcanter
Member
 

Joined: Sat Mar 25th, 2006
Location:  
Posts: 32
 Posted: Sat Aug 16th, 2008 01:13 am
 Quote  Reply 
Keith, I think it's almost there - but I can't get the icon to display - just a place holder.  The alt text displays, and clicking on it executes the script.  I've placed the new gif files in the Ikons folder.  Does it go elsewhere, or is there another file that needs to know about it's existence?

for the src I currently have src="$url_to_ikons/name_of_file.gif"

Thanks.

 

Larry

Last edited on Sat Aug 16th, 2008 01:15 am by lcanter

lcanter
Member
 

Joined: Sat Mar 25th, 2006
Location:  
Posts: 32
 Posted: Sat Aug 16th, 2008 01:45 am
 Quote  Reply 
Never mind - I must have had a typo somewhere - I redid the code and now it works just fine.

 

Thanks.

 

 


 Current time is 06:43 pm




Powered by WowBB 1.62 - Copyright © 2003-2004 Aycan Gulez