Common utilities for working with SharePoint
- pdsputil
- static
- .spSaveForm([formId], saveButtonValue) ⇒
void
- .domReady(callback, context) ⇒
void
- .getDataType(item) ⇒
string
- .elementTagName(element) ⇒
string
- .argsConverter(args, startAt) ⇒
Array
- .arrayInsertAtIndex(array, index) ⇒
Array
- .arrayRemoveAtIndex(array, index) ⇒
Array
- .encodeAccountName(acctName) ⇒
string
- .promiseDelay(time) ⇒
promise
- .exportToCSV(filename, rows) ⇒
void
- .getPageInfo() ⇒
object
- .spGotoUrl(url) ⇒
void
- .spSearchResultsCleaner(results, neededProps) ⇒
Array.<object>
- .pageEditModeTest() ⇒
boolean
- .hideRibbon() ⇒
void
- .URLparameters() ⇒
object
- .waitForScriptsReady(scriptName) ⇒
Promise
- .tableRowLoop(table, cb) ⇒
void
- .loadSPScript(fileName) ⇒
Promise
- .validGuid(guid) ⇒
boolean
- .getURLOrigin() ⇒
string
- .createGUID() ⇒
string
- .spSaveForm([formId], saveButtonValue) ⇒
- inner
- ~sesStorage
- new sesStorage()
- .getItem(key) ⇒
*
- .setItem(key, value) ⇒
void
- .removeItem(key) ⇒
void
- ~Sublish
- new Sublish()
- .publish(id, ...args) ⇒
void
- .subscribe(id, fn) ⇒
void
- .unsubscribe(id, fn) ⇒
void
- .clear(id) ⇒
void
- ~requestCallback ⇒
void
- ~subscription ⇒
void
- ~unsub ⇒
void
- ~sesStorage
- static
Saves SP out of the box form Editform, Newform
Kind: static method of pdsputil
Param | Type |
---|---|
[formId] | string |
saveButtonValue | string |
Invokes the callback when dom is ready context is passed to the call back as first parameter
Kind: static method of pdsputil
Param | Type |
---|---|
callback | requestCallback |
context | object |
Return the javascript type in lowercase, ex array object
Kind: static method of pdsputil
Param | Type |
---|---|
item | * |
Returns a lower case element tag name ex div
Kind: static method of pdsputil
Param | Type |
---|---|
element | JQuery | HTMLElement |
Takes a functions arguments and converts it to an array
Kind: static method of pdsputil
Param | Type |
---|---|
args | Array |
startAt | number |
Inserts an item or items starting at the passed index
Kind: static method of pdsputil
Param | Type |
---|---|
array | Array |
index | number |
Removes an item from index of the passed array
Kind: static method of pdsputil
Param | Type |
---|---|
array | Array |
index | number |
Adds the beginning string to an email and encodes it for url use
Kind: static method of pdsputil
Param | Type |
---|---|
acctName | string |
Returns a promise that will resolve in the given time or default to 5 secs
Kind: static method of pdsputil
Param | Type |
---|---|
time | number |
Creates a CSV file from the passed array
Kind: static method of pdsputil
Param | Type |
---|---|
filename | string |
rows | Array.<Array.<string>> |
Returns the SP pageObj that is on all SP pages
Kind: static method of pdsputil
Navigates the user to the url passed
Kind: static method of pdsputil
Param | Type |
---|---|
url | string |
Cleans the ajax search results to an array of objects
Kind: static method of pdsputil
Param | Type |
---|---|
results | Array.<object> |
neededProps | Array.<string> |
Lets the script know if the SP page is in edit mode
Kind: static method of pdsputil
Hides the ribbon at the top of an SP page
Kind: static method of pdsputil
Returns an object of the search properties in a url
Kind: static method of pdsputil
Returns a promise that is resolved when the passed SP (only) script file is loaded
Kind: static method of pdsputil
Param | Type |
---|---|
scriptName | string |
Loops through all rows of the passed table
Kind: static method of pdsputil
Param | Type |
---|---|
table | JQuery |
cb | function |
Returns a promise that resolves when the script file is loaded, any script file
Kind: static method of pdsputil
Param | Type |
---|---|
fileName | string |
Test a string to ensure it is a valid guid
Kind: static method of pdsputil
Param | Type |
---|---|
guid | string |
Returns the origin of the current site
Kind: static method of pdsputil
Creates a SharePoint GUID in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Kind: static method of pdsputil
Kind: inner class of pdsputil
- ~sesStorage
- new sesStorage()
- .getItem(key) ⇒
*
- .setItem(key, value) ⇒
void
- .removeItem(key) ⇒
void
Class creates a new instance of sesStorage
Retrieves an item from session storage
Kind: instance method of sesStorage
Param | Type |
---|---|
key | string |
Stores an item from session storage
Kind: instance method of sesStorage
Param | Type |
---|---|
key | string |
value | * |
Removes an item from session storage
Kind: instance method of sesStorage
Param | Type |
---|---|
key | string |
Kind: inner class of pdsputil
- ~Sublish
- new Sublish()
- .publish(id, ...args) ⇒
void
- .subscribe(id, fn) ⇒
void
- .unsubscribe(id, fn) ⇒
void
- .clear(id) ⇒
void
Class creates a new pub sub object
Publishes data to subscribers
Kind: instance method of Sublish
Param | Type | Description |
---|---|---|
id | string |
|
...args | args |
all items passed in will be added as parameters of function with same id |
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
Param | Type |
---|---|
id | string |
fn | subscription |
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
Param | Type |
---|---|
id | string |
fn | unsub |
Clears the internal cache so all subscribed function all be removed
Kind: instance method of Sublish
Param | Type |
---|---|
id | string |
Function that is called when the dom is ready
Kind: inner typedef of pdsputil
Param | Type |
---|---|
context | * |
function typedef for callback to subscribe to an emitted event.
Kind: inner typedef of pdsputil
Returns: void
- responseMessage
Type | Description |
---|---|
args |
whatever you pass into publish will be passed in here |
This function is a identifier for matching so it can be removed.
Kind: inner typedef of pdsputil
Returns: void
- - responseMessage
Type | Description |
---|---|
args |
whatever you pass into publish will be passed in here |