Status
Not open for further replies.

Mobius1

Customer
Greetings,

Due to popular demand on my board, I added an 'Add Image URL' and 'Quote' button into the editor toolbar of the shoutbox.

unledihk.png


My javascript knowledge is rusty but I've added the script for generating the prompt box to add the image url but I can't remember how to get it to add the url to the shoutbox once the user selects 'OK'.

How is this done?



headerinclude

Code:
<script type="text/javascript">
function show_prompt()
{
var name=prompt("Image URL");
if (name!=null && name!="")
  {
  document.write("[img]" + name + "[/img]");
  }
}
</script


dbtech_vbshout_shoutbox_editortools

HTML:
<li><input type="image" src="{vb:stylevar imgdir_editor}/insertimage.png" onclick="return show_prompt()"/></li>
 
Last edited:
Code:
vBShout{vb:raw instance.instanceid}.set_command('text');

Where {vb:raw instance.instanceid} is the instance ID you're working with :)
 
It'd be in place of the
document.write("
");
line.

In that template though, you probably need to hardcode the instance ID.
 
Thanks, that worked a treat!


headerinclude

Code:
<script type="text/javascript">
function show_prompt()
{
var name=prompt("Image URL");
if (name!=null && name!="")
  {
   vBShout1.set_command("[img]" + name + "[/img]");
  }
}
</script


dbtech_vbshout_shoutbox_editortools

HTML:
<li><input type="image" src="{vb:stylevar imgdir_editor}/insertimage.png" onclick="return show_prompt()"/></li>
 
Last edited:
Status
Not open for further replies.

Legacy vBShout

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
3,175
Customer rating
5.00 star(s) 1 ratings
Top