Giter Club home page Giter Club logo

meteor-autoform-summernote's Introduction

Summernote for AutoForm

Add WYSIWYG editor to your Meteor app.

Usage

  1. Install meteor add chroma:autoform-summernote

  2. Install dependencies:

you can use any version of bootstrap, or summernote you like here are some examples:

meteor add twbs:bootstrap meteor add fortawesome:fontawesome meteor add chroma:summernote

  1. Create schema
var BookSchema = new SimpleSchema({
  title: {
    type: String,
    label: "Title",
    max: 200
  },
  content: {
    type: String,
    label: "Yet another poem",
    autoform: {
      afFieldInput: {
        type: 'summernote',
        class: 'editor', // optional
        settings: // summernote options goes here (minHeight: and height: are useful)
        // if you want to use cfs instead of base64 inlining your images
        imageCollection='attachedImages'
        // if using s3 provide at least a bucket, and maybe a subfolder
        s3bucket='bucket name'
        s3subfolder='offering'
      }
    }
  }
});
  1. Attach schema to your collection Books.attachSchema(BookSchema)

  2. Generate the form with {{> quickform}} or {{#autoform}}

{{> quickForm collection="Books" type="insert"}}
  1. Remember to sanitize the HTML on the server! Summernote doesn't do that, and even if it did, the client could always send HTML containing <script> tags.

Summernote options

See all available summernote options here.

Summernote callbacks

See all available summernote calbacks here.

Version history

  • 5.0.2 - S3 support
  • 5.0.0 - Initial publish for autoform 5.

Notes

the summernote project is here: https://github.com/summernote/summernote

this package uses code based on greenewolf's reactive summernote solution here: summernote/summernote#1064

Contributing

yes, please.


ChromaPDX

meteor-autoform-summernote's People

Watchers

James Cloos avatar Leif Shackelford avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.