Wednesday, May 25, 2011

Customization Using JQuery

Client-Side Programming in Sharepoint # 5 - Customization Using JQuery



Save jquery-1.3.2.js in local document library (Jquery) , and update jquery file references in below scripts.You can placed these script either on the page in SPD editor or in CEWP.

  • List Forms (Edit/Display) - Hide created and modified by block from list forms (Edit, Display)

    <script type="text/javascript" src="/Jquery/jquery-1.3.2.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#onetidinfoblockV').hide();
    $('#onetidinfoblock1').hide();
    $('#onetidinfoblock2').hide();
    });
    </script>


  • List Forms (Edit/Display) - Replace created and modified by links with *** in list forms(Edit, Display)

    <script type="text/javascript" src="/Jquery/jquery-1.3.2.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('a[href*="userdisp.aspx?ID="]').each(function(index) {
    var link = $(this);
    $(this).after("***");
    $(this).remove();
    });
    });</script>



  • List Forms (Edit/Display) - Hide Spell Check image and list from list forms(Edit, Display)

    <script type="text/javascript" src="/Jquery/jquery-1.3.2.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('a[title*="Spelling..."]').each(function(index) {
    var link = $(this);
    link.parent().parent().hide();
    });

    });</script>


  • Site Header / Logo - Hide Title text from logo -
    Publishing Master Page- e.g. Blueband.master


    <script type="text/javascript" src="/Jquery/jquery-1.3.2.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('a[class*="zz1_logoLinkId_1"]').each(function(index) {
    var link = $(this);
    if (link.text() == "Employee Portal")
    link.text(link.text().replace("Employee Portal", ""));
    });
    });</script>

    Default Master page - default.master

    <style type="text/css">
    .ms-sitetitle h1
    {
    display:none
    }
    </style>


No comments: