|
19 | 19 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
20 | 20 | //SOFTWARE. |
21 | 21 |
|
22 | | -import utils from './modules/utils.es6'; |
23 | | -import Emoji from './modules/emoticons/emoji.es6'; |
24 | | -import Smiley from './modules/emoticons/smiley.es6'; |
25 | | -import Url from './modules/url.es6'; |
26 | | -import CodeEmbed from './modules/code/codeEmbed.es6'; |
| 22 | +import utils from './modules/utils.es6'; |
| 23 | +import Emoji from './modules/emoticons/emoji.es6'; |
| 24 | +import Smiley from './modules/emoticons/smiley.es6'; |
| 25 | +import Url from './modules/url.es6'; |
| 26 | +import CodeEmbed from './modules/code/codeEmbed.es6'; |
27 | 27 | import VideoEmbed from './modules/video/videoEmbed.es6'; |
28 | | -import Twitter from './modules/twitter.es6'; |
| 28 | +import Twitter from './modules/twitter.es6'; |
29 | 29 |
|
30 | 30 | (function() { |
31 | 31 |
|
32 | 32 | var defaultOptions = { |
33 | | - link: true, |
34 | | - linkOptions: { |
35 | | - target: 'self', |
36 | | - exclude: ['pdf'] |
| 33 | + link : true, |
| 34 | + linkOptions : { |
| 35 | + target : 'self', |
| 36 | + exclude : ['pdf'] |
37 | 37 | }, |
38 | | - emoji: true, |
39 | | - fontIcons: true, |
40 | | - highlightCode: true, |
41 | | - tweetsEmbed: true, |
42 | | - tweetOptions: { |
43 | | - maxWidth: 550, |
44 | | - hideMedia: false, |
45 | | - hideThread: false, |
46 | | - align: 'none', |
47 | | - lang: 'en' |
| 38 | + emoji : true, |
| 39 | + fontIcons : true, |
| 40 | + highlightCode : true, |
| 41 | + tweetsEmbed : true, |
| 42 | + tweetOptions : { |
| 43 | + maxWidth : 550, |
| 44 | + hideMedia : false, |
| 45 | + hideThread : false, |
| 46 | + align : 'none', |
| 47 | + lang : 'en' |
48 | 48 | }, |
49 | | - excludeEmbed: [], |
50 | | - codeEmbedHeight: 500, |
51 | | - videoHeight: null, |
52 | | - videoWidth: null, |
53 | | - vineOptions: { |
54 | | - maxWidth: null, |
55 | | - type: 'postcard', //'postcard' or 'simple' embedding |
56 | | - responsive: true, |
57 | | - width : 350, |
58 | | - height : 460 |
| 49 | + excludeEmbed : [], |
| 50 | + codeEmbedHeight : 500, |
| 51 | + videoHeight : null, |
| 52 | + videoWidth : null, |
| 53 | + vineOptions : { |
| 54 | + maxWidth : null, |
| 55 | + type : 'postcard', //'postcard' or 'simple' embedding |
| 56 | + responsive : true, |
| 57 | + width : 350, |
| 58 | + height : 460 |
59 | 59 | }, |
60 | | - googleAuthKey:'AIzaSyCqFouT8h5DKAbxlrTZmjXEmNBjC69f0ts' |
| 60 | + googleAuthKey : 'AIzaSyCqFouT8h5DKAbxlrTZmjXEmNBjC69f0ts' |
61 | 61 | }; |
62 | 62 |
|
63 | 63 | class EmbedJS { |
64 | 64 | constructor(options) { |
65 | 65 | this.options = utils.deepExtend(defaultOptions, options); |
66 | 66 | this.element = this.options.element; |
67 | | - this.input = this.element.innerHTML; |
| 67 | + this.input = this.element.innerHTML; |
68 | 68 | this.process(); |
69 | 69 | } |
70 | 70 |
|
71 | 71 | async process() { |
72 | | - let input = this.input; |
73 | | - let options = this.options; |
74 | | - let embeds = []; |
75 | | - let output = options.link ? await (new Url(input, options).process()) : output; |
76 | | - output = options.emoji ? await (new Emoji(output, options).process()) : output; |
77 | | - output = options.fontIcons ? await (new Smiley(output, options).process()) : output; |
| 72 | + let input = this.input; |
| 73 | + let options = this.options; |
| 74 | + let embeds = []; |
| 75 | + let output = options.link ? await (new Url(input, options).process()) : output; |
| 76 | + output = options.emoji ? await (new Emoji(output, options).process()) : output; |
| 77 | + output = options.fontIcons ? await (new Smiley(output, options).process()) : output; |
78 | 78 | [output, embeds] = await (new CodeEmbed(input, output, options, embeds).process()); |
79 | 79 | [output, embeds] = await (new VideoEmbed(input, output, options, embeds).process()); |
80 | 80 |
|
|
0 commit comments