Methods

getVersion

(source code)
getVersion()
Returns the SP version

Returns:

String
The current SharepointPlus version

plugin

(source code)
plugin(pluginName, options)
Permits to use a plugin

Parameters:

String
pluginName
The plugin name to call
Object
options Optional
The options for the plugin

Example:

$SP().plugin('test',{message:"This is a test !"})

registerPlugin

(source code)
registerPlugin(pluginName, pluginFct)
Permits to register a plugin

Parameters:

String
pluginName
You have to define the plugin name
Function
pluginFct
You have to define the function of the plugin with one parameter that are the options passed

Example:

$SP().registerPlugin('test', function(options) {
  console.log(options.message);
})

webService

(source code)
webService(options, operation, service, properties, webURL, soapURL, soapAction)
Permits to directly deal with a WebService (similar to SPServices http://sympmarc.github.io/SPServices/core/web-services.html)

Parameters:

Object
options
String
operation
The method name to use (e.g. UpdateList, GetList, ....)
String
service
The name of the service (Lists, Versions, PublishedLinksService, ...) it's the ".asmx" name without the extension
Object
properties Optional, Default: {}
The properties to call
String
webURL Optional, Default: current website
The URL of the website
String|Boolean
soapURL Optional, Default: 'http://schemas.microsoft.com/sharepoint/soap/'
If the SOAP url is not the default one, then you can customize it... it will be send in the request's headers as "SOAPAction"
Boolean
soapAction Optional, Default: true
Some web services don't want the "SOAPAction" header

Returns:

Promise
resolve(responseBody), reject(see $SP().ajax())

Example:

$SP().webService({ // http://sympmarc.github.io/SPServices/core/web-services/Lists/UpdateList.html
  service:"Lists",
  operation:"Updatelist",
  webURL:"http://what.ever/"
  properties:{
    listName:"Test",
    listProperties:"...",
    newFields:"...",
    updateFields:"...",
    deleteFields:"...",
    listVersion:"..."
  }
}).then(function(response) {
  // do something with the response
}, function(error) {
  console.log("Error => ",error)
});

// to remove a person from a group
$SP().webService({
  service:"UserGroup",
  operation:"RemoveUserFromGroup",
  soapURL:"http://schemas.microsoft.com/sharepoint/soap/directory/",
  properties:{
    groupName:"Group",
    userLoginName:"domain\\user"
  }
}).then(function(response) {
  console.log("OK => ",response)
}, function(error) { console.log("Error => ",error) });