Skip to content

Instantly share code, notes, and snippets.

@aflyen
Created May 16, 2017 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aflyen/592b821c33f8ae8590c4e45bc5b05c6d to your computer and use it in GitHub Desktop.
Save aflyen/592b821c33f8ae8590c4e45bc5b05c6d to your computer and use it in GitHub Desktop.
function addMigrationInfo(sender, args) {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function() {
var statusId = SP.UI.Status.addStatus("This site has moved. Please update you bookmarks and visit the new location: <a href='" + url + "'>" + url + "</a>");
SP.UI.Status.setStatusPriColor(statusId, 'yellow');
});
}
// Initialize the statusbar as late as possible, see: https://blog.josequinto.com/2015/06/16/custom-javascript-function-loaded-after-the-ui-has-loaded-in-sharepoint-2013/
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(addMigrationInfo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment