Search Results for

    Show / Hide Table of Contents

    Class JavaScriptExtensions

    JavaScript related methods

    Inheritance
    System.Object
    JavaScriptExtensions
    Namespace: Microsoft.SharePoint.Client
    Assembly: PnP.Framework.dll
    Syntax
    public static class JavaScriptExtensions : object

    Fields

    SCRIPT_LOCATION

    Default Script Location value

    Declaration
    public const string SCRIPT_LOCATION = null
    Field Value
    System.String

    Methods

    AddJsBlock(Site, String, String, Int32)

    Injects javascript via a adding a custom action to the site

    Declaration
    public static bool AddJsBlock(this Site site, string key, string scriptBlock, int sequence = 0)
    Parameters
    Site site

    Site to be processed

    System.String key

    Identifier (key) for the custom action that will be created

    System.String scriptBlock

    Javascript to be injected

    System.Int32 sequence

    Specifies the ordering priority for actions. A value is 0 indicates that the button will appear at the first position on the ribbon.

    Returns
    System.Boolean

    True if action was ok

    AddJsBlock(Web, String, String, Int32)

    Injects javascript via a adding a custom action to the site

    Declaration
    public static bool AddJsBlock(this Web web, string key, string scriptBlock, int sequence = 0)
    Parameters
    Web web

    Site to be processed - can be root web or sub site

    System.String key

    Identifier (key) for the custom action that will be created

    System.String scriptBlock

    Javascript to be injected

    System.Int32 sequence

    Specifies the ordering priority for actions. A value is 0 indicates that the button will appear at the first position on the ribbon.

    Returns
    System.Boolean

    True if action was ok

    AddJsLink(Site, String, IEnumerable<String>, Int32)

    Injects links to javascript files via a adding a custom action to the site

    Declaration
    public static bool AddJsLink(this Site site, string key, IEnumerable<string> scriptLinks, int sequence = 0)
    Parameters
    Site site

    Site to be processed

    System.String key

    Identifier (key) for the custom action that will be created

    IEnumerable<System.String> scriptLinks

    IEnumerable list of links to javascript files

    System.Int32 sequence

    Specifies the ordering priority for actions. A value is 0 indicates that the button will appear at the first position on the ribbon.

    Returns
    System.Boolean

    True if action was ok

    AddJsLink(Site, String, String, Int32)

    Injects links to javascript files via a adding a custom action to the site

    Declaration
    public static bool AddJsLink(this Site site, string key, string scriptLinks, int sequence = 0)
    Parameters
    Site site

    Site to be processed

    System.String key

    Identifier (key) for the custom action that will be created

    System.String scriptLinks

    semi colon delimited list of links to javascript files

    System.Int32 sequence

    Specifies the ordering priority for actions. A value is 0 indicates that the button will appear at the first position on the ribbon.

    Returns
    System.Boolean

    True if action was ok

    AddJsLink(Web, String, IEnumerable<String>, Int32)

    Injects links to javascript files via a adding a custom action to the site

    Declaration
    public static bool AddJsLink(this Web web, string key, IEnumerable<string> scriptLinks, int sequence = 0)
    Parameters
    Web web

    Site to be processed - can be root web or sub site

    System.String key

    Identifier (key) for the custom action that will be created

    IEnumerable<System.String> scriptLinks

    IEnumerable list of links to javascript files

    System.Int32 sequence

    Specifies the ordering priority for actions. A value is 0 indicates that the button will appear at the first position on the ribbon.

    Returns
    System.Boolean

    True if action was ok

    AddJsLink(Web, String, String, Int32)

    Injects links to javascript files via a adding a custom action to the site

    Declaration
    public static bool AddJsLink(this Web web, string key, string scriptLinks, int sequence = 0)
    Parameters
    Web web

    Site to be processed - can be root web or sub site

    System.String key

    Identifier (key) for the custom action that will be created

    System.String scriptLinks

    semi colon delimited list of links to javascript files

    System.Int32 sequence

    Specifies the ordering priority for actions. A value is 0 indicates that the button will appear at the first position on the ribbon.

    Returns
    System.Boolean

    True if action was ok

    DeleteJsLink(Site, String)

    Removes the custom action that triggers the execution of a javascript link

    Declaration
    public static bool DeleteJsLink(this Site site, string key)
    Parameters
    Site site

    Site to be processed

    System.String key

    Identifier (key) for the custom action that will be deleted

    Returns
    System.Boolean

    True if action was ok

    DeleteJsLink(Web, String)

    Removes the custom action that triggers the execution of a javascript link

    Declaration
    public static bool DeleteJsLink(this Web web, string key)
    Parameters
    Web web

    Site to be processed - can be root web or sub site

    System.String key

    Identifier (key) for the custom action that will be deleted

    Returns
    System.Boolean

    True if action was ok

    ExistsJsLink(Site, String)

    Checks if the target site already has a custom JsLink with a specified key

    Declaration
    public static Boolean ExistsJsLink(this Site site, string key)
    Parameters
    Site site

    Site to be processed

    System.String key

    Identifier (key) for the custom action that will be created

    Returns
    Boolean

    True if custom JsLink exists, false otherwise

    ExistsJsLink(Web, String)

    Checks if the target web already has a custom JsLink with a specified key

    Declaration
    public static Boolean ExistsJsLink(this Web web, string key)
    Parameters
    Web web

    Web to be processed

    System.String key

    Identifier (key) for the custom action that will be created

    Returns
    Boolean

    ExistsJsLinkImplementation(ClientObject, String)

    Checks if the given clientObject already has a custom JsLink with a specified key

    Declaration
    public static Boolean ExistsJsLinkImplementation(ClientObject clientObject, string key)
    Parameters
    ClientObject clientObject

    clientObject to operate on

    System.String key

    Identifier (key) for the custom action that will be created

    Returns
    Boolean

    True if custom JsLink exists, false otherwise

    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer