gd-sprest
Advanced tools
Comparing version 8.0.8 to 8.0.9
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadSPCore = void 0; | ||
var executor_1 = require("../executor"); | ||
/** | ||
@@ -11,31 +12,34 @@ * Loads the core SharePoint JavaScript library for JSOM. | ||
// Define the core libraries to load | ||
var libs = ["init", "MicrosoftAjax", "SP.Runtime", "SP"]; | ||
var _loop_1 = function (i) { | ||
var libName = libs[i]; | ||
// See if a script already exists | ||
if (document.querySelector("script[title='" + libName + "']") == null) { | ||
// Log | ||
console.debug("[gd-sprest] Loading the core library: " + libName); | ||
// Create the script element to load the library | ||
var elScript_1 = document.createElement("script"); | ||
elScript_1.title = libName; | ||
elScript_1.src = document.location.origin + "/_layouts/15/" + libName + ".js"; | ||
// Wait for the previous library to load | ||
setTimeout(function () { | ||
// Load the script | ||
document.head.appendChild(elScript_1); | ||
}, 10 * i); | ||
} | ||
else { | ||
// Log | ||
console.debug("[gd-sprest] Core library already loaded: " + libName); | ||
} | ||
}; | ||
var libs = ["init", "MicrosoftAjax", "SP.Runtime", "SP", "SP.Init"]; | ||
// Parse the libraries | ||
for (var i = 0; i < libs.length; i++) { | ||
_loop_1(i); | ||
} | ||
// Resolve the request | ||
resolve(); | ||
var counter = 0; | ||
executor_1.Executor(libs, function (libName) { | ||
// Return a promise | ||
return new Promise(function (resolve) { | ||
// See if a script already exists | ||
if (document.querySelector("script[title='" + libName + "']") == null) { | ||
// Log | ||
console.debug("[gd-sprest] Loading the core library: " + libName); | ||
// Create the script element to load the library | ||
var elScript_1 = document.createElement("script"); | ||
elScript_1.title = libName; | ||
elScript_1.src = document.location.origin + "/_layouts/15/" + libName + ".js"; | ||
// Wait for the previous library to load | ||
setTimeout(function () { | ||
// Load the script | ||
document.head.appendChild(elScript_1); | ||
// Resolve the request | ||
resolve(null); | ||
}, 10 * counter++); | ||
} | ||
else { | ||
// Log | ||
console.debug("[gd-sprest] Core library already loaded: " + libName); | ||
} | ||
}).then(function () { | ||
// Resolve the request after all the libraries have been requested | ||
resolve(); | ||
}); | ||
}); | ||
}); | ||
}; |
@@ -12,3 +12,3 @@ "use strict"; | ||
exports.$REST = { | ||
__ver: 8.08, | ||
__ver: 8.09, | ||
AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); }, | ||
@@ -15,0 +15,0 @@ Apps: Lib.Apps, |
{ | ||
"name": "gd-sprest", | ||
"version": "8.0.8", | ||
"version": "8.0.9", | ||
"description": "An easy way to develop against the SharePoint REST API.", | ||
@@ -5,0 +5,0 @@ "author": "Gunjan Datta <me@dattabase.com> (https://gunjandatta.github.io)", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2572055
31345