]> cat aescling's git repositories - mastodon.git/blob - public/embed.js
Fix webfinger response not returning 410 when account is suspended (#11869)
[mastodon.git] / public / embed.js
1 (function() {
2 'use strict';
3
4 var ready = function(loaded) {
5 if (['interactive', 'complete'].indexOf(document.readyState) !== -1) {
6 loaded();
7 } else {
8 document.addEventListener('DOMContentLoaded', loaded);
9 }
10 };
11
12 ready(function() {
13 var iframes = [];
14
15 window.addEventListener('message', function(e) {
16 var data = e.data || {};
17
18 if (data.type !== 'setHeight' || !iframes[data.id]) {
19 return;
20 }
21
22 iframes[data.id].height = data.height;
23 });
24
25 [].forEach.call(document.querySelectorAll('iframe.mastodon-embed'), function(iframe) {
26 iframe.scrolling = 'no';
27 iframe.style.overflow = 'hidden';
28
29 iframes.push(iframe);
30
31 var id = iframes.length - 1;
32
33 iframe.onload = function() {
34 iframe.contentWindow.postMessage({
35 type: 'setHeight',
36 id: id,
37 }, '*');
38 };
39
40 iframe.onload();
41 });
42 });
43 })();
This page took 0.062211 seconds and 4 git commands to generate.