Sha256: 6198ac9711400051739cb18987e99aa7bd3465827993db0e9dd80f4d6d6b70c5

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

{"version":3,"file":"oembed.esm.js","sources":["../../../javascript/blacklight-oembed/oembed.js"],"sourcesContent":["export default function oEmbed(elements) {\n  if (!elements) return;\n\n  // Ensure elements is an array-like collection\n  elements = elements instanceof NodeList ? Array.from(elements) : [elements];\n\n  elements.forEach(function(embedViewer) {\n    const embedURL = embedViewer.dataset.embedUrl; // Get the embed URL from the data attribute\n\n    if (!embedURL) return;\n\n    // Fetch JSON data from the embed URL\n    fetch(embedURL)\n      .then(response => {\n        if (!response.ok) {\n          throw new Error('Network response was not ok');\n        }\n        return response.json();\n      })\n      .then(data => {\n        if (data === null) {\n          return;\n        }\n        // Set the inner HTML of the element\n        embedViewer.innerHTML = data.html;\n      })\n      .catch(error => {\n        console.error('Error fetching embed data:', error);\n      });\n  });\n}\n"],"names":[],"mappings":"AAAe,SAAS,MAAM,CAAC,QAAQ,EAAE;AACzC,EAAE,IAAI,CAAC,QAAQ,EAAE;;AAEjB;AACA,EAAE,QAAQ,GAAG,QAAQ,YAAY,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;;AAE7E,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE;AACzC,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;;AAElD,IAAI,IAAI,CAAC,QAAQ,EAAE;;AAEnB;AACA,IAAI,KAAK,CAAC,QAAQ;AAClB,OAAO,IAAI,CAAC,QAAQ,IAAI;AACxB,QAAQ,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AAC1B,UAAU,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;AACxD;AACA,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE;AAC9B,OAAO;AACP,OAAO,IAAI,CAAC,IAAI,IAAI;AACpB,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AAC3B,UAAU;AACV;AACA;AACA,QAAQ,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI;AACzC,OAAO;AACP,OAAO,KAAK,CAAC,KAAK,IAAI;AACtB,QAAQ,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC;AAC1D,OAAO,CAAC;AACR,GAAG,CAAC;AACJ;;;;"}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-oembed-1.4.2 app/assets/javascripts/blacklight_oembed/oembed.esm.js.map
blacklight-oembed-1.4.1 app/assets/javascripts/blacklight_oembed/oembed.esm.js.map