This is something we've been using on our site for a while; I've updated the code so that I can share it with fellow Jive developers. Bookmarklets are browser bookmarks that contain JavaScript code. When you click the bookmark, it'll run the JavaScript against the page you're looking at, which comes in really handy!

 

What I've developed here is a bookmarklet that will display a panel at the top left of your Jive site.. the panel will contain the IDs of the content & Place you're looking at, and give you links to the full JSON object via a REST call. This kind of thing is really handy if you're regularly working with the REST API.

 

Here's how it looks;

 

 

1. Create a new bookmark

 

2. Edit the bookmark and paste in the JavaScript below

 

 

3. Go to your Jive site (or JiveWorks) and click the bookmark to display the panel

 

Here's the JavaScript...

 

javascript:var html='';var currentContainerID=window.jive.global.containerID;var currentContainerType=window.jive.global.containerType;var currentContainerName='';if(typeof(e14CurrentContainer)!=='undefined')currentContainerName=e14CurrentContainer.name;var contentInfo=$j('.jive-content:first');if(contentInfo.length==0||typeof(contentInfo.data('object-id'))==='undefined')contentInfo=$j('.bookmark-controls');if(contentInfo.length>0){var contentID=contentInfo.data('object-id');var contentType=contentInfo.data('object-type');if(typeof(contentID)==='undefined'&&typeof(e14CurrentObject)!=='undefined'){contentID=e14CurrentObject.id;contentType=e14CurrentObject.objectType;}if(typeof(contentID)!=='undefined'){html+='Content type: '+contentType+', ID: '+contentID+'. ';html+='<a href="'+_jive_base_url+'/api/core/v3/contents?filter=entityDescriptor('+contentType+','+contentID+')" target="_blank">REST</a>';html+='<br>';}}html+='Container type: '+currentContainerType+', ID: '+currentContainerID;if(jive.global.containerBrowseId>-1)html+=', Browse ID: '+jive.global.containerBrowseId;if(currentContainerName!=='')html+=', Name: '+currentContainerName+'.';if(currentContainerType!=3){html+=' <a href="'+_jive_base_url+'/api/core/v3/places?filter=entityDescriptor('+currentContainerType+','+currentContainerID+')" target="_blank">REST</a>';}else{html+=' <a href="'+_jive_base_url+'/api/core/v3/people/'+currentContainerID+'" target="_blank">REST</a>';}html+='<br>';$j('.e14-page-info').remove();$j('body').prepend('<div style="border:1px solid grey; height: 25px; font-size: 10px; padding: 5px; position: fixed; display: block; top: 10px; left: 10px; z-index: 10; background: white;" class="e14-page-info">'+html+'</div>');void(0);

 

If you're interested in the uncompressed source, here it is (to use this in a bookmarklet, you'll need to run it through a service like this);

 

var html = '';

var currentContainerID = window.jive.global.containerID;
var currentContainerType = window.jive.global.containerType;

var currentContainerName = '';
if (typeof(e14CurrentContainer)!=='undefined') currentContainerName = e14CurrentContainer.name;

var contentInfo = $j('.jive-content:first'); // Try the jive-content class first
if (contentInfo.length==0 || typeof(contentInfo.data('object-id'))==='undefined') contentInfo = $j('.bookmark-controls'); // Next try the social action link

if (contentInfo.length>0) {
  var contentID = contentInfo.data('object-id');
  var contentType = contentInfo.data('object-type');

  // We can get at blog container if we're on element14 Community 
  if (typeof(contentID)==='undefined' && typeof(e14CurrentObject)!=='undefined') {
  contentID = e14CurrentObject.id;
  contentType = e14CurrentObject.objectType;
  }

  if (typeof(contentID)!=='undefined') {
  html += 'Content type: '+contentType+', ID: '+contentID+'. ';
  html += '<a href="'+_jive_base_url+'/api/core/v3/contents?filter=entityDescriptor('+contentType+','+contentID+')" target="_blank">REST</a>';
  html += '<br>';
  }
}

html += 'Container type: '+currentContainerType+', ID: '+currentContainerID;
if (jive.global.containerBrowseId>-1) html+=', Browse ID: '+jive.global.containerBrowseId;
if (currentContainerName!=='') html += ', Name: '+currentContainerName + '.';
if (currentContainerType!=3) {
  html += ' <a href="'+_jive_base_url+'/api/core/v3/places?filter=entityDescriptor('+currentContainerType+','+currentContainerID+')" target="_blank">REST</a>';
} else {
  html += ' <a href="'+_jive_base_url+'/api/core/v3/people/'+currentContainerID+'" target="_blank">REST</a>';
}
html += '<br>';

$j('.e14-page-info').remove();
$j('body').prepend('<div style="border:1px solid grey; height: 25px; font-size: 10px; padding: 5px; position: fixed; display: block; top: 10px; left: 10px; z-index: 10; background: white;" class="e14-page-info">'+html+'</div>');

void(0);