rails html5,GitHub - zohararad/wysihtml5n-rails: Wysihtml5-Enhanced bundled as a gem for Rails asset...

Wysihtml5n-rails

This gem is a rails plugin that vendorizes the WysiHTML5-Enhanced Rich-Text editor for use with Rails asset pipeline.

You can learn more about WysiHTML5-Enhanced on Github

Installation

gem install wysihtml5n-rails

Usage

In your application.css (or any other Sprokets-enabled CSS file) add:

//= require wysihtml5n

Alternatively, if you're using SASS you can import wysihtml5n modules individually:

@import'wysihtml5n/bootstrap';

@import'wysihtml5n/editor';

@import'wysihtml5n/font-awesome';

In your application.js (or any other Sprockets-enabled Javascript file) add:

//= require wysihtml5n

Or include the editor modules individually:

//= require wysihtml5n/jcrop

//= require wysihtml5n/wysihtml5-0.3.0

//= require wysihtml5n/wysihtml5-enhanced

Finally, initialize the editor:

$('.wysiwyg').wysiHTML5N();

You can pass options to editor

# use only some editor tools

$('.wysiwyg').wysiHTML5N({toolbar: ['h1', 'h2', 'h3', 'p', 'bold', 'italic']})

Font Awesome 3 vs 4

By default gem uses Font Awesome 3 ().

To initialize editor with Font Awesome 4 icon style () :

$('.wysiwyg').wysiHTML5N({icon_style: 'font_awesome_4'})

Dependencies

Wysihtml5n-rails depends on:

jQuery

Rails 3.1+

SASS

The Twitter Bootstrap CSS file that's bundled with Wysihtml5n-rails only contains styles for forms and buttons. If you're already using Twitter Bootstrap in your application there's no need to require it again.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值