Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] Beautifying Chat Output

I have a slightly more complex dice rolling system I am scripting which involves, keep dice, bonus dice, and target numbers. Not a great fit for the existing roller, but no worries, with the available api, it was very easy to write. Now, I want to the sendChat message to look nice. So, I cracked up my dev console on the campaign and looked at the elements for how the standard roller was formatted. I tried reusing the div classes I found. Below: LOG.roll = function(result) { var msg = ''; _.each(results.rolls, function(obj){msg+= '<div class="didroll">' + obj + '</div>'}) msg+= '<div class="rolled ui-draggable">' + result.successes + ' Successes      </div>' log(JSON.stringify(result)) sendChat('', msg) } Unfortunately for me, it looks like part of the sand boxing adds 'userscript-' infront of all the classes: <div class="userscript-didroll">2</div> So I'm looking for tips on how best to 'beautify' my output. I see the list of acceptable tags in the API.  Could a possible enhancement be an approved list of existing roll20 css classes which will not be prefixed with userscript? I wanted to maintain the look and feel of roll20 with my output.
Interesting thought. I could probably change some stuff on our end so that userscript-didroll and whatnot worked properly. You won't get the drag-and-drop reordering, but at least you could take advantage of the same look-and-feel. I'll add it to my todo list.