Skip to content

Instantly share code, notes, and snippets.

@mutuadavid93
Last active November 17, 2016 09:05
Show Gist options
  • Save mutuadavid93/3d28761ca4e6f331374bea26e955c98e to your computer and use it in GitHub Desktop.
Save mutuadavid93/3d28761ca4e6f331374bea26e955c98e to your computer and use it in GitHub Desktop.
/*
Brand SharePoint by not editing
the masterpage.
Meant to Brand a SharePoint 2013
Blog site template.
*/
$(document).ready(function () {
var target = $(this);
//in the current open page
//Brand the Masterpage SP elems
target.find('div.ms-tableRow').css({
"background": "#00337F",
"color" : 'yellow'
});
//target left categories sidenav div
target.find('#contentRow #sideNavBox').css({
"background-color" : "brown"
});
//Target SideNav
target.find('#scriptWPQ3 ul.static.ms-blog-listMenu-root.ms-core-listMenu-root.root ul.static li a').css({
"color" : 'yellow'
});
//No the Archive Title
target.find('#DeltaPlaceHolderLeftNavBar div:first-child div:nth-child(2) ul.static li a:not(#monthlyarchiveviewtitle)').css({
"color" : 'yellow'
});
var realcont = $('#contentRow');
/**************************
* A BLOG POST BRANDING
*************************/
//individual blog post.
//as long as an li has content
var lichild = $('ul.ms-blog-postList li:parent');
lichild.find('.ms-blog-postBox.ms-shadow').css({
"backgroundColor" : "brown",
"color" : "yellow"
});
//The Date Pin
lichild.find('div.ms-blog-postBoxDate').css({
"background-color" : "turquoise",
"color" : "maroon"
});
//The Post Title
lichild.find('.ms-blog-postBoxMargin h2:parent:not').css("color", "#00337F");
//The Email link bg
lichild.find('span ul.ms-comm-forumCmdList li').css("backgroundColor", "brown");
/**************************
* A BLOG TOOLS COLUMN
*************************/
var leftpart = $('table.ms-blog-MainArea tbody > tr td[valign=top][class*=blog-LeftColumn]');
//ms-blog-LeftColumn
//Profile Picture
var resource = "/_layouts/15/images/SPCustomGallery/CEO_tn.jpg?rev=23";
leftpart.find('table tbody tr>td img').attr({
"src" : resource
});
//Find a web part with this ID
leftpart.find('#WebPartWPQ5 .ms-blog-adminLinks.ms-core-defaultFont.ms-noList').css({
"backgroundColor" : "brown",
"color" : "yellow"
});
leftpart.find('li.ms-comm-adminLinksListItem a').css({
"color" : "white",
"text-decoration" : "none"
});
//Hide the change Layout Skin content
leftpart.find('li.ms-comm-adminLinksListItem:last-of-type').css("visibility", "hidden");
//Apply brown bg to entire section
$('table.ms-blog-MainArea tbody > tr td[valign=top][class*=blog-LeftColumn] > div:first-child').css({
"backgroundColor" : "brown",
"color" : "yellow"
});
/**************************
* REPLCACE BLOG SITE LOGO
*************************/
//Replace it with Custom Logo
var logo = "SPCustomGallery/kplclogo_tn-min.jpg?rev=23";
var here = $('#DeltaSiteLogo img').empty().attr("src").substr(0, 20);
var result = here+logo;
$('#DeltaSiteLogo img').attr("src", result);
//Search Box
$('#SearchBox>div').css("background-color", "purple");
$('#SearchBox>div input[type=text]').css("color", "white");
//Blog Title
$('#pageTitle>span')
.html("Welcome to our blog")
.css({
"color" : "yellow",
"font-weight" : "bold"
});
/**************************
* THEME LAYOUT ROLL UP
*************************/
//Select Boxed layout on page load
//then disable the Dropdown control
var myne = $('select.ms-blog-skinSelector');
myne.find('option[value=1]').attr("selected", "selected");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment