forked from basecamp/wysihat
-
Notifications
You must be signed in to change notification settings - Fork 13
/
wysihat.js
53 lines (43 loc) · 1.29 KB
/
wysihat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* WysiHat - WYSIWYG JavaScript framework, version 0.2.1
* (c) 2008-2010 Joshua Peek
* JQ-WysiHat - jQuery port of WysiHat to run on jQuery
* (c) 2010 Scott Williams
*
* WysiHat is freely distributable under the terms of an MIT-style license.
*--------------------------------------------------------------------------*/
(function ($, window, undefined)
{
/**
* == wysihat ==
**/
/** section: wysihat
* WysiHat
**/
var WysiHat = {};
//= require "wysihat/editor"
//= require "wysihat/features"
//= require "wysihat/commands"
//= require "wysihat/dom/ierange"
//= require "wysihat/dom/range"
//= require "wysihat/dom/selection"
//= require "wysihat/dom/bookmark"
//= require "wysihat/element/sanitize_contents"
//= require "wysihat/events/field_change"
//= require "wysihat/events/frame_loaded"
//= require "wysihat/events/selection_change"
//= require "wysihat/formatting"
//= require "wysihat/toolbar"
// Set wysihat as a jQuery plugin
$.fn.wysihat = function(options) {
options = $.extend({
buttons: WysiHat.Toolbar.ButtonSets.Standard
}, options);
return this.each(function() {
var editor = WysiHat.Editor.attach($(this));
var toolbar = new WysiHat.Toolbar(editor);
toolbar.initialize(editor);
toolbar.addButtonSet(options);
});
};
window.WysiHat = WysiHat;
}(jQuery, this));