0.01
No commit activity in last 3 years
No release in over 3 years
A mountable Phrasing adapter for editing images inline.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.10.0
~> 4.0.0rc5
~> 4.2.1
 Project Readme

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.