]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/wp-embed.js
WordPress 4.7-scripts
[autoinstalls/wordpress.git] / wp-includes / js / wp-embed.js
index 660558e03b2b825e481a2be0f871783f8850ea0f..3be0dc724531bbeede20bede5650f8f13e45573a 100644 (file)
@@ -50,7 +50,7 @@
                                continue;
                        }
 
-                       source.style.display = '';
+                       source.removeAttribute( 'style' );
 
                        /* Resize the iframe on request. */
                        if ( 'height' === data.message ) {
                if ( loaded ) {
                        return;
                }
+
                loaded = true;
 
                var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ),
                        isIE11 = !!navigator.userAgent.match( /Trident.*rv:11\./ ),
                        iframes = document.querySelectorAll( 'iframe.wp-embedded-content' ),
-                       blockquotes = document.querySelectorAll( 'blockquote.wp-embedded-content' ),
                        iframeClone, i, source, secret;
 
-               for ( i = 0; i < blockquotes.length; i++ ) {
-                       blockquotes[ i ].style.display = 'none';
-               }
-
                for ( i = 0; i < iframes.length; i++ ) {
                        source = iframes[ i ];
-                       source.style.display = '';
 
-                       if ( source.getAttribute( 'data-secret' ) ) {
-                               continue;
+                       if ( ! source.getAttribute( 'data-secret' ) ) {
+                               /* Add secret to iframe */
+                               secret = Math.random().toString( 36 ).substr( 2, 10 );
+                               source.src += '#?secret=' + secret;
+                               source.setAttribute( 'data-secret', secret );
                        }
 
-                       /* Add secret to iframe */
-                       secret = Math.random().toString( 36 ).substr( 2, 10 );
-                       source.src += '#?secret=' + secret;
-                       source.setAttribute( 'data-secret', secret );
-
                        /* Remove security attribute from iframes in IE10 and IE11. */
                        if ( ( isIE10 || isIE11 ) ) {
                                iframeClone = source.cloneNode( true );