abhinavmathur / quilljs-rails Goto Github PK
View Code? Open in Web Editor NEWEasy integration of Quill rich editor with most Rails forms.
Home Page: http://quilljs.com
License: MIT License
Easy integration of Quill rich editor with most Rails forms.
Home Page: http://quilljs.com
License: MIT License
I'm using Cocoon to create a nested form. Cocoon offers the following method when the div is added to the DOM:
cocoon:after-insert
How might I initialise Quill on a textarea in the dynamic nested form?
My ruby code consists of the following:
<%= form_for :reply, url: comment_path(post_id: @post.id) do |f| %> <%= f.hidden_field :reply_to, value: comment.id.to_s %> <%= f.text_field :body, autofocus: true, class: 'quill_container' %> <%= f.submit "Post" %> <% end %>
First of all, the autofocus doesn't work, although that's a minor issue.
The bigger issue is that the text is not sent sometimes. Specifically, if I type something in and press "Post" without clicking out of the text box first, it doesn't send it. If I type something long, it will send the first part of what I type. However, if I click out of the text box and then click Post, it works every time.
Is this a known issue, or am I doing something wrong?
https://quilljs.com/docs/api/#events
For example:
quill.on('text-change', function() {
console.log('Text change!');
});
I would also need this to work for multiple quill editors on a single page.
Can you give more details about how to customize the default settings?
I'm installing quilljs-rails using the gem. I want to add the link and image to the toolbar. (I omitted the rest of toolbar code for this demo.) I tried to set the defaults application.js
//= require jquery
//= require quill.min
//= require quill.global
//= require turbolinks
//= require_tree .
var defaults = {
theme: 'snow',
modules: {
toolbar: [
['link', 'image']
]
}
};
Quilljs.setDefaults(defaults)
show.html.erb
<%= f.input :description, input_html: { class: 'quill_container' } %>
I end up with two editors for the description field.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.