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.
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.