[All Adaptavist Apps]

Page tree

We just upgraded to Confluence 3.4 and to Theme Builder 4.2. I have noticed that the Hover Profile (when you hover over a person's name) is not displaying. You get the top part of the profile box but nothing else. I replaced the Theme Builder theme with a generic confluence theme and the hover profile displays just fine.

I have added an attachment to show how it is displaying.

I was wondering if anyone else is having this problem or if we have something configured wrong.

  • No labels

4 Comments

  1. Unknown User (jvisser)

    I have the same issue in confluence 3.4.6. The javascript and html is identical for the default theme, but when i look at what request firebug sends it looks like this

    http://localhost:1990/confluence/display/undefined/users/userinfopopup.action?username=test
    

    It looks like batch.js can't execute AJS.Confluence.getContextPath()

    1. Unknown User (jvisser)

      I found a workaround. Execute this code in the custom Javascript.

      function loadLinkHover() {
          // global list of IDs to ensure user-hovers don't get reloaded unnecessarily
          var users = [],
              contextPath = AJS.Confluence.getContextPath(),
              $ = AJS.$;
      
          var contentHoverPostProcess = function(id) {
              var username = users[id],
                  data = { username: username, target: this };
              $(self).trigger("hover-user.open", data);
              $(".ajs-menu-bar", this).ajsMenu();
              $(".follow-icon, .unfollow-icon", this).each(function() {
                  var $this = $(this).click(function(e) {
                      if ($this.hasClass("waiting")) {
                          return;
                      }
                      var url = $this.hasClass("unfollow-icon") ? "/unfollowuser.action" : "/followuser.action";
                      $this.addClass("waiting");
                      AJS.safe.post(contextPath + url + "?username=" + username + "&mode=blank", function() {
                          $this.removeClass("waiting");
                          $this.parent().toggleClass("follow-item").toggleClass("unfollow-item");
                          $(self).trigger("hover-user.follow", data);
                      });
                      return AJS.stopEvent(e);
                  });
              });
          };
      
          var selectors = [
                  "span.user-hover-trigger",
                  "a.confluence-userlink",
                  "img.confluence-userlink",
                  "a.userLogoLink"
          ].join(", ");
          
          $(selectors).filter("[data-processed!=false]").each(function() {
             var userlink = $(this),
                 username = userlink.attr("data-username");
      
                  // Ensure no "popup" title will clash with the user hover.
             userlink.attr("title", "")
                     .attr("data-processed", "true");
             $("img", userlink).attr("title", "");
      
             var arrayIndex = $.inArray(username, users);
             if (arrayIndex == -1) {
                users.push(username);
                      arrayIndex = $.inArray(username, users);
                  }
                  $(this).addClass("userlink-" + arrayIndex);
              });
              $.each(users, function(i) {
                  $(".userlink-" + i).unbind("mousemove").unbind("mouseover").unbind("mouseout");
                  AJS.contentHover($(".userlink-" + i), i, contextPath + "/users/userinfopopup.action?username=" + users[i], contentHoverPostProcess);
              });
      }
      

      This code reprocesses the page and fixed the problem with the onhover.

      AJS.$(document).ready(function() {
          loadLinkHover();
      });
      
       
      1. Unknown User (martin-r)

        Thanks Joris. I copied both bits of code and now the hover help works great.

  2. This has been fixed for 4.2.1, please try the latest early access release.