This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //after goldfish has run... | |
| const head = document.head || document.getElementsByTagName('head')[0]; | |
| const overrides = document.createElement('style'); | |
| overrides.type = 'text/css'; | |
| const css = '#menu-items { display:none; } #outer-space { width: 100%; } #component, #component-favourites, #component-layout, #component-settings { display:block; box-shadow: 0 0 2px #d9d9d9; }#component {right: 1200px;}#component-favourites {right: 800px;}#component-layout {right: 400px; }'; | |
| if (overrides.styleSheet) { | |
| overrides.styleSheet.cssText = css; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| The console.time functionality can be used for measuring performance of JavaScript functions (outputing processing times to the developer console window) | |
| https://developer.mozilla.org/en-US/docs/Web/API/Console/time | |
| */ | |
| // console.time implementation for IE | |
| if ( window.console && typeof ( window.console.time ) == "undefined") { | |
| console.time = function (name, reset) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (userProfiles, $) { | |
| ... | |
| //Store the value in our JSON object | |
| function updateProperty (key, value) { | |
| userProfiles.Current[key] = value; | |
| } | |
| //This method iterates through the nested ugly JSON object array to get what we need (IE9+ or you will need to refactor the array.some functionality) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (userProfiles, $) { | |
| userProfiles.Constants = { | |
| EndPoint: '/_api/SP.UserProfiles.PeopleManager/GetMyProperties', | |
| Cache: { | |
| Key: 'ProfileProperties' | |
| } | |
| }; | |
| //You've seen this already, move on... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| The following code assumes you have a javascript namespace called MyCompany. I recommend you either swap that out for your namespace or create an instance of MyCompany before trying the code | |
| var MyCompany = MyCompany || {}; | |
| */ | |
| (function (userProfiles, $) { | |
| //This is where we hold our lovely properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * PLEASE NOTE: This function makes use of ES6 promises. Make sure you use the appropriate shim or swap this out for the jQuery equivilant if you need this to run of web browsers that do not support this functionality | |
| * https://github.com/stefanpenner/es6-promise | |
| * | |
| * PARAMS | |
| * @key - Local Storage Cache Key | |
| * @url The URL of the REST endpoint | |
| * @alwaysFresh - Boolean representing when to fetch the data when the cache is stale (out of date). When set to true, the result set will be fetched from the endpoint immediately | |
| * | |
| * Get data back from cache or request from the server when the cache is stale: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (userProfiles, $) { | |
| userProfiles.Constants = { | |
| EndPoint: '/_api/SP.UserProfiles.PeopleManager/GetMyProperties', | |
| Cache: { | |
| Key: 'ProfileProperties' | |
| } | |
| }; | |
| //Object to store the given user's profile properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var options = { | |
| title: 'People Search', | |
| termsets: [ | |
| { | |
| //the heading of the grouping | |
| title: 'Groups', | |
| //type declares if it is a Termset or a Field in the User Information List | |
| type: 'Termset', | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config = { | |
| client_id: <INSERT CLIENT ID GUID>, | |
| redirect_base_uri: <INSERT THE URL OF THE APP> | |
| } |