View AJAXFrames.js
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
// replacement function for console.log(), which avoids 'undefined' exception in IE 8 | |
window.LogMsg = function (msg) { | |
if (window.console) { | |
console.log(msg); | |
} | |
}; | |
// set up root namespaces | |
window.LS = window.LS || {}; | |
LS.AJAXFrames = LS.AJAXFrames || {}; |
View FieldsToConstants.ps1
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
$siteUrl = "http://site/collection/url" | |
$fieldPrefix = "ClientName_" | |
$outputPath = "c:\temp\Fields.cs" | |
$site = Get-SPSite $siteUrl | |
$fields = $site.RootWeb.Fields | |
$output = "" | |
$newLine = "`r`n" | |
$tab = "`t" |
View ComponentView.cshtml
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
<!--Views\Shared\User.cshtml--> | |
@model MyNamespace.ViewModels.User | |
<div>@Model.Name</div> | |
<!-- | |
This is a very basic example, obviously you'd have more complex nested HTML | |
and more properties in use for it to be worth using a component like this | |
--> |
View ScriptLoader.js
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
/* | |
Load non-minified version of JS if debug=1 is present in window.location.search. | |
This JS file can either be referenced in a master page with a <script> tag or via Custom Action. | |
Use of document.write ensures the script is inserted immediately below this one, synchronously. | |
For version string to successfully cache bust, the reference to this script also needs a query string that is updated each time this script is updated. | |
*/ | |
(function() { | |
var minUrl = "/script.min.js", | |
debugUrl = "/script.js", |
View FindControlIterative.cs
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
using System.Collections.Generic; | |
// accesses a control by ID (i.e. a checkbox/button/textbox etc) | |
private static Control FindControlIterative(Control root, string id) | |
{ | |
Control ctl = root; | |
LinkedList<Control> ctls = new LinkedList<Control>(); | |
while (ctl != null) | |
{ | |
if (ctl.ID == id) |
View UpdateUserInfo.ps1
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
##### ABOUT ##### | |
# This script updates the mobile number and work number values | |
# for all users in the "User Information List" for all site collections | |
# in the specified web application (see variables below) | |
##### VARIABLES ##### | |
$webAppURL = "http://mywebapp" | |
$logPath = "C:\temp\UpdateUserInfo\UpdateUserInfo" |
View LinqReflectionConsole.cs
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
using LS.Extensions; | |
using Properties; | |
namespace Properties | |
{ |
View AnimatedScrollToSection.js
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
/* | |
============================================================================== | |
Animated scroll-to-section | |
------------------------------------------------------------------------------ | |
Fancy animated scroll override for native browser scroll-to hyperlinks | |
which reference named anchor tags within the current page. | |
Requires jQuery. | |
============================================================================== | |
Sections should be defined in page content like so: |
View LS.Extensions.cs
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Web.UI; | |
using System.Xml; // requires System.Xml reference | |
using System.Xml.Linq; // requires System.Xml.Linq reference |
View GetExternalUsers.js
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
(function() { | |
var allResults = [], | |
queryText = encodeURIComponent("#ext# contentclass:spspeople"), | |
rowLimit = 500, | |
selectProperties = ["AccountName", "PreferredName", "WorkEmail"]; | |
function chunk (arr, len) { | |
var chunks = [], | |
i = 0, | |
n = arr.length; |
OlderNewer