Merge pull request #178 from ADefWebserver/RichTextEditor

Rich text editor
This commit is contained in:
Shaun Walker
2019-12-04 13:49:03 -05:00
committed by GitHub
9 changed files with 318 additions and 17 deletions

View File

@ -10,6 +10,8 @@
<meta name="viewport" content="width=device-width">
<title>Oqtane</title>
<base href="~/" />
<link href="//cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<link href="//cdn.quilljs.com/1.3.6/quill.bubble.css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="css/app.css" rel="stylesheet" />
</head>
@ -19,6 +21,7 @@
<script src="js/site.js"></script>
<script src="js/interop.js"></script>
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

View File

@ -1,5 +1,5 @@
{
"ConnectionStrings": {
"DefaultConnection": ""
"DefaultConnection": "Data Source=(Local);Initial Catalog=Oqtane;Integrated Security=SSPI;"
}
}

View File

@ -69,7 +69,7 @@ window.interop = {
for (var i = 0; i < fileinput.files.length; i++) {
files.push(fileinput.files[i].name);
}
}
}
return files;
},
uploadFiles: function (posturl, folder, name) {
@ -127,5 +127,36 @@ window.interop = {
request.send(data);
}
}
},
createQuill: function (
editorElement, toolBar, readOnly,
placeholder, theme, debugLevel) {
var options = {
debug: debugLevel,
modules: {
toolbar: toolBar
},
placeholder: placeholder,
readOnly: readOnly,
theme: theme
};
new Quill(editorElement, options);
},
getQuillContent: function (editorElement) {
return JSON.stringify(editorElement.__quill.getContents());
},
getQuillText: function (editorElement) {
return editorElement.__quill.getText();
},
getQuillHTML: function (editorElement) {
return editorElement.__quill.root.innerHTML;
},
loadQuillContent: function (editorElement, editorContent) {
return editorElement.__quill.root.innerHTML = editorContent;
},
enableQuillEditor: function (editorElement, mode) {
editorElement.__quill.enable(mode);
}
};