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

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

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

  • Property svn:eol-style set to LF
File size: 1.9 KB
RevLine 
[12796]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}>
[12855]5{if count($current.unique_derivatives)>1}
[12796]6{footer_script}{literal}
[12797]7function changeImgSrc(url,type,display)
[12796]8{
9        var theImg = document.getElementById("theMainImage");
10        if (theImg)
11        {
12                theImg.removeAttribute("width");theImg.removeAttribute("height");
13                theImg.src = url;
[12797]14                var elt = document.getElementById("derivativeSwitchLink");
15                if (elt) elt.innerHTML = display;
[12796]16        }
17        document.cookie = 'picture_deriv=' + type;
18}
[12797]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}
[12796]34{/literal}{/footer_script}
[12797]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">
[12855]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>
[12796]39{/foreach}
[12855]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}
[12797]43</div>
[12796]44{/if}
Note: See TracBrowser for help on using the repository browser.