[Fusionforge-commits] r14386 - in trunk/src/plugins: compactpreview/include compactpreview/www/scripts extsubproj/include

Olivier Berger olberger at fusionforge.org
Thu Sep 15 23:01:59 CEST 2011


Author: olberger
Date: 2011-09-15 23:01:59 +0200 (Thu, 15 Sep 2011)
New Revision: 14386

Modified:
   trunk/src/plugins/compactpreview/include/CompactResource.class.php
   trunk/src/plugins/compactpreview/www/scripts/oslcTooltip.js
   trunk/src/plugins/extsubproj/include/extsubproj_Widget_SubProjects.class.php
Log:
Make so that external projects hav their popups displayed too

Modified: trunk/src/plugins/compactpreview/include/CompactResource.class.php
===================================================================
--- trunk/src/plugins/compactpreview/include/CompactResource.class.php	2011-09-15 13:35:25 UTC (rev 14385)
+++ trunk/src/plugins/compactpreview/include/CompactResource.class.php	2011-09-15 21:01:59 UTC (rev 14386)
@@ -86,8 +86,11 @@
 
         $html = '';
         // construct a link that is the base for a hover popup (see oslcTooltip.js)
-        $url = '<a class="resourcePopupTrigger" href="'. util_make_url_u ($username, $user_id) .
-				'" rel="user,' . $username . '">'. $username . '</a>';
+        //$url = '<a class="resourcePopupTrigger" href="'. util_make_url_u ($username, $user_id) .
+		//		'" rel="user,' . $username . '">'. $username . '</a>';
+		$resource_url = util_make_url_u ($username, $user_id);
+        $url = '<a class="resourcePopupTrigger" href="'. $resource_url .
+        				'" rel="'. $resource_url .'">'. $username . '</a>';
         if ($logo_params['content']) {
         	$html = $logo_params['content'] . $url .'<div class="new_line"></div>';
         }
@@ -110,8 +113,9 @@
 		$group_name = $this->params['group_name'];
 		$group_id = $this->params['group_id'];
 		$link_text = $this->params['link_text'];
-		return '<a class="resourcePopupTrigger" href="'. util_make_url_g ($group_name, $group_id) .
-				'" rel="project,' . $group_name . '">'. $link_text . '</a>';
+		$resource_url = util_make_url_g ($group_name, $group_id);
+		return '<a class="resourcePopupTrigger" href="'. $resource_url .
+				'" rel="' . $resource_url . '">'. $link_text . '</a>';
 	}
 
 }

Modified: trunk/src/plugins/compactpreview/www/scripts/oslcTooltip.js
===================================================================
--- trunk/src/plugins/compactpreview/www/scripts/oslcTooltip.js	2011-09-15 13:35:25 UTC (rev 14385)
+++ trunk/src/plugins/compactpreview/www/scripts/oslcTooltip.js	2011-09-15 21:01:59 UTC (rev 14386)
@@ -55,17 +55,18 @@
 	jQuery('body').append(container);
 	
 	jQuery('.resourcePopupTrigger').live('mouseover', function() {
-		var params = jQuery(this).attr('rel').split(',');
-		var resourceType = params[0];
-		var resourceId = params[1];
-
-		if(resourceType == 'user') {
-			resource = 'users';
-		}
-		if(resourceType == 'project'){
-			resource = 'projects';
-		}
-
+//		var params = jQuery(this).attr('rel').split(',');
+//		var resourceType = params[0];
+//		var resourceId = params[1];
+//
+//		if(resourceType == 'user') {
+//			resource = 'users';
+//		}
+//		if(resourceType == 'project'){
+//			resource = 'projects';
+//		}
+		var url = jQuery(this).attr('rel');
+		
 		if (hideTimer) {
 			clearTimeout(hideTimer);  
 		}
@@ -79,9 +80,10 @@
 		jQuery('#resourcePopupContent').html('<i>...loading '+ resource +' compact preview...</i>');
 
 		// Fetch the OSLC compact preview representation of the resource
+		//url: '/'+ resource +'/' + resourceId + '/',
 		jQuery.ajax({  
 			type: 'GET',
-			url: '/'+ resource +'/' + resourceId + '/',
+			url: url,
 			dataType: 'xml',
 			beforeSend: function(xhr) {
 				xhr.setRequestHeader("Accept","application/x-oslc-compact+xml");

Modified: trunk/src/plugins/extsubproj/include/extsubproj_Widget_SubProjects.class.php
===================================================================
--- trunk/src/plugins/extsubproj/include/extsubproj_Widget_SubProjects.class.php	2011-09-15 13:35:25 UTC (rev 14385)
+++ trunk/src/plugins/extsubproj/include/extsubproj_Widget_SubProjects.class.php	2011-09-15 21:01:59 UTC (rev 14386)
@@ -76,11 +76,14 @@
 				$projname = $graph->resource( $url )->get( "doap:name" );
 				
 				
-				$html = $html . '
-				<tr>
-					<td><a href="'.$url.'">'.$projname.'</a>
-					</td>
-				</tr>';
+ 				$html = $html . '
+ 				<tr>
+ 					<td>';
+//<a href="'.$url.'">'.$projname.'</a>
+				$html .= '<a class="resourcePopupTrigger" href="'. $url .
+								'" rel="' . $url . '">'. $projname . '</a>';
+				$html = $html . '</td>
+ 				</tr>';
 			}
 		
 			$html .= $HTML->listTableBottom();




More information about the Fusionforge-commits mailing list