Giter Club home page Giter Club logo

pd-sputil's Introduction

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

Param Type
[formId] string
saveButtonValue string

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

Param Type
callback requestCallback
context object

pdsputil.getDataType(item) ⇒ string

Return the javascript type in lowercase, ex array object

Kind: static method of pdsputil

Param Type
item *

pdsputil.elementTagName(element) ⇒ string

Returns a lower case element tag name ex div

Kind: static method of pdsputil

Param Type
element JQuery | HTMLElement

pdsputil.argsConverter(args, startAt) ⇒ Array

Takes a functions arguments and converts it to an array

Kind: static method of pdsputil

Param Type
args Array
startAt number

pdsputil.arrayInsertAtIndex(array, index) ⇒ Array

Inserts an item or items starting at the passed index

Kind: static method of pdsputil

Param Type
array Array
index number

pdsputil.arrayRemoveAtIndex(array, index) ⇒ Array

Removes an item from index of the passed array

Kind: static method of pdsputil

Param Type
array Array
index number

pdsputil.encodeAccountName(acctName) ⇒ string

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

Kind: static method of pdsputil

Param Type
acctName string

pdsputil.promiseDelay(time) ⇒ promise

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

Kind: static method of pdsputil

Param Type
time number

pdsputil.exportToCSV(filename, rows) ⇒ void

Creates a CSV file from the passed array

Kind: static method of pdsputil

Param Type
filename string
rows Array.<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

Param Type
url string

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

Cleans the ajax search results to an array of objects

Kind: static method of pdsputil

Param Type
results Array.<object>
neededProps Array.<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

Param Type
scriptName string

pdsputil.tableRowLoop(table, cb) ⇒ void

Loops through all rows of the passed table

Kind: static method of pdsputil

Param Type
table JQuery
cb function

pdsputil.loadSPScript(fileName) ⇒ Promise

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

Kind: static method of pdsputil

Param Type
fileName string

pdsputil.validGuid(guid) ⇒ boolean

Test a string to ensure it is a valid guid

Kind: static method of pdsputil

Param Type
guid string

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

Param Type
key string

sesStorage.setItem(key, value) ⇒ void

Stores an item from session storage

Kind: instance method of sesStorage

Param Type
key string
value *

sesStorage.removeItem(key) ⇒ void

Removes an item from session storage

Kind: instance method of sesStorage

Param Type
key string

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

Param Type Description
id string
...args args all 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

Param Type
id string
fn subscription

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

Param Type
id string
fn unsub

sublish.clear(id) ⇒ void

Clears the internal cache so all subscribed function all be removed

Kind: instance method of Sublish

Param Type
id string

pdsputil~requestCallback ⇒ void

Function that is called when the dom is ready

Kind: inner typedef of pdsputil

Param Type
context *

pdsputil~subscription ⇒ void

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

pdsputil~unsub ⇒ void

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

pd-sputil's People

Contributors

johon8 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.