This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
952 additions
and
253 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,16 +45,16 @@ require(["pnp"], function (pnp) { | |
// pnp.sp.web.lists.getByTitle("Config3").items.orderBy("Title").top(1).getPaged().then(d => { | ||
// show(d); | ||
// d.getNext().then(d => show(d)); | ||
// }); | ||
// }); | ||
// pnp.sp.web.siteGroups.get().then(show); | ||
// pnp.sp.web.siteGroups.add({ "Title": "Test Group 1" }).then(show); | ||
// pnp.sp.web.siteGroups.getById(11).get().then(show); | ||
// pnp.sp.web.siteGroups.removeById(13).get().then(show); | ||
// pnp.sp.web.siteGroups.removeByLoginName("Delete My By Name").then(show); | ||
// pnp.sp.web.siteGroups.removeByLoginName("Delete My By Name").then(show); | ||
// pnp.sp.web.siteGroups.getByName("Test Group 1").get().then(show); | ||
// pnp.sp.web.siteGroups.getById(11).users.get().then(show); | ||
// pnp.sp.web.siteGroups.getByName("Test Group 1").update({ Title: "Test Group 1-2" }).then((r) => { | ||
// r.group.users.get().then(show); | ||
// pnp.sp.web.siteGroups.getByName("Test Group 1").update({ Title: "Test Group 1-2" }).then((r) => { | ||
// r.group.users.get().then(show); | ||
// }); | ||
//pnp.sp.web.roleDefinitions.add("Test1", "Description", 180, { High: '176', Low: '138612801' }).then(show); | ||
//pnp.sp.web.roleDefinitions.getByName("Test1").update({ BasePermissions: { High: '0', Low: '138612801' }, Name: "Fred" }).then(show); | ||
|
@@ -66,11 +66,11 @@ require(["pnp"], function (pnp) { | |
// pnp.sp.web.lists.getByTitle("Documents").items.get().then(show); | ||
// pnp.sp.web.roleAssignments.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Documents").views.get().then(show); | ||
// pnp.sp.site.rootWeb.folders.get().then(show); | ||
// pnp.sp.site.rootWeb.folders.getByName("Shared Documents").select("Title").get().then(show); | ||
// pnp.sp.site.rootWeb.folders.get().then(show); | ||
// pnp.sp.site.rootWeb.folders.getByName("Shared Documents").select("Title").get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("sites/dev/Style Library/test").select("Name").get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("/sites/dev/Style Library/test").parentFolder.select("Name").get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("/sites/dev/Style Library").folders.get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("/sites/dev/Style Library").folders.get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("/sites/dev/Style Library").name.get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("/sites/dev/Style Library").properties.select("vti_x005f_dirlateststamp").get().then(show); | ||
// pnp.sp.site.rootWeb.getFolderByServerRelativeUrl("/sites/dev/Style Library/test").files.get().then(show); | ||
|
@@ -82,40 +82,40 @@ require(["pnp"], function (pnp) { | |
// pnp.sp.web.lists.getByTitle("Documents").eventReceivers.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Documents").eventReceivers.select("ReceiverName").filter("SequenceNumber ne 10000").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Documents").getUserEffectivePermissions("i:0h.f|membership|[email protected]").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).attachmentFiles.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).attachmentFiles.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).attachmentFiles.select("ServerRelativeUrl").filter("FileName eq 'SP Customizations.pptx'").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).contentType.select("Id", "Name").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).effectiveBasePermissions.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).effectiveBasePermissionsForUI.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).fieldValuesAsHTML.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).fieldValuesAsHTML.select("GUID", "Title").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).fieldValuesAsHTML.select("GUID", "Title").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).fieldValuesAsText.select("GUID", "Title").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).fieldValuesForEdit.select("GUID", "Title").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).firstUniqueAncestorSecurableObject.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(1).firstUniqueAncestorSecurableObject.select("odata.type").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(2).folder.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(3).getUserEffectivePermissions("i:0h.f|membership|[email protected]").get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(3).roleAssignments.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(3).roleAssignments.select("PrincipalId").filter("PrincipalId eq 8").get().then(show) | ||
// pnp.sp.web.lists.getByTitle("Test List").items.getById(3).roleAssignments.select("PrincipalId").filter("PrincipalId eq 8").get().then(show) | ||
// pnp.sp.web.lists.add("My first list").then(function(result) { | ||
// result.list.update({ Title: "New Title!!" }).then(function(result) { | ||
// show(result.data); | ||
// }); | ||
// }); | ||
// }); | ||
// pnp.sp.web.lists.getByTitle("New Title!!").delete().then(show); | ||
// pnp.sp.web.lists.add("My first list").then(function(result) { | ||
// result.list.update({ Title: "New Title!!" }).then(function(result2) { | ||
// result.list.update({ Title: "New Title!!" }).then(function(result2) { | ||
// result2.list.breakRoleInheritance().then(show); | ||
// }); | ||
// }); | ||
// }); | ||
// pnp.sp.web.lists.getByTitle("New Title!!").resetRoleInheritance().then(show); | ||
// pnp.sp.web.lists.getByTitle("New Title!!").roleAssignments.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("New Title!!").roleAssignments.get().then(show); | ||
// let provider = new pnp.configuration.Providers.SPListConfigurationProvider("https://318studios.sharepoint.com/sites/dev"); | ||
// provider.getConfiguration().then(show); | ||
// provider.getConfiguration().then(show); | ||
// pnp.sp.web.lists.getByTitle("Config").items.add({ | ||
// Title: "Title 2", | ||
// Value: "Value 2" | ||
// }).then(show); | ||
// }).then(show); | ||
// pnp.sp.web.lists.getByTitle("Config").items.getById(4).update({ | ||
// Value: "Different" | ||
// }).then(show); | ||
|
@@ -132,11 +132,11 @@ require(["pnp"], function (pnp) { | |
// }); | ||
// pnp.sp.web.lists.ensureSitePagesLibrary().then(function(list) { | ||
// list.items.get().then(show); | ||
// }); | ||
// }); | ||
//pnp.sp.web.lists.ensureSitePagesLibrary().then(show); | ||
//pnp.sp.web.lists.getByTitle("Config").items.getById(5).validateUpdateListItem([{ FieldName: "Title", FieldValue: "So different, much woot."}]).then(show); | ||
//pnp.sp.web.lists.getByTitle("Config").views.getById("66e251c3-1362-4e86-90f2-1a8dacd655a5").renderAsHtml().then(showRaw); | ||
//pnp.sp.web.lists.getByTitle("Config").views.add("My New View").then(show); | ||
//pnp.sp.web.lists.getByTitle("Config").views.add("My New View").then(show); | ||
// pnp.sp.web.lists.getByTitle("Config").views.add("My New View 3").then(function(result) { | ||
// result.view.fields.getSchemaXml().then(show); | ||
// }); | ||
|
@@ -147,7 +147,7 @@ require(["pnp"], function (pnp) { | |
// result.view.fields.add("Modified").then(function () { | ||
// result.view.fields.move("Modified", 0).then(show); | ||
// }); | ||
// }); | ||
// }); | ||
//pnp.sp.web.lists.getByTitle("Config").fields.addText("MyNewField3").then(show); | ||
//pnp.sp.web.lists.getByTitle("Config").fields.addCalculated("calc", "=[Title]", 1, 2).then(show); | ||
//pnp.sp.web.lists.getByTitle("Config").fields.addDateTime("datetimefield").then(show); | ||
|
@@ -165,7 +165,7 @@ require(["pnp"], function (pnp) { | |
//pnp.sp.site.getDocumentLibraries("https://318studios.sharepoint.com/sites/dev/").then(show); | ||
//pnp.sp.web.applyTheme("/sites/dev/_catalogs/theme/15/palette011.spcolor", "/sites/dev/_catalogs/theme/15/fontscheme007.spfont", "/sites/dev/Style%20Library/DSC_0024.JPG", false).then(show); | ||
//pnp.sp.site.getWebUrlFromPageUrl("https://318studios.sharepoint.com/sites/dev/SitePages/DevHome.aspx").then(show); | ||
//pnp.sp.web.mapToIcon("blah.xlsx").then(show); | ||
//pnp.sp.web.mapToIcon("blah.xlsx").then(show); | ||
// pnp.sp.profiles.editProfileLink.then(show); | ||
// pnp.sp.profiles.isMyPeopleListPublic.then(show); | ||
// pnp.sp.profiles.amIFollowedBy("i:0#.w|ylo001\_spocrawler_18_3996").then(show); | ||
|
@@ -182,25 +182,60 @@ require(["pnp"], function (pnp) { | |
//pnp.sp.profiles.ownerUserProfile.then(show); | ||
//pnp.sp.profiles.userProfile.then(show); | ||
// test profile image upload | ||
// $(function() { | ||
// $("#testingshow").append("<div id='profiletest'><input type='file' /><button>Upload</button></div>"); | ||
// $(function() { | ||
// $("#testingshow").append("<div id='profiletest'><input type='file' /><button>Upload</button></div>"); | ||
// var div = $("#testingshow").find("#profiletest"); | ||
// var btn = div.find("button"); | ||
|
||
// btn.on('click', function(e) { | ||
// e.preventDefault(); | ||
// e.preventDefault(); | ||
// var file = $(this).closest("div").find("input")[0].files[0]; | ||
// pnp.sp.profiles.setMyProfilePic(file).then(show); | ||
// }); | ||
// }); | ||
|
||
// var caml = { ViewXml: "<View><ViewFields><FieldRef Name='Title' /><FieldRef Name='RoleAssignments' /></ViewFields><RowLimit>10</RowLimit></View>" }; | ||
|
||
// pnp.sp.web.lists.getByTitle("Config3").getItemsByCAMLQuery(caml, "RoleAssignments").then(show); | ||
// pnp.sp.web.lists.getByTitle("Config3").getItemsByCAMLQuery(caml, "RoleAssignments").then(show); | ||
|
||
//pnp.sp.search("Title").then(show); | ||
|
||
|
||
/* Webhook subscription creation */ | ||
// var notificationUrl = "{ notification url }"; | ||
// var today = new Date(); | ||
// var expirationDate = new Date(today.setDate(today.getDate() + 90)).toISOString(); | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.create(notificationUrl, expirationDate, 'custom').then(function (data) { | ||
// // Show new subscription information | ||
// show(data); | ||
// // Check all subscriptions of the current list | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.get().then(show); | ||
// }); | ||
|
||
/* Show webhook subscriptions of a list/library */ | ||
//pnp.sp.web.lists.getByTitle("Documents").subscriptions.get().then(show); | ||
|
||
/* Show webhook subscription by ID */ | ||
// var subscriptionId = "820965d1-f02b-483e-8b82-c3628aa459c0"; | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.getById(subscriptionId).then(show); | ||
|
||
/* Update a webhook subscription from a list or library */ | ||
// var subscriptionId = "820965d1-f02b-483e-8b82-c3628aa459c0"; | ||
// var today = new Date(); | ||
// var expirationDate = new Date(today.setDate(today.getDate() + 90)).toISOString(); | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.getById(subscriptionId).then(show); | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.update(subscriptionId, expirationDate).then(function () { | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.getById(subscriptionId).then(show); | ||
// }); | ||
|
||
/* Delete a webhook subscription */ | ||
// var subscriptionId = "820965d1-f02b-483e-8b82-c3628aa459c0"; | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.get().then(show); | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.remove(subscriptionId).then(function () { | ||
// pnp.sp.web.lists.getByTitle("Documents").subscriptions.get().then(show); | ||
// }); | ||
|
||
|
||
function syntaxHighlight(json) { | ||
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); | ||
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.