mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
tests: Promisify helper.init()
This commit is contained in:
parent
c714ff1014
commit
20df34bb67
2 changed files with 21 additions and 24 deletions
|
@ -6,17 +6,16 @@ const helper = {};
|
|||
let $iframe;
|
||||
const jsLibraries = {};
|
||||
|
||||
helper.init = (cb) => {
|
||||
$.get('../../static/js/vendors/jquery.js').done((code) => {
|
||||
// make sure we don't override existing jquery
|
||||
jsLibraries.jquery = `if(typeof $ === 'undefined') {\n${code}\n}`;
|
||||
|
||||
$.get('lib/sendkeys.js').done((code) => {
|
||||
jsLibraries.sendkeys = code;
|
||||
|
||||
cb();
|
||||
});
|
||||
});
|
||||
helper.init = async () => {
|
||||
[
|
||||
jsLibraries.jquery,
|
||||
jsLibraries.sendkeys,
|
||||
] = await Promise.all([
|
||||
$.get('../../static/js/vendors/jquery.js'),
|
||||
$.get('lib/sendkeys.js'),
|
||||
]);
|
||||
// make sure we don't override existing jquery
|
||||
jsLibraries.jquery = `if (typeof $ === 'undefined') {\n${jsLibraries.jquery}\n}`;
|
||||
};
|
||||
|
||||
helper.randomString = (len) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue