Customized menu
This commit is contained in:
parent
8fd66c7673
commit
a347637a8e
1 changed files with 31 additions and 9 deletions
|
|
@ -24,23 +24,45 @@
|
|||
<div id="bubble-container"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="quill.min.js"></script>
|
||||
|
||||
<form><input type="hidden" name="md" id="md" />
|
||||
<input id="btnSubmit" type="submit" value="Valider" class="ql-hidden"/></form>
|
||||
<script type="text/javascript" src="quill.min.js"></script>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="showdown.js"></script>
|
||||
<script type="text/javascript" src="to-markdown.js"></script>
|
||||
<script type="text/javascript" src="md-helpers.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var quill = new Quill('#bubble-container', {
|
||||
placeholder: 'Compose an epic...',
|
||||
<script type="text/javascript">
|
||||
var toolbarOptions = [
|
||||
['bold', 'italic', 'underline', 'strike'], // toggled buttons
|
||||
['blockquote', 'code-block'],
|
||||
|
||||
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
||||
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
||||
|
||||
['clean'] // remove formatting button
|
||||
];
|
||||
|
||||
var quill = new Quill('#bubble-container', {
|
||||
modules: {
|
||||
toolbar: toolbarOptions
|
||||
},
|
||||
placeholder: 'Composez votre texte ...',
|
||||
theme: 'bubble'
|
||||
});
|
||||
|
||||
function GetMD() {
|
||||
return $("<div>"+markdownize($('#bubble-container div.ql-editor').html())+"</div>").text()
|
||||
function getMD() {
|
||||
return markdownize($('#bubble-container div.ql-editor').html())
|
||||
}
|
||||
</script>
|
||||
quill.on('text-change', function (delta, oldDelta, source)
|
||||
{
|
||||
if (source === "user") {
|
||||
$('#md').val(getMD());
|
||||
$('#btnSubmit').removeClass('ql-hidden');
|
||||
};
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue