skype.html
2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!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">
$(document).ready(function()
{
$("a[href$=\"/profile\"").each(function(index)
{
var href = $(this).attr("href");
if (href.indexOf("/share/page/user/") > -1)
{
$(this).hover(function()
{
// Parses out the Alfresco username.
//TODO: Use regex
var user = "/user/";
var start = href.indexOf(user) + user.length;
var end = href.indexOf("/profile");
var username = href.substring(start, end);
var id = "skype_bubble_" + username;
var skypeBubble = $("#" + id);
if (skypeBubble.length)
{
console.log("found it");
$(this).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
$(this).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
$(this).find("div:last").remove();
});
}
});
});
</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>
<span id="jelena">something</span>
<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>