Showing posts with label SharePoint 2010; NoteBoard;. Show all posts
Showing posts with label SharePoint 2010; NoteBoard;. Show all posts

Wednesday, 24 July 2013

Customizing the OOB Note Board

1. Disabling the Edit button. Put the below css in content editor of the page containing the noteboard along with the css script tag.



span.socialcomment-cmdlink > a[id*="_socomEditBtn"]
{
    visibility: hidden !important;
   
}

2. Hiding the default text prior to 1st post and disabling the mysite hyperlink against the user & changing css .


<script language="javascript" src="/SiteAssets/jquery-1.7.1.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function () {
    SetProperties();
    HideCommentText();
    });
function HideCommentText() {
    var errorText = "There are no notes posted yet. You can use notes to comment on a page";
    if ($("div:contains('" + errorText + "')").length == 0) {
        setTimeout(HideCommentText, 50);
    }
    else {
        $("div:contains('" + errorText + "'):last").html("");
    }
}
function SetProperties() {
    var textBox = "div[id$='_newCommentField']";
    var errorText = "span[id$='_newCommentField_RTEError']";
    var listview = "div[id$='_PlaceHolder']";
    var pagination = "div[id^='CommentPagingControlContainer_']";
    $(textBox).css("margin-left", "40px");
    $(textBox).css("margin-right", "10px");
   $(textBox).css("background-color", "white");
    $(textBox).css("padding-top", "0px");
    $(textBox).css("width", "740px");
    $(textBox).css("height", "100px");
    $(textBox).css("overflow", "auto");
    $(errorText).css("width", "740px");
    $(errorText).css("margin-left", "40px");
    $("div.ms-socialCommentLoading").css("width", "740px");
    $("div.ms-socialCommentLoading").css("margin-left", "40px");
    $("div.ms-socialCommentLoading").css("margin-right", "10px");
    $(listview).css("width", "740px");
    $(listview).css("margin-left", "40px");
    $(pagination).css("margin-left", "40px");
}
$(window).load(function () {
    $('.ms-socialCommentItem .socialcomment-username').find("a").live({
        click: function () {
        },
        mouseover: function () {
            $(this).removeAttr('href');
            $(this).removeAttr('onclick');

        },
        mouseout: function () {
            $(this).removeClass("over");
            $(this).addClass("UserNameLink");
        }
    });
});
</script>