Skip to content

Instantly share code, notes, and snippets.

function Break-SPWebInheritance($siteXmlFilePath) {
$xml = Select-Xml -Path $siteXmlFilePath -XPath"//SiteStructure"
$xml.Node.Web | ForEach-Object {
Write-Host "Openning web for breaking inheritance ($($_.Url))"
$web = $clientContext.Site.OpenWeb($_.Url)
$web.BreakRoleInheritance($true, $true)
$clientContext.ExecuteQuery()
}
}
Break-SPWebInheritance "c:\MyAwesomeSiteStructure.xml"
var MyCompany = MyCompany || {};
MyCompany.MyProject = MyCompany.MyProject || { };
( function ( my, $ ) {
//Implements the modal logic on the create article button
my.CreateArticleButton = function ( ) {
var _src = 'MyCompany.MyProject.CreateArticleButton';
//if the button is pressed we load the article creation modal
var _dialog = function ( ) {
console.log ( _src + '.dialog initiating modal window' )
var _options = {
tite : 'Create News Item',
_news.count = "10";
_target.count = 10;
if (_news.count == _target.count) {
}
_news.count = "10";
_target.count = 10;
if (_news.count === _target.count) {
}
if (parseInt​(_news.count) === _target.count) {
}
var _counter;
var _newsCount = int.Parse(_news.count);
if (_newsCount > _target.count) {
_counter = (_newsCount - _news.removed) * average;
} else {
_counter = (_target.count - _news.removed) * average;
}
//config array of variables for our script
var _config = {
height: 310,
width: 310,
colour: '#00ff00'
};
//now you can get at your variables from the _config object like…
_config.height = 500;
SP.SOD.executeFunc ( 'sp.js', 'SP.ClientContext', function() {
//awesome code that does stuff
});