Skip to content

Commit

Permalink
Merge branch 'develop' into limit-filereader-size
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerwins committed Nov 16, 2014
2 parents 99cd96e + 60e9280 commit 4f907b7
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 144 deletions.
63 changes: 63 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
### Change Log

#### v0.6 2014-11-XX
* Plugin system

#### v0.5.9 2014-09-21
* Dom Editing: insert(Un)OrderedList, indent/outdent
* History in a line.

#### v0.5.8 2014-08-31
* Remove `autoFormatRange` option
* Fixed `onChange` issues

#### v0.5.7 ~ v0.5.4 2014-08-29 ~ 2014-08-23
* Dom editing: insertPara, insertNode

#### v0.5.3 2014-07-25
* Extract codemirror.autoFormatOnStart option
* Bug patch (createLink)

#### v0.5.2 2014-07-20
* Air Mode
* And bug patch (scroll, createLink, ...)

#### v0.5.1 2014-03-16
* Support 15 Languages(https://github.com/HackerWins/summernote/tree/master/lang)
* Add local-server for develop summernote.
* Font style: Font-Family
* And Bug patch.

#### v0.5 2013-12-29
* Support both Font-Awesome 3.x and 4.x
* CodeMirror as Codeview
* Insert Video (by cdownie)
* Support 5 Languages(by hendrismit, tschiela, inomies, cverond)
* Restructuring: jQuery build pattern

#### v0.4 2013-11-01
* Support both Bootstrap 3.0 and 2.x
* Fullscreen
* Codeview
* Image Upload callback

#### v0.3 2013-09-01
* Bugs(image upload, fontsize, tab, recent color, ...)
* Help dialog(keyboard shortcut)
* Init options(event callbacks, custom toolbar)
* Resize bar
* Support IE8 Beta(some range bugs, can't insert Image)

#### v0.2, 2013-08-01
* Undo/Redo
* Image sizing handle and popover
* Support standalone css
* Support Multiple Editor
* Remove jQuery.curstyles dependency

#### v0.1, 2013-07-01
* Font style: size, color, bold, italic, underline, remove font style
* Para style: bullet, align, outdent, indent, line height
* Image: drag & drop, dialog
* Link: popover and dialog
* Table: create table with dimension picker
119 changes: 26 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# Summernote
Super Simple WYSIWYG Editor on Bootstrap(3.0 and 2.x).
Super simple WYSIWYG Editor using Bootstrap (3.0 and 2.x).

[![Build Status](https://secure.travis-ci.org/HackerWins/summernote.png)](http://travis-ci.org/HackerWins/summernote)

### Summernote
Summernote is a javascript program that helps you to create WYSIWYG Editor on web.
Summernote is a JavaScript library that helps you create WYSIWYG editors online.

Home Page: http://hackerwins.github.io/summernote/

### Why Summernote?

Summernote has something specials no like others.
Summernote has a few special features:

* Paste images from clipboard
* Saves images directly in the content of the field using base64 encoding, so you don't need to implement image handling at all
* Simple UI
* Interative WYSIWYG editing
* Interactive WYSIWYG editing
* Handy integration with server

#### Inspired by
* Gmail WYSIWYG Editor (http://www.gmail.com)
* Gmail's WYSIWYG editor (http://www.gmail.com)
* Redactor (http://imperavi.com/redactor/)

### Easy to install
### Installation and dependencies

Summernote uses opensouce libraries(jQuery, bootstrap, fontAwesome)
Summernote uses opensouce libraries: [jQuery](http://jquery.com/), [Bootstrap](http://getbootstrap.com), [Font Awesome](https://github.com/FortAwesome/Font-Awesome).

#### 01. include js/css
#### 1. include JS/CSS

Include Following code into `<head>` tag of your HTML:
Include the following code in the `<head>` tag of your HTML:

```html
<!-- include libraries(jQuery, bootstrap, fontawesome) -->
Expand All @@ -39,15 +42,13 @@ Include Following code into `<head>` tag of your HTML:
<script src="summernote.min.js"></script>
```

If your summernote download is placed in a different folder, don't forget to change file's paths.

#### 02. target elements
#### 2. target elements
And place `div` tag to somewhere in the `body` tag. This element will be placed by the visual representation of the summernote.
```html
<div id="summernote">Hello Summernote</div>
```

#### 03. summernote
#### 3. summernote
Finally, run script after document ready.
```javascript
$(document).ready(function() {
Expand All @@ -56,99 +57,31 @@ $(document).ready(function() {
```

### API
Get HTML `code` if you need.
Get the HTML `code` if you need it:

```javascript
var sHTML = $('#summernote').code();
```

`Destroy` summernote.
`Destroy` summernote:

```javascript
$('#summernote').destroy();
```

#### Dependencies
* jQuery: http://jquery.com/
* Bootstrap: http://getbootstrap.com (both 2.x and 3.x)
* fontAwesome: https://github.com/FortAwesome/Font-Awesome (both 3.x and 4.x)
### Supported platforms

### Supported platform
* Modern Browser (Safari, Chrome, Firefox, Opera, Internet Explorer 9+)
* OS (Windows, Mac, Linux)
Any modern browser: Safari, Chrome, Firefox, Opera, Internet Explorer 9+.

### Upcoming Features
* Responsive Toolbar
* Table: Handles(Sizing, Selection) and Popover
* support IE8
* Clipboard
* Media Object Selection

### Change Log

#### v0.6 2014-11-XX
* Plugin system

#### v0.5.9 2014-09-21
* Dom Editing: insert(Un)OrderedList, indent/outdent
* History in a line.

#### v0.5.8 2014-08-31
* Remove `autoFormatRange` option
* Fixed `onChange` issues

#### v0.5.7 ~ v0.5.4 2014-08-29 ~ 2014-08-23
* Dom editing: insertPara, insertNode

#### v0.5.3 2014-07-25
* Extract codemirror.autoFormatOnStart option
* Bug patch (createLink)

#### v0.5.2 2014-07-20
* Air Mode
* And bug patch (scroll, createLink, ...)

#### v0.5.1 2014-03-16
* Support 15 Languages(https://github.com/HackerWins/summernote/tree/master/lang)
* Add local-server for develop summernote.
* Font style: Font-Family
* And Bug patch.

#### v0.5 2013-12-29
* Support both Font-Awesome 3.x and 4.x
* CodeMirror as Codeview
* Insert Video (by cdownie)
* Support 5 Languages(by hendrismit, tschiela, inomies, cverond)
* Restructuring: jQuery build pattern

#### v0.4 2013-11-01
* Support both Bootstrap 3.0 and 2.x
* Fullscreen
* Codeview
* Image Upload callback

#### v0.3 2013-09-01
* Bugs(image upload, fontsize, tab, recent color, ...)
* Help dialog(keyboard shortcut)
* Init options(event callbacks, custom toolbar)
* Resize bar
* Support IE8 Beta(some range bugs, can't insert Image)

#### v0.2, 2013-08-01
* Undo/Redo
* Image sizing handle and popover
* Support standalone css
* Support Multiple Editor
* Remove jQuery.curstyles dependency

#### v0.1, 2013-07-01
* Font style: size, color, bold, italic, underline, remove font style
* Para style: bullet, align, outdent, indent, line height
* Image: drag & drop, dialog
* Link: popover and dialog
* Table: create table with dimension picker

### for Hacker
* Responsive toolbar
* Table: Handles (sizing, selection) and popover
* IE8 Support
* Clipboard (you can paste images already)
* Media object selection


### Developer information

#### structure of summernote.js

Expand Down
48 changes: 27 additions & 21 deletions dist/summernote.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright 2013-2014 Alan Hong. and other contributors
* summernote may be freely distributed under the MIT license./
*
* Date: 2014-11-07T15:21Z
* Date: 2014-11-16T04:26Z
*/
(function (factory) {
/* global define */
Expand Down Expand Up @@ -2067,7 +2067,8 @@
shapeCircle: 'Shape: Circle',
shapeThumbnail: 'Shape: Thumbnail',
shapeNone: 'Shape: None',
dragImageHere: 'Drag an image here',
dragImageHere: 'Drag image here',
dropImage: 'Drop image',
selectFromFiles: 'Select from files',
url: 'Image URL',
remove: 'Remove Image'
Expand Down Expand Up @@ -4058,7 +4059,7 @@
layoutInfo.editor.addClass('dragover');
$dropzone.width(layoutInfo.editor.width());
$dropzone.height(layoutInfo.editor.height());
$dropzoneMessage.text('Drag Image Here');
$dropzoneMessage.text(layoutInfo.langInfo.image.dragImageHere);
}
collection = collection.add(e.target);
}).on('dragleave', function (e) {
Expand All @@ -4074,10 +4075,10 @@
// change dropzone's message on hover.
$dropzone.on('dragenter', function () {
$dropzone.addClass('hover');
$dropzoneMessage.text('Drop Image');
$dropzoneMessage.text(layoutInfo.langInfo.image.dropImage);
}).on('dragleave', function () {
$dropzone.removeClass('hover');
$dropzoneMessage.text('Drag Image Here');
$dropzoneMessage.text(layoutInfo.langInfo.image.dragImageHere);
});

// attach dropImage
Expand Down Expand Up @@ -4943,11 +4944,10 @@
*
* @param {jQuery} $holder
* @param {Object} options
* @param {Object} langInfo
*/
this.createLayoutByAirMode = function ($holder, options) {
this.createLayoutByAirMode = function ($holder, options, langInfo) {
var keyMap = options.keyMap[agent.isMac ? 'mac' : 'pc'];
var langInfo = $.extend($.summernote.lang['en-US'], $.summernote.lang[options.lang]);

var id = func.uniqueId();

$holder.addClass('note-air-editor note-editable');
Expand Down Expand Up @@ -4987,8 +4987,9 @@
*
* @param {jQuery} $holder
* @param {Object} options
* @param {Object} langInfo
*/
this.createLayoutByFrame = function ($holder, options) {
this.createLayoutByFrame = function ($holder, options, langInfo) {
//01. create Editor
var $editor = $('<div class="note-editor"></div>');
if (options.width) {
Expand Down Expand Up @@ -5016,8 +5017,6 @@
//031. create codable
$('<textarea class="note-codable"></textarea>').prependTo($editor);

var langInfo = $.extend($.summernote.lang['en-US'], $.summernote.lang[options.lang]);

//04. create Toolbar
var toolbarHTML = '';
for (var idx = 0, len = options.toolbar.length; idx < len; idx ++) {
Expand Down Expand Up @@ -5078,16 +5077,17 @@
*
* @param {jQuery} $holder
* @param {Object} options
* @param {Object} langInfo
*/
this.createLayout = function ($holder, options) {
this.createLayout = function ($holder, options, langInfo) {
if (this.noteEditorFromHolder($holder).length) {
return;
}

if (options.airMode) {
this.createLayoutByAirMode($holder, options);
this.createLayoutByAirMode($holder, options, langInfo);
} else {
this.createLayoutByFrame($holder, options);
this.createLayoutByFrame($holder, options, langInfo);
}
};

Expand Down Expand Up @@ -5224,13 +5224,18 @@
// extend default options
options = $.extend({}, $.summernote.options, options);

this.each(function (idx, elHolder) {
var $holder = $(elHolder);
this.each(function (idx, holder) {
var $holder = $(holder);

// Setup language info with en-US as default
var langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);

// createLayout with options
renderer.createLayout($holder, options);
renderer.createLayout($holder, options, langInfo);

var info = renderer.layoutInfoFromHolder($holder);
// Include langInfo in general info for later use, e.g. for image drag-n-drop
info.langInfo = langInfo;
eventHandler.attach(info, options);

// Textarea: auto filling the code before form submit.
Expand Down Expand Up @@ -5285,8 +5290,8 @@
}

// set the HTML contents of note
this.each(function (i, elHolder) {
var info = renderer.layoutInfoFromHolder($(elHolder));
this.each(function (i, holder) {
var info = renderer.layoutInfoFromHolder($(holder));
if (info && info.editable) { info.editable.html(sHTML); }
});

Expand All @@ -5295,11 +5300,12 @@

/**
* destroy Editor Layout and detach Key and Mouse Event
*
* @returns {this}
*/
destroy: function () {
this.each(function (idx, elHolder) {
var $holder = $(elHolder);
this.each(function (idx, holder) {
var $holder = $(holder);

var info = renderer.layoutInfoFromHolder($holder);
if (!info || !info.editable) { return; }
Expand Down
4 changes: 2 additions & 2 deletions dist/summernote.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4f907b7

Please sign in to comment.