• Stars
    star
    1,689
  • Rank 27,630 (Top 0.6 %)
  • Language
    JavaScript
  • License
    Other
  • Created almost 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A modern, simple and elegant WYSIWYG rich text editor.

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

More Repositories

1

webimage

A simple command line program that uses webkit to render a preview image from a web page. A live demo that has been wrapped with a web interface can be found here: http://previewtool.raphaelcruzeiro.com/
C++
76
star
2

PdfAnnotator-for-iPad

This was my first ever iOS project when I knew almost nothing about iOS. Check the demo: http://www.youtube.com/watch?v=CLTF6Rw8k_o
Objective-C
51
star
3

Face-Detector

A Python face detector module written in C with OpenCV. (Includes a sample Django project to show how to bring face detection to your web apps)
Python
22
star
4

Django-autodeploy

Fabfile for automatic installation and deployment of Django applications
Python
14
star
5

nginx-monitoring-tool

A simple tool for monitoring Python and Php applications running on a Linux machine using Nginx as its server
Python
7
star
6

OpenCV-webcam-face-detection

C
4
star
7

rarkiller

A simple tool to remove all rar files from the specified directory and it's subdirectories
Python
2
star
8

lisbonstartups

An interactive map of the Lisbon startup scene.
Python
2
star
9

InfiniteScroll

A simple AngularJS directive for infinite scrolling.
JavaScript
2
star
10

SwiftyBadgeButton

A simple, fully tested, 100% Swift badge button.
Ruby
2
star
11

macos-screenlocker

A proof of concept screen locking app for Mac OS X
Objective-C
2
star
12

webimage-live-demo-site

The live demo site for the webimage tool
Python
1
star
13

Diagnostic-tools

A tool and daemon for reporting diagnostics on Linux servers
C
1
star
14

SublimeSettings

1
star
15

coding_exercises

These are some of the examples and exercises that I use whenever I teach someone to code ;)
Python
1
star