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

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

feature 2541 multisize

  • nicer presentation on picture.php
  • added a maintenance purge derivatives action
  • Property svn:eol-style set to LF
File size: 1.7 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.available_derivative_types)>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.available_derivative_types item=derivative_type}
38<a onclick="changeImgSrc('{$current.derivatives[$derivative_type]->get_url()|@escape:javascript}', '{$derivative_type}', '{$derivative_type|@translate|@escape:javascript}')" style="cursor:pointer">{$derivative_type|@translate} ({$current.derivatives[$derivative_type]->get_size_hr()})</a><br>
39{/foreach}
40</div>
41{/if}
Note: See TracBrowser for help on using the repository browser.