README.md in embeditor-rails-1.0.1 vs README.md in embeditor-rails-1.1.0
- old
+ new
@@ -13,14 +13,17 @@
```
## Dependencies
-Currently, [`underscore.js`](http://underscorejs.org/) is a required dependency.
-I hope to remove this dependency eventually.
+The following dependencies must be included manually. I hope to remove these
+eventually.
+* [jQuery](http://jquery.com/)
+* [underscore.js](http://underscorejs.org/)
+
## Usage
**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.
@@ -132,12 +135,17 @@
#### 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 `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
an adapter which doesn't use a query, it's for configuring the embed properties.
For the most part, everything will be pretty consistent.
@@ -152,10 +160,13 @@
}
},
FireTracker: {
query: {
maxheight: 350
+ },
+ display: {
+ placement: 'replaceWith'
}
},
CoverItLive: {
query: {
maxheight: 500
@@ -185,10 +196,13 @@
```coffeescript
class Embeditor.Adapters.Twitter extends Embeditor.Adapter
@QueryDefaults =
maxheight: 500
+ @DisplayDefaults =
+ placement: 'before'
+
# ...
```
### Embedly
@@ -220,11 +234,16 @@
are able to render the embed properly just based off of the provided URL.
This eliminates any oEmbed headaches (Access-Control-Allowed-Origin, for
example), and also reduces the time it takes for an embed to load.
+## CKEditor plugin
+An unofficial CKEditor plugin can be found [HERE](https://github.com/SCPR/SCPRv4/blob/master/vendor/assets/javascripts/ckeditor/plugins/embed-placeholder/plugin.js).
+Copy and paste it into your own repository.
+
+
## Extending
You can/should add your own adapters! It's easy, I promise. If you add one
which you think could be useful to a lot of people, please submit a PR and
share the wealth!
@@ -234,9 +253,11 @@
* `Embeditor.Adapter`, which is the base adapter.
* `Embeditor.Adapters.Oembed`, for oEmbed endpoints.
* `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.