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

Revision 6453, 2.1 KB checked in by plg, 10 years ago (diff)

new theme Kardon by galain, converted for Piwigo 2.1

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