Skip to content

Instantly share code, notes, and snippets.

View jamesnotjim's full-sized avatar

James Martin jamesnotjim

View GitHub Profile
@jamesnotjim
jamesnotjim / JSredirect.html
Created September 6, 2017 20:36
A pure JS redirect with configurable URL and delay.
<script type="text/javascript">
// delay, in milliseconds
var delay = 6000;
var URL = "https://example.com";
document.write("<h1>This page has moved. You will be redirected in " + delay/1000 + " seconds. If you are not redirected, please <a href=" + URL + ">follow this link</a>.</h1>");
setTimeout(function(){ window.location = URL; }, delay);
</script>
@jamesnotjim
jamesnotjim / hideInlineBlogByline.css
Created April 18, 2017 20:30
Hides the byline and dateline on O365/SharePoint Online Blogs that use the Inline post layout
<style type="text/css">
.ms-metadata.ms-textSmall span {
visibility: hidden;
}
</style>
@jamesnotjim
jamesnotjim / removeAllCapsTransform.css
Last active April 14, 2017 21:41
Removes all-caps styling from BindTuning's Ignite theme
<style type="text/css">
h1, h2, h3, h4, h5, h6 {
text-transform: none !important;
}
</style>
@jamesnotjim
jamesnotjim / maxWidthForResponsiveImages.css
Created April 12, 2017 19:23
Keep responsive images from scaling up beyond a reasonable limit.
<style type="text/css">
.img-responsive {
max-width: 800px;
};
</style>
@jamesnotjim
jamesnotjim / hideQuickLaunchBelow1024px.css
Last active February 28, 2017 21:31
Hide SharePoint QuickLaunch when below 1024px
<style type="text/css">
@media screen and (max-width: 1024px){
#sideNavBox {
display: none;
}
#contentBox {
margin-left: 36px;
margin-right: 36px;
}
.ms-fullscreenmode #contentBox
@jamesnotjim
jamesnotjim / persistSharePointOverlayCalendarColor.css
Last active February 27, 2017 20:34
Persist colors for Calendars in View
<style type="text/css">
/* Persist the calendar item color for .ms-acal.color1 (dark teal) */
.ms-acal-item {
background-color: #00485B;
}
</style>
<style type="text/css">
/* Persist the calendar item color for .ms-acal.color2 (blue) */
.ms-acal-item {
@jamesnotjim
jamesnotjim / highlightImageOnHover.html
Created December 2, 2016 16:05
A simple image opacity effect for use on images as links.
<!-- Wrap image in a div with class="brightness" -->
<div class="brightness">
<img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png">
</div>
<!-- Add CSS to create the opacity effect -->
<style type="text/css">
.brightness {
background-color: white;
display: inline-block;
@jamesnotjim
jamesnotjim / hideByLine.css
Last active April 18, 2017 20:38
Hide the by-line on SharePoint blog sites
<style type="text/css">
/* Hide by-line author and time */
ul li div div span span .ms-subtleLink {
visibility: hidden;
display: none;
}
/* Uncomment to Hide entire by-line
ul li .ms-textSmall span {
visibility: hidden;
display: none;
@jamesnotjim
jamesnotjim / forwarder.html
Created September 6, 2016 17:01
Ye Olde Meta Refresh Forwarder
<meta http-equiv="refresh" content="3;url=http://example.com">
@jamesnotjim
jamesnotjim / viewTitle.html
Created August 30, 2016 20:28
In SharePoint 2013, replace a generic page title with the the document.title, which includes the view name
<script type="text/javascript">
// Replace default page title with document.title, which is based on view name
document.getElementById("DeltaPlaceHolderPageTitleInTitleArea").innerHTML = document.title;
</script>