Preventing copy-paste all the rich text editor in SharePoint

As part of an accessible Web sites in SharePoint, this time I will present the code prevents the copy-paste.

The following code prevents copy-paste content editor rich text field


/*  ECM  */
function disablePasteForRTE() {
    Type.registerNamespace("RTE");
    if (RTE) {
        if (RTE.RichTextEditor != null) {
            RTE.RichTextEditor.paste = function () {
                RTE.Cursor.paste(true);
            }
            RTE.Cursor.$3C_0 = true;
        }
    }
}
if (_spBodyOnLoadFunctionNames != null) {
    _spBodyOnLoadFunctionNames.push('disablePasteForRTE');
}
/* End ECM *




Your... Roi

Comments

Popular posts from this blog

A sharepoint list view of the current month

Export SharePoint 2010 List to Excel with PowerShell

SharePoint Service Provisioning - the service stuck on starting