INNER CODE UNIT · JavaScript
embed
presenta-software/presenta-lib · src/blocks/embed/index.js:12
const embed = function (el, config) {
const presentMode = config._mode === 'present' || config._mode === 'print' || config.overrideMode
let iframe = null
if (config.url) {
iframe = `<iframe src="${config.url}"></iframe>`
}
if (config.code) {
iframe = config.code
}
if (!iframe) return false
const that = this
return new Promise((resolve, reject) => {
const name = iframePrimaryDomain(iframe)
const msg = name ? `Embed from <mark>${name}</mark>` : 'Embed resource'