components/jquery.hotkeys/index.js
components/_mod/bootstrap-wysiwyg/bootstrap-wysiwyg.js
$('#my-editor').ace_wysiwyg();
wysiwyg
options to send to the pluginspeech_button
whether to add speech input button in Chrometoolbar
an array of toolbar buttons and optionstoolbar_place
optional toolbar placement function$('#my-editor').ace_wysiwyg({ toolbar: { 'bold', 'italic', null, { name: 'font', title: 'Custom tooltip', values: ['Some Font!', 'Arial', 'Verdana', 'Comic Sans MS', 'Custom Font!'] } } });
title
which is button's tooltip texticon
which is button's iconclassName
which is button's class namenull
value puts a separator(space) between buttons.
font
which takes an array as font names:
{ name: 'font', title: 'optional custom tooltip', icon: 'fa-leaf', //some custom icon values: ['Some Font!', 'Arial', 'Verdana', 'Comic Sans MS', 'Custom Font!'] }
fontSize
which takes an array as font sizes:
{ name: 'fontSize', title: 'optional custom tooltip', values:{1 : 'Size#1' , 2 : 'Size#2' , 3 : 'Size#3' , 4 : 'Size#4' , 5 : 'Size#5'} }
bold
:
'bold', //or { name: 'bold', title: 'optional custom tooltip', icon: 'fa-leaf' //some custom icon }
italic
strikethrough
underline
insertunorderedlist
insertorderedlist
outdent
indent
justifyleft
justifycenter
justifyright
justifyfull
createLink
which inserts a link:
{ name: 'createLink', title: 'optional custom tooltip', placeholder: 'link input placeholder', button_class: 'btn-purple',//insert button's class button_text: 'Add Link'//insert button's text }
unlink
insertImage
which inserts an image:
{ name: 'createLink', title: 'optional custom tooltip', placeholder: 'image url input placeholder', button_insert_class: 'btn-purple',//insert button's class button_insert: 'Add Link',//insert button's text choose_file: true,//'Whether there should be a "Choose File" button button_class: 'btn-success',//choose button's class button_text: 'Choose an Image'//choose button's text }
foreColor
and backColor
which have a list of color values:
{ name: 'foreColor', title: 'optional custom tooltip', values: ['red', 'blue', '#FF7721'] }
undo
redo
viewSource
examples/wysiwyg.html
toolbar_place
you can put the toolbar somewhere else:
$('#editor2').css({'height':'200px'}).ace_wysiwyg({ toolbar_place: function(toolbar) { //for example put the toolbar inside '.widget-header' return $(this).closest('.widget-box') .find('.widget-header').prepend(toolbar) .find('.wysiwyg-toolbar').addClass('inline'); } });It should return the new toolbar
.wysiwyg-style1
and .wysiwyg-style2
to toolbar for alternative styles:
$('#editor2').ace_wysiwyg().prev().addClass('wysiwyg-style2');
$('#myform').on('submit', function() { var hidden_input = $('<input type="hidden" name="my-html-content" />') .appendTo('#myform'); var html_content = $('#myeditor').html(); hidden_input.val( html_content ); //put the editor's HTML into hidden_input and it will be sent to server });
mustache/app/views/assets/scripts/wysiwyg.js
enableImageResize
function inside it
components/markdown/lib/markdown.js
and
components/bootstrap-markdown/js/bootstrap-markdown.js
data-provide="markdown"
attribute for the textarea element,
markdown editor will automatically be initiated.