Swap to EasyMDE

Various other fixes too
This commit is contained in:
2022-01-20 11:31:23 +00:00
parent b04a168f01
commit fc817fa9b5
9 changed files with 95 additions and 45 deletions

View File

@@ -1,7 +1,3 @@
marked.setOptions({
breaks: true,
})
function setupItemTable(items_json) {
objectitems = JSON.parse(items_json)
$.each(objectitems, function (key, val) {
@@ -37,7 +33,8 @@ function updatePrices() {
}
function setupMDE(selector) {
editor = new SimpleMDE({
editor = new EasyMDE({
autoDownloadFontAwesome: false,
element: $(selector)[0],
forceSync: true,
toolbar: ["bold", "italic", "strikethrough", "|", "unordered-list", "ordered-list", "|", "link", "|", "preview", "guide"],
@@ -120,7 +117,7 @@ $('body').on('submit', '#item-form', function (e) {
// update the table
$row = $('#item-' + pk);
$row.find('.name').html(escapeHtml(fields.name));
$row.find('.description').html(marked(fields.description));
$row.find('.description').html(fields.description);
$row.find('.cost').html(parseFloat(fields.cost).toFixed(2));
$row.find('.quantity').html(fields.quantity);

View File

@@ -123,7 +123,7 @@
color: $gray-100;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
@@ -145,7 +145,7 @@
.editor-toolbar > a.active {
background: $info !important;
}
.cm-s-paper {
.cm-s-easymde {
color: white;
background-color: $darktheme;
border-color: #bbb;