Class ScriptHelpers

Index

Methods

Methods

public static disableWebpartSelection(context: RenderContext)

Parameters

public static getDocumentQueryPairs(): { [index: string]: string; }

Returns

{ [index: string]: string; }

public static getFieldFromSchema(schema: ListSchema, fieldName: string): FieldSchema

Parameters

Returns

FieldSchema

public static getLayoutsPageUrl(pageName: string, webServerRelativeUrl: string): string

Parameters

  • pageName: string
  • webServerRelativeUrl: string

Returns

string

public static getListLevelPermissionMask(jsonItem: string): number

Parameters

  • jsonItem: string

Returns

number

public static getTextAreaElementValue(textAreaElement: HTMLTextAreaElement): string

Parameters

  • textAreaElement: HTMLTextAreaElement

Returns

string

public static getUrlQueryPairs(docUrl: string): { [index: string]: string; }

Parameters

  • docUrl: string

Returns

{ [index: string]: string; }

public static getUserFieldProperty(item: ListItem, fieldName: string, propertyName: string): any

Parameters

  • item: ListItem
  • fieldName: string
  • propertyName: string

Returns

any

public static hasPermission(listPermissionMask: number, listPermission: ListLevelPermissionMask): boolean

Parameters

Returns

boolean

public static isNullOrEmptyString(str: string): boolean

Parameters

  • str: string

Returns

boolean

public static isNullOrUndefined(obj: any): boolean

Parameters

  • obj: any

Returns

boolean

public static isNullOrUndefinedOrEmpty(str: string): boolean

Parameters

  • str: string

Returns

boolean

public static isUndefined(obj: any): boolean

Parameters

  • obj: any

Returns

boolean

public static newGuid(): Guid

Returns

Guid

public static removeHtml(str: string): string

Parameters

  • str: string

Returns

string

public static removeHtmlAndTrimStringWithEllipsis(str: string, maxLength: number): string

Parameters

  • str: string
  • maxLength: number

Returns

string

public static removeStyleChildren(element: HTMLElement): any

Parameters

  • element: HTMLElement

Returns

any

public static replaceOrAddQueryString(url: string, key: string, value: string): string

Parameters

  • url: string
  • key: string
  • value: string

Returns

string

public static resizeImageToSquareLength(imgElement: HTMLImageElement, squareLength: number)

Parameters

  • imgElement: HTMLImageElement
  • squareLength: number

public static setTextAreaElementValue(textAreaElement: HTMLTextAreaElement, newValue: string)

Parameters

  • textAreaElement: HTMLTextAreaElement
  • newValue: string

public static truncateToInt(n: number): number

Parameters

  • n: number

Returns

number

public static urlCombine(path1: string, path2: string): string

Parameters

  • path1: string
  • path2: string

Returns

string