gd-sprest 8.0.6 → 8.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -520,7 +520,7 @@ export interface ISPConfigProps {
520
520
  ListCfg?: Array<ISPCfgListInfo>;
521
521
 
522
522
  /** Event for the logging of the configuration. */
523
- onLogMessage?: (msg: string) => void;
523
+ onLogMessage?: (msg: string, isError?: boolean) => void;
524
524
 
525
525
  /** The web part configuration. */
526
526
  WebPartCfg?: Array<ISPCfgWebPartInfo>;
@@ -9,23 +9,30 @@ exports.loadSPCore = function () {
9
9
  return new Promise(function (resolve) {
10
10
  // Define the core libraries to load
11
11
  var libs = ["init", "MicrosoftAjax", "SP.Runtime", "SP"];
12
- // Parse the libraries
13
- for (var i = 0; i < libs.length; i++) {
12
+ var _loop_1 = function (i) {
14
13
  var libName = libs[i];
15
14
  // See if a script already exists
16
15
  if (document.querySelector("script[title='" + libName + "']") == null) {
17
16
  // Log
18
17
  console.debug("[gd-sprest] Loading the core library: " + libName);
19
- // Load the library
20
- var elScript = document.createElement("script");
21
- elScript.title = libName;
22
- elScript.src = document.location.origin + "/_layouts/15/" + libName + ".js";
23
- document.head.appendChild(elScript);
18
+ // Create the script element to load the library
19
+ var elScript_1 = document.createElement("script");
20
+ elScript_1.title = libName;
21
+ elScript_1.src = document.location.origin + "/_layouts/15/" + libName + ".js";
22
+ // Wait for the previous library to load
23
+ setTimeout(function () {
24
+ // Load the script
25
+ document.head.appendChild(elScript_1);
26
+ }, 10 * i);
24
27
  }
25
28
  else {
26
29
  // Log
27
30
  console.debug("[gd-sprest] Core library already loaded: " + libName);
28
31
  }
32
+ };
33
+ // Parse the libraries
34
+ for (var i = 0; i < libs.length; i++) {
35
+ _loop_1(i);
29
36
  }
30
37
  // Resolve the request
31
38
  resolve();
@@ -39,7 +39,7 @@ exports.SPConfig = function (cfg, webUrl) {
39
39
  console.log(message);
40
40
  }
41
41
  // Call the event
42
- cfg.onLogMessage ? cfg.onLogMessage(message) : null;
42
+ cfg.onLogMessage ? cfg.onLogMessage(message, isError) : null;
43
43
  };
44
44
  /**
45
45
  * Methods
package/build/rest.js CHANGED
@@ -9,7 +9,7 @@ var sptypes_1 = require("./sptypes");
9
9
  * SharePoint REST Library
10
10
  */
11
11
  exports.$REST = {
12
- __ver: 8.06,
12
+ __ver: 8.08,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -3997,7 +3997,7 @@ declare module 'gd-sprest/helper/spCfg' {
3997
3997
  ListCfg?: Array<ISPCfgListInfo>;
3998
3998
 
3999
3999
  /** Event for the logging of the configuration. */
4000
- onLogMessage?: (msg: string) => void;
4000
+ onLogMessage?: (msg: string, isError?: boolean) => void;
4001
4001
 
4002
4002
  /** The web part configuration. */
4003
4003
  WebPartCfg?: Array<ISPCfgWebPartInfo>;