From 7aa203150fc1a2ec79c681c13f0d486d531746eb Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 23:57:48 +0200 Subject: error pages; js system to support back/front-end --- html/assets/js/utils/getApis.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 html/assets/js/utils/getApis.js (limited to 'html/assets/js/utils/getApis.js') diff --git a/html/assets/js/utils/getApis.js b/html/assets/js/utils/getApis.js new file mode 100644 index 0000000..46788a6 --- /dev/null +++ b/html/assets/js/utils/getApis.js @@ -0,0 +1,17 @@ +define(['apiReady', 'whenAll'], function (apiReady, whenAll) { + return function ($elements, name) { + var result = []; + var d = $.Deferred(); + var p = $elements.map(function () { + var $element = $(this); + return apiReady($element, name).then(function (api) { + result.push({ api: api, $element: $element }); + }); + }); + whenAll(p).then(function () { + d.resolve(result); + }); + + return d; + }; +}); \ No newline at end of file -- cgit v1.2.3