Wednesday, May 05, 2010

Using tabs in SharePoint 2010 central administration, a solution

image I don’t know about you but tabbed navigation has become a must have for me in the past years. I mean who wants to open a different window for each and every web page.

Well my friends, it seems like Microsoft remembers too fondly those pre-tab browsing days and wants us to return to this prehistoric era. I am talking about the infamous Javascript links one can find in the SharePoint 2010 Central Administration – User Profile Service Application management page:

image

If you mouse over those links, you will see in the status bar that they are not actual links but instead Javascript calls:

image

If you add to that, the fact that the navigation is completely useless in this site, you have the recipe for a disastrous user experience as you can’t even open tab to compensate.

Having to work with the User Profile Service Application for a client I got fed up with the situation and decided to act. As javascript is the swiss knife of SharePointer, I wrote a script to replace those javascripts link with actual links so that I can open these links in tabs if needed :

image

Voila, here are your tab-compliant links.

As FireFox is now fully supported by SharePoint, I use this code in a GreaseMonkey user script. This way the script is applied on this page whatever the farm I am administering. Without even having to modify anything on the farms.

To add the user script, nothing too fancy, just add “*/_layouts/ManageUserProfileServiceApplication.aspx*” in the include. And add the following as the code :

// Jonathan Roussel - http://blog.jonathanroussel.com

// Make sure to Include */_layouts/ManageUserProfileServiceApplication.aspx*

var cUrl=document.location.href;
var aId = cUrl.substring(cUrl.indexOf("ApplicationID"));
var links,link;

links=document.getElementsByTagName("a");
for(var i=0;i<links.length;i++)
{
var link = links[i];
if(link.href.indexOf("javascript:AppendApplicationIdAndNavigate(")>=0)
{
link.href = link.href.substring(45,link.href.length-2) +aId;
}
};

If you want a more portable solution, I also put this code together as a Bookmarklet. Just drag and drop this link to your favorite bar. Thus whenever you are on the “Manage User Profile” page, just hit the link in the favorite bar to transform these nasty Javascript links into actual links.


SP2010_SCA_TabAllower


Tested with IE8, FireFox 3.6, Chrome 4.1.

1 comment:

BGM said...

I sort of had the same misgivings, so I created the Sharepoint Administrator's Toolbar for Firefox:

https://addons.mozilla.org/firefox/addon/405720