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
    
  
  
    
  | $(document).ready(function () { | |
| SP.SOD.executeOrDelayUntilScriptLoaded(function () | |
| { | |
| //read the simple link ID and store it | |
| var oldLogoId = $("#DeltaSiteLogo > a").attr('id'); | |
| //change the id to something custom, so O365 doesn't touch this | |
| $("#" + oldLogoId).attr('id', 'CustomSiteLogo'); | |
| //create temporary hidden element | |
| $("#DeltaSiteLogo > a").after("<a id='tmpUrl' href='#' style='display:none'>Temp</a>"); | |
| //set the hidden element id with old id value | 
  
    
      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
    
  
  
    
  | private void CleanUp(ClientContext ctx) | |
| { | |
| List _requestList = ctx.Web.Lists.GetByTitle(Lists.SiteRepositoryTitle); | |
| ctx.Load(_requestList, p => p.EventReceivers); | |
| ctx.ExecuteQuery(); | |
| var rer = _requestList.EventReceivers.Where( | |
| e => e.ReceiverName == RECEIVER_NAME).FirstOrDefault(); | |
| try | 
  
    
      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
    
  
  
    
  | private void HandleItemUpdated(SPRemoteEventProperties properties) | |
| { | |
| using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties)) | |
| { | |
| if(clientContext != null) | |
| { | |
| List requestList = clientContext.Web.Lists.GetById(properties.ItemEventProperties.ListId); | |
| ListItem item = requestList.GetItemById(properties.ItemEventProperties.ListItemId); | |
| clientContext.Load(item); | |
| clientContext.ExecuteQuery(); | 
  
    
      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
    
  
  
    
  | public void ProcessOneWayEvent(SPRemoteEventProperties properties) | |
| { | |
| switch(properties.EventType) | |
| { | |
| case SPRemoteEventType.ItemUpdated: | |
| HandleItemUpdated(properties); | |
| break; | |
| } | |
| } | 
  
    
      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
    
  
  
    
  | EventReceiverDefinitionCreationInformation receiver = new EventReceiverDefinitionCreationInformation(); | |
| receiver.EventType = EventReceiverType.ItemUpdated; | |
| //Get WCF URL where this message was handled | |
| OperationContext op = OperationContext.Current; | |
| Message msg = op.RequestContext.RequestMessage; | |
| receiver.ReceiverUrl = msg.Headers.To.ToString(); | |
| receiver.ReceiverName = RECEIVER_NAME; | |
| //Add the new event receiver to a list in the host web | 
  
    
      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
    
  
  
    
  | List requestList = ctx.Web.Lists.FirstOrDefault(); | |
| if(requestList == null) | |
| { | |
| var newList = new ListCreationInformation() | |
| { | |
| Title = Lists.SiteRepositoryTitle, | |
| Description = Lists.SiteRepositoryDesc, | |
| TemplateType = (int)ListTemplateType.GenericList, | |
| Url = Lists.SiteRepositoryUrl | |
| }; | 
  
    
      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
    
  
  
    
  | public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties) | |
| { | |
| SPRemoteEventResult result = new SPRemoteEventResult(); | |
| switch (properties.EventType) | |
| { | |
| case SPRemoteEventType.AppInstalled: | |
| this.HandleAppInstall(properties); | |
| result.Status = SPRemoteEventServiceStatus.Continue; | |
| break; | 
  
    
      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
    
  
  
    
  | // Remove resolved user from the array and updates the hidden field control with a JSON string | |
| PeoplePicker.prototype.RemoveResolvedUser = function (lookupValue) { | |
| var newResolvedUsers = []; | |
| for (var i = 0; i < this._ResolvedUsers.length; i++) { | |
| var resolvedLookupValue = this._ResolvedUsers[i].Login ? this._ResolvedUsers[i].Login : this._ResolvedUsers[i].LookupId; | |
| if (resolvedLookupValue != lookupValue) { | |
| newResolvedUsers.push(this._ResolvedUsers[i]); | |
| } | |
| } | |
| this._ResolvedUsers = newResolvedUsers; | 
  
    
      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 changeSiteOwnerPlaceholder() { | |
| if (document.getElementById("hdnSiteOwner").value != '[]') | |
| { | |
| $('#inputSiteOwner').attr('placeholder', ''); | |
| } | |
| else | |
| { | |
| $('#inputSiteOwner').attr('placeholder', 'Who will manage this site?'); | |
| } | |
| } | 
  
    
      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
    
  
  
    
  | <div id="divSiteOwner" class="cam-peoplepicker-userlookup ms-fullWidth"> | |
| <span id="spanSiteOwner"></span> | |
| <asp:TextBox ID="inputSiteOwner" runat="server" CssClass="cam-peoplepicker-edit" Width="70"></asp:TextBox> | |
| </div> | |
| <div id="divSiteOwnerSearch" class="cam-peoplepicker-usersearch ms-emphasisBorder"></div> | |
| <asp:HiddenField ID="hdnSiteOwner" runat="server" /> | 
NewerOlder