Code Monkey home page Code Monkey logo

jquery-notebook's Introduction

jQuery-Notebook

A simple, clean and elegant WYSIWYG rich text editor for web aplications
Note: Check out the fully functional demo and examples here.

Usage

Prerequisites: jQuery-Notebook's default styling FontAwesome draw the icons on the context bubble. You can install both FontAwesome and jQuery-Notebook through bower with the following command:

bower install jquery-notebook font-awesome

Alternatively, you can download FontAwesome here or link to the CDN.

Add the FontAwesome css and jQuery-Notebook css to you page head:
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="src/js/jquery.notebook.css">
Add jquery and jquery-notebook.js to your page:
<script type="text/javascript" src="src/js/libs/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="src/js/jquery.notebook.js"></script>
Create the editor:
<div class="my-editor"></div>
$(document).ready(function(){
    $('.my-editor').notebook();
});

That's it!

Available Commands

  • Ctrl/Command B - Bold
  • Ctrl/Command I - Italic
  • Ctrl/Command U - Underline
  • Ctrl/Command F1 - Header 1
  • Ctrl/Command F2 - Header 2
  • Ctrl/Command Z - Undo

Options

These are the supported options and their default values:

$.fn.notebook.defaults = {
    autoFocus: false,
    placeholder: 'Your text here...',
    mode: 'multiline', // multiline or inline
    modifiers: ['bold', 'italic', 'underline', 'h1', 'h2', 'ol', 'ul', 'anchor']
};

Events

  • contentChange: Fires every time the editor's content is modified:
// Using jQuery:
$('.my-editor').on('contentChange', function(e) {
    var content = e.originalEvent.detail.content;
});

// OR using the event directly:
var editorDomElement = $('.my-editor').get(0);
editorDomElement.addEventListener('contentChange', function(e) {
    var content = e.detail.content;
});

Contributing

We use Github Issues to do basically everything on this project, from feature request to bug tracking. There are a few issues marked as easy picking. These issues are ideally suited for someone who wants to start contributing as they are fairly simple.

To contribute to this project just fork the repository, create a branch with a descriptive but brief name and send a pull request when ready. There is no need to squash your commits before sending a pull request. After a few accepted and merged pull requests you can request push rights to the repository if you want to.

Please use 4 spaces for indentation. Any pull requests that has any JavaScript code with a different indentation will be rejected.

Contributors

raphaelcruzeiro
otaviosoares
slahn
TrevorHinesley
cbartlett
penman

jquery-notebook's People

Contributors

alyssais avatar andrewcrocker avatar cabaret avatar cbartlett avatar jrkolsby avatar otaviosoares avatar raphaelcruzeiro avatar slahn avatar trevorhinesley avatar zraly avatar

Watchers

 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.