April 24, 2012

Automatically refresh SharePoint page, but not in edit mode!

Task

Task was to automatically refresh SharePoint page every 5 minutes. Simple task, but can frustrate content editors if not done properly.

Thoughts

Classic META REFRESH tag was out of the question, as it will refresh the page also when in edit mode. JavaScript examples floating around the web also seemed to ignore the requirement of not refreshing page when in edit mode.

Solution

Fortunately detecting the edit mode is a one liner in JavaScript, so just wrap your favorite page refresh JavaScript with the bold code below, save it in Content Editor Web Part, and you’re set! Happy refreshing!

<script type="text/javascript">
var reloadTimer = null;
var sURL = unescape(window.location.pathname);

function setReloadTime(secs)
{ if (arguments.length == 1)
   { if (reloadTimer) clearTimeout(reloadTimer);
       reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs)*1000));
   }
   else
   { reloadTimer = null;
     location.reload(true);
     window.location.replace( sURL );
   }
}

var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value;

if (inDesignMode != "1")
{

     setReloadTime(300);
}
</script>

Original refresh JavaScript (the one not in bold) was borrowed from Drew’s blog article.

Technorati Tags:

April 23, 2012

Media Center Status Application update is out!

Fixed in this version (0.6.4) are the following issues.

  • Facebook login dialog wasn’t displayed in all scenarios, so use couldn’t login to Facebook after starting Media Center
  • Amazon media query was completely broken due changes in Amazon service

Download here

 

Technorati Tags: ,,

April 17, 2012

SharePoint: New Group Calendar missing Schedule content type

Issue

In SharePoint Online (haven’t tested with on-premise), when creating new Group Calendar, the created calendar list doesn’t include the required Schedule content type.

Steps to reproduce

1. Start to create new list, select Calendar, and click More Options button


image

2. Input Name for the calendar, and in the Group Calendar Options, select Yes to make this calendar a group calendar. Then click Create button at the bottom.

image

3. Start to create new event in the calendar and you will note that the Content Type used is incorrect.

image

4. Go to List settings of this new list and you will see that there is only Event content type defined.

image 

Solution

Reason for this is that when you define a calendar as a Group Calendar at the time of calendar creation, it will not include the required content type called Schedule. In order to get the Schedule content type visible, do this:

1. In List Settings screen of your new group calendar, select “Title, description and navigation”

image

2. Set Use this calendar to share member’s schedule to No, and click Save

image

3. Go back to “Title, description and navigation”

4. Set Use this calendar to share member’s schedule to Yes, and click Save

image

5. TADAA! The missing Schedule content type is now visible and you’re good to go!

image

Technorati Tags: ,

April 3, 2012

New version of Media Center Status Application released!

Brand new version of the Media Center Status Application has been released that will guarantee you a peaceful Media Center session with your favorite TV show or movie without annoying Twitter tweet popups.

image

In this latest version 0.6.3, you can suspend Twitter tweet dialogs for a specified number of minutes. Configuration is done using the Configuration application and you can enable Suspend button on tweet dialogs, as well as a time in minutes for how long tweet dialogs are suspended.

image

Media Center Status Application will ignore all tweets that have been made during the suspend period so you will not receive a spam of tweet dialogs after the suspend period has ended.

Download the latest version here

 

Technorati Tags: ,