Include width/height attributes for player flag and vehicle/ordnance counter images in snippets.

master
Pacman Ghost 5 years ago
parent ed3ec863a2
commit 5d2e01ec2e
  1. 2
      vasl_templates/webapp/data/default-template-pack/atmm.j2
  2. 2
      vasl_templates/webapp/data/default-template-pack/baz.j2
  3. 3
      vasl_templates/webapp/data/default-template-pack/extras/kgs/grenade-bundles.j2
  4. 3
      vasl_templates/webapp/data/default-template-pack/extras/kgs/molotov-cocktails.j2
  5. 2
      vasl_templates/webapp/data/default-template-pack/mol-p.j2
  6. 2
      vasl_templates/webapp/data/default-template-pack/mol.j2
  7. 2
      vasl_templates/webapp/data/default-template-pack/ob_ma_notes.j2
  8. 2
      vasl_templates/webapp/data/default-template-pack/ob_setup.j2
  9. 5
      vasl_templates/webapp/data/default-template-pack/ob_vo.image.include
  10. 2
      vasl_templates/webapp/data/default-template-pack/ob_vo.j2
  11. 2
      vasl_templates/webapp/data/default-template-pack/ob_vo_note.j2
  12. 2
      vasl_templates/webapp/data/default-template-pack/pf.j2
  13. 2
      vasl_templates/webapp/data/default-template-pack/piat.j2
  14. 2
      vasl_templates/webapp/data/default-template-pack/player_flag.include
  15. 5
      vasl_templates/webapp/data/default-template-pack/players.j2
  16. 2
      vasl_templates/webapp/data/default-template-pack/psk.j2
  17. 2
      vasl_templates/webapp/data/default-template-pack/thh.j2
  18. 4
      vasl_templates/webapp/static/snippets.js
  19. 20
      vasl_templates/webapp/tests/test_online_images.py

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}Anti-Tank Magnetic Mines
{{INCLUDE:player_flag}}Anti-Tank Magnetic Mines
<tr>
<td style="padding:2px 5px;">

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}Bazooka {%if BAZ_TYPE%} ('{{BAZ_TYPE}}) {%endif%}
{{INCLUDE:player_flag}}Bazooka {%if BAZ_TYPE%} ('{{BAZ_TYPE}}) {%endif%}
<tr>

@ -14,7 +14,8 @@ td { margin: 0 ; padding: 0 ; }
<tr>
<td colspan="2" style="background: {{PLAYER_COLORS["german"][0]}} ; border-bottom: 1px solid {{PLAYER_COLORS["german"][2]}} ; padding: 2px 5px ; font-weight: bold ;">
{%if PLAYER_FLAGS["german"]%}<img src="{{PLAYER_FLAGS["german"]}}">&nbsp;{%endif%}Grenade Bundles
{# Some versions of Java require <img> tags to have the width and height specified!?! #}
{%if PLAYER_FLAGS["german"]%}<img src="{{PLAYER_FLAGS["german"]}}" {{PLAYER_FLAG_SIZE}}>&nbsp;{%endif%}Grenade Bundles
<tr>
<td style="padding:2px 5px;">

@ -15,7 +15,8 @@ ul { margin: 0 0 0 10px ; padding: 0 ; }
<tr>
<td colspan="2" style="background: {{PLAYER_COLORS["german"][0]}} ; border-bottom: 1px solid {{PLAYER_COLORS["german"][2]}} ; padding: 2px 5px ; font-weight: bold ;">
{%if PLAYER_FLAGS["german"]%}<img src="{{PLAYER_FLAGS["german"]}}">&nbsp;{%endif%}Molotov Cocktails
{# Some versions of Java require <img> tags to have the width and height specified!?! #}
{%if PLAYER_FLAGS["german"]%}<img src="{{PLAYER_FLAGS["german"]}}" {{PLAYER_FLAG_SIZE}}>&nbsp;{%endif%}Molotov Cocktails
<tr>
<td style="padding:0 5px;">

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}MOL Projector
{{INCLUDE:player_flag}}MOL Projector
<tr>

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}Molotov Cocktail
{{INCLUDE:player_flag}}Molotov Cocktail
<tr>
<td style="padding:0 5px;">

@ -28,7 +28,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}{{PLAYER_NAME}} {{VO_TYPE}} Notes
{{INCLUDE:player_flag}}{{PLAYER_NAME}} {{VO_TYPE}} Notes
{%if OB_MA_NOTES%}
<tr> <td style="padding: 0 5px;">

@ -17,7 +17,7 @@
font-weight: bold ;
{%if OB_SETUP_WIDTH%} width: {{OB_SETUP_WIDTH}} ; {%endif%}
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}{{OB_SETUP}}
{{INCLUDE:player_flag}}{{OB_SETUP}}
</table>

