Status
Not open for further replies.

Mobius1

Customer
Shoutbox Input with JS

Hiya,

I've got some custom script to insert text into the shoutbox (for quoting shouts and adding images) but the upgrade to 6.0 seems to have broke it.

I use this to insert the text:

Code:
vBShout{vb:raw instance.instanceid}.set_command('text');


Thanks!
 
Last edited:
This is the HTML element that is used for inserting the /test command:
HTML:
<a data-command="/test" data-instanceid="{vb:raw instance.instanceid}" name="dbtech_vbshout_setcommand" href="javascript://">/me [text]</a>
You will need to replace /test with the text you want and insert that element somewhere.

Whenever someone clicks that element, the contents of data-command is inserted.

Then, when you want it triggered, you can use
Code:
$('[name="dbtech_vbshout_setcommand"][data-instanceid="{vb:raw instance.instanceid}"][data-command="/test"]').trigger('mousedown');
Also changing /test there.


It became more long-winded because I recoded it from scratch to support multiple instances natively, and supporting this was not something we had in mind then or now.

If this doesn't work then I don't know if I'll be able to assist any further, like I said we haven't created an API for these things.
 
Many thanks, that's perfect! :D


However, one of the buttons triggers a pop-up box to insert an image URL so when the shouter hits Enter the image appears as a shout.

This is the code:

headerinclude

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


dbtech_vbshout_shoutbox_editortools

HTML:
<li><input type="image" src="{vb:stylevar imgdir_editor}/insertimage.png" onclick="return show_prompt()"/></li>
 
Last edited:
This is probably bad form to post in another's support thread....so sorry. :o But the ability to have an image button is a feature that I would help pay for. Especially if I could toggle that with my img2 bbcode which assigns the image width to avoid images being too large in chat. This has been a major issue with my members.
 
Status
Not open for further replies.

Similar threads

Legacy vBShout

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