| 1 | $( function () { |
| 2 | var $videos = $( '.ext-YouTube-video--lazy' ); |
| 3 | |
| 4 | $videos.on( 'click', function () { |
| 5 | var $elm = $( this ), |
| 6 | $conts = $elm.contents(), |
| 7 | le = $conts.length, |
| 8 | ifr = null, |
| 9 | i; |
| 10 | |
| 11 | $elm.removeClass( 'ext-YouTube-video--lazy' ); |
| 12 | |
| 13 | for ( i = 0; i < le; i++ ) { |
| 14 | if ( $conts[ i ].nodeType === 8 ) { |
| 15 | ifr = $conts[ i ].textContent; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | $elm.addClass( 'player' ).html( ifr ); |
| 20 | $elm.off( 'click' ); |
| 21 | } ); |
| 22 | } ); |