From d0c1bdeedead95446a163e75d91d29eddb308947 Mon Sep 17 00:00:00 2001 From: ZiqiYan Date: Sun, 11 Dec 2022 17:06:04 -0500 Subject: [PATCH] Batch import file --- image.js | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/image.js b/image.js index 87f40bb..9c20123 100755 --- a/image.js +++ b/image.js @@ -16,15 +16,17 @@ var H5P = H5P || {}; this.placeholder = true; } else { - this.source = H5P.getPath(params.file.path, id); - this.width = params.file.width; - this.height = params.file.height; - } - - this.alt = (!params.decorative && params.alt !== undefined) ? params.alt : ''; - - if (params.title !== undefined) { - this.title = params.title; + this.imageSet = [] + for(let i = 0;i', { - width: '100%', - height: '100%', - src: source, - alt: this.alt, - title: this.title === undefined ? '' : this.title, - on: { - load: function () { - self.trigger('loaded'); - } + self.$img = $('
', { + class: 'h5p-placeholder', + }); + for(let i = 0;i', { + width: '100%', + height: '100%', + src: imageSet[i].source, + alt: imageSet[i].alt, + title: imageSet[i].title, + on: { + load: function () { + self.trigger('loaded'); + } + } + })); } - }); } }