Quote:
03-27-03 at 10:09 PM colicab-d said this in Post #9
how would i saw replace the image code with this? or even better add a THUMB button beside the IMG one?
|
To add a button you would need to edit 3 things.. The "vbcode_buttons" template, and the two JavaScripts "vbcode.js" and "vbcode_language.js".
In the "vbcode_buttons" template add this where you want the button to appear:
Code:
<input type="button" class="bginput" value="THUMB" title="Insert Thumbnail" onclick="vbcode(this.form,'THUMB','http://')" onmouseover="stat('thumb')">
In the "vbcode.js" you would need to add this just after the code for the IMG tag:
Code:
// *******************************************************
function vbcode(theform,vbcode,prompttext) {
// insert [x]yyy[/x] style markup
if ((normalmode(theform)) || (vbcode=="THUMB")) {
inserttext = prompt(tag_prompt+"\n["+vbcode+"]xxx[/"+vbcode+"]",prompttext);
if ((inserttext != null) && (inserttext != ""))
theform.message.value += "["+vbcode+"]"+inserttext+"[/"+vbcode+"] ";
}
else {
donotinsert = false;
for (i = 0; i < tags.length; i++) {
if (tags[i] == vbcode)
donotinsert = true;
}
if (donotinsert)
stat("already_open");
else {
theform.message.value += "["+vbcode+"]";
arraypush(tags,vbcode);
}
}
theform.message.focus();
}
In the "vbcode_language.js" you would need to add this just after the code for the "img_text":
Code:
thumb_text = "Insert a thumbnail into your message";