]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Icon added to likes and interface tweaked. Likes list js fixed to correctly get heigh...
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 12 Apr 2010 12:05:27 +0000 (12:05 +0000)
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 12 Apr 2010 12:05:27 +0000 (12:05 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5695 36083f99-b078-4883-b0ff-0f9b5a30f544

_graphics/icon_like.png [new file with mode: 0644]
languages/en.php
views/default/css.php
views/default/js/initialise_elgg.php
views/default/likes/forms/edit.php

diff --git a/_graphics/icon_like.png b/_graphics/icon_like.png
new file mode 100644 (file)
index 0000000..e610424
Binary files /dev/null and b/_graphics/icon_like.png differ
index 1e08cd309029e04cc7fae9578918664e5420ca21..7b711c725ae9146f734dc3525b857bf6e9ff1daa 100644 (file)
@@ -838,12 +838,13 @@ If you requested this click on the link below, otherwise ignore this email.
  **/
        'likes:this' => 'liked this',
        'likes:deleted' => 'Your like has been removed',
+       'likes:remove' => 'See who else liked this',
        'likes:notdeleted' => 'There was a problem removing your like',
        'likes:likes' => 'You now like this item',
        'likes:failure' => 'There was a problem liking this item',
        'likes:alreadyliked' => 'You have already liked this item',
        'likes:notfound' => 'The item you are trying to like cannot be found',
-       'likes:likethis' => 'Like',
+       'likes:likethis' => 'Like this',
        'likes:userlikedthis' => 'user',
        'likes:userslikedthis' => 'users',
        'likes:river:annotate' => 'likes',
index cc7e864517d2a7393df24ef5d2eed8c28c313576..e2a8d59b5d86d1cc03befddd16b9f87b9ee9090a 100644 (file)
@@ -1447,13 +1447,35 @@ a.action_button:focus {
 /* ***************************************
        LIKES
 *************************************** */
-.user_like_holder {
-       float:right;
-}
 .likes_list_holder {
     position: relative;
     float:right;
 }
+.likes_list_holder a.user_like {
+       cursor:pointer;
+       background: url(<?php echo $vars['url']; ?>_graphics/icon_like.png) no-repeat left -2px;
+       text-indent: -9000em;
+       text-align: left;
+       display:block;
+       width:20px;
+       height:20px;
+       margin:0;
+       float:left;
+}
+.likes_list_holder a.user_like:hover {
+       background-position: left -32px;
+}
+.likes_list_holder .likes_list_button.link {
+       float:left;
+       text-align: left;
+       background: url(<?php echo $vars['url']; ?>_graphics/icon_like.png) no-repeat left -32px;
+       padding-left:21px;
+       height:20px;
+}
+.likes_list_holder .likes_list_button.link.not_liked {
+       background:none;
+       padding-left:0;
+}
 .likes_list_holder .likes_list {
        background-color: white;
        border:1px solid #cccccc;
index 4679f551cc3eaa1bd958170bccc3867d28fc4168..056e22ee047c7dc5371bbd49aeb797a848228528 100644 (file)
@@ -56,12 +56,12 @@ $(document).ready(function () {
        // user likes
        $(".likes_list_button").click(function(event) { 
                if ($(this).next(".likes_list").css('display') == 'none') {     // show list
-                       var topPosition = -$('.likes_list').height();
+                       var topPosition = - $(this).next(".likes_list").height();
                        $('.likes_list').css('top',topPosition + 10);
                        $('.likes_list').css('left', -$('.likes_list').width()+40);
                        $(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500);
                } else { // hide list
-                       var topPosition = -$('.likes_list').height() + 5;
+                       var topPosition = - $(this).next(".likes_list").height() + 5;
                        $(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500);
                }
        });
index 1e9cbd02c69497c9c7ce7161e0ab86ff09880f83..99dbe598b5c14aa6eeee94ab783fd5462d0292ca 100644 (file)
 if (isset($vars['entity']) && isloggedin()) {
        $guid = $vars['entity']->getGuid();
        $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}");
+       
+       echo "<span class='likes_list_holder'>";
        //check to see if the user has already liked
        if (!elgg_annotation_exists($guid, 'likes') ) {
-               echo "<span class='user_like_holder'><a class='user_like link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a></span>";
+               echo "<a class='user_like link' title='".elgg_echo('likes:likethis')."' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>";
+               $likes_classname = "not_liked";
+               $likes_titletag = "";
+       } else {
+               $likes_titletag = "title='".elgg_echo('likes:remove')."'";
        }
        //display the number of likes
        $numoflikes = elgg_count_likes($vars['entity']);
@@ -25,13 +31,14 @@ if (isset($vars['entity']) && isloggedin()) {
                        $user_string = elgg_echo('likes:userslikedthis');
                }
 
-               echo "<span class='likes_list_holder'><a class='likes_list_button link'>+" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>";
+               echo "<a class='likes_list_button link {$likes_classname}' {$likes_titletag}>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>";
 
                //show the users who liked the object
                echo "<div class='likes_list hidden clearfloat'>";
                echo list_annotations($vars['entity']->getGUID(), 'likes', 99);
-               echo "</div></span>";   
+               echo "</div>";  
        }
+       echo "</span>"; 
 }