2.3.4 • Published 7 years ago

pd-sputil v2.3.4

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

pdsputil

Common utilities for working with SharePoint

pdsputil.spSaveForm(formId, saveButtonValue) ⇒ void

Saves SP out of the box form Editform, Newform

Kind: static method of pdsputil

ParamType
formIdstring
saveButtonValuestring

pdsputil.domReady(callback, context) ⇒ void

Invokes the callback when dom is ready context is passed to the call back as first parameter

Kind: static method of pdsputil

ParamType
callbackrequestCallback
contextobject

pdsputil.getDataType(item) ⇒ string

Return the javascript type in lowercase, ex array object

Kind: static method of pdsputil

ParamType
item*

pdsputil.elementTagName(element) ⇒ string

Returns a lower case element tag name ex div

Kind: static method of pdsputil

ParamType
elementJQuery | HTMLElement

pdsputil.argsConverter(args, startAt) ⇒ Array

Takes a functions arguments and converts it to an array

Kind: static method of pdsputil

ParamType
argsArray
startAtnumber

pdsputil.arrayInsertAtIndex(array, index) ⇒ Array

Inserts an item or items starting at the passed index

Kind: static method of pdsputil

ParamType
arrayArray
indexnumber

pdsputil.arrayRemoveAtIndex(array, index) ⇒ Array

Removes an item from index of the passed array

Kind: static method of pdsputil

ParamType
arrayArray
indexnumber

pdsputil.encodeAccountName(acctName) ⇒ string

Adds the beginning string to an email and encodes it for url use

Kind: static method of pdsputil

ParamType
acctNamestring

pdsputil.promiseDelay(time) ⇒ promise

Returns a promise that will resolve in the given time or default to 5 secs

Kind: static method of pdsputil

ParamType
timenumber

pdsputil.exportToCSV(filename, rows) ⇒ void

Creates a CSV file from the passed array

Kind: static method of pdsputil

ParamType
filenamestring
rowsArray.<Array.<string>>

pdsputil.getPageInfo() ⇒ object

Returns the SP pageObj that is on all SP pages

Kind: static method of pdsputil

pdsputil.spGotoUrl(url) ⇒ void

Navigates the user to the url passed

Kind: static method of pdsputil

ParamType
urlstring

pdsputil.spSearchResultsCleaner(results, neededProps) ⇒ Array.<object>

Cleans the ajax search results to an array of objects

Kind: static method of pdsputil

ParamType
resultsArray.<object>
neededPropsArray.<string>

pdsputil.pageEditModeTest() ⇒ boolean

Lets the script know if the SP page is in edit mode

Kind: static method of pdsputil

pdsputil.hideRibbon() ⇒ void

Hides the ribbon at the top of an SP page

Kind: static method of pdsputil

pdsputil.URLparameters() ⇒ object

Returns an object of the search properties in a url

Kind: static method of pdsputil

pdsputil.waitForScriptsReady(scriptName) ⇒ Promise

Returns a promise that is resolved when the passed SP (only) script file is loaded

Kind: static method of pdsputil

ParamType
scriptNamestring

pdsputil.tableRowLoop(table, cb) ⇒ void

Loops through all rows of the passed table

Kind: static method of pdsputil

ParamType
tableJQuery
cbfunction

pdsputil.loadSPScript(fileName) ⇒ Promise

Returns a promise that resolves when the script file is loaded, any script file

Kind: static method of pdsputil

ParamType
fileNamestring

pdsputil.validGuid(guid) ⇒ boolean

Test a string to ensure it is a valid guid

Kind: static method of pdsputil

ParamType
guidstring

pdsputil.getURLOrigin() ⇒ string

Returns the origin of the current site

Kind: static method of pdsputil

pdsputil.createGUID() ⇒ string

Creates a SharePoint GUID in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Kind: static method of pdsputil

pdsputil~sesStorage

Kind: inner class of pdsputil

new sesStorage()

Class creates a new instance of sesStorage

sesStorage.getItem(key) ⇒ *

Retrieves an item from session storage

Kind: instance method of sesStorage

ParamType
keystring

sesStorage.setItem(key, value) ⇒ void

Stores an item from session storage

Kind: instance method of sesStorage

ParamType
keystring
value*

sesStorage.removeItem(key) ⇒ void

Removes an item from session storage

Kind: instance method of sesStorage

ParamType
keystring

pdsputil~Sublish

Kind: inner class of pdsputil

new Sublish()

Class creates a new pub sub object

sublish.publish(id, ...args) ⇒ void

Publishes data to subscribers

Kind: instance method of Sublish

ParamTypeDescription
idstring
...argsargsall items passed in will be added as parameters of function with same id

sublish.subscribe(id, fn) ⇒ void

Subscribes a function to an id for the fn the function will recieve whatever arguments are passed to publish so your parameters to the function should be whatever you are going to pass publish to the given id

Kind: instance method of Sublish

ParamType
idstring
fnsubscription

sublish.unsubscribe(id, fn) ⇒ void

Unsubscribes a function for the fn the function passed must be an exact reference to the function or it will not match

Kind: instance method of Sublish

ParamType
idstring
fnunsub

sublish.clear(id) ⇒ void

Clears the internal cache so all subscribed function all be removed

Kind: instance method of Sublish

ParamType
idstring

pdsputil~requestCallback ⇒ void

Function that is called when the dom is ready

Kind: inner typedef of pdsputil

ParamType
context*

pdsputil~subscription ⇒ void

function typedef for callback to subscribe to an emitted event.

Kind: inner typedef of pdsputil
Returns: void - responseMessage

TypeDescription
argswhatever you pass into publish will be passed in here

pdsputil~unsub ⇒ void

This function is a identifier for matching so it can be removed.

Kind: inner typedef of pdsputil
Returns: void - - responseMessage

TypeDescription
argswhatever you pass into publish will be passed in here
2.3.4

7 years ago

2.3.3

8 years ago

2.3.2

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago