]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
displaying the labels on tags now
authorcash <cash.costello@gmail.com>
Mon, 2 Jan 2012 20:40:23 +0000 (15:40 -0500)
committercash <cash.costello@gmail.com>
Mon, 2 Jan 2012 20:40:23 +0000 (15:40 -0500)
views/default/js/photos/tagging.php
views/default/object/image/full.php
views/default/photos/css.php
views/default/photos/tagging/tag.php
views/default/photos/tagging/tags.php

index b00200e740ef3b15167009cd73104626120b7608..47bab9de5cbc5946fee8cc6976472b95f58b9005 100644 (file)
@@ -102,9 +102,14 @@ elgg.tidypics.tagging.position = function() {
        tag_left += image_pos.left;
        tag_top += image_pos.top;
 
-       $(this).css({
+       $(this).parent().css({
                left: tag_left + 'px',
-               top: tag_top + 'px',
+               top: tag_top + 'px' /*
+               width: tag_width + 'px',
+               height: tag_height + 'px' */
+       });
+
+       $(this).css({
                width: tag_width + 'px',
                height: tag_height + 'px'
        });
@@ -117,19 +122,19 @@ elgg.tidypics.tagging.toggleTagHover = function() {
        if (elgg.tidypics.tagging.tag_hover == false) {
                $('.tidypics-photo').hover(
                        function() {
-                               $('.tidypics-tag').show();
+                               $('.tidypics-tag-wrapper').show();
                        },
                        function() {
-                               $('.tidypics-tag').hide();
+                               $('.tidypics-tag-wrapper').hide();
                        }
                );
        } else {
                $('.tidypics-photo').hover(
                        function() {
-                               $('.tidypics-tag').hide();
+                               $('.tidypics-tag-wrapper').hide();
                        },
                        function() {
-                               $('.tidypics-tag').hide();
+                               $('.tidypics-tag-wrapper').hide();
                        }
                );
        }
index e12e968068cf7314d77925d4903a2baae14df3d9..175519c1623207da0eb280380ec484519f6ab782 100644 (file)
@@ -49,7 +49,7 @@ $summary = elgg_view_image_block($owner_icon, $list_body, $params);
 
 echo $summary;
 
-echo '<div class="tidypics-wrapper-photo">';
+echo '<div class="tidypics-photo-wrapper center">';
 echo elgg_view('object/image/navigation', $vars);
 echo elgg_view('photos/tagging/help', $vars);
 echo elgg_view('photos/tagging/select', $vars);
index 23926adbc8e8779b0f27e7fa85676b762970521c..3e18d1908fde694aa0a2524824ba4472b218aef1 100644 (file)
 .tidypics-gallery-widget > li {
        width: 100%;
 }
-
+/*
+.tidypics-lightbox {
+       margin: 0 auto;
+       display: block;
+       width: auto;
+}
+*/
+/*
 .tidypics-photo {
        margin: 0 auto;
        display: block;
 }
-
-.tidypics-wrapper-photo {
+*/
+.tidypics-photo-wrapper {
        position: relative;
 }
 
        max-width: 300px;
 }
 
-.tidypics-tag {
+.tidypics-tag-wrapper {
        display: none;
        position: absolute;
+}
+
+.tidypics-tag {
        border: 2px solid white;
+       clear: both;
+}
+
+.tidypics-tag-label {
+       float: left;
+       margin-top: 5px;
 }
 
 <?php
index 4d3affeb622cc2166275b0cb934abf45d73f5415..93ea1621898121ea4a8c1d9f052559a5057dfd4a 100644 (file)
@@ -3,6 +3,9 @@
  * Photo tag view
  *
  * @uses $vars['tag'] Tag object
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  */
 
 $coords = json_decode('{' . $vars['tag']->coords . '}');
@@ -15,10 +18,19 @@ $attributes = elgg_format_attributes(array(
        'data-height' => $coords->height,
 ));
 
-//var_dump($vars['tag']);
-//$text = "This is a something";
+if ($vars['tag']->type == 'user') {
+       $user = get_entity($vars['tag']->value);
+       $label = elgg_view('output/url', array(
+               'text' => $user->name,
+               'href' => $user->getURL(),
+       ));
+} else {
+       $label = $vars['tag']->value;
+}
 
 echo <<<HTML
-<div $attributes>
+<div class="tidypics-tag-wrapper">
+       <div $attributes></div>
+       <div class="elgg-module-popup tidypics-tag-label">$label</div>
 </div>
 HTML;
index 7a4aa3a59836d628e8de06d6d80df47b4a7656ae..29c9d0efba8d4dce6d01b74fceb54c5ca84eeb12 100644 (file)
@@ -3,6 +3,9 @@
  * View the tags for this image
  *
  * @uses $vars['entity']
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  */
 
 $tags = $vars['entity']->getPhotoTags();