2121
2222const utils = require ( './modules/utils.es6' ) ;
2323
24- if ( build . EMOJI ) var Emoji = require ( './modules/emoticons/emoji.es6' ) ;
25- if ( build . SMILEY ) var Smiley = require ( './modules/emoticons/smiley.es6' ) ;
26- if ( build . LINK ) var Url = require ( './modules/url.es6' ) ;
24+ if ( build . EMOJI ) var Emoji = require ( './modules/emoticons/emoji.es6' ) ;
25+ if ( build . SMILEY ) var Smiley = require ( './modules/emoticons/smiley.es6' ) ;
26+ if ( build . LINK ) var Url = require ( './modules/url.es6' ) ;
2727
28- if ( build . TWITTER ) var Twitter = require ( './modules/twitter/twitter.es6' ) ;
28+ if ( build . TWITTER ) var Twitter = require ( './modules/twitter/twitter.es6' ) ;
2929
3030const Code = require ( './modules/code/code.es6' ) ;
3131const Video = require ( './modules/video/video.es6' ) ;
@@ -40,58 +40,59 @@ const helper = require('./modules/video/helper.es6');
4040 var defaultOptions = {
4141 link : true ,
4242 linkOptions : {
43- target : 'self' ,
44- exclude : [ 'pdf' ]
43+ target : 'self' ,
44+ exclude : [ 'pdf' ]
4545 } ,
46- emoji : true ,
47- customEmoji : [ ] ,
48- fontIcons : true ,
49- highlightCode : true ,
50- videoJS : false ,
46+ emoji : true ,
47+ customEmoji : [ ] ,
48+ fontIcons : true ,
49+ customFontIcons : [ ] ,
50+ highlightCode : true ,
51+ videoJS : false ,
5152 videojsOptions : {
52- fluid : true ,
53- preload : 'metadata'
53+ fluid : true ,
54+ preload : 'metadata'
5455 } ,
5556 tweetsEmbed : true ,
5657 tweetOptions : {
57- maxWidth : 550 ,
58- hideMedia : false ,
59- hideThread : false ,
60- align : 'none' ,
61- lang : 'en'
58+ maxWidth : 550 ,
59+ hideMedia : false ,
60+ hideThread : false ,
61+ align : 'none' ,
62+ lang : 'en'
6263 } ,
63- imageEmbed : true ,
64- videoEmbed : true ,
65- videoHeight : null ,
66- videoWidth : null ,
67- videoDetails : true ,
68- audioEmbed : true ,
69- excludeEmbed : [ ] ,
70- codeEmbedHeight : 500 ,
64+ imageEmbed : true ,
65+ videoEmbed : true ,
66+ videoHeight : null ,
67+ videoWidth : null ,
68+ videoDetails : true ,
69+ audioEmbed : true ,
70+ excludeEmbed : [ ] ,
71+ codeEmbedHeight : 500 ,
7172 vineOptions : {
72- maxWidth : null ,
73- type : 'postcard' , //'postcard' or 'simple' embedding
74- responsive : true ,
75- width : 350 ,
76- height : 460
73+ maxWidth : null ,
74+ type : 'postcard' , //'postcard' or 'simple' embedding
75+ responsive : true ,
76+ width : 350 ,
77+ height : 460
7778 } ,
78- googleAuthKey : 'AIzaSyCqFouT8h5DKAbxlrTZmjXEmNBjC69f0ts ' ,
79+ googleAuthKey : '' ,
7980 soundCloudOptions : {
80- height : 160 ,
81- themeColor : 'f50000' , //Hex Code of the player theme color
82- autoPlay : false ,
83- hideRelated : false ,
84- showComments : true ,
85- showUser : true ,
86- showReposts : false ,
87- visual : false , //Show/hide the big preview image
88- download : false //Show/Hide download buttons
81+ height : 160 ,
82+ themeColor : 'f50000' , //Hex Code of the player theme color
83+ autoPlay : false ,
84+ hideRelated : false ,
85+ showComments : true ,
86+ showUser : true ,
87+ showReposts : false ,
88+ visual : false , //Show/hide the big preview image
89+ download : false //Show/Hide download buttons
8990 } ,
90- beforeEmbedJSApply : function ( ) { } ,
91- afterEmbedJSApply : function ( ) { } ,
92- onVideoShow : function ( ) { } ,
93- onTweetsLoad : function ( ) { } ,
94- videojsCallback : function ( ) { }
91+ beforeEmbedJSApply : function ( ) { } ,
92+ afterEmbedJSApply : function ( ) { } ,
93+ onVideoShow : function ( ) { } ,
94+ onTweetsLoad : function ( ) { } ,
95+ videojsCallback : function ( ) { }
9596 } ;
9697
9798 class EmbedJS {
@@ -117,9 +118,9 @@ const helper = require('./modules/video/helper.es6');
117118
118119 this . options . beforeEmbedJSApply ( ) ;
119120
120- let output = options . link && build . LINK ? ( new Url ( input , options ) . process ( ) ) : output ;
121- output = options . emoji && build . EMOJI ? ( new Emoji ( output , options ) . process ( ) ) : output ;
122- output = options . fontIcons && build . SMILEY ? ( new Smiley ( output , options ) . process ( ) ) : output ;
121+ let output = options . link && build . LINK ? ( new Url ( input , options ) . process ( ) ) : output ;
122+ output = options . emoji && build . EMOJI ? ( new Emoji ( output , options ) . process ( ) ) : output ;
123+ output = options . fontIcons && build . SMILEY ? ( new Smiley ( output , options ) . process ( ) ) : output ;
123124 [ output , embeds ] = ( new Code ( input , output , options , embeds ) . process ( ) ) ;
124125 [ output , embeds ] = await ( new Video ( input , output , options , embeds ) . process ( ) ) ;
125126
@@ -148,15 +149,8 @@ const helper = require('./modules/video/helper.es6');
148149 let result = await this . process ( ) ;
149150 this . options . element . innerHTML = result ;
150151
151- if ( twttr && build . TWITTER ) {
152- //Load twitter data with styling
153- twttr . widgets . load ( this . options . element ) ;
154-
155- //Execute the function after the widget is loaded
156- twttr . events . bind ( 'loaded' , ( ) => {
157- this . options . onTweetsLoad ( ) ;
158- } ) ;
159- }
152+ let event = new Event ( 'rendered' ) ;
153+ this . options . element . dispatchEvent ( event ) ;
160154
161155 helper . applyVideoJS ( this . options ) ;
162156
0 commit comments