source: trunk/themes/default/template/picture_content.tpl @ 12855

Last change on this file since 12855 was 12855, checked in by rvelices, 9 years ago

feature 2548 multisize - improved picture.php display (original...) + code cleanup

  • Property svn:eol-style set to LF
File size: 1.9 KB
Line 
1<img src="{$current.selected_derivative->get_url()}" {$current.selected_derivative->get_size_htm()} alt="{$ALT_IMG}" id="theMainImage"
2{if isset($COMMENT_IMG)}
3        title="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}" {else} title="{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}"
4{/if}>
5{if count($current.unique_derivatives)>1}
6{footer_script}{literal}
7function changeImgSrc(url,type,display)
8{
9        var theImg = document.getElementById("theMainImage");
10        if (theImg)
11        {
12                theImg.removeAttribute("width");theImg.removeAttribute("height");
13                theImg.src = url;
14                var elt = document.getElementById("derivativeSwitchLink");
15                if (elt) elt.innerHTML = display;
16        }
17        document.cookie = 'picture_deriv=' + type;
18}
19
20function toggleDerivativeSwitchBox()
21{
22        var elt = document.getElementById("derivativeSwitchBox"),
23                ePos = document.getElementById("derivativeSwitchLink");
24        if (elt.style.display==="none")
25        {
26                elt.style.position = "absolute";
27                elt.style.left = (ePos.offsetLeft + 10) + "px";
28                elt.style.top = (ePos.offsetTop + ePos.offsetHeight) + "px";
29                elt.style.display="";
30        }
31        else
32                elt.style.display="none";
33}
34{/literal}{/footer_script}
35<a id="derivativeSwitchLink" onclick="toggleDerivativeSwitchBox()" style="cursor:pointer">{$current.selected_derivative->get_type()|@translate}</a>
36<div id="derivativeSwitchBox" onclick="toggleDerivativeSwitchBox()" style="display:none">
37{foreach from=$current.unique_derivatives item=derivative key=derivative_type}
38<a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}', '{$derivative_type}', '{$derivative->get_type()|@translate|@escape:javascript}')" style="cursor:pointer">{$derivative->get_type()|@translate} ({$derivative->get_size_hr()})</a><br>
39{/foreach}
40{if isset($U_ORIGINAL)}
41<a  href="javascript:phpWGOpenWindow('{$U_ORIGINAL}','xxx','scrollbars=yes,toolbar=no,status=no,resizable=yes')" title="{'Click on the photo to see it in high definition'|@translate}">{'original'|@translate}</a>
42{/if}
43</div>
44{/if}
Note: See TracBrowser for help on using the repository browser.