source: extensions/Autosize/template/picture.tpl @ 17192

Last change on this file since 17192 was 17192, checked in by cljosse, 12 years ago

[extensions] Autosize fix compatibility with 2.4, new options

File size: 2.0 KB
Line 
1 <style type="text/css">
2         #bp_cla {ldelim}
3  cursor:pointer;
4}
5     </style>
6
7{php}
8global $picture;
9$zoom=$_POST['zoom'];
10$this->assign('zoom', $zoom );
11
12{/php}
13 <a onclick = "Toggle_bp()"  id="bp_cla"
14    title="{'cl_autosize_info_2'|@translate}"
15    alt="{'cl_autosize_info_2'|@translate}" />
16    <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/><span></span>
17  </a>
18
19
20
21 <script language="JavaScript" type="text/javascript">
22   var src1="{$cl_autosize_button.ICON}";
23   var src2="{$cl_autosize_button.ICON2}";
24   var src3="{'cl_autosize_info_2'|@translate}";
25   var src4 = "{'cl_autosize_info'|@translate}";
26   var src5 = "{'cl_autosize_info_1'|@translate}";
27   var src6 = "{$cl_autosize_button.ICON1}";
28
29   {if $ASP.width}
30   jQuery(window).load(function () {ldelim}
31   var asp_options ={ldelim} };
32   if(typeof $("#imageToolBar") !="undefined" )
33   var w = $("#imageToolBar").width();
34   if (w === null) {ldelim} w = $("#theImage").width(); }
35   if (w < {$ASP.min_viewport_width}) {ldelim} w = .75 * $("#theImage").width(); }
36        var m = w;
37        w = w * ( Math.min( Math.max({$ASP.viewport_width} / 100, .5) , 1 ));
38        w = Math.round(Math.min( {$ASP.max_viewport_width} , Math.max( {$ASP.min_viewport_width}, w) ));
39        var s = (100 - {$ASP.speed}) * 2000;
40        var p = Math.round(Math.min(Math.max({$ASP.width} * ( {$ASP.start_position} / 100 ), 0), {$ASP.width}));
41        if ({$ASP.width} > w) {ldelim}
42                $("#theImage img").eq(0).removeAttr("style").attr({ldelim}width:{$ASP.width},height:{$ASP.height}}).addClass("simple_panorama");
43                asp_options = {ldelim}
44                                         viewport_width: w,
45                                         speed: s,
46                                         direction: '{$ASP.direction}',
47                                         control_display: '{$ASP.control_display}',
48                                         start_position : p,
49                                         auto_start : {$ASP.auto_start},
50                                         mode_360 : {$ASP.mode_360},
51                                         loop_180 : {$ASP.loop_180}
52                         };
53                //$("#theImage img.simple_panorama").panorama(asp_options);
54        };
55 });
56  {/if}
57 </script>
58
Note: See TracBrowser for help on using the repository browser.