2 * This file is (c) Copyright 2011 by Sabri LABBENE, Institut TELECOM
4 * This file is part of FusionForge.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * This program has been developed in the frame of the HELIOS
21 * project with financial support of its funders.
29 // One instance that's reused to show info for the current person
30 var container = $('<div id="personPopupContainer">'
31 + '<table width="" border="0" cellspacing="0" cellpadding="0" class="personPopupPopup">'
33 + ' <td class="corner topLeft"></td>'
34 + ' <td class="top"></td>'
35 + ' <td class="corner topRight"></td>'
38 + ' <td class="left"> </td>'
39 + ' <td class="personPopupResult"><div id="personPopupContent"></div></td>'
40 + ' <td class="right"> </td>'
43 + ' <td class="corner bottomLeft"> </td>'
44 + ' <td class="bottom"> </td>'
45 + ' <td class="corner bottomRight"></td>'
51 $('body').append(container);
53 $('.personPopupTrigger').live('mouseover', function() {
54 var username = $(this).attr('rel');
57 clearTimeout(hideTimer);
59 var pos = $(this).offset();
60 var width = $(this).width();
62 left: (pos.left + width) + 'px',
63 top: pos.top - 5 + 'px'
66 $('#personPopupContent').html(' ');
70 url: '/users/' + username,
72 beforeSend: function(xhr) {
73 xhr.setRequestHeader("Accept","application/x-oslc-compact+xml");
75 success: function(data) {
76 var smPreview = data.documentElement.getElementsByTagName('oslc:smallPreview')[0];
78 var Preview = smPreview.getElementsByTagName('oslc:Preview')[0];
80 var oslcDoc = Preview.getElementsByTagName('oslc:document')[0];
82 var prevDocUrl = oslcDoc.getAttribute('rdf:ressource');
84 $('#personPopupContent').load(prevDocUrl);
92 container.css('display', 'block');
95 $('.personPopupTrigger').live('mouseout', function() {
97 clearTimeout(hideTimer);
99 hideTimer = setTimeout(function() {
100 container.css('display', 'none');
106 // Allow mouse over of details without hiding details
107 $('#personPopupContainer').mouseover(function() {
109 clearTimeout(hideTimer);
113 // Hide after mouseout
114 $('#personPopupContainer').mouseout(function() {
116 clearTimeout(hideTimer);
118 hideTimer = setTimeout(function() {
119 container.css('display', 'none');