The embedding looks a lot nicer! But this bit worries me:
Now when the page loads, the script will find that card, and replace it with a fancy embedded version.
Sounds suspiciously like Twitter’s embedding, which we can’t use on discourse because it modifies the height after the page loads…
Maybe we can use the “programmatic card creation” in a decorateCooked method somehow…
Edit:
Yep, their handily un-minified javascript has some iframe-resizing magic going on, so I don’t think it’ll work ![]()
var receiveMessage = function receiveMessage(event) {
if (!isAllowedOrigin(event.origin)) {
return;
}
if (event.data.command === 'resize' && event.data.secret) {
var card = _this.activeCards[event.data.secret];
if (!card || !card.el) {
return;
}
var newHeight = event.data.options.height;
if (newHeight !== undefined) {
card.el.height = newHeight;
}