source: extensions/kardon/template/slideshow.tpl @ 6458

Last change on this file since 6458 was 6458, checked in by plg, 14 years ago

move the CSS code specific to the slideshow page in a specific CSS stylesheet.

This tip suggested by P@t make feature:1712 useless (and I'll backmerge it)
and make the slideshow work in Piwigo 2.1.1, no need to wait for Piwigo 2.1.2

File size: 2.2 KB
Line 
1{html_head}
2<link rel="stylesheet" type="text/css" href="themes/kardon/slideshow.css">
3{/html_head}
4
5<div id="imageHeaderBar">
6  <div class="browsePath">
7    {if isset($U_SLIDESHOW_STOP) }
8    [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
9    {/if}
10  </div>
11  <div class="imageNumber">{$PHOTO}</div>
12  {if $SHOW_PICTURE_NAME_ON_TITLE }
13  <h2 class="showtitle">{$current.TITLE}</h2>
14  {/if}
15</div>
16
17<div id="imageToolBar">
18  {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
19</div>
20
21<div id="theImage">
22{literal}
23<script type="text/javascript">//<!--
24
25var maxWidth = maxHeight  = margin =  0;
26var finalW = w = {/literal}{$WIDTH_IMG}{literal}, finalH = h = {/literal}{$HEIGHT_IMG}{literal};
27if( typeof( window.innerWidth ) == 'number' ) {
28        //Non-IE
29        maxWidth = window.innerWidth;
30        maxHeight = window.innerHeight;
31} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
32        //IE 6+ in 'standards compliant mode'
33        maxWidth = document.documentElement.clientWidth;
34        maxHeight = document.documentElement.clientHeight;
35} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
36        //IE 4 compatible
37        maxWidth = document.body.clientWidth;
38        maxHeight = document.body.clientHeight;
39}
40maxHeight = maxHeight-32;
41if ((h > maxHeight) || (w > maxWidth)) {
42        if ((h > maxHeight) && (w > maxWidth)) {
43                if (maxHeight-h < maxWidth-w) {
44                        finalH = maxHeight;
45                        finalW = w * finalH / h;
46                        }
47                else {
48                        finalW = maxWidth;
49                        finalH = h * finalW / w;
50                }
51        }
52        else if ((h > maxHeight) && (w < maxWidth)) {
53                finalH = maxHeight;
54                finalW = w * finalH / h;
55        }
56        else if ((h < maxHeight) && (w > maxWidth)) {
57                finalW = maxWidth;
58                finalH = h * finalW / w;
59        }
60}
61if ((maxHeight-finalH) > 0) {
62        margin =  Math.round((maxHeight-finalH) / 2)
63}
64document.writeln("<img style=\"margin-top:"+margin+"px; width:"+finalW+"px;height:"+finalH+"px\" src=\"{/literal}{$SRC_IMG}{literal}\" alt=\"\">");
65
66//-->
67</script>
68{/literal}
69<noscript>
70  <div>
71    <img src="{$SRC_IMG}" style="width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;" alt="{$ALT_IMG}">
72  </div>
73</noscript>
74</div> <!-- theImage -->
Note: See TracBrowser for help on using the repository browser.