Skip to content

Instantly share code, notes, and snippets.

Phil Harding phillipharding

Block or report user

Report or block phillipharding

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@phillipharding
phillipharding / SharePoint People Picker
Created May 31, 2014
Set the value of SharePoint People Picker Controls
View SharePoint People Picker
(function(module,$) {
"use strict";
window.PD = window.PD || {};
PD.SP = PD.SP || {};
PD.SP.PeoplePicker = function() {
var
_module = {
Validate: ValidatePeoplePicker,
@phillipharding
phillipharding / gist:e42364c7792552b09134
Last active Oct 6, 2016
Create Document Set using JSOM
View gist:e42364c7792552b09134
var clientContext = null;
function createTestDocumentSet() {
if(clientContext === null) {
return false;
}
var item = null;
var oList = clientContext.get_web().get_lists().getByTitle('Library Name');
clientContext.load(oList);
var itemCreateInfo = new SP.ListItemCreationInformation();
View Filter LVWP - JS - 2010
(function(module,$) {
"use strict";
window.pd = window.pd || {};
pd.MeetingsViewModel = function() {
/* observable state */
this.FilterTextIm = ko.observable('');
this.FilterText = ko.computed(this.FilterTextIm)
.extend({ throttle: 400 });
View Filter LVWP - HTML - 2010
<link rel="stylesheet" type="text/css" href="../SiteAssets/sgm-meetings/css/fontello.css" runat="server" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="../SiteAssets/sgm-meetings/css/fontello-ie7.css" runat="server" />
<![endif]-->
<!-- Lib CSS -->
<link rel="stylesheet" type="text/css" href="../SiteAssets/sgm-meetings/css/cdtm-main.css" runat="server" />
<!-- Lib JS -->
<script type="text/javascript" src="../SiteAssets/sgm-meetings/scripts/knockout-3.1.0.js"></script>
View Filter LVWP - CSS - 2010
/* CLEARFIX */
.cdtm-wrapper .row:before,
.cdtm-wrapper .row:after {
content: "";
display: table;
}
.cdtm-wrapper .row:after {
clear: both;
}
View Filter LVWP - JS - 2013
(function(module,$) {
"use strict";
window.pd = window.pd || {};
pd.FilterLibraryViewModel = function() {
/* observable state */
this.FilterTextIm = ko.observable(''),
this.FilterText = ko.computed(this.FilterTextIm)
.extend({ throttle: 400 }),
View Filter LVWP - HTML - 2013
<link rel="stylesheet" type="text/css" href="../SiteAssets/sgm-meetings/css/fontello.css" runat="server" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="../SiteAssets/sgm-meetings/css/fontello-ie7.css" runat="server" />
<![endif]-->
<!-- App CSS -->
<link rel="stylesheet" type="text/css" href="../SiteAssets/sgm-meetings/css/cdtm-main.css" runat="server" />
<!-- Lib JS -->
<script type="text/javascript" src="../SiteAssets/sgm-meetings/scripts/knockout-3.1.0.js"></script>
View Filter LVWP - CSS - 2013
/* CLEARFIX */
.cdtm-wrapper .row:before,
.cdtm-wrapper .row:after {
content: "";
display: table;
}
.cdtm-wrapper .row:after {
clear: both;
@phillipharding
phillipharding / EnsureListFolderTree
Last active Aug 29, 2015
Create Folder Tree's for SharePoint Lists and Libraries
View EnsureListFolderTree
function EnsureListFolderTree($web, $list, $folderName) {
$curl = $list.RootFolder.ServerRelativeUrl
$folders = $folderName.Replace("^/+","").Split("/")
ForEach($fn in $folders) {
$furl = $curl + "/" + $fn
$f = $web.GetFolder($furl)
if ($f.Exists -eq $false) {
$f = $list.AddItem($curl, [Microsoft.SharePoint.SPFileSystemObjectType]::Folder, $fn)
$f.Update()
View CheckSPWebResource
(function($) {
"use strict";
function checkSPWebResource(url, async) {
var
endpoint = url.match(/^http[s]?:\/\//i) || url.match("^"+_spPageContextInfo.webServerRelativeUrl)
? url
: _spPageContextInfo.webServerRelativeUrl.replace(/\/$/g,'')
+ '/' + url.replace(/^\//g,''),
p = $.Deferred();
You can’t perform that action at this time.