]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Added support for colorbox.
authorSem <sembrestels@riseup.net>
Wed, 1 Aug 2012 16:45:25 +0000 (18:45 +0200)
committerSem <sembrestels@riseup.net>
Wed, 1 Aug 2012 16:45:25 +0000 (18:45 +0200)
classes/TidypicsAlbum.php
manifest.xml
start.php
views/default/js/photos/tidypics.php
views/default/object/image/full.php
views/default/object/image/summary.php
views/default/photos/css.php
views/default/river/object/album/create.php
views/default/river/object/image/create.php
views/default/river/object/tidypics_batch/create.php

index a03df2d3794c1e344e3fa2b049abfb73c77e9e21..0cb8bd84e6f8a1482e6a98d2ce5768c6a7cd3096 100644 (file)
@@ -128,7 +128,7 @@ class TidypicsAlbum extends ElggObject {
                        'list_type' => 'gallery',
                        'list_type_toggle' => false,
                        'pagination' => true,
-                       'gallery_class' => 'tidypics-gallery',
+                       'gallery_class' => 'tidypics-gallery elgg-lightbox-gallery',
                );
 
                $options = array_merge($defaults, (array) $options);
index 3f4025988e6a039a90365803f2580abdbea0915f..75a25e4b92dc2d7f43558fa054c57251942e1bb1 100644 (file)
                <type>elgg_release</type>
                <version>1.8</version>
        </requires>
+       <suggests>
+               <type>plugin</type>
+               <name>colorbox</name>
+               <version>1.8</version>
+       </suggests>
+       <requires>
+               <type>priority</type>
+               <priority>after</priority>
+               <plugin>colorbox</plugin>
+       </requires>
 </plugin_manifest>
\ No newline at end of file
index 1b487321d269f36073713b9a1fe06e1638268a9a..7de36b29f8d0b2a76eaef683e504e271a8e2ec0c 100644 (file)
--- a/start.php
+++ b/start.php
@@ -120,6 +120,8 @@ function tidypics_page_handler($page) {
                return false;
        }
 
+       elgg_load_js('lightbox');
+       elgg_load_css('lightbox');
        elgg_load_js('tidypics');
 
        $base = elgg_get_plugins_path() . 'tidypics/pages/photos';
