README.md in embeditor-rails-1.1.1 vs README.md in embeditor-rails-2.0.0.beta

- old
+ new

@@ -26,13 +26,15 @@ **Note** Currently Embeditor (the JS library) exists only in this Rails plugin. Eventually it will be extracted to a pure-JS library and this gem will be a simple wrapper around it. -First, add `embeditor` to your `application.js` manifest file: +First, add `embeditor` and dependencies to your `application.js` manifest file: ```javascript +//= require jquery +//= require underscore //= require embeditor ``` Next, initialize `Embeditor.Base` on any page where you want the swapping to occur, and call its `swap()` function to perform the swapping: @@ -135,13 +137,10 @@ #### Adapter-specific configuration When initializing the global `Embeditor.Base` object, you may specify configuration for individual adapters. -The `plugin` object is for configuring the adapter. The properties depends on -the adapter. - The `display` object is for configuring display options. Properties: * `placement` - the method to use for placing the embed, such as `before`, `after`, or `replace`. Default is `after`. The `query` object is for configuring the query parameters, or in the case of @@ -152,13 +151,10 @@ ```javascript new Embeditor.Base({ Embedly: { query: { maxheight: 450 - }, - plugin: { - key: '12345' } }, FireTracker: { query: { maxheight: 350 @@ -185,10 +181,26 @@ maxheight: 450, maxwidth: 200 }) ``` +There are also some Embeditor options you can configure: + +* `defaultAdapter` - Adapter that gets used when the service isn't recognized. + default: `Embedly` +* `defaultServer` - Service that gets used when the `data-service` attribute is + missing. default: `other` +* `placeholderClass` - The class that the embed placeholders are given. + default: `embed-placeholder` +* `wrapperClass` - The class the embed's wrapper is given. + default: `embed-wrapper` +* `wrapperElement` - The element which should be wrapped around all embeds. + default: `div` +* `defaultPlacement` - Default embed placement, if a placement is somehow + missing or it doesn't exist in the PlacementFunctions object. default: `after` + + #### Adapter-specific defaults Finally, if you're writing an adapter, you should specify a `QueryDefaults` object on the adapter, which will be used as a fallback for that adapter's parameters: @@ -205,24 +217,19 @@ ``` ### Embedly -If you're using the Embedly adapter, you need two things: +Embedly requires an API key. +You can provide it in the `query` options for the Embedly adapter when +initializing `Embeditor.Base`: -1. [embedly-jquery](https://github.com/embedly/embedly-jquery). This is a jquery - adapter for the embedly API. Really all you need is a jquery plugin which - adds the `embedly()` function, but the `embedly-jquery` library does a nice - job. -2. Embedly requires a key. You can provide it while initializing - `Embeditor.Base`: - ```javascript new Embeditor.Base({ Embedly: { - plugin: { - key: '12345' + query: { + key: 'YOUR_API_KEY' } } }) ``` @@ -255,9 +262,10 @@ * `Embeditor.Adapters.StaticTemplate`, for embeds where the embed code is stored in the `/templates` directory and rendered with JST. **NOTE** Any function beginning with an underscore, like `_extractData()`, should be considered a private function. + ## Known Issues * Cover It Live and Facebook embeds don't currently work together on the same page, due to a javascript conflict between the two.