aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-05-11 07:36:59 +1000
committerRedMatrix <info@friendica.com>2014-05-11 07:36:59 +1000
commit1ed210ef0ad38f687d0136e571b87c2ebb4aae9c (patch)
tree878ee3657b539cef409fb8b71d3263605aa26455 /view
parent481b4c21c9ab6e7e6df8f65ef97135fb5807d7fd (diff)
parentd1e0479f58e32c63160c7ad9dbd0c1c2363a1b6c (diff)
downloadvolse-hubzilla-1ed210ef0ad38f687d0136e571b87c2ebb4aae9c.tar.gz
volse-hubzilla-1ed210ef0ad38f687d0136e571b87c2ebb4aae9c.tar.bz2
volse-hubzilla-1ed210ef0ad38f687d0136e571b87c2ebb4aae9c.zip
Merge pull request #454 from chriswinstead/master
Detect high-resolution displays (like retina) and serve higher resolution photo thumbnails
Diffstat (limited to 'view')
-rwxr-xr-xview/tpl/head.tpl3
-rwxr-xr-xview/tpl/photo_view.tpl2
2 files changed, 4 insertions, 1 deletions
diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl
index e7b41523f..a212fd486 100755
--- a/view/tpl/head.tpl
+++ b/view/tpl/head.tpl
@@ -7,6 +7,9 @@
<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
+<script>(function(w){var dpr=((w.devicePixelRatio===undefined)?1:w.devicePixelRatio);if(!!w.navigator.standalone){var r=new XMLHttpRequest();r.open('GET','/retinaimages.php?devicePixelRatio='+dpr,false);r.send()}else{document.cookie='devicePixelRatio='+dpr+'; path=/'}})(window)</script>
+<noscript><style id="devicePixelRatio" media="only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2)">html{background-image:url("/retinaimages.php?devicePixelRatio=2")}</style></noscript>
+
{{$head_css}}
{{$js_strings}}
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index 01f135522..b34f3fcf5 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -9,7 +9,7 @@
</div>
{{if $prevlink}}<div id="photo-prev-link"><a href="{{$prevlink.0}}"><i class="icon-backward photo-icons"></i></div>{{/if}}
-<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;" ><img src="{{$photo.src}}" /></a></div>
+<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;" ><img style="max-width: 100%;" src="{{$photo.src}}" /></a></div>
{{if $nextlink}}<div id="photo-next-link"><a href="{{$nextlink.0}}"><i class="icon-forward photo-icons"></i></a></div>{{/if}}
<div id="photo-photo-end"></div>
<div id="photo-caption">{{$desc}}</div>