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
<!DOCTYPE html> | |
<html> | |
<head>JSON to Table</head> | |
<body> | |
<button type="button" value="Process" onclick="json2table('mytable')"> | |
<table id='mytable'></table> | |
</body> | |
</html> |
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 getUserInformationList() { | |
var context = SP.ClientContext.get_current(); | |
var list = context.get_web().get_siteUserInfoList(); //.get_currentUser(); | |
var userInfoItems = list.getItems(SP.CamlQuery.createAllItemsQuery()); | |
context.load(userInfoItems); | |
context.executeQueryAsync( | |
// success callback | |
function () { | |
//var listItemInfo = ''; |
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
{ | |
"type": "FrontPage Structure", | |
"fields": [ | |
"article", | |
"fosition", | |
"font", | |
"header", | |
"image" | |
], | |
"articles": [ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> | |
<CustomAction Id="dc08391a-82b7-44c6-b81b-5a093da0c978.RibbonCustomAction1" | |
RegistrationType="List" | |
RegistrationId="101" | |
Location="CommandUI.Ribbon" | |
Sequence="10001" | |
HostWebDialog="true" | |
HostWebDialogHeight="500" | |
HostWebDialogWidth="1000"> |
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() { | |
var nsName = "LS"; // root namespace name | |
var ns = window[nsName]; // root namespace alias | |
var utils = ns.Utils; // utils alias | |
ns.SP = ns.SP || {}; | |
ns.SP.JSOM = { | |
Data: { | |
Sites: {} // cache for Taxonomy terms JSON | |
}, |
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
TemplateHub.rest.post({ | |
url:"https://inmetademo-9e1505ae3276fd.sharepoint.com/sites/templatehub/TemplateHub/_api/SP.AppContextSite(@target)/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl='/sites/contentTypeHub/templatehub/Template Library'&@target='https://inmetademo.sharepoint.com/sites/contenttypehub/templatehub'&View=9dcf7a8c-e8f6-4866-8984-2465254ebb5f&FilterField1=Editor&FilterValue1=Mohamed Ali Abdi&FilterField2=FSObjType&FilterValue2=0", | |
data:'{"parameters":{"__metadata":{"type":"SP.RenderListDataParameters"},"ViewXml":"<View><Query><RowLimit>4</RowLimit></Query></View>","RenderOptions":23,"Paging":"","AllowMultipleValueFilterForTaxonomyFields":true}}' | |
}) | |
.then( | |
function(data){ | |
console.log(data) | |
}) |
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
/* | |
CreateDocument.aspx is in frame with window.frameElement.commitPopup(url) and cancelPopup() | |
Fix: | |
create window.on("message | createDocument") that | |
starts CreateDocument.aspx diaglog in context of SharePoint docLib page. | |
*/ | |
//Using a generic object. |
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 ($) { | |
'use strict'; | |
var requestHeaders = { | |
'X-RequestDigest': $("#__REQUESTDIGEST").val(), | |
"accept": "application/json; odata=nometadata", | |
"content-type": "application/json;odata=nometadata" | |
}; | |
var userData = { |
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
#Azure Resource Manager cmdlets to get hold of the dll. https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-4.0.0 | |
Add-Type -Path "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.ApiManagement\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
#Utility function to get Microsoft Graph Access Token. To know more about this, see my post http://www.vrdmn.com/2017/05/authenticating-to-microsoft-graph-api.html | |
function Get-MSGraphToken($azuretenantADName, $userName, $userPassword) | |
{ | |
$AzureADAuthority = "https://login.microsoftonline.com/$azuretenantADName/oauth2/v2.0/authorize" | |
$resourceURL = "https://graph.microsoft.com/" | |
$powerShellClientId = "1950a258-227b-4e31-a9cf-717495945fc2" | |
$userCreds = New-Object Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential($userName, $userPassword) |
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
$.getJSON(_spPageContextInfo.webAbsoluteUrl + "/_api/sphomeservice/context?$expand=Token,Payload").then( context => { | |
$.ajax({ | |
url: context.Urls[0] + "/api/v1/sites/feed?start=0&count=3&acronyms=true", | |
headers: { | |
"Authorization": "Bearer " + context.Token.access_token, | |
"sphome-apicontext": context.Payload | |
} | |
}) | |
}) |
OlderNewer