index c97a1eadb1c39ea06f3a7ecb5893becc398d6a59..20dcc403ed1a68e29060efd9f5a8a04038b6f84b 100644 (file)
@@ -9,8 +9,14 @@ elgg.provide('elgg.tidypics');
 
 elgg.tidypics.init = function() {
 
-       if ($(".tidypics-lightbox").length) {
-               $(".tidypics-lightbox").fancybox({'type': 'image'});
+       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');
+                       }
+               });
        }
 
        $("#tidypics-sort").sortable({
index 175519c1623207da0eb280380ec484519f6ab782..9b5c1315a19263cbc66745c605938e07dfbddde8 100644 (file)
@@ -13,10 +13,8 @@ $image = $photo = $vars['entity'];
 $img = elgg_view_entity_icon($image, 'large', array(
        'href' => $image->getIconURL('master'),
        'img_class' => 'tidypics-photo',
-       'link_class' => 'tidypics-lightbox',
+       'link_class' => 'tidypics-lightbox elgg-lightbox-photo',
 ));
-elgg_load_js('lightbox');
-elgg_load_css('lightbox');
 
 $owner_link = elgg_view('output/url', array(
        'href' => "photos/owner/" . $photo->getOwnerEntity()->username,
index ed8ceff38c1296b0e149c6d83d14addea5db699c..34a726353337f9e18360b1db796a922b5c315d94 100644 (file)
@@ -10,7 +10,6 @@
 
 $image = elgg_extract('entity', $vars);
 
-$img = elgg_view_entity_icon($image, 'small');
 
 $header = elgg_view('output/url', array(
        'text' => $image->getTitle(),
@@ -19,11 +18,12 @@ $header = elgg_view('output/url', array(
        'class' => 'tidypics-heading',
 ));
 
-$body = elgg_view('output/url', array(
-       'text' => $img,
+$body = elgg_view_entity_icon($image, 'small', array(
        'href' => $image->getURL(),
+       'img_class' => 'tidypics-photo',
        'encode_text' => false,
        'is_trusted' => true,
+       'link_class' => 'tidypics-lightbox elgg-lightbox',
 ));
 
 /*
index 2290e1f9a157c1f6d94dd40878e6ccdc43f0cffc..8fa7f730cba2c82953201e60832ee29e7b8e55f9 100644 (file)
@@ -18,6 +18,7 @@
 }
 .elgg-module-tidypics-image {
        margin: 5px auto;
+       height: 80%;
 }
 
 .tidypics-gallery-widget > li {
index c8c79f406c6d31b0b7afb970c83d46d325175a26..2269b2eb6cd024775fc6c8b3eb6e3f16dda1a794 100644 (file)
@@ -6,6 +6,10 @@
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  */
 
+elgg_load_css('lightbox');
+elgg_load_js('lightbox');
+elgg_load_js('tidypics');
+
 $album = $vars['item']->getObjectEntity();
 
 $album_river_view = elgg_get_plugin_setting('album_river_view', 'tidypics');
@@ -18,10 +22,12 @@ if ($album_river_view == "cover") {
        $images = $album->getImages(7);
 
        if (count($images)) {
-               $attachments = '<ul class="tidypics-river-list">';
+               $attachments = '<ul class="tidypics-river-list elgg-lightbox-gallery">';
                foreach($images as $image) {
                        $attachments .= '<li class="tidypics-photo-item">';
-                       $attachments .= elgg_view_entity_icon($image, 'tiny');
+                       $attachments .= elgg_view_entity_icon($image, 'tiny', array(
+                               'link_class' => 'tidypics-lightbox elgg-lightbox',
+                       ));
                        $attachments .= '</li>';
                }
                $attachments .= '</ul>';
index 08cfdc550f943b6fcf40168e304e55e510b370be..c34e6b309901e32846b29ee8b2a552bc388bfe2a 100644 (file)
@@ -6,6 +6,10 @@
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  */
 
+elgg_load_css('lightbox');
+elgg_load_js('lightbox');
+elgg_load_js('tidypics');
+
 $subject = $vars['item']->getSubjectEntity();
 $subject_link = elgg_view('output/url', array(
        'href' => $subject->getURL(),
@@ -21,6 +25,7 @@ $image_link = elgg_view('output/url', array(
        'href' => $image->getURL(),
        'text' => $image->getTitle(),
        'is_trusted' => true,
+       'class' => 'elgg-lightbox',
 ));
 
 $album_link = elgg_view('output/url', array(
index dc47284d2e1806b21b7d22d091af0613bca8c660..3908f824d57ea00de1f5e6037d9ec7ac022469d6 100644 (file)
@@ -6,6 +6,10 @@
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  */
 
+elgg_load_css('lightbox');
+elgg_load_js('lightbox');
+elgg_load_js('tidypics');
+
 $batch = $vars['item']->getObjectEntity();
 
 // Get images related to this batch
@@ -38,10 +42,12 @@ $subject_link = elgg_view('output/url', array(
 ));
 
 if (count($images)) {
-       $attachments = '<ul class="tidypics-river-list">';
+       $attachments = '<ul class="tidypics-river-list elgg-lightbox-gallery">';
        foreach($images as $image) {
                $attachments .= '<li class="tidypics-photo-item">';
-               $attachments .= elgg_view_entity_icon($image, 'tiny');
+               $attachments .= elgg_view_entity_icon($image, 'tiny', array(
+                       'link_class' => 'tidypics-lightbox elgg-lightbox',
+               ));
                $attachments .= '</li>';
        }
        $attachments .= '</ul>';