|
1 | 1 | /* |
2 | | - * embed-js - v2.0.1 |
| 2 | + * embed-js - v2.0.2 |
3 | 3 | * A jQuery plugin for converting text emojis into image-based emoticons, also supporting an automatic media embedding system for multimedia URLs |
4 | 4 | * |
5 | 5 | * |
|
142 | 142 | lang : 'en' //Request returned HTML and a rendered Tweet in the specified |
143 | 143 | // (https://dev.twitter.com/web/overview/languages) |
144 | 144 | }, |
145 | | - codepenEmbed : true, |
146 | | - codepenHeight : 300, |
147 | | - jsfiddleEmbed : true, |
148 | | - jsfiddleHeight : 300, |
149 | | - jsbinEmbed : true, |
150 | | - jsbinHeight : 300, |
151 | | - ideoneEmbed : true, |
152 | | - ideoneHeight : 300, |
153 | | - plunkerEmbed : true, |
154 | | - plunkerHeight : 300, |
155 | | - spotifyEmbed : true, |
156 | | - soundCloudEmbed : true, |
| 145 | + excludeEmbed :['twitchTv'], |
| 146 | + codeEmbedHeight :300, |
157 | 147 | soundCloudOptions: { |
158 | 148 | height : 160, themeColor: 'f50000', //Hex Code of the player theme color |
159 | 149 | autoPlay : false, |
|
164 | 154 | visual : false, //Show/hide the big preview image |
165 | 155 | download : false //Show/Hide download buttons |
166 | 156 | }, |
167 | | - twitchtvEmbed : true, |
168 | | - dotsubEmbed : true, |
169 | | - dailymotionEmbed : true, |
170 | | - vineEmbed : true, |
171 | 157 | vineOptions : { |
172 | 158 | width: 500, |
173 | 159 | type : 'postcard' //'postcard' or 'simple' embedding |
174 | 160 | }, |
175 | | - tedEmbed : true, |
176 | | - liveleakEmbed : true, |
177 | 161 | beforePdfPreview : function () { //callback before pdf preview |
178 | 162 | }, |
179 | 163 | afterPdfPreview : function () { //callback after pdf preview |
|
697 | 681 | if (matches) { |
698 | 682 | var i = 0; |
699 | 683 | while (i < matches.length) { |
700 | | - str = str + '<div class="ejs-embed ejs-codepen"><iframe scrolling="no" height="' + opts.codepenHeight + '" src="' + matches[i].replace(/\/pen\//, '/embed/') + '/?height=' + opts.codepenHeight + '" frameborder="no" allowtransparency="true" allowfullscreen="true"></iframe></div>'; |
| 684 | + str = str + '<div class="ejs-embed ejs-codepen"><iframe scrolling="no" height="' + opts.codeEmbedHeight + '" src="' + matches[i].replace(/\/pen\//, '/embed/') + '/?height=' + opts.codepenHeight + '" frameborder="no" allowtransparency="true" allowfullscreen="true"></iframe></div>'; |
701 | 685 | i++; |
702 | 686 | } |
703 | 687 | } |
|
710 | 694 | if (matches) { |
711 | 695 | var i = 0; |
712 | 696 | while (i < matches.length) { |
713 | | - str = str + '<div class="ejs-embed ejs-jsfiddle"><iframe height="' + opts.jsfiddleHeight + '" src="http://' + matches[i] + '/embedded"></iframe></div>'; |
| 697 | + str = str + '<div class="ejs-embed ejs-jsfiddle"><iframe height="' + opts.codeEmbedHeight + '" src="http://' + matches[i] + '/embedded"></iframe></div>'; |
714 | 698 | i++; |
715 | 699 | } |
716 | 700 | } |
|
723 | 707 | if (matches) { |
724 | 708 | var i = 0; |
725 | 709 | while (i < matches.length) { |
726 | | - str = str + '<div class="ejs-jsbin ejs-embed"><iframe height="' + opts.jsbinHeight + '" class="jsbin-embed foo" src="http://' + matches[i] + '/embed?html,js,output">Simple Animation Tests</iframe></div>'; |
| 710 | + str = str + '<div class="ejs-jsbin ejs-embed"><iframe height="' + opts.codeEmbedHeight + '" class="jsbin-embed foo" src="http://' + matches[i] + '/embed?html,js,output">Simple Animation Tests</iframe></div>'; |
727 | 711 | i++; |
728 | 712 | } |
729 | 713 | } |
|
736 | 720 | if (matches) { |
737 | 721 | var i = 0; |
738 | 722 | while (i < matches.length) { |
739 | | - console.log(matches[i]); |
740 | | - str = str + '<div class="ejs-ideone ejs-embed"><iframe src="http://ideone.com/embed/' + matches[i].split('/')[1] + '" frameborder="0" height="' + opts.ideoneHeight + '"></iframe></div>'; |
| 723 | + str = str + '<div class="ejs-ideone ejs-embed"><iframe src="http://ideone.com/embed/' + matches[i].split('/')[1] + '" frameborder="0" height="' + opts.codeEmbedHeight + '"></iframe></div>'; |
741 | 724 | i++; |
742 | 725 | } |
743 | 726 | } |
|
751 | 734 | var i = 0; |
752 | 735 | while (i < matches.length) { |
753 | 736 | var idMatch = (matches[i].indexOf('?') === -1) ? (matches[i].split('/')[2]) : (matches[i].split('/')[2].split('?')[0]); |
754 | | - str = str + '<div class="ejs-embed ejs-plunker"><iframe class="ne-plunker" src="http://embed.plnkr.co/' + idMatch + '" height="' + opts.plunkerHeight + '"></iframe></div>'; |
| 737 | + str = str + '<div class="ejs-embed ejs-plunker"><iframe class="ne-plunker" src="http://embed.plnkr.co/' + idMatch + '" height="' + opts.codeEmbedHeight + '"></iframe></div>'; |
755 | 738 | i++; |
756 | 739 | } |
757 | 740 | } |
|
788 | 771 |
|
789 | 772 | var rawInput = input; |
790 | 773 |
|
| 774 | + var ifEmbed = function(serviceName){ |
| 775 | + return ($.inArray(serviceName,settings.excludeEmbed)==-1); |
| 776 | + }; |
| 777 | + |
| 778 | + |
791 | 779 | input = (settings.link) ? urlEmbed(input) : input; |
792 | 780 | input = emoticonProcess.insertfontSmiley(input); |
793 | 781 | input = emoticonProcess.insertEmoji(input); |
|
796 | 784 | input = (settings.highlightCode) ? codeProcess.highlight(input) : input; |
797 | 785 | input = (settings.basicVideoEmbed) ? videoProcess.embedBasic(rawInput, input) : input; |
798 | 786 | input = (settings.imageEmbed) ? imageProcess.embed(rawInput, input) : input; |
799 | | - input = (settings.codepenEmbed) ? codeEmbedProcess.codepenEmbed(rawInput, input, settings) : input; |
800 | | - input = (settings.jsfiddleEmbed) ? codeEmbedProcess.jsfiddleEmbed(rawInput, input, settings) : input; |
801 | | - input = (settings.jsbinEmbed) ? codeEmbedProcess.jsbinEmbed(rawInput, input, settings) : input; |
802 | | - input = (settings.ideoneEmbed) ? codeEmbedProcess.ideoneEmbed(rawInput, input, options) : input; |
803 | | - input = (settings.plunkerEmbed) ? codeEmbedProcess.plunkerEmbed(rawInput, input, options) : input; |
804 | | - input = (settings.soundCloudEmbed) ? audioProcess.soundCloudEmbed(rawInput, input, settings) : input; |
805 | | - input = (settings.twitchtvEmbed) ? videoProcess.twitchtvEmbed(rawInput, input, settings) : input; |
806 | | - input = (settings.dotsubEmbed) ? videoProcess.dotsubEmbed(rawInput, input, settings) : input; |
807 | | - input = (settings.dailymotionEmbed) ? videoProcess.dailymotionEmbed(rawInput, input, settings) : input; |
808 | | - input = (settings.vineEmbed) ? videoProcess.vineEmbed(rawInput, input, settings) : input; |
809 | | - input = (settings.tedEmbed) ? videoProcess.tedEmbed(rawInput, input, settings) : input; |
810 | | - input = (settings.liveleakEmbed) ? videoProcess.liveleakEmbed(rawInput, input, settings) : input; |
811 | | - input = (settings.spotifyEmbed) ? audioProcess.spotifyEmbed(rawInput, input, settings) : input; |
| 787 | + input = (ifEmbed('codePen')) ? codeEmbedProcess.codepenEmbed(rawInput, input, settings) : input; |
| 788 | + input = (ifEmbed('jsFiddle')) ? codeEmbedProcess.jsfiddleEmbed(rawInput, input, settings) : input; |
| 789 | + input = (ifEmbed('jsbin')) ? codeEmbedProcess.jsbinEmbed(rawInput, input, settings) : input; |
| 790 | + input = (ifEmbed('ideone')) ? codeEmbedProcess.ideoneEmbed(rawInput, input, options) : input; |
| 791 | + input = (ifEmbed('plunker')) ? codeEmbedProcess.plunkerEmbed(rawInput, input, options) : input; |
| 792 | + input = (ifEmbed('soundcloud')) ? audioProcess.soundCloudEmbed(rawInput, input, settings) : input; |
| 793 | + input = (ifEmbed('twitchTv')) ? videoProcess.twitchtvEmbed(rawInput, input, settings) : input; |
| 794 | + input = (ifEmbed('dotSub')) ? videoProcess.dotsubEmbed(rawInput, input, settings) : input; |
| 795 | + input = (ifEmbed('dailymotion')) ? videoProcess.dailymotionEmbed(rawInput, input, settings) : input; |
| 796 | + input = (ifEmbed('vine')) ? videoProcess.vineEmbed(rawInput, input, settings) : input; |
| 797 | + input = (ifEmbed('ted')) ? videoProcess.tedEmbed(rawInput, input, settings) : input; |
| 798 | + input = (ifEmbed('liveLeak')) ? videoProcess.liveleakEmbed(rawInput, input, settings) : input; |
| 799 | + input = (ifEmbed('spotify')) ? audioProcess.spotifyEmbed(rawInput, input, settings) : input; |
812 | 800 | input = (settings.locationEmbed) ? mapProcess.locationEmbed(rawInput, input, settings) : input; |
813 | 801 |
|
814 | 802 | videoProcess.embed(input, settings).then(function (d) { |
|
0 commit comments