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 .
×
Advertisement Create a free account

Did the new sheet sanitation system change how roll templates work?

1618950039

Edited 1618991231
Chris D.
Pro
Sheet Author
API Scripter
I would have sworn that I read that roll templates were not affected by the newish sheet sanitation system, and that roll templates were supposed to be left alone (that they were still supposed to have sheet- in front of them.  I converted my development project several weeks ago, but today I noticed that my roll templates are all without any css formatting. Everything appears in the  places that they should, but everything is simply black and white.  Specifically, my roll table is still listed as  <rolltemplate class="sheet-rolltemplate-chatrecord"> and my css still has lines such as  .sheet-rolltemplate-chatrecord { background-color: LightBlue;   } I am using legacy = false and all my chatrecords are coming out with a white background (insead of LightBlue) Did I miss anything?       Thanks.  P.S. the reason I was looking at the roll templates today is that I was getting back to a project that had stymied me a few weeks ago.  I wanted to apply css formatting to something in the chat window (instead of inline styling like I normally do, and I could not figure out how to do it). I could not figure out how to get my css file to apply to anything in the chat window.  Then I remembered that roll templates could style the chat window, so was going to convert the thing I wanted to style to a roll template (even though I don't need anything else from a roll template other than the ability to be styled by the css file.  So imagine my dismay when I found out that my css file is no longer styling my old existing roll template entries! I went back and looked at my sheet running on the production server with the legacy system, and it is styling them fine, and if I inspect the  items in the chat window, I can see the css file tags are there. But now, suddenly, on copy on the dev server sandbox, it does not!   Any idea what is going on?  Any tips for using the css file to style things my API sends to the chat window?
1618957208
Scott C.
Forum Champion
Sheet Author
API Scripter
Just tested in a sheetsandbox. Toggling legacy sanitization off (my project is still using legacy) did not affect the roll templates. I'd guess there's something else going on. Have you tried on live instead of development servers?
1618958494
vÍnce
Pro
Sheet Author
Not sure if it would matter, but I think "legacy": false  (ie CSE mode please) is assumed unless you include  "legacy": true in the sheet.json or toggle the “Legacy Sanitization” checkbox from a custom sheet settings page.  What happens if you remove your legacy line?
1618991202
Chris D.
Pro
Sheet Author
API Scripter
OK, this is majorly weird.  So I kind of found where the problem is, but it makes no sense whatsoever. I went through my daily code saves and found the day that it stopped working (it was NOT when I converted from the legacy system so the title of this thread and that whole idea was a read herring. I then replaced lines one by one until I narrowed it down to it's narrowest case. The impossibly weird thing is that if I don't have a css selector with a comment that contains at least one asterix somewhere inside of it within a fairly narrow range of lines, the chat window stops recognizing my roll template css.  Quite literly look at the styling for    xxxx /* Colors: code description What used for. */ .sheet-user-root { --bg-color: transparent; /* blue gray. #B8C4C4 Main background color *#FFF4DA ;*/ --outline-color: black; /*#49392C ;*/ /* darker gray. Main border */ --input-color: transparent; /* Light gray Main section Input fields that are not disabled. */ --locked-color: #0081A7; /* medium Main section Input fields that are locked */ --control-secondary: #77625C; /* #605856; #C6DCEA header section background */ --control-main: #E8ECEC;/*#FFFFFF; /* main section outline */ --button-color: transparent ; /* main section outline */ } xxxxx { xxx: xx; /* * */ } .sheet-testNPC:not([value="0"])~div .sheet-HideIfNPC, .sheet-testNPC[value="0"]~div .sheet-HideIfPC, .sheet-testQuest[value="None"]~div .sheet-HideIfNotQuest, .sheet-testNone[value="None"]+.sheet-HideIfNone, I have tested this dozens of times with dozens of variations, and If that xxxxx (or any other css selector is not somewhere in that area. And if it does not have a comment, and that comment does not have an asterix somewhere inside of it, I loose my roll template css!   That is bizarre! Anybody have any idea why this might be happening?!?
1618993798
Chris D.
Pro
Sheet Author
API Scripter
And the weirdness gets weirder. I have some other projects, and the roll template formatting also disappeared.  On one of them I had the following comment.  /********************************************** Chat window tooltips *********************************************************** * The normal roll20 tooltips built in with the "tipsy" class show up above the hovered item. * unfortunately when these end up near the right edge of the chat window, the system goes into an infinite loop of creating and destroying the tooltip. * to avoid this, I built my own. * Format: an outer span of class "ttip" will hold a button and an inner span of class "ttiptext". */ The one and only thing I changed was to remove all the excess asterix's (along the top and left side), and the roll template formatting reappeared. Why does the system even care what is in my comments? How can the presence or absence of something in a comment keep roll template formatting  from working?  Why does it sometimes insiste that an asterix be present in a comment, and sometimes insist that none be? I am majorly confused.  Thanks
1619010565
Andreas J.
Forum Champion
Sheet Author
Translator
Weird stuff. In any case, I've added links to this thead on my haphazard "issues"-list for CSE stuff: <a href="https://wiki.roll20.net/BCS/Weird" rel="nofollow">https://wiki.roll20.net/BCS/Weird</a> Also updated the main info page a bit, but it's still lacking, and help would be appreciated: <a href="https://wiki.roll20.net/Character_Sheet_Enhancement" rel="nofollow">https://wiki.roll20.net/Character_Sheet_Enhancement</a>
1619013289
Scott C.
Forum Champion
Sheet Author
API Scripter
I think this has been an issue for as long as I've been coding sheets. I remember running into something like this when I first started on the Starfinder HUD sheet.
1619075204
Chris D.
Pro
Sheet Author
API Scripter
Scott C. said: I think this has been an issue for as long as I've been coding sheets. I remember running into something like this when I first started on the Starfinder HUD sheet. Thanks! So do you know what the actual issue is? I have been wondering if I ought to remove all *'s from all comments in the css file or something like that.&nbsp; So far I can't really wrap my head around how/why this could be happening, and if it happens again, what can I do except play around at random with my comments.&nbsp; I mean I found the first two instances by searching for versions of the css that did and did not have the problem, then looking for things that changed between those two version. If I did not have so many backups that would have been impossible, and even with them, I would have preferred to know what was actually happening and why rather than just finding something that works without knowing why.&nbsp;
1619080293
Scott C.
Forum Champion
Sheet Author
API Scripter
Yeah, when I need to make obvious comments that catch the eye, I use # instead. E.g. /*######*/