Class JavaScriptExtensions
JavaScript related methods
Inheritance
System.Object
JavaScriptExtensions
Namespace: Microsoft.SharePoint.Client
Assembly: PnP.Framework.dll
Syntax
public static class JavaScriptExtensions : object
JavaScript related methods
public static class JavaScriptExtensions : object
Default Script Location value
public const string SCRIPT_LOCATION = null
System.String
|
Injects javascript via a adding a custom action to the site
public static bool AddJsBlock(this Site site, string key, string scriptBlock, int sequence = 0)
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. |
System.Boolean
True if action was ok |
Injects javascript via a adding a custom action to the site
public static bool AddJsBlock(this Web web, string key, string scriptBlock, int sequence = 0)
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. |
System.Boolean
True if action was ok |
Injects links to javascript files via a adding a custom action to the site
public static bool AddJsLink(this Site site, string key, IEnumerable<string> scriptLinks, int sequence = 0)
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. |
System.Boolean
True if action was ok |
Injects links to javascript files via a adding a custom action to the site
public static bool AddJsLink(this Site site, string key, string scriptLinks, int sequence = 0)
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. |
System.Boolean
True if action was ok |
Injects links to javascript files via a adding a custom action to the site
public static bool AddJsLink(this Web web, string key, IEnumerable<string> scriptLinks, int sequence = 0)
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. |
System.Boolean
True if action was ok |
Injects links to javascript files via a adding a custom action to the site
public static bool AddJsLink(this Web web, string key, string scriptLinks, int sequence = 0)
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. |
System.Boolean
True if action was ok |
Removes the custom action that triggers the execution of a javascript link
public static bool DeleteJsLink(this Site site, string key)
Site
site
Site to be processed |
System.String
key
Identifier (key) for the custom action that will be deleted |
System.Boolean
True if action was ok |
Removes the custom action that triggers the execution of a javascript link
public static bool DeleteJsLink(this Web web, string key)
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 |
System.Boolean
True if action was ok |
Checks if the target site already has a custom JsLink with a specified key
public static Boolean ExistsJsLink(this Site site, string key)
Site
site
Site to be processed |
System.String
key
Identifier (key) for the custom action that will be created |
Boolean
True if custom JsLink exists, false otherwise |
Checks if the target web already has a custom JsLink with a specified key
public static Boolean ExistsJsLink(this Web web, string key)
Web
web
Web to be processed |
System.String
key
Identifier (key) for the custom action that will be created |
Boolean
|
Checks if the given clientObject already has a custom JsLink with a specified key
public static Boolean ExistsJsLinkImplementation(ClientObject clientObject, string key)
ClientObject
clientObject
clientObject to operate on |
System.String
key
Identifier (key) for the custom action that will be created |
Boolean
True if custom JsLink exists, false otherwise |