https://github.com/smashingboxes/cardboard_redactor
https://github.com/smashingboxes/cardboard_redactor
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/smashingboxes/cardboard_redactor
- Owner: smashingboxes
- License: other
- Created: 2014-02-12T21:06:33.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-05-12T19:53:41.000Z (almost 11 years ago)
- Last Synced: 2025-01-03T18:12:37.993Z (over 1 year ago)
- Language: JavaScript
- Size: 380 KB
- Stars: 0
- Watchers: 11
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cardboard Redactor
Add redactor to your cardboard project
*Note:* You need to purchase your own license from redactor at http://imperavi.com/redactor/download/
## Intallation Instructions
Add to your gemfile
```
gem 'cardboard_cms', github: 'smashingboxes/cardboard'
gem 'cardboard_redactor', github: 'smashingboxes/cardboard_redactor'
```
### Assets
Then to your `cardboard.js`
```javascript
//= require cardboard/redactor
//= require cardboard/redactor/highlight
window.init_redactor = function(){
var csrf_token = $('meta[name=csrf-token]').attr('content');
var csrf_param = $('meta[name=csrf-param]').attr('content');
var params;
if (csrf_param !== undefined && csrf_token !== undefined) {
params = csrf_param + "=" + encodeURIComponent(csrf_token);
}
$('.redactor').redactor({
plugins: ['fullscreen']
// // Uncomment as need be (these routes are created for you)
// imageUpload: "/cardboard/redactor/image?" + params
// imageGetJson: '/cardboard/redactor/images'
// fileUpload: '/cardboard/redactor/file?' + params
});
}
$(document).ready( window.init_redactor );
$(window).bind('page:change', window.init_redactor);
```
### Migrations
If you are using image or file upload you'll need to run the following
```
rake cardboard_redactor:install:migrations
rake db:migrate
```
copyright of SmashingBoxes.