aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/js/photos/tidypics.php16
-rw-r--r--views/default/object/image/full.php4
-rw-r--r--views/default/object/image/summary.php6
-rw-r--r--views/default/photos/css.php1
-rw-r--r--views/default/river/object/album/create.php10
-rw-r--r--views/default/river/object/image/create.php5
-rw-r--r--views/default/river/object/tidypics_batch/create.php10
7 files changed, 40 insertions, 12 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({
diff --git a/views/default/object/image/full.php b/views/default/object/image/full.php
index 4e2c02a9a..74436f500 100644
--- a/views/default/object/image/full.php
+++ b/views/default/object/image/full.php
@@ -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,
diff --git a/views/default/object/image/summary.php b/views/default/object/image/summary.php
index ed8ceff38..0fa03cbe8 100644
--- a/views/default/object/image/summary.php
+++ b/views/default/object/image/summary.php
@@ -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-photo',
));
/*
diff --git a/views/default/photos/css.php b/views/default/photos/css.php
index 0e0bbf5b4..49a7e139a 100644
--- a/views/default/photos/css.php
+++ b/views/default/photos/css.php
@@ -18,6 +18,7 @@
}
.elgg-module-tidypics-image {
margin: 5px auto;
+ height: 80%;
}
.tidypics-gallery-widget > li {
diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php
index c8c79f406..29620041f 100644
--- a/views/default/river/object/album/create.php
+++ b/views/default/river/object/album/create.php
@@ -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-photo',
+ ));
$attachments .= '</li>';
}
$attachments .= '</ul>';
diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php
index 08cfdc550..6b68b4d68 100644
--- a/views/default/river/object/image/create.php
+++ b/views/default/river/object/image/create.php
@@ -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-photo',
));
$album_link = elgg_view('output/url', array(
diff --git a/views/default/river/object/tidypics_batch/create.php b/views/default/river/object/tidypics_batch/create.php
index dc47284d2..b97c853a3 100644
--- a/views/default/river/object/tidypics_batch/create.php
+++ b/views/default/river/object/tidypics_batch/create.php
@@ -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-photo',
+ ));
$attachments .= '</li>';
}
$attachments .= '</ul>';