Content Editor Web Part Code
Hide Quick Launch Bar:
2007
<style>
.ms-pagetitleareaframe { display: none; } .ms-navframe { display: none; } .ms-titleareaframe { display: none; } </style>
2010 <style type="text/css"> body #s4-leftpanel
{
display: none;
} .s4-ca
{
margin-left: 0px;
} </style>
Hide Master Page:
<style>
.ms-globalbreadcrumb { display: none; } .ms-bannerContainer { display: none; } .ms-globaltitlearea { display: none; } .ms-pagebottommargin { display: none; } .ms-pagebottommarginleft { display: none; } .ms-pagemargin { display: none; } .ms-bodyareaframe { border-color: #FFFFFF; } .ms-bodyareapagemargin { display: none; } .ms-titlearealeft { display: none; } .ms-banner { display: none; } </style>
Hide More Items Link (2007):
<style type="text/css">
#onetidMore { display: none; }
</style>
Hide More Items Link (2010):
<style> #onetidMoreAnn { DISPLAY: none } </style>
Hide Web Part List Column Headers (2007):
<style> .ms-vb {display: none;} </style>
Hide Web Part List Column Headers (2010):
<style> .ms-viewheadertr { DISPLAY: none }</style>
Hide Web Part Page Description:
<style type="text/css"> .ms-webpartpagedescription {display:none;} </style>
Hide Web Part Page Breadcrumbs:
<style>
td.ms-titlearea { display: none; } </style>
Hides Link in Lookup Column (will also remove grouping expand/collapse option)
<div id="scriptdiv"></div>
<script language="javascript">
var CTXMAX = 5;
function RemoveLookupAfterPageLoad()
{
var table, i=1, ctx;
// Remove lookup links
while(i<=CTXMAX)
{
eval("if(typeof ctx" + i + " != 'undefined') ctx = ctx" + i +"; else ctx = null");
i++;
if(!ctx)
break;
table = document.getElementById(ctx.listName + "-" + ctx.view);
if(table)
{
table = table.parentNode;
table.innerHTML = RemoveLookupLinks(table.innerHTML);
}
}
}
function CreateDynamicFunction()
{
// Create a function "ExpGroupCallServerg_GUID"
var scriptdiv = document.createElement("div");
var i=1, funcExpGroup ="", ctx, val;
if(browseris.ie)
document.getElementById("scriptdiv").appendChild(scriptdiv);
while(i<=CTXMAX)
{
eval("if(typeof ctx" + i + " != 'undefined') ctx = ctx" + i +"; else ctx = null");
i++;
if(!ctx)
break;
funcExpGroup = funcExpGroup + "function ExpGroupCallServerg_{0}(arg, context){\n" +
"globalArg_g_{0} = arg; globalContext_g_{0} = context;\n" +
"setTimeout(\"WebForm_DoCallback('ctl00$m$g_{0}',globalArg_g_{0},Interceptor,globalContext_g_{0},ExpGroupOnError,true)\", 0);\n}\n";
funcExpGroup = funcExpGroup.replace(/\{0\}/g,ctx.view.toLowerCase().replace("{","").replace("}","").replace(/-/g,"_"));
}
scriptdiv.innerHTML = " <script" + " defer>" + funcExpGroup + "</" + "script>";
if(!(browseris.ie))
document.getElementById("scriptdiv").appendChild(scriptdiv);
scriptdiv.style.display="none";
}
CreateDynamicFunction();
//Ajax function interceptor
function Interceptor(htmlToRender, groupName)
{
ExpGroupReceiveData(RemoveLookupLinks(htmlToRender), groupName);
}
//Function which removes links using regex
function RemoveLookupLinks(htmlToRender)
{
return htmlToRender.replace(/<a[^>]*RootFolder=\*[^>]*>([^<]*)<\/a>/gi,"$1");
}
//Queue up the function to execute after page load
_spBodyOnLoadFunctionNames.push("RemoveLookupAfterPageLoad");
</script>
Shrinks Calendar
<style type="text/css">
/* Tiny Calendar */
/* Christophe@PathToSharePoint.com */
/* Remove week blocks */
.ms-cal-weekempty {display:none;}
.ms-cal-week {display:none;}
.ms-cal-weekB {display:none;}
.ms-cal-weekB {display:none;}
/* Shrink cells */
.ms-cal-workitem2B {display:none;}
.ms-cal-noworkitem2B {display:none;}
.ms-cal-nodataBtm2 {display:none;}
.ms-cal-todayitem2B {display:none;}
.ms-cal-workitem {font-size:0px;}
.ms-cal-muworkitem {font-size:0px;}
.ms-cal-noworkitem {font-size:0px;}
.ms-cal-nodataMid {font-size:0px;}
.ms-cal-todayitem {font-size:0px;}
/* thin out header */
.ms-cal-nav {display:none;}
.ms-cal-nav-buttonsltr {display:none;}
.ms-cal-navheader {padding:0px;spacing:0px;}
.ms-calheader IMG {width:15px;}
/* Abbreviate weekdays */
.ms-cal-weekday {letter-spacing:6px; width:22px; overflow: hidden;}
/* events display */
.ms-cal-defaultbgcolor {padding:0;}
.ms-cal-defaultbgcolor a {font-size:3px;}
.ms-cal-monthitem a {font-size:3px;}
.ms-cal-monthitem a:hover {font-size:10px;}
</style>
Allows Text to HTML
<script type="text/javascript">
/*
Text to HTML - version 2.1.1
Questions and comments: Christophe@PathToSharePoint.com
*/
function TextToHTML(NodeSet, HTMLregexp) {
var CellContent = "";
var i=0;
while (i < NodeSet.length){
try {
CellContent = NodeSet[i].innerText || NodeSet[i].textContent;
if (HTMLregexp.test(CellContent)) {NodeSet[i].innerHTML = CellContent;}
}
catch(err){}
i=i+1;
}
}
// Calendar views
var regexpA = new RegExp("\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*");
TextToHTML(document.getElementsByTagName("a"),regexpA);
// List views
var regexpTD = new RegExp("^\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");
TextToHTML(document.getElementsByTagName("TD"),regexpTD);
// Grouped list views
ExpGroupRenderData = (function (old) {
return function (htmlToRender, groupName, isLoaded) {
var result = old(htmlToRender, groupName, isLoaded);
var regexpTD = new RegExp("^\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");
TextToHTML(document.getElementsByTagName("TD"),regexpTD);
};
})(ExpGroupRenderData);
// Preview pane views
if (typeof(showpreview1)=="function") {
showpreview1 = (function (old) {
return function (o) {
var result = old(o);
var regexpTD = new RegExp("^\\s*<([a-zA-Z]*)(.|\\s)*/\\1?>\\s*$");
TextToHTML(document.getElementsByTagName("TD"),regexpTD);
};
})(showpreview1);
}
</script>
Change display size of Comment Box (i.e. in edit form)
2007
Changed .css from
.ms-rtelong{ width:384px; }
to
.ms-rtelong { width:600px; height:400px; }
2010
<style type="text/css">
.ms-rtelong{ width:600px; height:200px; }
</style>
Comments