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
This post has been closed. You can still view previous posts, but you can't post any new replies.

API is changing the sheet's html

1427789663

Edited 1427789887
vÍnce
Pro
Sheet Author
Strange problem came up in the character sheet forum( thread ) regarding the community PF sheet's button bar macros not working. Upon using inspect element to view the button's code in-game, I noticed the html for the button bar buttons were "scrambled", out of order with misplaced attributes, quotes, etc. OK, figured that it must have gotten accidentally jacked while editing/updating the sheet. I check the Github code and it's fine. What? So I check the API console(used custom view of the community sheet) and the code is fine. Only the code of the sheet in-game seems to be jacked. Here's the in-game code (using inspect element). Notice the code is jacked up. <button type="roll" class="roll_repeating_class-ability_0_Display btn ui-draggable" title="%{selected|repeating_class-ability_0_Display}" value="&{template:pf_block} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{Class=**Class**: @{repeating_class-ability_0_class-number}}} {{name=@{repeating_class-ability_0_name}}} {{description = @{repeating_class-ability_0_short-description}}}"></button> Now, here's the same code in the API editor. The code is fine. <button type="roll" Class="roll_repeating_class-ability_0_Display" title="%{selected|repeating_class-ability_0_Display}" value="&{template:pf_block} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{Class=**Class**: @{repeating_class-ability_0_class-number}}} {{name=@{repeating_class-ability_0_name}}} {{description = @{repeating_class-ability_0_short-description}}}"></button></span Why would this happen?
1427793964
Lithl
Pro
Sheet Author
API Scripter
Unless you're talking about the introduction of HTML entities (the forum resolves them, even in code blocks), everything looks fine. The only difference is the addition of the btn and ui-draggable classes, which are used for styling and for jQuery selectors.
1427812073

Edited 1427812163
vÍnce
Pro
Sheet Author
Thanks for the help Brian. Only the Attack and Spell button bar code does not change and works as expected with drag/drop and proper macro name referencing. Other buttons on the sheet also keep their code intact and work properly. However all the other button rows on the sheet exhibit their code being changed once the sheet is parsed which breaks their proper functions. Here's an attack button bar code in-game which works as expected: (note that btn ui-draggable isn't inserted into the class attribute) <button type="roll" name="roll_repeating_weapon_0_Attack" title="%{selected|repeating_weapon_0_Attack}" value="&{template:pf_attack} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{name=@{repeating_weapon_0_name}}} {{attack=[[1d20cs>@{repeating_weapon_0_crit-target} + (@{repeating_weapon_0_proficiency} + (((@{repeating_weapon_0_enhance} + @{repeating_weapon_0_masterwork}) + abs(@{repeating_weapon_0_enhance} - @{repeating_weapon_0_masterwork})) / 2) + @{repeating_weapon_0_attack} + @{repeating_weapon_0_attack-type} + @{armor-proficiency})]]}} {{damage=[[@{repeating_weapon_0_damage-dice-num}d@{repeating_weapon_0_damage-die} + (@{repeating_weapon_0_enhance} + @{repeating_weapon_0_damage} + @{repeating_weapon_0_damage-ability})]]}} {{crit_confirm=[[1d20 + (@{repeating_weapon_0_proficiency} + (((@{repeating_weapon_0_enhance} + @{repeating_weapon_0_masterwork}) + abs(@{repeating_weapon_0_enhance} - @{repeating_weapon_0_masterwork})) / 2) + @{repeating_weapon_0_attack} + @{repeating_weapon_0_attack-type} + @{armor-proficiency})]]}} {{crit_damage=[[(@{repeating_weapon_0_damage-dice-num} * (@{repeating_weapon_0_crit-multiplier} - 1))d@{repeating_weapon_0_damage-die} + ((@{repeating_weapon_0_enhance} + @{repeating_weapon_0_damage} + @{repeating_weapon_0_damage-ability}) * (@{repeating_weapon_0_crit-multiplier} - 1))]]}} {{type=@{repeating_weapon_0_type}}} {{description=@{repeating_weapon_0_notes}}}" class="btn ui-draggable"></button>
1427857304
vÍnce
Pro
Sheet Author
Please mark as resolved. Nibrodooh said: You found a bug in the sheet. The button is not correctly defined by its name so in the current version of the sheet it can not be called correctly. I will submit a fix to this tonight but as usual we must wait on the roll20 to approve the update so it will be awhile. Sorry for the inconvenience, and thank you for reporting the issue!