Skip to content

Commit

Permalink
fixed object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Aymkdn committed Dec 27, 2019
1 parent dd958d3 commit eb1c934
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 25 deletions.
4 changes: 2 additions & 2 deletions browser/sharepointplus.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

**Change Log v6.0.1 (December 27, 2019)**

- Fixed object creation that shared data with other instances

**Change Log v6.0 (December 26, 2019)**

- Added function `$SP().getManager()` to get details about an user's manager
Expand Down
2 changes: 1 addition & 1 deletion docs/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h3>Returns:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h3>Example:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ <h2>Older Versions</h2>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/lists.html
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ <h3>Example:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ <h3>Parameters:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/node.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h3>Example:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/people.html
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ <h3>Example:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ <h3>Example:</h3>
<div>Documentation built by <a target="_blank" href="http://twitter.com/aymkdn">@aymkdn</a> (<a href="http://kodono.info">http://kodono.info</a>) with <a href="https://jsdoc.app/">JSDoc</a>.</div>
<div>This work is licensed under <a rel="license" href="https://github.com/Aymkdn/SharepointPlus/blob/master/license.md">LGPL-3</a>.</div>
<div>Designed with <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>.</div>
<div>Automatically generated with JSDoc on Thu, 26 Dec 2019 13:58:38 GMT</div>
<div>Automatically generated with JSDoc on Fri, 27 Dec 2019 10:20:10 GMT</div>
</footer>
<script>prettyPrint()</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions es5/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ import webService from './utils/webService.js';
import workflowStatusToText from './utils/workflowStatusToText.js';

function spInit(params) {
var sp = new $SP();
sp.init(params);
return function () {
var sp = new $SP();
sp.init(params);
return sp;
};
}
Expand Down
11 changes: 7 additions & 4 deletions es5/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ global._SP_MAXWHERE_ONLOOKUP = 30;
global._SP_ISBROWSER = new Function("try {return this===window;}catch(e){ return false;}")();
global._SP_JSON_ACCEPT = "verbose"; // other options are "minimalmetadata" and "nometadata"

export var SharepointPlus =
var SharepointPlus =
/*#__PURE__*/
function () {
function SharepointPlus() {
Expand Down Expand Up @@ -214,6 +214,9 @@ function () {

return SharepointPlus;
}();
export default function () {
return new SharepointPlus();
}
/*export default function () {
return new SharepointPlus()
}*/


export { SharepointPlus as default };
2 changes: 1 addition & 1 deletion es5/utils/webService.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function _webService() {
}

_context.next = 10;
return getURL();
return getURL.call(this);

case 10:
url = _context.sent;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sharepointplus",
"version": "6.0.0",
"version": "6.0.1",
"description": "A library that offers an easy interface to deal with Sharepoint",
"module": "./es5/index.js",
"main": "./es5/index.js",
Expand Down
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ import webService from './utils/webService.js'
import workflowStatusToText from './utils/workflowStatusToText.js'

function spInit (params) {
let sp = new $SP();
sp.init(params);
return () => sp;
return () => {
let sp = new $SP;
sp.init(params);
return sp;
}
}

export default spInit({
Expand Down
1 change: 1 addition & 0 deletions src/lists/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import getURL from '../utils/getURL.js'
*/
export default async function list(list, url) {
this.listID = list.replace(/&/g,"&amp;");

if (url) {
// make sure we don't have a '/' at the end
this.url=(url.slice(-1)==='/'?url.slice(0,-1):url);
Expand Down
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ global._SP_MAXWHERE_ONLOOKUP=30;
global._SP_ISBROWSER=(new Function("try {return this===window;}catch(e){ return false;}"))();
global._SP_JSON_ACCEPT="verbose"; // other options are "minimalmetadata" and "nometadata"

export class SharepointPlus {
export default class SharepointPlus {
constructor() {
this.queue = []; // array of {fct:"function to execute", args:"Related arguments for this function"}
this.data=[];
Expand Down Expand Up @@ -149,6 +149,6 @@ export class SharepointPlus {

}

export default function () {
/*export default function () {
return new SharepointPlus()
}
}*/
2 changes: 1 addition & 1 deletion src/utils/webService.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default async function webService(options) {
options.webURL = options.webURL || this.url;
// if we didn't define the url in the parameters, then we need to find it
if (!options.webURL) {
let url = await getURL();
let url = await getURL.call(this);
options.webURL=url;
return webService.call(this, options);
}
Expand Down

0 comments on commit eb1c934

Please sign in to comment.