@ -1 +1,4 @@
{%if vo.image%} <img src="{{vo.image}}"> {%endif%}
{# Some versions of Java require <img> tags to have the width and height specified!?! #}
{%if vo.image%} <img src="{{vo.image}}"
{%if vo.small_piece%} width="48" height="48" {%else%} width="60" height="60" {%endif%}
> {%endif%}

@ -22,7 +22,7 @@
padding: 2px 5px 0 5px ;
font-weight: bold ;
">
<nobr>{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}{{PLAYER_NAME|nbsp}}&nbsp;{{VO_TYPES}}</nobr>
<nobr>{{INCLUDE:player_flag}}{{PLAYER_NAME|nbsp}}&nbsp;{{VO_TYPES}}</nobr>
{%for vo in OB_VO%}

@ -17,7 +17,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}{{VO_NAME}}
{{INCLUDE:player_flag}}{{VO_NAME}}
<tr>
<td style="padding-top:2px;"> {{VO_NOTE_HTML}}

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}Panzerfaust
{{INCLUDE:player_flag}}Panzerfaust
<tr>

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}PIAT
{{INCLUDE:player_flag}}PIAT
<tr>

@ -0,0 +1,2 @@
{# Some versions of Java require <img> tags to have the width and height specified!?! #}
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}" {{PLAYER_FLAG_SIZE}}>&nbsp;{%endif%}

@ -13,8 +13,9 @@
">
<td style="font-weight:bold;">
{%if PLAYER_FLAG_1%}<img src="{{PLAYER_FLAG_1}}">&nbsp;{%endif%}{{PLAYER_1_NAME}}: <br>
{%if PLAYER_FLAG_2%}<img src="{{PLAYER_FLAG_2}}">&nbsp;{%endif%}{{PLAYER_2_NAME}}:
{# Some versions of Java require <img> tags to have the width and height specified!?! #}
{%if PLAYER_FLAG_1%}<img src="{{PLAYER_FLAG_1}}" {{PLAYER_FLAG_SIZE}}>&nbsp;{%endif%}{{PLAYER_1_NAME}}: <br>
{%if PLAYER_FLAG_2%}<img src="{{PLAYER_FLAG_2}}" {{PLAYER_FLAG_SIZE}}>&nbsp;{%endif%}{{PLAYER_2_NAME}}:
<td style="padding-left:2px;">
ELR: {{PLAYER_1_ELR}} <br>

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}Panzerschrek
{{INCLUDE:player_flag}}Panzerschrek
<tr>

@ -16,7 +16,7 @@
padding: 2px 5px ;
font-weight: bold ;
">
{%if PLAYER_FLAG%}<img src="{{PLAYER_FLAG}}">&nbsp;{%endif%}Tank-Hunter Heroes
{{INCLUDE:player_flag}}Tank-Hunter Heroes
<tr>

