/**
Bootstrap wysihtml5 editor.
To use it you should **manually** include required js and css files.
You can download these files from https://github.com/jhollingworth/bootstrap-wysihtml5
@class wysihtml5
@extends abstractinput
@final
@since 1.4.0
@example
awesome
comment!
**/
(function ($) {
var Wysihtml5 = function (options) {
this.init('wysihtml5', options, Wysihtml5.defaults);
//extend wysihtml5 manually as $.extend not recursive
this.options.wysihtml5 = $.extend({}, Wysihtml5.defaults.wysihtml5, options.wysihtml5);
};
$.fn.editableutils.inherit(Wysihtml5, $.fn.editabletypes.abstractinput);
$.extend(Wysihtml5.prototype, {
render: function () {
var deferred = $.Deferred();
//generate unique id as it required for wysihtml5
this.$input.attr('id', 'textarea_'+(new Date()).getTime());
this.setClass();
this.setAttr('rows');
this.setAttr('placeholder');
//resolve deffered when widget loaded
$.extend(this.options.wysihtml5, {
events: {
load: function() {
deferred.resolve();
}
}
});
this.$input.wysihtml5(this.options.wysihtml5);
/*
In IE8 wysihtml5 iframe stays on the same line with buttons toolbar (inside popover).
Not pretty but working solution is to add . If you fine better way, please send PR.
*/
if($.browser.msie && parseInt($.browser.version, 10) <= 8) {
this.$input.before('
awesome
comment!