aboutsummaryrefslogtreecommitdiff
path: root/views/default/js/photos
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-08-02 21:15:33 +0200
committerSem <sembrestels@riseup.net>2012-08-02 21:15:33 +0200
commita7fd00b23708431d9875f1e7cd1743558ff25c5b (patch)
treeb4f0fad648a5c88875d6337b5ffd7dfad66b33f3 /views/default/js/photos
parent71e6db3c3dff9c9ec7e8109fc990f0d960273c9f (diff)
parent3ef058394574c630726c955ba2a54a63df453d08 (diff)
downloadelgg-a7fd00b23708431d9875f1e7cd1743558ff25c5b.tar.gz
elgg-a7fd00b23708431d9875f1e7cd1743558ff25c5b.tar.bz2
Merge branch 'colorbox' of git://github.com/sembrestels/Tidypics
Conflicts: manifest.xml start.php
Diffstat (limited to 'views/default/js/photos')
-rw-r--r--views/default/js/photos/tidypics.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/views/default/js/photos/tidypics.php b/views/default/js/photos/tidypics.php
index c97a1eadb..1ff7b2c40 100644
--- a/views/default/js/photos/tidypics.php
+++ b/views/default/js/photos/tidypics.php
@@ -9,8 +9,20 @@ elgg.provide('elgg.tidypics');
elgg.tidypics.init = function() {
- if ($(".tidypics-lightbox").length) {
- $(".tidypics-lightbox").fancybox({'type': 'image'});
+ if (elgg.ui.lightbox) {
+ $('.elgg-lightbox, .elgg-lightbox-photo').colorbox({
+ href: function() {
+ if ((new RegExp("photos/image/[0-9]+", 'i')).test($(this).attr('href'))) {
+ var guid = (new RegExp("photos/image/[0-9]+", 'i')).exec($(this).attr('href')).toString().substr("photos/image/".length);
+ return elgg.config.wwwroot + "photos/thumbnail/" + guid + "/large";
+ } else {
+ return $(this).attr('href');
+ }
+ },
+ title: function() {
+ return '<h3 style="display: inline">'+ $(this).find('img').attr('title') +'</h3> - <a href="'+ $(this).attr('href') +'">'+ elgg.echo('comments') +'</a>';
+ }
+ });
}
$("#tidypics-sort").sortable({