@ -130,6 +130,8 @@ function make_snippet( $btn, params, extra_params, show_date_warnings )
APP_URL_BASE + gImagesBaseUrl ;
if ( gUserSettings["custom-list-bullets"] )
params.CUSTOM_LIST_BULLETS = true ;
// some versions of Java require <img> tags to have the width and height specified!?!
params.PLAYER_FLAG_SIZE = "width='11' height='11'" ;
// set player-specific parameters
var player_no = get_player_no_for_element( $btn ) ;
@ -382,7 +384,7 @@ function make_snippet( $btn, params, extra_params, show_date_warnings )
for ( var key in gTemplatePack.css )
templ = strReplaceAll( templ, "{{CSS:"+key+"}}", gTemplatePack.css[key] ) ;
for ( key in gTemplatePack.includes )
templ = strReplaceAll( templ, "{{INCLUDE:"+key+"}}", gTemplatePack.includes[key] ) ;
templ = strReplaceAll( templ, "{{INCLUDE:"+key+"}}", gTemplatePack.includes[key].trim() ) ;
var func ;
try {
func = jinja.compile( templ ).render ;

@ -48,8 +48,8 @@ def test_online_images( webapp, webdriver ):
# test player flags
do_test( "players",
re.compile( r'<img src="http://vasl-templates.org/.+/flags/german.png">' ),
re.compile( r'<img src="http://[a-z0-9.]+:\d+/flags/german">' )
re.compile( r'<img src="http://vasl-templates.org/.+/flags/german.png"' ),
re.compile( r'<img src="http://[a-z0-9.]+:\d+/flags/german"' )
)
# test custom list bullets
@ -61,8 +61,8 @@ def test_online_images( webapp, webdriver ):
# test VASL counter images
select_tab( "ob1" )
do_test( "ob_vehicles_1",
re.compile( r'<img src="https://raw.githubusercontent.com/.+/ge/veh/pzivh.gif">' ),
re.compile( r'<img src="http://[a-z0-9.]+:\d+/counter/2584/front">' )
re.compile( r'<img src="https://raw.githubusercontent.com/.+/ge/veh/pzivh.gif"' ),
re.compile( r'<img src="http://[a-z0-9.]+:\d+/counter/2584/front"' )
)
# ---------------------------------------------------------------------
@ -95,7 +95,7 @@ def test_multiple_images( webapp, webdriver ):
btn = find_child( "button[data-id='ob_vehicles_1']" )
btn.click()
wait_for_clipboard( 2,
re.compile( r'<img src="https://raw.githubusercontent.com/.+/br/vehicles/portee.gif">')
re.compile( r'<img src="https://raw.githubusercontent.com/.+/br/vehicles/portee.gif"')
)
# select the second image for the vehicle
@ -114,7 +114,7 @@ def test_multiple_images( webapp, webdriver ):
btn = find_child( "button[data-id='ob_vehicles_1']" )
btn.click()
wait_for_clipboard( 2,
re.compile( r'<img src="https://raw.githubusercontent.com/.+/br/vehicles/portee0.gif">')
re.compile( r'<img src="https://raw.githubusercontent.com/.+/br/vehicles/portee0.gif"')
)
# ---------------------------------------------------------------------
@ -152,11 +152,11 @@ def test_extensions( webapp, webdriver ):
btn = find_child( "button[data-id='ob_vehicles_1']" )
btn.click()
wait_for_clipboard( 2, re.compile(
'<img src="http://vasl-templates.org/.+/f97/matii2-4cmg.gif">'
'<img src="http://vasl-templates.org/.+/f97/matii2-4cmg.gif"'
'.+'
'<img src="http://vasl-templates.org/.+/f97/matii2-6cmg.gif">'
'<img src="http://vasl-templates.org/.+/f97/matii2-6cmg.gif"'
'.+'
'<img src="https://raw.githubusercontent.com/.+/ru/veh/T60M40.gif">'
'<img src="https://raw.githubusercontent.com/.+/ru/veh/T60M40.gif"'
'.+'
'<img src="http://vasl-templates.org/.+/f97/T60M40.gif">'
'<img src="http://vasl-templates.org/.+/f97/T60M40.gif"'
, re.DOTALL ) )

Loading…
Cancel
Save