11let Base = require ( '../base.es6' ) ;
22
33class Gist extends Base {
4- constructor ( input , output , options , embeds ) {
5- super ( input , output , options , embeds ) ;
4+ constructor ( input , output , options , embeds ) {
5+ super ( input , output , options , embeds ) ;
66 this . regex = / g i s t .g i t h u b .c o m \/ [ a - z A - Z 0 - 9 _ - ] + \/ ( [ a - z A - Z 0 - 9 ] + ) / g;
7- this . service = 'gist' ;
7+ this . service = 'gist' ;
88
99 this . options . element . addEventListener ( 'rendered' , ( ) => {
1010 this . load ( )
@@ -17,23 +17,22 @@ class Gist extends Base {
1717
1818 load ( ) {
1919 let gists = this . options . element . getElementsByClassName ( 'ejs-gist' ) ;
20- for ( var i = 0 ; i < gists . length ; i ++ ) {
21- var gistFrame = document . createElement ( "iframe" ) ;
20+ for ( let i = 0 ; i < gists . length ; i ++ ) {
21+ let gistFrame = document . createElement ( "iframe" ) ;
2222 gistFrame . setAttribute ( "width" , "100%" ) ;
2323 gistFrame . id = `ejs-gist-${ i } ` ;
2424
25- var zone = gists [ i ] ;
25+ let zone = gists [ i ] ;
2626 zone . innerHTML = "" ;
2727 zone . appendChild ( gistFrame ) ;
2828
2929 // Create the iframe's document
3030 let url = gists [ i ] . getAttribute ( 'data-src' )
31- url = url . indexOf ( 'http' ) === - 1 ? `https://${ url } ` : url
32- var gistFrameHTML =
33- `<html><base target="_parent"/><body onload="parent.document.getElementById('ejs-gist-${ i } ').style.height=parseInt(document.body.scrollHeight)+20+'px'"><script type="text/javascript" src="${ url } .js"></script></body></html>` ;
31+ url = url . indexOf ( 'http' ) === - 1 ? `https://${ url } ` : url
32+ let gistFrameHTML = `<html><base target="_parent"/><body onload="parent.document.getElementById('ejs-gist-${ i } ').style.height=parseInt(document.body.scrollHeight)+20+'px'"><script type="text/javascript" src="${ url } .js"></script></body></html>` ;
3433
3534 // Set iframe's document with a trigger for this document to adjust the height
36- var gistFrameDoc = gistFrame . document ;
35+ let gistFrameDoc = gistFrame . document ;
3736
3837 if ( gistFrame . contentDocument ) {
3938 gistFrameDoc = gistFrame . contentDocument ;
0 commit comments