PDA

View Full Version : Added js buttons in new thread/reply thread


Bioderm
01-20-2002, 10:00 PM
This hack adds the glow and shadow buttons with the bold and italics buttons.You must have the glow and shadow codes installed for it to work.

Files to Edit:Template(vbcode_buttons)
vbcode_language.js
vbcode.js

Under vbcode code template
>> Vbcode_buttons

add:

<input type="button" class="bginput" value=" Glow " onclick="glow(this.form,'glow','')" onmouseover="stat('glow')" title="Glow (alt+g)" accesskey="g"
><input type="button" class="bginput" value=" Shadow " onclick="shadow(this.form,'shadow','')" onmouseover="stat('shadow')" title="Shadow (alt+s)" accesskey="s"
>

near the other buttons,make it look like you want of course.

now for vbcode.js

At the bottom add:

function smilie(thesmilie) {
// inserts smilie text
document.vbform.message.value += thesmilie+" ";
document.vbform.message.focus();
}

function opensmiliewindow(x,y,sessionhash) {
// um... opens smilie overflow window.
window.open("misc.php?action=getsmilies&s"+sessionhash, "smilies", "toolbar=no,scrollbars=yes,resizable=yes,width="+x+",height="+y);
}

// ************************************************** *****

function glow(theform,thetype) {
// inserts glow text - xxx
glowcolor = prompt(color_text_prompt,"");
var prompttext;
if (thetype == "GLOW") {
prompt_text = glow_text_prompt;
prompt_contents = "color";
}
else {
prompt_text = glow_text_prompt;
prompt_contents = "";
}
glow = prompt(prompt_text,prompt_contents);
if ((glow != null) && (glow != "")) {
if ((glowcolor != null) && (glowcolor != ""))
theform.message.value += "["+thetype+"="+glowcolor+"]"+glow+"[/"+thetype+"] ";
else
theform.message.value += "["+thetype+"="+glowcolor+"]"+glow+"[/"+thetype+"] ";
}
theform.message.focus();
}


// ************************************************** *****

function shadow(theform,thetype) {
// inserts shadowed text - xxx
shadowcolor = prompt(color_text_prompt,"");
var prompttext;
if (thetype == "Shadow") {
prompt_text = shadow_text_prompt;
prompt_contents = "color";
}
else {
prompt_text = shadow_text_prompt;
prompt_contents = "color";
}
shadow = prompt(prompt_text,prompt_contents);
if ((shadow != null) && (shadow != "")) {
if ((shadowcolor != null) && (shadowcolor != ""))
theform.message.value += "["+thetype+"="+shadowcolor+"]"+shadow+"[/"+thetype+"] ";
else
theform.message.value += "["+thetype+"="+shadowcolor+"]"+shadow+"[/"+thetype+"] ";
}
theform.message.focus();
}


// ************************************************** *****

save and close

In vbcode_language.js add:

glow_text_prompt = "Enter the glowing text";
color_text_prompt = "Enter the color you want to use";
shadow_text_prompt = "Enter the text that you want to have a shadow around";

near:

link_text_prompt = "Enter the text to be displayed for the link (optional)";
link_url_prompt = "Enter the full URL for the link";
link_email_prompt = "Enter the email address for the link";

save and close.

Now upload the 2 js files you should have added the glow and shadow commands to your buttons list in the add/reply to views.

Always backup files before modifying them.

I did not write this code fully.

It is a modified version of the code already in these 2 files.

The reason i did this is because i saw someone asking for this ode over at www.vbulletin.com and wasnt sure if someone already made it.

Shenlong
01-21-2002, 02:07 AM
screenshot?

Warlord
01-21-2002, 02:30 AM
He's an Admin at my site, and he went to bed (I think) So, I'm posting the screenshot for him...

Click the glow button...
http://www.superherochat.com/warlord/1.gif
And this pops up
http://www.superherochat.com/warlord/2.gif
Enter the color you'd like to use and hit enter and you get this where you type in your text
http://www.superherochat.com/warlord/3.gif

Then it will surround your text with the appropriate tags...

Lucky
01-21-2002, 09:36 AM
Good idea!

Just curious if this hack could be placed in a dropdown menu instead?

Fallout2man
01-21-2002, 04:00 PM
Great hack, but, eheh. Where do I find the HTML code for glowing and shadow text. I need to add that to the Vbcodes part of the admin CP for the buttons to work. I've tried searching the net, but I haven't found much of anything on how to do it.

Bioderm
01-21-2002, 06:07 PM
one sec,the post is over at vbulletin.com

Bioderm
01-21-2002, 06:08 PM
<a href="http://www.vbulletin.com/forum/showthread.php?s=&threadid=24595" target="_blank">http://www.vbulletin.com/forum/showt...threadid=24595</a>

there are tohers there to im gonna work on the code for them later.

Bioderm
01-21-2002, 06:09 PM
Originally posted by Lucky
Good idea!

