You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
691 B
JavaScript
28 lines
691 B
JavaScript
2 years ago
|
(function() {
|
||
|
window.spec = {
|
||
|
generateSimditor: function(opts) {
|
||
|
var $textarea;
|
||
|
if (opts == null) {
|
||
|
opts = {};
|
||
|
}
|
||
|
opts.content || (opts.content = '');
|
||
|
opts.toolbar || (opts.toolbar = false);
|
||
|
$textarea = $('<textarea id="editor"></textarea>').val(opts.content).appendTo('body');
|
||
|
return new Simditor({
|
||
|
textarea: $textarea,
|
||
|
toolbar: opts.toolbar
|
||
|
});
|
||
|
},
|
||
|
destroySimditor: function() {
|
||
|
var $textarea, editor;
|
||
|
$textarea = $('#editor');
|
||
|
editor = $textarea.data('simditor');
|
||
|
if (editor != null) {
|
||
|
editor.destroy();
|
||
|
}
|
||
|
return $textarea.remove();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
}).call(this);
|