skype.html 2.83 KB
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<script type="text/javascript" src="alfresco-skype-uri.js"></script>
<script
    src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</head>
<body>
    
<script type="text/javascript">
   function processProfileLink(element, username)
   {
      element.hover(function()
            {
               var id = "skype_bubble_" + username;
               var skypeBubble = $("#" + id);
               
               if (skypeBubble.length)
               {
                  console.log("found it");
                  element.append(skypeBubble);
               }
               else 
               {
                  //TODO: Determine if this user has a skype id, and then display Skype buttons
                  //Perhaps use Yahoo bubble like we did for Roles
                  element.append($("<div id=\"" + id 
                        + "\" style=\"background-color: #0094ff\" />"));
                      Skype.ui(
                         {
                        name : "dropdown",
                        element : id,
                        participants : [ "kngtinc117-test-skype" ],//["echo123"],
                        imageSize : 32,
                        imageColor : "white",
                        video : true
                     });
               }
               
            }, function()
            {
               //TODO: Only remove after a few seconds if user is not hovering above this or the skype bubble
               element.find("div:last").remove();
            });
   }

   function parsePage()
   {
        $("a[href$=\"/profile\"").each(function(index)
        {
           // Ensures that we are dealing with a user profile link
           var href = $(this).attr("href");
           var regex = /share\/page\/user\/(.+)\/profile/;
           var match = regex.exec(href);
           if (match !== null && match.length > 1)
           {
              processProfileLink($(this), match[1]);
           }
        });
   }
   
   $(document).ready(function()
       {
          parsePage();
       });
</script>

    <a href="/share/page/user/dsamarzija/profile" class="theme-color-1">Dario
        Samarzija</a>
    <br>
    <a href="/share/page/user/dsamarzija2/profile" class="theme-color-1">Dario
        Samarzija2</a>

    <div id="SkypeButton_Call_ahmedowian_1">
        <script type="text/javascript">
                           Skype.ui(
                           {
                              "name" : "dropdown",
                              video : true,
                              "element" : "SkypeButton_Call_ahmedowian_1",
                              "participants" : [ "jelena.cule97", "echo123" ],
                              "imageSize" : 32
                           });
                        </script>
    </div>
</body>
</html>