Commit 47cdc6341956ac4a5769ae0e774bd376fddf9b72

Authored by Jelena Cule
1 parent a7743bf829
Exists in master

Added function with ajax request to repo user api via share proxy to get user profile data

Showing 1 changed file with 38 additions and 7 deletions   Show diff stats
prototype/skype.html
1   -<!DOCTYPE html>
  1 + <!DOCTYPE html>
2 2 <html>
3 3 <head>
4 4 <title>Page Title</title>
... ... @@ -8,25 +8,56 @@
8 8 src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
9 9 </head>
10 10 <body>
11   -
  11 +
12 12 <script type="text/javascript">
  13 +
  14 + function getUserData()
  15 + {
  16 + /**
  17 + * Send the ajax request to the user api to get user data
  18 + *
  19 + */
  20 + Alfresco.util.Ajax.request(
  21 + {
  22 + url: Alfresco.constants.URL_SERVICECONTEXT + "proxy/alfresco-api/-default-/public/alfresco/versions/1/people/admin",
  23 + userObj:
  24 + {
  25 + userId: this.id,
  26 + skypeId: this.skypeId,
  27 + firstName: this.firstName,
  28 + email: this.email
  29 + enabled: this.enabled
  30 + },
  31 + successCallback:
  32 + {
  33 + //do something?
  34 + },
  35 + failureMessage: "Could not load user data"
  36 + });
  37 + }
  38 +
  39 + }
  40 +
  41 +
  42 +
  43 +
13 44 function processProfileLink(element, username)
14 45 {
15 46 element.hover(function()
16 47 {
17 48 var id = "skype_bubble_" + username;
18 49 var skypeBubble = $("#" + id);
19   -
  50 +
20 51 if (skypeBubble.length)
21 52 {
22 53 console.log("found it");
23 54 element.append(skypeBubble);
24 55 }
25   - else
  56 + else
26 57 {
27 58 //TODO: Determine if this user has a skype id, and then display Skype buttons
28 59 //Perhaps use Yahoo bubble like we did for Roles
29   - element.append($("<div id=\"" + id
  60 + element.append($("<div id=\"" + id
30 61 + "\" style=\"background-color: #0094ff\" />"));
31 62 Skype.ui(
32 63 {
... ... @@ -38,7 +69,7 @@
38 69 video : true
39 70 });
40 71 }
41   -
  72 +
42 73 }, function()
43 74 {
44 75 //TODO: Only remove after a few seconds if user is not hovering above this or the skype bubble
... ... @@ -60,7 +91,7 @@
60 91 }
61 92 });
62 93 }
63   -
  94 +
64 95 $(document).ready(function()
65 96 {
66 97 parsePage();
... ...