var H5P = H5P || {}; H5P.IFrameEmbed = function (options, contentId) { var $ = H5P.jQuery; var $iframe = null; this.$ = $(this); options = H5P.jQuery.extend({ width: "500px", minWidth: "300px", height: "500px", source: "", resizeSupported: true }, options); if (!this instanceof H5P.IFrameEmbed){ return new H5P.IFrameEmbed(options, contentId); } this.attach = function ($wrapper) { // Set up an iframe with the correct source, and append // it to '$wrapper'. var iFrameSource = ''; if (options.source !== undefined) { if (options.source.trim().toLowerCase().substring(0, 4) === 'http') { iFrameSource = options.source; } else { iFrameSource = H5P.getContentPath(contentId) + '/' + options.source; } } $iframe = $('