]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Ajax views was messy and wasn't resizing well, moved to only images.
authorSem <sembrestels@riseup.net>
Wed, 1 Aug 2012 18:32:15 +0000 (20:32 +0200)
committerSem <sembrestels@riseup.net>
Wed, 1 Aug 2012 18:32:15 +0000 (20:32 +0200)
start.php
views/default/js/photos/tidypics.php
views/default/object/image/summary.php
views/default/river/object/album/create.php
views/default/river/object/image/create.php
views/default/river/object/tidypics_batch/create.php

index 7de36b29f8d0b2a76eaef683e504e271a8e2ec0c..b47b71d81e8cd095485fc5d4c541752ed7735997 100644 (file)
--- a/start.php
+++ b/start.php
@@ -44,7 +44,7 @@ function tidypics_init() {
        $js = elgg_get_simplecache_url('js', 'photos/uploading');
        elgg_register_simplecache_view('js/photos/uploading');
        elgg_register_js('tidypics:uploading', $js, 'footer');
-
+       
        elgg_register_js('swfobject', 'mod/tidypics/vendors/uploadify/swfobject.js', 'footer');
        elgg_register_js('jquery.uploadify-tp', 'mod/tidypics/vendors/uploadify/jquery.uploadify.v2.1.1.min.js', 'footer');
 
index 20dcc403ed1a68e29060efd9f5a8a04038b6f84b..8690898501f7647176bcfc7018122a52234bb07c 100644 (file)
@@ -9,12 +9,14 @@ elgg.provide('elgg.tidypics');
 
 elgg.tidypics.init = function() {
 
-       if ($.colorbox) {
-               $(".elgg-gallery .tidypics-lightbox").colorbox({
-                       onComplete: function() {
-                               $('#cboxLoadedContent .elgg-page-topbar, #cboxLoadedContent .elgg-page-header, ' +
-                                       '#cboxLoadedContent .elgg-page-footer, #cboxLoadedContent .elgg-sidebar').css('display', 'none');
-                               $('#cboxLoadedContent .elgg-layout').css('background-image', 'none');
+       if (elgg.ui.lightbox) {
+               $('.elgg-lightbox, .elgg-lightbox-photo').colorbox({
+                       href: function() {
+                               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";
+                       },
+                       title: function() {
+                               return '<h3 style="display: inline">'+ $(this).find('img').attr('title') +'</h3> - <a href="'+ $(this).attr('href') +'">'+ elgg.echo('comments') +'</a>';
                        }
                });
        }
index 34a726353337f9e18360b1db796a922b5c315d94..0fa03cbe845d4ae5fb940ec12eb930bf19d624e6 100644 (file)
@@ -23,7 +23,7 @@ $body = elgg_view_entity_icon($image, 'small', array(
        'img_class' => 'tidypics-photo',
        'encode_text' => false,
        'is_trusted' => true,
-       'link_class' => 'tidypics-lightbox elgg-lightbox',
+       'link_class' => 'tidypics-lightbox elgg-lightbox-photo',
 ));
 
 /*
index 2269b2eb6cd024775fc6c8b3eb6e3f16dda1a794..29620041f95cb856a1c9c8354beb49172525ddc1 100644 (file)
@@ -26,7 +26,7 @@ if ($album_river_view == "cover") {
                foreach($images as $image) {
                        $attachments .= '<li class="tidypics-photo-item">';
                        $attachments .= elgg_view_entity_icon($image, 'tiny', array(
-                               'link_class' => 'tidypics-lightbox elgg-lightbox',
+                               'link_class' => 'tidypics-lightbox elgg-lightbox-photo',
                        ));
                        $attachments .= '</li>';
                }
index c34e6b309901e32846b29ee8b2a552bc388bfe2a..6b68b4d68df363c7a46824e9830ccbe5b266f539 100644 (file)
@@ -25,7 +25,7 @@ $image_link = elgg_view('output/url', array(
        'href' => $image->getURL(),
        'text' => $image->getTitle(),
        'is_trusted' => true,
-       'class' => 'elgg-lightbox',
+       'class' => 'elgg-lightbox-photo',
 ));
 
 $album_link = elgg_view('output/url', array(
index 3908f824d57ea00de1f5e6037d9ec7ac022469d6..b97c853a357d9a988c513ccdd995a3134f251c7c 100644 (file)
@@ -46,7 +46,7 @@ if (count($images)) {
        foreach($images as $image) {
                $attachments .= '<li class="tidypics-photo-item">';
                $attachments .= elgg_view_entity_icon($image, 'tiny', array(
-                       'link_class' => 'tidypics-lightbox elgg-lightbox',
+                       'link_class' => 'tidypics-lightbox elgg-lightbox-photo',
                ));
                $attachments .= '</li>';
        }