Skip to content

Phrasing extension for editing images inline

License

Notifications You must be signed in to change notification settings

dkNorth/phrasing_plus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhrasingPlus

PhrasingPlus is a Phrasing extension image inline editing. PhrasingPlus has a hard dependency on Phrasing version 4.0.0rc5, so please go through it's Readme before installing PhrasingPlus. PhrasingPlus is still in Experimental Alpha.

Build Status Code Climate

Installation

Add to Gemfile

gem 'phrasing_plus'

Copy migrations

 rails g phrasing_plus

Run migrations

rake db:migrate

Include the required javascript file:

//= require phrasing_plus

Include the required stylesheet file:

*= require phrasing_plus

Usage

PhrasingPlus can change images in two ways - simple image tags and background images.

Just use it's helpers:

Image tag (wrapper inside a span)

phrasing_image_tag(key, options = {})

The options are used to modify attributes of the image tag such as CSS classes, IDs and similar. To add some attributes to the wrapping span, just pass a wrapper_html key.

Example usage:

phrasing_image_tag('my-image', wrapper_html: { class: 'my-image-wrapper' }, size: '160x160')

Div with modifiable background image

phrasing_background_image_tag(key, options = {}, &block)

The background image tag can be a div (by default) or a span. Pass in options to modify attributes and pass in a block of content that will be rendered inside the div.

Example usage:

<% = phrasing_background_image_tag('my-placeholder', tag: :span) do %>
  <p> Hello, this inside my div with a changable background image </p> 
<% end %>

Uploading files to S3

By default, PhrasingPlus will store data to your local filesystem. If you want to store them on let's say S3, do the following:

  1. Add 'fog' gem to your Gemfile
  2. Create an initializer and add PhrasingPlus.storage = :fog
  3. Configure Carrierwave to work with s3. Follow this link for Carrierwave 0.10.0 (or switch tag version if you're using another version of Carrierwave).

This project rocks and uses MIT-LICENSE.

About

Phrasing extension for editing images inline

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 65.5%
  • JavaScript 13.3%
  • HTML 11.2%
  • SCSS 5.1%
  • Haml 3.1%
  • CSS 1.8%