ritz078 / embed-js

🌻 A lightweight plugin to embed emojis, media, maps, tweets, code and more. ✨
https://codesandbox.io/s/Wp5OlNMn
MIT License
1.27k stars 88 forks source link

new update: missing options? #14

Closed ghost closed 9 years ago

ghost commented 9 years ago

In the previous versios there where some other options, in the latest they are gone.. Did i miss something?

              codepenEmbed      :true,
              codepenHeight     :300,
              jsfiddleEmbed     :true,
              jsfiddleHeight    :300,
              jsbinEmbed        :true,
              jsbinHeight       :300,
              ideoneEmbed       :true,
              ideoneHeight      :300,
              plunkerEmbed      :true,
              plunkerHeight     :300,

              twitchtvEmbed     :true,
              dotsubEmbed       :true,
              dailymotionEmbed  :true,
              vineEmbed        : true,

              tedEmbed         :true,
              liveleakEmbed     :true,
ritz078 commented 9 years ago

Yes this method of taking options was not nice as with every added service this would have got longer. To make the use simple ,I just removed all those options and introduced a new options format instead of all the above

//An array of services excluded from embedding...
//Options:codePen/jdFiddle/jsBin/ideone/plunker/soundcloud/twitchTv/dotSub/dailymotion/vine/ted/liveleak/spotify
 //Can exclude all options by setting it to 'all'
excludeEmbed     :['twitchTv'],
//Height of jsfiddle/codepen/jsbin/ideone/plunker
codeEmbedHeight  :300,

I guess its easy to understand about how this works. Now I can add any new service without making the options documentation longer. Just add the service in the array which you want to exclude.

If you want to exclude all

excludeEmbed:'all'

If you want to exclude jsfiddle and ideone

excludeEmbed:['jsFiddle','ideone']

By default all the services are embedded

codeEmbedHeight automatically sets the height of codepen,jsfiddle,jsbin,ideone and plunker.

If there's any problem in understanding , do comment and I will be happy to help.

ghost commented 9 years ago

Thanx for the information, it's clear now :)