Just curious if this hack could be placed in a dropdown menu instead?

it probly could.ill try that later.

Psychdrone
01-21-2002, 10:35 PM
I found a tad problem, ounce you click it, and go ahead and insert your code, it won't allow you to do so again...?

Lucky
01-22-2002, 05:15 AM
Originally posted by Bioderm


it probly could.ill try that later.

Sounds good,

I'll install then.

Bald Bouncer
01-22-2002, 03:47 PM
you missed on thing mate

in vbcode_language

add

glow_text = "Make your text Glow";
shadow_text = "Give text a Shadow effect";

below

img_text = "Insert an image into your message";


cheers for this hack mate :p

StarBuG
01-22-2002, 04:46 PM
VERY NICE! Hehe

Is it possible to let the User define both (the font and the glow color? The same for Shadow??

Would be a great improvment!!!!

Hope you can help!

Thx

StarBuG

Bald Bouncer
01-22-2002, 05:01 PM
heres the ICQ button

Bioderm
01-22-2002, 07:53 PM
Originally posted by Bald Bouncer
you missed on thing mate

in vbcode_language

add

glow_text = "Make your text Glow";
shadow_text = "Give text a Shadow effect";

below

img_text = "Insert an image into your message";


cheers for this hack mate :p

well thats an old button was included with it,so it should have been in there already.atleast i though it was.

Bald Bouncer
01-23-2002, 12:34 PM
how come you can only use these once before getting a JS error?

Xelation
01-23-2002, 03:54 PM
yes, please make a drop down menu!! that would be very helpful!

Bioderm
01-24-2002, 09:09 PM
you get a js error.weird i have had no problems with it.

Psychdrone
01-25-2002, 12:44 AM
like I siad before I have a problem also when I click it more than ounce!

pogo
01-30-2002, 11:54 AM
I rewrote this hack because I couldn't find the error in the first version :(
I had the same problem that the Glow and Shadow buttons were working one time only.

Add this add the end of vbcode.js :
function glow(theform) {
glowtext = prompt(glow_text_prompt,"");
glowcolor = prompt(color_text_prompt,"");
if ((glowcolor != null) && (glowcolor != "")) {
if ((glowtext != null) && (glowtext != ""))
theform.message.value += ""+glowtext+" ";
else
theform.message.value += " ";
}
theform.message.focus();
}


// ************************************************** *****

function shadow(theform) {
shadowtext = prompt(shadow_text_prompt,"");
shadowcolor = prompt(color_text_prompt,"");
if ((shadowcolor != null) && (shadowcolor != "")) {
if ((shadowtext != null) && (shadowtext != ""))
theform.message.value += ""+shadowtext+" ";
else
theform.message.value += " ";
}
theform.message.focus();
}


// ************************************************** *****Add this at the end of vbcode_language.js :glow_text_prompt = "Enter the glowing text";
color_text_prompt = "Enter the color you want to use";
shadow_text_prompt = "Enter the text that you want to have a shadow around";
glow_text = "Make your text Glow";
shadow_text = "Give text a Shadow effect";Insert this into the vbcode_buttons template :<input type="button" class="bginput" value=" Glow " onclick="glow(this.form)" onmouseover="stat('glow')" title="Glow (alt+g)" accesskey="g">
<input type="button" class="bginput" value=" Shadow " onclick="shadow(this.form)" onmouseover="stat('shadow')" title="Shadow (alt+s)" accesskey="s">possibly before<input type="button" class="bginput" value=" B " onclick="vbcode(this.form,'B','')" onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b">

Platinumgamer
04-12-2002, 09:42 PM
I am going to install this. Is there any chance someone could make something like this for alignment?

BigJohnson
05-25-2002, 11:25 AM
The color doesnt work because the way it is made is that the glow will always be BLUE and and what you have down as changing the color is really the suppose to be the Strength of the glow. This would be really awesome if someone can make all the buttons for all these vb code buttons on vb.com. That would be the greatest thing ever made. IF someone has the time and skill please try this. I am trying to learn and i only got some down. I cant get the hard ones where it takes a couple of javascript windows to open up to ask questions like the URL buttons. IT first asks for the url then what you want the LINK text to look like. I only know how to make on window hehe. But this would be a great template hack if someone can do this. Also how can you change the color to the glow font instead of just having it one color like it is programmed to do.

This is what mine looks like

(<table style="filter:glow(color=blue, strength=4)">this text is glowing</table>)

Please help thanks.

Cyricx
03-13-2003, 08:19 AM
01-20-02 at 09:47 PM Bioderm said this in Post #1 (http://www.christianforums.com/showthread.php?postid=214689#post214689)

This hack adds the glow and shadow buttons with the bold and italics buttons.You must have the glow and shadow codes installed for it to work.





Know where I can get the shadow code? :)

Cyricx
03-14-2003, 12:11 PM
* Cyricx skims the other posts in this thread and finds the info :P

Oops hehe. :)