|
|
|
@ -6,6 +6,8 @@ $(function () { |
|
|
|
var $slug = $('#ViewModel_Slug'); |
|
|
|
var $buttonSubmit = $('#button-page-create'); |
|
|
|
|
|
|
|
initAllEditors(); |
|
|
|
|
|
|
|
var widgetModal = new abp.ModalManager({ viewUrl: abp.appPath + "CmsKit/Contents/AddWidgetModal", modalClass: "addWidgetModal" }); |
|
|
|
|
|
|
|
var scriptEditor = CodeMirror.fromTextArea(document.getElementById("ViewModel_Script"), { |
|
|
|
@ -89,21 +91,20 @@ $(function () { |
|
|
|
var fileUploadUri = "/api/cms-kit-admin/media/page"; |
|
|
|
var fileUriPrefix = "/api/cms-kit/media/"; |
|
|
|
|
|
|
|
initAllEditors(); |
|
|
|
|
|
|
|
function initAllEditors() { |
|
|
|
$('.content-editor').each(function (i, item) { |
|
|
|
initEditor(item); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
var editor; |
|
|
|
function initEditor(element) { |
|
|
|
var $editorContainer = $(element); |
|
|
|
var inputName = $editorContainer.data('input-id'); |
|
|
|
var $editorInput = $('#' + inputName); |
|
|
|
var initialValue = $editorInput.val(); |
|
|
|
|
|
|
|
var editor = new toastui.Editor({ |
|
|
|
editor = new toastui.Editor({ |
|
|
|
el: $editorContainer[0], |
|
|
|
usageStatistics: false, |
|
|
|
useCommandShortcut: true, |
|
|
|
@ -139,6 +140,10 @@ $(function () { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//$('.ProseMirror').on('click', function (e) {
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
function uploadFile(blob, callback, source) { |
|
|
|
var UPPY_OPTIONS = { |
|
|
|
endpoint: fileUploadUri, |
|
|
|
@ -171,6 +176,11 @@ $(function () { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
$('#GeneratedWidgetText').click(function (e) { |
|
|
|
var txt = $('#GeneratedWidgetText').val(); |
|
|
|
editor.insertText(txt); |
|
|
|
}); |
|
|
|
|
|
|
|
function createAddWidgetButton() { |
|
|
|
//TODO add auth
|
|
|
|
const button = document.createElement('button'); |
|
|
|
|